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 05:11:22 +02:00
committed by GitHub
parent 1b5af3a748
commit 777910d6d2
37 changed files with 50 additions and 52 deletions
@@ -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()