mirror of
https://gitgud.io/AbstractConcept/privacy-please.git
synced 2024-08-15 00:03:18 +00:00
211442e7eb
- Fixed a bug that was preventing threesomes from occurring - Stopped the red text errors from occurring when running this mod without Humanoid Alien Races
67 lines
1.9 KiB
C#
67 lines
1.9 KiB
C#
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;
|
|
private int lastInvitationTick = -1;
|
|
private int invitationCoolDown = 600;
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
public bool CanSendAnInvitionForSex()
|
|
{
|
|
if (Find.TickManager.TicksGame > invitationCoolDown + lastInvitationTick)
|
|
{
|
|
lastInvitationTick = Find.TickManager.TicksGame;
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|