[MIRROR] code/global.dm => code/_global_vars/ (#10689)

Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-04-21 10:16:48 -07:00
committed by GitHub
parent a7718c6177
commit f04f992cfe
474 changed files with 1401 additions and 1421 deletions

View File

@@ -51,7 +51,7 @@
on_engagement(target)
if(firing_lanes && !test_projectile_safety(target))
// Nudge them a bit, maybe they can shoot next time.
var/turf/T = get_step(holder, pick(cardinal))
var/turf/T = get_step(holder, pick(GLOB.cardinal))
if(T)
holder.IMove(T) // IMove() will respect movement cooldown.
holder.face_atom(target)
@@ -251,7 +251,7 @@
/datum/ai_holder/proc/destroy_surroundings(direction, violent = TRUE)
ai_log("destroy_surroundings() : Entering.", AI_LOG_TRACE)
if(!direction)
direction = pick(cardinal) // FLAIL WILDLY
direction = pick(GLOB.cardinal) // FLAIL WILDLY
ai_log("destroy_surroundings() : No direction given, picked [direction] randomly.", AI_LOG_DEBUG)
var/turf/problem_turf = get_step(holder, direction)
@@ -270,7 +270,7 @@
ai_log("destroy_surroundings() : Going to try to violently clear [problem_turf].", AI_LOG_DEBUG)
// First, kill windows in the way.
for(var/obj/structure/window/W in problem_turf)
if(W.dir == reverse_dir[holder.dir]) // So that windows get smashed in the right order
if(W.dir == GLOB.reverse_dir[holder.dir]) // So that windows get smashed in the right order
ai_log("destroy_surroundings() : Attacking side window.", AI_LOG_INFO)
return melee_attack(W)

View File

@@ -51,7 +51,7 @@
var/unsafe = FALSE
tile_test:
for(var/dir_tested in cardinal)
for(var/dir_tested in GLOB.cardinal)
var/turf/turf_tested = get_step(holder, dir_tested)
// Look for unsafe tiles.
if(!turf_tested.is_safe_to_enter(holder))
@@ -70,7 +70,7 @@
return // Just stay still.
var/moving_to = 0
moving_to = pick(cardinal)
moving_to = pick(GLOB.cardinal)
var/turf/T = get_step(holder, moving_to)
var/mob/living/L = locate() in T
@@ -85,7 +85,7 @@
ai_log("dangerous_wander() : Exited.", AI_LOG_DEBUG)
/*
// Wanders randomly in cardinal directions.
// Wanders randomly in GLOB.cardinal directions.
/datum/ai_holder/proc/handle_wander_movement()
ai_log("handle_wander_movement() : Entered.", AI_LOG_DEBUG)
if(isturf(holder.loc) && can_act())
@@ -96,7 +96,7 @@
return
var/moving_to = 0 // Apparently this is required or it always picks 4, according to the previous developer for simplemob AI.
moving_to = pick(cardinal)
moving_to = pick(GLOB.cardinal)
holder.set_dir(moving_to)
holder.IMove(get_step(holder,moving_to))
wander_delay = base_wander_delay

View File

@@ -10,7 +10,7 @@
var/max_home_distance = 3 // How far the mob can go away from its home before being told to go_home().
// Note that there is a 'BYOND cap' of 14 due to limitations of get_/step_to().
// Wandering.
var/wander = FALSE // If true, the mob will randomly move in the four cardinal directions when idle.
var/wander = FALSE // If true, the mob will randomly move in the four GLOB.cardinal directions when idle.
var/wander_delay = 0 // How many ticks until the mob can move a tile in handle_wander_movement().
var/base_wander_delay = 2 // What the above var gets set to when it wanders. Note that a tick happens every half a second.
var/wander_when_pulled = FALSE // If the mob will refrain from wandering if someone is pulling it.
@@ -145,7 +145,7 @@
/datum/ai_holder/proc/should_wander()
return (stance == STANCE_IDLE) && wander && !leader
// Wanders randomly in cardinal directions.
// Wanders randomly in GLOB.cardinal directions.
/datum/ai_holder/proc/handle_wander_movement()
if(!holder)
return
@@ -158,7 +158,7 @@
return
var/moving_to = 0 // Apparently this is required or it always picks 4, according to the previous developer for simplemob AI.
moving_to = pick(cardinal)
moving_to = pick(GLOB.cardinal)
holder.set_dir(moving_to)
holder.IMove(get_step(holder,moving_to))
wander_delay = base_wander_delay

View File

@@ -140,7 +140,7 @@
/datum/ai_holder/simple_mob/melee/evasive/post_melee_attack(atom/A)
if(holder.Adjacent(A))
holder.IMove(get_step(holder, pick(alldirs)))
holder.IMove(get_step(holder, pick(GLOB.alldirs)))
holder.face_atom(A)
@@ -206,12 +206,12 @@
// Juke
/datum/ai_holder/simple_mob/humanoid/hostile/post_melee_attack(atom/A)
holder.IMove(get_step(holder, pick(alldirs)))
holder.IMove(get_step(holder, pick(GLOB.alldirs)))
holder.face_atom(A)
/datum/ai_holder/simple_mob/humanoid/hostile/post_ranged_attack(atom/A)
//Pick a random turf to step into
var/turf/T = get_step(holder, pick(alldirs))
var/turf/T = get_step(holder, pick(GLOB.alldirs))
if((A in check_trajectory(A, T))) // Can we even hit them from there?
holder.IMove(T)
holder.face_atom(A)

View File

@@ -9,5 +9,5 @@
/datum/ai_holder/simple_mob/melee/pack_mob/post_melee_attack(atom/A)
if(holder.Adjacent(A))
holder.IMove(get_step(holder, pick(alldirs)))
holder.IMove(get_step(holder, pick(GLOB.alldirs)))
holder.face_atom(A)