Admin Verb Datums MkIII | Now with functional command bar (#82511)

This commit is contained in:
Zephyr
2024-04-12 12:27:09 -07:00
committed by GitHub
parent e0d335b442
commit 7f8752be14
104 changed files with 1898 additions and 3287 deletions
+59 -24
View File
@@ -1,11 +1,4 @@
/datum/admins/proc/spawn_objasmob(object as text)
set category = "Debug"
set desc = "(obj path) Spawn object-mob"
set name = "Spawn object-mob"
if(!check_rights(R_SPAWN))
return
ADMIN_VERB(spawn_obj_as_mob, R_SPAWN, "Spawn Object-Mob", "Spawn an object as if it were a mob.", ADMIN_CATEGORY_DEBUG, object as text)
var/chosen = pick_closest_path(object, make_types_fancy(subtypesof(/obj)))
if (!chosen)
@@ -15,21 +8,63 @@
var/obj/chosen_obj = text2path(chosen)
var/list/settings = list(
"mainsettings" = list(
"name" = list("desc" = "Name", "type" = "string", "value" = "Bob"),
"maxhealth" = list("desc" = "Max. health", "type" = "number", "value" = 100),
"access" = list("desc" = "Access ID", "type" = "datum", "path" = "/obj/item/card/id", "value" = "Default"),
"objtype" = list("desc" = "Base obj type", "type" = "datum", "path" = "/obj", "value" = "[chosen]"),
"googlyeyes" = list("desc" = "Googly eyes", "type" = "boolean", "value" = "No"),
"disableai" = list("desc" = "Disable AI", "type" = "boolean", "value" = "Yes"),
"idledamage" = list("desc" = "Damaged while idle", "type" = "boolean", "value" = "No"),
"dropitem" = list("desc" = "Drop obj on death", "type" = "boolean", "value" = "Yes"),
"mobtype" = list("desc" = "Base mob type", "type" = "datum", "path" = "/mob/living/simple_animal/hostile/mimic/copy", "value" = "/mob/living/simple_animal/hostile/mimic/copy"),
"ckey" = list("desc" = "ckey", "type" = "ckey", "value" = "none"),
var/list/settings = list("mainsettings" = list(
"name" = list(
"desc" = "Name",
"type" = "string",
"value" = "Bob",
),
"maxhealth" = list(
"desc" = "Max. health",
"type" = "number",
"value" = 100,
),
"access" = list(
"desc" = "Access ID",
"type" = "datum",
"path" = "/obj/item/card/id",
"value" = "Default",
),
"objtype" = list(
"desc" = "Base obj type",
"type" = "datum",
"path" = "/obj",
"value" = "[chosen]",
),
"googlyeyes" = list(
"desc" = "Googly eyes",
"type" = "boolean",
"value" = "No",
),
"disableai" = list(
"desc" = "Disable AI",
"type" = "boolean",
"value" = "Yes",
),
"idledamage" = list(
"desc" = "Damaged while idle",
"type" = "boolean",
"value" = "No",
),
"dropitem" = list(
"desc" = "Drop obj on death",
"type" = "boolean",
"value" = "Yes",
),
"mobtype" = list(
"desc" = "Base mob type",
"type" = "datum",
"path" = "/mob/living/simple_animal/hostile/mimic/copy",
"value" = "/mob/living/simple_animal/hostile/mimic/copy",
),
"ckey" = list(
"desc" = "ckey",
"type" = "ckey",
"value" = "none",
),
))
var/list/prefreturn = presentpreflikepicker(usr,"Customize mob", "Customize mob", Button1="Ok", width = 450, StealFocus = 1,Timeout = 0, settings=settings)
var/list/prefreturn = presentpreflikepicker(user.mob,"Customize mob", "Customize mob", Button1="Ok", width = 450, StealFocus = 1,Timeout = 0, settings=settings)
if (prefreturn["button"] == 1)
settings = prefreturn["settings"]
var/mainsettings = settings["mainsettings"]
@@ -37,9 +72,9 @@
basemob = text2path(mainsettings["mobtype"]["value"])
if (!ispath(basemob, /mob/living/simple_animal/hostile/mimic/copy) || !ispath(chosen_obj, /obj))
to_chat(usr, "Mob or object path invalid", confidential = TRUE)
to_chat(user.mob, "Mob or object path invalid", confidential = TRUE)
basemob = new basemob(get_turf(usr), new chosen_obj(get_turf(usr)), usr, mainsettings["dropitem"]["value"] == "Yes" ? FALSE : TRUE, (mainsettings["googlyeyes"]["value"] == "Yes" ? FALSE : TRUE))
basemob = new basemob(get_turf(user.mob), new chosen_obj(get_turf(user.mob)), user.mob, mainsettings["dropitem"]["value"] == "Yes" ? FALSE : TRUE, (mainsettings["googlyeyes"]["value"] == "Yes" ? FALSE : TRUE))
if (mainsettings["disableai"]["value"] == "Yes")
basemob.toggle_ai(AI_OFF)
@@ -65,5 +100,5 @@
basemob.ckey = mainsettings["ckey"]["value"]
log_admin("[key_name(usr)] spawned a sentient object-mob [basemob] from [chosen_obj] at [AREACOORD(usr)]")
log_admin("[key_name(user.mob)] spawned a sentient object-mob [basemob] from [chosen_obj] at [AREACOORD(user.mob)]")
BLACKBOX_LOG_ADMIN_VERB("Spawn object-mob")