Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using Verse;
  3.  
  4. namespace RimWorld
  5. {
  6. public class DamageWorker_FlameNoCamShake : DamageWorker_AddInjury
  7. {
  8. // Token: 0x06004AA6 RID: 19110 RVA: 0x0022CA48 File Offset: 0x0022AE48
  9. public override DamageWorker.DamageResult Apply(DamageInfo dinfo, Thing victim)
  10. {
  11. Pawn pawn = victim as Pawn;
  12. if (pawn != null && pawn.Faction == Faction.OfPlayer)
  13. {
  14. Find.TickManager.slower.SignalForceNormalSpeedShort();
  15. }
  16. Map map = victim.Map;
  17. DamageWorker.DamageResult damageResult = base.Apply(dinfo, victim);
  18. if (!damageResult.deflected && !dinfo.InstantPermanentInjury)
  19. {
  20. victim.TryAttachFire(Rand.Range(0.15f, 0.25f));
  21. }
  22. if (victim.Destroyed && map != null && pawn == null)
  23. {
  24. foreach (IntVec3 c in victim.OccupiedRect())
  25. {
  26. FilthMaker.MakeFilth(c, map, ThingDefOf.Filth_Ash, 1);
  27. }
  28. Plant plant = victim as Plant;
  29. if (plant != null && victim.def.plant.IsTree && plant.LifeStage != PlantLifeStage.Sowing && victim.def != ThingDefOf.BurnedTree)
  30. {
  31. DeadPlant deadPlant = (DeadPlant)GenSpawn.Spawn(ThingDefOf.BurnedTree, victim.Position, map, WipeMode.Vanish);
  32. deadPlant.Growth = plant.Growth;
  33. }
  34. }
  35. return damageResult;
  36. }
  37.  
  38. // Token: 0x06004AA7 RID: 19111 RVA: 0x0022CB98 File Offset: 0x0022AF98
  39. public override void ExplosionAffectCell(Explosion explosion, IntVec3 c, List<Thing> damagedThings, bool canThrowMotes)
  40. {
  41. base.ExplosionAffectCell(explosion, c, damagedThings, canThrowMotes);
  42. if (this.def == DamageDefOf.Flame && Rand.Chance(FireUtility.ChanceToStartFireIn(c, explosion.Map)))
  43. {
  44. FireUtility.TryStartFireIn(c, explosion.Map, Rand.Range(0.2f, 0.6f));
  45. }
  46. }
  47. public override void ExplosionStart(Explosion explosion, List<IntVec3> cellsToAffect)
  48. {
  49. if (this.def.explosionHeatEnergyPerCell > 1.401298E-45f)
  50. {
  51. GenTemperature.PushHeat(explosion.Position, explosion.Map, this.def.explosionHeatEnergyPerCell * (float)cellsToAffect.Count);
  52. }
  53. MoteMaker.MakeStaticMote(explosion.Position, explosion.Map, ThingDefOf.Mote_ExplosionFlash, explosion.radius * 6f);
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement