Add Runtime Station (#3350)

Ports Runtime Station from /tg/, a debugging map meant to speed up boot time during development.
Also adds RTGs, a low-output (< 10 kW) upgradable buildable infinite power source, and allows placement of cables on catwalks.
This commit is contained in:
Lohikar
2017-08-29 12:39:35 -05:00
committed by GitHub
parent ceab73c63e
commit 4ed82ce486
12 changed files with 4331 additions and 27 deletions
+1
View File
@@ -1826,6 +1826,7 @@
#include "code\modules\power\port_gen.dm"
#include "code\modules\power\power.dm"
#include "code\modules\power\powernet.dm"
#include "code\modules\power\rtg.dm"
#include "code\modules\power\smes.dm"
#include "code\modules\power\smes_construction.dm"
#include "code\modules\power\solar.dm"
+4 -4
View File
@@ -134,11 +134,11 @@
for(var/I in req_components)
if(istype(P, text2path(I)) && (req_components[I] > 0))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(iscoil(P))
var/obj/item/stack/cable_coil/CP = P
if (istype(P, /obj/item/stack))
var/obj/item/stack/CP = P
if(CP.get_amount() > 1)
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src)
var/obj/item/stack/CC = new CP.type(src)
CC.amount = camt
CC.update_icon()
CP.use(camt)
@@ -153,7 +153,7 @@
update_desc()
break
user << desc
if(P && P.loc != src && !iscoil(P))
if(P && P.loc != src && !istype(P, /obj/item/stack))
user << "<span class='warning'>You cannot add that component to the machine!</span>"
+7 -7
View File
@@ -227,7 +227,7 @@
hatch_colour = "#7d7d7d"
/obj/machinery/door/airlock/glass_command
name = "Maintenance Hatch"
name = "Glass Airlock"
icon = 'icons/obj/doors/Doorcomglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
@@ -238,7 +238,7 @@
hatch_colour = "#3e638c"
/obj/machinery/door/airlock/glass_engineering
name = "Maintenance Hatch"
name = "Glass Airlock"
icon = 'icons/obj/doors/Doorengglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
@@ -249,7 +249,7 @@
hatch_colour = "#caa638"
/obj/machinery/door/airlock/glass_security
name = "Maintenance Hatch"
name = "Glass Airlock"
icon = 'icons/obj/doors/Doorsecglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
@@ -260,7 +260,7 @@
hatch_colour = "#677c97"
/obj/machinery/door/airlock/glass_medical
name = "Maintenance Hatch"
name = "Glass Airlock"
icon = 'icons/obj/doors/Doormedglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
@@ -289,7 +289,7 @@
hatch_colour = "#d2d2d2"
/obj/machinery/door/airlock/glass_research
name = "Maintenance Hatch"
name = "Glass Airlock"
icon = 'icons/obj/doors/Doorresearchglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
@@ -301,7 +301,7 @@
hatch_colour = "#d2d2d2"
/obj/machinery/door/airlock/glass_mining
name = "Maintenance Hatch"
name = "Glass Airlock"
icon = 'icons/obj/doors/Doorminingglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
@@ -312,7 +312,7 @@
hatch_colour = "#c29142"
/obj/machinery/door/airlock/glass_atmos
name = "Maintenance Hatch"
name = "Glass Airlock"
icon = 'icons/obj/doors/Dooratmoglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+6 -1
View File
@@ -24,9 +24,14 @@
/obj/proc/buckle_mob(mob/living/M)
if(!can_buckle || !istype(M) || (M.loc != loc) || M.buckled || M.pinned.len || (buckle_require_restraints && !M.restrained()))
if(!can_buckle || !istype(M) || M.buckled || M.pinned.len || (buckle_require_restraints && !M.restrained()))
return 0
if ((M.loc != loc) && !(density && get_dist(src, M) <= 1))
return 0
if (M.loc != loc)
M.forceMove(loc)
M.buckled = src
M.facing_dir = null
M.set_dir(buckle_dir ? buckle_dir : dir)
+7 -1
View File
@@ -87,4 +87,10 @@
burnt = null
broken = null
else
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
/turf/simulated/floor/can_lay_cable()
return !flooring
/turf/simulated/can_have_cabling()
return TRUE
+8 -2
View File
@@ -59,6 +59,12 @@
for(var/obj/O in src)
O.hide(0)
/turf/space/can_have_cabling()
if (locate(/obj/structure/lattice/catwalk) in src)
return 1
return 0
/turf/space/proc/update_starlight()
if(config.starlight)
for (var/T in RANGE_TURFS(1, src))
@@ -96,8 +102,8 @@
return
else
user << "<span class='warning'>The plating is going to need some support.</span>"
return
..(C, user)
// Ported from unstable r355
+13
View File
@@ -201,6 +201,19 @@ var/const/enterloopsanity = 100
/turf/proc/is_plating()
return 0
/turf/proc/can_have_cabling()
return FALSE
/turf/proc/can_lay_cable()
return can_have_cabling()
/turf/attackby(obj/item/C, mob/user)
if (can_lay_cable() && iscoil(C))
var/obj/item/stack/cable_coil/coil = C
coil.turf_place(src, user)
else
..()
/turf/proc/inertial_drift(atom/movable/A as mob|obj)
if(!(A.last_move)) return
if((istype(A, /mob/) && src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy-1)))
+9 -12
View File
@@ -89,7 +89,7 @@ var/list/possible_cable_coil_colours = list(
d2 = text2num( copytext( icon_state, dash+1 ) )
var/turf/T = src.loc // hide if turf is not intact
if(level == 1)
if(level == 1 && !T.is_hole)
hide(!T.is_plating())
SSpower.all_cables += src //add it to the global cable list
@@ -133,7 +133,7 @@ var/list/possible_cable_coil_colours = list(
/obj/structure/cable/attackby(obj/item/W, mob/user)
var/turf/T = src.loc
if(!T.is_plating())
if(!T.can_have_cabling())
return
if(iswirecutter(W))
@@ -643,15 +643,12 @@ obj/structure/cable/proc/cableColor(var/colorC)
user << "You can't lay cable at a place that far away."
return
if(!istype(F,/turf/simulated/floor))
if(!locate(/obj/structure/lattice/catwalk) in F)
user << "You can't lay cable there unless there is plating or a catwalk."
return
if(!F.is_plating()) // Ff floor is intact, complain
if(!locate(/obj/structure/lattice/catwalk) in F)
if (!F.can_lay_cable())
if (istype(F, /turf/simulated/floor))
user << "You can't lay cable there unless the floor tiles are removed."
return
else
user << "You can't lay cable there unless there is plating or a catwalk."
return
else
var/dirn
@@ -743,7 +740,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
var/turf/T = C.loc
if(!isturf(T) || !T.is_plating()) // sanity checks, also stop use interacting with T-scanner revealed cable
if(!isturf(T) || !T.can_have_cabling()) // sanity checks, also stop use interacting with T-scanner revealed cable
return
if(get_dist(C, user) > 1) // make sure it's close enough
@@ -759,7 +756,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
// one end of the clicked cable is pointing towards us
if(C.d1 == dirn || C.d2 == dirn)
if(!U.is_plating()) // can't place a cable if the floor is complete
if(!T.can_have_cabling()) // can't place a cable if the floor is complete
user << "You can't lay cable there unless the floor tiles are removed."
return
else
+111
View File
@@ -0,0 +1,111 @@
// Radioisotope Thermoelectric Generator (RTG)
// Simple power generator that would replace "magic SMES" on various derelicts.
/obj/machinery/power/rtg
name = "radioisotope thermoelectric generator"
desc = "A simple nuclear power generator, used in small outposts to reliably provide power for decades."
icon = 'icons/obj/power.dmi'
icon_state = "rtg"
density = TRUE
anchored = TRUE
use_power = 0
// You can buckle someone to RTG, then open its panel. Fun stuff.
can_buckle = TRUE
buckle_lying = FALSE
buckle_require_restraints = TRUE
var/power_gen = 1000 // Enough to power a single APC. 4000 output with T4 capacitor.
var/irradiate = TRUE // RTGs irradiate surroundings, but only when panel is open.
component_types = list(
/obj/item/stack/cable_coil{amount = 5},
/obj/item/weapon/stock_parts/capacitor,
/obj/item/stack/material/uranium{amount = 10},
/obj/item/weapon/circuitboard/rtg
)
/obj/machinery/power/rtg/Initialize()
. = ..()
connect_to_network()
/obj/machinery/power/rtg/machinery_process()
..()
add_avail(power_gen)
if(panel_open && irradiate)
for (var/mob/living/L in range(2, src))
L.apply_effect(10, IRRADIATE, blocked = L.getarmor(null, "rad")) // Weak but noticeable.
/obj/machinery/power/rtg/update_icon()
icon_state = panel_open ? "[initial(icon_state)]-open" : initial(icon_state)
/obj/machinery/power/rtg/RefreshParts()
var/part_level = 0
for(var/obj/item/weapon/stock_parts/SP in component_parts)
part_level += SP.rating
power_gen = initial(power_gen) * part_level
/obj/machinery/power/rtg/attackby(obj/item/I, mob/user, params)
if(default_part_replacement(user, I))
return
else if(default_deconstruction_screwdriver(user, I))
return
else if(default_deconstruction_crowbar(user, I))
return
return ..()
/obj/machinery/power/rtg/attack_hand(mob/user)
if(user.a_intent == I_GRAB && user_buckle_mob(user.pulling, user))
return
..()
/obj/machinery/power/rtg/advanced
desc = "An advanced RTG capable of moderating isotope decay, increasing power output but reducing lifetime. It uses phoron-fueled radiation collectors to increase output even further."
power_gen = 1250 // 2500 on T1, 10000 on T4.
component_types = list(
/obj/item/stack/cable_coil{amount = 5},
/obj/item/weapon/stock_parts/capacitor,
/obj/item/weapon/stock_parts/micro_laser,
/obj/item/stack/material/uranium{amount = 10},
/obj/item/stack/material/phoron{amount = 5},
/obj/item/weapon/circuitboard/rtg/advanced
)
/obj/item/weapon/circuitboard/rtg
name = T_BOARD("radioisotope thermoelectric generator")
build_path = /obj/machinery/power/rtg
board_type = "machine"
origin_tech = list(
TECH_ENGINEERING = 3,
TECH_DATA = 2,
TECH_MATERIAL = 4,
TECH_POWER = 3
)
req_components = list(
"/obj/item/stack/cable_coil" = 5,
"/obj/item/weapon/stock_parts/capacitor" = 1,
"/obj/item/stack/material/uranium" = 10
)
/obj/item/weapon/circuitboard/rtg/advanced
name = T_BOARD("advanced radioisotope thermoelectric generator")
build_path = /obj/machinery/power/rtg/advanced
origin_tech = list(
TECH_DATA = 3,
TECH_MATERIAL = 4,
TECH_POWER = 3,
TECH_ENGINEERING = 3,
TECH_PHORON = 3
)
req_components = list(
"/obj/item/stack/cable_coil" = 5,
"/obj/item/weapon/stock_parts/capacitor" = 1,
"/obj/item/weapon/stock_parts/micro_laser" = 1,
"/obj/item/stack/material/uranium" = 10,
"/obj/item/stack/material/phoron" = 5
)
+4
View File
@@ -0,0 +1,4 @@
author: Lohikar
delete-after: True
changes:
- rscadd: "Wires can now be placed on catwalks in space."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because it is too large Load Diff