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

Zeng-Hu Hoverbeds #19152

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
179 changes: 169 additions & 10 deletions code/game/objects/structures/stool_bed_chair_nest/bed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,126 @@
held_item = /obj/item/roller/hover
has_iv_light = FALSE

/**
* The color of light the hoverbed emits
*/
var/hover_color = LIGHT_COLOR_CYAN
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved
/**
* The cell powering the hoverbed
*/
var/obj/item/cell/cell
/**
* The power drained from the bed every tick
*/
var/power_draw = 5
/**
* If the hovermode is active
*/
var/hover = TRUE
/**
* If the power cell is accessible or not
*/
var/cell_open = FALSE
/**
* If we have warned about low power recently
*/
var/warned = FALSE

/obj/structure/bed/roller/hover/Initialize()
.=..()
set_light(2,1,LIGHT_COLOR_CYAN)
set_light(2,1,hover_color)
if(!cell || !cell.charge)
hover = FALSE
START_PROCESSING(SSprocessing, src)

/obj/structure/bed/roller/hover/Destroy()
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved
QDEL_NULL(cell)
return ..()

// Same as parent, but doesn't kill processing (We need that for power drain)
/obj/structure/bed/roller/hover/detach_iv(mob/living/carbon/human/target, mob/user)
user.visible_message(SPAN_NOTICE("<b>[user]</b> takes [target] off the IV on \the [src]."), SPAN_NOTICE("You take the IV off \the [target]."))
iv_attached = FALSE
update_icon()

/obj/structure/bed/roller/hover/process()
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
if(!hover && cell && cell.charge)
hover = TRUE
visible_message(SPAN_WARNING("\The [src] rises from the floor as its hover thrusters kick in."))
update_icon()
if(hover && cell)
cell.use(power_draw)
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved

if(!cell || !cell.charge)
hover = FALSE
visible_message(SPAN_WARNING("\The [src] falls the the floor as its hover thrusters cut out."))
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved
update_icon()
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved
return . // Even if we are dead, we shouldn't stop the roller IV from working

else if(cell.charge <= cell.maxcharge/10 && !warned)
playsound(src, 'sound/machines/twobeep.ogg', 50)
visible_message(SPAN_WARNING("\The [src] beeps a warning: 10% charge remaining!"))
warned = TRUE
return TRUE // Even if the normal roller functions want to kill, we are still processing

/obj/structure/bed/roller/hover/emp_act(severity)
if(cell)
cell.charge = 0 //Drain cell
return ..()

/obj/structure/bed/roller/hover/collapse() // Same as parent, but we need to update the collapsed one's power cell
usr.visible_message(SPAN_NOTICE("<b>[usr]</b> collapses \the [src]."), SPAN_NOTICE("You collapse \the [src]"))
var/obj/item/roller/hover/H = new held_item(get_turf(src))
H.cell_open = cell_open
H.cell = cell
cell.forceMove(H)
cell = null
qdel(src)

/obj/structure/bed/roller/hover/attackby(obj/item/attacking_item, mob/user)
. = ..()
if(attacking_item.isscrewdriver())
cell_open = !cell_open
to_chat(user, SPAN_NOTICE("You [cell_open ? "open" : "close"] the powercell panel on \the [src]."))
if(cell_open && !cell && istype(attacking_item, /obj/item/cell))
cell = attacking_item
user.drop_from_inventory(cell, src)
to_chat(user, SPAN_NOTICE("You insert \the [cell] into \the [src]."))
warned = FALSE
START_PROCESSING(SSprocessing, src)

/obj/structure/bed/roller/hover/attack_hand(mob/user)
. = ..()
if(cell_open && cell)
user.put_in_hands(cell)
to_chat(user, SPAN_NOTICE("You remove \the [cell] from \the [src]."))
cell = null

/obj/structure/bed/roller/hover/update_icon()
if(!hover)
icon_state = "[base_icon]_off"
if(buckled)
buckled.pixel_y = 0
if(hover)
. = ..()
if(buckled && !buckled.pixel_y)
buckled.pixel_y = patient_shift

/obj/structure/bed/roller/hover/stair_act()
if(!hover)
return ..()
return

/obj/structure/bed/roller/hover/zeng
name = "zeng-hu hoverbed"
desc = "A medical hoverbed, designed by Zeng-Hu Pharmaceuticals in conjunction with the Nralakk Federation."
icon_state = "zeng_down"
base_icon = "zeng"
held_item = /obj/item/roller/hover/zeng
hover_color = LIGHT_COLOR_VIOLET
power_draw = 10 //Twice as power thirsty as the skrell ones

/obj/item/roller
name = "roller bed"
desc = "A collapsed roller bed that can be carried around."
Expand All @@ -597,14 +710,6 @@
var/origin_type = /obj/structure/bed/roller
w_class = ITEMSIZE_NORMAL

/obj/item/roller/hover
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

/obj/item/roller/attack_self(mob/user)
..()
deploy_roller(user, user.loc)
Expand Down Expand Up @@ -633,6 +738,55 @@
R.add_fingerprint(user)
qdel(src)

/obj/item/roller/hover
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
var/obj/item/cell/cell
var/cell_open = FALSE

/obj/item/roller/hover/Destroy()
QDEL_NULL(cell)
return ..()

/obj/item/roller/hover/attackby(obj/item/attacking_item, mob/user)
. = ..()
if(attacking_item.isscrewdriver())
cell_open = !cell_open
to_chat(user, SPAN_NOTICE("You [cell_open ? "open" : "close"] the powercell panel on \the [src]."))
if(cell_open && !cell && istype(attacking_item, /obj/item/cell))
cell = attacking_item
user.drop_from_inventory(cell, src)
to_chat(user, SPAN_NOTICE("You insert \the [cell] into \the [src]."))

/obj/item/roller/hover/attack_hand(mob/user)
if(cell_open && cell)
user.put_in_hands(cell)
to_chat(user, SPAN_NOTICE("You remove \the [cell] from \the [src]."))
cell = null
return
. = ..()

/obj/item/roller/hover/deploy_roller(mob/user, atom/location) // Same as parent, but we need to update the deployed one's power cell
var/obj/structure/bed/roller/hover/R = new origin_type(location)
R.add_fingerprint(user)
R.cell_open = cell_open
R.cell = cell
cell.forceMove(R)
cell = null
qdel(src)

/obj/item/roller/hover/zeng
name = "zeng-hu hoverbed"
desc = "A collapsed zeng-hu hoverbed that can be carried around. Designed by Zeng-Hu Pharmaceuticals in conjunction with the Nralakk Federation."
icon_state = "zeng_folded"
base_icon = "zeng"
item_state = "rbed_zeng"
origin_type = /obj/structure/bed/roller/hover/zeng

/obj/item/roller_holder
name = "roller bed rack"
desc = "A rack for carrying a collapsed roller bed."
Expand Down Expand Up @@ -677,10 +831,15 @@
*/
var/initial_beds = 4

/**
* The type path of the beds to spawn initially
*/
var/initial_bed_type = /obj/item/roller

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

Expand Down
7 changes: 7 additions & 0 deletions code/modules/research/designs/protolathe/medical_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@
materials = list(DEFAULT_WALL_MATERIAL = 3000, MATERIAL_PHORON = 3000, MATERIAL_DIAMOND = 500)
build_path = /obj/item/reagent_containers/personal_inhaler_cartridge/bluespace

/datum/design/item/medical/zeng_roller
name = "Zeng-Hu Hoverbed"
desc = "A medical hoverbed, designed by Zeng-Hu Pharmaceuticals in conjunction with the Nralakk Federation."
1Sparky1 marked this conversation as resolved.
Show resolved Hide resolved
req_tech = list(TECH_MAGNET = 5, TECH_BIO = 5)
materials = list(DEFAULT_WALL_MATERIAL = 15000, MATERIAL_GLASS = 5000, MATERIAL_SILVER = 2000)
build_path = /obj/item/roller/hover/zeng

/datum/design/item/beaker
p_category = "Advanced Beaker Design"

Expand Down
7 changes: 7 additions & 0 deletions html/changelogs/zenghoverbed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
author: Sparky_hotdog

delete-after: True

changes:
- rscadd: "Added a Zeng-Hu hoverbed variant, able to be produced by R&D."
- rscadd: "Both regular and Zeng-Hu hoverbeds require a powercell to function now. Zeng-Hu beds are more powerhungry."
Binary file modified icons/obj/rollerbed.dmi
Binary file not shown.
Loading