mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +01:00
Add AI text announcements
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
var/list/ai_list = list()
|
||||
var/list/ai_verbs_default = list(
|
||||
/mob/living/silicon/ai/proc/announcement,
|
||||
/mob/living/silicon/ai/proc/ai_announcement_text,
|
||||
/mob/living/silicon/ai/proc/ai_call_shuttle,
|
||||
/mob/living/silicon/ai/proc/ai_camera_track,
|
||||
/mob/living/silicon/ai/proc/ai_camera_list,
|
||||
@@ -79,6 +80,7 @@ var/list/ai_verbs_default = list(
|
||||
var/last_paper_seen = null
|
||||
var/can_shunt = 1
|
||||
var/last_announcement = ""
|
||||
var/datum/announcement/priority/announcement
|
||||
var/obj/machinery/bot/Bot
|
||||
var/turf/waypoint //Holds the turf of the currently selected waypoint.
|
||||
var/waypoint_mode = 0 //Waypoint mode is for selecting a turf via clicking.
|
||||
@@ -97,6 +99,11 @@ var/list/ai_verbs_default = list(
|
||||
src.verbs -= silicon_subsystems
|
||||
|
||||
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0)
|
||||
announcement = new()
|
||||
announcement.title = "A.I. Announcement"
|
||||
announcement.announcement_type = "A.I. Announcement"
|
||||
announcement.newscast = 1
|
||||
|
||||
var/list/possibleNames = ai_names
|
||||
|
||||
var/pickedName = null
|
||||
@@ -325,15 +332,35 @@ var/list/ai_verbs_default = list(
|
||||
set name = "Show Crew Manifest"
|
||||
set category = "AI Commands"
|
||||
show_station_manifest()
|
||||
|
||||
/mob/living/silicon/ai/var/message_cooldown = 0
|
||||
/mob/living/silicon/ai/proc/ai_announcement_text()
|
||||
set category = "AI Commands"
|
||||
set name = "Make Station Announcement"
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
if(message_cooldown)
|
||||
src << "<span class='warning'>Please allow one minute to pass between announcements.</span>"
|
||||
return
|
||||
|
||||
var/input = input(usr, "Please write a message to announce to the station crew.", "A.I. Announcement") as text|null
|
||||
if(!input)
|
||||
return
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
announcement.Announce(input)
|
||||
message_cooldown = 1
|
||||
spawn(600)//One minute cooldown
|
||||
message_cooldown = 0
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_call_shuttle()
|
||||
set name = "Call Emergency Shuttle"
|
||||
set category = "AI Commands"
|
||||
|
||||
if(src.stat == DEAD)
|
||||
src << "<span class='warning'>You can't call the shuttle because you are dead!</span>"
|
||||
return
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS))
|
||||
return
|
||||
|
||||
@@ -356,11 +383,7 @@ var/list/ai_verbs_default = list(
|
||||
/mob/living/silicon/ai/proc/ai_cancel_call()
|
||||
set name = "Recall Emergency Shuttle"
|
||||
set category = "AI Commands"
|
||||
|
||||
if(src.stat == 2)
|
||||
src << "You can't send the shuttle back because you are dead!"
|
||||
return
|
||||
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS))
|
||||
return
|
||||
|
||||
@@ -394,10 +417,6 @@ var/list/ai_verbs_default = list(
|
||||
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
|
||||
|
||||
@@ -949,14 +968,14 @@ var/list/ai_verbs_default = list(
|
||||
|
||||
/mob/living/silicon/ai/proc/check_unable(var/flags = 0)
|
||||
if(stat == DEAD)
|
||||
usr << "\red You are dead!"
|
||||
usr << "<span class='warning'>You are dead!</span>"
|
||||
return 1
|
||||
|
||||
if((flags & AI_CHECK_WIRELESS) && src.control_disabled)
|
||||
usr << "\red Wireless control is disabled!"
|
||||
usr << "<span class='warning'>Wireless control is disabled!</span>"
|
||||
return 1
|
||||
if((flags & AI_CHECK_RADIO) && src.aiRadio.disabledAi)
|
||||
src << "\red System Error - Transceiver Disabled!"
|
||||
src << "<span class='warning'>System Error - Transceiver Disabled!</span>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -28,13 +28,19 @@ var/const/VOX_PATH = "sound/vox_fem/"
|
||||
popup.open()
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_announcement()
|
||||
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
if(announcing_vox > world.time)
|
||||
src << "<span class='notice'>Please wait [round((announcing_vox - world.time) / 10)] seconds.</span>"
|
||||
src << "<span class='warning'>Please wait [round((announcing_vox - world.time) / 10)] seconds.</span>"
|
||||
return
|
||||
|
||||
var/message = input(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", src.last_announcement) as text
|
||||
var/message = input(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", last_announcement) as text|null
|
||||
|
||||
last_announcement = message
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
if(!message || announcing_vox > world.time)
|
||||
return
|
||||
@@ -54,7 +60,7 @@ var/const/VOX_PATH = "sound/vox_fem/"
|
||||
incorrect_words += word
|
||||
|
||||
if(incorrect_words.len)
|
||||
src << "<span class='notice'>These words are not available on the announcement system: [english_list(incorrect_words)].</span>"
|
||||
src << "<span class='warning'>These words are not available on the announcement system: [english_list(incorrect_words)].</span>"
|
||||
return
|
||||
|
||||
announcing_vox = world.time + VOX_DELAY
|
||||
|
||||
Reference in New Issue
Block a user