Camera eyes have been lightly refactored (among other things...) (#87805)

## About The Pull Request

* A generic /mob/eye/camera type has been made, containing everything
needed to interface with a cameranet
* /mob/eye/ai_eye has been refactored into a generic /mob/eye/camera
instance
* Advanced cameras no longer inherit from AI eyes, splitting off
behaviour
* Camera code has been somewhat cleaned up
* Probably some more stuff I'm forgetting right now

## Big man Southport:

![image](https://github.com/user-attachments/assets/de6e6ff0-ca99-4636-bdec-5e0b2d6b8037)

## Changelog

🆑
code: made /proc/getviewsize() pure

refactor: mob/eye/ai_eye has been restructured, now inheriting from a
generic mob/eye/camera type
refactor: advanced cameras and their subtypes are now
mob/eye/camera/remote subtypes
code: the cameranet no longer expects the user to be an AI eye
code: remote camera eyes have had their initialization streamlined
code: remote cameras handle assigning and unassigning users by
themselves now
code: remote cameras now use weakrefs instead of hard referencing owners
and origins
code: also the sentient disease is_define was removed (we don't have
those anymore)
fix: AI eyes no longer assign real names to themselves, fixing their
orbit name
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
tonty
2024-11-21 12:55:38 +01:00
committed by GitHub
co-authored by Ghom
parent 6859e714d0
commit d8450b4933
29 changed files with 477 additions and 361 deletions
@@ -5,7 +5,7 @@
/datum/action/innate/construction
button_icon = 'icons/mob/actions/actions_construction.dmi'
///Console's eye mob
var/mob/eye/ai_eye/remote/base_construction/remote_eye
var/mob/eye/camera/remote/base_construction/remote_eye
///Console itself
var/obj/machinery/computer/camera_advanced/base_construction/base_console
///Is this used to build only on the station z level?
@@ -1,7 +1,7 @@
/**
* Camera console used to control a base building drone
*
* Using this console will put the user in control of a [base building drone][/mob/eye/ai_eye/remote/base_construction].
* Using this console will put the user in control of a [base building drone][/mob/eye/camera/remote/base_construction].
* The drone will appear somewhere within the allowed_area var, or if no area is specified, at the location of the console.area
* Upon interacting, the user will be granted a set of base building actions that will generally be carried out at the drone's location.
* To create a new base builder system, this class should be the only thing that needs to be subtyped.
@@ -61,8 +61,7 @@
var/turf/spawn_spot = find_spawn_spot()
if (!spawn_spot)
return FALSE
eyeobj = new /mob/eye/ai_eye/remote/base_construction(spawn_spot, src)
eyeobj.origin = src
eyeobj = new /mob/eye/camera/remote/base_construction(spawn_spot, src)
return TRUE
/obj/machinery/computer/camera_advanced/base_construction/attackby(obj/item/W, mob/user, params)
@@ -95,7 +94,7 @@
* The mob is constrained to a given area defined by the base construction console.
*
*/
/mob/eye/ai_eye/remote/base_construction
/mob/eye/camera/remote/base_construction
name = "construction holo-drone"
//Allows any curious crew to watch the base after it leaves. (This is safe as the base cannot be modified once it leaves)
move_on_shuttle = TRUE
@@ -105,20 +104,20 @@
///Reference to the camera console controlling this drone
var/obj/machinery/computer/camera_advanced/base_construction/linked_console
/mob/eye/ai_eye/remote/base_construction/Initialize(mapload, obj/machinery/computer/camera_advanced/console_link)
/mob/eye/camera/remote/base_construction/Initialize(mapload, obj/machinery/computer/camera_advanced/console_link)
linked_console = console_link
if(!linked_console)
stack_trace("A base consturuction drone was created with no linked console")
return INITIALIZE_HINT_QDEL
return ..()
/mob/eye/ai_eye/remote/base_construction/setLoc(turf/destination, force_update = FALSE)
/mob/eye/camera/remote/base_construction/setLoc(turf/destination, force_update = FALSE)
var/area/curr_area = get_area(destination)
//Only move if we're in the allowed area. If no allowed area is defined, then we're free to move wherever.
if(!linked_console.allowed_area || istype(curr_area, linked_console.allowed_area))
return ..()
/mob/eye/ai_eye/remote/base_construction/relaymove(mob/living/user, direction)
/mob/eye/camera/remote/base_construction/relaymove(mob/living/user, direction)
//This camera eye is visible, and as such needs to keep its dir updated
dir = direction
return ..()