From 888b2e093e0004fc6c5276215ead817e1f2e5094 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Sun, 2 Jul 2017 20:14:42 -0400 Subject: [PATCH] Makes the lavaland pressure check a proc (#28954) * Makes the lavaland pressure check a proc * code that probably did nothing tm * sss * 50 should be a define instead --- code/__DEFINES/atmospherics.dm | 1 + code/__HELPERS/game.dm | 8 ++++++ code/game/mecha/working/ripley.dm | 16 ++++++------ code/modules/mining/equipment/resonator.dm | 8 ++---- .../mob/living/carbon/human/species.dm | 10 +++----- .../guns/energy/kinetic_accelerator.dm | 9 ++----- .../modules/projectiles/projectile/special.dm | 25 ++++++++----------- 7 files changed, 35 insertions(+), 42 deletions(-) diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index a3b6a34549f62..5ce803fa3cdd3 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -172,4 +172,5 @@ #define ATMOS_PASS_DENSITY -2 //just check density #define CANATMOSPASS(A, O) ( A.CanAtmosPass == ATMOS_PASS_PROC ? A.CanAtmosPass(O) : ( A.CanAtmosPass == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPass ) ) +#define LAVALAND_EQUIPMENT_EFFECT_PRESSURE 50 //what pressure you have to be under to increase the effect of equipment meant for lavaland #define LAVALAND_DEFAULT_ATMOS "o2=14;n2=23;TEMP=300" diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 7cf7370ae5b11..59619980580be 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -553,3 +553,11 @@ /proc/GetBluePart(const/hexa) return hex2num(copytext(hexa, 6, 8)) + +/proc/lavaland_equipment_pressure_check(turf/T) + if(!istype(T)) + return + var/datum/gas_mixture/environment = T.return_air() + var/pressure = environment.return_pressure() + if(pressure <= LAVALAND_EQUIPMENT_EFFECT_PRESSURE) + return TRUE diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 52b43af7817c4..2141cd5506327 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -1,10 +1,10 @@ /obj/mecha/working/ripley - desc = "Autonomous Power Loader Unit. This newer model is refitted with powerful armour against the dangers of the EVA mining process." + desc = "Autonomous Power Loader Unit. This newer model is refitted with powerful armour against the dangers of planetary mining." name = "\improper APLU \"Ripley\"" icon_state = "ripley" step_in = 4 //Move speed, lower is faster. - var/hi_pres_step_in = 4 //step_in while in high pressure. - var/lo_pres_step_in = 2 //step_in while in low/zero pressure. + var/fast_pressure_step_in = 4 //step_in while in normal pressure conditions + var/slow_pressure_step_in = 2 //step_in while in better pressure conditions max_temperature = 20000 obj_integrity = 200 max_integrity = 200 @@ -76,7 +76,7 @@ desc = "OH SHIT IT'S THE DEATHSQUAD WE'RE ALL GONNA DIE" name = "\improper DEATH-RIPLEY" icon_state = "deathripley" - hi_pres_step_in = 3 + slow_pressure_step_in = 3 opacity=0 lights_power = 7 wreckage = /obj/structure/mecha_wreckage/ripley/deathripley @@ -159,15 +159,13 @@ /obj/mecha/working/ripley/proc/update_pressure() var/turf/T = get_turf(loc) - var/datum/gas_mixture/environment = T.return_air() - var/pressure = environment.return_pressure() - if(pressure < 40) - step_in = lo_pres_step_in + if(lavaland_equipment_pressure_check(T)) + step_in = fast_pressure_step_in for(var/obj/item/mecha_parts/mecha_equipment/drill/drill in equipment) drill.equip_cooldown = initial(drill.equip_cooldown)/2 else - step_in = hi_pres_step_in + step_in = slow_pressure_step_in for(var/obj/item/mecha_parts/mecha_equipment/drill/drill in equipment) drill.equip_cooldown = initial(drill.equip_cooldown) diff --git a/code/modules/mining/equipment/resonator.dm b/code/modules/mining/equipment/resonator.dm index c54def1b2b792..5c110d09bf1eb 100644 --- a/code/modules/mining/equipment/resonator.dm +++ b/code/modules/mining/equipment/resonator.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/mining.dmi' icon_state = "resonator" item_state = "resonator" - desc = "A handheld device that creates small fields of energy that resonate until they detonate, crushing rock. It's more effective in a vacuum." + desc = "A handheld device that creates small fields of energy that resonate until they detonate, crushing rock. It does increased damage in low pressure." w_class = WEIGHT_CLASS_NORMAL force = 15 throwforce = 10 @@ -82,12 +82,8 @@ /obj/effect/temp_visual/resonance/proc/check_pressure(turf/proj_turf) if(!proj_turf) proj_turf = get_turf(src) - if(!istype(proj_turf)) - return - var/datum/gas_mixture/environment = proj_turf.return_air() - var/pressure = environment.return_pressure() resonance_damage = initial(resonance_damage) - if(pressure < 50) + if(lavaland_equipment_pressure_check(proj_turf)) name = "strong [initial(name)]" resonance_damage *= 3 else diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 4f01c3551e7a9..3f66fc72c174b 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1353,13 +1353,13 @@ //Body temperature is too hot. var/burn_damage switch(H.bodytemperature) - if(360 to 400) + if(BODYTEMP_HEAT_DAMAGE_LIMIT to 400) H.throw_alert("temp", /obj/screen/alert/hot, 1) burn_damage = HEAT_DAMAGE_LEVEL_1 if(400 to 460) H.throw_alert("temp", /obj/screen/alert/hot, 2) burn_damage = HEAT_DAMAGE_LEVEL_2 - if(460 to INFINITY) + else H.throw_alert("temp", /obj/screen/alert/hot, 3) if(H.on_fire) burn_damage = HEAT_DAMAGE_LEVEL_3 @@ -1371,17 +1371,15 @@ H.apply_damage(burn_damage, BURN) else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !(GLOB.mutations_list[COLDRES] in H.dna.mutations)) switch(H.bodytemperature) - if(200 to 260) + if(200 to BODYTEMP_COLD_DAMAGE_LIMIT) H.throw_alert("temp", /obj/screen/alert/cold, 1) H.apply_damage(COLD_DAMAGE_LEVEL_1*coldmod, BURN) if(120 to 200) H.throw_alert("temp", /obj/screen/alert/cold, 2) H.apply_damage(COLD_DAMAGE_LEVEL_2*coldmod, BURN) - if(-INFINITY to 120) + else H.throw_alert("temp", /obj/screen/alert/cold, 3) H.apply_damage(COLD_DAMAGE_LEVEL_3*coldmod, BURN) - else - H.clear_alert("temp") else H.clear_alert("temp") diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index fb2eafe301ae6..22b51064afb5f 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -172,18 +172,13 @@ return ..() /obj/item/projectile/kinetic/prehit(atom/target) - var/turf/target_turf = get_turf(target) - if(!isturf(target_turf)) - return . = ..() if(.) if(kinetic_gun) var/list/mods = kinetic_gun.get_modkits() for(var/obj/item/borg/upgrade/modkit/M in mods) M.projectile_prehit(src, target, kinetic_gun) - var/datum/gas_mixture/environment = target_turf.return_air() - var/pressure = environment.return_pressure() - if(pressure > 50) + if(!lavaland_equipment_pressure_check(get_turf(target))) name = "weakened [name]" damage = damage * pressure_decrease pressure_decrease_active = TRUE @@ -472,7 +467,7 @@ //Indoors /obj/item/borg/upgrade/modkit/indoors name = "decrease pressure penalty" - desc = "A syndicate modification kit that increases the damage a kinetic accelerator does in a high pressure environment." + desc = "A syndicate modification kit that increases the damage a kinetic accelerator does in high pressure environments." modifier = 2 denied_type = /obj/item/borg/upgrade/modkit/indoors maximum_of_type = 2 diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 93d0dad90ab6e..e6ee7af2c66a9 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -199,23 +199,20 @@ name = "plasma blast" icon_state = "plasmacutter" damage_type = BRUTE - damage = 5 + damage = 20 range = 4 dismemberment = 20 impact_effect_type = /obj/effect/temp_visual/impact_effect/purple_laser - var/mine_range = 3 //mines this many additional tiles + var/pressure_decrease_active = FALSE + var/pressure_decrease = 0.25 + var/mine_range = 3 //mines this many additional tiles of rock /obj/item/projectile/plasma/Initialize() . = ..() - var/turf/proj_turf = get_turf(src) - if(!isturf(proj_turf)) - return - var/datum/gas_mixture/environment = proj_turf.return_air() - if(environment) - var/pressure = environment.return_pressure() - if(pressure < 60) - name = "full strength [name]" - damage *= 4 + if(!lavaland_equipment_pressure_check(get_turf(src))) + name = "weakened [name]" + damage = damage * pressure_decrease + pressure_decrease_active = TRUE /obj/item/projectile/plasma/on_hit(atom/target) . = ..() @@ -229,19 +226,19 @@ return -1 /obj/item/projectile/plasma/adv - damage = 7 + damage = 28 range = 5 mine_range = 5 /obj/item/projectile/plasma/adv/mech - damage = 10 + damage = 40 range = 9 mine_range = 3 /obj/item/projectile/plasma/turret //Between normal and advanced for damage, made a beam so not the turret does not destroy glass name = "plasma beam" - damage = 6 + damage = 24 range = 7 pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE