mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-31 00:49:06 +01:00
Ports the TG globals controller and converts globals. (#18057)
* SDQL2 update * fix that verb * cl * fix that * toworld * this is pointless * update info * siiiiick.. * vv edit update * fix that * fix editing vars * fix VV * Port the /TG/ globals controller. * part 1 * part 2 * oops * part 3 * Hollow Purple * sadas * bsbsdb * muda na agaki ta * ids 1-15 * 16-31 * 41-75 * bring me back to how things used to be before i lost it all * the strength of mayhem * final touches * cl * protect some vars * update sdql2 to use glob * stuff? * forgot that is not defined there * whoops * observ * but it never gets better * a --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//like orange but only checks north/south/east/west for one step
|
||||
/proc/cardinalrange(var/center)
|
||||
var/list/things = list()
|
||||
for(var/direction in cardinal)
|
||||
for(var/direction in GLOB.cardinal)
|
||||
var/turf/T = get_step(center, direction)
|
||||
if(!T)
|
||||
continue
|
||||
@@ -128,7 +128,7 @@
|
||||
cut_overlays()
|
||||
coredirs = 0
|
||||
dirs = 0
|
||||
for(var/direction in alldirs)
|
||||
for(var/direction in GLOB.alldirs)
|
||||
var/turf/T = get_step(loc, direction)
|
||||
for(var/obj/machinery/machine in T)
|
||||
// Detect cores
|
||||
@@ -138,7 +138,7 @@
|
||||
coredirs |= direction
|
||||
|
||||
// Detect cores, shielding, and control boxen.
|
||||
if(direction in cardinal)
|
||||
if(direction in GLOB.cardinal)
|
||||
if(istype(machine, /obj/machinery/am_shielding))
|
||||
var/obj/machinery/am_shielding/AMS = machine
|
||||
if(AMS.control_unit == control_unit)
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
//Scans cards for shields or the control unit and if all there it
|
||||
/obj/machinery/am_shielding/proc/core_check()
|
||||
for(var/direction in alldirs)
|
||||
for(var/direction in GLOB.alldirs)
|
||||
var/found_am_device = FALSE
|
||||
for(var/obj/machinery/machine in get_step(loc, direction))
|
||||
if(!machine)
|
||||
|
||||
+11
-11
@@ -144,7 +144,7 @@
|
||||
/obj/machinery/power/apc/isolation
|
||||
cell_type = /obj/item/cell
|
||||
req_access = null
|
||||
req_one_access = list(access_engine_equip,access_research,access_xenobiology)
|
||||
req_one_access = list(ACCESS_ENGINE_EQUIP,ACCESS_RESEARCH,ACCESS_XENOBIOLOGY)
|
||||
|
||||
/obj/machinery/power/apc/isolation/north
|
||||
dir = NORTH
|
||||
@@ -164,7 +164,7 @@
|
||||
|
||||
/obj/machinery/power/apc/vault
|
||||
cell_type = /obj/item/cell
|
||||
req_access = list(access_captain)
|
||||
req_access = list(ACCESS_CAPTAIN)
|
||||
|
||||
/obj/machinery/power/apc/vault/north
|
||||
dir = NORTH
|
||||
@@ -185,7 +185,7 @@
|
||||
/obj/machinery/power/apc/intrepid
|
||||
cell_type = /obj/item/cell/high
|
||||
req_access = null
|
||||
req_one_access = list(access_intrepid,access_engine_equip)
|
||||
req_one_access = list(ACCESS_INTREPID,ACCESS_ENGINE_EQUIP)
|
||||
|
||||
/obj/machinery/power/apc/intrepid/north
|
||||
dir = NORTH
|
||||
@@ -206,7 +206,7 @@
|
||||
/obj/machinery/power/apc/canary
|
||||
cell_type = /obj/item/cell/high
|
||||
req_access = null
|
||||
req_one_access = list(access_intrepid,access_engine_equip)
|
||||
req_one_access = list(ACCESS_INTREPID,ACCESS_ENGINE_EQUIP)
|
||||
|
||||
/obj/machinery/power/apc/canary/north
|
||||
dir = NORTH
|
||||
@@ -227,7 +227,7 @@
|
||||
/obj/machinery/power/apc/mining_shuttle
|
||||
cell_type = /obj/item/cell/high
|
||||
req_access = null
|
||||
req_one_access = list(access_mining,access_engine_equip)
|
||||
req_one_access = list(ACCESS_MINING,ACCESS_ENGINE_EQUIP)
|
||||
|
||||
/obj/machinery/power/apc/mining_shuttle/north
|
||||
dir = NORTH
|
||||
@@ -363,7 +363,7 @@
|
||||
icon_state = "apc0"
|
||||
anchored = TRUE
|
||||
use_power = POWER_USE_OFF
|
||||
req_access = list(access_engine_equip)
|
||||
req_access = list(ACCESS_ENGINE_EQUIP)
|
||||
gfi_layer_rotation = GFI_ROTATION_DEFDIR
|
||||
clicksound = /singleton/sound_category/switch_sound
|
||||
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
|
||||
@@ -864,7 +864,7 @@
|
||||
if (C.amount >= 10 && !terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
|
||||
var/obj/structure/cable/N = T.get_cable_node()
|
||||
if (prob(50) && electrocute_mob(usr, N, N))
|
||||
spark(src, 5, alldirs)
|
||||
spark(src, 5, GLOB.alldirs)
|
||||
if(user.stunned)
|
||||
return
|
||||
C.use(10)
|
||||
@@ -883,7 +883,7 @@
|
||||
if(W.use_tool(src, user, 50, volume = 50))
|
||||
if(terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
|
||||
if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
|
||||
spark(src, 5, alldirs)
|
||||
spark(src, 5, GLOB.alldirs)
|
||||
if(usr.stunned)
|
||||
return
|
||||
new /obj/item/stack/cable_coil(loc,10)
|
||||
@@ -1067,7 +1067,7 @@
|
||||
|
||||
if(isipc(H) && H.a_intent == I_GRAB)
|
||||
if(emagged || stat & BROKEN)
|
||||
spark(src, 5, alldirs)
|
||||
spark(src, 5, GLOB.alldirs)
|
||||
to_chat(H, SPAN_DANGER("The APC power currents surge eratically, damaging your chassis!"))
|
||||
H.adjustFireLoss(10, 0)
|
||||
if(infected)
|
||||
@@ -1093,7 +1093,7 @@
|
||||
if (cell.charge < 0)
|
||||
cell.charge = 0
|
||||
if (prob(0.5))
|
||||
spark(src, 5, alldirs)
|
||||
spark(src, 5, GLOB.alldirs)
|
||||
to_chat(H, SPAN_DANGER("The APC power currents surge eratically, damaging your chassis!"))
|
||||
H.adjustFireLoss(10, 0)
|
||||
|
||||
@@ -1337,7 +1337,7 @@
|
||||
smoke.set_up(3, 0, loc)
|
||||
smoke.attach(src)
|
||||
smoke.start()
|
||||
spark(src, 5, alldirs)
|
||||
spark(src, 5, GLOB.alldirs)
|
||||
visible_message(SPAN_DANGER("The [name] suddenly lets out a blast of smoke and some sparks!"), \
|
||||
SPAN_DANGER("You hear sizzling electronics."))
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
if(level == 1 && !T.is_hole)
|
||||
hide(!T.is_plating())
|
||||
|
||||
cable_list += src
|
||||
GLOB.cable_list += src
|
||||
|
||||
if(mapload)
|
||||
var/image/I = image(icon, T, icon_state, EFFECTS_ABOVE_LIGHTING_LAYER, dir, pixel_x, pixel_y)
|
||||
@@ -94,7 +94,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
/obj/structure/cable/Destroy() // called when a cable is deleted
|
||||
if(powernet)
|
||||
cut_cable_from_powernet() // update the powernets
|
||||
cable_list -= src //remove it from global cable list
|
||||
GLOB.cable_list -= src //remove it from global cable list
|
||||
return ..() // then go ahead and delete the cable
|
||||
|
||||
///////////////////////////////////
|
||||
@@ -195,7 +195,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
if(!prob(prb))
|
||||
return FALSE
|
||||
if (electrocute_mob(user, powernet, src, siemens_coeff))
|
||||
spark(src, 5, alldirs)
|
||||
spark(src, 5, GLOB.alldirs)
|
||||
if(user.stunned)
|
||||
return TRUE
|
||||
return FALSE
|
||||
@@ -374,7 +374,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
for(var/cable_dir in list(d1, d2))
|
||||
if(cable_dir == 11 || cable_dir == 12 || cable_dir == 0)
|
||||
continue
|
||||
var/reverse = reverse_dir[cable_dir]
|
||||
var/reverse = GLOB.reverse_dir[cable_dir]
|
||||
T = get_step(src, cable_dir)
|
||||
if(T)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
|
||||
@@ -321,7 +321,7 @@
|
||||
alert_msg = null
|
||||
radio.autosay(emergency_alert, "INDRA Reactor Monitor")
|
||||
public_alert = TRUE
|
||||
for(var/mob/M in player_list)
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
var/turf/T = get_turf(M)
|
||||
if(T && !istype(M, /mob/abstract/new_player) && !isdeaf(M))
|
||||
sound_to(M, 'sound/effects/nuclearsiren.ogg')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
icon_state = "injector0"
|
||||
density = TRUE
|
||||
anchored = FALSE
|
||||
req_access = list(access_engine)
|
||||
req_access = list(ACCESS_ENGINE)
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 500
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ var/global/list/fusion_reactions
|
||||
// Copied from the SM for proof of concept. //Not any more --Cirra //Use the whole z proc --Leshana
|
||||
SSradiation.z_radiate(locate(1, 1, holder.z), radiation_level, 1)
|
||||
|
||||
for(var/mob/living/mob in living_mob_list)
|
||||
for(var/mob/living/mob in GLOB.living_mob_list)
|
||||
var/turf/T = get_turf(mob)
|
||||
if(T && (holder.z == T.z))
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
|
||||
@@ -350,14 +350,14 @@
|
||||
if(new_state) // If we turned on
|
||||
if(!area.has_gravity())
|
||||
alert = 1
|
||||
gravity_is_on = 1
|
||||
GLOB.gravity_is_on = 1
|
||||
soundloop.start(src)
|
||||
investigate_log("was brought online and is now producing gravity for this level.", "gravity")
|
||||
message_admins("The gravity generator was brought online. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
else
|
||||
if(area.has_gravity())
|
||||
alert = 1
|
||||
gravity_is_on = 0
|
||||
GLOB.gravity_is_on = 0
|
||||
soundloop.stop(src)
|
||||
investigate_log("was brought offline and there is now no gravity for this level.", "gravity")
|
||||
message_admins("The gravity generator was brought offline with no backup generator. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
@@ -423,7 +423,7 @@
|
||||
// Shake everyone on the z level to let them know that gravity was enagaged/disenagaged.
|
||||
/obj/machinery/gravity_generator/main/proc/shake_everyone()
|
||||
var/turf/our_turf = get_turf(src)
|
||||
for(var/mob/M in mob_list)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
var/turf/their_turf = get_turf(M)
|
||||
if(their_turf && (their_turf.z == our_turf.z))
|
||||
M.update_gravity(M.mob_has_gravity())
|
||||
@@ -455,14 +455,14 @@
|
||||
|
||||
/obj/machinery/gravity_generator/main/LateInitialize()
|
||||
if(current_map.use_overmap && !linked)
|
||||
var/my_sector = map_sectors["[z]"]
|
||||
var/my_sector = GLOB.map_sectors["[z]"]
|
||||
if (istype(my_sector, /obj/effect/overmap/visitable))
|
||||
attempt_hook_up(my_sector)
|
||||
if(linked)
|
||||
linked.gravity_generator = src
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/updateareas()
|
||||
for(var/area/A in all_areas)
|
||||
for(var/area/A in GLOB.all_areas)
|
||||
if(!(get_area_type(A) == AREA_STATION))
|
||||
continue
|
||||
localareas += A
|
||||
@@ -484,7 +484,7 @@
|
||||
set_state(FALSE)
|
||||
sleep(30)
|
||||
set_state(TRUE)
|
||||
for(var/mob/living/M in mob_list)
|
||||
for(var/mob/living/M in GLOB.mob_list)
|
||||
var/turf/their_turf = get_turf(M)
|
||||
if(their_turf?.loc == Area)
|
||||
if(ishuman(M))
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
|
||||
/obj/machinery/light/proc/broken_sparks()
|
||||
if(world.time > next_spark && !(stat & POWEROFF) && has_power())
|
||||
spark(src, 3, alldirs)
|
||||
spark(src, 3, GLOB.alldirs)
|
||||
next_spark = world.time + 1 MINUTE + (rand(-15, 15) SECONDS)
|
||||
|
||||
// ehh
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
var/cdir
|
||||
var/turf/T
|
||||
|
||||
for(var/card in cardinal)
|
||||
for(var/card in GLOB.cardinal)
|
||||
T = get_step(loc,card)
|
||||
cdir = get_dir(T,loc)
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
var/cdir
|
||||
var/turf/T
|
||||
|
||||
for(var/card in cardinal)
|
||||
for(var/card in GLOB.cardinal)
|
||||
T = get_step(loc,card)
|
||||
cdir = get_dir(T,loc)
|
||||
|
||||
|
||||
@@ -68,13 +68,13 @@ This is /obj/machinery level code to properly manage power usage from the area.
|
||||
/obj/machinery/Initialize(mapload, d = 0, populate_components = TRUE, is_internal = FALSE)
|
||||
internal = is_internal
|
||||
REPORT_POWER_CONSUMPTION_CHANGE(0, get_power_usage())
|
||||
moved_event.register(src, src, PROC_REF(update_power_on_move))
|
||||
GLOB.moved_event.register(src, src, PROC_REF(update_power_on_move))
|
||||
power_init_complete = TRUE
|
||||
. = ..()
|
||||
|
||||
// Or in Destroy at all, but especially after the ..().
|
||||
/obj/machinery/Destroy()
|
||||
moved_event.unregister(src, src, PROC_REF(update_power_on_move))
|
||||
GLOB.moved_event.unregister(src, src, PROC_REF(update_power_on_move))
|
||||
REPORT_POWER_CONSUMPTION_CHANGE(get_power_usage(), 0)
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -4,23 +4,23 @@ var/global/enable_power_update_profiling = 0
|
||||
|
||||
var/global/power_profiled_time = 0
|
||||
var/global/power_last_profile_time = 0
|
||||
var/global/list/power_update_requests_by_machine = list()
|
||||
var/global/list/power_update_requests_by_area = list()
|
||||
GLOBAL_LIST_EMPTY(power_update_requests_by_machine)
|
||||
GLOBAL_LIST_EMPTY(power_update_requests_by_area)
|
||||
|
||||
/proc/log_power_update_request(area/A, obj/machinery/M)
|
||||
if (!enable_power_update_profiling)
|
||||
return
|
||||
|
||||
var/machine_type = "[M.type]"
|
||||
if (machine_type in power_update_requests_by_machine)
|
||||
power_update_requests_by_machine[machine_type] += 1
|
||||
if (machine_type in GLOB.power_update_requests_by_machine)
|
||||
GLOB.power_update_requests_by_machine[machine_type] += 1
|
||||
else
|
||||
power_update_requests_by_machine[machine_type] = 1
|
||||
GLOB.power_update_requests_by_machine[machine_type] = 1
|
||||
|
||||
if (A.name in power_update_requests_by_area)
|
||||
power_update_requests_by_area[A.name] += 1
|
||||
if (A.name in GLOB.power_update_requests_by_area)
|
||||
GLOB.power_update_requests_by_area[A.name] += 1
|
||||
else
|
||||
power_update_requests_by_area[A.name] = 1
|
||||
GLOB.power_update_requests_by_area[A.name] = 1
|
||||
|
||||
power_profiled_time += (world.time - power_last_profile_time)
|
||||
power_last_profile_time = world.time
|
||||
@@ -55,8 +55,8 @@ var/global/list/power_update_requests_by_area = list()
|
||||
if(!check_rights(R_DEBUG)) return
|
||||
|
||||
to_chat(usr, "Total profiling time: [power_profiled_time] ticks")
|
||||
for (var/M in power_update_requests_by_machine)
|
||||
to_chat(usr, "[M] = [power_update_requests_by_machine[M]]")
|
||||
for (var/M in GLOB.power_update_requests_by_machine)
|
||||
to_chat(usr, "[M] = [GLOB.power_update_requests_by_machine[M]]")
|
||||
|
||||
/client/proc/view_power_update_stats_area()
|
||||
set name = "View Area Power Update Statistics By Area"
|
||||
@@ -67,5 +67,5 @@ var/global/list/power_update_requests_by_area = list()
|
||||
|
||||
to_chat(usr, "Total profiling time: [power_profiled_time] ticks")
|
||||
to_chat(usr, "Total profiling time: [power_profiled_time] ticks")
|
||||
for (var/A in power_update_requests_by_area)
|
||||
to_chat(usr, "[A] = [power_update_requests_by_area[A]]")
|
||||
for (var/A in GLOB.power_update_requests_by_area)
|
||||
to_chat(usr, "[A] = [GLOB.power_update_requests_by_area[A]]")
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
icon_state = "emitter"
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
req_access = list(access_engine_equip)
|
||||
req_access = list(ACCESS_ENGINE_EQUIP)
|
||||
obj_flags = OBJ_FLAG_ROTATABLE | OBJ_FLAG_SIGNALER
|
||||
var/id
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
/obj/machinery/power/emitter/Initialize()
|
||||
. = ..()
|
||||
spark_system = bind_spark(src, 5, alldirs)
|
||||
spark_system = bind_spark(src, 5, GLOB.alldirs)
|
||||
if(state == EMITTER_WELDED && anchored)
|
||||
connect_to_network()
|
||||
if(_wifi_id)
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
if(!move_self)
|
||||
return 0
|
||||
|
||||
var/movement_dir = pick(alldirs - last_failed_movement)
|
||||
var/movement_dir = pick(GLOB.alldirs - last_failed_movement)
|
||||
|
||||
if(force_move)
|
||||
movement_dir = force_move
|
||||
|
||||
@@ -100,13 +100,13 @@
|
||||
/obj/machinery/power/smes/Initialize()
|
||||
. = ..()
|
||||
SSmachinery.smes_units += src
|
||||
big_spark = bind_spark(src, 5, alldirs)
|
||||
big_spark = bind_spark(src, 5, GLOB.alldirs)
|
||||
small_spark = bind_spark(src, 3)
|
||||
if(!powernet)
|
||||
connect_to_network()
|
||||
|
||||
dir_loop:
|
||||
for(var/d in cardinal)
|
||||
for(var/d in GLOB.cardinal)
|
||||
var/turf/T = get_step(src, d)
|
||||
for(var/obj/machinery/power/terminal/term in T)
|
||||
if(term && term.dir == turn(d, 180))
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
// This also causes the SMES to quickly discharge, and has small chance of damaging output APCs.
|
||||
/obj/machinery/power/smes/buildable/process()
|
||||
if(!grounding && (Percentage() > 5))
|
||||
spark(src, 5, alldirs)
|
||||
spark(src, 5, GLOB.alldirs)
|
||||
charge -= (output_level_max * SMESRATE)
|
||||
if(prob(1)) // Small chance of overload occuring since grounding is disabled.
|
||||
apcs_overload(5,10,20)
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
/obj/singularity/energy_ball/proc/move_the_basket_ball(var/move_amount)
|
||||
|
||||
var/list/valid_directions = alldirs.Copy()
|
||||
var/list/valid_directions = GLOB.alldirs.Copy()
|
||||
|
||||
var/can_zmove = !(locate(/obj/machinery/containment_field) in view(12,src))
|
||||
if(can_zmove && prob(10))
|
||||
@@ -127,10 +127,10 @@
|
||||
zMove(DOWN)
|
||||
visible_message(SPAN_DANGER("\The [src] gravitates from above!"))
|
||||
|
||||
if(dir in alldirs)
|
||||
if(dir in GLOB.alldirs)
|
||||
dir = move_dir
|
||||
else
|
||||
dir = pick(alldirs)
|
||||
dir = pick(GLOB.alldirs)
|
||||
|
||||
for(var/mob/living/carbon/C in loc)
|
||||
dust_mobs(C)
|
||||
|
||||
Reference in New Issue
Block a user