Skip to content

Commit

Permalink
Расширенное изучение проводов (#330)
Browse files Browse the repository at this point in the history
* feature: add time for wire check

Adds a slight delay before examining the wire.
It depends on the knowledge of electronics.

* Trained and less: 3 seconds
* Experienced: 1.5 second
* Master: 0.5 second

* tweak: Adjust the requirements for wire examine

Corrects the requirements for the study of wires of various techniques.
  • Loading branch information
SidVeld committed Aug 5, 2023
1 parent 0b36b1c commit 974ae65
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 59 deletions.
22 changes: 11 additions & 11 deletions code/datums/wires/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
window_y = 570
descriptions = list(
new /datum/wire_description(AIRLOCK_WIRE_IDSCAN, "This wire is connected to the ID scanning panel.", SKILL_EXPERT),
new /datum/wire_description(AIRLOCK_WIRE_MAIN_POWER1, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(AIRLOCK_WIRE_MAIN_POWER2, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(AIRLOCK_WIRE_DOOR_BOLTS, "This wire runs down to the very base of the airlock."),
new /datum/wire_description(AIRLOCK_WIRE_BACKUP_POWER1, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(AIRLOCK_WIRE_BACKUP_POWER2, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(AIRLOCK_WIRE_OPEN_DOOR, "This wire connects to the door motors."),
new /datum/wire_description(AIRLOCK_WIRE_AI_CONTROL, "This wire connects to automated control systems."),
new /datum/wire_description(AIRLOCK_WIRE_ELECTRIFY, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(AIRLOCK_WIRE_SAFETY, "This wire connects to a safety override."),
new /datum/wire_description(AIRLOCK_WIRE_SPEED, "This wire appears to connect to the airlock's proximity detector modules."),
new /datum/wire_description(AIRLOCK_WIRE_MAIN_POWER1, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(AIRLOCK_WIRE_MAIN_POWER2, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(AIRLOCK_WIRE_DOOR_BOLTS, "This wire runs down to the very base of the airlock.", SKILL_EXPERT),
new /datum/wire_description(AIRLOCK_WIRE_BACKUP_POWER1, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(AIRLOCK_WIRE_BACKUP_POWER2, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(AIRLOCK_WIRE_OPEN_DOOR, "This wire connects to the door motors.", SKILL_EXPERT),
new /datum/wire_description(AIRLOCK_WIRE_AI_CONTROL, "This wire connects to automated control systems.", SKILL_PROF),
new /datum/wire_description(AIRLOCK_WIRE_ELECTRIFY, "This wire seems to be carrying a heavy current.", SKILL_PROF),
new /datum/wire_description(AIRLOCK_WIRE_SAFETY, "This wire connects to a safety override.", SKILL_PROF),
new /datum/wire_description(AIRLOCK_WIRE_SPEED, "This wire appears to connect to the airlock's proximity detector modules.", SKILL_PROF),
new /datum/wire_description(AIRLOCK_WIRE_LIGHT, "This wire powers the airlock's built-in lighting.", SKILL_EXPERT)
)

Expand Down Expand Up @@ -187,4 +187,4 @@ var/global/const/AIRLOCK_WIRE_LIGHT = 2048

if(AIRLOCK_WIRE_LIGHT)
A.lights = !A.lights
A.update_icon()
A.update_icon()
10 changes: 5 additions & 5 deletions code/datums/wires/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
wire_count = 5
descriptions = list(
new /datum/wire_description(AALARM_WIRE_IDSCAN, "This wire is connected to the ID scanning panel.", SKILL_EXPERT),
new /datum/wire_description(AALARM_WIRE_POWER, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(AALARM_WIRE_SYPHON, "This wire runs to atmospherics logic circuits of some sort."),
new /datum/wire_description(AALARM_WIRE_AI_CONTROL, "This wire connects to automated control systems."),
new /datum/wire_description(AALARM_WIRE_AALARM, "This wire gives power to the actual alarm mechanism.")
new /datum/wire_description(AALARM_WIRE_POWER, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(AALARM_WIRE_SYPHON, "This wire runs to atmospherics logic circuits of some sort.", SKILL_PROF),
new /datum/wire_description(AALARM_WIRE_AI_CONTROL, "This wire connects to automated control systems.", SKILL_PROF),
new /datum/wire_description(AALARM_WIRE_AALARM, "This wire gives power to the actual alarm mechanism.", SKILL_PROF)
)

var/global/const/AALARM_WIRE_IDSCAN = 1
Expand Down Expand Up @@ -106,4 +106,4 @@ var/global/const/AALARM_WIRE_AALARM = 16

if (A.alarm_area.atmosalert(0, A))
A.post_alert(0)
A.update_icon()
A.update_icon()
10 changes: 5 additions & 5 deletions code/datums/wires/apc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

/datum/wires/apc
holder_type = /obj/machinery/power/apc
wire_count = 4
wire_count = 4
descriptions = list(
new /datum/wire_description(APC_WIRE_IDSCAN, "This wire is connected to the ID scanning panel.", SKILL_EXPERT),
new /datum/wire_description(APC_WIRE_MAIN_POWER1, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(APC_WIRE_MAIN_POWER2, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(APC_WIRE_AI_CONTROL, "This wire connects to automated control systems.")
new /datum/wire_description(APC_WIRE_MAIN_POWER1, "This wire seems to be carrying a heavy current.", SKILL_PROF),
new /datum/wire_description(APC_WIRE_MAIN_POWER2, "This wire seems to be carrying a heavy current.", SKILL_PROF),
new /datum/wire_description(APC_WIRE_AI_CONTROL, "This wire connects to automated control systems.", SKILL_PROF)
)

/datum/wires/apc/GetInteractWindow(mob/user)
Expand Down Expand Up @@ -75,4 +75,4 @@
A.aidisabled = 1
else
if (A.aidisabled == 1)
A.aidisabled = 0
A.aidisabled = 0
8 changes: 4 additions & 4 deletions code/datums/wires/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
holder_type = /obj/machinery/camera
wire_count = 6
descriptions = list(
new /datum/wire_description(CAMERA_WIRE_FOCUS, "This wire runs to the camera's lens adjustment motors."),
new /datum/wire_description(CAMERA_WIRE_POWER, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(CAMERA_WIRE_FOCUS, "This wire runs to the camera's lens adjustment motors.", SKILL_PROF),
new /datum/wire_description(CAMERA_WIRE_POWER, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(CAMERA_WIRE_LIGHT, "This wire seems connected to the built-in light.", SKILL_EXPERT),
new /datum/wire_description(CAMERA_WIRE_ALARM, "This wire is connected to a remote signaling device of some sort.")
new /datum/wire_description(CAMERA_WIRE_ALARM, "This wire is connected to a remote signaling device of some sort.", SKILL_PROF)
)

/datum/wires/camera/GetInteractWindow(mob/user)
Expand Down Expand Up @@ -74,4 +74,4 @@ var/global/const/CAMERA_WIRE_NOTHING2 = 32
if(IsIndexCut(CAMERA_WIRE_POWER) && IsIndexCut(CAMERA_WIRE_FOCUS) && IsIndexCut(CAMERA_WIRE_LIGHT) && IsIndexCut(CAMERA_WIRE_NOTHING1) && IsIndexCut(CAMERA_WIRE_NOTHING2))
return 1
else
return 0
return 0
4 changes: 2 additions & 2 deletions code/datums/wires/fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
holder_type = /obj/machinery/fabricator
wire_count = 6
descriptions = list(
new /datum/wire_description(AUTOLATHE_HACK_WIRE, "This wire appears to lead to an auxiliary data storage unit."),
new /datum/wire_description(AUTOLATHE_SHOCK_WIRE, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(AUTOLATHE_HACK_WIRE, "This wire appears to lead to an auxiliary data storage unit.", SKILL_EXPERT),
new /datum/wire_description(AUTOLATHE_SHOCK_WIRE, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(AUTOLATHE_DISABLE_WIRE, "This wire is connected to the power switch.", SKILL_EXPERT)
)

Expand Down
6 changes: 3 additions & 3 deletions code/datums/wires/nuclearbomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
wire_count = 7
descriptions = list(
new /datum/wire_description(NUCLEARBOMB_WIRE_LIGHT, "This wire seems to connect to the small light on the device.", SKILL_EXPERT),
new /datum/wire_description(NUCLEARBOMB_WIRE_TIMING, "This wire connects to the time display."),
new /datum/wire_description(NUCLEARBOMB_WIRE_SAFETY, "This wire connects to a safety override.")
new /datum/wire_description(NUCLEARBOMB_WIRE_TIMING, "This wire connects to the time display.", SKILL_PROF),
new /datum/wire_description(NUCLEARBOMB_WIRE_SAFETY, "This wire connects to a safety override.", SKILL_PROF)
)

var/global/const/NUCLEARBOMB_WIRE_LIGHT = 1
Expand Down Expand Up @@ -60,4 +60,4 @@ var/global/const/NUCLEARBOMB_WIRE_SAFETY = 4
N.secure_device()
if(NUCLEARBOMB_WIRE_LIGHT)
N.lighthack = !mended
N.update_icon()
N.update_icon()
8 changes: 4 additions & 4 deletions code/datums/wires/particle_accelerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
holder_type = /obj/machinery/particle_accelerator/control_box
descriptions = list(
new /datum/wire_description(PARTICLE_TOGGLE_WIRE, "This wire seems to connect to the main power toggle.", SKILL_EXPERT),
new /datum/wire_description(PARTICLE_STRENGTH_WIRE, "This wire connects to the primary magnets."),
new /datum/wire_description(PARTICLE_INTERFACE_WIRE, "This wire appears connected to the user panel."),
new /datum/wire_description(PARTICLE_LIMIT_POWER_WIRE, "This wire connects to the primary magnets.")
new /datum/wire_description(PARTICLE_STRENGTH_WIRE, "This wire connects to the primary magnets.", SKILL_PROF),
new /datum/wire_description(PARTICLE_INTERFACE_WIRE, "This wire appears connected to the user panel.", SKILL_EXPERT),
new /datum/wire_description(PARTICLE_LIMIT_POWER_WIRE, "This wire connects to the primary magnets.", , SKILL_PROF)
)

var/global/const/PARTICLE_TOGGLE_WIRE = 1 // Toggles whether the PA is on or not.
Expand Down Expand Up @@ -55,4 +55,4 @@ var/global/const/PARTICLE_LIMIT_POWER_WIRE = 8 // Determines how strong the PA c
if(PARTICLE_LIMIT_POWER_WIRE)
C.strength_upper_limit = (mended ? 2 : 3)
if(C.strength_upper_limit < C.strength)
C.remove_strength()
C.remove_strength()
6 changes: 3 additions & 3 deletions code/datums/wires/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
holder_type = /obj/item/device/radio
wire_count = 3
descriptions = list(
new /datum/wire_description(WIRE_SIGNAL, "This wire connects several radio components."),
new /datum/wire_description(WIRE_SIGNAL, "This wire connects several radio components.", SKILL_EXPERT),
new /datum/wire_description(WIRE_RECEIVE, "This wire runs to the radio reciever.", SKILL_EXPERT),
new /datum/wire_description(WIRE_TRANSMIT, "This wire runs to the radio transmitter.")
new /datum/wire_description(WIRE_TRANSMIT, "This wire runs to the radio transmitter.", SKILL_EXPERT)
)

var/global/const/WIRE_SIGNAL = 1
Expand Down Expand Up @@ -49,4 +49,4 @@ var/global/const/WIRE_TRANSMIT = 4

if(WIRE_TRANSMIT)
R.broadcasting = mended && !IsIndexCut(WIRE_SIGNAL)
SSnano.update_uis(holder)
SSnano.update_uis(holder)
10 changes: 5 additions & 5 deletions code/datums/wires/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
holder_type = /mob/living/silicon/robot
wire_count = 5
descriptions = list(
new /datum/wire_description(BORG_WIRE_LAWCHECK, "This wire runs to the unit's law module."),
new /datum/wire_description(BORG_WIRE_LAWCHECK, "This wire runs to the unit's law module.", SKILL_PROF),
new /datum/wire_description(BORG_WIRE_MAIN_POWER, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(BORG_WIRE_LOCKED_DOWN, "This wire connects to the unit's safety override."),
new /datum/wire_description(BORG_WIRE_AI_CONTROL, "This wire connects to automated control systems."),
new /datum/wire_description(BORG_WIRE_CAMERA, "This wire runs to the unit's vision modules.")
new /datum/wire_description(BORG_WIRE_LOCKED_DOWN, "This wire connects to the unit's safety override.", SKILL_PROF),
new /datum/wire_description(BORG_WIRE_AI_CONTROL, "This wire connects to automated control systems.", SKILL_PROF),
new /datum/wire_description(BORG_WIRE_CAMERA, "This wire runs to the unit's vision modules.", SKILL_PROF)
)

var/global/const/BORG_WIRE_LAWCHECK = 1
Expand Down Expand Up @@ -77,4 +77,4 @@ var/global/const/BORG_WIRE_CAMERA = 16
return wires_status & BORG_WIRE_CAMERA

/datum/wires/robot/proc/LockedCut()
return wires_status & BORG_WIRE_LOCKED_DOWN
return wires_status & BORG_WIRE_LOCKED_DOWN
8 changes: 4 additions & 4 deletions code/datums/wires/shield_generator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
wire_count = 5
descriptions = list(
new /datum/wire_description(SHIELDGEN_WIRE_POWER, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(SHIELDGEN_WIRE_HACK, "This wire seems designed to enable a manual override."),
new /datum/wire_description(SHIELDGEN_WIRE_CONTROL, "This wire connects to the main control panel."),
new /datum/wire_description(SHIELDGEN_WIRE_AICONTROL, "This wire connects to automated control systems.")
new /datum/wire_description(SHIELDGEN_WIRE_HACK, "This wire seems designed to enable a manual override.", SKILL_PROF),
new /datum/wire_description(SHIELDGEN_WIRE_CONTROL, "This wire connects to the main control panel.", SKILL_PROF),
new /datum/wire_description(SHIELDGEN_WIRE_AICONTROL, "This wire connects to automated control systems.", SKILL_PROF)
)

var/global/const/SHIELDGEN_WIRE_POWER = 1 // Cut to disable power input into the generator. Pulse does nothing. Mend to restore.
Expand Down Expand Up @@ -41,4 +41,4 @@ var/global/const/SHIELDGEN_WIRE_NOTHING = 16 // A blank wire that doesn't have
var/obj/machinery/power/shield_generator/S = holder
switch(index)
if(SHIELDGEN_WIRE_HACK)
S.hacked = 1
S.hacked = 1
6 changes: 3 additions & 3 deletions code/datums/wires/smartfridge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
holder_type = /obj/machinery/smartfridge
wire_count = 3
descriptions = list(
new /datum/wire_description(SMARTFRIDGE_WIRE_ELECTRIFY, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(SMARTFRIDGE_WIRE_THROW, "This wire leads to the item dispensor force controls."),
new /datum/wire_description(SMARTFRIDGE_WIRE_ELECTRIFY, "This wire seems to be carrying a heavy current.", SKILL_PROF),
new /datum/wire_description(SMARTFRIDGE_WIRE_THROW, "This wire leads to the item dispensor force controls.", SKILL_PROF),
new /datum/wire_description(SMARTFRIDGE_WIRE_IDSCAN, "This wire is connected to the ID scanning panel.", SKILL_EXPERT)
)

Expand Down Expand Up @@ -53,4 +53,4 @@ var/global/const/SMARTFRIDGE_WIRE_IDSCAN = 4
else
S.seconds_electrified = -1
if(SMARTFRIDGE_WIRE_IDSCAN)
S.scan_id = 1
S.scan_id = 1
6 changes: 3 additions & 3 deletions code/datums/wires/smes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
holder_type = /obj/machinery/power/smes/buildable
wire_count = 5
descriptions = list(
new /datum/wire_description(SMES_WIRE_RCON, "This wire runs to a remote signaling mechanism."),
new /datum/wire_description(SMES_WIRE_RCON, "This wire runs to a remote signaling mechanism.", SKILL_PROF),
new /datum/wire_description(SMES_WIRE_INPUT, "This seems to be the primary input.", SKILL_EXPERT),
new /datum/wire_description(SMES_WIRE_OUTPUT, "This seems to be the primary output.", SKILL_EXPERT),
new /datum/wire_description(SMES_WIRE_GROUNDING, "This wire appeas to connect directly to the floor.", SKILL_EXPERT),
new /datum/wire_description(SMES_WIRE_FAILSAFES, "This wire appears to connect to a failsafe mechanism.")
new /datum/wire_description(SMES_WIRE_FAILSAFES, "This wire appears to connect to a failsafe mechanism.", SKILL_PROF)
)

var/global/const/SMES_WIRE_RCON = 1 // Remote control (AI and consoles), cut to disable
Expand Down Expand Up @@ -66,4 +66,4 @@ var/global/const/SMES_WIRE_FAILSAFES = 16 // Cut to disable failsafes, mend to r
if(S.safeties_enabled)
S.safeties_enabled = 0
spawn(10)
S.safeties_enabled = 1
S.safeties_enabled = 1
8 changes: 4 additions & 4 deletions code/datums/wires/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
holder_type = /obj/machinery/suit_cycler
wire_count = 3
descriptions = list(
new /datum/wire_description(SUIT_STORAGE_WIRE_ELECTRIFY, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(SUIT_STORAGE_WIRE_SAFETY, "This wire seems connected to a safety override", SKILL_EXPERT),
new /datum/wire_description(SUIT_STORAGE_WIRE_LOCKED, "This wire is connected to the ID scanning panel.")
new /datum/wire_description(SUIT_STORAGE_WIRE_ELECTRIFY, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(SUIT_STORAGE_WIRE_SAFETY, "This wire seems connected to a safety override", SKILL_PROF),
new /datum/wire_description(SUIT_STORAGE_WIRE_LOCKED, "This wire is connected to the ID scanning panel.", SKILL_PROF)
)

var/global/const/SUIT_STORAGE_WIRE_ELECTRIFY = 1
Expand Down Expand Up @@ -49,4 +49,4 @@ var/global/const/SUIT_STORAGE_WIRE_LOCKED = 4
if(mended)
S.electrified = 0
else
S.electrified = -1
S.electrified = -1
6 changes: 3 additions & 3 deletions code/datums/wires/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
holder_type = /obj/machinery/vending
wire_count = 4
descriptions = list(
new /datum/wire_description(VENDING_WIRE_THROW, "This wire leads to the item dispensor force controls."),
new /datum/wire_description(VENDING_WIRE_CONTRABAND, "This wire appears connected to a reserve inventory compartment."),
new /datum/wire_description(VENDING_WIRE_ELECTRIFY, "This wire seems to be carrying a heavy current."),
new /datum/wire_description(VENDING_WIRE_THROW, "This wire leads to the item dispensor force controls.", SKILL_PROF),
new /datum/wire_description(VENDING_WIRE_CONTRABAND, "This wire appears connected to a reserve inventory compartment.", SKILL_PROF),
new /datum/wire_description(VENDING_WIRE_ELECTRIFY, "This wire seems to be carrying a heavy current.", SKILL_EXPERT),
new /datum/wire_description(VENDING_WIRE_IDSCAN, "This wire is connected to the ID scanning panel.", SKILL_EXPERT)
)

Expand Down
25 changes: 25 additions & 0 deletions code/datums/wires/wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,31 @@ var/global/list/wireColours = list("red", "blue", "green", "darkred", "orange",
/datum/wires/proc/examine(index, mob/user)
. = "You aren't sure what this wire does."

// Космонавтику нужно потратить немного времени, чтобы узнать назначение провода
// Разумеется, чем он опытнее в этом, тем быстрее он их изучает

var/list/visible_messages = list(
"[user] touches the wires, trying to find out something...",
"[user] examines the wires...",
"[user] goes through the wires"
)
user.visible_message(
SPAN_NOTICE(pick(visible_messages)),
SPAN_NOTICE("You're trying to figure out what the wire is responsible for...")
)

var/time_for_check
switch (user.get_skill_value(SKILL_ELECTRICAL))
if (SKILL_PROF)
time_for_check = 0.5 SECOND
if (SKILL_EXPERT)
time_for_check = 1.5 SECOND
else
time_for_check = 3 SECONDS

if (!do_after(user, time_for_check))
return

var/datum/wire_description/wd = get_description(index)
if(!wd)
return
Expand Down

0 comments on commit 974ae65

Please sign in to comment.