From 34ad67a4fccc907dc8e74e000488aad9ee8a21c9 Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Thu, 2 Mar 2023 02:10:54 +0100
Subject: [PATCH] [MIRROR] Updates policy to better warn players for any
existing antagonist policy [MDB IGNORE] (#19341)
* Updates policy to better warn players for any existing antagonist policy
* Update job.dm
* Update job.dm
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
---
code/__DEFINES/role_preferences.dm | 1 -
code/controllers/subsystem/job.dm | 12 +++++++++---
code/datums/mind/_mind.dm | 13 +++++++++++++
.../effects/anomalies/anomalies_pyroclastic.dm | 4 ----
code/modules/antagonists/_common/antag_datum.dm | 7 ++++++-
code/modules/antagonists/changeling/changeling.dm | 6 ++----
code/modules/antagonists/heretic/heretic_antag.dm | 6 ------
code/modules/antagonists/obsessed/obsessed.dm | 3 ---
code/modules/jobs/job_types/spawner/free_golem.dm | 1 +
.../mob/living/carbon/human/human_helpers.dm | 1 +
code/modules/mob/mob_helpers.dm | 1 +
code/modules/mob_spawn/ghost_roles/golem_roles.dm | 7 ++-----
config/policy.json | 6 +++++-
13 files changed, 40 insertions(+), 28 deletions(-)
diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm
index f05d5254bff..8ecfa8bdc32 100644
--- a/code/__DEFINES/role_preferences.dm
+++ b/code/__DEFINES/role_preferences.dm
@@ -95,7 +95,6 @@
#define ROLE_SPACE_SYNDICATE "Space Syndicate"
#define ROLE_SYNDICATE_CYBERSUN "Cybersun Space Syndicate" //Ghost role syndi from Forgottenship ruin
#define ROLE_SYNDICATE_CYBERSUN_CAPTAIN "Cybersun Space Syndicate Captain" //Forgottenship captain syndie
-#define ROLE_HEADSLUG_CHANGELING "Headslug Changeling"
#define ROLE_SPACE_PIRATE "Space Pirate"
#define ROLE_ANCIENT_CREW "Ancient Crew"
#define ROLE_SPACE_DOCTOR "Space Doctor"
diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm
index e828923b79a..e28014cd6fa 100644
--- a/code/controllers/subsystem/job.dm
+++ b/code/controllers/subsystem/job.dm
@@ -533,7 +533,7 @@ SUBSYSTEM_DEF(job)
SEND_SIGNAL(equipping, COMSIG_JOB_RECEIVED, job)
- equipping.mind?.set_assigned_role(job)
+ equipping.mind?.set_assigned_role_with_greeting(job)
if(player_client)
to_chat(player_client, span_infoplain("You are the [chosen_title].")) // SKYRAT EDIT CHANGE - ALTERNATIVE_JOB_TITLES - Original: to_chat(player_client, span_infoplain("You are the [job.title]."))
@@ -555,9 +555,12 @@ SUBSYSTEM_DEF(job)
if(player_client)
if(job.req_admin_notify)
- to_chat(player_client, "You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.")
+ to_chat(player_client, span_infoplain("You are playing a job that is important for Game Progression. \
+ If you have to disconnect, please notify the admins via adminhelp."))
if(CONFIG_GET(number/minimal_access_threshold))
- to_chat(player_client, span_notice("As this station was initially staffed with a [CONFIG_GET(flag/jobs_have_minimal_access) ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card."))
+ to_chat(player_client, span_boldnotice("As this station was initially staffed with a \
+ [CONFIG_GET(flag/jobs_have_minimal_access) ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] \
+ have been added to your ID card."))
//SKYRAT EDIT START - ALTERNATIVE_JOB_TITLES
if(chosen_title != default_title)
to_chat(player_client, span_infoplain(span_warning("Remember that alternate titles are purely for flavor and roleplay.")))
@@ -566,6 +569,9 @@ SUBSYSTEM_DEF(job)
var/related_policy = get_policy(job.title)
if(related_policy)
to_chat(player_client, related_policy)
+ to_chat(player_client, span_boldnotice("As this station was initially staffed with a \
+ [CONFIG_GET(flag/jobs_have_minimal_access) ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] \
+ have been added to your ID card."))
if(ishuman(equipping))
var/mob/living/carbon/human/wageslave = equipping
diff --git a/code/datums/mind/_mind.dm b/code/datums/mind/_mind.dm
index 4d1e2f8945d..a1e09fe339b 100644
--- a/code/datums/mind/_mind.dm
+++ b/code/datums/mind/_mind.dm
@@ -508,6 +508,19 @@
. = assigned_role
assigned_role = new_role
+/// Sets us to the passed job datum, then greets them to their new job.
+/// Use this one for when you're assigning this mind to a new job for the first time,
+/// or for when someone's recieving a job they'd really want to be greeted to.
+/datum/mind/proc/set_assigned_role_with_greeting(datum/job/new_role)
+ . = set_assigned_role(new_role)
+ if(!.)
+ return
+
+ to_chat(src, span_infoplain("You are the [new_role.title]."))
+
+ var/related_policy = get_policy(new_role.title)
+ if(related_policy)
+ to_chat(src, related_policy)
/mob/proc/sync_mind()
mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist)
diff --git a/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm b/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm
index deb8403fa23..0383bf6c0c9 100644
--- a/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm
+++ b/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm
@@ -42,8 +42,4 @@
pyro.key = chosen.key
pyro.mind.special_role = ROLE_PYROCLASTIC_SLIME
pyro.mind.add_antag_datum(/datum/antagonist/pyro_slime)
- var/policy = get_policy(ROLE_PYROCLASTIC_SLIME)
-
- if (policy)
- to_chat(pyro, policy)
pyro.log_message("was made into a slime by pyroclastic anomaly", LOG_GAME)
diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm
index 5aa98c705d0..6d0025594cc 100644
--- a/code/modules/antagonists/_common/antag_datum.dm
+++ b/code/modules/antagonists/_common/antag_datum.dm
@@ -230,8 +230,13 @@ GLOBAL_LIST_EMPTY(antagonists)
if(!silent)
greet()
if(ui_name)
- to_chat(owner.current, span_boldnotice("For more info, read the panel. you can always come back to it using the button in the top left."))
+ to_chat(owner.current, span_boldnotice("For more info, read the panel. \
+ You can always come back to it using the button in the top left."))
info_button.Trigger()
+ var/type_policy = get_policy("[type]") // path to text
+ if(type_policy)
+ to_chat(owner.current, type_policy)
+
apply_innate_effects()
give_antag_moodies()
RegisterSignal(owner, COMSIG_PRE_MINDSHIELD_IMPLANT, PROC_REF(pre_mindshield))
diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm
index 9e4192739a3..27d6c54f056 100644
--- a/code/modules/antagonists/changeling/changeling.dm
+++ b/code/modules/antagonists/changeling/changeling.dm
@@ -1112,11 +1112,9 @@
total_chem_storage = 50
/datum/antagonist/changeling/headslug/greet()
- to_chat(owner, span_boldannounce("You are a fresh changeling birthed from a headslug! You aren't as strong as a normal changeling, as you are newly born."))
+ to_chat(owner, span_boldannounce("You are a fresh changeling birthed from a headslug! \
+ You aren't as strong as a normal changeling, as you are newly born."))
- var/policy = get_policy(ROLE_HEADSLUG_CHANGELING)
- if(policy)
- to_chat(owner, policy)
/datum/outfit/changeling
name = "Changeling"
diff --git a/code/modules/antagonists/heretic/heretic_antag.dm b/code/modules/antagonists/heretic/heretic_antag.dm
index 091043b5bb2..73982595d2a 100644
--- a/code/modules/antagonists/heretic/heretic_antag.dm
+++ b/code/modules/antagonists/heretic/heretic_antag.dm
@@ -167,12 +167,6 @@
return finish_preview_icon(icon)
-/datum/antagonist/heretic/greet()
- . = ..()
- var/policy = get_policy(ROLE_HERETIC)
- if(policy)
- to_chat(owner, policy)
-
/datum/antagonist/heretic/farewell()
if(!silent)
to_chat(owner.current, span_userdanger("Your mind begins to flare as the otherwordly knowledge escapes your grasp!"))
diff --git a/code/modules/antagonists/obsessed/obsessed.dm b/code/modules/antagonists/obsessed/obsessed.dm
index dc64a4bc12b..96eeceb3111 100644
--- a/code/modules/antagonists/obsessed/obsessed.dm
+++ b/code/modules/antagonists/obsessed/obsessed.dm
@@ -27,9 +27,6 @@
/datum/antagonist/obsessed/greet()
owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/creepalert.ogg', 100, FALSE, pressure_affected = FALSE, use_reverb = FALSE)
- var/policy = get_policy(ROLE_OBSESSED)
- if(policy)
- to_chat(owner, policy)
owner.announce_objectives()
/datum/antagonist/obsessed/Destroy()
diff --git a/code/modules/jobs/job_types/spawner/free_golem.dm b/code/modules/jobs/job_types/spawner/free_golem.dm
index 1fcfca7048b..a0dc8ea9b21 100644
--- a/code/modules/jobs/job_types/spawner/free_golem.dm
+++ b/code/modules/jobs/job_types/spawner/free_golem.dm
@@ -1,2 +1,3 @@
/datum/job/free_golem
title = ROLE_FREE_GOLEM
+ policy_index = ROLE_FREE_GOLEM
diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm
index 5d8786db3d5..3ae91834471 100644
--- a/code/modules/mob/living/carbon/human/human_helpers.dm
+++ b/code/modules/mob/living/carbon/human/human_helpers.dm
@@ -128,6 +128,7 @@
if(HAS_TRAIT_NOT_FROM(src, TRAIT_CHUNKYFINGERS, RIGHT_ARM_TRAIT) && HAS_TRAIT_NOT_FROM(src, TRAIT_CHUNKYFINGERS, LEFT_ARM_TRAIT))
return TRUE
return (active_hand_index % 2) ? HAS_TRAIT_FROM(src, TRAIT_CHUNKYFINGERS, LEFT_ARM_TRAIT) : HAS_TRAIT_FROM(src, TRAIT_CHUNKYFINGERS, RIGHT_ARM_TRAIT)
+
/mob/living/carbon/human/get_policy_keywords()
. = ..()
. += "[dna.species.type]"
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 3b0bb13694d..32e9b883be3 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -400,6 +400,7 @@
if(mind)
if(mind.assigned_role.policy_index)
. += mind.assigned_role.policy_index
+ . += mind.assigned_role.title //A bit redunant, but both title and policy index are used
. += mind.special_role //In case there's something special leftover, try to avoid
for(var/datum/antagonist/antag_datum as anything in mind.antag_datums)
. += "[antag_datum.type]"
diff --git a/code/modules/mob_spawn/ghost_roles/golem_roles.dm b/code/modules/mob_spawn/ghost_roles/golem_roles.dm
index 7f703ac88fd..7d3ee0f92a0 100644
--- a/code/modules/mob_spawn/ghost_roles/golem_roles.dm
+++ b/code/modules/mob_spawn/ghost_roles/golem_roles.dm
@@ -48,9 +48,6 @@
var/datum/species/golem/X = mob_species
to_chat(new_spawn, "[initial(X.info_text)]")
if(!owner)
- var/policy = get_policy(ROLE_FREE_GOLEM)
- if (policy)
- to_chat(new_spawn, policy)
to_chat(new_spawn, "Build golem shells in the autolathe, and feed refined mineral sheets to the shells to bring them to life! You are generally a peaceful group unless provoked.")
try_keep_home(new_spawn)
else
@@ -64,9 +61,9 @@
G.owner = owner
H.set_cloned_appearance()
if(has_owner && new_spawn.mind)
- new_spawn.mind.set_assigned_role(SSjob.GetJobType(/datum/job/servant_golem))
+ new_spawn.mind.set_assigned_role_with_greeting(SSjob.GetJobType(/datum/job/servant_golem))
else
- new_spawn.mind.set_assigned_role(SSjob.GetJobType(/datum/job/free_golem))
+ new_spawn.mind.set_assigned_role_with_greeting(SSjob.GetJobType(/datum/job/free_golem))
/obj/effect/mob_spawn/ghost_role/human/golem/proc/try_keep_home(mob/new_spawn)
var/static/list/allowed_areas = typecacheof(list(/area/icemoon, /area/lavaland, /area/ruin)) + typecacheof(/area/misc/survivalpod)
diff --git a/config/policy.json b/config/policy.json
index 9e26dfeeb6e..ade2a200f5c 100644
--- a/config/policy.json
+++ b/config/policy.json
@@ -1 +1,5 @@
-{}
\ No newline at end of file
+{
+ "How do I set policy?": "Policy is set in this file. It's simply setting the key to the text to show up.",
+ "Where is policy shown?": "Most, but not all policy text, is displayed when releveant, such as on gaining a role.",
+ "What can I all set policy of?": "Antagonist typepaths, mob typepaths, species typepaths, special roles, and some extra special policy keys are all valid. Consult the code."
+}