From b80dad03299a98bbec0d6b1f77c2f0dd504b0820 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Wed, 29 Jul 2015 19:58:01 +0200 Subject: [PATCH 1/7] Fixes #10355 - Bots can now be unlocked when you have one of the required accesses, instead of requiring all of them. - In other words, security officers can once again unlock beepsky. I believe no other bot uses more than one access level for unlocking. --- code/modules/mob/living/bot/bot.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 36110c600cb..cfaee275362 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -25,7 +25,7 @@ botcard.access = botcard_access.Copy() access_scanner = new /obj(src) - access_scanner.req_access = req_access.Copy() + access_scanner.req_one_access = req_access.Copy() /mob/living/bot/Life() ..() From ad45e5d16b0a02f69ad844f882cae7e55cb36a4b Mon Sep 17 00:00:00 2001 From: Atlantis Date: Sun, 2 Aug 2015 23:23:18 +0200 Subject: [PATCH 2/7] Implements req_one_access for bots, as per request on GitHub discussion. --- code/modules/mob/living/bot/bot.dm | 4 +++- code/modules/mob/living/bot/secbot.dm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index cfaee275362..51abe32723f 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -16,6 +16,7 @@ var/obj/access_scanner = null var/list/req_access = list() + var/list/req_one_access = list() /mob/living/bot/New() ..() @@ -25,7 +26,8 @@ botcard.access = botcard_access.Copy() access_scanner = new /obj(src) - access_scanner.req_one_access = req_access.Copy() + access_scanner.req_access = req_access.Copy() + access_scanner.req_one_access = req_one_access.Copy() /mob/living/bot/Life() ..() diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index a0a7a69450a..ee4a35e15b0 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -4,7 +4,7 @@ icon_state = "secbot0" maxHealth = 50 health = 50 - req_access = list(access_security, access_forensics_lockers) + req_one_access = list(access_security, access_forensics_lockers) botcard_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court) var/mob/target From d25d0c700cde4caaae2cdc2960c6ee3e8dd714ac Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 3 Aug 2015 20:01:55 -0400 Subject: [PATCH 3/7] Fixes #10403 can_start() no longer attempts to rebuild the antag candidate lists but instead reads the existing lists that are now built in pre_setup() Also fixes an inverted check that was preventing antags from spawning. --- code/game/antagonist/antagonist.dm | 16 +++++++++------- code/game/gamemodes/game_mode.dm | 14 +++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index 08d21673c7f..059a883aad3 100644 --- a/code/game/antagonist/antagonist.dm +++ b/code/game/antagonist/antagonist.dm @@ -76,7 +76,8 @@ return candidates /datum/antagonist/proc/attempt_random_spawn() - attempt_spawn(flags & (ANTAG_OVERRIDE_MOB|ANTAG_OVERRIDE_JOB)) + build_candidate_list(flags & (ANTAG_OVERRIDE_MOB|ANTAG_OVERRIDE_JOB)) + attempt_spawn() finalize_spawn() /datum/antagonist/proc/attempt_late_spawn(var/datum/mind/player) @@ -90,16 +91,17 @@ add_antagonist(player,0,1,0,1,1) return +/datum/antagonist/proc/build_candidate_list(var/ghosts_only) + // Get the raw list of potential players. + update_current_antag_max() + candidates = get_candidates(ghosts_only) + //Selects players that will be spawned in the antagonist role from the potential candidates //Selected players are added to the pending_antagonists lists. //Attempting to spawn an antag role with ANTAG_OVERRIDE_JOB should be done before jobs are assigned, //so that they do not occupy regular job slots. All other antag roles should be spawned after jobs are //assigned, so that job restrictions can be respected. -/datum/antagonist/proc/attempt_spawn(var/ghosts_only) - - // Get the raw list of potential players. - update_current_antag_max() - candidates = get_candidates(ghosts_only) +/datum/antagonist/proc/attempt_spawn(var/rebuild_candidates = 1) // Update our boundaries. if(!candidates.len) @@ -115,7 +117,7 @@ /datum/antagonist/proc/draft_antagonist(var/datum/mind/player) //Check if the player can join in this antag role, or if the player has already been given an antag role. - if(can_become_antag(player) && !player.special_role) + if(!can_become_antag(player) || player.special_role) return 0 pending_antagonists |= player diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index d409b511ca8..4a89de7ea6f 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -245,10 +245,8 @@ var/global/list/additional_antag_types = list() if(!(antag_templates && antag_templates.len)) return 1 - // Attempt to mark folks down as ready to go. Don't finalize until post setup. var/datum/antagonist/main_antags = antag_templates[1] - var/list/candidates = main_antags.get_candidates() - if(candidates.len >= required_enemies) + if(main_antags.candidates.len >= required_enemies) return 1 return 0 @@ -263,10 +261,12 @@ var/global/list/additional_antag_types = list() EMajor.delay_modifier = event_delay_mod_major /datum/game_mode/proc/pre_setup() - //antag roles that replace jobs need to be assigned before the job controller hands out jobs. for(var/datum/antagonist/antag in antag_templates) + antag.build_candidate_list() //compile a list of all eligible candidates + + //antag roles that replace jobs need to be assigned before the job controller hands out jobs. if(antag.flags & ANTAG_OVERRIDE_JOB) - antag.attempt_spawn() + antag.attempt_spawn() //select antags to be spawned ///post_setup() /datum/game_mode/proc/post_setup() @@ -284,8 +284,8 @@ var/global/list/additional_antag_types = list() //Assign all antag types for this game mode. Any players spawned as antags earlier should have been removed from the pending list, so no need to worry about those. for(var/datum/antagonist/antag in antag_templates) if(!(antag.flags & ANTAG_OVERRIDE_JOB)) - antag.attempt_spawn() - antag.finalize_spawn() + antag.attempt_spawn() //select antags to be spawned + antag.finalize_spawn() //actually spawn antags if(antag.is_latejoin_template()) latejoin_templates |= antag From e935baf1d82f652cdf842c58e2ea27d51da1f3f0 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Tue, 4 Aug 2015 12:41:32 +0300 Subject: [PATCH 4/7] Fixes #10418 - bots don't remover from stuns --- code/modules/mob/living/bot/bot.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 36110c600cb..a63e48b401b 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -29,11 +29,13 @@ /mob/living/bot/Life() ..() + if(health <= 0) + death() + return weakened = 0 stunned = 0 paralysis = 0 - if(health <= 0) - death() + update_canmove() /mob/living/bot/updatehealth() if(status_flags & GODMODE) From 595b58197dded226658c12c9cfee8f8989cc793b Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Wed, 5 Aug 2015 00:49:28 +0100 Subject: [PATCH 5/7] fix pAI radios not working --- .../game/objects/items/devices/radio/radio.dm | 3 +++ code/modules/nano/nanointeraction.dm | 4 +-- nano/templates/pai_radio.tmpl | 26 +++++++++---------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index d6b254cad19..903a32ed3b6 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -149,6 +149,9 @@ else channels[chan_name] |= FREQ_LISTENING + if(href_list["nowindow"]) // here for pAIs, maybe others will want it, idk + return + interact(usr) /obj/item/device/radio/proc/autosay(var/message, var/from, var/channel) //BS12 EDIT diff --git a/code/modules/nano/nanointeraction.dm b/code/modules/nano/nanointeraction.dm index 1e6c304541b..1a220771df3 100644 --- a/code/modules/nano/nanointeraction.dm +++ b/code/modules/nano/nanointeraction.dm @@ -18,7 +18,7 @@ return STATUS_UPDATE // Ghosts can view updates /mob/living/silicon/pai/can_use_topic(var/src_object) - if(src_object == src && !stat) + if((src_object == src || src_object == radio) && !stat) return STATUS_INTERACTIVE else return ..() @@ -128,4 +128,4 @@ var/flags = 0 /datum/topic_state/proc/href_list(var/mob/user) - return list() \ No newline at end of file + return list() diff --git a/nano/templates/pai_radio.tmpl b/nano/templates/pai_radio.tmpl index bcdacdb48f1..70e76a26334 100644 --- a/nano/templates/pai_radio.tmpl +++ b/nano/templates/pai_radio.tmpl @@ -8,11 +8,11 @@ code/modules/mob/living/silicon/pai/software_modules.dm
{{if data.listening}} - {{:helper.link("On", '', {"stopic":"radio", "talk":1}, 'selected')}} - {{:helper.link("Off", '', {"stopic":"radio", "talk":1})}} + {{:helper.link("On", '', {"stopic":"radio", "talk":1, "nowindow":1}, 'selected')}} + {{:helper.link("Off", '', {"stopic":"radio", "talk":1, "nowindow":1})}} {{else}} - {{:helper.link("On", '', {"stopic":"radio", "talk":1})}} - {{:helper.link("Off", '', {"stopic":"radio", "talk":1}, 'selected')}} + {{:helper.link("On", '', {"stopic":"radio", "talk":1, "nowindow":1})}} + {{:helper.link("Off", '', {"stopic":"radio", "talk":1, "nowindow":1}, 'selected')}} {{/if}}
@@ -22,11 +22,11 @@ code/modules/mob/living/silicon/pai/software_modules.dm Frequency:
- {{:helper.link("--", '', {"stopic":"radio", "freq":-10})}} - {{:helper.link("-", '', {"stopic":"radio", "freq": -2})}} + {{:helper.link("--", '', {"stopic":"radio", "freq":-10, "nowindow":1})}} + {{:helper.link("-", '', {"stopic":"radio", "freq": -2, "nowindow":1})}}
{{:data.frequency}}
- {{:helper.link("+", '', {"stopic":"radio", "freq": 2})}} - {{:helper.link("++", '', {"stopic":"radio", "freq": 10})}} + {{:helper.link("+", '', {"stopic":"radio", "freq": 2, "nowindow":1})}} + {{:helper.link("++", '', {"stopic":"radio", "freq": 10, "nowindow":1})}}
@@ -37,12 +37,12 @@ code/modules/mob/living/silicon/pai/software_modules.dm
{{if value.listening}} - {{:helper.link("On", '', {"stopic":"radio", "channel":value.name, "listen":1}, 'selected')}} - {{:helper.link("Off", '', {"stopic":"radio", "channel":value.name, "listen":1})}} + {{:helper.link("On", '', {"stopic":"radio", "channel":value.name, "listen":1, "nowindow":1}, 'selected')}} + {{:helper.link("Off", '', {"stopic":"radio", "channel":value.name, "listen":1, "nowindow":1})}} {{else}} - {{:helper.link("On", '', {"stopic":"radio", "channel":value.name, "listen":1})}} - {{:helper.link("Off", '', {"stopic":"radio", "channel":value.name, "listen":1}, 'selected')}} + {{:helper.link("On", '', {"stopic":"radio", "channel":value.name, "listen":1, "nowindow":1})}} + {{:helper.link("Off", '', {"stopic":"radio", "channel":value.name, "listen":1, "nowindow":1}, 'selected')}} {{/if}}
-{{/for}} \ No newline at end of file +{{/for}} From c71d78ab1a01df9dab367c9561824de5c698f77a Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Wed, 5 Aug 2015 00:50:04 +0100 Subject: [PATCH 6/7] add debug verb as pAI-spawning adminverb --- baystation12.dme | 1 + code/modules/admin/admin_verbs.dm | 3 ++- code/modules/mob/living/silicon/pai/admin.dm | 21 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 code/modules/mob/living/silicon/pai/admin.dm diff --git a/baystation12.dme b/baystation12.dme index e286a177bc9..b7193eb0209 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1172,6 +1172,7 @@ #include "code\modules\mob\living\silicon\decoy\death.dm" #include "code\modules\mob\living\silicon\decoy\decoy.dm" #include "code\modules\mob\living\silicon\decoy\life.dm" +#include "code\modules\mob\living\silicon\pai\admin.dm" #include "code\modules\mob\living\silicon\pai\death.dm" #include "code\modules\mob\living\silicon\pai\examine.dm" #include "code\modules\mob\living\silicon\pai\life.dm" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c0c92a81c7e..f0cba1b8f21 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -80,7 +80,8 @@ var/list/admin_verbs_admin = list( /client/proc/allow_character_respawn, /* Allows a ghost to respawn */ /client/proc/event_manager_panel, /client/proc/empty_ai_core_toggle_latejoin, - /client/proc/view_chemical_reaction_logs + /client/proc/view_chemical_reaction_logs, + /client/proc/makePAI ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, diff --git a/code/modules/mob/living/silicon/pai/admin.dm b/code/modules/mob/living/silicon/pai/admin.dm new file mode 100644 index 00000000000..069c5d2c684 --- /dev/null +++ b/code/modules/mob/living/silicon/pai/admin.dm @@ -0,0 +1,21 @@ +// Originally a debug verb, made it a proper adminverb for ~fun~ +/client/proc/makePAI(turf/t in view(), name as text, pai_key as null|text) + set name = "Make pAI" + set category = "Admin" + + if(!check_rights(R_ADMIN)) + return + + if(!pai_key) + var/client/C = input("Select client") as null|anything in clients + if(!C) return + pai_key = C.key + + log_and_message_admins("made a pAI with key=[pai_key] at ([t.x],[t.y],[t.z])") + var/obj/item/device/paicard/card = new(t) + var/mob/living/silicon/pai/pai = new(card) + pai.key = pai_key + card.setPersonality(pai) + + if(name) + pai.SetName(name) From 73a9c240179a863c517c1401fb9d54e8a3ad9e32 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 5 Aug 2015 09:26:43 +0200 Subject: [PATCH 7/7] Removes code in mob/living/bot/Life() that is now handled by mob/living/Life(). --- code/modules/mob/living/bot/bot.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 5bdc0969286..821c87bb1fa 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -37,7 +37,6 @@ weakened = 0 stunned = 0 paralysis = 0 - update_canmove() /mob/living/bot/updatehealth() if(status_flags & GODMODE)