mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Minor update to admin secrets panel (free antags for everyone) (#81292)
## About The Pull Request Remakes a button in admin secrets panel from everyone is traitor to everyone is admin chosen antag. ## Why It's Good For The Game Slightly better buttons for admin to push ## Changelog 🆑 admin: remade everyone is traitor into everyone is antag in secrets panel /🆑
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
|
||||
GLOBAL_DATUM(everyone_an_antag, /datum/everyone_is_an_antag_controller)
|
||||
|
||||
/client/proc/secrets() //Creates a verb for admins to open up the ui
|
||||
set name = "Secrets"
|
||||
@@ -457,24 +457,35 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
|
||||
for(var/i in GLOB.human_list)
|
||||
var/mob/living/carbon/human/H = i
|
||||
INVOKE_ASYNC(H, TYPE_PROC_REF(/mob/living/carbon, monkeyize))
|
||||
if("traitor_all")
|
||||
if("antag_all")
|
||||
if(!is_funmin)
|
||||
return
|
||||
if(!SSticker.HasRoundStarted())
|
||||
tgui_alert(usr,"The game hasn't started yet!")
|
||||
return
|
||||
if(GLOB.everyone_a_traitor)
|
||||
tgui_alert(usr, "The everyone is a traitor secret has already been triggered")
|
||||
if(GLOB.everyone_an_antag)
|
||||
var/are_we_antagstacking = tgui_alert(usr, "The everyone is antag secret has already been triggered. Do you want to stack antags?", "DANGER ZONE. Are you sure about this?", list("Confirm", "Abort"))
|
||||
if(are_we_antagstacking != "Confirm")
|
||||
return
|
||||
|
||||
var/chosen_antag = tgui_input_list(usr, "Choose antag", "Chose antag", list(ROLE_TRAITOR, ROLE_CHANGELING, ROLE_HERETIC, ROLE_CULTIST, ROLE_NINJA, ROLE_WIZARD, ROLE_NIGHTMARE))
|
||||
if(!chosen_antag)
|
||||
return
|
||||
var/objective = tgui_input_text(holder, "Enter an objective", "Objective")
|
||||
var/objective = tgui_input_text(usr, "Enter an objective", "Objective")
|
||||
if(!objective)
|
||||
return
|
||||
GLOB.everyone_a_traitor = new /datum/everyone_is_a_traitor_controller(objective)
|
||||
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Traitor All", "[objective]"))
|
||||
var/confirmation = tgui_alert(usr, "Make everyone in to [chosen_antag] with objective: [objective]", "Are you sure about this?", list("Confirm", "Abort"))
|
||||
if(confirmation != "Confirm")
|
||||
return
|
||||
var/keep_generic_objecives = tgui_alert(usr, "Generate normal objectives?", "Give default objectives?", list("Yes", "No"))
|
||||
keep_generic_objecives = (keep_generic_objecives != "Yes") ? FALSE : TRUE
|
||||
|
||||
GLOB.everyone_an_antag = new /datum/everyone_is_an_antag_controller(chosen_antag, objective, keep_generic_objecives)
|
||||
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("[chosen_antag] All", "[objective]"))
|
||||
for(var/mob/living/player in GLOB.player_list)
|
||||
GLOB.everyone_a_traitor.make_traitor(null, player)
|
||||
message_admins(span_adminnotice("[key_name_admin(holder)] used everyone is a traitor secret. Objective is [objective]"))
|
||||
log_admin("[key_name(holder)] used everyone is a traitor secret. Objective is [objective]")
|
||||
GLOB.everyone_an_antag.make_antag(null, player)
|
||||
message_admins(span_adminnotice("[key_name_admin(holder)] used everyone is antag secret. Antag is [chosen_antag]. Objective is [objective]. Generate default objectives: [keep_generic_objecives]"))
|
||||
log_admin("[key_name(holder)] used everyone is antag secret: [chosen_antag] . Objective is [objective]. Generate default objectives: [keep_generic_objecives]. ")
|
||||
if("massbraindamage")
|
||||
if(!is_funmin)
|
||||
return
|
||||
@@ -641,38 +652,79 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
|
||||
T.flick_overlay_static(portal_appearance[GET_TURF_PLANE_OFFSET(T) + 1], 15)
|
||||
playsound(T, 'sound/magic/lightningbolt.ogg', rand(80, 100), TRUE)
|
||||
|
||||
///Makes sure latejoining crewmembers also become traitors.
|
||||
/datum/everyone_is_a_traitor_controller
|
||||
/datum/everyone_is_an_antag_controller
|
||||
var/chosen_antag = ""
|
||||
var/objective = ""
|
||||
var/keep_generic_objecives
|
||||
|
||||
/datum/everyone_is_a_traitor_controller/New(objective)
|
||||
/datum/everyone_is_an_antag_controller/New(chosen_antag, objective, keep_generic_objecives)
|
||||
. = ..()
|
||||
src.chosen_antag = chosen_antag
|
||||
src.objective = objective
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED, PROC_REF(make_traitor))
|
||||
src.keep_generic_objecives = keep_generic_objecives
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED, PROC_REF(make_antag_delay))
|
||||
|
||||
/datum/everyone_is_a_traitor_controller/Destroy()
|
||||
/datum/everyone_is_an_antag_controller/Destroy()
|
||||
UnregisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED)
|
||||
return ..()
|
||||
|
||||
/datum/everyone_is_a_traitor_controller/proc/make_traitor(datum/source, mob/living/player)
|
||||
/datum/everyone_is_an_antag_controller/proc/assign_admin_objective_and_antag(mob/living/player, datum/antagonist/antag_datum)
|
||||
var/datum/objective/new_objective = new(objective)
|
||||
new_objective.team = player
|
||||
new_objective.team_explanation_text = objective
|
||||
antag_datum.objectives += new_objective
|
||||
player.mind.add_antag_datum(antag_datum)
|
||||
|
||||
/datum/everyone_is_an_antag_controller/proc/make_antag_delay(datum/source, mob/living/player)
|
||||
SIGNAL_HANDLER
|
||||
INVOKE_ASYNC(src, PROC_REF(make_antag), source, player)
|
||||
|
||||
|
||||
/datum/everyone_is_an_antag_controller/proc/make_antag(datum/source, mob/living/player)
|
||||
if(player.stat == DEAD || !player.mind)
|
||||
return
|
||||
if(is_special_character(player))
|
||||
return
|
||||
sleep(1)
|
||||
if(ishuman(player))
|
||||
var/datum/antagonist/traitor/traitor_datum = new(give_objectives = FALSE)
|
||||
var/datum/objective/new_objective = new
|
||||
new_objective.owner = player
|
||||
new_objective.explanation_text = objective
|
||||
traitor_datum.objectives += new_objective
|
||||
player.mind.add_antag_datum(traitor_datum)
|
||||
var/datum/uplink_handler/uplink = traitor_datum.uplink_handler
|
||||
uplink.has_progression = FALSE
|
||||
uplink.has_objectives = FALSE
|
||||
switch(chosen_antag)
|
||||
if(ROLE_TRAITOR)
|
||||
var/datum/antagonist/traitor/antag_datum = new(give_objectives = keep_generic_objecives)
|
||||
assign_admin_objective_and_antag(player, antag_datum)
|
||||
var/datum/uplink_handler/uplink = antag_datum.uplink_handler
|
||||
uplink.has_progression = FALSE
|
||||
uplink.has_objectives = FALSE
|
||||
if(ROLE_CHANGELING)
|
||||
var/datum/antagonist/changeling/antag_datum = new
|
||||
antag_datum.give_objectives = keep_generic_objecives
|
||||
assign_admin_objective_and_antag(player, antag_datum)
|
||||
if(ROLE_HERETIC)
|
||||
var/datum/antagonist/heretic/antag_datum = new
|
||||
antag_datum.give_objectives = keep_generic_objecives
|
||||
assign_admin_objective_and_antag(player, antag_datum)
|
||||
if(ROLE_CULTIST)
|
||||
var/datum/antagonist/cult/antag_datum = new
|
||||
assign_admin_objective_and_antag(player, antag_datum)
|
||||
if(ROLE_NINJA)
|
||||
var/datum/antagonist/ninja/antag_datum = new
|
||||
antag_datum.give_objectives = keep_generic_objecives
|
||||
for(var/obj/item/item_to_drop in player)
|
||||
if(!istype(item_to_drop, /obj/item/implant)) //avoid removing implanted uplinks
|
||||
player.dropItemToGround(item_to_drop, FALSE)
|
||||
assign_admin_objective_and_antag(player, antag_datum)
|
||||
if(ROLE_WIZARD)
|
||||
var/datum/antagonist/wizard/antag_datum = new
|
||||
antag_datum.give_objectives = keep_generic_objecives
|
||||
antag_datum.move_to_lair = FALSE
|
||||
for(var/obj/item/item_to_drop in player) //avoid deleting player's items
|
||||
if(!istype(item_to_drop, /obj/item/implant))
|
||||
player.dropItemToGround(item_to_drop, FALSE)
|
||||
assign_admin_objective_and_antag(player, antag_datum)
|
||||
if(ROLE_NIGHTMARE)
|
||||
var/datum/antagonist/nightmare/antag_datum = new
|
||||
assign_admin_objective_and_antag(player, antag_datum)
|
||||
player.set_species(/datum/species/shadow/nightmare)
|
||||
|
||||
else if(isAI(player))
|
||||
var/datum/antagonist/malf_ai/malfunction_datum = new(give_objectives = FALSE)
|
||||
var/datum/objective/new_objective = new
|
||||
new_objective.owner = player
|
||||
new_objective.explanation_text = objective
|
||||
malfunction_datum.objectives += new_objective
|
||||
player.mind.add_antag_datum(malfunction_datum)
|
||||
var/datum/antagonist/malf_ai/antag_datum = new
|
||||
antag_datum.give_objectives = keep_generic_objecives
|
||||
assign_admin_objective_and_antag(player, antag_datum)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user