Station Blueprints now contain wire legend (#20559)

Added a submenu to the Station Blueprints that lists wire color purposes for the round for NT made items
Does not list duds
Removed WIRE_ELECTRIFY as it was synonymous with WIRE_SHOCK
This commit is contained in:
Cyberboss
2016-09-23 10:24:57 +12:00
committed by oranges
parent 5809a52d21
commit 96087dcf67
12 changed files with 107 additions and 56 deletions
+44 -44
View File
@@ -1,44 +1,44 @@
#define WIRE_ACTIVATE "activate"
#define WIRE_AI "ai"
#define WIRE_ALARM "alarm"
#define WIRE_AVOIDANCE "avoidance"
#define WIRE_BACKUP1 "backup1"
#define WIRE_BACKUP2 "backup2"
#define WIRE_BEACON "beacon"
#define WIRE_BOLTS "bolts"
#define WIRE_BOOM "boom"
#define WIRE_CAMERA "camera"
#define WIRE_CONTRABAND "contraband"
#define WIRE_DELAY "delay"
#define WIRE_DISABLE "disable"
#define WIRE_DISARM "disarm"
#define WIRE_ELECTRIFY "electrify"
#define WIRE_HACK "hack"
#define WIRE_IDSCAN "idscan"
#define WIRE_INTERFACE "interface"
#define WIRE_LAWSYNC "lawsync"
#define WIRE_LIGHT "light"
#define WIRE_LIMIT "limit"
#define WIRE_LOADCHECK "loadcheck"
#define WIRE_LOCKDOWN "lockdown"
#define WIRE_MOTOR1 "motor1"
#define WIRE_MOTOR2 "motor2"
#define WIRE_OPEN "open"
#define WIRE_PANIC "panic"
#define WIRE_POWER "power"
#define WIRE_POWER1 "power1"
#define WIRE_POWER2 "power2"
#define WIRE_PROCEED "proceed"
#define WIRE_RX "recieve"
#define WIRE_SAFETY "safety"
#define WIRE_SHOCK "shock"
#define WIRE_SIGNAL "signal"
#define WIRE_SPEAKER "speaker"
#define WIRE_STRENGTH "strength"
#define WIRE_THROW "throw"
#define WIRE_TIMING "timing"
#define WIRE_TX "transmit"
#define WIRE_UNBOLT "unbolt"
#define WIRE_ZAP "zap"
#define WIRE_ZAP1 "zap1"
#define WIRE_ZAP2 "zap2"
#define WIRE_DUD_PREFIX "__dud"
#define WIRE_ACTIVATE "Activate"
#define WIRE_AI "AI Connection"
#define WIRE_ALARM "Alarm"
#define WIRE_AVOIDANCE "Avoidance"
#define WIRE_BACKUP1 "Auxillary Power 1"
#define WIRE_BACKUP2 "Auxillary Power 2"
#define WIRE_BEACON "Beacon"
#define WIRE_BOLTS "Bolts"
#define WIRE_BOOM "Boom"
#define WIRE_CAMERA "Camera"
#define WIRE_CONTRABAND "Contraband"
#define WIRE_DELAY "Delay"
#define WIRE_DISABLE "Disable"
#define WIRE_DISARM "Disarm"
#define WIRE_HACK "Hack"
#define WIRE_IDSCAN "ID Scan"
#define WIRE_INTERFACE "Interface"
#define WIRE_LAWSYNC "AI Law Synchronization"
#define WIRE_LIGHT "Bolt Lights"
#define WIRE_LIMIT "Limiter"
#define WIRE_LOADCHECK "Load Check"
#define WIRE_LOCKDOWN "Lockdown"
#define WIRE_MOTOR1 "Motor 1"
#define WIRE_MOTOR2 "Motor 2"
#define WIRE_OPEN "Open"
#define WIRE_PANIC "Panic Siphon"
#define WIRE_POWER "Power"
#define WIRE_POWER1 "Main Power 1"
#define WIRE_POWER2 "Main Power 2"
#define WIRE_PROCEED "Proceed"
#define WIRE_RX "Recieve"
#define WIRE_SAFETY "Safety"
#define WIRE_SHOCK "High Voltage Ground"
#define WIRE_SIGNAL "Signal"
#define WIRE_SPEAKER "Speaker"
#define WIRE_STRENGTH "Strength"
#define WIRE_THROW "Throw"
#define WIRE_TIMING "Timing"
#define WIRE_TX "Transmit"
#define WIRE_UNBOLT "Unbolt"
#define WIRE_ZAP "High Voltage Circuit"
#define WIRE_ZAP1 "High Voltage Circuit 1"
#define WIRE_ZAP2 "High Voltage Circuit 2"
+1
View File
@@ -1,5 +1,6 @@
/datum/wires/airalarm
holder_type = /obj/machinery/airalarm
proper_name = "Air Alarm"
/datum/wires/airalarm/New(atom/holder)
wires = list(
+1
View File
@@ -1,5 +1,6 @@
/datum/wires/airlock
holder_type = /obj/machinery/door/airlock
proper_name = "Airlock"
/datum/wires/airlock/secure
randomize = TRUE
+1
View File
@@ -1,5 +1,6 @@
/datum/wires/apc
holder_type = /obj/machinery/power/apc
proper_name = "APC"
/datum/wires/apc/New(atom/holder)
wires = list(
+1
View File
@@ -1,5 +1,6 @@
/datum/wires/autolathe
holder_type = /obj/machinery/autolathe
proper_name = "Autolathe"
/datum/wires/autolathe/New(atom/holder)
wires = list(
+1
View File
@@ -14,6 +14,7 @@
/datum/wires/explosive/c4
holder_type = /obj/item/weapon/c4
randomize = TRUE //Same behaviour since no wire actually disarms it
/datum/wires/explosive/c4/interactable(mob/user)
var/obj/item/weapon/c4/P = holder
@@ -1,5 +1,6 @@
/datum/wires/particle_accelerator/control_box
holder_type = /obj/machinery/particle_accelerator/control_box
proper_name = "Particle Accelerator"
/datum/wires/particle_accelerator/control_box/New(atom/holder)
wires = list(
+1
View File
@@ -1,5 +1,6 @@
/datum/wires/radio
holder_type = /obj/item/device/radio
proper_name = "Radio"
/datum/wires/radio/New(atom/holder)
wires = list(
+1
View File
@@ -1,5 +1,6 @@
/datum/wires/suit_storage_unit
holder_type = /obj/machinery/suit_storage_unit
proper_name = "Suit Storage Unit"
/datum/wires/suit_storage_unit/New(atom/holder)
wires = list(
+4 -3
View File
@@ -1,9 +1,10 @@
/datum/wires/vending
holder_type = /obj/machinery/vending
proper_name = "Vending Unit"
/datum/wires/vending/New(atom/holder)
wires = list(
WIRE_THROW, WIRE_ELECTRIFY, WIRE_SPEAKER,
WIRE_THROW, WIRE_SHOCK, WIRE_SPEAKER,
WIRE_CONTRABAND, WIRE_IDSCAN
)
add_duds(1)
@@ -33,7 +34,7 @@
V.shoot_inventory = !V.shoot_inventory
if(WIRE_CONTRABAND)
V.extended_inventory = !V.extended_inventory
if(WIRE_ELECTRIFY)
if(WIRE_SHOCK)
V.seconds_electrified = 30
if(WIRE_IDSCAN)
V.scan_id = !V.scan_id
@@ -47,7 +48,7 @@
V.shoot_inventory = !mend
if(WIRE_CONTRABAND)
V.extended_inventory = FALSE
if(WIRE_ELECTRIFY)
if(WIRE_SHOCK)
if(mend)
V.seconds_electrified = FALSE
else
+5 -1
View File
@@ -17,6 +17,7 @@ var/list/wire_colors = list(
"yellow",
)
var/list/wire_color_directory = list()
var/list/wire_name_directory = list()
/proc/is_wire_tool(obj/item/I)
if(istype(I, /obj/item/device/multitool))
@@ -35,12 +36,14 @@ var/list/wire_color_directory = list()
/datum/wires
var/atom/holder = null // The holder (atom that contains these wires).
var/holder_type = null // The holder's typepath (used to make wire colors common to all holders).
var/proper_name = "Unknown" // The display name for the wire set shown in station blueprints. Not used if randomize is true or it's an item NT wouldn't know about (Explosives/Nuke)
var/list/wires = list() // List of wires.
var/list/cut_wires = list() // List of wires that have been cut.
var/list/colors = list() // Dictionary of colors to wire.
var/list/assemblies = list() // List of attached assemblies.
var/randomize = 0 // If every instance of these wires should be random.
// Prevents wires from showing up in station blueprints
/datum/wires/New(atom/holder)
..()
@@ -55,6 +58,7 @@ var/list/wire_color_directory = list()
if(!wire_color_directory[holder_type])
randomize()
wire_color_directory[holder_type] = colors
wire_name_directory[holder_type] = proper_name
else
colors = wire_color_directory[holder_type]
@@ -65,7 +69,7 @@ var/list/wire_color_directory = list()
/datum/wires/proc/add_duds(duds)
while(duds)
var/dud = "dud[--duds]"
var/dud = WIRE_DUD_PREFIX + "[--duds]"
if(dud in wires)
continue
wires += dud
+46 -8
View File
@@ -54,6 +54,7 @@
fluffnotice = "Property of Nanotrasen. For heads of staff only. Store in high-secure storage."
var/list/image/showing = list()
var/client/viewing
var/legend = FALSE //Viewing the wire legend
/obj/item/areaeditor/blueprints/Destroy()
@@ -63,15 +64,25 @@
/obj/item/areaeditor/blueprints/attack_self(mob/user)
. = ..()
var/area/A = get_area()
if(get_area_type() == AREA_STATION)
. += "<p>According to \the [src], you are now in <b>\"[html_encode(A.name)]\"</b>.</p>"
. += "<p>You may <a href='?src=\ref[src];edit_area=1'>make an amendment</a> to the drawing.</p>"
if(!viewing)
. += "<p><a href='?src=\ref[src];view_blueprints=1'>View structural data</a></p>"
if(!legend)
var/area/A = get_area()
if(get_area_type() == AREA_STATION)
. += "<p>According to \the [src], you are now in <b>\"[html_encode(A.name)]\"</b>.</p>"
. += "<p>You may <a href='?src=\ref[src];edit_area=1'>make an amendment</a> to the drawing.</p>"
. += "<p><a href='?src=\ref[src];view_legend=1'>View wire colour legend</a></p>"
if(!viewing)
. += "<p><a href='?src=\ref[src];view_blueprints=1'>View structural data</a></p>"
else
. += "<p><a href='?src=\ref[src];refresh=1'>Refresh structural data</a></p>"
. += "<p><a href='?src=\ref[src];hide_blueprints=1'>Hide structural data</a></p>"
else
. += "<p><a href='?src=\ref[src];refresh=1'>Refresh structural data</a></p>"
. += "<p><a href='?src=\ref[src];hide_blueprints=1'>Hide structural data</a></p>"
if(legend == TRUE)
. += "<a href='?src=\ref[src];exit_legend=1'><< Back</a>"
. += view_wire_devices(user);
else
//legend is a wireset
. += "<a href='?src=\ref[src];view_legend=1'><< Back</a>"
. += view_wire_set(user, legend)
var/datum/browser/popup = new(user, "blueprints", "[src]", 700, 500)
popup.set_content(.)
popup.open()
@@ -84,6 +95,12 @@
if(get_area_type()!=AREA_STATION)
return
edit_area()
if(href_list["exit_legend"])
legend = FALSE;
if(href_list["view_legend"])
legend = TRUE;
if(href_list["view_wireset"])
legend = href_list["view_wireset"];
if(href_list["view_blueprints"])
set_viewer(usr, "<span class='notice'>You flip the blueprints over to view the complex information diagram.</span>")
if(href_list["hide_blueprints"])
@@ -122,6 +139,7 @@
/obj/item/areaeditor/blueprints/dropped(mob/user)
..()
clear_viewer()
legend = FALSE
/obj/item/areaeditor/proc/get_area()
@@ -149,6 +167,26 @@
return AREA_SPECIAL
return AREA_STATION
/obj/item/areaeditor/blueprints/proc/view_wire_devices(mob/user)
var/message = "<br>You examine the wire legend.<br>"
for(var/wireset in wire_color_directory)
message += "<br><a href='?src=\ref[src];view_wireset=[wireset]'>[wire_name_directory[wireset]]</a>"
message += "</p>"
return message
/obj/item/areaeditor/blueprints/proc/view_wire_set(mob/user, wireset)
//for some reason you can't use wireset directly as a derefencer so this is the next best :/
for(var/device in wire_color_directory)
if("[device]" == wireset) //I know... don't change it...
var/message = "<p><b>[wire_name_directory[device]]:</b>"
for(var/Col in wire_color_directory[device])
var/wire_name = wire_color_directory[device][Col]
if(!findtext(wire_name, WIRE_DUD_PREFIX)) //don't show duds
message += "<p><span style='color: [Col]'>[Col]</span>: [wire_name]</p>"
message += "</p>"
return message
return ""
/proc/create_area(mob/living/creator)
var/res = detect_room(get_turf(creator))
if(!istype(res,/list))