2022-04-18 14:51:59 +00:00
|
|
|
|
using RimWorld;
|
|
|
|
|
|
2022-04-27 10:56:16 +00:00
|
|
|
|
namespace RJWSexperience // Change in namespace will lead to save incompatibility
|
2022-04-18 14:51:59 +00:00
|
|
|
|
{
|
|
|
|
|
public class Thought_AteCum : Thought_Recordbased
|
|
|
|
|
{
|
|
|
|
|
public override int CurStageIndex
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2022-04-26 06:05:05 +00:00
|
|
|
|
if (pawn?.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false)
|
|
|
|
|
return def.stages.Count - 1;
|
2022-04-18 14:51:59 +00:00
|
|
|
|
return base.CurStageIndex;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool TryMergeWithExistingMemory(out bool showBubble)
|
|
|
|
|
{
|
|
|
|
|
ThoughtHandler thoughts = pawn.needs.mood.thoughts;
|
|
|
|
|
if (thoughts.memories.NumMemoriesInGroup(this) >= def.stackLimit)
|
|
|
|
|
{
|
|
|
|
|
Thought_AteCum thought_Memory = (Thought_AteCum)thoughts.memories.OldestMemoryInGroup(this);
|
|
|
|
|
if (thought_Memory != null)
|
|
|
|
|
{
|
2022-04-27 10:56:16 +00:00
|
|
|
|
showBubble = thought_Memory.age > thought_Memory.def.DurationTicks / 2;
|
2022-04-18 14:51:59 +00:00
|
|
|
|
thought_Memory.Merged();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
showBubble = true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void Merged()
|
|
|
|
|
{
|
|
|
|
|
age = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|