public LordToil_Party(IntVec3 spot, int ticksPerPartyPulse = 600) { this.spot = spot; this.ticksPerPartyPulse = ticksPerPartyPulse; data = new LordToilData_Party(); Data.ticksToNextPulse = ticksPerPartyPulse; }
private void ApplyOutcome(LordToil_Party toil) { List <Pawn> ownedPawns = lord.ownedPawns; LordToilData_Party lordToilData_Party = (LordToilData_Party)toil.data; for (int i = 0; i < ownedPawns.Count; i++) { Pawn pawn = ownedPawns[i]; bool flag = pawn == organizer; if (lordToilData_Party.presentForTicks.TryGetValue(pawn, out int value) && value > 0) { if (ownedPawns[i].needs.mood != null) { ThoughtDef thoughtDef = flag ? OrganizerThought : AttendeeThought; float num = 0.5f / thoughtDef.stages[0].baseMoodEffect; float moodPowerFactor = Mathf.Min((float)value / (float)durationTicks + num, 1f); Thought_Memory thought_Memory = (Thought_Memory)ThoughtMaker.MakeThought(thoughtDef); thought_Memory.moodPowerFactor = moodPowerFactor; ownedPawns[i].needs.mood.thoughts.memories.TryGainMemory(thought_Memory); } TaleRecorder.RecordTale(flag ? OrganizerTale : AttendeeTale, ownedPawns[i], organizer); } } }
public LordToil_Party(IntVec3 spot, GatheringDef gatheringDef, float joyPerTick = 3.5E-05f) : base(spot, gatheringDef) { this.joyPerTick = joyPerTick; data = new LordToilData_Party(); }