Being able to set people on FIRE

This commit is contained in:
ZomgPonies
2013-09-28 22:48:13 -04:00
parent d740274baa
commit 41efc56511
26 changed files with 342 additions and 109 deletions
+15 -8
View File
@@ -86,14 +86,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)
@@ -141,6 +142,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
@@ -53,6 +53,8 @@
//stuff in the stomach
handle_stomach()
//Handle being on fire
handle_fire()
//Status updates, death etc.
handle_regular_status_updates()
@@ -4,7 +4,8 @@
#define X_L_HAND_LAYER 3
#define X_R_HAND_LAYER 4
#define TARGETED_LAYER 5
#define X_TOTAL_LAYERS 5
#define X_FIRE_LAYER 6
#define X_TOTAL_LAYERS 6
/////////////////////////////////
/mob/living/carbon/alien/humanoid
@@ -49,6 +50,7 @@
update_inv_pockets(0)
update_hud()
update_icons()
update_fire()
/mob/living/carbon/alien/humanoid/update_hud()
@@ -58,7 +60,20 @@
// else client.screen -= hud_used.other //Not used
client.screen |= contents
/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
/mob/living/carbon/alien/humanoid/update_inv_wear_suit(var/update_icons=1)
if(wear_suit)
@@ -151,4 +166,5 @@
#undef X_L_HAND_LAYER
#undef X_R_HAND_LAYER
#undef TARGETED_LAYER
#undef X_FIRE_LAYER
#undef X_TOTAL_LAYERS
@@ -221,13 +221,18 @@
msg += "<span class='warning'>"
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)
/*if(usr.nutrition < 100)
if(usr.nutrition < 100)
msg += "[t_He] [t_is] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n"
else*/
msg += "[t_He] [t_is] quite chubby.\n"
else
msg += "[t_He] [t_is] quite chubby.\n"
msg += "</span>"
+26 -12
View File
@@ -90,6 +90,9 @@
handle_virus_updates()
//Check if we're on fire
handle_fire()
//stuff in the stomach
handle_stomach()
@@ -557,18 +560,19 @@
// log_debug("Adjusting to atmosphere.")
//After then, it reacts to the surrounding atmosphere based on your thermal protection
if(loc_temp < BODYTEMP_COLD_DAMAGE_LIMIT) //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)
var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX)
// log_debug("[loc_temp] is Cold. Cooling by [amt]")
bodytemperature += amt
else if (loc_temp > BODYTEMP_HEAT_DAMAGE_LIMIT) //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)
var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX)
// log_debug("[loc_temp] is Heat. Heating up by [amt]")
bodytemperature += amt
if(!on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases
if(loc_temp < BODYTEMP_COLD_DAMAGE_LIMIT) //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)
var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX)
// log_debug("[loc_temp] is Cold. Cooling by [amt]")
bodytemperature += amt
else if (loc_temp > BODYTEMP_HEAT_DAMAGE_LIMIT) //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)
var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX)
// log_debug("[loc_temp] is Heat. Heating up by [amt]")
bodytemperature += amt
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
@@ -628,6 +632,16 @@
pl_effects()
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
@@ -119,7 +119,8 @@ Please contact me on #coderbus IRC. ~Carn x
#define R_HAND_LAYER 20
#define TAIL_LAYER 21 //bs12 specific. this hack is probably gonna come back to haunt me
#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
@@ -129,6 +130,20 @@ Please contact me on #coderbus IRC. ~Carn x
var/icon/race_icon
var/icon/deform_icon
/mob/living/carbon/human/proc/apply_overlay(cache_index)
var/image/I = lying ? overlays_lying[cache_index] : overlays_standing[cache_index]
if(I)
overlays += I
/mob/living/carbon/human/proc/remove_overlay(cache_index)
if(overlays_lying[cache_index])
overlays -= overlays_lying[cache_index]
overlays_lying[cache_index] = null
if(overlays_standing[cache_index])
overlays -= overlays_standing[cache_index]
overlays_standing[cache_index] = null
//UPDATES OVERLAYS FROM OVERLAYS_LYING/OVERLAYS_STANDING
//this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers
//I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date.
@@ -457,6 +472,15 @@ proc/get_damage_icon_part(damage_state, body_part)
overlays_standing[TARGETED_LAYER] = null
if(update_icons) update_icons()
/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.
@@ -486,7 +510,7 @@ proc/get_damage_icon_part(damage_state, body_part)
update_icons()
//Hud Stuff
update_hud()
update_fire()
/* --------------------------------------- */
//vvvvvv UPDATE_INV PROCS vvvvvv
@@ -896,4 +920,5 @@ proc/get_damage_icon_part(damage_state, body_part)
#undef R_HAND_LAYER
#undef TAIL_LAYER
#undef TARGETED_LAYER
#undef FIRE_LAYER
#undef TOTAL_LAYERS
@@ -32,6 +32,10 @@
msg += "It has minor burns.\n"
else
msg += "<B>It has severe burns!</B>\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 += "</span>"
+15 -3
View File
@@ -55,6 +55,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()
@@ -380,10 +383,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)
@@ -657,3 +661,11 @@
proc/handle_changeling()
if(mind && mind.changeling)
mind.changeling.regenerate()
///FIRE CODE
handle_fire()
if(..())
return
adjustFireLoss(6)
return
//END FIRE CODE
@@ -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 7
#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()
update_icons()
//Hud Stuff
update_hud()
@@ -115,6 +117,21 @@
overlays_standing[TARGETED_LAYER] = null
if(update_icons) update_icons()
/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_MASK_LAYER
#undef M_BACK_LAYER
@@ -122,5 +139,6 @@
#undef M_L_HAND_LAYER
#undef M_R_HAND_LAYER
#undef TARGETED_LAYER
#undef M_FIRE_LAYER
#undef M_TOTAL_LAYERS
+3
View File
@@ -287,6 +287,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
@@ -297,6 +299,7 @@
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
update_fire()
regenerate_icons()
..()
return
+39 -1
View File
@@ -127,4 +127,42 @@
return 0
// End BS12 momentum-transfer code.
// End BS12 momentum-transfer code.
//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
@@ -35,6 +35,8 @@
var/tod = null // Time of death
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
var/silent = null //Can't talk. Value goes down every life proc.
var/specialsauce = 0 //Has this person consumed enough special sauce? IF so they're a ticking time bomb of death.
var/implanting = 0 //Used for the mind-slave implant
@@ -61,7 +61,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)
@@ -18,6 +18,10 @@
msg += "It looks slightly charred.\n"
else
msg += "<B>It looks severely burnt and heat-warped!</B>\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 += "</span>"
if(opened)
+22 -1
View File
@@ -19,6 +19,7 @@
process_killswitch()
process_locks()
update_canmove()
handle_fire()
/mob/living/silicon/robot/proc/clamp_values()
@@ -305,4 +306,24 @@
/mob/living/silicon/robot/update_canmove()
if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0
else canmove = 1
return canmove
return canmove
//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
@@ -1021,6 +1021,9 @@
icon_state = base_icon
return
/mob/living/silicon/robot/proc/updatefire()
return
//Call when target overlay should be added/removed
/mob/living/silicon/robot/update_targeted()
if(!targeted_by && target_locked)
@@ -462,3 +462,6 @@
if (M.occupant)
return 0
return 1
/mob/living/simple_animal/update_fire()
return
+12 -1
View File
@@ -663,6 +663,7 @@
if(resisting)
for(var/mob/O in viewers(usr, null))
O.show_message(text("\red <B>[] resists!</B>", L), 1)
return
//unbuckling yourself
@@ -753,9 +754,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("<span class='danger'>[CM] rolls on the floor, trying to put themselves out!</span>", \
"<span class='notice'>You stop, drop, and roll!</span>")
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
+26 -1
View File
@@ -259,6 +259,14 @@ datum
if(!cube.wrapped)
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
lube
name = "Space Lube"
@@ -1169,7 +1177,12 @@ 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
reaction_obj(var/obj/O, var/volume)
var/turf/the_turf = get_turf(O)
if(!the_turf)
@@ -1317,6 +1330,12 @@ datum
napalm.trace_gases += fuel
T.assume_air(napalm)
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
leporazine
name = "Leporazine"
@@ -1861,6 +1880,12 @@ datum
else
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
*/
ammonia
name = "Ammonia"