Exemplo n.º 1
0
        public override void PreApplyDamage(ref DamageInfo dinfo, out bool absorbed)
        {
            absorbed = false;

            if (flammableLinkcomp == null)
            {
                return;
            }

            if (Position.ContainsStaticFire(Map))
            {
                return;
            }

            if (dinfo.Instigator != null && dinfo.Instigator.Faction != Faction.OfPlayer &&
                !(dinfo.Weapon != null && dinfo.Weapon.IsRangedWeapon))
            {
                return;
            }

            var heat = flammableLinkcomp.HeatedByHitOf(dinfo);

            flammableLinkcomp.TrySparksFly(heat);
            FleckUtility.DrawHeatedMote(flammableLinkcomp.HeatRatio, base.DrawPos, Position, Map);
            dinfo.SetAmount(0);
        }
Exemplo n.º 2
0
 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;
         }
     }
 }