Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More subsystems to new datasystem type #82846

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__HELPERS/roundend.dm
Expand Up @@ -136,7 +136,7 @@ GLOBAL_LIST_INIT(achievements_unlocked, list())

/datum/controller/subsystem/ticker/proc/record_nuke_disk_location()
var/disk_count = 1
for(var/obj/item/disk/nuclear/nuke_disk as anything in SSpoints_of_interest.real_nuclear_disks)
for(var/obj/item/disk/nuclear/nuke_disk as anything in DSpoints_of_interest.real_nuclear_disks)
var/list/data = list()
var/turf/disk_turf = get_turf(nuke_disk)
if(disk_turf)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/shuttle.dm
Expand Up @@ -391,7 +391,7 @@ SUBSYSTEM_DEF(shuttle)
red_alert = (SSsecurity_level.get_current_level_as_number() >= SEC_LEVEL_RED)
)

var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS)
var/datum/radio_frequency/frequency = DSradio.return_frequency(FREQ_STATUS_DISPLAYS)

if(frequency)
// Start processing shuttle-mode displays to display the timer
Expand Down
6 changes: 3 additions & 3 deletions code/datums/components/deadchat_control.dm
Expand Up @@ -44,8 +44,8 @@
source = parent,
header = "Ghost Possession!",
)
if(!ismob(parent) && !SSpoints_of_interest.is_valid_poi(parent))
SSpoints_of_interest.make_point_of_interest(parent)
if(!ismob(parent) && !DSpoints_of_interest.is_valid_poi(parent))
DSpoints_of_interest.make_point_of_interest(parent)
generated_point_of_interest = TRUE

/datum/component/deadchat_control/Destroy(force)
Expand All @@ -54,7 +54,7 @@
orbiters = null
ckey_to_cooldown = null
if(generated_point_of_interest)
SSpoints_of_interest.remove_point_of_interest(parent)
DSpoints_of_interest.remove_point_of_interest(parent)
on_removal = null
return ..()

Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/phylactery.dm
Expand Up @@ -53,7 +53,7 @@

RegisterSignal(obj_parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))

SSpoints_of_interest.make_point_of_interest(obj_parent)
DSpoints_of_interest.make_point_of_interest(obj_parent)

/datum/component/phylactery/Destroy()
var/obj/obj_parent = parent
Expand Down
4 changes: 2 additions & 2 deletions code/datums/elements/point_of_interest.dm
Expand Up @@ -12,9 +12,9 @@
if(isnewplayer(target))
return ELEMENT_INCOMPATIBLE

SSpoints_of_interest.on_poi_element_added(target)
DSpoints_of_interest.on_poi_element_added(target)
return ..()

/datum/element/point_of_interest/Detach(datum/target)
SSpoints_of_interest.on_poi_element_removed(target)
DSpoints_of_interest.on_poi_element_removed(target)
return ..()
2 changes: 1 addition & 1 deletion code/datums/spawners_menu.dm
Expand Up @@ -81,7 +81,7 @@
if(!length(spawnerlist))
return
var/atom/mob_spawner = pick(spawnerlist)
if(!SSpoints_of_interest.is_valid_poi(mob_spawner))
if(!DSpoints_of_interest.is_valid_poi(mob_spawner))
return

switch(action)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/station_traits/negative_traits.dm
Expand Up @@ -671,7 +671,7 @@
priority_announce(announcement, sound = 'sound/misc/notice1.ogg')

//Set the display screens to the radiation alert
var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS)
var/datum/radio_frequency/frequency = DSradio.return_frequency(FREQ_STATUS_DISPLAYS)
if(!frequency)
return

Expand Down
55 changes: 27 additions & 28 deletions code/datums/systems/ds/battle_royale.dm
@@ -1,33 +1,32 @@
/// Global list of areas which are considered to be inside the same department for our purposes
GLOBAL_LIST_INIT(battle_royale_regions, list(
"Medical Bay" = list(
/area/station/command/heads_quarters/cmo,
/area/station/medical,
/area/station/security/checkpoint/medical,
),
"Research Division" = list(
/area/station/command/heads_quarters/rd,
/area/station/security/checkpoint/science,
/area/station/science,
),
"Engineering Bay" = list(
/area/station/command/heads_quarters/ce,
/area/station/engineering,
/area/station/maintenance/disposal/incinerator,
/area/station/security/checkpoint/engineering,
),
"Cargo Bay" = list(
/area/station/cargo,
/area/station/command/heads_quarters/qm,
/area/station/security/checkpoint/supply,
),
))

/// Basically just exists to hold references to datums so that they don't GC

DATASYSTEM_DEF(battle_royale)
name = "Battle Royale"
/// List of battle royale datums currently running
var/list/active_battles
/// Static list of available regions that are considered the same department
var/list/regions = list(list(
"Medical Bay" = list(
/area/station/command/heads_quarters/cmo,
/area/station/medical,
/area/station/security/checkpoint/medical,
),
"Research Division" = list(
/area/station/command/heads_quarters/rd,
/area/station/security/checkpoint/science,
/area/station/science,
),
"Engineering Bay" = list(
/area/station/command/heads_quarters/ce,
/area/station/engineering,
/area/station/maintenance/disposal/incinerator,
/area/station/security/checkpoint/engineering,
),
"Cargo Bay" = list(
/area/station/cargo,
/area/station/command/heads_quarters/qm,
/area/station/security/checkpoint/supply,
),
))

/// Start a new battle royale using a passed list of implants
/datum/system/battle_royale/proc/start_battle(list/competitors)
Expand Down Expand Up @@ -102,9 +101,9 @@ DATASYSTEM_DEF(battle_royale)

/// Start a battle royale with the list of provided implants
/datum/battle_royale_controller/proc/start(list/implants, battle_time = 10 MINUTES)
chosen_area = pick(GLOB.battle_royale_regions)
chosen_area = pick(DSbattle_royale.regions)
for (var/obj/item/implant/explosive/battle_royale/contestant_implant in implants)
contestant_implant.start_battle(chosen_area, GLOB.battle_royale_regions[chosen_area])
contestant_implant.start_battle(chosen_area, DSbattle_royale.regions[chosen_area])
if (isnull(contestant_implant))
continue // Might have exploded if it was removed from a person
RegisterSignal(contestant_implant, COMSIG_QDELETING, PROC_REF(implant_destroyed))
Expand Down
@@ -1,16 +1,11 @@
SUBSYSTEM_DEF(overlays)
DATASYSTEM_DEF(overlays)
name = "Overlay"
flags = SS_NO_FIRE|SS_NO_INIT
var/list/stats
/// Associative list of stats for overlay data
var/list/stats = list()

/datum/controller/subsystem/overlays/PreInit()
stats = list()

/datum/controller/subsystem/overlays/Shutdown()
/datum/system/overlays/Destroy()
text2file(render_stats(stats), "[GLOB.log_directory]/overlay.log")

/datum/controller/subsystem/overlays/Recover()
stats = SSoverlays.stats
return ..()

/// Converts an overlay list into text for debug printing
/// Of note: overlays aren't actually mutable appearances, they're just appearances
Expand Down Expand Up @@ -65,7 +60,7 @@ SUBSYSTEM_DEF(overlays)
overlays = null
POST_OVERLAY_CHANGE(src)
STAT_STOP_STOPWATCH
STAT_LOG_ENTRY(SSoverlays.stats, type)
STAT_LOG_ENTRY(DSoverlays.stats, type)

/atom/proc/cut_overlay(list/remove_overlays)
if(!overlays)
Expand All @@ -74,7 +69,7 @@ SUBSYSTEM_DEF(overlays)
overlays -= build_appearance_list(remove_overlays)
POST_OVERLAY_CHANGE(src)
STAT_STOP_STOPWATCH
STAT_LOG_ENTRY(SSoverlays.stats, type)
STAT_LOG_ENTRY(DSoverlays.stats, type)

/atom/proc/add_overlay(list/add_overlays)
if(!overlays)
Expand All @@ -84,7 +79,7 @@ SUBSYSTEM_DEF(overlays)
VALIDATE_OVERLAY_LIMIT(src)
POST_OVERLAY_CHANGE(src)
STAT_STOP_STOPWATCH
STAT_LOG_ENTRY(SSoverlays.stats, type)
STAT_LOG_ENTRY(DSoverlays.stats, type)

/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom
if(!other)
Expand All @@ -102,13 +97,13 @@ SUBSYSTEM_DEF(overlays)
VALIDATE_OVERLAY_LIMIT(src)
POST_OVERLAY_CHANGE(src)
STAT_STOP_STOPWATCH
STAT_LOG_ENTRY(SSoverlays.stats, type)
STAT_LOG_ENTRY(DSoverlays.stats, type)
else if(cached_other)
overlays += cached_other
VALIDATE_OVERLAY_LIMIT(src)
POST_OVERLAY_CHANGE(src)
STAT_STOP_STOPWATCH
STAT_LOG_ENTRY(SSoverlays.stats, type)
STAT_LOG_ENTRY(DSoverlays.stats, type)

//TODO: Better solution for these?
/image/proc/add_overlay(x)
Expand Down
@@ -1,6 +1,5 @@
SUBSYSTEM_DEF(pai)
DATASYSTEM_DEF(pai)
name = "pAI"
flags = SS_NO_INIT|SS_NO_FIRE

/// List of pAI candidates, including those not submitted.
var/list/candidates = list()
Expand All @@ -9,18 +8,18 @@ SUBSYSTEM_DEF(pai)
/// Prevents a pAI from submitting itself repeatedly and sounding an alert.
var/submit_spam = FALSE

/datum/controller/subsystem/pai/ui_interact(mob/user, datum/tgui/ui)
/datum/system/pai/ui_interact(mob/user, datum/tgui/ui)
. = ..()
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "PaiSubmit")
ui.open()
ui.set_autoupdate(FALSE)

/datum/controller/subsystem/pai/ui_state(mob/user)
/datum/system/pai/ui_state(mob/user)
return GLOB.observer_state

/datum/controller/subsystem/pai/ui_static_data(mob/user)
/datum/system/pai/ui_static_data(mob/user)
. = ..()
var/list/data = list()
var/datum/pai_candidate/candidate = candidates[user.ckey]
Expand All @@ -31,7 +30,7 @@ SUBSYSTEM_DEF(pai)
data["name"] = candidate.name
return data

/datum/controller/subsystem/pai/ui_act(action, list/params, datum/tgui/ui)
/datum/system/pai/ui_act(action, list/params, datum/tgui/ui)
. = ..()
if(.)
return TRUE
Expand Down Expand Up @@ -72,7 +71,7 @@ SUBSYSTEM_DEF(pai)
*
* @params {mob} user The ghost doing the pressing.
*/
/datum/controller/subsystem/pai/proc/recruit_window(mob/user)
/datum/system/pai/proc/recruit_window(mob/user)
/// Searches for a previous candidate upon opening the menu
var/datum/pai_candidate/candidate = candidates[user.ckey]
if(isnull(candidate))
Expand All @@ -84,7 +83,7 @@ SUBSYSTEM_DEF(pai)
/**
* Pings all pAI cards on the station that new candidates are available.
*/
/datum/controller/subsystem/pai/proc/submit_alert()
/datum/system/pai/proc/submit_alert()
if(submit_spam)
to_chat(usr, span_warning("Your candidacy has been submitted, but pAI cards have been alerted too recently."))
return FALSE
Expand Down
@@ -1,9 +1,6 @@
/// Subsystem for managing all POIs.
SUBSYSTEM_DEF(points_of_interest)
DATASYSTEM_DEF(points_of_interest)
name = "Points of Interest"

flags = SS_NO_FIRE | SS_NO_INIT

/// List of mob POIs. This list is automatically sorted.
var/list/datum/point_of_interest/mob_poi/mob_points_of_interest = list()
/// List of non-mob POIs. This list is automatically sorted.
Expand All @@ -20,19 +17,19 @@ SUBSYSTEM_DEF(points_of_interest)
/**
* Turns new_poi into a new point of interest by adding the /datum/element/point_of_interest element to it.
*/
/datum/controller/subsystem/points_of_interest/proc/make_point_of_interest(atom/new_poi)
/datum/system/points_of_interest/proc/make_point_of_interest(atom/new_poi)
new_poi.AddElement(/datum/element/point_of_interest)

/**
* Stops old_poi from being a point of interest by removing the /datum/element/point_of_interest element from it.
*/
/datum/controller/subsystem/points_of_interest/proc/remove_point_of_interest(atom/old_poi)
/datum/system/points_of_interest/proc/remove_point_of_interest(atom/old_poi)
old_poi.RemoveElement(/datum/element/point_of_interest)

/**
* Called by [/datum/element/point_of_interest] when it gets removed from old_poi.
*/
/datum/controller/subsystem/points_of_interest/proc/on_poi_element_added(atom/new_poi)
/datum/system/points_of_interest/proc/on_poi_element_added(atom/new_poi)
var/datum/point_of_interest/new_poi_datum
if(ismob(new_poi))
new_poi_datum = new /datum/point_of_interest/mob_poi(new_poi)
Expand All @@ -57,7 +54,7 @@ SUBSYSTEM_DEF(points_of_interest)
/**
* Called by [/datum/element/point_of_interest] when it gets removed from old_poi.
*/
/datum/controller/subsystem/points_of_interest/proc/on_poi_element_removed(atom/old_poi)
/datum/system/points_of_interest/proc/on_poi_element_removed(atom/old_poi)
var/poi_ref = REF(old_poi)
var/datum/point_of_interest/poi_to_remove = points_of_interest_by_target_ref[poi_ref]

Expand Down Expand Up @@ -87,7 +84,7 @@ SUBSYSTEM_DEF(points_of_interest)
/**
* If there is a valid POI for a given reference, it returns that POI's associated atom. Otherwise, it returns null.
*/
/datum/controller/subsystem/points_of_interest/proc/get_poi_atom_by_ref(reference)
/datum/system/points_of_interest/proc/get_poi_atom_by_ref(reference)
return points_of_interest_by_target_ref[reference]?.target

/**
Expand All @@ -100,7 +97,7 @@ SUBSYSTEM_DEF(points_of_interest)
* * poi_validation_override - [OPTIONAL] Callback to a proc that takes a single argument for the POI and returns TRUE if this POI should be included. Overrides standard POI validation.
* * append_dead_role - [OPTIONAL] If TRUE, adds a ghost tag to the end of observer names and a dead tag to the end of any other mob which is not alive.
*/
/datum/controller/subsystem/points_of_interest/proc/get_mob_pois(datum/callback/poi_validation_override = null, append_dead_role = TRUE)
/datum/system/points_of_interest/proc/get_mob_pois(datum/callback/poi_validation_override = null, append_dead_role = TRUE)
var/list/pois = list()
var/list/used_name_list = list()

Expand Down Expand Up @@ -134,7 +131,7 @@ SUBSYSTEM_DEF(points_of_interest)
* Arguments:
* * poi_validation_override - [OPTIONAL] Callback to a proc that takes a single argument for the POI and returns TRUE if this POI should be included. Overrides standard POI validation.
*/
/datum/controller/subsystem/points_of_interest/proc/get_other_pois(datum/callback/poi_validation_override = null)
/datum/system/points_of_interest/proc/get_other_pois(datum/callback/poi_validation_override = null)
var/list/pois = list()
var/list/used_name_list = list()

Expand All @@ -152,7 +149,7 @@ SUBSYSTEM_DEF(points_of_interest)
return pois

/// Returns TRUE if potential_poi has an associated poi_datum that validates.
/datum/controller/subsystem/points_of_interest/proc/is_valid_poi(atom/potential_poi, datum/callback/poi_validation_override = null)
/datum/system/points_of_interest/proc/is_valid_poi(atom/potential_poi, datum/callback/poi_validation_override = null)
var/datum/point_of_interest/poi_datum = points_of_interest_by_target_ref[REF(potential_poi)]

if(!poi_datum)
Expand Down
@@ -1,33 +1,32 @@
SUBSYSTEM_DEF(radio)
DATASYSTEM_DEF(radio)
name = "Radio"
flags = SS_NO_FIRE|SS_NO_INIT

var/list/datum/radio_frequency/frequencies = list()
var/list/saymodes = list()

/datum/controller/subsystem/radio/PreInit()
/datum/system/radio/New()
. = ..()
for(var/_SM in subtypesof(/datum/saymode))
var/datum/saymode/SM = new _SM()
saymodes[SM.key] = SM
return ..()

/datum/controller/subsystem/radio/proc/add_object(obj/device, new_frequency as num, filter = null as text|null)
/datum/system/radio/proc/add_object(obj/device, new_frequency as num, filter = null as text|null)
var/f_text = num2text(new_frequency)
var/datum/radio_frequency/frequency = frequencies[f_text]
if(!frequency)
frequencies[f_text] = frequency = new(new_frequency)
frequency.add_listener(device, filter)
return frequency

/datum/controller/subsystem/radio/proc/remove_object(obj/device, old_frequency)
/datum/system/radio/proc/remove_object(obj/device, old_frequency)
var/f_text = num2text(old_frequency)
var/datum/radio_frequency/frequency = frequencies[f_text]
if(frequency)
frequency.remove_listener(device)
// let's don't delete frequencies in case a non-listener keeps a reference
return 1

/datum/controller/subsystem/radio/proc/return_frequency(new_frequency as num)
/datum/system/radio/proc/return_frequency(new_frequency as num)
var/f_text = num2text(new_frequency)
var/datum/radio_frequency/frequency = frequencies[f_text]
if(!frequency)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/radiation_storm.dm
Expand Up @@ -71,7 +71,7 @@
mutant.domutcheck()

/datum/weather/rad_storm/proc/status_alarm(active) //Makes the status displays show the radiation warning for those who missed the announcement.
var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS)
var/datum/radio_frequency/frequency = DSradio.return_frequency(FREQ_STATUS_DISPLAYS)
if(!frequency)
return

Expand Down