mirror of
https://github.com/quotefox/Hyper-Station-13.git
synced 2026-08-29 23:56:18 +01:00
Merge pull request #1691 from haha26315/Cyborg-PDA-Usage
Cyborg pda usage
This commit is contained in:
@@ -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.update_label()
|
||||
|
||||
aiMulti = new(src)
|
||||
radio = new /obj/item/radio/headset/ai(src)
|
||||
@@ -800,7 +799,7 @@
|
||||
if(control_disabled || incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
if(be_close && !in_range(M, src))
|
||||
if(be_close && !in_range(M, src) && M != builtInPDA) //Makes sure AIs in shells can always use their PDA. This one probably unnecessary since it's called from robot.dm, but just in case.
|
||||
to_chat(src, "<span class='warning'>You are too far away!</span>")
|
||||
return FALSE
|
||||
return can_see(M) //stop AIs from leaving windows open and using then after they lose vision
|
||||
@@ -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,6 +142,7 @@
|
||||
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()
|
||||
@@ -165,6 +166,13 @@
|
||||
|
||||
updatename()
|
||||
|
||||
//Name updated, can build PDA data now. Checks for if AI is meant to control.
|
||||
if(!builtInPDA && !shell)
|
||||
builtInPDA = new/obj/item/pda/ai(src)
|
||||
builtInPDA.owner = name
|
||||
builtInPDA.ownjob = "Station Cyborg"
|
||||
builtInPDA.update_label()
|
||||
|
||||
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()
|
||||
@@ -931,7 +939,7 @@
|
||||
if(stat || lockcharge || low_power_mode)
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
if(be_close && !in_range(M, src))
|
||||
if(be_close && !in_range(M, src) && M != builtInPDA) //Makes sure AIs in shells can always use their PDA
|
||||
to_chat(src, "<span class='warning'>You are too far away!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
@@ -1141,6 +1149,10 @@
|
||||
mainframe.connected_robots |= src
|
||||
lawupdate = TRUE
|
||||
lawsync()
|
||||
|
||||
//Ensures AI shells have the same PDA as their mainframe AI
|
||||
builtInPDA = AI.builtInPDA
|
||||
|
||||
if(radio && AI.radio) //AI keeps all channels, including Syndie if it is a Traitor
|
||||
if(AI.radio.syndie)
|
||||
radio.make_syndie()
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user