mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
vasectomy patch
This commit is contained in:
parent
9ae622bb7f
commit
0e53cdb03d
2 changed files with 18 additions and 1 deletions
Binary file not shown.
|
@ -15,6 +15,7 @@ namespace RJW_BGS
|
||||||
[HarmonyPatch(typeof(PregnancyHelper))]
|
[HarmonyPatch(typeof(PregnancyHelper))]
|
||||||
public class PatchPregnancyHelper
|
public class PatchPregnancyHelper
|
||||||
{
|
{
|
||||||
|
public static HediffDef vasectomydef = DefDatabase<HediffDef>.GetNamed("Vasectomy", true);
|
||||||
// Token: 0x0600000F RID: 15
|
// Token: 0x0600000F RID: 15
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch("impregnate")]
|
[HarmonyPatch("impregnate")]
|
||||||
|
@ -31,6 +32,11 @@ namespace RJW_BGS
|
||||||
|
|
||||||
Pawn giver = props.pawn; // orgasmer
|
Pawn giver = props.pawn; // orgasmer
|
||||||
Pawn receiver = props.partner;
|
Pawn receiver = props.partner;
|
||||||
|
Hediff vasectomy;
|
||||||
|
receiver.health.hediffSet.TryGetHediff(vasectomydef, out vasectomy);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<Hediff> pawnparts = giver.GetGenitalsList();
|
List<Hediff> pawnparts = giver.GetGenitalsList();
|
||||||
List<Hediff> partnerparts = receiver.GetGenitalsList();
|
List<Hediff> partnerparts = receiver.GetGenitalsList();
|
||||||
var interaction = rjw.Modules.Interactions.Helpers.InteractionHelper.GetWithExtension(props.dictionaryKey);
|
var interaction = rjw.Modules.Interactions.Helpers.InteractionHelper.GetWithExtension(props.dictionaryKey);
|
||||||
|
@ -69,10 +75,21 @@ namespace RJW_BGS
|
||||||
if (RJWSettings.DevMode) RJW_Genes.ModLog.Message(xxx.get_pawnname(giver) + " has no parts to Fertilize with");
|
if (RJWSettings.DevMode) RJW_Genes.ModLog.Message(xxx.get_pawnname(giver) + " has no parts to Fertilize with");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (vasectomy != null)
|
||||||
|
{
|
||||||
|
if (RJWSettings.DevMode) RJW_Genes.ModLog.Message("vasectomy check");
|
||||||
|
receiver.health.RemoveHediff(vasectomy);
|
||||||
|
}
|
||||||
if (CanImpregnate2(giver, receiver, props.sexType))
|
if (CanImpregnate2(giver, receiver, props.sexType))
|
||||||
{
|
{
|
||||||
|
|
||||||
PregnancyHelper.DoImpregnate(giver, receiver);
|
PregnancyHelper.DoImpregnate(giver, receiver);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (vasectomy != null)
|
||||||
|
{
|
||||||
|
if (RJWSettings.DevMode) RJW_Genes.ModLog.Message("vasectomy check");
|
||||||
|
receiver.health.AddHediff(vasectomy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue