Merge pull request #5654 from GunHog/Potato_AI_Wants_To_Hear_You_Scream_Too

Gives Traitor AIs the Syndicate Channel!
This commit is contained in:
Swag McYolosteinen
2014-11-10 17:18:04 +01:00
5 changed files with 59 additions and 72 deletions
+2
View File
@@ -195,6 +195,8 @@
killer.set_zeroth_law(law, law_borg)
killer << "New law: 0. [law]"
give_codewords(killer)
killer.set_syndie_radio()
killer << "Your radio has been upgraded! Use :t to speak on an encrypted channel with Syndicate Agents!"
/datum/game_mode/proc/auto_declare_completion_traitor()
+4 -4
View File
@@ -255,17 +255,17 @@ var/list/sec_departments = list("engineering", "supply", "medical", "science")
recalculateChannels()
/obj/item/device/radio/headset/headset_sec/department/engi
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
keyslot = new /obj/item/device/encryptionkey/headset_sec
keyslot2 = new /obj/item/device/encryptionkey/headset_eng
/obj/item/device/radio/headset/headset_sec/department/supply
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
keyslot = new /obj/item/device/encryptionkey/headset_sec
keyslot2 = new /obj/item/device/encryptionkey/headset_cargo
/obj/item/device/radio/headset/headset_sec/department/med
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
keyslot = new /obj/item/device/encryptionkey/headset_sec
keyslot2 = new /obj/item/device/encryptionkey/headset_med
/obj/item/device/radio/headset/headset_sec/department/sci
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
keyslot = new /obj/item/device/encryptionkey/headset_sec
keyslot2 = new /obj/item/device/encryptionkey/headset_sci
@@ -9,21 +9,18 @@
canhear_range = 0 // can't hear headsets from very far away
slot_flags = SLOT_EARS
var/translate_binary = 0
var/translate_hive = 0
var/obj/item/device/encryptionkey/keyslot1 = null
var/obj/item/device/encryptionkey/keyslot2 = null
maxf = 1489
/obj/item/device/radio/headset/New()
..()
keyslot1 = new /obj/item/device/encryptionkey/
keyslot = new /obj/item/device/encryptionkey/
recalculateChannels()
/obj/item/device/radio/headset/Destroy()
qdel(keyslot1)
qdel(keyslot)
qdel(keyslot2)
keyslot1 = null
keyslot = null
keyslot2 = null
..()
@@ -48,17 +45,14 @@
/obj/item/device/radio/headset/syndicate/New()
..()
qdel(keyslot1)
keyslot1 = new /obj/item/device/encryptionkey/syndicate
syndie = 1
recalculateChannels()
make_syndie()
/obj/item/device/radio/headset/binary
origin_tech = "syndicate=3"
/obj/item/device/radio/headset/binary/New()
..()
qdel(keyslot1)
keyslot1 = new /obj/item/device/encryptionkey/binary
qdel(keyslot)
keyslot = new /obj/item/device/encryptionkey/binary
recalculateChannels()
/obj/item/device/radio/headset/headset_sec
@@ -203,7 +197,7 @@
return
if(istype(W, /obj/item/weapon/screwdriver))
if(keyslot1 || keyslot2)
if(keyslot || keyslot2)
for(var/ch_name in channels)
@@ -211,11 +205,11 @@
secure_radio_connections[ch_name] = null
if(keyslot1)
if(keyslot)
var/turf/T = get_turf(user)
if(T)
keyslot1.loc = T
keyslot1 = null
keyslot.loc = T
keyslot = null
@@ -232,14 +226,14 @@
user << "This headset doesn't have any encryption keys! How useless..."
if(istype(W, /obj/item/device/encryptionkey/))
if(keyslot1 && keyslot2)
if(keyslot && keyslot2)
user << "The headset can't hold another key!"
return
if(!keyslot1)
if(!keyslot)
user.drop_item()
W.loc = src
keyslot1 = W
keyslot = W
else
user.drop_item()
@@ -252,28 +246,8 @@
return
/obj/item/device/radio/headset/proc/recalculateChannels()
src.channels = list()
src.translate_binary = 0
src.translate_hive = 0
src.syndie = 0
if(keyslot1)
for(var/ch_name in keyslot1.channels)
if(ch_name in src.channels)
continue
src.channels += ch_name
src.channels[ch_name] = keyslot1.channels[ch_name]
if(keyslot1.translate_binary)
src.translate_binary = 1
if(keyslot1.translate_hive)
src.translate_hive = 1
if(keyslot1.syndie)
src.syndie = 1
/obj/item/device/radio/headset/recalculateChannels()
..()
if(keyslot2)
for(var/ch_name in keyslot2.channels)
if(ch_name in src.channels)
+35 -27
View File
@@ -16,8 +16,11 @@
var/b_stat = 0
var/broadcasting = 0
var/listening = 1
var/translate_binary = 0
var/translate_hive = 0
var/freerange = 0 // 0 - Sanitize frequencies, 1 - Full range
var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
var/obj/item/device/encryptionkey/keyslot //To allow the radio to accept encryption keys.
var/subspace_transmission = 0
var/syndie = 0//Holder to see if it's a syndicate encrpyed radio
var/maxf = 1499
@@ -49,6 +52,38 @@
if(radio_controller)
initialize()
/obj/item/device/radio/proc/recalculateChannels()
channels = list()
translate_binary = 0
translate_hive = 0
syndie = 0
if(keyslot)
for(var/ch_name in keyslot.channels)
if(ch_name in src.channels)
continue
channels += ch_name
channels[ch_name] = keyslot.channels[ch_name]
if(keyslot.translate_binary)
translate_binary = 1
if(keyslot.translate_hive)
translate_hive = 1
if(keyslot.syndie)
syndie = 1
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, radiochannels[ch_name])
/obj/item/device/radio/proc/make_syndie() //Turns normal radios into Syndicate radios!
qdel(keyslot)
keyslot = new /obj/item/device/encryptionkey/syndicate
syndie = 1
recalculateChannels()
/obj/item/device/radio/Destroy()
qdel(wires)
wires = null
@@ -493,7 +528,6 @@
//Giving borgs their own radio to have some more room to work with -Sieve
/obj/item/device/radio/borg
var/obj/item/device/encryptionkey/keyslot = null//Borg radios can handle a single encryption key
/obj/item/device/radio/borg/syndicate
syndie = 1
@@ -543,32 +577,6 @@
return
/obj/item/device/radio/borg/proc/recalculateChannels()
src.channels = list()
src.syndie = 0
if(keyslot)
for(var/ch_name in keyslot.channels)
if(ch_name in src.channels)
continue
src.channels += ch_name
src.channels[ch_name] = keyslot.channels[ch_name]
if(keyslot.syndie)
src.syndie = 1
for (var/ch_name in channels)
if(!radio_controller)
sleep(30) // Waiting for the radio_controller to be created.
if(!radio_controller)
src.name = "broken radio"
return
secure_radio_connections[ch_name] = add_radio(src, radiochannels[ch_name])
return
/obj/item/device/radio/borg/Topic(href, href_list)
if(usr.stat || !on)
return
+3
View File
@@ -725,6 +725,9 @@ var/list/ai_list = list()
if (radio)
radio.interact(src)
/mob/living/silicon/ai/proc/set_syndie_radio()
if(radio)
radio.make_syndie()
/mob/living/silicon/ai/attack_slime(mob/living/carbon/slime/user)
return