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:
Fluffy
2024-10-25 17:56:02 +00:00
committed by GitHub
parent e8107c3170
commit d9c44532fc
146 changed files with 377 additions and 281 deletions
+1 -1
View File
@@ -78,6 +78,6 @@ var/list/moving_levels = list()
T.icon_state = "speedspace_[gen_dir]_[rand(1,15)]"
for(var/atom/movable/AM in T)
if (AM.simulated && !AM.anchored)
AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1)
AM.throw_at(get_step(T,REVERSE_DIR(direction)), 5, 1)
CHECK_TICK
CHECK_TICK
@@ -80,7 +80,7 @@
AddOverlays(resource_indicator)
if(LAZYLEN(decals))
AddOverlays(decals)
for(var/direction in GLOB.cardinal)
for(var/direction in GLOB.cardinals)
var/turf/turf_to_check = get_step(src,direction)
if(!istype(turf_to_check, type))
var/image/rock_side = image(icon, "edge[pick(0,1,2)]", dir = turn(direction, 180))
@@ -51,5 +51,5 @@
icon_state = "drift"
/obj/effect/floor_decal/dune/random/Initialize(mapload, newdir, newcolour, bypass, set_icon_state)
supplied_dir = pick(GLOB.cardinal)
supplied_dir = pick(GLOB.cardinals)
. = ..()
@@ -270,7 +270,7 @@
gen_turf.resources[ORE_SAND] = rand(3, 5)
gen_turf.resources[ORE_COAL] = rand(3, 5)
if(ground_resources_roll)
var/image/resource_indicator = image('icons/obj/mining.dmi', null, "indicator_" + ground_resources_roll, gen_turf.layer, pick(GLOB.cardinal))
var/image/resource_indicator = image('icons/obj/mining.dmi', null, "indicator_" + ground_resources_roll, gen_turf.layer, pick(GLOB.cardinals))
resource_indicator.alpha = rand(30, 60)
gen_turf.resource_indicator = resource_indicator
if(!gen_turf.density)
+1 -1
View File
@@ -310,7 +310,7 @@
to_chat(user, SPAN_WARNING("You must be in the same area as the target location to attach \the [src]!"))
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
@@ -119,7 +119,7 @@
qdel(ammunition.original_projectile) //No longer needed.
ammunition.original_projectile = widowmaker
widowmaker.primed = TRUE
var/turf/entry_turf_initial = get_ranged_target_turf(entry_target, GLOB.reverse_dir[entry_target.dir], 20)
var/turf/entry_turf_initial = get_ranged_target_turf(entry_target, REVERSE_DIR(entry_target.dir), 20)
var/entry_dir_choice = (dir & NORTH) || (dir & SOUTH) ? list(EAST, WEST) : list(NORTH, SOUTH)
var/turf/entry_turf = get_ranged_target_turf(entry_turf_initial, entry_dir_choice, 5)
widowmaker.forceMove(entry_turf)
@@ -197,7 +197,7 @@
/obj/machinery/atmospherics/unary/engine/proc/check_blockage()
blockage = FALSE
var/exhaust_dir = reverse_direction(dir)
var/exhaust_dir = REVERSE_DIR(dir)
var/turf/A = get_turf(src)
for(var/i in 1 to exhaust_offset)
A = get_step(A, exhaust_dir)
@@ -235,7 +235,7 @@
if(network)
network.update = 1
var/exhaust_dir = reverse_direction(dir)
var/exhaust_dir = REVERSE_DIR(dir)
var/turf/T = get_turf(src)
for(var/i in 1 to exhaust_offset)
T = get_step(T, exhaust_dir)