Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quantum archways #6719

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 12 additions & 8 deletions code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 47 additions & 0 deletions code/modules/gateway/quantum_archway/quantum_archway.dm
Original file line number Diff line number Diff line change
@@ -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)

Check failure on line 19 in code/modules/gateway/quantum_archway/quantum_archway.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined type: /obj/machinery/quantum_gateway_segment
#warn impl

Check warning on line 20 in code/modules/gateway/quantum_archway/quantum_archway.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn impl

/datum/quantum_gateway/Destroy()
#warn impl

Check warning on line 23 in code/modules/gateway/quantum_archway/quantum_archway.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#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)

Check failure on line 31 in code/modules/gateway/quantum_archway/quantum_archway.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "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)

Check failure on line 40 in code/modules/gateway/quantum_archway/quantum_archway.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined type: /obj/machinery/quantum_gateway_segment

/datum/quantum_gateway/proc/set_linked(datum/quantum_gateway/other)

/datum/quantum_gateway/proc/get_length()
return length(segments)

Check failure on line 45 in code/modules/gateway/quantum_archway/quantum_archway.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "segments"

#warn impl

Check warning on line 47 in code/modules/gateway/quantum_archway/quantum_archway.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn impl
11 changes: 11 additions & 0 deletions code/modules/gateway/quantum_archway/quantum_archway_linker.dm
Original file line number Diff line number Diff line change
@@ -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

Check warning on line 11 in code/modules/gateway/quantum_archway/quantum_archway_linker.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn impl
54 changes: 54 additions & 0 deletions code/modules/gateway/quantum_archway/quantum_archway_segment.dm
Original file line number Diff line number Diff line change
@@ -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

Check warning on line 12 in code/modules/gateway/quantum_archway/quantum_archway_segment.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#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

Check warning on line 37 in code/modules/gateway/quantum_archway/quantum_archway_segment.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#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)

Check failure on line 44 in code/modules/gateway/quantum_archway/quantum_archway_segment.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined proc: "split_at" on /datum/quantum_archway

/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))

Loading