Merge branch 'master' into upstream-merge-34686

This commit is contained in:
deathride58
2018-01-21 22:38:47 +00:00
committed by GitHub
83 changed files with 882 additions and 1372 deletions
@@ -74,6 +74,8 @@
/datum/emote/living/carbon/human/wag/run_emote(mob/user, params)
. = ..()
if(!.)
return
var/mob/living/carbon/human/H = user
if(!H.is_wagging_tail())
H.startTailWag()
+21 -16
View File
@@ -1623,24 +1623,29 @@ GLOBAL_LIST_EMPTY(roundstart_races)
var/loc_temp = H.get_temperature(environment)
//Body temperature is adjusted in two steps. First, your body tries to stabilize itself a bit.
if(H.stat != DEAD)
H.natural_bodytemperature_stabilization()
//Then, it reacts to the surrounding atmosphere based on your thermal protection
//Body temperature is adjusted in two parts: first there your body tries to naturally preserve homeostasis (shivering/sweating), then it reacts to the surrounding environment
//Thermal protection (insulation) has mixed benefits in two situations (hot in hot places, cold in hot places)
if(!H.on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases
if(loc_temp < H.bodytemperature)
//Place is colder than we are
var/thermal_protection = H.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)
H.bodytemperature += min((1-thermal_protection) * ((loc_temp - H.bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX)
else
//Place is hotter than we are
var/thermal_protection = H.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)
H.bodytemperature += min((1-thermal_protection) * ((loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX)
if((abs(BODYTEMP_NORMAL - H.bodytemperature) <= 5) && (abs(BODYTEMP_NORMAL - loc_temp) <= 25))
return //Performance saver
var/natural = 0
if(H.stat != DEAD)
natural = H.natural_bodytemperature_stabilization()
var/thermal_protection = 1
if(loc_temp < H.bodytemperature) //Place is colder than we are
thermal_protection -= H.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(H.bodytemperature < BODYTEMP_NORMAL) //we're cold, insulation helps us retain body heat and will reduce the heat we lose to the environment
H.bodytemperature += (thermal_protection+1)*natural + max(thermal_protection * (loc_temp - H.bodytemperature) / BODYTEMP_COLD_DIVISOR, BODYTEMP_COOLING_MAX)
else //we're sweating, insulation hinders our ability to reduce heat - and it will reduce the amount of cooling you get from the environment
H.bodytemperature += natural*(1/(thermal_protection+1)) + max((thermal_protection * (loc_temp - H.bodytemperature) + BODYTEMP_NORMAL - H.bodytemperature) / BODYTEMP_COLD_DIVISOR , BODYTEMP_COOLING_MAX) //Extra calculation for hardsuits to bleed off heat
else //Place is hotter than we are
thermal_protection -= H.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(H.bodytemperature < BODYTEMP_NORMAL) //and we're cold, insulation enhances our ability to retain body heat but reduces the heat we get from the environment
H.bodytemperature += (thermal_protection+1)*natural + min(thermal_protection * (loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR, BODYTEMP_HEATING_MAX)
else //we're sweating, insulation hinders out ability to reduce heat - but will reduce the amount of heat we get from the environment
H.bodytemperature += natural*(1/(thermal_protection+1)) + min(thermal_protection * (loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR, BODYTEMP_HEATING_MAX)
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
// +/- 50 degrees from 310K is the 'safe' zone, where no damage is dealt.
if(H.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !(RESISTHOT in species_traits))
//Body temperature is too hot.
var/burn_damage
+8 -9
View File
@@ -396,15 +396,14 @@
/mob/living/carbon/proc/natural_bodytemperature_stabilization()
var/body_temperature_difference = BODYTEMP_NORMAL - bodytemperature
switch(bodytemperature)
if(-INFINITY to BODYTEMP_COLD_DAMAGE_LIMIT) //BODYTEMP_COLD_DAMAGE_LIMIT is BODYTEMP_NORMAL(310.15) - 50, the temperature where you start to feel effects.
bodytemperature += max((body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
if(-INFINITY to BODYTEMP_COLD_DAMAGE_LIMIT) //Cold damage limit is 50 below the default, the temperature where you start to feel effects.
return max((body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
if(BODYTEMP_COLD_DAMAGE_LIMIT to BODYTEMP_NORMAL)
bodytemperature += max(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, min(body_temperature_difference, BODYTEMP_AUTORECOVERY_MINIMUM/4))
if(BODYTEMP_NORMAL to BODYTEMP_HEAT_DAMAGE_LIMIT)
bodytemperature += min(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, max(body_temperature_difference, -BODYTEMP_AUTORECOVERY_MINIMUM/4))
if(BODYTEMP_HEAT_DAMAGE_LIMIT to INFINITY) //BODYTEMP_HEAT_DAMAGE_LIMIT is BODYTEMP_NORMAL(310.15) + 50, the temperature where you start to feel effects.
//We totally need a sweat system cause it totally makes sense...~
bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
return max(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, min(body_temperature_difference, BODYTEMP_AUTORECOVERY_MINIMUM/4))
if(BODYTEMP_NORMAL to BODYTEMP_HEAT_DAMAGE_LIMIT) // Heat damage limit is 50 above the default, the temperature where you start to feel effects.
return min(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, max(body_temperature_difference, -BODYTEMP_AUTORECOVERY_MINIMUM/4))
if(BODYTEMP_HEAT_DAMAGE_LIMIT to INFINITY)
return min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
/////////
//LIVER//
/////////
@@ -460,4 +459,4 @@
death()
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
if(B)
B.damaged_brain = TRUE
B.damaged_brain = TRUE
@@ -66,7 +66,7 @@
var/loc_temp = get_temperature(environment)
if(stat != DEAD)
natural_bodytemperature_stabilization()
bodytemperature += natural_bodytemperature_stabilization()
if(!on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases
if(loc_temp < bodytemperature)
@@ -247,7 +247,7 @@
if(prob(75))
var/turf/open/T = loc
if(istype(T))
T.MakeSlippery(min_wet_time = 20, wet_time_to_add = 15)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 20, wet_time_to_add = 15)
else
visible_message("<span class='danger'>[src] whirs and bubbles violently, before releasing a plume of froth!</span>")
new /obj/effect/particle_effect/foam(loc)
@@ -231,7 +231,7 @@
var/atom/A = src.loc
if(isturf(A))
var/areatemp = get_temperature(environment)
if( abs(areatemp - bodytemperature) > 40 )
if( abs(areatemp - bodytemperature) > 5)
var/diff = areatemp - bodytemperature
diff = diff / 5
bodytemperature += diff
@@ -339,6 +339,14 @@
if(L in Friends) // No eating friends!
continue
var/ally = FALSE
for(var/F in faction)
if(F in L.faction)
ally = TRUE
break
if(ally)
continue
if(issilicon(L) && (rabid || attacked)) // They can't eat silicons, but they can glomp them in defence
targets += L // Possible target found!
+7 -3
View File
@@ -212,9 +212,13 @@
R.stun(20)
return
if(stepTurf.flags_1 & NOJAUNT_1)
to_chat(L, "<span class='warning'>Holy energies block your path.</span>")
else
L.loc = get_step(L, direct)
to_chat(L, "<span class='warning'>Some strange aura is blocking the way.</span>")
return
if (locate(/obj/effect/blessing, stepTurf))
to_chat(L, "<span class='warning'>Holy energies block your path!</span>")
return
L.loc = get_step(L, direct)
L.setDir(direct)
return TRUE
+1 -1
View File
@@ -492,7 +492,7 @@
// if a light is turned off, it won't activate emergency power
/obj/machinery/light/proc/turned_off()
var/area/A = get_area(src)
return !A.lightswitch && A.power_light || !flickering
return !A.lightswitch && A.power_light || flickering
// returns whether this light has power
// true if area has power and lightswitch is on
+3 -3
View File
@@ -158,7 +158,7 @@
if(istype(target, /datum/reagents))
R = target
else
if(!target.reagents || src.total_volume<=0)
if(!target.reagents)
return
R = target.reagents
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
@@ -181,14 +181,14 @@
/datum/reagents/proc/copy_to(obj/target, amount=1, multiplier=1, preserve_data=1)
var/list/cached_reagents = reagent_list
if(!target)
if(!target || !total_volume)
return
var/datum/reagents/R
if(istype(target, /datum/reagents))
R = target
else
if(!target.reagents || src.total_volume<=0)
if(!target.reagents)
return
R = target.reagents
@@ -459,7 +459,7 @@
reac_volume = ..()
var/turf/open/T = get_turf(M)
if(istype(T) && prob(reac_volume))
T.MakeSlippery(min_wet_time = 10, wet_time_to_add = 5)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = 5)
M.adjust_fire_stacks(-(reac_volume / 10))
M.ExtinguishMob()
M.apply_damage(0.4*reac_volume, BRUTE)
@@ -481,7 +481,7 @@
/datum/reagent/blob/pressurized_slime/proc/extinguisharea(obj/structure/blob/B, probchance)
for(var/turf/open/T in range(1, B))
if(prob(probchance))
T.MakeSlippery(min_wet_time = 10, wet_time_to_add = 5)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = 5)
for(var/obj/O in T)
O.extinguish()
for(var/mob/living/L in T)
@@ -124,7 +124,7 @@
if(!istype(T))
return
if(reac_volume >= 5)
T.MakeSlippery(min_wet_time = 10, wet_time_to_add = reac_volume * 1.5)
T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10, wet_time_to_add = reac_volume * 1.5)
T.name = "deep-fried [initial(T.name)]"
T.add_atom_colour(color, TEMPORARY_COLOUR_PRIORITY)
@@ -213,29 +213,31 @@
taste_description = "mint"
/datum/reagent/consumable/frostoil/on_mob_life(mob/living/M)
switch(current_cycle)
if(1 to 15)
M.bodytemperature -= 10 * TEMPERATURE_DAMAGE_COEFFICIENT
if(holder.has_reagent("capsaicin"))
holder.remove_reagent("capsaicin", 5)
if(isslime(M))
M.bodytemperature -= rand(5,20)
if(15 to 25)
M.bodytemperature -= 20 * TEMPERATURE_DAMAGE_COEFFICIENT
if(isslime(M))
M.bodytemperature -= rand(10,20)
if(25 to 35)
M.bodytemperature -= 30 * TEMPERATURE_DAMAGE_COEFFICIENT
if(prob(1))
M.emote("shiver")
if(isslime(M))
M.bodytemperature -= rand(15,20)
if(35 to INFINITY)
M.bodytemperature -= 40 * TEMPERATURE_DAMAGE_COEFFICIENT
if(prob(5))
M.emote("shiver")
if(isslime(M))
M.bodytemperature -= rand(20,25)
if(M.bodytemperature > 50)
switch(current_cycle)
if(1 to 15)
M.bodytemperature -= 10 * TEMPERATURE_DAMAGE_COEFFICIENT
if(holder.has_reagent("capsaicin"))
holder.remove_reagent("capsaicin", 5)
if(isslime(M))
M.bodytemperature -= rand(5,20)
if(15 to 25)
M.bodytemperature -= 20 * TEMPERATURE_DAMAGE_COEFFICIENT
if(isslime(M))
M.bodytemperature -= rand(10,20)
if(25 to 35)
M.bodytemperature -= 30 * TEMPERATURE_DAMAGE_COEFFICIENT
if(prob(1))
M.emote("shiver")
if(isslime(M))
M.bodytemperature -= rand(15,20)
if(35 to INFINITY)
M.bodytemperature -= 40 * TEMPERATURE_DAMAGE_COEFFICIENT
if(prob(5))
M.emote("shiver")
if(isslime(M))
M.bodytemperature -= rand(20,25)
M.bodytemperature = max(50, M.bodytemperature)
..()
/datum/reagent/consumable/frostoil/reaction_turf(turf/T, reac_volume)
@@ -430,7 +432,7 @@
/datum/reagent/consumable/cornoil/reaction_turf(turf/open/T, reac_volume)
if (!istype(T))
return
T.MakeSlippery(min_wet_time = 10, wet_time_to_add = reac_volume*2)
T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10, wet_time_to_add = reac_volume*2)
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles())
@@ -130,7 +130,7 @@
var/CT = cooling_temperature
if(reac_volume >= 5)
T.MakeSlippery(min_wet_time = 10, wet_time_to_add = min(reac_volume*1.5, 60))
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = min(reac_volume*1.5, 60))
for(var/mob/living/simple_animal/slime/M in T)
M.apply_water()
@@ -614,11 +614,13 @@
/datum/reagent/oxygen/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
return 0
O.atmos_spawn_air("o2=[reac_volume/2];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
O.atmos_spawn_air("o2=[reac_volume/2];TEMP=[temp]")
/datum/reagent/oxygen/reaction_turf(turf/open/T, reac_volume)
if(istype(T))
T.atmos_spawn_air("o2=[reac_volume/2];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
T.atmos_spawn_air("o2=[reac_volume/2];TEMP=[temp]")
return
/datum/reagent/copper
@@ -640,11 +642,13 @@
/datum/reagent/nitrogen/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
return 0
O.atmos_spawn_air("n2=[reac_volume/2];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
O.atmos_spawn_air("n2=[reac_volume/2];TEMP=[temp]")
/datum/reagent/nitrogen/reaction_turf(turf/open/T, reac_volume)
if(istype(T))
T.atmos_spawn_air("n2=[reac_volume/2];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
T.atmos_spawn_air("n2=[reac_volume/2];TEMP=[temp]")
return
/datum/reagent/hydrogen
@@ -1119,11 +1123,13 @@
/datum/reagent/carbondioxide/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
return 0
O.atmos_spawn_air("co2=[reac_volume/5];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
O.atmos_spawn_air("co2=[reac_volume/5];TEMP=[temp]")
/datum/reagent/carbondioxide/reaction_turf(turf/open/T, reac_volume)
if(istype(T))
T.atmos_spawn_air("co2=[reac_volume/5];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
T.atmos_spawn_air("co2=[reac_volume/5];TEMP=[temp]")
return
/datum/reagent/nitrous_oxide
@@ -1138,11 +1144,13 @@
/datum/reagent/nitrous_oxide/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
return 0
O.atmos_spawn_air("n2o=[reac_volume/5];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
O.atmos_spawn_air("n2o=[reac_volume/5];TEMP=[temp]")
/datum/reagent/nitrous_oxide/reaction_turf(turf/open/T, reac_volume)
if(istype(T))
T.atmos_spawn_air("n2o=[reac_volume/5];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
T.atmos_spawn_air("n2o=[reac_volume/5];TEMP=[temp]")
/datum/reagent/nitrous_oxide/reaction_mob(mob/M, method=TOUCH, reac_volume)
if(method == VAPOR)
@@ -187,7 +187,7 @@
/datum/reagent/cryostylane/on_mob_life(mob/living/M) //TODO: code freezing into an ice cube
if(M.reagents.has_reagent("oxygen"))
M.reagents.remove_reagent("oxygen", 0.5)
M.bodytemperature -= 15
M.bodytemperature = max(M.bodytemperature - 15,0)
..()
/datum/reagent/cryostylane/reaction_turf(turf/T, reac_volume)
@@ -73,11 +73,13 @@
/datum/reagent/toxin/plasma/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
return 0
O.atmos_spawn_air("plasma=[reac_volume];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
O.atmos_spawn_air("plasma=[reac_volume];TEMP=[temp]")
/datum/reagent/toxin/plasma/reaction_turf(turf/open/T, reac_volume)
if(istype(T))
T.atmos_spawn_air("plasma=[reac_volume];TEMP=[T20C]")
var/temp = holder ? holder.chem_temp : T20C
T.atmos_spawn_air("plasma=[reac_volume];TEMP=[temp]")
return
/datum/reagent/toxin/plasma/reaction_mob(mob/living/M, method=TOUCH, reac_volume)//Splashing people with plasma is stronger than fuel!
@@ -346,15 +346,17 @@
id = "cryostylane_oxygen"
results = list("cryostylane" = 1)
required_reagents = list("cryostylane" = 1, "oxygen" = 1)
mob_react = FALSE
/datum/chemical_reaction/cryostylane_oxygen/on_reaction(datum/reagents/holder, created_volume)
holder.chem_temp -= 10*created_volume
holder.chem_temp = max(holder.chem_temp - 10*created_volume,0)
/datum/chemical_reaction/pyrosium_oxygen
name = "ephemeral pyrosium reaction"
id = "pyrosium_oxygen"
results = list("pyrosium" = 1)
required_reagents = list("pyrosium" = 1, "oxygen" = 1)
mob_react = FALSE
/datum/chemical_reaction/pyrosium_oxygen/on_reaction(datum/reagents/holder, created_volume)
holder.chem_temp += 10*created_volume
@@ -85,12 +85,18 @@
return
var/turf/newLoc = get_step(src,direction)
setDir(direction)
if(!(newLoc.flags_1 & NOJAUNT_1))
forceMove(newLoc)
else
to_chat(user, "<span class='warning'>Some strange aura is blocking the way!</span>")
movedelay = world.time + movespeed
if(newLoc.flags_1 & NOJAUNT_1)
to_chat(user, "<span class='warning'>Some strange aura is blocking the way.</span>")
return
if (locate(/obj/effect/blessing, newLoc))
to_chat(user, "<span class='warning'>Holy energies block your path!</span>")
return
forceMove(newLoc)
/obj/effect/dummy/spell_jaunt/ex_act(blah)
return
/obj/effect/dummy/spell_jaunt/bullet_act(blah)