mirror of
https://gitgud.io/Ed86/rjw-std.git
synced 2024-08-14 23:57:23 +00:00
39 lines
903 B
C#
39 lines
903 B
C#
|
using Verse;
|
|||
|
using HarmonyLib;
|
|||
|
using rjw;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace STD
|
|||
|
{
|
|||
|
///<summary>
|
|||
|
///roll for STD with unprotected rjw sex
|
|||
|
///</summary>
|
|||
|
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
|
|||
|
[StaticConstructorOnStartup]
|
|||
|
static class Aftersex_STD_Apply
|
|||
|
{
|
|||
|
[HarmonyPrefix]
|
|||
|
private static void Aftersex_STD_Patch(SexProps props)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
//TODO: add/test a roll_to_catch_from_corpse to std
|
|||
|
if (!props.usedCondom)
|
|||
|
if (!props.pawn.Dead && !props.partner.Dead)
|
|||
|
{
|
|||
|
//TODO: animal env probably always dirty, so skip, maybe add/test someday human-animal transfer
|
|||
|
if (!(xxx.is_animal(props.pawn) || xxx.is_animal(props.partner)))
|
|||
|
{
|
|||
|
std_spreader.roll_to_catch(props, props.pawn, props.partner);
|
|||
|
std_spreader.roll_to_catch(props, props.partner, props.pawn);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
Log.Error(e.ToString());
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|