Polaris Hook Removal Part 1 (#18672)

* starting cleanup

* thankyou vsc very cool

* resleeving mind signal

* id card modifier signals

* fix

* borgifying mob signal

* button and brain

* death

* explosions, mob init

* oooop

* semantic

* payment account revoke and status

* missed hook listener

* wip for now

* fixes

* round signals

* only remaining

* doppler arrays behave with z levels

* audible message it is

* wizard spells applied correctly to mind datum
This commit is contained in:
Will
2025-10-30 01:25:51 +01:00
committed by GitHub
parent 0a3ec4a983
commit bba55977a1
39 changed files with 180 additions and 273 deletions
+11 -11
View File
@@ -79,17 +79,17 @@ SUBSYSTEM_DEF(explosions)
// We've handled the actual explosions, it's time to wrap up everything else.
// send signals to all machines scanning for them
for(var/list/time_dat in currentsignals)
var/x0 = time_dat[1]
var/y0 = time_dat[2]
var/z0 = time_dat[3]
var/turf/epicenter = locate(time_dat[1],time_dat[2],time_dat[3])
if(!epicenter)
continue
var/z_transfer = time_dat[8]
if(z_transfer != (UP|DOWN)) // Only the initial explosion in a multiz explosion transfers both up and down!
continue
var/devastation_range = time_dat[4]
var/heavy_impact_range = time_dat[5]
var/light_impact_range = time_dat[6]
var/tim = time_dat[7]
for(var/i,i<=GLOB.doppler_arrays.len,i++)
var/obj/machinery/doppler_array/Array = GLOB.doppler_arrays[i]
if(Array)
Array.sense_explosion(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range, tim - world.time)
var/took = (world.time - time_dat[7]) / (1 SECOND) // Horrifyingly, this has always been server performance dependant. Should really only be used for cosmetic stuff.
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_EXPLOSION, epicenter, devastation_range, heavy_impact_range, light_impact_range, took)
currentsignals.Cut()
// return to setup mode... Unless...
@@ -217,7 +217,7 @@ SUBSYSTEM_DEF(explosions)
currentrun["[x0].[y0].[z0]"] = list(x0,y0,z0,pwr,direction,max_starting)
// Queue explosion event, call this from explosion() ONLY
/datum/controller/subsystem/explosions/proc/append_explosion(var/turf/epicenter,var/pwr,var/devastation_range,var/heavy_impact_range,var/light_impact_range,var/flash_range)
/datum/controller/subsystem/explosions/proc/append_explosion(turf/epicenter, pwr, devastation_range, heavy_impact_range, light_impact_range, flash_range, z_transfer)
SHOULD_NOT_OVERRIDE(TRUE)
if(pwr <= 0)
return
@@ -245,7 +245,7 @@ SUBSYSTEM_DEF(explosions)
pending_explosions["[T.x].[T.y].[T.z]"] = list(T.x,T.y,T.z,rad_power,direction,max_starting)
// send signals to dopplers
explosion_signals.Add(list( list(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range,world.time) )) // append a list in a list. Needed so that the data list doesn't get merged into the list of datalists
explosion_signals.Add(list( list(x0, y0, z0, devastation_range, heavy_impact_range, light_impact_range, world.time, z_transfer))) // append a list in a list. Needed so that the data list doesn't get merged into the list of datalists
// BOINK! Time to wake up sleeping beauty!
wake_and_defer_subsystem_updates(devastation_range >= 8 || heavy_impact_range >= 16 || light_impact_range >= 20)
@@ -336,4 +336,4 @@ SUBSYSTEM_DEF(explosions)
// Queue explosion event
var/power = devastation_range * 2 + heavy_impact_range + light_impact_range //The ranges add up, ie light 14 includes both heavy 7 and devestation 3. So this calculation means devestation counts for 4, heavy for 2 and light for 1 power, giving us a cap of 27 power.
SSexplosions.append_explosion(epicenter,power,devastation_range,heavy_impact_range,light_impact_range,flash_range)
SSexplosions.append_explosion(epicenter,power,devastation_range,heavy_impact_range,light_impact_range,flash_range,z_transfer)
+6 -5
View File
@@ -65,8 +65,8 @@ SUBSYSTEM_DEF(supply)
//Selling
/datum/controller/subsystem/supply/proc/sell()
// Loop over each area in the supply shuttle
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_SUPPLY_SHUTTLE_DEPART, shuttle.shuttle_area)
for(var/area/subarea in shuttle.shuttle_area)
callHook("sell_shuttle", list(subarea));
for(var/atom/movable/MA in subarea)
if(MA.anchored)
continue
@@ -77,10 +77,10 @@ SUBSYSTEM_DEF(supply)
EC.contents = list()
var/base_value = 0
// Must be in a crate!
// Most items must be in a crate!
var/sold_successfully = FALSE
if(istype(MA,/obj/structure/closet/crate))
var/obj/structure/closet/crate/CR = MA
callHook("sell_crate", list(CR, subarea))
points += CR.points_per_crate
if(CR.points_per_crate)
@@ -88,11 +88,12 @@ SUBSYSTEM_DEF(supply)
// For each thing in the crate, get the value and quantity
for(var/atom/A in CR)
SEND_SIGNAL(A,COMSIG_ITEM_SOLD,EC,TRUE)
sold_successfully = SEND_SIGNAL(A,COMSIG_ITEM_SOLD,EC,TRUE)
else
// Selling things that are not in crates.
// Usually it just makes a log that it wasn't shipped properly, and so isn't worth anything
SEND_SIGNAL(MA,COMSIG_ITEM_SOLD,EC,FALSE)
sold_successfully = SEND_SIGNAL(MA,COMSIG_ITEM_SOLD,EC,FALSE)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_SUPPLY_SHUTTLE_SELL_ITEM, MA, sold_successfully, EC, subarea)
exported_crates += EC
points += EC.value
+29 -3
View File
@@ -208,9 +208,34 @@ SUBSYSTEM_DEF(ticker)
cb.InvokeAsync()
LAZYCLEARLIST(round_start_events)
round_start_time = world.time //otherwise round_start_time would be 0 for the signals
//otherwise round_start_time would be 0 for the signals
round_start_time = world.time
GLOB.round_start_time = REALTIMEOFDAY
SEND_SIGNAL(src, COMSIG_TICKER_ROUND_STARTING, world.time)
callHook("roundstart")
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_ROUND_START)
SSwebhooks.send(WEBHOOK_ROUNDSTART, list("url" = get_world_url()))
// Spawn randomized items
for(var/id in multi_point_spawns)
var/list/spawn_points = multi_point_spawns[id]
var/obj/random_multi/rm = pickweight(spawn_points)
rm.generate_items()
for(var/entry in spawn_points)
qdel(entry)
// Place empty AI cores once we know who is playing AI
for(var/obj/effect/landmark/start/S in GLOB.landmarks_list)
if(S.name != JOB_AI)
continue
if(locate(/mob/living) in S.loc)
continue
GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S))
// Final init, these things need round to start for their info to be ready
for(var/obj/item/paper/dockingcodes/dcp as anything in GLOB.papers_dockingcode)
dcp.populate_info()
for(var/obj/machinery/power/solar_control/SC as anything in GLOB.solars_list)
SC.auto_start()
log_world("Game start took [(world.timeofday - init_start)/10]s")
INVOKE_ASYNC(SSdbcore, TYPE_PROC_REF(/datum/controller/subsystem/dbcore,SetRoundStart))
@@ -321,7 +346,8 @@ SUBSYSTEM_DEF(ticker)
/datum/controller/subsystem/ticker/proc/post_game_tick()
switch(end_game_state)
if(END_GAME_READY_TO_END)
callHook("roundend")
callHook("roundend") // TODO, remove all hooks that use this in favor of global signal
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_ROUND_END)
if (mode.station_was_nuked)
feedback_set_details("end_proper", "nuke")
-4
View File
@@ -90,7 +90,3 @@ SUBSYSTEM_DEF(webhooks)
log_and_message_admins("has pinged webhook [choice].", usr)
log_world("[usr.key] has pinged webhook [choice].")
webhook.send()
/hook/roundstart/proc/run_webhook()
SSwebhooks.send(WEBHOOK_ROUNDSTART, list("url" = get_world_url()))
return 1