From 0a2e8057357ca2d84e63c6ea31814bed4014d2c0 Mon Sep 17 00:00:00 2001 From: BlackMajor Date: Sun, 11 Aug 2019 01:37:36 +1200 Subject: [PATCH] Adds spawn character as mob verb --- code/modules/admin/admin_verbs.dm | 1 + code/modules/admin/verbs/randomverbs.dm | 82 +++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 4bad67b370..9f2aadb974 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -148,6 +148,7 @@ var/list/admin_verbs_spawn = list( /datum/admins/proc/spawn_plant, /datum/admins/proc/spawn_atom, //allows us to spawn instances, /client/proc/respawn_character, + /client/proc/spawn_character_mob, /client/proc/virus2_editor, /client/proc/spawn_chemdisp_cartridge, /client/proc/map_template_load, diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 3475e60314..d68139f055 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -513,6 +513,88 @@ Traitors and the like can also be revived with the previous role mostly intact. return new_character +/client/proc/spawn_character_mob() + set category = "Special Verbs" + set name = "Spawn Character As Mob" + set desc = "Spawn a specified ckey as a chosen mob." + if(!holder) + src << "Only administrators may use this command." + return + + var/client/picked_client = input(src, "Who are we spawning as a mob?", "Client", "Cancel") as null|anything in GLOB.clients + if(!picked_client) + return + var/list/types = typesof(/mob/living) + var/mob_type = input(src, "Mob path to spawn as?", "Mob") as text + if(!mob_type) + return + var/list/matches = new() + for(var/path in types) + if(findtext("[path]", mob_type)) + matches += path + if(matches.len==0) + return + var/mob/living/chosen + if(matches.len==1) + chosen = matches[1] + else + chosen = input("Select a mob type", "Select Mob", matches[1]) as null|anything in matches + if(!chosen) + return + src << "[chosen]" + + src << "YEET 1" + + var/char_name = alert(src, "Spawn mob with their character name?", "Mob name", "Yes", "No", "Cancel") + var/name = 0 + src << "YEET 2" + if(char_name == "Cancel") + return + if(char_name == "Yes") + name = 1 + var/vorgans = alert(src, "Spawn mob with their character's vore organs and prefs?", "Vore organs", "Yes", "No", "Cancel") + var/organs + if(vorgans == "Cancel") + return + if(vorgans == "Yes") + organs = 1 + if(vorgans == "No") + organs = 0 + + src << "YEET 3" + + var/spawnloc + if(!src.mob) + src << "Can't spawn them in unless you're in a valid spawn location!" + return + spawnloc = get_turf(src.mob) + + var/mob/living/new_mob = new chosen(spawnloc) + src << "[new_mob]" + + if(!new_mob) + src << "Spawning failed, try again or bully coders" + return + new_mob.ai_holder_type = /datum/ai_holder/simple_mob/inert //Dont want the mob AI to activate if the client dc's or anything + + if(name) + new_mob.real_name = picked_client.prefs.real_name + new_mob.name = picked_client.prefs.real_name + + + new_mob.key = picked_client.key //Finally put them in the mob + if(organs) + new_mob.copy_from_prefs_vr() + + log_admin("[key_name_admin(src)] has spawned [new_mob.key] as mob [new_mob.type].") + message_admins("[key_name_admin(src)] has spawned [new_mob.key] as mob [new_mob.type].", 1) + + new_mob << "You've been spawned as a mob! Have fun." + + return new_mob + + + /client/proc/cmd_admin_add_freeform_ai_law() set category = "Fun" set name = "Add Custom AI law"