From 0ad2cea1339117ae8b299dffa73b84d582afdf35 Mon Sep 17 00:00:00 2001 From: Remie Richards Date: Fri, 27 Mar 2015 11:22:39 +0000 Subject: [PATCH] Fire spreads evenly between 2 mobs when they MobBump() or Cross() each other. --- code/modules/mob/living/carbon/human/human.dm | 2 ++ code/modules/mob/living/living.dm | 3 +++ code/modules/mob/living/living_defense.dm | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index fe665d3686e..2965811c7da 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -239,6 +239,8 @@ if(istype(MB)) MB.RunOver(src) + spreadFire(AM) + //Added a safety check in case you want to shock a human mob directly through electrocute_act. /mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/safety = 0) if(!safety) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 782b47d5847..5a591a9cee7 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -71,6 +71,9 @@ Sorry Giacom. Please don't be mad :( //Called when we bump onto a mob /mob/living/proc/MobBump(mob/M) + //Even if we don't push/swap places, we "touched" them, so spread fire + spreadFire(M) + if(now_pushing) return 1 diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index aedc993e895..2aae4695109 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -134,6 +134,24 @@ proc/vol_by_throwforce_and_or_w_class(var/obj/item/I) adjust_fire_stacks(0.5) IgniteMob() + +//Share fire evenly between the two mobs +//Called in MobBump() and Crossed() +/mob/living/proc/spreadFire(var/mob/living/L) + if(!istype(L)) + return + var/L_old_on_fire = L.on_fire + + if(on_fire) //Only spread fire stacks if we're on fire + fire_stacks /= 2 + L.fire_stacks += fire_stacks + L.IgniteMob() + + if(L_old_on_fire) //Only ignite us and gain their stacks if they were onfire before we bumped them + L.fire_stacks /= 2 + fire_stacks += L.fire_stacks + IgniteMob() + //Mobs on Fire end