Skip to content

Commit

Permalink
The Evolution of Bar RP (#2470)
Browse files Browse the repository at this point in the history
<!-- 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
thgvr authored Nov 14, 2023
1 parent f86c026 commit 3e9e75c
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 11 deletions.
38 changes: 33 additions & 5 deletions code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,18 @@ GLOBAL_LIST_EMPTY(radial_menus)
parent.finished = TRUE

/datum/radial_menu
var/list/choices = list() //List of choice id's
var/list/choices_icons = list() //choice_id -> icon
var/list/choices_values = list() //choice_id -> choice
/// List of choice IDs
var/list/choices = list()

/// choice_id -> icon
var/list/choices_icons = list()

/// choice_id -> choice
var/list/choices_values = list()

/// choice_id -> /datum/radial_menu_choice
var/list/choice_datums = list()

var/list/page_data = list() //list of choices per page


Expand Down Expand Up @@ -199,6 +208,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
E.alpha = 255
E.mouse_opacity = MOUSE_OPACITY_ICON
E.cut_overlays()
E.vis_contents.Cut()
if(choice_id == NEXT_PAGE_ID)
E.name = "Next Page"
E.next_page = TRUE
Expand Down Expand Up @@ -245,11 +255,17 @@ GLOBAL_LIST_EMPTY(radial_menus)
var/I = extract_image(new_choices[E])
if(I)
choices_icons[id] = I
if (istype(new_choices[E], /datum/radial_menu_choice))
choice_datums[id] = new_choices[E]
setup_menu(use_tooltips)


/datum/radial_menu/proc/extract_image(E)
var/mutable_appearance/MA = new /mutable_appearance(E)
/datum/radial_menu/proc/extract_image(to_extract_from)
if (istype(to_extract_from, /datum/radial_menu_choice))
var/datum/radial_menu_choice/choice = to_extract_from
to_extract_from = choice.image

var/mutable_appearance/MA = new /mutable_appearance(to_extract_from)
if(MA)
MA.layer = ABOVE_HUD_LAYER
MA.appearance_flags |= RESET_TRANSFORM
Expand Down Expand Up @@ -332,3 +348,15 @@ GLOBAL_LIST_EMPTY(radial_menus)
if(!custom_check.Invoke())
return
return answer

/// Can be provided to choices in radial menus if you want to provide more information
/datum/radial_menu_choice
/// Required -- what to display for this button
var/image

/// If provided, will display an info button that will put this text in your chat
var/info

/datum/radial_menu_choice/Destroy(force, ...)
. = ..()
QDEL_NULL(image)
4 changes: 4 additions & 0 deletions code/game/objects/items/stacks/sheets/sheet_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,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, 15, time = 15, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("wooden barrel", /obj/structure/fermenting_barrel, 8, time = 50, 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), \
Expand Down Expand Up @@ -278,6 +279,9 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
. = ..()
. += GLOB.wood_recipes

/obj/item/stack/sheet/mineral/wood/twentyfive
amount = 25

/obj/item/stack/sheet/mineral/wood/fifty
amount = 50

Expand Down
101 changes: 101 additions & 0 deletions code/game/objects/structures/sauna.dm
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
15 changes: 14 additions & 1 deletion code/modules/cargo/packs/civilian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@
Bundles
*/

/datum/supply_pack/civilian/sauna_starter
name = "DIY Sauna Crate"
desc = "A Kalixcian staple. Comes with a set of five freshly cleaned towels, and enough wood to make your very own Sauna. Water not included."
cost = 500
contains = list(/obj/item/stack/sheet/mineral/wood/twentyfive,
/obj/item/reagent_containers/glass/bucket/wooden,
/obj/item/towel,
/obj/item/towel,
/obj/item/towel,
/obj/item/towel,
/obj/item/towel,)
crate_name = "sauna starter crate"
crate_type = /obj/structure/closet/crate/wooden

/datum/supply_pack/civilian/book_crate
name = "Book Crate"
desc = "Surplus from the Nanotrasen Archives, these six books are sure to be good reads."
Expand Down Expand Up @@ -272,7 +286,6 @@
crate_name = "masterwork fishing rod case"
crate_type = /obj/structure/closet/crate/wooden


/datum/supply_pack/civilian/fishinghooks
name = "Fishing Hook Variety Pack"
desc = "A variety of fishing hooks to allow for more specialized fishing."
Expand Down
10 changes: 5 additions & 5 deletions code/modules/cargo/packs/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,24 @@
crate_type = /obj/structure/closet/crate/large

/datum/supply_pack/tools/watertank
name = "Water Tank Crate"
name = "Fresh Water Supply Crate"
desc = "Contains a tank of dihydrogen monoxide. Sounds dangerous."
cost = 600
cost = 500
contains = list(/obj/structure/reagent_dispensers/watertank)
crate_name = "water tank crate"
crate_type = /obj/structure/closet/crate/large

/datum/supply_pack/tools/hightank
name = "Large Water Tank Crate"
name = "Large Fresh Water Supply Crate"
desc = "Contains a high-capacity water tank. Useful for botany or other service jobs."
cost = 1200
cost = 1500
contains = list(/obj/structure/reagent_dispensers/watertank/high)
crate_name = "high-capacity water tank crate"
crate_type = /obj/structure/closet/crate/large

/datum/supply_pack/tools/foamtank
name = "Firefighting Foam Tank Crate"
desc = "Contains a tank of firefighting foam. Also known as \"plasmaman's bane\"."
desc = "Contains a tank of firefighting foam. Also known as \"Phorid's Bane\"."
cost = 1500
contains = list(/obj/structure/reagent_dispensers/foamtank)
crate_name = "foam tank crate"
Expand Down
Loading

0 comments on commit 3e9e75c

Please sign in to comment.