Skip to content

Commit

Permalink
Makes the lavaland pressure check a proc (#28954)
Browse files Browse the repository at this point in the history
* Makes the lavaland pressure check a proc

* code that probably did nothing tm

* sss

* 50 should be a define instead
  • Loading branch information
ChangelingRain authored and Cyberboss committed Jul 3, 2017
1 parent e116cee commit 888b2e0
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 42 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 8 additions & 0 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 7 additions & 9 deletions code/game/mecha/working/ripley.dm
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
8 changes: 2 additions & 6 deletions code/modules/mining/equipment/resonator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
9 changes: 2 additions & 7 deletions code/modules/projectiles/guns/energy/kinetic_accelerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
25 changes: 11 additions & 14 deletions code/modules/projectiles/projectile/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand All @@ -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

Expand Down

0 comments on commit 888b2e0

Please sign in to comment.