public override DamageResult Apply(DamageInfo dinfo, Thing victim) { Pawn pawn = victim as Pawn; if (pawn != null && pawn.Faction == Faction.OfPlayer) { Find.TickManager.slower.SignalForceNormalSpeedShort(); } Map map = victim.Map; DamageResult damageResult = base.Apply(dinfo, victim); if (!damageResult.deflected && !dinfo.InstantPermanentInjury && Rand.Chance(FireUtility.ChanceToAttachFireFromEvent(victim))) { victim.TryAttachFire(Rand.Range(0.15f, 0.25f)); } if (victim.Destroyed && map != null && pawn == null) { foreach (IntVec3 item in victim.OccupiedRect()) { FilthMaker.TryMakeFilth(item, map, ThingDefOf.Filth_Ash); } Plant plant = victim as Plant; if (plant != null && victim.def.plant.IsTree && plant.LifeStage != 0 && victim.def != ThingDefOf.BurnedTree) { ((DeadPlant)GenSpawn.Spawn(ThingDefOf.BurnedTree, victim.Position, map)).Growth = plant.Growth; } } return(damageResult); }
public override DamageResult Apply(DamageInfo dinfo, Thing victim) { DamageResult damageResult = base.Apply(dinfo, victim); if (!damageResult.deflected && !dinfo.InstantPermanentInjury && Rand.Chance(FireUtility.ChanceToAttachFireFromEvent(victim) * 0.25f)) { victim.TryAttachFire(Rand.Range(0.15f, 0.25f)); } return(damageResult); }