public override void CompTick() { if (FireUtility.ContainsStaticFire(base.parent.Position, base.parent.Map)) { this.BurningNow = true; for (int i = 0; i < 4; i++) { IntVec3 vec = base.parent.Position + GenAdj.CardinalDirectionsAround[i]; List <Thing> things = base.parent.Map.thingGrid.ThingsListAt(vec); for (int j = 0; j < things.Count; j++) { FlammableLinkComp comp = things[j].TryGetComp <FlammableLinkComp>(); if (comp != null && this.IsConnected(comp)) { comp.TrySparksFly(compDef.ignitionDef.spreadPower); } } } } else { this.BurningNow = false; this.AmountOfHeat -= this.WeatherFactor(this.compDef.ignitionDef.easeCooling, CorrectWeatherFactorCooling); if (this.AmountOfHeat < 0) { this.AmountOfHeat = 0; } } }
public override void SpawnSetup(Map map, bool respawningAfterLoad) { base.SpawnSetup(map, respawningAfterLoad); flammableLinkcomp = GetComp <FlammableLinkComp>(); }
protected bool IsConnected(FlammableLinkComp comp) { return(comp.compDef.connectionID == this.compDef.connectionID); }