diff --git a/baystation12.dme b/baystation12.dme index 0d6cc2ba5c..38fe37bdc9 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1278,6 +1278,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/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index 08d21673c7..059a883aad 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 3ed80e1154..143c37553d 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -166,10 +166,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 @@ -184,10 +182,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() @@ -205,8 +205,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 diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index f8689208e9..ca2f6300e2 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -156,6 +156,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/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c3b3fb54ee..94bbf16415 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -88,7 +88,8 @@ var/list/admin_verbs_admin = list( /client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */ /client/proc/change_human_appearance_self, /* Allows the human-based mob itself change its basic appearance */ /client/proc/change_security_level, - /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/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index d58af33eef..5bdc096928 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() ..() @@ -26,14 +27,17 @@ access_scanner = new /obj(src) access_scanner.req_access = req_access.Copy() + access_scanner.req_one_access = req_one_access.Copy() /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) diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index a0a7a69450..ee4a35e15b 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 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 0000000000..069c5d2c68 --- /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) diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm index aa692e0a23..79c08227d5 100644 --- a/code/modules/nano/interaction/default.dm +++ b/code/modules/nano/interaction/default.dm @@ -15,7 +15,7 @@ return STATUS_UPDATE // Ghosts can view updates /mob/living/silicon/pai/default_can_use_topic(var/src_object) - if(src_object == src && !stat) + if((src_object == src || src_object == radio) && !stat) return STATUS_INTERACTIVE else return ..() diff --git a/nano/templates/pai_radio.tmpl b/nano/templates/pai_radio.tmpl index bcdacdb48f..70e76a2633 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