-
-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request Ports Saunas & Towels from Skyrat. Some edits to the code to fit here, and to make it work a little more sane. Ports some improvements to radial menus from TG. ![image](https://github.com/shiptest-ss13/Shiptest/assets/81882910/23386cc1-d4d7-4312-af41-10b207ea15ce) <!-- Describe The Pull Request. Please be sure every change is documented or this can delay review and even discourage maintainers from merging your PR! --> ## Changelog :cl: add: Saunas, craftable with wooden planks. Uses wood for fuel, and requires water splashed on the sauna. add: Towels. You can use them in-hand to change it from waist, chest, or head. /:cl: <!-- Both :cl:'s are required for the changelog to work! You can put your name to the right of the first :cl: if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. -->
- Loading branch information
Showing
11 changed files
with
365 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#define SAUNA_H2O_TEMP T20C + 60 | ||
#define SAUNA_LOG_FUEL 150 | ||
#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_state = "sauna" | ||
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) | ||
. = ..() | ||
. += "<span class='notice'>The rocks are [water_amount ? "moist" : "dry"].</span>" | ||
. += "<span class='notice'>There's [fuel_amount ? "some fuel" : "no fuel"] in the oven.</span>" | ||
|
||
/obj/structure/sauna_oven/Initialize() | ||
. = ..() | ||
RegisterSignal(src, COMSIG_ATOM_EXPOSE_REAGENTS, PROC_REF(add_water)) | ||
|
||
/obj/structure/sauna_oven/proc/add_water(atom/source, list/reagents, datum/reagents/source_reagents, method, volume_modifier, show_message) | ||
SIGNAL_HANDLER | ||
|
||
if(method != TOUCH) // Only splashing/pouring | ||
return | ||
|
||
for(var/reagent in reagents) | ||
if(istype(reagent, /datum/reagent/water)) | ||
water_amount += reagents[reagent] * SAUNA_WATER_PER_WATER_UNIT | ||
|
||
/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("<span class='notice'>[user] turns off [src].</span>", "<span class='notice'>You turn on [src].</span>") | ||
else if (fuel_amount) | ||
lit = TRUE | ||
START_PROCESSING(SSobj, src) | ||
user.visible_message("<span class='notice'>[user] turns on [src].</span>", "<span class='notice'>You turn off [src].</span>") | ||
update_icon() | ||
|
||
/obj/structure/sauna_oven/update_overlays() | ||
. = ..() | ||
if(lit) | ||
. += "sauna_on_overlay" | ||
|
||
/obj/structure/sauna_oven/update_icon() | ||
..() | ||
icon_state = "[lit ? "sauna_on" : initial(icon_state)]" | ||
|
||
/obj/structure/sauna_oven/attackby(obj/item/T, mob/user) | ||
if(T.tool_behaviour == TOOL_WRENCH) | ||
to_chat(user, "<span class='notice'>You begin to deconstruct [src].</span>") | ||
if(T.use_tool(src, user, 60, volume=50)) | ||
to_chat(user, "<span class='notice'>You successfully deconstructed [src].</span>") | ||
new /obj/item/stack/sheet/mineral/wood(get_turf(src), 30) | ||
qdel(src) | ||
|
||
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, "<span class='warning'>You can't fit any more of [T] in [src]!</span>") | ||
return | ||
fuel_amount += SAUNA_LOG_FUEL * wood.amount | ||
wood.use(wood.amount) | ||
user.visible_message("<span class='notice'>[user] tosses some \ | ||
wood into [src].</span>", "<span class='notice'>You add \ | ||
some fuel to [src].</span>") | ||
return ..() | ||
|
||
/obj/structure/sauna_oven/process() | ||
if(water_amount) | ||
var/used_amount = min(water_amount / 10, 20) | ||
water_amount -= used_amount | ||
var/turf/pos = get_turf(src) | ||
if(pos) | ||
pos.atmos_spawn_air("water_vapor=[used_amount];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_MAXIMUM_FUEL | ||
#undef SAUNA_WATER_PER_WATER_UNIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.