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..5dca7a8e2f --- /dev/null +++ b/code/modules/mining/lavaland/ash_tree.dm @@ -0,0 +1,96 @@ +//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 + name = "ashed tree" + desc = "A once large tree now burnt like the lands around it." + layer = FLY_LAYER + gender = PLURAL //same as other tree + density = TRUE + pixel_x = -16 + icon = 'icons/obj/lavaland/ash_tree.dmi' + icon_state = "ashtree" + //Are icon when we are full of honey or other sap + var/sap_icon_state = "ashtree_maple" + //What we look like when tapping + var/tabbed_icon_state = "ashtree_maple" + //amout of coal in are tree, simular to logs + var/coal_amount = 5 + //Do we have sap? + var/sap = FALSE + //What reagent we have + var/sap_type = /datum/reagent/consumable/honey + //This is in seconds, and now long we wait till are tree is tapped + var/harvest_sap_time = 60 + var/container_used + var/sap_amount + +/obj/structure/flora/ashtree/Initialize(mapload) + ..() + 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." + //If we have sap, we can generate a bit of it + sap_amount = rand(5,15) + //Random coal or wood amount, so its not bog standered. + coal_amount = rand(5,15) + //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("tally", "Honey Tree", 1, "Trees Spawned") + +//So we dont lose are bowls, stolen form closet code +/obj/structure/flora/ashtree/Destroy() + dump_contents(override = FALSE) + return ..() + +//Override is for not revealing the locker electronics when you open the locker, for example +/obj/structure/flora/ashtree/proc/dump_contents(override = TRUE) + var/atom/L = drop_location() + for(var/atom/movable/AM in src) + AM.forceMove(L) + +/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 + //Incase someone was a dumb and used a lidded container + if(RG.is_refillable()) + //Make sure that its not filling something thats full + if(!RG.reagents.holder_full()) + RG.reagents.add_reagent(sap_type, min(RG.volume - RG.reagents.total_volume, sap_amount)) + //We drop are used beaker and try to fill it with sap + RG.forceMove(drop_location()) + SSblackbox.record_feedback("tally", "Honey Tree", 1, "Harvested Honey") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + +//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 + //So we dont lose are bowl when cutting it down + needed for the harvest sap proc + user.transferItemToLoc(W, src) + 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) + return + 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.") + //2.5 seconds with 20 force, 4 seconds with a hatchet, 10 seconds with a shard. + if(do_after(user, 500/W.force, target = src)) + 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)//If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("tally", "Honey Tree", 1, "Cutted Tree") + + return ..() + diff --git a/icons/obj/lavaland/ash_tree.dmi b/icons/obj/lavaland/ash_tree.dmi new file mode 100644 index 0000000000..7a8addafe5 Binary files /dev/null and b/icons/obj/lavaland/ash_tree.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 79aef22354..361e3ee1e3 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2516,6 +2516,7 @@ #include "code\modules\mining\laborcamp\laborshuttle.dm" #include "code\modules\mining\laborcamp\laborstacker.dm" #include "code\modules\mining\lavaland\ash_flora.dm" +#include "code\modules\mining\lavaland\ash_tree.dm" #include "code\modules\mining\lavaland\necropolis_chests.dm" #include "code\modules\mining\lavaland\ruins\gym.dm" #include "code\modules\mob\clickdelay.dm"