2022-07-26 03:55:56 +00:00
|
|
|
|
using RimWorld;
|
|
|
|
|
|
2022-10-14 16:35:31 +00:00
|
|
|
|
namespace RJWSexperience.Ideology
|
2022-07-26 03:55:56 +00:00
|
|
|
|
{
|
2022-08-01 12:57:29 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Increments record every time the thought is added
|
|
|
|
|
/// The increment is permanent
|
|
|
|
|
/// </summary>
|
2022-07-26 03:55:56 +00:00
|
|
|
|
public class Thought_IncreaseRecord : Thought_Memory
|
|
|
|
|
{
|
2022-08-01 12:57:29 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// This method is called for every thought right after the pawn is assigned
|
|
|
|
|
/// </summary>
|
2022-07-26 03:55:56 +00:00
|
|
|
|
public override bool TryMergeWithExistingMemory(out bool showBubble)
|
|
|
|
|
{
|
2022-08-01 12:57:29 +00:00
|
|
|
|
var defExtension = def.GetModExtension<ThoughtDefExtension_IncreaseRecord>();
|
|
|
|
|
|
|
|
|
|
if (defExtension != null)
|
2022-07-26 03:55:56 +00:00
|
|
|
|
{
|
2022-08-01 12:57:29 +00:00
|
|
|
|
pawn.records.AddTo(defExtension.recordDef, defExtension.increment);
|
2022-07-26 03:55:56 +00:00
|
|
|
|
}
|
2022-08-01 12:57:29 +00:00
|
|
|
|
return base.TryMergeWithExistingMemory(out showBubble);
|
2022-07-26 03:55:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|