Esempio n. 1
0
 public FlakWorker(AirDefense airDefense, AntiAircraftDef def) : base(airDefense, def)
 {
     flakTurrets = new List <int>();
     for (int i = 0; i < airDefense.defenseBuildings; i++)
     {
         flakTurrets.Add(CooldownRange);
     }
     turretsCachedInMap ??= new List <Thing>();
 }
Esempio n. 2
0
 public AirDefense(WorldObject parent)
 {
     this.parent     = parent;
     uniqueId        = VehicleIdManager.Instance.GetNextAirDefenseId();
     antiAircraftDef = AntiAircraftDefOf.FlakProjectile;
     if (parent.Faction != Faction.OfPlayerSilentFail)
     {
         searchDirection = Rand.Chance(0.5f) ? 1 : -1;
     }
 }
Esempio n. 3
0
        public virtual void ExposeData()
        {
            Scribe_Values.Look(ref cooldownTimer, "cooldownTimer");
            Scribe_Values.Look(ref defenseBuildings, "defenseBuildings");
            Scribe_Defs.Look(ref antiAircraftDef, "antiAircraftDef");
            Scribe_Collections.Look(ref activeTargets, "activeTargets", LookMode.Reference);
            Scribe_References.Look(ref parent, "parent");

            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                activeTargets ??= new HashSet <AerialVehicleInFlight>();
                antiAircraftDef = AntiAircraftDefOf.FlakProjectile;
            }
        }
Esempio n. 4
0
 public AntiAircraftWorker(AirDefense airDefense, AntiAircraftDef def)
 {
     this.airDefense = airDefense;
     this.def        = def;
 }