Cumflation Negator works and is a hidden Hediff

This commit is contained in:
Vegapnk 2024-06-06 15:14:02 +02:00
parent 3feefaaab1
commit 2511986557
3 changed files with 13 additions and 22 deletions

View file

@ -24,6 +24,7 @@
<li>
<label>slight</label>
<minSeverity>0.2</minSeverity>
<becomeVisible>false</becomeVisible>
<statOffsets>
<Vulnerability>-0.1</Vulnerability>
</statOffsets>
@ -37,6 +38,7 @@
<li>
<label>moderate</label>
<minSeverity>0.4</minSeverity>
<becomeVisible>false</becomeVisible>
<statOffsets>
<Vulnerability>-0.3</Vulnerability>
</statOffsets>
@ -51,6 +53,7 @@
<li>
<label>intense</label>
<minSeverity>0.65</minSeverity>
<becomeVisible>false</becomeVisible>
<statOffsets>
<Vulnerability>+0.5</Vulnerability>
</statOffsets>
@ -65,6 +68,7 @@
<li>
<label>extreme</label>
<minSeverity>0.9</minSeverity>
<becomeVisible>false</becomeVisible>
<statOffsets>
<Vulnerability>-0.7</Vulnerability>
</statOffsets>
@ -113,6 +117,7 @@
<label>bloated</label>
<minSeverity>0.2</minSeverity>
<hungerRateFactor>0.95</hungerRateFactor>
<becomeVisible>false</becomeVisible>
<statOffsets>
<Vulnerability>-0.05</Vulnerability>
</statOffsets>
@ -130,6 +135,7 @@
<statOffsets>
<Vulnerability>-0.1</Vulnerability>
</statOffsets>
<becomeVisible>false</becomeVisible>
<capMods>
<li>
<capacity>Moving</capacity>
@ -141,6 +147,7 @@
<label>stuffed</label>
<minSeverity>0.6</minSeverity>
<hungerRateFactor>0.75</hungerRateFactor>
<becomeVisible>false</becomeVisible>
<statOffsets>
<Vulnerability>-0.15</Vulnerability>
</statOffsets>
@ -156,6 +163,7 @@
<label>overstuffed</label>
<minSeverity>0.8</minSeverity>
<hungerRateFactor>0.5</hungerRateFactor>
<becomeVisible>false</becomeVisible>
<statOffsets>
<Vulnerability>-0.2</Vulnerability>
</statOffsets>

View file

@ -9,8 +9,6 @@ using HarmonyLib;
using rjw;
using RimWorld;
using Verse;
using static LicentiaLabs.Licentia;
using static HarmonyLib.Code;
namespace RJW_Genes
{
@ -43,36 +41,23 @@ namespace RJW_Genes
public static void AddOrIncreaseCumflationCounterHediff(Pawn inflated)
{
//Hediff cumstuffed_hediff = inflated.health.hediffSet.GetFirstHediffOfDef(LicentiaLabs.Licentia.HediffDefs.Cumstuffed);
Hediff cumstuffed_hediff = LicentiaLabs.CumflationHelper.GetCumflationHediff(inflated, LicentiaLabs.Licentia.HediffDefs.Cumstuffed, "stomach");
Hediff cumstuffed_hediff = inflated.health.hediffSet.GetFirstHediffOfDef(LicentiaLabs.Licentia.HediffDefs.Cumstuffed);
//Hediff cumstuffed_hediff = LicentiaLabs.CumflationHelper.GetCumflationHediff(inflated, LicentiaLabs.Licentia.HediffDefs.Cumstuffed, "stomach");
if (cumstuffed_hediff != null && cumstuffed_hediff.Severity >= 0.01) {
ModLog.Message($"{inflated} got cumstuffed and gets the counter-part");
var bodyPartRecord = inflated.RaceProps.body.AllParts.Find(bpr => bpr.def.defName.Contains("stomach") || bpr.def.defName.Contains("stomach".ToLower()));
var counter_hediff = CreateOrGetCumflationCounterHediff(inflated, HediffDefOf.rjw_genes_cumstuffed_counter, bodyPartRecord);
counter_hediff.Severity = cumstuffed_hediff.Severity;
}
else if (cumstuffed_hediff != null)
{
ModLog.Message("cumstuffed_hediff was too un-sever");
}
else
ModLog.Message("cumstuffed_hediff was null");
Hediff cumflation_hediff = inflated.health.hediffSet.GetFirstHediffOfDef(LicentiaLabs.Licentia.HediffDefs.Cumflation);
if (cumflation_hediff != null && cumflation_hediff.Severity >= 0.01)
{
ModLog.Message($"{inflated} got cumflated and gets the counter-part");
var bodyPartRecord = Genital_Helper.get_genitalsBPR(inflated);
var counter_hediff = CreateOrGetCumflationCounterHediff(inflated, HediffDefOf.rjw_genes_cumstuffed_counter, bodyPartRecord);
counter_hediff.Severity = cumstuffed_hediff.Severity;
var counter_hediff = CreateOrGetCumflationCounterHediff(inflated, HediffDefOf.rjw_genes_cumflation_counter, bodyPartRecord);
counter_hediff.Severity = cumflation_hediff.Severity;
}
else if (cumflation_hediff != null)
{
ModLog.Message("Cumflation Hediff was too un-sever");
}
else
ModLog.Message("Cumflation Hediff was null");
}
public static Hediff CreateOrGetCumflationCounterHediff(Pawn inflated, HediffDef counterCumflationDef, BodyPartRecord bodyPartRecord)
@ -83,8 +68,6 @@ namespace RJW_Genes
cumflationHediff = HediffMaker.MakeHediff(counterCumflationDef, inflated, bodyPartRecord);
cumflationHediff.Severity = 0;
inflated.health.AddHediff(cumflationHediff, bodyPartRecord);
} else {
ModLog.Message("Did not find a correct Counter-CumflationDef ");
}
return cumflationHediff;

View file

@ -66,7 +66,7 @@ namespace RJW_Genes
postfix: new HarmonyMethod(typeof(Patch_SexTicks_ChangePsyfocus), nameof(Patch_SexTicks_ChangePsyfocus.Postfix)));
// Gene: Likes Cumflation [Postfix Patch]
harmony.Patch(AccessTools.Method(typeof(LicentiaLabs.CumflationHelper), nameof(LicentiaLabs.CumflationHelper.Cumflation)),
prefix: new HarmonyMethod(typeof(Patch_LikesCumflation), nameof(Patch_LikesCumflation.PostFix)));
postfix: new HarmonyMethod(typeof(Patch_LikesCumflation), nameof(Patch_LikesCumflation.PostFix)));
}
}))();
}