From 01d21b9b6645bd75763f7714e31c6e9cff402e75 Mon Sep 17 00:00:00 2001 From: Archie Date: Tue, 6 Jul 2021 15:04:00 -0300 Subject: [PATCH] Sauna --- .../items/stacks/sheets/sheet_types.dm | 3 +- .../game/objects/structures/sauna_oven.dm | 117 ++++++++++++++++++ .../icons/obj/structures/sauna_oven.dmi | Bin 0 -> 902 bytes tgstation.dme | 1 + 4 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 hyperstation/code/game/objects/structures/sauna_oven.dm create mode 100644 hyperstation/icons/obj/structures/sauna_oven.dmi diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 8f8afa9b..c86debe7 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -223,6 +223,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \ new/datum/stack_recipe("coffin", /obj/structure/closet/crate/coffin, 5, time = 15, one_per_turf = TRUE, on_floor = TRUE), \ new/datum/stack_recipe("book case", /obj/structure/bookcase, 4, time = 15, one_per_turf = TRUE, on_floor = TRUE), \ new/datum/stack_recipe("drying rack", /obj/machinery/smartfridge/drying_rack, 10, time = 15, one_per_turf = TRUE, on_floor = TRUE), \ + new/datum/stack_recipe("sauna oven", /obj/structure/sauna_oven, 30, time = 15, one_per_turf = TRUE, on_floor = TRUE), \ new/datum/stack_recipe("dog bed", /obj/structure/bed/dogbed, 10, time = 10, one_per_turf = TRUE, on_floor = TRUE), \ new/datum/stack_recipe("dresser", /obj/structure/dresser, 10, time = 15, one_per_turf = TRUE, on_floor = TRUE), \ new/datum/stack_recipe("ore box", /obj/structure/ore_box, 4, time = 50, one_per_turf = TRUE, on_floor = TRUE),\ @@ -900,4 +901,4 @@ GLOBAL_LIST_INIT(plaswood_recipes, list ( \ return ..() /obj/item/stack/sheet/mineral/plaswood/fifty - amount = 50 \ No newline at end of file + amount = 50 diff --git a/hyperstation/code/game/objects/structures/sauna_oven.dm b/hyperstation/code/game/objects/structures/sauna_oven.dm new file mode 100644 index 00000000..c1186178 --- /dev/null +++ b/hyperstation/code/game/objects/structures/sauna_oven.dm @@ -0,0 +1,117 @@ +#define SAUNA_H2O_TEMP T20C + 20 +#define SAUNA_LOG_FUEL 150 +#define SAUNA_PAPER_FUEL 5 +#define SAUNA_MAXIMUM_FUEL 3000 +#define SAUNA_WATER_PER_WATER_UNIT 5 + +/obj/structure/sauna_oven + name = "sauna oven" + desc = "A modest sauna oven with rocks. Add some fuel, pour some water and enjoy the moment." + icon = 'hyperstation/icons/obj/structures/sauna_oven.dmi' + icon_state = "sauna_oven" + density = TRUE + anchored = TRUE + resistance_flags = FIRE_PROOF + var/lit = FALSE + var/fuel_amount = 0 + var/water_amount = 0 + +/obj/structure/sauna_oven/examine(mob/user) + . = ..() + . += "The rocks are [water_amount ? "moist" : "dry"]." + . += "There's [fuel_amount ? "some fuel" : "no fuel"] in the oven." + +/obj/structure/sauna_oven/Destroy() + if(lit) + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/structure/sauna_oven/attack_hand(mob/user) + . = ..() + if(.) + return + if(lit) + lit = FALSE + STOP_PROCESSING(SSobj, src) + user.visible_message("[user] turns on [src].", "You turn on [src].") + else if (fuel_amount) + lit = TRUE + START_PROCESSING(SSobj, src) + user.visible_message("[user] turns off [src].", "You turn off [src].") + update_icon() + +/obj/structure/sauna_oven/update_overlays() + . = ..() + if(lit) + . += "sauna_oven_on_overlay" + +/obj/structure/sauna_oven/update_icon() + ..() + icon_state = "[lit ? "sauna_oven_on" : initial(icon_state)]" + +/obj/structure/sauna_oven/attackby(obj/item/T, mob/user) + if(T.tool_behaviour == TOOL_WRENCH) + to_chat(user, "You begin to deconstruct [src].") + if(T.use_tool(src, user, 60, volume=50)) + to_chat(user, "You successfully deconstructed [src].") + new /obj/item/stack/sheet/mineral/wood(get_turf(src), 30) + qdel(src) + + else if(istype(T, /obj/item/reagent_containers)) + var/obj/item/reagent_containers/reagent_container = T + if(!reagent_container.is_open_container()) + return ..() + if(reagent_container.reagents.has_reagent(/datum/reagent/water)) + reagent_container.reagents.remove_reagent(/datum/reagent/water, 5) + user.visible_message("[user] pours some \ + water into [src].", "You pour \ + some water to [src].") + water_amount += 5 * SAUNA_WATER_PER_WATER_UNIT + else + to_chat(user, "There's no water in [reagent_container]") + + else if(istype(T, /obj/item/stack/sheet/mineral/wood)) + var/obj/item/stack/sheet/mineral/wood/wood = T + if(fuel_amount > SAUNA_MAXIMUM_FUEL) + to_chat(user, "You can't fit any more of [T] in [src]!") + return FALSE + fuel_amount += SAUNA_LOG_FUEL * wood.amount + wood.use(wood.amount) + user.visible_message("[user] tosses some \ + wood into [src].", "You add \ + some fuel to [src].") + return TRUE + else if(istype(T, /obj/item/paper_bin)) + var/obj/item/paper_bin/paper_bin = T + user.visible_message("[user] throws [T] into \ + [src].", "You add [T] to [src].\ + ") + fuel_amount += SAUNA_PAPER_FUEL * paper_bin.total_paper + qdel(paper_bin) + return TRUE + else if(istype(T, /obj/item/paper)) + user.visible_message("[user] throws [T] into \ + [src].", "You throw [T] into [src].\ + ") + fuel_amount += SAUNA_PAPER_FUEL + qdel(T) + return TRUE + return ..() + +/obj/structure/sauna_oven/process() + if(water_amount) + water_amount-- + var/turf/pos = get_turf(src) + if(pos) + pos.atmos_spawn_air("water_vapor=10;TEMP=[SAUNA_H2O_TEMP]") + fuel_amount-- + if(fuel_amount <= 0) + lit = FALSE + STOP_PROCESSING(SSobj, src) + update_icon() + +#undef SAUNA_H2O_TEMP +#undef SAUNA_LOG_FUEL +#undef SAUNA_PAPER_FUEL +#undef SAUNA_MAXIMUM_FUEL +#undef SAUNA_WATER_PER_WATER_UNIT diff --git a/hyperstation/icons/obj/structures/sauna_oven.dmi b/hyperstation/icons/obj/structures/sauna_oven.dmi new file mode 100644 index 0000000000000000000000000000000000000000..fb0871ca9196734183821428b0ccf27fb7b9d868 GIT binary patch literal 902 zcmV;119|+3P)#oD2-({LLt(Fb9N*gN7>}^00001bW%=J06^y0W&i*HoO)DP zbVOxyV{&P5bZKvH004NLQ&wi$yG%qnezbrLRiHkEOv#1y-XvoExR+N~V3SnbW8lRsB zqKk48E3xY`2a2WwWkJF^NRW%OD78E@F9nam*bOvB7-+0xtYd~|l(K@Wp9|Rk0B$o& zH>LXZ-v9stI7vi7RA_M8cu z1W^Ujbu1R^U+AT%mH@8>H3bj?O9~+|908z|(pm~25K3wdZ?tIK146-eX%J;w0EGll zRA7T3g_KPJq*5CLHmnc(wg6joDb;!&AVu3DIQly9_Fm9yOMs7pngVG3slPsT{L)PU zcnA(3g3`ZXOMw1cTj){!V|4RPv`tncwv? z&5spif1f{&DM9W}Q%WE+fb%)8(BI{cV@{Cz)07j$0D~%MXy8ysq_W0OH|wtxp3G53g%|8i0r3@F5`9 z57hdksPzN2J`F&uAE@<7J$?R9_P`_75A66fzysC~?D@9<)UF@c^+`Q_{!aoteg01p c95(;|1s9oyPQrjUF#rGn07*qoM6N<$f^a5_&;S4c literal 0 HcmV?d00001 diff --git a/tgstation.dme b/tgstation.dme index 508e8ff7..115184bd 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3072,6 +3072,7 @@ #include "hyperstation\code\game\objects\items\cosmetics.dm" #include "hyperstation\code\game\objects\items\storage\big_bag.dm" #include "hyperstation\code\game\objects\structures\ghost_role_spawners.dm" +#include "hyperstation\code\game\objects\structures\sauna_oven.dm" #include "hyperstation\code\gamemode\traitor_lewd.dm" #include "hyperstation\code\gamemode\traitor_thief.dm" #include "hyperstation\code\gamemode\werewolf\werewolf.dm"