mirror of
https://gitgud.io/AbstractConcept/privacy-please.git
synced 2024-08-15 00:03:18 +00:00
Initial commit
This commit is contained in:
parent
fe7c28ad8e
commit
55402b9891
54 changed files with 2515 additions and 92 deletions
54
Source/Scripts/Comps/CompPawnThoughtData.cs
Normal file
54
Source/Scripts/Comps/CompPawnThoughtData.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
using AlienRace;
|
||||
using UnityEngine;
|
||||
using rjw;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Privacy_Please
|
||||
{
|
||||
public class CompPawnThoughtData : ThingComp
|
||||
{
|
||||
private Pawn pawn;
|
||||
private int lastExclaimationTick = -1;
|
||||
private int exclaimationCoolDown = 90;
|
||||
|
||||
public override void Initialize(CompProperties props)
|
||||
{
|
||||
if (pawn == null)
|
||||
{ pawn = parent as Pawn; }
|
||||
}
|
||||
|
||||
// Delay the cleaning of filth under the sexing pawns
|
||||
public override void CompTickRare()
|
||||
{
|
||||
base.CompTickRare();
|
||||
|
||||
if (pawn?.jobs?.curDriver != null && pawn.jobs.curDriver is JobDriver_Sex)
|
||||
{
|
||||
IEnumerable<Thing> filthPile = pawn.PositionHeld.GetThingList(pawn.Map);
|
||||
|
||||
if (filthPile == null) return;
|
||||
|
||||
foreach(Thing thing in filthPile)
|
||||
{
|
||||
if ((thing is Filth) == false) continue;
|
||||
|
||||
AccessTools.Field(typeof(Filth), "growTick").SetValue(thing as Filth, Find.TickManager.TicksGame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TryToExclaim()
|
||||
{
|
||||
if (Find.TickManager.TicksGame > exclaimationCoolDown + lastExclaimationTick)
|
||||
{
|
||||
lastExclaimationTick = Find.TickManager.TicksGame;
|
||||
FleckMaker.ThrowMetaIcon(pawn.Position, pawn.Map, FleckDefOf.IncapIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
13
Source/Scripts/Comps/CompProperties_PawnThoughtData.cs
Normal file
13
Source/Scripts/Comps/CompProperties_PawnThoughtData.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using Verse;
|
||||
|
||||
namespace Privacy_Please
|
||||
{
|
||||
public class CompProperties_PawnThoughtData : CompProperties
|
||||
{
|
||||
public CompProperties_PawnThoughtData()
|
||||
{
|
||||
base.compClass = typeof(CompPawnThoughtData);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue