Makes blob creatures be able to be set on fire (#15076)

This commit is contained in:
Farie82
2020-12-16 19:57:45 +01:00
committed by GitHub
parent 46d7019414
commit 8a20f24bb9
3 changed files with 36 additions and 13 deletions
+4 -3
View File
@@ -183,20 +183,21 @@
if(fire_stacks < 0) //If we've doused ourselves in water to avoid fire, dry off slowly
fire_stacks = min(0, fire_stacks + 1)//So we dry ourselves back to default, nonflammable.
if(!on_fire)
return 1
return FALSE
if(fire_stacks > 0)
adjust_fire_stacks(-0.1) //the fire is slowly consumed
for(var/obj/item/clothing/C in contents)
C.catch_fire()
else
ExtinguishMob()
return
return FALSE
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
return FALSE
var/turf/location = get_turf(src)
location.hotspot_expose(700, 50, 1)
return TRUE
/mob/living/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
@@ -36,8 +36,14 @@
//Temperature effect
var/minbodytemp = 250
var/maxbodytemp = 350
var/heat_damage_per_tick = 2 //amount of damage applied if animal's body temperature is higher than maxbodytemp
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
/// Amount of damage applied if animal's body temperature is higher than maxbodytemp
var/heat_damage_per_tick = 2
/// Same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
var/cold_damage_per_tick = 2
/// If the mob can catch fire
var/can_be_on_fire = FALSE
/// Damage the mob will take if it is on fire
var/fire_damage = 2
//Healable by medical stacks? Defaults to yes.
var/healable = 1
@@ -394,13 +400,30 @@
return TRUE
/mob/living/simple_animal/handle_fire()
return TRUE
if(!can_be_on_fire)
return TRUE
. = ..()
if(!.)
return
adjustFireLoss(fire_damage) // Slowly start dying from being on fire
/mob/living/simple_animal/IgniteMob()
return FALSE
if(!can_be_on_fire)
return FALSE
return ..()
/mob/living/simple_animal/ExtinguishMob()
return
if(!can_be_on_fire)
return
return ..()
/mob/living/simple_animal/update_fire()
if(!can_be_on_fire)
return
overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning")
if(on_fire)
overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning")
/mob/living/simple_animal/revive()
..()