mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Announcement system overhaul, crew monitor system overhaul, add portable crew monitor
This commit is contained in:
@@ -538,7 +538,21 @@
|
||||
var/obj/vehicle/V = AM
|
||||
V.RunOver(src)
|
||||
|
||||
|
||||
// Get rank from ID, ID inside PDA, PDA, ID in wallet, etc.
|
||||
/mob/living/carbon/human/proc/get_authentification_rank(var/if_no_id = "No id", var/if_no_job = "No job")
|
||||
var/obj/item/device/pda/pda = wear_id
|
||||
if (istype(pda))
|
||||
if (pda.id)
|
||||
return pda.id.rank
|
||||
else
|
||||
return pda.ownrank
|
||||
else
|
||||
var/obj/item/weapon/card/id/id = get_idcard()
|
||||
if(id)
|
||||
return id.rank ? id.rank : if_no_job
|
||||
else
|
||||
return if_no_id
|
||||
|
||||
//gets assignment from ID or ID inside PDA or PDA itself
|
||||
//Useful when player do something with computers
|
||||
/mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#define AI_CHECK_WIRELESS 1
|
||||
#define AI_CHECK_RADIO 2
|
||||
|
||||
var/list/ai_list = list()
|
||||
|
||||
//Not sure why this is necessary...
|
||||
@@ -77,8 +80,8 @@ var/list/ai_list = list()
|
||||
possibleNames -= pickedName
|
||||
pickedName = null
|
||||
|
||||
real_name = pickedName
|
||||
name = real_name
|
||||
aiPDA = new/obj/item/device/pda/ai(src)
|
||||
SetName(pickedName)
|
||||
anchored = 1
|
||||
canmove = 0
|
||||
density = 1
|
||||
@@ -96,11 +99,6 @@ var/list/ai_list = list()
|
||||
|
||||
verbs += /mob/living/silicon/ai/proc/show_laws_verb
|
||||
|
||||
aiPDA = new/obj/item/device/pda/ai(src)
|
||||
aiPDA.owner = name
|
||||
aiPDA.ownjob = "AI"
|
||||
aiPDA.name = name + " (" + aiPDA.ownjob + ")"
|
||||
|
||||
aiMulti = new(src)
|
||||
aiRadio = new(src)
|
||||
aiRadio.myAi = src
|
||||
@@ -112,7 +110,7 @@ var/list/ai_list = list()
|
||||
if (istype(loc, /turf))
|
||||
verbs.Add(/mob/living/silicon/ai/proc/ai_network_change, \
|
||||
/mob/living/silicon/ai/proc/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change, \
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/botcall, /mob/living/silicon/ai/proc/control_integrated_radio, /mob/living/silicon/ai/proc/control_hud, /mob/living/silicon/ai/proc/change_arrival_message, /mob/living/silicon/ai/proc/ai_store_location, /mob/living/silicon/ai/proc/ai_goto_location, /mob/living/silicon/ai/proc/ai_remove_location)
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/botcall, /mob/living/silicon/ai/proc/control_integrated_radio, /mob/living/silicon/ai/proc/control_hud, /mob/living/silicon/ai/proc/change_arrival_message, /mob/living/silicon/ai/proc/ai_store_location, /mob/living/silicon/ai/proc/ai_goto_location, /mob/living/silicon/ai/proc/ai_remove_location, /mob/living/silicon/ai/proc/nano_crew_monitor)
|
||||
|
||||
if(!safety)//Only used by AIize() to successfully spawn an AI.
|
||||
if (!B)//If there is no player/brain inside.
|
||||
@@ -155,11 +153,25 @@ var/list/ai_list = list()
|
||||
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
|
||||
init_subsystems()
|
||||
|
||||
ai_list += src
|
||||
..()
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/proc/SetName(pickedName as text)
|
||||
real_name = pickedName
|
||||
name = pickedName
|
||||
if(eyeobj)
|
||||
eyeobj.name = "[pickedName] (AI Eye)"
|
||||
|
||||
// Set ai pda name
|
||||
if(aiPDA)
|
||||
aiPDA.ownjob = "AI"
|
||||
aiPDA.owner = pickedName
|
||||
aiPDA.name = pickedName + " (" + aiPDA.ownjob + ")"
|
||||
|
||||
/mob/living/silicon/ai/Destroy()
|
||||
ai_list -= src
|
||||
@@ -301,14 +313,15 @@ var/list/ai_list = list()
|
||||
if(src.stat == 2)
|
||||
src << "You can't call the shuttle because you are dead!"
|
||||
return
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = src
|
||||
if(AI.control_disabled)
|
||||
usr << "Wireless control is disabled!"
|
||||
return
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS))
|
||||
return
|
||||
|
||||
var/confirm = alert("Are you sure you want to call the shuttle?", "Confirm Shuttle Call", "Yes", "No")
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS))
|
||||
return
|
||||
|
||||
if(confirm == "Yes")
|
||||
call_shuttle_proc(src)
|
||||
|
||||
@@ -324,14 +337,15 @@ var/list/ai_list = list()
|
||||
src.view_core()
|
||||
|
||||
/mob/living/silicon/ai/verb/toggle_anchor()
|
||||
set category = "AI Commands"
|
||||
set name = "Toggle Floor Bolts"
|
||||
if(!isturf(loc)) // if their location isn't a turf
|
||||
return // stop
|
||||
anchored = !anchored // Toggles the anchor
|
||||
set category = "AI Commands"
|
||||
set name = "Toggle Floor Bolts"
|
||||
|
||||
if(!isturf(loc)) // if their location isn't a turf
|
||||
return // stop
|
||||
|
||||
anchored = !anchored // Toggles the anchor
|
||||
|
||||
src << "[anchored ? "<b>You are now anchored.</b>" : "<b>You are now unanchored.</b>"]"
|
||||
// the message in the [] will change depending whether or not the AI is anchored
|
||||
src << "[anchored ? "<b>You are now anchored.</b>" : "<b>You are now unanchored.</b>"]"
|
||||
|
||||
/mob/living/silicon/ai/update_canmove()
|
||||
return 0
|
||||
@@ -339,16 +353,35 @@ var/list/ai_list = list()
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_cancel_call()
|
||||
set category = "Malfunction"
|
||||
|
||||
if(src.stat == 2)
|
||||
src << "You can't send the shuttle back because you are dead!"
|
||||
return
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = src
|
||||
if(AI.control_disabled)
|
||||
src << "Wireless control is disabled!"
|
||||
return
|
||||
cancel_call_proc(src)
|
||||
return
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS))
|
||||
return
|
||||
|
||||
var/confirm = alert("Are you sure you want to recall the shuttle?", "Confirm Shuttle Recall", "Yes", "No")
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS))
|
||||
return
|
||||
|
||||
if(confirm == "Yes")
|
||||
cancel_call_proc(src)
|
||||
|
||||
/mob/living/silicon/ai/proc/announcement()
|
||||
set name = "Announcement"
|
||||
set desc = "Create a vocal announcement by typing in the available words to create a sentence."
|
||||
set category = "AI Commands"
|
||||
|
||||
if(src.stat == 2)
|
||||
src << "You can't call make an announcement because you are dead!"
|
||||
return
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
ai_announcement()
|
||||
|
||||
/mob/living/silicon/ai/check_eye(var/mob/user as mob)
|
||||
if (!current)
|
||||
@@ -581,9 +614,9 @@ var/list/ai_list = list()
|
||||
src << "<span class='danger'>Critical error. System offline.</span>"
|
||||
return
|
||||
|
||||
if(control_disabled)
|
||||
src << "Wireless communication is disabled."
|
||||
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
var/ai_allowed_Zlevel = list(1,3,5)
|
||||
var/d
|
||||
var/area/bot_area
|
||||
@@ -704,6 +737,9 @@ var/list/ai_list = list()
|
||||
set name = "Jump To Network"
|
||||
unset_machine()
|
||||
var/cameralist[0]
|
||||
|
||||
if(check_unable())
|
||||
return
|
||||
|
||||
if(usr.stat == 2)
|
||||
usr << "You can't change your camera network because you are dead!"
|
||||
@@ -721,6 +757,9 @@ var/list/ai_list = list()
|
||||
cameralist[i] = i
|
||||
var/old_network = network
|
||||
network = input(U, "Which network would you like to view?") as null|anything in cameralist
|
||||
|
||||
if(check_unable())
|
||||
return
|
||||
|
||||
if(!U.eyeobj)
|
||||
U.view_core()
|
||||
@@ -752,8 +791,16 @@ var/list/ai_list = list()
|
||||
if(usr.stat == 2)
|
||||
usr <<"You cannot change your emotional status because you are dead!"
|
||||
return
|
||||
|
||||
if(check_unable())
|
||||
return
|
||||
|
||||
var/list/ai_emotions = list("Very Happy", "Happy", "Neutral", "Unsure", "Confused", "Sad", "BSOD", "Blank", "Problems?", "Awesome", "Facepalm", "Friend Computer")
|
||||
var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions
|
||||
|
||||
if(check_unable())
|
||||
return
|
||||
|
||||
for (var/obj/machinery/M in machines) //change status
|
||||
if(istype(M, /obj/machinery/ai_status_display))
|
||||
var/obj/machinery/ai_status_display/AISD = M
|
||||
@@ -773,6 +820,9 @@ var/list/ai_list = list()
|
||||
set name = "Change Hologram"
|
||||
set desc = "Change the default hologram available to AI to something else."
|
||||
set category = "AI Commands"
|
||||
|
||||
if(check_unable())
|
||||
return
|
||||
|
||||
var/input
|
||||
if(alert("Would you like to select a hologram based on a crew member or switch to unique avatar?",,"Crew Member","Unique")=="Crew Member")
|
||||
@@ -827,6 +877,9 @@ var/list/ai_list = list()
|
||||
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
if(check_unable())
|
||||
return
|
||||
|
||||
camera_light_on = !camera_light_on
|
||||
src << "Camera lights [camera_light_on ? "activated" : "deactivated"]."
|
||||
@@ -904,8 +957,11 @@ var/list/ai_list = list()
|
||||
set name = "Radio Settings"
|
||||
set desc = "Allows you to change settings of your radio."
|
||||
set category = "AI Commands"
|
||||
|
||||
src << "Accessing Subspace Transceiver control..."
|
||||
|
||||
if(check_unable(AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
src << "Accessing Subspace Transceiver control..."
|
||||
if (src.aiRadio)
|
||||
src.aiRadio.interact(src)
|
||||
|
||||
@@ -956,4 +1012,25 @@ var/list/ai_list = list()
|
||||
src << "\red You deny the request."
|
||||
else
|
||||
src << "\red You've failed to open an airlock for [target]"
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/check_unable(var/flags = 0)
|
||||
if(stat == DEAD)
|
||||
usr << "\red You are dead!"
|
||||
return 1
|
||||
|
||||
if((flags & AI_CHECK_WIRELESS) && src.control_disabled)
|
||||
usr << "\red Wireless control is disabled!"
|
||||
return 1
|
||||
if((flags & AI_CHECK_RADIO) && src.aiRadio.disabledAi)
|
||||
src << "\red System Error - Transceiver Disabled!"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/ai/proc/is_in_chassis()
|
||||
return istype(loc, /turf)
|
||||
|
||||
#undef AI_CHECK_WIRELESS
|
||||
#undef AI_CHECK_RADIO
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
src << "ERROR: Eyeobj not found. Creating new eye..."
|
||||
src.eyeobj = new(src.loc)
|
||||
src.eyeobj.ai = src
|
||||
src.eyeobj.name = "[src.name] (AI Eye)" // Give it a name
|
||||
src.SetName(src.name)
|
||||
|
||||
if(client && client.eye)
|
||||
client.eye = src
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
var/obj/nano_module/crew_monitor/crew_monitor
|
||||
|
||||
/mob/living/silicon/ai/proc/init_subsystems()
|
||||
crew_monitor = new(src)
|
||||
|
||||
/mob/living/silicon/ai/proc/nano_crew_monitor()
|
||||
set category = "AI Commands"
|
||||
set name = "Crew Monitor"
|
||||
|
||||
crew_monitor.ui_interact(usr)
|
||||
@@ -1,32 +1,32 @@
|
||||
/mob/living/silicon/ai/say(var/message)
|
||||
if(parent && istype(parent) && parent.stat != 2)
|
||||
parent.say(message)
|
||||
return
|
||||
//If there is a defined "parent" AI, it is actually an AI, and it is alive, anything the AI tries to say is said by the parent instead.
|
||||
..(message)
|
||||
if(parent && istype(parent) && parent.stat != 2)
|
||||
parent.say(message) //If there is a defined "parent" AI, it is actually an AI, and it is alive, anything the AI tries to say is said by the parent instead.
|
||||
return
|
||||
|
||||
..(message)
|
||||
|
||||
/mob/living/silicon/ai/say_understands(var/other)
|
||||
if (istype(other, /mob/living/carbon/human))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/robot))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/decoy))
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/brain))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/pai))
|
||||
return 1
|
||||
return ..()
|
||||
if (istype(other, /mob/living/carbon/human))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/robot))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/decoy))
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/brain))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/pai))
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/ai/say_quote(var/text)
|
||||
var/ending = copytext(text, length(text))
|
||||
var/ending = copytext(text, length(text))
|
||||
|
||||
if (ending == "?")
|
||||
return "queries, \"[text]\"";
|
||||
else if (ending == "!")
|
||||
return "declares, \"[text]\"";
|
||||
if (ending == "?")
|
||||
return "queries, \"[text]\"";
|
||||
else if (ending == "!")
|
||||
return "declares, \"[text]\"";
|
||||
|
||||
return "states, \"[text]\"";
|
||||
return "states, \"[text]\"";
|
||||
|
||||
/mob/living/silicon/ai/proc/IsVocal()
|
||||
|
||||
@@ -36,44 +36,28 @@ var/const/VOX_DELAY = 100
|
||||
var/const/VOX_PATH = "sound/vox_fem/"
|
||||
|
||||
/mob/living/silicon/ai/verb/announcement_help()
|
||||
|
||||
set name = "Announcement Help"
|
||||
set desc = "Display a list of vocal words to announce to the crew."
|
||||
set category = "AI Commands"
|
||||
|
||||
|
||||
var/dat = "Here is a list of words you can type into the 'Announcement' button to create sentences to vocally announce to everyone on the same level at you.<BR> \
|
||||
<UL><LI>You can also click on the word to preview it.</LI>\
|
||||
<LI>You can only say 30 words for every announcement.</LI>\
|
||||
<LI>Do not use punctuation as you would normally, if you want a pause you can use the full stop and comma characters by separating them with spaces, like so: 'Alpha . Test , Bravo'.</LI></UL>\
|
||||
<font class='bad'>WARNING:</font><BR>Misuse of the announcement system will get you job banned.<HR>"
|
||||
|
||||
var/index = 0
|
||||
for(var/word in vox_sounds)
|
||||
index++
|
||||
dat += "<A href='?src=\ref[src];say_word=[word]'>[capitalize(word)]</A>"
|
||||
if(index != vox_sounds.len)
|
||||
dat += " / "
|
||||
|
||||
var/datum/browser/popup = new(src, "announce_help", "Announcement Help", 500, 400)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/announcement()
|
||||
|
||||
set name = "Announcement"
|
||||
set desc = "Create a vocal announcement by typing in the available words to create a sentence."
|
||||
set name = "Announcement Help"
|
||||
set desc = "Display a list of vocal words to announce to the crew."
|
||||
set category = "AI Commands"
|
||||
if(src.stat == 2)
|
||||
src << "You can't call the shuttle because you are dead!"
|
||||
return
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = src
|
||||
if(AI.control_disabled)
|
||||
usr << "Wireless control is disabled!"
|
||||
return
|
||||
|
||||
var/dat = "Here is a list of words you can type into the 'Announcement' button to create sentences to vocally announce to everyone on the same level at you.<BR> \
|
||||
<UL><LI>You can also click on the word to preview it.</LI>\
|
||||
<LI>You can only say 30 words for every announcement.</LI>\
|
||||
<LI>Do not use punctuation as you would normally, if you want a pause you can use the full stop and comma characters by separating them with spaces, like so: 'Alpha . Test , Bravo'.</LI></UL>\
|
||||
<font class='bad'>WARNING:</font><BR>Misuse of the announcement system will get you job banned.<HR>"
|
||||
|
||||
var/index = 0
|
||||
for(var/word in vox_sounds)
|
||||
index++
|
||||
dat += "<A href='?src=\ref[src];say_word=[word]'>[capitalize(word)]</A>"
|
||||
if(index != vox_sounds.len)
|
||||
dat += " / "
|
||||
|
||||
var/datum/browser/popup = new(src, "announce_help", "Announcement Help", 500, 400)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_announcement()
|
||||
if(announcing_vox > world.time)
|
||||
src << "<span class='notice'>Please wait [round((announcing_vox - world.time) / 10)] seconds.</span>"
|
||||
return
|
||||
@@ -112,27 +96,24 @@ var/const/VOX_PATH = "sound/vox_fem/"
|
||||
|
||||
|
||||
/proc/play_vox_word(var/word, var/z_level, var/mob/only_listener)
|
||||
word = lowertext(word)
|
||||
if(vox_sounds[word])
|
||||
var/sound_file = vox_sounds[word]
|
||||
var/sound/voice = sound(sound_file, wait = 1, channel = VOX_CHANNEL)
|
||||
voice.status = SOUND_STREAM
|
||||
|
||||
word = lowertext(word)
|
||||
|
||||
if(vox_sounds[word])
|
||||
|
||||
var/sound_file = vox_sounds[word]
|
||||
var/sound/voice = sound(sound_file, wait = 1, channel = VOX_CHANNEL)
|
||||
voice.status = SOUND_STREAM
|
||||
|
||||
// If there is no single listener, broadcast to everyone in the same z level
|
||||
if(!only_listener)
|
||||
// Play voice for all mobs in the z level
|
||||
for(var/mob/M in player_list)
|
||||
if(M.client)
|
||||
var/turf/T = get_turf(M)
|
||||
if(T.z == z_level)
|
||||
M << voice
|
||||
else
|
||||
only_listener << voice
|
||||
return 1
|
||||
return 0
|
||||
// If there is no single listener, broadcast to everyone in the same z level
|
||||
if(!only_listener)
|
||||
// Play voice for all mobs in the z level
|
||||
for(var/mob/M in player_list)
|
||||
if(M.client)
|
||||
var/turf/T = get_turf(M)
|
||||
if(T.z == z_level && !isdeaf(M))
|
||||
M << voice
|
||||
else
|
||||
only_listener << voice
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// VOX sounds moved to /code/defines/vox_sounds.dm
|
||||
|
||||
|
||||
@@ -158,6 +158,12 @@ proc/isnewplayer(A)
|
||||
|
||||
proc/hasorgans(A)
|
||||
return ishuman(A)
|
||||
|
||||
proc/isdeaf(A)
|
||||
if(istype(A, /mob))
|
||||
var/mob/M = A
|
||||
return (M.sdisabilities & DEAF) || M.ear_deaf
|
||||
return 0
|
||||
|
||||
/proc/hsl2rgb(h, s, l)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user