From 045c393683af04fd78aebb75b5b28b9fffe6e722 Mon Sep 17 00:00:00 2001 From: SinTwo Date: Sat, 13 Aug 2016 19:55:57 -0400 Subject: [PATCH] Revert "Revert "Frame Cleanup"" This reverts commit 82722ba42f40ff77383f254bcb6f167633d55e9d. --- .../components/unary/cold_sink.dm | 1 - .../components/unary/heat_source.dm | 1 - code/datums/wires/alarm.dm | 2 +- code/game/machinery/Beacon.dm | 74 ++- code/game/machinery/CableLayer.dm | 3 +- code/game/machinery/OpTable.dm | 37 +- code/game/machinery/Sleeper.dm | 91 ++- code/game/machinery/adv_med.dm | 116 ++-- code/game/machinery/ai_slipper.dm | 57 +- code/game/machinery/alarm.dm | 343 +++++------ code/game/machinery/atmo_control.dm | 35 +- code/game/machinery/autolathe.dm | 7 +- code/game/machinery/biogenerator.dm | 13 +- code/game/machinery/buttons.dm | 5 +- code/game/machinery/cell_charger.dm | 8 +- code/game/machinery/cloning.dm | 19 +- code/game/machinery/computer/computer.dm | 38 +- code/game/machinery/computer/guestpass.dm | 19 - code/game/machinery/constructable_frame.dm | 1 - code/game/machinery/cryo.dm | 44 +- code/game/machinery/cryopod.dm | 35 +- code/game/machinery/deployable.dm | 197 +++--- code/game/machinery/door_control.dm | 24 +- code/game/machinery/doppler_array.dm | 4 +- code/game/machinery/flasher.dm | 51 +- code/game/machinery/floodlight.dm | 18 +- code/game/machinery/floor_light.dm | 4 +- code/game/machinery/floorlayer.dm | 6 +- code/game/machinery/frame.dm | 522 +++++++++------- code/game/machinery/hologram.dm | 40 +- code/game/machinery/holosign.dm | 10 +- code/game/machinery/igniter.dm | 54 +- code/game/machinery/iv_drip.dm | 60 +- code/game/machinery/jukebox.dm | 1 - code/game/machinery/kitchen/microwave.dm | 1 - code/game/machinery/lightswitch.dm | 10 +- code/game/machinery/machinery.dm | 110 +++- code/game/machinery/magnet.dm | 572 +++++++++--------- code/game/machinery/mass_driver.dm | 3 +- code/game/machinery/navbeacon.dm | 360 ++++++----- code/game/machinery/newscaster.dm | 455 +++++++------- code/game/machinery/nuclear_bomb.dm | 291 +++++---- code/game/machinery/overview.dm | 41 +- code/game/machinery/portable_turret.dm | 38 +- code/game/machinery/recharger.dm | 25 +- code/game/machinery/rechargestation.dm | 8 +- code/game/machinery/records_scanner.dm | 6 +- code/game/machinery/requests_console.dm | 36 +- code/game/machinery/robot_fabricator.dm | 72 +-- code/game/machinery/seed_extractor.dm | 2 +- code/game/machinery/spaceheater.dm | 15 +- code/game/machinery/status_display.dm | 26 +- code/game/machinery/status_display_ai.dm | 23 +- code/game/machinery/suit_storage_unit.dm | 465 +++++++------- code/game/machinery/supply_display.dm | 6 +- code/game/machinery/supplybeacon.dm | 6 +- code/game/machinery/syndicatebeacon.dm | 20 +- code/game/machinery/teleporter.dm | 108 ++-- code/game/machinery/turret_control.dm | 8 +- code/game/machinery/vending.dm | 224 +++---- code/game/machinery/wall_frames.dm | 138 ++--- code/game/machinery/washing_machine.dm | 17 +- code/game/machinery/wishgranter.dm | 14 +- code/game/mecha/mech_bay.dm | 7 +- code/game/mecha/mech_fabricator.dm | 1 - code/game/mecha/mech_prosthetics.dm | 1 - code/game/objects/items/devices/multitool.dm | 4 +- .../objects/items/devices/radio/intercom.dm | 17 +- .../weapons/circuitboards/circuitboard.dm | 6 +- .../circuitboards/computer/camera_monitor.dm | 2 +- .../circuitboards/computer/research.dm | 14 +- .../items/weapons/circuitboards/frame.dm | 146 +---- .../circuitboards/machinery/biogenerator.dm | 4 +- .../circuitboards/machinery/cloning.dm | 8 +- .../circuitboards/machinery/jukebox.dm | 4 +- .../circuitboards/machinery/mech_recharger.dm | 4 +- .../circuitboards/machinery/mining_drill.dm | 8 +- .../weapons/circuitboards/machinery/pacman.dm | 8 +- .../weapons/circuitboards/machinery/power.dm | 12 +- .../machinery/recharge_station.dm | 4 +- .../circuitboards/machinery/research.dm | 41 +- .../circuitboards/machinery/shieldgen.dm | 12 +- .../circuitboards/machinery/telecomms.dm | 22 +- .../circuitboards/machinery/unary_atmos.dm | 6 +- .../items/weapons/circuitboards/mecha.dm | 4 - .../detectivework/microscope/dnascanner.dm | 1 - code/modules/economy/ATM.dm | 19 +- code/modules/mining/drilling/drill.dm | 1 - code/modules/paperwork/filingcabinet.dm | 3 - code/modules/paperwork/photocopier.dm | 1 - code/modules/recycling/conveyor2.dm | 1 - code/modules/research/circuitprinter.dm | 1 - code/modules/research/destructive_analyzer.dm | 1 - code/modules/research/protolathe.dm | 1 - code/modules/research/server.dm | 1 - .../machinery/geosample_scanner.dm | 22 +- .../security levels/keycard authentication.dm | 37 +- .../xenobio2/machinery/core_extractor.dm | 44 +- .../xenobio2/machinery/gene_manipulators.dm | 59 +- code/modules/xenobio2/machinery/injector.dm | 7 +- .../xenobio2/machinery/injector_computer.dm | 5 +- .../xenobio2/machinery/slime_replicator.dm | 30 +- code/world.dm | 2 + icons/obj/stock_parts.dmi | Bin 66434 -> 66472 bytes maps/polaris-2.dmm | 6 +- maps/polaris-3.dmm | 8 +- maps/polaris-4.dmm | 10 +- polaris.dme | 2 +- 108 files changed, 2619 insertions(+), 3018 deletions(-) diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm index 11777e51d2..faefa64883 100644 --- a/code/ATMOSPHERICS/components/unary/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm @@ -24,7 +24,6 @@ /obj/machinery/atmospherics/unary/freezer/New() ..() initialize_directions = dir - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm index 8ee9600606..c2daa2b6d1 100644 --- a/code/ATMOSPHERICS/components/unary/heat_source.dm +++ b/code/ATMOSPHERICS/components/unary/heat_source.dm @@ -24,7 +24,6 @@ /obj/machinery/atmospherics/unary/heater/New() ..() initialize_directions = dir - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) diff --git a/code/datums/wires/alarm.dm b/code/datums/wires/alarm.dm index ace1ba9ec3..a665fd75a5 100644 --- a/code/datums/wires/alarm.dm +++ b/code/datums/wires/alarm.dm @@ -11,7 +11,7 @@ var/const/AALARM_WIRE_AALARM = 16 /datum/wires/alarm/CanUse(var/mob/living/L) var/obj/machinery/alarm/A = holder - if(A.wiresexposed) + if(A.panel_open) return 1 return 0 diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index ac736ddfe2..c59c67c300 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -1,5 +1,4 @@ /obj/machinery/bluespace_beacon - icon = 'icons/obj/objects.dmi' icon_state = "floor_beaconf" name = "Bluespace Gigabeacon" @@ -11,45 +10,42 @@ idle_power_usage = 0 var/obj/item/device/radio/beacon/Beacon - New() - ..() - var/turf/T = loc +/obj/machinery/bluespace_beacon/New() + ..() + var/turf/T = src.loc + Beacon = new /obj/item/device/radio/beacon + Beacon.invisibility = INVISIBILITY_MAXIMUM + Beacon.loc = T + + hide(!T.is_plating()) + +/obj/machinery/bluespace_beacon/Destroy() + if(Beacon) + qdel(Beacon) + ..() + +// update the invisibility and icon +/obj/machinery/bluespace_beacon/hide(var/intact) + invisibility = intact ? 101 : 0 + updateicon() + +// update the icon_state +/obj/machinery/bluespace_beacon/proc/updateicon() + var/state="floor_beacon" + + if(invisibility) + icon_state = "[state]f" + else + icon_state = "[state]" + +/obj/machinery/bluespace_beacon/process() + if(!Beacon) + var/turf/T = src.loc Beacon = new /obj/item/device/radio/beacon Beacon.invisibility = INVISIBILITY_MAXIMUM Beacon.loc = T + if(Beacon) + if(Beacon.loc != src.loc) + Beacon.loc = src.loc - hide(!T.is_plating()) - - Destroy() - if(Beacon) - qdel(Beacon) - ..() - - // update the invisibility and icon - hide(var/intact) - invisibility = intact ? 101 : 0 - updateicon() - - // update the icon_state - proc/updateicon() - var/state="floor_beacon" - - if(invisibility) - icon_state = "[state]f" - - else - icon_state = "[state]" - - process() - if(!Beacon) - var/turf/T = loc - Beacon = new /obj/item/device/radio/beacon - Beacon.invisibility = INVISIBILITY_MAXIMUM - Beacon.loc = T - if(Beacon) - if(Beacon.loc != loc) - Beacon.loc = loc - - updateicon() - - + updateicon() \ No newline at end of file diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm index 277742a22b..a5625e9253 100644 --- a/code/game/machinery/CableLayer.dm +++ b/code/game/machinery/CableLayer.dm @@ -1,6 +1,5 @@ /obj/machinery/cablelayer name = "automatic cable layer" - icon = 'icons/obj/stationobjs.dmi' icon_state = "pipe_d" density = 1 @@ -42,7 +41,7 @@ m = min(m, cable.amount) m = min(m, 30) if(m) - playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) use_cable(m) var/obj/item/stack/cable_coil/CC = new (get_turf(src)) CC.amount = m diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 8f0a0535b1..ba083031e7 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -10,41 +10,39 @@ active_power_usage = 5 var/mob/living/carbon/human/victim = null var/strapped = 0.0 - var/obj/machinery/computer/operating/computer = null /obj/machinery/optable/New() ..() for(dir in list(NORTH,EAST,SOUTH,WEST)) computer = locate(/obj/machinery/computer/operating, get_step(src, dir)) - if (computer) + if(computer) computer.table = src break // spawn(100) //Wont the MC just call this process() before and at the 10 second mark anyway? // process() /obj/machinery/optable/ex_act(severity) - switch(severity) if(1.0) //SN src = null qdel(src) return if(2.0) - if (prob(50)) + if(prob(50)) //SN src = null qdel(src) return if(3.0) - if (prob(25)) - src.density = 0 + if(prob(25)) + density = 0 else return /obj/machinery/optable/attack_hand(mob/user as mob) - if (HULK in usr.mutations) + if(HULK in usr.mutations) visible_message("\The [usr] destroys \the [src]!") - src.density = 0 + density = 0 qdel(src) return @@ -56,13 +54,12 @@ else return 0 - /obj/machinery/optable/MouseDrop_T(obj/O as obj, mob/user as mob) - if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) + if((!(istype(O, /obj/item/weapon)) || user.get_active_hand() != O)) return user.drop_item() - if (O.loc != src.loc) + if(O.loc != src.loc) step(O, get_dir(O, src)) return @@ -70,10 +67,10 @@ if(locate(/mob/living/carbon/human, src.loc)) var/mob/living/carbon/human/M = locate(/mob/living/carbon/human, src.loc) if(M.lying) - src.victim = M + victim = M icon_state = M.pulse ? "table2-active" : "table2-idle" return 1 - src.victim = null + victim = null icon_state = "table2-idle" return 0 @@ -81,21 +78,21 @@ check_victim() /obj/machinery/optable/proc/take_victim(mob/living/carbon/C, mob/living/carbon/user as mob) - if (C == user) + if(C == user) user.visible_message("[user] climbs on \the [src].","You climb on \the [src].") else visible_message("\The [C] has been laid on \the [src] by [user].", 3) - if (C.client) + if(C.client) C.client.perspective = EYE_PERSPECTIVE C.client.eye = src C.resting = 1 C.loc = src.loc for(var/obj/O in src) O.loc = src.loc - src.add_fingerprint(user) + add_fingerprint(user) if(ishuman(C)) var/mob/living/carbon/human/H = C - src.victim = H + victim = H icon_state = H.pulse ? "table2-active" : "table2-idle" else icon_state = "table2-idle" @@ -121,7 +118,7 @@ take_victim(usr,usr) /obj/machinery/optable/attackby(obj/item/weapon/W as obj, mob/living/carbon/user as mob) - if (istype(W, /obj/item/weapon/grab)) + if(istype(W, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = W if(iscarbon(G.affecting) && check_table(G.affecting)) take_victim(G.affecting,usr) @@ -130,10 +127,10 @@ /obj/machinery/optable/proc/check_table(mob/living/carbon/patient as mob) check_victim() - if(src.victim && get_turf(victim) == get_turf(src) && victim.lying) + if(victim && get_turf(victim) == get_turf(src) && victim.lying) usr << "\The [src] is already occupied!" return 0 if(patient.buckled) usr << "Unbuckle \the [patient] first!" return 0 - return 1 + return 1 \ No newline at end of file diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index c0ef428f99..7193a7907b 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -2,7 +2,7 @@ name = "Sleeper Console" icon = 'icons/obj/Cryogenic2.dmi' icon_state = "sleeperconsole" - var/obj/machinery/sleeper/connected = null + var/obj/machinery/sleeper/sleeper anchored = 1 //About time someone fixed this. density = 0 dir = 8 @@ -11,21 +11,19 @@ interact_offline = 1 circuit = /obj/item/weapon/circuitboard/sleeper_console -//obj/machinery/sleep_console/New() - //..() - //spawn( 5 ) - //src.connected = locate(/obj/machinery/sleeper, get_step(src, WEST)) //We assume dir = 8 so sleeper is WEST. Other sprites do exist. - //return - //return - /obj/machinery/sleep_console/New() ..() - spawn(5) - //src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir)) - src.connected = locate(/obj/machinery/sleeper) in range(2,src) - return - return + findsleeper() +/obj/machinery/sleep_console/proc/findsleeper() + spawn(5) + var/obj/machinery/sleeper/sleepernew = null + for(dir in list(NORTH, EAST, SOUTH, WEST)) // Loop through every direction + sleepernew = locate(/obj/machinery/sleeper, get_step(src, dir)) // Try to find a scanner in that direction + if(sleepernew) + sleeper = sleepernew + sleepernew.console = src + return /obj/machinery/sleep_console/attack_ai(var/mob/user) return attack_hand(user) @@ -33,39 +31,25 @@ /obj/machinery/sleep_console/attack_hand(var/mob/user) if(..()) return 1 - if(connected) - connected.ui_interact(user) + + if(sleeper.panel_open) + user << "Close the maintenance panel first." + return + + if(!sleeper) + findsleeper() + if(sleeper) + return sleeper.ui_interact(user) + else if(sleeper) + return sleeper.ui_interact(user) + else + user << "Sleeper not found!" /obj/machinery/sleep_console/attackby(var/obj/item/I, var/mob/user) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - user << "You start disconnecting the monitor." - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.circuit = M - A.anchored = 1 - A.density = 1 - A.frame_type = M.board_type - for (var/obj/C in src) - C.forceMove(loc) - if (src.stat & BROKEN) - user << "The broken glass falls out." - new /obj/item/weapon/material/shard( src.loc ) - A.state = 3 - A.icon_state = "[A.frame_type]_3" - else - user << "You disconnect the monitor." - A.state = 4 - A.icon_state = "[A.frame_type]_4" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.dir = dir - M.deconstruct(src) - qdel(src) + if(computer_deconstruction_screwdriver(user, I)) + return else - src.attack_hand(user) - return + return attack_hand(user) /obj/machinery/sleep_console/power_change() ..() @@ -86,6 +70,7 @@ var/list/available_chemicals = list("inaprovaline" = "Inaprovaline", "stoxin" = "Soporific", "paracetamol" = "Paracetamol", "anti_toxin" = "Dylovene", "dexalin" = "Dexalin") var/obj/item/weapon/reagent_containers/glass/beaker = null var/filtering = 0 + var/obj/machinery/sleep_console/console use_power = 1 idle_power_usage = 15 @@ -94,7 +79,6 @@ /obj/machinery/sleeper/New() ..() beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src) - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src) @@ -105,13 +89,6 @@ component_parts += new /obj/item/weapon/reagent_containers/syringe(src) component_parts += new /obj/item/stack/material/glass/reinforced(src, 2) - spawn(5) - //src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir)) - var/obj/machinery/sleep_console/C = locate(/obj/machinery/sleep_console) in range(2,src) - if(C) - C.connected = src - return - RefreshParts() /obj/machinery/sleeper/initialize() @@ -208,12 +185,12 @@ return 1 /obj/machinery/sleeper/attackby(var/obj/item/I, var/mob/user) + add_fingerprint(user) if(default_deconstruction_screwdriver(user, I)) return - if(default_deconstruction_crowbar(user, I)) + else if(default_deconstruction_crowbar(user, I)) return - add_fingerprint(user) - if(istype(I, /obj/item/weapon/reagent_containers/glass)) + else if(istype(I, /obj/item/weapon/reagent_containers/glass)) if(!beaker) beaker = I user.drop_item() @@ -283,21 +260,21 @@ if(occupant.client) occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE - occupant.loc = loc + occupant.loc = src.loc occupant = null for(var/atom/movable/A in src) // In case an object was dropped inside or something if(A == beaker || A == circuit) continue if(A in component_parts) continue - A.loc = loc + A.loc = src.loc update_use_power(1) update_icon() toggle_filter() /obj/machinery/sleeper/proc/remove_beaker() if(beaker) - beaker.loc = loc + beaker.loc = src.loc beaker = null toggle_filter() diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 43ca9d2fc3..1777151261 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -1,6 +1,5 @@ // Pretty much everything here is stolen from the dna scanner FYI - /obj/machinery/bodyscanner var/mob/living/carbon/occupant var/locked @@ -9,25 +8,15 @@ icon_state = "body_scanner_0" density = 1 anchored = 1 - circuit = /obj/item/weapon/circuitboard/body_scanner - use_power = 1 idle_power_usage = 60 active_power_usage = 10000 //10 kW. It's a big all-body scanner. - light_color = "#00FF00" + var/obj/machinery/body_scanconsole/console /obj/machinery/bodyscanner/New() ..() - spawn( 5 ) - var/obj/machinery/body_scanconsole/C = locate(/obj/machinery/body_scanconsole) in range(2,src) - if(C) - C.connected = src - -/obj/machinery/bodyscanner/map/New() - ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) @@ -45,10 +34,9 @@ /obj/machinery/bodyscanner/attackby(var/obj/item/G, user as mob) if(default_deconstruction_screwdriver(user, G)) return - if(default_deconstruction_crowbar(user, G)) + else if(default_deconstruction_crowbar(user, G)) return - - if(istype(G, /obj/item/weapon/grab)) + else if(istype(G, /obj/item/weapon/grab)) var/obj/item/weapon/grab/H = G if(panel_open) user << "Close the maintenance panel first." @@ -126,14 +114,14 @@ add_fingerprint(usr) /obj/machinery/bodyscanner/proc/go_out() - if ((!( src.occupant ) || src.locked)) + if ((!(occupant) || src.locked)) return - if (src.occupant.client) - src.occupant.client.eye = src.occupant.client.mob - src.occupant.client.perspective = MOB_PERSPECTIVE - src.occupant.loc = src.loc - src.occupant = null - src.icon_state = "body_scanner_0" + if (occupant.client) + occupant.client.eye = occupant.client.mob + occupant.client.perspective = MOB_PERSPECTIVE + occupant.loc = src.loc + occupant = null + icon_state = "body_scanner_0" return /obj/machinery/bodyscanner/ex_act(severity) @@ -169,7 +157,7 @@ //Body Scan Console /obj/machinery/body_scanconsole - var/obj/machinery/bodyscanner/connected + var/obj/machinery/bodyscanner/scanner var/known_implants = list(/obj/item/weapon/implant/chem, /obj/item/weapon/implant/death_alarm, /obj/item/weapon/implant/loyalty, /obj/item/weapon/implant/tracking) var/delete var/temphtml @@ -188,35 +176,22 @@ findscanner() /obj/machinery/body_scanconsole/attackby(var/obj/item/I, var/mob/user) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - user << "You start disconnecting the monitor." - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.circuit = M - A.anchored = 1 - A.density = 1 - A.frame_type = M.board_type - for (var/obj/C in src) - C.forceMove(loc) - if (src.stat & BROKEN) - user << "The broken glass falls out." - new /obj/item/weapon/material/shard( src.loc ) - A.state = 3 - A.icon_state = "[A.frame_type]_3" - else - user << "You disconnect the monitor." - A.state = 4 - A.icon_state = "[A.frame_type]_4" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.dir = dir - M.deconstruct(src) - qdel(src) + if(computer_deconstruction_screwdriver(user, I)) + return + else if(istype(I, /obj/item/device/multitool)) //Did you want to link it? + var/obj/item/device/multitool/P = I + if(P.connectable) + if(istype(P.connectable, /obj/machinery/bodyscanner)) + var/obj/machinery/bodyscanner/C = P.connectable + scanner = C + C.console = src + user << " You link the [src] to the [P.connectable]!" + else + user << " You store the [src] in the [P]'s buffer!" + P.connectable = src + return else - src.attack_hand(user) - return + return attack_hand(user) /obj/machinery/body_scanconsole/power_change() if(stat & BROKEN) @@ -226,7 +201,7 @@ stat &= ~NOPOWER else spawn(rand(0, 15)) - src.icon_state = "body_scannerconsole-p" + icon_state = "body_scannerconsole-p" stat |= NOPOWER /obj/machinery/body_scanconsole/ex_act(severity) @@ -244,13 +219,14 @@ return /obj/machinery/body_scanconsole/proc/findscanner() - spawn( 5 ) + spawn(5) var/obj/machinery/bodyscanner/bodyscannernew = null // Loop through every direction - for(dir in list(NORTH,EAST,SOUTH,WEST)) - // Try to find a scanner in that direction - bodyscannernew = locate(/obj/machinery/bodyscanner, get_step(src, dir)) - src.connected = bodyscannernew + for(dir in list(NORTH, EAST, SOUTH, WEST)) // Loop through every direction + bodyscannernew = locate(/obj/machinery/bodyscanner, get_step(src, dir)) // Try to find a scanner in that direction + if(bodyscannernew) + scanner = bodyscannernew + bodyscannernew.console = src return /obj/machinery/body_scanconsole/attack_ai(user as mob) @@ -263,26 +239,30 @@ if(stat & (NOPOWER|BROKEN)) return - if (panel_open) + if (scanner.panel_open) user << "Close the maintenance panel first." return - if(!src.connected) + if(!scanner) findscanner() - - ui_interact(user) + if(scanner) + return ui_interact(user) + else if(scanner) + return ui_interact(user) + else + user << "Scanner not found!" /obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) var/data[0] - data["connected"] = connected ? 1 : 0 + data["connected"] = scanner ? 1 : 0 - if(connected) - data["occupied"] = connected.occupant ? 1 : 0 + if(scanner) + data["occupied"] = scanner.occupant ? 1 : 0 var/occupantData[0] - if(connected.occupant && ishuman(connected.occupant)) - var/mob/living/carbon/human/H = connected.occupant + if(scanner.occupant && ishuman(scanner.occupant)) + var/mob/living/carbon/human/H = scanner.occupant occupantData["name"] = H.name occupantData["stat"] = H.stat occupantData["health"] = H.health @@ -420,8 +400,8 @@ /obj/machinery/body_scanconsole/proc/generate_printing_text() var/dat = "" - if(connected) - var/mob/living/carbon/human/occupant = connected.occupant + if(scanner) + var/mob/living/carbon/human/occupant = scanner.occupant dat = "Occupant Statistics:
" //Blah obvious if(istype(occupant)) //is there REALLY someone in there? var/t1 diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index 9d45b14414..0ea5527df2 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -15,7 +15,6 @@ var/cooldown_on = 0 req_access = list(access_ai_upload) - /obj/machinery/ai_slipper/New() ..() update_icon() @@ -25,32 +24,32 @@ update_icon() /obj/machinery/ai_slipper/update_icon() - if (stat & NOPOWER || stat & BROKEN) + if(stat & NOPOWER || stat & BROKEN) icon_state = "motion0" else icon_state = disabled ? "motion0" : "motion3" /obj/machinery/ai_slipper/proc/setState(var/enabled, var/uses) - src.disabled = disabled - src.uses = uses - src.power_change() + disabled = disabled + uses = uses + power_change() /obj/machinery/ai_slipper/attackby(obj/item/weapon/W, mob/user) if(stat & (NOPOWER|BROKEN)) return - if (istype(user, /mob/living/silicon)) - return src.attack_hand(user) + if(istype(user, /mob/living/silicon)) + return attack_hand(user) else // trying to unlock the interface - if (src.allowed(usr)) + if(allowed(usr)) locked = !locked user << "You [ locked ? "lock" : "unlock"] the device." - if (locked) - if (user.machine==src) + if(locked) + if(user.machine==src) user.unset_machine() user << browse(null, "window=ai_slipper") else - if (user.machine==src) - src.attack_hand(usr) + if(user.machine==src) + attack_hand(usr) else user << "Access denied." return @@ -62,8 +61,8 @@ /obj/machinery/ai_slipper/attack_hand(mob/user as mob) if(stat & (NOPOWER|BROKEN)) return - if ( (get_dist(src, user) > 1 )) - if (!istype(user, /mob/living/silicon)) + if((get_dist(src, user) > 1)) + if(!istype(user, /mob/living/silicon)) user << text("Too far away.") user.unset_machine() user << browse(null, "window=ai_slipper") @@ -71,18 +70,18 @@ user.set_machine(src) var/loc = src.loc - if (istype(loc, /turf)) + if(istype(loc, /turf)) loc = loc:loc - if (!istype(loc, /area)) + if(!istype(loc, /area)) user << text("Turret badly positioned - loc.loc is [].", loc) return var/area/area = loc var/t = "AI Liquid Dispenser ([area.name])
" - if(src.locked && (!istype(user, /mob/living/silicon))) + if(locked && (!istype(user, /mob/living/silicon))) t += "(Swipe ID card to unlock control panel.)
" else - t += text("Dispenser [] - []?
\n", src.disabled?"deactivated":"activated", src, src.disabled?"Enable":"Disable") + t += text("Dispenser [] - []?
\n", disabled?"deactivated":"activated", src, disabled?"Enable":"Disable") t += text("Uses Left: [uses]. Activate the dispenser?
\n") user << browse(t, "window=computer;size=575x450") @@ -91,25 +90,25 @@ /obj/machinery/ai_slipper/Topic(href, href_list) ..() - if (src.locked) - if (!istype(usr, /mob/living/silicon)) + if(locked) + if(!istype(usr, /mob/living/silicon)) usr << "Control panel is locked!" return - if (href_list["toggleOn"]) - src.disabled = !src.disabled + if(href_list["toggleOn"]) + disabled = !disabled update_icon() - if (href_list["toggleUse"]) + if(href_list["toggleUse"]) if(cooldown_on || disabled) return else new /obj/effect/effect/foam(src.loc) - src.uses-- + uses-- cooldown_on = 1 cooldown_time = world.timeofday + 100 slip_process() return - src.attack_hand(usr) + attack_hand(usr) return /obj/machinery/ai_slipper/proc/slip_process() @@ -122,9 +121,9 @@ cooldown_timeleft = (ticksleft / 10) sleep(5) - if (uses <= 0) + if(uses <= 0) return - if (uses >= 0) + if(uses >= 0) cooldown_on = 0 - src.power_change() - return + power_change() + return \ No newline at end of file diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 699898fde0..398bac9c54 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -51,10 +51,10 @@ var/rcon_setting = 2 var/rcon_time = 0 var/locked = 1 - var/wiresexposed = 0 // If it's been screwdrivered open. + panel_open = 0 // If it's been screwdrivered open. var/aidisabled = 0 var/shorted = 0 - circuit = /obj/item/weapon/circuitboard/airalarm + circuit = /obj/item/weapon/circuitboard/airalarm var/datum/wires/alarm/wires @@ -112,7 +112,7 @@ /obj/machinery/alarm/proc/first_run() alarm_area = get_area(src) area_uid = alarm_area.uid - if (name == "alarm") + if(name == "alarm") name = "[alarm_area.name] Air Alarm" if(!wires) @@ -123,20 +123,20 @@ TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa TLV["phoron"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa - TLV["pressure"] = list(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20) /* kpa */ - TLV["temperature"] = list(T0C-26, T0C, T0C+40, T0C+66) // K + TLV["pressure"] = list(ONE_ATMOSPHERE * 0.80, ONE_ATMOSPHERE * 0.90, ONE_ATMOSPHERE * 1.10, ONE_ATMOSPHERE * 1.20) /* kpa */ + TLV["temperature"] = list(T0C - 26, T0C, T0C + 40, T0C + 66) // K /obj/machinery/alarm/initialize() set_frequency(frequency) - if (!master_is_operating()) + if(!master_is_operating()) elect_master() /obj/machinery/alarm/process() if((stat & (NOPOWER|BROKEN)) || shorted) return - var/turf/simulated/location = loc + var/turf/simulated/location = src.loc if(!istype(location)) return//returns if loc is not simulated var/datum/gas_mixture/environment = location.return_air() @@ -148,16 +148,16 @@ var/old_pressurelevel = pressure_dangerlevel danger_level = overall_danger_level(environment) - if (old_level != danger_level) + if(old_level != danger_level) apply_danger_level(danger_level) - if (old_pressurelevel != pressure_dangerlevel) - if (breach_detected()) + if(old_pressurelevel != pressure_dangerlevel) + if(breach_detected()) mode = AALARM_MODE_OFF apply_mode() - if (mode==AALARM_MODE_CYCLE && environment.return_pressure() 2.0) update_use_power(2) @@ -184,13 +184,13 @@ "You hear a click and a faint electronic hum.") else //check for when we should stop adjusting temperature - if (get_danger_level(target_temperature, TLV["temperature"]) || abs(environment.temperature - target_temperature) <= 0.5) + if(get_danger_level(target_temperature, TLV["temperature"]) || abs(environment.temperature - target_temperature) <= 0.5) update_use_power(1) regulating_temperature = 0 visible_message("\The [src] clicks quietly as it stops [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\ "You hear a click as a faint electronic humming stops.") - if (regulating_temperature) + if(regulating_temperature) if(target_temperature > T0C + MAX_TEMPERATURE) target_temperature = T0C + MAX_TEMPERATURE @@ -198,11 +198,11 @@ target_temperature = T0C + MIN_TEMPERATURE var/datum/gas_mixture/gas - gas = environment.remove(0.25*environment.total_moles) + gas = environment.remove(0.25 * environment.total_moles) if(gas) - if (gas.temperature <= target_temperature) //gas heating - var/energy_used = min( gas.get_thermal_energy_change(target_temperature) , active_power_usage) + if(gas.temperature <= target_temperature) //gas heating + var/energy_used = min(gas.get_thermal_energy_change(target_temperature) , active_power_usage) gas.add_thermal_energy(energy_used) //use_power(energy_used, ENVIRON) //handle by update_use_power instead @@ -212,7 +212,7 @@ //Assume the heat is being pumped into the hull which is fixed at 20 C //none of this is really proper thermodynamics but whatever - var/cop = gas.temperature/T20C //coefficient of performance -> power used = heat_transfer/cop + var/cop = gas.temperature / T20C //coefficient of performance -> power used = heat_transfer/cop heat_transfer = min(heat_transfer, cop * active_power_usage) //this ensures that we don't use more than active_power_usage amount of power @@ -223,7 +223,7 @@ environment.merge(gas) /obj/machinery/alarm/proc/overall_danger_level(var/datum/gas_mixture/environment) - var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume + var/partial_pressure = R_IDEAL_GAS_EQUATION * environment.temperature/environment.volume var/environment_pressure = environment.return_pressure() var/other_moles = 0 @@ -248,7 +248,7 @@ // Returns whether this air alarm thinks there is a breach, given the sensors that are available to it. /obj/machinery/alarm/proc/breach_detected() - var/turf/simulated/location = loc + var/turf/simulated/location = src.loc if(!istype(location)) return 0 @@ -260,20 +260,18 @@ var/environment_pressure = environment.return_pressure() var/pressure_levels = TLV["pressure"] - if (environment_pressure <= pressure_levels[1]) //low pressures - if (!(mode == AALARM_MODE_PANIC || mode == AALARM_MODE_CYCLE)) + if(environment_pressure <= pressure_levels[1]) //low pressures + if(!(mode == AALARM_MODE_PANIC || mode == AALARM_MODE_CYCLE)) return 1 return 0 - /obj/machinery/alarm/proc/master_is_operating() - return alarm_area.master_air_alarm && !(alarm_area.master_air_alarm.stat & (NOPOWER|BROKEN)) - + return alarm_area.master_air_alarm && !(alarm_area.master_air_alarm.stat & (NOPOWER | BROKEN)) /obj/machinery/alarm/proc/elect_master() - for (var/obj/machinery/alarm/AA in alarm_area) - if (!(AA.stat & (NOPOWER|BROKEN))) + for(var/obj/machinery/alarm/AA in alarm_area) + if(!(AA.stat & (NOPOWER|BROKEN))) alarm_area.master_air_alarm = AA return 1 return 0 @@ -286,7 +284,7 @@ return 0 /obj/machinery/alarm/update_icon() - if(wiresexposed) + if(panel_open) icon_state = "alarmx" set_light(0) return @@ -296,18 +294,18 @@ return var/icon_level = danger_level - if (alarm_area.atmosalm) + if(alarm_area.atmosalm) icon_level = max(icon_level, 1) //if there's an atmos alarm but everything is okay locally, no need to go past yellow var/new_color = null switch(icon_level) - if (0) + if(0) icon_state = "alarm0" new_color = "#03A728" - if (1) + if(1) icon_state = "alarm2" //yes, alarm2 is yellow alarm new_color = "#EC8B2F" - if (2) + if(2) icon_state = "alarm1" new_color = "#DA0205" @@ -316,20 +314,20 @@ /obj/machinery/alarm/receive_signal(datum/signal/signal) if(stat & (NOPOWER|BROKEN)) return - if (alarm_area.master_air_alarm != src) - if (master_is_operating()) + if(alarm_area.master_air_alarm != src) + if(master_is_operating()) return elect_master() - if (alarm_area.master_air_alarm != src) + if(alarm_area.master_air_alarm != src) return if(!signal || signal.encryption) return var/id_tag = signal.data["tag"] - if (!id_tag) + if(!id_tag) return - if (signal.data["area"] != area_uid) + if(signal.data["area"] != area_uid) return - if (signal.data["sigtype"] != "status") + if(signal.data["sigtype"] != "status") return var/dev_type = signal.data["device"] @@ -342,28 +340,28 @@ /obj/machinery/alarm/proc/register_env_machine(var/m_id, var/device_type) var/new_name - if (device_type=="AVP") + if(device_type == "AVP") new_name = "[alarm_area.name] Vent Pump #[alarm_area.air_vent_names.len+1]" alarm_area.air_vent_names[m_id] = new_name - else if (device_type=="AScr") + else if(device_type == "AScr") new_name = "[alarm_area.name] Air Scrubber #[alarm_area.air_scrub_names.len+1]" alarm_area.air_scrub_names[m_id] = new_name else return - spawn (10) - send_signal(m_id, list("init" = new_name) ) + spawn(10) + send_signal(m_id, list("init" = new_name)) /obj/machinery/alarm/proc/refresh_all() for(var/id_tag in alarm_area.air_vent_names) var/list/I = alarm_area.air_vent_info[id_tag] - if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) + if(I && I["timestamp"] + AALARM_REPORT_TIMEOUT / 2 > world.time) continue - send_signal(id_tag, list("status") ) + send_signal(id_tag, list("status")) for(var/id_tag in alarm_area.air_scrub_names) var/list/I = alarm_area.air_scrub_info[id_tag] - if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) + if(I && I["timestamp"] + AALARM_REPORT_TIMEOUT / 2 > world.time) continue - send_signal(id_tag, list("status") ) + send_signal(id_tag, list("status")) /obj/machinery/alarm/proc/set_frequency(new_frequency) radio_controller.remove_object(src, frequency) @@ -390,42 +388,42 @@ /obj/machinery/alarm/proc/apply_mode() //propagate mode to other air alarms in the area //TODO: make it so that players can choose between applying the new mode to the room they are in (related area) vs the entire alarm area - for (var/obj/machinery/alarm/AA in alarm_area) + for(var/obj/machinery/alarm/AA in alarm_area) AA.mode = mode switch(mode) if(AALARM_MODE_SCRUBBING) for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "co2_scrub"= 1, "scrubbing"= 1, "panic_siphon"= 0) ) + send_signal(device_id, list("power"= 1, "co2_scrub"= 1, "scrubbing"= 1, "panic_siphon"= 0)) for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= "default", "set_external_pressure"= "default") ) + send_signal(device_id, list("power"= 1, "checks"= "default", "set_external_pressure"= "default")) if(AALARM_MODE_PANIC, AALARM_MODE_CYCLE) for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "panic_siphon"= 1) ) + send_signal(device_id, list("power"= 1, "panic_siphon"= 1)) for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 0) ) + send_signal(device_id, list("power"= 0)) if(AALARM_MODE_REPLACEMENT) for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "panic_siphon"= 1) ) + send_signal(device_id, list("power"= 1, "panic_siphon"= 1)) for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= "default", "set_external_pressure"= "default") ) + send_signal(device_id, list("power"= 1, "checks"= "default", "set_external_pressure"= "default")) if(AALARM_MODE_FILL) for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 0) ) + send_signal(device_id, list("power"= 0)) for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= "default", "set_external_pressure"= "default") ) + send_signal(device_id, list("power"= 1, "checks"= "default", "set_external_pressure"= "default")) if(AALARM_MODE_OFF) for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 0) ) + send_signal(device_id, list("power"= 0)) for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 0) ) + send_signal(device_id, list("power"= 0)) /obj/machinery/alarm/proc/apply_danger_level(var/new_danger_level) - if (report_danger_level && alarm_area.atmosalert(new_danger_level, src)) + if(report_danger_level && alarm_area.atmosalert(new_danger_level, src)) post_alert(new_danger_level) update_icon() @@ -443,9 +441,9 @@ if(alert_level==2) alert_signal.data["alert"] = "severe" - else if (alert_level==1) + else if(alert_level==1) alert_signal.data["alert"] = "minor" - else if (alert_level==0) + else if(alert_level==0) alert_signal.data["alert"] = "clear" frequency.post_signal(src, alert_signal) @@ -455,7 +453,7 @@ /obj/machinery/alarm/attack_hand(mob/user) . = ..() - if (.) + if(.) return return interact(user) @@ -485,7 +483,7 @@ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if(!ui) - ui = new(user, src, ui_key, "air_alarm.tmpl", src.name, 325, 625, master_ui = master_ui, state = state) + ui = new(user, src, ui_key, "air_alarm.tmpl", name, 325, 625, master_ui = master_ui, state = state) ui.set_initial_data(data) ui.open() ui.set_auto_update(1) @@ -570,7 +568,7 @@ "carbon dioxide" = "CO2", "phoron" = "Toxin", "other" = "Other") - for (var/g in gas_names) + for(var/g in gas_names) thresholds[++thresholds.len] = list("name" = gas_names[g], "settings" = list()) selected = TLV[g] for(var/i = 1, i <= 4, i++) @@ -586,7 +584,6 @@ for(var/i = 1, i <= 4, i++) thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = i, "selected" = selected[i])) - data["thresholds"] = thresholds /obj/machinery/alarm/CanUseTopic(var/mob/user, var/datum/topic_state/state, var/href_list = list()) @@ -660,7 +657,7 @@ "panic_siphon", "scrubbing") - send_signal(device_id, list(href_list["command"] = text2num(href_list["val"]) ) ) + send_signal(device_id, list(href_list["command"] = text2num(href_list["val"]))) return 1 if("set_threshold") @@ -668,16 +665,16 @@ var/threshold = text2num(href_list["var"]) var/list/selected = TLV[env] var/list/thresholds = list("lower bound", "low warning", "high warning", "upper bound") - var/newval = input("Enter [thresholds[threshold]] for [env]", "Alarm triggers", selected[threshold]) as null|num - if (isnull(newval)) + var/newval = input("Enter [thresholds[threshold]] for [env]", "Alarm triggers", selected[threshold]) as null | num + if(isnull(newval)) return 1 - if (newval<0) + if(newval<0) selected[threshold] = -1.0 - else if (env=="temperature" && newval>5000) + else if(env=="temperature" && newval>5000) selected[threshold] = 5000 - else if (env=="pressure" && newval>50*ONE_ATMOSPHERE) + else if(env=="pressure" && newval>50*ONE_ATMOSPHERE) selected[threshold] = 50*ONE_ATMOSPHERE - else if (env!="temperature" && env!="pressure" && newval>200) + else if(env!="temperature" && env!="pressure" && newval>200) selected[threshold] = 200 else newval = round(newval,0.01) @@ -727,13 +724,13 @@ return 1 if(href_list["atmos_alarm"]) - if (alarm_area.atmosalert(2, src)) + if(alarm_area.atmosalert(2, src)) apply_danger_level(2) update_icon() return 1 if(href_list["atmos_reset"]) - if (alarm_area.atmosalert(0, src)) + if(alarm_area.atmosalert(0, src)) apply_danger_level(0) update_icon() return 1 @@ -744,35 +741,13 @@ return 1 /obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob) - src.add_fingerprint(user) - if(istype(W, /obj/item/weapon/screwdriver)) // Opening that Air Alarm up. - //user << "You pop the Air Alarm's maintence panel open." - wiresexposed = !wiresexposed - user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]" - update_icon() + add_fingerprint(user) + if(alarm_deconstruction_screwdriver(user, W)) + return + if(alarm_deconstruction_wirecutters(user, W)) return - if (wiresexposed && istype(W, /obj/item/weapon/wirecutters)) - user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") - playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) - new/obj/item/stack/cable_coil(get_turf(src), 5) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "airalarm" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.set_dir(dir) - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) - A.state = 2 - A.icon_state = "airalarm_2" - M.deconstruct(src) - qdel(src) - return - - if (istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))// trying to unlock the interface with an ID card + if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))// trying to unlock the interface with an ID card if(stat & (NOPOWER|BROKEN)) user << "It does nothing" return @@ -822,14 +797,14 @@ FIRE ALARM active_power_usage = 6 power_channel = ENVIRON var/last_process = 0 - var/wiresexposed = 0 + panel_open = 0 var/seclevel - circuit = /obj/item/weapon/circuitboard/firealarm + circuit = /obj/item/weapon/circuitboard/firealarm /obj/machinery/firealarm/update_icon() overlays.Cut() - if(wiresexposed) + if(panel_open) set_light(0) return @@ -840,7 +815,7 @@ FIRE ALARM icon_state = "firep" set_light(0) else - if(!src.detecting) + if(!detecting) icon_state = "fire1" set_light(l_range = 4, l_power = 2, l_color = "#ff0000") else @@ -851,79 +826,56 @@ FIRE ALARM if("red") set_light(l_range = 4, l_power = 2, l_color = "#ff0000") if("delta") set_light(l_range = 4, l_power = 2, l_color = "#FF6633") - src.overlays += image('icons/obj/monitors.dmi', "overlay_[seclevel]") + overlays += image('icons/obj/monitors.dmi', "overlay_[seclevel]") /obj/machinery/firealarm/fire_act(datum/gas_mixture/air, temperature, volume) - if(src.detecting) - if(temperature > T0C+200) - src.alarm() // added check of detector status here + if(detecting) + if(temperature > T0C + 200) + alarm() // added check of detector status here return /obj/machinery/firealarm/attack_ai(mob/user as mob) - return src.attack_hand(user) + return attack_hand(user) /obj/machinery/firealarm/bullet_act() - return src.alarm() + return alarm() /obj/machinery/firealarm/emp_act(severity) - if(prob(50/severity)) - alarm(rand(30/severity, 60/severity)) + if(prob(50 / severity)) + alarm(rand(30 / severity, 60 / severity)) ..() /obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob) - src.add_fingerprint(user) + add_fingerprint(user) - if (istype(W, /obj/item/weapon/screwdriver)) - wiresexposed = !wiresexposed - update_icon() - return - - if(wiresexposed) - if (istype(W, /obj/item/device/multitool)) - src.detecting = !( src.detecting ) - if (src.detecting) + if(panel_open) + if(istype(W, /obj/item/device/multitool)) + detecting = !(detecting) + if(detecting) user.visible_message("\The [user] has reconnected [src]'s detecting unit!", "You have reconnected [src]'s detecting unit.") else user.visible_message("\The [user] has disconnected [src]'s detecting unit!", "You have disconnected [src]'s detecting unit.") - else if (istype(W, /obj/item/weapon/wirecutters)) - user.visible_message("\The [user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") - new/obj/item/stack/cable_coil(get_turf(src), 5) - playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "firealarm" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.set_dir(dir) - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) - A.state = 2 - A.icon_state = "firealarm_2" - M.deconstruct(src) - qdel(src) return - src.alarm() + alarm() return /obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed if(stat & (NOPOWER|BROKEN)) return - if(src.timing) - if(src.time > 0) - src.time = src.time - ((world.timeofday - last_process)/10) + if(timing) + if(time > 0) + time = time - ((world.timeofday - last_process) / 10) else - src.alarm() - src.time = 0 - src.timing = 0 + alarm() + time = 0 + timing = 0 processing_objects.Remove(src) - src.updateDialog() + updateDialog() last_process = world.timeofday - if(locate(/obj/fire) in loc) + if(locate(/obj/fire) in src.loc) alarm() return @@ -934,41 +886,41 @@ FIRE ALARM update_icon() /obj/machinery/firealarm/attack_hand(mob/user as mob) - if(user.stat || stat & (NOPOWER|BROKEN)) + if(user.stat || stat & (NOPOWER | BROKEN)) return user.set_machine(src) var/area/A = src.loc var/d1 var/d2 - if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon)) + if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon)) A = A.loc - if (A.fire) + if(A.fire) d1 = text("Reset - Lockdown", src) else d1 = text("Alarm - Lockdown", src) - if (src.timing) + if(timing) d2 = text("Stop Time Lock", src) else d2 = text("Initiate Time Lock", src) - var/second = round(src.time) % 60 - var/minute = (round(src.time) - second) / 60 + var/second = round(time) % 60 + var/minute = (round(time) - second) / 60 var/dat = "Fire alarm [d1]\n
The current alert level is: [get_security_level()]

\nTimer System: [d2]
\nTime Left: [(minute ? "[minute]:" : null)][second] - - + +\n
" user << browse(dat, "window=firealarm") onclose(user, "firealarm") else A = A.loc - if (A.fire) + if(A.fire) d1 = text("[]", src, stars("Reset - Lockdown")) else d1 = text("[]", src, stars("Alarm - Lockdown")) - if (src.timing) + if(timing) d2 = text("[]", src, stars("Stop Time Lock")) else d2 = text("[]", src, stars("Initiate Time Lock")) - var/second = round(src.time) % 60 - var/minute = (round(src.time) - second) / 60 + var/second = round(time) % 60 + var/minute = (round(time) - second) / 60 var/dat = "[stars("Fire alarm")] [d1]\n
The current alert level is: [stars(get_security_level())]

\nTimer System: [d2]
\nTime Left: [(minute ? text("[]:", minute) : null)][second] - - + +\n
" user << browse(dat, "window=firealarm") onclose(user, "firealarm") @@ -976,43 +928,43 @@ FIRE ALARM /obj/machinery/firealarm/Topic(href, href_list) ..() - if (usr.stat || stat & (BROKEN|NOPOWER)) + if(usr.stat || stat & (BROKEN | NOPOWER)) return - if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) + if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) usr.set_machine(src) - if (href_list["reset"]) - src.reset() - else if (href_list["alarm"]) - src.alarm() - else if (href_list["time"]) - src.timing = text2num(href_list["time"]) + if(href_list["reset"]) + reset() + else if(href_list["alarm"]) + alarm() + else if(href_list["time"]) + timing = text2num(href_list["time"]) last_process = world.timeofday processing_objects.Add(src) - else if (href_list["tp"]) + else if(href_list["tp"]) var/tp = text2num(href_list["tp"]) - src.time += tp - src.time = min(max(round(src.time), 0), 120) + time += tp + time = min(max(round(time), 0), 120) - src.updateUsrDialog() + updateUsrDialog() - src.add_fingerprint(usr) + add_fingerprint(usr) else usr << browse(null, "window=firealarm") return return /obj/machinery/firealarm/proc/reset() - if (!( src.working )) + if(!(working)) return var/area/area = get_area(src) for(var/obj/machinery/firealarm/FA in area) - fire_alarm.clearAlarm(loc, FA) + fire_alarm.clearAlarm(src.loc, FA) update_icon() return /obj/machinery/firealarm/proc/alarm(var/duration = 0) - if (!( src.working)) + if(!(working)) return var/area/area = get_area(src) for(var/obj/machinery/firealarm/FA in area) @@ -1066,13 +1018,13 @@ Just a object used in constructing fire alarms ASSERT(isarea(A)) var/d1 var/d2 - if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai)) + if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai)) - if (A.party) + if(A.party) d1 = text("No Party :(", src) else d1 = text("PARTY!!!", src) - if (timing) + if(timing) d2 = text("Stop Time Lock", src) else d2 = text("Initiate Time Lock", src) @@ -1082,11 +1034,11 @@ Just a object used in constructing fire alarms user << browse(dat, "window=partyalarm") onclose(user, "partyalarm") else - if (A.fire) + if(A.fire) d1 = text("[]", src, stars("No Party :(")) else d1 = text("[]", src, stars("PARTY!!!")) - if (timing) + if(timing) d2 = text("[]", src, stars("Stop Time Lock")) else d2 = text("[]", src, stars("Initiate Time Lock")) @@ -1098,7 +1050,7 @@ Just a object used in constructing fire alarms return /obj/machinery/partyalarm/proc/reset() - if (!( working )) + if(!(working)) return var/area/A = get_area(src) ASSERT(isarea(A)) @@ -1106,7 +1058,7 @@ Just a object used in constructing fire alarms return /obj/machinery/partyalarm/proc/alarm() - if (!( working )) + if(!(working)) return var/area/A = get_area(src) ASSERT(isarea(A)) @@ -1115,23 +1067,20 @@ Just a object used in constructing fire alarms /obj/machinery/partyalarm/Topic(href, href_list) ..() - if (usr.stat || stat & (BROKEN|NOPOWER)) + if(usr.stat || stat & (BROKEN|NOPOWER)) return - if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) + if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) usr.machine = src - if (href_list["reset"]) + if(href_list["reset"]) reset() - else - if (href_list["alarm"]) - alarm() - else - if (href_list["time"]) - timing = text2num(href_list["time"]) - else - if (href_list["tp"]) - var/tp = text2num(href_list["tp"]) - time += tp - time = min(max(round(time), 0), 120) + else if(href_list["alarm"]) + alarm() + else if(href_list["time"]) + timing = text2num(href_list["time"]) + else if(href_list["tp"]) + var/tp = text2num(href_list["tp"]) + time += tp + time = min(max(round(time), 0), 120) updateUsrDialog() add_fingerprint(usr) diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm index 19d1ee1253..83c6f81e30 100644 --- a/code/game/machinery/atmo_control.dm +++ b/code/game/machinery/atmo_control.dm @@ -58,7 +58,6 @@ signal.data["sigtype"]="status" radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) - /obj/machinery/air_sensor/proc/set_frequency(new_frequency) radio_controller.remove_object(src, frequency) frequency = new_frequency @@ -76,12 +75,9 @@ obj/machinery/air_sensor/Destroy() icon = 'icons/obj/computer.dmi' icon_keyboard = "atmos_key" icon_screen = "tank" - name = "Computer" - var/frequency = 1439 var/list/sensors = list() - var/list/sensor_information = list() var/datum/radio_frequency/radio_connection circuit = /obj/item/weapon/circuitboard/air_management @@ -121,8 +117,8 @@ obj/machinery/computer/general_air_control/Destroy() data["sensors"] = sensors_ui ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if (!ui) - ui = new(user, src, ui_key, "atmo_control.tmpl", src.name, 525, 600) + if(!ui) + ui = new(user, src, ui_key, "atmo_control.tmpl", name, 525, 600) ui.set_initial_data(data) ui.open() ui.set_auto_update(5) @@ -137,14 +133,11 @@ obj/machinery/computer/general_air_control/Destroy() /obj/machinery/computer/general_air_control/large_tank_control icon = 'icons/obj/computer.dmi' - frequency = 1441 var/input_tag var/output_tag - var/list/input_info var/list/output_info - var/input_flow_setting = 200 var/pressure_setting = ONE_ATMOSPHERE * 45 circuit = /obj/item/weapon/circuitboard/air_management/tank_control @@ -179,8 +172,8 @@ obj/machinery/computer/general_air_control/Destroy() data["pressure_setting"] = pressure_setting ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if (!ui) - ui = new(user, src, ui_key, "atmo_control.tmpl", src.name, 660, 500) + if(!ui) + ui = new(user, src, ui_key, "atmo_control.tmpl", name, 660, 500) ui.set_initial_data(data) ui.open() ui.set_auto_update(5) @@ -251,14 +244,11 @@ obj/machinery/computer/general_air_control/Destroy() /obj/machinery/computer/general_air_control/supermatter_core icon = 'icons/obj/computer.dmi' - frequency = 1438 var/input_tag var/output_tag - var/list/input_info var/list/output_info - var/input_flow_setting = 700 var/pressure_setting = 100 circuit = /obj/item/weapon/circuitboard/air_management/supermatter_core @@ -292,8 +282,8 @@ obj/machinery/computer/general_air_control/Destroy() data["pressure_setting"] = pressure_setting ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if (!ui) - ui = new(user, src, ui_key, "atmo_control.tmpl", src.name, 650, 500) + if(!ui) + ui = new(user, src, ui_key, "atmo_control.tmpl", name, 650, 500) ui.set_initial_data(data) ui.open() ui.set_auto_update(5) @@ -365,12 +355,9 @@ obj/machinery/computer/general_air_control/Destroy() /obj/machinery/computer/general_air_control/fuel_injection icon = 'icons/obj/computer.dmi' icon_screen = "alert:0" - var/device_tag var/list/device_info - var/automation = 0 - var/cutoff_temperature = 2000 var/on_temperature = 1200 circuit = /obj/item/weapon/circuitboard/air_management/injector_control @@ -427,8 +414,8 @@ obj/machinery/computer/general_air_control/Destroy() data["device_info"] = null ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if (!ui) - ui = new(user, src, ui_key, "atmo_control.tmpl", src.name, 650, 500) + if(!ui) + ui = new(user, src, ui_key, "atmo_control.tmpl", name, 650, 500) ui.set_initial_data(data) ui.open() ui.set_auto_update(5) @@ -494,8 +481,4 @@ obj/machinery/computer/general_air_control/Destroy() "sigtype"="command" ) - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) - - - - + radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) \ No newline at end of file diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 236079f8e3..e9c7df22b2 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -26,7 +26,6 @@ /obj/machinery/autolathe/New() ..() wires = new(src) - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) @@ -48,7 +47,6 @@ current_category = machine_recipes.categories[1] /obj/machinery/autolathe/interact(mob/user as mob) - update_recipe_list() if(..() || (disabled && !panel_open)) @@ -119,7 +117,6 @@ onclose(user, "autolathe") /obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(busy) user << "\The [src] is busy. Please wait for completion of previous operation." return @@ -223,7 +220,6 @@ interact(user) /obj/machinery/autolathe/Topic(href, href_list) - if(..()) return @@ -277,7 +273,7 @@ if(!making || !src) return //Create the desired item. - var/obj/item/I = new making.path(loc) + var/obj/item/I = new making.path(src.loc) if(multiplier > 1 && istype(I, /obj/item/stack)) var/obj/item/stack/S = I S.amount = multiplier @@ -303,7 +299,6 @@ mat_efficiency = 1.1 - man_rating * 0.1// Normally, price is 1.25 the amount of material, so this shouldn't go higher than 0.8. Maximum rating of parts is 3 /obj/machinery/autolathe/dismantle() - for(var/mat in stored_material) var/material/M = get_material_by_name(mat) if(!istype(M)) diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm index 986d20e3b9..07f0b8f9bd 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -15,7 +15,6 @@ var/build_eff = 1 var/eat_eff = 1 - /obj/machinery/biogenerator/New() ..() var/datum/reagents/R = new/datum/reagents(1000) @@ -23,11 +22,9 @@ R.my_atom = src beaker = new /obj/item/weapon/reagent_containers/glass/bottle(src) - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) - RefreshParts() /obj/machinery/biogenerator/on_reagent_change() //When the reagents change, change the icon as well. @@ -96,13 +93,13 @@ return user.set_machine(src) var/dat = "BiogeneratorBiogenerator:
" - if (processing) + if(processing) dat += "Biogenerator is processing! Please wait..." else dat += "Biomass: [points] points.
" switch(menustat) if("menu") - if (beaker) + if(beaker) dat += "Activate Biogenerator!
" dat += "Detach Container

" dat += "Food
" @@ -139,9 +136,9 @@ interact(user) /obj/machinery/biogenerator/proc/activate() - if (usr.stat) + if(usr.stat) return - if (stat) //NOPOWER etc + if(stat) //NOPOWER etc return if(processing) usr << "The biogenerator is in the process of working." @@ -255,4 +252,4 @@ man_rating += P.rating build_eff = man_rating - eat_eff = bin_rating + eat_eff = bin_rating \ No newline at end of file diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 70557a2e18..b072a7e488 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -10,9 +10,8 @@ idle_power_usage = 2 active_power_usage = 4 - /obj/machinery/button/attack_ai(mob/user as mob) - return src.attack_hand(user) + return attack_hand(user) /obj/machinery/button/attackby(obj/item/weapon/W, mob/user as mob) - return src.attack_hand(user) \ No newline at end of file + return attack_hand(user) \ No newline at end of file diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 9ff0b2f894..1e5c6ec73b 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -14,7 +14,7 @@ /obj/machinery/cell_charger/update_icon() icon_state = "ccharger[charging ? 1 : 0]" - if(charging && !(stat & (BROKEN|NOPOWER)) ) + if(charging && !(stat & (BROKEN|NOPOWER))) var/newlevel = round(charging.percent() * 4.0 / 99) //world << "nl: [newlevel]" @@ -73,14 +73,14 @@ charging.add_fingerprint(user) charging.update_icon() - src.charging = null + charging = null user.visible_message("[user] removes the cell from the charger.", "You remove the cell from the charger.") chargelevel = -1 update_icon() /obj/machinery/cell_charger/attack_ai(mob/user) if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough - if(!src.charging) + if(!charging) return charging.loc = src.loc @@ -104,7 +104,7 @@ update_use_power(0) return - if (charging && !charging.fully_charged()) + if(charging && !charging.fully_charged()) charging.give(active_power_usage*CELLRATE) update_use_power(2) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 19d187ade4..88bafe5cd3 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -47,7 +47,6 @@ /obj/machinery/clonepod/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) @@ -184,7 +183,7 @@ else if((occupant.health >= heal_level) && (!eject_wait)) playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) - src.audible_message("\The [src] signals that the cloning process is complete.") + audible_message("\The [src] signals that the cloning process is complete.") connected_message("Cloning Process Complete.") locked = 0 go_out() @@ -235,7 +234,7 @@ connected = null else anchored = 1 - playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) if(anchored) user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.") else @@ -298,7 +297,7 @@ if(mess) //Clean that mess and dump those gibs! mess = 0 - gibs(loc) + gibs(src.loc) update_icon() return @@ -308,7 +307,7 @@ if(occupant.client) occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE - occupant.loc = loc + occupant.loc = src.loc eject_wait = 0 //If it's still set somehow. domutcheck(occupant) //Waiting until they're out before possible transforming. occupant = null @@ -342,21 +341,21 @@ switch(severity) if(1.0) for(var/atom/movable/A as mob|obj in src) - A.loc = loc + A.loc = src.loc ex_act(severity) qdel(src) return if(2.0) if(prob(50)) for(var/atom/movable/A as mob|obj in src) - A.loc = loc + A.loc = src.loc ex_act(severity) qdel(src) return if(3.0) if(prob(25)) for(var/atom/movable/A as mob|obj in src) - A.loc = loc + A.loc = src.loc ex_act(severity) qdel(src) return @@ -366,9 +365,9 @@ /obj/machinery/clonepod/update_icon() ..() icon_state = "pod_0" - if (occupant && !(stat & NOPOWER)) + if(occupant && !(stat & NOPOWER)) icon_state = "pod_1" - else if (mess) + else if(mess) icon_state = "pod_g" //Health Tracker Implant diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 6f380739cc..5cdbdeab9c 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -7,7 +7,6 @@ use_power = 1 idle_power_usage = 300 active_power_usage = 300 - frame_type = "computer" var/processing = 0 var/icon_keyboard = "generic_key" @@ -97,37 +96,8 @@ return text /obj/machinery/computer/attackby(I as obj, user as mob) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - user << "You start disconnecting the monitor." - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.circuit = M - A.anchored = 1 - A.density = 1 - A.frame_type = M.board_type - for (var/obj/C in src) - C.forceMove(loc) - if (src.stat & BROKEN) - user << "The broken glass falls out." - new /obj/item/weapon/material/shard( src.loc ) - A.state = 3 - A.icon_state = "[A.frame_type]_3" - else - user << "You disconnect the monitor." - A.state = 4 - A.icon_state = "[A.frame_type]_4" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - M.deconstruct(src) - qdel(src) + if(computer_deconstruction_screwdriver(user, I)) + return else - src.attack_hand(user) - return - - - - - - + attack_hand(user) + return \ No newline at end of file diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm index b3f9765746..333c12cd44 100644 --- a/code/game/machinery/computer/guestpass.dm +++ b/code/game/machinery/computer/guestpass.dm @@ -65,25 +65,6 @@ /obj/machinery/computer/guestpass/attackby(obj/I, mob/user) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - user << "You start disconnecting the monitor." - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "guestpass" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) - user << "You disconnect the monitor." - A.state = 4 - A.icon_state = "guestpass_4" - M.deconstruct(src) - qdel(src) - return if(istype(I, /obj/item/weapon/card/id)) if(!giver && user.unEquip(I)) I.forceMove(src) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 665f74d926..1236ae0e5b 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -1,5 +1,4 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 - //Circuit boards are in /code/game/objects/items/weapons/circuitboards/machinery/ /obj/machinery/constructable_frame //Made into a seperate type to make future revisions easier. diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 6c4c6160cd..7a1b12509c 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -27,10 +27,10 @@ initialize_directions = dir /obj/machinery/atmospherics/unary/cryo_cell/Destroy() - var/turf/T = loc + var/turf/T = src.loc T.contents += contents if(beaker) - beaker.loc = get_step(loc, SOUTH) //Beaker is carefully ejected from the wreckage of the cryotube + beaker.loc = get_step(src.loc, SOUTH) //Beaker is carefully ejected from the wreckage of the cryotube ..() /obj/machinery/atmospherics/unary/cryo_cell/initialize() @@ -64,7 +64,7 @@ /obj/machinery/atmospherics/unary/cryo_cell/relaymove(mob/user as mob) // note that relaymove will also be called for mobs outside the cell with UI open - if(src.occupant == user && !user.stat) + if(occupant == user && !user.stat) go_out() /obj/machinery/atmospherics/unary/cryo_cell/attack_hand(mob/user) @@ -92,7 +92,7 @@ data["hasOccupant"] = occupant ? 1 : 0 var/occupantData[0] - if (occupant) + if(occupant) occupantData["name"] = occupant.name occupantData["stat"] = occupant.stat occupantData["health"] = occupant.health @@ -124,13 +124,13 @@ data["beakerVolume"] = 0 if(beaker) data["beakerLabel"] = beaker.label_text ? beaker.label_text : null - if (beaker.reagents && beaker.reagents.reagent_list.len) + if(beaker.reagents && beaker.reagents.reagent_list.len) for(var/datum/reagent/R in beaker.reagents.reagent_list) data["beakerVolume"] += R.volume // update the ui if it exists, returns null if no ui is passed/found ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if (!ui) + if(!ui) // the ui does not exist, so we'll create a new() one // for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm ui = new(user, src, ui_key, "cryo.tmpl", "Cryo Cell Control System", 520, 410) @@ -158,7 +158,7 @@ if(href_list["ejectBeaker"]) if(beaker) - beaker.loc = get_step(loc, SOUTH) + beaker.loc = get_step(src.loc, SOUTH) beaker = null if(href_list["ejectOccupant"]) @@ -235,7 +235,7 @@ occupant.adjustOxyLoss(-1) //severe damage should heal waaay slower without proper chemicals if(occupant.bodytemperature < 225) - if (occupant.getToxLoss()) + if(occupant.getToxLoss()) occupant.adjustToxLoss(max(-1, -20/occupant.getToxLoss())) var/heal_brute = occupant.getBruteLoss() ? min(1, 20/occupant.getBruteLoss()) : 0 var/heal_fire = occupant.getFireLoss() ? min(1, 20/occupant.getFireLoss()) : 0 @@ -267,15 +267,15 @@ //loc.assume_air(expel_gas) /obj/machinery/atmospherics/unary/cryo_cell/proc/go_out() - if(!( occupant )) + if(!(occupant)) return //for(var/obj/O in src) - // O.loc = loc - if (occupant.client) + // O.loc = src.loc + if(occupant.client) occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE - occupant.loc = get_step(loc, SOUTH) //this doesn't account for walls or anything, but i don't forsee that being a problem. - if (occupant.bodytemperature < 261 && occupant.bodytemperature >= 70) //Patch by Aranclanos to stop people from taking burn damage after being ejected + occupant.loc = get_step(src.loc, SOUTH) //this doesn't account for walls or anything, but i don't forsee that being a problem. + if(occupant.bodytemperature < 261 && occupant.bodytemperature >= 70) //Patch by Aranclanos to stop people from taking burn damage after being ejected occupant.bodytemperature = 261 // Changed to 70 from 140 by Zuhayr due to reoccurance of bug. // occupant.metabslow = 0 occupant = null @@ -284,22 +284,22 @@ update_icon() return /obj/machinery/atmospherics/unary/cryo_cell/proc/put_mob(mob/living/carbon/M as mob) - if (stat & (NOPOWER|BROKEN)) + if(stat & (NOPOWER|BROKEN)) usr << "The cryo cell is not functioning." return - if (!istype(M)) + if(!istype(M)) usr << "The cryo cell cannot handle such a lifeform!" return - if (occupant) + if(occupant) usr << "The cryo cell is already occupied!" return - if (M.abiotic()) + if(M.abiotic()) usr << "Subject may not have abiotic items on." return if(!node) usr << "The cell is not correctly connected to its pipe network!" return - if (M.client) + if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src M.stop_pulling() @@ -320,7 +320,7 @@ set category = "Object" set src in oview(1) if(usr == occupant)//If the user is inside the tube... - if (usr.stat == 2)//and he's not dead.... + if(usr.stat == 2)//and he's not dead.... return usr << "Release sequence activated. This will take two minutes." sleep(1200) @@ -328,7 +328,7 @@ return go_out()//and release him from the eternal prison. else - if (usr.stat != 0) + if(usr.stat != 0) return go_out() add_fingerprint(usr) @@ -342,7 +342,7 @@ if(M.Victim == usr) usr << "You're too busy getting your life sucked out of you." return - if (usr.stat != 0) + if(usr.stat != 0) return put_mob(usr) return @@ -353,7 +353,7 @@ /obj/machinery/atmospherics/unary/cryo_cell/return_air_for_internal_lifeform() //assume that the cryo cell has some kind of breath mask or something that //draws from the cryo tube's environment, instead of the cold internal air. - if(loc) + if(src.loc) return loc.return_air() else return null diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index e1c65243d9..9c3a8f26bb 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -6,7 +6,6 @@ * ~ Zuhayr */ - //Main cryopod console. /obj/machinery/computer/cryopod @@ -73,18 +72,18 @@ allow_items = 1 /obj/machinery/computer/cryopod/attack_ai() - src.attack_hand() + attack_hand() /obj/machinery/computer/cryopod/attack_hand(mob/user = usr) if(stat & (NOPOWER|BROKEN)) return user.set_machine(src) - src.add_fingerprint(usr) + add_fingerprint(usr) var/dat - if (!( ticker )) + if(!(ticker)) return dat += "

[storage_name]
" @@ -105,7 +104,7 @@ var/mob/user = usr - src.add_fingerprint(user) + add_fingerprint(user) if(href_list["log"]) @@ -159,7 +158,7 @@ I.forceMove(get_turf(src)) frozen_items -= I - src.updateUsrDialog() + updateUsrDialog() return /obj/item/weapon/circuitboard/cryopodcontrol @@ -395,7 +394,7 @@ O.forceMove(src) //Delete all items not on the preservation list. - var/list/items = src.contents.Copy() + var/list/items = contents.Copy() items -= occupant // Don't delete the occupant items -= announce // or the autosay radio. @@ -451,13 +450,13 @@ if(PDA_Manifest.len) PDA_Manifest.Cut() for(var/datum/data/record/R in data_core.medical) - if ((R.fields["name"] == occupant.real_name)) + if((R.fields["name"] == occupant.real_name)) qdel(R) for(var/datum/data/record/T in data_core.security) - if ((T.fields["name"] == occupant.real_name)) + if((T.fields["name"] == occupant.real_name)) qdel(T) for(var/datum/data/record/G in data_core.general) - if ((G.fields["name"] == occupant.real_name)) + if((G.fields["name"] == occupant.real_name)) qdel(G) icon_state = base_icon_state @@ -536,7 +535,7 @@ message_admins("[key_name_admin(M)] has entered a stasis pod.") //Despawning occurs when process() is called with an occupant without a client. - src.add_fingerprint(M) + add_fingerprint(M) /obj/machinery/cryopod/verb/eject() set name = "Eject Pod" @@ -548,14 +547,14 @@ icon_state = base_icon_state //Eject any items that aren't meant to be in the pod. - var/list/items = src.contents + var/list/items = contents if(occupant) items -= occupant if(announce) items -= announce for(var/obj/item/W in items) W.forceMove(get_turf(src)) - src.go_out() + go_out() add_fingerprint(usr) name = initial(name) @@ -569,7 +568,7 @@ if(usr.stat != 0 || !check_occupant_allowed(usr)) return - if(src.occupant) + if(occupant) usr << "\The [src] is in use." return @@ -585,7 +584,7 @@ if(!usr || !usr.client) return - if(src.occupant) + if(occupant) usr << "\The [src] is in use." return @@ -605,7 +604,7 @@ time_entered = world.time - src.add_fingerprint(usr) + add_fingerprint(usr) return @@ -626,7 +625,7 @@ return if(occupant.client) - occupant.client.eye = src.occupant.client.mob + occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE occupant.forceMove(get_turf(src)) @@ -640,7 +639,7 @@ return /obj/machinery/cryopod/proc/set_occupant(var/occupant) - src.occupant = occupant + occupant = occupant name = initial(name) if(occupant) name = "[name] ([occupant])" diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 0140a33fe3..fa4b601e91 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -1,11 +1,9 @@ /* CONTAINS: - Deployable items Barricades for reference: - access_security = 1 access_brig = 2 access_armory = 3 @@ -50,7 +48,6 @@ for reference: access_court = 42 access_clown = 43 access_mime = 44 - */ //Barricades! @@ -83,17 +80,17 @@ for reference: return material /obj/structure/barricade/attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/stack)) + if(istype(W, /obj/item/stack)) var/obj/item/stack/D = W if(D.get_material_name() != material.name) return //hitting things with the wrong type of stack usually doesn't produce messages, and probably doesn't need to. - if (health < maxhealth) - if (D.get_amount() < 1) + if(health < maxhealth) + if(D.get_amount() < 1) user << "You need one sheet of [material.display_name] to repair \the [src]." return visible_message("[user] begins to repair \the [src].") if(do_after(user,20) && health < maxhealth) - if (D.use(1)) + if(D.use(1)) health = maxhealth visible_message("[user] repairs \the [src].") return @@ -102,11 +99,11 @@ for reference: user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) switch(W.damtype) if("fire") - src.health -= W.force * 1 + health -= W.force * 1 if("brute") - src.health -= W.force * 0.75 + health -= W.force * 0.75 else - if (src.health <= 0) + if(health <= 0) visible_message("The barricade is smashed apart!") dismantle() qdel(src) @@ -125,8 +122,8 @@ for reference: qdel(src) return if(2.0) - src.health -= 25 - if (src.health <= 0) + health -= 25 + if(health <= 0) visible_message("\The [src] is blown apart!") dismantle() return @@ -158,114 +155,114 @@ for reference: var/locked = 0.0 // req_access = list(access_maint_tunnels) - New() +/obj/machinery/deployable/barrier/New() + ..() + + icon_state = "barrier[locked]" + +/obj/machinery/deployable/barrier/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/card/id/)) + if(allowed(user)) + if (emagged < 2.0) + locked = !locked + anchored = !anchored + icon_state = "barrier[locked]" + if((locked == 1.0) && (emagged < 2.0)) + user << "Barrier lock toggled on." + return + else if((locked == 0.0) && (emagged < 2.0)) + user << "Barrier lock toggled off." + return + else + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(2, 1, src) + s.start() + visible_message("BZZzZZzZZzZT") + return + return + else if(istype(W, /obj/item/weapon/wrench)) + if(health < maxhealth) + health = maxhealth + emagged = 0 + req_access = list(access_security) + visible_message("[user] repairs \the [src]!") + return + else if(emagged > 0) + emagged = 0 + req_access = list(access_security) + visible_message("[user] repairs \the [src]!") + return + return + else + switch(W.damtype) + if("fire") + health -= W.force * 0.75 + if("brute") + health -= W.force * 0.5 + else + if(health <= 0) + explode() ..() - src.icon_state = "barrier[src.locked]" - - attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/card/id/)) - if (src.allowed(user)) - if (src.emagged < 2.0) - src.locked = !src.locked - src.anchored = !src.anchored - src.icon_state = "barrier[src.locked]" - if ((src.locked == 1.0) && (src.emagged < 2.0)) - user << "Barrier lock toggled on." - return - else if ((src.locked == 0.0) && (src.emagged < 2.0)) - user << "Barrier lock toggled off." - return - else - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(2, 1, src) - s.start() - visible_message("BZZzZZzZZzZT") - return +/obj/machinery/deployable/barrier/ex_act(severity) + switch(severity) + if(1.0) + explode() return - else if (istype(W, /obj/item/weapon/wrench)) - if (src.health < src.maxhealth) - src.health = src.maxhealth - src.emagged = 0 - src.req_access = list(access_security) - visible_message("[user] repairs \the [src]!") - return - else if (src.emagged > 0) - src.emagged = 0 - src.req_access = list(access_security) - visible_message("[user] repairs \the [src]!") - return + if(2.0) + health -= 25 + if(health <= 0) + explode() return - else - switch(W.damtype) - if("fire") - src.health -= W.force * 0.75 - if("brute") - src.health -= W.force * 0.5 - else - if (src.health <= 0) - src.explode() - ..() + +/obj/machinery/deployable/barrier/emp_act(severity) + if(stat & (BROKEN|NOPOWER)) + return + if(prob(50/severity)) + locked = !locked + anchored = !anchored + icon_state = "barrier[locked]" - ex_act(severity) - switch(severity) - if(1.0) - src.explode() - return - if(2.0) - src.health -= 25 - if (src.health <= 0) - src.explode() - return - emp_act(severity) - if(stat & (BROKEN|NOPOWER)) - return - if(prob(50/severity)) - locked = !locked - anchored = !anchored - icon_state = "barrier[src.locked]" +/obj/machinery/deployable/barrier/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff. + if(air_group || (height==0)) + return 1 + if(istype(mover) && mover.checkpass(PASSTABLE)) + return 1 + else + return 0 - CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff. - if(air_group || (height==0)) - return 1 - if(istype(mover) && mover.checkpass(PASSTABLE)) - return 1 - else - return 0 +/obj/machinery/deployable/barrier/proc/explode() - proc/explode() + visible_message("[src] blows apart!") + var/turf/Tsec = get_turf(src) - visible_message("[src] blows apart!") - var/turf/Tsec = get_turf(src) +/* var/obj/item/stack/rods/ =*/ + PoolOrNew(/obj/item/stack/rods, Tsec) - /* var/obj/item/stack/rods/ =*/ - PoolOrNew(/obj/item/stack/rods, Tsec) + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(3, 1, src) + s.start() - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(3, 1, src) - s.start() + explosion(src.loc,-1,-1,0) + if(src) + qdel(src) - explosion(src.loc,-1,-1,0) - if(src) - qdel(src) - - /obj/machinery/deployable/barrier/emag_act(var/remaining_charges, var/mob/user) - if (src.emagged == 0) - src.emagged = 1 - src.req_access.Cut() - src.req_one_access.Cut() + if(emagged == 0) + emagged = 1 + req_access.Cut() + req_one_access.Cut() user << "You break the ID authentication lock on \the [src]." var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(2, 1, src) s.start() visible_message("BZZzZZzZZzZT") return 1 - else if (src.emagged == 1) - src.emagged = 2 + else if(emagged == 1) + emagged = 2 user << "You short out the anchoring mechanism on \the [src]." var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(2, 1, src) s.start() visible_message("BZZzZZzZZzZT") - return 1 + return 1 \ No newline at end of file diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index b51d72ccd8..7f7ce32e03 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -19,12 +19,12 @@ /obj/machinery/button/remote/attack_ai(mob/user as mob) if(wires & 2) - return src.attack_hand(user) + return attack_hand(user) else user << "Error, no route to host." /obj/machinery/button/remote/attackby(obj/item/weapon/W, mob/user as mob) - return src.attack_hand(user) + return attack_hand(user) /obj/machinery/button/remote/emag_act(var/remaining_charges, var/mob/user) if(req_access.len || req_one_access.len) @@ -37,7 +37,7 @@ if(..()) return - src.add_fingerprint(user) + add_fingerprint(user) if(stat & (NOPOWER|BROKEN)) return @@ -92,9 +92,9 @@ /obj/machinery/button/remote/airlock/trigger() for(var/obj/machinery/door/airlock/D in world) - if(D.id_tag == src.id) + if(D.id_tag == id) if(specialfunctions & OPEN) - if (D.density) + if(D.density) spawn(0) D.open() return @@ -136,7 +136,7 @@ /obj/machinery/button/remote/blast_door/trigger() for(var/obj/machinery/door/blast/M in world) - if(M.id == src.id) + if(M.id == id) if(M.density) spawn(0) M.open() @@ -155,7 +155,7 @@ /obj/machinery/button/remote/emitter/trigger(mob/user as mob) for(var/obj/machinery/power/emitter/E in world) - if(E.id == src.id) + if(E.id == id) spawn(0) E.activate(user) return @@ -174,21 +174,21 @@ update_icon() for(var/obj/machinery/door/blast/M in machines) - if (M.id == src.id) - spawn( 0 ) + if(M.id == id) + spawn(0) M.open() return sleep(20) for(var/obj/machinery/mass_driver/M in machines) - if(M.id == src.id) + if(M.id == id) M.drive() sleep(50) for(var/obj/machinery/door/blast/M in machines) - if (M.id == src.id) + if(M.id == id) spawn(0) M.close() return @@ -202,4 +202,4 @@ if(!active || (stat & NOPOWER)) icon_state = "launcherbtt" else - icon_state = "launcheract" + icon_state = "launcheract" \ No newline at end of file diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index 6661468f59..7a4087e2c4 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -4,7 +4,6 @@ var/list/doppler_arrays = list() name = "tachyon-doppler array" desc = "A highly precise directional sensor array which measures the release of quants from decaying tachyons. The doppler shifting of the mirror-image formed by these quants can reveal the size, location and temporal affects of energetic disturbances within a large radius ahead of the array." - /obj/machinery/doppler_array/New() ..() doppler_arrays += src @@ -39,13 +38,12 @@ var/list/doppler_arrays = list() for(var/mob/O in hearers(src, null)) O.show_message("[src] states coldly, \"[message]\"",2) - /obj/machinery/doppler_array/power_change() ..() if(stat & BROKEN) icon_state = "[initial(icon_state)]-broken" else - if( !(stat & NOPOWER) ) + if(!(stat & NOPOWER)) icon_state = initial(icon_state) else icon_state = "[initial(icon_state)]-off" \ No newline at end of file diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 7532cb1407..18844dcd73 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -1,5 +1,4 @@ // It is a gizmo that flashes a small area - /obj/machinery/flasher name = "Mounted flash" desc = "A wall-mounted flashbulb device." @@ -27,48 +26,48 @@ /obj/machinery/flasher/power_change() ..() - if ( !(stat & NOPOWER) ) + if(!(stat & NOPOWER)) icon_state = "[base_state]1" -// src.sd_SetLuminosity(2) +// sd_SetLuminosity(2) else icon_state = "[base_state]1-p" -// src.sd_SetLuminosity(0) +// sd_SetLuminosity(0) //Don't want to render prison breaks impossible /obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/wirecutters)) + if(istype(W, /obj/item/weapon/wirecutters)) add_fingerprint(user) - src.disable = !src.disable - if (src.disable) + disable = !disable + if(disable) user.visible_message("[user] has disconnected the [src]'s flashbulb!", "You disconnect the [src]'s flashbulb!") - if (!src.disable) + if(!disable) user.visible_message("[user] has connected the [src]'s flashbulb!", "You connect the [src]'s flashbulb!") //Let the AI trigger them directly. /obj/machinery/flasher/attack_ai() - if (src.anchored) - return src.flash() + if(anchored) + return flash() else return /obj/machinery/flasher/proc/flash() - if (!(powered())) + if(!(powered())) return - if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150)) + if((disable) || (last_flash && world.time < last_flash + 150)) return playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1) flick("[base_state]_flash", src) - src.last_flash = world.time + last_flash = world.time use_power(1500) for (var/mob/O in viewers(src, null)) - if (get_dist(src, O) > src.range) + if(get_dist(src, O) > range) continue var/flash_time = strength - if (istype(O, /mob/living/carbon/human)) + if(istype(O, /mob/living/carbon/human)) var/mob/living/carbon/human/H = O if(!H.eyecheck() <= 0) continue @@ -94,26 +93,26 @@ ..(severity) /obj/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj) - if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150)) + if((disable) || (last_flash && world.time < last_flash + 150)) return if(istype(AM, /mob/living/carbon)) var/mob/living/carbon/M = AM - if ((M.m_intent != "walk") && (src.anchored)) - src.flash() + if((M.m_intent != "walk") && (anchored)) + flash() /obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/wrench)) + if(istype(W, /obj/item/weapon/wrench)) add_fingerprint(user) - src.anchored = !src.anchored + anchored = !anchored - if (!src.anchored) + if(!anchored) user.show_message(text("[src] can now be moved.")) - src.overlays.Cut() + overlays.Cut() - else if (src.anchored) + else if(anchored) user.show_message(text("[src] is now secured.")) - src.overlays += "[base_state]-s" + overlays += "[base_state]-s" /obj/machinery/button/flasher name = "flasher button" @@ -130,7 +129,7 @@ icon_state = "launcheract" for(var/obj/machinery/flasher/M in machines) - if(M.id == src.id) + if(M.id == id) spawn() M.flash() @@ -139,4 +138,4 @@ icon_state = "launcherbtt" active = 0 - return + return \ No newline at end of file diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index e31a19b265..9f594e4178 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -1,5 +1,3 @@ -//these are probably broken - /obj/machinery/floodlight name = "Emergency Floodlight" icon = 'icons/obj/machines/floodlight.dmi' @@ -13,7 +11,7 @@ var/brightness_on = 8 //can't remember what the maxed out value is /obj/machinery/floodlight/New() - src.cell = new(src) + cell = new(src) cell.maxcharge = 1000 cell.charge = 1000 // 41minutes @ 200W ..() @@ -71,7 +69,6 @@ if(!turn_on(1)) user << "You try to turn on \the [src] but it does not work." - /obj/machinery/floodlight/attack_hand(mob/user as mob) if(open && cell) if(ishuman(user)) @@ -79,12 +76,12 @@ user.put_in_hands(cell) cell.loc = user.loc else - cell.loc = loc + cell.loc = src.loc cell.add_fingerprint(user) cell.update_icon() - src.cell = null + cell = null on = 0 set_light(0) user << "You remove the power cell" @@ -99,10 +96,9 @@ update_icon() - /obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/screwdriver)) - if (!open) + if(istype(W, /obj/item/weapon/screwdriver)) + if(!open) if(unlocked) unlocked = 0 user << "You screw the battery panel in place." @@ -110,7 +106,7 @@ unlocked = 1 user << "You unscrew the battery panel." - if (istype(W, /obj/item/weapon/crowbar)) + if(istype(W, /obj/item/weapon/crowbar)) if(unlocked) if(open) open = 0 @@ -121,7 +117,7 @@ open = 1 user << "You remove the battery panel." - if (istype(W, /obj/item/weapon/cell)) + if(istype(W, /obj/item/weapon/cell)) if(open) if(cell) user << "There is a power cell already installed." diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index 7298b62abf..a134e68e3f 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -132,7 +132,7 @@ var/list/floor_light_cache = list() if(1) qdel(src) if(2) - if (prob(50)) + if(prob(50)) qdel(src) else if(prob(20)) stat |= BROKEN @@ -140,7 +140,7 @@ var/list/floor_light_cache = list() if(isnull(damaged)) damaged = 0 if(3) - if (prob(5)) + if(prob(5)) qdel(src) else if(isnull(damaged)) damaged = 0 diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm index c682a2b228..1cbccc195c 100644 --- a/code/game/machinery/floorlayer.dm +++ b/code/game/machinery/floorlayer.dm @@ -1,5 +1,4 @@ /obj/machinery/floorlayer - name = "automatic floor layer" icon = 'icons/obj/stationobjs.dmi' icon_state = "pipe_d" @@ -35,8 +34,7 @@ return /obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob) - - if (istype(W, /obj/item/weapon/wrench)) + if(istype(W, /obj/item/weapon/wrench)) var/m = input("Choose work mode", "Mode") as null|anything in mode mode[m] = !mode[m] var/O = mode[m] @@ -109,4 +107,4 @@ /obj/machinery/floorlayer/proc/CollectTiles(var/turf/w_turf) for(var/obj/item/stack/tile/tile in w_turf) - TakeTile(tile) + TakeTile(tile) \ No newline at end of file diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm index 1dddcedea0..3005996f0b 100644 --- a/code/game/machinery/frame.dm +++ b/code/game/machinery/frame.dm @@ -1,3 +1,177 @@ +/var/global/list/construction_frame_wall +/var/global/list/construction_frame_floor + +/proc/populate_frame_types() + //Create global frame type list if it hasn't been made already. + construction_frame_wall = list() + construction_frame_floor = list() + for(var/R in typesof(/datum/frame/frame_types) - /datum/frame/frame_types) + var/datum/frame/frame_types/type = new R + if(type.frame_style == "wall") + construction_frame_wall += type + else + construction_frame_floor += type + + var/datum/frame/frame_types/cancel/cancel = new /datum/frame/frame_types/cancel + construction_frame_wall += cancel + construction_frame_floor += cancel + +/datum/frame/frame_types + var/name + var/frame_size = 5 + var/frame_class + var/circuit + var/frame_style = "floor" + var/x_offset + var/y_offset + +/datum/frame/frame_types/computer + name = "Computer" + frame_class = "computer" + +/datum/frame/frame_types/machine + name = "Machine" + frame_class = "machine" + +/datum/frame/frame_types/conveyor + name = "Conveyor" + frame_class = "machine" + circuit = /obj/item/weapon/circuitboard/conveyor + +/datum/frame/frame_types/photocopier + name = "Photocopier" + frame_class = "machine" + +/datum/frame/frame_types/washing_machine + name = "Washing Machine" + frame_class = "machine" + +/datum/frame/frame_types/medical_console + name = "Medical Console" + frame_class = "computer" + +/datum/frame/frame_types/medical_pod + name = "Medical Pod" + frame_class = "machine" + +/datum/frame/frame_types/dna_analyzer + name = "DNA Analyzer" + frame_class = "machine" + +/datum/frame/frame_types/mass_driver + name = "Mass Driver" + frame_class = "machine" + circuit = /obj/item/weapon/circuitboard/mass_driver + +/datum/frame/frame_types/holopad + name = "Holopad" + frame_class = "computer" + frame_size = 4 + +/datum/frame/frame_types/microwave + name = "Microwave" + frame_class = "machine" + frame_size = 4 + +/datum/frame/frame_types/fax + name = "Fax" + frame_class = "machine" + frame_size = 3 + +/datum/frame/frame_types/recharger + name = "Recharger" + frame_class = "machine" + circuit = /obj/item/weapon/circuitboard/recharger + frame_size = 3 + +/datum/frame/frame_types/grinder + name = "Grinder" + frame_class = "machine" + circuit = /obj/item/weapon/circuitboard/grinder + frame_size = 3 + +/datum/frame/frame_types/display + name = "Display" + frame_class = "display" + frame_style = "wall" + x_offset = 32 + y_offset = 32 + +/datum/frame/frame_types/supply_request_console + name = "Supply Request Console" + frame_class = "display" + frame_style = "wall" + x_offset = 32 + y_offset = 32 + +/datum/frame/frame_types/atm + name = "ATM" + frame_class = "display" + frame_size = 3 + frame_style = "wall" + x_offset = 32 + y_offset = 32 + +/datum/frame/frame_types/newscaster + name = "Newscaster" + frame_class = "display" + frame_size = 3 + frame_style = "wall" + x_offset = 28 + y_offset = 30 + +/datum/frame/frame_types/wall_charger + name = "Wall Charger" + frame_class = "machine" + circuit = /obj/item/weapon/circuitboard/recharger/wrecharger + frame_size = 3 + frame_style = "wall" + x_offset = 32 + y_offset = 32 + +/datum/frame/frame_types/fire_alarm + name = "Fire Alarm" + frame_class = "alarm" + frame_size = 2 + frame_style = "wall" + x_offset = 24 + y_offset = 24 + +/datum/frame/frame_types/air_alarm + name = "Air Alarm" + frame_class = "alarm" + frame_size = 2 + frame_style = "wall" + x_offset = 24 + y_offset = 24 + +/datum/frame/frame_types/guest_pass_console + name = "Guest Pass Console" + frame_class = "display" + frame_size = 2 + frame_style = "wall" + x_offset = 30 + y_offset = 30 + +/datum/frame/frame_types/intercom + name = "Intercom" + frame_class = "alarm" + frame_size = 2 + frame_style = "wall" + x_offset = 28 + y_offset = 28 + +/datum/frame/frame_types/keycard_authenticator + name = "Keycard Authenticator" + frame_class = "alarm" + frame_size = 1 + frame_style = "wall" + x_offset = 24 + y_offset = 24 + +/datum/frame/frame_types/cancel //used to get out of input dialogue + name = "Cancel" + /obj/structure/frame anchored = 0 name = "frame" @@ -6,20 +180,16 @@ var/state = 0 var/obj/item/weapon/circuitboard/circuit = null var/need_circuit = 1 - var/frame_type = "machine" + var/datum/frame/frame_types/frame_type = new /datum/frame/frame_types/machine var/list/components = null var/list/req_components = null var/list/req_component_names = null - var/list/alarms = list("firealarm", "airalarm", "intercom", "keycard") - var/list/machines = list( - "machine", "photocopier", "fax", "microwave", "conveyor", "recharger", "wrecharger", - "washing", "grinder", "teleporter_hub", "teleporter_station", "medpod", "dna_analyzer", - "massdriver") - var/list/computers = list("computer", "holopad", "console") - var/list/displays = list("display", "guestpass", "newscaster", "atm", "request") - var/list/no_circuit = list("wrecharger", "recharger", "grinder", "conveyor", "massdriver") +/obj/structure/frame/computer //used for maps + frame_type = new /datum/frame/frame_types/computer + anchored = 1 + density = 1 /obj/structure/frame/proc/update_desc() var/D @@ -31,6 +201,12 @@ D = "Requires [english_list(component_list)]." desc = D +/obj/structure/frame/update_icon() + ..() + var/type = lowertext(frame_type.name) + type = replacetext(type, " ", "_") + icon_state = "[type]_[state]" + /obj/structure/frame/proc/check_components(mob/user as mob) components = list() req_components = circuit.req_components.Copy() @@ -41,175 +217,110 @@ var/obj/ct = A req_component_names[A] = initial(ct.name) -/obj/structure/frame/New(var/loc, var/dir, var/building = 0, var/obj/item/frame/frame_type, mob/user as mob) +/obj/structure/frame/New(var/loc, var/dir, var/building = 0, var/datum/frame/frame_types/type, mob/user as mob) ..() if(building) - src.frame_type = frame_type - icon_state = "[frame_type]_0" + frame_type = type + state = 0 + if(dir) - src.set_dir(dir) + set_dir(dir) - if(frame_type in alarms) - if(loc) - src.loc = loc + if(loc) + src.loc = loc - state = 0 - if(frame_type == "airalarm" || frame_type == "firealarm" || frame_type == "keycard") - if(dir) - src.set_dir(dir) - pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) - pixel_y = (dir & 3)? (dir == 1 ? -24 : 24) : 0 + if(frame_type.x_offset) + pixel_x = (dir & 3)? 0 : (dir == 4 ? -frame_type.x_offset : frame_type.x_offset) - if(frame_type == "intercom") - if(dir) - src.set_dir(dir) - pixel_x = (dir & 3)? 0 : (dir == 4 ? -28 : 28) - pixel_y = (dir & 3)? (dir == 1 ? -28 : 28) : 0 + if(frame_type.y_offset) + pixel_y = (dir & 3)? (dir == 1 ? -frame_type.y_offset : frame_type.y_offset) : 0 - update_icon() - return - - if(frame_type in displays) - if(loc) - src.loc = loc - - if(frame_type == "display" || frame_type == "atm" || frame_type == "request") - pixel_x = (dir & 3)? 0 : (dir == 4 ? -32 : 32) - pixel_y = (dir & 3)? (dir == 1 ? -32 : 32) : 0 - - if(frame_type == "newscaster") - pixel_x = (dir & 3)? 0 : (dir == 4 ? -28 : 28) - pixel_y = (dir & 3)? (dir == 1 ? -30 : 30) : 0 - - if(frame_type == "guestpass") - pixel_x = (dir & 3)? 0 : (dir == 4 ? -30 : 30) - pixel_y = (dir & 3)? (dir == 1 ? -30 : 30) : 0 - - update_icon() - return - - if(frame_type in no_circuit) + if(frame_type.circuit) need_circuit = 0 - if(frame_type == "wrecharger") - circuit = new /obj/item/weapon/circuitboard/recharger/wrecharger(src) - if(loc) - src.loc = loc + circuit = new frame_type.circuit(src) - state = 0 - - pixel_x = (dir & 3)? 0 : (dir == 4 ? -26 : 32) - pixel_y = (dir & 3)? (dir == 1 ? -32 : 32) : 0 - - update_icon() - return - if(frame_type == "recharger") - circuit = new /obj/item/weapon/circuitboard/recharger(src) - if(frame_type == "grinder") - circuit = new /obj/item/weapon/circuitboard/grinder(src) - if(frame_type == "conveyor") - circuit = new /obj/item/weapon/circuitboard/conveyor(src) - if(frame_type == "massdriver") - circuit = new /obj/item/weapon/circuitboard/mass_driver(src) - - if(frame_type == "computer") + if(frame_type.name == "Computer") density = 1 - if(frame_type in machines) + + if(frame_type.frame_class == "machine") density = 1 - return + + update_icon() /obj/structure/frame/attackby(obj/item/P as obj, mob/user as mob) if(istype(P, /obj/item/weapon/wrench)) - if(state == 0) + if(state == 0 && !anchored) user << "You start to wrench the frame into place." playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20)) - src.anchored = 1 + anchored = 1 if(!need_circuit && circuit) - src.state = 2 + state = 2 check_components() update_desc() - src.icon_state = "[frame_type]_2" user << "You wrench the frame into place and set the outer cover." else - src.state = 1 user << "You wrench the frame into place." - return - if(state == 1) + else if(state == 0 && anchored) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20)) user << "You unfasten the frame." - src.anchored = 0 - src.state = 0 - return + anchored = 0 - if(istype(P, /obj/item/weapon/weldingtool)) + else if(istype(P, /obj/item/weapon/weldingtool)) if(state == 0) var/obj/item/weapon/weldingtool/WT = P - if(!WT.remove_fuel(0, user)) + if(WT.remove_fuel(0, user)) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + if(do_after(user, 20)) + if(src && WT.isOn()) + user << "You deconstruct the frame." + new /obj/item/stack/material/steel(src.loc, frame_type.frame_size) + qdel(src) + return + else if(!WT.remove_fuel(0, user)) user << "The welding tool must be on to complete this task." return - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - if(do_after(user, 20)) - if(!src || !WT.isOn()) return - user << "You deconstruct the frame." - if(frame_type == "holopad" || frame_type == "microwave") - new /obj/item/stack/material/steel( src.loc, 4 ) - else if(frame_type == "fax" || frame_type == "newscaster" || frame_type == "recharger" || frame_type == "wrecharger" || frame_type == "grinder") - new /obj/item/stack/material/steel( src.loc, 3 ) - else if(frame_type == "firealarm" || frame_type == "airalarm" || frame_type == "intercom" || frame_type == "guestpass") - new /obj/item/stack/material/steel( src.loc, 2 ) - else if(frame_type == "keycard") - new /obj/item/stack/material/steel( src.loc, 1 ) - else - new /obj/item/stack/material/steel( src.loc, 5 ) - qdel(src) - return - if(istype(P, /obj/item/weapon/circuitboard) && need_circuit && !circuit) - if(state == 1) + else if(istype(P, /obj/item/weapon/circuitboard) && need_circuit && !circuit) + if(state == 0 && anchored) var/obj/item/weapon/circuitboard/B = P - if(B.board_type == frame_type) + var/datum/frame/frame_types/board_type = B.board_type + if(board_type.name == frame_type.name) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You place the circuit board inside the frame." - src.icon_state = "[frame_type]_1" - src.circuit = P + circuit = P user.drop_item() P.loc = src - if(frame_type in machines) //because machines are assholes + state = 1 + if(frame_type.frame_class == "machine") check_components() update_desc() - return else user << "This frame does not accept circuit boards of this type!" - return + return - if(istype(P, /obj/item/weapon/screwdriver)) + else if(istype(P, /obj/item/weapon/screwdriver)) if(state == 1) if(need_circuit && circuit) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You screw the circuit board into place." - src.state = 2 - src.icon_state = "[frame_type]_2" - return + state = 2 - if(state == 2) + else if(state == 2) if(need_circuit && circuit) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You unfasten the circuit board." - src.state = 1 - src.icon_state = "[frame_type]_1" - return + state = 1 - if(!need_circuit && circuit) + else if(!need_circuit && circuit) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You unfasten the outer cover." - src.state = 1 - src.icon_state = "[frame_type]_0" - return + state = 0 - if(state == 3) - if(frame_type in machines) + else if(state == 3) + if(frame_type.frame_class == "machine") var/component_check = 1 for(var/R in req_components) if(req_components[R] > 0) @@ -217,7 +328,7 @@ break if(component_check) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - var/obj/machinery/new_machine = new src.circuit.build_path(src.loc, src.dir) + var/obj/machinery/new_machine = new circuit.build_path(src.loc, dir) // Handle machines that have allocated default parts in thier constructor. if(new_machine.component_parts) for(var/CP in new_machine.component_parts) @@ -226,9 +337,9 @@ else new_machine.component_parts = list() - src.circuit.construct(new_machine) + circuit.construct(new_machine) - for(var/obj/O in src.components) + for(var/obj/O in components) if(circuit.contain_parts) O.loc = new_machine else @@ -240,173 +351,158 @@ new_machine.RefreshParts() - new_machine.pixel_x = src.pixel_x - new_machine.pixel_y = src.pixel_y + new_machine.pixel_x = pixel_x + new_machine.pixel_y = pixel_y qdel(src) - return + return - if(frame_type in alarms) + else if(frame_type.frame_class == "alarm") playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You fasten the cover." - var/obj/machinery/B = new src.circuit.build_path ( src.loc ) - B.pixel_x = src.pixel_x - B.pixel_y = src.pixel_y + var/obj/machinery/B = new circuit.build_path(src.loc) + B.pixel_x = pixel_x + B.pixel_y = pixel_y B.set_dir(dir) - src.circuit.construct(B) + circuit.construct(B) + circuit.loc = null + B.circuit = circuit qdel(src) return - if(state == 4) - if(frame_type in computers) + else if(state == 4) + if(frame_type.frame_class == "computer") playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You connect the monitor." - var/obj/machinery/B = new src.circuit.build_path ( src.loc ) - B.pixel_x = src.pixel_x - B.pixel_y = src.pixel_y + var/obj/machinery/B = new circuit.build_path(src.loc) + B.pixel_x = pixel_x + B.pixel_y = pixel_y B.set_dir(dir) - src.circuit.construct(B) + circuit.construct(B) + circuit.loc = null + B.circuit = circuit qdel(src) return - if(frame_type in displays) + else if(frame_type.frame_class == "display") playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You connect the monitor." - var/obj/machinery/B = new src.circuit.build_path ( src.loc ) - B.pixel_x = src.pixel_x - B.pixel_y = src.pixel_y + var/obj/machinery/B = new circuit.build_path(src.loc) + B.pixel_x = pixel_x + B.pixel_y = pixel_y B.set_dir(dir) - src.circuit.construct(B) + circuit.construct(B) + circuit.loc = null + B.circuit = circuit qdel(src) return - if(istype(P, /obj/item/weapon/crowbar)) + else if(istype(P, /obj/item/weapon/crowbar)) if(state == 1) if(need_circuit && circuit) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "You remove the circuit board." - src.state = 1 - src.icon_state = "[frame_type]_0" - circuit.loc = src.loc - src.circuit = null - if(frame_type in machines) //becuase machines are assholes + state = 0 + circuit.forceMove(src.loc) + circuit = null + if(frame_type.frame_class == "machine") req_components = null - return - if(state == 3) - if(frame_type in machines) + else if(state == 3) + if(frame_type.frame_class == "machine") playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) if(components.len == 0) user << "There are no components to remove." else user << "You remove the components." for(var/obj/item/weapon/W in components) - W.forceMove(loc) + W.forceMove(src.loc) check_components() update_desc() user << desc - return - if(state == 4) - if(frame_type in computers) + else if(state == 4) + if(frame_type.frame_class == "computer") playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "You remove the glass panel." - src.state = 3 - src.icon_state = "[frame_type]_3" - new /obj/item/stack/material/glass( src.loc, 2 ) - return + state = 3 + new /obj/item/stack/material/glass(src.loc, 2) - if(frame_type in displays) + else if(frame_type.frame_class == "display") playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "You remove the glass panel." - src.state = 3 - src.icon_state = "[frame_type]_3" - new /obj/item/stack/material/glass( src.loc, 2 ) - return + state = 3 + new /obj/item/stack/material/glass(src.loc, 2) - if(istype(P, /obj/item/stack/cable_coil)) + else if(istype(P, /obj/item/stack/cable_coil)) if(state == 2) var/obj/item/stack/cable_coil/C = P - if (C.get_amount() < 5) + if(C.get_amount() < 5) user << "You need five coils of wire to add them to the frame." return user << "You start to add cables to the frame." playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20) && state == 2) - if (C.use(5)) + if(C.use(5)) user << "You add cables to the frame." state = 3 - icon_state = "[frame_type]_3" - if(frame_type in machines) + if(frame_type.frame_class == "machine") user << desc - return - if(istype(P, /obj/item/weapon/wirecutters)) + else if(istype(P, /obj/item/weapon/wirecutters)) if(state == 3) - if(frame_type in computers) + if(frame_type.frame_class == "computer") playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." - src.state = 2 - src.icon_state = "[frame_type]_2" - new /obj/item/stack/cable_coil( src.loc, 5 ) - return + state = 2 + new /obj/item/stack/cable_coil(src.loc, 5) - if(frame_type in displays) + else if(frame_type.frame_class == "display") playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." - src.state = 2 - src.icon_state = "[frame_type]_2" - new /obj/item/stack/cable_coil( src.loc, 5 ) - return + state = 2 + new /obj/item/stack/cable_coil(src.loc, 5) - if(frame_type in alarms) + else if(frame_type.frame_class == "alarm") playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." - src.state = 2 - src.icon_state = "[frame_type]_2" - new /obj/item/stack/cable_coil( src.loc, 5 ) - return + state = 2 + new /obj/item/stack/cable_coil(src.loc, 5) - if(frame_type in machines) + else if(frame_type.frame_class == "machine") playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." - src.state = 2 - src.icon_state = "[frame_type]_2" - new /obj/item/stack/cable_coil( src.loc, 5 ) - return + state = 2 + new /obj/item/stack/cable_coil(src.loc, 5) - if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass") + else if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass") if(state == 3) - if(frame_type in computers) + if(frame_type.frame_class == "computer") var/obj/item/stack/G = P - if (G.get_amount() < 2) + if(G.get_amount() < 2) user << "You need two sheets of glass to put in the glass panel." return playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You start to put in the glass panel." if(do_after(user, 20) && state == 3) - if (G.use(2)) + if(G.use(2)) user << "You put in the glass panel." - src.state = 4 - src.icon_state = "[frame_type]_4" - return + state = 4 - if(frame_type in displays) + else if(frame_type.frame_class == "display") var/obj/item/stack/G = P - if (G.get_amount() < 2) + if(G.get_amount() < 2) user << "You need two sheets of glass to put in the glass panel." return playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You start to put in the glass panel." if(do_after(user, 20) && state == 3) - if (G.use(2)) + if(G.use(2)) user << "You put in the glass panel." - src.state = 4 - src.icon_state = "[frame_type]_4" - return + state = 4 - if(istype(P, /obj/item)) + else if(istype(P, /obj/item)) if(state == 3) - if(frame_type in machines) + if(frame_type.frame_class == "machine") for(var/I in req_components) if(istype(P, I) && (req_components[I] > 0)) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) @@ -423,10 +519,10 @@ update_desc() break - if(istype(P, /obj/item/stack/material/glass/reinforced)) + else if(istype(P, /obj/item/stack/material/glass/reinforced)) var/obj/item/stack/material/glass/reinforced/CP = P if(CP.get_amount() > 1) - var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided + var/camt = min(CP.amount, req_components[I]) // amount of glass to take, idealy amount required, but limited by amount provided var/obj/item/stack/material/glass/reinforced/CC = new /obj/item/stack/material/glass/reinforced(src) CC.amount = camt CC.update_icon() @@ -445,4 +541,6 @@ user << desc if(P && P.loc != src && !istype(P, /obj/item/stack/cable_coil) && !istype(P, /obj/item/stack/material)) user << "You cannot add that component to the machine!" - return \ No newline at end of file + return + + update_icon() \ No newline at end of file diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 58c8423a23..158b718e83 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -19,11 +19,9 @@ Possible to do for anyone motivated enough: Itegrate EMP effect to disable the unit. */ - /* * Holopad */ - #define HOLOPAD_PASSIVE_POWER_USAGE 1 #define HOLOGRAM_POWER_USAGE 2 #define RANGE_BASED 4 @@ -37,39 +35,19 @@ var/const/HOLOPAD_MODE = RANGE_BASED icon_state = "holopad0" show_messages = 1 circuit = /obj/item/weapon/circuitboard/holopad - layer = TURF_LAYER+0.1 //Preventing mice and drones from sneaking under them. - var/power_per_hologram = 500 //per usage per hologram idle_power_usage = 5 use_power = 1 - var/list/mob/living/silicon/ai/masters = new() //List of AIs that use the holopad var/last_request = 0 //to prevent request spam. ~Carn var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating. /obj/machinery/hologram/holopad/attackby(obj/item/I as obj, user as mob) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - user << "You start removing the glass." - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.circuit = M - A.anchored = 1 - A.density = 1 - A.frame_type = "holopad" - for (var/obj/C in src) - C.forceMove(loc) - user << "You remove the glass." - A.state = 4 - A.icon_state = "holopad_4" - M.deconstruct(src) - for (var/mob/living/silicon/ai/master in masters) - clear_holo(master) - qdel(src) + if(computer_deconstruction_screwdriver(user, I)) + return else - src.attack_hand(user) + attack_hand(user) return /obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. @@ -87,7 +65,7 @@ var/const/HOLOPAD_MODE = RANGE_BASED user << "A request for AI presence was already sent recently." /obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user) - if (!istype(user)) + if(!istype(user)) return /*There are pretty much only three ways to interact here. I don't need to check for client since they're clicking on an object. @@ -102,11 +80,11 @@ var/const/HOLOPAD_MODE = RANGE_BASED /obj/machinery/hologram/holopad/proc/activate_holo(mob/living/silicon/ai/user) if(!(stat & NOPOWER) && user.eyeobj.loc == src.loc)//If the projector has power and client eye is on it - if (user.holo) + if(user.holo) user << "ERROR: Image feed in progress." return create_holo(user)//Create one. - src.visible_message("A holographic image of [user] flicks to life right before your eyes!") + visible_message("A holographic image of [user] flicks to life right before your eyes!") else user << "ERROR: Unable to project hologram." return @@ -165,7 +143,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ user.holo = null qdel(masters[user])//Get rid of user's hologram masters -= user //Discard AI from the list of those who use holopad - if (!masters.len)//If no users left + if(!masters.len)//If no users left set_light(0) //pad lighting (hologram lighting will be handled automatically since its owner was deleted) icon_state = "holopad0" return 1 @@ -214,10 +192,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ if(1.0) qdel(src) if(2.0) - if (prob(50)) + if(prob(50)) qdel(src) if(3.0) - if (prob(5)) + if(prob(5)) qdel(src) return diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm index 6319871022..7e465db189 100644 --- a/code/game/machinery/holosign.dm +++ b/code/game/machinery/holosign.dm @@ -14,20 +14,20 @@ var/on_icon = "sign_on" /obj/machinery/holosign/proc/toggle() - if (stat & (BROKEN|NOPOWER)) + if(stat & (BROKEN|NOPOWER)) return lit = !lit use_power = lit ? 2 : 1 update_icon() /obj/machinery/holosign/update_icon() - if (!lit) + if(!lit) icon_state = "sign_off" else icon_state = on_icon /obj/machinery/holosign/power_change() - if (stat & NOPOWER) + if(stat & NOPOWER) lit = 0 use_power = 0 update_icon() @@ -55,8 +55,8 @@ icon_state = "light[active]" for(var/obj/machinery/holosign/M in machines) - if (M.id == src.id) - spawn( 0 ) + if(M.id == id) + spawn(0) M.toggle() return diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 5fd791843d..97c430f9d0 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -11,7 +11,7 @@ active_power_usage = 4 /obj/machinery/igniter/attack_ai(mob/user as mob) - return src.attack_hand(user) + return attack_hand(user) /obj/machinery/igniter/attack_hand(mob/user as mob) if(..()) @@ -19,14 +19,14 @@ add_fingerprint(user) use_power(50) - src.on = !( src.on ) - src.icon_state = text("igniter[]", src.on) + on = !(on) + icon_state = text("igniter[]", on) return /obj/machinery/igniter/process() //ugh why is this even in process()? - if (src.on && !(stat & NOPOWER) ) + if(on && !(stat & NOPOWER)) var/turf/location = src.loc - if (isturf(location)) + if(isturf(location)) location.hotspot_expose(1000,500,1) return 1 @@ -36,8 +36,8 @@ /obj/machinery/igniter/power_change() ..() - if(!( stat & NOPOWER) ) - icon_state = "igniter[src.on]" + if(!(stat & NOPOWER)) + icon_state = "igniter[on]" else icon_state = "igniter0" @@ -57,56 +57,54 @@ idle_power_usage = 2 active_power_usage = 4 - /obj/machinery/sparker/New() ..() /obj/machinery/sparker/power_change() ..() - if ( !(stat & NOPOWER) && disable == 0 ) + if(!(stat & NOPOWER) && disable == 0) icon_state = "[base_state]" -// src.sd_SetLuminosity(2) +// sd_SetLuminosity(2) else icon_state = "[base_state]-p" -// src.sd_SetLuminosity(0) +// sd_SetLuminosity(0) /obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/screwdriver)) + if(istype(W, /obj/item/weapon/screwdriver)) add_fingerprint(user) - src.disable = !src.disable - if (src.disable) + disable = !disable + if(disable) user.visible_message("[user] has disabled the [src]!", "You disable the connection to the [src].") icon_state = "[base_state]-d" - if (!src.disable) + if(!disable) user.visible_message("[user] has reconnected the [src]!", "You fix the connection to the [src].") - if(src.powered()) + if(powered()) icon_state = "[base_state]" else icon_state = "[base_state]-p" /obj/machinery/sparker/attack_ai() - if (src.anchored) - return src.ignite() + if(anchored) + return ignite() else return /obj/machinery/sparker/proc/ignite() - if (!(powered())) + if(!(powered())) return - if ((src.disable) || (src.last_spark && world.time < src.last_spark + 50)) + if((disable) || (last_spark && world.time < last_spark + 50)) return - flick("[base_state]-spark", src) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(2, 1, src) s.start() - src.last_spark = world.time + last_spark = world.time use_power(1000) var/turf/location = src.loc - if (isturf(location)) + if(isturf(location)) location.hotspot_expose(1000,500,1) return 1 @@ -132,14 +130,14 @@ icon_state = "launcheract" for(var/obj/machinery/sparker/M in machines) - if (M.id == src.id) - spawn( 0 ) + if(M.id == id) + spawn(0) M.ignite() for(var/obj/machinery/igniter/M in machines) - if(M.id == src.id) + if(M.id == id) use_power(50) - M.on = !( M.on ) + M.on = !(M.on) M.icon_state = text("igniter[]", M.on) sleep(50) @@ -147,4 +145,4 @@ icon_state = "launcherbtt" active = 0 - return + return \ No newline at end of file diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 4ae639c039..c0f2a284f4 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -10,7 +10,7 @@ /obj/machinery/iv_drip/var/obj/item/weapon/reagent_containers/beaker = null /obj/machinery/iv_drip/update_icon() - if(src.attached) + if(attached) icon_state = "hooked" else icon_state = "" @@ -41,28 +41,28 @@ return if(attached) - visible_message("[src.attached] is detached from \the [src]") - src.attached = null - src.update_icon() + visible_message("[attached] is detached from \the [src]") + attached = null + update_icon() return if(in_range(src, usr) && ishuman(over_object) && get_dist(over_object, src) <= 1) visible_message("[usr] attaches \the [src] to \the [over_object].") - src.attached = over_object - src.update_icon() + attached = over_object + update_icon() /obj/machinery/iv_drip/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/reagent_containers)) - if(!isnull(src.beaker)) + if(istype(W, /obj/item/weapon/reagent_containers)) + if(!isnull(beaker)) user << "There is already a reagent container loaded!" return user.drop_item() W.loc = src - src.beaker = W + beaker = W user << "You attach \the [W] to \the [src]." - src.update_icon() + update_icon() return if(istype(W, /obj/item/weapon/screwdriver)) @@ -70,11 +70,11 @@ user << "You start to dismantle the IV drip." if(do_after(user, 15)) user << "You dismantle the IV drip." - var/obj/item/stack/rods/A = new /obj/item/stack/rods( src.loc ) + var/obj/item/stack/rods/A = new /obj/item/stack/rods(src.loc) A.amount = 6 - if(src.beaker) - src.beaker.loc = get_turf(src) - src.beaker = null + if(beaker) + beaker.loc = get_turf(src) + beaker = null qdel(src) return else @@ -84,24 +84,24 @@ /obj/machinery/iv_drip/process() set background = 1 - if(src.attached) + if(attached) - if(!(get_dist(src, src.attached) <= 1 && isturf(src.attached.loc))) - visible_message("The needle is ripped out of [src.attached], doesn't that hurt?") - src.attached:apply_damage(3, BRUTE, pick("r_arm", "l_arm")) - src.attached = null - src.update_icon() + if(!(get_dist(src, attached) <= 1 && isturf(attached.loc))) + visible_message("The needle is ripped out of [attached], doesn't that hurt?") + attached:apply_damage(3, BRUTE, pick("r_arm", "l_arm")) + attached = null + update_icon() return - if(src.attached && src.beaker) + if(attached && beaker) // Give blood if(mode) - if(src.beaker.volume > 0) + if(beaker.volume > 0) var/transfer_amount = REM - if(istype(src.beaker, /obj/item/weapon/reagent_containers/blood)) + if(istype(beaker, /obj/item/weapon/reagent_containers/blood)) // speed up transfer on blood packs transfer_amount = 4 - src.beaker.reagents.trans_to_mob(src.attached, transfer_amount, CHEM_BLOOD) + beaker.reagents.trans_to_mob(attached, transfer_amount, CHEM_BLOOD) update_icon() // Take blood @@ -130,7 +130,7 @@ var/datum/reagent/B = T.take_blood(beaker,amount) - if (B) + if(B) beaker.reagents.reagent_list |= B beaker.reagents.update_total() beaker.on_reagent_change() @@ -138,9 +138,9 @@ update_icon() /obj/machinery/iv_drip/attack_hand(mob/user as mob) - if(src.beaker) - src.beaker.loc = get_turf(src) - src.beaker = null + if(beaker) + beaker.loc = get_turf(src) + beaker = null update_icon() else return ..() @@ -163,7 +163,7 @@ /obj/machinery/iv_drip/examine(mob/user) ..(user) - if (!(user in view(2)) && user!=src.loc) return + if(!(user in view(2)) && user != src.loc) return user << "The IV drip is [mode ? "injecting" : "taking blood"]." @@ -177,7 +177,7 @@ usr << "[attached ? attached : "No one"] is attached." -/obj/machinery/iv_drip/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) +/obj/machinery/iv_drip/CanPass(atom/movable/mover, turf/target, height = 0, air_group = 0) if(height && istype(mover) && mover.checkpass(PASSTABLE)) //allow bullets, beams, thrown objects, mice, drones, and the like through. return 1 return ..() diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm index 3cc537be49..57e0e1b55a 100644 --- a/code/game/machinery/jukebox.dm +++ b/code/game/machinery/jukebox.dm @@ -38,7 +38,6 @@ datum/track/New(var/title_name, var/audio) /obj/machinery/media/jukebox/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/stock_parts/console_screen(src) diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 1be387f35f..a3b0f9fdd4 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -30,7 +30,6 @@ reagents = new/datum/reagents(100) reagents.my_atom = src - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/console_screen(src) component_parts += new /obj/item/weapon/stock_parts/motor(src) diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 7d8e75764c..180471f070 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -18,19 +18,17 @@ /obj/machinery/light_switch/New() ..() spawn(5) - src.area = get_area(src) + area = get_area(src) if(otherarea) - src.area = locate(text2path("/area/[otherarea]")) + area = locate(text2path("/area/[otherarea]")) if(!name) name = "light switch ([area.name])" - src.on = src.area.lightswitch + on = area.lightswitch updateicon() - - /obj/machinery/light_switch/proc/updateicon() if(!overlay) overlay = image(icon, "light1-overlay", LIGHTING_LAYER+0.1) @@ -77,4 +75,4 @@ ..(severity) return power_change() - ..(severity) + ..(severity) \ No newline at end of file diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 30a9b8548b..9b7760a12e 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -113,7 +113,6 @@ Class Procs: var/global/gl_uid = 1 var/interact_offline = 0 // Can the machine be interacted with while de-powered. var/circuit = null - var/frame_type = "machine" /obj/machinery/New(l, d=0) ..(l) @@ -124,6 +123,8 @@ Class Procs: else machines += src machinery_sort_required = 1 + if(circuit) + circuit = new circuit(src) /obj/machinery/Destroy() machines -= src @@ -165,11 +166,11 @@ Class Procs: qdel(src) return if(2.0) - if (prob(50)) + if(prob(50)) qdel(src) return if(3.0) - if (prob(25)) + if(prob(25)) qdel(src) return else @@ -182,20 +183,20 @@ Class Procs: /obj/machinery/proc/auto_use_power() if(!powered(power_channel)) return 0 - if(src.use_power == 1) - use_power(idle_power_usage,power_channel, 1) - else if(src.use_power >= 2) - use_power(active_power_usage,power_channel, 1) + if(use_power == 1) + use_power(idle_power_usage, power_channel, 1) + else if(use_power >= 2) + use_power(active_power_usage, power_channel, 1) return 1 /obj/machinery/proc/operable(var/additional_flags = 0) return !inoperable(additional_flags) /obj/machinery/proc/inoperable(var/additional_flags = 0) - return (stat & (NOPOWER|BROKEN|additional_flags)) + return (stat & (NOPOWER | BROKEN | additional_flags)) /obj/machinery/CanUseTopic(var/mob/user) - if(!interact_offline && (stat & (NOPOWER|BROKEN))) + if(!interact_offline && (stat & (NOPOWER | BROKEN))) return STATUS_CLOSE return ..() @@ -214,20 +215,19 @@ Class Procs: // For some reason attack_robot doesn't work // This is to stop robots from using cameras to remotely control machines. if(user.client && user.client.eye == user) - return src.attack_hand(user) + return attack_hand(user) else - return src.attack_hand(user) + return attack_hand(user) /obj/machinery/attack_hand(mob/user as mob) if(inoperable(MAINT)) return 1 if(user.lying || user.stat) return 1 - if ( ! (istype(usr, /mob/living/carbon/human) || \ - istype(usr, /mob/living/silicon))) + if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/living/silicon))) usr << "You don't have the dexterity to do this!" return 1 - if (ishuman(user)) + if(ishuman(user)) var/mob/living/carbon/human/H = user if(H.getBrainLoss() >= 55) visible_message("[H] stares cluelessly at [src].") @@ -236,7 +236,7 @@ Class Procs: user << "You momentarily forget how to use [src]." return 1 - src.add_fingerprint(user) + add_fingerprint(user) return ..() @@ -252,7 +252,7 @@ Class Procs: O.show_message("\icon[src] [msg]", 2) /obj/machinery/proc/ping(text=null) - if (!text) + if(!text) text = "\The [src] pings." state(text, "blue") @@ -266,7 +266,7 @@ Class Procs: var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() - if (electrocute_mob(user, get_area(src), src, 0.7)) + if(electrocute_mob(user, get_area(src), src, 0.7)) var/area/temp_area = get_area(src) if(temp_area) var/obj/machinery/power/apc/temp_apc = temp_area.get_apc() @@ -304,7 +304,7 @@ Class Procs: RefreshParts() else user << "Following parts detected in the machine:" - for(var/var/obj/item/C in component_parts) + for(var/var/obj/item/C in component_parts) //var/var/obj/item/C? user << " [C.name]" return 1 @@ -324,31 +324,77 @@ Class Procs: update_icon() return 1 +/obj/machinery/proc/computer_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S) + if(!istype(S)) + return 0 + if(!circuit) + return 0 + user << "You start disconnecting the monitor." + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + if(do_after(user, 20)) + if(stat & BROKEN) + user << "The broken glass falls out." + new /obj/item/weapon/material/shard(src.loc) + else + user << "You disconnect the monitor." + . = dismantle() + +/obj/machinery/proc/alarm_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S) + if(!istype(S)) + return 0 + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + panel_open = !panel_open + user << "The wires have been [panel_open ? "exposed" : "unexposed"]" + update_icon() + return 1 + +/obj/machinery/proc/alarm_deconstruction_wirecutters(var/mob/user, var/obj/item/weapon/wirecutters/W) + if(!istype(W)) + return 0 + if(!panel_open) + return 0 + user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) + new/obj/item/stack/cable_coil(get_turf(src), 5) + . = dismantle() + /obj/machinery/proc/dismantle() - playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + var/obj/structure/frame/A = new /obj/structure/frame(src.loc) var/obj/item/weapon/circuitboard/M = circuit A.circuit = M A.anchored = 1 A.density = 1 A.frame_type = M.board_type - if(A.frame_type in A.no_circuit) + if(A.frame_type.circuit) A.need_circuit = 0 - for (var/obj/D in src.component_parts) - D.forceMove(loc) - if(A.components) - A.components.Cut() + + if(A.frame_type.frame_class == "machine") + for(var/obj/D in component_parts) + D.forceMove(src.loc) + if(A.components) + A.components.Cut() + else + A.components = list() + component_parts = list() + A.check_components() + + if(A.frame_type.frame_class == "alarm") + A.state = 2 + else if(A.frame_type.frame_class == "computer" || A.frame_type.frame_class == "display") + if(stat & BROKEN) + A.state = 3 + else + A.state = 4 else - A.components = list() - component_parts = list() - A.icon_state = "[A.frame_type]_3" - A.state = 3 - A.dir = dir + A.state = 3 + + A.set_dir(dir) A.pixel_x = pixel_x A.pixel_y = pixel_y - A.check_components() A.update_desc() + A.update_icon() M.loc = null M.deconstruct(src) qdel(src) - return 1 + return 1 \ No newline at end of file diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index ca044a5a48..af61e93424 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -5,7 +5,6 @@ // This was created for firing ranges, but I suppose this could have other applications - Doohl /obj/machinery/magnetic_module - icon = 'icons/obj/objects.dmi' icon_state = "floor_magnet-f" name = "Electromagnetic Generator" @@ -29,166 +28,157 @@ var/center_y = 0 var/max_dist = 20 // absolute value of center_x,y cannot exceed this integer - New() - ..() - var/turf/T = loc - hide(!T.is_plating()) - center = T +/obj/machinery/magnetic_module/New() + ..() + var/turf/T = loc + hide(!T.is_plating()) + center = T - spawn(10) // must wait for map loading to finish - if(radio_controller) - radio_controller.add_object(src, freq, RADIO_MAGNETS) + spawn(10) // must wait for map loading to finish + if(radio_controller) + radio_controller.add_object(src, freq, RADIO_MAGNETS) - spawn() - magnetic_process() + spawn() + magnetic_process() - // update the invisibility and icon - hide(var/intact) - invisibility = intact ? 101 : 0 - updateicon() +// update the invisibility and icon +/obj/machinery/magnetic_module/hide(var/intact) + invisibility = intact ? 101 : 0 + updateicon() - // update the icon_state - proc/updateicon() - var/state="floor_magnet" - var/onstate="" - if(!on) - onstate="0" +// update the icon_state +/obj/machinery/magnetic_module/proc/updateicon() + var/state="floor_magnet" + var/onstate="" + if(!on) + onstate="0" - if(invisibility) - icon_state = "[state][onstate]-f" // if invisible, set icon to faded version - // in case of being revealed by T-scanner - else - icon_state = "[state][onstate]" + if(invisibility) + icon_state = "[state][onstate]-f" // if invisible, set icon to faded version + // in case of being revealed by T-scanner + else + icon_state = "[state][onstate]" - receive_signal(datum/signal/signal) +/obj/machinery/magnetic_module/receive_signal(datum/signal/signal) + var/command = signal.data["command"] + var/modifier = signal.data["modifier"] + var/signal_code = signal.data["code"] + if(command && (signal_code == code)) - var/command = signal.data["command"] - var/modifier = signal.data["modifier"] - var/signal_code = signal.data["code"] - if(command && (signal_code == code)) + Cmd(command, modifier) - Cmd(command, modifier) +/obj/machinery/magnetic_module/proc/Cmd(var/command, var/modifier) + if(command) + switch(command) + if("set-electriclevel") + if(modifier) electricity_level = modifier + if("set-magneticfield") + if(modifier) magnetic_field = modifier + if("add-elec") + electricity_level++ + if(electricity_level > 12) + electricity_level = 12 + if("sub-elec") + electricity_level-- + if(electricity_level <= 0) + electricity_level = 1 + if("add-mag") + magnetic_field++ + if(magnetic_field > 4) + magnetic_field = 4 + if("sub-mag") + magnetic_field-- + if(magnetic_field <= 0) + magnetic_field = 1 + if("set-x") + if(modifier) center_x = modifier + if("set-y") + if(modifier) center_y = modifier - proc/Cmd(var/command, var/modifier) + if("N") // NORTH + center_y++ + if("S") // SOUTH + center_y-- + if("E") // EAST + center_x++ + if("W") // WEST + center_x-- + if("C") // CENTER + center_x = 0 + center_y = 0 + if("R") // RANDOM + center_x = rand(-max_dist, max_dist) + center_y = rand(-max_dist, max_dist) - if(command) - switch(command) - if("set-electriclevel") - if(modifier) electricity_level = modifier - if("set-magneticfield") - if(modifier) magnetic_field = modifier + if("set-code") + if(modifier) code = modifier + if("toggle-power") + on = !on - if("add-elec") - electricity_level++ - if(electricity_level > 12) - electricity_level = 12 - if("sub-elec") - electricity_level-- - if(electricity_level <= 0) - electricity_level = 1 - if("add-mag") - magnetic_field++ - if(magnetic_field > 4) - magnetic_field = 4 - if("sub-mag") - magnetic_field-- - if(magnetic_field <= 0) - magnetic_field = 1 + if(on) + spawn() + magnetic_process() - if("set-x") - if(modifier) center_x = modifier - if("set-y") - if(modifier) center_y = modifier +/obj/machinery/magnetic_module/process() + if(stat & NOPOWER) + on = 0 - if("N") // NORTH - center_y++ - if("S") // SOUTH - center_y-- - if("E") // EAST - center_x++ - if("W") // WEST - center_x-- - if("C") // CENTER - center_x = 0 - center_y = 0 - if("R") // RANDOM - center_x = rand(-max_dist, max_dist) - center_y = rand(-max_dist, max_dist) + // Sanity checks: + if(electricity_level <= 0) + electricity_level = 1 + if(magnetic_field <= 0) + magnetic_field = 1 - if("set-code") - if(modifier) code = modifier - if("toggle-power") - on = !on + // Limitations: + if(abs(center_x) > max_dist) + center_x = max_dist + if(abs(center_y) > max_dist) + center_y = max_dist + if(magnetic_field > 4) + magnetic_field = 4 + if(electricity_level > 12) + electricity_level = 12 - if(on) - spawn() - magnetic_process() + // Update power usage: + if(on) + use_power = 2 + active_power_usage = electricity_level*15 + else + use_power = 0 + // Overload conditions: + /* // Eeeehhh kinda stupid + if(on) + if(electricity_level > 11) + if(prob(electricity_level)) + explosion(loc, 0, 1, 2, 3) // ooo dat shit EXPLODES son + spawn(2) + qdel(src) + */ + updateicon() - process() - if(stat & NOPOWER) - on = 0 +/obj/machinery/magnetic_module/proc/magnetic_process() // proc that actually does the pulling + if(pulling) return + while(on) - // Sanity checks: - if(electricity_level <= 0) - electricity_level = 1 - if(magnetic_field <= 0) - magnetic_field = 1 + pulling = 1 + center = locate(x+center_x, y+center_y, z) + if(center) + for(var/obj/M in orange(magnetic_field, center)) + if(!M.anchored && (M.flags & CONDUCT)) + step_towards(M, center) + for(var/mob/living/silicon/S in orange(magnetic_field, center)) + if(istype(S, /mob/living/silicon/ai)) continue + step_towards(S, center) - // Limitations: - if(abs(center_x) > max_dist) - center_x = max_dist - if(abs(center_y) > max_dist) - center_y = max_dist - if(magnetic_field > 4) - magnetic_field = 4 - if(electricity_level > 12) - electricity_level = 12 + use_power(electricity_level * 5) + sleep(13 - electricity_level) - // Update power usage: - if(on) - use_power = 2 - active_power_usage = electricity_level*15 - else - use_power = 0 - - - // Overload conditions: - /* // Eeeehhh kinda stupid - if(on) - if(electricity_level > 11) - if(prob(electricity_level)) - explosion(loc, 0, 1, 2, 3) // ooo dat shit EXPLODES son - spawn(2) - qdel(src) - */ - - updateicon() - - - proc/magnetic_process() // proc that actually does the pulling - if(pulling) return - while(on) - - pulling = 1 - center = locate(x+center_x, y+center_y, z) - if(center) - for(var/obj/M in orange(magnetic_field, center)) - if(!M.anchored && (M.flags & CONDUCT)) - step_towards(M, center) - - for(var/mob/living/silicon/S in orange(magnetic_field, center)) - if(istype(S, /mob/living/silicon/ai)) continue - step_towards(S, center) - - use_power(electricity_level * 5) - sleep(13 - electricity_level) - - pulling = 0 + pulling = 0 /obj/machinery/magnetic_module/Destroy() if(radio_controller) @@ -220,186 +210,186 @@ var/datum/radio_frequency/radio_connection - New() - ..() +/obj/machinery/magnetic_controller/New() + ..() - if(autolink) - for(var/obj/machinery/magnetic_module/M in world) - if(M.freq == frequency && M.code == code) - magnets.Add(M) + if(autolink) + for(var/obj/machinery/magnetic_module/M in world) + if(M.freq == frequency && M.code == code) + magnets.Add(M) - spawn(45) // must wait for map loading to finish - if(radio_controller) - radio_connection = radio_controller.add_object(src, frequency, RADIO_MAGNETS) + spawn(45) // must wait for map loading to finish + if(radio_controller) + radio_connection = radio_controller.add_object(src, frequency, RADIO_MAGNETS) - if(path) // check for default path - filter_path() // renders rpath + if(path) // check for default path + filter_path() // renders rpath - process() - if(magnets.len == 0 && autolink) - for(var/obj/machinery/magnetic_module/M in world) - if(M.freq == frequency && M.code == code) - magnets.Add(M) +/obj/machinery/magnetic_controller/process() + if(magnets.len == 0 && autolink) + for(var/obj/machinery/magnetic_module/M in world) + if(M.freq == frequency && M.code == code) + magnets.Add(M) - attack_ai(mob/user as mob) - return src.attack_hand(user) +/obj/machinery/magnetic_controller/attack_ai(mob/user as mob) + return attack_hand(user) + +/obj/machinery/magnetic_controller/attack_hand(mob/user as mob) + if(stat & (BROKEN|NOPOWER)) + return + user.set_machine(src) + var/dat = "Magnetic Control Console

" + if(!autolink) + dat += {" + Frequency: [frequency]
+ Code: [code]
+ Probe Generators
+ "} + + if(magnets.len >= 1) + + dat += "Magnets confirmed:
" + var/i = 0 + for(var/obj/machinery/magnetic_module/M in magnets) + i++ + dat += "     < \[[i]\] ([M.on ? "On":"Off"]) | Electricity level: - [M.electricity_level] +; Magnetic field: - [M.magnetic_field] +
" + + dat += "
Speed: - [speed] +
" + dat += "Path: {[path]}
" + dat += "Moving: [moving ? "Enabled":"Disabled"]" + + + user << browse(dat, "window=magnet;size=400x500") + onclose(user, "magnet") + +/obj/machinery/magnetic_controller/Topic(href, href_list) + if(stat & (BROKEN|NOPOWER)) + return + usr.set_machine(src) + add_fingerprint(usr) + + if(href_list["radio-op"]) + + // Prepare signal beforehand, because this is a radio operation + var/datum/signal/signal = new + signal.transmission_method = 1 // radio transmission + signal.source = src + signal.frequency = frequency + signal.data["code"] = code + + // Apply any necessary commands + switch(href_list["radio-op"]) + if("togglepower") + signal.data["command"] = "toggle-power" + + if("minuselec") + signal.data["command"] = "sub-elec" + if("pluselec") + signal.data["command"] = "add-elec" + + if("minusmag") + signal.data["command"] = "sub-mag" + if("plusmag") + signal.data["command"] = "add-mag" + + + // Broadcast the signal + + radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) + + spawn(1) + updateUsrDialog() // pretty sure this increases responsiveness + + if(href_list["operation"]) + switch(href_list["operation"]) + if("plusspeed") + speed ++ + if(speed > 10) + speed = 10 + if("minusspeed") + speed -- + if(speed <= 0) + speed = 1 + if("setpath") + var/newpath = sanitize(input(usr, "Please define a new path!",,path) as text|null) + if(newpath && newpath != "") + moving = 0 // stop moving + path = newpath + pathpos = 1 // reset position + filter_path() // renders rpath + + if("togglemoving") + moving = !moving + if(moving) + spawn() MagnetMove() + + + updateUsrDialog() + +/obj/machinery/magnetic_controller/proc/MagnetMove() + if(looping) return + + while(moving && rpath.len >= 1) - attack_hand(mob/user as mob) if(stat & (BROKEN|NOPOWER)) - return - user.set_machine(src) - var/dat = "Magnetic Control Console

" - if(!autolink) - dat += {" - Frequency: [frequency]
- Code: [code]
- Probe Generators
- "} + break - if(magnets.len >= 1) + looping = 1 - dat += "Magnets confirmed:
" - var/i = 0 - for(var/obj/machinery/magnetic_module/M in magnets) - i++ - dat += "     < \[[i]\] ([M.on ? "On":"Off"]) | Electricity level: - [M.electricity_level] +; Magnetic field: - [M.magnetic_field] +
" + // Prepare the radio signal + var/datum/signal/signal = new + signal.transmission_method = 1 // radio transmission + signal.source = src + signal.frequency = frequency + signal.data["code"] = code - dat += "
Speed: - [speed] +
" - dat += "Path: {[path]}
" - dat += "Moving: [moving ? "Enabled":"Disabled"]" + if(pathpos > rpath.len) // if the position is greater than the length, we just loop through the list! + pathpos = 1 + + var/nextmove = uppertext(rpath[pathpos]) // makes it un-case-sensitive + + if(!(nextmove in list("N","S","E","W","C","R"))) + // N, S, E, W are directional + // C is center + // R is random (in magnetic field's bounds) + qdel(signal) + break // break the loop if the character located is invalid + + signal.data["command"] = nextmove - user << browse(dat, "window=magnet;size=400x500") - onclose(user, "magnet") - - Topic(href, href_list) - if(stat & (BROKEN|NOPOWER)) - return - usr.set_machine(src) - src.add_fingerprint(usr) - - if(href_list["radio-op"]) - - // Prepare signal beforehand, because this is a radio operation - var/datum/signal/signal = new - signal.transmission_method = 1 // radio transmission - signal.source = src - signal.frequency = frequency - signal.data["code"] = code - - // Apply any necessary commands - switch(href_list["radio-op"]) - if("togglepower") - signal.data["command"] = "toggle-power" - - if("minuselec") - signal.data["command"] = "sub-elec" - if("pluselec") - signal.data["command"] = "add-elec" - - if("minusmag") - signal.data["command"] = "sub-mag" - if("plusmag") - signal.data["command"] = "add-mag" - - - // Broadcast the signal + pathpos++ // increase iterator + // Broadcast the signal + spawn() radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) - spawn(1) - updateUsrDialog() // pretty sure this increases responsiveness + if(speed == 10) + sleep(1) + else + sleep(12-speed) - if(href_list["operation"]) - switch(href_list["operation"]) - if("plusspeed") - speed ++ - if(speed > 10) - speed = 10 - if("minusspeed") - speed -- - if(speed <= 0) - speed = 1 - if("setpath") - var/newpath = sanitize(input(usr, "Please define a new path!",,path) as text|null) - if(newpath && newpath != "") - moving = 0 // stop moving - path = newpath - pathpos = 1 // reset position - filter_path() // renders rpath - - if("togglemoving") - moving = !moving - if(moving) - spawn() MagnetMove() + looping = 0 - updateUsrDialog() +/obj/machinery/magnetic_controller/proc/filter_path() + // Generates the rpath variable using the path string, think of this as "string2list" + // Doesn't use params2list() because of the akward way it stacks entities + rpath = list() // clear rpath + var/maximum_character = min(50, length(path)) // chooses the maximum length of the iterator. 50 max length - proc/MagnetMove() - if(looping) return + for(var/i=1, i<=maximum_character, i++) // iterates through all characters in path - while(moving && rpath.len >= 1) + var/nextchar = copytext(path, i, i+1) // find next character - if(stat & (BROKEN|NOPOWER)) - break + if(!(nextchar in list(";", "&", "*", " "))) // if char is a separator, ignore + rpath += copytext(path, i, i+1) // else, add to list - looping = 1 - - // Prepare the radio signal - var/datum/signal/signal = new - signal.transmission_method = 1 // radio transmission - signal.source = src - signal.frequency = frequency - signal.data["code"] = code - - if(pathpos > rpath.len) // if the position is greater than the length, we just loop through the list! - pathpos = 1 - - var/nextmove = uppertext(rpath[pathpos]) // makes it un-case-sensitive - - if(!(nextmove in list("N","S","E","W","C","R"))) - // N, S, E, W are directional - // C is center - // R is random (in magnetic field's bounds) - qdel(signal) - break // break the loop if the character located is invalid - - signal.data["command"] = nextmove - - - pathpos++ // increase iterator - - // Broadcast the signal - spawn() - radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) - - if(speed == 10) - sleep(1) - else - sleep(12-speed) - - looping = 0 - - - proc/filter_path() - // Generates the rpath variable using the path string, think of this as "string2list" - // Doesn't use params2list() because of the akward way it stacks entities - rpath = list() // clear rpath - var/maximum_character = min( 50, length(path) ) // chooses the maximum length of the iterator. 50 max length - - for(var/i=1, i<=maximum_character, i++) // iterates through all characters in path - - var/nextchar = copytext(path, i, i+1) // find next character - - if(!(nextchar in list(";", "&", "*", " "))) // if char is a separator, ignore - rpath += copytext(path, i, i+1) // else, add to list - - // there doesn't HAVE to be separators but it makes paths syntatically visible + // there doesn't HAVE to be separators but it makes paths syntatically visible /obj/machinery/magnetic_controller/Destroy() if(radio_controller) diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm index f563d9ef39..4d1affb3a0 100644 --- a/code/game/machinery/mass_driver.dm +++ b/code/game/machinery/mass_driver.dm @@ -18,7 +18,6 @@ /obj/machinery/mass_driver/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/motor(src) component_parts += new /obj/item/weapon/stock_parts/motor(src) @@ -59,7 +58,7 @@ M << "The mass driver lets out a screech, it mustn't be able to handle any more items." break use_power(500) - spawn( 0 ) + spawn(0) O.throw_at(target, drive_range * power, power) flick("mass_driver1", src) return diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 0c14c66990..fe5cac9c44 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -1,11 +1,9 @@ // Navigation beacon for AI robots // Functions as a transponder: looks for incoming signal matching - var/global/list/navbeacons // no I don't like putting this in, but it will do for now /obj/machinery/navbeacon - icon = 'icons/obj/objects.dmi' icon_state = "navbeacon0-f" name = "navigation beacon" @@ -13,162 +11,160 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do level = 1 // underfloor layer = 2.5 anchored = 1 - var/open = 0 // true if cover is open var/locked = 1 // true if controls are locked var/freq = 1445 // radio frequency var/location = "" // location response text var/list/codes // assoc. list of transponder codes var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" - req_access = list(access_engine) - New() - ..() +/obj/machinery/navbeacon/New() + ..() - set_codes() + set_codes() - var/turf/T = loc - hide(!T.is_plating()) + var/turf/T = loc + hide(!T.is_plating()) - // add beacon to MULE bot beacon list - if(freq == 1400) - if(!navbeacons) - navbeacons = new() - navbeacons += src + // add beacon to MULE bot beacon list + if(freq == 1400) + if(!navbeacons) + navbeacons = new() + navbeacons += src - spawn(5) // must wait for map loading to finish - if(radio_controller) - radio_controller.add_object(src, freq, RADIO_NAVBEACONS) + spawn(5) // must wait for map loading to finish + if(radio_controller) + radio_controller.add_object(src, freq, RADIO_NAVBEACONS) - // set the transponder codes assoc list from codes_txt - proc/set_codes() - if(!codes_txt) - return - - codes = new() - - var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons - - for(var/e in entries) - var/index = findtext(e, "=") // format is "key=value" - if(index) - var/key = copytext(e, 1, index) - var/val = copytext(e, index+1) - codes[key] = val - else - codes[e] = "1" - - - // called when turf state changes - // hide the object if turf is intact - hide(var/intact) - invisibility = intact ? 101 : 0 - updateicon() - - // update the icon_state - proc/updateicon() - var/state="navbeacon[open]" - - if(invisibility) - icon_state = "[state]-f" // if invisible, set icon to faded version - // in case revealed by T-scanner - else - icon_state = "[state]" - - - // look for a signal of the form "findbeacon=X" - // where X is any - // or the location - // or one of the set transponder keys - // if found, return a signal - receive_signal(datum/signal/signal) - - var/request = signal.data["findbeacon"] - if(request && ((request in codes) || request == "any" || request == location)) - spawn(1) - post_signal() - - // return a signal giving location and transponder codes - - proc/post_signal() - - var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq) - - if(!frequency) return - - var/datum/signal/signal = new() - signal.source = src - signal.transmission_method = 1 - signal.data["beacon"] = location - - for(var/key in codes) - signal.data[key] = codes[key] - - frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS) - - - attackby(var/obj/item/I, var/mob/user) - var/turf/T = loc - if(!T.is_plating()) - return // prevent intraction when T-scanner revealed - - if(istype(I, /obj/item/weapon/screwdriver)) - open = !open - - user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") - - updateicon() - - else if (istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) - if(open) - if (src.allowed(user)) - src.locked = !src.locked - user << "Controls are now [src.locked ? "locked." : "unlocked."]" - else - user << "Access denied." - updateDialog() - else - user << "You must open the cover first!" +// set the transponder codes assoc list from codes_txt +/obj/machinery/navbeacon/proc/set_codes() + if(!codes_txt) return - attack_ai(var/mob/user) - interact(user, 1) + codes = new() - attack_hand(var/mob/user) + var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons - if(!user.IsAdvancedToolUser()) - return 0 - - interact(user, 0) - - interact(var/mob/user, var/ai = 0) - var/turf/T = loc - if(!T.is_plating()) - return // prevent intraction when T-scanner revealed - - if(!open && !ai) // can't alter controls if not open, unless you're an AI - user << "The beacon's control cover is closed." - return + for(var/e in entries) + var/index = findtext(e, "=") // format is "key=value" + if(index) + var/key = copytext(e, 1, index) + var/val = copytext(e, index+1) + codes[key] = val + else + codes[e] = "1" - var/t +// called when turf state changes +// hide the object if turf is intact +/obj/machinery/navbeacon/hide(var/intact) + invisibility = intact ? 101 : 0 + updateicon() - if(locked && !ai) - t = {"Navigation Beacon

+// update the icon_state +/obj/machinery/navbeacon/proc/updateicon() + var/state="navbeacon[open]" + + if(invisibility) + icon_state = "[state]-f" // if invisible, set icon to faded version + // in case revealed by T-scanner + else + icon_state = "[state]" + + +// look for a signal of the form "findbeacon=X" +// where X is any +// or the location +// or one of the set transponder keys +// if found, return a signal +/obj/machinery/navbeacon/receive_signal(datum/signal/signal) + + var/request = signal.data["findbeacon"] + if(request && ((request in codes) || request == "any" || request == location)) + spawn(1) + post_signal() + +// return a signal giving location and transponder codes + +/obj/machinery/navbeacon/proc/post_signal() + + var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq) + + if(!frequency) return + + var/datum/signal/signal = new() + signal.source = src + signal.transmission_method = 1 + signal.data["beacon"] = location + + for(var/key in codes) + signal.data[key] = codes[key] + + frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS) + + +/obj/machinery/navbeacon/attackby(var/obj/item/I, var/mob/user) + var/turf/T = loc + if(!T.is_plating()) + return // prevent intraction when T-scanner revealed + + if(istype(I, /obj/item/weapon/screwdriver)) + open = !open + + user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") + + updateicon() + + else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) + if(open) + if(allowed(user)) + locked = !locked + user << "Controls are now [locked ? "locked." : "unlocked."]" + else + user << "Access denied." + updateDialog() + else + user << "You must open the cover first!" + return + +/obj/machinery/navbeacon/attack_ai(var/mob/user) + interact(user, 1) + +/obj/machinery/navbeacon/attack_hand(var/mob/user) + + if(!user.IsAdvancedToolUser()) + return 0 + + interact(user, 0) + +/obj/machinery/navbeacon/interact(var/mob/user, var/ai = 0) + var/turf/T = loc + if(!T.is_plating()) + return // prevent intraction when T-scanner revealed + + if(!open && !ai) // can't alter controls if not open, unless you're an AI + user << "The beacon's control cover is closed." + return + + + var/t + + if(locked && !ai) + t = {"Navigation Beacon

(swipe card to unlock controls)
Frequency: [format_frequency(freq)]

Location: [location ? location : "(none)"]
Transponder Codes:
    "} - for(var/key in codes) - t += "
  • [key] ... [codes[key]]" - t+= "
      " + for(var/key in codes) + t += "
    • [key] ... [codes[key]]" + t+= "
        " - else + else - t = {"Navigation Beacon

        + t = {"Navigation Beacon

        (swipe card to lock controls)
        Frequency: - @@ -180,75 +176,75 @@ Frequency: Location: [location ? location : "(none)"]
        Transponder Codes:
          "} - for(var/key in codes) - t += "
        • [key] ... [codes[key]]" - t += " (edit)" - t += " (delete)
          " - t += "(add new)
          " - t+= "
            " + for(var/key in codes) + t += "
          • [key] ... [codes[key]]" + t += " (edit)" + t += " (delete)
            " + t += "(add new)
            " + t+= "
              " - user << browse(t, "window=navbeacon") - onclose(user, "navbeacon") + user << browse(t, "window=navbeacon") + onclose(user, "navbeacon") + return + +/obj/machinery/navbeacon/Topic(href, href_list) + ..() + if(usr.stat) return + if((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))) + if(open && !locked) + usr.set_machine(src) - Topic(href, href_list) - ..() - if (usr.stat) - return - if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))) - if(open && !locked) - usr.set_machine(src) + if(href_list["freq"]) + freq = sanitize_frequency(freq + text2num(href_list["freq"])) + updateDialog() - if (href_list["freq"]) - freq = sanitize_frequency(freq + text2num(href_list["freq"])) + else if(href_list["locedit"]) + var/newloc = sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null) + if(newloc) + location = newloc updateDialog() - else if(href_list["locedit"]) - var/newloc = sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null) - if(newloc) - location = newloc - updateDialog() + else if(href_list["edit"]) + var/codekey = href_list["code"] - else if(href_list["edit"]) - var/codekey = href_list["code"] + var/newkey = input("Enter Transponder Code Key", "Navigation Beacon", codekey) as text|null + if(!newkey) + return - var/newkey = input("Enter Transponder Code Key", "Navigation Beacon", codekey) as text|null - if(!newkey) - return + var/codeval = codes[codekey] + var/newval = input("Enter Transponder Code Value", "Navigation Beacon", codeval) as text|null + if(!newval) + newval = codekey + return - var/codeval = codes[codekey] - var/newval = input("Enter Transponder Code Value", "Navigation Beacon", codeval) as text|null - if(!newval) - newval = codekey - return + codes.Remove(codekey) + codes[newkey] = newval - codes.Remove(codekey) - codes[newkey] = newval + updateDialog() - updateDialog() + else if(href_list["delete"]) + var/codekey = href_list["code"] + codes.Remove(codekey) + updateDialog() - else if(href_list["delete"]) - var/codekey = href_list["code"] - codes.Remove(codekey) - updateDialog() + else if(href_list["add"]) - else if(href_list["add"]) + var/newkey = input("Enter New Transponder Code Key", "Navigation Beacon") as text|null + if(!newkey) + return - var/newkey = input("Enter New Transponder Code Key", "Navigation Beacon") as text|null - if(!newkey) - return + var/newval = input("Enter New Transponder Code Value", "Navigation Beacon") as text|null + if(!newval) + newval = "1" + return - var/newval = input("Enter New Transponder Code Value", "Navigation Beacon") as text|null - if(!newval) - newval = "1" - return + if(!codes) + codes = new() - if(!codes) - codes = new() + codes[newkey] = newval - codes[newkey] = newval - - updateDialog() + updateDialog() /obj/machinery/navbeacon/Destroy() navbeacons.Remove(src) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 7bfe32d719..d879d9bcaa 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -101,9 +101,9 @@ var/list/receiving_pdas = new for (var/obj/item/device/pda/P in PDAs) - if (!P.owner) + if(!P.owner) continue - if (P.toff) + if(P.toff) continue receiving_pdas += P @@ -120,7 +120,6 @@ var/datum/feed_network/news_network = new /datum/feed_network //The global n var/list/obj/machinery/newscaster/allCasters = list() //Global list that will contain reference to all newscasters in existence. - /obj/machinery/newscaster name = "newscaster" desc = "A standard newsfeed handler for use on commercial space stations. All the news you absolutely have no use for, in one place!" @@ -167,7 +166,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co light_range = 0 anchored = 1 var/obj/machinery/exonet_node/node = null - circuit = /obj/item/weapon/circuitboard/newscaster + circuit = /obj/item/weapon/circuitboard/newscaster /obj/machinery/newscaster/security_unit //Security unit name = "Security Newscaster" @@ -175,10 +174,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co /obj/machinery/newscaster/New() //Constructor, ho~ allCasters += src - src.paper_remaining = 15 // Will probably change this to something better + paper_remaining = 15 // Will probably change this to something better for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) // Let's give it an appropriate unit number - src.unit_no++ - src.update_icon() //for any custom ones on the map... + unit_no++ + update_icon() //for any custom ones on the map... spawn(10) //Should be enough time for the node to spawn at tcomms. node = get_exonet_node() ..() //I just realised the newscasters weren't in the global machines list. The superconstructor call will tend to that @@ -191,21 +190,21 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(!ispowered || isbroken) icon_state = "newscaster_off" if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite. - src.overlays.Cut() - src.overlays += image(src.icon, "crack3") + overlays.Cut() + overlays += image(icon, "crack3") return - src.overlays.Cut() //reset overlays + overlays.Cut() //reset overlays if(news_network.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message icon_state = "newscaster_wanted" return if(alert) //new message alert overlay - src.overlays += "newscaster_alert" + overlays += "newscaster_alert" if(hitstaken > 0) //Cosmetic damage overlay - src.overlays += image(src.icon, "crack[hitstaken]") + overlays += image(icon, "crack[hitstaken]") icon_state = "newscaster_normal" return @@ -214,14 +213,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(isbroken) //Broken shit can't be powered. return ..() - if( !(stat & NOPOWER) ) - src.ispowered = 1 - src.update_icon() + if(!(stat & NOPOWER)) + ispowered = 1 + update_icon() else spawn(rand(0, 15)) - src.ispowered = 0 - src.update_icon() - + ispowered = 0 + update_icon() /obj/machinery/newscaster/ex_act(severity) switch(severity) @@ -229,25 +227,24 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co qdel(src) return if(2.0) - src.isbroken=1 + isbroken=1 if(prob(50)) qdel(src) else - src.update_icon() //can't place it above the return and outside the if-else. or we might get runtimes of null.update_icon() if(prob(50)) goes in. + update_icon() //can't place it above the return and outside the if-else. or we might get runtimes of null.update_icon() if(prob(50)) goes in. return else if(prob(50)) - src.isbroken=1 - src.update_icon() + isbroken=1 + update_icon() return return /obj/machinery/newscaster/attack_ai(mob/user as mob) - return src.attack_hand(user) + return attack_hand(user) /obj/machinery/newscaster/attack_hand(mob/user as mob) //########### THE MAIN BEEF IS HERE! And in the proc below this...############ - - if(!src.ispowered || src.isbroken) + if(!ispowered || isbroken) return if(!node) @@ -261,16 +258,16 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(!user.IsAdvancedToolUser()) return 0 - if(istype(user, /mob/living/carbon/human) || istype(user,/mob/living/silicon) ) + if(istype(user, /mob/living/carbon/human) || istype(user,/mob/living/silicon)) var/mob/living/human_or_robot_user = user var/dat - dat = text("Newscaster

              Newscaster Unit #[src.unit_no]

              ") + dat = text("Newscaster

              Newscaster Unit #[unit_no]

              ") - src.scan_user(human_or_robot_user) //Newscaster scans you + scan_user(human_or_robot_user) //Newscaster scans you switch(screen) if(0) - dat += "Welcome to Newscasting Unit #[src.unit_no].
              Interface & News networks Operational." + dat += "Welcome to Newscasting Unit #[unit_no].
              Interface & News networks Operational." dat += "
              Property of Nanotransen Inc" if(news_network.wanted_issue) dat+= "
              Read Wanted Issue" @@ -280,7 +277,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+= "
              Print newspaper" dat+= "
              Re-scan User" dat+= "

              Exit" - if(src.securityCaster) + if(securityCaster) var/wanted_already = 0 if(news_network.wanted_issue) wanted_already = 1 @@ -289,10 +286,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="
              [(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue" dat+="
              Censor Feed Stories" dat+="
              Mark Feed Channel with [company_name] D-Notice" - dat+="

              The newscaster recognises you as: [src.scanned_user]" + dat+="

              The newscaster recognises you as: [scanned_user]" if(1) dat+= "Station Feed Channels
              " - if( isemptylist(news_network.network_channels) ) + if(isemptylist(news_network.network_channels)) dat+="No active channels found..." else for(var/datum/feed_channel/CHANNEL in news_network.network_channels) @@ -304,30 +301,30 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="
              Back" if(2) dat+="Creating new Feed Channel..." - dat+="
              Channel Name: [src.channel_name]
              " - dat+="Channel Author: [src.scanned_user]
              " - dat+="Will Accept Public Feeds: [(src.c_locked) ? ("NO") : ("YES")]

              " + dat+="
              Channel Name: [channel_name]
              " + dat+="Channel Author: [scanned_user]
              " + dat+="Will Accept Public Feeds: [(c_locked) ? ("NO") : ("YES")]

              " dat+="
              Submit

              Cancel
              " if(3) dat+="Creating new Feed Message..." - dat+="
              Receiving Channel: [src.channel_name]
              " //MARK - dat+="Message Author: [src.scanned_user]
              " - dat+="Message Body: [src.msg]
              " - dat+="Attach Photo: [(src.photo_data ? "Photo Attached" : "No Photo")]
              " + dat+="
              Receiving Channel: [channel_name]
              " //MARK + dat+="Message Author: [scanned_user]
              " + dat+="Message Body: [msg]
              " + dat+="Attach Photo: [(photo_data ? "Photo Attached" : "No Photo")]
              " dat+="
              Submit

              Cancel
              " if(4) - dat+="Feed story successfully submitted to [src.channel_name].

              " + dat+="Feed story successfully submitted to [channel_name].

              " dat+="
              Return
              " if(5) - dat+="Feed Channel [src.channel_name] created successfully.

              " + dat+="Feed Channel [channel_name] created successfully.

              " dat+="
              Return
              " if(6) dat+="ERROR: Could not submit Feed story to Network.

              " - if(src.channel_name=="") + if(channel_name=="") dat+="•Invalid receiving channel name.
              " - if(src.scanned_user=="Unknown") + if(scanned_user=="Unknown") dat+="•Channel author unverified.
              " - if(src.msg == "" || src.msg == "\[REDACTED\]") + if(msg == "" || msg == "\[REDACTED\]") dat+="•Invalid message body.
              " dat+="
              Return
              " @@ -339,18 +336,18 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co existing_authors += FC.backup_author else existing_authors += FC.author - if(src.scanned_user in existing_authors) + if(scanned_user in existing_authors) dat+="•There already exists a Feed channel under your name.
              " - if(src.channel_name=="" || src.channel_name == "\[REDACTED\]") + if(channel_name=="" || channel_name == "\[REDACTED\]") dat+="•Invalid channel name.
              " var/check = 0 for(var/datum/feed_channel/FC in news_network.network_channels) - if(FC.channel_name == src.channel_name) + if(FC.channel_name == channel_name) check = 1 break if(check) dat+="•Channel name already in use.
              " - if(src.scanned_user=="Unknown") + if(scanned_user=="Unknown") dat+="•Channel author unverified.
              " dat+="
              Return
              " if(8) @@ -363,20 +360,20 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else active_num-- dat+="Network currently serves a total of [total_num] Feed channels, [active_num] of which are active, and a total of [message_num] Feed Stories." //TODO: CONTINUE - dat+="

              Liquid Paper remaining: [(src.paper_remaining) *100 ] cm^3" + dat+="

              Liquid Paper remaining: [(paper_remaining) *100 ] cm^3" dat+="

              Print Paper" dat+="
              Cancel" if(9) - dat+="[src.viewing_channel.channel_name]: \[created by: [src.viewing_channel.author]\]
              " - if(src.viewing_channel.censored) + dat+="[viewing_channel.channel_name]: \[created by: [viewing_channel.author]\]
              " + if(viewing_channel.censored) dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [company_name] D-Notice.
              " dat+="No further feed story additions are allowed while the D-Notice is in effect.

              " else - if( isemptylist(src.viewing_channel.messages) ) + if(isemptylist(viewing_channel.messages)) dat+="No feed messages found in channel...
              " else var/i = 0 - for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages) + for(var/datum/feed_message/MESSAGE in viewing_channel.messages) i++ dat+="-[MESSAGE.body]
              " if(MESSAGE.img) @@ -412,28 +409,28 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="
              Back" if(12) - dat+="[src.viewing_channel.channel_name]: \[ created by: [src.viewing_channel.author] \]
              " - dat+="[(src.viewing_channel.author=="\[REDACTED\]") ? ("Undo Author censorship") : ("Censor channel Author")]
              " + dat+="[viewing_channel.channel_name]: \[ created by: [viewing_channel.author] \]
              " + dat+="[(viewing_channel.author=="\[REDACTED\]") ? ("Undo Author censorship") : ("Censor channel Author")]
              " - if( isemptylist(src.viewing_channel.messages) ) + if(isemptylist(viewing_channel.messages)) dat+="No feed messages found in channel...
              " else - for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages) + for(var/datum/feed_message/MESSAGE in viewing_channel.messages) dat+="-[MESSAGE.body]
              \[[MESSAGE.message_type] by [MESSAGE.author]\]
              " dat+="[(MESSAGE.body == "\[REDACTED\]") ? ("Undo story censorship") : ("Censor story")] - [(MESSAGE.author == "\[REDACTED\]") ? ("Undo Author Censorship") : ("Censor message Author")]
              " dat+="
              Back" if(13) - dat+="[src.viewing_channel.channel_name]: \[ created by: [src.viewing_channel.author] \]
              " - dat+="Channel messages listed below. If you deem them dangerous to the station, you can Bestow a D-Notice upon the channel.
              " - if(src.viewing_channel.censored) + dat+="[viewing_channel.channel_name]: \[ created by: [viewing_channel.author] \]
              " + dat+="Channel messages listed below. If you deem them dangerous to the station, you can Bestow a D-Notice upon the channel.
              " + if(viewing_channel.censored) dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a [company_name] D-Notice.
              " dat+="No further feed story additions are allowed while the D-Notice is in effect.

              " else - if( isemptylist(src.viewing_channel.messages) ) + if(isemptylist(viewing_channel.messages)) dat+="No feed messages found in channel...
              " else - for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages) + for(var/datum/feed_message/MESSAGE in viewing_channel.messages) dat+="-[MESSAGE.body]
              \[[MESSAGE.message_type] by [MESSAGE.author]\]
              " dat+="
              Back" @@ -448,27 +445,27 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(wanted_already) dat+="
              A wanted issue is already in Feed Circulation. You can edit or cancel it below.
              " dat+="
              " - dat+="Criminal Name: [src.channel_name]
              " - dat+="Description: [src.msg]
              " - dat+="Attach Photo: [(src.photo_data ? "Photo Attached" : "No Photo")]
              " + dat+="Criminal Name: [channel_name]
              " + dat+="Description: [msg]
              " + dat+="Attach Photo: [(photo_data ? "Photo Attached" : "No Photo")]
              " if(wanted_already) dat+="Wanted Issue created by: [news_network.wanted_issue.backup_author]
              " else - dat+="Wanted Issue will be created under prosecutor: [src.scanned_user]
              " + dat+="Wanted Issue will be created under prosecutor: [scanned_user]
              " dat+="
              [(wanted_already) ? ("Edit Issue") : ("Submit")]" if(wanted_already) dat+="
              Take down Issue" dat+="
              Cancel" if(15) - dat+="Wanted issue for [src.channel_name] is now in Network Circulation.

              " + dat+="Wanted issue for [channel_name] is now in Network Circulation.

              " dat+="
              Return
              " if(16) dat+="ERROR: Wanted Issue rejected by Network.

              " - if(src.channel_name=="" || src.channel_name == "\[REDACTED\]") + if(channel_name=="" || channel_name == "\[REDACTED\]") dat+="•Invalid name for person wanted.
              " - if(src.scanned_user=="Unknown") + if(scanned_user=="Unknown") dat+="•Issue author unverified.
              " - if(src.msg == "" || src.msg == "\[REDACTED\]") + if(msg == "" || msg == "\[REDACTED\]") dat+="•Invalid description.
              " dat+="
              Return
              " if(17) @@ -486,7 +483,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="None" dat+="

              Back
              " if(19) - dat+="Wanted issue for [src.channel_name] successfully edited.

              " + dat+="Wanted issue for [channel_name] successfully edited.

              " dat+="
              Return
              " if(20) dat+="Printing successful. Please receive your newspaper from the bottom of the machine.

              " @@ -504,17 +501,17 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co /obj/machinery/newscaster/Topic(href, href_list) if(..()) return - if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) + if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) usr.set_machine(src) if(href_list["set_channel_name"]) - src.channel_name = sanitizeSafe(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""), MAX_LNAME_LEN) - src.updateUsrDialog() - //src.update_icon() + channel_name = sanitizeSafe(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""), MAX_LNAME_LEN) + updateUsrDialog() + //update_icon() else if(href_list["set_channel_lock"]) - src.c_locked = !src.c_locked - src.updateUsrDialog() - //src.update_icon() + c_locked = !c_locked + updateUsrDialog() + //update_icon() else if(href_list["submit_new_channel"]) //var/list/existing_channels = list() //OBSOLETE @@ -527,73 +524,73 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co existing_authors +=FC.author var/check = 0 for(var/datum/feed_channel/FC in news_network.network_channels) - if(FC.channel_name == src.channel_name) + if(FC.channel_name == channel_name) check = 1 break - if(src.channel_name == "" || src.channel_name == "\[REDACTED\]" || src.scanned_user == "Unknown" || check || (src.scanned_user in existing_authors) ) - src.screen=7 + if(channel_name == "" || channel_name == "\[REDACTED\]" || scanned_user == "Unknown" || check || (scanned_user in existing_authors)) + screen=7 else var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel") if(choice=="Confirm") - news_network.CreateFeedChannel(src.channel_name, src.scanned_user, c_locked) - src.screen=5 - src.updateUsrDialog() - //src.update_icon() + news_network.CreateFeedChannel(channel_name, scanned_user, c_locked) + screen=5 + updateUsrDialog() + //update_icon() else if(href_list["set_channel_receiving"]) //var/list/datum/feed_channel/available_channels = list() var/list/available_channels = list() for(var/datum/feed_channel/F in news_network.network_channels) - if( (!F.locked || F.author == scanned_user) && !F.censored) + if((!F.locked || F.author == scanned_user) && !F.censored) available_channels += F.channel_name - src.channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels - src.updateUsrDialog() + channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels + updateUsrDialog() else if(href_list["set_new_message"]) - src.msg = sanitize(input(usr, "Write your Feed story", "Network Channel Handler", "")) - src.updateUsrDialog() + msg = sanitize(input(usr, "Write your Feed story", "Network Channel Handler", "")) + updateUsrDialog() else if(href_list["set_attachment"]) AttachPhoto(usr) - src.updateUsrDialog() + updateUsrDialog() else if(href_list["submit_new_message"]) - if(src.msg =="" || src.msg=="\[REDACTED\]" || src.scanned_user == "Unknown" || src.channel_name == "" ) - src.screen=6 + if(msg =="" || msg=="\[REDACTED\]" || scanned_user == "Unknown" || channel_name == "") + screen=6 else var/image = photo_data ? photo_data.photo : null feedback_inc("newscaster_stories",1) - news_network.SubmitArticle(src.msg, src.scanned_user, src.channel_name, image, 0) - src.screen=4 + news_network.SubmitArticle(msg, scanned_user, channel_name, image, 0) + screen=4 - src.updateUsrDialog() + updateUsrDialog() else if(href_list["create_channel"]) - src.screen=2 - src.updateUsrDialog() + screen=2 + updateUsrDialog() else if(href_list["create_feed_story"]) - src.screen=3 - src.updateUsrDialog() + screen=3 + updateUsrDialog() else if(href_list["menu_paper"]) - src.screen=8 - src.updateUsrDialog() + screen=8 + updateUsrDialog() else if(href_list["print_paper"]) - if(!src.paper_remaining) - src.screen=21 + if(!paper_remaining) + screen=21 else - src.print_paper() - src.screen = 20 - src.updateUsrDialog() + print_paper() + screen = 20 + updateUsrDialog() else if(href_list["menu_censor_story"]) - src.screen=10 - src.updateUsrDialog() + screen=10 + updateUsrDialog() else if(href_list["menu_censor_channel"]) - src.screen=11 - src.updateUsrDialog() + screen=11 + updateUsrDialog() else if(href_list["menu_wanted"]) var/already_wanted = 0 @@ -601,48 +598,48 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co already_wanted = 1 if(already_wanted) - src.channel_name = news_network.wanted_issue.author - src.msg = news_network.wanted_issue.body - src.screen = 14 - src.updateUsrDialog() + channel_name = news_network.wanted_issue.author + msg = news_network.wanted_issue.body + screen = 14 + updateUsrDialog() else if(href_list["set_wanted_name"]) - src.channel_name = sanitizeSafe(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""), MAX_LNAME_LEN) - src.updateUsrDialog() + channel_name = sanitizeSafe(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""), MAX_LNAME_LEN) + updateUsrDialog() else if(href_list["set_wanted_desc"]) - src.msg = sanitize(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "")) - src.updateUsrDialog() + msg = sanitize(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "")) + updateUsrDialog() else if(href_list["submit_wanted"]) var/input_param = text2num(href_list["submit_wanted"]) - if(src.msg == "" || src.channel_name == "" || src.scanned_user == "Unknown") - src.screen = 16 + if(msg == "" || channel_name == "" || scanned_user == "Unknown") + screen = 16 else var/choice = alert("Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. See the else below var/datum/feed_message/WANTED = new /datum/feed_message - WANTED.author = src.channel_name - WANTED.body = src.msg - WANTED.backup_author = src.scanned_user //I know, a bit wacky + WANTED.author = channel_name + WANTED.body = msg + WANTED.backup_author = scanned_user //I know, a bit wacky if(photo_data) WANTED.img = photo_data.photo.img news_network.wanted_issue = WANTED news_network.alert_readers() - src.screen = 15 + screen = 15 else if(news_network.wanted_issue.is_admin_message) alert("The wanted issue has been distributed by a [company_name] higherup. You cannot edit it.","Ok") return - news_network.wanted_issue.author = src.channel_name - news_network.wanted_issue.body = src.msg - news_network.wanted_issue.backup_author = src.scanned_user + news_network.wanted_issue.author = channel_name + news_network.wanted_issue.body = msg + news_network.wanted_issue.backup_author = scanned_user if(photo_data) news_network.wanted_issue.img = photo_data.photo.img - src.screen = 19 + screen = 19 - src.updateUsrDialog() + updateUsrDialog() else if(href_list["cancel_wanted"]) if(news_network.wanted_issue.is_admin_message) @@ -653,12 +650,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co news_network.wanted_issue = null for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) NEWSCASTER.update_icon() - src.screen=17 - src.updateUsrDialog() + screen=17 + updateUsrDialog() else if(href_list["view_wanted"]) - src.screen=18 - src.updateUsrDialog() + screen=18 + updateUsrDialog() else if(href_list["censor_channel_author"]) var/datum/feed_channel/FC = locate(href_list["censor_channel_author"]) if(FC.is_admin_channel) @@ -670,7 +667,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else FC.author = FC.backup_author FC.update() - src.updateUsrDialog() + updateUsrDialog() else if(href_list["censor_channel_story_author"]) var/datum/feed_message/MSG = locate(href_list["censor_channel_story_author"]) @@ -683,7 +680,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else MSG.author = MSG.backup_author MSG.parent_channel.update() - src.updateUsrDialog() + updateUsrDialog() else if(href_list["censor_channel_story_body"]) var/datum/feed_message/MSG = locate(href_list["censor_channel_story_body"]) @@ -703,13 +700,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co MSG.img = MSG.backup_img MSG.parent_channel.update() - src.updateUsrDialog() + updateUsrDialog() else if(href_list["pick_d_notice"]) var/datum/feed_channel/FC = locate(href_list["pick_d_notice"]) - src.viewing_channel = FC - src.screen=13 - src.updateUsrDialog() + viewing_channel = FC + screen=13 + updateUsrDialog() else if(href_list["toggle_d_notice"]) var/datum/feed_channel/FC = locate(href_list["toggle_d_notice"]) @@ -718,70 +715,46 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co return FC.censored = !FC.censored FC.update() - src.updateUsrDialog() + updateUsrDialog() else if(href_list["view"]) - src.screen=1 - src.updateUsrDialog() + screen=1 + updateUsrDialog() else if(href_list["setScreen"]) //Brings us to the main menu and resets all fields~ - src.screen = text2num(href_list["setScreen"]) - if (src.screen == 0) - src.scanned_user = "Unknown"; + screen = text2num(href_list["setScreen"]) + if(screen == 0) + scanned_user = "Unknown"; msg = ""; - src.c_locked=0; + c_locked=0; channel_name=""; - src.viewing_channel = null - src.updateUsrDialog() + viewing_channel = null + updateUsrDialog() else if(href_list["show_channel"]) var/datum/feed_channel/FC = locate(href_list["show_channel"]) - src.viewing_channel = FC - src.screen = 9 - src.updateUsrDialog() + viewing_channel = FC + screen = 9 + updateUsrDialog() else if(href_list["pick_censor_channel"]) var/datum/feed_channel/FC = locate(href_list["pick_censor_channel"]) - src.viewing_channel = FC - src.screen = 12 - src.updateUsrDialog() + viewing_channel = FC + screen = 12 + updateUsrDialog() else if(href_list["refresh"]) - src.updateUsrDialog() - - + updateUsrDialog() /obj/machinery/newscaster/attackby(I as obj, user as mob) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - user << "You start disconnecting the monitor." - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "newscaster" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) - if (src.stat & isbroken == 1) - user << "The broken glass falls out." - new /obj/item/weapon/material/shard( src.loc ) - A.state = 3 - A.icon_state = "newscaster_3" - else - user << "You disconnect the monitor." - A.state = 4 - A.icon_state = "newscaster_4" - M.deconstruct(src) - qdel(src) + if(computer_deconstruction_screwdriver(user, I)) + return else - src.attack_hand(user) + attack_hand(user) return /obj/machinery/newscaster/attack_ai(mob/user as mob) - return src.attack_hand(user) //or maybe it'll have some special functions? No idea. + return attack_hand(user) //or maybe it'll have some special functions? No idea. /datum/news_photo var/is_synth = 0 @@ -807,12 +780,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(istype(user,/mob/living/silicon)) var/mob/living/silicon/tempAI = user var/obj/item/weapon/photo/selection = tempAI.GetPicture() - if (!selection) + if(!selection) return photo_data = new(selection, 1) - //######################################################################################################################## //###################################### NEWSPAPER! ###################################################################### //######################################################################################################################## @@ -836,34 +808,34 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob) if(ishuman(user)) var/mob/living/carbon/human/human_user = user var/dat - src.pages = 0 + pages = 0 switch(screen) if(0) //Cover dat+="
              The Griffon
              " dat+="
              [company_name]-standard newspaper, for use on [company_name]© Space Facilities

              " - if(isemptylist(src.news_content)) - if(src.important_message) - dat+="Contents:
                **Important Security Announcement** \[page [src.pages+2]\]
              " + if(isemptylist(news_content)) + if(important_message) + dat+="Contents:
                **Important Security Announcement** \[page [pages+2]\]
              " else dat+="Other than the title, the rest of the newspaper is unprinted..." else dat+="Contents:
                " - for(var/datum/feed_channel/NP in src.news_content) - src.pages++ - if(src.important_message) - dat+="**Important Security Announcement** \[page [src.pages+2]\]
                " + for(var/datum/feed_channel/NP in news_content) + pages++ + if(important_message) + dat+="**Important Security Announcement** \[page [pages+2]\]
                " var/temp_page=0 - for(var/datum/feed_channel/NP in src.news_content) + for(var/datum/feed_channel/NP in news_content) temp_page++ dat+="[NP.channel_name] \[page [temp_page+1]\]
                " dat+="
              " if(scribble_page==curr_page) - dat+="
              There is a small scribble near the end of this page... It reads: \"[src.scribble]\"" + dat+="
              There is a small scribble near the end of this page... It reads: \"[scribble]\"" dat+= "
              " if(1) // X channel pages inbetween. - for(var/datum/feed_channel/NP in src.news_content) - src.pages++ //Let's get it right again. - var/datum/feed_channel/C = src.news_content[src.curr_page] + for(var/datum/feed_channel/NP in news_content) + pages++ //Let's get it right again. + var/datum/feed_channel/C = news_content[curr_page] dat+="[C.channel_name] \[created by: [C.author]\]

              " if(C.censored) dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a D-Notice. Its contents were not transferred to the newspaper at the time of printing." @@ -882,12 +854,12 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob) dat+="\[[MESSAGE.message_type] by [MESSAGE.author]\]

              " dat+="
            " if(scribble_page==curr_page) - dat+="
            There is a small scribble near the end of this page... It reads: \"[src.scribble]\"" + dat+="
            There is a small scribble near the end of this page... It reads: \"[scribble]\"" dat+= "

            " if(2) //Last page - for(var/datum/feed_channel/NP in src.news_content) - src.pages++ - if(src.important_message!=null) + for(var/datum/feed_channel/NP in news_content) + pages++ + if(important_message!=null) dat+="
            Wanted Issue:


            " dat+="Criminal name: [important_message.author]
            " dat+="Description: [important_message.body]
            " @@ -900,91 +872,86 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob) else dat+="Apart from some uninteresting Classified ads, there's nothing on this page..." if(scribble_page==curr_page) - dat+="
            There is a small scribble near the end of this page... It reads: \"[src.scribble]\"" + dat+="
            There is a small scribble near the end of this page... It reads: \"[scribble]\"" dat+= "
            " else dat+="I'm sorry to break your immersion. This shit's bugged. Report this bug to Agouri, polyxenitopalidou@gmail.com" - dat+="

            [src.curr_page+1]
            " + dat+="

            [curr_page+1]
            " human_user << browse(dat, "window=newspaper_main;size=300x400") onclose(human_user, "newspaper_main") else user << "The paper is full of intelligible symbols!" - obj/item/weapon/newspaper/Topic(href, href_list) var/mob/living/U = usr ..() - if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) )) + if((src in U.contents) || (istype(loc, /turf) && in_range(src, U))) U.set_machine(src) if(href_list["next_page"]) - if(curr_page==src.pages+1) + if(curr_page == pages+1) return //Don't need that at all, but anyway. - if(src.curr_page == src.pages) //We're at the middle, get to the end - src.screen = 2 + if(curr_page == pages) //We're at the middle, get to the end + screen = 2 else if(curr_page == 0) //We're at the start, get to the middle - src.screen=1 - src.curr_page++ - playsound(src.loc, "pageturn", 50, 1) + screen = 1 + curr_page++ + playsound(loc, "pageturn", 50, 1) else if(href_list["prev_page"]) if(curr_page == 0) return if(curr_page == 1) - src.screen = 0 + screen = 0 else - if(curr_page == src.pages+1) //we're at the end, let's go back to the middle. - src.screen = 1 - src.curr_page-- + if(curr_page == pages+1) //we're at the end, let's go back to the middle. + screen = 1 + curr_page-- playsound(src.loc, "pageturn", 50, 1) - if (istype(src.loc, /mob)) - src.attack_self(src.loc) - + if(istype(src.loc, /mob)) + attack_self(src.loc) obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/pen)) - if(src.scribble_page == src.curr_page) + if(scribble_page == curr_page) user << "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?" else var/s = sanitize(input(user, "Write something", "Newspaper", "")) s = sanitize(s) - if (!s) + if(!s) return - if (!in_range(src, usr) && src.loc != usr) + if(!in_range(src, usr) && src.loc != usr) return - src.scribble_page = src.curr_page - src.scribble = s - src.attack_self(user) + scribble_page = curr_page + scribble = s + attack_self(user) return - ////////////////////////////////////helper procs - /obj/machinery/newscaster/proc/scan_user(mob/living/user as mob) if(istype(user,/mob/living/carbon/human)) //User is a human var/mob/living/carbon/human/human_user = user if(human_user.wear_id) //Newscaster scans you - if(istype(human_user.wear_id, /obj/item/device/pda) ) //autorecognition, woo! + if(istype(human_user.wear_id, /obj/item/device/pda)) //autorecognition, woo! var/obj/item/device/pda/P = human_user.wear_id if(P.id) - src.scanned_user = GetNameAndAssignmentFromId(P.id) + scanned_user = GetNameAndAssignmentFromId(P.id) else - src.scanned_user = "Unknown" - else if(istype(human_user.wear_id, /obj/item/weapon/card/id) ) + scanned_user = "Unknown" + else if(istype(human_user.wear_id, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/ID = human_user.wear_id - src.scanned_user = GetNameAndAssignmentFromId(ID) + scanned_user = GetNameAndAssignmentFromId(ID) else - src.scanned_user ="Unknown" + scanned_user ="Unknown" else - src.scanned_user ="Unknown" + scanned_user ="Unknown" else var/mob/living/silicon/ai_user = user - src.scanned_user = "[ai_user.name] ([ai_user.job])" - + scanned_user = "[ai_user.name] ([ai_user.job])" /obj/machinery/newscaster/proc/print_paper() feedback_inc("newscaster_newspapers_printed",1) @@ -994,7 +961,7 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) if(news_network.wanted_issue) NEWSPAPER.important_message = news_network.wanted_issue NEWSPAPER.loc = get_turf(src) - src.paper_remaining-- + paper_remaining-- return /obj/machinery/newscaster/proc/newsAlert(var/news_call) @@ -1003,15 +970,15 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) var/turf/T = get_turf(src) if(news_call) for(var/mob/O in hearers(world.view-1, T)) - O.show_message("[src.name] beeps, \"[news_call]\"",2) - src.alert = 1 - src.update_icon() + O.show_message("[name] beeps, \"[news_call]\"",2) + alert = 1 + update_icon() spawn(300) - src.alert = 0 - src.update_icon() + alert = 0 + update_icon() playsound(src.loc, 'sound/machines/twobeep.ogg', 75, 1) else for(var/mob/O in hearers(world.view-1, T)) - O.show_message("[src.name] beeps, \"Attention! Wanted issue distributed!\"",2) + O.show_message("[name] beeps, \"Attention! Wanted issue distributed!\"",2) playsound(src.loc, 'sound/machines/warning-buzzer.ogg', 75, 1) return diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index d02d3522a4..74b39840d0 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -25,83 +25,79 @@ var/bomb_set // 3 is sealant open, 4 is unwrenched, 5 is removed from bolts. use_power = 0 - - /obj/machinery/nuclearbomb/New() ..() r_code = "[rand(10000, 99999.0)]"//Creates a random code upon object spawn. - - src.wires["Red"] = 0 - src.wires["Blue"] = 0 - src.wires["Green"] = 0 - src.wires["Marigold"] = 0 - src.wires["Fuschia"] = 0 - src.wires["Black"] = 0 - src.wires["Pearl"] = 0 + wires["Red"] = 0 + wires["Blue"] = 0 + wires["Green"] = 0 + wires["Marigold"] = 0 + wires["Fuschia"] = 0 + wires["Black"] = 0 + wires["Pearl"] = 0 var/list/w = list("Red","Blue","Green","Marigold","Black","Fuschia","Pearl") - src.light_wire = pick(w) - w -= src.light_wire - src.timing_wire = pick(w) - w -= src.timing_wire - src.safety_wire = pick(w) - w -= src.safety_wire + light_wire = pick(w) + w -= light_wire + timing_wire = pick(w) + w -= timing_wire + safety_wire = pick(w) + w -= safety_wire /obj/machinery/nuclearbomb/process() - if (src.timing) + if(timing) bomb_set = 1 //So long as there is one nuke timing, it means one nuke is armed. - src.timeleft-- - if (src.timeleft <= 0) + timeleft-- + if(timeleft <= 0) explode() for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) + if((M.client && M.machine == src)) + attack_hand(M) return /obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob) - - if (istype(O, /obj/item/weapon/screwdriver)) - src.add_fingerprint(user) - if (src.auth) - if (src.opened == 0) - src.opened = 1 + if(istype(O, /obj/item/weapon/screwdriver)) + add_fingerprint(user) + if(auth) + if(opened == 0) + opened = 1 overlays += image(icon, "npanel_open") user << "You unscrew the control panel of [src]." else - src.opened = 0 + opened = 0 overlays -= image(icon, "npanel_open") user << "You screw the control panel of [src] back on." else - if (src.opened == 0) + if(opened == 0) user << "The [src] emits a buzzing noise, the panel staying locked in." - if (src.opened == 1) - src.opened = 0 + if(opened == 1) + opened = 0 overlays -= image(icon, "npanel_open") user << "You screw the control panel of [src] back on." flick("nuclearbombc", src) return - if (istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/device/multitool)) - if (src.opened == 1) + if(istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/device/multitool)) + if(opened == 1) nukehack_win(user) return - if (src.extended) - if (istype(O, /obj/item/weapon/disk/nuclear)) + if(extended) + if(istype(O, /obj/item/weapon/disk/nuclear)) usr.drop_item() O.loc = src - src.auth = O - src.add_fingerprint(user) + auth = O + add_fingerprint(user) return - if (src.anchored) + if(anchored) switch(removal_stage) if(0) if(istype(O,/obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = O if(!WT.isOn()) return - if (WT.get_fuel() < 5) // uses up 5 fuel. + if(WT.get_fuel() < 5) // uses up 5 fuel. user << "You need more fuel to complete this task." return @@ -128,7 +124,7 @@ var/bomb_set var/obj/item/weapon/weldingtool/WT = O if(!WT.isOn()) return - if (WT.get_fuel() < 5) // uses up 5 fuel. + if(WT.get_fuel() < 5) // uses up 5 fuel. user << "You need more fuel to complete this task." return @@ -165,51 +161,51 @@ var/bomb_set ..() /obj/machinery/nuclearbomb/attack_hand(mob/user as mob) - if (src.extended) - if (!ishuman(user)) + if(extended) + if(!ishuman(user)) usr << "You don't have the dexterity to do this!" return 1 user.set_machine(src) - var/dat = text("Nuclear Fission Explosive
            \nAuth. Disk: []
            ", src, (src.auth ? "++++++++++" : "----------")) - if (src.auth) - if (src.yes_code) - dat += text("\nStatus: []-[]
            \nTimer: []
            \n
            \nTimer: [] Toggle
            \nTime: - - [] + +
            \n
            \nSafety: [] Toggle
            \nAnchor: [] Toggle
            \n", (src.timing ? "Func/Set" : "Functional"), (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src, src, src, src.timeleft, src, src, (src.safety ? "On" : "Off"), src, (src.anchored ? "Engaged" : "Off"), src) + var/dat = text("Nuclear Fission Explosive
            \nAuth. Disk: []
            ", src, (auth ? "++++++++++" : "----------")) + if(auth) + if(yes_code) + dat += text("\nStatus: []-[]
            \nTimer: []
            \n
            \nTimer: [] Toggle
            \nTime: - - [] + +
            \n
            \nSafety: [] Toggle
            \nAnchor: [] Toggle
            \n", (timing ? "Func/Set" : "Functional"), (safety ? "Safe" : "Engaged"), timeleft, (timing ? "On" : "Off"), src, src, src, timeleft, src, src, (safety ? "On" : "Off"), src, (anchored ? "Engaged" : "Off"), src) else - dat += text("\nStatus: Auth. S2-[]
            \nTimer: []
            \n
            \nTimer: [] Toggle
            \nTime: - - [] + +
            \n
            \n[] Safety: Toggle
            \nAnchor: [] Toggle
            \n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) + dat += text("\nStatus: Auth. S2-[]
            \nTimer: []
            \n
            \nTimer: [] Toggle
            \nTime: - - [] + +
            \n
            \n[] Safety: Toggle
            \nAnchor: [] Toggle
            \n", (safety ? "Safe" : "Engaged"), timeleft, (timing ? "On" : "Off"), timeleft, (safety ? "On" : "Off"), (anchored ? "Engaged" : "Off")) else - if (src.timing) - dat += text("\nStatus: Set-[]
            \nTimer: []
            \n
            \nTimer: [] Toggle
            \nTime: - - [] + +
            \n
            \nSafety: [] Toggle
            \nAnchor: [] Toggle
            \n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) + if(timing) + dat += text("\nStatus: Set-[]
            \nTimer: []
            \n
            \nTimer: [] Toggle
            \nTime: - - [] + +
            \n
            \nSafety: [] Toggle
            \nAnchor: [] Toggle
            \n", (safety ? "Safe" : "Engaged"), timeleft, (timing ? "On" : "Off"), timeleft, (safety ? "On" : "Off"), (anchored ? "Engaged" : "Off")) else - dat += text("\nStatus: Auth. S1-[]
            \nTimer: []
            \n
            \nTimer: [] Toggle
            \nTime: - - [] + +
            \n
            \nSafety: [] Toggle
            \nAnchor: [] Toggle
            \n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) + dat += text("\nStatus: Auth. S1-[]
            \nTimer: []
            \n
            \nTimer: [] Toggle
            \nTime: - - [] + +
            \n
            \nSafety: [] Toggle
            \nAnchor: [] Toggle
            \n", (safety ? "Safe" : "Engaged"), timeleft, (timing ? "On" : "Off"), timeleft, (safety ? "On" : "Off"), (anchored ? "Engaged" : "Off")) var/message = "AUTH" - if (src.auth) - message = text("[]", src.code) - if (src.yes_code) + if(auth) + message = text("[]", code) + if(yes_code) message = "*****" dat += text("
            \n>[]
            \n1-2-3
            \n4-5-6
            \n7-8-9
            \nR-0-E
            \n
            ", message, src, src, src, src, src, src, src, src, src, src, src, src) user << browse(dat, "window=nuclearbomb;size=300x400") onclose(user, "nuclearbomb") - else if (src.deployable) + else if(deployable) if(removal_stage < 5) - src.anchored = 1 + anchored = 1 visible_message("With a steely snap, bolts slide out of [src] and anchor it to the flooring!") else visible_message("\The [src] makes a highly unpleasant crunching noise. It looks like the anchoring bolts have been cut.") - if(!src.lighthack) + if(!lighthack) flick("nuclearbombc", src) - src.icon_state = "nuclearbomb1" - src.extended = 1 + icon_state = "nuclearbomb1" + extended = 1 return obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) var/dat as text dat += "Nuclear Fission Explosive
            \nNuclear Device Wires:
            " - for(var/wire in src.wires) - dat += text("[wire] Wire: [src.wires[wire] ? "Mend" : "Cut"] Pulse
            ") - dat += text("
            The device is [src.timing ? "shaking!" : "still"]
            ") - dat += text("The device is [src.safety ? "quiet" : "whirring"].
            ") - dat += text("The lights are [src.lighthack ? "static" : "functional"].
            ") + for(var/wire in wires) + dat += text("[wire] Wire: [wires[wire] ? "Mend" : "Cut"] Pulse
            ") + dat += text("
            The device is [timing ? "shaking!" : "still"]
            ") + dat += text("The device is [safety ? "quiet" : "whirring"].
            ") + dat += text("The lights are [lighthack ? "static" : "functional"].
            ") user << browse("Bomb Defusion[dat]","window=nukebomb_hack") onclose(user, "nukebomb_hack") @@ -218,141 +214,140 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) set name = "Make Deployable" set src in oview(1) - if (!usr.canmove || usr.stat || usr.restrained()) + if(!usr.canmove || usr.stat || usr.restrained()) return - if (!ishuman(usr)) + if(!ishuman(usr)) usr << "You don't have the dexterity to do this!" return 1 - if (src.deployable) + if(deployable) usr << "You close several panels to make [src] undeployable." - src.deployable = 0 + deployable = 0 else usr << "You adjust some panels to make [src] deployable." - src.deployable = 1 + deployable = 1 return - /obj/machinery/nuclearbomb/Topic(href, href_list) ..() - if (!usr.canmove || usr.stat || usr.restrained()) + if(!usr.canmove || usr.stat || usr.restrained()) return - if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))) + if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))) usr.set_machine(src) if(href_list["act"]) var/temp_wire = href_list["wire"] if(href_list["act"] == "pulse") - if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) + if(!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" else - if(src.wires[temp_wire]) + if(wires[temp_wire]) usr << "You can't pulse a cut wire." else - if(src.light_wire == temp_wire) - src.lighthack = !src.lighthack - spawn(100) src.lighthack = !src.lighthack - if(src.timing_wire == temp_wire) - if(src.timing) + if(light_wire == temp_wire) + lighthack = !lighthack + spawn(100) lighthack = !lighthack + if(timing_wire == temp_wire) + if(timing) explode() - if(src.safety_wire == temp_wire) - src.safety = !src.safety - spawn(100) src.safety = !src.safety - if(src.safety == 1) + if(safety_wire == temp_wire) + safety = !safety + spawn(100) safety = !safety + if(safety == 1) visible_message("The [src] quiets down.") - if(!src.lighthack) - if (src.icon_state == "nuclearbomb2") - src.icon_state = "nuclearbomb1" + if(!lighthack) + if(icon_state == "nuclearbomb2") + icon_state = "nuclearbomb1" else visible_message("The [src] emits a quiet whirling noise!") if(href_list["act"] == "wire") - if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) + if(!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) usr << "You need wirecutters!" else wires[temp_wire] = !wires[temp_wire] - if(src.safety_wire == temp_wire) - if(src.timing) + if(safety_wire == temp_wire) + if(timing) explode() - if(src.timing_wire == temp_wire) - if(!src.lighthack) - if (src.icon_state == "nuclearbomb2") - src.icon_state = "nuclearbomb1" - src.timing = 0 + if(timing_wire == temp_wire) + if(!lighthack) + if(icon_state == "nuclearbomb2") + icon_state = "nuclearbomb1" + timing = 0 bomb_set = 0 - if(src.light_wire == temp_wire) - src.lighthack = !src.lighthack + if(light_wire == temp_wire) + lighthack = !lighthack - if (href_list["auth"]) - if (src.auth) - src.auth.loc = src.loc - src.yes_code = 0 - src.auth = null + if(href_list["auth"]) + if(auth) + auth.loc = src.loc + yes_code = 0 + auth = null else var/obj/item/I = usr.get_active_hand() - if (istype(I, /obj/item/weapon/disk/nuclear)) + if(istype(I, /obj/item/weapon/disk/nuclear)) usr.drop_item() I.loc = src - src.auth = I - if (src.auth) - if (href_list["type"]) - if (href_list["type"] == "E") - if (src.code == src.r_code) - src.yes_code = 1 - src.code = null + auth = I + if(auth) + if(href_list["type"]) + if(href_list["type"] == "E") + if(code == r_code) + yes_code = 1 + code = null else - src.code = "ERROR" + code = "ERROR" else - if (href_list["type"] == "R") - src.yes_code = 0 - src.code = null + if(href_list["type"] == "R") + yes_code = 0 + code = null else - src.code += text("[]", href_list["type"]) - if (length(src.code) > 5) - src.code = "ERROR" - if (src.yes_code) - if (href_list["time"]) + code += text("[]", href_list["type"]) + if(length(code) > 5) + code = "ERROR" + if(yes_code) + if(href_list["time"]) var/time = text2num(href_list["time"]) - src.timeleft += time - src.timeleft = min(max(round(src.timeleft), 60), 600) - if (href_list["timer"]) - if (src.timing == -1.0) + timeleft += time + timeleft = min(max(round(timeleft), 60), 600) + if(href_list["timer"]) + if(timing == -1.0) return - if (src.safety) + if(safety) usr << "The safety is still on." return - src.timing = !( src.timing ) - if (src.timing) - if(!src.lighthack) - src.icon_state = "nuclearbomb2" - if(!src.safety) + timing = !(timing) + if(timing) + if(!lighthack) + icon_state = "nuclearbomb2" + if(!safety) bomb_set = 1//There can still be issues with this reseting when there are multiple bombs. Not a big deal tho for Nuke/N else bomb_set = 0 else bomb_set = 0 - if(!src.lighthack) - src.icon_state = "nuclearbomb1" - if (href_list["safety"]) - src.safety = !( src.safety ) + if(!lighthack) + icon_state = "nuclearbomb1" + if(href_list["safety"]) + safety = !(safety) if(safety) - src.timing = 0 + timing = 0 bomb_set = 0 - if (href_list["anchor"]) + if(href_list["anchor"]) if(removal_stage == 5) - src.anchored = 0 + anchored = 0 visible_message("\The [src] makes a highly unpleasant crunching noise. It looks like the anchoring bolts have been cut.") return - src.anchored = !( src.anchored ) - if(src.anchored) + anchored = !(anchored) + if(anchored) visible_message("With a steely snap, bolts slide out of [src] and anchor it to the flooring.") else visible_message("The anchoring bolts slide back into the depths of [src].") - src.add_fingerprint(usr) + add_fingerprint(usr) for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) + if((M.client && M.machine == src)) + attack_hand(M) else usr << browse(null, "window=nuclearbomb") return @@ -365,23 +360,23 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) #define NUKERANGE 80 /obj/machinery/nuclearbomb/proc/explode() - if (src.safety) - src.timing = 0 + if(safety) + timing = 0 return - src.timing = -1.0 - src.yes_code = 0 - src.safety = 1 - if(!src.lighthack) - src.icon_state = "nuclearbomb3" + timing = -1.0 + yes_code = 0 + safety = 1 + if(!lighthack) + icon_state = "nuclearbomb3" playsound(src,'sound/machines/Alarm.ogg',100,0,5) - if (ticker && ticker.mode) + if(ticker && ticker.mode) ticker.mode.explosion_in_progress = 1 sleep(100) var/off_station = 0 var/turf/bomb_location = get_turf(src) if(bomb_location && (bomb_location.z in config.station_levels)) - if( (bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)) ) + if((bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE))) off_station = 1 else off_station = 2 diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm index 2b3679dda5..48bd028c09 100644 --- a/code/game/machinery/overview.dm +++ b/code/game/machinery/overview.dm @@ -1,27 +1,23 @@ //#define AMAP - /obj/machinery/computer/security/verb/station_map() set name = ".map" set category = "Object" set src in view(1) usr.set_machine(src) if(!mapping) return - log_game("[usr]([usr.key]) used station map L[z] in [src.loc.loc]") - - src.drawmap(usr) + drawmap(usr) /obj/machinery/computer/security/proc/drawmap(var/mob/user as mob) var/icx = round(world.maxx/16) + 1 var/icy = round(world.maxy/16) + 1 - var/xoff = round( (icx*16-world.maxx)-2) - var/yoff = round( (icy*16-world.maxy)-2) + var/xoff = round((icx*16-world.maxx)-2) + var/yoff = round((icy*16-world.maxy)-2) var/icount = icx * icy - var/list/imap = list() #ifdef AMAP @@ -32,7 +28,6 @@ //world << "[icount] images in list" - for(var/wx = 1 ; wx <= world.maxx; wx++) for(var/wy = 1; wy <= world.maxy; wy++) @@ -42,8 +37,6 @@ var/colour var/colour2 - - if(!T) colour = rgb(0,0,0) @@ -79,9 +72,6 @@ else colour = rgb(0,40,0) - - - if(sense) for(var/atom/AM in T.contents) @@ -127,10 +117,8 @@ var/turf_total = environment.total_moles() //var/turf_total = T.co2 + T.oxygen + T.poison + T.sl_gas + T.n2 - var/t1 = turf_total / MOLES_CELLSTANDARD * 150 - if(t1<=100) colour2 = rgb(t1*2.55,0,0) else @@ -150,19 +138,16 @@ var/icon/I = imap[1+(ix + icx*iy)*2] var/icon/I2 = imap[2+(ix + icx*iy)*2] - //world << "icon: \icon[I]" I.DrawBox(colour, rx, ry, rx+1, ry+1) I2.DrawBox(colour2, rx, ry, rx+1, ry+1) - user.clearmap() user.mapobjs = list() - for(var/i=0; iCannot secure turrets in space!" return - user.visible_message( \ + user.visible_message(\ "[user] begins [anchored ? "un" : ""]securing the turret.", \ "You begin [anchored ? "un" : ""]securing the turret." \ ) @@ -386,7 +385,7 @@ var/list/turret_icons return health -= force - if (force > 5 && prob(45)) + if(force > 5 && prob(45)) spark_system.start() if(health <= 0) die() //the death process :( @@ -434,14 +433,14 @@ var/list/turret_icons /obj/machinery/porta_turret/ex_act(severity) switch (severity) - if (1) + if(1) qdel(src) - if (2) - if (prob(25)) + if(2) + if(prob(25)) qdel(src) else take_damage(initial(health) * 8) //should instakill most turrets - if (3) + if(3) take_damage(initial(health) * 8 / 3) /obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0 @@ -600,8 +599,8 @@ var/list/turret_icons timeout = 10 /obj/machinery/porta_turret/proc/set_raised_raising(var/raised, var/raising) - src.raised = raised - src.raising = raising + raised = raised + raising = raising density = raised || raising /obj/machinery/porta_turret/proc/target(var/mob/living/target) @@ -677,9 +676,9 @@ var/list/turret_icons /obj/machinery/porta_turret/proc/setState(var/datum/turret_checks/TC) if(controllock) return - src.enabled = TC.enabled - src.lethal = TC.lethal - src.iconholder = TC.lethal + enabled = TC.enabled + lethal = TC.lethal + iconholder = TC.lethal check_synth = TC.check_synth check_access = TC.check_access @@ -689,7 +688,7 @@ var/list/turret_icons check_anomalies = TC.check_anomalies ailock = TC.ailock - src.power_change() + power_change() /* Portable turret constructions @@ -707,7 +706,6 @@ var/list/turret_icons var/installation = null //the gun type installed var/gun_charge = 0 //the gun charge of the gun type installed - /obj/machinery/porta_turret_construct/attackby(obj/item/I, mob/user) //this is a bit unwieldy but self-explanatory switch(build_step) @@ -722,7 +720,7 @@ var/list/turret_icons else if(istype(I, /obj/item/weapon/crowbar) && !anchored) playsound(loc, 'sound/items/Crowbar.ogg', 75, 1) user << "You dismantle the turret construction." - new /obj/item/stack/material/steel( loc, 5) + new /obj/item/stack/material/steel(loc, 5) qdel(src) return @@ -744,7 +742,6 @@ var/list/turret_icons build_step = 0 return - if(2) if(istype(I, /obj/item/weapon/wrench)) playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) @@ -765,10 +762,9 @@ var/list/turret_icons if(!src || !WT.remove_fuel(5, user)) return build_step = 1 user << "You remove the turret's interior metal armor." - new /obj/item/stack/material/steel( loc, 2) + new /obj/item/stack/material/steel(loc, 2) return - if(3) if(istype(I, /obj/item/weapon/gun/energy)) //the gun installation part @@ -873,7 +869,6 @@ var/list/turret_icons ..() - /obj/machinery/porta_turret_construct/attack_hand(mob/user) switch(build_step) if(4) @@ -899,7 +894,6 @@ var/list/turret_icons /atom/movable/porta_turret_cover icon = 'icons/obj/turrets.dmi' - #undef TURRET_PRIORITY_TARGET #undef TURRET_SECONDARY_TARGET -#undef TURRET_NOT_TARGET +#undef TURRET_NOT_TARGET \ No newline at end of file diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 55c2e10eaa..5d3270231f 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -1,5 +1,4 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 - obj/machinery/recharger name = "recharger" icon = 'icons/obj/stationobjs.dmi' @@ -16,8 +15,7 @@ obj/machinery/recharger var/portable = 1 circuit = /obj/item/weapon/circuitboard/recharger -obj/machinery/recharger/New() - circuit = new circuit(src) +/obj/machinery/recharger/New() component_parts = list() component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/stack/cable_coil(src, 5) @@ -25,13 +23,13 @@ obj/machinery/recharger/New() ..() return -obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) +/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) if(istype(user,/mob/living/silicon)) return var/allowed = 0 for (var/allowed_type in allowed_devices) - if (istype(G, allowed_type)) allowed = 1 + if(istype(G, allowed_type)) allowed = 1 if(allowed) if(charging) @@ -41,10 +39,10 @@ obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) if(!powered()) user << "The [name] blinks red as you try to insert the item!" return - if (istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow)) + if(istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow)) user << "Your gun's recharge port was removed to make room for a miniaturized reactor." return - if (istype(G, /obj/item/weapon/gun/energy/staff)) + if(istype(G, /obj/item/weapon/gun/energy/staff)) return if(istype(G, /obj/item/device/laptop)) var/obj/item/device/laptop/L = G @@ -67,7 +65,7 @@ obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) else if(default_deconstruction_crowbar(user, G)) return -obj/machinery/recharger/attack_hand(mob/user as mob) +/obj/machinery/recharger/attack_hand(mob/user as mob) if(istype(user,/mob/living/silicon)) return @@ -79,7 +77,7 @@ obj/machinery/recharger/attack_hand(mob/user as mob) charging = null update_icon() -obj/machinery/recharger/process() +/obj/machinery/recharger/process() if(stat & (NOPOWER|BROKEN) || !anchored) update_use_power(0) icon_state = icon_state_idle @@ -137,7 +135,7 @@ obj/machinery/recharger/process() update_use_power(1) return -obj/machinery/recharger/emp_act(severity) +/obj/machinery/recharger/emp_act(severity) if(stat & (NOPOWER|BROKEN) || !anchored) ..(severity) return @@ -153,14 +151,14 @@ obj/machinery/recharger/emp_act(severity) B.bcell.charge = 0 ..(severity) -obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier. +/obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier. if(charging) icon_state = icon_state_charging else icon_state = icon_state_idle -obj/machinery/recharger/wallcharger +/obj/machinery/recharger/wallcharger name = "wall recharger" icon = 'icons/obj/stationobjs.dmi' icon_state = "wrecharger0" @@ -170,5 +168,4 @@ obj/machinery/recharger/wallcharger icon_state_charging = "wrecharger1" icon_state_idle = "wrecharger0" portable = 0 - circuit = /obj/item/weapon/circuitboard/recharger/wrecharger - frame_type = "wrecharger" + circuit = /obj/item/weapon/circuitboard/recharger/wrecharger \ No newline at end of file diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index b5f7e029a5..96ab5eab20 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -24,7 +24,6 @@ /obj/machinery/recharge_station/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) @@ -32,7 +31,6 @@ component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/cell/high(src) component_parts += new /obj/item/stack/cable_coil(src, 5) - RefreshParts() update_icon() @@ -80,9 +78,9 @@ if(!has_cell_power()) return 0 - if(src.use_power == 1) + if(use_power == 1) cell.use(idle_power_usage * CELLRATE) - else if(src.use_power >= 2) + else if(use_power >= 2) cell.use(active_power_usage * CELLRATE) return 1 @@ -266,7 +264,7 @@ if(!occupant) return - occupant.forceMove(loc) + occupant.forceMove(src.loc) occupant.reset_view() occupant = null update_icon() diff --git a/code/game/machinery/records_scanner.dm b/code/game/machinery/records_scanner.dm index 54faef41f8..f9ed05c7e9 100644 --- a/code/game/machinery/records_scanner.dm +++ b/code/game/machinery/records_scanner.dm @@ -78,7 +78,7 @@ obj/machinery/scanner/attack_hand(mob/living/carbon/human/user) print.stamped = 1 for(var/datum/data/record/test in data_core.general) - if (test.fields["name"] == mname) + if(test.fields["name"] == mname) return var/datum/data/record/G = new() @@ -136,6 +136,4 @@ obj/machinery/scanner/attack_hand(mob/living/carbon/human/user) data_core.general += G data_core.medical += M data_core.security += S - data_core.locked += L - - + data_core.locked += L \ No newline at end of file diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index fc39af88f7..2854d0ac25 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -74,11 +74,11 @@ var/list/obj/machinery/requests_console/allConsoles = list() name = "[department] Requests Console" allConsoles += src - if (departmentType & RC_ASSIST) + if(departmentType & RC_ASSIST) req_console_assistance |= department - if (departmentType & RC_SUPPLY) + if(departmentType & RC_SUPPLY) req_console_supplies |= department - if (departmentType & RC_INFO) + if(departmentType & RC_INFO) req_console_information |= department set_light(1) @@ -87,15 +87,15 @@ var/list/obj/machinery/requests_console/allConsoles = list() allConsoles -= src var/lastDeptRC = 1 for (var/obj/machinery/requests_console/Console in allConsoles) - if (Console.department == department) + if(Console.department == department) lastDeptRC = 0 break if(lastDeptRC) - if (departmentType & RC_ASSIST) + if(departmentType & RC_ASSIST) req_console_assistance -= department - if (departmentType & RC_SUPPLY) + if(departmentType & RC_SUPPLY) req_console_supplies -= department - if (departmentType & RC_INFO) + if(departmentType & RC_INFO) req_console_information -= department ..() @@ -126,7 +126,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() data["announceAuth"] = announceAuth ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if (!ui) + if(!ui) ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410) ui.set_initial_data(data) ui.open() @@ -162,7 +162,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() announcement.Announce(message, msg_sanitized = 1) reset_message(1) - if( href_list["department"] && message ) + if(href_list["department"] && message) var/log_msg = message var/pass = 0 screen = RCS_SENTFAIL @@ -183,7 +183,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() return if(tempScreen == RCS_VIEWMSGS) for (var/obj/machinery/requests_console/Console in allConsoles) - if (Console.department == department) + if(Console.department == department) Console.newmessagepriority = 0 Console.icon_state = "req_comp0" Console.set_light(1) @@ -200,9 +200,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() //err... hacking code, which has no reason for existing... but anyway... it was once supposed to unlock priority 3 messanging on that console (EXTREME priority...), but the code for that was removed. /obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob) - if(default_deconstruction_screwdriver(user, O)) - return - if(default_deconstruction_crowbar(user, O)) + if(computer_deconstruction_screwdriver(user, O)) return if(istype(O, /obj/item/device/multitool)) if(panel_open) @@ -216,15 +214,15 @@ var/list/obj/machinery/requests_console/allConsoles = list() name = "[department] Requests Console" allConsoles += src - if (departmentType & RC_ASSIST) + if(departmentType & RC_ASSIST) req_console_assistance |= department - if (departmentType & RC_SUPPLY) + if(departmentType & RC_SUPPLY) req_console_supplies |= department - if (departmentType & RC_INFO) + if(departmentType & RC_INFO) req_console_information |= department return - if (istype(O, /obj/item/weapon/card/id)) + if(istype(O, /obj/item/weapon/card/id)) if(inoperable(MAINT)) return if(screen == RCS_MESSAUTH) var/obj/item/weapon/card/id/T = O @@ -232,14 +230,14 @@ var/list/obj/machinery/requests_console/allConsoles = list() updateUsrDialog() if(screen == RCS_ANNOUNCE) var/obj/item/weapon/card/id/ID = O - if (access_RC_announce in ID.GetAccess()) + if(access_RC_announce in ID.GetAccess()) announceAuth = 1 announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name else reset_message() user << "You are not authorized to send announcements." updateUsrDialog() - if (istype(O, /obj/item/weapon/stamp)) + if(istype(O, /obj/item/weapon/stamp)) if(inoperable(MAINT)) return if(screen == RCS_MESSAUTH) var/obj/item/weapon/stamp/T = O diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm index 4c44bcd4ee..59f364d948 100644 --- a/code/game/machinery/robot_fabricator.dm +++ b/code/game/machinery/robot_fabricator.dm @@ -12,40 +12,40 @@ active_power_usage = 10000 /obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob) - if (istype(O, /obj/item/stack/material) && O.get_material_name() == DEFAULT_WALL_MATERIAL) + if(istype(O, /obj/item/stack/material) && O.get_material_name() == DEFAULT_WALL_MATERIAL) var/obj/item/stack/M = O - if (src.metal_amount < 150000.0) + if(metal_amount < 150000.0) var/count = 0 - src.overlays += "fab-load-metal" + overlays += "fab-load-metal" spawn(15) if(M) if(!M.get_amount()) return while(metal_amount < 150000 && M.amount) - src.metal_amount += O.matter[DEFAULT_WALL_MATERIAL] /*O:height * O:width * O:length * 100000.0*/ + metal_amount += O.matter[DEFAULT_WALL_MATERIAL] /*O:height * O:width * O:length * 100000.0*/ M.use(1) count++ user << "You insert [count] metal sheet\s into the fabricator." - src.overlays -= "fab-load-metal" + overlays -= "fab-load-metal" updateDialog() else user << "The robot part maker is full. Please remove metal from the robot part maker in order to insert more." /obj/machinery/robotic_fabricator/attack_hand(user as mob) var/dat - if (..()) + if(..()) return - if (src.operating) + if(operating) dat = {" -Building [src.being_built.name].
            +Building [being_built.name].
            Please wait until completion...


            "} else dat = {" -Metal Amount: [min(150000, src.metal_amount)] cm3 (MAX: 150,000)

            +Metal Amount: [min(150000, metal_amount)] cm3 (MAX: 150,000)


            Left Arm (25,000 cc metal.)
            Right Arm (25,000 cc metal.)
            @@ -61,14 +61,14 @@ Please wait until completion...

            return /obj/machinery/robotic_fabricator/Topic(href, href_list) - if (..()) + if(..()) return usr.set_machine(src) - src.add_fingerprint(usr) + add_fingerprint(usr) - if (href_list["make"]) - if (!src.operating) + if(href_list["make"]) + if(!operating) var/part_type = text2num(href_list["make"]) var/build_type = "" @@ -76,63 +76,63 @@ Please wait until completion...

            var/build_cost = 25000 switch (part_type) - if (1) + if(1) build_type = "/obj/item/robot_parts/l_arm" build_time = 200 build_cost = 25000 - if (2) + if(2) build_type = "/obj/item/robot_parts/r_arm" build_time = 200 build_cost = 25000 - if (3) + if(3) build_type = "/obj/item/robot_parts/l_leg" build_time = 200 build_cost = 25000 - if (4) + if(4) build_type = "/obj/item/robot_parts/r_leg" build_time = 200 build_cost = 25000 - if (5) + if(5) build_type = "/obj/item/robot_parts/chest" build_time = 350 build_cost = 50000 - if (6) + if(6) build_type = "/obj/item/robot_parts/head" build_time = 350 build_cost = 50000 - if (7) + if(7) build_type = "/obj/item/robot_parts/robot_suit" build_time = 600 build_cost = 75000 var/building = text2path(build_type) - if (!isnull(building)) - if (src.metal_amount >= build_cost) - src.operating = 1 - src.update_use_power(2) + if(!isnull(building)) + if(metal_amount >= build_cost) + operating = 1 + update_use_power(2) - src.metal_amount = max(0, src.metal_amount - build_cost) + metal_amount = max(0, metal_amount - build_cost) - src.being_built = new building(src) + being_built = new building(src) - src.overlays += "fab-active" - src.updateUsrDialog() + overlays += "fab-active" + updateUsrDialog() spawn (build_time) - if (!isnull(src.being_built)) - src.being_built.loc = get_turf(src) - src.being_built = null - src.update_use_power(1) - src.operating = 0 - src.overlays -= "fab-active" + if(!isnull(being_built)) + being_built.loc = get_turf(src) + being_built = null + update_use_power(1) + operating = 0 + overlays -= "fab-active" return for (var/mob/M in viewers(1, src)) - if (M.client && M.machine == src) - src.attack_hand(M) + if(M.client && M.machine == src) + attack_hand(M) \ No newline at end of file diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm index e9a2081fb2..c7d6b7c514 100644 --- a/code/game/machinery/seed_extractor.dm +++ b/code/game/machinery/seed_extractor.dm @@ -36,7 +36,7 @@ obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob //Grass. else if(istype(O, /obj/item/stack/tile/grass)) var/obj/item/stack/tile/grass/S = O - if (S.use(1)) + if(S.use(1)) user << "You extract some seeds from the grass tile." new /obj/item/seeds/grassseed(loc) diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 36c8c62814..d60d49b47e 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -11,11 +11,10 @@ var/set_temperature = T0C + 20 //K var/heating_power = 40000 - /obj/machinery/space_heater/New() ..() - if (cell_type) - src.cell = new cell_type(src) + if(cell_type) + cell = new cell_type(src) update_icon() /obj/machinery/space_heater/update_icon() @@ -79,7 +78,7 @@ return /obj/machinery/space_heater/attack_hand(mob/user as mob) - src.add_fingerprint(user) + add_fingerprint(user) interact(user) /obj/machinery/space_heater/interact(mob/user as mob) @@ -113,9 +112,9 @@ /obj/machinery/space_heater/Topic(href, href_list) - if (usr.stat) + if(usr.stat) return - if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))) + if((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))) usr.set_machine(src) switch(href_list["op"]) @@ -153,8 +152,6 @@ usr.unset_machine() return - - /obj/machinery/space_heater/process() if(on) if(cell && cell.charge) @@ -166,7 +163,7 @@ if(removed) var/heat_transfer = removed.get_thermal_energy_change(set_temperature) if(heat_transfer > 0) //heating air - heat_transfer = min( heat_transfer , heating_power ) //limit by the power rating of the heater + heat_transfer = min(heat_transfer , heating_power) //limit by the power rating of the heater removed.add_thermal_energy(heat_transfer) cell.use(heat_transfer*CELLRATE) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 8b0d78cb96..a05f69d84f 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -53,28 +53,12 @@ return ..() /obj/machinery/status_display/attackby(I as obj, user as mob) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "display" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) - user << "You disconnect the monitor." - A.state = 4 - A.icon_state = "display_4" - M.deconstruct(src) - qdel(src) + if(computer_deconstruction_screwdriver(user, I)) + return else - src.attack_hand(user) + attack_hand(user) return - // register for radio system /obj/machinery/status_display/initialize() ..() @@ -108,7 +92,7 @@ if(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME) //emergency shuttle timer if(emergency_shuttle.waiting_to_leave()) message1 = "-ETD-" - if (emergency_shuttle.shuttle.is_launching()) + if(emergency_shuttle.shuttle.is_launching()) message2 = "Launch" else message2 = get_shuttle_timer_departure() @@ -201,7 +185,7 @@ /obj/machinery/status_display/proc/get_supply_shuttle_timer() var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle - if (!shuttle) + if(!shuttle) return "Error" if(shuttle.has_arrive_time()) diff --git a/code/game/machinery/status_display_ai.dm b/code/game/machinery/status_display_ai.dm index 51fcfb4f51..6984017c3d 100644 --- a/code/game/machinery/status_display_ai.dm +++ b/code/game/machinery/status_display_ai.dm @@ -70,31 +70,16 @@ var/list/ai_status_emotions = list( var/emotion = "Neutral" /obj/machinery/ai_status_display/attackby(I as obj, user as mob) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "display" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) - user << "You disconnect the monitor." - A.state = 4 - A.icon_state = "display_4" - M.deconstruct(src) - qdel(src) + if(computer_deconstruction_screwdriver(user, I)) + return else - src.attack_hand(user) + attack_hand(user) return /obj/machinery/ai_status_display/attack_ai/(mob/user as mob) var/list/ai_emotions = get_ai_emotions(user.ckey) var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions - src.emotion = emote + emotion = emote /obj/machinery/ai_status_display/process() return diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 227ba52e0c..a0595bcdc2 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -2,7 +2,6 @@ // SUIT STORAGE UNIT ///////////////// ////////////////////////////////////// - /obj/machinery/suit_storage_unit name = "Suit Storage Unit" desc = "An industrial U-Stor-It Storage unit designed to accomodate all kinds of space suits. Its on-board equipment also allows the user to decontaminate the contents through a UV-ray purging cycle. There's a warning label dangling from the control pad, reading \"STRICTLY NO BIOLOGICALS IN THE CONFINES OF THE UNIT\"." @@ -34,9 +33,8 @@ HELMET_TYPE = /obj/item/clothing/head/helmet/space MASK_TYPE = /obj/item/clothing/mask/breath - /obj/machinery/suit_storage_unit/New() - src.update_icon() + update_icon() if(SUIT_TYPE) SUIT = new SUIT_TYPE(src) if(HELMET_TYPE) @@ -54,40 +52,37 @@ hassuit = 1 if(OCCUPANT) hashuman = 1 - icon_state = text("suitstorage[][][][][][][][][]",hashelmet,hassuit,hashuman,src.isopen,src.islocked,src.isUV,src.ispowered,src.isbroken,src.issuperUV) - + icon_state = text("suitstorage[][][][][][][][][]", hashelmet, hassuit, hashuman, isopen, islocked, isUV, ispowered, isbroken, issuperUV) /obj/machinery/suit_storage_unit/power_change() ..() - if( !(stat & NOPOWER) ) - src.ispowered = 1 - src.update_icon() + if(!(stat & NOPOWER)) + ispowered = 1 + update_icon() else spawn(rand(0, 15)) - src.ispowered = 0 - src.islocked = 0 - src.isopen = 1 - src.dump_everything() - src.update_icon() - + ispowered = 0 + islocked = 0 + isopen = 1 + dump_everything() + update_icon() /obj/machinery/suit_storage_unit/ex_act(severity) switch(severity) if(1.0) if(prob(50)) - src.dump_everything() //So suits dont survive all the time + dump_everything() //So suits dont survive all the time qdel(src) return if(2.0) if(prob(50)) - src.dump_everything() + dump_everything() qdel(src) return else return return - /obj/machinery/suit_storage_unit/attack_hand(mob/user as mob) var/dat if(..()) @@ -96,45 +91,45 @@ return if(!user.IsAdvancedToolUser()) return 0 - if(src.panelopen) //The maintenance panel is open. Time for some shady stuff + if(panelopen) //The maintenance panel is open. Time for some shady stuff dat+= "Suit storage unit: Maintenance panel" dat+= "Maintenance panel controls
            " dat+= "The panel is ridden with controls, button and meters, labeled in strange signs and symbols that
            you cannot understand. Probably the manufactoring world's language.
            Among other things, a few controls catch your eye.


            " - dat+= text("A small dial with a small lambda symbol on it. It's pointing towards a gauge that reads [].
            Turn towards []
            ",(src.issuperUV ? "15nm" : "185nm"),src,(src.issuperUV ? "185nm" : "15nm") ) - dat+= text("A thick old-style button, with 2 grimy LED lights next to it. The [] LED is on.
            Press button",(src.safetieson? "GREEN" : "RED"),src) + dat+= text("A small dial with a small lambda symbol on it. It's pointing towards a gauge that reads [].
            Turn towards []
            ",(issuperUV ? "15nm" : "185nm"),src,(issuperUV ? "185nm" : "15nm")) + dat+= text("A thick old-style button, with 2 grimy LED lights next to it. The [] LED is on.
            Press button",(safetieson? "GREEN" : "RED"),src) dat+= text("

            Close panel", user) //user << browse(dat, "window=ssu_m_panel;size=400x500") //onclose(user, "ssu_m_panel") - else if(src.isUV) //The thing is running its cauterisation cycle. You have to wait. + else if(isUV) //The thing is running its cauterisation cycle. You have to wait. dat += "Suit storage unit" dat+= "Unit is cauterising contents with selected UV ray intensity. Please wait.
            " - //dat+= "Cycle end in: [src.cycletimeleft()] seconds. " + //dat+= "Cycle end in: [cycletimeleft()] seconds. " //user << browse(dat, "window=ssu_cycling_panel;size=400x500") //onclose(user, "ssu_cycling_panel") else - if(!src.isbroken) + if(!isbroken) dat+= "Suit storage unit" dat+= "U-Stor-It Suit Storage Unit, model DS1900
            " dat+= "Welcome to the Unit control panel.

            " - dat+= text("Helmet storage compartment: []
            ",(src.HELMET ? HELMET.name : "No helmet detected.") ) - if(HELMET && src.isopen) + dat+= text("Helmet storage compartment: []
            ",(HELMET ? HELMET.name : "
            No helmet detected.")) + if(HELMET && isopen) dat+=text("Dispense helmet
            ",src) - dat+= text("Suit storage compartment: []
            ",(src.SUIT ? SUIT.name : "
            No exosuit detected.") ) - if(SUIT && src.isopen) + dat+= text("Suit storage compartment: []
            ",(SUIT ? SUIT.name : "
            No exosuit detected.")) + if(SUIT && isopen) dat+=text("Dispense suit
            ",src) - dat+= text("Breathmask storage compartment: []
            ",(src.MASK ? MASK.name : "
            No breathmask detected.") ) - if(MASK && src.isopen) + dat+= text("Breathmask storage compartment: []
            ",(MASK ? MASK.name : "
            No breathmask detected.")) + if(MASK && isopen) dat+=text("Dispense mask
            ",src) - if(src.OCCUPANT) + if(OCCUPANT) dat+= "
            WARNING: Biological entity detected inside the Unit's storage. Please remove.
            " dat+= "Eject extra load" - dat+= text("
            Unit is: [] - [] Unit ",(src.isopen ? "Open" : "Closed"),src,(src.isopen ? "Close" : "Open")) - if(src.isopen) + dat+= text("
            Unit is: [] - [] Unit ",(isopen ? "Open" : "Closed"),src,(isopen ? "Close" : "Open")) + if(isopen) dat+="
            " else - dat+= text(" - *[] Unit*
            ",src,(src.islocked ? "Unlock" : "Lock") ) - dat+= text("Unit status: []",(src.islocked? "**LOCKED**
            " : "**UNLOCKED**
            ") ) + dat+= text(" - *[] Unit*
            ",src,(islocked ? "Unlock" : "Lock")) + dat+= text("Unit status: []",(islocked? "**LOCKED**
            " : "**UNLOCKED**
            ")) dat+= text("Start Disinfection cycle
            ",src) dat += text("

            Close control panel", user) //user << browse(dat, "window=Suit Storage Unit;size=400x500") @@ -154,54 +149,54 @@ /obj/machinery/suit_storage_unit/Topic(href, href_list) //I fucking HATE this proc if(..()) return - if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) + if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) usr.set_machine(src) - if (href_list["toggleUV"]) - src.toggleUV(usr) - src.updateUsrDialog() - src.update_icon() - if (href_list["togglesafeties"]) - src.togglesafeties(usr) - src.updateUsrDialog() - src.update_icon() - if (href_list["dispense_helmet"]) - src.dispense_helmet(usr) - src.updateUsrDialog() - src.update_icon() - if (href_list["dispense_suit"]) - src.dispense_suit(usr) - src.updateUsrDialog() - src.update_icon() - if (href_list["dispense_mask"]) - src.dispense_mask(usr) - src.updateUsrDialog() - src.update_icon() - if (href_list["toggle_open"]) - src.toggle_open(usr) - src.updateUsrDialog() - src.update_icon() - if (href_list["toggle_lock"]) - src.toggle_lock(usr) - src.updateUsrDialog() - src.update_icon() - if (href_list["start_UV"]) - src.start_UV(usr) - src.updateUsrDialog() - src.update_icon() - if (href_list["eject_guy"]) - src.eject_occupant(usr) - src.updateUsrDialog() - src.update_icon() - /*if (href_list["refresh"]) - src.updateUsrDialog()*/ - src.add_fingerprint(usr) + if(href_list["toggleUV"]) + toggleUV(usr) + updateUsrDialog() + update_icon() + if(href_list["togglesafeties"]) + togglesafeties(usr) + updateUsrDialog() + update_icon() + if(href_list["dispense_helmet"]) + dispense_helmet(usr) + updateUsrDialog() + update_icon() + if(href_list["dispense_suit"]) + dispense_suit(usr) + updateUsrDialog() + update_icon() + if(href_list["dispense_mask"]) + dispense_mask(usr) + updateUsrDialog() + update_icon() + if(href_list["toggle_open"]) + toggle_open(usr) + updateUsrDialog() + update_icon() + if(href_list["toggle_lock"]) + toggle_lock(usr) + updateUsrDialog() + update_icon() + if(href_list["start_UV"]) + start_UV(usr) + updateUsrDialog() + update_icon() + if(href_list["eject_guy"]) + eject_occupant(usr) + updateUsrDialog() + update_icon() + /*if(href_list["refresh"]) + updateUsrDialog()*/ + add_fingerprint(usr) return /obj/machinery/suit_storage_unit/proc/toggleUV(mob/user as mob) // var/protected = 0 // var/mob/living/carbon/human/H = user - if(!src.panelopen) + if(!panelopen) return /*if(istype(H)) //Let's check if the guy's wearing electrically insulated gloves @@ -215,25 +210,25 @@ user << "You try to touch the controls but you get zapped. There must be a short circuit somewhere." return*/ else //welp, the guy is protected, we can continue - if(src.issuperUV) + if(issuperUV) user << "You slide the dial back towards \"185nm\"." - src.issuperUV = 0 + issuperUV = 0 else user << "You crank the dial all the way up to \"15nm\"." - src.issuperUV = 1 + issuperUV = 1 return /obj/machinery/suit_storage_unit/proc/togglesafeties(mob/user as mob) // var/protected = 0 // var/mob/living/carbon/human/H = user - if(!src.panelopen) //Needed check due to bugs + if(!panelopen) //Needed check due to bugs return /*if(istype(H)) //Let's check if the guy's wearing electrically insulated gloves if(H.gloves) var/obj/item/clothing/gloves/G = H.gloves - if(istype(G,/obj/item/clothing/gloves/yellow) ) + if(istype(G,/obj/item/clothing/gloves/yellow)) protected = 1 if(!protected) @@ -242,146 +237,146 @@ return*/ else user << "You push the button. The coloured LED next to it changes." - src.safetieson = !src.safetieson + safetieson = !safetieson /obj/machinery/suit_storage_unit/proc/dispense_helmet(mob/user as mob) - if(!src.HELMET) + if(!HELMET) return //Do I even need this sanity check? Nyoro~n else - src.HELMET.loc = src.loc - src.HELMET = null + HELMET.loc = src.loc + HELMET = null return /obj/machinery/suit_storage_unit/proc/dispense_suit(mob/user as mob) - if(!src.SUIT) + if(!SUIT) return else - src.SUIT.loc = src.loc - src.SUIT = null + SUIT.loc = src.loc + SUIT = null return /obj/machinery/suit_storage_unit/proc/dispense_mask(mob/user as mob) - if(!src.MASK) + if(!MASK) return else - src.MASK.loc = src.loc - src.MASK = null + MASK.loc = src.loc + MASK = null return /obj/machinery/suit_storage_unit/proc/dump_everything() - src.islocked = 0 //locks go free - if(src.SUIT) - src.SUIT.loc = src.loc - src.SUIT = null - if(src.HELMET) - src.HELMET.loc = src.loc - src.HELMET = null - if(src.MASK) - src.MASK.loc = src.loc - src.MASK = null - if(src.OCCUPANT) - src.eject_occupant(OCCUPANT) + islocked = 0 //locks go free + if(SUIT) + SUIT.loc = src.loc + SUIT = null + if(HELMET) + HELMET.loc = src.loc + HELMET = null + if(MASK) + MASK.loc = src.loc + MASK = null + if(OCCUPANT) + eject_occupant(OCCUPANT) return /obj/machinery/suit_storage_unit/proc/toggle_open(mob/user as mob) - if(src.islocked || src.isUV) + if(islocked || isUV) user << "Unable to open unit." return - if(src.OCCUPANT) - src.eject_occupant(user) + if(OCCUPANT) + eject_occupant(user) return // eject_occupant opens the door, so we need to return - src.isopen = !src.isopen + isopen = !isopen return /obj/machinery/suit_storage_unit/proc/toggle_lock(mob/user as mob) - if(src.OCCUPANT && src.safetieson) + if(OCCUPANT && safetieson) user << "The Unit's safety protocols disallow locking when a biological form is detected inside its compartments." return - if(src.isopen) + if(isopen) return - src.islocked = !src.islocked + islocked = !islocked return /obj/machinery/suit_storage_unit/proc/start_UV(mob/user as mob) - if(src.isUV || src.isopen) //I'm bored of all these sanity checks + if(isUV || isopen) //I'm bored of all these sanity checks return - if(src.OCCUPANT && src.safetieson) + if(OCCUPANT && safetieson) user << "WARNING: Biological entity detected in the confines of the Unit's storage. Cannot initiate cycle." return - if(!src.HELMET && !src.MASK && !src.SUIT && !src.OCCUPANT ) //shit's empty yo + if(!HELMET && !MASK && !SUIT && !OCCUPANT) //shit's empty yo user << "Unit storage bays empty. Nothing to disinfect -- Aborting." return user << "You start the Unit's cauterisation cycle." - src.cycletime_left = 20 - src.isUV = 1 - if(src.OCCUPANT && !src.islocked) - src.islocked = 1 //Let's lock it for good measure - src.update_icon() - src.updateUsrDialog() + cycletime_left = 20 + isUV = 1 + if(OCCUPANT && !islocked) + islocked = 1 //Let's lock it for good measure + update_icon() + updateUsrDialog() var/i //our counter for(i=0,i<4,i++) sleep(50) - if(src.OCCUPANT) + if(OCCUPANT) OCCUPANT.apply_effect(50, IRRADIATE) var/obj/item/organ/internal/diona/nutrients/rad_organ = locate() in OCCUPANT.internal_organs - if (!rad_organ) - if (OCCUPANT.can_feel_pain()) + if(!rad_organ) + if(OCCUPANT.can_feel_pain()) OCCUPANT.emote("scream") - if(src.issuperUV) + if(issuperUV) var/burndamage = rand(28,35) OCCUPANT.take_organ_damage(0,burndamage) else var/burndamage = rand(6,10) OCCUPANT.take_organ_damage(0,burndamage) if(i==3) //End of the cycle - if(!src.issuperUV) - if(src.HELMET) + if(!issuperUV) + if(HELMET) HELMET.clean_blood() - if(src.SUIT) + if(SUIT) SUIT.clean_blood() - if(src.MASK) + if(MASK) MASK.clean_blood() else //It was supercycling, destroy everything - if(src.HELMET) - src.HELMET = null - if(src.SUIT) - src.SUIT = null - if(src.MASK) - src.MASK = null + if(HELMET) + HELMET = null + if(SUIT) + SUIT = null + if(MASK) + MASK = null visible_message("With a loud whining noise, the Suit Storage Unit's door grinds open. Puffs of ashen smoke come out of its chamber.", 3) - src.isbroken = 1 - src.isopen = 1 - src.islocked = 0 - src.eject_occupant(OCCUPANT) //Mixing up these two lines causes bug. DO NOT DO IT. - src.isUV = 0 //Cycle ends - src.update_icon() - src.updateUsrDialog() + isbroken = 1 + isopen = 1 + islocked = 0 + eject_occupant(OCCUPANT) //Mixing up these two lines causes bug. DO NOT DO IT. + isUV = 0 //Cycle ends + update_icon() + updateUsrDialog() return /* spawn(200) //Let's clean dat shit after 20 secs //Eh, this doesn't work - if(src.HELMET) + if(HELMET) HELMET.clean_blood() - if(src.SUIT) + if(SUIT) SUIT.clean_blood() - if(src.MASK) + if(MASK) MASK.clean_blood() - src.isUV = 0 //Cycle ends - src.update_icon() - src.updateUsrDialog() + isUV = 0 //Cycle ends + update_icon() + updateUsrDialog() var/i for(i=0,i<4,i++) //Gradually give the guy inside some damaged based on the intensity spawn(50) - if(src.OCCUPANT) - if(src.issuperUV) + if(OCCUPANT) + if(issuperUV) OCCUPANT.take_organ_damage(0,40) user << "Test. You gave him 40 damage" else @@ -391,33 +386,33 @@ /obj/machinery/suit_storage_unit/proc/cycletimeleft() - if(src.cycletime_left >= 1) - src.cycletime_left-- - return src.cycletime_left + if(cycletime_left >= 1) + cycletime_left-- + return cycletime_left /obj/machinery/suit_storage_unit/proc/eject_occupant(mob/user as mob) - if (src.islocked) + if(islocked) return - if (!src.OCCUPANT) + if(!OCCUPANT) return // for(var/obj/O in src) // O.loc = src.loc - if (src.OCCUPANT.client) + if(OCCUPANT.client) if(user != OCCUPANT) OCCUPANT << "The machine kicks you out!" if(user.loc != src.loc) OCCUPANT << "You leave the not-so-cozy confines of the SSU." - src.OCCUPANT.client.eye = src.OCCUPANT.client.mob - src.OCCUPANT.client.perspective = MOB_PERSPECTIVE - src.OCCUPANT.loc = src.loc - src.OCCUPANT = null - if(!src.isopen) - src.isopen = 1 - src.update_icon() + OCCUPANT.client.eye = OCCUPANT.client.mob + OCCUPANT.client.perspective = MOB_PERSPECTIVE + OCCUPANT.loc = src.loc + OCCUPANT = null + if(!isopen) + isopen = 1 + update_icon() return @@ -426,12 +421,12 @@ set category = "Object" set src in oview(1) - if (usr.stat != 0) + if(usr.stat != 0) return - src.eject_occupant(usr) + eject_occupant(usr) add_fingerprint(usr) - src.updateUsrDialog() - src.update_icon() + updateUsrDialog() + update_icon() return @@ -440,15 +435,15 @@ set category = "Object" set src in oview(1) - if (usr.stat != 0) + if(usr.stat != 0) return - if (!src.isopen) + if(!isopen) usr << "The unit's doors are shut." return - if (!src.ispowered || src.isbroken) + if(!ispowered || isbroken) usr << "The unit is not operational." return - if ( (src.OCCUPANT) || (src.HELMET) || (src.SUIT) ) + if((OCCUPANT) || (HELMET) || (SUIT)) usr << "It's too cluttered inside for you to fit in!" return visible_message("[usr] starts squeezing into the suit storage unit!", 3) @@ -458,111 +453,111 @@ usr.client.eye = src usr.loc = src // usr.metabslow = 1 - src.OCCUPANT = usr - src.isopen = 0 //Close the thing after the guy gets inside - src.update_icon() + OCCUPANT = usr + isopen = 0 //Close the thing after the guy gets inside + update_icon() // for(var/obj/O in src) // qdel(O) - src.add_fingerprint(usr) - src.updateUsrDialog() + add_fingerprint(usr) + updateUsrDialog() return else - src.OCCUPANT = null //Testing this as a backup sanity test + OCCUPANT = null //Testing this as a backup sanity test return /obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob) - if(!src.ispowered) + if(!ispowered) return if(istype(I, /obj/item/weapon/screwdriver)) - src.panelopen = !src.panelopen + panelopen = !panelopen playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) - user << text("You [] the unit's maintenance panel.",(src.panelopen ? "open up" : "close") ) - src.updateUsrDialog() + user << text("You [] the unit's maintenance panel.",(panelopen ? "open up" : "close")) + updateUsrDialog() return - if ( istype(I, /obj/item/weapon/grab) ) + if(istype(I, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = I - if( !(ismob(G.affecting)) ) + if(!(ismob(G.affecting))) return - if (!src.isopen) + if(!isopen) usr << "The unit's doors are shut." return - if (!src.ispowered || src.isbroken) + if(!ispowered || isbroken) usr << "The unit is not operational." return - if ( (src.OCCUPANT) || (src.HELMET) || (src.SUIT) ) //Unit needs to be absolutely empty + if((OCCUPANT) || (HELMET) || (SUIT)) //Unit needs to be absolutely empty user << "The unit's storage area is too cluttered." return visible_message("[user] starts putting [G.affecting.name] into the Suit Storage Unit.", 3) if(do_after(user, 20)) if(!G || !G.affecting) return //derpcheck var/mob/M = G.affecting - if (M.client) + if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src M.loc = src - src.OCCUPANT = M - src.isopen = 0 //close ittt + OCCUPANT = M + isopen = 0 //close ittt //for(var/obj/O in src) // O.loc = src.loc - src.add_fingerprint(user) + add_fingerprint(user) qdel(G) - src.updateUsrDialog() - src.update_icon() + updateUsrDialog() + update_icon() return return - if( istype(I,/obj/item/clothing/suit/space) ) - if(!src.isopen) + if(istype(I,/obj/item/clothing/suit/space)) + if(!isopen) return var/obj/item/clothing/suit/space/S = I - if(src.SUIT) + if(SUIT) user << "The unit already contains a suit." return user << "You load the [S.name] into the storage compartment." user.drop_item() S.loc = src - src.SUIT = S - src.update_icon() - src.updateUsrDialog() + SUIT = S + update_icon() + updateUsrDialog() return - if( istype(I,/obj/item/clothing/head/helmet) ) - if(!src.isopen) + if(istype(I,/obj/item/clothing/head/helmet)) + if(!isopen) return var/obj/item/clothing/head/helmet/H = I - if(src.HELMET) + if(HELMET) user << "The unit already contains a helmet." return user << "You load the [H.name] into the storage compartment." user.drop_item() H.loc = src - src.HELMET = H - src.update_icon() - src.updateUsrDialog() + HELMET = H + update_icon() + updateUsrDialog() return - if( istype(I,/obj/item/clothing/mask) ) - if(!src.isopen) + if(istype(I,/obj/item/clothing/mask)) + if(!isopen) return var/obj/item/clothing/mask/M = I - if(src.MASK) + if(MASK) user << "The unit already contains a mask." return user << "You load the [M.name] into the storage compartment." user.drop_item() M.loc = src - src.MASK = M - src.update_icon() - src.updateUsrDialog() + MASK = M + update_icon() + updateUsrDialog() return - src.update_icon() - src.updateUsrDialog() + update_icon() + updateUsrDialog() return /obj/machinery/suit_storage_unit/attack_ai(mob/user as mob) - return src.attack_hand(user) + return attack_hand(user) //////////////////////////////REMINDER: Make it lock once you place some fucker inside. @@ -649,12 +644,12 @@ can_repair = 1 /obj/machinery/suit_cycler/attack_ai(mob/user as mob) - return src.attack_hand(user) + return attack_hand(user) /obj/machinery/suit_cycler/attackby(obj/item/I as obj, mob/user as mob) if(electrified != 0) - if(src.shock(user, 100)) + if(shock(user, 100)) return //Hacking init. @@ -673,7 +668,7 @@ user << "The suit cycler is locked." return - if(src.contents.len > 0) + if(contents.len > 0) user << "There is no room inside the cycler for [G.affecting.name]." return @@ -682,23 +677,23 @@ if(do_after(user, 20)) if(!G || !G.affecting) return var/mob/M = G.affecting - if (M.client) + if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src M.loc = src - src.occupant = M + occupant = M - src.add_fingerprint(user) + add_fingerprint(user) qdel(G) - src.updateUsrDialog() + updateUsrDialog() return else if(istype(I,/obj/item/weapon/screwdriver)) panel_open = !panel_open user << "You [panel_open ? "open" : "close"] the maintenance panel." - src.updateUsrDialog() + updateUsrDialog() return else if(istype(I,/obj/item/clothing/head/helmet/space) && !istype(I, /obj/item/clothing/head/helmet/space/rig)) @@ -720,8 +715,8 @@ I.loc = src helmet = I - src.update_icon() - src.updateUsrDialog() + update_icon() + updateUsrDialog() return else if(istype(I,/obj/item/clothing/suit/space/void)) @@ -743,8 +738,8 @@ I.loc = src suit = I - src.update_icon() - src.updateUsrDialog() + update_icon() + updateUsrDialog() return ..() @@ -762,7 +757,7 @@ emagged = 1 safeties = 0 req_access = list() - src.updateUsrDialog() + updateUsrDialog() return 1 /obj/machinery/suit_cycler/attack_hand(mob/user as mob) @@ -776,19 +771,19 @@ return 0 if(electrified != 0) - if(src.shock(user, 100)) + if(shock(user, 100)) return usr.set_machine(src) var/dat = "Suit Cycler Interface" - if(src.active) + if(active) dat+= "
            The [model_text ? "[model_text] " : ""]suit cycler is currently in use. Please wait..." else if(locked) dat += "
            The [model_text ? "[model_text] " : ""]suit cycler is currently locked. Please contact your system administrator." - if(src.allowed(usr)) + if(allowed(usr)) dat += "
            \[unlock unit\]" else dat += "

            Suit cycler

            " @@ -857,7 +852,7 @@ else if(href_list["toggle_lock"]) - if(src.allowed(usr)) + if(allowed(usr)) locked = !locked usr << "You [locked ? "" : "un"]lock \the [src]." else @@ -871,7 +866,7 @@ active = 1 irradiating = 10 - src.updateUsrDialog() + updateUsrDialog() sleep(10) @@ -887,7 +882,7 @@ if(radiation_level > 1) suit.clean_blood() - src.updateUsrDialog() + updateUsrDialog() return /obj/machinery/suit_cycler/process() @@ -924,7 +919,7 @@ T.visible_message("\icon[src]The [src] pings loudly.") icon_state = initial(icon_state) active = 0 - src.updateUsrDialog() + updateUsrDialog() /obj/machinery/suit_cycler/proc/repair_suit() if(!suit || !suit.damage || !suit.can_breach) @@ -940,7 +935,7 @@ set category = "Object" set src in oview(1) - if (usr.stat != 0) + if(usr.stat != 0) return eject_occupant(usr) @@ -951,10 +946,10 @@ user << "The cycler is locked." return - if (!occupant) + if(!occupant) return - if (occupant.client) + if(occupant.client) occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE @@ -962,8 +957,8 @@ occupant = null add_fingerprint(usr) - src.updateUsrDialog() - src.update_icon() + updateUsrDialog() + update_icon() return diff --git a/code/game/machinery/supply_display.dm b/code/game/machinery/supply_display.dm index 97e747c0db..d1be70e754 100644 --- a/code/game/machinery/supply_display.dm +++ b/code/game/machinery/supply_display.dm @@ -7,14 +7,14 @@ message2 = "" var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle - if (!shuttle) + if(!shuttle) message2 = "Error" else if(shuttle.has_arrive_time()) message2 = get_supply_shuttle_timer() if(lentext(message2) > CHARS_PER_LINE) message2 = "Error" - else if (shuttle.is_launching()) - if (shuttle.at_station()) + else if(shuttle.is_launching()) + if(shuttle.at_station()) message2 = "Launch" else message2 = "ETA" diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm index 77e5887099..fae062ffed 100644 --- a/code/game/machinery/supplybeacon.dm +++ b/code/game/machinery/supplybeacon.dm @@ -111,9 +111,9 @@ target_drop_time = world.time + drop_delay else if(world.time >= target_drop_time) deactivate(permanent = 1) - var/drop_x = src.x-2 - var/drop_y = src.y-2 + var/drop_x = src.x - 2 + var/drop_y = src.y - 2 var/drop_z = src.z command_announcement.Announce(starsys_name+" Rapid Fabrication priority supply request #[rand(1000,9999)]-[rand(100,999)] recieved. Shipment dispatched via ballistic supply pod for immediate delivery. Have a nice day.", "Thank You For Your Patronage") - spawn(rand(100,300)) + spawn(rand(100, 300)) new /datum/random_map/droppod/supply(null, drop_x, drop_y, drop_z, supplied_drop = drop_type) // Splat. diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 99d713cccb..2f53931312 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -5,16 +5,13 @@ // If he accepts there is a random chance he will be accepted, rejected, or rejected and killed // Bringing certain items can help improve the chance to become a traitor - /obj/machinery/syndicate_beacon name = "ominous beacon" desc = "This looks suspicious..." icon = 'icons/obj/device.dmi' icon_state = "syndbeacon" - anchored = 1 density = 1 - var/temptext = "" var/selfdestructing = 0 var/charges = 1 @@ -43,18 +40,18 @@ return if(href_list["betraitor"]) if(charges < 1) - src.updateUsrDialog() + updateUsrDialog() return var/mob/M = locate(href_list["traitormob"]) if(M.mind.special_role || jobban_isbanned(M, "Syndicate")) temptext = "We have no need for you at this time. Have a pleasant day.
            " - src.updateUsrDialog() + updateUsrDialog() return charges -= 1 switch(rand(1,2)) if(1) temptext = "Double-crosser. You planned to betray us from the start. Allow us to repay the favor in kind." - src.updateUsrDialog() + updateUsrDialog() spawn(rand(50,200)) selfdestruct() return if(istype(M, /mob/living/carbon/human)) @@ -64,11 +61,9 @@ traitors.equip(N) message_admins("[N]/([N.ckey]) has accepted a traitor objective from a syndicate beacon.") - - src.updateUsrDialog() + updateUsrDialog() return - /obj/machinery/syndicate_beacon/proc/selfdestruct() selfdestructing = 1 spawn() explosion(src.loc, 1, rand(1,3), rand(3,8), 10) @@ -90,7 +85,6 @@ var/active = 0 var/icontype = "beacon" - /obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null) if(surplus() < 1500) if(user) user << "The connected wire doesn't have enough current." @@ -104,7 +98,6 @@ if(user) user << "You activate the beacon." - /obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null) for(var/obj/singularity/singulo in world) if(singulo.target == src) @@ -114,11 +107,9 @@ if(user) user << "You deactivate the beacon." - /obj/machinery/power/singularity_beacon/attack_ai(mob/user as mob) return - /obj/machinery/power/singularity_beacon/attack_hand(var/mob/user as mob) if(anchored) return active ? Deactivate(user) : Activate(user) @@ -126,7 +117,6 @@ user << "You need to screw the beacon to the floor first!" return - /obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/weapon/screwdriver)) if(active) @@ -148,7 +138,6 @@ ..() return - /obj/machinery/power/singularity_beacon/Destroy() if(active) Deactivate() @@ -162,7 +151,6 @@ if(draw_power(1500) < 1500) Deactivate() - /obj/machinery/power/singularity_beacon/syndicate icontype = "beaconsynd" icon_state = "beaconsynd0" diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index c9a42680f7..77ac7f697e 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -8,10 +8,10 @@ var/obj/item/locked = null var/id = null var/one_time_use = 0 //Used for one-time-use teleport cards (such as clown planet coordinates.) - //Setting this to 1 will set src.locked to null after a player enters the portal and will not allow hand-teles to open portals to that location. + //Setting this to 1 will set locked to null after a player enters the portal and will not allow hand-teles to open portals to that location. /obj/machinery/computer/teleporter/New() - src.id = "[rand(1000, 9999)]" + id = "[rand(1000, 9999)]" ..() underlays.Cut() underlays += image('icons/obj/stationobjs.dmi', icon_state = "telecomp-wires") @@ -36,7 +36,7 @@ if(istype(I, /obj/item/weapon/card/data/)) var/obj/item/weapon/card/data/C = I if(stat & (NOPOWER|BROKEN) & (C.function != "teleporter")) - src.attack_hand() + attack_hand() var/obj/L = null @@ -49,7 +49,6 @@ if(!L) L = locate("landmark*[C.data]") // use old stype - if(istype(L, /obj/effect/landmark/) && istype(L.loc, /turf)) usr << "You insert the coordinates into the machine." usr << "A message flashes across the screen reminding the traveller that the nuclear authentication disk is to remain on the station at all times." @@ -69,17 +68,17 @@ else for(var/mob/O in hearers(src, null)) O.show_message("Locked In", 2) - src.locked = L + locked = L one_time_use = 1 - src.add_fingerprint(usr) + add_fingerprint(usr) else ..() return /obj/machinery/teleport/station/attack_ai() - src.attack_hand() + attack_hand() /obj/machinery/computer/teleporter/attack_hand(user as mob) if(..()) return @@ -92,7 +91,7 @@ for(var/obj/item/device/radio/beacon/R in world) var/turf/T = get_turf(R) - if (!T) + if(!T) continue if(!(T.z in config.player_levels)) continue @@ -104,12 +103,12 @@ L[tmpname] = R for (var/obj/item/weapon/implant/tracking/I in world) - if (!I.implanted || !ismob(I.loc)) + if(!I.implanted || !ismob(I.loc)) continue else var/mob/M = I.loc - if (M.stat == 2) - if (M.timeofdeath + 6000 < world.time) + if(M.stat == 2) + if(M.timeofdeath + 6000 < world.time) continue var/turf/T = get_turf(M) if(T) continue @@ -127,10 +126,10 @@ if(get_dist(src, usr) > 1 && !issilicon(usr)) return - src.locked = L[desc] + locked = L[desc] for(var/mob/O in hearers(src, null)) O.show_message("Locked In", 2) - src.add_fingerprint(usr) + add_fingerprint(usr) return /obj/machinery/computer/teleporter/verb/set_id(t as text) @@ -141,12 +140,12 @@ if(stat & (NOPOWER|BROKEN) || !istype(usr,/mob/living)) return - if (t) - src.id = t + if(t) + id = t return /proc/find_loc(obj/R as obj) - if (!R) return null + if(!R) return null var/turf/T = R.loc while(!istype(T, /turf)) T = T.loc @@ -160,7 +159,6 @@ anchored = 1.0 var/lockeddown = 0 - /obj/machinery/teleport/hub name = "teleporter hub" desc = "It's the hub of a teleporting machine." @@ -173,13 +171,11 @@ circuit = /obj/item/weapon/circuitboard/teleporter_hub var/obj/machinery/computer/teleporter/com - /obj/machinery/teleport/hub/New() ..() underlays.Cut() underlays += image('icons/obj/stationobjs.dmi', icon_state = "tele-wires") - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) @@ -194,19 +190,19 @@ /obj/machinery/teleport/hub/Bumped(M as mob|obj) spawn() - if (src.icon_state == "tele1") + if(icon_state == "tele1") teleport(M) use_power(5000) return /obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj) - if (!com) + if(!com) return - if (!com.locked) + if(!com.locked) for(var/mob/O in hearers(src, null)) O.show_message("Failure: Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.") return - if (istype(M, /atom/movable)) + if(istype(M, /atom/movable)) if(prob(5) && !accurate) //oh dear a problem, put em in deep space do_teleport(M, locate(rand((2*TRANSITIONEDGE), world.maxx - (2*TRANSITIONEDGE)), rand((2*TRANSITIONEDGE), world.maxy - (2*TRANSITIONEDGE)), 3), 2) else @@ -229,61 +225,60 @@ if(istype(M, /obj/effect)) qdel(M) return - if (istype(M, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite + if(istype(M, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite for(var/mob/O in viewers(M, null)) O.show_message(text("The [] bounces off of the portal!", M.name), 1) return - if (istype(M, /mob/living)) + if(istype(M, /mob/living)) var/mob/living/MM = M if(MM.check_contents_for(/obj/item/weapon/disk/nuclear)) MM << "Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through." return var/disky = 0 for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite - if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift)) + if(istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift)) for (var/obj/OO in O.contents) - if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift)) + if(istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift)) for (var/obj/OOO in OO.contents) - if (istype(OOO, /obj/item/weapon/disk/nuclear)) + if(istype(OOO, /obj/item/weapon/disk/nuclear)) disky = 1 - if (istype(OO, /obj/item/weapon/disk/nuclear)) + if(istype(OO, /obj/item/weapon/disk/nuclear)) disky = 1 - if (istype(O, /obj/item/weapon/disk/nuclear)) + if(istype(O, /obj/item/weapon/disk/nuclear)) disky = 1 - if (istype(O, /mob/living)) + if(istype(O, /mob/living)) var/mob/living/MM = O if(MM.check_contents_for(/obj/item/weapon/disk/nuclear)) disky = 1 - if (disky) + if(disky) for(var/mob/P in viewers(M, null)) P.show_message(text("The [] bounces off of the portal!", M.name), 1) return //Bags of Holding cause bluespace teleportation to go funky. --NeoFite - if (istype(M, /mob/living)) + if(istype(M, /mob/living)) var/mob/living/MM = M if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding)) MM << "The Bluespace interface on your Bag of Holding interferes with the teleport!" precision = rand(1,100) - if (istype(M, /obj/item/weapon/storage/backpack/holding)) + if(istype(M, /obj/item/weapon/storage/backpack/holding)) precision = rand(1,100) for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite - if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift)) + if(istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift)) for (var/obj/OO in O.contents) - if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift)) + if(istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift)) for (var/obj/OOO in OO.contents) - if (istype(OOO, /obj/item/weapon/storage/backpack/holding)) + if(istype(OOO, /obj/item/weapon/storage/backpack/holding)) precision = rand(1,100) - if (istype(OO, /obj/item/weapon/storage/backpack/holding)) + if(istype(OO, /obj/item/weapon/storage/backpack/holding)) precision = rand(1,100) - if (istype(O, /obj/item/weapon/storage/backpack/holding)) + if(istype(O, /obj/item/weapon/storage/backpack/holding)) precision = rand(1,100) - if (istype(O, /mob/living)) + if(istype(O, /mob/living)) var/mob/living/MM = O if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding)) precision = rand(1,100) - var/turf/destturf = get_turf(destination) var/tx = destturf.x + rand(precision * -1, precision) @@ -291,7 +286,7 @@ var/tmploc - if (ismob(destination.loc)) //If this is an implant. + if(ismob(destination.loc)) //If this is an implant. tmploc = locate(tx, ty, destturf.z) else tmploc = locate(tx, ty, destination.z) @@ -329,7 +324,6 @@ overlays.Cut() overlays += image('icons/obj/stationobjs.dmi', icon_state = "controller-wires") - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/console_screen(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) @@ -338,45 +332,45 @@ RefreshParts() /obj/machinery/teleport/station/attackby(var/obj/item/weapon/W) - src.attack_hand() + attack_hand() /obj/machinery/teleport/station/attack_ai() - src.attack_hand() + attack_hand() /obj/machinery/teleport/station/attack_hand() if(engaged) - src.disengage() + disengage() else - src.engage() + engage() /obj/machinery/teleport/station/proc/engage() if(stat & (BROKEN|NOPOWER)) return - if (com) + if(com) com.icon_state = "tele1" use_power(5000) update_use_power(2) com.update_use_power(2) for(var/mob/O in hearers(src, null)) O.show_message("Teleporter engaged!", 2) - src.add_fingerprint(usr) - src.engaged = 1 + add_fingerprint(usr) + engaged = 1 return /obj/machinery/teleport/station/proc/disengage() if(stat & (BROKEN|NOPOWER)) return - if (com) + if(com) com.icon_state = "tele0" com.accurate = 0 com.update_use_power(1) update_use_power(1) for(var/mob/O in hearers(src, null)) O.show_message("Teleporter disengaged!", 2) - src.add_fingerprint(usr) - src.engaged = 0 + add_fingerprint(usr) + engaged = 0 return /obj/machinery/teleport/station/verb/testfire() @@ -387,7 +381,7 @@ if(stat & (BROKEN|NOPOWER) || !istype(usr,/mob/living)) return - if (com && !active) + if(com && !active) active = 1 for(var/mob/O in hearers(src, null)) O.show_message("Test firing!", 2) @@ -397,7 +391,7 @@ spawn(30) active=0 - src.add_fingerprint(usr) + add_fingerprint(usr) return /obj/machinery/teleport/station/power_change() @@ -412,11 +406,11 @@ /obj/effect/laser/Bump() - src.range-- + range-- return /obj/effect/laser/Move() - src.range-- + range-- return /atom/proc/laserhit(L as obj) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 967b7799ed..17797e2a68 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -85,7 +85,7 @@ return if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) - if(src.allowed(usr)) + if(allowed(usr)) if(emagged) user << "The turret control is unresponsive." else @@ -133,7 +133,7 @@ data["settings"] = settings ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if (!ui) + if(!ui) ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) ui.set_initial_data(data) ui.open() @@ -193,8 +193,8 @@ if(stat & NOPOWER) icon_state = "control_off" set_light(0) - else if (enabled) - if (lethal) + else if(enabled) + if(lethal) icon_state = "control_kill" set_light(1.5, 1,"#990000") else diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index d28cb2444c..3c8414affb 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -68,18 +68,18 @@ ..() wires = new(src) spawn(4) - if(src.product_slogans) - src.slogan_list += splittext(src.product_slogans, ";") + if(product_slogans) + slogan_list += splittext(product_slogans, ";") // So not all machines speak at the exact same time. // The first time this machine says something will be at slogantime + this random value, // so if slogantime is 10 minutes, it will say it at somewhere between 10 and 20 minutes after the machine is crated. - src.last_slogan = world.time + rand(0, slogan_delay) + last_slogan = world.time + rand(0, slogan_delay) - if(src.product_ads) - src.ads_list += splittext(src.product_ads, ";") + if(product_ads) + ads_list += splittext(product_ads, ";") - src.build_inventory() + build_inventory() power_change() return @@ -87,17 +87,17 @@ return /** - * Build src.produdct_records from the products lists + * Build produdct_records from the products lists * - * src.products, src.contraband, src.premium, and src.prices allow specifying + * products, contraband, premium, and prices allow specifying * products that the vending machine is to carry without manually populating - * src.product_records. + * product_records. */ /obj/machinery/vending/proc/build_inventory() var/list/all_products = list( - list(src.products, CAT_NORMAL), - list(src.contraband, CAT_HIDDEN), - list(src.premium, CAT_COIN)) + list(products, CAT_NORMAL), + list(contraband, CAT_HIDDEN), + list(premium, CAT_COIN)) for(var/current_list in all_products) var/category = current_list[2] @@ -105,11 +105,11 @@ for(var/entry in current_list[1]) var/datum/stored_item/vending_product/product = new/datum/stored_item/vending_product(src, entry) - product.price = (entry in src.prices) ? src.prices[entry] : 0 + product.price = (entry in prices) ? prices[entry] : 0 product.amount = (current_list[1][entry]) ? current_list[1][entry] : 1 product.category = category - src.product_records.Add(product) + product_records.Add(product) /obj/machinery/vending/Destroy() qdel(wires) @@ -127,21 +127,21 @@ qdel(src) return if(2.0) - if (prob(50)) + if(prob(50)) qdel(src) return if(3.0) - if (prob(25)) + if(prob(25)) spawn(0) - src.malfunction() + malfunction() return return else return /obj/machinery/vending/emag_act(var/remaining_charges, var/mob/user) - if (!emagged) - src.emagged = 1 + if(!emagged) + emagged = 1 user << "You short out the product lock on \the [src]" return 1 @@ -149,43 +149,43 @@ var/obj/item/weapon/card/id/I = W.GetID() - if (currently_vending && vendor_account && !vendor_account.suspended) + if(currently_vending && vendor_account && !vendor_account.suspended) var/paid = 0 var/handled = 0 - if (I) //for IDs and PDAs and wallets with IDs + if(I) //for IDs and PDAs and wallets with IDs paid = pay_with_card(I,W) handled = 1 - else if (istype(W, /obj/item/weapon/spacecash/ewallet)) + else if(istype(W, /obj/item/weapon/spacecash/ewallet)) var/obj/item/weapon/spacecash/ewallet/C = W paid = pay_with_ewallet(C) handled = 1 - else if (istype(W, /obj/item/weapon/spacecash)) + else if(istype(W, /obj/item/weapon/spacecash)) var/obj/item/weapon/spacecash/C = W paid = pay_with_cash(C, user) handled = 1 if(paid) - src.vend(currently_vending, usr) + vend(currently_vending, usr) return else if(handled) nanomanager.update_uis(src) return // don't smack that machine with your 2 thalers - if (I || istype(W, /obj/item/weapon/spacecash)) + if(I || istype(W, /obj/item/weapon/spacecash)) attack_hand(user) return else if(istype(W, /obj/item/weapon/screwdriver)) - src.panel_open = !src.panel_open - user << "You [src.panel_open ? "open" : "close"] the maintenance panel." - src.overlays.Cut() - if(src.panel_open) - src.overlays += image(src.icon, "[initial(icon_state)]-panel") + panel_open = !panel_open + user << "You [panel_open ? "open" : "close"] the maintenance panel." + overlays.Cut() + if(panel_open) + overlays += image(icon, "[initial(icon_state)]-panel") nanomanager.update_uis(src) // Speaker switch is on the main UI, not wires UI return else if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/weapon/wirecutters)) - if(src.panel_open) + if(panel_open) attack_hand(user) return else if(istype(W, /obj/item/weapon/coin) && premium.len > 0) @@ -197,7 +197,7 @@ nanomanager.update_uis(src) return else if(istype(W, /obj/item/weapon/wrench)) - playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) if(anchored) user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") else @@ -253,8 +253,8 @@ /obj/machinery/vending/proc/pay_with_ewallet(var/obj/item/weapon/spacecash/ewallet/wallet) visible_message("\The [usr] swipes \the [wallet] through \the [src].") if(currently_vending.price > wallet.worth) - src.status_message = "Insufficient funds on chargecard." - src.status_error = 1 + status_message = "Insufficient funds on chargecard." + status_error = 1 return 0 else wallet.worth -= currently_vending.price @@ -273,14 +273,14 @@ else visible_message("\The [usr] swipes \the [ID_container] through \the [src].") var/datum/money_account/customer_account = get_account(I.associated_account_number) - if (!customer_account) - src.status_message = "Error: Unable to access account. Please contact technical support if problem persists." - src.status_error = 1 + if(!customer_account) + status_message = "Error: Unable to access account. Please contact technical support if problem persists." + status_error = 1 return 0 if(customer_account.suspended) - src.status_message = "Unable to access account: account suspended." - src.status_error = 1 + status_message = "Unable to access account: account suspended." + status_error = 1 return 0 // Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is @@ -290,13 +290,13 @@ customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2) if(!customer_account) - src.status_message = "Unable to access account: incorrect credentials." - src.status_error = 1 + status_message = "Unable to access account: incorrect credentials." + status_error = 1 return 0 if(currently_vending.price > customer_account.money) - src.status_message = "Insufficient funds in account." - src.status_error = 1 + status_message = "Insufficient funds in account." + status_error = 1 return 0 else // Okay to move the money at this point @@ -306,13 +306,13 @@ // create entry in the purchaser's account log var/datum/transaction/T = new() - T.target_name = "[vendor_account.owner_name] (via [src.name])" + T.target_name = "[vendor_account.owner_name] (via [name])" T.purpose = "Purchase of [currently_vending.item_name]" if(currently_vending.price > 0) T.amount = "([currently_vending.price])" else T.amount = "[currently_vending.price]" - T.source_terminal = src.name + T.source_terminal = name T.date = current_date_string T.time = worldtime2text() customer_account.transaction_log.Add(T) @@ -335,7 +335,7 @@ T.target_name = target T.purpose = "Purchase of [currently_vending.item_name]" T.amount = "[currently_vending.price]" - T.source_terminal = src.name + T.source_terminal = name T.date = current_date_string T.time = worldtime2text() vendor_account.transaction_log.Add(T) @@ -347,8 +347,8 @@ if(stat & (BROKEN|NOPOWER)) return - if(src.seconds_electrified != 0) - if(src.shock(user, 100)) + if(seconds_electrified != 0) + if(shock(user, 100)) return wires.Interact(user) @@ -368,16 +368,16 @@ data["product"] = currently_vending.item_name data["price"] = currently_vending.price data["message_err"] = 0 - data["message"] = src.status_message - data["message_err"] = src.status_error + data["message"] = status_message + data["message_err"] = status_error else data["mode"] = 0 var/list/listed_products = list() - for(var/key = 1 to src.product_records.len) - var/datum/stored_item/vending_product/I = src.product_records[key] + for(var/key = 1 to product_records.len) + var/datum/stored_item/vending_product/I = product_records[key] - if(!(I.category & src.categories)) + if(!(I.category & categories)) continue listed_products.Add(list(list( @@ -389,18 +389,18 @@ data["products"] = listed_products - if(src.coin) - data["coin"] = src.coin.name + if(coin) + data["coin"] = coin.name - if(src.panel_open) + if(panel_open) data["panel"] = 1 - data["speaker"] = src.shut_up ? 0 : 1 + data["speaker"] = shut_up ? 0 : 1 else data["panel"] = 0 ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if (!ui) - ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600) + if(!ui) + ui = new(user, src, ui_key, "vending_machine.tmpl", name, 440, 600) ui.set_initial_data(data) ui.open() @@ -422,8 +422,8 @@ coin = null categories &= ~CAT_COIN - if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))) - if ((href_list["vend"]) && (src.vend_ready) && (!currently_vending)) + if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))) + if((href_list["vend"]) && (vend_ready) && (!currently_vending)) if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH usr << "Access denied." //Unless emagged of course flick(icon_deny,src) @@ -433,43 +433,43 @@ var/datum/stored_item/vending_product/R = product_records[key] // This should not happen unless the request from NanoUI was bad - if(!(R.category & src.categories)) + if(!(R.category & categories)) return if(R.price <= 0) - src.vend(R, usr) + vend(R, usr) else if(istype(usr,/mob/living/silicon)) //If the item is not free, provide feedback if a synth is trying to buy something. usr << "Artificial unit recognized. Artificial units cannot complete this transaction. Purchase canceled." return else - src.currently_vending = R + currently_vending = R if(!vendor_account || vendor_account.suspended) - src.status_message = "This machine is currently unable to process payments due to problems with the associated account." - src.status_error = 1 + status_message = "This machine is currently unable to process payments due to problems with the associated account." + status_error = 1 else - src.status_message = "Please swipe a card or insert cash to pay for the item." - src.status_error = 0 + status_message = "Please swipe a card or insert cash to pay for the item." + status_error = 0 - else if (href_list["cancelpurchase"]) - src.currently_vending = null + else if(href_list["cancelpurchase"]) + currently_vending = null - else if ((href_list["togglevoice"]) && (src.panel_open)) - src.shut_up = !src.shut_up + else if((href_list["togglevoice"]) && (panel_open)) + shut_up = !shut_up - src.add_fingerprint(usr) + add_fingerprint(usr) nanomanager.update_uis(src) /obj/machinery/vending/proc/vend(datum/stored_item/vending_product/R, mob/user) if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH usr << "Access denied." //Unless emagged of course - flick(src.icon_deny,src) + flick(icon_deny,src) return - src.vend_ready = 0 //One thing at a time!! - src.status_message = "Vending..." - src.status_error = 0 + vend_ready = 0 //One thing at a time!! + status_message = "Vending..." + status_error = 0 nanomanager.update_uis(src) - if (R.category & CAT_COIN) + if(R.category & CAT_COIN) if(!coin) user << "You need to insert a coin to get this item." return @@ -486,24 +486,24 @@ coin = null categories &= ~CAT_COIN - if(((src.last_reply + (src.vend_delay + 200)) <= world.time) && src.vend_reply) + if(((last_reply + (vend_delay + 200)) <= world.time) && vend_reply) spawn(0) - src.speak(src.vend_reply) - src.last_reply = world.time + speak(vend_reply) + last_reply = world.time use_power(vend_power_usage) //actuators and stuff - if (src.icon_vend) //Show the vending animation if needed - flick(src.icon_vend,src) - spawn(src.vend_delay) + if(icon_vend) //Show the vending animation if needed + flick(icon_vend,src) + spawn(vend_delay) R.get_product(get_turf(src)) if(prob(1)) sleep(3) if(R.get_product(get_turf(src))) - src.visible_message("\The [src] clunks as it vends an additional item.") + visible_message("\The [src] clunks as it vends an additional item.") - src.status_message = "" - src.status_error = 0 - src.vend_ready = 1 + status_message = "" + status_error = 0 + vend_ready = 1 currently_vending = null nanomanager.update_uis(src) @@ -527,20 +527,20 @@ if(stat & (BROKEN|NOPOWER)) return - if(!src.active) + if(!active) return - if(src.seconds_electrified > 0) - src.seconds_electrified-- + if(seconds_electrified > 0) + seconds_electrified-- //Pitch to the people! Really sell it! - if(((src.last_slogan + src.slogan_delay) <= world.time) && (src.slogan_list.len > 0) && (!src.shut_up) && prob(5)) - var/slogan = pick(src.slogan_list) - src.speak(slogan) - src.last_slogan = world.time + if(((last_slogan + slogan_delay) <= world.time) && (slogan_list.len > 0) && (!shut_up) && prob(5)) + var/slogan = pick(slogan_list) + speak(slogan) + last_slogan = world.time - if(src.shoot_inventory && prob(2)) - src.throw_item() + if(shoot_inventory && prob(2)) + throw_item() return @@ -548,7 +548,7 @@ if(stat & NOPOWER) return - if (!message) + if(!message) return for(var/mob/O in hearers(src, null)) @@ -560,21 +560,21 @@ if(stat & BROKEN) icon_state = "[initial(icon_state)]-broken" else - if( !(stat & NOPOWER) ) + if(!(stat & NOPOWER)) icon_state = initial(icon_state) else spawn(rand(0, 15)) - src.icon_state = "[initial(icon_state)]-off" + icon_state = "[initial(icon_state)]-off" //Oh no we're malfunctioning! Dump out some product and break. /obj/machinery/vending/proc/malfunction() - for(var/datum/stored_item/vending_product/R in src.product_records) + for(var/datum/stored_item/vending_product/R in product_records) while(R.get_amount()>0) R.get_product(loc) break stat |= BROKEN - src.icon_state = "[initial(icon_state)]-broken" + icon_state = "[initial(icon_state)]-broken" return //Somebody cut an important wire and now we're following a new definition of "pitch." @@ -584,16 +584,16 @@ if(!target) return 0 - for(var/datum/stored_item/vending_product/R in src.product_records) + for(var/datum/stored_item/vending_product/R in product_records) throw_item = R.get_product(loc) - if (!throw_item) + if(!throw_item) continue break - if (!throw_item) + if(!throw_item) return 0 spawn(0) throw_item.throw_at(target, 16, 3, src) - src.visible_message("\The [src] launches \a [throw_item] at \the [target]!") + visible_message("\The [src] launches \a [throw_item] at \the [target]!") return 1 /* @@ -885,9 +885,9 @@ */ /obj/machinery/vending/hydroseeds/build_inventory() var/list/all_products = list( - list(src.products, CAT_NORMAL), - list(src.contraband, CAT_HIDDEN), - list(src.premium, CAT_COIN)) + list(products, CAT_NORMAL), + list(contraband, CAT_HIDDEN), + list(premium, CAT_COIN)) for(var/current_list in all_products) var/category = current_list[2] @@ -897,11 +897,11 @@ var/name = S.name var/datum/stored_item/vending_product/product = new/datum/stored_item/vending_product(src, entry, name) - product.price = (entry in src.prices) ? src.prices[entry] : 0 + product.price = (entry in prices) ? prices[entry] : 0 product.amount = (current_list[1][entry]) ? current_list[1][entry] : 1 product.category = category - src.product_records.Add(product) + product_records.Add(product) /obj/machinery/vending/magivend name = "MagiVend" @@ -961,7 +961,7 @@ /obj/item/weapon/wrench = 5,/obj/item/device/analyzer = 5,/obj/item/device/t_scanner = 5,/obj/item/weapon/screwdriver = 5, /obj/item/device/flashlight/glowstick = 3, /obj/item/device/flashlight/glowstick/red = 3, /obj/item/device/flashlight/glowstick/blue = 3, /obj/item/device/flashlight/glowstick/orange =3, /obj/item/device/flashlight/glowstick/yellow = 3) - contraband = list(/obj/item/weapon/weldingtool/hugetank = 2,/obj/item/clothing/gloves/fyellow = 2, ) + contraband = list(/obj/item/weapon/weldingtool/hugetank = 2,/obj/item/clothing/gloves/fyellow = 2,) premium = list(/obj/item/clothing/gloves/yellow = 1) /obj/machinery/vending/engivend diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm index 701d4ebab2..3a036eec8e 100644 --- a/code/game/machinery/wall_frames.dm +++ b/code/game/machinery/wall_frames.dm @@ -4,136 +4,96 @@ icon = 'icons/obj/stock_parts.dmi' icon_state = "frame_bitem" flags = CONDUCT - var/build_machine_type = /obj/structure/frame + var/build_machine_type var/refund_amt = 5 var/refund_type = /obj/item/stack/material/steel var/reverse = 0 //if resulting object faces opposite its dir (like light fixtures) - var/frame_type = null + var/list/frame_types_floor + var/list/frame_types_wall + +/obj/item/frame/proc/update_type_list() + if(!frame_types_floor) + frame_types_floor = construction_frame_floor + if(!frame_types_wall) + frame_types_wall = construction_frame_wall /obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/wrench)) - new refund_type( get_turf(src.loc), refund_amt) + if(istype(W, /obj/item/weapon/wrench)) + new refund_type(get_turf(src.loc), refund_amt) qdel(src) return ..() /obj/item/frame/attack_self(mob/user as mob) ..() + update_type_list() + var/datum/frame/frame_types/frame_type if(!build_machine_type) - return - - if(!frame_type) - var/response = input(usr, "What kind of frame would you like to make?", "Frame type request", null) in list("Computer", "Machine", "Holopad", "Conveyor", - "Photocopier", "Fax", "Microwave", - "Recharger", "Washing Machine", "Grinder", - "Medical Console", "Medical Pod", "DNA Analyzer", - "Mass Driver", - "Cancel") - - if(response == "Cancel") + var/datum/frame/frame_types/response = input(usr, "What kind of frame would you like to make?", "Frame type request", null) in frame_types_floor + if(!response || response.name == "Cancel") return + frame_type = response - frame_type = lowertext(response) + build_machine_type = /obj/structure/frame - switch(response) - if("Holopad") - new /obj/item/stack/material/steel( usr.loc, 1 ) //holopads are smaller, they only need 4 sheets - if("Fax") - new /obj/item/stack/material/steel( usr.loc, 2 ) //faxes are smaller, they only need 3 sheets - if("Microwave") - new /obj/item/stack/material/steel( usr.loc, 1 ) //microwaves are smaller, they only need 4 sheets - if("Recharger") - new /obj/item/stack/material/steel( usr.loc, 2 ) //rechargers are smaller, they only need 3 sheets - if("Washing Machine") - frame_type = "washing" - if("Grinder") - new /obj/item/stack/material/steel( usr.loc, 2 ) //grinders are smaller, they only need 3 sheets - if("Medical Console") - frame_type = "console" - if("Medical Pod") - frame_type = "medpod" - if("DNA Analyzer") - frame_type = "dna_analyzer" - if("Mass Driver") - frame_type = "massdriver" + if(frame_type.frame_size != 5) + new /obj/item/stack/material/steel(usr.loc, (5 - frame_type.frame_size)) var/ndir ndir = usr.dir - if (!(ndir in cardinal)) + if(!(ndir in cardinal)) return var/obj/machinery/M = new build_machine_type(get_turf(src.loc), ndir, 1, frame_type) - M.fingerprints = src.fingerprints - M.fingerprintshidden = src.fingerprintshidden - M.fingerprintslast = src.fingerprintslast + M.fingerprints = fingerprints + M.fingerprintshidden = fingerprintshidden + M.fingerprintslast = fingerprintslast qdel(src) /obj/item/frame/proc/try_build(turf/on_wall, mob/user as mob) - if(!frame_type) - var/response = input(usr, "What kind of frame would you like to make?", "Frame type request", null) in list("Fire Alarm", "Air Alarm", "Display", "Newscaster", - "ATM", "Guest Pass Console", "Intercom", "Keycard Authenticator", - "Wall Charger", "Supply Request Console", - "Cancel") - - if(response == "Cancel") - return - - frame_type = lowertext(response) - - switch(response) - if("Fire Alarm") - frame_type = "firealarm" - new /obj/item/stack/material/steel( usr.loc, 3 ) //fire alarms are smaller, they only need 2 sheets - if("Air Alarm") - frame_type = "airalarm" - new /obj/item/stack/material/steel( usr.loc, 3 ) //air alarms are smaller, they only need 2 sheets - if("Intercom") - new /obj/item/stack/material/steel( usr.loc, 3 ) //intercoms are smaller, they only need 2 sheets - if("Newscaster") - new /obj/item/stack/material/steel( usr.loc, 2 ) //newscasters are smaller, they only need 3 sheets - if("Guest Pass Console") - frame_type = "guestpass" - new /obj/item/stack/material/steel( usr.loc, 3 ) //guestpass consoles are smaller, they only need 2 sheets - if("Keycard Authenticator") - frame_type = "keycard" - new /obj/item/stack/material/steel( usr.loc, 4 ) //keycard authenticators are smaller, they only need 1 sheets - if("Wall Charger") - frame_type = "wrecharger" - new /obj/item/stack/material/steel( usr.loc, 2 ) //wall rechargers are smaller, they only need 3 sheets - if("Supply Request Console") - frame_type = "request" - + update_type_list() + var/datum/frame/frame_types/frame_type if(!build_machine_type) - return + var/datum/frame/frame_types/response = input(usr, "What kind of frame would you like to make?", "Frame type request", null) in frame_types_wall + if(!response || response.name == "Cancel") + return + frame_type = response - if (get_dist(on_wall,usr)>1) + build_machine_type = /obj/structure/frame + + if(frame_type.frame_size != 5) + new /obj/item/stack/material/steel(usr.loc, (5 - frame_type.frame_size)) + + if(get_dist(on_wall, usr)>1) return var/ndir if(reverse) - ndir = get_dir(usr,on_wall) + ndir = get_dir(usr, on_wall) else - ndir = get_dir(on_wall,usr) + ndir = get_dir(on_wall, usr) - if (!(ndir in cardinal)) + if(!(ndir in cardinal)) return var/turf/loc = get_turf(usr) var/area/A = loc.loc - if (!istype(loc, /turf/simulated/floor)) + if(!istype(loc, /turf/simulated/floor)) usr << "\The frame cannot be placed on this spot." return - if (A.requires_power == 0 || A.name == "Space") + + if(A.requires_power == 0 || A.name == "Space") usr << "\The [src] Alarm cannot be placed in this area." return if(gotwallitem(loc, ndir)) usr << "There's already an item on this wall!" return + var/obj/machinery/M = new build_machine_type(loc, ndir, 1, frame_type) - M.fingerprints = src.fingerprints - M.fingerprintshidden = src.fingerprintshidden - M.fingerprintslast = src.fingerprintslast + M.fingerprints = fingerprints + M.fingerprintshidden = fingerprintshidden + M.fingerprintslast = fingerprintslast qdel(src) /obj/item/frame/light @@ -143,14 +103,12 @@ icon_state = "tube-construct-item" build_machine_type = /obj/machinery/light_construct reverse = 1 - frame_type = 1 /obj/item/frame/light/small name = "small light fixture frame" icon_state = "bulb-construct-item" refund_amt = 1 build_machine_type = /obj/machinery/light_construct/small - frame_type = 1 /obj/item/frame/extinguisher_cabinet name = "extinguisher cabinet frame" @@ -159,7 +117,6 @@ icon_state = "extinguisher_empty" refund_amt = 4 build_machine_type = /obj/structure/extinguisher_cabinet - frame_type = 1 /obj/item/frame/noticeboard name = "noticeboard frame" @@ -169,7 +126,6 @@ refund_amt = 4 refund_type = /obj/item/stack/material/wood build_machine_type = /obj/structure/noticeboard - frame_type = 1 /obj/item/frame/mirror name = "mirror frame" @@ -178,7 +134,6 @@ icon_state = "mirror_frame" refund_amt = 1 build_machine_type = /obj/structure/mirror - frame_type = 1 /obj/item/frame/fireaxe_cabinet name = "fire axe cabinet frame" @@ -186,5 +141,4 @@ icon = 'icons/obj/closet.dmi' icon_state = "fireaxe0101" refund_amt = 4 - build_machine_type = /obj/structure/closet/fireaxecabinet - frame_type = 1 \ No newline at end of file + build_machine_type = /obj/structure/closet/fireaxecabinet \ No newline at end of file diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 93d161f2ea..cf96260358 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -26,7 +26,7 @@ ) /obj/machinery/washing_machine/New() - circuit = new circuit(src) + ..() component_parts = list() component_parts += new /obj/item/weapon/stock_parts/motor(src) component_parts += new /obj/item/weapon/stock_parts/gear(src) @@ -41,11 +41,11 @@ if(!istype(usr, /mob/living)) //ew ew ew usr, but it's the only way to check. return - if( state != 4 ) + if(state != 4) usr << "The washing machine cannot run in this state." return - if( locate(/mob,washing) ) + if(locate(/mob,washing)) state = 8 else state = 5 @@ -63,7 +63,7 @@ WL.amount = HH.amount qdel(HH) - if( locate(/mob,washing) ) + if(locate(/mob,washing)) state = 7 gibs_ready = 1 else @@ -76,10 +76,9 @@ set src in usr.loc sleep(20) - if(state in list(1,3,6) ) + if(state in list(1,3,6)) usr.loc = src.loc - /obj/machinery/washing_machine/update_icon() icon_state = "wm_[state][panel_open]" @@ -93,7 +92,7 @@ panel = !panel user << "You [panel ? "open" : "close"] the [src]'s maintenance panel"*/ if(istype(W,/obj/item/weapon/pen/crayon) || istype(W,/obj/item/weapon/stamp)) - if( state in list( 1, 3, 6 ) ) + if(state in list( 1, 3, 6)) if(!crayon) user.drop_item() crayon = W @@ -103,7 +102,7 @@ else ..() else if(istype(W,/obj/item/weapon/grab)) - if( (state == 1) && hacked) + if((state == 1) && hacked) var/obj/item/weapon/grab/G = W if(ishuman(G.assailant) && iscorgi(G.affecting)) G.affecting.loc = src @@ -118,7 +117,7 @@ else if(istype(W, /obj/item/clothing)) if(washing.len < 5) - if ( state in list(1, 3) ) + if(state in list(1, 3)) user.drop_item() W.loc = src washing += W diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm index 71b7de64c0..e36b577e9e 100644 --- a/code/game/machinery/wishgranter.dm +++ b/code/game/machinery/wishgranter.dm @@ -3,11 +3,9 @@ desc = "You're not so sure about this, anymore..." icon = 'icons/obj/device.dmi' icon_state = "syndbeacon" - use_power = 0 anchored = 1 density = 1 - var/charges = 1 var/insisting = 0 @@ -25,7 +23,7 @@ else if(is_special_character(user)) user << "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away." - else if (!insisting) + else if(!insisting) user << "Your first touch makes the Wish Granter stir, listening to you. Are you really sure you want to do this?" insisting++ @@ -36,22 +34,22 @@ charges-- insisting = 0 - if (!(HULK in user.mutations)) + if(!(HULK in user.mutations)) user.mutations.Add(HULK) - if (!(LASER in user.mutations)) + if(!(LASER in user.mutations)) user.mutations.Add(LASER) - if (!(XRAY in user.mutations)) + if(!(XRAY in user.mutations)) user.mutations.Add(XRAY) user.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) user.see_in_dark = 8 user.see_invisible = SEE_INVISIBLE_LEVEL_TWO - if (!(COLD_RESISTANCE in user.mutations)) + if(!(COLD_RESISTANCE in user.mutations)) user.mutations.Add(COLD_RESISTANCE) - if (!(TK in user.mutations)) + if(!(TK in user.mutations)) user.mutations.Add(TK) if(!(HEAL in user.mutations)) diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 23c30d3a3d..55255d2097 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -4,6 +4,7 @@ icon = 'icons/mecha/mech_bay.dmi' icon_state = "recharge_floor" density = 0 + anchored = 1 layer = TURF_LAYER + 0.1 circuit = /obj/item/weapon/circuitboard/mech_recharger @@ -14,13 +15,11 @@ /obj/machinery/mech_recharger/New() ..() component_parts = list() - component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) - RefreshParts() /obj/machinery/mech_recharger/Crossed(var/obj/mecha/M) @@ -50,7 +49,7 @@ ..() if(!charging) return - if(charging.loc != loc) // Could be qdel or teleport or something + if(charging.loc != src.loc) // Could be qdel or teleport or something stop_charging() return var/done = 1 @@ -95,4 +94,4 @@ if(!charging) return - charging = null + charging = null \ No newline at end of file diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index ee000d60be..da744422cf 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -27,7 +27,6 @@ /obj/machinery/mecha_part_fabricator/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) diff --git a/code/game/mecha/mech_prosthetics.dm b/code/game/mecha/mech_prosthetics.dm index 588fd402f3..634a239d82 100644 --- a/code/game/mecha/mech_prosthetics.dm +++ b/code/game/mecha/mech_prosthetics.dm @@ -28,7 +28,6 @@ /obj/machinery/pros_fabricator/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index cbc60670e7..4e6154189a 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -21,8 +21,8 @@ origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1) var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage var/obj/machinery/clonepod/connecting //same for cryopod linkage - var/obj/machinery/connectable //Used to connect machinery, currently only used by Xenobio2. - + var/obj/machinery/connectable //Used to connect machinery. + /obj/item/device/multitool/attack_self(mob/user) var/clear = alert("Do you want to clear the buffers on the [src]?",, "Yes", "No",) if(clear == "Yes") diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 7aaf609eca..4ea8837d80 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -46,6 +46,7 @@ /obj/item/device/radio/intercom/New() ..() processing_objects += src + circuit = new circuit(src) /obj/item/device/radio/intercom/department/medbay/New() ..() @@ -84,7 +85,7 @@ attack_self(user) /obj/item/device/radio/intercom/attackby(obj/item/W as obj, mob/user as mob) - src.add_fingerprint(user) + add_fingerprint(user) if(istype(W, /obj/item/weapon/screwdriver)) // Opening the intercom up. wiresexposed = !wiresexposed user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]" @@ -96,22 +97,20 @@ else icon_state = "intercom" return - if (wiresexposed && istype(W, /obj/item/weapon/wirecutters)) + if(wiresexposed && istype(W, /obj/item/weapon/wirecutters)) user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) new/obj/item/stack/cable_coil(get_turf(src), 5) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "intercom" + var/obj/structure/frame/A = new /obj/structure/frame(src.loc) + var/obj/item/weapon/circuitboard/M = circuit + A.frame_type = M.board_type A.pixel_x = pixel_x A.pixel_y = pixel_y A.circuit = M A.set_dir(dir) A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) A.state = 2 - A.icon_state = "intercom_2" + A.update_icon() M.deconstruct(src) qdel(src) else @@ -175,4 +174,4 @@ /obj/item/device/radio/intercom/locked/confessional name = "confessional intercom" - frequency = 1480 + frequency = 1480 \ No newline at end of file diff --git a/code/game/objects/items/weapons/circuitboards/circuitboard.dm b/code/game/objects/items/weapons/circuitboards/circuitboard.dm index fd30153c37..3711cf0690 100644 --- a/code/game/objects/items/weapons/circuitboards/circuitboard.dm +++ b/code/game/objects/items/weapons/circuitboards/circuitboard.dm @@ -19,19 +19,19 @@ throw_speed = 3 throw_range = 15 var/build_path = null - var/board_type = "computer" + var/board_type = new /datum/frame/frame_types/computer var/list/req_components = null var/contain_parts = 1 //Called when the circuitboard is used to contruct a new machine. /obj/item/weapon/circuitboard/proc/construct(var/obj/machinery/M) - if (istype(M, build_path)) + if(istype(M, build_path)) return 1 return 0 //Called when a computer is deconstructed to produce a circuitboard. //Only used by computers, as other machines store their circuitboard instance. /obj/item/weapon/circuitboard/proc/deconstruct(var/obj/machinery/M) - if (istype(M, build_path)) + if(istype(M, build_path)) return 1 return 0 diff --git a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm index 0016fc730a..c46c519e9e 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm @@ -32,7 +32,7 @@ /obj/item/weapon/circuitboard/security/telescreen/entertainment name = T_BOARD("entertainment camera monitor") build_path = /obj/machinery/computer/security/telescreen/entertainment - board_type = "display" + board_type = new /datum/frame/frame_types/display matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/security/telescreen/entertainment/New() diff --git a/code/game/objects/items/weapons/circuitboards/computer/research.dm b/code/game/objects/items/weapons/circuitboards/computer/research.dm index 7695913eed..f49b80e6df 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/research.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/research.dm @@ -1,5 +1,5 @@ #ifndef T_BOARD -#error T_BOARD macro is not defined but we need it! +#error T_BOARD macro is not defined but we need it! #endif /obj/item/weapon/circuitboard/rdconsole @@ -9,12 +9,12 @@ /obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) if(istype(I,/obj/item/weapon/screwdriver)) user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") - if(src.build_path == /obj/machinery/computer/rdconsole/core) - src.name = T_BOARD("RD Console - Robotics") - src.build_path = /obj/machinery/computer/rdconsole/robotics + if(build_path == /obj/machinery/computer/rdconsole/core) + name = T_BOARD("RD Console - Robotics") + build_path = /obj/machinery/computer/rdconsole/robotics user << "Access protocols set to robotics." else - src.name = T_BOARD("RD Console") - src.build_path = /obj/machinery/computer/rdconsole/core + name = T_BOARD("RD Console") + build_path = /obj/machinery/computer/rdconsole/core user << "Access protocols set to default." - return + return \ No newline at end of file diff --git a/code/game/objects/items/weapons/circuitboards/frame.dm b/code/game/objects/items/weapons/circuitboards/frame.dm index 3acb2de755..fa48be65bb 100644 --- a/code/game/objects/items/weapons/circuitboards/frame.dm +++ b/code/game/objects/items/weapons/circuitboards/frame.dm @@ -9,37 +9,37 @@ /obj/item/weapon/circuitboard/guestpass name = T_BOARD("guestpass console") build_path = /obj/machinery/computer/guestpass - board_type = "guestpass" + board_type = new /datum/frame/frame_types/guest_pass_console matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/status_display name = T_BOARD("status display") build_path = /obj/machinery/status_display - board_type = "display" + board_type = new /datum/frame/frame_types/display matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/ai_status_display name = T_BOARD("ai status display") build_path = /obj/machinery/ai_status_display - board_type = "display" + board_type = new /datum/frame/frame_types/display matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/newscaster name = T_BOARD("newscaster") build_path = /obj/machinery/newscaster - board_type = "newscaster" + board_type = new /datum/frame/frame_types/newscaster matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/atm name = T_BOARD("atm") build_path = /obj/machinery/atm - board_type = "atm" + board_type = new /datum/frame/frame_types/atm matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/request name = T_BOARD("reques console") build_path = /obj/machinery/requests_console - board_type = "request" + board_type = new /datum/frame/frame_types/supply_request_console matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) //Alarm @@ -47,25 +47,25 @@ /obj/item/weapon/circuitboard/firealarm name = T_BOARD("fire alarm") build_path = /obj/machinery/firealarm - board_type = "firealarm" + board_type = new /datum/frame/frame_types/fire_alarm matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/airalarm name = T_BOARD("air alarm") build_path = /obj/machinery/alarm - board_type = "airalarm" + board_type = new /datum/frame/frame_types/air_alarm matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/intercom name = T_BOARD("intercom") build_path = /obj/item/device/radio/intercom - board_type = "intercom" + board_type = new /datum/frame/frame_types/intercom matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/keycard_auth name = T_BOARD("keycard authenticator") build_path = /obj/machinery/keycard_auth - board_type = "keycard" + board_type = new /datum/frame/frame_types/keycard_authenticator matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) //Computer @@ -73,19 +73,19 @@ /obj/item/weapon/circuitboard/holopad name = T_BOARD("holopad") build_path = /obj/machinery/hologram/holopad - board_type = "holopad" + board_type = new /datum/frame/frame_types/holopad matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /obj/item/weapon/circuitboard/scanner_console name = T_BOARD("body scanner console") build_path = /obj/machinery/body_scanconsole - board_type = "console" + board_type = new /datum/frame/frame_types/medical_console origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2) /obj/item/weapon/circuitboard/sleeper_console name = T_BOARD("sleeper console") build_path = /obj/machinery/sleep_console - board_type = "console" + board_type = new /datum/frame/frame_types/medical_console origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2) //Machine @@ -93,7 +93,7 @@ /obj/item/weapon/circuitboard/photocopier name = T_BOARD("photocopier") build_path = /obj/machinery/photocopier - board_type = "photocopier" + board_type = new /datum/frame/frame_types/photocopier matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) req_components = list( /obj/item/weapon/stock_parts/scanning_module = 1, @@ -104,7 +104,7 @@ /obj/item/weapon/circuitboard/fax name = T_BOARD("fax") build_path = /obj/machinery/photocopier/faxmachine - board_type = "fax" + board_type = new /datum/frame/frame_types/fax matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) req_components = list( /obj/item/weapon/stock_parts/scanning_module = 1, @@ -115,7 +115,7 @@ /obj/item/weapon/circuitboard/conveyor name = T_BOARD("conveyor") build_path = /obj/machinery/conveyor - board_type = "conveyor" + board_type = new /datum/frame/frame_types/conveyor req_components = list( /obj/item/weapon/stock_parts/gear = 2, /obj/item/weapon/stock_parts/motor = 2, @@ -124,7 +124,7 @@ /obj/item/weapon/circuitboard/microwave name = T_BOARD("microwave") build_path = /obj/machinery/microwave - board_type = "microwave" + board_type = new /datum/frame/frame_types/microwave matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) req_components = list( /obj/item/weapon/stock_parts/console_screen = 1, @@ -134,7 +134,7 @@ /obj/item/weapon/circuitboard/recharger name = T_BOARD("recharger") build_path = /obj/machinery/recharger - board_type = "recharger" + board_type = new /datum/frame/frame_types/recharger req_components = list( /obj/item/weapon/stock_parts/capacitor = 1, /obj/item/stack/cable_coil = 5) @@ -142,12 +142,12 @@ /obj/item/weapon/circuitboard/recharger/wrecharger name = T_BOARD("wall recharger") build_path = /obj/machinery/recharger/wallcharger - board_type = "wrecharger" + board_type = new /datum/frame/frame_types/wall_charger /obj/item/weapon/circuitboard/washing name = T_BOARD("washing machine") build_path = /obj/machinery/washing_machine - board_type = "washing" + board_type = new /datum/frame/frame_types/washing_machine matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) req_components = list( /obj/item/weapon/stock_parts/motor = 1, @@ -156,7 +156,7 @@ /obj/item/weapon/circuitboard/grinder name = T_BOARD("reagent grinder") build_path = /obj/machinery/reagentgrinder - board_type = "grinder" + board_type = new /datum/frame/frame_types/grinder req_components = list( /obj/item/weapon/stock_parts/motor = 1, /obj/item/weapon/stock_parts/gear = 1, @@ -185,7 +185,7 @@ /obj/item/weapon/circuitboard/body_scanner name = T_BOARD("body scanner") build_path = /obj/machinery/bodyscanner - board_type = "medpod" + board_type = new /datum/frame/frame_types/medical_pod origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2) req_components = list( /obj/item/weapon/stock_parts/scanning_module = 3, @@ -194,7 +194,7 @@ /obj/item/weapon/circuitboard/sleeper name = T_BOARD("sleeper") build_path = /obj/machinery/sleeper - board_type = "medpod" + board_type = new /datum/frame/frame_types/medical_pod origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2) req_components = list( /obj/item/weapon/stock_parts/scanning_module = 1, @@ -205,7 +205,7 @@ /obj/item/weapon/circuitboard/dna_analyzer name = T_BOARD("dna analyzer") build_path = /obj/machinery/dnaforensics - board_type = "dna_analyzer" + board_type = new /datum/frame/frame_types/dna_analyzer origin_tech = list(TECH_MAGNET = 4, TECH_BIO = 2, TECH_DATA = 2) req_components = list( /obj/item/weapon/stock_parts/scanning_module = 2, @@ -215,104 +215,10 @@ /obj/item/weapon/circuitboard/mass_driver name = T_BOARD("mass driver") build_path = /obj/machinery/mass_driver - board_type = "massdriver" + board_type = new /datum/frame/frame_types/mass_driver req_components = list( /obj/item/weapon/stock_parts/gear = 2, /obj/item/weapon/stock_parts/motor = 2, /obj/item/weapon/stock_parts/capacitor = 1, /obj/item/weapon/stock_parts/spring = 1, - /obj/item/stack/cable_coil = 5) - -//for testing - If this is still in when I commit, someone shoot me. --leaving in for now, shouldn't be able to get these on station anyways. -/obj/item/weapon/storage/box/frame_parts - display_contents_with_number = 1 - New() - ..() - new /obj/item/weapon/circuitboard/guestpass( src ) - new /obj/item/weapon/circuitboard/status_display( src ) - new /obj/item/weapon/circuitboard/ai_status_display( src ) - new /obj/item/weapon/circuitboard/newscaster( src ) - new /obj/item/weapon/circuitboard/atm( src ) - new /obj/item/weapon/circuitboard/firealarm( src ) - new /obj/item/weapon/circuitboard/airalarm( src ) - new /obj/item/weapon/circuitboard/intercom( src ) - new /obj/item/weapon/circuitboard/keycard_auth( src ) - new /obj/item/weapon/circuitboard/holopad( src ) - new /obj/item/weapon/circuitboard/photocopier( src ) - new /obj/item/weapon/circuitboard/fax( src ) - new /obj/item/weapon/circuitboard/microwave( src ) - new /obj/item/weapon/circuitboard/washing( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/weapon/stock_parts/scanning_module( src ) - new /obj/item/weapon/stock_parts/motor( src ) - new /obj/item/weapon/stock_parts/micro_laser( src ) - new /obj/item/weapon/stock_parts/matter_bin( src ) - new /obj/item/weapon/stock_parts/gear( src ) - new /obj/item/weapon/stock_parts/console_screen( src ) - new /obj/item/weapon/stock_parts/capacitor( src ) - new /obj/item/weapon/stock_parts/spring( src ) - new /obj/item/stack/cable_coil( src , 5 ) - new /obj/item/stack/material/glass/reinforced( src , 2 ) \ No newline at end of file + /obj/item/stack/cable_coil = 5) \ No newline at end of file diff --git a/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm b/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm index 716e763515..c32b93484e 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm @@ -4,8 +4,8 @@ /obj/item/weapon/circuitboard/biogenerator name = T_BOARD("biogenerator") - build_path = "/obj/machinery/biogenerator" - board_type = "machine" + build_path = /obj/machinery/biogenerator + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 2) req_components = list( /obj/item/weapon/stock_parts/matter_bin = 1, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm b/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm index a1edb3f464..ffca070fe9 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm @@ -4,8 +4,8 @@ /obj/item/weapon/circuitboard/clonepod name = T_BOARD("clone pod") - build_path = "/obj/machinery/clonepod" - board_type = "machine" + build_path = /obj/machinery/clonepod + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3, TECH_BIO = 3) req_components = list( /obj/item/stack/cable_coil = 2, @@ -15,8 +15,8 @@ /obj/item/weapon/circuitboard/clonescanner name = T_BOARD("cloning scanner") - build_path = "/obj/machinery/dna_scannernew" - board_type = "machine" + build_path = /obj/machinery/dna_scannernew + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 2, TECH_BIO = 2) req_components = list( /obj/item/weapon/stock_parts/scanning_module = 1, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/jukebox.dm b/code/game/objects/items/weapons/circuitboards/machinery/jukebox.dm index 4b6296c886..ab3ae6f384 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/jukebox.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/jukebox.dm @@ -4,8 +4,8 @@ /obj/item/weapon/circuitboard/jukebox name = T_BOARD("jukebox") - build_path = "/obj/machinery/media/jukebox" - board_type = "machine" + build_path = /obj/machinery/media/jukebox + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_MAGNET = 2, TECH_DATA = 1) req_components = list( /obj/item/weapon/stock_parts/capacitor = 1, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/mech_recharger.dm b/code/game/objects/items/weapons/circuitboards/machinery/mech_recharger.dm index 4515bfd74b..01d5f0933c 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/mech_recharger.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/mech_recharger.dm @@ -4,8 +4,8 @@ /obj/item/weapon/circuitboard/mech_recharger name = T_BOARD("mech recharger") - build_path = "/obj/machinery/mech_recharger" - board_type = "machine" + build_path = /obj/machinery/mech_recharger + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 2, TECH_POWER = 2, TECH_ENGINEERING = 2) req_components = list( /obj/item/weapon/stock_parts/capacitor = 2, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm b/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm index 653d20d666..82217a1b8f 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm @@ -4,8 +4,8 @@ /obj/item/weapon/circuitboard/miningdrill name = T_BOARD("mining drill head") - build_path = "/obj/machinery/mining/drill" - board_type = "machine" + build_path = /obj/machinery/mining/drill + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1) req_components = list( /obj/item/weapon/stock_parts/capacitor = 1, @@ -15,7 +15,7 @@ /obj/item/weapon/circuitboard/miningdrillbrace name = T_BOARD("mining drill brace") - build_path = "/obj/machinery/mining/brace" - board_type = "machine" + build_path = /obj/machinery/mining/brace + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1) req_components = list() diff --git a/code/game/objects/items/weapons/circuitboards/machinery/pacman.dm b/code/game/objects/items/weapons/circuitboards/machinery/pacman.dm index a5cd69b0f4..218ffd924a 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/pacman.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/pacman.dm @@ -4,8 +4,8 @@ /obj/item/weapon/circuitboard/pacman name = T_BOARD("PACMAN-type generator") - build_path = "/obj/machinery/power/port_gen/pacman" - board_type = "machine" + build_path = /obj/machinery/power/port_gen/pacman + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3, TECH_POWER = 3, TECH_PHORON = 3, TECH_ENGINEERING = 3) req_components = list( /obj/item/weapon/stock_parts/matter_bin = 1, @@ -15,10 +15,10 @@ /obj/item/weapon/circuitboard/pacman/super name = T_BOARD("SUPERPACMAN-type generator") - build_path = "/obj/machinery/power/port_gen/pacman/super" + build_path = /obj/machinery/power/port_gen/pacman/super origin_tech = list(TECH_DATA = 3, TECH_POWER = 4, TECH_ENGINEERING = 4) /obj/item/weapon/circuitboard/pacman/mrs name = T_BOARD("MRSPACMAN-type generator") - build_path = "/obj/machinery/power/port_gen/pacman/mrs" + build_path = /obj/machinery/power/port_gen/pacman/mrs origin_tech = list(TECH_DATA = 3, TECH_POWER = 5, TECH_ENGINEERING = 5) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/power.dm b/code/game/objects/items/weapons/circuitboards/machinery/power.dm index 5c8975a207..6e5667ebe5 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/power.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/power.dm @@ -4,21 +4,21 @@ /obj/item/weapon/circuitboard/smes name = T_BOARD("superconductive magnetic energy storage") - build_path = "/obj/machinery/power/smes/buildable" - board_type = "machine" + build_path = /obj/machinery/power/smes/buildable + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_POWER = 6, TECH_ENGINEERING = 4) req_components = list(/obj/item/weapon/smes_coil = 1, /obj/item/stack/cable_coil = 30) /obj/item/weapon/circuitboard/batteryrack name = T_BOARD("battery rack PSU") - build_path = "/obj/machinery/power/smes/batteryrack" - board_type = "machine" + build_path = /obj/machinery/power/smes/batteryrack + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 2) req_components = list(/obj/item/weapon/cell = 3) /obj/item/weapon/circuitboard/ghettosmes name = T_BOARD("makeshift PSU") desc = "An APC circuit repurposed into some power storage device controller" - build_path = "/obj/machinery/power/smes/batteryrack/makeshift" - board_type = "machine" + build_path = /obj/machinery/power/smes/batteryrack/makeshift + board_type = new /datum/frame/frame_types/machine req_components = list(/obj/item/weapon/cell = 3) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm b/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm index a3684cd894..f45549bab6 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm @@ -4,8 +4,8 @@ /obj/item/weapon/circuitboard/recharge_station name = T_BOARD("cyborg recharging station") - build_path = "/obj/machinery/recharge_station" - board_type = "machine" + build_path = /obj/machinery/recharge_station + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3) req_components = list( /obj/item/stack/cable_coil = 5, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/research.dm b/code/game/objects/items/weapons/circuitboards/machinery/research.dm index c871bd3dc5..1e4fe2afd9 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/research.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/research.dm @@ -4,17 +4,30 @@ obj/item/weapon/circuitboard/rdserver name = T_BOARD("R&D server") - build_path = "/obj/machinery/r_n_d/server" - board_type = "machine" + build_path = /obj/machinery/r_n_d/server/core + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3) req_components = list( /obj/item/stack/cable_coil = 2, /obj/item/weapon/stock_parts/scanning_module = 1) +obj/item/weapon/circuitboard/rdserver/attackby(obj/item/I as obj, mob/user as mob) + if(istype(I,/obj/item/weapon/screwdriver)) + user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") + if(build_path == /obj/machinery/r_n_d/server/core) + name = T_BOARD("RD Console - Robotics") + build_path = /obj/machinery/r_n_d/server/robotics + user << "Access protocols set to robotics." + else + name = T_BOARD("RD Console") + build_path = /obj/machinery/r_n_d/server/core + user << "Access protocols set to default." + return + /obj/item/weapon/circuitboard/destructive_analyzer name = T_BOARD("destructive analyzer") - build_path = "/obj/machinery/r_n_d/destructive_analyzer" - board_type = "machine" + build_path = /obj/machinery/r_n_d/destructive_analyzer + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( /obj/item/weapon/stock_parts/scanning_module = 1, @@ -23,8 +36,8 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/autolathe name = T_BOARD("autolathe") - build_path = "/obj/machinery/autolathe" - board_type = "machine" + build_path = /obj/machinery/autolathe + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( /obj/item/weapon/stock_parts/matter_bin = 3, @@ -33,8 +46,8 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/protolathe name = T_BOARD("protolathe") - build_path = "/obj/machinery/r_n_d/protolathe" - board_type = "machine" + build_path = /obj/machinery/r_n_d/protolathe + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( /obj/item/weapon/stock_parts/matter_bin = 2, @@ -43,8 +56,8 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/circuit_imprinter name = T_BOARD("circuit imprinter") - build_path = "/obj/machinery/r_n_d/circuit_imprinter" - board_type = "machine" + build_path = /obj/machinery/r_n_d/circuit_imprinter + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( /obj/item/weapon/stock_parts/matter_bin = 1, @@ -53,8 +66,8 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/mechfab name = "Circuit board (Exosuit Fabricator)" - build_path = "/obj/machinery/mecha_part_fabricator" - board_type = "machine" + build_path = /obj/machinery/mecha_part_fabricator + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3) req_components = list( /obj/item/weapon/stock_parts/matter_bin = 2, @@ -64,8 +77,8 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/prosthetics name = "Circuit board (Prosthetics Fabricator)" - build_path = "/obj/machinery/pros_fabricator" - board_type = "machine" + build_path = /obj/machinery/pros_fabricator + board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3) req_components = list( /obj/item/weapon/stock_parts/matter_bin = 2, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm b/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm index 7218b7f094..1d806a2710 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm @@ -4,8 +4,8 @@ /obj/item/weapon/circuitboard/shield_gen_ex name = T_BOARD("hull shield generator") - board_type = "machine" - build_path = "/obj/machinery/shield_gen/external" + board_type = new /datum/frame/frame_types/machine + build_path = /obj/machinery/shield_gen/external origin_tech = list(TECH_BLUESPACE = 4, TECH_PHORON = 3) req_components = list( /obj/item/weapon/stock_parts/manipulator/pico = 2, @@ -17,8 +17,8 @@ /obj/item/weapon/circuitboard/shield_gen name = T_BOARD("bubble shield generator") - board_type = "machine" - build_path = "/obj/machinery/shield_gen" + board_type = new /datum/frame/frame_types/machine + build_path = /obj/machinery/shield_gen origin_tech = list(TECH_BLUESPACE = 4, TECH_PHORON = 3) req_components = list( /obj/item/weapon/stock_parts/manipulator/pico = 2, @@ -30,8 +30,8 @@ /obj/item/weapon/circuitboard/shield_cap name = T_BOARD("shield capacitor") - board_type = "machine" - build_path = "/obj/machinery/shield_capacitor" + board_type = new /datum/frame/frame_types/machine + build_path = /obj/machinery/shield_capacitor origin_tech = list(TECH_MAGNET = 3, TECH_POWER = 4) req_components = list( /obj/item/weapon/stock_parts/manipulator/pico = 2, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm b/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm index 8a7516f476..835971b012 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm @@ -3,11 +3,11 @@ #endif /obj/item/weapon/circuitboard/telecomms - board_type = "machine" + board_type = new /datum/frame/frame_types/machine /obj/item/weapon/circuitboard/telecomms/receiver name = T_BOARD("subspace receiver") - build_path = "/obj/machinery/telecomms/receiver" + build_path = /obj/machinery/telecomms/receiver origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 3, TECH_BLUESPACE = 2) req_components = list( /obj/item/weapon/stock_parts/subspace/ansible = 1, @@ -17,7 +17,7 @@ /obj/item/weapon/circuitboard/telecomms/hub name = T_BOARD("hub mainframe") - build_path = "/obj/machinery/telecomms/hub" + build_path = /obj/machinery/telecomms/hub origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4) req_components = list( /obj/item/weapon/stock_parts/manipulator = 2, @@ -26,7 +26,7 @@ /obj/item/weapon/circuitboard/telecomms/relay name = T_BOARD("relay mainframe") - build_path = "/obj/machinery/telecomms/relay" + build_path = /obj/machinery/telecomms/relay origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 4, TECH_BLUESPACE = 3) req_components = list( /obj/item/weapon/stock_parts/manipulator = 2, @@ -35,7 +35,7 @@ /obj/item/weapon/circuitboard/telecomms/bus name = T_BOARD("bus mainframe") - build_path = "/obj/machinery/telecomms/bus" + build_path = /obj/machinery/telecomms/bus origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4) req_components = list( /obj/item/weapon/stock_parts/manipulator = 2, @@ -44,7 +44,7 @@ /obj/item/weapon/circuitboard/telecomms/processor name = T_BOARD("processor unit") - build_path = "/obj/machinery/telecomms/processor" + build_path = /obj/machinery/telecomms/processor origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4) req_components = list( /obj/item/weapon/stock_parts/manipulator = 3, @@ -56,7 +56,7 @@ /obj/item/weapon/circuitboard/telecomms/server name = T_BOARD("telecommunication server") - build_path = "/obj/machinery/telecomms/server" + build_path = /obj/machinery/telecomms/server origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4) req_components = list( /obj/item/weapon/stock_parts/manipulator = 2, @@ -65,7 +65,7 @@ /obj/item/weapon/circuitboard/telecomms/broadcaster name = T_BOARD("subspace broadcaster") - build_path = "/obj/machinery/telecomms/broadcaster" + build_path = /obj/machinery/telecomms/broadcaster origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4, TECH_BLUESPACE = 2) req_components = list( /obj/item/weapon/stock_parts/manipulator = 2, @@ -77,7 +77,7 @@ //This isn't a real telecomms board but I don't want to make a whole file to hold only one circuitboard. /obj/item/weapon/circuitboard/telecomms/exonet_node name = T_BOARD("exonet node") - build_path = "/obj/machinery/exonet_node" + build_path = /obj/machinery/exonet_node origin_tech = list(TECH_DATA = 5, TECH_ENGINEERING = 5, TECH_BLUESPACE = 4) req_components = list( /obj/item/weapon/stock_parts/subspace/ansible = 1, @@ -90,11 +90,11 @@ /obj/item/weapon/circuitboard/telecomms/pda_multicaster name = T_BOARD("pda multicaster") - build_path = "/obj/machinery/pda_multicaster" + build_path = /obj/machinery/pda_multicaster origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 2, TECH_BLUESPACE = 2) req_components = list( /obj/item/weapon/stock_parts/subspace/ansible = 1, /obj/item/weapon/stock_parts/subspace/filter = 1, /obj/item/weapon/stock_parts/manipulator = 1, /obj/item/weapon/stock_parts/subspace/treatment = 1, - /obj/item/stack/cable_coil = 2) + /obj/item/stack/cable_coil = 2) \ No newline at end of file diff --git a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm index 38438d6327..07e9ae53dd 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm @@ -3,7 +3,7 @@ #endif /obj/item/weapon/circuitboard/unary_atmos - board_type = "machine" + board_type = new /datum/frame/frame_types/machine /obj/item/weapon/circuitboard/unary_atmos/construct(var/obj/machinery/atmospherics/unary/U) //TODO: Move this stuff into the relevant constructor when pipe/construction.dm is cleaned up. @@ -15,7 +15,7 @@ /obj/item/weapon/circuitboard/unary_atmos/heater name = T_BOARD("gas heating system") - build_path = "/obj/machinery/atmospherics/unary/heater" + build_path = /obj/machinery/atmospherics/unary/heater origin_tech = list(TECH_POWER = 2, TECH_ENGINEERING = 1) req_components = list( /obj/item/stack/cable_coil = 5, @@ -24,7 +24,7 @@ /obj/item/weapon/circuitboard/unary_atmos/cooler name = T_BOARD("gas cooling system") - build_path = "/obj/machinery/atmospherics/unary/freezer" + build_path = /obj/machinery/atmospherics/unary/freezer origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) req_components = list( /obj/item/stack/cable_coil = 2, diff --git a/code/game/objects/items/weapons/circuitboards/mecha.dm b/code/game/objects/items/weapons/circuitboards/mecha.dm index 0ce851e3a3..ac4d83d98c 100644 --- a/code/game/objects/items/weapons/circuitboards/mecha.dm +++ b/code/game/objects/items/weapons/circuitboards/mecha.dm @@ -10,7 +10,6 @@ item_state = "electronic" board_type = "other" - /obj/item/weapon/circuitboard/mecha/ripley origin_tech = list(TECH_DATA = 3) @@ -22,7 +21,6 @@ name = T_BOARD_MECHA("Ripley central control") icon_state = "mainboard" - /obj/item/weapon/circuitboard/mecha/gygax origin_tech = list(TECH_DATA = 4) @@ -39,7 +37,6 @@ name = T_BOARD_MECHA("Gygax central control") icon_state = "mainboard" - /obj/item/weapon/circuitboard/mecha/durand origin_tech = list(TECH_DATA = 4) @@ -56,7 +53,6 @@ name = T_BOARD_MECHA("Durand central control") icon_state = "mainboard" - /obj/item/weapon/circuitboard/mecha/honker origin_tech = list(TECH_DATA = 4) diff --git a/code/modules/detectivework/microscope/dnascanner.dm b/code/modules/detectivework/microscope/dnascanner.dm index 9fc49b1bf7..3d442dfb4a 100644 --- a/code/modules/detectivework/microscope/dnascanner.dm +++ b/code/modules/detectivework/microscope/dnascanner.dm @@ -17,7 +17,6 @@ var/report_num = 0 /obj/machinery/dnaforensics/New() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/console_screen(src) component_parts += new /obj/item/weapon/stock_parts/micro_laser(src) diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index bc0388d40d..ca0db0595a 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -80,24 +80,7 @@ log transactions return 1 /obj/machinery/atm/attackby(obj/item/I as obj, mob/user as mob) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - user << "You start disconnecting the monitor." - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "atm" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) - user << "You disconnect the monitor." - A.state = 4 - A.icon_state = "atm_4" - M.deconstruct(src) - qdel(src) + if(computer_deconstruction_screwdriver(user, I)) return if(istype(I, /obj/item/weapon/card)) if(emagged > 0) diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index eeb7546211..7c964b9d4b 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -42,7 +42,6 @@ /obj/machinery/mining/drill/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 57691fed9b..a8e0c6eacb 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -30,7 +30,6 @@ if(istype(I, /obj/item/weapon/paper) || istype(I, /obj/item/weapon/folder) || istype(I, /obj/item/weapon/photo) || istype(I, /obj/item/weapon/paper_bundle)) I.loc = src - /obj/structure/filingcabinet/attackby(obj/item/P as obj, mob/user as mob) if(istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/folder) || istype(P, /obj/item/weapon/photo) || istype(P, /obj/item/weapon/paper_bundle)) user << "You put [P] in [src]." @@ -57,7 +56,6 @@ else user << "You can't put [P] in [src]!" - /obj/structure/filingcabinet/attack_hand(mob/user as mob) if(contents.len <= 0) user << "\The [src] is empty." @@ -103,7 +101,6 @@ sleep(5) icon_state = initial(icon_state) - /* * Security Record Cabinets */ diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index ec0d7acf19..c8942f0093 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -16,7 +16,6 @@ var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier! /obj/machinery/photocopier/New() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/motor(src) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 6296a8b951..8a5c8cc7b4 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -38,7 +38,6 @@ operating = 1 setmove() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/gear(src) component_parts += new /obj/item/weapon/stock_parts/motor(src) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index e444bcb8c1..6831034edf 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -24,7 +24,6 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid). /obj/machinery/r_n_d/circuit_imprinter/New() ..() - circuit = new circuit() component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 686a273023..3fbb141f7e 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -18,7 +18,6 @@ Note: Must be placed within 3 tiles of the R&D Console /obj/machinery/r_n_d/destructive_analyzer/New() ..() - circuit = new circuit() component_parts = list() component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 46b688929d..d5237e5a81 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -19,7 +19,6 @@ /obj/machinery/r_n_d/protolathe/New() ..() - circuit = new circuit() component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index bf4cab0697..abcfdd0fa0 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -17,7 +17,6 @@ /obj/machinery/r_n_d/server/New() ..() - circuit = new circuit() component_parts = list() component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/stack/cable_coil(src) diff --git a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm index ed23b965df..27b4801ae1 100644 --- a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm +++ b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm @@ -1,4 +1,3 @@ - /obj/machinery/radiocarbon_spectrometer name = "radiocarbon spectrometer" desc = "A specialised, complex scanner for gleaning information on all manner of small things." @@ -76,19 +75,20 @@ scanner_seal_integrity = round(scanner_seal_integrity + amount_used * 10) return if(istype(I, /obj/item/weapon/reagent_containers/glass)) + var/obj/item/weapon/reagent_containers/glass/G = I + if(!G.is_open_container()) + return var/choice = alert("What do you want to do with the container?","Radiometric Scanner","Add coolant","Empty coolant","Scan container") if(choice == "Add coolant") - var/obj/item/weapon/reagent_containers/glass/G = I var/amount_transferred = min(src.reagents.maximum_volume - src.reagents.total_volume, G.reagents.total_volume) - G.reagents.trans_to(src, amount_transferred) - user << "You empty [amount_transferred]u of coolant into [src]." + var/trans = G.reagents.trans_to_obj(src, amount_transferred) + user << "You empty [trans ? trans : 0]u of coolant into [src]." update_coolant() return else if(choice == "Empty coolant") - var/obj/item/weapon/reagent_containers/glass/G = I var/amount_transferred = min(G.reagents.maximum_volume - G.reagents.total_volume, src.reagents.total_volume) - src.reagents.trans_to(G, amount_transferred) - user << "You remove [amount_transferred]u of coolant from [src]." + var/trans = src.reagents.trans_to(G, amount_transferred) + user << "You remove [trans ? trans : 0]u of coolant from [src]." update_coolant() return if(scanned_item) @@ -148,15 +148,15 @@ data["radiation"] = round(radiation) data["t_left_radspike"] = round(t_left_radspike) data["rad_shield_on"] = rad_shield - + // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) // the ui does not exist, so we'll create a new() one // for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm ui = new(user, src, ui_key, "geoscanner.tmpl", "High Res Radiocarbon Spectrometer", 900, 825) // when the ui is first opened this is the data it will use - ui.set_initial_data(data) + ui.set_initial_data(data) // open the new ui window ui.open() // auto update every Master Controller tick @@ -361,4 +361,4 @@ scanned_item = null add_fingerprint(usr) - return 1 // update UIs attached to this object + return 1 // update UIs attached to this object \ No newline at end of file diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index b4301cf557..7c9fea54da 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -42,22 +42,25 @@ broadcast_request() //This is the device making the initial event request. It needs to broadcast to other devices if(istype(W, /obj/item/weapon/screwdriver)) - user << "You remove the faceplate from the [src]" - var/obj/structure/frame/A = new /obj/structure/frame( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.frame_type = "keycard" - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.set_dir(dir) - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.forceMove(loc) - A.state = 3 - A.icon_state = "keycard_3" - M.deconstruct(src) - qdel(src) - return + user << "You begin removing the faceplate from the [src]" + if(do_after(user, 10)) + user << "You remove the faceplate from the [src]" + var/obj/structure/frame/A = new /obj/structure/frame(loc) + var/obj/item/weapon/circuitboard/M = new circuit(A) + A.frame_type = M.board_type + A.need_circuit = 0 + A.pixel_x = pixel_x + A.pixel_y = pixel_y + A.set_dir(dir) + A.circuit = M + A.anchored = 1 + for (var/obj/C in src) + C.forceMove(loc) + A.state = 3 + A.update_icon() + M.deconstruct(src) + qdel(src) + return /obj/machinery/keycard_auth/power_change() ..() @@ -195,4 +198,4 @@ var/global/maint_all_access = 0 /obj/machinery/door/airlock/allowed(mob/M) if(maint_all_access && src.check_access_list(list(access_maint_tunnels))) return 1 - return ..(M) + return ..(M) \ No newline at end of file diff --git a/code/modules/xenobio2/machinery/core_extractor.dm b/code/modules/xenobio2/machinery/core_extractor.dm index b50e42acd6..e772558fcc 100644 --- a/code/modules/xenobio2/machinery/core_extractor.dm +++ b/code/modules/xenobio2/machinery/core_extractor.dm @@ -16,12 +16,11 @@ var/occupiedcolor = "#22FF22" var/emptycolor = "#FF2222" var/operatingcolor = "#FFFF22" - - + + /obj/machinery/slime/extractor/New() ..() update_light_color() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) @@ -29,14 +28,14 @@ component_parts += new /obj/item/weapon/stock_parts/micro_laser(src) component_parts += new /obj/item/weapon/stock_parts/micro_laser(src) RefreshParts() - + /obj/machinery/slime/extractor/attackby(var/obj/item/W, var/mob/user) //Let's try to deconstruct first. if(istype(W, /obj/item/weapon/screwdriver) && !inuse) default_deconstruction_screwdriver(user, W) return - + if(istype(W, /obj/item/weapon/crowbar)) default_deconstruction_crowbar(user, W) return @@ -45,7 +44,7 @@ user << "Close the panel first!" var/obj/item/weapon/grab/G = W - + if(!istype(G)) return ..() @@ -54,12 +53,12 @@ return move_into_extractor(user,G.affecting) - + /obj/machinery/slime/extractor/MouseDrop_T(mob/target, mob/user) if(user.stat || user.restrained()) return move_into_extractor(user,target) - + /obj/machinery/slime/extractor/proc/move_into_extractor(var/mob/user,var/mob/living/victim) if(src.occupant) @@ -73,12 +72,12 @@ if(!(istype(victim, /mob/living/simple_animal/xeno/slime)) ) user << "This is not a suitable subject for the core extractor!" return - + var/mob/living/simple_animal/xeno/slime/S = victim if(S.is_child) user << "This subject is not developed enough for the core extractor!" return - + user.visible_message("[user] starts to put [victim] into the core extractor!") src.add_fingerprint(user) if(do_after(user, 30) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant) @@ -89,7 +88,7 @@ victim.forceMove(src) src.occupant = victim update_light_color() - + /obj/machinery/slime/extractor/proc/update_light_color() if(src.occupant && !(inuse)) set_light(2, 2, occupiedcolor) @@ -97,13 +96,13 @@ set_light(2, 2, operatingcolor) else set_light(2, 2, emptycolor) - + /obj/machinery/slime/extractor/proc/extract_cores() if(!src.occupant) src.visible_message("\icon[src] [src] pings unhappily.") else if(inuse) return - + inuse = 1 update_light_color() spawn(30) @@ -112,17 +111,17 @@ var/obj/item/xenoproduct/slime/core/C = new(src) C.traits = new() occupant.traitdat.copy_traits(C.traits) - + C.nameVar = occupant.nameVar - + C.create_reagents(C.traits.traits[TRAIT_XENO_CHEMVOL]) for(var/reagent in occupant.traitdat.chems) C.reagents.add_reagent(reagent, occupant.traitdat.chems[reagent]) - + C.color = C.traits.traits[TRAIT_XENO_COLOR] if(occupant.traitdat.get_trait(TRAIT_XENO_BIOLUMESCENT)) C.set_light(occupant.traitdat.get_trait(TRAIT_XENO_GLOW_STRENGTH),occupant.traitdat.get_trait(TRAIT_XENO_GLOW_RANGE), occupant.traitdat.get_trait(TRAIT_XENO_BIO_COLOR)) - + spawn(30) icon_state = "scanner_0old" qdel(occupant) @@ -131,20 +130,20 @@ eject_contents() update_light_color() src.updateUsrDialog() - -/obj/machinery/slime/extractor/proc/eject_slime() + +/obj/machinery/slime/extractor/proc/eject_slime() if(occupant) occupant.forceMove(loc) occupant = null - + /obj/machinery/slime/extractor/proc/eject_core() for(var/obj/thing in (contents - component_parts - circuit)) thing.forceMove(loc) - + /obj/machinery/slime/extractor/proc/eject_contents() eject_core() eject_slime() - + //Here lies the UI /obj/machinery/slime/extractor/attack_hand(mob/user as mob) user.set_machine(src) @@ -192,4 +191,3 @@ /obj/item/weapon/stock_parts/matter_bin = 1, /obj/item/weapon/stock_parts/micro_laser = 2 ) - \ No newline at end of file diff --git a/code/modules/xenobio2/machinery/gene_manipulators.dm b/code/modules/xenobio2/machinery/gene_manipulators.dm index c8bd8d374c..8cf7b45a1f 100644 --- a/code/modules/xenobio2/machinery/gene_manipulators.dm +++ b/code/modules/xenobio2/machinery/gene_manipulators.dm @@ -1,12 +1,12 @@ /* This file contains: - + Xenobiological disk: Holds traits that can be taken from cores and transplanted into slimes. - + Biological Product Destructive Analyzer: Takes certain traits in gene grouping from a core and places them into a disk. - + Biological genetic bombarder: Takes traits from a disk and replaces/adds to the genes in a xenobiological creature. */ @@ -16,10 +16,10 @@ icon = 'icons/obj/hydroponics_machines.dmi' icon_state = "disk" w_class = 1.0 - + var/list/genes = list() var/genesource = "unknown" - + /obj/item/weapon/disk/xenobio/attack_self(var/mob/user as mob) if(genes.len) var/choice = alert(user, "Are you sure you want to wipe the disk?", "Xenobiological Data", "No", "Yes") @@ -29,7 +29,7 @@ desc = initial(name) genes = list() genesource = "unknown" - + /obj/item/weapon/storage/box/xenobiodisk name = "biological disk box" desc = "A box of biological data disks, apparently." @@ -53,13 +53,13 @@ var/eject_disk = 0 var/failed_task = 0 var/disk_needs_genes = 0 - + /obj/machinery/xenobio/attack_ai(mob/user as mob) return attack_hand(user) /obj/machinery/xenobio/attack_hand(mob/user as mob) ui_interact(user) - + /obj/machinery/xenobio/attackby(obj/item/weapon/W as obj, mob/user as mob) if(default_deconstruction_screwdriver(user, W)) return @@ -96,7 +96,7 @@ if(world.time > last_action + action_time) finished_task() - + /obj/machinery/xenobio/proc/finished_task() active = 0 in_use = 0 @@ -112,7 +112,7 @@ loaded_disk.forceMove(get_turf(src)) visible_message("\icon[src] [src] beeps and spits out [loaded_disk].") loaded_disk = null - + /obj/machinery/xenobio/extractor name = "biological product destructive analyzer" icon = 'icons/obj/hydroponics_machines.dmi' @@ -122,10 +122,9 @@ var/obj/item/xenoproduct/product var/datum/xeno/traits/genetics // Currently scanned xeno genetic structure. var/degradation = 0 // Increments with each scan, stops allowing gene mods after a certain point. - + /obj/machinery/xenobio/extractor/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) @@ -134,7 +133,7 @@ component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) RefreshParts() - + /obj/machinery/xenobio/extractor/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/xenoproduct)) if(product) @@ -187,7 +186,7 @@ ui.set_initial_data(data) ui.open() ui.set_auto_update(1) - + /obj/machinery/xenobio/proc/eject_disk() if(!loaded_disk) return loaded_disk.forceMove(loc) @@ -201,7 +200,7 @@ if(href_list["eject_product"]) if(!product) return - + product.forceMove(get_turf(src)) visible_message("\icon[src] [src] beeps and spits out [product].") product = null @@ -253,22 +252,21 @@ usr.set_machine(src) src.add_fingerprint(usr) - + src.updateUsrDialog() return - + /obj/machinery/xenobio/editor name = "biological genetic bombarder" icon = 'icons/obj/cryogenics.dmi' icon_state = "cellold0" disk_needs_genes = 1 circuit = /obj/item/weapon/circuitboard/biobombarder - + var/mob/living/simple_animal/xeno/slime/occupant - + /obj/machinery/xenobio/editor/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) @@ -277,7 +275,7 @@ component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) RefreshParts() - + /obj/machinery/xenobio/editor/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/weapon/grab)) var/obj/item/weapon/grab/G = W @@ -358,21 +356,21 @@ occupant.traitdat.apply_gene(gene) occupant.stability += rand(5,10) occupant.ProcessTraits() - + if(href_list["eject_disk"]) eject_disk() - + if(href_list["eject_xeno"]) eject_xeno() - + usr.set_machine(src) src.add_fingerprint(usr) - + /obj/machinery/xenobio/editor/MouseDrop_T(mob/target, mob/user) if(user.stat || user.restrained()) return move_into_editor(user,target) - + /obj/machinery/xenobio/editor/proc/move_into_editor(var/mob/user,var/mob/living/victim) if(src.occupant) @@ -396,16 +394,16 @@ victim.client.eye = src victim.forceMove(src) occupant = victim - + /obj/machinery/xenobio/editor/proc/eject_contents() eject_disk() eject_xeno() - + /obj/machinery/xenobio/editor/proc/eject_xeno() if(occupant) occupant.forceMove(loc) occupant = null - + /obj/item/weapon/circuitboard/bioproddestanalyzer name = T_BOARD("biological product destructive analyzer") build_path = "/obj/machinery/xenobio/extractor" @@ -416,7 +414,7 @@ /obj/item/weapon/stock_parts/matter_bin = 1, /obj/item/weapon/stock_parts/scanning_module = 3 ) - + /obj/item/weapon/circuitboard/biobombarder name = T_BOARD("biological genetic bombarder") build_path = "/obj/machinery/xenobio/editor" @@ -427,4 +425,3 @@ /obj/item/weapon/stock_parts/matter_bin = 2, /obj/item/weapon/stock_parts/scanning_module = 2 ) - \ No newline at end of file diff --git a/code/modules/xenobio2/machinery/injector.dm b/code/modules/xenobio2/machinery/injector.dm index 7b482d5c1d..dc9bad89f1 100644 --- a/code/modules/xenobio2/machinery/injector.dm +++ b/code/modules/xenobio2/machinery/injector.dm @@ -25,7 +25,6 @@ reagents = R R.my_atom = src beaker = new /obj/item/weapon/reagent_containers/glass/beaker(src) - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) @@ -75,7 +74,7 @@ if(occupant) occupant.forceMove(loc) occupant = null - + /obj/machinery/xenobio2/manualinjector/proc/eject_beaker() if(beaker) var/obj/item/weapon/reagent_containers/glass/beaker/B = beaker @@ -140,7 +139,7 @@ /obj/item/weapon/circuitboard/xenobioinjectormachine name = T_BOARD("biological injector") - build_path = "/obj/machinery/xenobio2/manualinjector" - board_type = "machine" + build_path = /obj/machinery/xenobio2/manualinjector + board_type = /datum/frame/frame_types/machine origin_tech = list() //To be filled, req_components = list() //To be filled, \ No newline at end of file diff --git a/code/modules/xenobio2/machinery/injector_computer.dm b/code/modules/xenobio2/machinery/injector_computer.dm index 7bcccd55ca..12887506c2 100644 --- a/code/modules/xenobio2/machinery/injector_computer.dm +++ b/code/modules/xenobio2/machinery/injector_computer.dm @@ -61,7 +61,7 @@ if(isxeno(injector.occupant)) var/mob/living/simple_animal/xeno/X = injector.occupant data["compatible"] = 1 - data["instability"] = 100 * (X.mut_level / X.mut_max) + data["instability"] = 100 * (X.mut_level / X.mut_max) else data["compatible"] = null @@ -109,6 +109,5 @@ /obj/item/weapon/circuitboard/xenobio2computer name = T_BOARD("injector control console") - build_path = "/obj/item/weapon/circuitboard/xenobio2computer" - board_type = "computer" + build_path = /obj/item/weapon/circuitboard/xenobio2computer origin_tech = list() //To be filled, diff --git a/code/modules/xenobio2/machinery/slime_replicator.dm b/code/modules/xenobio2/machinery/slime_replicator.dm index 9faa4272b4..077e330008 100644 --- a/code/modules/xenobio2/machinery/slime_replicator.dm +++ b/code/modules/xenobio2/machinery/slime_replicator.dm @@ -16,10 +16,9 @@ var/occupiedcolor = "#22FF22" var/emptycolor = "#FF2222" var/operatingcolor = "#FFFF22" - + /obj/machinery/slime/replicator/New() ..() - circuit = new circuit(src) component_parts = list() component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) @@ -27,23 +26,23 @@ component_parts += new /obj/item/weapon/stock_parts/micro_laser(src) RefreshParts() update_light_color() - - + + /obj/machinery/slime/replicator/attackby(var/obj/item/W, var/mob/user) //Let's try to deconstruct first. if(istype(W, /obj/item/weapon/screwdriver) && !inuse) default_deconstruction_screwdriver(user, W) return - + if(istype(W, /obj/item/weapon/crowbar)) default_deconstruction_crowbar(user, W) return var/obj/item/xenoproduct/slime/core/G = W - + if(!istype(G)) return ..() - + if(core) user << "[src] is already filled!" return @@ -53,7 +52,7 @@ user.drop_from_inventory(G) G.forceMove(src) update_light_color() - + /obj/machinery/slime/replicator/proc/update_light_color() if(src.core && !(inuse)) set_light(2, 2, occupiedcolor) @@ -61,13 +60,13 @@ set_light(2, 2, operatingcolor) else set_light(2, 2, emptycolor) - + /obj/machinery/slime/replicator/proc/replicate_slime() if(!src.core) src.visible_message("\icon[src] [src] pings unhappily.") else if(inuse) return - + inuse = 1 update_light_color() icon_state = "restruct_1" @@ -86,20 +85,20 @@ icon_state = "restruct_0" update_light_color() src.updateUsrDialog() - + /obj/machinery/slime/replicator/proc/eject_slime() for(var/mob/thing in contents) thing.forceMove(loc) -/obj/machinery/slime/replicator/proc/eject_core() +/obj/machinery/slime/replicator/proc/eject_core() if(core) core.forceMove(loc) core = null /obj/machinery/slime/replicator/proc/eject_contents() eject_slime() - eject_core() - + eject_core() + //Here lies the UI /obj/machinery/slime/replicator/attack_hand(mob/user as mob) user.set_machine(src) @@ -135,7 +134,7 @@ eject_core() src.updateUsrDialog() return - + //Circuit board below, /obj/item/weapon/circuitboard/slimereplicator name = T_BOARD("Slime replicator") @@ -148,4 +147,3 @@ /obj/item/weapon/stock_parts/micro_laser = 1 ) - \ No newline at end of file diff --git a/code/world.dm b/code/world.dm index 1d439428d2..68a066f27f 100644 --- a/code/world.dm +++ b/code/world.dm @@ -103,6 +103,8 @@ var/global/datum/global_init/init = new () for(var/turf/simulated/mineral/M in world) // Ugh. M.update_icon() + // Create frame types. + populate_frame_types() // Create robolimbs for chargen. populate_robolimb_list() diff --git a/icons/obj/stock_parts.dmi b/icons/obj/stock_parts.dmi index 294f1f82f745aa6514122055795ec6c4a88e5626..28ea28bde1d2eaaad494d4c99a42595cddd4e5fb 100644 GIT binary patch delta 995 zcmV<9104KUL?Ojl*zJ1G+#r~aywr?i?(dJM?zf%y>SEQN_DG9s#u?!f4+Tx`Pn@G zcv*Iwi;bb#HQPVGEEi{MYTN9Z&3d_L*&f^a{!gh?x!E6VWYH9qkLKifoc+377|U}WLM5|V`z zXPhkj`n$rv<_dH4@_x(F%eyT{9}D!XSmdX*#>mfVjgg;JJQt;-mDh7+$LQKOwj@Uv z;7sdD*-lT&o_bO~+}+#YOZMUJu`n%au+Y7V@f18-zFlV`QJmA%|~@wsR!Sf4b2 z<+=@ExpV`6SgzgxmJ3KW!}Ytfa{2D8T)jIh7mun3DnZo)C7|ko+*9>H(y4kN+s6}^ zsuGo=bPOdrq){Ca$=*gpveglh?0iHdC&GrxS;vQ3{w<&@99`q+Mnv1_Vj=@nswaVu z(3J$fX;)G%L{G}uPi?GG$7G>nZAi<`hP3Q%NXrg?4}{zY4uo6>4usqW4uo6=ywy3L zse`VaHx{^f-dN!3d1HZiBQ)Pg*@mOM|C!`xz4Ap(NXYr|3DBdL!H#KEHiG4ZGXKJeKF1Es$wf%fD|0zJuiL4L*+KsQz^=1+c6UEkd|BTAuR_zq=C5ESWRxMdj%Ch{2vs6hYyPRKDMwT zMKi;7ie`r66wM5`DH_0OIi=(-D)YZ5E_KFLwPQjk@9ha8FmxFgBE#5Gq1*^p+B;tV zVGS_At?W3(jEw>Yu$-^~EGKCI1B0AEw@EHCbsFNp=xK-p^QR#`8T;qv+t26b`Nzxh RKL_eUcmG&7OtZ`bw*Mmb@A?1$ delta 957 zcmV;u148_$hXjI$1dt?upL$eSbVOxyV{&P5bZKvH004NLotVjv<2De6&-POYGuKWq zUM9%Jm!JnhA7)-bD3N80Xf6s#OYJ;;4%(Q-s9!-}+`v~<{q=Jx@^kgux8L7>RIlIP z_C3dBg0C*s`R6bD-C%TXt4nn{?sqMlTbsv!Ql`w+rTUaqWcHtb_B(B2sxH-Gzq>|q zJpNuVMI9-VLlnuR$k#6DyXF68zwURMEj_ABb$FTn)^KN347DR~#4maBAlVrOk}A0F zo;lWEaP)wqM;txj=vhP^sn&P~RL!I;Y9?h(Gbu|N-M5rjo@lMPwe^;OyUmg6&0&sm z=2$mIUL~Y^@``nTy&)#uJC0id`X+n;M)pnk09@>w@BvuZH{k>DFWsBek>Z+sGR?Cc zpfvH(aU7`U`f6+j+*rThI%}@xS;%?aWsWcBm*dNM9V17k?AYg8oAfSza-g0q`&({n z@?;->0%=bAYZV_Ulf`A_NIp4}ky>cVq)mE%G8s<)*l7QM9r$E=$bnBLj2!r63dw;_ z_Bc84>;Db>WouvzPF`;@IC-_j;6j4N3P~QV)mk2_)mk1YIZm|-MxM`^Eu(W^o77o) z0DIa@%5r8>)-;py<~Eb^aeFn9$x?KsrnAHzHn7JH>`7)LIj$R%*~wiO4@ptNdZYrD zJu6_@wgQ%aohxA3JTejWZb4=17F2d_L1p78JHQ3X4k$lm2h^Ri0}4*r0hPYpIpvO0 z0yM0wtYl?nJu54#T3K0}@tLCvf3xRT0X^X85l2rV+6Egs(tryy37jVr2^>!oDc64{ zmyzH6evEKQiC?acUCgtkPq+FYslq=J-*T&zF3*{0PcwBL8vcl%aiiB#~WsB#}LM zB#{$iB<1cfQ)Bt~lhMEfWoFA=h}d