Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Adds decorative plant pots! #47

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions code/modules/vending/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
32 changes: 32 additions & 0 deletions code/obj/item/decorative_pot.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/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"
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)
if(istype(weapon,/obj/item/wrench) || istype(weapon,/obj/item/screwdriver))
if(!src.anchored)
user.visible_message("<b>[user]</b> secures the [src] to the floor!")
playsound(src.loc, "sound/items/Screwdriver.ogg", 100, 1)
src.anchored = 1
else
user.visible_message("<b>[user]</b> 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))
var/obj/item/gardentrowel/t = weapon
if(!t.plantyboi)
return
src.UpdateOverlays(t.plantyboi,"plant")
t.plantyboi = null
t.icon_state = "trowel"
return
else
..()
45 changes: 45 additions & 0 deletions code/obj/item/hydroponics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// - Watering can
// - Compost bag
// - Plant formulas
// - Garden Trowel

//////////////////////////////////////////////// Chainsaw ////////////////////////////////////

Expand Down Expand Up @@ -297,6 +298,50 @@
/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"

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/image/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")
plantyboi.pixel_x = 2
src.icon_state = "trowel_full"
else
return
if(p.growthmode == "weed")
user.visible_message("<b>[user]</b> tries to uproot the [p.name], but it's roots hold firmly to the [pot]!","<span style=\"color:red\">The [p.name] is too strong for you traveller...</span>")
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/
Expand Down
1 change: 1 addition & 0 deletions goonstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down