replace magic numbers related to emp and explosion severity with defines (#26495)

replace even more magic emp and ex numbers
This commit is contained in:
Kenionatus
2024-08-18 03:11:22 +00:00
committed by GitHub
parent 1b5af3a748
commit 777910d6d2
37 changed files with 50 additions and 52 deletions
+1 -1
View File
@@ -188,7 +188,7 @@
return
owner.visible_message("<span class='warning'>[owner]'s body flashes a bright blue!</span>", \
"<span class='cultitalic'>You speak the cursed words, channeling an electromagnetic pulse from your body.</span>")
owner.emp_act(2)
owner.emp_act(EMP_LIGHT)
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(empulse), owner, 2, 5, TRUE, "cult")
owner.whisper(invocation)
charges--
@@ -223,7 +223,7 @@ CONTENTS:
if(isradio(I))
var/obj/item/radio/R = I
R.listening = FALSE // Prevents the radio from buzzing due to the EMP, preserving possible stealthiness.
R.emp_act(1)
R.emp_act(EMP_HEAVY)
/obj/item/gun/energy/alien
name = "alien pistol"
@@ -86,7 +86,7 @@
to_chat(spawner, "<span class='danger'>Success! Your trap on [src] caught [user]!</span>")
stored_obj.forceMove(get_turf(loc))
playsound(get_turf(src),'sound/effects/explosion2.ogg', 200, 1)
user.ex_act(2)
user.ex_act(EXPLODE_HEAVY)
user.Stun(3 SECONDS)//A bomb went off in your hands. Actually lets people follow up with it if they bait someone, right now it is unreliable.
qdel(src)
@@ -15,7 +15,7 @@
var/list/connected_shields = list()
/mob/living/simple_animal/hostile/guardian/protector/ex_act(severity)
if(severity == 1)
if(severity == EXPLODE_DEVASTATE)
adjustBruteLoss(200) //if in protector mode, will do 20 damage and not actually necessarily kill the summoner
else
..()
@@ -441,7 +441,7 @@
to_chat(src, "<span class='warning'>You feel [pick("your sense of direction flicker out", "a stabbing pain in your head", "your mind fill with static")].</span>")
new /obj/effect/temp_visual/revenant(loc)
if(cause_emp)
emp_act(1)
emp_act(EMP_HEAVY)
/mob/living/simple_animal/bot/rev_malfunction(cause_emp = TRUE)
if(!emagged)
@@ -456,7 +456,7 @@
new /obj/effect/temp_visual/revenant(loc)
emag_act(usr)
else if(cause_emp)
emp_act(1)
emp_act(EMP_HEAVY)
/obj/machinery/clonepod/rev_malfunction(cause_emp = TRUE)
..(cause_emp = FALSE)
@@ -472,7 +472,7 @@
new /obj/effect/temp_visual/revenant(loc)
spark_system.start()
if(cause_emp)
emp_act(1)
emp_act(EMP_HEAVY)
/turf/defile()
if(flags & BLESSED_TILE)
@@ -75,7 +75,7 @@
for(var/turf/T in linkedholodeck)
if(prob(30))
do_sparks(2, 1, T)
T.ex_act(3)
T.ex_act(EXPLODE_LIGHT)
T.hotspot_expose(1000,500,1)
/obj/machinery/computer/HolodeckControl/proc/loadProgram(area/A)
+2 -2
View File
@@ -39,9 +39,9 @@
return
var/num_of_prizes = 0
switch(severity)
if(1)
if(EMP_HEAVY)
num_of_prizes = rand(1,4)
if(2)
if(EMP_LIGHT)
num_of_prizes = rand(0,2)
for(var/i = num_of_prizes; i > 0; i--)
prizevend()
+2 -2
View File
@@ -116,10 +116,10 @@
/obj/machinery/computer/emp_act(severity)
..()
switch(severity)
if(1)
if(EMP_HEAVY)
if(prob(50))
obj_break(ENERGY)
if(2)
if(EMP_LIGHT)
if(prob(10))
obj_break(ENERGY)
+1 -1
View File
@@ -397,7 +397,7 @@
qdel(src)
/obj/structure/dropwall_generator/ex_act(severity)
if(protected && severity > 1) //We would throw the explosion at the shield, but it is already getting hit
if(protected && severity > EXPLODE_DEVASTATE) //We would throw the explosion at the shield, but it is already getting hit
return
qdel(src)
+1 -1
View File
@@ -50,7 +50,7 @@
//"BLAST" doors are obviously stronger than regular doors when it comes to BLASTS.
/obj/machinery/door/poddoor/ex_act(severity)
if(severity == 3)
if(severity == EXPLODE_LIGHT)
return
..()
+1 -1
View File
@@ -409,7 +409,7 @@
breakthrough = TRUE
else if(istype(obstacle, /obj/structure/reagent_dispensers/fueltank))
obstacle.ex_act(1)
obstacle.ex_act(EXPLODE_DEVASTATE)
else if(isliving(obstacle))
var/mob/living/L = obstacle
@@ -232,7 +232,7 @@
mergeable_decal = FALSE
/obj/effect/decal/cleanable/shreds/ex_act(severity, target)
if(severity == 1) //so shreds created during an explosion aren't deleted by the explosion.
if(severity == EXPLODE_DEVASTATE) //so shreds created during an explosion aren't deleted by the explosion.
qdel(src)
/obj/effect/decal/cleanable/shreds/Initialize(mapload)
+1 -1
View File
@@ -113,7 +113,7 @@
qdel(src)
/obj/effect/snow/ex_act(severity)
if(severity == 3 && prob(50))
if(severity == EXPLODE_LIGHT && prob(50))
return
qdel(src)
+4 -4
View File
@@ -37,16 +37,16 @@
var/will_affect = FALSE
if(distance < heavy_range)
will_affect = T.emp_act(1)
will_affect = T.emp_act(EMP_HEAVY)
else if(distance == heavy_range)
if(prob(50))
will_affect = T.emp_act(1)
will_affect = T.emp_act(EMP_HEAVY)
else
will_affect = T.emp_act(2)
will_affect = T.emp_act(EMP_LIGHT)
else if(distance <= light_range)
will_affect = T.emp_act(2)
will_affect = T.emp_act(EMP_LIGHT)
if(will_affect)
if(cause == "cult")
+2 -2
View File
@@ -195,7 +195,7 @@
if(breach)
T.ex_act(dist)
else
T.ex_act(3)
T.ex_act(EXPLODE_LIGHT)
CHECK_TICK
@@ -219,7 +219,7 @@
/proc/secondaryexplosion(turf/epicenter, range)
for(var/turf/tile in spiral_range_turfs(range, epicenter))
tile.ex_act(2)
tile.ex_act(EXPLODE_HEAVY)
/client/proc/check_bomb_impacts()
set name = "Check Bomb Impact"
@@ -393,7 +393,7 @@
var/mob/M = A
add_attack_logs(user, M, "Hit with EMP-light")
to_chat(user, "[src] now has [emp_cur_charges] charge\s.")
A.emp_act(1)
A.emp_act(EMP_HEAVY)
else
to_chat(user, "<span class='warning'>\The [src] needs time to recharge!</span>")
return
@@ -129,7 +129,7 @@
else if(istype(target, /obj/machinery/camera))
var/obj/machinery/camera/C = target
if(prob(effectchance * diode.rating))
C.emp_act(1)
C.emp_act(EMP_HEAVY)
outmsg = "<span class='notice'>You hit the lens of [C] with [src], temporarily disabling the camera!</span>"
log_admin("[key_name(user)] EMPd a camera with a laser pointer")
+2 -2
View File
@@ -722,12 +722,12 @@
if(HAS_TRAIT(src, TRAIT_WIELDED))
if(iswallturf(A))
var/turf/simulated/wall/Z = A
Z.ex_act(2)
Z.ex_act(EXPLODE_HEAVY)
charged = 3
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
else if(isstructure(A) || ismecha(A))
var/obj/Z = A
Z.ex_act(2)
Z.ex_act(EXPLODE_HEAVY)
charged = 3
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
+1 -1
View File
@@ -272,7 +272,7 @@
var/atom/throw_target = get_edge_target_turf(target, user.dir)
user.visible_message("<span class='userdanger'>It's a home run!</span>")
target.throw_at(throw_target, rand(8,10), 14, user)
target.ex_act(2)
target.ex_act(EXPLODE_HEAVY)
playsound(get_turf(src), 'sound/weapons/homerun.ogg', 100, 1)
homerun_ready = 0
return
@@ -28,7 +28,7 @@
return ..()
/obj/structure/fusionreactor/ex_act(severity)
if(severity < 3)
if(severity < EXPLODE_LIGHT)
obj_integrity = 0
healthcheck()
+1 -1
View File
@@ -71,7 +71,7 @@ GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","dama
return
/turf/simulated/floor/burn_down()
ex_act(2)
ex_act(EXPLODE_HEAVY)
/turf/simulated/floor/is_shielded()
for(var/obj/structure/A in contents)