public void FactionTick() { if (Find.TickManager.TicksGame % 1001 == 0 && this != Faction.OfPlayer) { if (this.PlayerGoodwill < this.def.naturalColonyGoodwill.min) { this.AffectGoodwillWith(Faction.OfPlayer, (float)(this.def.goodwillDailyGain * 0.0)); } else if (this.PlayerGoodwill > this.def.naturalColonyGoodwill.max) { this.AffectGoodwillWith(Faction.OfPlayer, (float)((0.0 - this.def.goodwillDailyFall) * 0.0)); } } this.kidnapped.KidnappedPawnsTrackerTick(); for (int num = this.predatorThreats.Count - 1; num >= 0; num--) { PredatorThreat predatorThreat = this.predatorThreats[num]; if (predatorThreat.Expired) { this.predatorThreats.RemoveAt(num); if (predatorThreat.predator.Spawned) { predatorThreat.predator.Map.attackTargetsCache.UpdateTarget(predatorThreat.predator); } } } if (Find.TickManager.TicksGame % 1000 == 200 && this.IsPlayer) { if (NamePlayerFactionAndBaseUtility.CanNameFactionNow()) { FactionBase factionBase = Find.WorldObjects.FactionBases.Find(NamePlayerFactionAndBaseUtility.CanNameFactionBaseSoon); if (factionBase != null) { Find.WindowStack.Add(new Dialog_NamePlayerFactionAndBase(factionBase)); } else { Find.WindowStack.Add(new Dialog_NamePlayerFaction()); } } else { FactionBase factionBase2 = Find.WorldObjects.FactionBases.Find(NamePlayerFactionAndBaseUtility.CanNameFactionBaseNow); if (factionBase2 != null) { if (NamePlayerFactionAndBaseUtility.CanNameFactionSoon()) { Find.WindowStack.Add(new Dialog_NamePlayerFactionAndBase(factionBase2)); } else { Find.WindowStack.Add(new Dialog_NamePlayerFactionBase(factionBase2)); } } } } }
public void FactionTick() { this.CheckNaturalTendencyToReachGoodwillThreshold(); this.kidnapped.KidnappedPawnsTrackerTick(); for (int i = this.predatorThreats.Count - 1; i >= 0; i--) { PredatorThreat predatorThreat = this.predatorThreats[i]; if (predatorThreat.Expired) { this.predatorThreats.RemoveAt(i); if (predatorThreat.predator.Spawned) { predatorThreat.predator.Map.attackTargetsCache.UpdateTarget(predatorThreat.predator); } } } if (Find.TickManager.TicksGame % 1000 == 200 && this.IsPlayer) { if (NamePlayerFactionAndSettlementUtility.CanNameFactionNow()) { List <Settlement> settlements = Find.WorldObjects.Settlements; if (Faction.< > f__mg$cache0 == null) { Faction.< > f__mg$cache0 = new Predicate <Settlement>(NamePlayerFactionAndSettlementUtility.CanNameSettlementSoon); } Settlement settlement = settlements.Find(Faction.< > f__mg$cache0); if (settlement != null) { Find.WindowStack.Add(new Dialog_NamePlayerFactionAndSettlement(settlement)); } else { Find.WindowStack.Add(new Dialog_NamePlayerFaction()); } } else { List <Settlement> settlements2 = Find.WorldObjects.Settlements; if (Faction.< > f__mg$cache1 == null) { Faction.< > f__mg$cache1 = new Predicate <Settlement>(NamePlayerFactionAndSettlementUtility.CanNameSettlementNow); } Settlement settlement2 = settlements2.Find(Faction.< > f__mg$cache1); if (settlement2 != null) { if (NamePlayerFactionAndSettlementUtility.CanNameFactionSoon()) { Find.WindowStack.Add(new Dialog_NamePlayerFactionAndSettlement(settlement2)); } else { Find.WindowStack.Add(new Dialog_NamePlayerSettlement(settlement2)); } } } } }
private void TookDamageFromPredator(Pawn predator) { for (int i = 0; i < this.predatorThreats.Count; i++) { if (this.predatorThreats[i].predator == predator) { this.predatorThreats[i].lastAttackTicks = Find.TickManager.TicksGame; return; } } PredatorThreat predatorThreat = new PredatorThreat(); predatorThreat.predator = predator; predatorThreat.lastAttackTicks = Find.TickManager.TicksGame; this.predatorThreats.Add(predatorThreat); }
public void FactionTick() { CheckNaturalTendencyToReachGoodwillThreshold(); kidnapped.KidnappedPawnsTrackerTick(); for (int num = predatorThreats.Count - 1; num >= 0; num--) { PredatorThreat predatorThreat = predatorThreats[num]; if (predatorThreat.Expired) { predatorThreats.RemoveAt(num); if (predatorThreat.predator.Spawned) { predatorThreat.predator.Map.attackTargetsCache.UpdateTarget(predatorThreat.predator); } } } if (Find.TickManager.TicksGame % 1000 != 200 || !IsPlayer) { return; } if (NamePlayerFactionAndSettlementUtility.CanNameFactionNow()) { Settlement settlement = Find.WorldObjects.Settlements.Find((Settlement x) => NamePlayerFactionAndSettlementUtility.CanNameSettlementSoon(x)); if (settlement != null) { Find.WindowStack.Add(new Dialog_NamePlayerFactionAndSettlement(settlement)); } else { Find.WindowStack.Add(new Dialog_NamePlayerFaction()); } return; } Settlement settlement2 = Find.WorldObjects.Settlements.Find((Settlement x) => NamePlayerFactionAndSettlementUtility.CanNameSettlementNow(x)); if (settlement2 != null) { if (NamePlayerFactionAndSettlementUtility.CanNameFactionSoon()) { Find.WindowStack.Add(new Dialog_NamePlayerFactionAndSettlement(settlement2)); } else { Find.WindowStack.Add(new Dialog_NamePlayerSettlement(settlement2)); } } }
private static bool <ExposeData> m__0(PredatorThreat x) { return(x.predator == null); }