diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index 3718aaace85..04f7c14795c 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -22,7 +22,6 @@
var/obj/item/weapon/reagent_containers/glass/B = beaker
B.loc = get_step(loc, SOUTH)
..()
-
/obj/machinery/atmospherics/unary/cryo_cell/initialize()
if(node) return
var/node_connect = dir
@@ -309,6 +308,7 @@
occupant = M
add_fingerprint(usr)
update_icon()
+ M.ExtinguishMob()
return 1
diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm
index 15dee70e78f..d5547dd732f 100644
--- a/code/game/objects/items/weapons/cigs_lighters.dm
+++ b/code/game/objects/items/weapons/cigs_lighters.dm
@@ -171,12 +171,14 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/cigarette/process()
var/turf/location = get_turf(src)
+ var/mob/living/M = loc
+ if(isliving(loc))
+ M.IgniteMob()
smoketime--
if(smoketime < 1)
new type_butt(location)
processing_objects.Remove(src)
if(ismob(loc))
- var/mob/living/M = loc
M << "Your [name] goes out."
M.u_equip(src) //un-equip it so the overlays can update
M.update_inv_wear_mask(0)
@@ -381,11 +383,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return ..()
return
-
/obj/item/weapon/lighter/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
+ if(!isliving(M))
+ return
+ M.IgniteMob()
if(!istype(M,/mob/living/carbon))
return
-
if(istype(M.wear_mask, /obj/item/clothing/mask/cigarette) && user.zone_sel.selecting == "mouth" && lit)
var/obj/item/clothing/mask/cigarette/cig = M.wear_mask
if(M == user)
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 0c5f84a4b73..adb25a029d2 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -10,7 +10,7 @@
w_class = 3.0
throw_speed = 2
throw_range = 10
- force = 10.0
+ force = 10
m_amt = 90
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
var/max_water = 50
@@ -119,6 +119,9 @@
for(var/atom/atm in get_turf(W))
if(!W) return
W.reagents.reaction(atm)
+ if(isliving(atm)) //For extinguishing mobs on fire
+ var/mob/living/M = atm
+ M.ExtinguishMob()
if(W.loc == my_target) break
sleep(2)
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index 452fac28fd4..1c0c3cd2305 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -190,7 +190,7 @@
location.hotspot_expose(700, 5)
-/obj/item/weapon/weldingtool/afterattack(obj/O, mob/user, proximity)
+/obj/item/weapon/weldingtool/afterattack(atom/O, mob/user, proximity)
if(!proximity) return
if(istype(O, /obj/structure/reagent_dispensers/fueltank) && in_range(src, O))
if(!welding)
@@ -212,6 +212,9 @@
var/turf/location = get_turf(user)
location.hotspot_expose(700, 50, 1)
+ if(isliving(O))
+ var/mob/living/L = O
+ L.IgniteMob()
/obj/item/weapon/weldingtool/attack_self(mob/user)
toggle(user)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 00aa0e3d787..cf85e1bead2 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -219,71 +219,76 @@
/obj/machinery/shower/proc/wash(atom/movable/O)
if(!on) return
- if(iscarbon(O))
- var/mob/living/carbon/M = O
- if(M.r_hand)
- M.r_hand.clean_blood()
- if(M.l_hand)
- M.l_hand.clean_blood()
- if(M.back)
- if(M.back.clean_blood())
- M.update_inv_back(0)
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- var/washgloves = 1
- var/washshoes = 1
- var/washmask = 1
- var/washears = 1
- var/washglasses = 1
+ if(isliving(O))
+ var/mob/living/L = O
+ L.ExtinguishMob()
+ L.fire_stacks = -20 //Douse ourselves with water to avoid fire more easily
+ L << "You've been drenched in water!"
+ if(iscarbon(O))
+ var/mob/living/carbon/M = O
+ if(M.r_hand)
+ M.r_hand.clean_blood()
+ if(M.l_hand)
+ M.l_hand.clean_blood()
+ if(M.back)
+ if(M.back.clean_blood())
+ M.update_inv_back(0)
+ if(ishuman(M))
+ var/mob/living/carbon/human/H = M
+ var/washgloves = 1
+ var/washshoes = 1
+ var/washmask = 1
+ var/washears = 1
+ var/washglasses = 1
- if(H.wear_suit)
- washgloves = !(H.wear_suit.flags_inv & HIDEGLOVES)
- washshoes = !(H.wear_suit.flags_inv & HIDESHOES)
+ if(H.wear_suit)
+ washgloves = !(H.wear_suit.flags_inv & HIDEGLOVES)
+ washshoes = !(H.wear_suit.flags_inv & HIDESHOES)
- if(H.head)
- washmask = !(H.head.flags_inv & HIDEMASK)
- washglasses = !(H.head.flags_inv & HIDEEYES)
- washears = !(H.head.flags_inv & HIDEEARS)
+ if(H.head)
+ washmask = !(H.head.flags_inv & HIDEMASK)
+ washglasses = !(H.head.flags_inv & HIDEEYES)
+ washears = !(H.head.flags_inv & HIDEEARS)
- if(H.wear_mask)
- if (washears)
- washears = !(H.wear_mask.flags_inv & HIDEEARS)
- if (washglasses)
- washglasses = !(H.wear_mask.flags_inv & HIDEEYES)
+ if(H.wear_mask)
+ if (washears)
+ washears = !(H.wear_mask.flags_inv & HIDEEARS)
+ if (washglasses)
+ washglasses = !(H.wear_mask.flags_inv & HIDEEYES)
- if(H.head)
- if(H.head.clean_blood())
- H.update_inv_head(0)
- if(H.wear_suit)
- if(H.wear_suit.clean_blood())
- H.update_inv_wear_suit(0)
- else if(H.w_uniform)
- if(H.w_uniform.clean_blood())
- H.update_inv_w_uniform(0)
- if(H.gloves && washgloves)
- if(H.gloves.clean_blood())
- H.update_inv_gloves(0)
- if(H.shoes && washshoes)
- if(H.shoes.clean_blood())
- H.update_inv_shoes(0)
- if(H.wear_mask && washmask)
- if(H.wear_mask.clean_blood())
- H.update_inv_wear_mask(0)
- if(H.glasses && washglasses)
- if(H.glasses.clean_blood())
- H.update_inv_glasses(0)
- if(H.ears && washears)
- if(H.ears.clean_blood())
- H.update_inv_ears(0)
- if(H.belt)
- if(H.belt.clean_blood())
- H.update_inv_belt(0)
+ if(H.head)
+ if(H.head.clean_blood())
+ H.update_inv_head(0)
+ if(H.wear_suit)
+ if(H.wear_suit.clean_blood())
+ H.update_inv_wear_suit(0)
+ else if(H.w_uniform)
+ if(H.w_uniform.clean_blood())
+ H.update_inv_w_uniform(0)
+ if(H.gloves && washgloves)
+ if(H.gloves.clean_blood())
+ H.update_inv_gloves(0)
+ if(H.shoes && washshoes)
+ if(H.shoes.clean_blood())
+ H.update_inv_shoes(0)
+ if(H.wear_mask && washmask)
+ if(H.wear_mask.clean_blood())
+ H.update_inv_wear_mask(0)
+ if(H.glasses && washglasses)
+ if(H.glasses.clean_blood())
+ H.update_inv_glasses(0)
+ if(H.ears && washears)
+ if(H.ears.clean_blood())
+ H.update_inv_ears(0)
+ if(H.belt)
+ if(H.belt.clean_blood())
+ H.update_inv_belt(0)
+ else
+ if(M.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags
+ if(M.wear_mask.clean_blood())
+ M.update_inv_wear_mask(0)
else
- if(M.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags
- if(M.wear_mask.clean_blood())
- M.update_inv_wear_mask(0)
- else
- O.clean_blood()
+ O.clean_blood()
if(isturf(loc))
var/turf/tile = loc
diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm
index 62be882c11e..f7b6eb302ea 100644
--- a/code/modules/mob/living/carbon/alien/alien.dm
+++ b/code/modules/mob/living/carbon/alien/alien.dm
@@ -85,14 +85,15 @@
// Aliens are now weak to fire.
//After then, it reacts to the surrounding atmosphere based on your thermal protection
- if(loc_temp > bodytemperature)
- //Place is hotter than we are
- var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
- if(thermal_protection < 1)
- bodytemperature += (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
- else
- bodytemperature += 1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
- // bodytemperature -= max((loc_temp - bodytemperature / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
+ if(!on_fire) // If you're on fire, ignore local air temperature
+ if(loc_temp > bodytemperature)
+ //Place is hotter than we are
+ var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
+ if(thermal_protection < 1)
+ bodytemperature += (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
+ else
+ bodytemperature += 1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
+ // bodytemperature -= max((loc_temp - bodytemperature / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature > 360.15)
@@ -140,6 +141,12 @@
radiation -= 3
adjustToxLoss(3)
+/mob/living/carbon/alien/handle_fire()//Aliens on fire code
+ if(..())
+ return
+ bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
+ return
+
/mob/living/carbon/alien/IsAdvancedToolUser()
return has_fine_manipulation
diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm
index 97e09c42c18..1cb0dc30104 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/life.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm
@@ -53,6 +53,8 @@
//stuff in the stomach
handle_stomach()
+ //Handle being on fire
+ handle_fire()
//Status updates, death etc.
handle_regular_status_updates()
diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
index 8566d93c039..465a85b9c44 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
@@ -1,7 +1,8 @@
//Xeno Overlays Indexes//////////
#define X_L_HAND_LAYER 1
#define X_R_HAND_LAYER 2
-#define X_TOTAL_LAYERS 2
+#define X_FIRE_LAYER 3
+#define X_TOTAL_LAYERS 3
/////////////////////////////////
/mob/living/carbon/alien/humanoid
@@ -44,7 +45,7 @@
update_inv_pockets(0)
update_hud()
update_icons()
-
+ update_fire()
/mob/living/carbon/alien/humanoid/update_hud()
if(client)
@@ -85,8 +86,23 @@
if(update_icons)
update_icons()
+/mob/living/carbon/alien/humanoid/update_fire()
+ overlays -= overlays_lying[X_FIRE_LAYER]
+ overlays -= overlays_standing[X_FIRE_LAYER]
+ if(on_fire)
+ overlays_lying[X_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Lying", "layer"= -X_FIRE_LAYER)
+ overlays_standing[X_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -X_FIRE_LAYER)
+ if(src.lying)
+ overlays += overlays_lying[X_FIRE_LAYER]
+ else
+ overlays += overlays_standing[X_FIRE_LAYER]
+ return
+ else
+ overlays_lying[X_FIRE_LAYER] = null
+ overlays_standing[X_FIRE_LAYER] = null
//Xeno Overlays Indexes//////////
#undef X_L_HAND_LAYER
#undef X_R_HAND_LAYER
+#undef X_FIRE_LAYER
#undef X_TOTAL_LAYERS
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 8404d8bc73b..3311a3365e7 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -389,11 +389,6 @@
item.throw_at(target, item.throw_range, item.throw_speed)
-
-/mob/living/carbon/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
- ..()
- bodytemperature = max(bodytemperature, BODYTEMP_HEAT_DAMAGE_LIMIT+10)
-
/mob/living/carbon/can_use_hands()
if(handcuffed)
return 0
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 593222a8357..bb5e59c44bb 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -244,6 +244,12 @@
else
msg += "[t_He] [t_has] severe genetic deformities.\n"
+ if(fire_stacks > 0)
+ msg += "[t_He] [t_is] covered in something flammable.\n"
+ if(fire_stacks < 0)
+ msg += "[t_He] looks a little soaked.\n"
+
+
if(nutrition < 100)
msg += "[t_He] [t_is] severely malnourished.\n"
else if(nutrition >= 500)
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 753c3a325c4..2f824974878 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -83,6 +83,9 @@
//Handle temperature/pressure differences between body and environment
handle_environment(environment)
+ //Check if we're on fire
+ handle_fire()
+
//stuff in the stomach
handle_stomach()
@@ -444,8 +447,8 @@
proc/handle_environment(datum/gas_mixture/environment)
if(!environment)
return
- var/loc_temp = get_temperature(environment)
+ var/loc_temp = get_temperature(environment)
//world << "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Thermal protection: [get_thermal_protection()] - Fire protection: [thermal_protection + add_fire_protection(loc_temp)] - Heat capacity: [environment_heat_capacity] - Location: [loc] - src: [src]"
//Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit.
@@ -453,16 +456,17 @@
stabilize_temperature_from_calories()
//After then, it reacts to the surrounding atmosphere based on your thermal protection
- if(loc_temp < bodytemperature)
- //Place is colder than we are
- var/thermal_protection = get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
- if(thermal_protection < 1)
- bodytemperature += min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX)
- else
- //Place is hotter than we are
- var/thermal_protection = get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
- if(thermal_protection < 1)
- bodytemperature += min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX)
+ if(!on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases
+ if(loc_temp < bodytemperature)
+ //Place is colder than we are
+ var/thermal_protection = get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
+ if(thermal_protection < 1)
+ bodytemperature += min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX)
+ else
+ //Place is hotter than we are
+ var/thermal_protection = get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
+ if(thermal_protection < 1)
+ bodytemperature += min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX)
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
@@ -517,6 +521,16 @@
return
+///FIRE CODE
+ handle_fire()
+ if(..())
+ return
+ var/thermal_protection = get_heat_protection(30000) //If you don't have fire suit level protection, you get a temperature increase
+ if((1 - thermal_protection) > 0.0001)
+ bodytemperature += BODYTEMP_HEATING_MAX
+ return
+//END FIRE CODE
+
/*
proc/adjust_body_temperature(current, loc_temp, boost)
var/temperature = current
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index 282effc356d..457d5a8e09c 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -61,27 +61,28 @@ Please contact me on #coderbus IRC. ~Carnie x
*/
//Human Overlays Indexes/////////
-#define BODY_LAYER 20 //underwear, eyes, lips(makeup)
-#define MUTATIONS_LAYER 19 //Tk headglows etc.
-#define DAMAGE_LAYER 18 //damage indicators (cuts and burns)
-#define UNIFORM_LAYER 17
-#define ID_LAYER 16
-#define SHOES_LAYER 15
-#define GLOVES_LAYER 14
-#define EARS_LAYER 13
-#define SUIT_LAYER 12
-#define GLASSES_LAYER 11
-#define BELT_LAYER 10 //Possible make this an overlay of somethign required to wear a belt?
-#define SUIT_STORE_LAYER 9
-#define BACK_LAYER 8
-#define HAIR_LAYER 7 //TODO: make part of head layer?
-#define FACEMASK_LAYER 6
-#define HEAD_LAYER 5
-#define HANDCUFF_LAYER 4
-#define LEGCUFF_LAYER 3
-#define L_HAND_LAYER 2
-#define R_HAND_LAYER 1 //Having the two hands seperate seems rather silly, merge them together? It'll allow for code to be reused on mobs with arbitarily many hands
-#define TOTAL_LAYERS 20 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
+#define BODY_LAYER 21 //underwear, eyes, lips(makeup)
+#define MUTATIONS_LAYER 20 //Tk headglows etc.
+#define DAMAGE_LAYER 19 //damage indicators (cuts and burns)
+#define UNIFORM_LAYER 18
+#define ID_LAYER 17
+#define SHOES_LAYER 16
+#define GLOVES_LAYER 15
+#define EARS_LAYER 14
+#define SUIT_LAYER 13
+#define GLASSES_LAYER 12
+#define BELT_LAYER 11 //Possible make this an overlay of somethign required to wear a belt?
+#define SUIT_STORE_LAYER 10
+#define BACK_LAYER 9
+#define HAIR_LAYER 8 //TODO: make part of head layer?
+#define FACEMASK_LAYER 7
+#define HEAD_LAYER 6
+#define HANDCUFF_LAYER 5
+#define LEGCUFF_LAYER 4
+#define L_HAND_LAYER 3
+#define R_HAND_LAYER 2 //Having the two hands seperate seems rather silly, merge them together? It'll allow for code to be reused on mobs with arbitarily many hands
+#define FIRE_LAYER 1 //If you're on fire
+#define TOTAL_LAYERS 21 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
//////////////////////////////////
/mob/living/carbon/human
@@ -283,6 +284,17 @@ Please contact me on #coderbus IRC. ~Carnie x
apply_overlay(BODY_LAYER)
+
+/mob/living/carbon/human/update_fire()
+
+ remove_overlay(FIRE_LAYER)
+ if(on_fire)
+ overlays_lying[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Lying", "layer"=-FIRE_LAYER)
+ overlays_standing[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"=-FIRE_LAYER)
+
+ apply_overlay(FIRE_LAYER)
+
+
/* --------------------------------------- */
//For legacy support.
/mob/living/carbon/human/regenerate_icons()
@@ -308,6 +320,7 @@ Please contact me on #coderbus IRC. ~Carnie x
update_inv_handcuffed()
update_inv_legcuffed()
update_inv_pockets()
+ update_fire()
//Hud Stuff
update_hud()
@@ -658,7 +671,6 @@ Please contact me on #coderbus IRC. ~Carnie x
apply_overlay(L_HAND_LAYER)
-
//Human Overlays Indexes/////////
#undef BODY_LAYER
#undef MUTATIONS_LAYER
@@ -680,4 +692,5 @@ Please contact me on #coderbus IRC. ~Carnie x
#undef LEGCUFF_LAYER
#undef L_HAND_LAYER
#undef R_HAND_LAYER
+#undef FIRE_LAYER
#undef TOTAL_LAYERS
diff --git a/code/modules/mob/living/carbon/monkey/examine.dm b/code/modules/mob/living/carbon/monkey/examine.dm
index 869482b13f4..fa16619e4d2 100644
--- a/code/modules/mob/living/carbon/monkey/examine.dm
+++ b/code/modules/mob/living/carbon/monkey/examine.dm
@@ -32,6 +32,12 @@
msg += "It has minor burns.\n"
else
msg += "It has severe burns!\n"
+
+ if (src.fire_stacks > 0)
+ msg += "It's covered in something flammable.\n"
+ if (src.fire_stacks < 0)
+ msg += "It's soaked in water.\n"
+
if (src.stat == UNCONSCIOUS)
msg += "It isn't responding to anything around it; it seems to be asleep.\n"
msg += ""
diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm
index 46c817cfb33..859a99abb29 100644
--- a/code/modules/mob/living/carbon/monkey/life.dm
+++ b/code/modules/mob/living/carbon/monkey/life.dm
@@ -52,6 +52,9 @@
if(environment) // More error checking -- TLE
handle_environment(environment)
+ //Check if we're on fire
+ handle_fire()
+
//Status updates, death etc.
handle_regular_status_updates()
update_canmove()
@@ -327,10 +330,11 @@
var/turf/heat_turf = get_turf(src)
environment_heat_capacity = heat_turf.heat_capacity
- if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
- var/transfer_coefficient = 1
+ if(!on_fire)
+ if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
+ var/transfer_coefficient = 1
- handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
+ handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
if(stat != 2)
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
@@ -570,3 +574,11 @@
proc/handle_changeling()
if(mind && mind.changeling)
mind.changeling.regenerate()
+
+///FIRE CODE
+ handle_fire()
+ if(..())
+ return
+ adjustFireLoss(6)
+ return
+//END FIRE CODE
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm
index 59d31431d32..86ff0f77d8e 100644
--- a/code/modules/mob/living/carbon/monkey/update_icons.dm
+++ b/code/modules/mob/living/carbon/monkey/update_icons.dm
@@ -1,10 +1,11 @@
//Monkey Overlays Indexes////////
+#define M_FIRE_LAYER 6
#define M_MASK_LAYER 5
#define M_BACK_LAYER 4
#define M_HANDCUFF_LAYER 3
#define M_L_HAND_LAYER 2
#define M_R_HAND_LAYER 1
-#define M_TOTAL_LAYERS 5
+#define M_TOTAL_LAYERS 6
/////////////////////////////////
/mob/living/carbon/monkey
@@ -18,6 +19,7 @@
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_handcuffed(0)
+ update_fire()
update_icons()
//Hud Stuff
update_hud()
@@ -152,7 +154,24 @@
if(client)
client.screen |= contents
+/mob/living/carbon/monkey/update_fire()
+ overlays -= overlays_lying[M_FIRE_LAYER]
+ overlays -= overlays_standing[M_FIRE_LAYER]
+ if(on_fire)
+ overlays_lying[M_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Lying", "layer"= -M_FIRE_LAYER)
+ overlays_standing[M_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -M_FIRE_LAYER)
+ if(src.lying)
+ overlays += overlays_lying[M_FIRE_LAYER]
+ else
+ overlays += overlays_standing[M_FIRE_LAYER]
+ return
+ else
+ overlays_lying[M_FIRE_LAYER] = null
+ overlays_standing[M_FIRE_LAYER] = null
+
+
//Monkey Overlays Indexes////////
+#undef M_FIRE_LAYER
#undef M_MASK_LAYER
#undef M_BACK_LAYER
#undef M_HANDCUFF_LAYER
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 4fcf0733abb..d1bc68c69a8 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -263,6 +263,8 @@
ear_deaf = 0
ear_damage = 0
heal_overall_damage(1000, 1000)
+ fire_stacks = 0
+ on_fire = 0
buckled = initial(src.buckled)
if(iscarbon(src))
var/mob/living/carbon/C = src
@@ -276,6 +278,7 @@
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
+ update_fire()
regenerate_icons()
..()
return
@@ -434,7 +437,7 @@
del(G)
if(resisting)
L.visible_message("[L] resists!")
-
+ return
//unbuckling yourself
if(L.buckled && L.last_special <= world.time)
@@ -489,9 +492,19 @@
BD.attack_hand(usr)
C.open()
- //breaking out of handcuffs
+ //Stop drop and roll & Handcuffs
else if(iscarbon(L))
var/mob/living/carbon/CM = L
+ if(CM.on_fire && CM.canmove)
+ CM.fire_stacks -= 5
+ CM.weakened = 5
+ CM.visible_message("[CM] rolls on the floor, trying to put themselves out!", \
+ "You stop, drop, and roll!")
+ if(fire_stacks <= 0)
+ CM.visible_message("[CM] has successfully extinguished themselves!", \
+ "You extinguish yourself.")
+ ExtinguishMob()
+ return
if(CM.handcuffed && CM.canmove && (CM.last_special <= world.time))
CM.next_move = world.time + 100
CM.last_special = world.time + 100
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index 8d7c4143076..336fc3e5068 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -73,4 +73,42 @@
var/mob/M = assailant.mob
src.attack_log += text("\[[time_stamp()]\] Has been hit with [O], last touched by [M.name] ([assailant.ckey])")
M.attack_log += text("\[[time_stamp()]\] Hit [src.name] ([src.ckey]) with [O]")
- log_attack("[src.name] ([src.ckey]) was hit by [O], last touched by [M.name] ([assailant.ckey])")
\ No newline at end of file
+ log_attack("[src.name] ([src.ckey]) was hit by [O], last touched by [M.name] ([assailant.ckey])")
+
+//Mobs on Fire
+/mob/living/proc/IgniteMob()
+ if(fire_stacks > 0)
+ on_fire = 1
+ update_fire()
+
+/mob/living/proc/ExtinguishMob()
+ if(on_fire)
+ on_fire = 0
+ fire_stacks = 0
+ update_fire()
+
+/mob/living/proc/update_fire()
+ return
+
+/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
+ fire_stacks = Clamp(fire_stacks + add_fire_stacks, min = -20, max = 20)
+
+/mob/living/proc/handle_fire()
+ if(fire_stacks < 0)
+ fire_stacks++ //If we've doused ourselves in water to avoid fire, dry off slowly
+ fire_stacks = min(0, fire_stacks)//So we dry ourselves back to default, nonflammable.
+ if(!on_fire)
+ return 1
+ var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
+ if(G.oxygen < 1)
+ ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
+ return
+ var/turf/location = get_turf(src)
+ location.hotspot_expose(700, 50, 1)
+
+/mob/living/fire_act()
+ adjust_fire_stacks(5)
+ if(fire_stacks > 9 && !on_fire)
+ IgniteMob()
+
+//Mobs on Fire end
\ No newline at end of file
diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm
index e1a3d295676..4d026c5c532 100644
--- a/code/modules/mob/living/living_defines.dm
+++ b/code/modules/mob/living/living_defines.dm
@@ -37,4 +37,7 @@
var/cameraFollow = null
var/tod = null // Time of death
- var/update_slimes = 1
\ No newline at end of file
+ var/update_slimes = 1
+
+ var/on_fire = 0 //The "Are we on fire?" var
+ var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20
\ No newline at end of file
diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm
index 997dcccde37..41be911e75e 100644
--- a/code/modules/mob/living/silicon/robot/death.dm
+++ b/code/modules/mob/living/silicon/robot/death.dm
@@ -59,7 +59,7 @@
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
updateicon()
-
+ update_fire()
tod = worldtime2text() //weasellos time of death patch
if(mind) mind.store_memory("Time of death: [tod]", 0)
diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm
index e42d5e8f31a..03a791a4973 100644
--- a/code/modules/mob/living/silicon/robot/examine.dm
+++ b/code/modules/mob/living/silicon/robot/examine.dm
@@ -20,6 +20,10 @@
msg += "It looks severely burnt and heat-warped!\n"
if (src.health < -50)
msg += "It looks barely operational.\n"
+ if (src.fire_stacks < 0)
+ msg += "It's covered in water.\n"
+ if (src.fire_stacks > 0)
+ msg += "It's coated in something flammable.\n"
msg += ""
if(opened)
diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm
index bb1a3eacc1d..24b7c72241a 100644
--- a/code/modules/mob/living/silicon/robot/life.dm
+++ b/code/modules/mob/living/silicon/robot/life.dm
@@ -20,7 +20,7 @@
process_killswitch()
process_locks()
update_canmove()
-
+ handle_fire()
@@ -306,6 +306,26 @@
weapon_lock = 0
weaponlock_time = 120
+//Robots on fire
+/mob/living/silicon/robot/handle_fire()
+ if(..())
+ return
+ adjustFireLoss(3)
+ return
+
+/mob/living/silicon/robot/update_fire()
+ overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
+ if(on_fire)
+ overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
+ update_icons()
+ return
+
+/mob/living/silicon/robot/fire_act()
+ if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
+ IgniteMob()
+
+//Robots on fire
+
/mob/living/silicon/robot/update_canmove()
if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0
else canmove = 1
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 07aa7c7d67c..0d2ae6eb9b1 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -801,6 +801,8 @@
overlays += "ov-openpanel +c"
else
overlays += "ov-openpanel -c"
+
+ update_fire()
return
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index d943a0e8fef..f28b503f533 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -470,3 +470,7 @@
if (M.occupant)
return 0
return 1
+
+
+/mob/living/simple_animal/update_fire()
+ return
diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm
index cbbc734bc85..53db0f98999 100644
--- a/code/modules/reagents/Chemistry-Reagents.dm
+++ b/code/modules/reagents/Chemistry-Reagents.dm
@@ -258,6 +258,15 @@ datum
cube.Expand()
return
+ reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with water can help put them out!
+ if(!istype(M, /mob/living))
+ return
+ if(method == TOUCH)
+ M.adjust_fire_stacks(-(volume / 10))
+ if(M.fire_stacks <= 0)
+ M.ExtinguishMob()
+ return
+
water/holywater
name = "Holy Water"
id = "holywater"
@@ -729,6 +738,13 @@ datum
reagent_state = LIQUID
color = "#660000" // rgb: 102, 0, 0
+ reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with welding fuel to make them easy to ignite!
+ if(!istype(M, /mob/living))
+ return
+ if(method == TOUCH)
+ M.adjust_fire_stacks(volume / 10)
+ return
+
//Commenting this out as it's horribly broken. It's a neat effect though, so it might be worth making a new reagent (that is less common) with similar effects. -Pete
/*
reaction_obj(var/obj/O, var/volume)
@@ -1321,6 +1337,13 @@ datum
T.atmos_spawn_air("fuel", 5)
return
+ reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with plasma is stronger than fuel!
+ if(!istype(M, /mob/living))
+ return
+ if(method == TOUCH)
+ M.adjust_fire_stacks(volume / 5)
+ return
+
toxin/lexorin
name = "Lexorin"
id = "lexorin"
@@ -2703,6 +2726,13 @@ datum
usr << "It wasn't enough..."
return
+ reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with ethanol isn't quite as good as fuel.
+ if(!istype(M, /mob/living))
+ return
+ if(method == TOUCH)
+ M.adjust_fire_stacks(volume / 15)
+ return
+
ethanol/beer
name = "Beer"
id = "beer"
diff --git a/icons/mob/OnFire.dmi b/icons/mob/OnFire.dmi
new file mode 100644
index 00000000000..52c6ad88a1c
Binary files /dev/null and b/icons/mob/OnFire.dmi differ