예제 #1
0
        private void CheckBulletFire(Mote mote)
        {
            if (mote == null)
            {
                return;
            }
            // Launch
            if (mote.def == ThingDefOf.Mote_ShotFlash)
            {
                float heat = mote.exactScale.x * 4f;
                if (this.flammableLinkcomp.TrySparksFly(heat) == SparksFlyResult.Undefine)
                {
                    MoteUtility.DrawHeatedMote(this.flammableLinkcomp.HeatRatio, base.DrawPos, base.Position, base.Map);
                }
#if DEBUG
                Log.Message("Mote_ShotFlash base:" + base.DrawPos + " heat:" + heat + " cap:" + this.flammableLinkcomp.AmountOfHeat);
#endif
            }

            // Impact
            if (mote.def == ThingDefOf.Mote_ShotHit_Dirt)
            {
                if (this.flammableLinkcomp.TrySparksFly(60f) == SparksFlyResult.Undefine)
                {
                    MoteUtility.DrawHeatedMote(this.flammableLinkcomp.HeatRatio, base.DrawPos, base.Position, base.Map);
                }
#if DEBUG
                Log.Message("Mote_ShotHit_Dirt base:" + base.DrawPos + " cap:" + this.flammableLinkcomp.AmountOfHeat);
#endif
            }
        }
예제 #2
0
 private void CheckSparksFromPawn(Pawn pawn)
 {
     if (pawn == null)
     {
         return;
     }
     if (pawn.HasAttachment(ThingDefOf.Fire))
     {
         if (this.flammableLinkcomp.TrySparksFly(AttachSparksHeat) == SparksFlyResult.Undefine)
         {
             MoteUtility.DrawHeatedMote(this.flammableLinkcomp.HeatRatio, base.DrawPos, base.Position, base.Map);
         }
     }
 }
예제 #3
0
        public override void PreApplyDamage(ref DamageInfo dinfo, out bool absorbed)
        {
            absorbed = false;

            if (this.flammableLinkcomp != null)
            {
                if (!(FireUtility.ContainsStaticFire(base.Position, base.Map)))
                {
                    if ((dinfo.Instigator != null && dinfo.Instigator.Faction != Faction.OfPlayer) && !(dinfo.Weapon != null && dinfo.Weapon.IsRangedWeapon))
                    {
                        return;
                    }

                    float heat = flammableLinkcomp.HeatedByHitOf(dinfo);
                    this.flammableLinkcomp.TrySparksFly(heat);
                    MoteUtility.DrawHeatedMote(this.flammableLinkcomp.HeatRatio, base.DrawPos, base.Position, base.Map);
                    dinfo.SetAmount(0);
                }
            }
        }