Merge remote-tracking branch 'upstream/dev-freeze' into dev

This commit is contained in:
PsiOmegaDelta
2015-08-05 09:25:53 +02:00
10 changed files with 64 additions and 32 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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,

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

View File

@@ -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 ..()

View File

@@ -8,11 +8,11 @@ code/modules/mob/living/silicon/pai/software_modules.dm
</div>
<div class="itemContent">
{{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}}
</div>
</div>
@@ -22,11 +22,11 @@ code/modules/mob/living/silicon/pai/software_modules.dm
Frequency:
</div>
<div class="itemContent">
{{: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})}}
<div style="float: left; width: 80px; text-align: center;">{{:data.frequency}}</div>
{{: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})}}
</div>
</div>
@@ -37,11 +37,11 @@ code/modules/mob/living/silicon/pai/software_modules.dm
</div>
<div class="itemContent">
{{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}}
</div>
</div>