mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 08:03:43 +01:00
Makes Space Heaters Into Constructable Machines and Slightly Improves Them (#28747)
* Reverse-engineered techniques of the Space Amish * The Space Amish are no longer required. * Update spaceheater.dm * Update spaceheater.dm * Update code/game/machinery/spaceheater.dm Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> --------- Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
@@ -420,6 +420,17 @@ to destroy them and players will be able to make replacements.
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/stack/sheet/glass = 1)
|
||||
|
||||
/obj/item/circuitboard/space_heater
|
||||
board_name = "Space Heater"
|
||||
icon_state = "engineering"
|
||||
build_path = /obj/machinery/space_heater
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;plasmatech=3"
|
||||
req_components = list(
|
||||
/obj/item/stock_parts/micro_laser = 1,
|
||||
/obj/item/stock_parts/capacitor = 1,
|
||||
/obj/item/stock_parts/cell = 1)
|
||||
|
||||
/obj/item/circuitboard/recharger
|
||||
board_name = "Recharger"
|
||||
icon_state = "security"
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
/obj/machinery/space_heater
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
name = "space heater"
|
||||
desc = "A free-standing mobile space heater for heating rooms, featuring a temperature adjustment dial and an easy-swap power cell holder which are hidden behind a screwed-on panel."
|
||||
icon = 'icons/obj/atmos.dmi'
|
||||
icon_state = "sheater0"
|
||||
name = "space heater"
|
||||
desc = "Made by Space Amish using traditional space techniques, this heater is guaranteed not to set the station on fire."
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
max_integrity = 250
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 100, FIRE = 80, ACID = 10)
|
||||
var/obj/item/stock_parts/cell/cell
|
||||
var/on = FALSE
|
||||
var/open = FALSE
|
||||
var/set_temperature = 50 // in celcius, add T0C for kelvin
|
||||
var/heating_power = 40000
|
||||
|
||||
@@ -18,10 +17,27 @@
|
||||
|
||||
/obj/machinery/space_heater/Initialize(mapload)
|
||||
. = ..()
|
||||
cell = new /obj/item/stock_parts/cell(src)
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/space_heater(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor(null)
|
||||
component_parts += new /obj/item/stock_parts/micro_laser(null)
|
||||
component_parts += new /obj/item/stock_parts/cell(null)
|
||||
RefreshParts()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/space_heater/RefreshParts()
|
||||
cell = null
|
||||
for(var/obj/item/stock_parts/cell/P in component_parts)
|
||||
cell = P
|
||||
return
|
||||
|
||||
/obj/machinery/space_heater/deconstruct(disassembled)
|
||||
if(cell)
|
||||
cell.forceMove(loc)
|
||||
cell = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/space_heater/Destroy()
|
||||
QDEL_NULL(cell)
|
||||
return ..()
|
||||
@@ -31,13 +47,13 @@
|
||||
|
||||
/obj/machinery/space_heater/update_overlays()
|
||||
. = ..()
|
||||
if(open)
|
||||
if(panel_open)
|
||||
. += "sheater-open"
|
||||
|
||||
/obj/machinery/space_heater/examine(mob/user)
|
||||
. = ..()
|
||||
. += "The heater is [on ? "on" : "off"] and the hatch is [open ? "open" : "closed"]."
|
||||
if(open)
|
||||
. += "The heater is [on ? "on" : "off"] and the hatch is [panel_open ? "open" : "closed"]."
|
||||
if(panel_open)
|
||||
. += "The power cell is [cell ? "installed" : "missing"]."
|
||||
else
|
||||
. += "The charge meter reads [cell ? round(cell.percent(),1) : 0]%"
|
||||
@@ -54,42 +70,60 @@
|
||||
if(!istype(used, /obj/item/stock_parts/cell))
|
||||
return ..()
|
||||
|
||||
if(!open)
|
||||
if(!panel_open)
|
||||
to_chat(user, "The hatch must be open to insert a power cell.")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(cell)
|
||||
to_chat(user, "There is already a power cell inside.")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
else
|
||||
// insert cell
|
||||
var/obj/item/stock_parts/cell/C = user.get_active_hand()
|
||||
C.add_fingerprint(user)
|
||||
user.visible_message("<span class='notice'>[user] inserts a power cell into [src].</span>",\
|
||||
"<span class='notice'>You insert the power cell into [src].</span>")
|
||||
|
||||
// insert cell
|
||||
var/obj/item/stock_parts/cell/C = used
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='warning'>[used] is stuck to your hand!</span>")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/machinery/space_heater/screwdriver_act(mob/user, obj/item/I)
|
||||
component_parts += C
|
||||
RefreshParts()
|
||||
cell.forceMove(src)
|
||||
C.add_fingerprint(user)
|
||||
user.visible_message(
|
||||
"<span class='notice'>[user] inserts a power cell into [src].</span>",
|
||||
"<span class='notice'>You insert the power cell into [src].</span>"
|
||||
)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/machinery/space_heater/screwdriver_act(mob/living/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
return
|
||||
open = !open
|
||||
if(open)
|
||||
|
||||
panel_open = !panel_open
|
||||
if(panel_open)
|
||||
SCREWDRIVER_OPEN_PANEL_MESSAGE
|
||||
on = FALSE
|
||||
else
|
||||
SCREWDRIVER_CLOSE_PANEL_MESSAGE
|
||||
update_icon()
|
||||
if(!open && user.machine == src)
|
||||
if(!panel_open && user.machine == src)
|
||||
user << browse(null, "window=spaceheater")
|
||||
user.unset_machine()
|
||||
|
||||
/obj/machinery/space_heater/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(panel_open && !on && default_deconstruction_crowbar(user, I))
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/space_heater/wrench_act(mob/living/user, obj/item/I)
|
||||
default_unfasten_wrench(user, I, 0)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/space_heater/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/space_heater/interact(mob/user as mob)
|
||||
if(open)
|
||||
if(panel_open)
|
||||
var/dat
|
||||
dat = "Power cell: "
|
||||
if(cell)
|
||||
@@ -116,10 +150,10 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/space_heater/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
if((in_range(src, usr) && isturf(src.loc)) || (issilicon(usr)))
|
||||
usr.set_machine(src)
|
||||
|
||||
@@ -132,26 +166,37 @@
|
||||
set_temperature = dd_range(0, 90, set_temperature + value)
|
||||
|
||||
if("cellremove")
|
||||
if(open && cell && !usr.get_active_hand())
|
||||
if(panel_open && cell && !usr.get_active_hand())
|
||||
cell.update_icon()
|
||||
cell.forceMove(loc)
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
usr.put_in_hands(cell)
|
||||
cell.add_fingerprint(usr)
|
||||
cell = null
|
||||
usr.visible_message("<span class='notice'>[usr] removes the power cell from [src].</span>", "<span class='notice'>You remove the power cell from [src].</span>")
|
||||
|
||||
for(var/obj/item/stock_parts/cell/C in component_parts)
|
||||
component_parts -= C
|
||||
cell = null
|
||||
RefreshParts()
|
||||
usr.visible_message(
|
||||
"<span class='notice'>[usr] removes the power cell from [src].</span>",
|
||||
"<span class='notice'>You remove the power cell from [src].</span>"
|
||||
)
|
||||
|
||||
if("cellinstall")
|
||||
if(open && !cell)
|
||||
if(panel_open && !cell)
|
||||
var/obj/item/stock_parts/cell/C = usr.get_active_hand()
|
||||
if(istype(C))
|
||||
usr.drop_item()
|
||||
cell = C
|
||||
C.loc = src
|
||||
C.add_fingerprint(usr)
|
||||
if(usr.drop_item())
|
||||
component_parts += C
|
||||
RefreshParts()
|
||||
C.forceMove(src)
|
||||
C.add_fingerprint(usr)
|
||||
|
||||
usr.visible_message("<span class='notice'>[usr] inserts a power cell into [src].</span>", "<span class='notice'>You insert the power cell into [src].</span>")
|
||||
usr.visible_message(
|
||||
"<span class='notice'>[usr] inserts a power cell into [src].</span>",
|
||||
"<span class='notice'>You insert the power cell into [src].</span>"
|
||||
)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>[C] is stuck to your hand!</span>")
|
||||
|
||||
updateDialog()
|
||||
else
|
||||
@@ -159,8 +204,6 @@
|
||||
usr.unset_machine()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/space_heater/process()
|
||||
var/datum/milla_safe/space_heater_process/milla = new()
|
||||
milla.invoke_async(src)
|
||||
|
||||
@@ -12,6 +12,16 @@
|
||||
build_path = /obj/item/circuitboard/thermomachine
|
||||
category = list ("Engineering Machinery")
|
||||
|
||||
/datum/design/space_heater
|
||||
name = "Machine Board (Space Heater)"
|
||||
desc = "The circuit board for a space heater"
|
||||
id = "space_heater"
|
||||
req_tech = list("programming" = 3, "plasmatech" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list(MAT_GLASS = 1000)
|
||||
build_path = /obj/item/circuitboard/space_heater
|
||||
category = list ("Engineering Machinery")
|
||||
|
||||
/datum/design/recharger
|
||||
name = "Machine Board (Weapon Recharger)"
|
||||
desc = "The circuit board for a weapon recharger."
|
||||
|
||||
Reference in New Issue
Block a user