mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Restructuring, some sorting into folders
This commit is contained in:
parent
ac1fdc99be
commit
31e96bd5e3
36 changed files with 80 additions and 65 deletions
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using Verse.AI;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class LifeForceMentalBreakWorker : MentalBreakWorker
|
||||
{
|
||||
public override bool BreakCanOccur(Pawn pawn)
|
||||
{
|
||||
if (pawn.Spawned && base.BreakCanOccur(pawn))
|
||||
{
|
||||
if (!GeneUtility.HasLifeForce(pawn))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Gene_LifeForce gene = pawn.genes.GetFirstGeneOfType<Gene_LifeForce>();
|
||||
if( gene.Resource.Value <= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
23
Source/Genes/Life_Force/MentalStates/LifeForceMentalState.cs
Normal file
23
Source/Genes/Life_Force/MentalStates/LifeForceMentalState.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using rjw;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class LifeForceMentalState : MentalState
|
||||
{
|
||||
public override void MentalStateTick()
|
||||
{
|
||||
if (this.pawn.IsHashIntervalTick(150) && !GeneUtility.HasCriticalLifeForce(this.pawn))
|
||||
{
|
||||
Pawn_JobTracker jobs = this.pawn.jobs;
|
||||
if (!(((jobs != null) ? jobs.curDriver : null) is JobDriver_Sex))
|
||||
{
|
||||
base.RecoverFromState();
|
||||
return;
|
||||
}
|
||||
}
|
||||
base.MentalStateTick();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using rjw;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class LifeForceMentalStateWorker : MentalStateWorker
|
||||
{
|
||||
public override bool StateCanOccur(Pawn pawn)
|
||||
{
|
||||
return base.StateCanOccur(pawn) && (xxx.is_human(pawn) && JobGiver_LifeForce_RandomRape.can_rape(pawn));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue