mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Allows AIs to see visible actions through cameras (I broke smartgit) (#11151)
* Allows AIs to see visible actions through cameras * changelog * high res need to fix flag * high_res and flags * Atom level proc honestly just remove istype tbh * hi,res 2.0 * Internal conflicts * Make malf great again * Gee AI how come you get to have two News * actually this isn't necessary also remove removing src
This commit is contained in:
@@ -242,6 +242,9 @@ var/global/list/ghdel_profiling = list()
|
||||
|
||||
/atom/proc/projectile_check()
|
||||
return
|
||||
|
||||
//Override this to have source respond differently to visible_messages said by an atom A
|
||||
/atom/proc/on_see(var/message, var/blind_message, var/drugged_message, var/blind_drugged_message, atom/A)
|
||||
|
||||
/*
|
||||
* atom/proc/search_contents_for(path,list/filter_path=null)
|
||||
|
||||
@@ -180,8 +180,9 @@ rcd light flash thingy on matter drain
|
||||
/datum/AI_Module/large/highrescams
|
||||
module_name = "High Resolution Cameras"
|
||||
mod_pick_name = "High Res Cameras"
|
||||
description = "Allows the AI to read papers and the lips of crewmembers from his cameras!"
|
||||
description = "Allows the AI to better interpret the actions of the crew! Read papers and their lips from his cameras!"
|
||||
cost = 10
|
||||
one_time = 1
|
||||
|
||||
power_type = /mob/living/silicon/ai/proc/highrescameras
|
||||
|
||||
@@ -191,7 +192,7 @@ rcd light flash thingy on matter drain
|
||||
|
||||
ai_flags |= HIGHRESCAMS
|
||||
|
||||
eyeobj.addHear()
|
||||
eyeobj.high_res = 1
|
||||
src.verbs -= /mob/living/silicon/ai/proc/highrescameras
|
||||
|
||||
|
||||
|
||||
@@ -86,6 +86,12 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
|
||||
rendered_message = "<i><span class='[speech.render_wrapper_classes()]'>Holopad received, <span class='message'>[rendered_message]</span></span></i>"
|
||||
master.show_message(rendered_message, 2)
|
||||
|
||||
/obj/machinery/hologram/holopad/on_see(var/message, var/blind_message, var/drugged_message, var/blind_drugged_message, atom/A)
|
||||
if(!master)
|
||||
return
|
||||
if(master.eyeobj.high_res && cameranet.checkCameraVis(A)) //visible message is already being picked up by the cameras, avoids duplicate messages
|
||||
return
|
||||
master.show_message( message, 1, blind_message, 2) //otherwise it's being picked up by the holopad itself
|
||||
|
||||
/obj/machinery/hologram/holopad/proc/create_holo(mob/living/silicon/ai/A, turf/T = loc)
|
||||
hologram = new(T)//Spawn a blank effect at the location.
|
||||
|
||||
@@ -111,7 +111,6 @@ var/list/ai_list = list()
|
||||
|
||||
aiMulti = new(src)
|
||||
aicamera = new/obj/item/device/camera/ai_camera(src)
|
||||
|
||||
if (istype(loc, /turf))
|
||||
verbs.Add(/mob/living/silicon/ai/proc/ai_network_change, \
|
||||
/mob/living/silicon/ai/proc/ai_statuschange, \
|
||||
|
||||
@@ -125,9 +125,9 @@ var/datum/cameranet/cameranet = new()
|
||||
chunk.cameras |= c
|
||||
chunk.hasChanged()
|
||||
|
||||
// Will check if a mob is on a viewable turf. Returns 1 if it is, otherwise returns 0.
|
||||
// Will check if an atom is on a viewable turf. Returns 1 if it is, otherwise returns 0.
|
||||
|
||||
/datum/cameranet/proc/checkCameraVis(mob/living/target as mob)
|
||||
/datum/cameranet/proc/checkCameraVis(atom/target as obj|mob|turf)
|
||||
|
||||
|
||||
// 0xf = 15
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
var/list/visibleCameraChunks = list()
|
||||
var/mob/living/silicon/ai/ai = null
|
||||
|
||||
var/high_res = 0
|
||||
flags = HEAR_ALWAYS
|
||||
|
||||
// Use this when setting the aiEye's location.
|
||||
// It will also stream the chunk that the new loc is in.
|
||||
@@ -38,9 +39,17 @@
|
||||
|
||||
/mob/camera/aiEye/Move()
|
||||
return 0
|
||||
|
||||
//An AI eyeobj mob cant have a virtualhearer to hear with unless it gets one from a malf module
|
||||
|
||||
/mob/camera/aiEye/on_see(var/message, var/blind_message, var/drugged_message, var/blind_drugged_message, atom/A) //proc for eye seeing visible messages from atom A, only possible with the high_res camera module
|
||||
if(!high_res)
|
||||
return
|
||||
if(ai && cameranet.checkCameraVis(A)) //check it's actually in view of a camera
|
||||
ai.show_message( message, 1, blind_message, 2)
|
||||
|
||||
//An AI eyeobj mob cant hear unless it updates high_res with a Malf Module
|
||||
/mob/camera/aiEye/Hear(var/datum/speech/speech, var/rendered_speech="")
|
||||
if(!high_res)
|
||||
return
|
||||
if(speech.frequency) //HOW CAN IT POSSIBLY READ LIPS THROUGH RADIOS
|
||||
return
|
||||
|
||||
|
||||
@@ -341,32 +341,29 @@ var/global/obj/screen/fuckstat/FUCK = new
|
||||
|
||||
..(message, blind_message, drugged_message, blind_drugged_message)
|
||||
|
||||
/mob/on_see(var/message, var/blind_message, var/drugged_message, var/blind_drugged_message, atom/A)
|
||||
if(see_invisible < invisibility || src == A)
|
||||
return
|
||||
var/hallucination = hallucinating()
|
||||
var/msg = message
|
||||
var/msg2 = blind_message
|
||||
if(hallucination)
|
||||
if(drugged_message)
|
||||
msg = drugged_message
|
||||
if(blind_drugged_message)
|
||||
msg2 = blind_drugged_message
|
||||
show_message( msg, 1, msg2, 2)
|
||||
|
||||
// Show a message to all mobs in sight of this atom
|
||||
// Use for objects performing visible actions
|
||||
// message is output to anyone who can see, e.g. "The [src] does something!"
|
||||
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
|
||||
|
||||
/atom/proc/visible_message(var/message, var/blind_message, var/drugged_message, var/blind_drugged_message)
|
||||
if(world.time>resethearers) sethearing()
|
||||
if(world.time>resethearers)
|
||||
sethearing()
|
||||
for(var/mob/virtualhearer/hearer in viewers(get_turf(src)))
|
||||
if(istype(hearer.attached, /mob))
|
||||
var/mob/M = hearer.attached
|
||||
if(M.see_invisible < invisibility || M == src)
|
||||
continue
|
||||
var/hallucination = M.hallucinating()
|
||||
var/msg = message
|
||||
var/msg2 = blind_message
|
||||
|
||||
if(hallucination)
|
||||
if(drugged_message)
|
||||
msg = drugged_message
|
||||
if(blind_drugged_message)
|
||||
msg2 = blind_drugged_message
|
||||
M.show_message( msg, 1, msg2, 2)
|
||||
|
||||
else if(istype(hearer.attached, /obj/machinery/hologram/holopad))
|
||||
var/obj/machinery/hologram/holopad/holo = hearer.attached
|
||||
if(holo.master)
|
||||
holo.master.show_message( message, 1, blind_message, 2)
|
||||
hearer.attached.on_see(message, blind_message, drugged_message, blind_drugged_message, src)
|
||||
|
||||
/mob/proc/findname(msg)
|
||||
for(var/mob/M in mob_list)
|
||||
|
||||
36
html/changelogs/JustSumBody.yml
Normal file
36
html/changelogs/JustSumBody.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
################################
|
||||
# Example Changelog File
|
||||
#
|
||||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||
#
|
||||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||
# When it is, any changes listed below will disappear.
|
||||
#
|
||||
# Valid Prefixes:
|
||||
# bugfix
|
||||
# wip (For works in progress)
|
||||
# tweak
|
||||
# soundadd
|
||||
# sounddel
|
||||
# rscdel (general deleting of nice things)
|
||||
# rscadd (general adding of nice things)
|
||||
# imageadd
|
||||
# imagedel
|
||||
# spellcheck (typo fixes)
|
||||
# experiment
|
||||
# tgs (TG-ported fixes?)
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: JustSumGuy
|
||||
|
||||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# There needs to be a space after the - and before the prefix. Don't use tabs anywhere in this file.
|
||||
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
|
||||
# If you're using characters such as # ' : - or the like in your changelog, surround the entire change with quotes as shown in the second example. These quotes don't show up on the changelog once it's merged and prevent errors.
|
||||
# SCREW ANY OF THIS UP AND IT WON'T WORK.
|
||||
changes:
|
||||
- rscadd: "Malfunctioning AI's with the High Res camera module can now see actions such as attacks through their cameras."
|
||||
Reference in New Issue
Block a user