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>(); }
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; } }
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; } }
public AntiAircraftWorker(AirDefense airDefense, AntiAircraftDef def) { this.airDefense = airDefense; this.def = def; }