mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 20:43:10 +01:00
Refactored directionals (#20082)
Refactored directionals, ported lists of directions from TG, got rid of useless proc to get the reverse direction.
This commit is contained in:
@@ -224,7 +224,7 @@
|
||||
|
||||
/obj/structure/barricade/ex_act(severity, direction, cause_data)
|
||||
for(var/obj/structure/barricade/B in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade
|
||||
if(B.dir == reverse_direction(dir))
|
||||
if(B.dir == REVERSE_DIR(dir))
|
||||
INVOKE_ASYNC(B, TYPE_PROC_REF(/atom, ex_act), severity, direction)
|
||||
update_health(round(severity))
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
|
||||
/obj/structure/barricade/proc/take_damage(var/damage)
|
||||
for(var/obj/structure/barricade/B in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade
|
||||
if(B.dir == reverse_direction(dir))
|
||||
if(B.dir == REVERSE_DIR(dir))
|
||||
B.update_health(damage)
|
||||
update_health(damage)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/obj/structure/barricade/plasteel/update_icon()
|
||||
..()
|
||||
if(linked)
|
||||
for(var/direction in GLOB.cardinal)
|
||||
for(var/direction in GLOB.cardinals)
|
||||
for(var/obj/structure/barricade/plasteel/cade in get_step(src, direction))
|
||||
if(((dir & (NORTH|SOUTH) && get_dir(src, cade) & (EAST|WEST)) || (dir & (EAST|WEST) && get_dir(src, cade) & (NORTH|SOUTH))) && dir == cade.dir && cade.linked && cade.closed == src.closed && hasconnectionoverlay)
|
||||
if(closed)
|
||||
@@ -102,7 +102,7 @@
|
||||
to_chat(user, SPAN_WARNING("The [src] has no linking points."))
|
||||
return
|
||||
linked = !linked
|
||||
for(var/direction in GLOB.cardinal)
|
||||
for(var/direction in GLOB.cardinals)
|
||||
for(var/obj/structure/barricade/plasteel/cade in get_step(src, direction))
|
||||
cade.update_icon()
|
||||
update_icon()
|
||||
@@ -197,7 +197,7 @@
|
||||
closed = 0
|
||||
density = 1
|
||||
if(linked)
|
||||
for(var/direction in GLOB.cardinal)
|
||||
for(var/direction in GLOB.cardinals)
|
||||
for(var/obj/structure/barricade/plasteel/cade in get_step(src, direction))
|
||||
if(((dir & (NORTH|SOUTH) && get_dir(src, cade) & (EAST|WEST)) || (dir & (EAST|WEST) && get_dir(src, cade) & (NORTH|SOUTH))) && dir == cade.dir && cade != origin && cade.linked)
|
||||
cade.open(src)
|
||||
@@ -210,7 +210,7 @@
|
||||
closed = 1
|
||||
density = 0
|
||||
if(linked)
|
||||
for(var/direction in GLOB.cardinal)
|
||||
for(var/direction in GLOB.cardinals)
|
||||
for(var/obj/structure/barricade/plasteel/cade in get_step(src, direction))
|
||||
if(((dir & (NORTH|SOUTH) && get_dir(src, cade) & (EAST|WEST)) || (dir & (EAST|WEST) && get_dir(src, cade) & (NORTH|SOUTH))) && dir == cade.dir && cade != origin && cade.linked)
|
||||
cade.close(src)
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
return
|
||||
|
||||
var/placement_dir = get_dir(user, A)
|
||||
if (!(placement_dir in GLOB.cardinal))
|
||||
if (!(placement_dir in GLOB.cardinals))
|
||||
to_chat(user, SPAN_WARNING("You must stand directly in front of the location you wish to place that on."))
|
||||
return
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@
|
||||
|
||||
new /obj/effect/decal/cleanable/blood/no_dry(loc)
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
dirs_left = GLOB.cardinal.Copy()
|
||||
dirs_left = GLOB.cardinals.Copy()
|
||||
|
||||
/obj/structure/gore/tendrils/proc/update_neighbours(turf/U)
|
||||
if(!U)
|
||||
U = loc
|
||||
if(istype(U))
|
||||
for(var/dirn in GLOB.cardinal)
|
||||
for(var/dirn in GLOB.cardinals)
|
||||
var/turf/T = get_step(U, dirn)
|
||||
if(!istype(T))
|
||||
continue
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
/obj/structure/gore/tendrils/proc/update_sprite()
|
||||
var/my_dir = 0
|
||||
for(var/check_dir in GLOB.cardinal)
|
||||
for(var/check_dir in GLOB.cardinals)
|
||||
var/turf/check = get_step(src, check_dir)
|
||||
if(!istype(check))
|
||||
continue
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
buckled.set_dir(dir)
|
||||
|
||||
/obj/structure/bed/stool/chair/MouseDrop_T(atom/dropping, mob/user)
|
||||
if(dropping == user && user.loc != loc && (GLOB.reverse_dir[dir] & angle2dir(Get_Angle(src, user))))
|
||||
if(dropping == user && user.loc != loc && (REVERSE_DIR(dir) & angle2dir(Get_Angle(src, user))))
|
||||
user.visible_message("<b>[user]</b> starts climbing over the back of \the [src]...", SPAN_NOTICE("You start climbing over the back of \the [src]..."))
|
||||
if(do_after(user, 2 SECONDS, do_flags = DO_UNIQUE))
|
||||
user.forceMove(loc)
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
/obj/structure/bed/stool/chair/CanPass(atom/movable/mover, turf/target, height, air_group)
|
||||
if(anchored && padding_material)
|
||||
if(mover?.density && isliving(mover) && (GLOB.reverse_dir[dir] & angle2dir(Get_Angle(src, mover))))
|
||||
if(mover?.density && isliving(mover) && (REVERSE_DIR(dir) & angle2dir(Get_Angle(src, mover))))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user