mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 00:55:20 +01:00
Some explosions code cleanup (#57493)
Clears out two deprecated explosions systems (explosion ids and explosion levels) Refactors a bunch of contents_explosions procs to be maybe slightly faster. Cleans up a bunch of ex_act code. Slightly cleaner code A few less unused vars on /atom and /turf
This commit is contained in:
@@ -502,14 +502,13 @@
|
||||
req_access += pick(SSid_access.get_region_access_list(list(REGION_ALL_STATION)))
|
||||
|
||||
/obj/structure/closet/contents_explosion(severity, target)
|
||||
for(var/thing in contents)
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += thing
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += thing
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += thing
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += contents
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += contents
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += contents
|
||||
|
||||
/obj/structure/closet/singularity_act()
|
||||
dump_contents()
|
||||
|
||||
@@ -21,10 +21,9 @@
|
||||
recursive_organ_check(src)
|
||||
|
||||
/obj/structure/closet/secure_closet/freezer/ex_act()
|
||||
if(!jones)
|
||||
jones = TRUE
|
||||
else
|
||||
..()
|
||||
if(jones)
|
||||
return ..()
|
||||
jones = TRUE
|
||||
|
||||
/obj/structure/closet/secure_closet/freezer/kitchen
|
||||
name = "kitchen cabinet"
|
||||
|
||||
@@ -32,14 +32,16 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/contents_explosion(severity, target)
|
||||
if(stored_extinguisher)
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += stored_extinguisher
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += stored_extinguisher
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += stored_extinguisher
|
||||
if(!stored_extinguisher)
|
||||
return
|
||||
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += stored_extinguisher
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += stored_extinguisher
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += stored_extinguisher
|
||||
|
||||
/obj/structure/extinguisher_cabinet/handle_atom_del(atom/A)
|
||||
if(A == stored_extinguisher)
|
||||
|
||||
@@ -113,14 +113,13 @@
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/guncase/contents_explosion(severity, target)
|
||||
for(var/thing in contents)
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += thing
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += thing
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += thing
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += contents
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += contents
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += contents
|
||||
|
||||
/obj/structure/guncase/shotgun
|
||||
name = "shotgun locker"
|
||||
|
||||
@@ -246,9 +246,8 @@
|
||||
|
||||
/obj/structure/reflector/ex_act()
|
||||
if(admin)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/obj/structure/reflector/singularity_act()
|
||||
if(admin)
|
||||
|
||||
@@ -83,7 +83,7 @@ FLOOR SAFES
|
||||
return
|
||||
|
||||
/obj/structure/safe/ex_act(severity, target)
|
||||
if(((severity == 2 && target == src) || severity == 1) && explosion_count < BROKEN_THRESHOLD)
|
||||
if(((severity == EXPLODE_HEAVY && target == src) || severity == EXPLODE_DEVASTATE) && explosion_count < BROKEN_THRESHOLD)
|
||||
explosion_count++
|
||||
switch(explosion_count)
|
||||
if(1)
|
||||
|
||||
@@ -80,8 +80,16 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/tank_holder/contents_explosion(severity, target)
|
||||
if(tank)
|
||||
tank.ex_act(severity, target)
|
||||
if(!tank)
|
||||
return
|
||||
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += tank
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += tank
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += tank
|
||||
|
||||
/// Call this after taking the tank from contents in order to update references, icon
|
||||
/// and density.
|
||||
|
||||
@@ -60,19 +60,18 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/transit_tube_pod/ex_act(severity, target)
|
||||
..()
|
||||
. = ..()
|
||||
if(!QDELETED(src))
|
||||
empty_pod()
|
||||
|
||||
/obj/structure/transit_tube_pod/contents_explosion(severity, target)
|
||||
for(var/thing in contents)
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += thing
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += thing
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += thing
|
||||
switch(severity)
|
||||
if(EXPLODE_DEVASTATE)
|
||||
SSexplosions.high_mov_atom += contents
|
||||
if(EXPLODE_HEAVY)
|
||||
SSexplosions.med_mov_atom += contents
|
||||
if(EXPLODE_LIGHT)
|
||||
SSexplosions.low_mov_atom += contents
|
||||
|
||||
/obj/structure/transit_tube_pod/singularity_pull(S, current_size)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user