rjw-std/1.3/Source/STD/harmony_add_stds.cs
Ed86 bc8368af15 split off rjw stds in separate mod for rjw 5.0+
split stds into separate xml/cs files
2022-05-26 14:37:23 +03:00

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