Merge pull request #7 from Markolie/master

Fixes drone talk
This commit is contained in:
Fox-McCloud
2014-11-30 00:23:10 -05:00
5 changed files with 155 additions and 123 deletions
+2
View File
@@ -10,6 +10,7 @@ var/list/department_radio_keys = list(
":s" = "Security", "#s" = "Security", ".s" = "Security",
":w" = "whisper", "#w" = "whisper", ".w" = "whisper",
":b" = "binary", "#b" = "binary", ".b" = "binary",
":d" = "drone", "#d" = "drone", ".d" = "drone",
":a" = "alientalk", "#a" = "alientalk", ".a" = "alientalk",
":t" = "Syndicate", "#t" = "Syndicate", ".t" = "Syndicate",
":u" = "Supply", "#u" = "Supply", ".u" = "Supply",
@@ -27,6 +28,7 @@ var/list/department_radio_keys = list(
":E" = "Engineering", "#E" = "Engineering", ".E" = "Engineering",
":S" = "Security", "#S" = "Security", ".S" = "Security",
":W" = "whisper", "#W" = "whisper", ".W" = "whisper",
":D" = "drone", "#D" = "drone", ".D" = "drone",
":B" = "binary", "#B" = "binary", ".B" = "binary",
":A" = "alientalk", "#A" = "alientalk", ".A" = "alientalk",
":T" = "Syndicate", "#T" = "Syndicate", ".T" = "Syndicate",
@@ -91,7 +91,6 @@
//Drones can only use binary and say emotes. NOTHING else.
//TBD, fix up boilerplate. ~ Z
/mob/living/silicon/robot/drone/say(var/message)
if (!message)
return
@@ -102,42 +101,65 @@
if (src.client.handle_spam_prevention(message,MUTE_IC))
return
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if (stat == 2)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
return say_dead(message)
//Must be concious to speak
if (stat)
return
if(copytext(message,1,2) == "*")
return emote(copytext(message,2))
else if(length(message) >= 2)
if(copytext(message, 1 ,3) == ":d" || copytext(message, 1 ,3) == ":D")
if(!is_component_functioning("radio"))
src << "\red Your radio transmitter isn't functional."
return
for (var/mob/living/S in living_mob_list)
if(istype(S, /mob/living/silicon/robot/drone))
S << "<i><span class='game say'>Drone Talk, <span class='name'>[name]</span><span class='message'> transmits, \"[message]\"</span></span></i>"
for (var/mob/M in dead_mob_list)
if(!istype(M,/mob/new_player) && !istype(M,/mob/living/carbon/brain))
M << "<i><span class='game say'>Drone Talk, <span class='name'>[name]</span><span class='message'> transmits, \"[trim(copytext(message,3))]\"</span></span></i>"
if (length(message) >= 2)
var/prefix = copytext(message, 1, 3)
if (department_radio_keys[prefix] == "drone")
message = copytext(message, 3)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(istype(src, /mob/living/silicon/robot/drone))
var/mob/living/silicon/robot/drone/R = src
if(!R.is_component_functioning("comms"))
src << "\red Your drone communications component isn't functional."
return
drone_talk(message)
else
var/list/listeners = hearers(5,src)
listeners |= src
for(var/mob/living/silicon/robot/drone/D in listeners)
if(D.client) D << "<b>[src]</b> transmits, \"[message]\""
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
for(var/mob/living/silicon/D in listeners)
if(D.client)
D << "<b>[src]</b> transmits, \"[message]\""
for (var/mob/M in player_list)
if (!M.client)
continue
if (istype(M, /mob/new_player))
continue
else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS)
if(M.client) M << "<b>[src]</b> transmits, \"[message]\""
else if(M.stat == 2 && (M.client.prefs.toggles & CHAT_GHOSTEARS) && src.client)
M << "<b>[src]</b> <a href='byond://?src=\ref[M];follow2=\ref[M];follow=\ref[src]'>(Follow)</a> transmits, \"[message]\""
else if(M.stat == 2 && src.client && M in listeners)
M << "<b>[src]</b> <a href='byond://?src=\ref[M];follow2=\ref[M];follow=\ref[src]'>(Follow)</a> transmits, \"[message]\""
/mob/living/proc/drone_talk(var/message)
log_say("[key_name(src)] : [message]")
message = trim(message)
if (!message)
return
var/message_a = say_quote(message)
var/rendered = "<i><span class='game say'>Drone Talk, <span class='name'>[name]</span> <span class='message'>[message_a]</span></span></i>"
for (var/mob/living/S in living_mob_list)
if(istype(S, /mob/living/silicon/robot/drone))
S.show_message(rendered, 2)
for (var/mob/S in dead_mob_list)
if(!istype(S,/mob/new_player) && !istype(S,/mob/living/carbon/brain))
var/rendered2 = "<i><span class='game say'>Drone Talk, <span class='name'>[name]</span> <a href='byond://?src=\ref[S];follow2=\ref[S];follow=\ref[src]'>(Follow)</a> <span class='message'>[message_a]</span></span></i>"
S.show_message(rendered2, 2)
//Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..().
/mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -316,7 +338,7 @@
full_law_reset()
src << "<br><b>You are a maintenance drone, a tiny-brained robotic repair machine</b>."
src << "You have no individual will, no personality, and no drives or urges other than your laws."
src << "Use <b>:b</b> to talk to your fellow synthetics, <b>:d</b> to talk to other drones, and <b>say</b> to speak silently to your nearby fellows."
src << "Use <b>:d</b> to talk to other drones, and <b>say</b> to speak silently to your nearby fellows."
src << "Remember, you are <b>lawed against interference with the crew</b>. Also remember, <b>you DO NOT take orders from the AI.</b>"
src << "<b>Don't invade their worksites, don't steal their resources, don't tell them about the changeling in the toilets.</b>"
src << "<b>If a crewmember has noticed you, <i>you are probably breaking your first law</i></b>."
+4
View File
@@ -3,6 +3,10 @@
shuttle_tag = "Special Operations"
req_access = list(access_cent_general)
/obj/machinery/computer/shuttle_control/specops/attack_ai(user as mob)
user << "\red Access Denied."
return 1
//for shuttles that may use a different docking port at each location
/datum/shuttle/ferry/multidock
var/docking_controller_tag_station