Axes harvest products into procs instead of lists (#94233)

## About The Pull Request

###### Get it? Cause you're chopping down trees...

Why do this at all? Well, we have been looking into memory consumption
and found an unexpectedly high amount of lists on flora objects.

Was talking about it with Melbert, we agreed this would be a good way of
removing needless lists on every blade of grass that are just taking up
memory.

Instead, these lists will be generated and consumed when the actually
chopping down of a tree occurs.

## Why It's Good For The Game

Uploads some more RAM

## Changelog

Not player-facing, things will function the same as they always have.
This commit is contained in:
Bloop
2025-12-01 16:40:16 -07:00
committed by GitHub
parent 8a61205986
commit bb78b9c49b
2 changed files with 56 additions and 27 deletions
+24 -8
View File
@@ -10,7 +10,6 @@
resistance_flags = LAVA_PROOF
gender = PLURAL
layer = PROJECTILE_HIT_THRESHHOLD_LAYER //sporangiums up don't shoot
product_types = list(/obj/item/food/grown/ash_flora/shavings = 1)
harvest_with_hands = TRUE
harvested_name = "shortened mushrooms"
harvested_desc = "Some quickly regrowing mushrooms, formerly known to be quite large."
@@ -27,6 +26,9 @@
base_icon_state = "[base_icon_state][rand(1, number_of_variants)]"
icon_state = base_icon_state
/obj/structure/flora/ash/get_potential_products()
return list(/obj/item/food/grown/ash_flora/shavings = 1)
/obj/structure/flora/ash/harvest(user, product_amount_multiplier)
if(!..())
return FALSE
@@ -45,7 +47,6 @@
desc = "A number of mushrooms, each of which surrounds a greenish sporangium with a number of leaf-like structures."
icon_state = "s_mushroom1"
base_icon_state = "s_mushroom"
product_types = list(/obj/item/food/grown/ash_flora/mushroom_leaf = 1)
harvested_name = "leafless mushrooms"
harvested_desc = "A bunch of formerly-leafed mushrooms, with their sporangiums exposed. Scandalous?"
harvest_amount_high = 4
@@ -56,12 +57,14 @@
regrowth_time_low = 2400
regrowth_time_high = 6000
/obj/structure/flora/ash/leaf_shroom/get_potential_products()
return list(/obj/item/food/grown/ash_flora/mushroom_leaf = 1)
/obj/structure/flora/ash/cap_shroom
name = "tall mushrooms"
desc = "Several mushrooms, the larger of which have a ring of conks at the midpoint of their stems."
icon_state = "r_mushroom1"
base_icon_state = "r_mushroom"
product_types = list(/obj/item/food/grown/ash_flora/mushroom_cap = 1)
harvested_name = "small mushrooms"
harvested_desc = "Several small mushrooms near the stumps of what likely were larger mushrooms."
harvest_amount_high = 4
@@ -72,6 +75,9 @@
regrowth_time_low = 3000
regrowth_time_high = 5400
/obj/structure/flora/ash/cap_shroom/get_potential_products()
return list(/obj/item/food/grown/ash_flora/mushroom_cap = 1)
/obj/structure/flora/ash/stem_shroom
name = "numerous mushrooms"
desc = "A large number of mushrooms, some of which have long, fleshy stems. They're radiating light!"
@@ -79,7 +85,6 @@
base_icon_state = "t_mushroom"
light_range = 1.5
light_power = 2.1
product_types = list(/obj/item/food/grown/ash_flora/mushroom_stem = 1)
harvested_name = "tiny mushrooms"
harvested_desc = "A few tiny mushrooms around larger stumps. You can already see them growing back."
harvest_amount_high = 4
@@ -90,12 +95,14 @@
regrowth_time_low = 3000
regrowth_time_high = 6000
/obj/structure/flora/ash/stem_shroom/get_potential_products()
return list(/obj/item/food/grown/ash_flora/mushroom_stem = 1)
/obj/structure/flora/ash/cacti
name = "fruiting cacti"
desc = "Several prickly cacti, brimming with ripe fruit and covered in a thin layer of ash."
icon_state = "cactus1"
base_icon_state = "cactus"
product_types = list(/obj/item/food/grown/ash_flora/cactus_fruit = 20, /obj/item/seeds/lavaland/cactus = 1)
harvested_name = "cacti"
harvested_desc = "A bunch of prickly cacti. You can see fruits slowly growing beneath the covering of ash."
harvest_amount_high = 2
@@ -111,12 +118,14 @@
. = ..()
AddComponent(/datum/component/caltrop, min_damage = 3, max_damage = 6, probability = 70)
/obj/structure/flora/ash/cacti/get_potential_products()
return list(/obj/item/food/grown/ash_flora/cactus_fruit = 20, /obj/item/seeds/lavaland/cactus = 1)
/obj/structure/flora/ash/seraka
name = "seraka mushrooms"
desc = "A small cluster of seraka mushrooms. These must have come with the ashlizards."
icon_state = "seraka_mushroom1"
base_icon_state = "seraka_mushroom"
product_types = list(/obj/item/food/grown/ash_flora/seraka = 1)
harvested_name = "harvested seraka mushrooms"
harvested_desc = "A couple of small seraka mushrooms, with the larger ones clearly having been recently removed. They'll grow back... eventually."
harvest_amount_high = 6
@@ -129,6 +138,9 @@
number_of_variants = 2
harvest_message_true_thresholds = FALSE
/obj/structure/flora/ash/seraka/get_potential_products()
return list(/obj/item/food/grown/ash_flora/seraka = 1)
/obj/structure/flora/ash/fireblossom
name = "fire blossom"
desc = "An odd flower that grows commonly near bodies of lava."
@@ -137,7 +149,6 @@
light_range = LIGHT_FIRE_BLOSSOM
light_power = LIGHT_FIRE_BLOSSOM
light_color = COLOR_BIOLUMINESCENCE_YELLOW
product_types = list(/obj/item/food/grown/ash_flora/fireblossom = 1)
harvested_name = "fire blossom stems"
harvested_desc = "A few fire blossom stems, missing their flowers."
harvest_amount_high = 3
@@ -148,6 +159,9 @@
regrowth_time_high = 4000
number_of_variants = 2
/obj/structure/flora/ash/fireblossom/get_potential_products()
return list(/obj/item/food/grown/ash_flora/fireblossom = 1)
/obj/structure/flora/ash/fireblossom/after_harvest()
set_light_power(LIGHT_RANGE_FIRE_BLOSSOM_HARVESTED)
set_light_range(LIGHT_POWER_FIRE_BLOSSOM_HARVESTED)
@@ -166,7 +180,6 @@
desc = "A number of bright, springy blue fruiting plants. They seem to be unconcerned with the hardy, cold environment."
icon_state = "chilly_pepper1"
base_icon_state = "chilly_pepper"
product_types = list(/obj/item/food/grown/icepepper = 1)
harvested_name = "springy grass"
harvested_desc = "A bunch of springy, bouncy fruiting grass, all picked. Or maybe they were never fruiting at all?"
harvest_amount_high = 3
@@ -178,6 +191,9 @@
regrowth_time_high = 5500
number_of_variants = 2
/obj/structure/flora/ash/chilly/get_potential_products()
return list(/obj/item/food/grown/icepepper = 1)
//SNACKS
/obj/item/food/grown/ash_flora