bluespace pipe dispenser and sprite previews, isn't it nice?

This commit is contained in:
Enric Gabriel
2020-07-02 00:13:08 -03:00
parent c8ff8d1a6f
commit e18a47ca8a
17 changed files with 295 additions and 11 deletions

BIN
.vs/slnx.sqlite Normal file

Binary file not shown.

View File

@@ -2,6 +2,7 @@
"recommendations": [
"gbasood.byond-dm-language-support",
"platymuus.dm-langclient",
"EditorConfig.EditorConfig"
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint"
]
}

View File

@@ -12,7 +12,6 @@ RPD
#define DESTROY_MODE (1<<2)
#define PAINT_MODE (1<<3)
GLOBAL_LIST_INIT(atmos_pipe_recipes, list(
"Pipes" = list(
new /datum/pipe_info/pipe("Pipe", /obj/machinery/atmospherics/pipe/simple),
@@ -175,6 +174,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(dt == PIPE_UNARY_FLIPPABLE)
icon_state = "[icon_state]_preview"
// SKYRAT CHANGE: Made BSRPD into a subtype of RPD, additionally made it work at range.
/obj/item/pipe_dispenser
name = "Rapid Piping Device (RPD)"
desc = "A device used to rapidly pipe things."
@@ -209,6 +209,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
var/static/datum/pipe_info/first_disposal
var/static/datum/pipe_info/first_transit
var/mode = BUILD_MODE | DESTROY_MODE | WRENCH_MODE
var/has_bluespace_pipe = FALSE // Skyrat
/obj/item/pipe_dispenser/New()
. = ..()
@@ -266,7 +267,10 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
var/list/recipes
switch(category)
if(ATMOS_CATEGORY)
recipes = GLOB.atmos_pipe_recipes
if(has_bluespace_pipe) // stupid skyrat edit
recipes = GLOB.bsatmos_pipe_recipes
else
recipes = GLOB.atmos_pipe_recipes
if(DISPOSALS_CATEGORY)
recipes = GLOB.disposal_pipe_recipes
if(TRANSIT_CATEGORY)
@@ -307,7 +311,10 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if("pipe_type")
var/static/list/recipes
if(!recipes)
recipes = GLOB.disposal_pipe_recipes + GLOB.atmos_pipe_recipes + GLOB.transit_tube_recipes
if(has_bluespace_pipe) // skyrat hack
recipes = GLOB.disposal_pipe_recipes + GLOB.bsatmos_pipe_recipes + GLOB.transit_tube_recipes
else
recipes = GLOB.disposal_pipe_recipes + GLOB.atmos_pipe_recipes + GLOB.transit_tube_recipes
recipe = recipes[params["category"]][text2num(params["pipe_type"])]
p_dir = NORTH
if("setdir")
@@ -327,10 +334,13 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
return TRUE
/obj/item/pipe_dispenser/pre_attack(atom/A, mob/user)
/obj/item/pipe_dispenser/pre_attack(atom/A, mob/user) // Skyrat: All functionality moved to proc/dispense
dispense(A, user)
/obj/item/pipe_dispenser/proc/dispense(atom/A, mob/user)
var/turf/T = get_turf(A)
if(!user.IsAdvancedToolUser() || !T || istype(T, /turf/open/space/transit) || isindestructiblewall(T))
return ..()
return
//So that changing the menu settings doesn't affect the pipes already being built.
var/queued_p_type = recipe.id
@@ -377,7 +387,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
switch(category) //if we've gotten this var, the target is valid
if(ATMOS_CATEGORY) //Making pipes
if(!can_make_pipe)
return ..()
return
A = T
if(is_type_in_typecache(recipe, GLOB.ventcrawl_machinery) && isclosedturf(A)) //wall escapism sanity check.
to_chat(user, "<span class='warning'>[src]'s error light flickers; there's something in the way!</span>")
@@ -413,7 +423,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(DISPOSALS_CATEGORY) //Making disposals pipes
if(!can_make_pipe)
return ..()
return
A = T
if(isclosedturf(A))
to_chat(user, "<span class='warning'>[src]'s error light flickers; there's something in the way!</span>")
@@ -438,7 +448,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(TRANSIT_CATEGORY) //Making transit tubes
if(!can_make_pipe)
return ..()
return
A = T
if(isclosedturf(A))
to_chat(user, "<span class='warning'>[src]'s error light flickers; there's something in the way!</span>")
@@ -471,7 +481,8 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
return
else
return ..()
return
// End skyrat edit
/obj/item/pipe_dispenser/proc/activate()
playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1)

View File

@@ -5,6 +5,9 @@
/obj/structure/closet/secure_closet/engineering_chief/PopulateContents()
..()
//SKYRAT EDIT - ATMS
new /obj/item/pipe_dispenser/bluespace(src) // SKYRAT: CE gets BPRPD instead of RPD, since they start with all other power tools too
//SKYRAT EDIT END
new /obj/item/clothing/neck/cloak/ce(src)
new /obj/item/clothing/head/beret/ce(src)
new /obj/item/clothing/under/rank/engineering/chief_engineer(src)
@@ -21,7 +24,6 @@
new /obj/item/assembly/flash/handheld(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/door_remote/chief_engineer(src)
new /obj/item/pipe_dispenser(src)
new /obj/item/inducer(src)
new /obj/item/circuitboard/machine/techfab/department/engineering(src)
new /obj/item/extinguisher/advanced(src)

View File

@@ -0,0 +1,24 @@
/obj/item/pipe/bluespace
pipe_type = /obj/machinery/atmospherics/pipe/bluespace
var/bluespace_network_name = "default"
icon_state = "bluespace"
desc = "Transmits gas across large distances of space. Developed using bluespace technology. Use a multitool on it to set its network."
/obj/item/pipe/bluespace/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/multitool))
var/new_name = input(user, "Enter identifier for bluespace pipe network", "bluespace pipe", bluespace_network_name) as text|null
if(!isnull(new_name))
bluespace_network_name = new_name
else
return
/obj/item/pipe/bluespace/make_from_existing(obj/machinery/atmospherics/pipe/bluespace/make_from)
bluespace_network_name = make_from.bluespace_network_name
return ..()
/obj/item/pipe/bluespace/build_pipe(obj/machinery/atmospherics/pipe/bluespace/A)
A.bluespace_network_name = bluespace_network_name
return ..()
/obj/item/pipe/bluespace/directional
RPD_type = PIPE_UNARY

View File

@@ -0,0 +1,76 @@
/*
CONTAINS:
BSRPD
*/
#define ATMOS_CATEGORY 0
#define DISPOSALS_CATEGORY 1
#define TRANSIT_CATEGORY 2
#define BUILD_MODE (1<<0)
#define WRENCH_MODE (1<<1)
#define DESTROY_MODE (1<<2)
#define PAINT_MODE (1<<3)
GLOBAL_LIST_INIT(bsatmos_pipe_recipes, list(
"Pipes" = list(
new /datum/pipe_info/pipe("Pipe", /obj/machinery/atmospherics/pipe/simple),
new /datum/pipe_info/pipe("Manifold", /obj/machinery/atmospherics/pipe/manifold),
new /datum/pipe_info/pipe("4-Way Manifold", /obj/machinery/atmospherics/pipe/manifold4w),
new /datum/pipe_info/pipe("Layer Manifold", /obj/machinery/atmospherics/pipe/layer_manifold),
new /datum/pipe_info/pipe("Bluespace Pipe", /obj/machinery/atmospherics/pipe/bluespace),
),
"Devices" = list(
new /datum/pipe_info/pipe("Connector", /obj/machinery/atmospherics/components/unary/portables_connector),
new /datum/pipe_info/pipe("Gas Pump", /obj/machinery/atmospherics/components/binary/pump),
new /datum/pipe_info/pipe("Volume Pump", /obj/machinery/atmospherics/components/binary/volume_pump),
new /datum/pipe_info/pipe("Gas Filter", /obj/machinery/atmospherics/components/trinary/filter),
new /datum/pipe_info/pipe("Gas Mixer", /obj/machinery/atmospherics/components/trinary/mixer),
new /datum/pipe_info/pipe("Passive Gate", /obj/machinery/atmospherics/components/binary/passive_gate),
new /datum/pipe_info/pipe("Injector", /obj/machinery/atmospherics/components/unary/outlet_injector),
new /datum/pipe_info/pipe("Scrubber", /obj/machinery/atmospherics/components/unary/vent_scrubber),
new /datum/pipe_info/pipe("Unary Vent", /obj/machinery/atmospherics/components/unary/vent_pump),
new /datum/pipe_info/pipe("Passive Vent", /obj/machinery/atmospherics/components/unary/passive_vent),
new /datum/pipe_info/pipe("Manual Valve", /obj/machinery/atmospherics/components/binary/valve),
new /datum/pipe_info/pipe("Digital Valve", /obj/machinery/atmospherics/components/binary/valve/digital),
new /datum/pipe_info/pipe("Relief Valve (Binary)", /obj/machinery/atmospherics/components/binary/relief_valve),
new /datum/pipe_info/pipe("Relief Valve (Unary)", /obj/machinery/atmospherics/components/unary/relief_valve),
new /datum/pipe_info/meter("Meter"),
),
"Heat Exchange" = list(
new /datum/pipe_info/pipe("Pipe", /obj/machinery/atmospherics/pipe/heat_exchanging/simple),
new /datum/pipe_info/pipe("Manifold", /obj/machinery/atmospherics/pipe/heat_exchanging/manifold),
new /datum/pipe_info/pipe("4-Way Manifold", /obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w),
new /datum/pipe_info/pipe("Junction", /obj/machinery/atmospherics/pipe/heat_exchanging/junction),
new /datum/pipe_info/pipe("Heat Exchanger", /obj/machinery/atmospherics/components/unary/heat_exchanger),
)
))
// SKYRAT CHANGE: Made BSRPD into a subtype of RPD, additionally made it work at range.
/obj/item/pipe_dispenser/bluespace
name = "Bluespace Rapid Piping Device (BSRPD)"
desc = "A device used to rapidly pipe things at a distance."
icon = 'sandcode/icons/obj/tools.dmi'
icon_state = "bsrpd"
lefthand_file = 'sandcode/icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'sandcode/icons/mob/inhands/equipment/tools_righthand.dmi'
custom_materials = list(/datum/material/iron=75000, /datum/material/glass=37500, /datum/material/bluespace=1000)
has_bluespace_pipe = TRUE
/obj/item/pipe_dispenser/bluespace/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
if(proximity_flag)
return // this will be handled in pre_attack in RPD.dm
user.Beam(target, icon_state = "rped_upgrade", time = 5)
playsound(src, 'sound/items/pshoom.ogg', 30, TRUE)
dispense(target, user)
// End skyrat edit
#undef ATMOS_CATEGORY
#undef DISPOSALS_CATEGORY
#undef TRANSIT_CATEGORY
#undef BUILD_MODE
#undef DESTROY_MODE
#undef PAINT_MODE
#undef WRENCH_MODE

View File

@@ -0,0 +1,34 @@
/obj/item/borg/upgrade/bsrpd
name = "engineering cyborg bluespace RPD"
desc = "A bluespace RPD replacement for the engineering module's standard RPD."
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = list(/obj/item/robot_module/engineering)
/obj/item/borg/upgrade/bsrpd/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/pipe_dispenser/PD = locate() in R
var/obj/item/pipe_dispenser/bluespace/BD = locate() in R // Skyrat edit
if(!PD)
PD = locate() in R.module
if(!BD)
BD = locate() in R.module //There's gotta be a smarter way to do this.
if(BD)
to_chat(user, "<span class='warning'>This unit is already equipped with a BSRPD module.</span>")
return FALSE
BD = new(R.module)
qdel(PD)
R.module.basic_modules += BD
R.module.add_module(BD, FALSE, TRUE)
/obj/item/borg/upgrade/bsrpd/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/pipe_dispenser/bluespace/BD in R.module) // Skyrat edit
R.module.remove_module(BD, TRUE)
var/obj/item/pipe_dispenser/PD = new (R.module)
R.module.basic_modules += PD
R.module.add_module(PD, FALSE, TRUE)

View File

@@ -0,0 +1,103 @@
GLOBAL_LIST_EMPTY(bluespace_pipe_networks)
/obj/machinery/atmospherics/pipe/bluespace
name = "bluespace pipe"
desc = "Transmits gas across large distances of space. Developed using bluespace technology. Use a multitool on it to set its network."
icon = 'sandcode/icons/obj/atmospherics/pipes/bluespace.dmi'
icon_state = "blue_map-2"
pipe_state = "bluespace"
dir = SOUTH
initialize_directions = SOUTH
device_type = UNARY
can_buckle = FALSE
construction_type = /obj/item/pipe/bluespace/directional
var/bluespace_network_name
/obj/machinery/atmospherics/pipe/bluespace/New()
icon_state = "map"
if(bluespace_network_name) // in case someone maps one in for some reason
if(!GLOB.bluespace_pipe_networks[bluespace_network_name])
GLOB.bluespace_pipe_networks[bluespace_network_name] = list()
GLOB.bluespace_pipe_networks[bluespace_network_name] |= src
..()
/obj/machinery/atmospherics/pipe/bluespace/on_construction()
. = ..()
if(bluespace_network_name)
if(!GLOB.bluespace_pipe_networks[bluespace_network_name])
GLOB.bluespace_pipe_networks[bluespace_network_name] = list()
GLOB.bluespace_pipe_networks[bluespace_network_name] |= src
/obj/machinery/atmospherics/pipe/bluespace/Destroy()
if(GLOB.bluespace_pipe_networks[bluespace_network_name])
GLOB.bluespace_pipe_networks[bluespace_network_name] -= src
for(var/p in GLOB.bluespace_pipe_networks[bluespace_network_name])
var/obj/machinery/atmospherics/pipe/bluespace/P = p
QDEL_NULL(P.parent)
P.build_network()
return ..()
/obj/machinery/atmospherics/pipe/bluespace/examine(user)
. = ..()
to_chat(user, "<span class='notice'>This one is connected to the \"[html_encode(bluespace_network_name)]\" network</span>")
/obj/machinery/atmospherics/pipe/bluespace/SetInitDirections()
initialize_directions = dir
/obj/machinery/atmospherics/pipe/bluespace/pipeline_expansion()
return ..() + GLOB.bluespace_pipe_networks[bluespace_network_name] - src
/obj/machinery/atmospherics/pipe/bluespace/hide()
update_icon()
/obj/machinery/atmospherics/pipe/bluespace/update_icon(showpipe)
underlays.Cut()
var/turf/T = loc
if(level == 2 || !T.intact)
icon_state = "blue_map-2"
showpipe = TRUE
plane = GAME_PLANE
else
showpipe = FALSE
plane = FLOOR_PLANE
if(!showpipe)
return //no need to update the pipes if they aren't showing
/* This shit aint in here
var/connected = 0 //Direction bitset
for(var/i in 1 to device_type) //adds intact pieces
if(nodes[i])
connected |= icon_addintact(nodes[i])
icon_addbroken(connected) //adds broken pieces//adds broken pieces
*/
if(piping_layer == 1)
icon_state = "blue_map-1"
else if(piping_layer == 2)
icon_state = "blue_map-2"
else if(piping_layer == 3)
icon_state = "blue_map-3"
/obj/machinery/atmospherics/pipe/bluespace/paint()
return FALSE
/obj/machinery/atmospherics/pipe/bluespace/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/multitool))
var/new_name = input(user, "Enter identifier for bluespace pipe network", "bluespace pipe", bluespace_network_name) as text|null
if(!isnull(new_name))
bluespace_network_name = new_name
else
return
/obj/machinery/atmospherics/pipe/bluespace/layer1
piping_layer = 1
icon_state = "blue_map-1"
/obj/machinery/atmospherics/pipe/bluespace/layer2
piping_layer = 2
icon_state = "blue_map-2"
/obj/machinery/atmospherics/pipe/bluespace/layer3
piping_layer = 3
icon_state = "blue_map-3"

View File

@@ -0,0 +1,8 @@
/datum/design/borg_upgrade_bsrpd
name = "Cyborg Upgrade (Bluespace RPD)"
id = "borg_upgrade_bsrpd"
build_type = MECHFAB
build_path = /obj/item/borg/upgrade/bsrpd
materials = list(/datum/material/iron = 1000, /datum/material/glass = 1000, /datum/material/bluespace = 500)
construction_time = 100
category = list("Cyborg Upgrade Modules")

View File

@@ -0,0 +1,9 @@
/datum/design/bsrpd
name = "Bluespace Rapid Pipe Dispenser"
desc = "A tool that can construct and deconstruct pipes on the fly."
id = "bsrpd"
build_type = PROTOLATHE
materials = list(/datum/material/iron = 75000, /datum/material/glass = 37500, /datum/material/bluespace = 1000)
build_path = /obj/item/pipe_dispenser/bluespace // Skyrat edit
category = list("Tool Designs")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING

View File

@@ -46,3 +46,8 @@
prereq_ids = list("alien_bio")
design_ids = list("ci-toolset-adv","ci-surgery-adv")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000)
/datum/techweb_node/bluespace_portal/New()
design_ids += "borg_upgrade_bsrpd"
design_ids += "bsrpd"
. = ..()

View File

@@ -0,0 +1,4 @@
/datum/techweb_node/bluespace_portal/New()
design_ids += "borg_upgrade_bsrpd"
design_ids += "bsrpd"
. = ..()

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -3495,14 +3495,18 @@
#include "sandcode\code\datums\traits\negative.dm"
#include "sandcode\code\datums\traits\neutral.dm"
#include "sandcode\code\game\area\ship_area.dm"
#include "sandcode\code\game\machinery\pipe\construction.dm"
#include "sandcode\code\game\mecha\mech_fabricator.dm"
#include "sandcode\code\game\objects\effects\contraband.dm"
#include "sandcode\code\game\objects\items\BSRPD.dm"
#include "sandcode\code\game\objects\items\circuitboards\computer_circuitboards.dm"
#include "sandcode\code\game\objects\items\circuitboards\machine_circuitboards.dm"
#include "sandcode\code\game\objects\items\devices\extra_arm.dm"
#include "sandcode\code\game\objects\items\devices\floor_painter.dm"
#include "sandcode\code\game\objects\items\robot\robot_upgrades.dm"
#include "sandcode\code\game\objects\items\storage\backpack.dm"
#include "sandcode\code\game\objects\items\storage\bags.dm"
#include "sandcode\code\modules\atmospherics\machinery\pipes\bluespace.dm"
#include "sandcode\code\modules\cargo\packs\emergency.dm"
#include "sandcode\code\modules\clothing\masks\miscellaneous.dm"
#include "sandcode\code\modules\crafting\recipes\recipes_misc.dm"
@@ -3520,9 +3524,12 @@
#include "sandcode\code\modules\research\designs\autolathe_designs.dm"
#include "sandcode\code\modules\research\designs\biogenerator_designs.dm"
#include "sandcode\code\modules\research\designs\machine_designs.dm"
#include "sandcode\code\modules\research\designs\mechfabricator_designs.dm"
#include "sandcode\code\modules\research\designs\misc_designs.dm"
#include "sandcode\code\modules\research\designs\tool_designs.dm"
#include "sandcode\code\modules\research\designs\weapon_designs.dm"
#include "sandcode\code\modules\research\techweb\all_nodes.dm"
#include "sandcode\code\modules\research\techweb\bluespace_nodes.dm"
#include "sandcode\code\modules\shuttle\spaceship_navigation_beacon.dm"
#include "sandcode\code\modules\spells\spell_types\shapeshift.dm"
#include "sandcode\code\modules\surgery\organs\augments_arms.dm"