Seduced ThoughtDef

This commit is contained in:
Shabakur 2023-01-06 13:52:04 +01:00
parent ee1625306a
commit 34bb5d3b2c
13 changed files with 25 additions and 91 deletions

View file

@ -1,18 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
namespace RJW_Genes
{
public class HediffCompProperties_RemoveSubmit :HediffCompProperties
{
public HediffCompProperties_RemoveSubmit()
{
this.compClass = typeof(HediffComp_RemoveSubmit);
}
}
}

View file

@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Genes
{
public class HediffComp_RemoveSubmit : HediffComp
{
public HediffCompProperties_RemoveSubmit Props
{
get
{
return (HediffCompProperties_RemoveSubmit)this.props;
}
}
public override void CompPostPostRemoved()
{
base.CompPostPostRemoved();
HediffWithComps submitting = this.Pawn.health.hediffSet.GetFirstHediffOfDef(xxx.submitting) as HediffWithComps;
submitting.CurStage.becomeVisible = false;
if (submitting != null)
{
foreach (HediffComp comp in submitting.comps)
{
HediffComp_Disappears hediffComp = comp as HediffComp_Disappears;
if (hediffComp != null)
{
hediffComp.ticksToDisappear = 1;
//pawn.health.RemoveHediff(submitting);
//removing the hediff directly gives an error, ArgementOutOrRange, making the remaining time 1 ticks should have the same effect without the error
}
}
}
}
}
}

View file

@ -38,6 +38,7 @@ namespace RJW_Genes
if(partner != null)
{
partner.drafter.Drafted = false;
this.pawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.rjw_genes_seduced, partner, null);
Job newJob = JobMaker.MakeJob(JobDefOf.sex_on_spot, pawn);
partner.jobs.StartJob(newJob, JobCondition.InterruptForced, null, false, true, null, null, false, false, null, false, true);
}