rjw-std/1.3/Source/STD/harmony_add_stds.cs

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());
}
}
}
}