Files
Bubberstation/code/modules/admin/verbs/spawnobjasmob.dm
jimmyl 4b512f1239 makes mimics into basicmobs (#88910)
## About The Pull Request

mimics are basicmobs now
the only change not carried over worth mentioning is that all mimics are
a consistent speed because i cant imagine a gun or object with aimbot
going at you mach 2 would be very fun

mimic crates had some stuff changed compared to their simple animal
variant
they open and close their lid when attacking (unless locked) to be like
menacing or something like animals flash colors to ward off people
attempting to open a nonsentient hostile crate mimic will make it lock
itself (if it contains anything) and attack you

mimics are a really stupid naming for these because like
mimic crates pretend to be crates
anything else inheriting from mimics are just used to make objects alive



https://github.com/user-attachments/assets/34a733a4-45a3-409e-8a6a-b2a8c7540898



ranged mimics now use viscontents (they also keep trying to pointblank
people for some reason i think thats ok though unless its a wand of
fireball)
ranged mimic (any ranged weapon animated by a bolt of animation)


https://github.com/user-attachments/assets/c3f1d2f5-cfb8-46a9-a58c-255c53a034db



## Why It's Good For The Game
fixes #85668

## Changelog
🆑
refactor: mimics (bolt of animation, malf ai Machine Override, etc) are
basicmobs
fix: crate mimics may now be opened
/🆑

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2025-01-19 21:29:49 +00:00

108 lines
3.3 KiB
Plaintext

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)
return
var/mob/living/basic/mimic/copy/basemob = /mob/living/basic/mimic/copy
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/basic/mimic/copy",
"value" = "/mob/living/basic/mimic/copy",
),
"ckey" = list(
"desc" = "ckey",
"type" = "ckey",
"value" = "none",
),
))
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"]
chosen_obj = text2path(mainsettings["objtype"]["value"])
basemob = text2path(mainsettings["mobtype"]["value"])
if (!ispath(basemob, /mob/living/basic/mimic/copy) || !ispath(chosen_obj, /obj))
to_chat(user.mob, "Mob or object path invalid", confidential = 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")
qdel(basemob.ai_controller)
basemob.ai_controller = null
if (mainsettings["idledamage"]["value"] == "No")
basemob.idledamage = FALSE
if (mainsettings["access"])
var/newaccess = text2path(mainsettings["access"]["value"])
if (ispath(newaccess))
var/obj/item/card/id/id = new newaccess //cant do initial on lists
basemob.AddComponent(/datum/component/simple_access, id.access)
qdel(id)
if (mainsettings["maxhealth"]["value"])
if (!isnum(mainsettings["maxhealth"]["value"]))
mainsettings["maxhealth"]["value"] = text2num(mainsettings["maxhealth"]["value"])
if (mainsettings["maxhealth"]["value"] > 0)
basemob.maxHealth = basemob.maxHealth = mainsettings["maxhealth"]["value"]
if (mainsettings["name"]["value"])
basemob.name = basemob.real_name = html_decode(mainsettings["name"]["value"])
if (mainsettings["ckey"]["value"] != "none")
basemob.ckey = mainsettings["ckey"]["value"]
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")