Blueprints Rework (#18947)

Reworks blueprints to use an eye component for area selection and
changing. Blueprints will now work on whichever overmap site they spawn
on if overmap is enabled, though currently they have only been added to
the Horizon.

Adds shuttle-modifying blueprints for altering shuttle areas and
exoplanet outpost blueprints for creating areas on exoplanets. A set of
outpost blueprints and a lockbox containing blueprints for the Horizon's
shuttles have been added to the CE's locker.

Moves eye creation to a component.

Ported from:
https://github.com/NebulaSS13/Nebula/pull/465
https://github.com/NebulaSS13/Nebula/pull/564
https://github.com/NebulaSS13/Nebula/pull/3046
This commit is contained in:
RustingWithYou
2024-04-19 21:56:26 +00:00
committed by GitHub
parent ab23fbdb70
commit 6957bc34f1
29 changed files with 810 additions and 302 deletions
+84
View File
@@ -0,0 +1,84 @@
/datum/component/eye
///The actual eye mob linked to the component
var/mob/abstract/eye/component_eye
///What type of /mob/abstract/eye is used
var/eye_type = /mob/abstract/eye
///The mob currently looking through the eye
var/mob/current_looker
///Actions used to pass commands from the eye to the holder. Must be subtypes of /datum/action/eye
///Base type of the action, all subtypes of this are added to actions.
var/action_type
///The actions available to the eye
var/list/actions = list()
/datum/component/eye/Destroy()
unlook()
QDEL_LIST(actions)
. = ..()
/datum/component/eye/proc/look(var/mob/new_looker, var/list/eye_args)
if(new_looker.eyeobj || current_looker)
return FALSE
LAZYINSERT(eye_args, get_turf(current_looker), 1) //Make sure that a loc is provided to the eye
if(!component_eye)
component_eye = new eye_type(arglist(eye_args))
current_looker = new_looker
component_eye.possess(current_looker)
if(action_type)
for(var/atype in subtypesof(action_type))
var/datum/action/eye/action = new atype(src)
actions += action
action.Grant(current_looker)
//Manual unlooking for the looker
var/datum/action/eye/unlook/unlook_action = new(src)
actions += unlook_action
unlook_action.Grant(current_looker)
//Checks for removing the user from the eye outside of unlook actions.
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(unlook))
RegisterSignal(current_looker, COMSIG_MOVABLE_MOVED, PROC_REF(unlook))
RegisterSignal(parent, COMSIG_QDELETING, PROC_REF(unlook))
RegisterSignal(current_looker, COMSIG_QDELETING, PROC_REF(unlook))
RegisterSignal(component_eye, COMSIG_QDELETING, PROC_REF(unlook))
RegisterSignal(current_looker, COMSIG_MOB_LOGOUT, PROC_REF(unlook))
RegisterSignal(current_looker, COMSIG_GLOB_MOB_DEATH, PROC_REF(unlook))
return TRUE
/datum/component/eye/proc/unlook()
if(!isnull(parent))
UnregisterSignal(parent, COMSIG_QDELETING)
UnregisterSignal(parent, COMSIG_MOVABLE_MOVED)
if(!isnull(component_eye))
UnregisterSignal(component_eye, COMSIG_QDELETING)
component_eye.release(current_looker)
if(!isnull(current_looker))
UnregisterSignal(current_looker, COMSIG_MOVABLE_MOVED)
UnregisterSignal(current_looker, COMSIG_QDELETING)
UnregisterSignal(current_looker, COMSIG_MOB_LOGOUT)
UnregisterSignal(current_looker, COMSIG_GLOB_MOB_DEATH)
if(current_looker.client)
current_looker.client.eye = current_looker
current_looker.eyeobj = null
QDEL_NULL(component_eye)
if(current_looker)
for(var/datum/action/A in actions)
A.Remove(current_looker)
current_looker = null
/datum/component/eye/proc/get_eye_turf()
return get_turf(component_eye)
//Every eye created using a subtype of this extension will have this action added for manual unlooking.
/datum/action/eye/unlook
name = "Stop looking"
procname = "unlook"
button_icon_state = "cancel"
target_type = COMPONENT_TARGET