From 908c4f0dd1e49218611e2174a9aa4fc407ad23f1 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Fri, 9 Jul 2021 11:39:01 +0100 Subject: [PATCH] Jobban adjustments (#16319) * Borer ban * Terror Spider jobban category * Defines --- code/__DEFINES/role_preferences.dm | 5 +++++ code/__DEFINES/rolebans.dm | 5 +++-- code/__HELPERS/game.dm | 4 ++-- code/controllers/subsystem/ghost_spawns.dm | 2 +- code/datums/datacore.dm | 6 +++--- code/game/gamemodes/autotraitor/autotraitor.dm | 4 ++-- code/game/gamemodes/blob/blob.dm | 2 +- code/game/gamemodes/game_mode.dm | 2 +- code/game/gamemodes/miniantags/borer/borer.dm | 4 ++-- code/game/gamemodes/wizard/soulstone.dm | 2 +- code/game/machinery/wishgranter.dm | 2 +- code/game/objects/items/robot/robot_parts.dm | 2 +- code/modules/admin/verbs/one_click_antag.dm | 8 ++++---- code/modules/admin/verbs/randomverbs.dm | 15 ++++++++++----- code/modules/client/preference/preferences.dm | 4 ++-- code/modules/mob/dead/observer/observer.dm | 2 +- .../mob/living/carbon/brain/robotic_brain.dm | 4 ++-- code/modules/mob/living/silicon/pai/recruit.dm | 2 +- .../simple_animal/hostile/terror_spiders/ghost.dm | 4 ++-- code/modules/mob/transform_procs.dm | 2 +- 20 files changed, 46 insertions(+), 35 deletions(-) diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm index 85c15c1971c..45c7a5d0f99 100644 --- a/code/__DEFINES/role_preferences.dm +++ b/code/__DEFINES/role_preferences.dm @@ -39,11 +39,16 @@ #define ROLE_ERT "emergency response team" #define ROLE_NYMPH "Dionaea" #define ROLE_GSPIDER "giant spider" +#define ROLE_TSPIDER "terror spider" #define ROLE_DRONE "drone" #define ROLE_DEATHSQUAD "deathsquad" #define ROLE_EVENTMISC "eventmisc" #define ROLE_GHOST "ghost role" +// Misc jobban categories +#define ROLEBAN_AHUD "AntagHUD" +#define ROLEBAN_RECORDS "Records" + //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 //(in game days played) to play that role diff --git a/code/__DEFINES/rolebans.dm b/code/__DEFINES/rolebans.dm index ad6f1324afa..58670bcbb77 100644 --- a/code/__DEFINES/rolebans.dm +++ b/code/__DEFINES/rolebans.dm @@ -18,6 +18,7 @@ GLOBAL_LIST_INIT(antag_roles, list( ROLE_GUARDIAN, ROLE_MORPH, ROLE_GSPIDER, + ROLE_TSPIDER, )) // Bannable other roles @@ -26,6 +27,6 @@ GLOBAL_LIST_INIT(other_roles, list( ROLE_NYMPH, ROLE_ERT, ROLE_GHOST, - "AntagHUD", - "Records" + ROLEBAN_AHUD, + ROLEBAN_RECORDS )) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 63e527b59f2..561ab7ca198 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -308,7 +308,7 @@ if(G.client != null) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) if(!G.client.is_afk(afk_bracket) && (be_special_type in G.client.prefs.be_special)) - if(!override_jobban || (!jobban_isbanned(G, roletext) && !jobban_isbanned(G,"Syndicate"))) + if(!override_jobban || (!jobban_isbanned(G, roletext) && !jobban_isbanned(G, ROLE_SYNDICATE))) if(override_age || player_old_enough_antag(G.client,be_special_type)) candidates += G.client afk_bracket += 600 // Add a minute to the bracket, for every attempt @@ -324,7 +324,7 @@ if(G.client != null) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) if(!G.client.is_afk(afk_bracket) && (be_special_type in G.client.prefs.be_special)) - if(!override_jobban || (!jobban_isbanned(G, roletext) && !jobban_isbanned(G,"Syndicate"))) + if(!override_jobban || (!jobban_isbanned(G, roletext) && !jobban_isbanned(G, ROLE_SYNDICATE))) if(override_age || player_old_enough_antag(G.client,be_special_type)) candidates += G afk_bracket += 600 // Add a minute to the bracket, for every attempt diff --git a/code/controllers/subsystem/ghost_spawns.dm b/code/controllers/subsystem/ghost_spawns.dm index e0234c2616a..96ac8f09116 100644 --- a/code/controllers/subsystem/ghost_spawns.dm +++ b/code/controllers/subsystem/ghost_spawns.dm @@ -164,7 +164,7 @@ SUBSYSTEM_DEF(ghost_spawns) if(!player_old_enough_antag(M.client, role)) return if(role_text) - if(jobban_isbanned(M, role_text) || jobban_isbanned(M, "Syndicate")) + if(jobban_isbanned(M, role_text) || jobban_isbanned(M, ROLE_SYNDICATE)) return if(config.use_exp_restrictions && min_hours) if(M.client.get_exp_type_num(EXP_TYPE_LIVING) < min_hours * 60) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 38b1dd5954d..a79eb2105ae 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -163,7 +163,7 @@ GLOBAL_VAR_INIT(record_id_num, 1001) G.fields["photo"] = get_id_photo(H) G.fields["photo-south"] = "data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = SOUTH))]" G.fields["photo-west"] = "data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = WEST))]" - if(H.gen_record && !jobban_isbanned(H, "Records")) + if(H.gen_record && !jobban_isbanned(H, ROLEBAN_RECORDS)) G.fields["notes"] = H.gen_record else G.fields["notes"] = "No notes found." @@ -183,7 +183,7 @@ GLOBAL_VAR_INIT(record_id_num, 1001) M.fields["alg_d"] = "No allergies have been detected in this patient." M.fields["cdi"] = "None" M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - if(H.med_record && !jobban_isbanned(H, "Records")) + if(H.med_record && !jobban_isbanned(H, ROLEBAN_RECORDS)) M.fields["notes"] = H.med_record else M.fields["notes"] = "No notes found." @@ -199,7 +199,7 @@ GLOBAL_VAR_INIT(record_id_num, 1001) S.fields["ma_crim"] = "None" S.fields["ma_crim_d"] = "No major crime convictions." S.fields["notes"] = "No notes." - if(H.sec_record && !jobban_isbanned(H, "Records")) + if(H.sec_record && !jobban_isbanned(H, ROLEBAN_RECORDS)) S.fields["notes"] = H.sec_record else S.fields["notes"] = "No notes found." diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index 92352f782fd..f0dbb68ec15 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -84,7 +84,7 @@ traitorcount += 1 continue if(ishuman(player) || isAI(player)) - if((ROLE_TRAITOR in player.client.prefs.be_special) && !player.client.skip_antag && !jobban_isbanned(player, ROLE_TRAITOR) && !jobban_isbanned(player, "Syndicate")) + if((ROLE_TRAITOR in player.client.prefs.be_special) && !player.client.skip_antag && !jobban_isbanned(player, ROLE_TRAITOR) && !jobban_isbanned(player, ROLE_SYNDICATE)) possible_traitors += player.mind for(var/datum/mind/player in possible_traitors) for(var/job in restricted_jobs) @@ -144,7 +144,7 @@ if(SSshuttle.emergency.mode >= SHUTTLE_ESCAPE) return //message_admins("Late Join Check") - if(character.client && (ROLE_TRAITOR in character.client.prefs.be_special) && !character.client.skip_antag && !jobban_isbanned(character, ROLE_TRAITOR) && !jobban_isbanned(character, "Syndicate")) + if(character.client && (ROLE_TRAITOR in character.client.prefs.be_special) && !character.client.skip_antag && !jobban_isbanned(character, ROLE_TRAITOR) && !jobban_isbanned(character, ROLE_SYNDICATE)) //message_admins("Late Joiner has Be Syndicate") //message_admins("Checking number of players") var/playercount = 0 diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index ba674aae658..85d776ad662 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -57,7 +57,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) /datum/game_mode/blob/proc/get_blob_candidates() var/list/candidates = list() for(var/mob/living/carbon/human/player in GLOB.player_list) - if(!player.stat && player.mind && !player.client.skip_antag && !player.mind.special_role && !jobban_isbanned(player, "Syndicate") && (ROLE_BLOB in player.client.prefs.be_special)) + if(!player.stat && player.mind && !player.client.skip_antag && !player.mind.special_role && !jobban_isbanned(player, ROLE_SYNDICATE) && (ROLE_BLOB in player.client.prefs.be_special)) candidates += player return candidates diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 343f8bf27ae..7fdf66c7a1f 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -238,7 +238,7 @@ // Assemble a list of active players without jobbans. for(var/mob/new_player/player in GLOB.player_list) if(player.client && player.ready && player.has_valid_preferences()) - if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext)) + if(!jobban_isbanned(player, ROLE_SYNDICATE) && !jobban_isbanned(player, roletext)) if(player_old_enough_antag(player.client,role)) players += player diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm index 0342c1d4707..ea62734f383 100644 --- a/code/game/gamemodes/miniantags/borer/borer.dm +++ b/code/game/gamemodes/miniantags/borer/borer.dm @@ -128,8 +128,8 @@ if(cannotPossess(user)) to_chat(user, "Upon using the antagHUD you forfeited the ability to join the round.") return - if(jobban_isbanned(user, "Syndicate")) - to_chat(user, "You are banned from antagonists!") + if(jobban_isbanned(user, ROLE_SYNDICATE) || jobban_isbanned(user, ROLE_BORER)) + to_chat(user, "You are banned from playing this antagonist!") return if(key) return diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index 37f1bbf4c6d..574042abc08 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -366,7 +366,7 @@ qdel(SS) /proc/make_new_construct(mob/living/simple_animal/hostile/construct/c_type, mob/target, mob/user, cult_override = FALSE) - if(jobban_isbanned(target, "cultist")) + if(jobban_isbanned(target, ROLE_CULTIST)) return var/mob/living/simple_animal/hostile/construct/C = new c_type(get_turf(target)) C.faction |= "\ref[user]" diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm index c4c4c674294..d762543f807 100644 --- a/code/game/machinery/wishgranter.dm +++ b/code/game/machinery/wishgranter.dm @@ -57,7 +57,7 @@ to_chat(user, "You feel a dark stirring inside of the Wish Granter, something you want nothing of. Your instincts are better than any man's.") return TRUE - if(is_special_character(user) || jobban_isbanned(user, ROLE_TRAITOR) || jobban_isbanned(user, "Syndicate")) + if(is_special_character(user) || jobban_isbanned(user, ROLE_TRAITOR) || jobban_isbanned(user, ROLE_SYNDICATE)) to_chat(user, "Something instinctual makes you pull away.") return TRUE diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index c758e109e81..e3049e47634 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -226,7 +226,7 @@ to_chat(user, "Sticking an empty [M] into the frame would sort of defeat the purpose.") return - if(jobban_isbanned(M.brainmob, "Cyborg") || jobban_isbanned(M.brainmob,"nonhumandept")) + if(jobban_isbanned(M.brainmob, "Cyborg") || jobban_isbanned(M.brainmob, "nonhumandept")) to_chat(user, "This [W] is not fit to serve as a cyborg!") return diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 66bc9aae6cc..06f4086fe81 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -27,7 +27,7 @@ /datum/admins/proc/CandCheck(role = null, mob/living/carbon/human/M, datum/game_mode/temp = null) // You pass in ROLE define (optional), the applicant, and the gamemode, and it will return true / false depending on whether the applicant qualify for the candidacy in question - if(jobban_isbanned(M, "Syndicate")) + if(jobban_isbanned(M, ROLE_SYNDICATE)) return FALSE if(M.stat || !M.mind || M.mind.special_role || M.mind.offstation_role) return FALSE @@ -199,7 +199,7 @@ for(var/mob/G in GLOB.respawnable_list) if(istype(G) && G.client && (ROLE_OPERATIVE in G.client.prefs.be_special)) - if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate")) + if(!jobban_isbanned(G, ROLE_OPERATIVE) && !jobban_isbanned(G, ROLE_SYNDICATE)) if(player_old_enough_antag(G.client,ROLE_OPERATIVE)) spawn(0) switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No")) @@ -316,7 +316,7 @@ //Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos. for(var/mob/G in GLOB.respawnable_list) - if(!jobban_isbanned(G, "Syndicate")) + if(!jobban_isbanned(G, ROLE_SYNDICATE)) spawn(0) switch(alert(G,"Do you wish to be considered for an elite syndicate strike team being sent in?","Please answer in 30 seconds!","Yes","No")) if("Yes") @@ -427,7 +427,7 @@ for(var/mob/G in GLOB.respawnable_list) if(istype(G) && G.client && (ROLE_RAIDER in G.client.prefs.be_special)) if(player_old_enough_antag(G.client,ROLE_RAIDER)) - if(!jobban_isbanned(G, "raider") && !jobban_isbanned(G, "Syndicate")) + if(!jobban_isbanned(G, ROLE_RAIDER) && !jobban_isbanned(G, ROLE_SYNDICATE)) spawn(0) switch(alert(G,"Do you wish to be considered for a vox raiding party arriving on the station?","Please answer in 30 seconds!","Yes","No")) if("Yes") diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 484bd321bf1..0d724e68420 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -498,11 +498,16 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!ckey) var/list/candidates = list() for(var/mob/M in GLOB.player_list) - if(M.stat != DEAD) continue //we are not dead! - if(!(ROLE_ALIEN in M.client.prefs.be_special)) continue //we don't want to be an alium - if(jobban_isbanned(M, "alien") || jobban_isbanned(M, "Syndicate")) continue //we are jobbanned - if(M.client.is_afk()) continue //we are afk - if(M.mind && M.mind.current && M.mind.current.stat != DEAD) continue //we have a live body we are tied to + if(M.stat != DEAD) + continue //we are not dead! + if(!(ROLE_ALIEN in M.client.prefs.be_special)) + continue //we don't want to be an alium + if(jobban_isbanned(M, ROLE_ALIEN) || jobban_isbanned(M, ROLE_SYNDICATE)) + continue //we are jobbanned + if(M.client.is_afk()) + continue //we are afk + if(M.mind && M.mind.current && M.mind.current.stat != DEAD) + continue //we have a live body we are tied to candidates += M.ckey if(candidates.len) ckey = input("Pick the player you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 12d7bc62237..60e973b8770 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -362,7 +362,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts dat += "" dat += "

Occupation Choices

" dat += "Set Occupation Preferences
" - if(jobban_isbanned(user, "Records")) + if(jobban_isbanned(user, ROLEBAN_RECORDS)) dat += "You are banned from using character records.
" else dat += "Character Records
" @@ -495,7 +495,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts // RIGHT SIDE OF THE PAGE dat += "" dat += "

Special Role Settings

" - if(jobban_isbanned(user, "Syndicate")) + if(jobban_isbanned(user, ROLE_SYNDICATE)) dat += "You are banned from special roles." be_special = list() else diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index b48a20013d2..42d86e0553a 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -360,7 +360,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!client) return var/mob/dead/observer/M = src - if(jobban_isbanned(M, "AntagHUD")) + if(jobban_isbanned(M, ROLEBAN_AHUD)) to_chat(src, "You have been banned from using this feature") return diff --git a/code/modules/mob/living/carbon/brain/robotic_brain.dm b/code/modules/mob/living/carbon/brain/robotic_brain.dm index e7c3528ae27..9fdaa57ec23 100644 --- a/code/modules/mob/living/carbon/brain/robotic_brain.dm +++ b/code/modules/mob/living/carbon/brain/robotic_brain.dm @@ -64,7 +64,7 @@ /obj/item/mmi/robotic_brain/proc/check_observer(mob/dead/observer/O) if(cannotPossess(O)) return FALSE - if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept")) + if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O, "nonhumandept")) return FALSE if(!O.can_reenter_corpse) return FALSE @@ -160,7 +160,7 @@ if(cannotPossess(O)) to_chat(O, "Upon using the antagHUD you forfeited the ability to join the round.") return - if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept")) + if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O, "nonhumandept")) to_chat(O, "You are job banned from this role.") return to_chat(O, "You've been added to the list of ghosts that may become this [src]. Click again to unvolunteer.") diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index 1966c535022..02de57df689 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -368,7 +368,7 @@ GLOBAL_DATUM_INIT(paiController, /datum/paiController, new) // Global handler fo //question(O.client) /datum/paiController/proc/check_recruit(mob/dead/observer/O) - if(jobban_isbanned(O, ROLE_PAI) || jobban_isbanned(O,"nonhumandept")) + if(jobban_isbanned(O, ROLE_PAI) || jobban_isbanned(O, "nonhumandept")) return 0 if(!player_old_enough_antag(O.client,ROLE_PAI)) return 0 diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/ghost.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/ghost.dm index 685b508c291..74c829200f8 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/ghost.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/ghost.dm @@ -28,8 +28,8 @@ error_on_humanize = "Dead spiders are not player-controllable." else if(!(user in GLOB.respawnable_list)) error_on_humanize = "You are not able to rejoin the round." - if(jobban_isbanned(user, "Syndicate") || jobban_isbanned(user, "alien")) - to_chat(user,"You are jobbanned from role of syndicate and/or alien lifeform.") + if(jobban_isbanned(user, ROLE_SYNDICATE) || jobban_isbanned(user, ROLE_TSPIDER)) + to_chat(user, "You are jobbanned from role of syndicate and/or terror spider.") return if(error_on_humanize == "") var/spider_ask = alert(humanize_prompt, "Join as Terror Spider?", "Yes", "No") diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index feb60d9ba67..fb08abb0977 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -299,7 +299,7 @@ if(ispath(MP, /mob/living/simple_animal/butterfly)) return 1 - if(ispath(MP, /mob/living/simple_animal/borer) && !jobban_isbanned(src, ROLE_BORER) && !jobban_isbanned(src, "Syndicate")) + if(ispath(MP, /mob/living/simple_animal/borer) && !jobban_isbanned(src, ROLE_BORER) && !jobban_isbanned(src, ROLE_SYNDICATE)) return 1 if(ispath(MP, /mob/living/simple_animal/diona) && !jobban_isbanned(src, ROLE_NYMPH))