From dedd4f7b86c600ed866a69c7919754280e2f0482 Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 18:38:09 -0900 Subject: [PATCH 01/12] Added Garden Trowel Added Garden Trowel tool object and function to grab current plant overlay from Hydroponics trays --- code/obj/item/hydroponics.dm | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/code/obj/item/hydroponics.dm b/code/obj/item/hydroponics.dm index 4baec0eb..ee6c427a 100644 --- a/code/obj/item/hydroponics.dm +++ b/code/obj/item/hydroponics.dm @@ -6,6 +6,7 @@ // - Watering can // - Compost bag // - Plant formulas +// - Garden Trowel //////////////////////////////////////////////// Chainsaw //////////////////////////////////// @@ -297,6 +298,48 @@ /obj/item/seedplanter/hidden desc = "This is supposed to be a cyborg part. You're not quite sure what it's doing here." + +///////////////////////////////////// Garden Trowel /////////////////////////////////////////////// + +/obj/item/gardentrowel + name = "Garden Trowel" + desc = "A tool to uproot plants and transfer them to decorative pots" + icon = 'icons/obj/hydroponics/hydromisc.dmi' + inhand_image_icon = 'icons/mob/inhand/tools/screwdriver.dmi' + icon_state = "trowel_empty" + + flags = FPRINT | TABLEPASS | ONBELT + w_class = 1.0 + + force = 5.0 + throwforce = 5.0 + throw_speed = 3 + throw_range = 5 + stamina_damage = 10 + stamina_cost = 10 + stamina_crit_chance = 30 + hit_type = DAMAGE_STAB + hitsound = 'sound/impact_sounds/Flesh_Stab_1.ogg' + + module_research = list("tools" = 4, "metals" = 1) + rand_pos = 1 + var/icon/plantyboi + + afterattack(obj/target as obj, mob/user as mob) + if(istype(target, /obj/machinery/plantpot)) + var/obj/machinery/plantpot/pot = target + if(pot.current) + var/datum/plant/p = pot.current + if(pot.GetOverlayImage("plant")) + plantyboi = pot.GetOverlayImage("plant") + else + return + if(p.growthmode == "weed") + user.visible_message("[user] tries to uproot the [p.name], but it's roots hold firmly to the [pot]!","The [p.name] is too strong for you traveller...") + return + pot.HYPdestroyplant() + + //check if target is a plant pot to paste in the cosmetic plant overlay ///////////////////////////////////// Watering can /////////////////////////////////////////////// /obj/item/reagent_containers/glass/wateringcan/ From c09d1cef5fbafc6ecc47dbcd0f30e4bd4ba76e13 Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 19:07:38 -0900 Subject: [PATCH 02/12] Add iconrefs to trowel --- code/obj/item/hydroponics.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/obj/item/hydroponics.dm b/code/obj/item/hydroponics.dm index ee6c427a..cf416019 100644 --- a/code/obj/item/hydroponics.dm +++ b/code/obj/item/hydroponics.dm @@ -306,7 +306,7 @@ desc = "A tool to uproot plants and transfer them to decorative pots" icon = 'icons/obj/hydroponics/hydromisc.dmi' inhand_image_icon = 'icons/mob/inhand/tools/screwdriver.dmi' - icon_state = "trowel_empty" + icon_state = "trowel" flags = FPRINT | TABLEPASS | ONBELT w_class = 1.0 @@ -332,6 +332,7 @@ var/datum/plant/p = pot.current if(pot.GetOverlayImage("plant")) plantyboi = pot.GetOverlayImage("plant") + src.icon_state = "trowel_full" else return if(p.growthmode == "weed") From f5f534c09a793eee0041352e5fe25d063e477978 Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 19:24:01 -0900 Subject: [PATCH 03/12] Added Decorative Pot definition --- code/obj/item/decorative_pot.dm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 code/obj/item/decorative_pot.dm diff --git a/code/obj/item/decorative_pot.dm b/code/obj/item/decorative_pot.dm new file mode 100644 index 00000000..ebc53abc --- /dev/null +++ b/code/obj/item/decorative_pot.dm @@ -0,0 +1,24 @@ +/obj/decorative_pot + icon = 'icons/obj/hydroponics/hydromisc.dmi' + icon_state = 'plantpot' + + CanPass(atom/movable/mover, turf/target, height=0, air_group=0) + return 0 + + attackby(obj/item/weapon as obj,mob/user as mob) + if(istype(weapon,/obj/item/wrench) || istype(weapon,/obj/item/screwdriver)) + if(!src.anchored) + user.visible_message("[user] wrenches the [src] in place!") + src.anchored = 1 + else + user.visible_message("[user] unbolts the [src] from the floor!") + src.anchored = 0 + return + else if(istype(weapon,/obj/item/gardentrowel)) + var/obj/item/gardentrowel/t = weapon + src.UpdateOverlays(t.plantyboi,"plant") + src.plantyboi = null + src.icon_state = "trowel" + return + else + ..() \ No newline at end of file From 955ca4b4a73aa732e57798c9304be3a0b7239998 Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 19:28:24 -0900 Subject: [PATCH 04/12] Fixed incorrect overlay definition on trowel Also added description to the decorative plantpot --- code/obj/item/hydroponics.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/obj/item/hydroponics.dm b/code/obj/item/hydroponics.dm index cf416019..26b4dcbf 100644 --- a/code/obj/item/hydroponics.dm +++ b/code/obj/item/hydroponics.dm @@ -323,7 +323,7 @@ module_research = list("tools" = 4, "metals" = 1) rand_pos = 1 - var/icon/plantyboi + var/image/plantyboi afterattack(obj/target as obj, mob/user as mob) if(istype(target, /obj/machinery/plantpot)) From 9a5ca40c7b964773386c807bbb2819361dc245d5 Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 19:28:24 -0900 Subject: [PATCH 05/12] Revert "Fixed incorrect overlay definition on trowel" This reverts commit 955ca4b4a73aa732e57798c9304be3a0b7239998. --- code/obj/item/hydroponics.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/obj/item/hydroponics.dm b/code/obj/item/hydroponics.dm index 26b4dcbf..cf416019 100644 --- a/code/obj/item/hydroponics.dm +++ b/code/obj/item/hydroponics.dm @@ -323,7 +323,7 @@ module_research = list("tools" = 4, "metals" = 1) rand_pos = 1 - var/image/plantyboi + var/icon/plantyboi afterattack(obj/target as obj, mob/user as mob) if(istype(target, /obj/machinery/plantpot)) From 1939ec14e1480299cc1f508ba675729d4a3f4ef1 Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 19:29:33 -0900 Subject: [PATCH 06/12] Fixed previous commit --- code/obj/item/decorative_pot.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/obj/item/decorative_pot.dm b/code/obj/item/decorative_pot.dm index ebc53abc..d7633c57 100644 --- a/code/obj/item/decorative_pot.dm +++ b/code/obj/item/decorative_pot.dm @@ -1,6 +1,8 @@ /obj/decorative_pot + name = "plant pot" + desc = "A decorative plant pot, sans the Hydroponic Tray's fancy hypergrowth tech." icon = 'icons/obj/hydroponics/hydromisc.dmi' - icon_state = 'plantpot' + icon_state = "plantpot" CanPass(atom/movable/mover, turf/target, height=0, air_group=0) return 0 From 1f79788c5e50b9c2ad9d06a65bd3fe61eb4a1607 Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 19:34:59 -0900 Subject: [PATCH 07/12] Added decorative pots to vending --- code/modules/vending/vending.dm | 2 ++ code/obj/item/decorative_pot.dm | 27 +++++++++++++-------------- code/obj/item/hydroponics.dm | 4 ++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/code/modules/vending/vending.dm b/code/modules/vending/vending.dm index dd9f42a0..da6186f1 100644 --- a/code/modules/vending/vending.dm +++ b/code/modules/vending/vending.dm @@ -878,6 +878,7 @@ product_list += new/datum/data/vending_product(/obj/item/plantanalyzer, 5) product_list += new/datum/data/vending_product(/obj/item/reagent_containers/glass/compostbag, 5) product_list += new/datum/data/vending_product(/obj/item/saw, 3) + product_list += new/datum/data/vending_product(/obj/item/gardentrowel, 5) product_list += new/datum/data/vending_product(/obj/item/satchel/hydro, 10) product_list += new/datum/data/vending_product(/obj/item/reagent_containers/glass/beaker, 10) product_list += new/datum/data/vending_product(/obj/item/reagent_containers/glass/bottle/weedkiller, 10) @@ -886,6 +887,7 @@ product_list += new/datum/data/vending_product(/obj/item/reagent_containers/glass/bottle/topcrop, 5) product_list += new/datum/data/vending_product(/obj/item/reagent_containers/glass/bottle/powerplant, 5) product_list += new/datum/data/vending_product(/obj/item/reagent_containers/glass/bottle/fruitful, 5) + product_list += new/datum/data/vending_product(/obj/decorative_pot, 5) product_list += new/datum/data/vending_product(/obj/item/seedplanter/hidden, 1, hidden=1) product_list += new/datum/data/vending_product(/obj/item/seed/grass, rand(3, 6), hidden=1) diff --git a/code/obj/item/decorative_pot.dm b/code/obj/item/decorative_pot.dm index d7633c57..8324968a 100644 --- a/code/obj/item/decorative_pot.dm +++ b/code/obj/item/decorative_pot.dm @@ -4,23 +4,22 @@ icon = 'icons/obj/hydroponics/hydromisc.dmi' icon_state = "plantpot" - CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - return 0 - - attackby(obj/item/weapon as obj,mob/user as mob) - if(istype(weapon,/obj/item/wrench) || istype(weapon,/obj/item/screwdriver)) - if(!src.anchored) - user.visible_message("[user] wrenches the [src] in place!") - src.anchored = 1 - else - user.visible_message("[user] unbolts the [src] from the floor!") - src.anchored = 0 + CanPass(atom/movable/mover, turf/target, height=0, air_group=0) + return 0 + attackby(obj/item/weapon as obj,mob/user as mob) + if(istype(weapon,/obj/item/wrench) || istype(weapon,/obj/item/screwdriver)) + if(!src.anchored) + user.visible_message("[user] wrenches the [src] in place!") + src.anchored = 1 + else + user.visible_message("[user] unbolts the [src] from the floor!") + src.anchored = 0 return else if(istype(weapon,/obj/item/gardentrowel)) var/obj/item/gardentrowel/t = weapon src.UpdateOverlays(t.plantyboi,"plant") - src.plantyboi = null + t.plantyboi = null src.icon_state = "trowel" return - else - ..() \ No newline at end of file + else + ..() \ No newline at end of file diff --git a/code/obj/item/hydroponics.dm b/code/obj/item/hydroponics.dm index cf416019..50a43069 100644 --- a/code/obj/item/hydroponics.dm +++ b/code/obj/item/hydroponics.dm @@ -302,7 +302,7 @@ ///////////////////////////////////// Garden Trowel /////////////////////////////////////////////// /obj/item/gardentrowel - name = "Garden Trowel" + name = "garden trowel" desc = "A tool to uproot plants and transfer them to decorative pots" icon = 'icons/obj/hydroponics/hydromisc.dmi' inhand_image_icon = 'icons/mob/inhand/tools/screwdriver.dmi' @@ -323,7 +323,7 @@ module_research = list("tools" = 4, "metals" = 1) rand_pos = 1 - var/icon/plantyboi + var/image/plantyboi afterattack(obj/target as obj, mob/user as mob) if(istype(target, /obj/machinery/plantpot)) From d797645db6322a9c81b7f1fe227be98ac3ae7f59 Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 19:43:36 -0900 Subject: [PATCH 08/12] Let's not turn the tray into a trowel --- code/obj/item/decorative_pot.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/obj/item/decorative_pot.dm b/code/obj/item/decorative_pot.dm index 8324968a..21fc3062 100644 --- a/code/obj/item/decorative_pot.dm +++ b/code/obj/item/decorative_pot.dm @@ -16,10 +16,12 @@ src.anchored = 0 return else if(istype(weapon,/obj/item/gardentrowel)) + if(!plantyboi) + return var/obj/item/gardentrowel/t = weapon src.UpdateOverlays(t.plantyboi,"plant") t.plantyboi = null - src.icon_state = "trowel" + t.icon_state = "trowel" return else ..() \ No newline at end of file From 51452f1d6c7bb8c85d1be797485cecdb254de54c Mon Sep 17 00:00:00 2001 From: Ava Date: Tue, 3 Mar 2020 19:44:36 -0900 Subject: [PATCH 09/12] gorram file ticking --- code/obj/item/decorative_pot.dm | 4 ++-- goonstation.dme | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/obj/item/decorative_pot.dm b/code/obj/item/decorative_pot.dm index 21fc3062..e087c233 100644 --- a/code/obj/item/decorative_pot.dm +++ b/code/obj/item/decorative_pot.dm @@ -16,9 +16,9 @@ src.anchored = 0 return else if(istype(weapon,/obj/item/gardentrowel)) - if(!plantyboi) - return var/obj/item/gardentrowel/t = weapon + if(!t.plantyboi) + return src.UpdateOverlays(t.plantyboi,"plant") t.plantyboi = null t.icon_state = "trowel" diff --git a/goonstation.dme b/goonstation.dme index 820861f4..33530b06 100644 --- a/goonstation.dme +++ b/goonstation.dme @@ -1061,6 +1061,7 @@ var/datum/preMapLoad/preMapLoad = new #include "code\obj\item\coin.dm" #include "code\obj\item\dartboard.dm" #include "code\obj\item\decoration.dm" +#include "code\obj\item\decorative_pot.dm" #include "code\obj\item\deployable_turret.dm" #include "code\obj\item\dice.dm" #include "code\obj\item\fitness.dm" From f44afa98bb5ea9586c09f6d0d40a4e3ff50a6c25 Mon Sep 17 00:00:00 2001 From: Ava Date: Wed, 4 Mar 2020 14:01:15 -0900 Subject: [PATCH 10/12] Added obj variables to decorative pot --- code/obj/item/decorative_pot.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/obj/item/decorative_pot.dm b/code/obj/item/decorative_pot.dm index e087c233..c4e3d763 100644 --- a/code/obj/item/decorative_pot.dm +++ b/code/obj/item/decorative_pot.dm @@ -3,7 +3,10 @@ desc = "A decorative plant pot, sans the Hydroponic Tray's fancy hypergrowth tech." icon = 'icons/obj/hydroponics/hydromisc.dmi' icon_state = "plantpot" - + anchored = 0 + density = 1 + mats = 2 + CanPass(atom/movable/mover, turf/target, height=0, air_group=0) return 0 attackby(obj/item/weapon as obj,mob/user as mob) From aa34a37a114d8958e11bce78461444a03dd742f0 Mon Sep 17 00:00:00 2001 From: Ava Date: Wed, 4 Mar 2020 14:31:29 -0900 Subject: [PATCH 11/12] Added sprite offset to prevent excessive eye twitching --- code/obj/item/hydroponics.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/obj/item/hydroponics.dm b/code/obj/item/hydroponics.dm index 50a43069..4b5fdce3 100644 --- a/code/obj/item/hydroponics.dm +++ b/code/obj/item/hydroponics.dm @@ -332,6 +332,7 @@ var/datum/plant/p = pot.current if(pot.GetOverlayImage("plant")) plantyboi = pot.GetOverlayImage("plant") + plantyboi.pixel_x = 2 src.icon_state = "trowel_full" else return From a24f91527966b068aee900ebabab2081bbcc0592 Mon Sep 17 00:00:00 2001 From: Ava Date: Wed, 4 Mar 2020 14:46:19 -0900 Subject: [PATCH 12/12] Added sound effect to wrenching action --- code/obj/item/decorative_pot.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/obj/item/decorative_pot.dm b/code/obj/item/decorative_pot.dm index c4e3d763..b1d38536 100644 --- a/code/obj/item/decorative_pot.dm +++ b/code/obj/item/decorative_pot.dm @@ -12,10 +12,12 @@ attackby(obj/item/weapon as obj,mob/user as mob) if(istype(weapon,/obj/item/wrench) || istype(weapon,/obj/item/screwdriver)) if(!src.anchored) - user.visible_message("[user] wrenches the [src] in place!") + user.visible_message("[user] secures the [src] to the floor!") + playsound(src.loc, "sound/items/Screwdriver.ogg", 100, 1) src.anchored = 1 else user.visible_message("[user] unbolts the [src] from the floor!") + playsound(src.loc, "sound/items/Screwdriver.ogg", 100, 1) src.anchored = 0 return else if(istype(weapon,/obj/item/gardentrowel))