Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] issue fixes and qol for ant, worm, and ash farming #269

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading