Exemple #1
0
 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));
                 }
             }
         }
     }
 }
 private static bool CanNameFactionBase(FactionBase factionBase, int ticksPassed)
 {
     return(factionBase.Faction == Faction.OfPlayer && !factionBase.namedByPlayer && (float)ticksPassed / 60000.0 >= 3.0 && factionBase.HasMap && factionBase.Map.dangerWatcher.DangerRating != StoryDanger.High && factionBase.Map.mapPawns.FreeColonistsSpawnedCount != 0 && NamePlayerFactionAndBaseUtility.CanNameAnythingNow());
 }
 private static bool CanNameFaction(int ticksPassed)
 {
     return(!Faction.OfPlayer.HasName && (float)ticksPassed / 60000.0 >= 3.0 && NamePlayerFactionAndBaseUtility.CanNameAnythingNow());
 }
 public static bool CanNameFactionBaseSoon(FactionBase factionBase)
 {
     return(NamePlayerFactionAndBaseUtility.CanNameFactionBase(factionBase, Find.TickManager.TicksGame - factionBase.creationGameTicks + 30000));
 }
 public static bool CanNameFactionSoon()
 {
     return(NamePlayerFactionAndBaseUtility.CanNameFaction(Find.TickManager.TicksGame + 30000));
 }