From 5bd9b440a9a90e058e3fb07841f322c41f482be2 Mon Sep 17 00:00:00 2001
From: Trilbyspaceclone <30435998+Trilbyspaceclone@users.noreply.github.com>
Date: Mon, 1 Nov 2021 11:27:42 -0400
Subject: [PATCH] Ashen tree!
---
.../mapgen/Cavegens/LavalandGenerator.dm | 2 +-
code/modules/mining/lavaland/ash_tree.dm | 68 ++++++++++++++++++
icons/obj/lavaland/ash_tree.dmi | Bin 0 -> 2637 bytes
tgstation.dme | 1 +
4 files changed, 70 insertions(+), 1 deletion(-)
create mode 100644 code/modules/mining/lavaland/ash_tree.dm
create mode 100644 icons/obj/lavaland/ash_tree.dmi
diff --git a/code/datums/mapgen/Cavegens/LavalandGenerator.dm b/code/datums/mapgen/Cavegens/LavalandGenerator.dm
index b895ad4414..3ce3821708 100644
--- a/code/datums/mapgen/Cavegens/LavalandGenerator.dm
+++ b/code/datums/mapgen/Cavegens/LavalandGenerator.dm
@@ -7,7 +7,7 @@
/mob/living/simple_animal/hostile/asteroid/basilisk/watcher/random = 40, /obj/structure/spawner/lavaland = 2, \
/mob/living/simple_animal/hostile/asteroid/hivelord/legion/random = 30, /obj/structure/spawner/lavaland/legion = 3, \
SPAWN_MEGAFAUNA = 4, /mob/living/simple_animal/hostile/asteroid/goldgrub = 10)
- flora_spawn_list = list(/obj/structure/flora/ash/leaf_shroom = 2 , /obj/structure/flora/ash/cap_shroom = 2 , /obj/structure/flora/ash/stem_shroom = 2 , /obj/structure/flora/ash/cacti = 1, /obj/structure/flora/ash/tall_shroom = 2)
+ flora_spawn_list = list(/obj/structure/flora/ash/leaf_shroom = 2 , /obj/structure/flora/ash/cap_shroom = 2 , /obj/structure/flora/ash/stem_shroom = 2 , /obj/structure/flora/ash/cacti = 1, /obj/structure/flora/ash/tall_shroom = 2, /obj/structure/flora/ashtree = 1)
feature_spawn_list = list(/obj/structure/geyser/random = 1)
initial_closed_chance = 45
diff --git a/code/modules/mining/lavaland/ash_tree.dm b/code/modules/mining/lavaland/ash_tree.dm
new file mode 100644
index 0000000000..d9775290f1
--- /dev/null
+++ b/code/modules/mining/lavaland/ash_tree.dm
@@ -0,0 +1,68 @@
+//Houses the ash tree, a lava land tree that has been burning for quite some time making a maple like sweetener.
+
+/obj/structure/flora/ashtree
+ gender = PLURAL //same as other tree
+ icon = 'icons/obj/lavaland/ash_tree.dmi'
+ icon_state = "ashtree"
+ var/sap_icon_state = "ashtree_maple" //Are icon when we are full of honey or other sap
+ var/tabbed_icon_state = "ashtree_maple" //What we look like when tapping
+ name = "ashed tree"
+ desc = "A once large tree now burnt like the lands around it."
+ density = TRUE
+ pixel_x = -16
+ layer = FLY_LAYER
+ var/coal_amount = 5 //amout of coal in are tree, simular to logs
+ var/sap = FALSE //Do we have sap?
+ var/are_sap = /datum/reagent/consumable/honey //What reagent we have
+ //var/tapping_items = list(/obj/item/reagent_containers/glass) - current dosnt work commiting it out
+ var/harvest_sap_time = 60 //This is in seconds, and now long we wait till are tree is tapped
+ var/container_used
+ var/sap_amount
+
+/obj/structure/flora/ashtree/New()
+ ..()
+ if(prob(50))
+ sap = TRUE
+ icon_state = sap_icon_state
+ desc = "A once large tree now burnt like the lands around it. This one seems to have a sap still inside."
+ sap_amount = rand(60,120) //good amout of honey
+ coal_amount = rand(5,15) //We give a random amout
+
+/obj/structure/flora/ashtree/proc/harvest_sap()
+ desc = "A once large tree now burnt like the lands around it."
+ icon_state = "ashtree"
+ var/obj/item/reagent_containers/RG = container_used
+ if(RG.is_refillable()) //Incase someone was a dumb and used a lidded container
+ if(!RG.reagents.holder_full()) //Make sure that its not filling something thats full
+ RG.reagents.add_reagent(are_sap, min(RG.volume - RG.reagents.total_volume, sap_amount))
+ RG.forceMove(drop_location()) //We drop are used beaker and try to fill it with sap
+
+//Proc stolen from Trees
+//If you hit it with a sharp force aboe 0 item it chops it down, unlike trees tho it dosnt give wood as its already charcoal
+//Also dosnt have a stump
+/obj/structure/flora/ashtree/attackby(obj/item/W, mob/user, params)
+ if(istype(W, /obj/item/reagent_containers))
+ if(sap)
+ user.visible_message("[user] pokes [src] and places a container under the [W].","You set up [src] with [W].")
+ icon_state = tabbed_icon_state
+ sap = FALSE
+ container_used = W
+ W.forceMove(src) //Sadly when cutting down the tree we get deleted with it, otherwise this allows us to get sap!
+ addtimer(CALLBACK(src, .proc/harvest_sap), harvest_sap_time SECONDS)
+ else
+ to_chat(user, "There is no sap to collect.")
+
+ if(coal_amount && (!(flags_1 & NODECONSTRUCT_1)))
+ if(W.sharpness && W.force > 0)
+ if(W.hitsound)
+ playsound(get_turf(src), W.hitsound, 100, 0, 0)
+ user.visible_message("[user] begins to cut down [src] with [W].","You begin to cut down [src] with [W].", "You hear the sound of brittle sawing.")
+ if(do_after(user, 500/W.force, target = src)) //2.5 seconds with 20 force, 4 seconds with a hatchet, 10 seconds with a shard.
+ user.visible_message("[user] fells [src] with the [W].","You fell [src] with the [W].", "You hear the sound of a crumbling tree.")
+ playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 100 , 0, 0)
+ for(var/i=1 to coal_amount)
+ new /obj/item/stack/sheet/mineral/coal(get_turf(src))
+ qdel(src)
+
+ else
+ return ..()
\ No newline at end of file
diff --git a/icons/obj/lavaland/ash_tree.dmi b/icons/obj/lavaland/ash_tree.dmi
new file mode 100644
index 0000000000000000000000000000000000000000..7a8addafe59a5e1d7ec10a77543cdb358463b289
GIT binary patch
literal 2637
zcmaJ@XH=8R7X3o#ol6r*h|;7A4-kaVq>54%1jPW-QHmgtNJ#=J)k_dXI#L7#l-^qc
zic-ahfHdj7g_3|l;Dxu|{rA@UF>}`1Yv!zd_RN_*v6kk>9IR(q0RZ4IxoU8O7O}K}
zW@e<#>xDvjv=9|yZ5L?Z_Q)l`>tUdmpDzHQGLw5NSvwTDqqo)f`7mP$zU%e&;)Y5!
z<(8ZQ>DZw}2$jm|8~J2h?N6IX(F#Q1K>gdz2faA>nUB5}o5}eSik~Cyeh)Ka{ET|*
z?#ya*LH@SQMpx%u;WJDDDKZ&o>iCC@SL1I&E=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