Ported TG's code for burny mobs, by ergoslavi.

This commit is contained in:
Chinsky
2015-01-15 23:47:07 +03:00
parent 476ac0e530
commit 95e4f53258
15 changed files with 158 additions and 9 deletions
@@ -219,7 +219,10 @@
usr << "<span class='deadsay'>[t_He] has no pulse[src.client ? "" : " and [t_his] soul has departed"]...</span>"
else
usr << "<span class='deadsay'>[t_He] has a pulse!</span>"
if(fire_stacks)
msg += "[t_He] [t_is] covered in some liquid.\n"
if(fire_stacks)
msg += "<span class='warning'>[t_He] [t_is] on fire!.</span>\n"
msg += "<span class='warning'>"
if(nutrition < 100)
@@ -112,6 +112,9 @@
//Handle temperature/pressure differences between body and environment
handle_environment(environment) //Optimized a good bit.
//Check if we're on fire
handle_fire()
//Status updates, death etc.
handle_regular_status_updates() //Optimized a bit
update_canmove()
@@ -784,6 +787,8 @@
if (abs(body_temperature_difference) < 0.5)
return //fuck this precision
if (on_fire)
return //too busy for pesky convection
if(bodytemperature < species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects.
if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up.
@@ -1774,5 +1779,25 @@
speech_problem_flag = 1
return stuttering
/mob/living/carbon/human/handle_fire()
if(..())
return
var/thermal_protection = 0 //Simple check to estimate how protected we are against multiple temperatures
if(wear_suit)
if(wear_suit.max_heat_protection_temperature >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE)
thermal_protection += (wear_suit.max_heat_protection_temperature*0.7)
if(head)
if(head.max_heat_protection_temperature >= FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE)
thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD)
thermal_protection = round(thermal_protection)
if(thermal_protection >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE)
return
if(thermal_protection >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE)
bodytemperature += 11
return
else
bodytemperature += BODYTEMP_HEATING_MAX
return
#undef HUMAN_MAX_OXYLOSS
#undef HUMAN_CRIT_MAX_OXYLOSS
@@ -127,7 +127,8 @@ Please contact me on #coderbus IRC. ~Carn x
#define L_HAND_LAYER 20
#define R_HAND_LAYER 21
#define TARGETED_LAYER 22 //BS12: Layer for the target overlay from weapon targeting system
#define TOTAL_LAYERS 22
#define FIRE_LAYER 23 //If you're on fire
#define TOTAL_LAYERS 23
//////////////////////////////////
/mob/living/carbon/human
@@ -508,6 +509,7 @@ proc/get_damage_icon_part(damage_state, body_part)
update_inv_handcuffed(0)
update_inv_legcuffed(0)
update_inv_pockets(0)
update_fire(0)
UpdateDamageIcon()
update_icons()
//Hud Stuff
@@ -911,6 +913,13 @@ proc/get_damage_icon_part(damage_state, body_part)
if(update_icons) update_icons()
/mob/living/carbon/human/update_fire(var/update_icons=1)
overlays_standing[FIRE_LAYER] = null
if(on_fire)
overlays_standing[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"=-FIRE_LAYER)
if(update_icons) update_icons()
// Used mostly for creating head items
/mob/living/carbon/human/proc/generate_head_icon()
//gender no longer matters for the mouth, although there should probably be seperate base head icons.
@@ -969,4 +978,5 @@ proc/get_damage_icon_part(damage_state, body_part)
#undef L_HAND_LAYER
#undef R_HAND_LAYER
#undef TARGETED_LAYER
#undef FIRE_LAYER
#undef TOTAL_LAYERS
@@ -57,6 +57,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()
@@ -629,3 +632,9 @@
proc/handle_changeling()
if(mind && mind.changeling)
mind.changeling.regenerate()
/mob/living/carbon/monkey/handle_fire()
if(..())
return
adjustFireLoss(6)
return
@@ -5,7 +5,8 @@
#define M_L_HAND_LAYER 4
#define M_R_HAND_LAYER 5
#define TARGETED_LAYER 6
#define M_TOTAL_LAYERS 6
#define M_FIRE_LAYER 6
#define M_TOTAL_LAYERS 7
/////////////////////////////////
/mob/living/carbon/monkey
@@ -19,6 +20,7 @@
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_handcuffed(0)
update_fire(0)
update_icons()
//Hud Stuff
update_hud()
@@ -109,6 +111,12 @@
overlays_standing[TARGETED_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_fire(var/update_icons=1)
if(on_fire)
overlays_standing[M_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -M_FIRE_LAYER)
else
overlays_standing[M_FIRE_LAYER] = null
if(update_icons) update_icons()
//Monkey Overlays Indexes////////
#undef M_MASK_LAYER
#undef M_BACK_LAYER
@@ -116,5 +124,6 @@
#undef M_L_HAND_LAYER
#undef M_R_HAND_LAYER
#undef TARGETED_LAYER
#undef M_FIRE_LAYER
#undef M_TOTAL_LAYERS
+14 -1
View File
@@ -281,6 +281,8 @@
C.legcuffed = initial(C.legcuffed)
hud_updateflag |= 1 << HEALTH_HUD
hud_updateflag |= 1 << STATUS_HUD
ExtinguishMob()
fire_stacks = 0
/mob/living/proc/rejuvenate()
@@ -628,9 +630,20 @@
BD.attack_hand(usr)
C.open()
//breaking out of handcuffs
//drop && roll or breaking out of handcuffs
else if(iscarbon(L))
var/mob/living/carbon/CM = L
if(CM.on_fire && CM.canmove)
CM.fire_stacks -= 5
CM.Weaken(3)
CM.visible_message("<span class='danger'>[CM] rolls on the floor, trying to put themselves out!</span>", \
"<span class='notice'>You stop, drop, and roll!</span>")
sleep(30)
if(fire_stacks <= 0)
CM.visible_message("<span class='danger'>[CM] has successfully extinguished themselves!</span>", \
"<span class='notice'>You extinguish yourself.</span>")
ExtinguishMob()
return
if(CM.handcuffed && CM.canmove && (CM.last_special <= world.time))
CM.next_move = world.time + 100
CM.last_special = world.time + 100
+35
View File
@@ -191,3 +191,38 @@
src.visible_message("<span class='danger'>[user] has [attack_message] [src]!</span>")
spawn(1) updatehealth()
return 1
/mob/living/proc/IgniteMob()
if(fire_stacks > 0 && !on_fire)
on_fire = 1
src.AddLuminosity(3)
update_fire()
/mob/living/proc/ExtinguishMob()
if(on_fire)
on_fire = 0
fire_stacks = 0
src.AddLuminosity(-3)
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 = max(0, fire_stacks++) //If we've doused ourselves in water to avoid fire, dry off slowly
if(!on_fire)
return 1
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
if(G.gas["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(0.5)
IgniteMob()
+4 -1
View File
@@ -37,4 +37,7 @@
var/tod = null // Time of death
var/update_slimes = 1
var/silent = null //Can't talk. Value goes down every life proc.
var/silent = null //Can't talk. Value goes down every life proc.
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