public override void UpdateAllDuties() { LordToilData_HuntEnemies data = this.Data; for (int i = 0; i < this.lord.ownedPawns.Count; i++) { Pawn pawn = this.lord.ownedPawns[i]; if (!data.fallbackLocation.IsValid) { RCellFinder.TryFindRandomSpotJustOutsideColony(this.lord.ownedPawns[0], out data.fallbackLocation); } pawn.mindState.duty = new PawnDuty(DutyDefOf.HuntEnemiesIndividual); pawn.mindState.duty.focusSecond = data.fallbackLocation; } }
public override void UpdateAllDuties() { LordToilData_HuntEnemies data = Data; if (!data.fallbackLocation.IsValid) { for (int i = 0; i < lord.ownedPawns.Count; i++) { Pawn pawn = lord.ownedPawns[i]; if (pawn.Spawned && RCellFinder.TryFindRandomSpotJustOutsideColony(pawn, out data.fallbackLocation) && data.fallbackLocation.IsValid) { break; } } } for (int j = 0; j < lord.ownedPawns.Count; j++) { Pawn pawn2 = lord.ownedPawns[j]; pawn2.mindState.duty = new PawnDuty(DutyDefOf.HuntEnemiesIndividual); pawn2.mindState.duty.focusSecond = data.fallbackLocation; } }
public LordToil_HuntEnemies(IntVec3 fallbackLocation) { data = new LordToilData_HuntEnemies(); Data.fallbackLocation = fallbackLocation; }