Skip to content

Commit

Permalink
issue fixes and qol for ant, worm, and ash farming (#24543)
Browse files Browse the repository at this point in the history
* fixes some issues with ash, worm, and ant farming + qol

* Update modular_skyrat/modules/ashwalkers/code/buildings/wormfarm.dm

Co-authored-by: Bloop <[email protected]>

---------

Co-authored-by: Bloop <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Oct 24, 2023
1 parent 3dd52ac commit 0c9bed9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
11 changes: 11 additions & 0 deletions modular_skyrat/modules/ashwalkers/code/buildings/antfarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@
ant_chance++
return

if(istype(attacking_item, /obj/item/storage/bag/plants))
balloon_alert(user, "feeding the ants")
for(var/obj/item/food/selected_food in attacking_item.contents)
if(!do_after(user, 1 SECONDS, src))
return

qdel(selected_food)
ant_chance++

return

return ..()

/obj/item/stack/ore/glass/ten
Expand Down
22 changes: 18 additions & 4 deletions modular_skyrat/modules/ashwalkers/code/buildings/ash_farming.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,25 @@
return

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

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

else if(istype(attacking_item, /obj/item/storage/bag/plants))
if(!COOLDOWN_FINISHED(src, harvest_timer))
return

COOLDOWN_START(src, harvest_timer, harvest_cooldown)
create_harvest(attacking_item, user)
update_appearance()
return

return ..()

/**
Expand Down Expand Up @@ -227,7 +236,7 @@
/**
* will create a harvest of the seeds product, with a chance to create a mutated version
*/
/obj/structure/simple_farm/proc/create_harvest()
/obj/structure/simple_farm/proc/create_harvest(var/obj/item/storage/bag/plants/plant_bag, var/mob/user)
if(!planted_seed)
return

Expand All @@ -241,7 +250,10 @@
if(!creating_obj)
creating_obj = choose_seed

new creating_obj(get_turf(src))
var/created_special = new creating_obj(get_turf(src))

plant_bag?.atom_storage?.attempt_insert(created_special, user, TRUE)

balloon_alert_to_viewers("something special drops!")
continue

Expand All @@ -250,7 +262,9 @@
if(!creating_obj)
creating_obj = planted_seed.type

new creating_obj(get_turf(src))
var/created_harvest = new creating_obj(get_turf(src))

plant_bag?.atom_storage?.attempt_insert(created_harvest, user, TRUE)

/turf/open/misc/asteroid/basalt/Initialize(mapload)
. = ..()
Expand Down
20 changes: 19 additions & 1 deletion modular_skyrat/modules/ashwalkers/code/buildings/wormfarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

COOLDOWN_START(src, worm_timer, 1 MINUTES)

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

if(current_food > 0 && current_worm > 1)
Expand Down Expand Up @@ -107,6 +107,24 @@
in_use = FALSE
return

if(istype(attacking_item, /obj/item/storage/bag/plants))
if(in_use)
balloon_alert(user, "currently in use")
return
in_use = TRUE

balloon_alert(user, "feeding the worms")
for(var/obj/item/food/selected_food in attacking_item.contents)
if(!do_after(user, 1 SECONDS, src))
in_use = FALSE
return

qdel(selected_food)
current_food++

in_use = FALSE
return

//it wasn't a worm, or a piece of food
return ..()

Expand Down

0 comments on commit 0c9bed9

Please sign in to comment.