mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Cumflation Negator works and is a hidden Hediff
This commit is contained in:
parent
3feefaaab1
commit
2511986557
3 changed files with 13 additions and 22 deletions
|
@ -24,6 +24,7 @@
|
||||||
<li>
|
<li>
|
||||||
<label>slight</label>
|
<label>slight</label>
|
||||||
<minSeverity>0.2</minSeverity>
|
<minSeverity>0.2</minSeverity>
|
||||||
|
<becomeVisible>false</becomeVisible>
|
||||||
<statOffsets>
|
<statOffsets>
|
||||||
<Vulnerability>-0.1</Vulnerability>
|
<Vulnerability>-0.1</Vulnerability>
|
||||||
</statOffsets>
|
</statOffsets>
|
||||||
|
@ -37,6 +38,7 @@
|
||||||
<li>
|
<li>
|
||||||
<label>moderate</label>
|
<label>moderate</label>
|
||||||
<minSeverity>0.4</minSeverity>
|
<minSeverity>0.4</minSeverity>
|
||||||
|
<becomeVisible>false</becomeVisible>
|
||||||
<statOffsets>
|
<statOffsets>
|
||||||
<Vulnerability>-0.3</Vulnerability>
|
<Vulnerability>-0.3</Vulnerability>
|
||||||
</statOffsets>
|
</statOffsets>
|
||||||
|
@ -51,6 +53,7 @@
|
||||||
<li>
|
<li>
|
||||||
<label>intense</label>
|
<label>intense</label>
|
||||||
<minSeverity>0.65</minSeverity>
|
<minSeverity>0.65</minSeverity>
|
||||||
|
<becomeVisible>false</becomeVisible>
|
||||||
<statOffsets>
|
<statOffsets>
|
||||||
<Vulnerability>+0.5</Vulnerability>
|
<Vulnerability>+0.5</Vulnerability>
|
||||||
</statOffsets>
|
</statOffsets>
|
||||||
|
@ -65,6 +68,7 @@
|
||||||
<li>
|
<li>
|
||||||
<label>extreme</label>
|
<label>extreme</label>
|
||||||
<minSeverity>0.9</minSeverity>
|
<minSeverity>0.9</minSeverity>
|
||||||
|
<becomeVisible>false</becomeVisible>
|
||||||
<statOffsets>
|
<statOffsets>
|
||||||
<Vulnerability>-0.7</Vulnerability>
|
<Vulnerability>-0.7</Vulnerability>
|
||||||
</statOffsets>
|
</statOffsets>
|
||||||
|
@ -113,6 +117,7 @@
|
||||||
<label>bloated</label>
|
<label>bloated</label>
|
||||||
<minSeverity>0.2</minSeverity>
|
<minSeverity>0.2</minSeverity>
|
||||||
<hungerRateFactor>0.95</hungerRateFactor>
|
<hungerRateFactor>0.95</hungerRateFactor>
|
||||||
|
<becomeVisible>false</becomeVisible>
|
||||||
<statOffsets>
|
<statOffsets>
|
||||||
<Vulnerability>-0.05</Vulnerability>
|
<Vulnerability>-0.05</Vulnerability>
|
||||||
</statOffsets>
|
</statOffsets>
|
||||||
|
@ -130,6 +135,7 @@
|
||||||
<statOffsets>
|
<statOffsets>
|
||||||
<Vulnerability>-0.1</Vulnerability>
|
<Vulnerability>-0.1</Vulnerability>
|
||||||
</statOffsets>
|
</statOffsets>
|
||||||
|
<becomeVisible>false</becomeVisible>
|
||||||
<capMods>
|
<capMods>
|
||||||
<li>
|
<li>
|
||||||
<capacity>Moving</capacity>
|
<capacity>Moving</capacity>
|
||||||
|
@ -141,6 +147,7 @@
|
||||||
<label>stuffed</label>
|
<label>stuffed</label>
|
||||||
<minSeverity>0.6</minSeverity>
|
<minSeverity>0.6</minSeverity>
|
||||||
<hungerRateFactor>0.75</hungerRateFactor>
|
<hungerRateFactor>0.75</hungerRateFactor>
|
||||||
|
<becomeVisible>false</becomeVisible>
|
||||||
<statOffsets>
|
<statOffsets>
|
||||||
<Vulnerability>-0.15</Vulnerability>
|
<Vulnerability>-0.15</Vulnerability>
|
||||||
</statOffsets>
|
</statOffsets>
|
||||||
|
@ -156,6 +163,7 @@
|
||||||
<label>overstuffed</label>
|
<label>overstuffed</label>
|
||||||
<minSeverity>0.8</minSeverity>
|
<minSeverity>0.8</minSeverity>
|
||||||
<hungerRateFactor>0.5</hungerRateFactor>
|
<hungerRateFactor>0.5</hungerRateFactor>
|
||||||
|
<becomeVisible>false</becomeVisible>
|
||||||
<statOffsets>
|
<statOffsets>
|
||||||
<Vulnerability>-0.2</Vulnerability>
|
<Vulnerability>-0.2</Vulnerability>
|
||||||
</statOffsets>
|
</statOffsets>
|
||||||
|
|
|
@ -9,8 +9,6 @@ using HarmonyLib;
|
||||||
using rjw;
|
using rjw;
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
using Verse;
|
using Verse;
|
||||||
using static LicentiaLabs.Licentia;
|
|
||||||
using static HarmonyLib.Code;
|
|
||||||
|
|
||||||
namespace RJW_Genes
|
namespace RJW_Genes
|
||||||
{
|
{
|
||||||
|
@ -43,36 +41,23 @@ namespace RJW_Genes
|
||||||
|
|
||||||
public static void AddOrIncreaseCumflationCounterHediff(Pawn inflated)
|
public static void AddOrIncreaseCumflationCounterHediff(Pawn inflated)
|
||||||
{
|
{
|
||||||
//Hediff cumstuffed_hediff = inflated.health.hediffSet.GetFirstHediffOfDef(LicentiaLabs.Licentia.HediffDefs.Cumstuffed);
|
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 = LicentiaLabs.CumflationHelper.GetCumflationHediff(inflated, LicentiaLabs.Licentia.HediffDefs.Cumstuffed, "stomach");
|
||||||
if (cumstuffed_hediff != null && cumstuffed_hediff.Severity >= 0.01) {
|
if (cumstuffed_hediff != null && cumstuffed_hediff.Severity >= 0.01) {
|
||||||
|
|
||||||
ModLog.Message($"{inflated} got cumstuffed and gets the counter-part");
|
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 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);
|
var counter_hediff = CreateOrGetCumflationCounterHediff(inflated, HediffDefOf.rjw_genes_cumstuffed_counter, bodyPartRecord);
|
||||||
counter_hediff.Severity = cumstuffed_hediff.Severity;
|
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);
|
Hediff cumflation_hediff = inflated.health.hediffSet.GetFirstHediffOfDef(LicentiaLabs.Licentia.HediffDefs.Cumflation);
|
||||||
if (cumflation_hediff != null && cumflation_hediff.Severity >= 0.01)
|
if (cumflation_hediff != null && cumflation_hediff.Severity >= 0.01)
|
||||||
{
|
{
|
||||||
ModLog.Message($"{inflated} got cumflated and gets the counter-part");
|
ModLog.Message($"{inflated} got cumflated and gets the counter-part");
|
||||||
var bodyPartRecord = Genital_Helper.get_genitalsBPR(inflated);
|
var bodyPartRecord = Genital_Helper.get_genitalsBPR(inflated);
|
||||||
var counter_hediff = CreateOrGetCumflationCounterHediff(inflated, HediffDefOf.rjw_genes_cumstuffed_counter, bodyPartRecord);
|
var counter_hediff = CreateOrGetCumflationCounterHediff(inflated, HediffDefOf.rjw_genes_cumflation_counter, bodyPartRecord);
|
||||||
counter_hediff.Severity = cumstuffed_hediff.Severity;
|
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)
|
public static Hediff CreateOrGetCumflationCounterHediff(Pawn inflated, HediffDef counterCumflationDef, BodyPartRecord bodyPartRecord)
|
||||||
|
@ -83,8 +68,6 @@ namespace RJW_Genes
|
||||||
cumflationHediff = HediffMaker.MakeHediff(counterCumflationDef, inflated, bodyPartRecord);
|
cumflationHediff = HediffMaker.MakeHediff(counterCumflationDef, inflated, bodyPartRecord);
|
||||||
cumflationHediff.Severity = 0;
|
cumflationHediff.Severity = 0;
|
||||||
inflated.health.AddHediff(cumflationHediff, bodyPartRecord);
|
inflated.health.AddHediff(cumflationHediff, bodyPartRecord);
|
||||||
} else {
|
|
||||||
ModLog.Message("Did not find a correct Counter-CumflationDef ");
|
|
||||||
}
|
}
|
||||||
return cumflationHediff;
|
return cumflationHediff;
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace RJW_Genes
|
||||||
postfix: new HarmonyMethod(typeof(Patch_SexTicks_ChangePsyfocus), nameof(Patch_SexTicks_ChangePsyfocus.Postfix)));
|
postfix: new HarmonyMethod(typeof(Patch_SexTicks_ChangePsyfocus), nameof(Patch_SexTicks_ChangePsyfocus.Postfix)));
|
||||||
// Gene: Likes Cumflation [Postfix Patch]
|
// Gene: Likes Cumflation [Postfix Patch]
|
||||||
harmony.Patch(AccessTools.Method(typeof(LicentiaLabs.CumflationHelper), nameof(LicentiaLabs.CumflationHelper.Cumflation)),
|
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)));
|
||||||
}
|
}
|
||||||
}))();
|
}))();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue