Adds a new admin verb (#3521)

Adds a verb that allows admins to replace people using the ghost trap. It is in the secrets menu. If the person they are replacing has a special role (IE. merc) it will only asks ghosts who have that pref enabled. Otherwise, it asks anyone.
This commit is contained in:
Ron
2017-10-01 15:17:55 +02:00
committed by Werner
parent 913e47721e
commit 85ab392256
4 changed files with 198 additions and 0 deletions
@@ -0,0 +1,25 @@
/datum/admin_secret_item/admin_secret/replace_player_with_ghost
name = "Replace player with ghost"
/datum/admin_secret_item/admin_secret/replace_player_with_ghost/can_execute(var/mob/user)
if(!ROUND_IS_STARTED) return 0
return ..()
/datum/admin_secret_item/admin_secret/replace_player_with_ghost/execute(var/mob/user)
. = ..()
if(!.)
return
var/list/targets = list()
targets += getmobs()
var/mob/T = input(user, "Which player do you want to replace?") as null|anything in targets
if (!T)
return
var/mob/player_to_replace = targets[T]
var/datum/ghosttrap/G = get_ghost_trap("[player_to_replace.mind.special_role]")
if(player_to_replace.client)
player_to_replace.ghostize(0)
if(G)
G.request_player(player_to_replace, "Would you like to play as a [player_to_replace.mind.special_role]?", 60 SECONDS)
else
G = ghost_traps["Special"]
G.request_player(player_to_replace, "Would you like to play as [player_to_replace.name]?", 60 SECONDS)