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 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);
                }
            }
        }