Skip to content

Commit

Permalink
fertilizer is a stackable item now + some balance for worms (#24790) (#…
Browse files Browse the repository at this point in the history
…454)

* fertilizer is a stackable item now + some balance for worms

* okay unit tests

Co-authored-by: jjpark-kb <[email protected]>
  • Loading branch information
Steals-The-PRs and jjpark-kb authored Nov 5, 2023
1 parent 030c8a9 commit e2dcc7d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,19 @@
increase_yield(user)
return

else if(istype(attacking_item, /obj/item/worm_fertilizer))
else if(istype(attacking_item, /obj/item/stack/worm_fertilizer))

var/obj/item/stack/attacking_stack = attacking_item

if(!attacking_stack.use(1))
balloon_alert(user, "unable to use [attacking_item]")
return

if(!decrease_cooldown(user, silent = TRUE) && !increase_yield(user, silent = TRUE))
balloon_alert(user, "plant is already fully upgraded")

else
balloon_alert(user, "plant was upgraded")
qdel(attacking_item)

return

Expand Down
12 changes: 7 additions & 5 deletions modular_skyrat/modules/ashwalkers/code/buildings/wormfarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/obj/structure/wormfarm/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
COOLDOWN_START(src, worm_timer, 1 MINUTES)
COOLDOWN_START(src, worm_timer, 30 SECONDS)

/obj/structure/wormfarm/Destroy()
STOP_PROCESSING(SSobj, src)
Expand All @@ -30,14 +30,14 @@
if(!COOLDOWN_FINISHED(src, worm_timer))
return

COOLDOWN_START(src, worm_timer, 1 MINUTES)
COOLDOWN_START(src, worm_timer, 30 SECONDS)

if(current_worm >= 2 && current_worm < max_worm)
current_worm++

if(current_food > 0 && current_worm > 1)
current_food--
new /obj/item/worm_fertilizer(get_turf(src))
new /obj/item/stack/worm_fertilizer(get_turf(src))

/obj/structure/wormfarm/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -89,7 +89,7 @@
in_use = TRUE

balloon_alert(user, "feeding the worms")
if(!do_after(user, 5 SECONDS, src))
if(!do_after(user, 1 SECONDS, src))
balloon_alert(user, "stopped feeding the worms")
in_use = FALSE
return
Expand Down Expand Up @@ -129,9 +129,11 @@
return ..()

//produced by feeding worms food and can be ground up for plant nutriment or used directly on ash farming
/obj/item/worm_fertilizer
/obj/item/stack/worm_fertilizer
name = "worm fertilizer"
desc = "When you fed your worms, you should have expected this."
icon = 'modular_skyrat/modules/ashwalkers/icons/misc_tools.dmi'
icon_state = "fertilizer"
grind_results = list(/datum/reagent/plantnutriment/eznutriment = 3, /datum/reagent/plantnutriment/left4zednutriment = 3, /datum/reagent/plantnutriment/robustharvestnutriment = 3)
singular_name = "fertilizer"
merge_type = /obj/item/stack/worm_fertilizer

0 comments on commit e2dcc7d

Please sign in to comment.