[READY] pAI's have headsets and can use encryption keys (#43603)

* pAI's have little AI headsets and can use encryption keys.

* pAI's now spawn radio AND headset.

Reverted radio code and changed new variables to the new headset var

* Undid the comment out of radio code.

As far as I can tell this isn't working properly though. Tried testing it locally and can't enable/disable radio as pAI or master.

* Removed redundant null keyslots.

* Final version

It should all work.

# Conflicts:
#	code/game/objects/items/devices/radio/headset.dm
#	code/modules/mob/living/silicon/pai/pai.dm

* Merge

* Mergies

* Update code/modules/mob/living/silicon/pai/pai.dm

Co-Authored-By: RaveRadbury <3204033+RaveRadbury@users.noreply.github.com>
This commit is contained in:
RaveRadbury
2019-04-24 08:30:27 -07:00
committed by moo
parent cdfd007e88
commit 8dcfdff576
6 changed files with 41 additions and 7 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
/obj/machinery/announcement_system/Initialize()
. = ..()
GLOB.announcement_systems += src
radio = new /obj/item/radio/headset/ai(src)
radio = new /obj/item/radio/headset/silicon/ai(src)
update_icon()
/obj/machinery/announcement_system/update_icon()
@@ -157,3 +157,4 @@
return
if(pai && !pai.holoform)
pai.emp_act(severity)
@@ -261,12 +261,17 @@ GLOBAL_LIST_INIT(channel_tokens, list(
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/ai
/obj/item/radio/headset/silicon/pai
name = "\proper mini Integrated Subspace Transceiver "
subspace_transmission = FALSE
/obj/item/radio/headset/silicon/ai
name = "\proper Integrated Subspace Transceiver "
keyslot2 = new /obj/item/encryptionkey/ai
command = TRUE
/obj/item/radio/headset/ai/can_receive(freq, level)
/obj/item/radio/headset/silicon/can_receive(freq, level)
return ..(freq, level, TRUE)
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
+1 -1
View File
@@ -148,7 +148,7 @@
aiPDA.name = real_name + " (" + aiPDA.ownjob + ")"
aiMulti = new(src)
radio = new /obj/item/radio/headset/ai(src)
radio = new /obj/item/radio/headset/silicon/ai(src)
aicamera = new/obj/item/camera/siliconcam/ai_camera(src)
deploy_action.Grant(src)
+14 -1
View File
@@ -26,6 +26,7 @@
var/speakDoubleExclamation = "alarms"
var/speakQuery = "queries"
var/obj/item/radio/headset // The pAI's headset
var/obj/item/pai_cable/cable // The cable we produce and use when door or camera jacking
var/master // Name of the one who commands us
@@ -55,6 +56,7 @@
var/obj/item/instrument/piano_synth/internal_instrument
var/encryptmod = FALSE
var/holoform = FALSE
var/canholo = TRUE
var/obj/item/card/id/access_card = null
@@ -106,7 +108,7 @@
card = P
signaler = new(src)
if(!radio)
radio = new /obj/item/radio(src)
radio = new /obj/item/radio/headset/silicon/pai(src)
//PDA
pda = new(src)
@@ -289,3 +291,14 @@
/mob/living/silicon/pai/process()
emitterhealth = CLAMP((emitterhealth + emitterregen), -50, emittermaxhealth)
/obj/item/paicard/attackby(obj/item/W, mob/user, params)
..()
user.set_machine(src)
if(pai.encryptmod == TRUE)
if(W.tool_behaviour == TOOL_SCREWDRIVER)
pai.radio.attackby(W, user, params)
else if(istype(W, /obj/item/encryptionkey))
pai.radio.attackby(W, user, params)
else
to_chat(user, "Encryption Key ports not configured.")
@@ -1,5 +1,4 @@
// TODO:
// - Additional radio modules
// - Potentially roll HUDs and Records into one
// - Shock collar/lock system for prisoner pAIs?
// - Put cable in user's hand instead of on the ground
@@ -20,7 +19,8 @@
"universal translator" = 35,
//"projection array" = 15
"remote signaller" = 5,
"loudness booster" = 25
"loudness booster" = 25,
"encryption keys" = 20
)
/mob/living/silicon/pai/proc/paiInterface()
@@ -51,6 +51,8 @@
left_part = softwareMedicalRecord()
if("securityrecord")
left_part = softwareSecurityRecord()
if("encryptionkeys")
left_part = softwareEncryptionKeys()
if("translator")
left_part = softwareTranslator()
if("atmosensor")
@@ -252,6 +254,9 @@
else
var/datum/atom_hud/med = GLOB.huds[med_hud]
med.remove_hud_from(src)
if("encryptionkeys")
if(href_list["toggle"])
encryptmod = TRUE
if("translator")
if(href_list["toggle"])
grant_all_languages(TRUE)
@@ -320,6 +325,8 @@
dat += "<a href='byond://?src=[REF(src)];software=securityhud;sub=0'>Facial Recognition Suite</a>[(secHUD) ? "<font color=#55FF55> On</font>" : "<font color=#FF5555> Off</font>"] <br>"
if(s == "medical HUD")
dat += "<a href='byond://?src=[REF(src)];software=medicalhud;sub=0'>Medical Analysis Suite</a>[(medHUD) ? "<font color=#55FF55> On</font>" : "<font color=#FF5555> Off</font>"] <br>"
if(s == "encryption keys")
dat += "<a href='byond://?src=[REF(src)];software=encryptionkeys;sub=0'>Channel Encryption Firmware</a>[(encryptmod) ? "<font color=#55FF55> On</font>" : "<font color=#FF5555> Off</font>"] <br>"
if(s == "universal translator")
var/datum/language_holder/H = get_language_holder()
dat += "<a href='byond://?src=[REF(src)];software=translator;sub=0'>Universal Translator</a>[H.omnitongue ? "<font color=#55FF55> On</font>" : "<font color=#FF5555> Off</font>"] <br>"
@@ -471,6 +478,14 @@
. += "<BR>\n<A href='?src=[REF(src)];software=securityrecord;sub=0'>Back</A><BR>"
return .
// Encryption kets
/mob/living/silicon/pai/proc/softwareEncryptionKeys()
var/dat = {"<h3>Encryption Key Firmware</h3><br>
When enabled, this device will be able to use up to two (2) encryption keys for departmental channel access.<br><br>
The device is currently [encryptmod ? "<font color=#55FF55>en" : "<font color=#FF5555>dis" ]abled.</font><br>[encryptmod ? "" : "<a href='byond://?src=[REF(src)];software=encryptionkeys;sub=0;toggle=1'>Activate Encryption Key Ports</a><br>"]"}
return dat
// Universal Translator
/mob/living/silicon/pai/proc/softwareTranslator()
var/datum/language_holder/H = get_language_holder()