From 8d5c3292fcd715dbaa85bdc245bd58a5a581984c Mon Sep 17 00:00:00 2001 From: Geeves Date: Tue, 9 Nov 2021 23:40:23 +0200 Subject: [PATCH] Telecomms Stuff (#12680) --- .../telecomms/machine_interactions.dm | 100 ++++++++---------- code/modules/mob/mob_helpers.dm | 2 +- html/changelogs/geeves-tcomms_stuff.yml | 7 ++ maps/aurora/aurora-6_surface.dmm | 21 +++- 4 files changed, 75 insertions(+), 55 deletions(-) create mode 100644 html/changelogs/geeves-tcomms_stuff.yml diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 55b1039f66d..b5dd5cd308b 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -12,19 +12,20 @@ var/construct_op = 0 -/obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob) +/obj/machinery/telecomms/attackby(obj/item/I, mob/user) // Using a multitool lets you access the receiver's interface - if(P.ismultitool()) - attack_hand(user) + if(I.ismultitool()) + user.set_machine(src) + interact(user, I) + return - - // REPAIRING: Use Nanopaste to repair 10-20 integrity points. - if(istype(P, /obj/item/stack/nanopaste)) - var/obj/item/stack/nanopaste/T = P + // REPAIRING: Use Nanopaste to repair half of the system's integrity. At 24 machines, it will take 48 uses of nanopaste to repair the entire array. + if(istype(I, /obj/item/stack/nanopaste)) + var/obj/item/stack/nanopaste/T = I if (integrity < 100) //Damaged, let's repair! if (T.use(1)) - integrity = between(0, integrity + rand(10,20), 100) + integrity = between(0, initial(integrity) / 2, initial(integrity)) to_chat(usr, "You apply the Nanopaste to [src], repairing some of the damage.") else to_chat(usr, "This machine is already in perfect condition.") @@ -33,44 +34,44 @@ switch(construct_op) if(0) - if(P.isscrewdriver()) + if(I.isscrewdriver()) to_chat(user, "You unfasten the bolts.") - playsound(src.loc, P.usesound, 50, 1) + playsound(src.loc, I.usesound, 50, 1) construct_op ++ if(1) - if(P.isscrewdriver()) + if(I.isscrewdriver()) to_chat(user, "You fasten the bolts.") - playsound(src.loc, P.usesound, 50, 1) + playsound(src.loc, I.usesound, 50, 1) construct_op -- - if(P.iswrench()) + if(I.iswrench()) to_chat(user, "You dislodge the external plating.") - playsound(src.loc, P.usesound, 75, 1) + playsound(src.loc, I.usesound, 75, 1) construct_op ++ if(2) - if(P.iswrench()) + if(I.iswrench()) to_chat(user, "You secure the external plating.") - playsound(src.loc, P.usesound, 75, 1) + playsound(src.loc, I.usesound, 75, 1) construct_op -- - if(P.iswirecutter()) - playsound(src.loc, P.usesound, 50, 1) + if(I.iswirecutter()) + playsound(src.loc, I.usesound, 50, 1) to_chat(user, "You remove the cables.") construct_op ++ var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( user.loc ) A.amount = 5 stat |= BROKEN // the machine's been borked! if(3) - if(P.iscoil()) - var/obj/item/stack/cable_coil/A = P + if(I.iscoil()) + var/obj/item/stack/cable_coil/A = I if (A.use(5)) to_chat(user, "You insert the cables.") construct_op-- stat &= ~BROKEN // the machine's not borked anymore! else to_chat(user, "You need five coils of wire for this.") - if(P.iscrowbar()) + if(I.iscrowbar()) to_chat(user, "You begin prying out the circuit board other components...") - playsound(src.loc, P.usesound, 50, 1) - if(do_after(user,60/P.toolspeed)) + playsound(src.loc, I.usesound, 50, 1) + if(do_after(user,60/I.toolspeed)) to_chat(user, "You finish prying out the components.") // Drop all the component stuff @@ -83,13 +84,13 @@ // manually find the components and drop them! var/newpath = text2path(circuitboard) var/obj/item/circuitboard/C = new newpath - for(var/I in C.req_components) - for(var/i = 1, i <= C.req_components[I], i++) - newpath = text2path(I) + for(var/component in C.req_components) + for(var/i = 1, i <= C.req_components[component], i++) + newpath = text2path(component) var/obj/item/s = new newpath s.forceMove(user.loc) - if(P.iscoil()) - var/obj/item/stack/cable_coil/A = P + if(s.iscoil()) + var/obj/item/stack/cable_coil/A = I A.amount = 1 // Drop a circuit board too @@ -102,26 +103,17 @@ update_icon() -/obj/machinery/telecomms/attack_ai(var/mob/user as mob) +/obj/machinery/telecomms/attack_ai(mob/living/silicon/user) if(!ai_can_interact(user)) return - attack_hand(user) + interact(user, user.get_multitool()) -/obj/machinery/telecomms/attack_hand(var/mob/user as mob) - - if(stat & (BROKEN|NOPOWER)) - return - - var/obj/item/device/multitool/P = user.get_multitool() - - if(!P) - return - - user.set_machine(src) +/obj/machinery/telecomms/interact(mob/user, var/obj/item/device/multitool/M) + if(!M) + M = user.get_multitool() var/dat - dat = "[src.name]

[src.name] Access

" - dat += "
[temp]
" - dat += "
Power Status: [src.toggled ? "On" : "Off"]" + dat += "
[temp]

" + dat += "Power Status: [src.toggled ? "On" : "Off"]" if(on && toggled) if(id != "" && id) dat += "
Identification String: [id]" @@ -144,7 +136,7 @@ dat += "
  • \ref[T] [T.name] ([T.id]) \[X\]
  • " dat += "" - dat += "
    Filtering Frequencies: " + dat += "Filtering Frequencies: " i = 0 if(length(freq_listening)) @@ -160,17 +152,19 @@ dat += "
    \[Add Filter\]" dat += "
    " - if(P) - var/obj/machinery/telecomms/device = P.get_buffer() + if(M) + var/obj/machinery/telecomms/device = M.get_buffer() if(istype(device)) - dat += "

    MULTITOOL BUFFER: [device] ([device.id]) \[Link\] \[Flush\]" + dat += "
    MULTITOOL BUFFER: [device] ([device.id])
    \[Link\] \[Flush\]" else - dat += "

    MULTITOOL BUFFER: \[Add Machine\]" + dat += "
    MULTITOOL BUFFER: \[Add Machine\]" - dat += "
    " temp = "" - user << browse(dat, "window=tcommachine;size=520x500;can_resize=0") - onclose(user, "dormitory") + + var/datum/browser/tcomms_win = new(user, "tcommachine", "[name] Access", 520, 500) + tcomms_win.set_content(dat) + tcomms_win.set_window_options(replacetext(tcomms_win.window_options, "can_resize=1", "can_resize=0")) + tcomms_win.open() // Additional Options for certain machines. Use this when you want to add an option to a specific machine. // Example of how to use below. @@ -345,7 +339,7 @@ usr.set_machine(src) src.add_fingerprint(usr) - updateUsrDialog() + updateDialog() /obj/machinery/telecomms/proc/canAccess(var/mob/user) if(issilicon(user) || in_range(user, src)) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 8c52aa1c5d1..0c56122f557 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -1066,7 +1066,7 @@ proc/is_blind(A) #undef SAFE_PERP /mob/proc/get_multitool(var/obj/P) - if(P.ismultitool()) + if(P?.ismultitool()) return P /mob/abstract/observer/get_multitool() diff --git a/html/changelogs/geeves-tcomms_stuff.yml b/html/changelogs/geeves-tcomms_stuff.yml new file mode 100644 index 00000000000..84c22ce4500 --- /dev/null +++ b/html/changelogs/geeves-tcomms_stuff.yml @@ -0,0 +1,7 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Mapped some additional items into the telecomms east area, notably: relay and hub circuitboards, additional stock parts for them, some cable coil, as well as four tubes of nanopaste to repair the machines." + - tweak: "Nanopaste has been tweaked to repair half of a telecomms machines health per use. With 24 machines, a fully damaged telecomms will take 5 tubes of nanopaste to repair the array." diff --git a/maps/aurora/aurora-6_surface.dmm b/maps/aurora/aurora-6_surface.dmm index 06d083aeaaa..05fe92be0ff 100644 --- a/maps/aurora/aurora-6_surface.dmm +++ b/maps/aurora/aurora-6_surface.dmm @@ -4940,6 +4940,8 @@ /obj/random/tech_supply, /obj/random/tech_supply, /obj/random/powercell, +/obj/item/stack/cable_coil/random, +/obj/item/stack/cable_coil/random, /turf/simulated/floor/tiled, /area/tcommsat/computer) "ewm" = ( @@ -8547,6 +8549,14 @@ }, /turf/simulated/floor/wood, /area/hydroponics/garden) +"hHk" = ( +/obj/structure/table/rack, +/obj/item/stack/nanopaste, +/obj/item/stack/nanopaste, +/obj/item/stack/nanopaste, +/obj/item/stack/nanopaste, +/turf/simulated/floor/tiled, +/area/tcommsat/computer) "hIb" = ( /obj/effect/floor_decal/corner/blue/full{ dir = 1 @@ -11404,6 +11414,10 @@ /obj/machinery/atmospherics/unary/vent_scrubber/on{ dir = 1 }, +/obj/item/stock_parts/subspace/filter, +/obj/item/stock_parts/subspace/filter, +/obj/item/stock_parts/subspace/filter, +/obj/item/stock_parts/subspace/filter, /turf/simulated/floor/tiled, /area/turret_protected/tcomsat) "koW" = ( @@ -14576,6 +14590,9 @@ /obj/item/circuitboard/telecomms/bus, /obj/item/circuitboard/telecomms/bus, /obj/item/circuitboard/telecomms/broadcaster, +/obj/item/circuitboard/telecomms/relay, +/obj/item/circuitboard/telecomms/relay, +/obj/item/circuitboard/telecomms/hub, /turf/simulated/floor/tiled, /area/turret_protected/tcomsat) "ncU" = ( @@ -20648,6 +20665,8 @@ /obj/item/stock_parts/manipulator, /obj/item/stock_parts/manipulator, /obj/item/stock_parts/manipulator, +/obj/item/stock_parts/manipulator, +/obj/item/stock_parts/manipulator, /obj/item/stock_parts/capacitor, /obj/item/stock_parts/micro_laser/high, /obj/item/stock_parts/micro_laser/high, @@ -42289,7 +42308,7 @@ wXr wXr kym pGM -vOy +hHk hmU cXk gry