mirror of
https://github.com/quotefox/Hyper-Station-13.git
synced 2026-08-23 12:46:17 +01:00
Cyborg PDA Update
Allows robots to use the same PDA subtype as the AI. Adds a 1/1000 chance of AOL "You've got mail!" playing when receiving a PDA message.
This commit is contained in:
@@ -59,7 +59,9 @@
|
||||
#define ui_borg_store "CENTER+2:16,SOUTH:5" //borgs
|
||||
#define ui_borg_camera "CENTER+3:21,SOUTH:5" //borgs
|
||||
#define ui_borg_album "CENTER+4:21,SOUTH:5" //borgs
|
||||
#define ui_borg_language_menu "CENTER+4:21,SOUTH+1:5" //borgs
|
||||
#define ui_borg_language_menu "CENTER+6:21,SOUTH+1:5" //borgs
|
||||
#define ui_borg_pda_log "CENTER+5:21,SOUTH:5" //borgs
|
||||
#define ui_borg_pda_send "CENTER+6:21,SOUTH:5" //borgs
|
||||
|
||||
#define ui_monkey_head "CENTER-5:13,SOUTH:5" //monkey
|
||||
#define ui_monkey_mask "CENTER-4:14,SOUTH:5" //monkey
|
||||
|
||||
@@ -128,6 +128,17 @@
|
||||
|
||||
//End of module select
|
||||
|
||||
//PDA stuff
|
||||
using = new /obj/screen/ai/pda_msg_send
|
||||
using.screen_loc = ui_borg_pda_send
|
||||
using.hud = src
|
||||
static_inventory += using
|
||||
|
||||
using = new/obj/screen/ai/pda_msg_show
|
||||
using.screen_loc = ui_borg_pda_log
|
||||
using.hud = src
|
||||
static_inventory += using
|
||||
|
||||
//Photography stuff
|
||||
using = new /obj/screen/ai/image_take()
|
||||
using.screen_loc = ui_borg_camera
|
||||
|
||||
@@ -795,8 +795,12 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
tnote += "<i><b>← From <a href='byond://?src=[REF(src)];choice=Message;target=[REF(signal.source)]'>[signal.data["name"]]</a> ([signal.data["job"]]):</b></i><br>[signal.format_message()]<br>"
|
||||
|
||||
if (!silent)
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
audible_message("[icon2html(src, hearers(src))] *[ttone]*", null, 3)
|
||||
if(prob(0.1))
|
||||
playsound(src, 'sound/machines/youve_got_mail.ogg', 50, 1)
|
||||
audible_message("[icon2html(src, hearers(src))] *You've got mail!*", null, 3)
|
||||
else
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
audible_message("[icon2html(src, hearers(src))] *[ttone]*", null, 3)
|
||||
//Search for holder of the PDA.
|
||||
var/mob/living/L = null
|
||||
if(loc && isliving(loc))
|
||||
@@ -1069,21 +1073,21 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
|
||||
//AI verb and proc for sending PDA messages.
|
||||
|
||||
/mob/living/silicon/ai/proc/cmd_send_pdamesg(mob/user)
|
||||
/mob/living/silicon/proc/cmd_send_pdamesg(mob/user)
|
||||
var/list/plist = list()
|
||||
var/list/namecounts = list()
|
||||
|
||||
if(aiPDA.toff)
|
||||
if(builtInPDA.toff)
|
||||
to_chat(user, "Turn on your receiver in order to send messages.")
|
||||
return
|
||||
|
||||
for (var/obj/item/pda/P in get_viewable_pdas())
|
||||
if (P == src)
|
||||
continue
|
||||
else if (P == aiPDA)
|
||||
else if (P == builtInPDA)
|
||||
continue
|
||||
|
||||
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P
|
||||
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)+" ("+P.ownjob+")"] = P
|
||||
|
||||
var/c = input(user, "Please select a PDA") as null|anything in sortList(plist)
|
||||
|
||||
@@ -1096,42 +1100,42 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
var/add_photo = input(user,"Do you want to attach a photo?","Photo","No") as null|anything in list("Yes","No")
|
||||
if(add_photo=="Yes")
|
||||
var/datum/picture/Pic = aicamera.selectpicture(user)
|
||||
aiPDA.picture = Pic
|
||||
builtInPDA.picture = Pic
|
||||
|
||||
if(incapacitated())
|
||||
return
|
||||
|
||||
aiPDA.create_message(src, selected)
|
||||
builtInPDA.create_message(src, selected)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/verb/cmd_toggle_pda_receiver()
|
||||
/mob/living/silicon/verb/cmd_toggle_pda_receiver()
|
||||
set category = "AI Commands"
|
||||
set name = "PDA - Toggle Sender/Receiver"
|
||||
if(usr.stat == DEAD)
|
||||
return //won't work if dead
|
||||
if(!isnull(aiPDA))
|
||||
aiPDA.toff = !aiPDA.toff
|
||||
to_chat(usr, "<span class='notice'>PDA sender/receiver toggled [(aiPDA.toff ? "Off" : "On")]!</span>")
|
||||
if(!isnull(builtInPDA))
|
||||
builtInPDA.toff = !builtInPDA.toff
|
||||
to_chat(usr, "<span class='notice'>PDA sender/receiver toggled [(builtInPDA.toff ? "Off" : "On")]!</span>")
|
||||
else
|
||||
to_chat(usr, "You do not have a PDA. You should make an issue report about this.")
|
||||
|
||||
/mob/living/silicon/ai/verb/cmd_toggle_pda_silent()
|
||||
/mob/living/silicon/verb/cmd_toggle_pda_silent()
|
||||
set category = "AI Commands"
|
||||
set name = "PDA - Toggle Ringer"
|
||||
if(usr.stat == DEAD)
|
||||
return //won't work if dead
|
||||
if(!isnull(aiPDA))
|
||||
if(!isnull(builtInPDA))
|
||||
//0
|
||||
aiPDA.silent = !aiPDA.silent
|
||||
to_chat(usr, "<span class='notice'>PDA ringer toggled [(aiPDA.silent ? "Off" : "On")]!</span>")
|
||||
builtInPDA.silent = !builtInPDA.silent
|
||||
to_chat(usr, "<span class='notice'>PDA ringer toggled [(builtInPDA.silent ? "Off" : "On")]!</span>")
|
||||
else
|
||||
to_chat(usr, "You do not have a PDA. You should make an issue report about this.")
|
||||
|
||||
/mob/living/silicon/ai/proc/cmd_show_message_log(mob/user)
|
||||
/mob/living/silicon/proc/cmd_show_message_log(mob/user)
|
||||
if(incapacitated())
|
||||
return
|
||||
if(!isnull(aiPDA))
|
||||
var/HTML = "<html><head><title>AI PDA Message Log</title></head><body>[aiPDA.tnote]</body></html>"
|
||||
if(!isnull(builtInPDA))
|
||||
var/HTML = "<html><head><title>PDA Message Log</title></head><body>[builtInPDA.tnote]</body></html>"
|
||||
user << browse(HTML, "window=log;size=400x444;border=1;can_resize=1;can_close=1;can_minimize=0")
|
||||
else
|
||||
to_chat(user, "You do not have a PDA. You should make an issue report about this.")
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
/obj/effect/mob_spawn/proc/delayusability(deciseconds, showOnMenu) //How many deciseconds until it is enabled, + should it show up on the menu?
|
||||
addtimer(CALLBACK(src, .proc/enableghostrole, showOnMenu), deciseconds)
|
||||
|
||||
|
||||
/obj/effect/mob_spawn/proc/enableghostrole(show)
|
||||
ghost_usable = TRUE
|
||||
if (show == TRUE)
|
||||
@@ -276,7 +276,7 @@
|
||||
var/mob/living/silicon/ai/spawned/M = new(loc) //spawn new AI at landmark as var M
|
||||
M.name = src.name
|
||||
M.real_name = src.name
|
||||
M.aiPDA.toff = TRUE //turns the AI's PDA messenger off, stopping it showing up on player PDAs
|
||||
M.builtInPDA.toff = TRUE //turns the AI's PDA messenger off, stopping it showing up on player PDAs
|
||||
M.death() //call the AI's death proc
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
var/obj/mecha/controlled_mech //For controlled_mech a mech, to determine whether to relaymove or use the AI eye.
|
||||
var/radio_enabled = TRUE //Determins if a carded AI can speak with its built in radio or not.
|
||||
radiomod = ";" //AIs will, by default, state their laws on the internal radio.
|
||||
var/obj/item/pda/ai/aiPDA
|
||||
var/obj/item/multitool/aiMulti
|
||||
var/mob/living/simple_animal/bot/Bot
|
||||
var/tracking = FALSE //this is 1 if the AI is currently tracking somebody, but the track has not yet been completed.
|
||||
@@ -139,10 +138,10 @@
|
||||
|
||||
add_verb(src, /mob/living/silicon/ai/proc/show_laws_verb)
|
||||
|
||||
aiPDA = new/obj/item/pda/ai(src)
|
||||
aiPDA.owner = name
|
||||
aiPDA.ownjob = "AI"
|
||||
aiPDA.name = name + " (" + aiPDA.ownjob + ")"
|
||||
builtInPDA = new/obj/item/pda/ai(src)
|
||||
builtInPDA.owner = name
|
||||
builtInPDA.ownjob = "AI"
|
||||
builtInPDA.name = name + " (" + builtInPDA.ownjob + ")"
|
||||
|
||||
aiMulti = new(src)
|
||||
radio = new /obj/item/radio/headset/ai(src)
|
||||
@@ -846,9 +845,9 @@
|
||||
Slave.show_laws()
|
||||
|
||||
/mob/living/silicon/ai/replace_identification_name(oldname,newname)
|
||||
if(aiPDA)
|
||||
aiPDA.owner = newname
|
||||
aiPDA.name = newname + " (" + aiPDA.ownjob + ")"
|
||||
if(builtInPDA)
|
||||
builtInPDA.owner = newname
|
||||
builtInPDA.name = newname + " (" + builtInPDA.ownjob + ")"
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/add_malf_picker()
|
||||
|
||||
@@ -142,10 +142,6 @@
|
||||
builtInCamera.internal_light = FALSE
|
||||
if(wires.is_cut(WIRE_CAMERA))
|
||||
builtInCamera.status = 0
|
||||
module = new /obj/item/robot_module(src)
|
||||
module.rebuild_modules()
|
||||
update_icons()
|
||||
. = ..()
|
||||
|
||||
//If this body is meant to be a borg controlled by the AI player
|
||||
if(shell)
|
||||
@@ -165,6 +161,18 @@
|
||||
|
||||
updatename()
|
||||
|
||||
//Name updated, can build PDA data now
|
||||
if(!builtInPDA)
|
||||
builtInPDA = new/obj/item/pda/ai(src)
|
||||
builtInPDA.owner = name
|
||||
builtInPDA.ownjob = "Station Cyborg"
|
||||
builtInPDA.name = name + " (" + builtInPDA.ownjob + ")"
|
||||
|
||||
module = new /obj/item/robot_module(src)
|
||||
module.rebuild_modules()
|
||||
update_icons()
|
||||
. = ..()
|
||||
|
||||
equippable_hats = typecacheof(equippable_hats)
|
||||
|
||||
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
||||
@@ -661,7 +669,7 @@
|
||||
if(BORGBELLY_GREEN) sleeper_overlay_state = "_g"
|
||||
if(BORGBELLY_RED) sleeper_overlay_state = "_r"
|
||||
add_overlay("[module.sleeper_overlay][sleeper_overlay_state]")
|
||||
|
||||
|
||||
if(module.dogborg == TRUE)
|
||||
if(resting)
|
||||
cut_overlays()
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
var/obj/machinery/camera/builtInCamera = null
|
||||
var/updating = FALSE //portable camera camerachunk update
|
||||
|
||||
var/obj/item/pda/ai/builtInPDA = null
|
||||
|
||||
var/hack_software = FALSE //Will be able to use hacking actions
|
||||
var/interaction_range = 7 //wireless control range
|
||||
|
||||
@@ -70,6 +72,7 @@
|
||||
radio = null
|
||||
aicamera = null
|
||||
QDEL_NULL(builtInCamera)
|
||||
QDEL_NULL(builtInPDA)
|
||||
GLOB.silicon_mobs -= src
|
||||
return ..()
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user