From 5d0853e16a494bfcf99c883124c966e87e3df3e2 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Sun, 8 Oct 2017 17:05:40 +0000 Subject: [PATCH] Crew objective/miscreant system tweaks (#3213) * Loadsa tweaks * adds miscreant pref, other fixes * fixes runtime * fixes compiling errors for REAL now hopefully * HOPEFULLY fixes compiling errors * COMPILE! --- code/__DEFINES/citadel_defines.dm | 2 +- code/__DEFINES/role_preferences.dm | 4 ++- code/citadel/cit_crewobjectives.dm | 5 ++-- code/citadel/cit_miscreants.dm | 7 ++++- .../cit_crewobjectives_civilian.dm | 27 +++---------------- .../cit_crewobjectives_medical.dm | 2 +- code/controllers/subsystem/ticker.dm | 12 ++++----- .../modules/mob/dead/new_player/new_player.dm | 4 +-- 8 files changed, 25 insertions(+), 38 deletions(-) diff --git a/code/__DEFINES/citadel_defines.dm b/code/__DEFINES/citadel_defines.dm index 51ba9d4c59..4c8243cdc5 100644 --- a/code/__DEFINES/citadel_defines.dm +++ b/code/__DEFINES/citadel_defines.dm @@ -70,4 +70,4 @@ #define ADMIN_MARKREAD(client) "(MARK READ)"//marks an adminhelp as read and under investigation #define ADMIN_IC(client) "(IC)"//marks and adminhelp as an IC issue -#define ADMIN_REJECT(client) "(REJT)"//Rejects an adminhelp for being unclear or otherwise unhelpful. resets their adminhelp timer \ No newline at end of file +#define ADMIN_REJECT(client) "(REJT)"//Rejects an adminhelp for being unclear or otherwise unhelpful. resets their adminhelp timer diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm index cea6bc5e36..ab62710652 100644 --- a/code/__DEFINES/role_preferences.dm +++ b/code/__DEFINES/role_preferences.dm @@ -24,6 +24,7 @@ #define ROLE_SERVANT_OF_RATVAR "servant of Ratvar" #define ROLE_BORER "borer" #define ROLE_BROTHER "blood brother" +#define ROLE_MISCREANT "miscreant" //Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR. //The gamemode specific ones are just so the gamemodes can query whether a player is old enough @@ -46,7 +47,8 @@ GLOBAL_LIST_INIT(special_roles, list( ROLE_ABDUCTOR = /datum/game_mode/abduction, ROLE_DEVIL = /datum/game_mode/devil, ROLE_BORER, - ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult + ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult, + ROLE_MISCREANT )) //Job defines for what happens when you fail to qualify for any job during job selection diff --git a/code/citadel/cit_crewobjectives.dm b/code/citadel/cit_crewobjectives.dm index 2d9149f5b1..90a655b622 100644 --- a/code/citadel/cit_crewobjectives.dm +++ b/code/citadel/cit_crewobjectives.dm @@ -1,6 +1,6 @@ /datum/controller/subsystem/ticker/proc/generate_crew_objectives() for(var/datum/mind/crewMind in SSticker.minds) - if(prob(2) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed) + if(prob(2) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in crewMind.current.client.prefs.be_special) generate_miscreant_objectives(crewMind) else if(CONFIG_GET(flag/allow_crew_objectives)) @@ -25,7 +25,8 @@ return newObjective.owner = crewMind crewMind.objectives += newObjective - to_chat(crewMind, "Your objective: [newObjective.explanation_text]") + to_chat(crewMind, "As a part of Nanotrasen's anti-tide efforts, you have been assigned an optional objective. It will be checked at the end of the shift. Performing traitorous acts in pursuit of your objective may result in termination of your employment.") + to_chat(crewMind, "Your optional objective: [newObjective.explanation_text]") /datum/controller/subsystem/ticker/proc/get_valid_crew_objs(var/job = "")//taken from old hippie with adjustments var/list/objpaths = typesof(/datum/objective/crew) diff --git a/code/citadel/cit_miscreants.dm b/code/citadel/cit_miscreants.dm index f828127b55..e658fad097 100644 --- a/code/citadel/cit_miscreants.dm +++ b/code/citadel/cit_miscreants.dm @@ -7,6 +7,8 @@ return if(!crewMind.assigned_role) return + if(ROLE_MISCREANT in crewMind.current.client.prefs.be_special) + return if(jobban_isbanned(crewMind, "Syndicate")) return var/list/objectiveTypes = typesof(/datum/objective/miscreant) - /datum/objective/miscreant @@ -58,4 +60,7 @@ explanation_text = "Act as out of character as you possibly can." /datum/objective/miscreant/racism - explanation_text = "Attempt to establish superiority of your race." + explanation_text = "Attempt to establish superiority of your species." + +/datum/objective/miscreant/cargonia + explanation_text = "Attempt to establish independence of your department." diff --git a/code/citadel/crew_objectives/cit_crewobjectives_civilian.dm b/code/citadel/crew_objectives/cit_crewobjectives_civilian.dm index 81427c7951..9be0e1c028 100644 --- a/code/citadel/crew_objectives/cit_crewobjectives_civilian.dm +++ b/code/citadel/crew_objectives/cit_crewobjectives_civilian.dm @@ -185,29 +185,6 @@ else return FALSE -/datum/objective/crew/departmentclothes - var/obj/item/clothing/under/rank/targetuniform - explanation_text = "Be wearing a (Yo, this objective broke. report this to citadels discord via the development channel) at the end of the shift." - jobs = "assistant" - -/datum/objective/crew/departmentclothes/New() - . = ..() - var/list/blacklist = list(/obj/item/clothing/under/rank, /obj/item/clothing/under/rank/miner, /obj/item/clothing/under/rank/medical/blue, /obj/item/clothing/under/rank/medical/green, /obj/item/clothing/under/rank/medical/purple, /obj/item/clothing/under/rank/security/grey, /obj/item/clothing/under/rank/warden/grey, /obj/item/clothing/under/rank/head_of_security/grey, /obj/item/clothing/under/rank/mailman, /obj/item/clothing/under/rank/psyche, /obj/item/clothing/under/rank/clown/sexy, /obj/item/clothing/under/rank/centcom_officer, /obj/item/clothing/under/rank/centcom_commander, /obj/item/clothing/under/rank/security/navyblue/russian, /obj/item/clothing/under/rank/security/blueshirt) - var/list/validclothes = typesof(/obj/item/clothing/under/rank) - blacklist - targetuniform = pick(validclothes) - update_explanation_text() - -/datum/objective/crew/departmentclothes/update_explanation_text() - . = ..() - explanation_text = "Be wearing a [initial(targetuniform.name)] at the end of the shift." - -/datum/objective/crew/departmentclothes/check_completion() - if(owner && owner.current) - var/mob/living/carbon/human/H = owner.current - if(istype(H.w_uniform, targetuniform)) - return TRUE - return FALSE - /datum/objective/crew/pwrgame //ported from Goon with adjustments var/obj/item/clothing/targettidegarb explanation_text = "Get your grubby hands on a (Dear god something broke. Report this to Citadel's development dicussion channel)." @@ -215,7 +192,9 @@ /datum/objective/crew/pwrgame/New() . = ..() - var/list/muhvalids = list(/obj/item/clothing/mask/gas, /obj/item/clothing/head/welding, /obj/item/clothing/head/ushanka, /obj/item/clothing/gloves/color/yellow, /obj/item/clothing/mask/gas/owl_mask, /obj/item/clothing/suit/space) + var/list/muhvalids = list(/obj/item/clothing/mask/gas, /obj/item/clothing/head/welding, /obj/item/clothing/head/ushanka, /obj/item/clothing/gloves/color/yellow, /obj/item/clothing/mask/gas/owl_mask) + if(prob(10)) + muhvalids += list(/obj/item/clothing/suit/space) targettidegarb = pick(muhvalids) update_explanation_text() diff --git a/code/citadel/crew_objectives/cit_crewobjectives_medical.dm b/code/citadel/crew_objectives/cit_crewobjectives_medical.dm index 43d470f2f3..53a9dc73aa 100644 --- a/code/citadel/crew_objectives/cit_crewobjectives_medical.dm +++ b/code/citadel/crew_objectives/cit_crewobjectives_medical.dm @@ -74,7 +74,7 @@ return FALSE /datum/objective/crew/noinfections - explanation_text = "Ensure no living crew members are infected with harmful viruses at the end of the shift" + explanation_text = "Make sure there are no crew members with harmful diseases at the end of the shift." jobs = "virologist" /datum/objective/crew/noinfections/check_completion() diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index fc53bfa25a..b7c3176067 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -258,7 +258,7 @@ SUBSYSTEM_DEF(ticker) //Deleting Startpoints but we need the ai point to AI-ize people later if(S.name != "AI") qdel(S) - + //assign crew objectives and generate miscreants if(CONFIG_GET(flag/allow_extended_miscreants) && GLOB.master_mode == "extended") GLOB.miscreants_allowed = TRUE @@ -282,7 +282,7 @@ SUBSYSTEM_DEF(ticker) qdel(bomb) if(epi) explosion(epi, 0, 256, 512, 0, TRUE, TRUE, 0, TRUE) - + /datum/controller/subsystem/ticker/proc/create_characters() for(var/mob/dead/new_player/player in GLOB.player_list) if(player.ready == PLAYER_READY_TO_PLAY && player.mind) @@ -472,13 +472,13 @@ SUBSYSTEM_DEF(ticker) if(!crewMind.current || !crewMind.objectives.len) continue for(var/datum/objective/miscreant/MO in crewMind.objectives) - miscreants += "[crewMind.current.real_name] (Played by: [crewMind.key]). Objective: [MO.explanation_text]" + miscreants += "[crewMind.current.real_name] (Played by: [crewMind.key])
Objective: [MO.explanation_text] (Optional)
" for(var/datum/objective/crew/CO in crewMind.objectives) if(CO.check_completion()) - to_chat(crewMind.current, "
Your objective: [CO.explanation_text] Success!") - successfulCrew += "[crewMind.current.real_name] (Played by: [crewMind.key]). Objective: [CO.explanation_text]" + to_chat(crewMind.current, "
Your optional objective: [CO.explanation_text] Success!") + successfulCrew += "[crewMind.current.real_name] (Played by: [crewMind.key])
Objective: [CO.explanation_text] Success! (Optional)
" else - to_chat(crewMind.current, "
Your objective: [CO.explanation_text] Failed.") + to_chat(crewMind.current, "
Your optional objective: [CO.explanation_text] Failed.") if (successfulCrew.len) var/completedObjectives = "The following crew members completed their Crew Objectives:
" diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 9aab9e54f1..b692ab2d32 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -80,7 +80,7 @@ if(SSticker.current_state == GAME_STATE_PREGAME) var/time_remaining = SSticker.GetTimeLeft() if(time_remaining > 0) - stat("Time To Start:", "[round(time_remaining/10)]s") + stat("Time To Start:", "[round(time_remaining/10)]s") else if(time_remaining == -10) stat("Time To Start:", "DELAYED") else @@ -375,7 +375,7 @@ if(GLOB.highlander) to_chat(humanc, "THERE CAN BE ONLY ONE!!!") humanc.make_scottish() - if(prob(2) && !issilicon(humanc) && !jobban_isbanned(humanc.mind, "Syndicate") && GLOB.miscreants_allowed) + if(prob(2) && !issilicon(humanc) && !jobban_isbanned(humanc.mind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in humanc.client.prefs.be_special) SSticker.generate_miscreant_objectives(humanc.mind) else if(CONFIG_GET(flag/allow_crew_objectives))