mirror of
				https://github.com/amevarashi/RJW-Sexperience.git
				synced 2024-08-14 23:54:08 +00:00 
			
		
		
		
	Optimized Ate Cum thought
This commit is contained in:
		
							parent
							
								
									cdc79acfa3
								
							
						
					
					
						commit
						8a48d2e463
					
				
					 5 changed files with 61 additions and 56 deletions
				
			
		| 
						 | 
				
			
			@ -1,39 +1,17 @@
 | 
			
		|||
using RimWorld;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience // Change in namespace will lead to save incompatibility
 | 
			
		||||
namespace RJWSexperience // Change in namespace will lead to save incompatibility
 | 
			
		||||
{
 | 
			
		||||
	public class Thought_AteCum : Thought_Recordbased
 | 
			
		||||
	{
 | 
			
		||||
		public override int CurStageIndex
 | 
			
		||||
		protected override void UpdateCurStage()
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			if (pawn?.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false)
 | 
			
		||||
			{
 | 
			
		||||
				if (pawn?.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false)
 | 
			
		||||
					return def.stages.Count - 1;
 | 
			
		||||
				return base.CurStageIndex;
 | 
			
		||||
				SetForcedStage(def.stages.Count - 1);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public override bool TryMergeWithExistingMemory(out bool showBubble)
 | 
			
		||||
		{
 | 
			
		||||
			ThoughtHandler thoughts = pawn.needs.mood.thoughts;
 | 
			
		||||
			if (thoughts.memories.NumMemoriesInGroup(this) >= def.stackLimit)
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				Thought_AteCum thought_Memory = (Thought_AteCum)thoughts.memories.OldestMemoryInGroup(this);
 | 
			
		||||
				if (thought_Memory != null)
 | 
			
		||||
				{
 | 
			
		||||
					showBubble = thought_Memory.age > thought_Memory.def.DurationTicks / 2;
 | 
			
		||||
					thought_Memory.Merged();
 | 
			
		||||
					return true;
 | 
			
		||||
				}
 | 
			
		||||
				base.UpdateCurStage();
 | 
			
		||||
			}
 | 
			
		||||
			showBubble = true;
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		protected virtual void Merged()
 | 
			
		||||
		{
 | 
			
		||||
			age = 0;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue