Administration tool: Build mode offer tool to quickly offer large amount of mobs. (#26712)

* offer buildmode

* stops asking to show special role if already decided in build mode

* Update offer.dm

* minor oopsy

* linter crying

* Update code/modules/buildmode/submodes/offer.dm

Co-authored-by: chuga-git <98280110+chuga-git@users.noreply.github.com>
Signed-off-by: meow20 <62257265+meow20@users.noreply.github.com>

* Update mob_misc_procs.dm

* Update code/modules/mob/mob_misc_procs.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: meow20 <62257265+meow20@users.noreply.github.com>

---------

Signed-off-by: meow20 <62257265+meow20@users.noreply.github.com>
Co-authored-by: chuga-git <98280110+chuga-git@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
meow20
2024-09-19 12:46:53 +02:00
committed by GitHub
parent c1c1ef94f5
commit a091516181
6 changed files with 47 additions and 5 deletions
+15 -5
View File
@@ -158,16 +158,26 @@
return U.sensor_mode
return SUIT_SENSOR_OFF
/proc/offer_control(mob/M)
to_chat(M, "Control of your mob has been offered to dead players.")
/proc/offer_control(mob/M, hours, hide_role)
if(HAS_TRAIT(M, TRAIT_BEING_OFFERED))
return
var/minhours
ADD_TRAIT(M, TRAIT_BEING_OFFERED, "admin_offer")
log_admin("[key_name(usr)] has offered control of ([key_name(M)]) to ghosts.")
var/minhours = input(usr, "Minimum hours required to play [M]?", "Set Min Hrs", 10) as num
message_admins("[key_name_admin(usr)] has offered control of ([key_name_admin(M)]) to ghosts with [minhours] hrs playtime")
var/question = "Do you want to play as [M.real_name ? M.real_name : M.name][M.job ? " ([M.job])" : ""]"
if(alert("Do you want to show the antag status?","Show antag status","Yes","No") == "Yes")
if(!hours)
minhours = input(usr, "Minimum hours required to play [M]?", "Set Min Hrs", 10) as num
else
minhours = hours
if(isnull(hide_role))
if(alert("Do you want to show the antag status?","Show antag status","Yes","No") == "Yes")
question += ", [M.mind?.special_role || "No special role"]"
else if(!hide_role)
question += ", [M.mind?.special_role ? M.mind?.special_role : "No special role"]"
message_admins("[key_name_admin(usr)] has offered control of ([key_name_admin(M)]) to ghosts with [minhours] hrs playtime")
var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("[question]?", poll_time = 10 SECONDS, min_hours = minhours, source = M)
var/mob/dead/observer/theghost = null
REMOVE_TRAIT(M, TRAIT_BEING_OFFERED, "admin_offer")
if(length(candidates))
if(QDELETED(M))