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

Adds new monitoring and valve wires, capable of showing a powernet's power without a multitool and cutting off a powernet safelly #1558

Merged
merged 5 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 0 additions & 6 deletions code/modules/power/cable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
return ..()


/obj/structure/cable/examine(mob/user)
. = ..()
if(isobserver(user))
. += get_power_info()


/obj/structure/cable/proc/handlecable(obj/item/W, mob/user, params)
var/turf/T = get_turf(src)
if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE)
Expand Down
4 changes: 3 additions & 1 deletion code/modules/vending/youtool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
light_mask = "tool-light-mask"
products = list(
/obj/item/stack/cable_coil = 10,
/obj/item/stack/cable_coil/industrial = 3,
/obj/item/stack/cable_coil/industrial = 3, // MONKESTATION ADDITION
/obj/item/stack/cable_coil/monitoring = 5, // MONKESTATION ADDITION
/obj/item/stack/cable_coil/valve = 5, // MONKESTATION ADDITION
/obj/item/crowbar = 5,
/obj/item/weldingtool = 3,
/obj/item/wirecutters = 5,
Expand Down
Binary file modified icons/obj/power_cond/layer_cable.dmi
Binary file not shown.
110 changes: 110 additions & 0 deletions monkestation/code/modules/power/cables.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/obj/item/stack/cable_coil/monitoring
name = "electronic display cable coil" // only shows up in vendors
max_amount = 1
amount = 1
merge_type = /obj/item/stack/cable_coil/monitoring
target_type = /obj/structure/cable/monitoring
gender = FEMALE // yes i made your cable coil female

/obj/item/stack/cable_coil/monitoring/update_name()
. = ..()
name = "wire with an electronic display"

/obj/item/stack/cable_coil/monitoring/update_desc()
. = ..()
desc = "A piece of insulated power cable with an attached electronic display, allowing for quick and safe network power checking."

/obj/item/stack/cable_coil/monitoring/attack_self(mob/living/user)
return

/obj/structure/cable/monitoring
name = "cable with an attached electronic display"
desc = "A flexible, superconducting insulated cable for heavy-duty power transfer with an attached electronic display that is displaying its current power amount."
cable_color = CABLE_COLOR_CYAN
color = CABLE_COLOR_CYAN
gender = FEMALE // nothing wrong here

/obj/structure/cable/monitoring/examine(mob/user)
. = ..()
if(!isobserver(user)) // check if they are an observer, we dont want to double-dip
. += get_power_info()

/obj/structure/cable/monitoring/update_overlays()
. = ..()
. += "power_monitor"

/obj/structure/cable/monitoring/attack_hand(mob/living/user, list/modifiers)
to_chat(user, get_power_info())

/obj/structure/cable/monitoring/deconstruct(disassembled = TRUE)
to_chat(usr, span_notice("You start to carefully snip the electronic monitoring equipment..."))
if(!do_after(usr, 5 SECONDS, src))
to_chat(usr, span_warning("Your hand slips, and the monitoring equipment is destroyed!"))
do_sparks(5, TRUE, src)
playsound(usr, 'sound/effects/sparks2.ogg', 100, TRUE)
new /obj/item/stack/cable_coil(drop_location(), 1)
qdel(src) // those electronics are fragile
return

if(!(flags_1 & NODECONSTRUCT_1))
to_chat(usr, span_notice("You manage to free the monitoring equipment and cable free from the network."))
var/obj/item/stack/cable_coil/monitoring/cable = new(drop_location(), 1)
cable.set_cable_color(cable_color)

qdel(src)

/obj/item/stack/cable_coil/valve
name = "valve cable coil" // only shows up in vendors
max_amount = 1
amount = 1
merge_type = /obj/item/stack/cable_coil/valve
target_type = /obj/structure/cable/valve
gender = FEMALE // indeed, the cable coil is female

/obj/item/stack/cable_coil/valve/update_name()
. = ..()
name = "fuse wire"

/obj/item/stack/cable_coil/valve/update_desc()
. = ..()
desc = "A piece of insulated power cable thats capable of having its power flow stopped without risk of electrocution"

/obj/item/stack/cable_coil/valve/attack_self(mob/living/user)
return

/obj/structure/cable/valve
name = "a fuse wire"
desc = "A flexible, superconducting insulated cable for heavy-duty power transfer, this one is outfitted with special valve capabilities. Enabling for power to be disabled or enabled quickly and safelly."
cable_color = CABLE_COLOR_CYAN
color = CABLE_COLOR_CYAN
gender = FEMALE // seems about right
var/off_Layer = "industrial" // when off, we switch to the industrial cable tag. When ON we switch to the initial one
var/transmits_power = TRUE

/obj/structure/cable/valve/update_overlays()
. = ..()
if(transmits_power)
. += "power_on"
else
. += "power_off"

/obj/structure/cable/valve/attack_hand(mob/living/user, list/modifiers)
transmits_power = !transmits_power
balloon_alert_to_viewers("fuse [transmits_power ? "on" : "off"]")

if(transmits_power)
cable_tag = initial(cable_tag)
else
cable_tag = off_Layer

cut_cable_from_powernet(FALSE) // update the powernets
Connect_cable(TRUE)
auto_propagate_cut_cable(src)

update_appearance(UPDATE_OVERLAYS)

/obj/structure/cable/valve/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
var/obj/item/stack/cable_coil/valve/cable = new(drop_location(), 1)
cable.set_cable_color(cable_color)
qdel(src)
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6601,6 +6601,7 @@
#include "monkestation\code\modules\possession\basic_pixel_shift_editor.dm"
#include "monkestation\code\modules\possession\item_overrides.dm"
#include "monkestation\code\modules\possession\possessed_hud.dm"
#include "monkestation\code\modules\power\cables.dm"
#include "monkestation\code\modules\power\lighting\floor_light.dm"
#include "monkestation\code\modules\power\lighting\neon_lining.dm"
#include "monkestation\code\modules\power\power_transmission_laser\code\announcement.dm"
Expand Down
Loading