Skip to content

Commit

Permalink
reorganizes gateway into its own module (#6718)
Browse files Browse the repository at this point in the history
it's stargate time
  • Loading branch information
silicons authored Sep 4, 2024
1 parent 4224dff commit 701ebc4
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 258 deletions.
5 changes: 4 additions & 1 deletion citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,6 @@
#include "code\modules\awaymissions\bluespaceartillery.dm"
#include "code\modules\awaymissions\corpse.dm"
#include "code\modules\awaymissions\exile.dm"
#include "code\modules\awaymissions\gateway.dm"
#include "code\modules\awaymissions\loot.dm"
#include "code\modules\awaymissions\loot_vr.dm"
#include "code\modules\awaymissions\pamphlet.dm"
Expand Down Expand Up @@ -2857,6 +2856,10 @@
#include "code\modules\games\spaceball_cards.dm"
#include "code\modules\games\tarot.dm"
#include "code\modules\games\unus.dm"
#include "code\modules\gateway\stargate\stargate-away.dm"
#include "code\modules\gateway\stargate\stargate-destination.dm"
#include "code\modules\gateway\stargate\stargate-station.dm"
#include "code\modules\gateway\stargate\stargate.dm"
#include "code\modules\genetics\side_effects.dm"
#include "code\modules\ghostroles\instantiator.dm"
#include "code\modules\ghostroles\menu.dm"
Expand Down
257 changes: 0 additions & 257 deletions code/modules/awaymissions/gateway.dm

This file was deleted.

11 changes: 11 additions & 0 deletions code/modules/gateway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Gateway Module

WIP module for a series of disjunct mechanics for shunting people across spaces.

- These are unrelated to telescience module, and therefore will not be balanced by it nor will it be constructible.
- These are mostly for map design, admin spawn, and events.

## Contains

- Stargates: Classic SS13 gateways with rudimentary accuracy/precision and destination settings
- Quantum Archways: See-through & Walk-through 'line' gateways
107 changes: 107 additions & 0 deletions code/modules/gateway/stargate/stargate-away.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/**
* Preset for away destinations for the stargate system
*/

/obj/machinery/gateway/centeraway
density = 1
icon_state = "offcenter"
use_power = USE_POWER_OFF
var/calibrated = 1
var/list/linked = list() //a list of the connected gateway chunks
var/ready = 0
var/obj/machinery/gateway/centeraway/stationgate = null


/obj/machinery/gateway/centeraway/Initialize(mapload)
update_icon()
stationgate = locate(/obj/machinery/gateway/centerstation)
. = ..()
density = 1


/obj/machinery/gateway/centeraway/update_icon()
if(active)
icon_state = "oncenter"
return
icon_state = "offcenter"

/obj/machinery/gateway/centeraway/proc/detect()
linked = list() //clear the list
var/turf/T = loc

for(var/i in GLOB.alldirs)
T = get_step(loc, i)
var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T
if(G)
linked.Add(G)
continue

//this is only done if we fail to find a part
ready = 0
toggleoff()
break

if(linked.len == 8)
ready = 1


/obj/machinery/gateway/centeraway/proc/toggleon(mob/user as mob)
if(!ready) return
if(linked.len != 8) return
if(!stationgate || !calibrated)
to_chat(user, SPAN_NOTICE("Error: No destination found. Please calibrate gateway."))
return

for(var/obj/machinery/gateway/G in linked)
G.active = 1
G.update_icon()
active = 1
update_icon()


/obj/machinery/gateway/centeraway/proc/toggleoff()
for(var/obj/machinery/gateway/G in linked)
G.active = 0
G.update_icon()
active = 0
update_icon()


/obj/machinery/gateway/centeraway/attack_hand(mob/user, list/params)
if(!ready)
detect()
return
if(!active)
toggleon(user)
return
toggleoff()


/obj/machinery/gateway/centeraway/Bumped(atom/movable/M as mob|obj)
if(!ready) return
if(!active) return
if(istype(M, /mob/living/carbon))
for(var/obj/item/implant/exile/E in M)//Checking that there is an exile implant in the contents
if(E.imp_in == M)//Checking that it's actually implanted vs just in their pocket
to_chat(M, "<font color='black'>The station gate has detected your exile implant and is blocking your entry.</font>")
return
M.forceMove(get_step(stationgate.loc, SOUTH))
M.setDir(SOUTH)
SEND_SOUND(M, sound('sound/effects/phasein.ogg'))
playsound(src, 'sound/effects/phasein.ogg', 100, 1)


/obj/machinery/gateway/centeraway/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/multitool))
if(calibrated && stationgate)
to_chat(user, "<font color='black'>The gate is already calibrated, there is no work for you to do here.</font>")
return
else
stationgate = locate(/obj/machinery/gateway/centerstation)
if(!stationgate)
to_chat(user, "<span class='notice'>Error: Recalibration failed. No destination found... That can't be good.</span>")
return
else
to_chat(user, "<font color=#4F49AF><b>Recalibration successful!</b>:</font><font color='black'> This gate's systems have been fine tuned. Travel to this gate will now be on target.</font>")
calibrated = 1
return
Loading

0 comments on commit 701ebc4

Please sign in to comment.