A fertilin alert and some label/description changes

This commit is contained in:
Shabakur 2023-01-08 15:51:07 +01:00
parent 6f2c4dc374
commit 2e1e74e0b1
15 changed files with 148 additions and 28 deletions

Binary file not shown.

View File

@ -23,7 +23,13 @@
<subNodes>
<li Class="RJW_Genes.ThinkNode_ConditionalCritcalLifeForce">
<subNodes>
<li Class="rjw.JobGiver_RandomRape" />
<!--Maybe make a custom chance per hour to determine if pawn would consider rape-->
<li Class="ThinkNode_ChancePerHour_Constant">
<mtbHours>8</mtbHours>
<subNodes>
<li Class="rjw.JobGiver_RandomRape" />
</subNodes>
</li>
<li Class="rjw.ThinkNode_ConditionalBestiality">
<subNodes>
<li Class="rjw.ThinkNode_ChancePerHour_Bestiality">

View File

@ -25,7 +25,18 @@
<stages>
<li>
<label>seduced</label>
<description>I was seduced into having sex. I regrett what happened.</description>
<description>I was seduced into having sex. I regret what happened.</description>
<baseMoodEffect>-10</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>rjw_critical_fertilin</defName>
<stages>
<li>
<label>low on fertilin</label>
<description>I'm almost out of fertilin. I'm scared of losing control.</description>
<baseMoodEffect>-10</baseMoodEffect>
</li>
</stages>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
<!-- Fertilin strings -->
<AbilityDisabledNoFertilinGene>Pawn doesn't have required fertilin gene.</AbilityDisabledNoFertilinGene>
<AbilityDisabledNoFertilin>Not enough fertilin to cast.</AbilityDisabledNoFertilin>
<AlertLowFertilin>Low fertilin</AlertLowFertilin>
<AlertLowFertilinDesc>A colonist has low fertilin. At this point they are becoming desperate enough to consider rape and bestiality to obtain fertilin (if they didn't already). At zero fertilin they will lose all sense and start raping randomly</AlertLowFertilinDesc>
</LanguageData>

View File

@ -82,10 +82,10 @@ namespace RJW_Genes
// Cosmetic
public static readonly GeneDef rjw_genes_succubus_tail;
public static readonly GeneDef rjw_genes_youth_fountain;
public static readonly GeneDef rjw_genes_sex_age_drain;
public static readonly HediffDef rjw_genes_orgasm_rush_hediff;
}
}

View File

@ -15,21 +15,31 @@ namespace RJW_Genes
return pawn.genes.HasGene(genedef);
}
public static void OffsetLifeForce(Pawn pawn, float offset, bool applyStatFactor = true)
//Split function so I can offsetlifeforce from gene without needing to look for the gene agian (for the constant drain tick)
public static Gene_LifeForce GetLifeForceGene(Pawn pawn)
{
if (!ModsConfig.BiotechActive)
{
return;
}
//if (offset > 0f && applyStatFactor)
//{
// offset *= pawn.GetStatValue(StatDefOf.HemogenGainFactor, true, -1);
//}
Pawn_GeneTracker genes2 = pawn.genes;
Gene_LifeForce gene_LifeFroce = (genes2 != null) ? genes2.GetFirstGeneOfType<Gene_LifeForce>() : null;
if (gene_LifeFroce != null)
Gene_LifeForce gene_LifeForce = (genes2 != null) ? genes2.GetFirstGeneOfType<Gene_LifeForce>() : null;
return gene_LifeForce;
}
public static void OffsetLifeForce(Gene_LifeForce gene_LifeForce, float offset, bool applyStatFactor = true)
{
if (gene_LifeForce != null)
{
gene_LifeFroce.Value += offset;
float old_value = gene_LifeForce.Value;
gene_LifeForce.Value += offset;
PostOffSetLifeForce(gene_LifeForce, old_value);
}
}
public static void PostOffSetLifeForce(Gene_LifeForce gene_LifeForce, float old_value)
{
if (old_value > 0.15f && gene_LifeForce.Resource.Value <= 0.15f)
{
Pawn pawn = gene_LifeForce.Pawn;
//Give thoughtdef
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld.Planet;
using Verse;
using RimWorld;
namespace RJW_Genes
{
public class Alert_CriticalFertilin : Alert
{
private List<GlobalTargetInfo> Targets
{
get
{
this.CalculateTargets();
return this.targets;
}
}
public override string GetLabel()
{
if (this.Targets.Count == 1)
{
return "AlertLowFertilin".Translate() + ": " + this.targetLabels[0];
}
return "AlertLowFertilin".Translate();
}
private void CalculateTargets()
{
this.targets.Clear();
this.targetLabels.Clear();
if (!ModsConfig.BiotechActive)
{
return;
}
foreach (Pawn pawn in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive)
{
if (pawn.RaceProps.Humanlike && pawn.Faction == Faction.OfPlayer)
{
Pawn_GeneTracker genes = pawn.genes;
Gene_LifeForce gene_Lifeforce = (genes != null) ? genes.GetFirstGeneOfType<Gene_LifeForce>() : null;
if (gene_Lifeforce != null && gene_Lifeforce.Value < gene_Lifeforce.MinLevelForAlert)
{
this.targets.Add(pawn);
this.targetLabels.Add(pawn.NameShortColored.Resolve());
}
}
}
}
public override TaggedString GetExplanation()
{
return "AlertLowFertilinDesc".Translate() + ":\n" + this.targetLabels.ToLineList(" - ");
}
public override AlertReport GetReport()
{
return AlertReport.CulpritsAre(this.Targets);
}
// Token: 0x04004B5C RID: 19292
private List<GlobalTargetInfo> targets = new List<GlobalTargetInfo>();
// Token: 0x04004B5D RID: 19293
private List<string> targetLabels = new List<string>();
}
}

View File

@ -39,7 +39,7 @@ namespace RJW_Genes
if (rjw.Genital_Helper.is_penis(part))
{
GeneUtility.OffsetLifeForce(this.parent.pawn, part.Severity); ;
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(this.parent.pawn), part.Severity); ;
pawn.health.RemoveHediff(part);
pawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.rjw_genes_cock_eaten, pawn, null);
break; //Only one penis at the time

View File

@ -37,7 +37,7 @@ namespace RJW_Genes
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
{
base.Apply(target, dest);
GeneUtility.OffsetLifeForce(this.parent.pawn, -this.Props.fertilinCost, true);
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(this.parent.pawn), -this.Props.fertilinCost, true);
}
// Token: 0x06005D1B RID: 23835 RVA: 0x001FA7E0 File Offset: 0x001F89E0

View File

@ -26,8 +26,8 @@ namespace RJW_Genes
Pawn pawn2 = this.parent.pawn;
if (pawn != null && pawn2 != null && !pawn.Downed)
{
Job job = JobMaker.MakeJob(JobDefOf.rjw_genes_lifeforce_seduced, pawn2);//ChooseJob(pawn, pawn2);
job.mote = MoteMaker.MakeThoughtBubble(pawn, this.parent.def.iconPath, true); //make this image of pawn or else heart
Job job = JobMaker.MakeJob(JobDefOf.rjw_genes_lifeforce_seduced, pawn2);
job.mote = MoteMaker.MakeThoughtBubble(pawn, this.parent.def.iconPath, true);
pawn.jobs.StopAll(false, true);
pawn.jobs.StartJob(job, JobCondition.InterruptForced, null, false, true, null, null, false, false, null, false, true);
}

View File

@ -43,7 +43,15 @@ namespace RJW_Genes
//base.Tick();
if (this.CanOffset && this.Resource != null)
{
this.Resource.Value -= this.ResourceLossPerDay / 60000;
if (this.CanOffset)
{
if (this.Resource == null)
{
return;
}
GeneUtility.OffsetLifeForce(this, -this.ResourceLossPerDay / 60000f);
}
//this.Resource.Value -= this.ResourceLossPerDay / 60000;
if (this.Resource.Value <= 0 && this.pawn.IsHashIntervalTick(300))
{
if (ModsConfig.BiotechActive && this.def.mentalBreakDef != null &&

View File

@ -15,7 +15,7 @@ namespace RJW_Genes
if (GeneUtility.HasLifeForce(pawn))
{
float num = ingested.stackCount * this.FertilinPerUnit / 100;
GeneUtility.OffsetLifeForce(pawn, num);
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(pawn), num);
}
}
public float FertilinPerUnit = 1f;

View File

@ -71,7 +71,7 @@ namespace RJW_Genes
if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_drainer) && !props.pawn.health.hediffSet.HasHediff(HediffDefOf.Succubus_Drained))
{
props.pawn.health.AddHediff(HediffDefOf.Succubus_Drained);
GeneUtility.OffsetLifeForce(succubus, 0.25f);
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(succubus), 0.25f);
}
}
}
@ -103,7 +103,7 @@ namespace RJW_Genes
}
//Currently taking the sum of all penises, maybe I should just consider one at random
float valuechange = CumUtility.GetTotalFluidAmount(props.pawn) / 100 * absorb_factor * multiplier;
GeneUtility.OffsetLifeForce(props.partner, valuechange);
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(props.partner), valuechange);
//gene.Resource.Value += CumUtility.GetTotalFluidAmount(props.pawn) / 100 * absorb_factor * multiplier;
}

View File

@ -27,14 +27,14 @@
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="LicentiaLabs">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\licentia-labs-master\Assemblies\LicentiaLabs.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">
<HintPath>..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\rjw-master\1.4\Assemblies\RJW.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -49,11 +49,11 @@
<None Include="..\Common\Languages\**" />
<None Include="..\Common\Patches\**" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
@ -115,6 +115,7 @@
<Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
<Compile Include="Genes\Life_Force\AbilityUtility.cs" />
<Compile Include="Genes\Life_Force\Alert_LowFertilin.cs" />
<Compile Include="Genes\Life_Force\CompAbilityEffect_Seduce.cs" />
<Compile Include="Genes\Life_Force\CompAbilityEffect_LifeForceCost.cs" />
<Compile Include="Genes\Life_Force\CompAbilityEffect_CockEater.cs" />
@ -128,6 +129,9 @@
<Compile Include="Genes\Life_Force\ThinkNode_ConditionalLowLifeForce.cs" />
<Compile Include="Genes\Life_Force\ThinkNode_ConditionalCritcalLifeForce.cs" />
<Compile Include="Genes\Life_Force\JobGiver_GetLifeForce.cs" />
<Compile Include="Genes\Damage\Gene_Unbreakable.cs" />
<Compile Include="Genes\Special\Patch_AgeDrain.cs" />
<Compile Include="Genes\Special\Patch_Youth_Fountain.cs" />
<Compile Include="Interactions\CompAbility_SexInteractionRequirements.cs" />
<Compile Include="Genes\Life_Force\CompAbilityEffect_PussyHeal.cs" />
<Compile Include="Genes\Life_Force\CompProperties_AbilityLifeForceCost.cs" />

View File

@ -12,5 +12,6 @@ namespace RJW_Genes
{
public static readonly ThoughtDef rjw_genes_cock_eaten;
public static readonly ThoughtDef rjw_genes_seduced;
public static readonly ThoughtDef rjw_critical_fertilin;
}
}