diff --git a/citadel.dme b/citadel.dme index 898d2771d3f1..4ea19607e254 100644 --- a/citadel.dme +++ b/citadel.dme @@ -2824,6 +2824,9 @@ #include "code\modules\games\spaceball_cards.dm" #include "code\modules\games\tarot.dm" #include "code\modules\games\unus.dm" +#include "code\modules\gateway\quantum_archway\quantum_archway.dm" +#include "code\modules\gateway\quantum_archway\quantum_archway_linker.dm" +#include "code\modules\gateway\quantum_archway\quantum_archway_segment.dm" #include "code\modules\genetics\side_effects.dm" #include "code\modules\ghostroles\instantiator.dm" #include "code\modules\ghostroles\menu.dm" diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index dfb3d955096c..1607d20b0c7a 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -107,30 +107,34 @@ rad_flags = RAD_BLOCK_CONTENTS // todo: anchored / unanchored should be replaced by movement force someday, how to handle that? - //* Construction / Deconstruction + //* Construction / Deconstruction *// + /// allow default part replacement. null for disallowed, number for time. var/default_part_replacement = 0 + /// Can be constructed / deconstructed by players by default. null for off, number for time needed. Panel must be open. // todo: proc for allow / disallow, refactor var/default_deconstruct - /// Can have panel open / closed by players by default. null for off, number for time needed. You usually want 0 for instant. - var/default_panel - /// Can be anchored / unanchored by players without deconstructing by default with a wrench. null for off, number for time needed. - // todo: proc for allow / disallow, refactor, unify with can_be_unanchored - var/default_unanchor /// default deconstruct requires panel open var/default_deconstruct_requires_panel_open = TRUE /// tool used for deconstruction var/tool_deconstruct = TOOL_CROWBAR + + /// Can have panel open / closed by players by default. null for off, number for time needed. You usually want 0 for instant. + var/default_panel /// tool used for panel open var/tool_panel = TOOL_SCREWDRIVER - /// tool used for unanchor - var/tool_unanchor = TOOL_WRENCH /// default icon state overlay for panel open var/panel_icon_state /// is the maintenance panel open? var/panel_open = FALSE + /// Can be anchored / unanchored by players without deconstructing by default with a wrench. null for off, number for time needed. + // todo: proc for allow / disallow, refactor, unify with can_be_unanchored + var/default_unanchor + /// tool used for unanchor + var/tool_unanchor = TOOL_WRENCH + //* unsorted var/machine_stat = 0 var/emagged = FALSE diff --git a/code/modules/gateway/quantum_archway/quantum_archway.dm b/code/modules/gateway/quantum_archway/quantum_archway.dm new file mode 100644 index 000000000000..5ce1d67f73f5 --- /dev/null +++ b/code/modules/gateway/quantum_archway/quantum_archway.dm @@ -0,0 +1,47 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 Citadel Station developers. *// + +/** + * Controller datum for quantum archways + */ +/datum/quantum_archway + /// active? + var/active = FALSE + /// segments in us + var/list/obj/machinery/quantum_archway_segment/segments + /// our linked archway + /// + /// * UI/UX reasons: must be same axis as us (so no NORTH to EAST, only NORTH to SOUTH) + /// * simulation reasons: must be opposite dir as us (so NORTH to SOUTH, no NORTH to NORTH) + /// * lazy, can be fixed later: must be same length + var/datum/quantum_archway/linked + +/datum/quantum_gateway/New(obj/machinery/quantum_gateway_segment/segment) + #warn impl + +/datum/quantum_gateway/Destroy() + #warn impl + return ..() + +/datum/quantum_gateway/proc/activate() + +/datum/quantum_gateway/proc/deactivate() + +/datum/quantum_gateway/proc/set_activation(new_activation) + if(new_activation == active) + return + if(new_activation) + activate() + else + deactivate() + +/datum/quantum_gateway/proc/merge_with(datum/quantum_gateway/other) + +/datum/quantum_gateway/proc/split_at(obj/machinery/quantum_gateway_segment/segment) + +/datum/quantum_gateway/proc/set_linked(datum/quantum_gateway/other) + +/datum/quantum_gateway/proc/get_length() + return length(segments) + +#warn impl diff --git a/code/modules/gateway/quantum_archway/quantum_archway_linker.dm b/code/modules/gateway/quantum_archway/quantum_archway_linker.dm new file mode 100644 index 000000000000..47e04eced05f --- /dev/null +++ b/code/modules/gateway/quantum_archway/quantum_archway_linker.dm @@ -0,0 +1,11 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 Citadel Station developers. *// + +/** + * Linker for archways. + * + * * You must use this to set ID, you can't set it directly. + */ +/obj/map_helper/quantum_archway_linker + +#warn impl diff --git a/code/modules/gateway/quantum_archway/quantum_archway_segment.dm b/code/modules/gateway/quantum_archway/quantum_archway_segment.dm new file mode 100644 index 000000000000..57bc385207b6 --- /dev/null +++ b/code/modules/gateway/quantum_archway/quantum_archway_segment.dm @@ -0,0 +1,54 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 Citadel Station developers. *// + +/** + * A segment of a quantum arch: A mapped archway allowing instant transportation between two locales. + * + * * autolinking, adminbus support included + */ +/obj/machinery/quantum_archway_segment + name = "quantum archway" + desc = "A massive, nigh-indestructible archway connecting to a linked line-gate in another locale." + #warn sprite + + opacity = TRUE + density = FALSE + integrity_flags = INTEGRITY_INDESTRUCTIBLE + + use_power = USE_POWER_OFF + + /// are we active? + var/active = FALSE + /// our archway controller datum + var/datum/quantum_archway/controller + /// our cached id + /// + /// * intentionally not allowed to be edited by mapper. use the linker helper. + var/tmp/rebuild_id + +/obj/machinery/quantum_archway_segment/Initialize() + form_network() + return ..() + +/obj/machinery/quantum_archway_segment/Destroy() + break_network() + return ..() + +#warn impl + +/obj/machinery/quantum_archway_segment/proc/form_network() + if(!controller) + controller = new(src) + +/obj/machinery/quantum_archway_segment/proc/break_network() + controller?.split_at(src) + +/obj/machinery/quantum_archway_segment/proc/activate() + +/obj/machinery/quantum_archway_segment/proc/deactivate() + +/obj/machinery/quantum_archway_segment/proc/set_active(new_activation) + +/obj/machinery/quantum_archway_segment/proc/set_partner(obj/machinery/quantum_archway_segment/partner) + ASSERT(partner.dir == turn(dir, 108)) +