From 39363749ca27a22d1e860e92ff5d3ec8549201cb Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 21 Feb 2015 12:54:46 -0500 Subject: [PATCH 01/14] Fixes suit breach_threshold not being applied. --- code/modules/clothing/spacesuits/breaches.dm | 17 ++++++++++------- .../clothing/spacesuits/rig/rig_pieces.dm | 4 +++- code/modules/clothing/spacesuits/void/void.dm | 1 + 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index ee2746cccd8..a3bb5a3e35f 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -3,7 +3,7 @@ //They can be healed with plastic or metal sheeting. /datum/breach - var/class = 0 // Size. Lower is smaller. + var/class = 0 // Size. Lower is smaller. Uses floating point values! var/descriptor // 'gaping hole' etc. var/damtype = BURN // Punctured or melted var/obj/item/clothing/suit/space/holder // Suit containing the list of breaches holding this instance. @@ -12,8 +12,8 @@ var/can_breach = 1 // Set to 0 to disregard all breaching. var/list/breaches = list() // Breach datum container. - var/resilience = 0.2 // Multiplier that turns damage into breach class. 1 is 100% of damage to breach, 0.1 is 10%. - var/breach_threshold = 3 // Min damage before a breach is possible. + var/resilience = 0.2 // Multiplier that turns damage into breach class. 1 is 100% of damage to breach, 0.1 is 10%. 0.2 -> 50 brute/burn damage to cause 10 breach damage + var/breach_threshold = 3 // Min damage before a breach is possible. Damage is subtracted by this amount, it determines the "hardness" of the suit. var/damage = 0 // Current total damage var/brute_damage = 0 // Specifically brute damage. var/burn_damage = 0 // Specifically burn damage. @@ -44,7 +44,7 @@ var/global/list/breach_burn_descriptors = list( /datum/breach/proc/update_descriptor() //Sanity... - class = max(1,min(class,5)) + class = between(1, round(class), 5) //Apply the correct descriptor. if(damtype == BURN) descriptor = breach_burn_descriptors[class] @@ -86,7 +86,10 @@ var/global/list/breach_burn_descriptors = list( /obj/item/clothing/suit/space/proc/create_breaches(var/damtype, var/amount) - if(!can_breach || !amount) + amount -= src.breach_threshold + amount *= src.resilience + + if(!can_breach || amount <= 0) return if(!breaches) @@ -98,14 +101,14 @@ var/global/list/breach_burn_descriptors = list( var/turf/T = get_turf(src) if(!T) return - amount = amount * src.resilience - //Increase existing breaches. for(var/datum/breach/existing in breaches) if(existing.damtype != damtype) continue + //keep in mind that 10 breach damage == full pressure loss. + //a breach can have at most 5 breach damage if (existing.class < 5) var/needs = 5 - existing.class if(amount < needs) diff --git a/code/modules/clothing/spacesuits/rig/rig_pieces.dm b/code/modules/clothing/spacesuits/rig/rig_pieces.dm index de18d5e020c..6a0d7012f93 100644 --- a/code/modules/clothing/spacesuits/rig/rig_pieces.dm +++ b/code/modules/clothing/spacesuits/rig/rig_pieces.dm @@ -38,7 +38,9 @@ flags_inv = HIDEJUMPSUIT|HIDETAIL flags = STOPSPRESSUREDMAGE | THICKMATERIAL | AIRTIGHT slowdown = 0 - breach_threshold = 35 + //With 0.2 resiliance, will reach 10 breach damage after 9 laser carbine blasts. Completely immune to smg hits. + breach_threshold = 28 + resilience = 0.1 can_breach = 1 supporting_limbs = list() diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 1cab4a659cb..68a619ba282 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -48,6 +48,7 @@ ) //Breach thresholds, should ideally be inherited by most (if not all) voidsuits. + //With 0.2 resiliance, will reach 10 breach damage after 3 laser carbine blasts or 8 smg hits. breach_threshold = 18 can_breach = 1 From 31e8babb9f93110406e09c48866bcfa74dfc8744 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 21 Feb 2015 12:55:51 -0500 Subject: [PATCH 02/14] Fixes rig emp severity class handling --- code/modules/clothing/spacesuits/rig/rig.dm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 4c7735974c1..dad5fa36c91 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -686,11 +686,12 @@ /obj/item/weapon/rig/proc/malfunction() return 0 -/obj/item/weapon/rig/emp_act(severity) - malfunctioning += severity*10 +/obj/item/weapon/rig/emp_act(severity_class) + //class 1 severity is the most severe, not least. + malfunctioning += round(30/severity_class) if(malfunction_delay <= 0) malfunction_delay = 20 - take_hit(severity*10,"electrical pulse") + take_hit(round(30/severity_class),"electrical pulse") /obj/item/weapon/rig/proc/shock(mob/user) if (electrocute_mob(user, cell, src)) @@ -699,12 +700,14 @@ return 0 /obj/item/weapon/rig/proc/take_hit(damage,source) - if(!installed_modules.len) return - if(!prob(max(0,(damage-(chest ? chest.breach_threshold : 0))))) - return + //given that module damage is spread out across all modules, even this is probably not enough for emp to affect rigs much. + if(source != "electrical pulse") + var/protection = chest? chest.breach_threshold : 0 + if(!prob(max(0, damage - protection))) + return var/list/valid_modules = list() for(var/obj/item/rig_module/module in installed_modules) From 1596c28328f028fe532a2badfc1af37bdde6da11 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Sat, 21 Feb 2015 21:38:47 +0300 Subject: [PATCH 03/14] Fixes ship deceleration for south/east directions --- code/WorkInProgress/Chinsky/overmap/ships/ship.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/WorkInProgress/Chinsky/overmap/ships/ship.dm b/code/WorkInProgress/Chinsky/overmap/ships/ship.dm index b080c41b071..ba2364e63c2 100644 --- a/code/WorkInProgress/Chinsky/overmap/ships/ship.dm +++ b/code/WorkInProgress/Chinsky/overmap/ships/ship.dm @@ -75,9 +75,9 @@ /obj/effect/map/ship/proc/decelerate() if(!is_still() && can_burn()) if (speed[1]) - adjust_speed(-SIGN(speed[1]) * min(get_acceleration(),speed[1]), 0) + adjust_speed(-SIGN(speed[1]) * min(get_acceleration(),abs(speed[1])), 0) if (speed[2]) - adjust_speed(0, -SIGN(speed[2]) * min(get_acceleration(),speed[2])) + adjust_speed(0, -SIGN(speed[2]) * min(get_acceleration(),abs(speed[2]))) last_burn = world.time /obj/effect/map/ship/proc/accelerate(direction) From 657028026a4dc529630666a57e370388208f0bc0 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 21 Feb 2015 14:55:13 -0500 Subject: [PATCH 04/14] Fixes APC emp_act() Now properly handles the channel changes. --- code/modules/power/apc.dm | 86 ++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 5a1dcc5b721..59390ce7a17 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1146,46 +1146,9 @@ // Set channels depending on how much charge we have left - - // Allow the APC to operate as normal if the cell can charge - if(charging && longtermpower < 10) - longtermpower += 1 - else if(longtermpower > -10) - longtermpower -= 2 - - if((cell.percent() > 30) || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101 - if(autoflag != 3) - equipment = autoset(equipment, 1) - lighting = autoset(lighting, 1) - environ = autoset(environ, 1) - autoflag = 3 - area.poweralert(1, src) - if(cell.charge >= 4000) - area.poweralert(1, src) - else if((cell.percent() <= 30) && (cell.percent() > 15) && longtermpower < 0) // <30%, turn off equipment - if(autoflag != 2) - equipment = autoset(equipment, 2) - lighting = autoset(lighting, 1) - environ = autoset(environ, 1) - area.poweralert(0, src) - autoflag = 2 - else if(cell.percent() <= 15) // <15%, turn off lighting & equipment - if((autoflag > 1 && longtermpower < 0) || (autoflag > 1 && longtermpower >= 0)) - equipment = autoset(equipment, 2) - lighting = autoset(lighting, 2) - environ = autoset(environ, 1) - area.poweralert(0, src) - autoflag = 1 - else // zero charge, turn all off - if(autoflag != 0) - equipment = autoset(equipment, 0) - lighting = autoset(lighting, 0) - environ = autoset(environ, 0) - area.poweralert(0, src) - autoflag = 0 + update_channels() // now trickle-charge the cell - lastused_charging = 0 // Clear the variable for new use. if(src.attempt_charging()) if(excess > 0) // check to make sure we have enough to charge @@ -1222,7 +1185,6 @@ chargecount = 0 else // no cell, switch everything off - charging = 0 chargecount = 0 equipment = autoset(equipment, 0) @@ -1232,13 +1194,50 @@ autoflag = 0 // update icon & area power if anything changed - if(last_lt != lighting || last_eq != equipment || last_en != environ) queue_icon_update() update() else if (last_ch != charging) queue_icon_update() +/obj/machinery/power/apc/proc/update_channels() + // Allow the APC to operate as normal if the cell can charge + if(charging && longtermpower < 10) + longtermpower += 1 + else if(longtermpower > -10) + longtermpower -= 2 + + if((cell.percent() > 30) || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101 + if(autoflag != 3) + equipment = autoset(equipment, 1) + lighting = autoset(lighting, 1) + environ = autoset(environ, 1) + autoflag = 3 + area.poweralert(1, src) + if(cell.charge >= 4000) + area.poweralert(1, src) + else if((cell.percent() <= 30) && (cell.percent() > 15) && longtermpower < 0) // <30%, turn off equipment + if(autoflag != 2) + equipment = autoset(equipment, 2) + lighting = autoset(lighting, 1) + environ = autoset(environ, 1) + area.poweralert(0, src) + autoflag = 2 + else if(cell.percent() <= 15) // <15%, turn off lighting & equipment + if((autoflag > 1 && longtermpower < 0) || (autoflag > 1 && longtermpower >= 0)) + equipment = autoset(equipment, 2) + lighting = autoset(lighting, 2) + environ = autoset(environ, 1) + area.poweralert(0, src) + autoflag = 1 + else // zero charge, turn all off + if(autoflag != 0) + equipment = autoset(equipment, 0) + lighting = autoset(lighting, 0) + environ = autoset(environ, 0) + area.poweralert(0, src) + autoflag = 0 + // val 0=off, 1=off(auto) 2=on 3=on(auto) // on 0=off, 1=on, 2=autooff @@ -1266,12 +1265,15 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on) cell.emp_act(severity) if(occupier) occupier.emp_act(severity) + lighting = 0 equipment = 0 environ = 0 + update() + spawn(600) - equipment = 3 - environ = 3 + update_channels() + update() ..() /obj/machinery/power/apc/ex_act(severity) From ac233b9db7edad07e72107397e81fc221eec82d0 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Sun, 22 Feb 2015 16:18:33 +1030 Subject: [PATCH 05/14] Fixes an issue with bees using bluespace powers to modify plants globally. --- code/game/machinery/bees_apiary.dm | 4 ++++ code/modules/hydroponics/seed_datums.dm | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/bees_apiary.dm b/code/game/machinery/bees_apiary.dm index d4e6aa6307e..58e6dd7783d 100644 --- a/code/game/machinery/bees_apiary.dm +++ b/code/game/machinery/bees_apiary.dm @@ -188,8 +188,12 @@ if(prob(10)) H.lastcycle -= 5 if(prob(10)) + if(!isnull(seed_types[H.seed.name])) + H.seed = H.seed.diverge(-1) H.seed.lifespan = max(initial(H.seed.lifespan) * 1.5, H.seed.lifespan + 1) if(prob(10)) + if(!isnull(seed_types[H.seed.name])) + H.seed = H.seed.diverge(-1) H.seed.endurance = max(initial(H.seed.endurance) * 1.5, H.seed.endurance + 1) if(H.toxins && prob(10)) H.toxins = min(0, H.toxins - 1) diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index 6fbfa3743a5..2e1350bc92d 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -643,8 +643,13 @@ proc/populate_seed_list() if(consume_gasses) new_seed.consume_gasses = consume_gasses.Copy() if(exude_gasses) new_seed.exude_gasses = exude_gasses.Copy() - new_seed.seed_name = "[(roundstart ? "[(modified ? "modified" : "mutant")] " : "")][seed_name]" - new_seed.display_name = "[(roundstart ? "[(modified ? "modified" : "mutant")] " : "")][display_name]" + if(modified != -1) + new_seed.seed_name = "[(roundstart ? "[(modified ? "modified" : "mutant")] " : "")][seed_name]" + new_seed.display_name = "[(roundstart ? "[(modified ? "modified" : "mutant")] " : "")][display_name]" + else + new_seed.seed_name = "[seed_name]" + new_seed.display_name = "[display_name]" + new_seed.seed_noun = seed_noun new_seed.requires_nutrients = requires_nutrients From 9e1a2315cd4456482b24b3980b7db692eb3803ca Mon Sep 17 00:00:00 2001 From: Chinsky Date: Sun, 22 Feb 2015 11:13:09 +0300 Subject: [PATCH 06/14] Changes loop for space tiles from world one to for over coordinates. It would raise infinite loop warnings otherwise when used with big zlevels. --- code/modules/overmap/_defines.dm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/code/modules/overmap/_defines.dm b/code/modules/overmap/_defines.dm index c81cbb1ae67..23b6e588459 100644 --- a/code/modules/overmap/_defines.dm +++ b/code/modules/overmap/_defines.dm @@ -22,17 +22,18 @@ proc/toggle_move_stars(zlevel, direction) if (moving_levels["zlevel"] != gen_dir) moving_levels["zlevel"] = gen_dir - for(var/turf/space/S in world) - if(S.z == zlevel) + for(var/x = 1 to world.maxx) + for(var/y = 1 to world.maxy) spawn(0) - var/turf/T = S - if(!gen_dir) - T.icon_state = "[((T.x + T.y) ^ ~(T.x * T.y) + T.z) % 25]" - else - T.icon_state = "speedspace_[gen_dir]_[rand(1,15)]" - for(var/atom/movable/AM in T) - if (!AM.anchored) - AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1) + var/turf/space/T = locate(x,y,zlevel) + if (T) + if(!gen_dir) + T.icon_state = "[((T.x + T.y) ^ ~(T.x * T.y) + T.z) % 25]" + else + T.icon_state = "speedspace_[gen_dir]_[rand(1,15)]" + for(var/atom/movable/AM in T) + if (!AM.anchored) + AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1) //list used to cache empty zlevels to avoid nedless map bloat From e47c45591c86179e913adc22823e4c877dfbab0b Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Mon, 23 Feb 2015 18:58:41 +0000 Subject: [PATCH 07/14] Fixes a few issues with noise-language. --- .../objects/items/devices/taperecorder.dm | 26 +++++-------------- code/modules/admin/admin.dm | 13 +++++----- code/modules/mob/language.dm | 8 +++++- code/modules/mob/living/carbon/human/say.dm | 11 +++++--- code/setup.dm | 1 + 5 files changed, 29 insertions(+), 30 deletions(-) diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index dc74f0272c0..1e9405cbeb5 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -20,26 +20,14 @@ throw_speed = 4 throw_range = 20 -/obj/item/device/taperecorder/hear_talk(mob/living/M as mob, msg, var/verb="says") +/obj/item/device/taperecorder/hear_talk(mob/living/M as mob, msg, var/verb="says", datum/language/speaking=null) if(recording) - //var/ending = copytext(msg, length(msg)) - timestamp+= timerecorded - /* - if(M.stuttering) - storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] stammers, \"[msg]\"" - return - if(M.getBrainLoss() >= 60) - storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] gibbers, \"[msg]\"" - return - if(ending == "?") - storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] asks, \"[msg]\"" - return - else if(ending == "!") - storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] exclaims, \"[msg]\"" - return - */ - storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [verb], \"[msg]\"" - return + timestamp += timerecorded + + if(speaking) + storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [speaking.format_message_plain(msg, verb)]" + else + storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [verb], \"[msg]\"" /obj/item/device/taperecorder/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 9ecbab5b9e9..fcba6a91cce 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -186,12 +186,13 @@ var/global/floorIsLava = 0 var/f = 1 for(var/k in all_languages) var/datum/language/L = all_languages[k] - if(!f) body += " | " - else f = 0 - if(L in M.languages) - body += "[k]" - else - body += "[k]" + if(!(L.flags & INNATE)) + if(!f) body += " | " + else f = 0 + if(L in M.languages) + body += "[k]" + else + body += "[k]" body += {"
diff --git a/code/modules/mob/language.dm b/code/modules/mob/language.dm index 9621ec0176e..86d407cff86 100644 --- a/code/modules/mob/language.dm +++ b/code/modules/mob/language.dm @@ -88,6 +88,9 @@ /datum/language/proc/format_message(message, verb) return "[verb], \"[capitalize(message)]\"" +/datum/language/proc/format_message_plain(message, verb) + return "[verb], \"[capitalize(message)]\"" + /datum/language/proc/format_message_radio(message, verb) return "[verb], \"[capitalize(message)]\"" @@ -121,11 +124,14 @@ name = "Noise" desc = "Noises" key = "" - flags = RESTRICTED|NONGLOBAL|INNATE|NO_TALK_MSG + flags = RESTRICTED|NONGLOBAL|INNATE|NO_TALK_MSG|NO_STUTTER /datum/language/noise/format_message(message, verb) return "[message]" +/datum/language/noise/format_message_plain(message, verb) + return message + /datum/language/noise/format_message_radio(message, verb) return "[message]" diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 3f89f5b230e..b0eeaf41466 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -36,6 +36,8 @@ else message = copytext(message,3) + message = trim_left(message) + //parse the language code and consume it var/datum/language/speaking = parse_language(message) if(speaking) @@ -61,10 +63,11 @@ message = trim(message) if(speech_problem_flag) - var/list/handle_r = handle_speech_problems(message) - message = handle_r[1] - verb = handle_r[2] - speech_problem_flag = handle_r[3] + if(!speaking || !(speaking.flags & NO_STUTTER)) + var/list/handle_r = handle_speech_problems(message) + message = handle_r[1] + verb = handle_r[2] + speech_problem_flag = handle_r[3] if(!message || message == "") return diff --git a/code/setup.dm b/code/setup.dm index 632ada1804a..33201d10bf4 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -681,6 +681,7 @@ var/list/be_special_flags = list( #define NONGLOBAL 32 // Do not add to general languages list #define INNATE 64 // All mobs can be assumed to speak and understand this language (audible emotes) #define NO_TALK_MSG 128 // Do not show the "\The [speaker] talks into \the [radio]" message +#define NO_STUTTER 256 // No stuttering, slurring, or other speech problems //Flags for zone sleeping #define ZONE_ACTIVE 1 From 1fd70d03b121574dc8c6e2d557e6e3b694880632 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 24 Feb 2015 08:28:15 +0100 Subject: [PATCH 08/14] Fixes Malfuction Turret Upgrade Now upgrades all portable turrets on the station, instead of turrets found in the player list. Decreases delays between shots, instead of increasing it, to 66% of original delay. --- code/game/gamemodes/malfunction/Malf_Modules.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 104fbf1cdb7..09911abf2cd 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -49,9 +49,12 @@ rcd light flash thingy on matter drain set category = "Malfunction" set name = "Upgrade Turrets" usr.verbs -= /client/proc/upgrade_turrets - for(var/obj/machinery/turret/turret in player_list) - turret.health += 30 - turret.shot_delay = 20 + for(var/obj/machinery/porta_turret/turret in machines) + var/turf/T = get_turf(turret) + if(T.z in config.station_levels) + // Increase health by 37.5% of original max, decrease delays between shots to 66% + turret.health += initial(turret.health) * 3 / 8 + turret.shot_delay = initial(turret.shot_delay) * 2 / 3 /datum/AI_Module/large/disable_rcd module_name = "RCD disable" From 768faa4bf0909c0f929eee98b4d4b9041f9f52e3 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Wed, 25 Feb 2015 09:00:18 +0100 Subject: [PATCH 09/14] Fixes #8266. Ensures drones get access to the alarm monitor subsystem. Restores the Show Alerts link in alarm notices. --- code/modules/mob/living/silicon/robot/drone/drone.dm | 2 ++ code/modules/mob/living/silicon/silicon.dm | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 44df3272409..bda08125e7b 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -287,5 +287,7 @@ return /mob/living/silicon/robot/drone/add_robot_verbs() + src.verbs |= robot_verbs_subsystems /mob/living/silicon/robot/drone/remove_robot_verbs() + src.verbs -= robot_verbs_subsystems diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index fc647dcbeb9..466e984350e 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -323,11 +323,13 @@ if(next_alarm_notice && (world.time > next_alarm_notice)) next_alarm_notice = 0 + var/alarm_raised = 0 for(var/datum/alarm_handler/AH in queued_alarms) var/list/alarms = queued_alarms[AH] var/reported = 0 for(var/datum/alarm/A in alarms) if(alarms[A] == 1) + alarm_raised = 1 if(!reported) reported = 1 src << "--- [AH.category] Detected ---" @@ -343,6 +345,9 @@ src << "--- [AH.category] Cleared ---" src << "\The [A.alarm_name()]." + if(alarm_raised) + src << "\[Show Alerts\]" + for(var/datum/alarm_handler/AH in queued_alarms) var/list/alarms = queued_alarms[AH] alarms.Cut() From 4dca85b17c990e3d4d7e8c6143b669a4fb7223d1 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Wed, 25 Feb 2015 19:45:48 +0100 Subject: [PATCH 10/14] Fixes camera network changes not always being reflected in camera consoles. Cameras with altered networks would not necessarily show up on camera consoles, primarily affecting cameras joining/leaving alarm zones. --- code/game/machinery/camera/camera.dm | 45 +++++++++++++++++++ code/game/machinery/camera/camera_assembly.dm | 2 +- .../objects/items/robot/robot_upgrades.dm | 2 +- code/modules/alarm/alarm_handler.dm | 5 +-- .../modules/clothing/spacesuits/spacesuits.dm | 2 +- .../mob/living/silicon/robot/drone/drone.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 14 +++--- .../simple_animal/friendly/spiderbot.dm | 2 +- 8 files changed, 59 insertions(+), 15 deletions(-) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 77f41cb2eb1..50a814b8de6 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -349,6 +349,51 @@ user.set_machine(src) wires.Interact(user) +/obj/machinery/camera/proc/add_network(var/network_name) + add_networks(list(network_name)) + +/obj/machinery/camera/proc/remove_network(var/network_name) + remove_networks(list(network_name)) + +/obj/machinery/camera/proc/add_networks(var/list/networks) + var/network_added + network_added = 0 + for(var/network_name in networks) + if(!(network_name in src.network)) + network += network_name + network_added = 1 + + if(network_added) + invalidateCameraCache() + +/obj/machinery/camera/proc/remove_networks(var/list/networks) + var/network_removed + network_removed = 0 + for(var/network_name in networks) + if(network_name in src.network) + network -= network_name + network_removed = 1 + + if(network_removed) + invalidateCameraCache() + +/obj/machinery/camera/proc/replace_networks(var/list/networks) + if(networks.len != network.len) + network = networks + invalidateCameraCache() + return + + for(var/new_network in networks) + if(!(new_network in network)) + network = networks + invalidateCameraCache() + return + +/obj/machinery/camera/proc/clear_all_networks() + if(network.len) + network.Cut() + invalidateCameraCache() + /obj/machinery/camera/proc/nano_structure() var/cam[0] cam["name"] = sanitize(c_tag) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 19f2216272d..8be7f6ebe52 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -99,7 +99,7 @@ C.auto_turn() - C.network = uniquelist(tempnetwork) + C.replace_networks(uniquelist(tempnetwork)) tempnetwork = difflist(C.network,restricted_camera_networks) if(!tempnetwork.len)//Camera isn't on any open network - remove its chunk from AI visibility. cameranet.removeCamera(C) diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index 9bc40c779d8..a9b040f6471 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -37,7 +37,7 @@ R.icon_state = "[R.ckey]-Standard" del(R.module) R.module = null - R.camera.network.Remove(list("Engineering","Medical","MINE")) + R.camera.remove_networks(list("Engineering","Medical","MINE")) R.updatename("Default") R.status_flags |= CANPUSH R.updateicon() diff --git a/code/modules/alarm/alarm_handler.dm b/code/modules/alarm/alarm_handler.dm index 73bd2348aa5..2be4060de28 100644 --- a/code/modules/alarm/alarm_handler.dm +++ b/code/modules/alarm/alarm_handler.dm @@ -64,10 +64,9 @@ /datum/alarm_handler/proc/on_alarm_change(var/datum/alarm/alarm, var/was_raised) for(var/obj/machinery/camera/C in alarm.cameras()) if(was_raised) - C.network.Add(category) - invalidateCameraCache() + C.add_network(category) else - C.network.Remove(category) + C.remove_network(category) notify_listeners(alarm, was_raised) /datum/alarm_handler/proc/get_alarm_severity_for_origin(var/atom/origin) diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index 8d73a40e68c..b7db5da5913 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -32,7 +32,7 @@ icon_action_button = "[icon_state]" camera = new /obj/machinery/camera(src) - camera.network = camera_networks + camera.replace_networks(camera_networks) cameranet.removeCamera(camera) camera.c_tag = user.name user << "\blue User scanned as [camera.c_tag]. Camera activated." diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 44df3272409..a1bd1c3019f 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -31,7 +31,7 @@ add_language("Drone Talk", 1) if(camera && "Robots" in camera.network) - camera.network.Add("Engineering") + camera.add_network("Engineering") //They are unable to be upgraded, so let's give them a bit of a better battery. cell.maxcharge = 10000 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 667f57f953f..d5ff0f1c094 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -125,7 +125,7 @@ var/list/robot_verbs_default = list( if(!scrambledcodes && !camera) camera = new /obj/machinery/camera(src) camera.c_tag = real_name - camera.network = list("SS13","Robots") + camera.replace_networks(list("SS13","Robots")) if(wires.IsIndexCut(BORG_WIRE_CAMERA)) camera.status = 0 @@ -275,7 +275,7 @@ var/list/robot_verbs_default = list( module = new /obj/item/weapon/robot_module/miner(src) module.channels = list("Supply" = 1) if(camera && "Robots" in camera.network) - camera.network.Add("MINE") + camera.add_network("MINE") module_sprites["Basic"] = "Miner_old" module_sprites["Advanced Droid"] = "droid-miner" module_sprites["Treadhead"] = "Miner" @@ -285,7 +285,7 @@ var/list/robot_verbs_default = list( module = new /obj/item/weapon/robot_module/crisis(src) module.channels = list("Medical" = 1) if(camera && "Robots" in camera.network) - camera.network.Add("Medical") + camera.add_network("Medical") module_sprites["Basic"] = "Medbot" module_sprites["Standard"] = "surgeon" module_sprites["Advanced Droid"] = "droid-medical" @@ -296,7 +296,7 @@ var/list/robot_verbs_default = list( module = new /obj/item/weapon/robot_module/surgeon(src) module.channels = list("Medical" = 1) if(camera && "Robots" in camera.network) - camera.network.Add("Medical") + camera.add_network("Medical") module_sprites["Basic"] = "Medbot" module_sprites["Standard"] = "surgeon" @@ -318,7 +318,7 @@ var/list/robot_verbs_default = list( module = new /obj/item/weapon/robot_module/engineering(src) module.channels = list("Engineering" = 1) if(camera && "Robots" in camera.network) - camera.network.Add("Engineering") + camera.add_network("Engineering") module_sprites["Basic"] = "Engineering" module_sprites["Antique"] = "engineerrobot" module_sprites["Landmate"] = "landmate" @@ -329,7 +329,7 @@ var/list/robot_verbs_default = list( module = new /obj/item/weapon/robot_module/construction(src) module.channels = list("Engineering" = 1) if(camera && "Robots" in camera.network) - camera.network.Add("Engineering") + camera.add_network("Engineering") module_sprites["Basic"] = "Engineering" module_sprites["Antique"] = "engineerrobot" module_sprites["Landmate"] = "landmate" @@ -1142,7 +1142,7 @@ var/list/robot_verbs_default = list( scrambledcodes = 1 //Disconnect it's camera so it's not so easily tracked. if(src.camera) - src.camera.network = list() + src.camera.clear_all_networks() cameranet.removeCamera(src.camera) diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 89cfe60b659..ab4f7b2269e 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -194,7 +194,7 @@ radio = new /obj/item/device/radio/borg(src) camera = new /obj/machinery/camera(src) camera.c_tag = "Spiderbot-[real_name]" - camera.network = list("SS13") + camera.replace_networks(list("SS13")) ..() From 6d1580976876f39bd0cd89884b5fe0d9bc612733 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 25 Feb 2015 21:32:35 -0500 Subject: [PATCH 11/14] Corrects return values for the Topic procs of several computers and some other machines as well. --- .../ATMOSPHERICS/components/binary_devices/passive_gate.dm | 2 +- code/ATMOSPHERICS/components/binary_devices/pump.dm | 2 +- code/ATMOSPHERICS/components/omni_devices/filter.dm | 2 +- code/ATMOSPHERICS/components/omni_devices/mixer.dm | 2 +- code/ATMOSPHERICS/components/trinary_devices/filter.dm | 2 +- code/ATMOSPHERICS/components/trinary_devices/mixer.dm | 2 +- code/ATMOSPHERICS/components/unary/cold_sink.dm | 3 ++- code/ATMOSPHERICS/components/unary/heat_source.dm | 3 ++- code/game/machinery/atmoalter/canister.dm | 1 + code/game/machinery/computer/lockdown.dm | 2 +- code/game/machinery/computer/medical.dm | 2 +- code/game/machinery/computer/pod.dm | 2 +- code/modules/assembly/infrared.dm | 2 +- code/modules/assembly/proximity.dm | 2 +- code/modules/assembly/signaler.dm | 2 +- code/modules/assembly/timer.dm | 2 +- code/modules/detectivework/scanning_console.dm | 1 + code/modules/holodeck/HolodeckControl.dm | 2 +- code/modules/mining/machine_processing.dm | 2 +- code/modules/mining/machine_stacking.dm | 2 +- code/modules/mining/mint.dm | 2 +- code/modules/mining/money_bag.dm | 2 +- code/modules/overmap/ships/computers/engine_control.dm | 2 +- code/modules/overmap/ships/computers/helm.dm | 2 +- code/modules/overmap/ships/computers/shuttle.dm | 2 +- code/modules/projectiles/guns/energy/temperature.dm | 2 +- code/modules/projectiles/guns/projectile/dartgun.dm | 1 + code/modules/research/rdconsole.dm | 2 +- code/modules/research/server.dm | 2 +- .../research/xenoarchaeology/genetics/reconstitutor.dm | 7 ++----- code/modules/shuttles/escape_pods.dm | 2 +- code/modules/shuttles/shuttle_console.dm | 2 +- code/modules/shuttles/shuttle_emergency.dm | 2 +- code/modules/shuttles/shuttles_multi.dm | 2 +- code/modules/virus2/centrifuge.dm | 2 +- code/modules/virus2/curer.dm | 3 +-- code/modules/virus2/diseasesplicer.dm | 2 +- code/modules/virus2/dishincubator.dm | 2 +- code/modules/virus2/isolator.dm | 2 +- code/modules/virus2/items_devices.dm | 2 +- 40 files changed, 43 insertions(+), 42 deletions(-) diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 3bd9fdae2bd..51035c5d760 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -204,7 +204,7 @@ /obj/machinery/atmospherics/binary/passive_gate/Topic(href,href_list) - if(..()) return + if(..()) return 1 if(href_list["toggle_valve"]) unlocked = !unlocked diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 53a66d70a6e..87eaf9250d5 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -190,7 +190,7 @@ Thus, the two variables affect pump operation are set in New(): return /obj/machinery/atmospherics/binary/pump/Topic(href,href_list) - if(..()) return + if(..()) return 1 if(href_list["power"]) use_power = !use_power diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index af9586037f8..3478f0f1429 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -155,7 +155,7 @@ return null /obj/machinery/atmospherics/omni/filter/Topic(href, href_list) - if(..()) return + if(..()) return 1 switch(href_list["command"]) if("power") if(!configuring) diff --git a/code/ATMOSPHERICS/components/omni_devices/mixer.dm b/code/ATMOSPHERICS/components/omni_devices/mixer.dm index bb3376fab4e..970a33feee0 100644 --- a/code/ATMOSPHERICS/components/omni_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/omni_devices/mixer.dm @@ -172,7 +172,7 @@ return data /obj/machinery/atmospherics/omni/mixer/Topic(href, href_list) - if(..()) return + if(..()) return 1 switch(href_list["command"]) if("power") diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index d582eddd360..7a5fca0fa78 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -199,7 +199,7 @@ /obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE if(..()) - return + return 1 usr.set_machine(src) src.add_fingerprint(usr) if(href_list["filterset"]) diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index bc5b49157f0..c6f5b17613e 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -156,7 +156,7 @@ return /obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list) - if(..()) return + if(..()) return 1 if(href_list["power"]) use_power = !use_power if(href_list["set_press"]) diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm index 82d7d41b7b8..e5305876ed9 100644 --- a/code/ATMOSPHERICS/components/unary/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm @@ -93,6 +93,8 @@ ui.set_auto_update(1) /obj/machinery/atmospherics/unary/freezer/Topic(href, href_list) + if(..()) + return 1 if(href_list["toggleStatus"]) use_power = !use_power update_icon() @@ -107,7 +109,6 @@ set_power_level(new_setting) add_fingerprint(usr) - return 1 /obj/machinery/atmospherics/unary/freezer/process() ..() diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm index 829f06f4202..db046e79743 100644 --- a/code/ATMOSPHERICS/components/unary/heat_source.dm +++ b/code/ATMOSPHERICS/components/unary/heat_source.dm @@ -113,6 +113,8 @@ ui.set_auto_update(1) /obj/machinery/atmospherics/unary/heater/Topic(href, href_list) + if(..()) + return 1 if(href_list["toggleStatus"]) use_power = !use_power update_icon() @@ -127,7 +129,6 @@ set_power_level(new_setting) add_fingerprint(usr) - return 1 //upgrading parts /obj/machinery/atmospherics/unary/heater/RefreshParts() diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 12ad5d1c3b5..6026166b6b8 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -302,6 +302,7 @@ update_flag /obj/machinery/portable_atmospherics/canister/Topic(href, href_list) //Do not use "if(..()) return" here, canisters will stop working in unpowered areas like space or on the derelict. // yeah but without SOME sort of Topic check any dick can mess with them via exploits as he pleases -walter0o + //First comment might be outdated. if (!istype(src.loc, /turf)) return 0 diff --git a/code/game/machinery/computer/lockdown.dm b/code/game/machinery/computer/lockdown.dm index bb1fff338d5..c1eb5d8e067 100644 --- a/code/game/machinery/computer/lockdown.dm +++ b/code/game/machinery/computer/lockdown.dm @@ -110,7 +110,7 @@ onclose(user, "lockdown") Topic(href, href_list) - ..() + if(..()) return 1 if( href_list["close"] ) usr << browse(null, "window=lockdown") diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index b67834eb601..562b92a2df9 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -148,7 +148,7 @@ /obj/machinery/computer/med_data/Topic(href, href_list) if(..()) - return + return 1 if (!( data_core.general.Find(src.active1) )) src.active1 = null diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index bdac56c85d5..0c7830a78a7 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -158,7 +158,7 @@ /obj/machinery/computer/pod/Topic(href, href_list) if(..()) - return + return 1 if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon))) usr.set_machine(src) if(href_list["power"]) diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 89699b34275..79e3cf86371 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -120,7 +120,7 @@ Topic(href, href_list) - ..() + if(..()) return 1 if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) usr << browse(null, "window=infra") onclose(usr, "infra") diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index cd0a377b433..06923f84586 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -129,7 +129,7 @@ Topic(href, href_list) - ..() + if(..()) return 1 if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) usr << browse(null, "window=prox") onclose(usr, "prox") diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index 9d79d678764..0b2acd5a5b0 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -70,7 +70,7 @@ Topic(href, href_list) - ..() + if(..()) return 1 if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) usr << browse(null, "window=radio") diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index 5a0fb6e4d42..326d36195f2 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -83,7 +83,7 @@ Topic(href, href_list) - ..() + if(..()) return 1 if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) usr << browse(null, "window=timer") onclose(usr, "timer") diff --git a/code/modules/detectivework/scanning_console.dm b/code/modules/detectivework/scanning_console.dm index 5ff719548cf..d9f3ac4df93 100644 --- a/code/modules/detectivework/scanning_console.dm +++ b/code/modules/detectivework/scanning_console.dm @@ -213,6 +213,7 @@ onclose(user,"fscanner") /obj/machinery/computer/forensic_scanning/Topic(href,href_list) + if(..()) return 1 switch(href_list["operation"]) if("login") var/mob/M = usr diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm index 9431c4685f4..fdc882eee66 100644 --- a/code/modules/holodeck/HolodeckControl.dm +++ b/code/modules/holodeck/HolodeckControl.dm @@ -106,7 +106,7 @@ var/global/list/holodeck_programs = list( /obj/machinery/computer/HolodeckControl/Topic(href, href_list) if(..()) - return + return 1 if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) usr.set_machine(src) diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index 2a029b42eeb..ee043b14415 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -67,7 +67,7 @@ /obj/machinery/mineral/processing_unit_console/Topic(href, href_list) if(..()) - return + return 1 usr.set_machine(src) src.add_fingerprint(usr) diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm index b974a57aafc..9dc23503ec7 100644 --- a/code/modules/mining/machine_stacking.dm +++ b/code/modules/mining/machine_stacking.dm @@ -43,7 +43,7 @@ /obj/machinery/mineral/stacking_unit_console/Topic(href, href_list) if(..()) - return + return 1 if(href_list["change_stack"]) var/choice = input("What would you like to set the stack amount to?") as null|anything in list(1,5,10,20,50) diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index 59857424e67..bcf46bb2922 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -116,7 +116,7 @@ /obj/machinery/mineral/mint/Topic(href, href_list) if(..()) - return + return 1 usr.set_machine(src) src.add_fingerprint(usr) if(processing==1) diff --git a/code/modules/mining/money_bag.dm b/code/modules/mining/money_bag.dm index d49ccc222f1..7409859af26 100644 --- a/code/modules/mining/money_bag.dm +++ b/code/modules/mining/money_bag.dm @@ -62,7 +62,7 @@ /obj/item/weapon/moneybag/Topic(href, href_list) if(..()) - return + return 1 usr.set_machine(src) src.add_fingerprint(usr) if(href_list["remove"]) diff --git a/code/modules/overmap/ships/computers/engine_control.dm b/code/modules/overmap/ships/computers/engine_control.dm index 87873775b08..933969a91b7 100644 --- a/code/modules/overmap/ships/computers/engine_control.dm +++ b/code/modules/overmap/ships/computers/engine_control.dm @@ -59,7 +59,7 @@ /obj/machinery/computer/engines/Topic(href, href_list) if(..()) - return + return 1 if(href_list["state"]) state = href_list["state"] diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index d78934f5749..a0611c68669 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -110,7 +110,7 @@ /obj/machinery/computer/helm/Topic(href, href_list) if(..()) - return + return 1 if (!linked) return diff --git a/code/modules/overmap/ships/computers/shuttle.dm b/code/modules/overmap/ships/computers/shuttle.dm index dbfa94043ec..5199b3e3eb0 100644 --- a/code/modules/overmap/ships/computers/shuttle.dm +++ b/code/modules/overmap/ships/computers/shuttle.dm @@ -113,7 +113,7 @@ /obj/machinery/computer/shuttle_control/explore/Topic(href, href_list) if(..()) - return + return 1 usr.set_machine(src) src.add_fingerprint(usr) diff --git a/code/modules/projectiles/guns/energy/temperature.dm b/code/modules/projectiles/guns/energy/temperature.dm index ad4db3d5ca6..cd69b9413ab 100644 --- a/code/modules/projectiles/guns/energy/temperature.dm +++ b/code/modules/projectiles/guns/energy/temperature.dm @@ -42,7 +42,7 @@ /obj/item/weapon/gun/energy/temperature/Topic(href, href_list) if (..()) - return + return 1 usr.set_machine(src) src.add_fingerprint(usr) diff --git a/code/modules/projectiles/guns/projectile/dartgun.dm b/code/modules/projectiles/guns/projectile/dartgun.dm index 4d90a0fef3c..afb1f33874c 100644 --- a/code/modules/projectiles/guns/projectile/dartgun.dm +++ b/code/modules/projectiles/guns/projectile/dartgun.dm @@ -165,6 +165,7 @@ return 0 /obj/item/weapon/gun/projectile/dartgun/Topic(href, href_list) + if(..()) return 1 src.add_fingerprint(usr) if(href_list["stop_mix"]) var/index = text2num(href_list["stop_mix"]) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 16c14863aa6..da76756fd6a 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -162,7 +162,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, /obj/machinery/computer/rdconsole/Topic(href, href_list) if(..()) - return + return 1 add_fingerprint(usr) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 5688f6b6d7c..6a5311e62be 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -205,7 +205,7 @@ /obj/machinery/computer/rdservercontrol/Topic(href, href_list) if(..()) - return + return 1 add_fingerprint(usr) usr.set_machine(src) diff --git a/code/modules/research/xenoarchaeology/genetics/reconstitutor.dm b/code/modules/research/xenoarchaeology/genetics/reconstitutor.dm index 26419c6ab28..38d6a524658 100644 --- a/code/modules/research/xenoarchaeology/genetics/reconstitutor.dm +++ b/code/modules/research/xenoarchaeology/genetics/reconstitutor.dm @@ -181,6 +181,7 @@ datum/genesequence onclose(user, "reconstitutor") /obj/machinery/computer/reconstitutor/animal/Topic(href, href_list) + if(..()) return 1 if(href_list["clone"]) var/sequence_num = text2num(href_list["sequence_num"]) var/datum/genesequence/cloned_genesequence = completed_genesequences[sequence_num] @@ -201,10 +202,9 @@ datum/genesequence pod1.biomass -= CLONE_BIOMASS else usr << "\red \icon[src] Unable to locate cloning pod!" - else - ..() /obj/machinery/computer/reconstitutor/Topic(href, href_list) + if(..()) return 1 if(href_list["insertpos"]) //world << "inserting gene for genesequence [href_list["insertgenome"]] at pos [text2num(href_list["insertpos"])]" var/sequence_num = text2num(href_list["sequence_num"]) @@ -252,9 +252,6 @@ datum/genesequence usr.unset_machine(src) usr << browse(null, "window=reconstitutor") - else - ..() - /obj/machinery/computer/reconstitutor/proc/scan_fossil(var/obj/item/weapon/fossil/scan_fossil) //see whether we accept these kind of fossils if(accepted_fossil_types.len && !accepted_fossil_types.Find(scan_fossil.type)) diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index 719c29fd9a6..289cf4d7b01 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -43,7 +43,7 @@ ui.set_auto_update(1) /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/Topic(href, href_list) - if(..()) //I hate this "return 1 to indicate they are not allowed to use the controller" crap, but not sure how else to do it without being able to call machinery/Topic() directly. + if(..()) return 1 if("manual_arm") diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm index 6a5c4934624..5cb28c40e64 100644 --- a/code/modules/shuttles/shuttle_console.dm +++ b/code/modules/shuttles/shuttle_console.dm @@ -67,7 +67,7 @@ /obj/machinery/computer/shuttle_control/Topic(href, href_list) if(..()) - return + return 1 usr.set_machine(src) src.add_fingerprint(usr) diff --git a/code/modules/shuttles/shuttle_emergency.dm b/code/modules/shuttles/shuttle_emergency.dm index 814401cb5a5..5215400a4e1 100644 --- a/code/modules/shuttles/shuttle_emergency.dm +++ b/code/modules/shuttles/shuttle_emergency.dm @@ -221,7 +221,7 @@ /obj/machinery/computer/shuttle_control/emergency/Topic(href, href_list) if(..()) - return + return 1 if(href_list["removeid"]) var/dna_hash = href_list["removeid"] diff --git a/code/modules/shuttles/shuttles_multi.dm b/code/modules/shuttles/shuttles_multi.dm index 9c2528adaa6..88a1e0fffaa 100644 --- a/code/modules/shuttles/shuttles_multi.dm +++ b/code/modules/shuttles/shuttles_multi.dm @@ -78,7 +78,7 @@ /obj/machinery/computer/shuttle_control/multi/Topic(href, href_list) if(..()) - return + return 1 usr.set_machine(src) src.add_fingerprint(usr) diff --git a/code/modules/virus2/centrifuge.dm b/code/modules/virus2/centrifuge.dm index a4c91876676..f6cf9fe3901 100644 --- a/code/modules/virus2/centrifuge.dm +++ b/code/modules/virus2/centrifuge.dm @@ -92,7 +92,7 @@ isolate() /obj/machinery/computer/centrifuge/Topic(href, href_list) - if (..()) return 0 + if (..()) return 1 var/mob/user = usr var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main") diff --git a/code/modules/virus2/curer.dm b/code/modules/virus2/curer.dm index 367e336c437..ccbbbed9a2c 100644 --- a/code/modules/virus2/curer.dm +++ b/code/modules/virus2/curer.dm @@ -80,7 +80,7 @@ /obj/machinery/computer/curer/Topic(href, href_list) if(..()) - return + return 1 usr.machine = src if (href_list["antibody"]) @@ -91,7 +91,6 @@ src.add_fingerprint(usr) src.updateUsrDialog() - return /obj/machinery/computer/curer/proc/createcure(var/obj/item/weapon/reagent_containers/container) diff --git a/code/modules/virus2/diseasesplicer.dm b/code/modules/virus2/diseasesplicer.dm index 81e4ed5e93a..4ff37034b71 100644 --- a/code/modules/virus2/diseasesplicer.dm +++ b/code/modules/virus2/diseasesplicer.dm @@ -122,7 +122,7 @@ nanomanager.update_uis(src) /obj/machinery/computer/diseasesplicer/Topic(href, href_list) - if(..()) return 0 + if(..()) return 1 var/mob/user = usr var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main") diff --git a/code/modules/virus2/dishincubator.dm b/code/modules/virus2/dishincubator.dm index b259c1eac76..6882e8e622e 100644 --- a/code/modules/virus2/dishincubator.dm +++ b/code/modules/virus2/dishincubator.dm @@ -139,7 +139,7 @@ nanomanager.update_uis(src) /obj/machinery/disease2/incubator/Topic(href, href_list) - if (..()) return 0 + if (..()) return 1 var/mob/user = usr var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main") diff --git a/code/modules/virus2/isolator.dm b/code/modules/virus2/isolator.dm index 460181bc36e..6a27d2f17d3 100644 --- a/code/modules/virus2/isolator.dm +++ b/code/modules/virus2/isolator.dm @@ -120,7 +120,7 @@ update_icon() /obj/machinery/disease2/isolator/Topic(href, href_list) - if (..()) return 0 + if (..()) return 1 var/mob/user = usr var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main") diff --git a/code/modules/virus2/items_devices.dm b/code/modules/virus2/items_devices.dm index 784c1c42492..741fdb099d5 100644 --- a/code/modules/virus2/items_devices.dm +++ b/code/modules/virus2/items_devices.dm @@ -73,7 +73,7 @@ /obj/item/weapon/virusdish/Topic(href, href_list) . = ..() - if(.) return + if(.) return 1 if(href_list["info"]) usr << browse(info, "window=info_\ref[src]") From f4f54dfed16257675d073cf44f846b4efdfa8bea Mon Sep 17 00:00:00 2001 From: MrSnapwalk Date: Wed, 25 Feb 2015 21:52:36 -0600 Subject: [PATCH 12/14] Fixes action figures not randomizing properly. --- code/game/machinery/computer/arcade.dm | 2 +- code/game/objects/random/random.dm | 44 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 056c45e4f88..12beaf47cac 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -33,7 +33,7 @@ /obj/item/toy/prize/odysseus = 1, /obj/item/toy/prize/phazon = 1, /obj/item/toy/waterflower = 1, - /obj/item/toy/figure = 1, + /obj/random/action_figure = 1, /obj/random/plushie = 1, /obj/item/toy/cultsword = 1 ) diff --git a/code/game/objects/random/random.dm b/code/game/objects/random/random.dm index 773881ab589..c4d0c75313d 100644 --- a/code/game/objects/random/random.dm +++ b/code/game/objects/random/random.dm @@ -210,6 +210,50 @@ prob(3);/obj/item/ammo_magazine/mc9mmt/rubber) +/obj/random/action_figure + name = "random action figure" + desc = "This is a random action figure." + icon = 'icons/obj/toy.dmi' + icon_state = "assistant" + item_to_spawn() + return pick(/obj/item/toy/figure/cmo,\ + /obj/item/toy/figure/assistant,\ + /obj/item/toy/figure/atmos,\ + /obj/item/toy/figure/bartender,\ + /obj/item/toy/figure/borg,\ + /obj/item/toy/figure/gardener,\ + /obj/item/toy/figure/captain,\ + /obj/item/toy/figure/cargotech,\ + /obj/item/toy/figure/ce,\ + /obj/item/toy/figure/chaplain,\ + /obj/item/toy/figure/chef,\ + /obj/item/toy/figure/chemist,\ + /obj/item/toy/figure/clown,\ + /obj/item/toy/figure/corgi,\ + /obj/item/toy/figure/detective,\ + /obj/item/toy/figure/dsquad,\ + /obj/item/toy/figure/engineer,\ + /obj/item/toy/figure/geneticist,\ + /obj/item/toy/figure/hop,\ + /obj/item/toy/figure/hos,\ + /obj/item/toy/figure/qm,\ + /obj/item/toy/figure/janitor,\ + /obj/item/toy/figure/agent,\ + /obj/item/toy/figure/librarian,\ + /obj/item/toy/figure/md,\ + /obj/item/toy/figure/mime,\ + /obj/item/toy/figure/miner,\ + /obj/item/toy/figure/ninja,\ + /obj/item/toy/figure/wizard,\ + /obj/item/toy/figure/rd,\ + /obj/item/toy/figure/roboticist,\ + /obj/item/toy/figure/scientist,\ + /obj/item/toy/figure/syndie,\ + /obj/item/toy/figure/secofficer,\ + /obj/item/toy/figure/warden,\ + /obj/item/toy/figure/psychologist,\ + /obj/item/toy/figure/paramedic,\ + /obj/item/toy/figure/ert) /obj/random/plushie From ec59f8ab0766fec9bba27830ff2f6ff2c8a31435 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 25 Feb 2015 23:35:20 -0500 Subject: [PATCH 13/14] Fixes captain's laser gun Also updates retro laser gun path, as it isn't really conceptually related to the carbine anymore, and should avoid inheriting things like fire rate. --- code/game/gamemodes/newobjective.dm | 2 +- code/game/gamemodes/objective.dm | 2 +- code/game/machinery/portable_turret.dm | 6 +++--- code/game/objects/structures/displaycase.dm | 8 ++++---- code/modules/flufftext/Hallucination.dm | 2 +- code/modules/projectiles/guns/energy/laser.dm | 12 ++++++++++-- code/modules/research/xenoarchaeology/finds/finds.dm | 2 +- .../research/xenoarchaeology/finds/finds_eguns.dm | 4 ++-- maps/exodus-3.dmm | 2 +- 9 files changed, 24 insertions(+), 16 deletions(-) diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index 949e6bfc77f..9dc8623822f 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -563,7 +563,7 @@ datum captainslaser - steal_target = /obj/item/weapon/gun/energy/laser/captain + steal_target = /obj/item/weapon/gun/energy/captain explanation_text = "Steal the captain's antique laser gun." weight = 20 diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 534383867ef..83fc1a9a85b 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -480,7 +480,7 @@ datum/objective/steal var/target_name var/global/possible_items[] = list( - "the captain's antique laser gun" = /obj/item/weapon/gun/energy/laser/captain, + "the captain's antique laser gun" = /obj/item/weapon/gun/energy/captain, "a hand teleporter" = /obj/item/weapon/hand_tele, "an RCD" = /obj/item/weapon/rcd, "a jetpack" = /obj/item/weapon/tank/jetpack, diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 60447703f5e..8c04da619b8 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -94,13 +94,13 @@ // iconholder = 1 // eprojectile = /obj/item/projectile/beam - if(/obj/item/weapon/gun/energy/laser/retro) + if(/obj/item/weapon/gun/energy/retro) iconholder = 1 -// if(/obj/item/weapon/gun/energy/laser/retro/sc_retro) +// if(/obj/item/weapon/gun/energy/retro/sc_retro) // iconholder = 1 - if(/obj/item/weapon/gun/energy/laser/captain) + if(/obj/item/weapon/gun/energy/captain) iconholder = 1 if(/obj/item/weapon/gun/energy/lasercannon) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 0ab10debe9b..4eb2236ec0c 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -15,7 +15,7 @@ if (1) new /obj/item/weapon/shard( src.loc ) if (occupied) - new /obj/item/weapon/gun/energy/laser/captain( src.loc ) + new /obj/item/weapon/gun/energy/captain( src.loc ) occupied = 0 del(src) if (2) @@ -39,14 +39,14 @@ if (prob(75)) new /obj/item/weapon/shard( src.loc ) if (occupied) - new /obj/item/weapon/gun/energy/laser/captain( src.loc ) + new /obj/item/weapon/gun/energy/captain( src.loc ) occupied = 0 del(src) /obj/structure/displaycase/meteorhit(obj/O as obj) new /obj/item/weapon/shard( src.loc ) - new /obj/item/weapon/gun/energy/laser/captain( src.loc ) + new /obj/item/weapon/gun/energy/captain( src.loc ) del(src) @@ -78,7 +78,7 @@ /obj/structure/displaycase/attack_hand(mob/user as mob) if (src.destroyed && src.occupied) - new /obj/item/weapon/gun/energy/laser/captain( src.loc ) + new /obj/item/weapon/gun/energy/captain( src.loc ) user << "\b You deactivate the hover field built into the case." src.occupied = 0 src.add_fingerprint(user) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index fe6c3ea0315..e35b100269f 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -342,7 +342,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite /obj/item/weapon/storage/toolbox/syndicate, /obj/item/weapon/aiModule,\ /obj/item/device/radio/headset/syndicate, /obj/item/weapon/plastique,\ /obj/item/device/powersink, /obj/item/weapon/storage/box/syndie_kit,\ - /obj/item/toy/syndicateballoon, /obj/item/weapon/gun/energy/laser/captain,\ + /obj/item/toy/syndicateballoon, /obj/item/weapon/gun/energy/captain,\ /obj/item/weapon/hand_tele, /obj/item/weapon/rcd, /obj/item/weapon/tank/jetpack,\ /obj/item/clothing/under/rank/captain, /obj/item/device/aicard,\ /obj/item/clothing/shoes/magboots, /obj/item/blueprints, /obj/item/weapon/disk/nuclear,\ diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 28f95d8211a..eb6e73ec2eb 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -21,22 +21,29 @@ desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice." projectile_type = /obj/item/projectile/beam/practice -obj/item/weapon/gun/energy/laser/retro +obj/item/weapon/gun/energy/retro name = "retro laser" icon_state = "retro" desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws." + fire_sound = 'sound/weapons/Laser.ogg' + slot_flags = SLOT_BELT + w_class = 3 + projectile_type = /obj/item/projectile/beam + fire_delay = 10 /obj/item/weapon/gun/energy/captain name = "antique laser gun" icon_state = "caplaser" desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding." force = 5 + fire_sound = 'sound/weapons/Laser.ogg' slot_flags = SLOT_BELT + w_class = 3 + projectile_type = /obj/item/projectile/beam origin_tech = null charge_cost = 200 //to compensate a bit for self-recharging self_recharge = 1 - /obj/item/weapon/gun/energy/lasercannon name = "laser cannon" desc = "With the laser cannon, the lasing medium is enclosed in a tube lined with uranium-235 and subjected to high neutron flux in a nuclear reactor core. This incredible technology may help YOU achieve high excitation rates with small laser volumes!" @@ -62,6 +69,7 @@ obj/item/weapon/gun/energy/laser/retro origin_tech = "combat=5;materials=3;magnets=2;syndicate=2" projectile_type = /obj/item/projectile/beam/xray charge_cost = 50 + fire_delay = 1 /obj/item/weapon/gun/energy/sniperrifle name = "\improper L.W.A.P. sniper rifle" diff --git a/code/modules/research/xenoarchaeology/finds/finds.dm b/code/modules/research/xenoarchaeology/finds/finds.dm index b758192bee0..518b2ddc40b 100644 --- a/code/modules/research/xenoarchaeology/finds/finds.dm +++ b/code/modules/research/xenoarchaeology/finds/finds.dm @@ -345,7 +345,7 @@ /obj/item/weapon/gun/energy/laser/practice/xenoarch,\ /obj/item/weapon/gun/energy/laser/xenoarch,\ /obj/item/weapon/gun/energy/xray/xenoarch,\ - /obj/item/weapon/gun/energy/laser/captain/xenoarch) + /obj/item/weapon/gun/energy/captain/xenoarch) if(spawn_type) var/obj/item/weapon/gun/energy/new_gun = new spawn_type(src.loc) new_item = new_gun diff --git a/code/modules/research/xenoarchaeology/finds/finds_eguns.dm b/code/modules/research/xenoarchaeology/finds/finds_eguns.dm index 95755e4d9c6..dc07d9a88d9 100644 --- a/code/modules/research/xenoarchaeology/finds/finds_eguns.dm +++ b/code/modules/research/xenoarchaeology/finds/finds_eguns.dm @@ -19,7 +19,7 @@ update_icon() return -/obj/item/weapon/gun/energy/laser/captain/xenoarch +/obj/item/weapon/gun/energy/captain/xenoarch icon = 'icons/obj/xenoarchaeology.dmi' update_icon() - return \ No newline at end of file + return diff --git a/maps/exodus-3.dmm b/maps/exodus-3.dmm index 5dd253a86cd..b1005c80a18 100644 --- a/maps/exodus-3.dmm +++ b/maps/exodus-3.dmm @@ -45,7 +45,7 @@ "aS" = (/obj/machinery/door/window,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/derelict/ship) "aT" = (/obj/machinery/light{icon_state = "tube1"; dir = 8},/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/derelict/ship) "aU" = (/obj/structure/lattice,/turf/space,/area/space) -"aV" = (/obj/structure/table,/obj/item/weapon/gun/energy/laser/retro,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/derelict/ship) +"aV" = (/obj/structure/table,/obj/item/weapon/gun/energy/retro,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/derelict/ship) "aW" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 8},/turf/simulated/shuttle/plating,/area/derelict/ship) "aX" = (/obj/machinery/light/small{dir = 8},/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/derelict/ship) "aY" = (/obj/structure/table,/obj/item/weapon/tank/oxygen,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/derelict/ship) From 98f6a4cae5b4bc7a105139e6dad4a6bfe5dde744 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Thu, 26 Feb 2015 11:39:41 +0100 Subject: [PATCH 14/14] Camera coverage fixes. Fixes issues with AI cameras coverage not updating properly in several instances during EMPs, destruction, etc., --- code/game/machinery/camera/camera.dm | 40 +++++++++++++------ code/game/machinery/camera/camera_assembly.dm | 5 +-- code/game/objects/items/devices/spy_bug.dm | 1 - code/global.dm | 2 +- .../modules/clothing/spacesuits/spacesuits.dm | 1 - .../living/silicon/ai/freelook/cameranet.dm | 14 ++++--- .../mob/living/silicon/ai/freelook/chunk.dm | 16 +++----- .../silicon/ai/freelook/update_triggers.dm | 12 ++---- .../modules/mob/living/silicon/robot/robot.dm | 1 - 9 files changed, 46 insertions(+), 46 deletions(-) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 50a814b8de6..1a20fd29efe 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -31,13 +31,13 @@ var/alarm_on = 0 var/busy = 0 + var/on_open_network = 0 + /obj/machinery/camera/New() wires = new(src) assembly = new(src) assembly.state = 4 - invalidateCameraCache() - /* // Use this to look for cameras that have the same c_tag. for(var/obj/machinery/camera/C in cameranet.cameras) var/list/tempnetwork = C.network&src.network @@ -56,18 +56,18 @@ /obj/machinery/camera/emp_act(severity) if(!isEmpProof()) if(prob(100/severity)) - invalidateCameraCache() stat |= EMPED SetLuminosity(0) kick_viewers() - triggerCameraAlarm(10 * severity) + triggerCameraAlarm(30 / severity) update_icon() + update_coverage() spawn(900) stat &= ~EMPED cancelCameraAlarm() update_icon() - invalidateCameraCache() + update_coverage() ..() /obj/machinery/camera/bullet_act(var/obj/item/projectile/P) @@ -114,7 +114,7 @@ destroy() /obj/machinery/camera/attackby(obj/W as obj, mob/living/user as mob) - invalidateCameraCache() + update_coverage() // DECONSTRUCTION if(isscrewdriver(W)) //user << "You start to [panel_open ? "close" : "open"] the camera's panel." @@ -195,7 +195,7 @@ //legacy support, if choice is != 1 then just kick viewers without changing status kick_viewers() else - invalidateCameraCache() + update_coverage() set_status( !src.status ) if (!(src.status)) visible_message("\red [user] has deactivated [src]!") @@ -215,11 +215,11 @@ //Used when someone breaks a camera /obj/machinery/camera/proc/destroy() - invalidateCameraCache() stat |= BROKEN kick_viewers() triggerCameraAlarm() update_icon() + update_coverage() //sparks var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() @@ -364,7 +364,7 @@ network_added = 1 if(network_added) - invalidateCameraCache() + update_coverage(1) /obj/machinery/camera/proc/remove_networks(var/list/networks) var/network_removed @@ -375,24 +375,24 @@ network_removed = 1 if(network_removed) - invalidateCameraCache() + update_coverage(1) /obj/machinery/camera/proc/replace_networks(var/list/networks) if(networks.len != network.len) network = networks - invalidateCameraCache() + update_coverage(1) return for(var/new_network in networks) if(!(new_network in network)) network = networks - invalidateCameraCache() + update_coverage(1) return /obj/machinery/camera/proc/clear_all_networks() if(network.len) network.Cut() - invalidateCameraCache() + update_coverage(1) /obj/machinery/camera/proc/nano_structure() var/cam[0] @@ -403,3 +403,17 @@ cam["y"] = y cam["z"] = z return cam + +/obj/machinery/camera/proc/update_coverage(var/network_change = 0) + if(network_change) + var/list/open_networks = difflist(network, restricted_camera_networks) + // Add or remove camera from the camera net as necessary + if(on_open_network && !open_networks.len) + cameranet.removeCamera(src) + else if(!on_open_network && open_networks.len) + on_open_network = 1 + cameranet.addCamera(src) + else + cameranet.updateVisibility(src, 0) + + invalidateCameraCache() diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 8be7f6ebe52..4ece6594f06 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -78,7 +78,7 @@ if(isscrewdriver(W)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - var/input = strip_html(input(usr, "Which networks would you like to connect this camera to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13")) + var/input = strip_html(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13")) if(!input) usr << "No input found please hang up and try your call again." return @@ -100,9 +100,6 @@ C.auto_turn() C.replace_networks(uniquelist(tempnetwork)) - tempnetwork = difflist(C.network,restricted_camera_networks) - if(!tempnetwork.len)//Camera isn't on any open network - remove its chunk from AI visibility. - cameranet.removeCamera(C) C.c_tag = input diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm index 70e3628f67e..2ad3df7ae5c 100644 --- a/code/game/objects/items/devices/spy_bug.dm +++ b/code/game/objects/items/devices/spy_bug.dm @@ -140,7 +140,6 @@ ..() name = "DV-136ZB #[rand(1000,9999)]" c_tag = name - cameranet.removeCamera(src) // Sorry, no AI spying. /obj/machinery/camera/spy/check_eye(var/mob/user as mob) return 1 diff --git a/code/global.dm b/code/global.dm index 13a62b38ce9..7bb7da4531a 100644 --- a/code/global.dm +++ b/code/global.dm @@ -10,7 +10,7 @@ var/global/list/med_hud_users = list() // List of all entities using var/global/list/sec_hud_users = list() // List of all entities using a security HUD. // Those networks can only be accessed by pre-existing terminals. AIs and new terminals can't use them. -var/list/restricted_camera_networks = list("thunder","ERT","NUKE") +var/list/restricted_camera_networks = list("thunder","ERT","NUKE","Secret") var/global/list/global_mutations = list() // List of hidden mutation things. var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called manually after an event. diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index b7db5da5913..7bf622b5394 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -33,7 +33,6 @@ camera = new /obj/machinery/camera(src) camera.replace_networks(camera_networks) - cameranet.removeCamera(camera) camera.c_tag = user.name user << "\blue User scanned as [camera.c_tag]. Camera activated." return 1 diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index d94f7053205..f05fdda45f0 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -120,12 +120,14 @@ var/datum/cameranet/cameranet = new() for(var/y = y1; y <= y2; y += 16) if(chunkGenerated(x, y, T.z)) var/datum/camerachunk/chunk = getCameraChunk(x, y, T.z) - if(choice == 0) - // Remove the camera. - chunk.cameras -= c - else if(choice == 1) - // You can't have the same camera in the list twice. - chunk.cameras |= c + // Only add actual cameras to the list of cameras + if(istype(c, /obj/machinery/camera)) + if(choice == 0) + // Remove the camera. + chunk.cameras -= c + else if(choice == 1) + // You can't have the same camera in the list twice. + chunk.cameras |= c chunk.hasChanged() // Will check if a mob is on a viewable turf. Returns 1 if it is, otherwise returns 0. diff --git a/code/modules/mob/living/silicon/ai/freelook/chunk.dm b/code/modules/mob/living/silicon/ai/freelook/chunk.dm index 33dbfd09665..11c87159796 100644 --- a/code/modules/mob/living/silicon/ai/freelook/chunk.dm +++ b/code/modules/mob/living/silicon/ai/freelook/chunk.dm @@ -64,7 +64,7 @@ else changed = 1 -// The actual updating. It gathers the visible turfs from cameras and puts them into the appropiate lists. +// The actual updating. It gathers the visible turfs from cameras and puts them into the appropriate lists. /datum/camerachunk/proc/update() @@ -76,14 +76,14 @@ var/obj/machinery/camera/c = camera if(!c) - continue + cameras -= c if(!c.can_use()) continue var/turf/point = locate(src.x + 8, src.y + 8, src.z) if(get_dist(point, c) > 24) - continue + cameras -= c for(var/turf/t in c.can_see()) newVisibleTurfs[t] = t @@ -143,14 +143,8 @@ if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16) turfs[t] = t - for(var/camera in cameras) - var/obj/machinery/camera/c = camera - if(!c) - continue - - if(!c.can_use()) - continue - + // At this point we only have functional cameras + for(var/obj/machinery/camera/c in cameras) for(var/turf/t in c.can_see()) visibleTurfs[t] = t diff --git a/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm b/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm index e6311e7a009..5bcec964a79 100644 --- a/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm +++ b/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm @@ -84,6 +84,7 @@ /obj/machinery/camera/deactivate(user as mob, var/choice = 1) ..(user, choice) + invalidateCameraCache() if(src.can_use()) cameranet.addCamera(src) else @@ -98,16 +99,11 @@ cameranet.cameras_unsorted = 1 else dd_insertObjectList(cameranet.cameras, src) - - var/list/open_networks = difflist(network,restricted_camera_networks) //...but if all of camera's networks are restricted, it only works for specific camera consoles. - if(open_networks.len) //If there is at least one open network, chunk is available for AI usage. - cameranet.addCamera(src) + update_coverage(1) /obj/machinery/camera/Del() cameranet.cameras -= src - var/list/open_networks = difflist(network,restricted_camera_networks) - if(open_networks.len) - cameranet.removeCamera(src) + clear_all_networks() ..() -#undef BORG_CAMERA_BUFFER \ No newline at end of file +#undef BORG_CAMERA_BUFFER diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index d5ff0f1c094..3539e683afb 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1143,7 +1143,6 @@ var/list/robot_verbs_default = list( //Disconnect it's camera so it's not so easily tracked. if(src.camera) src.camera.clear_all_networks() - cameranet.removeCamera(src.camera) /mob/living/silicon/robot/proc/ResetSecurityCodes()