Skip to content

Commit

Permalink
Merge branch 'master' into obimprovement
Browse files Browse the repository at this point in the history
  • Loading branch information
Cthulhu80 committed Jun 29, 2023
2 parents fa46ca0 + ae54d1f commit 8206db3
Show file tree
Hide file tree
Showing 95 changed files with 7,915 additions and 2,143 deletions.
4 changes: 3 additions & 1 deletion .github/guides/STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ While we normally encourage (and in some cases, even require) bringing out of da
This is a simple one - as we will eventually move to 515, we will need to ditch this kind of callback. So please don't add any new ones. Make our lives easier.

### PROC_REF Macros
When referencing procs in RegisterSignal, Callback and other procs you should use PROC_REF,TYPE_PROC_REF and GLOBAL_PROC_REF macros.
When referencing procs in RegisterSignal, Callback and other procs you should use PROC_REF, TYPE_PROC_REF and GLOBAL_PROC_REF macros.
They ensure compilation fails if the reffered to procs change names or get removed.
The macro to be used depends on how the proc you're in relates to the proc you want to use:

Expand Down Expand Up @@ -168,6 +168,8 @@ This is a simple one - as we will eventually move to 515, we will need to ditch
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(funny)), 100))
```

Note that the same rules go for verbs too! We have VERB_REF() and TYPE_VERB_REF() as you need it in these same cases. GLOBAL_VERB_REF() isn't a thing however, as verbs are not global.

### Signal Handlers

All procs that are registered to listen for signals using `RegisterSignal()` must contain at the start of the proc `SIGNAL_HANDLER` eg;
Expand Down
54 changes: 54 additions & 0 deletions code/__DEFINES/ARES.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/// Generic access for 1:1 conversations with ARES and unrestricted commands.
#define ARES_ACCESS_BASIC 0
/// Secure Access, can read ARES Announcements and Bioscans.
#define ARES_ACCESS_COMMAND 1
#define ARES_ACCESS_JOE 2
/// CL, can read Apollo Log and also Delete Announcements.
#define ARES_ACCESS_CORPORATE 3
/// Senior Command, can Delete Bioscans.
#define ARES_ACCESS_SENIOR 4
/// Synth, CE & Commanding Officer, can read the access log.
#define ARES_ACCESS_CE 5
#define ARES_ACCESS_SYNTH 6
#define ARES_ACCESS_CO 7
/// High Command, can read the deletion log.
#define ARES_ACCESS_HIGH 8
#define ARES_ACCESS_WY_COMMAND 9
/// Debugging. Allows me to view everything without using a high command rank. Unlikely to stay in a full merge.
#define ARES_ACCESS_DEBUG 10

#define ARES_RECORD_ANNOUNCE "Announcement Record"
#define ARES_RECORD_ANTIAIR "AntiAir Control Log"
#define ARES_RECORD_ASRS "Requisition Record"
#define ARES_RECORD_BIOSCAN "Bioscan Record"
#define ARES_RECORD_BOMB "Orbital Bombardment Record"
#define ARES_RECORD_DELETED "Deleted Record"
#define ARES_RECORD_SECURITY "Security Update"
#define ARES_RECORD_MAINTENANCE "Maintenance Ticket"
#define ARES_RECORD_ACCESS "Access Ticket"

/// Not by ARES logged through marine_announcement()
#define ARES_LOG_NONE 0
/// Logged with all announcements
#define ARES_LOG_MAIN 1
/// Logged in the security updates
#define ARES_LOG_SECURITY 2

/// Access levels specifically for Working Joe management console
#define APOLLO_ACCESS_REQUEST 0
#define APOLLO_ACCESS_REPORTER 1
#define APOLLO_ACCESS_TEMP 2
#define APOLLO_ACCESS_AUTHED 3
#define APOLLO_ACCESS_JOE 4
#define APOLLO_ACCESS_DEBUG 5

/// Ticket statuses, both for Access and Maintenance
#define TICKET_PENDING "pending"
#define TICKET_ASSIGNED "assigned"
#define TICKET_REJECTED "rejected"
#define TICKET_CANCELLED "cancelled"
#define TICKET_COMPLETED "complete"

/// Cooldowns
#define COOLDOWN_ARES_SENSOR 60 SECONDS
#define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS
1 change: 1 addition & 0 deletions code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ block( \
#define SOUND_REBOOT (1<<5)
#define SOUND_ADMIN_MEME (1<<6)
#define SOUND_ADMIN_ATMOSPHERIC (1<<7)
#define SOUND_ARES_MESSAGE (1<<8)

//toggles_chat
#define CHAT_OOC (1<<0)
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ most of them are tied into map-placed objects. This should be reworked in the fu

#define ACCESS_MARINE_SYNTH 36

// AI Core Accesses
/// Used in temporary passes
#define ACCESS_MARINE_AI_TEMP 90
/// Used as dedicated access to ARES Core.
#define ACCESS_MARINE_AI 91
/// Used to access Maintenance Protocols on ARES Interface.
#define ACCESS_ARES_DEBUG 92

//Surface access levels
#define ACCESS_CIVILIAN_PUBLIC 100
#define ACCESS_CIVILIAN_LOGISTICS 101
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ var/global/list/note_categories = list("Admin", "Merit", "Commanding Officer", "
#define CC_MARK(user) "(<a href='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];ccmark=[REF(user)]'>MARK</a>)"
#define CC_REPLY(user) "(<a href='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];CentcommReply=[REF(user)]'>RPLY</a>)"
#define OBSERVER_JMP(observer, atom) atom ? "(<a href='?src=[REF(observer)];jumptocoord=1;X=[atom.x];Y=[atom.y];Z=[atom.z]'>JMP</a>)" : ""
#define ARES_MARK(user) "(<a href='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];AresMark=[REF(user)]'>MARK</a>)"
#define ARES_REPLY(user, ref) "(<a href='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];AresReply=[REF(user)];AresRef=[ref]'>RPLY</a>)"

/atom/proc/Admin_Coordinates_Readable(area_name, admin_jump_ref)
var/turf/T = get_turf(src)
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define CAMERA_NET_ALAMO "Alamo"
#define CAMERA_NET_NORMANDY "Normandy"
#define CAMERA_NET_COLONY "Colony"
#define CAMERA_NET_ARES "ARES"

#define CAMERA_NET_MILITARY "Military"
#define CAMERA_NET_OVERWATCH "Overwatch"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define LANGUAGE_XENOMORPH "Xenomorph"
#define LANGUAGE_HIVEMIND "Hivemind"

#define LANGUAGE_APOLLO "Apollo Link"
#define LANGUAGE_APOLLO "APOLLO Link"

#define LANGUAGE_TELEPATH "Telepath Implant"

Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#define AREA_ALLOW_XENO_JOIN (1<<2)
/// Flags the area as a containment area
#define AREA_CONTAINMENT (1<<3)
/// Flags the area as permanently unweedable. Still requires is_resin_allowed = FALSE
#define AREA_UNWEEDABLE (1<<4)
/// Default number of ticks for do_after
#define DA_DEFAULT_NUM_TICKS 5

Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define EVACUATION_STATUS_IN_PROGRESS 2
#define EVACUATION_STATUS_COMPLETE 3

#define NUCLEAR_TIME_LOCK 90 MINUTES
#define NUKE_EXPLOSION_INACTIVE 0
#define NUKE_EXPLOSION_ACTIVE 1
#define NUKE_EXPLOSION_IN_PROGRESS 2
Expand Down
44 changes: 37 additions & 7 deletions code/_byond_version_compat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,49 @@
#define LIBCALL call_ext
#endif

// So we want to have compile time guarantees these procs exist on local type, unfortunately 515 killed the .proc/procname syntax so we have to use nameof()
// So we want to have compile time guarantees these methods exist on local type, unfortunately 515 killed the .proc/procname and .verb/verbname syntax so we have to use nameof()
// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global.

#if DM_VERSION < 515
/// Call by name proc reference, checks if the proc exists on this type or as a global proc

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (.proc/##X)
/// Call by name proc reference, checks if the proc exists on given type or as a global proc
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (.verb/##X)

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X)
/// Call by name proc reference, checks if the proc is existing global proc
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (##TYPE.verb/##X)

/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#else
/// Call by name proc reference, checks if the proc exists on this type or as a global proc

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (nameof(.proc/##X))
/// Call by name proc reference, checks if the proc exists on given type or as a global proc
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (nameof(.verb/##X))

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X))
/// Call by name proc reference, checks if the proc is existing global proc
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (nameof(##TYPE.verb/##X))

/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#endif

#if (DM_VERSION == 515)
/// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows
/// var case matches documentation for fcopy.
/world/proc/__fcopy(Src, Dst)
if (istext(Src) && !fexists(Src))
return 0
return fcopy(Src, Dst)

#define fcopy(Src, Dst) world.__fcopy(Src, Dst)

#endif
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ DEFINE_BITFIELD(flags_area, list(
"AREA_NOTUNNEL" = AREA_NOTUNNEL,
"AREA_ALLOW_XENO_JOIN" = AREA_ALLOW_XENO_JOIN,
"AREA_CONTAINMENT" = AREA_CONTAINMENT,
"ARES_UNWEEDABLE" = AREA_UNWEEDABLE,
))

DEFINE_BITFIELD(disabilities, list(
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
return

face_atom(A)
if(mods["middle"])
if(mods["middle"])
return
// Special type of click.
if (is_mob_restrained())
Expand Down Expand Up @@ -334,7 +334,7 @@
if(prefs.adaptive_zoom)
INVOKE_ASYNC(src, PROC_REF(adaptive_zoom))
else if(prefs.auto_fit_viewport)
INVOKE_ASYNC(src, .verb/fit_viewport)
INVOKE_ASYNC(src, VERB_REF(fit_viewport))

/client/proc/get_adaptive_zoom_factor()
if(!prefs.adaptive_zoom)
Expand Down
22 changes: 16 additions & 6 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,12 @@ SUBSYSTEM_DEF(minimaps)
* removes an image from raw tracked lists, invoked by callback
*/
/datum/controller/subsystem/minimaps/proc/removeimage(image/blip, atom/target)
var/turf/turf_gotten = get_turf(target)
if(!turf_gotten)
return
var/z_level = turf_gotten.z
for(var/flag in GLOB.all_minimap_flags)
minimaps_by_z["[target.z]"].images_raw["[flag]"] -= blip
minimaps_by_z["[z_level]"].images_raw["[flag]"] -= blip
blip.UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
removal_cbs -= target

Expand Down Expand Up @@ -391,18 +395,24 @@ SUBSYSTEM_DEF(minimaps)
owner.client.screen += map
minimap_displayed = !minimap_displayed

/datum/action/minimap/give_to(mob/M)
/datum/action/minimap/give_to(mob/target)
. = ..()

if(default_overwatch_level)
map = SSminimaps.fetch_minimap_object(default_overwatch_level, minimap_flags)
else
RegisterSignal(M, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change))
if(!SSminimaps.minimaps_by_z["[M.z]"] || !SSminimaps.minimaps_by_z["[M.z]"].hud_image)
RegisterSignal(target, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change))

var/turf/turf_gotten = get_turf(target)
if(!turf_gotten)
return
var/z_level = turf_gotten.z

if(!SSminimaps.minimaps_by_z["[z_level]"] || !SSminimaps.minimaps_by_z["[z_level]"].hud_image)
return
map = SSminimaps.fetch_minimap_object(M.z, minimap_flags)
map = SSminimaps.fetch_minimap_object(z_level, minimap_flags)

/datum/action/minimap/remove_from(mob/M)
/datum/action/minimap/remove_from(mob/target)
. = ..()
if(minimap_displayed)
owner?.client?.screen -= map
Expand Down
8 changes: 4 additions & 4 deletions code/datums/emergency_calls/emergency_call.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
message_admins("Distress beacon: '[name]' activated [src.hostility? "[SPAN_WARNING("(THEY ARE HOSTILE)")]":"(they are friendly)"]. Looking for candidates.")

if(announce)
marine_announcement("A distress beacon has been launched from the [MAIN_SHIP_NAME].", "Priority Alert", 'sound/AI/distressbeacon.ogg')
marine_announcement("A distress beacon has been launched from the [MAIN_SHIP_NAME].", "Priority Alert", 'sound/AI/distressbeacon.ogg', logging = ARES_LOG_SECURITY)

addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/emergency_call, spawn_candidates), announce, override_spawn_loc, announce_dispatch_message), 30 SECONDS)

Expand All @@ -207,7 +207,7 @@
candidates = list()

if(announce)
marine_announcement("The distress signal has not received a response, the launch tubes are now recalibrating.", "Distress Beacon")
marine_announcement("The distress signal has not received a response, the launch tubes are now recalibrating.", "Distress Beacon", logging = ARES_LOG_SECURITY)
return

//We've got enough!
Expand Down Expand Up @@ -236,8 +236,8 @@
if(I.current)
to_chat(I.current, SPAN_WARNING("You didn't get selected to join the distress team. Better luck next time!"))

if(announce_dispatch_message)
marine_announcement(dispatch_message, "Distress Beacon", 'sound/AI/distressreceived.ogg') //Announcement that the Distress Beacon has been answered, does not hint towards the chosen ERT
if(announce)
marine_announcement(dispatch_message, "Distress Beacon", 'sound/AI/distressreceived.ogg', logging = ARES_LOG_SECURITY) //Announcement that the Distress Beacon has been answered, does not hint towards the chosen ERT

message_admins("Distress beacon: [src.name] finalized, setting up candidates.")

Expand Down
7 changes: 7 additions & 0 deletions code/datums/paygrades/paygrade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GLOBAL_LIST_INIT_TYPED(paygrades, /datum/paygrade, setup_paygrades())
.[pg_id] = new PG

GLOBAL_LIST_INIT(highcom_paygrades, list(
"PvI",
"NO7",
"MO7",
"NO8",
Expand Down Expand Up @@ -52,3 +53,9 @@ GLOBAL_LIST_INIT(co_paygrades, list(
"MO5",
"MO4"
))

GLOBAL_LIST_INIT(wy_paygrades, list(
"WYC8",
"WYC9",
"WYC10"
))
30 changes: 27 additions & 3 deletions code/defines/procs/announcement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


//general marine announcement
/proc/marine_announcement(message, title = COMMAND_ANNOUNCE, sound_to_play = sound('sound/misc/notice2.ogg'), faction_to_display = FACTION_MARINE, add_PMCs = TRUE, signature)
/proc/marine_announcement(message, title = COMMAND_ANNOUNCE, sound_to_play = sound('sound/misc/notice2.ogg'), faction_to_display = FACTION_MARINE, add_PMCs = TRUE, signature, logging = ARES_LOG_MAIN)
var/list/targets = GLOB.human_mob_list + GLOB.dead_mob_list
if(faction_to_display == FACTION_MARINE)
for(var/mob/M in targets)
Expand All @@ -45,6 +45,14 @@
if((H.faction != faction_to_display && !add_PMCs) || (H.faction != faction_to_display && add_PMCs && !(H.faction in FACTION_LIST_WY)) && !(faction_to_display in H.faction_group)) //faction checks
targets.Remove(H)

var/datum/ares_link/link = GLOB.ares_link
if(link.interface && !(link.interface.inoperable()))
switch(logging)
if(ARES_LOG_MAIN)
link.log_ares_announcement(title, message)
if(ARES_LOG_SECURITY)
link.log_ares_security(title, message)

else if(faction_to_display == "Everyone (-Yautja)")
for(var/mob/M in targets)
if(isobserver(M)) //observers see everything
Expand Down Expand Up @@ -82,14 +90,22 @@
announcement_helper(message, title, targets, sound_to_play)

//AI announcement that uses talking into comms
/proc/ai_announcement(message, sound_to_play = sound('sound/misc/interference.ogg'))
/proc/ai_announcement(message, sound_to_play = sound('sound/misc/interference.ogg'), logging = ARES_LOG_MAIN)
for(var/mob/M in (GLOB.human_mob_list + GLOB.dead_mob_list))
if(isobserver(M) || ishuman(M) && is_mainship_level(M.z))
playsound_client(M.client, sound_to_play, M, vol = 45)

for(var/mob/living/silicon/decoy/ship_ai/AI in ai_mob_list)
INVOKE_ASYNC(AI, TYPE_PROC_REF(/mob/living/silicon/decoy/ship_ai, say), message)

var/datum/ares_link/link = GLOB.ares_link
if(link.interface && !(link.interface.inoperable()))
switch(logging)
if(ARES_LOG_MAIN)
link.log_ares_announcement("[MAIN_AI_SYSTEM] Comms Update", message)
if(ARES_LOG_SECURITY)
link.log_ares_security("[MAIN_AI_SYSTEM] Security Update", message)

/proc/ai_silent_announcement(message, channel_prefix, bypass_cooldown = FALSE)
if(!message)
return
Expand Down Expand Up @@ -119,17 +135,25 @@

if(!isnull(signature))
message += "<br><br><i> Signed by, <br> [signature]</i>"
var/datum/ares_link/link = GLOB.ares_link
if(link.interface && !(link.interface.inoperable()))
link.log_ares_announcement(title, message)

announcement_helper(message, title, targets, sound_to_play)

//Subtype of AI shipside announcement for "All Hands On Deck" alerts (COs and SEAs joining the game)
/proc/all_hands_on_deck(message, title = MAIN_AI_SYSTEM, sound_to_play = sound('sound/misc/sound_misc_boatswain.ogg'), signature)
/proc/all_hands_on_deck(message, title = MAIN_AI_SYSTEM, sound_to_play = sound('sound/misc/sound_misc_boatswain.ogg'))
var/list/targets = GLOB.human_mob_list + GLOB.dead_mob_list
for(var/mob/T in targets)
if(isobserver(T))
continue
if(!ishuman(T) || isyautja(T) || !is_mainship_level(T.z))
targets.Remove(T)

var/datum/ares_link/link = GLOB.ares_link
if(link.interface && !(link.interface.inoperable()))
link.log_ares_announcement("[title] Shipwide Update", message)

announcement_helper(message, title, targets, sound_to_play)

//the announcement proc that handles announcing for each mob in targets list
Expand Down
Loading

0 comments on commit 8206db3

Please sign in to comment.