Ghostspawner Conversion 2 (#10970)

This commit is contained in:
Geeves
2021-01-16 12:41:24 +01:00
committed by GitHub
parent 74982a3222
commit e2abfd7e23
17 changed files with 118 additions and 555 deletions
@@ -80,6 +80,8 @@
var/hat_x_offset = 0
var/hat_y_offset = -13
var/rebooting = FALSE
/mob/living/silicon/robot/drone/can_be_possessed_by(var/mob/abstract/observer/possessor)
if(!istype(possessor) || !possessor.client || !possessor.ckey)
return FALSE
@@ -239,6 +241,9 @@
if(!allowed(usr))
to_chat(user, SPAN_WARNING("Access denied."))
return
if(rebooting)
to_chat(user, SPAN_WARNING("\The [src] is already rebooting!"))
return
user.visible_message(SPAN_NOTICE("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src], attempting to reboot it."), SPAN_NOTICE("You swipe your ID card through \the [src], attempting to reboot it."))
request_player()
return
@@ -370,11 +375,17 @@
//Reboot procs.
/mob/living/silicon/robot/drone/Logout()
. = ..()
rebooting = FALSE
/mob/living/silicon/robot/drone/proc/request_player()
if(too_many_active_drones())
return
var/datum/ghosttrap/G = get_ghost_trap("maintenance drone")
G.request_player(src, "Someone is attempting to reboot a maintenance drone.", 30 SECONDS)
if(rebooting)
return
stat = CONSCIOUS
SSghostroles.add_spawn_atom("rebooted_maint_drone", src)
/mob/living/silicon/robot/drone/proc/transfer_personality(var/client/player)
if(!player)