From 25894314d3eac494ddf0bc351687b5afd8cce4eb Mon Sep 17 00:00:00 2001 From: VerySoft Date: Mon, 23 Aug 2021 06:32:54 -0400 Subject: [PATCH] Adds the ability to ban people from ghost roles There are some mobs you can play as now that are PRETTY ABUSABLE, and there's some players who play fine normally, but get into trouble and take things too far when you put them in special roles, SO! Rather than just flat banning those people from the server, it would be cool if we could just, ban them from playing those roles. This should help with that. --- code/datums/ghost_query.dm | 7 ++++++- code/game/objects/items/devices/denecrotizer_vr.dm | 4 +++- code/game/objects/structures/ghost_pods/event_vr.dm | 3 +++ code/game/objects/structures/ghost_pods/ghost_pods.dm | 5 +++++ code/game/objects/structures/ghost_pods/ghost_pods_vr.dm | 4 ++++ code/modules/admin/topic.dm | 6 ++++++ 6 files changed, 27 insertions(+), 2 deletions(-) diff --git a/code/datums/ghost_query.dm b/code/datums/ghost_query.dm index d40ef7bab89..c471c47c812 100644 --- a/code/datums/ghost_query.dm +++ b/code/datums/ghost_query.dm @@ -52,6 +52,11 @@ /// Send async alerts and ask for responses. Expects you to have tested D for client and type already /datum/ghost_query/proc/ask_question(var/mob/observer/dead/D) + //VOREStation Add Start Check the ban status before we ask + if(jobban_isbanned(D, "GhostRoles")) + return + //VOREStation Add End + var/client/C = D.client window_flash(C) @@ -67,7 +72,7 @@ return // Unhandled are "No" and "Nevermind" responses, which should just do nothing - + // This response is always fine, doesn't warrant retesting switch(response) if("Never for this round") diff --git a/code/game/objects/items/devices/denecrotizer_vr.dm b/code/game/objects/items/devices/denecrotizer_vr.dm index 8aeaba5b0d9..e25dc145317 100644 --- a/code/game/objects/items/devices/denecrotizer_vr.dm +++ b/code/game/objects/items/devices/denecrotizer_vr.dm @@ -43,7 +43,9 @@ /mob/living/simple_mob/attack_ghost(mob/observer/dead/user as mob) if(!ghostjoin) return ..() - + if(jobban_isbanned(user, "GhostRoles")) + to_chat(user, "You cannot inhabit this creature because you are banned from playing ghost roles.") + return if(!evaluate_ghost_join(user)) return ..() diff --git a/code/game/objects/structures/ghost_pods/event_vr.dm b/code/game/objects/structures/ghost_pods/event_vr.dm index a41e1e99b5e..c566f95e763 100644 --- a/code/game/objects/structures/ghost_pods/event_vr.dm +++ b/code/game/objects/structures/ghost_pods/event_vr.dm @@ -51,6 +51,9 @@ var/finalized = "No" while(finalized == "No" && M.client) + if(jobban_isbanned(M, "GhostRoles")) + to_chat(M, "You cannot inhabit this creature because you are banned from playing ghost roles.") + return choice = tgui_input_list(M, "What type of predator do you want to play as?", "Maintpred Choice", possible_mobs) if(!choice) randomize = TRUE diff --git a/code/game/objects/structures/ghost_pods/ghost_pods.dm b/code/game/objects/structures/ghost_pods/ghost_pods.dm index c77e00e13e5..8197e958a87 100644 --- a/code/game/objects/structures/ghost_pods/ghost_pods.dm +++ b/code/game/objects/structures/ghost_pods/ghost_pods.dm @@ -84,6 +84,11 @@ description_info = "A ghost can click on this to return to the round as whatever is contained inside this object." /obj/structure/ghost_pod/ghost_activated/attack_ghost(var/mob/observer/dead/user) + //VOREStation Add Start + if(jobban_isbanned(user, "GhostRoles")) + to_chat(user, "You cannot inhabit this creature because you are banned from playing ghost roles.") + return + //VOREStation Add End if(used) to_chat(user, "Another spirit appears to have gotten to \the [src] before you. Sorry.") return diff --git a/code/game/objects/structures/ghost_pods/ghost_pods_vr.dm b/code/game/objects/structures/ghost_pods/ghost_pods_vr.dm index a792e1b5592..be189d37edf 100644 --- a/code/game/objects/structures/ghost_pods/ghost_pods_vr.dm +++ b/code/game/objects/structures/ghost_pods/ghost_pods_vr.dm @@ -11,6 +11,10 @@ var/activated = FALSE /obj/structure/ghost_pod/manual/attack_ghost(var/mob/observer/dead/user) + if(jobban_isbanned(user, "GhostRoles")) + to_chat(user, "You cannot inhabit this creature because you are banned from playing ghost roles.") + return + if(!remains_active || busy) return diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 4649296b14a..19a336d20b3 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -591,6 +591,12 @@ jobs += "pAI" else jobs += "pAI" + //VOREStation Add Start + if(jobban_isbanned(M, "GhostRoles")) + jobs += "GhostRoles" + else + jobs += "GhostRoles" + //VOREStation Add End if(jobban_isbanned(M, "AntagHUD")) jobs += "AntagHUD" else