From a444918936d37b70dd5f28dc2751992e02b56095 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Fri, 19 Feb 2021 23:11:41 +0000 Subject: [PATCH 1/4] Update ghost_role_spawners.dm --- .../objects/structures/ghost_role_spawners.dm | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm index fadf33cb85..004386f2bc 100644 --- a/code/game/objects/structures/ghost_role_spawners.dm +++ b/code/game/objects/structures/ghost_role_spawners.dm @@ -662,6 +662,50 @@ to_chat(M,"You're once again longer hearing deadchat.") +/datum/action/disguise + name = "Disguise" + button_icon_state = "ling_transform" + icon_icon = 'icons/mob/actions/actions_changeling.dmi' + background_icon_state = "bg_mime" + +/datum/action/disguise/Trigger() + var/mob/living/carbon/human/H = owner + var/user_search_type = input(H, "Search by PATH or NAME") as null|anything in list("PATH","NAME") + if(user_search_type) + var/user_object_type = input(H, "Disguising as OBJECT or MOB?") as null|anything in list("OBJECT", "MOB") + if(user_object_type) + var/search_term = stripped_input(H, "Enter the search term") + if(search_term) + var/list_to_search + if(user_object_type == "MOB") + list_to_search = subtypesof(/mob) + else + list_to_search = subtypesof(/obj) + var/list/filtered_results = list() + // it's better to have two loops here rather than make the conditional check for path or name in every cycle of a single loop + var/x = 0 + switch(user_search_type) + if("PATH") + for(var/some_search_item in list_to_search) + if(findtext("[some_search_item]", search_term)) + filtered_results += some_search_item + if("NAME") + for(var/some_search_item in list_to_search) + var/mob/some_search_atom = some_search_item + if(findtext(initial(some_search_atom.name), search_term)) + filtered_results[some_search_item] += some_search_atom.name + if(x < 10) + message_admins("initial name is [initial(some_search_atom.name)]") + + x += 1 + if(!length(filtered_results)) + to_chat(H, "Nothing matched your search query!") + message_admins("for reference the length of list to search was [length(list_to_search)]") + else + message_admins("it s + var/disguise_selection = input("Select item to disguise as") as null|anything in filtered_results + + /obj/effect/mob_spawn/human/ghostcafe/special(mob/living/carbon/human/new_spawn) if(new_spawn.client) new_spawn.client.prefs.copy_to(new_spawn) @@ -681,6 +725,11 @@ var/datum/action/toggle_dead_chat_mob/D = new(new_spawn) D.Grant(new_spawn) + + // debug if you see this delete it + var/datum/action/disguise/disguise_action = new(new_spawn) + disguise_action.Grant(new_spawn) + /datum/outfit/ghostcafe name = "ID, jumpsuit and shoes" uniform = /obj/item/clothing/under/color/random From d34c821db44ac50450d09d819c79ea75bc395f4d Mon Sep 17 00:00:00 2001 From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Fri, 19 Feb 2021 23:45:01 +0000 Subject: [PATCH 2/4] Update ghost_role_spawners.dm --- code/game/objects/structures/ghost_role_spawners.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm index 004386f2bc..c79369dfe0 100644 --- a/code/game/objects/structures/ghost_role_spawners.dm +++ b/code/game/objects/structures/ghost_role_spawners.dm @@ -693,7 +693,7 @@ for(var/some_search_item in list_to_search) var/mob/some_search_atom = some_search_item if(findtext(initial(some_search_atom.name), search_term)) - filtered_results[some_search_item] += some_search_atom.name + filtered_results[some_search_item] = some_search_atom.name if(x < 10) message_admins("initial name is [initial(some_search_atom.name)]") @@ -702,7 +702,6 @@ to_chat(H, "Nothing matched your search query!") message_admins("for reference the length of list to search was [length(list_to_search)]") else - message_admins("it s var/disguise_selection = input("Select item to disguise as") as null|anything in filtered_results From deb1a5374d8654cb689fc617d5a5321e7b828c8d Mon Sep 17 00:00:00 2001 From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Sat, 20 Feb 2021 00:33:57 +0000 Subject: [PATCH 3/4] Update ghost_role_spawners.dm --- .../objects/structures/ghost_role_spawners.dm | 38 ++++++++----------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm index c79369dfe0..b66cec270e 100644 --- a/code/game/objects/structures/ghost_role_spawners.dm +++ b/code/game/objects/structures/ghost_role_spawners.dm @@ -667,11 +667,11 @@ button_icon_state = "ling_transform" icon_icon = 'icons/mob/actions/actions_changeling.dmi' background_icon_state = "bg_mime" + var/currently_disguised = FALSE /datum/action/disguise/Trigger() var/mob/living/carbon/human/H = owner - var/user_search_type = input(H, "Search by PATH or NAME") as null|anything in list("PATH","NAME") - if(user_search_type) + if(!currently_disguised) var/user_object_type = input(H, "Disguising as OBJECT or MOB?") as null|anything in list("OBJECT", "MOB") if(user_object_type) var/search_term = stripped_input(H, "Enter the search term") @@ -682,28 +682,23 @@ else list_to_search = subtypesof(/obj) var/list/filtered_results = list() - // it's better to have two loops here rather than make the conditional check for path or name in every cycle of a single loop - var/x = 0 - switch(user_search_type) - if("PATH") - for(var/some_search_item in list_to_search) - if(findtext("[some_search_item]", search_term)) - filtered_results += some_search_item - if("NAME") - for(var/some_search_item in list_to_search) - var/mob/some_search_atom = some_search_item - if(findtext(initial(some_search_atom.name), search_term)) - filtered_results[some_search_item] = some_search_atom.name - if(x < 10) - message_admins("initial name is [initial(some_search_atom.name)]") - - x += 1 + for(var/some_search_item in list_to_search) + if(findtext("[some_search_item]", search_term)) + filtered_results += some_search_item if(!length(filtered_results)) to_chat(H, "Nothing matched your search query!") - message_admins("for reference the length of list to search was [length(list_to_search)]") else var/disguise_selection = input("Select item to disguise as") as null|anything in filtered_results - + if(disguise_selection) + var/atom/disguise_item = disguise_selection + var/image/I = image(icon = initial(disguise_item.icon), icon_state = initial(disguise_item.icon_state), loc = H) + I.override = TRUE + I.layer = ABOVE_MOB_LAYER + H.add_alt_appearance(/datum/atom_hud/alternate_appearance/basic/everyone, "ghost_cafe_disguise", I) + currently_disguised = TRUE + else + H.remove_alt_appearance("ghost_cafe_disguise") + currently_disguised = FALSE /obj/effect/mob_spawn/human/ghostcafe/special(mob/living/carbon/human/new_spawn) if(new_spawn.client) @@ -723,9 +718,6 @@ to_chat(new_spawn,"Ghosting is free!") var/datum/action/toggle_dead_chat_mob/D = new(new_spawn) D.Grant(new_spawn) - - - // debug if you see this delete it var/datum/action/disguise/disguise_action = new(new_spawn) disguise_action.Grant(new_spawn) From b2015e4c94b605e47f07f74ead842a78a469aacc Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Sun, 21 Feb 2021 17:32:07 +0000 Subject: [PATCH 4/4] blacklist --- .../objects/structures/ghost_role_spawners.dm | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm index b66cec270e..68970a6f23 100644 --- a/code/game/objects/structures/ghost_role_spawners.dm +++ b/code/game/objects/structures/ghost_role_spawners.dm @@ -668,6 +668,34 @@ icon_icon = 'icons/mob/actions/actions_changeling.dmi' background_icon_state = "bg_mime" var/currently_disguised = FALSE + var/static/list/mob_blacklist = typecacheof(list( + /mob/living/simple_animal/pet, + /mob/living/simple_animal/hostile/retaliate/goose, + /mob/living/simple_animal/hostile/poison, + /mob/living/simple_animal/hostile/retaliate/goat, + /mob/living/simple_animal/cow, + /mob/living/simple_animal/chick, + /mob/living/simple_animal/chicken, + /mob/living/simple_animal/kiwi, + /mob/living/simple_animal/babyKiwi, + /mob/living/simple_animal/deer, + /mob/living/simple_animal/parrot, + /mob/living/simple_animal/hostile/lizard, + /mob/living/simple_animal/crab, + /mob/living/simple_animal/cockroach, + /mob/living/simple_animal/butterfly, + /mob/living/simple_animal/mouse, + /mob/living/simple_animal/sloth, + /mob/living/simple_animal/opossum, + /mob/living/simple_animal/hostile/bear, + /mob/living/simple_animal/hostile/asteroid/polarbear, + /mob/living/simple_animal/hostile/asteroid/wolf, + /mob/living/carbon/monkey, + /mob/living/simple_animal/hostile/gorilla, + /mob/living/carbon/alien/larva, + /mob/living/simple_animal/hostile/retaliate/frog + )) + /datum/action/disguise/Trigger() var/mob/living/carbon/human/H = owner @@ -678,7 +706,7 @@ if(search_term) var/list_to_search if(user_object_type == "MOB") - list_to_search = subtypesof(/mob) + list_to_search = subtypesof(/mob) - mob_blacklist else list_to_search = subtypesof(/obj) var/list/filtered_results = list()