From b26daf5fb1ef259ac6f43b98892b0fc898135d59 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Mon, 24 Feb 2020 12:59:33 -0800 Subject: [PATCH] Hide items in plant pots and plushies --- code/game/machinery/vending.dm | 6 +- code/game/objects/items/tailoring.dm | 7 ++ code/game/objects/items/toys.dm | 99 ++++++++++++++++++++++++++- code/game/objects/structures/flora.dm | 38 ++++++++++ vorestation.dme | 1 + 5 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 code/game/objects/items/tailoring.dm diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 070351ea2c2..90f801c7a3e 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -1128,7 +1128,8 @@ /obj/item/toy/plushie/face_hugger = 1, /obj/item/toy/plushie/carp = 1, /obj/item/toy/plushie/deer = 1, - /obj/item/toy/plushie/tabby_cat = 1) + /obj/item/toy/plushie/tabby_cat = 1, + /obj/item/device/threadneedle = 3) premium = list(/obj/item/weapon/reagent_containers/food/drinks/bottle/champagne = 1, /obj/item/weapon/storage/trinketbox = 2) prices = list(/obj/item/weapon/storage/fancy/heartbox = 15, @@ -1156,7 +1157,8 @@ /obj/item/toy/plushie/face_hugger = 50, /obj/item/toy/plushie/carp = 50, /obj/item/toy/plushie/deer = 50, - /obj/item/toy/plushie/tabby_cat = 50) + /obj/item/toy/plushie/tabby_cat = 50, + /obj/item/device/threadneedle = 2) /obj/machinery/vending/fishing name = "Loot Trawler" diff --git a/code/game/objects/items/tailoring.dm b/code/game/objects/items/tailoring.dm new file mode 100644 index 00000000000..4dc359ba333 --- /dev/null +++ b/code/game/objects/items/tailoring.dm @@ -0,0 +1,7 @@ +// I like the idea of this item having more uses in future. + +/obj/item/device/threadneedle + name = "thread and needle" + icon = 'icons/obj/items.dmi' + icon_state = "needle_thread" + desc = "Used for most sewing and tailoring applications." diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 43bf50f7eb3..ec8cb44e5aa 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -880,9 +880,31 @@ anchored = 0 density = 1 var/phrase = "I don't want to exist anymore!" - + var/searching = FALSE + var/opened = FALSE // has this been slit open? this will allow you to store an object in a plushie. + var/obj/item/stored_item // Note: Stored items can't be bigger than the plushie itself. + +/obj/structure/plushie/examine(mob/user) + ..() + if(opened) + to_chat(user, "You notice an incision has been made on [src].") + if(in_range(user, src) && stored_item) + to_chat(user, "You can see something in there...") + /obj/structure/plushie/attack_hand(mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + + if(stored_item && !searching) + searching = TRUE + if(do_after(user, 10)) + to_chat(user, "You find \icon[stored_item] [stored_item] in [src]!") + stored_item.forceMove(get_turf(src)) + stored_item = null + searching = FALSE + return + else + searching = FALSE + if(user.a_intent == I_HELP) user.visible_message("\The [user] hugs [src]!","You hug [src]!") else if (user.a_intent == I_HURT) @@ -894,6 +916,34 @@ visible_message("[src] says, \"[phrase]\"") +/obj/structure/plushie/attackby(obj/item/I as obj, mob/user as mob) + if(istype(I, /obj/item/device/threadneedle) && opened) + to_chat(user, "You sew the hole in [src].") + opened = FALSE + return + + if(is_sharp(I) && !opened) + to_chat(user, "You open a small incision in [src]. You can place tiny items inside.") + opened = TRUE + return + + if(opened) + if(stored_item) + to_chat(user, "There is already something in here.") + return + + if(!(I.w_class > w_class)) + to_chat(user, "You place [I] inside [src].") + user.drop_from_inventory(I, src) + I.forceMove(src) + stored_item = I + return + else + to_chat(user, "You open a small incision in [src]. You can place tiny items inside.") + + + ..() + /obj/structure/plushie/ian name = "plush corgi" desc = "A plushie of an adorable corgi! Don't you just want to hug it and squeeze it and call it \"Ian\"?" @@ -927,8 +977,30 @@ w_class = ITEMSIZE_TINY var/last_message = 0 var/pokephrase = "Uww!" + var/searching = FALSE + var/opened = FALSE // has this been slit open? this will allow you to store an object in a plushie. + var/obj/item/stored_item // Note: Stored items can't be bigger than the plushie itself. + + +/obj/item/toy/plushie/examine(mob/user) + ..() + if(opened) + to_chat(user, "You notice an incision has been made on [src].") + if(in_range(user, src) && stored_item) + to_chat(user, "You can see something in there...") /obj/item/toy/plushie/attack_self(mob/user as mob) + if(stored_item && !searching) + searching = TRUE + if(do_after(user, 10)) + to_chat(user, "You find \icon[stored_item] [stored_item] in [src]!") + stored_item.forceMove(get_turf(src)) + stored_item = null + searching = FALSE + return + else + searching = FALSE + if(world.time - last_message <= 1 SECOND) return if(user.a_intent == I_HELP) @@ -961,6 +1033,31 @@ if(istype(I, /obj/item/toy/plushie) || istype(I, /obj/item/organ/external/head)) user.visible_message("[user] makes \the [I] kiss \the [src]!.", \ "You make \the [I] kiss \the [src]!.") + return + + + if(istype(I, /obj/item/device/threadneedle) && opened) + to_chat(user, "You sew the hole underneath [src].") + opened = FALSE + return + + if(is_sharp(I) && !opened) + to_chat(user, "You open a small incision in [src]. You can place tiny items inside.") + opened = TRUE + return + + if( (!(I.w_class > w_class)) && opened) + if(stored_item) + to_chat(user, "There is already something in here.") + return + + to_chat(user, "You place [I] inside [src].") + user.drop_from_inventory(I, src) + I.forceMove(src) + stored_item = I + to_chat(user, "You placed [I] into [src].") + return + return ..() /obj/item/toy/plushie/nymph diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 15bfe8ac893..a5a8704dc12 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -222,6 +222,44 @@ icon_state = "plant-01" plane = OBJ_PLANE + var/obj/item/stored_item + +/obj/structure/flora/pottedplant/examine(mob/user) + ..() + if(in_range(user, src) && stored_item) + to_chat(user, "You can see something in there...") + +/obj/structure/flora/pottedplant/attackby(obj/item/I, mob/user) + if(stored_item) + to_chat(user, "[I] won't fit in. There already appears to be something in here...") + return + + if(I.w_class > ITEMSIZE_TINY) + to_chat(user, "[I] is too big to fit inside [src].") + return + + if(do_after(user, 10)) + user.drop_from_inventory(I, src) + I.forceMove(src) + stored_item = I + src.visible_message("\icon[src] \icon[I] [user] places [I] into [src].") + return + else + to_chat(user, "You refrain from putting things into the plant pot.") + return + + ..() + +/obj/structure/flora/pottedplant/attack_hand(mob/user) + if(!stored_item) + to_chat(user, "You see nothing of interest in [src]...") + else + if(do_after(user, 10)) + to_chat(user, "You find \icon[stored_item] [stored_item] in [src]!") + stored_item.forceMove(get_turf(src)) + stored_item = null + ..() + /obj/structure/flora/pottedplant/large name = "large potted plant" diff --git a/vorestation.dme b/vorestation.dme index 366937ae38f..dc07cf87259 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -1021,6 +1021,7 @@ #include "code\game\objects\items\poi_items.dm" #include "code\game\objects\items\robobag.dm" #include "code\game\objects\items\shooting_range.dm" +#include "code\game\objects\items\tailoring.dm" #include "code\game\objects\items\toys.dm" #include "code\game\objects\items\trash.dm" #include "code\game\objects\items\trash_vr.dm"