Skip to content

Commit

Permalink
Fixes issues and improves millstones, ant farms and seed meshes (#1070)
Browse files Browse the repository at this point in the history
* Fixes a few issues with millstones, improves feedback

* Makes ant farms easier to fill with food, stop you when no longer needed, gives all sand back when destroyed

* Makes seed meshes only take 2 seconds to sift through sand and increases chance of finding seed to 50%

* Addresses review comments in order to improve the ant farm code
  • Loading branch information
GoldenAlpharex authored and StealsThePRs committed Feb 24, 2024
1 parent 9e8e102 commit c3068ba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
18 changes: 12 additions & 6 deletions modular_nova/modules/ashwalkers/code/buildings/antfarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

/obj/structure/antfarm/Destroy()
STOP_PROCESSING(SSobj, src)
new /obj/item/stack/ore/glass/ten(get_turf(src))
new /obj/item/stack/ore/glass(get_turf(src), 20)
return ..()

/obj/structure/antfarm/process(seconds_per_tick)
Expand All @@ -66,19 +66,28 @@
/obj/structure/antfarm/examine(mob/user)
. = ..()
. += span_notice("<br>There are currently [has_ants ? "" : "no "]ants in the farm.")
. += span_notice("To add ants, feed the farm some food.")
if(!has_ants)
. += span_notice("To add ants, feed the farm some <b>food</b>.")

/obj/structure/antfarm/attackby(obj/item/attacking_item, mob/user, params)
if(istype(attacking_item, /obj/item/food))
if(has_ants)
balloon_alert(user, "ants block the way!")
return

qdel(attacking_item)
balloon_alert(user, "food has been placed")
ant_chance++
return

if(istype(attacking_item, /obj/item/storage/bag/plants))
if(has_ants)
balloon_alert(user, "ants block the way!")
return

balloon_alert(user, "feeding the ants")
for(var/obj/item/food/selected_food in attacking_item.contents)
if(!do_after(user, 1 SECONDS, src))
if(has_ants || !do_after(user, 0.5 SECONDS, src))
return

qdel(selected_food)
Expand All @@ -87,6 +96,3 @@
return

return ..()

/obj/item/stack/ore/glass/ten
amount = 10
4 changes: 2 additions & 2 deletions modular_nova/modules/ashwalkers/code/items/ash_seedmesh.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
return

while(ore_item.amount >= 5)
if(!do_after(user, 5 SECONDS, src))
if(!do_after(user, 2 SECONDS, src))
user.balloon_alert(user, "have to stand still!")
return

if(!ore_item.use(5))
user.balloon_alert(user, "unable to use five of [ore_item]!")
return

if(prob(70))
if(prob(50))
user.balloon_alert(user, "[ore_item] reveals nothing!")
continue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

. += span_notice("And it can fit <b>[maximum_contained_items - length(contents)]</b> more items in it.")
else
. += span_notice("It can hold [maximum_contained_items] items, and there is nothing in it presently.")
. += span_notice("It can hold <b>[maximum_contained_items]</b> items, and there is nothing in it presently.")

. += span_notice("You can [anchored ? "un" : ""]secure [src] with <b>CTRL-Shift-Click</b>.")
. += span_notice("With a <b>prying tool</b> of some sort, you could take [src] apart.")
Expand Down Expand Up @@ -112,7 +112,7 @@

return TRUE

if(!((istype(attacking_item, /obj/item/food/grown/)) || (istype(attacking_item, /obj/item/grown))))
if(!(istype(attacking_item, /obj/item/food/grown) || istype(attacking_item, /obj/item/grown)))
balloon_alert(user, "can only mill plants")
return ..()

Expand All @@ -121,7 +121,8 @@
return

attacking_item.forceMove(src)
return ..()
balloon_alert(user, "transferred [attacking_item]")
return TRUE

/// Takes the content's seeds and spits them out on the turf, as well as grinding whatever the contents may be
/obj/structure/millstone/proc/mill_it_up(mob/living/carbon/human/user)
Expand Down Expand Up @@ -150,7 +151,7 @@
for(var/target_item as anything in contents)
seedify(target_item, t_max = 1)

return
balloon_alert_to_viewers("finished grinding")

#undef MILLSTONE_STAMINA_MINIMUM
#undef MILLSTONE_STAMINA_USE

0 comments on commit c3068ba

Please sign in to comment.