diff --git a/baystation12.dme b/baystation12.dme index 0826d38307..df06eb0416 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -164,7 +164,11 @@ #include "code\datums\spells\trigger.dm" #include "code\datums\spells\turf_teleport.dm" #include "code\datums\spells\wizard.dm" +#include "code\datums\wires\airlock.dm" +#include "code\datums\wires\alarm.dm" #include "code\datums\wires\apc.dm" +#include "code\datums\wires\camera.dm" +#include "code\datums\wires\robot.dm" #include "code\datums\wires\smartfridge.dm" #include "code\datums\wires\suit_storage_unit.dm" #include "code\datums\wires\vending.dm" @@ -312,6 +316,7 @@ #include "code\game\machinery\holosign.dm" #include "code\game\machinery\igniter.dm" #include "code\game\machinery\iv_drip.dm" +#include "code\game\machinery\jukebox.dm" #include "code\game\machinery\lightswitch.dm" #include "code\game\machinery\machinery.dm" #include "code\game\machinery\magnet.dm" @@ -320,6 +325,7 @@ #include "code\game\machinery\newscaster.dm" #include "code\game\machinery\OpTable.dm" #include "code\game\machinery\overview.dm" +#include "code\game\machinery\portable_tag_turret.dm" #include "code\game\machinery\portable_turret.dm" #include "code\game\machinery\recharger.dm" #include "code\game\machinery\rechargestation.dm" @@ -357,7 +363,6 @@ #include "code\game\machinery\camera\motion.dm" #include "code\game\machinery\camera\presets.dm" #include "code\game\machinery\camera\tracking.dm" -#include "code\game\machinery\camera\wires.dm" #include "code\game\machinery\computer\ai_core.dm" #include "code\game\machinery\computer\aifixer.dm" #include "code\game\machinery\computer\arcade.dm" @@ -393,6 +398,7 @@ #include "code\game\machinery\doors\checkForMultipleDoors.dm" #include "code\game\machinery\doors\door.dm" #include "code\game\machinery\doors\firedoor.dm" +#include "code\game\machinery\doors\firedoor_assembly.dm" #include "code\game\machinery\doors\multi_tile.dm" #include "code\game\machinery\doors\poddoor.dm" #include "code\game\machinery\doors\shutters.dm" @@ -684,7 +690,6 @@ #include "code\game\turfs\unsimulated\beach.dm" #include "code\game\turfs\unsimulated\floor.dm" #include "code\game\turfs\unsimulated\walls.dm" -#include "code\game\verbs\atom_verbs.dm" #include "code\game\verbs\ooc.dm" #include "code\game\verbs\suicide.dm" #include "code\game\verbs\who.dm" @@ -844,6 +849,7 @@ #include "code\modules\events\disease_outbreak.dm" #include "code\modules\events\electrical_storm.dm" #include "code\modules\events\event.dm" +#include "code\modules\events\event_container.dm" #include "code\modules\events\event_dynamic.dm" #include "code\modules\events\event_manager.dm" #include "code\modules\events\grid_check.dm" @@ -976,7 +982,6 @@ #include "code\modules\mob\living\carbon\human\examine.dm" #include "code\modules\mob\living\carbon\human\human.dm" #include "code\modules\mob\living\carbon\human\human_attackhand.dm" -#include "code\modules\mob\living\carbon\human\human_attackpaw.dm" #include "code\modules\mob\living\carbon\human\human_damage.dm" #include "code\modules\mob\living\carbon\human\human_defense.dm" #include "code\modules\mob\living\carbon\human\human_defines.dm" @@ -1060,7 +1065,6 @@ #include "code\modules\mob\living\silicon\robot\robot_items.dm" #include "code\modules\mob\living\silicon\robot\robot_modules.dm" #include "code\modules\mob\living\silicon\robot\robot_movement.dm" -#include "code\modules\mob\living\silicon\robot\wires.dm" #include "code\modules\mob\living\silicon\robot\drone\drone.dm" #include "code\modules\mob\living\silicon\robot\drone\drone_abilities.dm" #include "code\modules\mob\living\silicon\robot\drone\drone_console.dm" @@ -1128,7 +1132,7 @@ #include "code\modules\organs\wound.dm" #include "code\modules\paperwork\carbonpaper.dm" #include "code\modules\paperwork\clipboard.dm" -#include "code\modules\paperwork\faxmachine2.dm" +#include "code\modules\paperwork\faxmachine.dm" #include "code\modules\paperwork\filingcabinet.dm" #include "code\modules\paperwork\folders.dm" #include "code\modules\paperwork\handlabeler.dm" diff --git a/baystation12.int b/baystation12.int index b82874fded..28f433f0ff 100644 --- a/baystation12.int +++ b/baystation12.int @@ -3,4 +3,4 @@ MAP_ICON_TYPE: 0 AUTO_FILE_DIR: OFF */ -// END_INTERNALS +// END_INTERNALS \ No newline at end of file diff --git a/code/ATMOSPHERICS/_atmos_setup.dm b/code/ATMOSPHERICS/_atmos_setup.dm index 01a8eb003e..6f38eb6089 100644 --- a/code/ATMOSPHERICS/_atmos_setup.dm +++ b/code/ATMOSPHERICS/_atmos_setup.dm @@ -67,8 +67,8 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ return omni_icons[state] if("underlay") return underlays[state + dir + color] - //if("underlay_intact") - // return underlays_intact[state + dir + color] + // if("underlay_intact") + // return underlays_intact[state + dir + color] // if("underlay_exposed") // return underlays_exposed[state + dir + color] // if("underlay_down") @@ -194,6 +194,11 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ I.color = pipe_colors[pipe_color] underlays[state + "[D]" + "[pipe_colors[pipe_color]]"] = I +/* + Leaving the old icon manager code commented out for now, as we may want to rewrite the new code to cleanly + separate the newpipe icon caching (speshul supply and scrubber lines) from the rest of the pipe code. +*/ + /* /datum/pipe_icon_manager/proc/gen_underlay_icons() if(!underlays_intact) diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index c31f6f92b7..632803cd3b 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -27,6 +27,8 @@ active_power_usage = 7500 //This also doubles as a measure of how powerful the pump is, in Watts. 7500 W ~ 10 HP var/last_power_draw = 0 + connect_types = list(1,2,3) //connects to regular, supply and scrubbers pipes + var/on = 0 var/pump_direction = 1 //0 = siphoning, 1 = releasing @@ -62,7 +64,7 @@ return overlays.Cut() - + var/vent_icon = "vent" var/turf/T = get_turf(src) @@ -71,7 +73,7 @@ if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe)) vent_icon += "h" - + if(!powered()) vent_icon += "off" else @@ -88,8 +90,14 @@ if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe)) return else - add_underlay(T, node1, turn(dir, -180)) - add_underlay(T, node2, dir) + if (node1) + add_underlay(T, node1, turn(dir, -180), node1.icon_connect_type) + else + add_underlay(T, node1, turn(dir, -180)) + if (node2) + add_underlay(T, node2, dir, node2.icon_connect_type) + else + add_underlay(T, node2, dir) /obj/machinery/atmospherics/binary/dp_vent_pump/hide(var/i) update_icon() @@ -97,7 +105,7 @@ /obj/machinery/atmospherics/binary/dp_vent_pump/process() ..() - + if(stat & (NOPOWER|BROKEN) || !on) update_use_power(0) //usually we get here because a player turned a pump off - definitely want to update. last_power_draw = 0 @@ -107,19 +115,19 @@ var/datum/gas_mixture/environment = loc.return_air() var/power_draw = -1 - + //Figure out the target pressure difference var/pressure_delta = get_pressure_delta(environment) if(pressure_delta > 0.5) - if(pump_direction) //internal -> external + if(pump_direction) //internal -> external if (node1 && (environment.temperature || air1.temperature)) var/output_volume = environment.volume * environment.group_multiplier var/air_temperature = environment.temperature? environment.temperature : air1.temperature var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION) - + power_draw = pump_gas(src, air1, environment, transfer_moles, active_power_usage) - + if(power_draw >= 0 && network1) network1.update = 1 else //external -> internal @@ -127,15 +135,15 @@ var/output_volume = air2.volume + (network2? network2.volume : 0) var/air_temperature = air2.temperature? air2.temperature : environment.temperature var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION) - + //limit flow rate from turfs transfer_moles = min(transfer_moles, environment.total_moles*air2.volume/environment.volume) //group_multiplier gets divided out here - + power_draw = pump_gas(src, environment, air2, transfer_moles, active_power_usage) - + if(power_draw >= 0 && network2) network2.update = 1 - + if (power_draw < 0) last_power_draw = 0 last_flow_rate = 0 @@ -149,7 +157,7 @@ /obj/machinery/atmospherics/binary/dp_vent_pump/proc/get_pressure_delta(datum/gas_mixture/environment) var/pressure_delta = DEFAULT_PRESSURE_DELTA var/environment_pressure = environment.return_pressure() - + if(pump_direction) //internal -> external if(pressure_checks & PRESSURE_CHECK_EXTERNAL) pressure_delta = min(pressure_delta, external_pressure_bound - environment_pressure) //increasing the pressure here @@ -160,9 +168,9 @@ pressure_delta = min(pressure_delta, environment_pressure - external_pressure_bound) //decreasing the pressure here if(pressure_checks & PRESSURE_CHECK_OUTPUT) pressure_delta = min(pressure_delta, output_pressure_max - air2.return_pressure()) //increasing the pressure here - + return pressure_delta - + //Radio remote control @@ -200,12 +208,10 @@ if(frequency) set_frequency(frequency) -/obj/machinery/atmospherics/binary/dp_vent_pump/examine() - set src in oview(1) - ..() - - if (get_dist(usr, src) <= 1) - usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W" +/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user) + if(..(user, 1)) + user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W" + /obj/machinery/atmospherics/unary/vent_pump/power_change() var/old_stat = stat diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index 7a24bf2fbb..dda2e707a7 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -190,9 +190,11 @@ if(!istype(T)) return if(T.intact && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 ) - pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node)) + //pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node)) + pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down") else - pipe_state = icon_manager.get_atmos_icon("underlay_intact", P.dir, color_cache_name(P.node)) + //pipe_state = icon_manager.get_atmos_icon("underlay_intact", P.dir, color_cache_name(P.node)) + pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "intact") return list("on_icon" = ic_on, "off_icon" = ic_off, "pipe_icon" = pipe_state) diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index a3555f5322..39ca1e25fd 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -172,9 +172,6 @@ /obj/machinery/atmospherics/tvalve/attack_ai(mob/user as mob) return -/obj/machinery/atmospherics/tvalve/attack_paw(mob/user as mob) - return attack_hand(user) - /obj/machinery/atmospherics/tvalve/attack_hand(mob/user as mob) src.add_fingerprint(usr) update_icon(1) diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm index bd3c3b1796..a567cf5cd6 100644 --- a/code/ATMOSPHERICS/components/unary/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm @@ -65,9 +65,6 @@ /obj/machinery/atmospherics/unary/freezer/attack_ai(mob/user as mob) src.ui_interact(user) -/obj/machinery/atmospherics/unary/freezer/attack_paw(mob/user as mob) - src.ui_interact(user) - /obj/machinery/atmospherics/unary/freezer/attack_hand(mob/user as mob) src.ui_interact(user) @@ -201,7 +198,7 @@ ..() -/obj/machinery/atmospherics/unary/freezer/examine() - ..() +/obj/machinery/atmospherics/unary/freezer/examine(mob/user) + ..(user) if (opened) - usr << "The maintenance hatch is open." \ No newline at end of file + user << "The maintenance hatch is open." diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm index 15d416fff0..6b25753ec8 100644 --- a/code/ATMOSPHERICS/components/unary/heat_source.dm +++ b/code/ATMOSPHERICS/components/unary/heat_source.dm @@ -18,7 +18,7 @@ use_power = 0 idle_power_usage = 5 //5 Watts for thermostat related circuitry active_power_usage //50 kW. The power rating of the heater - + var/max_power_usage = 20000 //power rating when the usage is turned up to 100 var/power_setting = 100 @@ -35,7 +35,7 @@ component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) - + active_power_usage = max_power_usage * (power_setting/100) /obj/machinery/atmospherics/unary/heater/initialize() @@ -86,9 +86,6 @@ /obj/machinery/atmospherics/unary/heater/attack_ai(mob/user as mob) src.ui_interact(user) -/obj/machinery/atmospherics/unary/heater/attack_paw(mob/user as mob) - src.ui_interact(user) - /obj/machinery/atmospherics/unary/heater/attack_hand(mob/user as mob) src.ui_interact(user) @@ -164,10 +161,10 @@ /obj/machinery/atmospherics/unary/heater/proc/set_power_level(var/new_power_setting) power_setting = new_power_setting - + var/old_power_usage = active_power_usage active_power_usage = max_power_usage * (power_setting/100) - + if (use_power >= 2 && old_power_usage != active_power_usage) force_power_update() @@ -184,7 +181,7 @@ ..() -/obj/machinery/atmospherics/unary/heater/examine() - ..() +/obj/machinery/atmospherics/unary/heater/examine(mob/user) + ..(user) if (opened) - usr << "The maintenance hatch is open." \ No newline at end of file + user << "The maintenance hatch is open." diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 925994546e..ff43e91385 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -375,15 +375,13 @@ else ..() -/obj/machinery/atmospherics/unary/vent_pump/examine() - set src in oview(1) - ..() - if (get_dist(usr, src) <= 1) - usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W" +/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user) + if(..(user, 1)) + user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W" else - usr << "You are too far away to read the gauge." + user << "You are too far away to read the gauge." if(welded) - usr << "It seems welded shut." + user << "It seems welded shut." /obj/machinery/atmospherics/unary/vent_pump/power_change() var/old_stat = stat diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 2bad9230e5..6c71e72e27 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -1,6 +1,6 @@ /obj/machinery/atmospherics/unary/vent_scrubber icon = 'icons/atmos/vent_scrubber.dmi' - icon_state = "map_scrubber" + icon_state = "map_scrubber_off" name = "Air Scrubber" desc = "Has a valve and pump attached to it" @@ -30,6 +30,7 @@ /obj/machinery/atmospherics/unary/vent_scrubber/on on = 1 + icon_state = "map_scrubber_on" /obj/machinery/atmospherics/unary/vent_scrubber/New() ..() @@ -260,13 +261,11 @@ new /obj/item/pipe(loc, make_from=src) del(src) -/obj/machinery/atmospherics/unary/vent_scrubber/examine() - set src in oview(1) - ..() - if (get_dist(usr, src) <= 1) - usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W" +/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user) + if(..(user, 1)) + user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W" else - usr << "You are too far away to read the gauge." + user << "You are too far away to read the gauge." /obj/machinery/atmospherics/unary/vent_scrubber/Del() if(initial_loc) diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index a57458d2e0..bce38d0654 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -130,9 +130,6 @@ /obj/machinery/atmospherics/valve/attack_ai(mob/user as mob) return -/obj/machinery/atmospherics/valve/attack_paw(mob/user as mob) - return attack_hand(user) - /obj/machinery/atmospherics/valve/attack_hand(mob/user as mob) src.add_fingerprint(usr) update_icon(1) diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index 77249a4e7e..53910f2fe3 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -6,7 +6,7 @@ var/volume = 0 force = 20 - //layer = 2.4 //under wires with their 2.44 + layer = 2.4 //under wires with their 2.44 use_power = 0 var/alert_pressure = 80*ONE_ATMOSPHERE @@ -256,9 +256,9 @@ del(meter) del(src) else if(node1 && node2) - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "intact" + icon_connect_type) + overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]intact[icon_connect_type]") else - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "exposed[node1?1:0][node2?1:0]" + icon_connect_type) + overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]exposed[node1?1:0][node2?1:0][icon_connect_type]") /obj/machinery/atmospherics/pipe/simple/update_underlays() return @@ -911,29 +911,21 @@ /obj/machinery/atmospherics/pipe/cap name = "pipe endcap" desc = "An endcap for pipes" - icon = 'icons/obj/pipes.dmi' - icon_state = "cap" + icon = 'icons/atmos/pipes.dmi' + icon_state = "" level = 2 layer = 2.4 //under wires with their 2.44 volume = 35 dir = SOUTH - initialize_directions = NORTH + initialize_directions = SOUTH var/obj/machinery/atmospherics/node /obj/machinery/atmospherics/pipe/cap/New() ..() - switch(dir) - if(SOUTH) - initialize_directions = NORTH - if(NORTH) - initialize_directions = SOUTH - if(WEST) - initialize_directions = EAST - if(EAST) - initialize_directions = WEST + initialize_directions = dir /obj/machinery/atmospherics/pipe/cap/hide(var/i) if(level == 1 && istype(loc, /turf/simulated)) @@ -964,11 +956,20 @@ ..() -/obj/machinery/atmospherics/pipe/cap/update_icon() - overlays = new() +/obj/machinery/atmospherics/pipe/cap/change_color(var/new_color) + ..() + //for updating connected atmos device pipes (i.e. vents, manifolds, etc) + if(node) + node.update_underlays() - icon_state = "cap[invisibility ? "-f" : ""]" - return +/obj/machinery/atmospherics/pipe/cap/update_icon(var/safety = 0) + if(!check_icon_cache()) + return + + alpha = 255 + + overlays.Cut() + overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "cap") /obj/machinery/atmospherics/pipe/cap/initialize() for(var/obj/machinery/atmospherics/target in get_step(src, dir)) @@ -1008,7 +1009,8 @@ /obj/machinery/atmospherics/pipe/cap/hidden level = 1 - icon_state = "cap-f" + icon_state = "cap" + alpha = 128 /obj/machinery/atmospherics/pipe/cap/hidden/scrubbers name = "scrubbers pipe endcap" diff --git a/code/TriDimension/Structures.dm b/code/TriDimension/Structures.dm index dd97676115..fa91ccd5bb 100644 --- a/code/TriDimension/Structures.dm +++ b/code/TriDimension/Structures.dm @@ -55,9 +55,6 @@ del target return ..() - attack_paw(var/mob/M) - return attack_hand(M) - attackby(obj/item/C as obj, mob/user as mob) (..) diff --git a/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_animals.dm b/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_animals.dm index a2e1f1c4b9..4c95b5be1c 100644 --- a/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_animals.dm +++ b/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_animals.dm @@ -68,7 +68,7 @@ harm_intent_damage = 8 melee_damage_lower = 15 melee_damage_upper = 15 - attacktext = "slashes" + attacktext = "slashed" attack_sound = 'sound/weapons/bite.ogg' layer = 3.1 //so they can stay hidde under the /obj/structure/bush @@ -126,7 +126,7 @@ harm_intent_damage = 2 melee_damage_lower = 3 melee_damage_upper = 10 - attacktext = "bites" + attacktext = "bitten" attack_sound = 'sound/weapons/bite.ogg' layer = 3.1 //so they can stay hidde under the /obj/structure/bush diff --git a/code/WorkInProgress/Chinsky/guestpass.dm b/code/WorkInProgress/Chinsky/guestpass.dm index 5f798fa61a..7b524fe989 100644 --- a/code/WorkInProgress/Chinsky/guestpass.dm +++ b/code/WorkInProgress/Chinsky/guestpass.dm @@ -16,12 +16,12 @@ else return temp_access -/obj/item/weapon/card/id/guest/examine() - ..() +/obj/item/weapon/card/id/guest/examine(mob/user) + ..(user) if (world.time < expiration_time) - usr << "This pass expires at [worldtime2text(expiration_time)]." + user << "This pass expires at [worldtime2text(expiration_time)]." else - usr << "It expired at [worldtime2text(expiration_time)]." + user << "It expired at [worldtime2text(expiration_time)]." /obj/item/weapon/card/id/guest/read() if (world.time > expiration_time) @@ -71,9 +71,6 @@ /obj/machinery/computer/guestpass/attack_ai(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer/guestpass/attack_paw(var/mob/user as mob) - return attack_hand(user) - /obj/machinery/computer/guestpass/attack_hand(var/mob/user as mob) if(..()) return diff --git a/code/WorkInProgress/Cib/meme.dm b/code/WorkInProgress/Cib/meme.dm index 880f21bad5..cbd536da93 100644 --- a/code/WorkInProgress/Cib/meme.dm +++ b/code/WorkInProgress/Cib/meme.dm @@ -292,8 +292,12 @@ mob/living/parasite/meme/verb/Agony() spawn // backup the host incase we switch hosts after using the verb - var/mob/host = src.host + var/mob/living/carbon/host = src.host + if (host.species && (host.species.flags & NO_PAIN)) + usr << "Nothing seems to happen." + return + host.paralysis = max(host.paralysis, 2) host.flash_weak_pain() diff --git a/code/WorkInProgress/Mini/atmos_control.dm b/code/WorkInProgress/Mini/atmos_control.dm index 2c83a77fd3..38dee770cd 100644 --- a/code/WorkInProgress/Mini/atmos_control.dm +++ b/code/WorkInProgress/Mini/atmos_control.dm @@ -34,9 +34,6 @@ /obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob) return interact(user) -/obj/machinery/computer/atmoscontrol/attack_paw(var/mob/user as mob) - return interact(user) - /obj/machinery/computer/atmoscontrol/attack_hand(mob/user) if(..()) return diff --git a/code/WorkInProgress/Ported/policetape.dm b/code/WorkInProgress/Ported/policetape.dm index f331f8401b..a4d2c31bdc 100644 --- a/code/WorkInProgress/Ported/policetape.dm +++ b/code/WorkInProgress/Ported/policetape.dm @@ -135,8 +135,7 @@ else breaktape(null, user) -/obj/item/tape/attack_paw(mob/user as mob) - breaktape(/obj/item/weapon/wirecutters,user) + /obj/item/tape/proc/breaktape(obj/item/weapon/W as obj, mob/user as mob) if(user.a_intent == "help" && ((!can_puncture(W) && src.allowed(user)))) diff --git a/code/WorkInProgress/Sigyn/Softcurity/secure_closet.dm b/code/WorkInProgress/Sigyn/Softcurity/secure_closet.dm index e74c6fce6c..1f65f9f8d2 100644 --- a/code/WorkInProgress/Sigyn/Softcurity/secure_closet.dm +++ b/code/WorkInProgress/Sigyn/Softcurity/secure_closet.dm @@ -9,7 +9,6 @@ icon_off = "capsecureoff" New() - sleep(2) if(prob(50)) new /obj/item/weapon/storage/backpack/captain(src) else @@ -40,7 +39,6 @@ icon_off = "hopsecureoff" New() - sleep(2) new /obj/item/clothing/under/rank/head_of_personnel(src) new /obj/item/clothing/suit/armor/vest(src) new /obj/item/clothing/head/helmet(src) @@ -66,7 +64,6 @@ icon_off = "hossecureoff" New() - sleep(2) new /obj/item/weapon/storage/backpack/satchel_sec(src) new /obj/item/weapon/cartridge/hos(src) new /obj/item/device/radio/headset/heads/hos(src) @@ -93,7 +90,6 @@ New() - sleep(2) new /obj/item/weapon/storage/backpack/satchel_sec(src) new /obj/item/clothing/under/rank/advisor(src) new /obj/item/device/radio/headset/headset_sec(src) @@ -118,7 +114,6 @@ icon_off = "secoff" New() - sleep(2) new /obj/item/weapon/storage/backpack/satchel_sec(src) new /obj/item/device/radio/headset/headset_sec(src) new /obj/item/weapon/storage/belt/security(src) @@ -141,7 +136,6 @@ icon_off = "cabinetdetective_broken" New() - sleep(2) new /obj/item/clothing/under/det(src) new /obj/item/clothing/suit/armor/det_suit(src) new /obj/item/clothing/suit/det_suit(src) @@ -173,7 +167,6 @@ New() - sleep(2) new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src) new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src) return @@ -197,7 +190,6 @@ req_access = list(access_court) New() - sleep(2) new /obj/item/clothing/shoes/brown(src) new /obj/item/weapon/paper/Court (src) new /obj/item/weapon/paper/Court (src) diff --git a/code/WorkInProgress/SkyMarshal/wardrobes.dm b/code/WorkInProgress/SkyMarshal/wardrobes.dm index 420345214f..ffbf4d6983 100755 --- a/code/WorkInProgress/SkyMarshal/wardrobes.dm +++ b/code/WorkInProgress/SkyMarshal/wardrobes.dm @@ -63,16 +63,13 @@ user.visible_message("\blue [user] gathers up[could_fill ? " " : " most of "]the pile of items and puts it into [src].") update_icon() - examine() - set src in view() - ..() - if(src in usr) - usr << "It claims to contain [contents.len ? descriptor : descriptor + "... but it looks empty"]." - if(seal_torn && !contents.len) - usr << "The seal on the bag is broken." - else - usr << "The seal on the bag is[seal_torn ? ", however, not intact" : " intact"]." - return + examine(mob/user) + ..(user) + user << "It claims to contain [contents.len ? descriptor : descriptor + "... but it looks empty"]." + if(seal_torn && !contents.len) + user << "The seal on the bag is broken." + else + user << "The seal on the bag is[seal_torn ? ", however, not intact" : " intact"]." update_icon() if(contents.len) diff --git a/code/WorkInProgress/Wrongnumber/weldbackpack.dm b/code/WorkInProgress/Wrongnumber/weldbackpack.dm index 18899745c9..f1c786d3e1 100644 --- a/code/WorkInProgress/Wrongnumber/weldbackpack.dm +++ b/code/WorkInProgress/Wrongnumber/weldbackpack.dm @@ -46,8 +46,7 @@ user << "\blue The pack is already full!" return -/obj/item/weapon/weldpack/examine() - set src in usr - usr << text("\icon[] [] units of fuel left!", src, src.reagents.total_volume) - ..() +/obj/item/weapon/weldpack/examine(mob/user) + ..(user) + user << text("\icon[] [] units of fuel left!", src, src.reagents.total_volume) return diff --git a/code/WorkInProgress/computer3/computer.dm b/code/WorkInProgress/computer3/computer.dm index 456bdf3d71..4939444ae5 100644 --- a/code/WorkInProgress/computer3/computer.dm +++ b/code/WorkInProgress/computer3/computer.dm @@ -131,8 +131,6 @@ for(var/typekey in spawn_files) hdd.addfile(new typekey,1) - if(program) - program.execute(os) update_icon() diff --git a/code/WorkInProgress/computer3/computers/robot.dm b/code/WorkInProgress/computer3/computers/robot.dm index 98eea82f9c..3083a986c7 100644 --- a/code/WorkInProgress/computer3/computers/robot.dm +++ b/code/WorkInProgress/computer3/computers/robot.dm @@ -163,8 +163,10 @@ R.ResetSecurityCodes() else - message_admins("\blue [key_name_admin(usr)] detonated [R.name]!") - log_game("\blue [key_name_admin(usr)] detonated [R.name]!") + message_admins("[key_name_admin(usr)] detonated [key_name(R.name)]!") + log_game("[key_name_admin(usr)] detonated [key_name(R.name)]!") + if(R.connected_ai) + R.connected_ai << "

ALERT - Cyborg kill-switch activated: [R.name]
" R.self_destruct() else usr << "\red Access Denied." @@ -176,16 +178,14 @@ var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort") if(choice == "Confirm") if(R && istype(R)) - message_admins("\blue [key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") - log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") + message_admins("[key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") + log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [key_name(R.name)]!") R.canmove = !R.canmove if (R.lockcharge) - // R.cell.charge = R.lockcharge R.lockcharge = !R.lockcharge R << "Your lockdown has been lifted!" else R.lockcharge = !R.lockcharge - // R.cell.charge = 0 R << "You have been locked down!" else diff --git a/code/WorkInProgress/computer3/laptop.dm b/code/WorkInProgress/computer3/laptop.dm index 52d996827b..e0156e874e 100644 --- a/code/WorkInProgress/computer3/laptop.dm +++ b/code/WorkInProgress/computer3/laptop.dm @@ -138,6 +138,9 @@ usr << "You can't reach it." return + close_laptop(usr) + + proc/close_laptop(mob/user = null) if(istype(loc,/obj/item/device/laptop)) testing("Close closed computer") return @@ -146,7 +149,8 @@ return if(stat&BROKEN) - usr << "\The [src] is broken! You can't quite get it closed." + if(user) + user << "\The [src] is broken! You can't quite get it closed." return if(!portable) @@ -157,7 +161,8 @@ portable.loc = loc loc = portable stat |= MAINT - usr << "You close \the [src]." + if(user) + user << "You close \the [src]." auto_use_power() if(stat&MAINT) diff --git a/code/WorkInProgress/computer3/lapvend.dm b/code/WorkInProgress/computer3/lapvend.dm index b6f93f4702..36de9e4cfc 100644 --- a/code/WorkInProgress/computer3/lapvend.dm +++ b/code/WorkInProgress/computer3/lapvend.dm @@ -263,7 +263,7 @@ choose_progs(C) vend() popup.close() - newlap.close_computer() + newlap.close_laptop() newlap = null cardreader = 0 floppy = 0 diff --git a/code/WorkInProgress/periodic_news.dm b/code/WorkInProgress/periodic_news.dm index f5219aa435..099da60ba3 100644 --- a/code/WorkInProgress/periodic_news.dm +++ b/code/WorkInProgress/periodic_news.dm @@ -143,10 +143,5 @@ proc/announce_newscaster_news(datum/news_announcement/news) sendto.is_admin_channel = 1 news_network.network_channels += sendto - var/datum/feed_message/newMsg = new /datum/feed_message - newMsg.author = news.author ? news.author : sendto.author - newMsg.is_admin_message = !news.can_be_redacted - newMsg.body = news.message - newMsg.message_type = news.message_type - - news_network.insert_message_in_channel(sendto, newMsg) + var/author = news.author ? news.author : sendto.author + news_network.SubmitArticle(news.message, author, news.channel_name, null, !news.can_be_redacted, news.message_type) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index d19c6138fc..9743988875 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -45,8 +45,20 @@ return heard +/proc/isStationLevel(var/level) + return level in config.station_levels +/proc/isNotStationLevel(var/level) + return !isStationLevel() +/proc/isPlayerLevel(var/level) + return level in config.player_levels + +/proc/isAdminLevel(var/level) + return level in config.admin_levels + +/proc/isNotAdminLevel(var/level) + return !isAdminLevel(level) //Magic constants obtained by using linear regression on right-angled triangles of sides 0 1 ? num * RaiseToPower(num, power) : num) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 521f07c35e..3c7582b816 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -97,3 +97,21 @@ proc/RoundHealth(health) else return "health-100" return "0" + +/* +Proc for attack log creation, because really why not +1 argument is the actor +2 argument is the target of action +3 is the description of action(like punched, throwed, or any other verb) +4 should it make adminlog note or not +5 is the tool with which the action was made(usually item) 5 and 6 are very similar(5 have "by " before it, that it) and are separated just to keep things in a bit more in order +6 is additional information, anything that needs to be added +*/ + +/proc/add_logs(mob/user, mob/target, what_done, var/admin=1, var/object=null, var/addition=null) + if(user && ismob(user)) + user.attack_log += text("\[[time_stamp()]\] Has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]") + if(target && ismob(target)) + target.attack_log += text("\[[time_stamp()]\] Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]") + if(admin) + log_attack("[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(ismob(target) && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]") diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index ee3648fea2..4a21302777 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -228,9 +228,12 @@ Turf and target are seperate in case you want to teleport some distance from a t if (findtext(key, "Guest-", 1, 7) != 1) //was findtextEx return 0 - var/i, ch, len = length(key) + var/i = 7, ch, len = length(key) - for (i = 7, i <= len, ++i) + if(copytext(key, 7, 8) == "W") //webclient + i++ + + for (, i <= len, ++i) ch = text2ascii(key, i) if (ch < 48 || ch > 57) return 0 diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index 03fe0d53b2..020efa396f 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -106,9 +106,9 @@ /obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors! if(density) - Topic("aiEnable=7", list("aiEnable"="7"), 1) // 1 meaning no window (consistency!) + Topic(src, list("src"= "\ref[src]", "aiEnable"="7"), 1) // 1 meaning no window (consistency!) else - Topic("aiDisable=7", list("aiDisable"="7"), 1) + Topic(src, list("src"= "\ref[src]", "aiDisable"="7"), 1) return /atom/proc/AICtrlClick() @@ -116,17 +116,15 @@ /obj/machinery/door/airlock/AICtrlClick() // Bolts doors if(locked) - Topic("aiEnable=4", list("aiEnable"="4"), 1)// 1 meaning no window (consistency!) + Topic(src, list("src"= "\ref[src]", "aiEnable"="4"), 1)// 1 meaning no window (consistency!) else - Topic("aiDisable=4", list("aiDisable"="4"), 1) + Topic(src, list("src"= "\ref[src]", "aiDisable"="4"), 1) /obj/machinery/power/apc/AICtrlClick() // turns off/on APCs. - Topic("breaker=1", list("breaker"="1"), 1) // 0 meaning window (consistency! wait...) + Topic(src, list("src"= "\ref[src]", "breaker"="1"), 1) // 1 meaning no window (consistency!) /obj/machinery/turretid/AICtrlClick() //turns off/on Turrets - if(!ailock) - src.enabled = !src.enabled - src.updateTurrets() + Topic(src, list("src"= "\ref[src]", "toggleOn"="1", 1)) // 1 meaning no window (consistency!) /atom/proc/AIAltClick(var/atom/A) AltClick(A) @@ -134,25 +132,23 @@ /obj/machinery/door/airlock/AIAltClick() // Electrifies doors. if(!secondsElectrified) // permanent shock - Topic("aiEnable=6", list("aiEnable"="6"), 1) // 1 meaning no window (consistency!) + Topic(src, list("src"= "\ref[src]", "aiEnable"="6"), 1) // 1 meaning no window (consistency!) else // disable/6 is not in Topic; disable/5 disables both temporary and permanent shock - Topic("aiDisable=5", list("aiDisable"="5"), 1) + Topic(src, list("src"= "\ref[src]", "aiDisable"="5"), 1) return /obj/machinery/turretid/AIAltClick() //toggles lethal on turrets - if(!ailock) - src.lethal = !src.lethal - src.updateTurrets() + Topic(src, list("src"= "\ref[src]", "toggleLethal"="1", 1)) // 1 meaning no window (consistency!) /atom/proc/AIMiddleClick() return /obj/machinery/door/airlock/AIMiddleClick() // Toggles door bolt lights. if(!src.lights) - Topic("aiEnable=10", list("aiEnable"="10"), 1) // 1 meaning no window (consistency!) + Topic(src, list("src"= "\ref[src]", "aiEnable"="10"), 1) // 1 meaning no window (consistency!) else - Topic("aiDisable=10", list("aiDisable"="10"), 1) + Topic(src, list("src"= "\ref[src]", "aiDisable"="10"), 1) return // diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 569423ec01..a50bdce685 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -154,7 +154,6 @@ /mob/proc/DblClickOn(var/atom/A, var/params) ClickOn(A,params) - /* Translates into attack_hand, etc. @@ -168,6 +167,21 @@ /mob/proc/UnarmedAttack(var/atom/A, var/proximity_flag) return +/mob/living/UnarmedAttack(var/atom/A, var/proximity_flag) + + if(!ticker) + src << "You cannot attack people before the game has started." + return 0 + + if (istype(get_area(src), /area/start)) + src << "No attacking people at spawn, you jackass." + return 0 + + if(stat) + return 0 + + return 1 + /* Ranged unarmed attack: @@ -227,8 +241,7 @@ return /atom/proc/ShiftClick(var/mob/user) if(user.client && user.client.eye == user) - examine() - user.face_atom(src) + user.examinate(src) return /* @@ -304,7 +317,6 @@ // Simple helper to face what you clicked on, in case it should be needed in more than one place /mob/proc/face_atom(var/atom/A) - // Snowflake for space vines. var/is_buckled = 0 if(buckled) @@ -313,8 +325,7 @@ is_buckled = 1 else is_buckled = 0 - - if( stat || is_buckled || !A || !x || !y || !A.x || !A.y ) return + if( is_buckled || !A || !x || !y || !A.x || !A.y || (stat && !isobserver(src))) return var/dx = A.x - x var/dy = A.y - y if(!dx && !dy) return @@ -326,7 +337,7 @@ else if(dx > 0) direction = EAST else direction = WEST - usr.dir = direction + dir = direction if(buckled && buckled.movable) buckled.dir = direction buckled.handle_rotation() \ No newline at end of file diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 2b941562b0..337a044235 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -41,7 +41,7 @@ // Oh by the way this didn't work with old click code which is why clicking shit didn't spam you /atom/proc/attack_ghost(mob/dead/observer/user as mob) if(user.client && user.client.inquisitive_ghost) - examine() + user.examinate(src) return // --------------------------------------- diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 3c1cb43727..4f4224b04b 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -1,3 +1,7 @@ +// Generic damage proc (slimes and monkeys). +/atom/proc/attack_generic(mob/user as mob) + return 0 + /* Humans: Adds an exception for gloves, to allow special glove types like the ninja ones. @@ -5,15 +9,19 @@ Otherwise pretty standard. */ /mob/living/carbon/human/UnarmedAttack(var/atom/A, var/proximity) - var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines + + if(!..()) + return // Special glove functions: // If the gloves do anything, have them return 1 to stop // normal attack_hand() here. - if(proximity && istype(G) && G.Touch(A,1)) + var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines + if(istype(G) && G.Touch(A,1)) return A.attack_hand(src) + /atom/proc/attack_hand(mob/user as mob) return @@ -41,23 +49,20 @@ return A.attack_tk(src) -/* - Animals & All Unspecified -*/ -/mob/living/UnarmedAttack(var/atom/A) - A.attack_animal(src) -/atom/proc/attack_animal(mob/user as mob) - return /mob/living/RestrainedClickOn(var/atom/A) return /* Monkeys */ -/mob/living/carbon/monkey/UnarmedAttack(var/atom/A) - A.attack_paw(src) -/atom/proc/attack_paw(mob/user as mob) - return + + +/mob/living/carbon/monkey/UnarmedAttack(var/atom/A, var/proximity) + + if(!..()) + return + + A.attack_hand(src) /* Monkey RestrainedClickOn() was apparently the @@ -88,26 +93,91 @@ /* Aliens - Defaults to same as monkey in most places */ /mob/living/carbon/alien/RestrainedClickOn(var/atom/A) return +/mob/living/carbon/alien/UnarmedAttack(var/atom/A, var/proximity) + + if(!..()) + return 0 + + A.attack_generic(src,rand(5,6),"bitten") + /* Slimes Nothing happening here */ -/mob/living/carbon/slime/UnarmedAttack(var/atom/A) - A.attack_slime(src) -/atom/proc/attack_slime(mob/user as mob) - return + /mob/living/carbon/slime/RestrainedClickOn(var/atom/A) return +/mob/living/carbon/slime/UnarmedAttack(var/atom/A, var/proximity) + + if(!..()) + return + + // Eating + if(Victim) + return + + // Basic attack. + A.attack_generic(src, (is_adult ? rand(20,40) : rand(5,25)), "glomped") + + // Handle mob shocks. + var/mob/living/M = A + if(istype(M) && powerlevel > 0 && !istype(A,/mob/living/carbon/slime)) + + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(H.species.flags & IS_SYNTHETIC || H.species.insulated) + return + + var/power = max(0,min(10,(powerlevel+rand(0,3)))) + + var/stunprob = 10 + switch(power*10) + if(1 to 2) stunprob = 20 + if(3 to 4) stunprob = 30 + if(5 to 6) stunprob = 40 + if(7 to 8) stunprob = 60 + if(9) stunprob = 70 + if(10) stunprob = 95 + + if(prob(stunprob)) + powerlevel = max(0,powerlevel-3) + src.visible_message("\red The [name] has shocked [M]!") + M.Weaken(power) + M.Stun(power) + if (M.stuttering < power) M.stuttering = power + + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, M) + s.start() + + if(prob(stunprob) && powerlevel >= 8) + M.adjustFireLoss(powerlevel * rand(6,10)) + M.updatehealth() /* New Players: Have no reason to click on anything at all. */ /mob/new_player/ClickOn() return + +/* + Animals +*/ +/mob/living/simple_animal/UnarmedAttack(var/atom/A, var/proximity) + + if(!..()) + return + + if(melee_damage_upper == 0 && istype(A,/mob/living)) + custom_emote(1,"[friendly] [src]!") + return + + var/damage = rand(melee_damage_lower, melee_damage_upper) + if(A.attack_generic(src,damage,attacktext,wall_smash) && loc && attack_sound) + playsound(loc, attack_sound, 50, 1, 1) \ No newline at end of file diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index 0267aed853..a0d9067038 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -75,6 +75,7 @@ Radio: 1341 - death squad 1443 - Confession Intercom 1347 - Cargo techs +1349 - Service people Devices: 1451 - tracking implant @@ -109,6 +110,7 @@ var/const/ENG_FREQ = 1357 var/const/SCI_FREQ = 1351 var/const/MED_FREQ = 1355 var/const/SUP_FREQ = 1347 +var/const/SRV_FREQ = 1349 var/list/radiochannels = list( "Common" = PUB_FREQ, @@ -121,6 +123,7 @@ var/list/radiochannels = list( "Special Ops" = DTH_FREQ, "Mercenary" = SYND_FREQ, "Supply" = SUP_FREQ, + "Service" = SRV_FREQ, "AI Private" = AI_FREQ ) @@ -131,11 +134,43 @@ var/list/CENT_FREQS = list(ERT_FREQ, DTH_FREQ) var/list/ANTAG_FREQS = list(SYND_FREQ) //depenging helpers -var/list/DEPT_FREQS = list(SCI_FREQ, MED_FREQ, ENG_FREQ, SEC_FREQ, SUP_FREQ, ERT_FREQ, SYND_FREQ, DTH_FREQ) +var/list/DEPT_FREQS = list(SCI_FREQ, MED_FREQ, ENG_FREQ, SEC_FREQ, SUP_FREQ, SRV_FREQ, ERT_FREQ, SYND_FREQ, DTH_FREQ) #define TRANSMISSION_WIRE 0 #define TRANSMISSION_RADIO 1 +/proc/frequency_span_class(var/frequency) + // Antags! + if (frequency in ANTAG_FREQS) + return "syndradio" + // centcomm channels (deathsquid and ert) + else if(frequency in CENT_FREQS) + return "centradio" + // command channel + else if(frequency == COMM_FREQ) + return "comradio" + // AI private channel + else if(frequency == AI_FREQ) + return "airadio" + // department radio formatting (poorly optimized, ugh) + else if(frequency == SEC_FREQ) + return "secradio" + else if (frequency == ENG_FREQ) + return "engradio" + else if(frequency == SCI_FREQ) + return "sciradio" + else if(frequency == MED_FREQ) + return "medradio" + else if(frequency == SUP_FREQ) // cargo + return "supradio" + else if(frequency == SRV_FREQ) // service + return "srvradio" + // If all else fails and it's a dept_freq, color me purple! + else if(frequency in DEPT_FREQS) + return "deptradio" + + return "radio" + /* filters */ //When devices register with the radio controller, they might register under a certain filter. //Other devices can then choose to send signals to only those devices that belong to a particular filter. diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 87aee98471..098786f59b 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -152,9 +152,23 @@ var/use_overmap = 0 var/list/station_levels = list(1) // Defines which Z-levels the station exists on. + var/list/admin_levels= list(2) // Defines which Z-levels which are for admin functionality, for example including such areas as Central Command and the Syndicate Shuttle var/list/contact_levels = list(1, 5) // Defines which Z-levels which, for example, a Code Red announcement may affect var/list/player_levels = list(1, 3, 4, 5, 6) // Defines all Z-levels a character can typically reach + // Event settings + var/expected_round_length = 3 * 60 * 60 * 10 // 3 hours + // If the first delay has a custom start time + // No custom time, no custom time, between 80 to 100 minutes respectively. + var/list/event_first_run = list(EVENT_LEVEL_MUNDANE = null, EVENT_LEVEL_MODERATE = null, EVENT_LEVEL_MAJOR = list("lower" = 48000, "upper" = 60000)) + // The lowest delay until next event + // 10, 30, 50 minutes respectively + var/list/event_delay_lower = list(EVENT_LEVEL_MUNDANE = 6000, EVENT_LEVEL_MODERATE = 18000, EVENT_LEVEL_MAJOR = 30000) + // The upper delay until next event + // 15, 45, 70 minutes respectively + var/list/event_delay_upper = list(EVENT_LEVEL_MUNDANE = 9000, EVENT_LEVEL_MODERATE = 27000, EVENT_LEVEL_MAJOR = 42000) + + /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode for (var/T in L) @@ -518,12 +532,42 @@ if("station_levels") config.station_levels = text2numlist(value, ";") + if("admin_levels") + config.admin_levels = text2numlist(value, ";") + if("contact_levels") config.contact_levels = text2numlist(value, ";") if("player_levels") config.player_levels = text2numlist(value, ";") + if("expected_round_length") + config.expected_round_length = MinutesToTicks(text2num(value)) + + if("event_custom_start_mundane") + var/values = text2numlist(value, ";") + config.event_first_run[EVENT_LEVEL_MUNDANE] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2])) + + if("event_custom_start_moderate") + var/values = text2numlist(value, ";") + config.event_first_run[EVENT_LEVEL_MODERATE] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2])) + + if("event_custom_start_major") + var/values = text2numlist(value, ";") + config.event_first_run[EVENT_LEVEL_MAJOR] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2])) + + if("event_delay_lower") + var/values = text2numlist(value, ";") + config.event_delay_lower[EVENT_LEVEL_MUNDANE] = MinutesToTicks(values[1]) + config.event_delay_lower[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2]) + config.event_delay_lower[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3]) + + if("event_delay_upper") + var/values = text2numlist(value, ";") + config.event_delay_upper[EVENT_LEVEL_MUNDANE] = MinutesToTicks(values[1]) + config.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2]) + config.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3]) + else log_misc("Unknown setting in configuration: '[name]'") diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 49684fdc91..3afc89f421 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -360,6 +360,7 @@ datum/controller/game_controller/proc/process_pipenets() Powernet.reset() datum/controller/game_controller/proc/process_nano() + last_thing_processed = /datum/nanoui var/i = 1 while(i<=nanomanager.processing_uis.len) var/datum/nanoui/ui = nanomanager.processing_uis[i] @@ -371,15 +372,7 @@ datum/controller/game_controller/proc/process_nano() datum/controller/game_controller/proc/process_events() last_thing_processed = /datum/event - var/i = 1 - while(i<=events.len) - var/datum/event/Event = events[i] - if(Event) - Event.process() - i++ - continue - events.Cut(i,i+1) - checkEvent() + event_manager.process() datum/controller/game_controller/proc/Recover() //Mostly a placeholder for now. var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n" diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index 4ab6742b83..263a91769b 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -48,7 +48,7 @@ message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.") return -/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data")) +/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event")) set category = "Debug" set name = "Debug Controller" set desc = "Debug the various periodic loop controllers for the game (be careful!)" @@ -102,6 +102,9 @@ feedback_add_details("admin_verb","DAutovoter") if("Gas Data") debug_variables(gas_data) - feedback_add_details("admin_verv","DGasdata") + feedback_add_details("admin_verb","DGasdata") + if("Event") + debug_variables(event_manager) + feedback_add_details("admin_verb", "DEvent") message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.") return diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm index 02780f31b6..27b1b7558b 100644 --- a/code/controllers/voting.dm +++ b/code/controllers/voting.dm @@ -290,9 +290,9 @@ datum/controller/vote var/admin = 0 var/trialmin = 0 if(C.holder) - admin = 1 if(C.holder.rights & R_ADMIN) - trialmin = 1 + admin = 1 + trialmin = 1 // don't know why we use both of these it's really weird, but I'm 2 lasy to refactor this all to use just admin. voting |= C . = "Voting Panel" diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index 12925ffc61..c11ca32bca 100755 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -450,7 +450,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee containertype = /obj/structure/closet/crate containername = "Wooden planks crate" group = "Engineering" - + /datum/supply_packs/plastic50 name = "50 plastic sheets" contains = list(/obj/item/stack/sheet/mineral/plastic) @@ -980,7 +980,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /obj/item/clothing/under/rank/mailman, /obj/item/clothing/under/dress/dress_saloon, /obj/item/clothing/suit/suspenders, - /obj/item/clothing/suit/storage/labcoat/mad, + /obj/item/clothing/suit/storage/toggle/labcoat/mad, /obj/item/clothing/suit/bio_suit/plaguedoctorsuit, /obj/item/clothing/under/schoolgirl, /obj/item/clothing/under/owl, @@ -1003,7 +1003,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/formal_wear contains = list(/obj/item/clothing/head/bowler, /obj/item/clothing/head/that, - /obj/item/clothing/suit/storage/lawyer/bluejacket, + /obj/item/clothing/suit/storage/toggle/lawyer/bluejacket, /obj/item/clothing/suit/storage/lawyer/purpjacket, /obj/item/clothing/under/suit_jacket, /obj/item/clothing/under/suit_jacket/female, diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm new file mode 100644 index 0000000000..e6cb473f59 --- /dev/null +++ b/code/datums/wires/airlock.dm @@ -0,0 +1,195 @@ +// Wires for airlocks + +/datum/wires/airlock/secure + random = 1 + wire_count = 14 + +/datum/wires/airlock + holder_type = /obj/machinery/door/airlock + wire_count = 12 + window_y = 570 + +var/const/AIRLOCK_WIRE_IDSCAN = 1 +var/const/AIRLOCK_WIRE_MAIN_POWER1 = 2 +var/const/AIRLOCK_WIRE_MAIN_POWER2 = 4 +var/const/AIRLOCK_WIRE_DOOR_BOLTS = 8 +var/const/AIRLOCK_WIRE_BACKUP_POWER1 = 16 +var/const/AIRLOCK_WIRE_BACKUP_POWER2 = 32 +var/const/AIRLOCK_WIRE_OPEN_DOOR = 64 +var/const/AIRLOCK_WIRE_AI_CONTROL = 128 +var/const/AIRLOCK_WIRE_ELECTRIFY = 256 +var/const/AIRLOCK_WIRE_SAFETY = 512 +var/const/AIRLOCK_WIRE_SPEED = 1024 +var/const/AIRLOCK_WIRE_LIGHT = 2048 + +/datum/wires/airlock/CanUse(var/mob/living/L) + var/obj/machinery/door/airlock/A = holder + if(!istype(L, /mob/living/silicon)) + if(A.isElectrified()) + if(A.shock(L, 100)) + return 0 + if(A.p_open) + return 1 + return 0 + +/datum/wires/airlock/GetInteractWindow() + var/obj/machinery/door/airlock/A = holder + . += ..() + . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", (A.locked ? "The door bolts have fallen!" : "The door bolts look up."), + (A.lights ? "The door bolt lights are on." : "The door bolt lights are off!"), + ((A.hasPower()) ? "The test light is on." : "The test light is off!"), + ((A.aiControlDisabled==0 && !A.emagged) ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), + (A.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."), + (A.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."), + (A.aiDisabledIdScanner==0 ? "The IDScan light is on." : "The IDScan light is off.")) + +/datum/wires/airlock/UpdateCut(var/index, var/mended) + + var/obj/machinery/door/airlock/A = holder + switch(index) + if(AIRLOCK_WIRE_IDSCAN) + A.aiDisabledIdScanner = !mended + if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) + + if(!mended) + //Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user. + A.loseMainPower() + A.shock(usr, 50) + else + if((!IsIndexCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!IsIndexCut(AIRLOCK_WIRE_MAIN_POWER2))) + A.regainMainPower() + A.shock(usr, 50) + + if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) + + if(!mended) + //Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user. + A.loseBackupPower() + A.shock(usr, 50) + else + if((!IsIndexCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!IsIndexCut(AIRLOCK_WIRE_BACKUP_POWER2))) + A.regainBackupPower() + A.shock(usr, 50) + + if(AIRLOCK_WIRE_DOOR_BOLTS) + + if(!mended) + //Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present) + if(A.locked!=1) + A.locked = 1 + A.update_icon() + + if(AIRLOCK_WIRE_AI_CONTROL) + + if(!mended) + //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. + //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. + if(A.aiControlDisabled == 0) + A.aiControlDisabled = 1 + else if(A.aiControlDisabled == -1) + A.aiControlDisabled = 2 + else + if(A.aiControlDisabled == 1) + A.aiControlDisabled = 0 + else if(A.aiControlDisabled == 2) + A.aiControlDisabled = -1 + + if(AIRLOCK_WIRE_ELECTRIFY) + + if(!mended) + //Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted. + if(A.secondsElectrified != -1) + A.shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") + add_logs(usr, A, "electrified", admin=0, addition="at [A.x],[A.y],[A.z]") + A.secondsElectrified = -1 + else + if(A.secondsElectrified == -1) + A.secondsElectrified = 0 + return // Don't update the dialog. + + if (AIRLOCK_WIRE_SAFETY) + A.safe = mended + + if(AIRLOCK_WIRE_SPEED) + A.autoclose = mended + if(mended) + if(!A.density) + A.close() + + if(AIRLOCK_WIRE_LIGHT) + A.lights = mended + A.update_icon() + + +/datum/wires/airlock/UpdatePulsed(var/index) + + var/obj/machinery/door/airlock/A = holder + switch(index) + if(AIRLOCK_WIRE_IDSCAN) + //Sending a pulse through flashes the red light on the door (if the door has power). + if(A.hasPower() && A.density) + A.do_animate("deny") + if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2) + //Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). + A.loseMainPower() + if(AIRLOCK_WIRE_DOOR_BOLTS) + //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not), + //raises them if they are down (only if power's on) + if(!A.locked) + A.locked = 1 + A.audible_message("You hear a click from the bottom of the door.", null, 1) + else + if(A.hasPower()) //only can raise bolts if power's on + A.locked = 0 + A.audible_message("You hear a click from the bottom of the door.", null, 1) + A.update_icon() + + if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2) + //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). + A.loseBackupPower() + if(AIRLOCK_WIRE_AI_CONTROL) + if(A.aiControlDisabled == 0) + A.aiControlDisabled = 1 + else if(A.aiControlDisabled == -1) + A.aiControlDisabled = 2 + + spawn(10) + if(A) + if(A.aiControlDisabled == 1) + A.aiControlDisabled = 0 + else if(A.aiControlDisabled == 2) + A.aiControlDisabled = -1 + + if(AIRLOCK_WIRE_ELECTRIFY) + //one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds. + if(A.secondsElectrified==0) + A.shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") + add_logs(usr, A, "electrified", admin=0, addition="at [A.x],[A.y],[A.z]") + A.secondsElectrified = 30 + spawn(10) + if(A) + //TODO: Move this into process() and make pulsing reset secondsElectrified to 30 + while (A.secondsElectrified>0) + A.secondsElectrified-=1 + if(A.secondsElectrified<0) + A.secondsElectrified = 0 + sleep(10) + return + if(AIRLOCK_WIRE_OPEN_DOOR) + //tries to open the door without ID + //will succeed only if the ID wire is cut or the door requires no access and it's not emagged + if(A.emagged) return + if(!A.requiresID() || A.check_access(null)) + if(A.density) A.open() + else A.close() + if(AIRLOCK_WIRE_SAFETY) + A.safe = !A.safe + if(!A.density) + A.close() + + if(AIRLOCK_WIRE_SPEED) + A.normalspeed = !A.normalspeed + + if(AIRLOCK_WIRE_LIGHT) + A.lights = !A.lights + A.update_icon() diff --git a/code/datums/wires/alarm.dm b/code/datums/wires/alarm.dm new file mode 100644 index 0000000000..e8d68d7ffe --- /dev/null +++ b/code/datums/wires/alarm.dm @@ -0,0 +1,93 @@ +/datum/wires/alarm + holder_type = /obj/machinery/alarm + wire_count = 5 + +var/const/AALARM_WIRE_IDSCAN = 1 +var/const/AALARM_WIRE_POWER = 2 +var/const/AALARM_WIRE_SYPHON = 4 +var/const/AALARM_WIRE_AI_CONTROL = 8 +var/const/AALARM_WIRE_AALARM = 16 + + +/datum/wires/alarm/CanUse(var/mob/living/L) + var/obj/machinery/alarm/A = holder + if(A.wiresexposed) + return 1 + return 0 + +/datum/wires/alarm/GetInteractWindow() + var/obj/machinery/alarm/A = holder + . += ..() + . += text("
\n[(A.locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
\n[((A.shorted || (A.stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
\n[(A.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]") + +/datum/wires/alarm/UpdateCut(var/index, var/mended) + var/obj/machinery/alarm/A = holder + switch(index) + if(AALARM_WIRE_IDSCAN) + if(!mended) + A.locked = 1 + //world << "Idscan wire cut" + + if(AALARM_WIRE_POWER) + A.shock(usr, 50) + A.shorted = !mended + A.update_icon() + //world << "Power wire cut" + + if (AALARM_WIRE_AI_CONTROL) + if (A.aidisabled == !mended) + A.aidisabled = mended + //world << "AI Control Wire Cut" + + if(AALARM_WIRE_SYPHON) + if(!mended) + A.mode = 3 // AALARM_MODE_PANIC + A.apply_mode() + //world << "Syphon Wire Cut" + + if(AALARM_WIRE_AALARM) + if (A.alarm_area.atmosalert(2)) + A.post_alert(2) + A.update_icon() + +/datum/wires/alarm/UpdatePulsed(var/index) + var/obj/machinery/alarm/A = holder + switch(index) + if(AALARM_WIRE_IDSCAN) + A.locked = !A.locked + // world << "Idscan wire pulsed" + + if (AALARM_WIRE_POWER) + // world << "Power wire pulsed" + if(A.shorted == 0) + A.shorted = 1 + A.update_icon() + + spawn(12000) + if(A.shorted == 1) + A.shorted = 0 + A.update_icon() + + + if (AALARM_WIRE_AI_CONTROL) + // world << "AI Control wire pulsed" + if (A.aidisabled == 0) + A.aidisabled = 1 + A.updateDialog() + spawn(100) + if (A.aidisabled == 1) + A.aidisabled = 0 + + if(AALARM_WIRE_SYPHON) + // world << "Syphon wire pulsed" + if(A.mode == 1) // AALARM_MODE_SCRUB + A.mode = 3 // AALARM_MODE_PANIC + else + A.mode = 1 // AALARM_MODE_SCRUB + A.apply_mode() + + if(AALARM_WIRE_AALARM) + // world << "Aalarm wire pulsed" + if (A.alarm_area.atmosalert(0)) + A.post_alert(0) + A.update_icon() diff --git a/code/datums/wires/apc.dm b/code/datums/wires/apc.dm index 7e48809af9..bdddf048c5 100644 --- a/code/datums/wires/apc.dm +++ b/code/datums/wires/apc.dm @@ -2,10 +2,10 @@ holder_type = /obj/machinery/power/apc wire_count = 4 -var/const/APC_WIRE_IDSCAN = 1 -var/const/APC_WIRE_MAIN_POWER1 = 2 -var/const/APC_WIRE_MAIN_POWER2 = 4 -var/const/APC_WIRE_AI_CONTROL = 8 +#define APC_WIRE_IDSCAN 1 +#define APC_WIRE_MAIN_POWER1 2 +#define APC_WIRE_MAIN_POWER2 4 +#define APC_WIRE_AI_CONTROL 8 /datum/wires/apc/GetInteractWindow() var/obj/machinery/power/apc/A = holder @@ -31,7 +31,6 @@ var/const/APC_WIRE_AI_CONTROL = 8 spawn(300) if(A) A.locked = 1 - A.updateDialog() if (APC_WIRE_MAIN_POWER1, APC_WIRE_MAIN_POWER2) if(A.shorted == 0) @@ -40,7 +39,6 @@ var/const/APC_WIRE_AI_CONTROL = 8 spawn(1200) if(A && !IsIndexCut(APC_WIRE_MAIN_POWER1) && !IsIndexCut(APC_WIRE_MAIN_POWER2)) A.shorted = 0 - A.updateDialog() if (APC_WIRE_AI_CONTROL) if (A.aidisabled == 0) @@ -49,9 +47,6 @@ var/const/APC_WIRE_AI_CONTROL = 8 spawn(10) if(A && !IsIndexCut(APC_WIRE_AI_CONTROL)) A.aidisabled = 0 - A.updateDialog() - - A.updateDialog() /datum/wires/apc/UpdateCut(var/index, var/mended) var/obj/machinery/power/apc/A = holder @@ -75,4 +70,3 @@ var/const/APC_WIRE_AI_CONTROL = 8 else if (A.aidisabled == 1) A.aidisabled = 0 - A.updateDialog() diff --git a/code/datums/wires/camera.dm b/code/datums/wires/camera.dm new file mode 100644 index 0000000000..d03da5fa17 --- /dev/null +++ b/code/datums/wires/camera.dm @@ -0,0 +1,74 @@ +// Wires for cameras. + +/datum/wires/camera + random = 1 + holder_type = /obj/machinery/camera + wire_count = 6 + +/datum/wires/camera/GetInteractWindow() + + . = ..() + var/obj/machinery/camera/C = holder + . += "
\n[(C.view_range == initial(C.view_range) ? "The focus light is on." : "The focus light is off.")]" + . += "
\n[(C.can_use() ? "The power link light is on." : "The power link light is off.")]" + . += "
\n[(C.light_disabled ? "The camera light is off." : "The camera light is on.")]" + . += "
\n[(C.alarm_on ? "The alarm light is on." : "The alarm light is off.")]" + return . + +/datum/wires/camera/CanUse(var/mob/living/L) + var/obj/machinery/camera/C = holder + return C.panel_open + +var/const/CAMERA_WIRE_FOCUS = 1 +var/const/CAMERA_WIRE_POWER = 2 +var/const/CAMERA_WIRE_LIGHT = 4 +var/const/CAMERA_WIRE_ALARM = 8 +var/const/CAMERA_WIRE_NOTHING1 = 16 +var/const/CAMERA_WIRE_NOTHING2 = 32 + +/datum/wires/camera/UpdateCut(var/index, var/mended) + var/obj/machinery/camera/C = holder + + switch(index) + if(CAMERA_WIRE_FOCUS) + var/range = (mended ? initial(C.view_range) : C.short_range) + C.setViewRange(range) + + if(CAMERA_WIRE_POWER) + if(C.status && !mended || !C.status && mended) + C.deactivate(usr, 1) + + if(CAMERA_WIRE_LIGHT) + C.light_disabled = !mended + + if(CAMERA_WIRE_ALARM) + if(!mended) + C.triggerCameraAlarm() + else + C.cancelCameraAlarm() + return + +/datum/wires/camera/UpdatePulsed(var/index) + var/obj/machinery/camera/C = holder + if(IsIndexCut(index)) + return + switch(index) + if(CAMERA_WIRE_FOCUS) + var/new_range = (C.view_range == initial(C.view_range) ? C.short_range : initial(C.view_range)) + C.setViewRange(new_range) + + if(CAMERA_WIRE_POWER) + C.deactivate(null) // Deactivate the camera + + if(CAMERA_WIRE_LIGHT) + C.light_disabled = !C.light_disabled + + if(CAMERA_WIRE_ALARM) + C.visible_message("\icon[C] *beep*", "\icon[C] *beep*") + return + +/datum/wires/camera/proc/CanDeconstruct() + if(IsIndexCut(CAMERA_WIRE_POWER) && IsIndexCut(CAMERA_WIRE_FOCUS) && IsIndexCut(CAMERA_WIRE_LIGHT) && IsIndexCut(CAMERA_WIRE_NOTHING1) && IsIndexCut(CAMERA_WIRE_NOTHING2)) + return 1 + else + return 0 diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm new file mode 100644 index 0000000000..13e5316432 --- /dev/null +++ b/code/datums/wires/robot.dm @@ -0,0 +1,103 @@ +/datum/wires/robot + random = 1 + holder_type = /mob/living/silicon/robot + wire_count = 5 + +var/const/BORG_WIRE_LAWCHECK = 1 +var/const/BORG_WIRE_MAIN_POWER = 2 // The power wires do nothing whyyyyyyyyyyyyy +var/const/BORG_WIRE_LOCKED_DOWN = 4 +var/const/BORG_WIRE_AI_CONTROL = 8 +var/const/BORG_WIRE_CAMERA = 16 + +/datum/wires/robot/GetInteractWindow() + + . = ..() + var/mob/living/silicon/robot/R = holder + . += text("
\n[(R.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]") + . += text("
\n[(R.connected_ai ? "The AI link light is on." : "The AI link light is off.")]") + . += text("
\n[((!isnull(R.camera) && R.camera.status == 1) ? "The Camera light is on." : "The Camera light is off.")]") + . += text("
\n[(R.lockcharge ? "The lockdown light is on." : "The lockdown light is off.")]") + return . + +/datum/wires/robot/UpdateCut(var/index, var/mended) + + var/mob/living/silicon/robot/R = holder + switch(index) + if(BORG_WIRE_LAWCHECK) //Cut the law wire, and the borg will no longer receive law updates from its AI + if(!mended) + if (R.lawupdate == 1) + R << "LawSync protocol engaged." + R.show_laws() + else + if (R.lawupdate == 0 && !R.emagged) + R.lawupdate = 1 + + if (BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control + if(!mended) + if (R.connected_ai) + R.connected_ai = null + + if (BORG_WIRE_CAMERA) + if(!isnull(R.camera) && !R.scrambledcodes) + R.camera.status = mended + R.camera.deactivate(usr, 0) // Will kick anyone who is watching the Cyborg's camera. + + if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh + if (R.lawupdate) + R.lawsync() + + if(BORG_WIRE_LOCKED_DOWN) + R.SetLockdown(!mended) + + +/datum/wires/robot/UpdatePulsed(var/index) + + var/mob/living/silicon/robot/R = holder + switch(index) + if (BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI + if(!R.emagged) + var/new_ai = select_active_ai(R) + if(new_ai && (new_ai != R.connected_ai)) + R.connected_ai = new_ai + R.notify_ai(1) + var/numberer = 1 // Send images the Cyborg has taken to the AI's album upon sync. + for(var/datum/picture/z in R.aiCamera.aipictures) + if(R.connected_ai.aiCamera.aipictures.len == 0) + var/datum/picture/p = new/datum/picture() + p = z + p.fields["name"] = "Uploaded Image [numberer] (synced from [R.name])" + R.connected_ai.aiCamera.aipictures += p + numberer++ + continue + for(var/datum/picture/t in R.connected_ai.aiCamera.aipictures) //Hopefully to prevent someone spamming images to silicons, by spamming this wire + if((z.fields["pixel_y"] != t.fields["pixel_y"]) && (z.fields["pixel_x"] != t.fields["pixel_x"])) //~2.26 out of 1000 chance this will stop something it shouldn't + var/datum/picture/p = new/datum/picture() + p = z + p.fields["name"] = "Uploaded Image [numberer] (synced from [R.name])" + R.connected_ai.aiCamera.aipictures += p + else + continue + numberer++ + if(R.aiCamera.aipictures.len > 0) + R << "Locally saved images synced with AI. Images were retained in local database in case of loss of connection with the AI." + + if (BORG_WIRE_CAMERA) + if(!isnull(R.camera) && R.camera.can_use() && !R.scrambledcodes) + R.camera.deactivate(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera. + R.visible_message("[R]'s camera lense focuses loudly.") + R << "Your camera lense focuses loudly." + + if(BORG_WIRE_LOCKED_DOWN) + R.SetLockdown(!R.lockcharge) // Toggle + +/datum/wires/robot/CanUse(var/mob/living/L) + var/mob/living/silicon/robot/R = holder + if(R.wiresexposed) + return 1 + return 0 + +/datum/wires/robot/proc/IsCameraCut() + return wires_status & BORG_WIRE_CAMERA + +/datum/wires/robot/proc/LockedCut() + return wires_status & BORG_WIRE_LOCKED_DOWN diff --git a/code/datums/wires/smartfridge.dm b/code/datums/wires/smartfridge.dm index 0d0fb29870..b611497e79 100644 --- a/code/datums/wires/smartfridge.dm +++ b/code/datums/wires/smartfridge.dm @@ -2,6 +2,10 @@ holder_type = /obj/machinery/smartfridge wire_count = 3 +/datum/wires/smartfridge/secure + random = 1 + wire_count = 4 + var/const/SMARTFRIDGE_WIRE_ELECTRIFY = 1 var/const/SMARTFRIDGE_WIRE_THROW = 2 var/const/SMARTFRIDGE_WIRE_IDSCAN = 4 @@ -16,11 +20,6 @@ var/const/SMARTFRIDGE_WIRE_IDSCAN = 4 return 1 return 0 -/datum/wires/smartfridge/Interact(var/mob/living/user) - if(CanUse(user)) - var/obj/machinery/smartfridge/S = holder - S.attack_hand(user) - /datum/wires/smartfridge/GetInteractWindow() var/obj/machinery/smartfridge/S = holder . += ..() diff --git a/code/datums/wires/suit_storage_unit.dm b/code/datums/wires/suit_storage_unit.dm index 8ef5ce6398..c2d1a130d7 100644 --- a/code/datums/wires/suit_storage_unit.dm +++ b/code/datums/wires/suit_storage_unit.dm @@ -16,11 +16,6 @@ var/const/SUIT_STORAGE_WIRE_LOCKED = 4 return 1 return 0 -/datum/wires/suit_storage_unit/Interact(var/mob/living/user) - if(CanUse(user)) - var/obj/machinery/suit_cycler/S = holder - S.attack_hand(user) - /datum/wires/suit_storage_unit/GetInteractWindow() var/obj/machinery/suit_cycler/S = holder . += ..() diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 6204c90325..26feaefe47 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -6,8 +6,8 @@ #define MAX_FLAG 65535 var/list/same_wires = list() -// 12 colours, if you're adding more than 12 wires then add more colours here -var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink") +// 14 colours, if you're adding more than 14 wires then add more colours here +var/list/wireColours = list("red", "blue", "green", "white", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink", "black", "yellow") /datum/wires diff --git a/code/defines/procs/admin.dm b/code/defines/procs/admin.dm index 5943ada459..44d79a3893 100644 --- a/code/defines/procs/admin.dm +++ b/code/defines/procs/admin.dm @@ -1,3 +1,7 @@ proc/log_and_message_admins(var/message as text) log_admin("[usr]([usr.ckey]) " + message) message_admins("[usr]([usr.ckey]) " + message) + +proc/admin_log_and_message_admins(var/message as text) + log_admin("[key_name(usr)] " + message) + message_admins("[key_name_admin(usr)] " + message, 1) \ No newline at end of file diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm index 54bdd95397..b74f7a1c78 100644 --- a/code/defines/procs/announce.dm +++ b/code/defines/procs/announce.dm @@ -7,7 +7,7 @@ var/log = 0 var/sound var/newscast = 0 - var/channel_name = "Public Station Announcements" + var/channel_name = "Station Announcements" var/announcement_type = "Announcement" /datum/announcement/New(var/do_log = 0, var/new_sound = null, var/do_newscast = 0) diff --git a/code/defines/procs/radio.dm b/code/defines/procs/radio.dm index 0846502ede..0cbd009076 100644 --- a/code/defines/procs/radio.dm +++ b/code/defines/procs/radio.dm @@ -51,27 +51,26 @@ return TELECOMMS_RECEPTION_RECEIVER return TELECOMMS_RECEPTION_NONE -/proc/get_reception(var/atom/sender, var/receiver, var/message = "") +/proc/get_reception(var/atom/sender, var/receiver, var/message = "", var/do_sleep = 1) var/datum/reception/reception = new // check if telecomms I/O route 1459 is stable - //var/telecomms_intact = telecomms_process(P.owner, owner, t) reception.message_server = get_message_server() - var/datum/signal/signal = sender.telecomms_process() // Be aware that this proc calls sleep, to simulate transmition delays + var/datum/signal/signal = sender.telecomms_process(do_sleep) // Be aware that this proc calls sleep, to simulate transmition delays reception.telecomms_reception |= get_sender_reception(sender, signal) reception.telecomms_reception |= get_receiver_reception(receiver, signal) reception.message = signal && signal.data["compression"] > 0 ? Gibberish(message, signal.data["compression"] + 50) : message return reception -/proc/get_receptions(var/atom/sender, var/list/atom/receivers) +/proc/get_receptions(var/atom/sender, var/list/atom/receivers, var/do_sleep = 1) var/datum/receptions/receptions = new receptions.message_server = get_message_server() var/datum/signal/signal if(sender) - signal = sender.telecomms_process() + signal = sender.telecomms_process(do_sleep) receptions.sender_reception = get_sender_reception(sender, signal) for(var/atom/receiver in receivers) diff --git a/code/defines/procs/records.dm b/code/defines/procs/records.dm index 3bf23c5941..4e9fbcc9af 100644 --- a/code/defines/procs/records.dm +++ b/code/defines/procs/records.dm @@ -39,6 +39,9 @@ data_core.security += R return R +/proc/find_security_record(field, value) + return find_record(field, value, data_core.security) + /proc/find_record(field, value, list/L) for(var/datum/data/record/R in L) if(R.fields[field] == value) diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 17275475be..075126bdbe 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -56,6 +56,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area var/air_doors_activated = 0 var/list/ambience = list('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg') + var/sound/forced_ambience = null /*Adding a wizard area teleport list because motherfucking lag -- Urist*/ /*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/ @@ -717,6 +718,10 @@ var/list/ghostteleportlocs = list() name = "\improper Incinerator" icon_state = "disposal" +/area/maintenance/library + name = "Library Maintenance" + icon_state = "maint_library" + /area/maintenance/locker name = "Locker Room Maintenance" icon_state = "maint_locker" @@ -726,11 +731,11 @@ var/list/ghostteleportlocs = list() icon_state = "maint_medbay" /area/maintenance/research_port - name = "Port Research Maintenance" + name = "Research Maintenance - Port" icon_state = "maint_research_port" /area/maintenance/research_starboard - name = "Starboard Research Maintenance" + name = "Research Maintenance - Starboard" icon_state = "maint_research_starboard" /area/maintenance/research_shuttle @@ -738,11 +743,11 @@ var/list/ghostteleportlocs = list() icon_state = "maint_research_shuttle" /area/maintenance/security_port - name = "Port Security Maintenance" + name = "Security Maintenance - Port" icon_state = "maint_security_port" /area/maintenance/security_starboard - name = "Starboard Security Maintenance" + name = "Security Maintenance - Starboard" icon_state = "maint_security_starboard" /area/maintenance/storage @@ -814,9 +819,21 @@ var/list/ghostteleportlocs = list() name = "\improper Construction Area" icon_state = "construction" -/area/hallway/secondary/entry - name = "\improper Arrival Shuttle Hallway" - icon_state = "entry" +/area/hallway/secondary/entry/fore + name = "\improper Arrival Shuttle Hallway - Fore" + icon_state = "entry_1" + +/area/hallway/secondary/entry/port + name = "\improper Arrival Shuttle Hallway - Port" + icon_state = "entry_2" + +/area/hallway/secondary/entry/starboard + name = "\improper Arrival Shuttle Hallway - Starboard" + icon_state = "entry_3" + +/area/hallway/secondary/entry/aft + name = "\improper Arrival Shuttle Hallway - Aft" + icon_state = "entry_4" //Command @@ -1175,7 +1192,7 @@ var/list/ghostteleportlocs = list() /area/assembly/robotics name = "\improper Robotics Lab" - icon_state = "ass_line" + icon_state = "robotics" /area/assembly/assembly_line //Derelict Assembly Line name = "\improper Assembly Line" @@ -1205,21 +1222,26 @@ var/list/ghostteleportlocs = list() //MedBay /area/medical/medbay - name = "\improper Medbay" + name = "\improper Medbay Hallway - Port" icon_state = "medbay" music = 'sound/ambience/signal.ogg' //Medbay is a large area, these additional areas help level out APC load. /area/medical/medbay2 - name = "\improper Medbay" + name = "\improper Medbay Hallway - Starboard" icon_state = "medbay2" music = 'sound/ambience/signal.ogg' /area/medical/medbay3 - name = "\improper Medbay" + name = "\improper Medbay Hallway - Fore" icon_state = "medbay3" music = 'sound/ambience/signal.ogg' +/area/medical/medbay4 + name = "\improper Medbay Hallway - Aft" + icon_state = "medbay4" + music = 'sound/ambience/signal.ogg' + /area/medical/biostorage name = "\improper Secondary Storage" icon_state = "medbay2" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index bc45640522..e90ca9e096 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -65,7 +65,7 @@ //Check all the alarms before lowering atmosalm. Raising is perfectly fine. for (var/area/RA in related) for (var/obj/machinery/alarm/AA in RA) - if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted) + if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.report_danger_level) danger_level = max(danger_level, AA.danger_level) if(danger_level != atmosalm) @@ -282,10 +282,9 @@ master.used_environ += amount -/area/Entered(A) - var/musVolume = 25 - var/sound = 'sound/ambience/ambigen1.ogg' +var/list/mob/living/forced_ambiance_list = new +/area/Entered(A) if(!istype(A,/mob/living)) return var/mob/living/L = A @@ -300,18 +299,28 @@ L.make_floating(0) L.lastarea = newarea + play_ambience(L) +/area/proc/play_ambience(var/mob/living/L) // Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch if(!(L && L.client && (L.client.prefs.toggles & SOUND_AMBIENCE))) return + // If we previously were in an area with force-played ambiance, stop it. + if(L in forced_ambiance_list) + L << sound(null, channel = 1) + forced_ambiance_list -= L + if(!L.client.ambience_playing) L.client.ambience_playing = 1 L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2) - if(src.ambience.len && prob(35)) - sound = pick(ambience) - - if(world.time > L.client.played + 600) + if(forced_ambience) + forced_ambiance_list += L + L << forced_ambience + else if(src.ambience.len && prob(35)) + if((world.time >= L.client.played + 600)) + var/musVolume = 25 + var/sound = pick(ambience) L << sound(sound, repeat = 0, wait = 0, volume = musVolume, channel = 1) L.client.played = world.time diff --git a/code/game/atoms.dm b/code/game/atoms.dm index b1cfd18551..c53296c0d1 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -187,18 +187,22 @@ its easier to just keep the beam vertical. //All atoms -/atom/verb/examine() - set name = "Examine" - set category = "IC" - set src in view(usr.client) //If it can be seen, it can be examined. +/atom/proc/examine(mob/user, var/distance = -1, var/sufix = "") + //This reformat names to get a/an properly working on item descriptions when they are bloody + var/f_name = "\a [src]." + if(src.blood_DNA && !istype(src, /obj/effect/decal)) + if(gender == PLURAL) + f_name = "some " + else + f_name = "a " + f_name += "blood-stained [name]!" - if (!( usr )) - return - usr << "That's \a [src]." //changed to "That's" from "This is" because "This is some metal sheets" sounds dumb compared to "That's some metal sheets" ~Carn - usr << desc - // *****RM - //usr << "[name]: Dn:[density] dir:[dir] cont:[contents] icon:[icon] is:[icon_state] loc:[loc]" - return + user << "\icon[src] That's [f_name] [sufix]" + + if(desc) + user << desc + + return distance == -1 || (get_dist(src, user) <= distance) // called by mobs when e.g. having the atom as their machine, pulledby, loc (AKA mob being inside the atom) or buckled var set. // see code/modules/mob/mob_movement.dm for more. @@ -244,7 +248,7 @@ its easier to just keep the beam vertical. src.fingerprintslast = M.key return -/atom/proc/add_fingerprint(mob/living/M as mob) +/atom/proc/add_fingerprint(mob/living/M as mob, ignoregloves = 0) if(isnull(M)) return if(isAI(M)) return if(isnull(M.key)) return @@ -280,11 +284,12 @@ its easier to just keep the beam vertical. H.gloves.add_fingerprint(M) //Deal with gloves the pass finger/palm prints. - if(H.gloves != src) - if(prob(75) && istype(H.gloves, /obj/item/clothing/gloves/latex)) - return 0 - else if(H.gloves && !istype(H.gloves, /obj/item/clothing/gloves/latex)) - return 0 + if(!ignoregloves) + if(H.gloves != src) + if(prob(75) && istype(H.gloves, /obj/item/clothing/gloves/latex)) + return 0 + else if(H.gloves && !istype(H.gloves, /obj/item/clothing/gloves/latex)) + return 0 //More adminstuffz if(fingerprintslast != H.key) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index de6b84d655..82c7eb3016 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -193,11 +193,6 @@ return src.master.attackby(a, b) return -/atom/movable/overlay/attack_paw(a, b, c) - if (src.master) - return src.master.attack_paw(a, b, c) - return - /atom/movable/overlay/attack_hand(a, b, c) if (src.master) return src.master.attack_hand(a, b, c) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index d1398402fc..01ef334ce7 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -324,8 +324,6 @@ return return */ -/obj/machinery/computer/scan_consolenew/attack_paw(user as mob) - ui_interact(user) /obj/machinery/computer/scan_consolenew/attack_ai(user as mob) src.add_hiddenprint(user) @@ -424,15 +422,15 @@ if (connected.beaker.reagents && connected.beaker.reagents.reagent_list.len) for(var/datum/reagent/R in connected.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) + 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, "dna_modifier.tmpl", "DNA Modifier Console", 660, 700) // 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 diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index e53053764b..f3d60d48ad 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -82,7 +82,7 @@ var/list/blob_nodes = list() sleep(-1) if(!blobs.len) break var/obj/effect/blob/B = pick(blobs) - if(B.z != 1) + if(isNotStationLevel(B.z)) continue B.Life() diff --git a/code/game/gamemodes/blob/blob_finish.dm b/code/game/gamemodes/blob/blob_finish.dm index 8cdc9ffd1f..4afdf6d147 100644 --- a/code/game/gamemodes/blob/blob_finish.dm +++ b/code/game/gamemodes/blob/blob_finish.dm @@ -7,12 +7,12 @@ return 1 for(var/obj/effect/blob/B in blob_cores) - if(B && B.z != 1) continue + if(B && isNotStationLevel(B.z)) continue return 0 var/nodes = 0 for(var/obj/effect/blob/B in blob_nodes) - if(B && B.z != 1) continue + if(B && isNotStationLevel(B.z)) continue nodes++ if(nodes > 4)//Perhapse make a new core with a low prob return 0 @@ -62,7 +62,7 @@ if (istype(T, /turf/space)) numSpace += 1 else if(istype(T, /turf)) - if (M.z!=1) + if (isNotStationLevel(M.z)) numOffStation += 1 else numAlive += 1 diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index 46243b0df1..d12bfaa754 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -62,7 +62,7 @@ proc/count() for(var/turf/T in world) - if(T.z != 1) + if(isNotStationLevel(T.z) continue if(istype(T,/turf/simulated/floor)) @@ -84,7 +84,7 @@ src.r_wall += 1 for(var/obj/O in world) - if(O.z != 1) + if(isNotStationLevel(O.z)) continue if(istype(O, /obj/structure/window)) diff --git a/code/game/gamemodes/blob/blobs/factory.dm b/code/game/gamemodes/blob/blobs/factory.dm index b388396639..bb8de8184e 100644 --- a/code/game/gamemodes/blob/blobs/factory.dm +++ b/code/game/gamemodes/blob/blobs/factory.dm @@ -34,7 +34,7 @@ maxHealth = 20 melee_damage_lower = 4 melee_damage_upper = 8 - attacktext = "hits" + attacktext = "hit" attack_sound = 'sound/weapons/genhit1.ogg' var/obj/effect/blob/factory/factory = null faction = "blob" diff --git a/code/game/gamemodes/calamity/calamity.dm b/code/game/gamemodes/calamity/calamity.dm index be0d9abdb2..6ddd3d70a5 100644 --- a/code/game/gamemodes/calamity/calamity.dm +++ b/code/game/gamemodes/calamity/calamity.dm @@ -82,6 +82,17 @@ return 1 /datum/game_mode/calamity/post_setup() + event_manager.report_at_round_end = 1 + // Reduce the interval between moderate/major events + var/datum/event_container/EModerate = event_manager.event_containers[EVENT_LEVEL_MODERATE] + var/datum/event_container/EMajor = event_manager.event_containers[EVENT_LEVEL_MAJOR] + EModerate.delay_modifier = 0.5 + EMajor.delay_modifier = 0.75 + + // Add the cortical borer event + var/list/moderate_event_list = EModerate.available_events + var/event = new /datum/event_meta(EVENT_LEVEL_MODERATE, "Borer Infestation", /datum/event/borer_infestation, 400, one_shot = 1) + moderate_event_list.Add(event) if(chosen_atypes) for(var/atype in chosen_atypes) diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index e60795f5fd..b78baf2816 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -20,7 +20,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", runewords-=cultwords[word] /obj/effect/rune - desc = "" + desc = "A strange collection of symbols drawn in blood." anchored = 1 icon = 'icons/obj/rune.dmi' icon_state = "1" @@ -68,26 +68,10 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", for(var/mob/living/silicon/ai/AI in player_list) AI.client.images += blood - examine() - set src in view(2) - - if(!iscultist(usr)) - usr << "A strange collection of symbols drawn in blood." - return - /* Explosions... really? - if(desc && !usr.stat) - usr << "It reads: [desc]." - sleep(30) - explosion(src.loc, 0, 2, 5, 5) - if(src) - del(src) - */ - if(!desc) - usr << "A spell circle drawn in blood. It reads: [word1] [word2] [word3]." - else - usr << "Explosive Runes inscription in blood. It reads: [desc]." - - return + examine(mob/user) + ..() + if(iscultist(user)) + user << "This spell circle reads: [word1] [word2] [word3]." attackby(I as obj, user as mob) @@ -346,7 +330,8 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", msg_admin_attack("[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey]) (JMP)") if(istype(M,/mob/dead)) - M.invisibility = 0 + var/mob/dead/D = M + D.manifest() user.visible_message( \ "\red [user] drags the ghost to our plan of reality!", \ "\red You drag the ghost to our plan of reality!" \ @@ -510,12 +495,11 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", user << "You copy the translation notes from your tome." - examine() - set src in usr - if(!iscultist(usr)) - usr << "An old, dusty tome with frayed edges and a sinister looking cover." + examine(mob/user) + if(!iscultist(user)) + user << "An old, dusty tome with frayed edges and a sinister looking cover." else - usr << "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though." + user << "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though." /obj/item/weapon/book/tome/imbued //admin tome, spawns working runes without waiting w_class = 2.0 diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 4bed45418a..fb6476bf07 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -12,7 +12,7 @@ var/list/sacrificed = list() for(var/obj/effect/rune/R in world) if(R == src) continue - if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && R.z != 2) + if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && isPlayerLevel(R.z)) index++ allrunesloc.len = index allrunesloc[index] = R.loc @@ -104,9 +104,13 @@ var/list/sacrificed = list() if(M.stat==2) continue usr.say("Mah[pick("'","`")]weyh pleggh at e'ntrath!") - M.visible_message("\red [M] writhes in pain as the markings below \him glow a bloody red.", \ - "\red AAAAAAHHHH!", \ - "\red You hear an anguished scream.") + + if (M.species && (M.species.flags & NO_PAIN)) + M.visible_message("\red The markings below [M] glow a bloody red.") + else + M.visible_message("\red [M] writhes in pain as the markings below \him glow a bloody red.", \ + "\red AAAAAAHHHH!", \ + "\red You hear an anguished scream.") if(is_convertable_to_cult(M.mind) && !jobban_isbanned(M, "cultist"))//putting jobban check here because is_convertable uses mind as argument // Mostly for the benefit of those who resist, but it makes sense for even those who join to have some.. effect. diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index a319e83421..961f38fc0d 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -3,13 +3,6 @@ var/imbue = null var/uses = 0 - - examine() - set src in view(2) - ..() - return - - attack_self(mob/living/user as mob) if(iscultist(user)) var/delete = 1 diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 53b9186a3e..59aede3ac9 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -151,7 +151,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue for(var/datum/disease/D in H.viruses) foundAlready = 1 @@ -211,7 +211,7 @@ /* // Haha, this is way too laggy. I'll keep the prison break though. for(var/obj/machinery/light/L in world) - if(L.z != 1) continue + if(isNotStationLevel(L.z)) continue L.flicker(50) sleep(100) @@ -220,7 +220,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue if(istype(H,/mob/living/carbon/human)) H.apply_effect((rand(15,75)),IRRADIATE,0) @@ -237,7 +237,7 @@ var/turf/T = get_turf(M) if(!T) continue - if(T.z != 1) + if(isNotStationLevel(T.z)) continue M.apply_effect((rand(15,75)),IRRADIATE,0) sleep(100) diff --git a/code/game/gamemodes/events/biomass.dm b/code/game/gamemodes/events/biomass.dm index 3b48b971f0..b758c85019 100644 --- a/code/game/gamemodes/events/biomass.dm +++ b/code/game/gamemodes/events/biomass.dm @@ -29,6 +29,7 @@ if(/obj/item/weapon/twohanded/fireaxe) del src if(/obj/item/weapon/hatchet) del src if(/obj/item/weapon/melee/energy) del src + if(/obj/item/weapon/pickaxe/plasmacutter) del src //less effective weapons if(/obj/item/weapon/wirecutters) diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm index 8e7bd03a7d..7f4f6f7020 100644 --- a/code/game/gamemodes/events/clang.dm +++ b/code/game/gamemodes/events/clang.dm @@ -78,8 +78,8 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 walk_towards(immrod, end,1) sleep(1) while (immrod) - if (immrod.z != 1) - immrod.z = 1 + if (isNotStationLevel(immrod.z)) + immrod.z = pick(config.station_levels) if(immrod.loc == end) del(immrod) sleep(10) diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm index 378c6b2468..f2c510b9b9 100644 --- a/code/game/gamemodes/events/dust.dm +++ b/code/game/gamemodes/events/dust.dm @@ -83,7 +83,7 @@ The "dust" will damage the hull of the station causin minor hull breaches. var/goal = locate(endx, endy, 1) src.x = startx src.y = starty - src.z = 1 + src.z = pick(config.station_levels) spawn(0) walk_towards(src, goal, 1) return diff --git a/code/game/gamemodes/events/holidays/Christmas.dm b/code/game/gamemodes/events/holidays/Christmas.dm index 9203fa15e9..ba1c2be13c 100644 --- a/code/game/gamemodes/events/holidays/Christmas.dm +++ b/code/game/gamemodes/events/holidays/Christmas.dm @@ -1,6 +1,6 @@ /proc/Christmas_Game_Start() for(var/obj/structure/flora/tree/pine/xmas in world) - if(xmas.z != 1) continue + if(isNotStationLevel(xmas.z)) continue for(var/turf/simulated/floor/T in orange(1,xmas)) for(var/i=1,i<=rand(1,5),i++) new /obj/item/weapon/a_gift(T) diff --git a/code/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm index 2cd06199bd..cab426e455 100644 --- a/code/game/gamemodes/events/holidays/Holidays.dm +++ b/code/game/gamemodes/events/holidays/Holidays.dm @@ -171,7 +171,7 @@ var/global/Holiday = null */ /* var/list/obj/containers = list() for(var/obj/item/weapon/storage/S in world) - if(S.z != 1) continue + if(isNotStationLevel(S.z)) continue containers += S message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/ diff --git a/code/game/gamemodes/events/miniblob.dm b/code/game/gamemodes/events/miniblob.dm index 127e877e96..93fbbb8c2d 100644 --- a/code/game/gamemodes/events/miniblob.dm +++ b/code/game/gamemodes/events/miniblob.dm @@ -21,7 +21,7 @@ sleep(-1) if(!blob_cores.len) break var/obj/effect/blob/B = pick(blob_cores) - if(B.z != 1) + if(isNotStationLevel(B.z)) continue B.Life() spawn(30) diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm index 48b99580fd..bb62f3c8e0 100644 --- a/code/game/gamemodes/events/ninja_equipment.dm +++ b/code/game/gamemodes/events/ninja_equipment.dm @@ -911,9 +911,8 @@ ________________________________________________________________________________ U.drop_item() return 0 -/obj/item/clothing/suit/space/space_ninja/examine() - set src in view() - ..() +/obj/item/clothing/suit/space/space_ninja/examine(mob/user) + ..(user) if(s_initialized) var/mob/living/carbon/human/U = affecting if(s_control) @@ -1168,9 +1167,8 @@ ________________________________________________________________________________ U << "You [candrain?"disable":"enable"] special interaction." candrain=!candrain -/obj/item/clothing/gloves/space_ninja/examine() - set src in view() - ..() +/obj/item/clothing/gloves/space_ninja/examine(mob/user) + ..(user) if(!canremove) var/mob/living/carbon/human/U = loc U << "The energy drain mechanism is: [candrain?"active":"inactive"]." @@ -1306,12 +1304,11 @@ ________________________________________________________________________________ var/mob/U = loc U << "Switching mode to [ninja_vision.mode]." -/obj/item/clothing/mask/gas/voice/space_ninja/examine() - set src in view() - ..() +/obj/item/clothing/mask/gas/voice/space_ninja/examine(mob/user) + ..(user) - usr << "[ninja_vision.mode] is active."//Leaving usr here since it may be on the floor or on a person. - usr << "Voice mimicking algorithm is set [!vchange?"inactive":"active"]." + user << "[ninja_vision.mode] is active." + user << "Voice mimicking algorithm is set [!vchange?"inactive":"active"]." /* =================================================================================== @@ -1476,9 +1473,6 @@ It is possible to destroy the net by the occupant or someone else. healthcheck() return - attack_paw() - return attack_hand() - attackby(obj/item/weapon/W as obj, mob/user as mob) var/aforce = W.force health = max(0, health - aforce) diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index ed82647615..fdf1b856cb 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -33,7 +33,7 @@ C.cell.charge = C.cell.maxcharge for(var/obj/machinery/power/smes/S in world) var/area/current_area = get_area(S) - if(current_area.type in skipped_areas || S.z != 1) + if(current_area.type in skipped_areas || isNotStationLevel(S.z)) continue S.charge = S.last_charge S.output = S.last_output @@ -46,10 +46,10 @@ if(announce) command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg') for(var/obj/machinery/power/smes/S in world) - if(S.z != 1) + if(isNotStationLevel(S.z)) continue S.charge = S.capacity - S.output = 200000 + S.output = S.output_level_max // Most new SMESs on map are of buildable type, and may actually have higher output limit than 200kW. Use max output of that SMES instead. S.online = 1 S.updateicon() S.power_change() diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 2b1e13ee29..17e85c9fb1 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -213,7 +213,7 @@ /datum/game_mode/proc/send_intercept() var/intercepttext = "Cent. Com. Update Requested status information:
" - intercepttext += " In case you have misplaced your copy, attached is a list of personnel whom reliable sources™ suspect may be affiliated with criminal organisations or hostile foreign entities:
" + intercepttext += " In case you have misplaced your copy, attached is a list of personnel whom reliable sources™ suspect may be affiliated with subversive elements:
" var/list/suspects = list() diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 568903ae89..d4d14c9120 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -274,7 +274,7 @@ var/global/datum/controller/gameticker/ticker proc/create_characters() for(var/mob/new_player/player in player_list) - if(player.ready && player.mind) + if(player && player.ready && player.mind) if(player.mind.assigned_role=="AI") player.close_spawn_windows() player.AIize() @@ -382,11 +382,11 @@ var/global/datum/controller/gameticker/ticker if(Player.stat != DEAD) var/turf/playerTurf = get_turf(Player) if(emergency_shuttle.departed && emergency_shuttle.evac) - if(playerTurf.z != 2) + if(isNotAdminLevel(playerTurf.z)) Player << "You managed to survive, but were marooned on [station_name()] as [Player.real_name]..." else Player << "You managed to survive the events on [station_name()] as [Player.real_name]." - else if(playerTurf.z == 2) + else if(isAdminLevel(playerTurf.z)) Player << "You successfully underwent crew transfer after events on [station_name()] as [Player.real_name]." else if(issilicon(Player)) Player << "You remain operational after the events on [station_name()] as [Player.real_name]." @@ -441,6 +441,9 @@ var/global/datum/controller/gameticker/ticker if (findtext("[handler]","auto_declare_completion_")) call(mode, handler)() + //Ask the event manager to print round end information + event_manager.RoundEnd() + //Print a list of antagonists to the server log var/list/total_antagonists = list() //Look into all mobs in world, dead or alive diff --git a/code/game/gamemodes/mutiny/emergency_authentication_device.dm b/code/game/gamemodes/mutiny/emergency_authentication_device.dm index 5bdcf27576..bedd67e64c 100644 --- a/code/game/gamemodes/mutiny/emergency_authentication_device.dm +++ b/code/game/gamemodes/mutiny/emergency_authentication_device.dm @@ -99,7 +99,7 @@ return ..() -/obj/machinery/emergency_authentication_device/examine() - usr << {" +/obj/machinery/emergency_authentication_device/examine(mob/user) + user << {" This is a specialized communications device that is able to instantly send a message to NanoTrasen High Command via quantum entanglement with a sister device at CentCom. The EAD's status is [get_status()]."} diff --git a/code/game/gamemodes/mutiny/key_pinpointer.dm b/code/game/gamemodes/mutiny/key_pinpointer.dm index c481fd5bbc..7e8d628d85 100644 --- a/code/game/gamemodes/mutiny/key_pinpointer.dm +++ b/code/game/gamemodes/mutiny/key_pinpointer.dm @@ -25,14 +25,14 @@ icon_state = "pinoff" usr << "\blue You switch \the [src] off." -/obj/item/weapon/pinpointer/advpinpointer/auth_key/examine() +/obj/item/weapon/pinpointer/advpinpointer/auth_key/examine(mob/user) switch(mode) if (1) - usr << "Is is calibrated for the Captain's Authentication Key." + user << "Is is calibrated for the Captain's Authentication Key." if (2) - usr << "It is calibrated for the Emergency Secondary Authentication Key." + user << "It is calibrated for the Emergency Secondary Authentication Key." else - usr << "It is switched off." + user << "It is switched off." /datum/supply_packs/key_pinpointer name = "Authentication Key Pinpointer crate" diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index 8cf15cfd59..2447244675 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -1404,7 +1404,7 @@ datum var/turf/T = get_turf(target.current) if(target.current.stat == 2) return 1 - else if((T) && (T.z != 1))//If they leave the station they count as dead for this + else if((T) && (isNotStationLevel(T.z)))//If they leave the station they count as dead for this return 2 else return 0 diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 4ab5961323..cc57ccd855 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -165,9 +165,6 @@ var/bomb_set return ..() -/obj/machinery/nuclearbomb/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/nuclearbomb/attack_hand(mob/user as mob) if (src.extended) if (!ishuman(user)) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 9b49e37fae..36137a74a9 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -42,11 +42,11 @@ icon_state = "pinonfar" spawn(5) .() - examine() - ..() + examine(mob/user) + ..(user) for(var/obj/machinery/nuclearbomb/bomb in world) if(bomb.timing) - usr << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]" + user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]" /obj/item/weapon/pinpointer/advpinpointer diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index e2cc152c8e..d2fae33e86 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -88,7 +88,7 @@ datum/objective/mutiny if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey) return 1 var/turf/T = get_turf(target.current) - if(T && (T.z != 1)) //If they leave the station they count as dead for this + if(T && isNotStationLevel(T.z)) //If they leave the station they count as dead for this return 2 return 0 return 1 @@ -123,7 +123,7 @@ datum/objective/mutiny/rp if(target in ticker.mode:head_revolutionaries) return 1 var/turf/T = get_turf(target.current) - if(T && (T.z != 1)) //If they leave the station they count as dead for this + if(T && isNotStationLevel(T.z)) //If they leave the station they count as dead for this rval = 2 return 0 return rval diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 51f0dc7b3d..051c112bbb 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -367,7 +367,7 @@ if(headrev.current) if(headrev.current.stat == DEAD) text += "died" - else if(headrev.current.z != 1) + else if(isNotStationLevel(headrev.current.z)) text += "fled the station" else text += "survived the revolution" @@ -390,7 +390,7 @@ if(rev.current) if(rev.current.stat == DEAD) text += "died" - else if(rev.current.z != 1) + else if(isNotStationLevel(rev.current.z)) text += "fled the station" else text += "survived the revolution" @@ -415,7 +415,7 @@ if(head.current) if(head.current.stat == DEAD) text += "died" - else if(head.current.z != 1) + else if(isNotStationLevel(head.current.z)) text += "fled the station" else text += "survived the revolution" diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 8441ab790b..0dc946aa16 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -417,76 +417,20 @@ /proc/get_all_centcom_jobs() return list("VIP Guest","Custodian","Thunderdome Overseer","Intel Officer","Medical Officer","Death Commando","Research Officer","BlackOps Commander","Supreme Commander") -//gets the actual job rank (ignoring alt titles) -//this is used solely for sechuds -/obj/proc/GetJobRealName() - if (!istype(src, /obj/item/device/pda) && !istype(src,/obj/item/weapon/card/id)) - return - - var/rank - var/assignment - if(istype(src, /obj/item/device/pda)) - if(src:id) - rank = src:id:rank - assignment = src:id:assignment - else if(istype(src, /obj/item/weapon/card/id)) - rank = src:rank - assignment = src:assignment - - if( rank in joblist ) - return rank - - if( assignment in joblist ) - return assignment - - return "Unknown" - -//gets the alt title, failing that the actual job rank -//this is unused -/obj/proc/sdsdsd() //GetJobDisplayName - if (!istype(src, /obj/item/device/pda) && !istype(src,/obj/item/weapon/card/id)) - return - - var/assignment - if(istype(src, /obj/item/device/pda)) - if(src:id) - assignment = src:id:assignment - else if(istype(src, /obj/item/weapon/card/id)) - assignment = src:assignment - - if(assignment) - return assignment - - return "Unknown" +proc/GetIdCard(var/mob/living/carbon/human/H) + if(H.wear_id) + var/id = H.wear_id.GetID() + if(id) + return id + if(H.get_active_hand()) + var/obj/item/I = H.get_active_hand() + return I.GetID() proc/FindNameFromID(var/mob/living/carbon/human/H) ASSERT(istype(H)) - var/obj/item/weapon/card/id/C = H.get_active_hand() - if( istype(C) || istype(C, /obj/item/device/pda) ) - var/obj/item/weapon/card/id/ID = C - - if( istype(C, /obj/item/device/pda) ) - var/obj/item/device/pda/pda = C - ID = pda.id - if(!istype(ID)) - ID = null - - if(ID) - return ID.registered_name - - C = H.wear_id - - if( istype(C) || istype(C, /obj/item/device/pda) ) - var/obj/item/weapon/card/id/ID = C - - if( istype(C, /obj/item/device/pda) ) - var/obj/item/device/pda/pda = C - ID = pda.id - if(!istype(ID)) - ID = null - - if(ID) - return ID.registered_name + var/obj/item/weapon/card/id/C = GetIdCard(H) + if(C) + return C.registered_name proc/get_all_job_icons() //For all existing HUD icons return joblist + list("Prisoner") diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index c75a2a759a..a43056fa96 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -34,7 +34,9 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H), slot_r_hand) else H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H.back), slot_in_backpack) - captain_announcement.Announce("All hands, captain [H.real_name] on deck!") + + var/sound/announce_sound = (ticker.current_state <= GAME_STATE_SETTING_UP)? null : sound('sound/misc/boatswain.ogg', volume=20) + captain_announcement.Announce("All hands, Captain [H.real_name] on deck!", new_sound=announce_sound) H.implant_loyalty(src) diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index 3d83666a46..64209f675b 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -18,6 +18,7 @@ if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/bartender(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/device/pda/bar(H), slot_belt) @@ -56,6 +57,7 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear) H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chef(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/suit/chef(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) @@ -85,6 +87,7 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear) H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/hydroponics(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/clothing/gloves/botanic_leather(H), slot_gloves) @@ -286,6 +289,7 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear) H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/janitor(H), slot_belt) @@ -348,7 +352,7 @@ if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back) H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/internalaffairs(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/internalaffairs(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/internalaffairs(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/big(H), slot_glasses) H.equip_to_slot_or_del(new /obj/item/device/pda/lawyer(H), slot_belt) diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 682c80f174..0c44f6f260 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -70,4 +70,43 @@ if(!isnum(minimal_player_age)) return 0 - return max(0, minimal_player_age - C.player_age) \ No newline at end of file + return max(0, minimal_player_age - C.player_age) + +/datum/job/proc/apply_fingerprints(var/mob/living/carbon/human/H) + if(!istype(H)) + return + if(H.back) + H.back.add_fingerprint(H,1) //The 1 sets a flag to ignore gloves + for(var/obj/item/I in H.back.contents) + I.add_fingerprint(H,1) + if(H.wear_id) + H.wear_id.add_fingerprint(H,1) + if(H.w_uniform) + H.w_uniform.add_fingerprint(H,1) + if(H.wear_suit) + H.wear_suit.add_fingerprint(H,1) + if(H.wear_mask) + H.wear_mask.add_fingerprint(H,1) + if(H.head) + H.head.add_fingerprint(H,1) + if(H.shoes) + H.shoes.add_fingerprint(H,1) + if(H.gloves) + H.gloves.add_fingerprint(H,1) + if(H.l_ear) + H.l_ear.add_fingerprint(H,1) + if(H.r_ear) + H.r_ear.add_fingerprint(H,1) + if(H.glasses) + H.glasses.add_fingerprint(H,1) + if(H.belt) + H.belt.add_fingerprint(H,1) + for(var/obj/item/I in H.belt.contents) + I.add_fingerprint(H,1) + if(H.s_store) + H.s_store.add_fingerprint(H,1) + if(H.l_store) + H.l_store.add_fingerprint(H,1) + if(H.r_store) + H.r_store.add_fingerprint(H,1) + return 1 diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm index 07250e2dd3..085ca17a80 100644 --- a/code/game/jobs/job/medical.dm +++ b/code/game/jobs/job/medical.dm @@ -27,7 +27,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_medical_officer(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/heads/cmo(H), slot_belt) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/cmo(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/cmo(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(H), slot_l_hand) H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) if(H.backbag == 1) @@ -62,24 +62,22 @@ switch(H.mind.role_alt_title) if("Emergency Physician") H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/fr_jacket(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/fr_jacket(H), slot_wear_suit) if("Surgeon") H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical/blue(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/clothing/head/surgery/blue(H), slot_head) if("Virologist") - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/virologist(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/virologist(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/virologist(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/mask/surgical(H), slot_wear_mask) switch(H.backbag) - if(1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/virology(H), slot_back) if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_vir(H), slot_back) if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back) - H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) if("Medical Doctor") H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit) if("Nurse") if(H.gender == FEMALE) if(prob(50)) @@ -91,7 +89,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical/purple(H), slot_w_uniform) else H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt) H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(H), slot_l_hand) @@ -125,7 +123,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chemist(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/chemist(H), slot_belt) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/chemist(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/chemist(H), slot_wear_suit) switch(H.backbag) if(1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/chemistry(H), slot_back) @@ -155,7 +153,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/geneticist(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/geneticist(H), slot_belt) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/genetics(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/genetics(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) switch(H.backbag) if(1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) @@ -190,7 +188,7 @@ H.equip_to_slot_or_del(new /obj/item/device/pda/viro(H), slot_belt) H.equip_to_slot_or_del(new /obj/item/clothing/mask/surgical(H), slot_wear_mask) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/virologist(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/virologist(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) if(H.backbag == 1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) @@ -226,10 +224,10 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/psych/turtleneck(H), slot_w_uniform) else H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt) if(H.backbag == 1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) else - H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm index 3a0118e9b8..b18e8b8ec1 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -25,7 +25,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/research_director(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/device/pda/heads/rd(H), slot_belt) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/weapon/clipboard(H), slot_l_hand) switch(H.backbag) if(1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) @@ -58,7 +58,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/scientist(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/science(H), slot_belt) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/science(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/science(H), slot_wear_suit) switch(H.backbag) if(1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/toxins(H), slot_back) @@ -89,7 +89,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/scientist(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/science(H), slot_belt) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/science(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/science(H), slot_wear_suit) switch(H.backbag) if(1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/toxins(H), slot_back) @@ -122,7 +122,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/roboticist(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/roboticist(H), slot_belt) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit) // H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) H.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(H), slot_l_hand) if(H.backbag == 1) diff --git a/code/game/jobs/job/silicon.dm b/code/game/jobs/job/silicon.dm index 5e067d8556..07ceefb8b3 100644 --- a/code/game/jobs/job/silicon.dm +++ b/code/game/jobs/job/silicon.dm @@ -21,7 +21,7 @@ flag = CYBORG department_flag = ENGSEC faction = "Station" - total_positions = 0 + total_positions = 2 spawn_positions = 2 supervisors = "your laws and the AI" //Nodrak selection_color = "#ddffdd" diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index a564f68692..465b4ef05d 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -348,7 +348,7 @@ var/global/datum/controller/occupations/job_master proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0) - if(!H) return 0 + if(!H) return null var/datum/job/job = GetJob(rank) var/list/spawn_in_storage = list() @@ -386,6 +386,7 @@ var/global/datum/controller/occupations/job_master //Equip job items. job.equip(H) + job.apply_fingerprints(H) else H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator." @@ -444,8 +445,7 @@ var/global/datum/controller/occupations/job_master switch(rank) if("Cyborg") - H.Robotize() - return 1 + return H.Robotize() if("AI","Clown") //don't need bag preference stuff! else switch(H.backbag) //BS12 EDIT @@ -524,7 +524,7 @@ var/global/datum/controller/occupations/job_master H.hud_updateflag |= (1 << ID_HUD) H.hud_updateflag |= (1 << IMPLOYAL_HUD) H.hud_updateflag |= (1 << SPECIALROLE_HUD) - return 1 + return H proc/spawnId(var/mob/living/carbon/human/H, rank, title) diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 641e9473ad..b01b0bbda6 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -45,19 +45,6 @@ if(prob(75)) del(src) -/obj/machinery/optable/attack_paw(mob/user as mob) - if ((HULK in usr.mutations)) - usr << text("\blue You destroy the operating table.") - visible_message("\red [usr] destroys the operating table!") - src.density = 0 - del(src) - if (!( locate(/obj/machinery/optable, user.loc) )) - step(user, get_dir(user, src)) - if (user.loc == src.loc) - user.layer = TURF_LAYER - visible_message("The monkey hides under the table!") - return - /obj/machinery/optable/attack_hand(mob/user as mob) if (HULK in usr.mutations) usr << text("\blue You destroy the table.") diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 047012edcb..026195252e 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -10,7 +10,7 @@ anchored = 1 //About time someone fixed this. density = 1 var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r" - + use_power = 1 idle_power_usage = 40 @@ -50,9 +50,6 @@ /obj/machinery/sleep_console/attack_ai(mob/user as mob) return src.attack_hand(user) -/obj/machinery/sleep_console/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/sleep_console/attack_hand(mob/user as mob) if(..()) return @@ -166,7 +163,7 @@ var/amounts = list(5, 10) var/obj/item/weapon/reagent_containers/glass/beaker = null var/filtering = 0 - + use_power = 1 idle_power_usage = 15 active_power_usage = 200 //builtin health analyzer, dialysis machine, injectors. @@ -188,7 +185,7 @@ process() if (stat & (NOPOWER|BROKEN)) return - + if(filtering > 0) if(beaker) if(beaker.reagents.total_volume < beaker.reagents.maximum_volume) @@ -338,7 +335,7 @@ proc/inject_chemical(mob/living/user as mob, chemical, amount) if (stat & (BROKEN|NOPOWER)) return - + if(src.occupant && src.occupant.reagents) if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20) use_power(amount * CHEM_SYNTH_ENERGY) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 963b07df0f..97e61e5707 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -211,10 +211,6 @@ */ - -/obj/machinery/body_scanconsole/attack_paw(user as mob) - return src.attack_hand(user) - /obj/machinery/body_scanconsole/attack_ai(user as mob) return src.attack_hand(user) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 6ca98474f7..c74f03db43 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -2,32 +2,6 @@ //CONTAINS: Air Alarms and Fire Alarms// //////////////////////////////////////// -/proc/RandomAAlarmWires() - //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). - var/list/AAlarmwires = list(0, 0, 0, 0, 0) - AAlarmIndexToFlag = list(0, 0, 0, 0, 0) - AAlarmIndexToWireColor = list(0, 0, 0, 0, 0) - AAlarmWireColorToIndex = list(0, 0, 0, 0, 0) - var/flagIndex = 1 - for (var/flag=1, flag<32, flag+=flag) - var/valid = 0 - while (!valid) - var/colorIndex = rand(1, 5) - if (AAlarmwires[colorIndex]==0) - valid = 1 - AAlarmwires[colorIndex] = flag - AAlarmIndexToFlag[flagIndex] = flag - AAlarmIndexToWireColor[flagIndex] = colorIndex - AAlarmWireColorToIndex[colorIndex] = flagIndex - flagIndex+=1 - return AAlarmwires - -#define AALARM_WIRE_IDSCAN 1 //Added wires -#define AALARM_WIRE_POWER 2 -#define AALARM_WIRE_SYPHON 3 -#define AALARM_WIRE_AI_CONTROL 4 -#define AALARM_WIRE_AALARM 5 - #define AALARM_MODE_SCRUBBING 1 #define AALARM_MODE_REPLACEMENT 2 //like scrubbing, but faster. #define AALARM_MODE_PANIC 3 //constantly sucks all air @@ -79,9 +53,10 @@ var/locked = 1 var/wiresexposed = 0 // If it's been screwdrivered open. var/aidisabled = 0 - var/AAlarmwires = 31 var/shorted = 0 + var/datum/wires/alarm/wires + var/mode = AALARM_MODE_SCRUBBING var/screen = AALARM_SCREEN_MAIN var/area_uid @@ -103,13 +78,11 @@ var/temperature_dangerlevel = 0 var/other_dangerlevel = 0 - var/apply_danger_level = 1 - var/post_alert = 1 + var/report_danger_level = 1 /obj/machinery/alarm/monitor - apply_danger_level = 0 + report_danger_level = 0 breach_detection = 0 - post_alert = 0 /obj/machinery/alarm/server/New() ..() @@ -153,6 +126,9 @@ if (name == "alarm") name = "[alarm_area.name] Air Alarm" + if(!wires) + wires = new(src) + // breathable air according to human/Life() TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa @@ -454,15 +430,12 @@ send_signal(device_id, list("power"= 0) ) /obj/machinery/alarm/proc/apply_danger_level(var/new_danger_level) - if (apply_danger_level && alarm_area.atmosalert(new_danger_level)) + if (report_danger_level && alarm_area.atmosalert(new_danger_level)) post_alert(new_danger_level) update_icon() /obj/machinery/alarm/proc/post_alert(alert_level) - if(!post_alert) - return - var/datum/radio_frequency/frequency = radio_controller.return_frequency(alarm_frequency) if(!frequency) return @@ -482,125 +455,6 @@ frequency.post_signal(src, alert_signal) - -/////////// -//HACKING// -/////////// -/obj/machinery/alarm/proc/isWireColorCut(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - return ((AAlarmwires & wireFlag) == 0) - -/obj/machinery/alarm/proc/isWireCut(var/wireIndex) - var/wireFlag = AAlarmIndexToFlag[wireIndex] - return ((AAlarmwires & wireFlag) == 0) - -/obj/machinery/alarm/proc/allWiresCut() - var/i = 1 - while(i<=5) - if(AAlarmwires & AAlarmIndexToFlag[i]) - return 0 - i++ - return 1 - -/obj/machinery/alarm/proc/cut(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - var/wireIndex = AAlarmWireColorToIndex[wireColor] - AAlarmwires &= ~wireFlag - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) - locked = 1 - - if(AALARM_WIRE_POWER) - shock(usr, 50) - shorted = 1 - update_icon() - - if (AALARM_WIRE_AI_CONTROL) - if (aidisabled == 0) - aidisabled = 1 - - if(AALARM_WIRE_SYPHON) - mode = AALARM_MODE_PANIC - apply_mode() - - if(AALARM_WIRE_AALARM) - - if (alarm_area.atmosalert(2)) - apply_danger_level(2) - spawn(1) - updateUsrDialog() - update_icon() - - updateDialog() - - return - -/obj/machinery/alarm/proc/mend(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function - AAlarmwires |= wireFlag - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) - - if(AALARM_WIRE_POWER) - shorted = 0 - shock(usr, 50) - update_icon() - - if(AALARM_WIRE_AI_CONTROL) - if (aidisabled == 1) - aidisabled = 0 - - updateDialog() - return - -/obj/machinery/alarm/proc/pulse(var/wireColor) - //var/wireFlag = AAlarmWireColorToFlag[wireColor] //not used in this function - var/wireIndex = AAlarmWireColorToIndex[wireColor] - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) //unlocks for 30 seconds, if you have a better way to hack I'm all ears - locked = 0 - spawn(300) - locked = 1 - - if (AALARM_WIRE_POWER) - if(shorted == 0) - shorted = 1 - update_icon() - - spawn(1200) - if(shorted == 1) - shorted = 0 - update_icon() - - - if (AALARM_WIRE_AI_CONTROL) - if (aidisabled == 0) - aidisabled = 1 - updateDialog() - spawn(10) - if (aidisabled == 1) - aidisabled = 0 - updateDialog() - - if(AALARM_WIRE_SYPHON) - mode = AALARM_MODE_REPLACEMENT - apply_mode() - - if(AALARM_WIRE_AALARM) - if (alarm_area.atmosalert(0)) - apply_danger_level(0) - spawn(1) - updateUsrDialog() - update_icon() - - updateDialog() - return - -/////////////// -//END HACKING// -/////////////// - /obj/machinery/alarm/attack_ai(mob/user) return interact(user) @@ -616,7 +470,7 @@ if(buildstage!=2) return - if ( (get_dist(src, user) > 1 )) + if((get_dist(src, user) > 1 )) if (!istype(user, /mob/living/silicon)) user.machine = null user << browse(null, "window=air_alarm") @@ -629,30 +483,8 @@ user << browse(null, "window=air_alarm") return - if(wiresexposed && (!istype(user, /mob/living/silicon))) - var/t1 = text("[alarm_area.name] Air Alarm WiresAccess Panel
\n") - var/list/wirecolors = list( - "Orange" = 1, - "Dark red" = 2, - "White" = 3, - "Yellow" = 4, - "Black" = 5, - ) - for(var/wiredesc in wirecolors) - var/is_uncut = AAlarmwires & AAlarmWireColorToFlag[wirecolors[wiredesc]] - t1 += "[wiredesc] wire: " - if(!is_uncut) - t1 += "Mend" - - else - t1 += "Cut " - t1 += "Pulse " - - t1 += "
" - t1 += text("
\n[(locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
\n[((shorted || (stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
\n[(aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]") - t1 += text("

Close

") - user << browse(t1, "window=AAlarmwires") - onclose(user, "AAlarmwires") + if(wiresexposed && (!istype(user, /mob/living/silicon/ai))) + wires.Interact(user) if(!shorted) user << browse(return_text(user),"window=air_alarm") @@ -1055,35 +887,6 @@ table tr:first-child th:first-child { border: none;} mode = text2num(href_list["mode"]) apply_mode() - // hrefs that need the AA wires exposed, note that borgs should be in range here too -walter0o - if(wiresexposed && Adjacent(usr)) - - if (href_list["AAlarmwires"]) - var/t1 = text2num(href_list["AAlarmwires"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) - usr << "You need wirecutters!" - return - if (isWireColorCut(t1)) - mend(t1) - else - cut(t1) - if (AAlarmwires == 0) - usr << "You cut last of wires inside [src]" - update_icon() - buildstage = 1 - return - - else if (href_list["pulse"]) - var/t1 = text2num(href_list["pulse"]) - if (!istype(usr.equipped(), /obj/item/device/multitool)) - usr << "You need a multitool!" - return - if (isWireColorCut(t1)) - usr << "You can't pulse a cut wire." - return - else - pulse(t1) - updateUsrDialog() @@ -1115,7 +918,7 @@ table tr:first-child th:first-child { border: none;} user << "It does nothing" return else - if(allowed(usr) && !isWireCut(AALARM_WIRE_IDSCAN)) + if(allowed(usr) && !wires.IsIndexCut(AALARM_WIRE_IDSCAN)) locked = !locked user << "\blue You [ locked ? "lock" : "unlock"] the Air Alarm interface." updateUsrDialog() @@ -1168,12 +971,12 @@ table tr:first-child th:first-child { border: none;} spawn(rand(0,15)) update_icon() -/obj/machinery/alarm/examine() - ..() +/obj/machinery/alarm/examine(mob/user) + ..(user) if (buildstage < 2) - usr << "It is not wired." + user << "It is not wired." if (buildstage < 1) - usr << "The circuit is missing." + user << "The circuit is missing." /* AIR ALARM CIRCUIT Just a object used in constructing air alarms @@ -1286,9 +1089,6 @@ FIRE ALARM /obj/machinery/firealarm/bullet_act(BLAH) return src.alarm() -/obj/machinery/firealarm/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/firealarm/emp_act(severity) if(prob(50/severity)) alarm() ..() @@ -1488,7 +1288,7 @@ FIRE ALARM wiresexposed = 1 pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 - + /obj/machinery/firealarm/initialize() if(z in config.contact_levels) if(security_level) @@ -1571,9 +1371,6 @@ Code shamelessly copied from apc_frame idle_power_usage = 2 active_power_usage = 6 -/obj/machinery/partyalarm/attack_paw(mob/user as mob) - return attack_hand(user) - /obj/machinery/partyalarm/attack_hand(mob/user as mob) if(user.stat || stat & (NOPOWER|BROKEN)) return diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm index 20347eefe6..935feae3e2 100644 --- a/code/game/machinery/atmoalter/area_atmos_computer.dm +++ b/code/game/machinery/atmoalter/area_atmos_computer.dm @@ -21,9 +21,6 @@ attack_ai(var/mob/user as mob) return src.attack_hand(user) - attack_paw(var/mob/user as mob) - return - attack_hand(var/mob/user as mob) if(..(user)) return diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 40e04f0928..1e75aa119d 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -11,8 +11,8 @@ var/canister_color = "yellow" var/can_label = 1 - var/filled = 0.5 - pressure_resistance = 7*ONE_ATMOSPHERE + start_pressure = 45 * ONE_ATMOSPHERE + pressure_resistance = 7 * ONE_ATMOSPHERE var/temperature_resistance = 1000 + T0C volume = 1000 use_power = 0 @@ -24,33 +24,44 @@ icon_state = "redws" canister_color = "redws" can_label = 0 + /obj/machinery/portable_atmospherics/canister/nitrogen name = "Canister: \[N2\]" icon_state = "red" canister_color = "red" can_label = 0 + /obj/machinery/portable_atmospherics/canister/oxygen name = "Canister: \[O2\]" icon_state = "blue" canister_color = "blue" can_label = 0 + /obj/machinery/portable_atmospherics/canister/phoron name = "Canister \[Phoron\]" icon_state = "orange" canister_color = "orange" can_label = 0 + /obj/machinery/portable_atmospherics/canister/carbon_dioxide name = "Canister \[CO2\]" icon_state = "black" canister_color = "black" can_label = 0 + /obj/machinery/portable_atmospherics/canister/air name = "Canister \[Air\]" icon_state = "grey" canister_color = "grey" can_label = 0 + /obj/machinery/portable_atmospherics/canister/air/airlock - filled = 0.05 + start_pressure = 3 * ONE_ATMOSPHERE + +/obj/machinery/portable_atmospherics/canister/empty/ + start_pressure = 0 + can_label = 1 + /obj/machinery/portable_atmospherics/canister/empty/oxygen name = "Canister: \[O2\]" icon_state = "blue" @@ -243,9 +254,6 @@ update_flag /obj/machinery/portable_atmospherics/canister/attack_ai(var/mob/user as mob) return src.attack_hand(user) -/obj/machinery/portable_atmospherics/canister/attack_paw(var/mob/user as mob) - return src.attack_hand(user) - /obj/machinery/portable_atmospherics/canister/attack_hand(var/mob/user as mob) return src.ui_interact(user) @@ -345,28 +353,23 @@ update_flag return 1 /obj/machinery/portable_atmospherics/canister/phoron/New() - ..() - src.air_contents.adjust_gas("phoron", (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)) - + src.air_contents.adjust_gas("phoron", MolesForPressure()) src.update_icon() return 1 /obj/machinery/portable_atmospherics/canister/oxygen/New() - ..() - src.air_contents.adjust_gas("oxygen", (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)) + src.air_contents.adjust_gas("oxygen", MolesForPressure()) src.update_icon() return 1 /obj/machinery/portable_atmospherics/canister/sleeping_agent/New() - ..() - air_contents.adjust_gas("sleeping_agent", (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)) - + air_contents.adjust_gas("sleeping_agent", MolesForPressure()) src.update_icon() return 1 @@ -387,22 +390,21 @@ update_flag ..() - src.air_contents.adjust_gas("nitrogen", (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)) - + src.air_contents.adjust_gas("nitrogen", MolesForPressure()) src.update_icon() return 1 /obj/machinery/portable_atmospherics/canister/carbon_dioxide/New() - ..() - src.air_contents.adjust_gas("carbon_dioxide", (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)) + src.air_contents.adjust_gas("carbon_dioxide", MolesForPressure()) + src.update_icon() return 1 /obj/machinery/portable_atmospherics/canister/air/New() - ..() - src.air_contents.adjust_multi("oxygen", (O2STANDARD*src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature), "nitrogen", (N2STANDARD*src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)) + var/list/air_mix = StandardAirMix() + src.air_contents.adjust_multi("oxygen", air_mix["oxygen"], "nitrogen", air_mix["nitrogen"]) src.update_icon() return 1 diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 1c99ff7344..ad7d55c2aa 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -65,10 +65,10 @@ ) radio_connection.post_signal(src, signal) -/obj/machinery/meter/examine() +/obj/machinery/meter/examine(mob/user) var/t = "A gas flow meter. " - if(get_dist(usr, src) > 3 && !(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead))) + if(get_dist(user, src) > 3 && !(istype(user, /mob/living/silicon/ai) || istype(user, /mob/dead))) t += "\blue You are too far away to read it." else if(stat & (NOPOWER|BROKEN)) @@ -83,12 +83,12 @@ else t += "The connect error light is blinking." - usr << t + user << t /obj/machinery/meter/Click() if(istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine - examine() + usr.examinate(src) return 1 return ..() diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index 615bf17359..9ed28cc125 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -9,7 +9,8 @@ var/volume = 0 var/destroyed = 0 - var/maximum_pressure = 90*ONE_ATMOSPHERE + var/start_pressure = ONE_ATMOSPHERE + var/maximum_pressure = 90 * ONE_ATMOSPHERE /obj/machinery/portable_atmospherics/New() ..() @@ -39,6 +40,14 @@ ..() +/obj/machinery/portable_atmospherics/proc/StandardAirMix() + return list( + "oxygen" = O2STANDARD * MolesForPressure(), + "nitrogen" = N2STANDARD * MolesForPressure()) + +/obj/machinery/portable_atmospherics/proc/MolesForPressure(var/target_pressure = start_pressure) + return (target_pressure * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature) + /obj/machinery/portable_atmospherics/update_icon() return null diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index 718ffcb6b3..9f2c4023b2 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -10,14 +10,20 @@ var/target_pressure = 100 volume = 1000 - + power_rating = 7500 //7500 W ~ 10 HP power_losses = 150 +/obj/machinery/portable_atmospherics/powered/pump/filled + start_pressure = 90 * ONE_ATMOSPHERE + /obj/machinery/portable_atmospherics/powered/pump/New() ..() cell = new/obj/item/weapon/cell(src) + var/list/air_mix = StandardAirMix() + src.air_contents.adjust_multi("oxygen", air_mix["oxygen"], "nitrogen", air_mix["nitrogen"]) + /obj/machinery/portable_atmospherics/powered/pump/update_icon() src.overlays = 0 @@ -53,16 +59,16 @@ /obj/machinery/portable_atmospherics/powered/pump/process() ..() var/power_draw = -1 - + if(on && cell && cell.charge) var/datum/gas_mixture/environment if(holding) environment = holding.air_contents else environment = loc.return_air() - + var/pressure_delta - var/output_volume + var/output_volume var/air_temperature if(direction_out) pressure_delta = target_pressure - environment.return_pressure() @@ -72,15 +78,15 @@ pressure_delta = target_pressure - air_contents.return_pressure() output_volume = air_contents.volume * air_contents.group_multiplier air_temperature = air_contents.temperature? air_contents.temperature : environment.temperature - + var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION) - + if (pressure_delta > 0.01) if (direction_out) power_draw = pump_gas(src, air_contents, environment, transfer_moles, power_rating) else power_draw = pump_gas(src, environment, air_contents, transfer_moles, power_rating) - + if (power_draw < 0) last_flow_rate = 0 last_power_draw = 0 @@ -88,13 +94,13 @@ power_draw = max(power_draw, power_losses) cell.use(power_draw * CELLRATE) last_power_draw = power_draw - + update_connected_network() - + //ran out of charge if (!cell.charge) update_icon() - + src.updateDialog() /obj/machinery/portable_atmospherics/powered/pump/return_air() @@ -103,9 +109,6 @@ /obj/machinery/portable_atmospherics/powered/pump/attack_ai(var/mob/user as mob) return src.attack_hand(user) -/obj/machinery/portable_atmospherics/powered/pump/attack_paw(var/mob/user as mob) - return src.attack_hand(user) - /obj/machinery/portable_atmospherics/powered/pump/attack_hand(var/mob/user as mob) user.set_machine(src) diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index af0a452efe..9e8c508148 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -9,7 +9,7 @@ var/volume_rate = 800 volume = 750 - + power_rating = 7500 //7500 W ~ 10 HP power_losses = 150 @@ -48,7 +48,7 @@ /obj/machinery/portable_atmospherics/powered/scrubber/process() ..() - + var/power_draw = -1 if(on && cell && cell.charge) @@ -57,11 +57,11 @@ environment = holding.air_contents else environment = loc.return_air() - + var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles - + power_draw = scrub_gas(src, scrubbing_gas, environment, air_contents, transfer_moles, power_rating) - + if (power_draw < 0) last_flow_rate = 0 last_power_draw = 0 @@ -69,13 +69,13 @@ power_draw = max(power_draw, power_losses) cell.use(power_draw * CELLRATE) last_power_draw = power_draw - + update_connected_network() - + //ran out of charge if (!cell.charge) update_icon() - + //src.update_icon() src.updateDialog() @@ -85,9 +85,6 @@ /obj/machinery/portable_atmospherics/powered/scrubber/attack_ai(var/mob/user as mob) return src.attack_hand(user) -/obj/machinery/portable_atmospherics/powered/scrubber/attack_paw(var/mob/user as mob) - return src.attack_hand(user) - /obj/machinery/portable_atmospherics/powered/scrubber/attack_hand(var/mob/user as mob) user.set_machine(src) @@ -156,14 +153,14 @@ Flow Rate Regulator: - - - S.perunit) S.amount = round(stored_material[mat] / S.perunit) - S.loc = loc + S.loc = loc diff --git a/code/game/machinery/autolathe_datums.dm b/code/game/machinery/autolathe_datums.dm index 04ce040162..b94f42d0c6 100644 --- a/code/game/machinery/autolathe_datums.dm +++ b/code/game/machinery/autolathe_datums.dm @@ -89,7 +89,7 @@ /datum/autolathe/recipe/rglass name = "reinforced glass sheets" - path = /obj/item/stack/sheet/rglass + path = /obj/item/stack/sheet/glass/reinforced category = "General" is_stack = 1 diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 9289c438e9..9f98f89dee 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -43,28 +43,15 @@ emagged = 2 log_and_message_admins("emagged [src]'s inner circuits") -/obj/machinery/bot/examine() - set src in view() - ..() +/obj/machinery/bot/examine(mob/user) + ..(user) if (src.health < maxhealth) if (src.health > maxhealth/3) - usr << "[src]'s parts look loose." + user << "[src]'s parts look loose." else - usr << "[src]'s parts look very loose!" + user << "[src]'s parts look very loose!" return -/obj/machinery/bot/attack_animal(var/mob/living/simple_animal/M as mob) - if(M.melee_damage_upper == 0) return - src.health -= M.melee_damage_upper - src.visible_message("\red [M] has [M.attacktext] [src]!") - M.attack_log += text("\[[time_stamp()]\] attacked [src.name]") - if(prob(10)) - new /obj/effect/decal/cleanable/blood/oil(src.loc) - healthcheck() - - - - /obj/machinery/bot/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/screwdriver)) if(!locked) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index 5a0e424e15..c7381a5cd1 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -96,9 +96,6 @@ src.icon_state = "medibot[src.on]" src.updateUsrDialog() -/obj/machinery/bot/medbot/attack_paw(mob/user as mob) - return attack_hand(user) - /obj/machinery/bot/medbot/attack_hand(mob/user as mob) . = ..() if (.) diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index ce76680b0d..0ff1bec277 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -93,7 +93,6 @@ suffix = "#[count]" name = "Mulebot ([suffix])" - verbs -= /atom/movable/verb/pull // set up the wire colours in random order diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index f6140d9102..84f3efb167 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -260,6 +260,12 @@ Auto Patrol: []"}, src.mode = 0 walk_to(src,0) + // We re-assess human targets, before bashing their head in, in case their credentials change + if(target && istype(target, /mob/living/carbon/human)) + var/threat = src.assess_perp(target, idcheck, check_records) + if(threat < 4) + target = null + if(target) // make sure target exists if(!lasercolor && Adjacent(target)) // If right next to perp. Lasertag bots do not arrest anyone, just patrol and shoot and whatnot if(istype(src.target,/mob/living/carbon)) @@ -643,7 +649,7 @@ Auto Patrol: []"}, continue if(istype(C, /mob/living/carbon/human)) - src.threatlevel = src.assess_perp(C, idcheck, check_records, lasercolor) + src.threatlevel = src.assess_perp(C, idcheck, check_records) else if(istype(M, /mob/living/simple_animal/hostile)) if(M.stat == DEAD) @@ -669,6 +675,40 @@ Auto Patrol: []"}, else continue +/obj/machinery/bot/secbot/on_assess_perp(mob/living/carbon/human/perp) + if(lasercolor) + return laser_check(perp, lasercolor) + + var/threat = 0 + threat -= laser_check(perp, "b") + threat -= laser_check(perp, "r") + + return threat + +/obj/machinery/bot/secbot/proc/laser_check(mob/living/carbon/human/perp, var/lasercolor) + var/target_suit + var/target_weapon + var/threat = 0 + //Lasertag turrets target the opposing team, how great is that? -Sieve + switch(lasercolor) + if("b") + target_suit = /obj/item/clothing/suit/redtag + target_weapon = /obj/item/weapon/gun/energy/laser/redtag + if("r") + target_suit = /obj/item/clothing/suit/bluetag + target_weapon = /obj/item/weapon/gun/energy/laser/bluetag + + if((istype(perp.r_hand, target_weapon)) || (istype(perp.l_hand, target_weapon))) + threat += 4 + + if(istype(perp, /mob/living/carbon/human)) + if(istype(perp.wear_suit, target_suit)) + threat += 4 + if(istype(perp.belt, target_weapon)) + threat += 2 + + return threat + /obj/machinery/bot/secbot/is_assess_emagged() return emagged == 2 diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 1c8298bd0b..140659a0e5 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -19,11 +19,7 @@ var/obj/item/weapon/camera_assembly/assembly = null // WIRES - var/wires = 63 // 0b111111 - var/list/IndexToFlag = list() - var/list/IndexToWireColor = list() - var/list/WireColorToIndex = list() - var/list/WireColorToFlag = list() + var/datum/wires/camera/wires = null // Wires datum //OTHER @@ -35,7 +31,7 @@ var/busy = 0 /obj/machinery/camera/New() - WireColorToFlag = randomCameraWires() + wires = new(src) assembly = new(src) assembly.state = 4 /* // Use this to look for cameras that have the same c_tag. @@ -115,7 +111,7 @@ else if((iswirecutter(W) || ismultitool(W)) && panel_open) interact(user) - else if(iswelder(W) && canDeconstruct()) + else if(iswelder(W) && wires.CanDeconstruct()) if(weld(W, user)) if(assembly) assembly.loc = src.loc @@ -283,4 +279,11 @@ return 0 return 1 busy = 0 - return 0 \ No newline at end of file + return 0 + +/obj/machinery/camera/interact(mob/living/user as mob) + if(!panel_open || istype(user, /mob/living/silicon/ai)) + return + + user.set_machine(src) + wires.Interact(user) diff --git a/code/game/machinery/camera/wires.dm b/code/game/machinery/camera/wires.dm deleted file mode 100644 index 785b33368a..0000000000 --- a/code/game/machinery/camera/wires.dm +++ /dev/null @@ -1,169 +0,0 @@ -#define CAMERA_WIRE_FOCUS 1 -#define CAMERA_WIRE_POWER 2 -#define CAMERA_WIRE_LIGHT 3 -#define CAMERA_WIRE_ALARM 4 -#define CAMERA_WIRE_NOTHING1 5 -#define CAMERA_WIRE_NOTHING2 6 - -/obj/machinery/camera/proc/randomCameraWires() - //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). - var/list/wires = list(0, 0, 0, 0, 0, 0) - IndexToFlag = list(0, 0, 0, 0, 0, 0) - IndexToWireColor = list(0, 0, 0, 0, 0, 0) - WireColorToIndex = list(0, 0, 0, 0, 0, 0) - var/flagIndex = 1 - //I think it's easier to read this way, also doesn't rely on the random number generator to land on a new wire. - var/list/colorIndexList = list(CAMERA_WIRE_FOCUS, CAMERA_WIRE_POWER, CAMERA_WIRE_LIGHT, CAMERA_WIRE_ALARM, CAMERA_WIRE_NOTHING1, CAMERA_WIRE_NOTHING2) - for (var/flag=1, flag<=32, flag+=flag) - var/colorIndex = pick(colorIndexList) - if (wires[colorIndex]==0) - wires[colorIndex] = flag - IndexToFlag[flagIndex] = flag - IndexToWireColor[flagIndex] = colorIndex - WireColorToIndex[colorIndex] = flagIndex - colorIndexList -= colorIndex // Shortens the list. - //world.log << "Flag: [flag], CIndex: [colorIndex], FIndex: [flagIndex]" - flagIndex+=1 - return wires - -/obj/machinery/camera/proc/isWireColorCut(var/wireColor) - var/wireFlag = WireColorToFlag[wireColor] - return ((src.wires & wireFlag) == 0) - -/obj/machinery/camera/proc/isWireCut(var/wireIndex) - var/wireFlag = IndexToFlag[wireIndex] - return ((src.wires & wireFlag) == 0) - -/obj/machinery/camera/proc/canDeconstruct() - if(isWireCut(CAMERA_WIRE_POWER) && isWireCut(CAMERA_WIRE_FOCUS) && isWireCut(CAMERA_WIRE_LIGHT) && isWireCut(CAMERA_WIRE_NOTHING1) && isWireCut(CAMERA_WIRE_NOTHING2)) - return 1 - else - return 0 - -/obj/machinery/camera/proc/cut(var/wireColor) - var/wireFlag = WireColorToFlag[wireColor] - var/wireIndex = WireColorToIndex[wireColor] - wires &= ~wireFlag - switch(wireIndex) - if(CAMERA_WIRE_FOCUS) - setViewRange(short_range) - - if(CAMERA_WIRE_POWER) - deactivate(usr, 1) - - if(CAMERA_WIRE_LIGHT) - light_disabled = 1 - - if(CAMERA_WIRE_ALARM) - triggerCameraAlarm() - - src.interact(usr) - -/obj/machinery/camera/proc/mend(var/wireColor) - var/wireFlag = WireColorToFlag[wireColor] - var/wireIndex = WireColorToIndex[wireColor] - wires |= wireFlag - switch(wireIndex) - if(CAMERA_WIRE_FOCUS) - setViewRange(initial(view_range)) - - if(CAMERA_WIRE_POWER) - deactivate(usr, 1) - - if(CAMERA_WIRE_LIGHT) - light_disabled = 0 - - if(CAMERA_WIRE_ALARM) - cancelCameraAlarm() - - src.interact(usr) - - -/obj/machinery/camera/proc/pulse(var/wireColor) - var/wireIndex = WireColorToIndex[wireColor] - switch(wireIndex) - if(CAMERA_WIRE_FOCUS) - var/new_range = (view_range == initial(view_range) ? short_range : initial(view_range)) - setViewRange(new_range) - - if(CAMERA_WIRE_POWER) - deactivate(usr, 0) // Kicks anyone watching the camera - - if(CAMERA_WIRE_LIGHT) - light_disabled = !light_disabled - - if(CAMERA_WIRE_ALARM) - src.visible_message("\icon[src] *beep*", "\icon[src] *beep*") - - src.interact(usr) - -/obj/machinery/camera/interact(mob/living/user as mob) - if(!panel_open) - return - - user.set_machine(src) - var/t1 = text("Access Panel
\n") - var/list/wires = list( - "Orange" = 1, - "Dark red" = 2, - "White" = 3, - "Yellow" = 4, - "Blue" = 5, - "Pink" = 6 - ) - for(var/wiredesc in wires) - var/is_uncut = src.wires & WireColorToFlag[wires[wiredesc]] - t1 += "[wiredesc] wire: " - if(!is_uncut) - t1 += "
Mend" - else - t1 += "Cut " - t1 += "Pulse " - t1 += "
" - - t1 += "
\n[(src.view_range == initial(view_range) ? "The focus light is on." : "The focus light is off.")]" - t1 += "
\n[(src.can_use() ? "The power link light is on." : "The power link light is off.")]" - t1 += "
\n[(light_disabled ? "The camera light is off." : "The camera light is on.")]" - t1 += "
\n[(alarm_on ? "The alarm light is on." : "The alarm light is off.")]" - - t1 += "

Close

\n" - user << browse(t1, "window=wires") - onclose(user, "wires") - - - -/obj/machinery/camera/Topic(href, href_list) - ..() - if (in_range(src, usr) && istype(src.loc, /turf)) - usr.set_machine(src) - if (href_list["wires"]) - var/t1 = text2num(href_list["wires"]) - if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) - usr << "You need wirecutters!" - return - if (src.isWireColorCut(t1)) - src.mend(t1) - else - src.cut(t1) - else if (href_list["pulse"]) - var/t1 = text2num(href_list["pulse"]) - if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) - usr << "You need a multitool!" - return - if (src.isWireColorCut(t1)) - usr << "You can't pulse a cut wire." - return - else - src.pulse(t1) - else if (href_list["close2"]) - usr << browse(null, "window=wires") - usr.unset_machine() - return - - -#undef CAMERA_WIRE_FOCUS -#undef CAMERA_WIRE_POWER -#undef CAMERA_WIRE_LIGHT -#undef CAMERA_WIRE_ALARM -#undef CAMERA_WIRE_NOTHING1 -#undef CAMERA_WIRE_NOTHING2 \ No newline at end of file diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 4608944b5f..171646c4b1 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -28,12 +28,13 @@ else overlays.Cut() -/obj/machinery/cell_charger/examine() - set src in oview(5) - ..() - usr << "There's [charging ? "a" : "no"] cell in the charger." +/obj/machinery/cell_charger/examine(mob/user) + if(!..(user, 5)) + return + + user << "There's [charging ? "a" : "no"] cell in the charger." if(charging) - usr << "Current charge: [charging.charge]" + user << "Current charge: [charging.charge]" /obj/machinery/cell_charger/attackby(obj/item/weapon/W, mob/user) if(stat & BROKEN) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 8084ab09ff..aa5d7a02f1 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -96,10 +96,9 @@ src.read_only = !src.read_only user << "You flip the write-protect tab to [src.read_only ? "protected" : "unprotected"]." -/obj/item/weapon/disk/data/examine() - set src in oview(5) - ..() - usr << text("The write-protect tab is set to [src.read_only ? "protected" : "unprotected"].") +/obj/item/weapon/disk/data/examine(mob/user) + ..(user) + user << text("The write-protect tab is set to [src.read_only ? "protected" : "unprotected"].") return //Health Tracker Implant @@ -122,8 +121,7 @@ /obj/machinery/clonepod/attack_ai(mob/user as mob) src.add_hiddenprint(user) return attack_hand(user) -/obj/machinery/clonepod/attack_paw(mob/user as mob) - return attack_hand(user) + /obj/machinery/clonepod/attack_hand(mob/user as mob) if ((isnull(src.occupant)) || (stat & NOPOWER)) return diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 3c153b58d1..9ebc550119 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -43,9 +43,6 @@ var/global/list/holodeck_programs = list( attack_ai(var/mob/user as mob) return src.attack_hand(user) - attack_paw(var/mob/user as mob) - return - attack_hand(var/mob/user as mob) if(..()) @@ -316,15 +313,6 @@ var/global/list/holodeck_programs = list( return // HOLOFLOOR DOES NOT GIVE A FUCK - - - - - - - - - /obj/structure/table/holotable name = "table" desc = "A square piece of metal standing on four metal legs. It can not move." @@ -335,13 +323,6 @@ var/global/list/holodeck_programs = list( layer = 2.8 throwpass = 1 //You can throw objects over this, despite it's density. - -/obj/structure/table/holotable/attack_paw(mob/user as mob) - return attack_hand(user) - -/obj/structure/table/holotable/attack_animal(mob/living/user as mob) //Removed code for larva since it doesn't work. Previous code is now a larva ability. /N - return attack_hand(user) - /obj/structure/table/holotable/attack_hand(mob/user as mob) return // HOLOTABLE DOES NOT GIVE A FUCK @@ -529,10 +510,6 @@ var/global/list/holodeck_programs = list( user << "The station AI is not to interact with these devices!" return -/obj/machinery/readybutton/attack_paw(mob/user as mob) - user << "You are too primitive to use this device." - return - /obj/machinery/readybutton/New() ..() @@ -541,10 +518,14 @@ var/global/list/holodeck_programs = list( user << "The device is a solid button, there's nothing you can do with it!" /obj/machinery/readybutton/attack_hand(mob/user as mob) + if(user.stat || stat & (NOPOWER|BROKEN)) user << "This device is not powered." return + if(!user.IsAdvancedToolUser()) + return 0 + currentarea = get_area(src.loc) if(!currentarea) del(src) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 5e3c29996f..259012f4db 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -87,8 +87,8 @@ var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc ) A.amount = 5 - if(istype(P, /obj/item/stack/sheet/rglass)) - var/obj/item/stack/sheet/rglass/RG = P + if(istype(P, /obj/item/stack/sheet/glass/reinforced)) + var/obj/item/stack/sheet/glass/reinforced/RG = P if (RG.get_amount() < 2) user << "You need two sheets of glass to put in the glass panel." return @@ -161,7 +161,7 @@ icon_state = "3b" else icon_state = "3" - new /obj/item/stack/sheet/rglass( loc, 2 ) + new /obj/item/stack/sheet/glass/reinforced( loc, 2 ) return if(istype(P, /obj/item/weapon/screwdriver)) @@ -388,4 +388,4 @@ That prevents a few funky behaviors. U << "\red ERROR: \black [A_T.name] data core is corrupted. Unable to install." else U << "\red ERROR: \black AI flush is in progress, cannot execute transfer protocol." - return \ No newline at end of file + return diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index cf36af21c9..77e5dc977c 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -24,9 +24,6 @@ /obj/machinery/computer/aifixer/attack_ai(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer/aifixer/attack_paw(var/mob/user as mob) - return attack_hand(user) - /obj/machinery/computer/aifixer/attack_hand(var/mob/user as mob) if(..()) return @@ -36,7 +33,7 @@ if (src.occupant) var/laws - dat += "Stored AI: [src.occupant.name]
System integrity: [(src.occupant.health+100)/2]%
" + dat += "Stored AI: [src.occupant.name]
System integrity: [src.occupant.system_integrity()]%
" for (var/law in occupant.laws.ion) if(law) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 11bebd70b6..2915bf0761 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -56,9 +56,6 @@ /obj/machinery/computer/arcade/attack_ai(mob/user as mob) return src.attack_hand(user) -/obj/machinery/computer/arcade/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/computer/arcade/attack_hand(mob/user as mob) if(..()) return diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index c57ab0de54..14c7847c6a 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -15,11 +15,6 @@ attack_ai(var/mob/user as mob) return attack_hand(user) - - attack_paw(var/mob/user as mob) - return attack_hand(user) - - check_eye(var/mob/user as mob) if (user.stat || ((get_dist(user, src) > 1 || !( user.canmove ) || user.blinded) && !istype(user, /mob/living/silicon))) //user can't see - not sure why canmove is here. return null diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 9341aca674..4342778f9a 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -72,9 +72,6 @@ /obj/machinery/computer/card/attack_ai(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer/card/attack_paw(var/mob/user as mob) - return attack_hand(user) - /obj/machinery/computer/card/attack_hand(mob/user as mob) if(..()) return if(stat & (NOPOWER|BROKEN)) return diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index adb4d24b54..dadda5cfd7 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -69,9 +69,6 @@ ..() return -/obj/machinery/computer/cloning/attack_paw(mob/user as mob) - return attack_hand(user) - /obj/machinery/computer/cloning/attack_ai(mob/user as mob) return attack_hand(user) @@ -137,7 +134,7 @@ dat += "

Current records

" dat += "Back

" for(var/datum/dna2/record/R in src.records) - dat += "
  • [R.dna.real_name]
  • " + dat += "
  • [R.dna.real_name]
  • " if(3) dat += "

    Selected Record

    " diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index a6047cf534..0af60a14c7 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -276,11 +276,6 @@ /obj/machinery/computer/communications/attack_ai(var/mob/user as mob) return src.attack_hand(user) - -/obj/machinery/computer/communications/attack_paw(var/mob/user as mob) - return src.attack_hand(user) - - /obj/machinery/computer/communications/attack_hand(var/mob/user as mob) if(..()) return diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index a23c717a7b..f21322a3e2 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -44,9 +44,6 @@ /obj/machinery/computer/med_data/attack_ai(user as mob) return src.attack_hand(user) -/obj/machinery/computer/med_data/attack_paw(user as mob) - return src.attack_hand(user) - /obj/machinery/computer/med_data/attack_hand(mob/user as mob) if(..()) return diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 5a33b62cb8..042555fe00 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -110,11 +110,6 @@ /obj/machinery/computer/pod/attack_ai(var/mob/user as mob) return attack_hand(user) - -/obj/machinery/computer/pod/attack_paw(var/mob/user as mob) - return attack_hand(user) - - /obj/machinery/computer/pod/attack_hand(var/mob/user as mob) if(..()) return diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 3bd94c747a..56f093276a 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -17,11 +17,6 @@ attack_ai(var/mob/user as mob) return src.attack_hand(user) - - attack_paw(var/mob/user as mob) - return - - attack_hand(var/mob/user as mob) if(..()) return diff --git a/code/game/machinery/computer/prisonshuttle.dm b/code/game/machinery/computer/prisonshuttle.dm index 25607ab66f..f1c57104cc 100644 --- a/code/game/machinery/computer/prisonshuttle.dm +++ b/code/game/machinery/computer/prisonshuttle.dm @@ -21,19 +21,9 @@ var/prison_shuttle_timeleft = 0 var/allowedtocall = 0 var/prison_break = 0 - - attackby(I as obj, user as mob) - return src.attack_hand(user) - - attack_ai(var/mob/user as mob) return src.attack_hand(user) - - attack_paw(var/mob/user as mob) - return src.attack_hand(user) - - attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index f8029b0e96..43e65b1273 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -20,11 +20,6 @@ /obj/machinery/computer/robotics/attack_ai(var/mob/user as mob) return src.attack_hand(user) -/obj/machinery/computer/robotics/attack_paw(var/mob/user as mob) - - return src.attack_hand(user) - return - /obj/machinery/computer/robotics/attack_hand(var/mob/user as mob) if(..()) return @@ -197,10 +192,10 @@ else if (href_list["magbot"]) if(src.allowed(usr)) var/mob/living/silicon/robot/R = locate(href_list["magbot"]) - + // whatever weirdness this is supposed to be, but that is how the href gets added, so here it is again if(istype(R) && istype(usr, /mob/living/silicon) && usr.mind.special_role && (usr.mind.original == usr) && !R.emagged) - + var/choice = input("Are you certain you wish to hack [R.name]?") in list("Confirm", "Abort") if(choice == "Confirm") if(R && istype(R)) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index fde49fb7e3..f1f866864a 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -50,9 +50,6 @@ /obj/machinery/computer/secure_data/attack_ai(mob/user as mob) return attack_hand(user) -/obj/machinery/computer/secure_data/attack_paw(mob/user as mob) - return attack_hand(user) - //Someone needs to break down the dat += into chunks instead of long ass lines. /obj/machinery/computer/secure_data/attack_hand(mob/user as mob) if(..()) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 6d2a4857c5..21d584fe8b 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -33,9 +33,6 @@ /obj/machinery/computer/skills/attack_ai(mob/user as mob) return attack_hand(user) -/obj/machinery/computer/skills/attack_paw(mob/user as mob) - return attack_hand(user) - //Someone needs to break down the dat += into chunks instead of long ass lines. /obj/machinery/computer/skills/attack_hand(mob/user as mob) if(..()) diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm index bc050c6d1d..ba44553b16 100644 --- a/code/game/machinery/computer/specops_shuttle.dm +++ b/code/game/machinery/computer/specops_shuttle.dm @@ -248,9 +248,6 @@ var/specops_shuttle_timeleft = 0 /obj/machinery/computer/specops_shuttle/attack_ai(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer/specops_shuttle/attack_paw(var/mob/user as mob) - return attack_hand(user) - /obj/machinery/computer/specops_shuttle/attackby(I as obj, user as mob) if(istype(I,/obj/item/weapon/card/emag)) user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals." diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm index 7ba21efbcf..970a68b64a 100644 --- a/code/game/machinery/computer/syndicate_specops_shuttle.dm +++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm @@ -184,9 +184,6 @@ var/syndicate_elite_shuttle_timeleft = 0 /obj/machinery/computer/syndicate_elite_shuttle/attack_ai(var/mob/user as mob) return attack_hand(user) -/obj/machinery/computer/syndicate_elite_shuttle/attack_paw(var/mob/user as mob) - return attack_hand(user) - /obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob) if(istype(I,/obj/item/weapon/card/emag)) user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals." diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 106cd2bbad..4e5b64c631 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -288,9 +288,9 @@ obj/item/weapon/circuitboard/rdserver user.visible_message("\blue \The [user] adjusts the jumper on the [src]'s port configuration pins.", "\blue You adjust the jumper on the port configuration pins. Now set to [dir2text(machine_dir)].") return -/obj/item/weapon/circuitboard/unary_atmos/examine() - ..() - usr << "The jumper is connecting the [dir2text(machine_dir)] pins." +/obj/item/weapon/circuitboard/unary_atmos/examine(mob/user) + ..(user) + user << "The jumper is connecting the [dir2text(machine_dir)] pins." /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. diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 48321f9fc8..d9c40ce64e 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -6,9 +6,6 @@ * ~ Zuhayr */ -//Used for logging people entering cryosleep and important items they are carrying. -var/global/list/frozen_crew = list() -var/global/list/frozen_items = list() //Main cryopod console. @@ -20,8 +17,24 @@ var/global/list/frozen_items = list() circuit = "/obj/item/weapon/circuitboard/cryopodcontrol" var/mode = null -/obj/machinery/computer/cryopod/attack_paw() - src.attack_hand() + //Used for logging people entering cryosleep and important items they are carrying. + var/list/frozen_crew = list() + var/list/frozen_items = list() + + var/storage_type = "crewmembers" + var/storage_name = "Cryogenic Oversight Control" + var/allow_items = 1 + +/obj/machinery/computer/cryopod/robot + name = "robotic storage console" + desc = "An interface between crew and the robotic storage systems" + icon = 'icons/obj/robot_storage.dmi' + icon_state = "console" + circuit = "/obj/item/weapon/circuitboard/robotstoragecontrol" + + storage_type = "cyborgs" + storage_name = "Robotic Storage Control" + allow_items = 0 /obj/machinery/computer/cryopod/attack_ai() src.attack_hand() @@ -38,12 +51,13 @@ var/global/list/frozen_items = list() if (!( ticker )) return - dat += "

    Cryogenic Oversight Control
    " + dat += "

    [storage_name]
    " dat += "Welcome, [user.real_name].


    " dat += "View storage log.
    " - dat += "View objects.
    " - dat += "Recover object.
    " - dat += "Recover all objects.
    " + if(allow_items) + dat += "View objects.
    " + dat += "Recover object.
    " + dat += "Recover all objects.
    " user << browse(dat, "window=cryopod_console") onclose(user, "cryopod_console") @@ -59,7 +73,7 @@ var/global/list/frozen_items = list() if(href_list["log"]) - var/dat = "Recently stored crewmembers


    " + var/dat = "Recently stored [storage_type]


    " for(var/person in frozen_crew) dat += "[person]
    " dat += "
    " @@ -67,6 +81,7 @@ var/global/list/frozen_items = list() user << browse(dat, "window=cryolog") if(href_list["view"]) + if(!allow_items) return var/dat = "Recently stored objects


    " for(var/obj/item/I in frozen_items) @@ -76,6 +91,7 @@ var/global/list/frozen_items = list() user << browse(dat, "window=cryoitems") else if(href_list["item"]) + if(!allow_items) return if(frozen_items.len == 0) user << "\blue There is nothing to recover from storage." @@ -95,6 +111,7 @@ var/global/list/frozen_items = list() frozen_items -= I else if(href_list["allitems"]) + if(!allow_items) return if(frozen_items.len == 0) user << "\blue There is nothing to recover from storage." @@ -114,6 +131,11 @@ var/global/list/frozen_items = list() build_path = "/obj/machinery/computer/cryopod" origin_tech = "programming=3" +/obj/item/weapon/circuitboard/robotstoragecontrol + name = "Circuit board (Robotic Storage Console)" + build_path = "/obj/machinery/computer/cryopod/robot" + origin_tech = "programming=3" + //Decorative structures to go alongside cryopods. /obj/structure/cryofeed @@ -146,12 +168,23 @@ var/global/list/frozen_items = list() density = 1 anchored = 1 + var/base_icon_state = "body_scanner_0" + var/occupied_icon_state = "body_scanner_1" + var/on_store_message = "has entered long-term storage." + var/on_store_name = "Cryogenic Oversight" + var/on_enter_occupant_message = "You feel cool air surround you. You go numb as your senses turn inward." + var/allow_occupant_types = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + var/disallow_occupant_types = list() + var/mob/occupant = null // Person waiting to be despawned. var/orient_right = null // Flips the sprite. var/time_till_despawn = 18000 // 30 minutes-ish safe period before being despawned. var/time_entered = 0 // Used to keep track of the safe period. var/obj/item/device/radio/intercom/announce // + var/obj/machinery/computer/cryopod/control_computer + var/last_no_computer_message = 0 + // These items are preserved when the process() despawn proc occurs. var/list/preserve_items = list( /obj/item/weapon/hand_tele, @@ -172,16 +205,64 @@ var/global/list/frozen_items = list() orient_right = 1 icon_state = "body_scanner_0-r" -/obj/machinery/cryopod/New() +/obj/machinery/cryopod/robot + name = "robotic storage unit" + desc = "A storage unit for robots." + icon = 'icons/obj/robot_storage.dmi' + icon_state = "pod_0" + base_icon_state = "pod_0" + occupied_icon_state = "pod_1" + on_store_message = "has entered robotic storage." + on_store_name = "Robotic Storage Oversight" + on_enter_occupant_message = "The storage unit broadcasts a sleep signal to you. Your systems start to shut down, and you enter low-power mode." + allow_occupant_types = list(/mob/living/silicon/robot) + disallow_occupant_types = list(/mob/living/silicon/robot/drone) +/obj/machinery/cryopod/robot/right + orient_right = 1 + icon_state = "pod_0-r" + +/obj/machinery/cryopod/New() announce = new /obj/item/device/radio/intercom(src) if(orient_right) - icon_state = "body_scanner_0-r" + icon_state = "[base_icon_state]-r" else - icon_state = "body_scanner_0" + icon_state = base_icon_state + ..() +/obj/machinery/cryopod/initialize() + ..() + + find_control_computer() + +/obj/machinery/cryopod/proc/find_control_computer(urgent=0) + control_computer = locate(/obj/machinery/computer/cryopod) in src.loc.loc + + // Don't send messages unless we *need* the computer, and less than five minutes have passed since last time we messaged + if(!control_computer && urgent && last_no_computer_message + 5*60*10 < world.time) + log_admin("Cryopod in [src.loc.loc] could not find control computer!") + message_admins("Cryopod in [src.loc.loc] could not find control computer!") + last_no_computer_message = world.time + + return control_computer != null + +/obj/machinery/cryopod/proc/check_occupant_allowed(mob/M) + var/correct_type = 0 + for(var/type in allow_occupant_types) + if(istype(M, type)) + correct_type = 1 + break + + if(!correct_type) return 0 + + for(var/type in disallow_occupant_types) + if(istype(M, type)) + return 0 + + return 1 + //Lifted from Unity stasis.dm and refactored. ~Zuhayr /obj/machinery/cryopod/process() if(occupant) @@ -190,9 +271,18 @@ var/global/list/frozen_items = list() return if(!occupant.client && occupant.stat<2) //Occupant is living and has no client. + if(!control_computer) + if(!find_control_computer(urgent=1)) + return //Drop all items into the pod. for(var/obj/item/W in occupant) + if(istype(W, /obj/item/device/mmi)) + if(istype(occupant, /mob/living/silicon/robot)) + var/mob/living/silicon/robot/R = occupant + if(R.mmi == W) + del(W) + continue occupant.drop_from_inventory(W) W.loc = src @@ -218,8 +308,11 @@ var/global/list/frozen_items = list() if(!preserve) del(W) else - frozen_items += W - W.loc = null + if(control_computer && control_computer.allow_items) + control_computer.frozen_items += W + W.loc = null + else + W.loc = src.loc //Update any existing objectives involving this mob. for(var/datum/objective/O in all_objectives) @@ -268,9 +361,9 @@ var/global/list/frozen_items = list() del(G) if(orient_right) - icon_state = "body_scanner_0-r" + icon_state = "[base_icon_state]-r" else - icon_state = "body_scanner_0" + icon_state = base_icon_state //TODO: Check objectives/mode, update new targets if this mob is the target, spawn new antags? @@ -278,10 +371,10 @@ var/global/list/frozen_items = list() occupant.ckey = null //Make an announcement and log the person entering storage. - frozen_crew += "[occupant.real_name]" + control_computer.frozen_crew += "[occupant.real_name]" - announce.autosay("[occupant.real_name] has entered long-term storage.", "Cryogenic Oversight") - visible_message("\blue The crypod hums and hisses as it moves [occupant.real_name] into storage.", 3) + announce.autosay("[occupant.real_name] [on_store_message]", "[on_store_name]") + visible_message("\blue \The [src] hums and hisses as it moves [occupant.real_name] into storage.", 3) // Delete the mob. del(occupant) @@ -296,17 +389,20 @@ var/global/list/frozen_items = list() if(istype(G, /obj/item/weapon/grab)) if(occupant) - user << "\blue The cryo pod is in use." + user << "\blue \The [src] is in use." return if(!ismob(G:affecting)) return + if(!check_occupant_allowed(G:affecting)) + return + var/willing = null //We don't want to allow people to be forced into despawning. var/mob/M = G:affecting if(M.client) - if(alert(M,"Would you like to enter cryosleep?",,"Yes","No") == "Yes") + if(alert(M,"Would you like to enter long-term storage?",,"Yes","No") == "Yes") if(!M || !G || !G:affecting) return willing = 1 else @@ -314,7 +410,7 @@ var/global/list/frozen_items = list() if(willing) - visible_message("[user] starts putting [G:affecting:name] into the cryo pod.", 3) + visible_message("[user] starts putting [G:affecting:name] into \the [src].", 3) if(do_after(user, 20)) if(!M || !G || !G:affecting) return @@ -326,11 +422,11 @@ var/global/list/frozen_items = list() M.client.eye = src if(orient_right) - icon_state = "body_scanner_1-r" + icon_state = "[occupied_icon_state]-r" else - icon_state = "body_scanner_1" + icon_state = occupied_icon_state - M << "\blue You feel cool air surround you. You go numb as your senses turn inward." + M << "\blue [on_enter_occupant_message]" M << "\blue If you ghost, log out or close your client now, your character will shortly be permanently removed from the round." occupant = M time_entered = world.time @@ -352,9 +448,9 @@ var/global/list/frozen_items = list() return if(orient_right) - icon_state = "body_scanner_0-r" + icon_state = "[base_icon_state]-r" else - icon_state = "body_scanner_0" + icon_state = base_icon_state //Eject any items that aren't meant to be in the pod. var/list/items = src.contents @@ -373,11 +469,11 @@ var/global/list/frozen_items = list() set category = "Object" set src in oview(1) - if(usr.stat != 0 || !(ishuman(usr) || ismonkey(usr))) + if(usr.stat != 0 || !check_occupant_allowed(usr)) return if(src.occupant) - usr << "\blue The cryo pod is in use." + usr << "\blue \The [src] is in use." return for(var/mob/living/carbon/slime/M in range(1,usr)) @@ -385,7 +481,7 @@ var/global/list/frozen_items = list() usr << "You're too busy getting your life sucked out of you." return - visible_message("[usr] starts climbing into the cryo pod.", 3) + visible_message("[usr] starts climbing into \the [src].", 3) if(do_after(usr, 20)) @@ -393,7 +489,7 @@ var/global/list/frozen_items = list() return if(src.occupant) - usr << "\blue The cryo pod is in use." + usr << "\blue \The [src] is in use." return usr.stop_pulling() @@ -403,11 +499,11 @@ var/global/list/frozen_items = list() src.occupant = usr if(orient_right) - icon_state = "body_scanner_1-r" + icon_state = "[occupied_icon_state]-r" else - icon_state = "body_scanner_1" + icon_state = occupied_icon_state - usr << "\blue You feel cool air surround you. You go numb as your senses turn inward." + usr << "\blue [on_enter_occupant_message]" usr << "\blue If you ghost, log out or close your client now, your character will shortly be permanently removed from the round." occupant = usr time_entered = world.time @@ -429,9 +525,9 @@ var/global/list/frozen_items = list() occupant = null if(orient_right) - icon_state = "body_scanner_0-r" + icon_state = "[base_icon_state]-r" else - icon_state = "body_scanner_0" + icon_state = base_icon_state return diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index 496c55ecb6..57de93c0b8 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -10,7 +10,6 @@ desc = "A remote control-switch for a door." power_channel = ENVIRON var/id = null - var/range = 10 var/normaldoorcontrol = CONTROL_POD_DOORS var/desiredstate = 0 // Zero is closed, 1 is open. var/specialfunctions = 1 @@ -41,9 +40,6 @@ else user << "Error, no route to host." -/obj/machinery/door_control/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/door_control/attackby(obj/item/weapon/W, mob/user as mob) /* For later implementation if (istype(W, /obj/item/weapon/screwdriver)) @@ -68,7 +64,7 @@ return src.attack_hand(user) /obj/machinery/door_control/proc/handle_door() - for(var/obj/machinery/door/airlock/D in range(range)) + for(var/obj/machinery/door/airlock/D in world) if(D.id_tag == src.id) if(specialfunctions & OPEN) if (D.density) @@ -112,7 +108,7 @@ return /obj/machinery/door_control/proc/handle_emitters(mob/user as mob) - for(var/obj/machinery/power/emitter/E in range(range)) + for(var/obj/machinery/power/emitter/E in world) if(E.id == src.id) spawn(0) E.activate(user) @@ -155,9 +151,6 @@ /obj/machinery/driver_button/attack_ai(mob/user as mob) return src.attack_hand(user) -/obj/machinery/driver_button/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/driver_button/attackby(obj/item/weapon/W, mob/user as mob) if(istype(W, /obj/item/device/detective_scanner)) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 430bfd5604..bb23176478 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1,76 +1,3 @@ -#define AIRLOCK_WIRE_IDSCAN 1 -#define AIRLOCK_WIRE_MAIN_POWER1 2 -#define AIRLOCK_WIRE_MAIN_POWER2 3 -#define AIRLOCK_WIRE_DOOR_BOLTS 4 -#define AIRLOCK_WIRE_BACKUP_POWER1 5 -#define AIRLOCK_WIRE_BACKUP_POWER2 6 -#define AIRLOCK_WIRE_OPEN_DOOR 7 -#define AIRLOCK_WIRE_AI_CONTROL 8 -#define AIRLOCK_WIRE_ELECTRIFY 9 -#define AIRLOCK_WIRE_SAFETY 10 -#define AIRLOCK_WIRE_SPEED 11 -#define AIRLOCK_WIRE_LIGHT 12 - -/* - New methods: - pulse - sends a pulse into a wire for hacking purposes - cut - cuts a wire and makes any necessary state changes - mend - mends a wire and makes any necessary state changes - isWireColorCut - returns 1 if that color wire is cut, or 0 if not - isWireCut - returns 1 if that wire (e.g. AIRLOCK_WIRE_DOOR_BOLTS) is cut, or 0 if not - canAIControl - 1 if the AI can control the airlock, 0 if not (then check canAIHack to see if it can hack in) - canAIHack - 1 if the AI can hack into the airlock to recover control, 0 if not. Also returns 0 if the AI does not *need* to hack it. - arePowerSystemsOn - 1 if the main or backup power are functioning, 0 if not. Does not check whether the power grid is charged or an APC has equipment on or anything like that. (Check (stat & NOPOWER) for that) - requiresIDs - 1 if the airlock is requiring IDs, 0 if not - isAllPowerCut - 1 if the main and backup power both have cut wires. - regainMainPower - handles the effect of main power coming back on. - loseMainPower - handles the effect of main power going offline. Usually (if one isn't already running) spawn a thread to count down how long it will be offline - counting down won't happen if main power was completely cut along with backup power, though, the thread will just sleep. - loseBackupPower - handles the effect of backup power going offline. - regainBackupPower - handles the effect of main power coming back on. - shock - has a chance of electrocuting its target. -*/ - -//This generates the randomized airlock wire assignments for the game. -/proc/RandomAirlockWires() - var/list/wire_assignments = CreateRandomAirlockWires() - - globalAirlockIndexToFlag = wire_assignments[2] - globalAirlockIndexToWireColor = wire_assignments[3] - globalAirlockWireColorToIndex = wire_assignments[4] - return wire_assignments[1] - -/proc/CreateRandomAirlockWires() - //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). - var/list/wires = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - var/airlockIndexToFlag = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - var/airlockIndexToWireColor = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - var/airlockWireColorToIndex = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - var/flagIndex = 1 - for (var/flag=1, flag<4096, flag+=flag) - var/valid = 0 - var/list/colorList = list(AIRLOCK_WIRE_IDSCAN, AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2, AIRLOCK_WIRE_DOOR_BOLTS, - AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2, AIRLOCK_WIRE_OPEN_DOOR, AIRLOCK_WIRE_AI_CONTROL, AIRLOCK_WIRE_ELECTRIFY, - AIRLOCK_WIRE_SAFETY, AIRLOCK_WIRE_SPEED, AIRLOCK_WIRE_LIGHT) - - while (!valid) - var/colorIndex = pick(colorList) - if(wires[colorIndex]==0) - valid = 1 - wires[colorIndex] = flag - airlockIndexToFlag[flagIndex] = flag - airlockIndexToWireColor[flagIndex] = colorIndex - airlockWireColorToIndex[colorIndex] = flagIndex - colorList -= colorIndex - flagIndex+=1 - return list(wires, airlockIndexToFlag, airlockIndexToWireColor, airlockWireColorToIndex) - -/* Example: -Airlock wires color -> flag are { 64, 128, 256, 2, 16, 4, 8, 32, 1 }. -Airlock wires color -> index are { 7, 8, 9, 2, 5, 3, 4, 6, 1 }. -Airlock index -> flag are { 1, 2, 4, 8, 16, 32, 64, 128, 256 }. -Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. -*/ - /obj/machinery/door/airlock name = "Airlock" icon = 'icons/obj/doors/Doorint.dmi' @@ -86,13 +13,11 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. var/welded = null var/locked = 0 var/lights = 1 // bolt lights show by default - var/wires = 4095 secondsElectrified = 0 //How many seconds remain until the door is no longer electrified. -1 if it is permanently electrified until someone fixes it. var/aiDisabledIdScanner = 0 var/aiHacking = 0 var/obj/machinery/door/airlock/closeOther = null var/closeOtherId = null - var/list/signalers[12] var/lockdownbyai = 0 autoclose = 1 var/assembly_type = /obj/structure/door_assembly @@ -103,10 +28,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. var/obj/item/weapon/airlock_electronics/electronics = null var/hasShocked = 0 //Prevents multiple shocks from happening var/secured_wires = 0 //for mapping use - var/list/airlockIndexToFlag - var/list/airlockWireColorToFlag - var/list/airlockIndexToWireColor - var/list/airlockWireColorToIndex + var/security_bolts = 0 //if 1, door bolts when broken + var/datum/wires/airlock/wires = null /obj/machinery/door/airlock/command name = "Airlock" @@ -141,6 +64,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/glass name = "Glass Airlock" icon = 'icons/obj/doors/Doorglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 opacity = 0 glass = 1 @@ -153,6 +78,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. name = "Vault" icon = 'icons/obj/doors/vault.dmi' opacity = 1 + security_bolts = 1 assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites. /obj/machinery/door/airlock/freezer @@ -176,6 +102,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/glass_command name = "Maintenance Hatch" icon = 'icons/obj/doors/Doorcomglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_com glass = 1 @@ -183,6 +111,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/glass_engineering name = "Maintenance Hatch" icon = 'icons/obj/doors/Doorengglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_eng glass = 1 @@ -190,6 +120,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/glass_security name = "Maintenance Hatch" icon = 'icons/obj/doors/Doorsecglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_sec glass = 1 @@ -197,6 +129,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/glass_medical name = "Maintenance Hatch" icon = 'icons/obj/doors/Doormedglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_med glass = 1 @@ -219,6 +153,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/glass_research name = "Maintenance Hatch" icon = 'icons/obj/doors/Doorresearchglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_research glass = 1 @@ -227,6 +163,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/glass_mining name = "Maintenance Hatch" icon = 'icons/obj/doors/Doorminingglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_min glass = 1 @@ -234,6 +172,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/glass_atmos name = "Maintenance Hatch" icon = 'icons/obj/doors/Dooratmoglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_atmo glass = 1 @@ -321,6 +261,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/highsecurity name = "High Tech Security Airlock" icon = 'icons/obj/doors/hightechsecurity.dmi' + security_bolts = 1 assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity /* @@ -360,176 +301,14 @@ About the new airlock wires panel: /obj/machinery/door/airlock/bumpopen(mob/living/simple_animal/user as mob) ..(user) - -/obj/machinery/door/airlock/proc/pulse(var/wireColor) - //var/wireFlag = airlockWireColorToFlag[wireColor] //not used in this function - var/wireIndex = airlockWireColorToIndex[wireColor] - switch(wireIndex) - if(AIRLOCK_WIRE_IDSCAN) - //Sending a pulse through this flashes the red light on the door (if the door has power). - if((src.arePowerSystemsOn()) && (!(stat & NOPOWER))) - do_animate("deny") - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) - //Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). - src.loseMainPower() - if(AIRLOCK_WIRE_DOOR_BOLTS) - //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not), - //raises them if they are down (only if power's on) - if(!src.locked) - src.lock() - else - src.unlock() - src.updateUsrDialog() - - if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) - //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). - src.loseBackupPower() - if(AIRLOCK_WIRE_AI_CONTROL) - if(src.aiControlDisabled == 0) - src.aiControlDisabled = 1 - else if(src.aiControlDisabled == -1) - src.aiControlDisabled = 2 - src.updateDialog() - spawn(10) - if(src.aiControlDisabled == 1) - src.aiControlDisabled = 0 - else if(src.aiControlDisabled == 2) - src.aiControlDisabled = -1 - src.updateDialog() - if(AIRLOCK_WIRE_ELECTRIFY) - //one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds. - if(src.secondsElectrified==0) - shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") - usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]") - src.secondsElectrified = 30 - spawn(10) - //TODO: Move this into process() and make pulsing reset secondsElectrified to 30 - while (src.secondsElectrified>0) - src.secondsElectrified-=1 - if(src.secondsElectrified<0) - src.secondsElectrified = 0 -// src.updateUsrDialog() //Commented this line out to keep the airlock from clusterfucking you with electricity. --NeoFite - sleep(10) - if(AIRLOCK_WIRE_OPEN_DOOR) - //tries to open the door without ID - //will succeed only if the ID wire is cut or the door requires no access - if(!src.requiresID() || src.check_access(null)) - if(density) open() - else close() - if(AIRLOCK_WIRE_SAFETY) - safe = !safe - if(!src.density) - close() - src.updateUsrDialog() - - if(AIRLOCK_WIRE_SPEED) - normalspeed = !normalspeed - src.updateUsrDialog() - - if(AIRLOCK_WIRE_LIGHT) - lights = !lights - src.updateUsrDialog() - - -/obj/machinery/door/airlock/proc/cut(var/wireColor) - var/wireFlag = airlockWireColorToFlag[wireColor] - var/wireIndex = airlockWireColorToIndex[wireColor] - wires &= ~wireFlag - switch(wireIndex) - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) - //Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user. - src.loseMainPower() - src.shock(usr, 50) - src.updateUsrDialog() - if(AIRLOCK_WIRE_DOOR_BOLTS) - //Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present) - src.lock() - src.updateUsrDialog() - if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) - //Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user. - src.loseBackupPower() - src.shock(usr, 50) - src.updateUsrDialog() - if(AIRLOCK_WIRE_AI_CONTROL) - //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. - //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. - if(src.aiControlDisabled == 0) - src.aiControlDisabled = 1 - else if(src.aiControlDisabled == -1) - src.aiControlDisabled = 2 - src.updateUsrDialog() - if(AIRLOCK_WIRE_ELECTRIFY) - //Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted. - if(src.secondsElectrified != -1) - shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") - usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]") - src.secondsElectrified = -1 - if (AIRLOCK_WIRE_SAFETY) - safe = 0 - src.updateUsrDialog() - - if(AIRLOCK_WIRE_SPEED) - autoclose = 0 - src.updateUsrDialog() - - if(AIRLOCK_WIRE_LIGHT) - lights = 0 - src.updateUsrDialog() - -/obj/machinery/door/airlock/proc/mend(var/wireColor) - var/wireFlag = airlockWireColorToFlag[wireColor] - var/wireIndex = airlockWireColorToIndex[wireColor] //not used in this function - wires |= wireFlag - switch(wireIndex) - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) - if((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2))) - src.regainMainPower() - src.shock(usr, 50) - src.updateUsrDialog() - if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) - if((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))) - src.regainBackupPower() - src.shock(usr, 50) - src.updateUsrDialog() - if(AIRLOCK_WIRE_AI_CONTROL) - //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. - //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. - if(src.aiControlDisabled == 1) - src.aiControlDisabled = 0 - else if(src.aiControlDisabled == 2) - src.aiControlDisabled = -1 - src.updateUsrDialog() - if(AIRLOCK_WIRE_ELECTRIFY) - if(src.secondsElectrified == -1) - src.secondsElectrified = 0 - - if (AIRLOCK_WIRE_SAFETY) - safe = 1 - src.updateUsrDialog() - - if(AIRLOCK_WIRE_SPEED) - autoclose = 1 - if(!src.density) - close() - src.updateUsrDialog() - - if(AIRLOCK_WIRE_LIGHT) - lights = 1 - src.updateUsrDialog() - - /obj/machinery/door/airlock/proc/isElectrified() if(src.secondsElectrified != 0) return 1 return 0 -/obj/machinery/door/airlock/proc/isWireColorCut(var/wireColor) - var/wireFlag = airlockWireColorToFlag[wireColor] - return ((src.wires & wireFlag) == 0) - /obj/machinery/door/airlock/proc/isWireCut(var/wireIndex) - var/wireFlag = airlockIndexToFlag[wireIndex] - return ((src.wires & wireFlag) == 0) + // You can find the wires in the datum folder. + return wires.IsIndexCut(wireIndex) /obj/machinery/door/airlock/proc/canAIControl() return ((src.aiControlDisabled!=1) && (!src.isAllPowerLoss())); @@ -546,7 +325,7 @@ About the new airlock wires panel: return !(src.isWireCut(AIRLOCK_WIRE_IDSCAN) || aiDisabledIdScanner) /obj/machinery/door/airlock/proc/isAllPowerLoss() - if(stat & NOPOWER) + if(stat & (NOPOWER|BROKEN)) return 1 if(src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1) || src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)) if(src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1) || src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2)) @@ -619,10 +398,19 @@ About the new airlock wires panel: overlays = list() if(p_open) overlays += image(icon, "panel_open") + if (!(stat & NOPOWER)) + if(stat & BROKEN) + overlays += image(icon, "sparks_broken") + else if (health < maxhealth * 3/4) + overlays += image(icon, "sparks_damaged") if(welded) overlays += image(icon, "welded") + else if (health < maxhealth * 3/4 && !(stat & NOPOWER)) + overlays += image(icon, "sparks_damaged") else icon_state = "door_open" + if((stat & BROKEN) && !(stat & NOPOWER)) + overlays += image(icon, "sparks_open") return @@ -633,19 +421,24 @@ About the new airlock wires panel: if(p_open) spawn(2) // The only work around that works. Downside is that the door will be gone for a millisecond. flick("o_door_opening", src) //can not use flick due to BYOND bug updating overlays right before flicking + update_icon() else - flick("door_opening", src) + flick("door_opening", src)//[stat ? "_stat":] + update_icon() if("closing") if(overlays) overlays.Cut() if(p_open) - flick("o_door_closing", src) + spawn(2) + flick("o_door_closing", src) + update_icon() else flick("door_closing", src) + update_icon() if("spark") if(density) flick("door_spark", src) if("deny") - if(density) + if(density && !(stat & (BROKEN|NOPOWER))) flick("door_deny", src) return @@ -808,13 +601,11 @@ About the new airlock wires panel: if (src.isElectrified()) if (istype(mover, /obj/item)) var/obj/item/i = mover - if (i.matter["metal"]) + if (i.matter && ("metal" in i.matter) && i.matter["metal"] > 0) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() return ..() -/obj/machinery/door/airlock/attack_paw(mob/user as mob) - return src.attack_hand(user) /obj/machinery/door/airlock/attack_hand(mob/user as mob) if(!istype(usr, /mob/living/silicon)) @@ -842,44 +633,7 @@ About the new airlock wires panel: if(src.p_open) user.set_machine(src) - var/t1 = text("Access Panel
    \n") - - //t1 += text("[]: ", airlockFeatureNames[airlockWireColorToIndex[9]]) - var/list/wires = list( - "Orange" = 1, - "Dark red" = 2, - "White" = 3, - "Yellow" = 4, - "Red" = 5, - "Blue" = 6, - "Green" = 7, - "Grey" = 8, - "Black" = 9, - "Gold" = 10, - "Aqua" = 11, - "Pink" = 12 - ) - for(var/wiredesc in wires) - var/is_uncut = src.wires & airlockWireColorToFlag[wires[wiredesc]] - t1 += "[wiredesc] wire: " - if(!is_uncut) - t1 += "Mend" - else - t1 += "Cut " - t1 += "Pulse " - if(src.signalers[wires[wiredesc]]) - t1 += "Detach signaler" - else - t1 += "Attach signaler" - t1 += "
    " - - t1 += text("
    \n[]
    \n[]
    \n[]
    \n[]
    \n[]
    \n[]", (src.locked ? "The door bolts have fallen!" : "The door bolts look up."), (src.lights ? "The door bolt lights are on." : "The door bolt lights are off!"), ((src.arePowerSystemsOn()) ? "The test light is on." : "The test light is off!"), (src.aiControlDisabled==0 ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), (src.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."), (src.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off.")) - - t1 += text("

    Close

    \n", src) - - user << browse(t1, "window=airlock") - onclose(user, "airlock") - + wires.Interact(user) else ..(user) return @@ -900,69 +654,21 @@ About the new airlock wires panel: return 1 /obj/machinery/door/airlock/Topic(href, href_list, var/nowindow = 0) - if(!nowindow) - ..() - if(usr.stat || usr.restrained()|| usr.small) - return - add_fingerprint(usr) + if(..()) + return 1 + if(href_list["close"]) usr << browse(null, "window=airlock") if(usr.machine==src) usr.unset_machine() - return + return 1 if((in_range(src, usr) && istype(src.loc, /turf)) && src.p_open) usr.set_machine(src) - if(href_list["wires"]) - var/t1 = text2num(href_list["wires"]) - if(!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) - usr << "You need wirecutters!" - return - if(src.isWireColorCut(t1)) - src.mend(t1) - else - src.cut(t1) - else if(href_list["pulse"]) - var/t1 = text2num(href_list["pulse"]) - if(!istype(usr.get_active_hand(), /obj/item/device/multitool)) - usr << "You need a multitool!" - return - if(src.isWireColorCut(t1)) - usr << "You can't pulse a cut wire." - return - else - src.pulse(t1) - else if(href_list["signaler"]) - var/wirenum = text2num(href_list["signaler"]) - if(!istype(usr.get_active_hand(), /obj/item/device/assembly/signaler)) - usr << "You need a signaller!" - return - if(src.isWireColorCut(wirenum)) - usr << "You can't attach a signaller to a cut wire." - return - var/obj/item/device/assembly/signaler/R = usr.get_active_hand() - if(R.secured) - usr << "This radio can't be attached!" - return - var/mob/M = usr - M.drop_item() - R.loc = src - R.airlock_wire = wirenum - src.signalers[wirenum] = R - else if(href_list["remove-signaler"]) - var/wirenum = text2num(href_list["remove-signaler"]) - if(!(src.signalers[wirenum])) - usr << "There's no signaller attached to that wire!" - return - var/obj/item/device/assembly/signaler/R = src.signalers[wirenum] - R.loc = usr.loc - R.airlock_wire = null - src.signalers[wirenum] = null - if(istype(usr, /mob/living/silicon)) if (!check_synth_access(usr)) - return + return 1 //AI //aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door, 8 door safties, 9 door speed @@ -998,8 +704,8 @@ About the new airlock wires panel: else if(src.locked) usr << "The door bolts are already dropped." else - src.lock() - usr << "The door bolts have been dropped." + if(src.lock()) + usr << "The door bolts have been dropped." if(5) //un-electrify door if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY)) @@ -1138,7 +844,7 @@ About the new airlock wires panel: update_icon() if(!nowindow) updateUsrDialog() - return + return 0 /obj/machinery/door/airlock/attackby(C as obj, mob/user as mob) //world << text("airlock attackby src [] obj [] mob []", src, C, user) @@ -1162,7 +868,13 @@ About the new airlock wires panel: else return else if(istype(C, /obj/item/weapon/screwdriver)) - src.p_open = !( src.p_open ) + if (src.p_open) + if (stat & BROKEN) + usr << "The airlock control panel is too damaged to be closed!" + else + src.p_open = 0 + else + src.p_open = 1 src.update_icon() else if(istype(C, /obj/item/weapon/wirecutters)) return src.attack_hand(user) @@ -1173,7 +885,7 @@ About the new airlock wires panel: else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE var/obj/item/weapon/pai_cable/cable = C cable.plugin(src, user) - else if(istype(C, /obj/item/weapon/crowbar) || istype(C, /obj/item/weapon/twohanded/fireaxe) ) + else if(istype(C, /obj/item/weapon/crowbar)) var/beingcrowbarred = null if(istype(C, /obj/item/weapon/crowbar) ) beingcrowbarred = 1 //derp, Agouri @@ -1219,29 +931,32 @@ About the new airlock wires panel: del(src) return - else if(arePowerSystemsOn()) + else if(arePowerSystemsOn() && !(stat & BROKEN)) user << "\blue The airlock's motors resist your efforts to force it." else if(locked) user << "\blue The airlock's bolts prevent it from being forced." else if( !welded && !operating ) if(density) - if(beingcrowbarred == 0) //being fireaxe'd - var/obj/item/weapon/twohanded/fireaxe/F = C - if(F:wielded) - spawn(0) open(1) - else - user << "\red You need to be wielding the Fire axe to do that." - else - spawn(0) open(1) + spawn(0) open(1) else - if(beingcrowbarred == 0) - var/obj/item/weapon/twohanded/fireaxe/F = C - if(F:wielded) - spawn(0) close(1) - else - user << "\red You need to be wielding the Fire axe to do that." + spawn(0) close(1) + + else if(istype(C, /obj/item/weapon/twohanded/fireaxe) && (!arePowerSystemsOn() || (stat & BROKEN))) + if(locked) + user << "\blue The airlock's bolts prevent it from being forced." + else if( !welded && !operating ) + if(density) + var/obj/item/weapon/twohanded/fireaxe/F = C + if(F:wielded) + spawn(0) open(1) else + user << "\red You need to be wielding the Fire axe to do that." + else + var/obj/item/weapon/twohanded/fireaxe/F = C + if(F:wielded) spawn(0) close(1) + else + user << "\red You need to be wielding the Fire axe to do that." else ..() @@ -1252,6 +967,22 @@ About the new airlock wires panel: ignite(is_hot(C)) ..() +/obj/machinery/door/airlock/set_broken() + src.p_open = 1 + stat |= BROKEN + if (src.security_bolts) + lock() + for (var/mob/O in viewers(src, null)) + if ((O.client && !( O.blinded ))) + O.show_message("[src.name]'s control panel bursts open, sparks spewing out!") + + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + + update_icon() + return + /obj/machinery/door/airlock/open(var/forced=0) if( operating || welded || locked ) return 0 @@ -1295,7 +1026,10 @@ About the new airlock wires panel: S.loc = M.loc spawn(20) del(S) - M.emote("scream") + if (iscarbon(M)) + var/mob/living/carbon/C = M + if (!(C.species && (C.species.flags & NO_PAIN))) + M.emote("scream") var/turf/location = src.loc if(istype(location, /turf/simulated)) location.add_blood(M) @@ -1313,12 +1047,13 @@ About the new airlock wires panel: return /obj/machinery/door/airlock/proc/lock(var/forced=0) - if (operating || src.locked) return + if (operating || src.locked) return 0 src.locked = 1 for(var/mob/M in range(1,src)) M.show_message("You hear a click from the bottom of the door.", 2) update_icon() + return 1 /obj/machinery/door/airlock/proc/unlock(var/forced=0) if (operating || !src.locked) return @@ -1335,13 +1070,10 @@ About the new airlock wires panel: ..() //wires - if (!secured_wires) - airlockWireColorToFlag = globalAirlockWireColorToFlag - airlockIndexToFlag = globalAirlockIndexToFlag - airlockIndexToWireColor = globalAirlockIndexToWireColor - airlockWireColorToIndex = globalAirlockWireColorToIndex + if (secured_wires) + wires = new/datum/wires/airlock/secure(src) else - randomize_wires() + wires = new/datum/wires/airlock(src) if(src.closeOtherId != null) spawn (5) @@ -1350,12 +1082,12 @@ About the new airlock wires panel: src.closeOther = A break -/obj/machinery/door/airlock/proc/randomize_wires() - var/wire_assignments = CreateRandomAirlockWires() - airlockWireColorToFlag = wire_assignments[1] - airlockIndexToFlag = wire_assignments[2] - airlockIndexToWireColor = wire_assignments[3] - airlockWireColorToIndex = wire_assignments[4] +/obj/machinery/door/airlock/power_change() //putting this is obj/machinery/door itself makes non-airlock doors turn invisible for some reason + ..() + update_icon() + +/obj/machinery/door/airlock/proc/hasPower() + return ((src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0) && !(stat & NOPOWER)) /obj/machinery/door/airlock/proc/prison_open() src.unlock() diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index d9a3efe959..0a22aa0dd9 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -16,7 +16,7 @@ var/locked = 1 attack_self(mob/user as mob) - if (!ishuman(user) && !istype(user,/mob/living/silicon/robot/drone)) + if (!ishuman(user) && !istype(user,/mob/living/silicon/robot)) return ..(user) var/mob/living/carbon/human/H = user diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index ceb04ad56b..ce29b60898 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -23,6 +23,10 @@ var/normalspeed = 1 var/heat_proof = 0 // For glass airlocks/opacity firedoors var/air_properties_vary_with_direction = 0 + var/maxhealth = 300 + var/health + var/min_force = 10 //minimum amount of force needed to damage the door with a melee weapon + var/hitsound = 'sound/weapons/smash.ogg' //sound door makes when hit with a weapon //Multi-tile doors dir = EAST @@ -47,6 +51,8 @@ bound_width = world.icon_size bound_height = width * world.icon_size + health = maxhealth + update_nearby_tiles(need_rebuild=1) return @@ -120,15 +126,33 @@ src.open() return +/obj/machinery/door/bullet_act(var/obj/item/projectile/Proj) + ..() + + //Tasers and the like should not damage doors. + if(Proj.damage_type == HALLOSS) + return + + if(Proj.damage) + take_damage(Proj.damage) + +/obj/machinery/door/hitby(AM as mob|obj) + + ..() + visible_message("\red [src.name] was hit by [AM].", 1) + var/tforce = 0 + if(ismob(AM)) + tforce = 15 + else + tforce = AM:throwforce + playsound(src.loc, hitsound, 100, 1) + take_damage(tforce) + //..() //Does this really need to be here twice? The parent proc doesn't even do anything yet. - Nodrak + return /obj/machinery/door/attack_ai(mob/user as mob) return src.attack_hand(user) - -/obj/machinery/door/attack_paw(mob/user as mob) - return src.attack_hand(user) - - /obj/machinery/door/attack_hand(mob/user as mob) return src.attackby(user, user) @@ -146,22 +170,69 @@ user = null if(!src.requiresID()) user = null + if(istype(I, /obj/item/stack/sheet/metal)) + if(stat & BROKEN) + user << "\blue [src.name] is damaged beyond repair and must be reconstructed!" + return + if(health >= maxhealth) + user << "\blue Nothing to fix!" + return + var/obj/item/stack/sheet/metal/metalstack = I + var/health_per_sheet = 50 + var/initialhealth = health + src.health = min(maxhealth, health + 100, health + (metalstack.amount * health_per_sheet)) + user.visible_message("\The [user] patches some dents on \the [src] with \the [metalstack].") + metalstack.use(round((health - initialhealth)/health_per_sheet)) + return + if(src.density && ((operable() && istype(I, /obj/item/weapon/card/emag)) || istype(I, /obj/item/weapon/melee/energy/blade))) flick("door_spark", src) sleep(6) open() operating = -1 return 1 - if(src.allowed(user)) + if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card)) + var/obj/item/weapon/W = I + if(W.damtype == BRUTE || W.damtype == BURN) + if(W.force < min_force) + user.visible_message("\red \The [user] hits \the [src] with \the [W] with no visible effect." ) + else + user.visible_message("\red \The [user] forcefully slams \the [src] with \the [W]!" ) + playsound(src.loc, hitsound, 100, 1) + take_damage(W.force) + return + if(src.allowed(user) && operable()) if(src.density) open() else close() return - if(src.density) + if(src.density && !(stat & (NOPOWER|BROKEN))) flick("door_deny", src) return +/obj/machinery/door/proc/take_damage(var/damage) + var/initialhealth = src.health + src.health = max(0, src.health - damage) + if(src.health <= 0 && initialhealth > 0) + src.set_broken() + else if(src.health < src.maxhealth / 4 && initialhealth >= src.maxhealth / 4) + visible_message("\The [src] looks like it's about to break!" ) + else if(src.health < src.maxhealth / 2 && initialhealth >= src.maxhealth / 2) + visible_message("\The [src] looks seriously damaged!" ) + else if(src.health < src.maxhealth * 3/4 && initialhealth >= src.maxhealth * 3/4) + visible_message("\The [src] shows signs of damage!" ) + update_icon() + return + +/obj/machinery/door/proc/set_broken() + stat |= BROKEN + for (var/mob/O in viewers(src, null)) + if ((O.client && !( O.blinded ))) + O.show_message("[src.name] breaks!" ) + update_icon() + return + /obj/machinery/door/blob_act() if(prob(40)) @@ -187,11 +258,15 @@ if(2.0) if(prob(25)) del(src) + else + take_damage(300) if(3.0) if(prob(80)) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(2, 1, src) s.start() + else + take_damage(150) return @@ -293,7 +368,7 @@ /obj/machinery/door/proc/autoclose() var/obj/machinery/door/airlock/A = src - if(!A.density && !A.operating && !A.locked && !A.welded && A.autoclose) + if(!A.density && !A.operating && !A.locked && !A.welded && !(A.stat & (BROKEN|NOPOWER)) && A.autoclose) close() return diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 89c76372fe..264fecbc2b 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -2,7 +2,7 @@ /var/const/CLOSED = 2 #define FIREDOOR_MAX_PRESSURE_DIFF 25 // kPa -#define FIREDOOR_MAX_TEMP 50 // °C +#define FIREDOOR_MAX_TEMP 50 // °C #define FIREDOOR_MIN_TEMP 0 // Bitflags @@ -32,6 +32,8 @@ var/list/users_to_open = new var/next_process_time = 0 + var/hatch_open = 0 + power_channel = ENVIRON use_power = 1 idle_power_usage = 5 @@ -70,17 +72,14 @@ . = ..() -/obj/machinery/door/firedoor/examine() - set src in view() - . = ..() - - if(get_dist(src, usr) > 1 && !isAI(usr)) +/obj/machinery/door/firedoor/examine(mob/user) + if(!..(user, 1) && !isAI(user)) return if(pdiff >= FIREDOOR_MAX_PRESSURE_DIFF) - usr << "WARNING: Current pressure differential is [pdiff]kPa! Opening door may result in injury!" + user << "WARNING: Current pressure differential is [pdiff]kPa! Opening door may result in injury!" - usr << "Sensor readings:" + user << "Sensor readings:" for(var/index = 1; index <= tile_info.len; index++) var/o = "  " switch(index) @@ -94,7 +93,7 @@ o += "WEST: " if(tile_info[index] == null) o += "DATA UNAVAILABLE" - usr << o + user << o continue var/celsius = convert_k2c(tile_info[index][1]) var/pressure = tile_info[index][2] @@ -105,14 +104,14 @@ o += "[celsius]°C " o += "" o += "[pressure]kPa" - usr << o + user << o if(islist(users_to_open) && users_to_open.len) var/users_to_open_string = users_to_open[1] if(users_to_open.len >= 2) for(var/i = 2 to users_to_open.len) users_to_open_string += ", [users_to_open[i]]" - usr << "These people have opened \the [src] during an alert: [users_to_open_string]." + user << "These people have opened \the [src] during an alert: [users_to_open_string]." /obj/machinery/door/firedoor/Bumped(atom/AM) if(p_open || operating) @@ -166,8 +165,6 @@ if(alarmed) // Accountability! users_to_open |= user.name - log_admin("[user]([user.ckey]) has opened an alarming emergency shutter.") - message_admins("[user]([user.ckey]) has opened an alarming emergency shutter.") needs_to_close = 1 spawn() open() @@ -199,6 +196,33 @@ update_icon() return + if(density && istype(C, /obj/item/weapon/screwdriver)) + hatch_open = !hatch_open + user.visible_message("[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance hatch.", + "You have [hatch_open ? "opened" : "closed"] the [src] maintenance hatch.") + update_icon() + return + + if(blocked && istype(C, /obj/item/weapon/crowbar)) + if(!hatch_open) + user << "You must open the maintenance hatch first!" + else + user.visible_message("[user] is removing the electronics from \the [src].", + "You start to remove the electronics from [src].") + if(do_after(user,30)) + if(blocked && density && hatch_open) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) + user.visible_message("[user] has removed the electronics from \the [src].", + "You have removed the electronics from [src].") + + new/obj/item/weapon/airalarm_electronics(src.loc) + var/obj/structure/firedoor_assembly/FA = new/obj/structure/firedoor_assembly(src.loc) + FA.anchored = 1 + FA.density = 1 + FA.update_icon() + del(src) + return + if(blocked) user << "\The [src] is welded solid!" return @@ -302,6 +326,11 @@ return ..() /obj/machinery/door/firedoor/open(var/forced = 0) + if(hatch_open) + hatch_open = 0 + visible_message("The maintenance hatch of \the [src] closes.") + update_icon() + if(!forced) if(stat & (BROKEN|NOPOWER)) return //needs power to open unless it was forced @@ -326,6 +355,8 @@ overlays.Cut() if(density) icon_state = "door_closed" + if(hatch_open) + overlays += "hatch" if(blocked) overlays += "welded" if(pdiff_alert) diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm new file mode 100644 index 0000000000..017e758ef3 --- /dev/null +++ b/code/game/machinery/doors/firedoor_assembly.dm @@ -0,0 +1,48 @@ +obj/structure/firedoor_assembly + name = "\improper emergency shutter assembly" + desc = "It can save lives." + icon = 'icons/obj/doors/DoorHazard.dmi' + icon_state = "door_construction" + anchored = 0 + opacity = 0 + density = 0 + +obj/structure/firedoor_assembly/update_icon() + if(anchored) + icon_state = "door_anchored" + else + icon_state = "door_construction" + +obj/structure/firedoor_assembly/attackby(C as obj, mob/user as mob) + if(istype(C, /obj/item/weapon/airalarm_electronics)) + if(anchored) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + user.visible_message("[user] has inserted a circuit into \the [src]!", + "You have inserted the circuit into \the [src]!") + new /obj/machinery/door/firedoor(src.loc) + del(C) + del(src) + else + user << "You must secure \the [src] first!" + else if(istype(C, /obj/item/weapon/wrench)) + anchored = !anchored + density = !density + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + user.visible_message("[user] has [anchored ? "" : "un" ]secured \the [src]!", + "You have [anchored ? "" : "un" ]secured \the [src]!") + update_icon() + else if(!anchored && istype(C, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = C + if(WT.remove_fuel(0, user)) + user.visible_message("[user] dissassembles \the [src].", + "You start to dissassemble \the [src].") + if(do_after(user, 40)) + if(!src || !WT.isOn()) return + user.visible_message("[user] has dissassembled \the [src].", + "You have dissassembled \the [src].") + new /obj/item/stack/sheet/metal(src.loc, 2) + del (src) + else + user << "You need more welding fuel." + else + ..(C, user) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 89a36e8dc0..33a2878e51 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -4,7 +4,10 @@ icon = 'icons/obj/doors/windoor.dmi' icon_state = "left" var/base_state = "left" - var/health = 150.0 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file + min_force = 4 + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 150 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file + health visible = 0.0 use_power = 0 flags = ON_BORDER @@ -122,7 +125,7 @@ src.operating = 0 return 1 -/obj/machinery/door/window/proc/take_damage(var/damage) +/obj/machinery/door/window/take_damage(var/damage) src.health = max(0, src.health - damage) if (src.health <= 0) new /obj/item/weapon/shard(src.loc) @@ -149,27 +152,6 @@ del(src) return -/obj/machinery/door/window/bullet_act(var/obj/item/projectile/Proj) - if(Proj.damage) - take_damage(round(Proj.damage / 2)) - ..() - -//When an object is thrown at the window -/obj/machinery/door/window/hitby(AM as mob|obj) - - ..() - visible_message("\red The glass door was hit by [AM].", 1) - var/tforce = 0 - if(ismob(AM)) - tforce = 40 - else - tforce = AM:throwforce - playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1) - take_damage(tforce) - //..() //Does this really need to be here twice? The parent proc doesn't even do anything yet. - Nodrak - return - - /obj/machinery/door/window/attack_ai(mob/user as mob) return src.attack_hand(user) diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index ec41175380..84fa419265 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -3,7 +3,7 @@ name = "Embedded Controller" anchored = 1 - + use_power = 1 idle_power_usage = 10 @@ -29,11 +29,11 @@ /obj/machinery/embedded_controller/attack_ai(mob/user as mob) src.ui_interact(user) -/obj/machinery/embedded_controller/attack_paw(mob/user as mob) - user << "You do not have the dexterity to use this." - return - /obj/machinery/embedded_controller/attack_hand(mob/user as mob) + + if(!user.IsAdvancedToolUser()) + return 0 + src.ui_interact(user) /obj/machinery/embedded_controller/ui_interact() @@ -44,7 +44,7 @@ icon_state = "airlock_control_standby" power_channel = ENVIRON density = 0 - + var/id_tag //var/radio_power_use = 50 //power used to xmit signals diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 345d9f44d5..632fee8215 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -122,9 +122,6 @@ /obj/machinery/flasher_button/attack_ai(mob/user as mob) return src.attack_hand(user) -/obj/machinery/flasher_button/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/flasher_button/attackby(obj/item/weapon/W, mob/user as mob) return src.attack_hand(user) diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm index 073973cdee..a4bd1456cf 100644 --- a/code/game/machinery/holosign.dm +++ b/code/game/machinery/holosign.dm @@ -47,8 +47,6 @@ /obj/machinery/holosign_switch/attack_ai(mob/user as mob) return src.attack_hand(user) / -obj/machinery/holosign_switch/attack_paw(mob/user as mob) - return src.attack_hand(user) /obj/machinery/holosign_switch/attackby(obj/item/weapon/W, mob/user as mob) if(istype(W, /obj/item/device/detective_scanner)) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index dcc67a5af2..500c2cf061 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -13,9 +13,6 @@ /obj/machinery/igniter/attack_ai(mob/user as mob) return src.attack_hand(user) -/obj/machinery/igniter/attack_paw(mob/user as mob) - return - /obj/machinery/igniter/attack_hand(mob/user as mob) if(..()) return @@ -63,7 +60,7 @@ /obj/machinery/sparker/power_change() ..() if ( !(stat & NOPOWER) && disable == 0 ) - + icon_state = "[base_state]" // src.sd_SetLuminosity(2) else @@ -121,9 +118,6 @@ /obj/machinery/ignition_switch/attack_ai(mob/user as mob) return src.attack_hand(user) -/obj/machinery/ignition_switch/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/ignition_switch/attackby(obj/item/weapon/W, mob/user as mob) return src.attack_hand(user) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index e677e6e8be..63ad92f017 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -146,12 +146,11 @@ mode = !mode usr << "The IV drip is now [mode ? "injecting" : "taking blood"]." -/obj/machinery/iv_drip/examine() - set src in view() - ..() - if (!(usr in view(2)) && usr!=src.loc) return +/obj/machinery/iv_drip/examine(mob/user) + ..(user) + if (!(user in view(2)) && user!=src.loc) return - usr << "The IV drip is [mode ? "injecting" : "taking blood"]." + user << "The IV drip is [mode ? "injecting" : "taking blood"]." if(beaker) if(beaker.reagents && beaker.reagents.reagent_list.len) diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm new file mode 100644 index 0000000000..4bca09fdcc --- /dev/null +++ b/code/game/machinery/jukebox.dm @@ -0,0 +1,207 @@ +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 + +datum/track + var/title + var/sound + +datum/track/New(var/title_name, var/audio) + title = title_name + sound = audio + +/obj/machinery/media/jukebox/ + name = "space jukebox" + icon = 'icons/obj/jukebox.dmi' + icon_state = "jukebox2-nopower" + var/state_base = "jukebox2" + anchored = 1 + density = 1 + power_channel = EQUIP + + var/playing = 0 + + var/datum/track/current_track + var/list/datum/track/tracks = list( + new/datum/track("Beyond", 'sound/ambience/ambispace.ogg'), + new/datum/track("Clouds of Fire", 'sound/music/clouds.s3m'), + new/datum/track("D`Bert", 'sound/music/title2.ogg'), + new/datum/track("D`Fort", 'sound/ambience/song_game.ogg'), + new/datum/track("Floating", 'sound/music/main.ogg'), + new/datum/track("Endless Space", 'sound/music/space.ogg'), + new/datum/track("Part A", 'sound/misc/TestLoop1.ogg'), + new/datum/track("Scratch", 'sound/music/title1.ogg'), + new/datum/track("Trai`Tor", 'sound/music/traitor.ogg'), + ) + +/obj/machinery/media/jukebox/Del() + StopPlaying() + +/obj/machinery/media/jukebox/power_change() + if(!powered(power_channel) || !anchored) + stat |= NOPOWER + else + stat &= ~NOPOWER + + if(stat & (NOPOWER|BROKEN) && playing) + StopPlaying() + update_icon() + +/obj/machinery/media/jukebox/update_icon() + overlays.Cut() + if(stat & (NOPOWER|BROKEN) || !anchored) + if(stat & BROKEN) + icon_state = "[state_base]-broken" + else + icon_state = "[state_base]-nopower" + return + icon_state = state_base + if(playing) + if(emagged) + overlays += "[state_base]-emagged" + else + overlays += "[state_base]-running" + +/obj/machinery/media/jukebox/Topic(href, href_list) + if(..() || !(Adjacent(usr) || istype(usr, /mob/living/silicon))) + return + + if(!anchored) + usr << "You must secure \the [src] first." + return + + if(stat & (NOPOWER|BROKEN)) + usr << "\the [src] doesn't appear to function." + return + + if(href_list["change_track"]) + for(var/datum/track/T in tracks) + if(T.title == href_list["title"]) + current_track = T + StartPlaying() + break + else if(href_list["stop"]) + StopPlaying() + else if(href_list["play"]) + if(emagged) + playsound(src.loc, 'sound/items/AirHorn.ogg', 100, 1) + for(var/mob/living/carbon/M in ohearers(6, src)) + if(istype(M, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = M + if(istype(H.l_ear, /obj/item/clothing/ears/earmuffs) || istype(H.r_ear, /obj/item/clothing/ears/earmuffs)) + continue + M.sleeping = 0 + M.stuttering += 20 + M.ear_deaf += 30 + M.Weaken(3) + if(prob(30)) + M.Stun(10) + M.Paralyse(4) + else + M.make_jittery(500) + spawn(15) + explode() + else if(current_track == null) + usr << "No track selected." + else + StartPlaying() + + return 1 + +/obj/machinery/media/jukebox/interact(mob/user) + if(stat & (NOPOWER|BROKEN)) + usr << "\the [src] doesn't appear to function." + return + + ui_interact(user) + +/obj/machinery/media/jukebox/ui_interact(mob/user, ui_key = "jukebox", var/datum/nanoui/ui = null, var/force_open = 1) + var/title = "RetroBox - Space Style" + var/data[0] + + if(!(stat & (NOPOWER|BROKEN))) + data["current_track"] = current_track != null ? current_track.title : "" + data["playing"] = playing + + var/list/nano_tracks = new + for(var/datum/track/T in tracks) + nano_tracks[++nano_tracks.len] = list("track" = T.title) + + data["tracks"] = nano_tracks + + // 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) + // 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, "jukebox.tmpl", title, 450, 600) + // when the ui is first opened this is the data it will use + ui.set_initial_data(data) + // open the new ui window + ui.open() + +/obj/machinery/media/jukebox/attack_ai(mob/user as mob) + return src.attack_hand(user) + +/obj/machinery/media/jukebox/attack_hand(var/mob/user as mob) + interact(user) + +/obj/machinery/media/jukebox/proc/explode() + walk_to(src,0) + src.visible_message("\the [src] blows apart!", 1) + + explosion(src.loc, 0, 0, 1, rand(1,2), 1) + + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(3, 1, src) + s.start() + + new /obj/effect/decal/cleanable/blood/oil(src.loc) + del(src) + +/obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob) + src.add_fingerprint(user) + + if(istype(W, /obj/item/weapon/wrench)) + if(playing) + StopPlaying() + user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].") + anchored = !anchored + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + power_change() + update_icon() + return + if(istype(W, /obj/item/weapon/card/emag)) + if(!emagged) + emagged = 1 + StopPlaying() + visible_message("\the [src] makes a fizzling sound.") + log_and_message_admins("emagged \the [src]") + update_icon() + return + + return ..() + +/obj/machinery/media/jukebox/proc/StopPlaying() + var/area/A = get_area(src) + // Always kill the current sound + for(var/mob/living/M in mobs_in_area(A)) + M << sound(null, channel = 1) + + A.forced_ambience = null + playing = 0 + update_icon() + + +/obj/machinery/media/jukebox/proc/StartPlaying() + StopPlaying() + if(!current_track) + return + + var/area/A = get_area(src) + A.forced_ambience = sound(current_track.sound, channel = 1, repeat = 1, volume = 25) + + for(var/mob/living/M in mobs_in_area(A)) + if(M.mind) + A.play_ambience(M) + + playing = 1 + update_icon() diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm index b74d3a587a..a005d0e9d4 100644 --- a/code/game/machinery/kitchen/gibber.dm +++ b/code/game/machinery/kitchen/gibber.dm @@ -62,9 +62,6 @@ else src.overlays += image('icons/obj/kitchen.dmi', "gridle") -/obj/machinery/gibber/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/gibber/relaymove(mob/user as mob) src.go_out() return diff --git a/code/game/machinery/kitchen/juicer.dm b/code/game/machinery/kitchen/juicer.dm index dc62b875ee..a5a15fb876 100644 --- a/code/game/machinery/kitchen/juicer.dm +++ b/code/game/machinery/kitchen/juicer.dm @@ -53,9 +53,6 @@ src.updateUsrDialog() return 0 -/obj/machinery/juicer/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/juicer/attack_ai(mob/user as mob) return 0 diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 0ade94a93f..4af48a539b 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -138,9 +138,6 @@ return 1 src.updateUsrDialog() -/obj/machinery/microwave/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/microwave/attack_ai(mob/user as mob) return 0 diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index ef62417b69..52ca3debd9 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -23,13 +23,22 @@ var/locked = 0 var/panel_open = 0 //Hacking a smartfridge var/scan_id = 1 + var/is_secure = 0 var/datum/wires/smartfridge/wires = null +/obj/machinery/smartfridge/secure/ + is_secure = 1 + /obj/machinery/smartfridge/New() - wires = new(src) + ..() + if(is_secure) + wires = new/datum/wires/smartfridge/secure(src) + else + wires = new/datum/wires/smartfridge(src) /obj/machinery/smartfridge/Del() del(wires) // qdel + ..() /obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj) if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/)) @@ -209,20 +218,12 @@ ..() -/obj/machinery/smartfridge/attack_paw(mob/user as mob) - return attack_hand(user) - /obj/machinery/smartfridge/attack_ai(mob/user as mob) return 0 /obj/machinery/smartfridge/attack_hand(mob/user as mob) if(!ispowered) return - if(seconds_electrified != 0) - if(shock(user, 100)) - return - if(panel_open) - wires.Interact(user) - + wires.Interact(user) ui_interact(user) /******************* @@ -232,12 +233,8 @@ /obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) - var/is_secure = istype(src,/obj/machinery/smartfridge/secure) - var/data[0] data["contents"] = null - data["wires"] = null - data["panel_open"] = panel_open data["electrified"] = seconds_electrified > 0 data["shoot_inventory"] = shoot_inventory data["locked"] = locked diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index f75ebc4171..1c9a9bd21d 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -37,14 +37,9 @@ else icon_state = "light0" -/obj/machinery/light_switch/examine() - set src in oview(1) - if(usr && !usr.stat) - usr << "A light switch. It is [on? "on" : "off"]." - - -/obj/machinery/light_switch/attack_paw(mob/user) - src.attack_hand(user) +/obj/machinery/light_switch/examine(mob/user) + if(..(user, 1)) + user << "A light switch. It is [on? "on" : "off"]." /obj/machinery/light_switch/attack_hand(mob/user) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 77b20f0d3f..c568372c8b 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -192,7 +192,8 @@ Class Procs: return (stat & (NOPOWER|BROKEN|additional_flags)) /obj/machinery/Topic(href, href_list) - ..() + if(..()) + return 1 if(inoperable()) return 1 if(usr.restrained() || usr.lying || usr.stat) @@ -231,9 +232,6 @@ Class Procs: else return src.attack_hand(user) -/obj/machinery/attack_paw(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/attack_hand(mob/user as mob) if(inoperable(MAINT)) return 1 @@ -315,7 +313,7 @@ Class Procs: /obj/machinery/proc/is_assess_emagged() return emagged -/obj/machinery/proc/assess_perp(mob/living/carbon/human/perp, var/auth_weapons, var/check_records, var/lasercolor) +/obj/machinery/proc/assess_perp(mob/living/carbon/human/perp, var/auth_weapons, var/check_records) var/threatcount = 0 //the integer returned if(is_assess_emagged()) @@ -325,59 +323,30 @@ Class Procs: if(threatcount >= 10) return threatcount + //Agent cards lower threatlevel. + var/obj/item/weapon/card/id/id = GetIdCard(perp) + if(id && istype(id, /obj/item/weapon/card/id/syndicate)) + threatcount -= 2 + if(auth_weapons && !src.allowed(perp)) if(istype(perp.l_hand, /obj/item/weapon/gun) || istype(perp.l_hand, /obj/item/weapon/melee)) - if(!istype(perp.l_hand, /obj/item/weapon/gun/energy/laser/bluetag) \ - && !istype(perp.l_hand, /obj/item/weapon/gun/energy/laser/redtag) \ - && !istype(perp.l_hand, /obj/item/weapon/gun/energy/laser/practice)) - threatcount += 4 + threatcount += 4 if(istype(perp.r_hand, /obj/item/weapon/gun) || istype(perp.r_hand, /obj/item/weapon/melee)) - if(!istype(perp.r_hand, /obj/item/weapon/gun/energy/laser/bluetag) \ - && !istype(perp.r_hand, /obj/item/weapon/gun/energy/laser/redtag) \ - && !istype(perp.r_hand, /obj/item/weapon/gun/energy/laser/practice)) - threatcount += 4 + threatcount += 4 if(istype(perp.belt, /obj/item/weapon/gun) || istype(perp.belt, /obj/item/weapon/melee)) - if(!istype(perp.belt, /obj/item/weapon/gun/energy/laser/bluetag) \ - && !istype(perp.belt, /obj/item/weapon/gun/energy/laser/redtag) \ - && !istype(perp.belt, /obj/item/weapon/gun/energy/laser/practice)) - threatcount += 2 + threatcount += 2 if(perp.dna && perp.dna.mutantrace && perp.dna.mutantrace != "none") threatcount += 2 - - //Agent cards lower threatlevel. - if(perp.wear_id && istype(perp.wear_id.GetID(), /obj/item/weapon/card/id/syndicate)) - threatcount -= 2 - - if(lasercolor == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve - threatcount = 0//They will not, however shoot at people who have guns, because it gets really fucking annoying - if(istype(perp.wear_suit, /obj/item/clothing/suit/redtag)) - threatcount += 4 - if((istype(perp.r_hand,/obj/item/weapon/gun/energy/laser/redtag)) || (istype(perp.l_hand,/obj/item/weapon/gun/energy/laser/redtag))) - threatcount += 4 - if(istype(perp.belt, /obj/item/weapon/gun/energy/laser/redtag)) - threatcount += 2 - - if(lasercolor == "r") - threatcount = 0 - if(istype(perp.wear_suit, /obj/item/clothing/suit/bluetag)) - threatcount += 4 - if((istype(perp.r_hand,/obj/item/weapon/gun/energy/laser/bluetag)) || (istype(perp.l_hand,/obj/item/weapon/gun/energy/laser/bluetag))) - threatcount += 4 - if(istype(perp.belt, /obj/item/weapon/gun/energy/laser/bluetag)) - threatcount += 2 - if(check_records) var/perpname = perp.name - if(perp.wear_id) - var/obj/item/weapon/card/id/id = perp.wear_id.GetID() - if(id) - perpname = id.registered_name + if(id) + perpname = id.registered_name - var/datum/data/record/R = find_record("name", perpname, data_core.security) - if(!R || (R.fields["criminal"] == "*Arrest*")) + var/datum/data/record/R = find_security_record("name", perpname) + if(R && (R.fields["criminal"] == "*Arrest*")) threatcount += 4 return threatcount diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 71f450e70f..16e1cc032d 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -126,10 +126,11 @@ attack_ai(var/mob/user) interact(user, 1) - attack_paw() - return - attack_hand(var/mob/user) + + if(!user.IsAdvancedToolUser()) + return 0 + interact(user, 0) interact(var/mob/user, var/ai = 0) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 6d627bacbb..5e278bf2f5 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -7,36 +7,35 @@ var/body ="" var/message_type ="Story" var/datum/feed_channel/parent_channel - var/backup_body ="" - var/backup_author ="" var/is_admin_message = 0 var/icon/img = null - var/icon/backup_img + var/icon/caption = "" + var/time_stamp = "" + var/backup_body = "" + var/backup_author = "" + var/icon/backup_img = null + var/icon/backup_caption = "" /datum/feed_channel var/channel_name="" var/list/datum/feed_message/messages = list() - //var/message_count = 0 var/locked=0 var/author="" var/backup_author="" var/censored=0 var/is_admin_channel=0 var/updated = 0 - //var/page = null //For newspapers - -/datum/feed_channel/proc/announce_news() - return "Breaking news from [channel_name]!" - -/datum/feed_channel/station/announce_news() - return "New Station Announcement Available" + var/announcement = "" /datum/feed_message/proc/clear() src.author = "" src.body = "" + src.caption = "" + src.img = null + src.time_stamp = "" src.backup_body = "" src.backup_author = "" - src.img = null + src.backup_caption = "" src.backup_img = null parent_channel.update() @@ -51,24 +50,49 @@ src.backup_author = "" src.censored = 0 src.is_admin_channel = 0 + src.announcement = "" update() /datum/feed_network var/list/datum/feed_channel/network_channels = list() var/datum/feed_message/wanted_issue -/datum/feed_network/proc/add_news(var/channel_name, var/datum/feed_message/newMsg) - for(var/datum/feed_channel/FC in news_network.network_channels) +/datum/feed_network/New() + CreateFeedChannel("Station Announcements", "SS13", 1, 1, "New Station Announcement Available") + +/datum/feed_network/proc/CreateFeedChannel(var/channel_name, var/author, var/locked, var/adminChannel = 0, var/announcement_message) + var/datum/feed_channel/newChannel = new /datum/feed_channel + newChannel.channel_name = channel_name + newChannel.author = author + newChannel.locked = locked + newChannel.is_admin_channel = adminChannel + if(announcement_message) + newChannel.announcement = announcement_message + else + newChannel.announcement = "Breaking news from [channel_name]!" + network_channels += newChannel + +/datum/feed_network/proc/SubmitArticle(var/msg, var/author, var/channel_name, var/obj/item/weapon/photo/photo, var/adminMessage = 0, var/message_type = "") + var/datum/feed_message/newMsg = new /datum/feed_message + newMsg.author = author + newMsg.body = msg + newMsg.time_stamp = "[worldtime2text()]" + newMsg.is_admin_message = adminMessage + if(message_type) + newMsg.message_type = message_type + if(photo) + newMsg.img = photo.img + newMsg.caption = photo.scribble + for(var/datum/feed_channel/FC in network_channels) if(FC.channel_name == channel_name) - insert_message_in_channel(FC, newMsg) + insert_message_in_channel(FC, newMsg) //Adding message to the network's appropriate feed_channel break /datum/feed_network/proc/insert_message_in_channel(var/datum/feed_channel/FC, var/datum/feed_message/newMsg) - FC.messages += newMsg //Adding message to the network's appropriate feed_channel + FC.messages += newMsg newMsg.parent_channel = FC FC.update() - var/announcement = FC.announce_news() - alert_readers(announcement) + alert_readers(FC.announcement) /datum/feed_network/proc/alert_readers(var/annoncement) for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) @@ -135,7 +159,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co // 1 = there has var/scanned_user = "Unknown" //Will contain the name of the person who currently uses the newscaster var/msg = ""; //Feed message - var/obj/item/weapon/photo/photo = null + var/datum/news_photo/photo_data = null var/channel_name = ""; //the feed channel which will be receiving the feed, or being created var/c_locked=0; //Will our new channel be locked to public submissions? var/hitstaken = 0 //Death at 3 hits from an item with force>=15 @@ -219,8 +243,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co return src.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) return + + if(!user.IsAdvancedToolUser()) + return 0 + if(istype(user, /mob/living/carbon/human) || istype(user,/mob/living/silicon) ) var/mob/living/human_or_robot_user = user var/dat @@ -260,14 +289,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="[CHANNEL.channel_name]
    " else dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()]
    " - /*for(var/datum/feed_channel/CHANNEL in src.channel_list) - dat+="[CHANNEL.channel_name]:
    \[created by: [CHANNEL.author]\]

    " - if( isemptylist(CHANNEL.messages) ) - dat+="No feed messages found in channel...

    " - else - for(var/datum/feed_message/MESSAGE in CHANNEL.messages) - dat+="-[MESSAGE.body]
    \[[MESSAGE.message_type] by [MESSAGE.author]\]
    "*/ - dat+="

    Refresh" dat+="
    Back" if(2) @@ -281,7 +302,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="
    Receiving Channel: [src.channel_name]
    " //MARK dat+="Message Author: [src.scanned_user]
    " dat+="Message Body: [src.msg]
    " - dat+="Attach Photo: [(src.photo ? "Photo Attached" : "No Photo")]
    " + dat+="Attach Photo: [(src.photo_data ? "Photo Attached" : "No Photo")]
    " dat+="
    Submit

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

    " @@ -301,10 +322,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="
    Return
    " if(7) dat+="ERROR: Could not submit Feed Channel to Network.

    " - //var/list/existing_channels = list() //Let's get dem existing channels - OBSOLETE var/list/existing_authors = list() for(var/datum/feed_channel/FC in news_network.network_channels) - //existing_channels += FC.channel_name //OBSOLETE if(FC.author == "\[REDACTED\]") existing_authors += FC.backup_author else @@ -351,8 +370,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="-[MESSAGE.body]
    " if(MESSAGE.img) usr << browse_rsc(MESSAGE.img, "tmp_photo[i].png") - dat+="

    " - dat+="\[[MESSAGE.message_type] by [MESSAGE.author]\]
    " + dat+="
    " + if(MESSAGE.caption) + dat+="[MESSAGE.caption]
    " + dat+="
    " + dat+="\[Story by [MESSAGE.author] - [MESSAGE.time_stamp]\]
    " dat+="

    Refresh" dat+="
    Back" if(10) @@ -417,7 +439,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="
    " dat+="Criminal Name: [src.channel_name]
    " dat+="Description: [src.msg]
    " - dat+="Attach Photo: [(src.photo ? "Photo Attached" : "No Photo")]
    " + dat+="Attach Photo: [(src.photo_data ? "Photo Attached" : "No Photo")]
    " if(wanted_already) dat+="Wanted Issue created by: [news_network.wanted_issue.backup_author]
    " else @@ -468,14 +490,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co human_or_robot_user << browse(dat, "window=newscaster_main;size=400x600") onclose(human_or_robot_user, "newscaster_main") - /*if(src.isbroken) //debugging shit - return - src.hitstaken++ - if(src.hitstaken==3) - src.isbroken = 1 - src.update_icon()*/ - - /obj/machinery/newscaster/Topic(href, href_list) if(..()) return @@ -512,14 +526,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel") if(choice=="Confirm") - var/datum/feed_channel/newChannel = new /datum/feed_channel - newChannel.channel_name = src.channel_name - newChannel.author = src.scanned_user - newChannel.locked = c_locked - feedback_inc("newscaster_channels",1) - /*for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) //Let's add the new channel in all casters. - NEWSCASTER.channel_list += newChannel*/ //Now that it is sane, get it into the list. -OBSOLETE - news_network.network_channels += newChannel //Adding channel to the global network + news_network.CreateFeedChannel(src.channel_name, src.scanned_user, c_locked) src.screen=5 src.updateUsrDialog() //src.update_icon() @@ -530,7 +537,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co for(var/datum/feed_channel/F in news_network.network_channels) if( (!F.locked || F.author == scanned_user) && !F.censored) available_channels += F.channel_name - src.channel_name = strip_html(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels ) + src.channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels src.updateUsrDialog() else if(href_list["set_new_message"]) @@ -547,13 +554,9 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(src.msg =="" || src.msg=="\[REDACTED\]" || src.scanned_user == "Unknown" || src.channel_name == "" ) src.screen=6 else - var/datum/feed_message/newMsg = new /datum/feed_message - newMsg.author = src.scanned_user - newMsg.body = src.msg - if(photo) - newMsg.img = photo.img + var/image = photo_data ? photo_data.photo : null feedback_inc("newscaster_stories",1) - news_network.add_news(src.channel_name, newMsg) + news_network.SubmitArticle(src.msg, src.scanned_user, src.channel_name, image, 0) src.screen=4 src.updateUsrDialog() @@ -620,8 +623,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co WANTED.author = src.channel_name WANTED.body = src.msg WANTED.backup_author = src.scanned_user //I know, a bit wacky - if(photo) - WANTED.img = photo.img + if(photo_data) + WANTED.img = photo_data.photo.img news_network.wanted_issue = WANTED news_network.alert_readers() src.screen = 15 @@ -632,8 +635,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co news_network.wanted_issue.author = src.channel_name news_network.wanted_issue.body = src.msg news_network.wanted_issue.backup_author = src.scanned_user - if(photo) - news_network.wanted_issue.img = photo.img + if(photo_data) + news_network.wanted_issue.img = photo_data.photo.img src.screen = 19 src.updateUsrDialog() @@ -684,16 +687,18 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(MSG.is_admin_message) alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok") return - if(MSG.img != null) - MSG.backup_img = MSG.img - MSG.img = null - else - MSG.img = MSG.backup_img if(MSG.body != "\[REDACTED\]") MSG.backup_body = MSG.body + MSG.backup_caption = MSG.caption + MSG.backup_img = MSG.img MSG.body = "\[REDACTED\]" + MSG.caption = "\[REDACTED\]" + MSG.img = null else MSG.body = MSG.backup_body + MSG.caption = MSG.caption + MSG.img = MSG.backup_img + MSG.parent_channel.update() src.updateUsrDialog() @@ -744,19 +749,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co /obj/machinery/newscaster/attackby(obj/item/I as obj, mob/user as mob) - -/* if (istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda) ) //Name verification for channels or messages - if(src.screen == 4 || src.screen == 5) - if( istype(I, /obj/item/device/pda) ) - var/obj/item/device/pda/P = I - if(P.id) - src.scanned_user = "[P.id.registered_name] ([P.id.assignment])" - src.screen=2 - else - var/obj/item/weapon/card/id/T = I - src.scanned_user = text("[T.registered_name] ([T.assignment])") - src.screen=2*/ //Obsolete after autorecognition - if (src.isbroken) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1) for (var/mob/O in hearers(5, src.loc)) @@ -786,30 +778,34 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co /obj/machinery/newscaster/attack_ai(mob/user as mob) return src.attack_hand(user) //or maybe it'll have some special functions? No idea. +/datum/news_photo + var/is_synth = 0 + var/obj/item/weapon/photo/photo = null -/obj/machinery/newscaster/attack_paw(mob/user as mob) - user << "The newscaster controls are far too complicated for your tiny brain!" - return +/datum/news_photo/New(var/obj/item/weapon/photo/p, var/synth) + is_synth = synth + photo = p /obj/machinery/newscaster/proc/AttachPhoto(mob/user as mob) - if(photo) - if(!issilicon(user)) - photo.loc = src.loc - user.put_in_inactive_hand(photo) - photo = null + if(photo_data) + if(!photo_data.is_synth) + photo_data.photo.loc = src.loc + if(!issilicon(user)) + user.put_in_inactive_hand(photo_data.photo) + del(photo_data) + if(istype(user.get_active_hand(), /obj/item/weapon/photo)) - photo = user.get_active_hand() + var/obj/item/photo = user.get_active_hand() user.drop_item() photo.loc = src + photo_data = new(photo, 0) else if(istype(user,/mob/living/silicon)) var/mob/living/silicon/tempAI = user - var/datum/picture/selection = tempAI.GetPicture() + var/obj/item/weapon/photo/selection = tempAI.GetPicture() if (!selection) return - var/obj/item/weapon/photo/P = new/obj/item/weapon/photo() - P.construct(selection) - photo = P + photo_data = new(selection, 1) //######################################################################################################################## @@ -831,10 +827,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co var/scribble="" var/scribble_page = null -/*obj/item/weapon/newspaper/attack_hand(mob/user as mob) - ..() - world << "derp"*/ - obj/item/weapon/newspaper/attack_self(mob/user as mob) if(ishuman(user)) var/mob/living/carbon/human/human_user = user @@ -974,12 +966,12 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) 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 = "[P.id.registered_name] ([P.id.assignment])" + src.scanned_user = GetNameAndAssignmentFromId(P.id) else src.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 ="[ID.registered_name] ([ID.assignment])" + src.scanned_user = GetNameAndAssignmentFromId(ID) else src.scanned_user ="Unknown" else diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index a1a56bb976..205cc1cede 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -376,7 +376,7 @@ Buildable meters if(PIPE_GAS_MIXER_T) return dir|cw|acw if(PIPE_CAP, PIPE_SUPPLY_CAP, PIPE_SCRUBBERS_CAP) - return flip + return dir ///// Z-Level stuff if(PIPE_UP,PIPE_DOWN,PIPE_SUPPLY_UP,PIPE_SUPPLY_DOWN,PIPE_SCRUBBERS_UP,PIPE_SCRUBBERS_DOWN) return dir diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index e57ccfe1ed..49f566af57 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -7,9 +7,6 @@ var/unwrenched = 0 var/wait = 0 -/obj/machinery/pipedispenser/attack_paw(user as mob) - return src.attack_hand(user) - /obj/machinery/pipedispenser/attack_hand(user as mob) if(..()) return diff --git a/code/game/machinery/portable_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm new file mode 100644 index 0000000000..fa4e75bfc5 --- /dev/null +++ b/code/game/machinery/portable_tag_turret.dm @@ -0,0 +1,128 @@ +#define TURRET_PRIORITY_TARGET 2 +#define TURRET_SECONDARY_TARGET 1 +#define TURRET_NOT_TARGET 0 + +/obj/machinery/porta_turret/tag + // Reasonable defaults, in case someone manually spawns us + var/lasercolor = "r" //Something to do with lasertag turrets, blame Sieve for not adding a comment. + installation = /obj/item/weapon/gun/energy/laser/redtag + +/obj/machinery/porta_turret/tag/red + +/obj/machinery/porta_turret/tag/blue + lasercolor = "b" + installation = /obj/item/weapon/gun/energy/laser/bluetag + +/obj/machinery/porta_turret/tag/New() + ..() + icon_state = "[lasercolor]grey_target_prism" + +/obj/machinery/porta_turret/tag/weapon_setup(var/obj/item/weapon/gun/energy/E) + switch(E.type) + if(/obj/item/weapon/gun/energy/laser/bluetag) + eprojectile = /obj/item/weapon/gun/energy/laser/bluetag + lasercolor = "b" + req_access = list(access_maint_tunnels, access_theatre) + check_records = 0 + auth_weapons = 1 + stun_all = 0 + check_anomalies = 0 + shot_delay = 30 + + if(/obj/item/weapon/gun/energy/laser/redtag) + eprojectile = /obj/item/weapon/gun/energy/laser/redtag + lasercolor = "r" + req_access = list(access_maint_tunnels, access_theatre) + check_records = 0 + auth_weapons = 1 + stun_all = 0 + check_anomalies = 0 + shot_delay = 30 + iconholder = 1 + +/obj/machinery/porta_turret/tag/interact(mob/user) + var/dat + + if(istype(user,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = user + if(lasercolor == "b" && istype(H.wear_suit, /obj/item/clothing/suit/redtag)) + return + if(lasercolor == "r" && istype(H.wear_suit, /obj/item/clothing/suit/bluetag)) + return + dat += text({" + Automatic Portable Turret Installation

    + Status: []
    "}, + + "[on ? "On" : "Off"]" ) + + + user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") + onclose(user, "autosec") + return + +/obj/machinery/porta_turret/tag/update_icon() + if(!anchored) + icon_state = "turretCover" + return + if(stat & BROKEN) + icon_state = "[lasercolor]destroyed_target_prism" + else + if(powered()) + if(on) + if(iconholder) + //lasers have a orange icon + icon_state = "[lasercolor]orange_target_prism" + else + //almost everything has a blue icon + icon_state = "[lasercolor]target_prism" + else + icon_state = "[lasercolor]grey_target_prism" + else + icon_state = "[lasercolor]grey_target_prism" + +/obj/machinery/porta_turret/tag/bullet_act(obj/item/projectile/Proj) + ..() + + if(lasercolor == "b" && disabled == 0) + if(istype(Proj, /obj/item/weapon/gun/energy/laser/redtag)) + disabled = 1 + del(Proj) // qdel + sleep(100) + disabled = 0 + if(lasercolor == "r" && disabled == 0) + if(istype(Proj, /obj/item/weapon/gun/energy/laser/bluetag)) + disabled = 1 + del(Proj) // qdel + sleep(100) + disabled = 0 + +/obj/machinery/porta_turret/tag/assess_living(var/mob/living/L) + if(!L) + return TURRET_NOT_TARGET + + if(L.lying) + return TURRET_NOT_TARGET + + var/target_suit + var/target_weapon + switch(lasercolor) + if("b") + target_suit = /obj/item/clothing/suit/redtag + target_weapon = /obj/item/weapon/gun/energy/laser/redtag + if("r") + target_suit = /obj/item/clothing/suit/bluetag + target_weapon = /obj/item/weapon/gun/energy/laser/bluetag + + + if(target_suit)//Lasertag turrets target the opposing team, how great is that? -Sieve + if((istype(L.r_hand, target_weapon)) || (istype(L.l_hand, target_weapon))) + return TURRET_PRIORITY_TARGET + + if(istype(L, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = L + if(istype(H.wear_suit, target_suit)) + return TURRET_PRIORITY_TARGET + if(istype(H.belt, target_weapon)) + return TURRET_SECONDARY_TARGET + + return TURRET_NOT_TARGET \ No newline at end of file diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 4701669b24..692d4da481 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -3,10 +3,6 @@ This code is slightly more documented than normal, as requested by XSI on IRC. */ -#define TURRET_PRIORITY_TARGET 2 -#define TURRET_SECONDARY_TARGET 1 -#define TURRET_NOT_TARGET 0 - /obj/machinery/porta_turret name = "turret" icon = 'icons/obj/turrets.dmi' @@ -22,7 +18,6 @@ req_one_access = list(access_security, access_heads) power_channel = EQUIP //drains power from the EQUIPMENT channel - var/lasercolor = "" //Something to do with lasertag turrets, blame Sieve for not adding a comment. var/raised = 0 //if the turret cover is "open" and the turret is raised var/raising= 0 //if the turret is currently opening or closing its cover var/health = 80 //the turret's health @@ -51,6 +46,7 @@ var/attacked = 0 //if set to 1, the turret gets pissed off and shoots at people nearby (unless they have sec access!) var/on = 1 //determines if the turret is on + var/lethal = 0 //whether in lethal or stun mode var/disabled = 0 var/shot_sound //what sound should play when the turret fires @@ -58,9 +54,13 @@ var/datum/effect/effect/system/spark_spread/spark_system //the spark system, used for generating... sparks? +/obj/machinery/porta_turret/stationary + lethal = 1 + installation = /obj/item/weapon/gun/energy/laser + /obj/machinery/porta_turret/New() ..() - icon_state = "[lasercolor]grey_target_prism" + icon_state = "grey_target_prism" //Sets up a spark system spark_system = new /datum/effect/effect/system/spark_spread spark_system.set_up(5, 0, src) @@ -71,7 +71,6 @@ setup() /obj/machinery/porta_turret/proc/setup() - var/obj/item/weapon/gun/energy/E = new installation //All energy-based weapons are applicable //var/obj/item/ammo_casing/shottype = E.projectile_type @@ -80,134 +79,140 @@ shot_sound = E.fire_sound eshot_sound = shot_sound - switch(E.type) - if(/obj/item/weapon/gun/energy/laser/bluetag) - eprojectile = /obj/item/weapon/gun/energy/laser/bluetag - lasercolor = "b" - req_access = list(access_maint_tunnels, access_theatre) - check_records = 0 - auth_weapons = 1 - stun_all = 0 - check_anomalies = 0 - shot_delay = 30 + weapon_setup(E) - if(/obj/item/weapon/gun/energy/laser/redtag) - eprojectile = /obj/item/weapon/gun/energy/laser/redtag - lasercolor = "r" - req_access = list(access_maint_tunnels, access_theatre) - check_records = 0 - auth_weapons = 1 - stun_all = 0 - check_anomalies = 0 - shot_delay = 30 - iconholder = 1 - - if(/obj/item/weapon/gun/energy/laser/practice) - iconholder = 1 - eprojectile = /obj/item/projectile/beam +/obj/machinery/porta_turret/proc/weapon_setup(var/obj/item/weapon/gun/energy/E) + if(/obj/item/weapon/gun/energy/laser/practice) + iconholder = 1 + eprojectile = /obj/item/projectile/beam // if(/obj/item/weapon/gun/energy/laser/practice/sc_laser) // iconholder = 1 // eprojectile = /obj/item/projectile/beam - if(/obj/item/weapon/gun/energy/laser/retro) - iconholder = 1 + if(/obj/item/weapon/gun/energy/laser/retro) + iconholder = 1 // if(/obj/item/weapon/gun/energy/laser/retro/sc_retro) // iconholder = 1 - if(/obj/item/weapon/gun/energy/laser/captain) - iconholder = 1 + if(/obj/item/weapon/gun/energy/laser/captain) + iconholder = 1 - if(/obj/item/weapon/gun/energy/lasercannon) - iconholder = 1 + if(/obj/item/weapon/gun/energy/lasercannon) + iconholder = 1 - if(/obj/item/weapon/gun/energy/taser) - eprojectile = /obj/item/projectile/beam - eshot_sound = 'sound/weapons/Laser.ogg' + if(/obj/item/weapon/gun/energy/taser) + eprojectile = /obj/item/projectile/beam + eshot_sound = 'sound/weapons/Laser.ogg' - if(/obj/item/weapon/gun/energy/stunrevolver) - eprojectile = /obj/item/projectile/beam - eshot_sound = 'sound/weapons/Laser.ogg' + if(/obj/item/weapon/gun/energy/stunrevolver) + eprojectile = /obj/item/projectile/beam + eshot_sound = 'sound/weapons/Laser.ogg' - if(/obj/item/weapon/gun/energy/gun) - eprojectile = /obj/item/projectile/beam //If it has, going to kill mode - eshot_sound = 'sound/weapons/Laser.ogg' - egun = 1 + if(/obj/item/weapon/gun/energy/gun) + eprojectile = /obj/item/projectile/beam //If it has, going to kill mode + eshot_sound = 'sound/weapons/Laser.ogg' + egun = 1 - if(/obj/item/weapon/gun/energy/gun/nuclear) - eprojectile = /obj/item/projectile/beam //If it has, going to kill mode - eshot_sound = 'sound/weapons/Laser.ogg' - egun = 1 + if(/obj/item/weapon/gun/energy/gun/nuclear) + eprojectile = /obj/item/projectile/beam //If it has, going to kill mode + eshot_sound = 'sound/weapons/Laser.ogg' + egun = 1 +/obj/machinery/porta_turret/update_icon() + if(!anchored) + icon_state = "turretCover" + return + if(stat & BROKEN) + icon_state = "destroyed_target_prism" + else + if(powered()) + if(on) + if(iconholder) + //lasers have a orange icon + icon_state = "orange_target_prism" + else + //almost everything has a blue icon + icon_state = "target_prism" + else + icon_state = "grey_target_prism" + else + icon_state = "grey_target_prism" /obj/machinery/porta_turret/Del() //deletes its own cover with it del(cover) // qdel ..() +/obj/machinery/porta_turret/proc/can_use(mob/user) + if(ailock && issilicon(user)) + user << "There seems to be a firewall preventing you from accessing this device." + return 0 + + if(locked && !issilicon(user)) + user << "Access denied." + return 0 + + return 1 /obj/machinery/porta_turret/attack_ai(mob/user) - if(!ailock) - return attack_hand(user) - else - user << "There seems to be a firewall preventing you from accessing this device." - + return attack_hand(user) /obj/machinery/porta_turret/attack_hand(mob/user) - . = ..() - if(.) - return - var/dat + if(..()) + return 1 + if(!can_use(user)) + return 1 + interact(user) - //The browse() text, similar to ED-209s and beepskies. - if(!lasercolor) //Lasertag turrets have less options - dat += text({" - Automatic Portable Turret Installation

    - Status: []
    - Behaviour controls are [locked ? "locked" : "unlocked"]"}, +/obj/machinery/porta_turret/interact(mob/user) + var/dat = text({" + Automatic Portable Turret Installation

    + Status: []
    + Behaviour controls are [locked ? "locked" : "unlocked"]"}, - "[on ? "On" : "Off"]" ) + "[on ? "On" : "Off"]" ) - if(!locked || issilicon(user)) - dat += text({"

    - Neutralize All Non-Synthetics: []
    - Check for Weapon Authorization: []
    - Check Security Records: []
    - Neutralize All Non-Authorized Personnel: []
    - Neutralize All Unidentified Life Signs: []
    "}, + if(!locked || issilicon(user)) + dat += text({"

    + Lethal Mode: []
    + Neutralize All Non-Synthetics: []
    "}, - "[ai ? "Yes" : "No"]", - "[auth_weapons ? "Yes" : "No"]", - "[check_records ? "Yes" : "No"]", - "[stun_all ? "Yes" : "No"]", - "[check_anomalies ? "Yes" : "No"]" ) - else - if(istype(user,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = user - if(lasercolor == "b" && istype(H.wear_suit, /obj/item/clothing/suit/redtag)) - return - if(lasercolor == "r" && istype(H.wear_suit, /obj/item/clothing/suit/bluetag)) - return - dat += text({" - Automatic Portable Turret Installation

    - Status: []
    "}, - - "[on ? "On" : "Off"]" ) + "[lethal ? "Enabled" : "Disabled"]", + "[ai ? "Yes" : "No"]") + if(!ai) + dat += text({"Check for Weapon Authorization: []
    + Check Security Records: []
    + Neutralize All Non-Authorized Personnel: []
    + Neutralize All Unidentified Life Signs: []
    "}, + "[auth_weapons ? "Yes" : "No"]", + "[check_records ? "Yes" : "No"]", + "[stun_all ? "Yes" : "No"]", + "[check_anomalies ? "Yes" : "No"]" ) user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") onclose(user, "autosec") return +/obj/machinery/porta_turret/proc/HasController() + var/area/A = get_area(src) + return A && A.turret_controls.len > 0 + /obj/machinery/porta_turret/Topic(href, href_list) if(..()) - return + return 1 + if(!can_use(usr)) + return 1 + usr.set_machine(src) - add_fingerprint(usr) - if(href_list["power"] && (!locked || issilicon(usr))) + if(href_list["power"]) if(anchored) //you can't turn a turret on/off if it's not anchored/secured - on = !on //toggle on/off + if(HasController()) + usr << "Turrets can only be [on ? "disabled" : "enabled"] using the assigned turret controller." + else + on = !on //toggle on/off else usr << "It has to be secured first!" @@ -215,6 +220,12 @@ return switch(href_list["operation"]) //toggles customizable behavioural protocols + if("togglelethal") + if(!controllock) + if(HasController()) + usr << "Weapon mode can only be altered using the assigned turret controller." + else + lethal = !lethal if("toggleai") ai = !ai if("authweapon") @@ -223,33 +234,19 @@ check_records = !check_records if("shootall") stun_all = !stun_all + if("checkxenos") + check_anomalies = !check_anomalies updateUsrDialog() /obj/machinery/porta_turret/power_change() - - if(!anchored) - icon_state = "turretCover" - return - if(stat & BROKEN) - icon_state = "[lasercolor]destroyed_target_prism" + if(powered()) + stat &= ~NOPOWER + update_icon() else - if(powered()) - if(on) - if(iconholder) - //lasers have a orange icon - icon_state = "[lasercolor]orange_target_prism" - else - //almost everything has a blue icon - icon_state = "[lasercolor]target_prism" - else - icon_state = "[lasercolor]grey_target_prism" - stat &= ~NOPOWER - else - spawn(rand(0, 15)) - icon_state = "[lasercolor]grey_target_prism" - stat |= NOPOWER - + spawn(rand(0, 15)) + stat |= NOPOWER + update_icon() /obj/machinery/porta_turret/attackby(obj/item/I, mob/user) @@ -258,21 +255,20 @@ //If the turret is destroyed, you can remove it with a crowbar to //try and salvage its components user << "You begin prying the metal coverings off." - sleep(20) - if(prob(70)) - user << "You remove the turret and salvage some components." - if(installation) - var/obj/item/weapon/gun/energy/Gun = new installation(loc) - Gun.power_supply.charge = gun_charge - Gun.update_icon() - lasercolor = null - if(prob(50)) - new /obj/item/stack/sheet/metal(loc, rand(1,4)) - if(prob(50)) - new /obj/item/device/assembly/prox_sensor(loc) - else - user << "You remove the turret but did not manage to salvage anything." - del(src) // qdel + if(do_after(user, 20)) + if(prob(70)) + user << "You remove the turret and salvage some components." + if(installation) + var/obj/item/weapon/gun/energy/Gun = new installation(loc) + Gun.power_supply.charge = gun_charge + Gun.update_icon() + if(prob(50)) + new /obj/item/stack/sheet/metal(loc, rand(1,4)) + if(prob(50)) + new /obj/item/device/assembly/prox_sensor(loc) + else + user << "You remove the turret but did not manage to salvage anything." + del(src) // qdel if(istype(I, /obj/item/weapon/card/emag) && !emagged) //Emagging the turret makes it go bonkers and stun everyone. It also makes @@ -288,20 +284,24 @@ else if((istype(I, /obj/item/weapon/wrench)) && (!on)) if(raised) return - //This code handles moving the turret around. After all, it's a portable turret! - if(!anchored && !isinspace()) - anchored = 1 - invisibility = INVISIBILITY_LEVEL_TWO - icon_state = "[lasercolor]grey_target_prism" - user << "You secure the exterior bolts on the turret." - cover = new /obj/machinery/porta_turret_cover(loc) //create a new turret. While this is handled in process(), this is to workaround a bug where the turret becomes invisible for a split second - cover.Parent_Turret = src //make the cover's parent src - else if(anchored) - anchored = 0 - user << "You unsecure the exterior bolts on the turret." - icon_state = "turretCover" - invisibility = 0 - del(cover) //deletes the cover, and the turret instance itself becomes its own cover. - qdel + + if(do_after(user, 50)) + //This code handles moving the turret around. After all, it's a portable turret! + if(!anchored && !isinspace()) + playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) + anchored = 1 + invisibility = INVISIBILITY_LEVEL_TWO + update_icon() + user << "You secure the exterior bolts on the turret." + cover = new /obj/machinery/porta_turret_cover(loc) //create a new turret. While this is handled in process(), this is to workaround a bug where the turret becomes invisible for a split second + cover.Parent_Turret = src //make the cover's parent src + else if(anchored) + playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) + anchored = 0 + user << "You unsecure the exterior bolts on the turret." + invisibility = 0 + update_icon() + del(cover) //deletes the cover, and the turret instance itself becomes its own cover. - qdel else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) //Behavior lock/unlock mangement @@ -345,20 +345,6 @@ if(health <= 0) die() //the death process :( - if(lasercolor == "b" && disabled == 0) - if(istype(Proj, /obj/item/weapon/gun/energy/laser/redtag)) - disabled = 1 - del(Proj) // qdel - sleep(100) - disabled = 0 - if(lasercolor == "r" && disabled == 0) - if(istype(Proj, /obj/item/weapon/gun/energy/laser/bluetag)) - disabled = 1 - del(Proj) // qdel - sleep(100) - disabled = 0 - - /obj/machinery/porta_turret/emp_act(severity) if(on) //if the turret is on, the EMP no matter how severe disables the turret for a while @@ -386,10 +372,10 @@ health = 0 density = 0 stat |= BROKEN //enables the BROKEN bit - icon_state = "[lasercolor]destroyed_target_prism" invisibility = 0 spark_system.start() //creates some sparks because they look cool density = 1 + update_icon() del(cover) //deletes the cover - no need on keeping it there! - del @@ -445,8 +431,9 @@ if(!L) return TURRET_NOT_TARGET - if(emagged && !isAI(L)) //if emagged, target everything (except the AI, otherwise lethal-set turrets attempt to fire at it in the core) - return TURRET_PRIORITY_TARGET + // If emagged not even the dead get a rest + if(emagged) + return L.stat ? TURRET_SECONDARY_TARGET : TURRET_PRIORITY_TARGET if(issilicon(L)) // Don't target silica return TURRET_NOT_TARGET @@ -460,26 +447,20 @@ if(ai) //If it's set to attack all non-silicons, target them! if(L.lying) - if(lasercolor) - return TURRET_NOT_TARGET - else - return TURRET_SECONDARY_TARGET - else - return TURRET_PRIORITY_TARGET + return TURRET_SECONDARY_TARGET + return TURRET_PRIORITY_TARGET if(iscuffed(L)) // If the target is handcuffed, leave it alone return TURRET_NOT_TARGET - if(isanimal(L)) // Animals are not so dangerous + if(isanimal(L) || ismonkey(L)) // Animals are not so dangerous return check_anomalies ? TURRET_SECONDARY_TARGET : TURRET_NOT_TARGET if(isxenomorph(L) || isalien(L)) // Xenos are dangerous return check_anomalies ? TURRET_PRIORITY_TARGET : TURRET_NOT_TARGET if(ishuman(L)) //if the target is a human, analyze threat level - if(assess_perp(L, auth_weapons, check_records, lasercolor) < 4) + if(assess_perp(L, auth_weapons, check_records) < 4) return TURRET_NOT_TARGET //if threat level < 4, keep going - else if(ismonkey(L)) - return TURRET_NOT_TARGET //Don't target monkeys or borgs/AIs if(L.lying) //if the perp is lying down, it's still a target but a less-important target return TURRET_SECONDARY_TARGET @@ -509,6 +490,7 @@ cover.icon_state = "openTurretCover" raised = 1 layer = 4 + update_icon() /obj/machinery/porta_turret/proc/popDown() //pops the turret down if(disabled) @@ -525,7 +507,7 @@ cover.icon_state = "turretCover" raised = 0 invisibility = 2 - icon_state = "[lasercolor]grey_target_prism" + update_icon() /obj/machinery/porta_turret/on_assess_perp(mob/living/carbon/human/perp) @@ -549,7 +531,8 @@ return /obj/machinery/porta_turret/proc/shootAt(var/mob/living/target) - if(!emagged) //if it hasn't been emagged, it has to obey a cooldown rate + //any emagged turrets will shoot extremely fast! This not only is deadly, but drains a lot power! + if(!(emagged || lethal)) //if it hasn't been emagged, it has to obey a cooldown rate if(last_fired || !raised) //prevents rapid-fire shooting, unless it's been emagged return last_fired = 1 @@ -565,20 +548,17 @@ if(!raised) //the turret has to be raised in order to fire - makes sense, right? return - //any emagged turrets will shoot extremely fast! This not only is deadly, but drains a lot power! - if(iconholder) - icon_state = "[lasercolor]orange_target_prism" - else - icon_state = "[lasercolor]target_prism" + + update_icon() var/obj/item/projectile/A - if(emagged) + if(emagged || lethal) A = new eprojectile(loc) playsound(loc, eshot_sound, 75, 1) else A = new projectile(loc) playsound(loc, shot_sound, 75, 1) A.original = target - if(!emagged) + if(!(emagged || lethal)) use_power(reqpower) else use_power(reqpower * 2) @@ -589,12 +569,12 @@ spawn(1) A.process() -/obj/machinery/porta_turret/proc/setState(var/on, var/emagged) +/obj/machinery/porta_turret/proc/setState(var/on, var/lethal) if(controllock) return src.on = on - src.emagged = emagged - src.iconholder = emagged + src.lethal = lethal + src.iconholder = lethal src.power_change() /* @@ -607,6 +587,7 @@ icon = 'icons/obj/turrets.dmi' icon_state = "turret_frame" density=1 + var/target_type = /obj/machinery/porta_turret // The type we intend to build var/build_step = 0 //the current step in the building process var/finish_name="turret" //the name applied to the product turret var/installation = null //the gun type installed @@ -686,6 +667,12 @@ installation = I.type //installation becomes I.type gun_charge = E.power_supply.charge //the gun's charge is stored in gun_charge user << "You add [I] to the turret." + + if(istype(installation, /obj/item/weapon/gun/energy/laser/bluetag) || istype(installation, /obj/item/weapon/gun/energy/laser/redtag)) + target_type = /obj/machinery/porta_turret/tag + else + target_type = /obj/machinery/porta_turret + build_step = 4 del(I) //delete the gun :( qdel return @@ -748,10 +735,11 @@ user << "You weld the turret's armor down." //The final step: create a full turret - var/obj/machinery/porta_turret/Turret = new/obj/machinery/porta_turret(loc) + var/obj/machinery/porta_turret/Turret = new target_type(loc) Turret.name = finish_name Turret.installation = installation Turret.gun_charge = gun_charge + Turret.on = 0 Turret.setup() // Turret.cover=new/obj/machinery/porta_turret_cover(loc) @@ -821,136 +809,14 @@ //I'm not fixing it because i'm fucking bored of this code already, but someone should just reroute these to the parent turret's procs. /obj/machinery/porta_turret_cover/attack_ai(mob/user) - if(!Parent_Turret.ailock) - return attack_hand(user) - else - user << "There seems to be a firewall preventing you from accessing this device." + return attack_hand(user) /obj/machinery/porta_turret_cover/attack_hand(mob/user) - . = ..() - if(.) - return - var/dat - if(!Parent_Turret.lasercolor) - dat += text({" - Automatic Portable Turret Installation

    - Status: []
    - Behaviour controls are [Parent_Turret.locked ? "locked" : "unlocked"]"}, - - "[Parent_Turret.on ? "On" : "Off"]" ) - - if(!src.Parent_Turret.locked || issilicon(user)) - dat += text({"

    - Neutralize All Non-Synthetics: []
    - Check for Weapon Authorization: []
    - Check Security Records: []
    - Neutralize All Non-Authorized Personnel: []
    - Neutralize All Unidentified Life Signs: []
    "}, - - "[Parent_Turret.ai ? "Yes" : "No"]", - "[Parent_Turret.auth_weapons ? "Yes" : "No"]", - "[Parent_Turret.check_records ? "Yes" : "No"]", - "[Parent_Turret.stun_all ? "Yes" : "No"]" , - "[Parent_Turret.check_anomalies ? "Yes" : "No"]" ) - else - if(istype(user,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = user - if(Parent_Turret.lasercolor == "b" && istype(H.wear_suit, /obj/item/clothing/suit/redtag)) - return - if(Parent_Turret.lasercolor == "r" && istype(H.wear_suit, /obj/item/clothing/suit/bluetag)) - return - dat += text({" - Automatic Portable Turret Installation

    - Status: []
    "}, - - "[Parent_Turret.on ? "On" : "Off"]" ) - - user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") - onclose(user, "autosec") - + return Parent_Turret.attack_hand(user) /obj/machinery/porta_turret_cover/Topic(href, href_list) - if(..()) - return - usr.set_machine(src) - Parent_Turret.add_fingerprint(usr) - add_fingerprint(usr) - if(href_list["power"] && (!src.Parent_Turret.locked || issilicon(usr))) - if(Parent_Turret.anchored) - if(Parent_Turret.on) - Parent_Turret.on = 0 - else - Parent_Turret.on = 1 - else - usr << "It has to be secured first!" - - updateUsrDialog() - return - - switch(href_list["operation"]) - if("toggleai") - Parent_Turret.ai = !Parent_Turret.ai - if("authweapon") - Parent_Turret.auth_weapons = !Parent_Turret.auth_weapons - if("checkrecords") - Parent_Turret.check_records = !Parent_Turret.check_records - if("shootall") - Parent_Turret.stun_all = !Parent_Turret.stun_all - if("checkxenos") - Parent_Turret.check_anomalies = !Parent_Turret.check_anomalies - + Parent_Turret.Topic(href, href_list, 1) // Calling another object's Topic requires that we claim to not have a window, otherwise BYOND's base proc will runtime. updateUsrDialog() - /obj/machinery/porta_turret_cover/attackby(obj/item/I, mob/user) - if(istype(I, /obj/item/weapon/card/emag) && !Parent_Turret.emagged) - user << "You short out [Parent_Turret]'s threat assessment circuits." - visible_message("[Parent_Turret] hums oddly...") - Parent_Turret.emagged = 1 - Parent_Turret.on = 0 - sleep(40) - Parent_Turret.on = 1 - - else if(istype(I, /obj/item/weapon/wrench) && !Parent_Turret.on) - if(Parent_Turret.raised) return - - if(!Parent_Turret.anchored) - Parent_Turret.anchored = 1 - Parent_Turret.invisibility = INVISIBILITY_LEVEL_TWO - Parent_Turret.icon_state = "grey_target_prism" - user << "You secure the exterior bolts on the turret." - else - Parent_Turret.anchored = 0 - user << "You unsecure the exterior bolts on the turret." - Parent_Turret.icon_state = "turretCover" - Parent_Turret.invisibility = 0 - del(src) // qdel - - else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) - if(Parent_Turret.allowed(user)) - Parent_Turret.locked = !Parent_Turret.locked - user << "Controls are now [Parent_Turret.locked ? "locked" : "unlocked"]." - updateUsrDialog() - else - user << "Access denied." - - else - user.changeNext_move(CLICK_CD_MELEE) - Parent_Turret.health -= I.force * 0.5 - if(Parent_Turret.health <= 0) - Parent_Turret.die() - if(I.force * 0.5 > 2) - if(!Parent_Turret.attacked && !Parent_Turret.emagged) - Parent_Turret.attacked = 1 - spawn() - sleep(30) - Parent_Turret.attacked = 0 - ..() - - -/obj/machinery/porta_turret/stationary - emagged = 1 - - New() - installation = /obj/item/weapon/gun/energy/laser - ..() + Parent_Turret.attackby(I, user) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 6cdedefe7f..8a949f7272 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -65,9 +65,6 @@ obj/machinery/recharger/attack_hand(mob/user as mob) charging = null update_icon() -obj/machinery/recharger/attack_paw(mob/user as mob) - return attack_hand(user) - obj/machinery/recharger/process() if(stat & (NOPOWER|BROKEN) || !anchored) update_use_power(0) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index d4b5f90d68..3049a6f694 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -70,8 +70,9 @@ allow_drop() return 0 - examine() - usr << "The charge meter reads: [round(chargepercentage())]%" + examine(mob/user) + ..(user) + user << "The charge meter reads: [round(chargepercentage())]%" proc/chargepercentage() return ((current_internal_charge / max_internal_charge) * 100) diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm index 085f455deb..0c3ae56115 100644 --- a/code/game/machinery/robot_fabricator.dm +++ b/code/game/machinery/robot_fabricator.dm @@ -32,9 +32,6 @@ 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_paw(user as mob) - return src.attack_hand(user) - /obj/machinery/robotic_fabricator/attack_hand(user as mob) var/dat if (..()) diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index f6a1455e78..bc65e08eb4 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -25,18 +25,14 @@ if(open) overlays += "sheater-open" -/obj/machinery/space_heater/examine() - set src in oview(12) - if (!( usr )) - return - usr << "This is \icon[src] \an [src.name]." - usr << src.desc +/obj/machinery/space_heater/examine(mob/user) + ..(user) - usr << "The heater is [on ? "on" : "off"] and the hatch is [open ? "open" : "closed"]." + user << "The heater is [on ? "on" : "off"] and the hatch is [open ? "open" : "closed"]." if(open) - usr << "The power cell is [cell ? "installed" : "missing"]." + user << "The power cell is [cell ? "installed" : "missing"]." else - usr << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%" + user << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%" return /obj/machinery/space_heater/emp_act(severity) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index a652cd50f0..8d7ed7fccc 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -124,11 +124,10 @@ return 1 return 0 -/obj/machinery/status_display/examine() - set src in view() - . = ..() +/obj/machinery/status_display/examine(mob/user) + . = ..(user) if(mode != STATUS_DISPLAY_BLANK && mode != STATUS_DISPLAY_ALERT) - usr << "The display says:
    \t[sanitize(message1)]
    \t[sanitize(message2)]" + user << "The display says:
    \t[sanitize(message1)]
    \t[sanitize(message2)]" /obj/machinery/status_display/proc/set_message(m1, m2) if(m1) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index bee250fd29..7dc7ba75a5 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -94,6 +94,8 @@ return if(stat & NOPOWER) return + if(!user.IsAdvancedToolUser()) + return 0 if(src.panelopen) //The maintenance panel is open. Time for some shady stuff dat+= "Suit storage unit: Maintenance panel" dat+= "Maintenance panel controls
    " @@ -328,14 +330,18 @@ for(i=0,i<4,i++) sleep(50) if(src.OCCUPANT) - if(src.issuperUV) - var/burndamage = rand(28,35) - OCCUPANT.take_organ_damage(0,burndamage) - OCCUPANT.emote("scream") - else - var/burndamage = rand(6,10) - OCCUPANT.take_organ_damage(0,burndamage) - OCCUPANT.emote("scream") + var/datum/organ/internal/diona/nutrients/rad_organ = locate() in OCCUPANT.internal_organs + if (!rad_organ) + if(src.issuperUV) + var/burndamage = rand(28,35) + OCCUPANT.take_organ_damage(0,burndamage) + if (!(OCCUPANT.species && (OCCUPANT.species.flags & NO_PAIN))) + OCCUPANT.emote("scream") + else + var/burndamage = rand(6,10) + OCCUPANT.take_organ_damage(0,burndamage) + if (!(OCCUPANT.species && (OCCUPANT.species.flags & NO_PAIN))) + OCCUPANT.emote("scream") if(i==3) //End of the cycle if(!src.issuperUV) if(src.HELMET) @@ -559,12 +565,6 @@ /obj/machinery/suit_storage_unit/attack_ai(mob/user as mob) return src.attack_hand(user) - -/obj/machinery/suit_storage_unit/attack_paw(mob/user as mob) - user << "The console controls are far too complicated for your tiny brain!" - return - - //////////////////////////////REMINDER: Make it lock once you place some fucker inside. //God this entire file is fucking awful @@ -657,10 +657,6 @@ /obj/machinery/suit_cycler/attack_ai(mob/user as mob) return src.attack_hand(user) -/obj/machinery/suit_cycler/attack_paw(mob/user as mob) - user << "\blue The console controls are far too complicated for your tiny brain!" - return - /obj/machinery/suit_cycler/attackby(obj/item/I as obj, mob/user as mob) if(electrified != 0) @@ -786,6 +782,9 @@ if(..() || stat & (BROKEN|NOPOWER)) return + if(!user.IsAdvancedToolUser()) + return 0 + if(electrified != 0) if(src.shock(user, 100)) return diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 5bc531e571..dcbdb0e7dc 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -330,7 +330,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept if (length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled) || length(heard_gibberish)) /* --- Some miscellaneous variables to format the string output --- */ - var/part_a = "" // goes in the actual output + var/part_a = "" // goes in the actual output var/freq_text = get_frequency_name(display_freq) // --- Some more pre-message formatting --- @@ -341,41 +341,6 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept var/part_b = " \icon[radio]\[[freq_text]\][part_b_extra] " // Tweaked for security headsets -- TLE var/part_c = "" - // Antags! - if (display_freq in ANTAG_FREQS) - part_a = "" - // centcomm channels (deathsquid and ert) - else if (display_freq in CENT_FREQS) - part_a = "" - - // command channel - else if (display_freq == COMM_FREQ) - part_a = "" - - // AI private channel - else if (display_freq == AI_FREQ) - part_a = "" - - // department radio formatting (poorly optimized, ugh) - else if (display_freq == SEC_FREQ) - part_a = "" - - else if (display_freq == ENG_FREQ) - part_a = "" - - else if (display_freq == SCI_FREQ) - part_a = "" - - else if (display_freq == MED_FREQ) - part_a = "" - - else if (display_freq == SUP_FREQ) // cargo - part_a = "" - - // If all else fails and it's a dept_freq, color me purple! - else if (display_freq in DEPT_FREQS) - part_a = "" - // --- Filter the message; place it in quotes apply a verb --- @@ -412,6 +377,8 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept blackbox.msg_syndicate += blackbox_msg if(SUP_FREQ) blackbox.msg_cargo += blackbox_msg + if(SRV_FREQ) + blackbox.msg_service += blackbox_msg else blackbox.messages += blackbox_msg @@ -452,6 +419,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept for (var/mob/R in heard_gibberish) R.hear_radio(message, verbage, speaking, part_a, part_b, M, 1) + return 1 /proc/Broadcast_SimpleMessage(var/source, var/frequency, var/text, var/data, var/mob/M, var/compression, var/level) @@ -599,6 +567,8 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept blackbox.msg_syndicate += blackbox_msg if(SUP_FREQ) blackbox.msg_cargo += blackbox_msg + if(SRV_FREQ) + blackbox.msg_service += blackbox_msg else blackbox.messages += blackbox_msg @@ -641,7 +611,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept var/turf/position = get_turf(src) return (position.z in signal.data["level"] && signal.data["done"]) -/atom/proc/telecomms_process() +/atom/proc/telecomms_process(var/do_sleep = 1) // First, we want to generate a new radio signal var/datum/signal/signal = new @@ -665,7 +635,8 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept for(var/obj/machinery/telecomms/receiver/R in telecomms_list) R.receive_signal(signal) - sleep(rand(10,25)) + if(do_sleep) + sleep(rand(10,25)) //world.log << "Level: [signal.data["level"]] - Done: [signal.data["done"]]" diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index 8b4977f106..35c2ecdc1f 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -40,7 +40,7 @@ id = "Hub" network = "tcommsat" autolinkers = list("hub", "relay", "c_relay", "s_relay", "m_relay", "r_relay", "science", "medical", - "supply", "common", "command", "engineering", "security", + "supply", "service", "common", "command", "engineering", "security", "receiverA", "receiverB", "broadcasterA", "broadcasterB") /obj/machinery/telecomms/hub/preset_cent @@ -58,7 +58,7 @@ id = "Receiver A" network = "tcommsat" autolinkers = list("receiverA") // link to relay - freq_listening = list(SCI_FREQ, MED_FREQ, SUP_FREQ) // science, medical, supply + freq_listening = list(SCI_FREQ, MED_FREQ, SUP_FREQ, SRV_FREQ) // science, medical, supply, service //--PRESET RIGHT--// @@ -94,8 +94,8 @@ /obj/machinery/telecomms/bus/preset_two id = "Bus 2" network = "tcommsat" - freq_listening = list(SUP_FREQ) - autolinkers = list("processor2", "supply") + freq_listening = list(SUP_FREQ, SRV_FREQ) + autolinkers = list("processor2", "supply", "service") /obj/machinery/telecomms/bus/preset_three id = "Bus 3" @@ -169,6 +169,11 @@ id = "Supply Server" freq_listening = list(SUP_FREQ) autolinkers = list("supply") + +/obj/machinery/telecomms/server/presets/service + id = "Service Server" + freq_listening = list(SRV_FREQ) + autolinkers = list("service") /obj/machinery/telecomms/server/presets/common id = "Common Server" diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index b247f17919..acd89ee17c 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -77,9 +77,6 @@ return -/obj/machinery/computer/teleporter/attack_paw() - src.attack_hand() - /obj/machinery/teleport/station/attack_ai() src.attack_hand() @@ -311,9 +308,6 @@ /obj/machinery/teleport/station/attackby(var/obj/item/weapon/W) src.attack_hand() -/obj/machinery/teleport/station/attack_paw() - src.attack_hand() - /obj/machinery/teleport/station/attack_ai() src.attack_hand() diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index a817c2c3a5..7885a8b8e2 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -33,11 +33,12 @@ playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) use_power(5000) // Use a lot of power. var/mob/living/silicon/robot = H.Robotize() - robot.lying = 1 + robot.SetLockDown() spawn(50) // So he can't jump out the gate right away. playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) if(robot) - robot.lying = 0 + robot.SetLockDown(0) + robot.notify_ai(1) /obj/machinery/transformer/conveyor/New() ..() diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 6c1b6acd11..b28d0a6e7f 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -2,6 +2,10 @@ //Turret Control Panel// //////////////////////// +/area + // Turrets use this list to see if individual power/lethal settings are allowed + var/list/turret_controls = list() + /obj/machinery/turretid name = "turret control panel" desc = "Used to control a room's automated defenses." @@ -25,6 +29,13 @@ lethal = 1 icon_state = "control_kill" +/obj/machinery/turretid/Del() + if(control_area) + var/area/A = control_area + if(A && istype(A)) + A.turret_controls -= src + ..() + /obj/machinery/turretid/initialize() if(!control_area) var/area/CA = get_area(src) @@ -39,8 +50,25 @@ break power_change() //Checks power and initial settings //don't have to check if control_area is path, since get_area_all_atoms can take path. + + if(control_area) + var/area/A = control_area + if(A && istype(A)) + A.turret_controls += src return +/obj/machinery/turretid/proc/can_use(mob/user) + if (get_dist(src, user) > 0 && !issilicon(user)) + user << "You are too far away." + user.unset_machine() + user << browse(null, "window=turretid") + return 0 + + if(ailock && issilicon(user)) + user << "There seems to be a firewall preventing you from accessing this device." + return 0 + return 1 + /obj/machinery/turretid/attackby(obj/item/weapon/W, mob/user) if(stat & BROKEN) return if (istype(user, /mob/living/silicon)) @@ -74,16 +102,10 @@ user << "Access denied." /obj/machinery/turretid/attack_ai(mob/user as mob) - if(!ailock) - return attack_hand(user) - else - user << "There seems to be a firewall preventing you from accessing this device." + return attack_hand(user) /obj/machinery/turretid/attack_hand(mob/user as mob) - if (get_dist(src, user) > 0 && !issilicon(user)) - user << "You are too far away." - user.unset_machine() - user << browse(null, "window=turretid") + if(!can_use(user)) return user.set_machine(src) @@ -106,25 +128,32 @@ //user << browse(t, "window=turretid") //onclose(user, "turretid") - var/datum/browser/popup = new(user, "turretid", "Turret Control Panel ([area.name])") + var/datum/browser/popup = new(user, "turretid", "Turret Control Panel ([area.name])", 500, 200) popup.set_content(t) popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) popup.open() -/obj/machinery/turretid/Topic(href, href_list) +/obj/machinery/turretid/Topic(href, href_list, var/nowindow = 0) if(..()) - return - if (src.locked) - if (!istype(usr, /mob/living/silicon)) - usr << "Control panel is locked!" - return + return 1 + + if(!can_use(usr)) + return 1 + if (href_list["toggleOn"]) src.enabled = !src.enabled src.updateTurrets() else if (href_list["toggleLethal"]) src.lethal = !src.lethal src.updateTurrets() - src.attack_hand(usr) + + if(!nowindow) + attack_hand(usr) + +/obj/machinery/turretid/updateDialog() + if (stat & (BROKEN|MAINT)) + return + ..() /obj/machinery/turretid/proc/updateTurrets() if(control_area) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index f9e8a94747..567afc0d6d 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -338,18 +338,18 @@ spawn(13) del(src) -/obj/machinery/turret/attack_animal(mob/living/M as mob) - if(M.melee_damage_upper == 0) return - if(!(stat & BROKEN)) - visible_message("\red [M] [M.attacktext] [src]!") - M.attack_log += text("\[[time_stamp()]\] attacked [src.name]") - //src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])") - src.health -= M.melee_damage_upper - if (src.health <= 0) - src.die() - else - M << "\red That object is useless to you." - return +/obj/machinery/turret/attack_generic(var/mob/user, var/damage, var/attack_message) + if(!damage) + return 0 + if(stat & BROKEN) + user << "That object is useless to you." + return 0 + visible_message("[user] [attack_message] the [src]!") + user.attack_log += text("\[[time_stamp()]\] attacked [src.name]") + src.health -= damage + if (src.health <= 0) + src.die() + return 1 /obj/structure/turret/gun_turret name = "Gun Turret" diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index aaf8283a00..ab931c46d3 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -274,10 +274,6 @@ else usr << "\icon[src]Error: Unable to access your account. Please contact technical support if problem persists." - -/obj/machinery/vending/attack_paw(mob/user as mob) - return attack_hand(user) - /obj/machinery/vending/attack_ai(mob/user as mob) return attack_hand(user) @@ -657,7 +653,7 @@ vend_power_usage = 85000 //85 kJ to heat a 250 mL cup of coffee products = list(/obj/item/weapon/reagent_containers/food/drinks/coffee = 25,/obj/item/weapon/reagent_containers/food/drinks/tea = 25,/obj/item/weapon/reagent_containers/food/drinks/h_chocolate = 25) contraband = list(/obj/item/weapon/reagent_containers/food/drinks/ice = 10) - prices = list(/obj/item/weapon/reagent_containers/food/drinks/coffee = 25, /obj/item/weapon/reagent_containers/food/drinks/tea = 25, /obj/item/weapon/reagent_containers/food/drinks/h_chocolate = 25) + prices = list(/obj/item/weapon/reagent_containers/food/drinks/coffee = 3, /obj/item/weapon/reagent_containers/food/drinks/tea = 3, /obj/item/weapon/reagent_containers/food/drinks/h_chocolate = 3) diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index 960f6d99c8..3d318a891a 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -173,11 +173,14 @@ energy_drain = 0 range = MELEE|RANGED required_type = /obj/mecha/working + var/spray_particles = 5 + var/spray_amount = 5 //units of liquid per particle. 5 is enough to wet the floor - it's a big fire extinguisher, so should be fine + var/max_water = 1000 New() - reagents = new/datum/reagents(200) + reagents = new/datum/reagents(max_water) reagents.my_atom = src - reagents.add_reagent("water", 200) + reagents.add_reagent("water", max_water) ..() return @@ -188,8 +191,8 @@ if(do_after_cooldown(target)) if(istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1) var/obj/o = target - o.reagents.trans_to(src, 200) - occupant_message("\blue Extinguisher refilled") + var/amount = o.reagents.trans_to(src, 200) + occupant_message("\blue [amount] units transferred into internal tank.") playsound(chassis, 'sound/effects/refill.ogg', 50, 1, -6) else if(src.reagents.total_volume > 0) @@ -200,22 +203,25 @@ var/turf/T2 = get_step(T,turn(direction, -90)) var/list/the_targets = list(T,T1,T2) - spawn(0) - for(var/a=0, a<5, a++) + for(var/a=0, a[user] [user.attacktext] [src]!") - user.attack_log += text("\[[time_stamp()]\] attacked [src.name]") - else - src.log_append_to_last("Armor saved.") - playsound(src.loc, 'sound/weapons/slash.ogg', 50, 1, -1) - src.occupant_message("\blue The [user]'s attack is stopped by the armor.") - visible_message("\blue The [user] rebounds off [src.name]'s armor!") - user.attack_log += text("\[[time_stamp()]\] attacked [src.name]") - return - /obj/mecha/hitby(atom/movable/A as mob|obj) //wrapper ..() src.log_message("Hit by [A].",1) @@ -1406,11 +1382,11 @@ /obj/mecha/proc/output_maintenance_dialog(obj/item/weapon/card/id/id_card,mob/user) if(!id_card || !user) return - + var/maint_options = "Set Cabin Air Pressure" if (locate(/obj/item/mecha_parts/mecha_equipment/tool/passenger) in contents) - maint_options += "Remove Passenger" - + maint_options += "Remove Passenger" + var/output = {"