Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roller Bed Racks - Revivial #19057

Merged
merged 22 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions code/game/objects/structures/stool_bed_chair_nest/bed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@
desc = "A collapsed roller bed that can be carried around."
icon = 'icons/obj/rollerbed.dmi'
icon_state = "standard_folded"
base_icon = "standard"
item_state = "rbed"
contained_sprite = TRUE
drop_sound = 'sound/items/drop/axe.ogg'
Expand All @@ -582,6 +583,7 @@
name = "medical hoverbed"
desc = "A collapsed hoverbed that can be carried around."
icon_state = "hover_folded"
base_icon = "hover"
item_state = "rbed_hover"
origin_type = /obj/structure/bed/roller/hover

Expand Down Expand Up @@ -633,3 +635,85 @@
R.add_fingerprint(user)
qdel(held)
held = null

/**
* # Roller Rack
*
* A rack structure that can hold up to four roller bed items (Or subtypes i.e. Hoverbeds), stored in the `held` list.
*
* The `initial_beds` variable controls the number of beds the rack will spawn with.
*/
/obj/structure/roller_rack
name = "roller bed rack"
desc = "A rack for holding collapsed roller beds."
icon = 'icons/obj/rollerbed.dmi'
icon_state = "holder"

/**
* List of held roller bed items.
*/
var/list/obj/item/roller/held = list()

/**
* The number of beds the rack spawns with
*/
var/initial_beds = 4
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved

/obj/structure/roller_rack/Initialize()
. = ..()
for(var/_ in 1 to initial_beds)
var/obj/item/roller/RB = new /obj/item/roller(src)
held += RB
update_icon()

/obj/structure/roller_rack/Destroy()
QDEL_LIST(held)
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved
return ..()

/obj/structure/roller_rack/update_icon()
. = ..()
ClearOverlays()
var/beds = 0
for(var/obj/item/roller/RB in held)
var/image/I = overlay_image(icon, "[icon_state]_bed_[RB.base_icon]")
I.pixel_x = (5 * beds)
beds++
AddOverlays(I)

/obj/structure/roller_rack/examine(mob/user)
desc = "[initial(desc)] \nIt is holding [LAZYLEN(held)] beds."
. = ..()

/obj/structure/roller_rack/attack_hand(mob/user)
if(!LAZYLEN(held))
to_chat(user, SPAN_NOTICE("The rack is empty."))
return

var/obj/item/roller/RB = held[LAZYLEN(held)]
user.put_in_hands(RB)
held -= RB
to_chat(user, SPAN_NOTICE("You retrieve \the [RB] from the rack."))
update_icon()

/obj/structure/roller_rack/attackby(obj/item/attacking_item, mob/user)
if(iswrench(attacking_item))
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "bolt" : "unbolt"] \the [src] [anchored ? "to" : "from"] the ground."))

if(istype(attacking_item, /obj/item/roller))
var/obj/item/roller/RB = attacking_item

if(LAZYLEN(held) >= 4)
to_chat(user, SPAN_NOTICE("The rack has no space for \the [RB]"))
return

user.drop_from_inventory(RB, src)
held += RB
to_chat(user, SPAN_NOTICE("You place \the [RB] on the rack."))
update_icon()

/obj/structure/roller_rack/two
initial_beds = 2

/obj/structure/roller_rack/three
initial_beds = 3
6 changes: 6 additions & 0 deletions html/changelogs/rolleracks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
author: Sparky_hotdog

delete-after: True

changes:
- rscadd: "Added roller bed racks, which can store 4 roller beds at a time. Replaced the previous stacks of roller beds in medical with racks."
Binary file modified icons/obj/rollerbed.dmi
Binary file not shown.
25 changes: 3 additions & 22 deletions maps/sccv_horizon/sccv_horizon-2_deck_2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2428,10 +2428,7 @@
"aZR" = (
/obj/effect/floor_decal/corner/white/diagonal,
/obj/structure/table/standard,
/obj/item/roller,
/obj/item/roller{
pixel_y = 4
},
/obj/structure/roller_rack/two,
/turf/simulated/floor/tiled,
/area/medical/first_responder)
"ban" = (
Expand Down Expand Up @@ -28007,18 +28004,10 @@
pixel_x = -17;
pixel_y = 2
},
/obj/item/roller{
pixel_y = 3
},
/obj/item/roller{
pixel_y = 3
},
/obj/item/roller{
pixel_y = 3
},
/obj/effect/floor_decal/corner_wide/green{
dir = 10
},
/obj/structure/roller_rack/three,
/turf/simulated/floor/tiled/white,
/area/medical/gen_treatment)
"mPq" = (
Expand Down Expand Up @@ -30668,16 +30657,8 @@
/obj/structure/table/standard,
/obj/structure/window/reinforced,
/obj/effect/floor_decal/corner/grey/diagonal,
/obj/item/roller{
pixel_y = 4
},
/obj/item/roller{
pixel_y = 4
},
/obj/item/roller{
pixel_y = 4
},
/obj/machinery/firealarm/east,
/obj/structure/roller_rack/three,
/turf/simulated/floor/tiled/white,
/area/medical/reception)
"oeK" = (
Expand Down
Loading