mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 14:37:04 +01:00
- Addressed the issue of AIs not being able to see anything in the dark. They now have a 'toggle camera light' verb in the AI verbs panel. What this does is enable a light on the camera they are viewing from. Only the light on the camera they're viewing from will continue to be enabled.
The fluff behind this change is that a loss of power in an area prevents the use of advanced camera features, such as XRAY. The amount of power which the camera network supplies is only enough to operate a light on the camera. Since there are lots of ways to remove an AI from a camera, it is possible that some bugs will appear. I tested what I could and fixed all the errors that I noticed. If any additional errors appear, please let me know. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4387 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#define AI_CAMERA_LUMINOSITY 6
|
||||
|
||||
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0)
|
||||
var/list/possibleNames = ai_names
|
||||
|
||||
@@ -35,7 +37,8 @@
|
||||
if (istype(loc, /turf))
|
||||
verbs.Add(/mob/living/silicon/ai/proc/ai_call_shuttle,/mob/living/silicon/ai/proc/ai_camera_track, \
|
||||
/mob/living/silicon/ai/proc/ai_camera_list, /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/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change, \
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light)
|
||||
|
||||
if(!safety)//Only used by AIize() to successfully spawn an AI.
|
||||
if (!B)//If there is no player/brain inside.
|
||||
@@ -355,6 +358,14 @@
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/silicon/ai/reset_view(atom/A)
|
||||
if(current)
|
||||
current.sd_SetLuminosity(0)
|
||||
if(istype(A,/obj/machinery/camera))
|
||||
current = A
|
||||
..()
|
||||
if(istype(A,/obj/machinery/camera))
|
||||
A.sd_SetLuminosity(camera_light_on * AI_CAMERA_LUMINOSITY)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/switchCamera(var/obj/machinery/camera/C)
|
||||
@@ -367,7 +378,6 @@
|
||||
|
||||
// ok, we're alive, camera is good and in our network...
|
||||
machine = src
|
||||
src.current = C
|
||||
reset_view(C)
|
||||
return 1
|
||||
|
||||
@@ -519,4 +529,19 @@
|
||||
if(!istype(apc))
|
||||
src << "\blue You are already in your Main Core."
|
||||
return
|
||||
apc.malfvacate()
|
||||
apc.malfvacate()
|
||||
|
||||
//Toggles the luminosity and applies it by re-entereing the camera.
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light()
|
||||
set name = "Toggle camera light"
|
||||
set desc = "Toggles the light on the camera the AI is looking through."
|
||||
set category = "AI Commands"
|
||||
|
||||
if(!current)
|
||||
usr << "\red You are not looking through a camera right now."
|
||||
return
|
||||
camera_light_on = !camera_light_on
|
||||
reset_view(current)
|
||||
|
||||
|
||||
#undef AI_CAMERA_LUMINOSITY
|
||||
@@ -6,9 +6,9 @@
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
if (src.stat!=0)
|
||||
src:cameraFollow = null
|
||||
src:current = null
|
||||
src:machine = null
|
||||
src.cameraFollow = null
|
||||
src.reset_view(null)
|
||||
src.machine = null
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
|
||||
@@ -81,4 +81,4 @@
|
||||
|
||||
if(!closest)
|
||||
return
|
||||
user.switchCamera(closest)
|
||||
user.switchCamera(closest)
|
||||
Reference in New Issue
Block a user