Files
Yogstation/code/modules/events/wormholes.dm
swissloaf 51fbb4059c Adds station traits: Small modifiers that can randomly be chosen each round (#11134)
* Station Traits

* Update positive_traits.dm

* Test

* Revert "Test"

This reverts commit c99e3e9db5.

* Update sound.dm

* Update code/datums/station_traits/positive_traits.dm

Co-authored-by: Redmoogle <dakotamew@gmail.com>

* Update code/__HELPERS/priority_announce.dm

Co-authored-by: Redmoogle <dakotamew@gmail.com>

* Update ai_laws.dm

* Update traits.dm

* Update neutral_traits.dm

* Update negative_traits.dm

* Negative bot trait

* Update negative_traits.dm

* Adds an admin log hpoefully

* Update station.dm

* Update station.dm

* Update station.dm

* Update station.dm

* Update station.dm

* Update station.dm

* Update station.dm

* Removes custom alert message for now

* Update station.dm

* Update game_mode.dm

* Update extended.dm

* Update game_mode.dm

* Update dynamic.dm

* Update dynamic.dm

* Update extended.dm

* Update game_mode.dm

* Update dynamic.dm

* Update game_mode.dm

* Update dynamic.dm

* Update extended.dm

* Revert "Update extended.dm"

This reverts commit 2235319bb3.

* Revert "Update dynamic.dm"

This reverts commit 6af1fbaf60.

* Revert "Update game_mode.dm"

This reverts commit dd84d504dc.

* Try again

* Update game_mode.dm

* Let's test making them more common

* Medbot update

* Update negative_traits.dm

* Update negative_traits.dm

* tHNE great f

* Update traits.dm

* Update job.dm

* Update negative_traits.dm

Co-authored-by: Redmoogle <dakotamew@gmail.com>
2021-04-10 12:17:08 +01:00

78 lines
2.1 KiB
Plaintext

GLOBAL_LIST_EMPTY(all_wormholes) // So we can pick wormholes to teleport to
/datum/round_event_control/wormholes
name = "Wormholes"
typepath = /datum/round_event/wormholes
max_occurrences = 3
weight = 2
min_players = 2
/datum/round_event/wormholes
announceWhen = 10
endWhen = 60
var/list/pick_turfs = list()
var/list/wormholes = list()
var/shift_frequency = 3
var/number_of_wormholes = 400
/datum/round_event/wormholes/setup()
announceWhen = rand(0, 20)
endWhen = rand(40, 80)
/datum/round_event/wormholes/start()
for(var/turf/open/floor/T in world)
if(is_station_level(T.z))
pick_turfs += T
for(var/i = 1, i <= number_of_wormholes, i++)
var/turf/T = pick(pick_turfs)
wormholes += new /obj/effect/portal/wormhole(T, null, 0, null, FALSE)
/datum/round_event/wormholes/announce(fake)
priority_announce("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert", ANNOUNCER_SPANOMALIES)
/datum/round_event/wormholes/tick()
if(activeFor % shift_frequency == 0)
for(var/obj/effect/portal/wormhole/O in wormholes)
var/turf/T = pick(pick_turfs)
if(T)
O.forceMove(T)
/datum/round_event/wormholes/end()
QDEL_LIST(wormholes)
wormholes = null
/obj/effect/portal/wormhole
name = "wormhole"
desc = "It looks highly unstable; It could close at any moment."
icon = 'icons/obj/objects.dmi'
icon_state = "anom"
mech_sized = TRUE
/obj/effect/portal/wormhole/Initialize(mapload, _creator, _lifespan = 0, obj/effect/portal/_linked, automatic_link = FALSE, turf/hard_target_override, atmos_link_override)
. = ..()
GLOB.all_wormholes += src
/obj/effect/portal/wormhole/Destroy()
. = ..()
GLOB.all_wormholes -= src
/obj/effect/portal/wormhole/teleport(atom/movable/M)
if(iseffect(M)) //sparks don't teleport
return
if(M.anchored)
if(!(ismecha(M) && mech_sized))
return
if(ismovable(M))
if(GLOB.all_wormholes.len)
var/obj/effect/portal/wormhole/P = pick(GLOB.all_wormholes)
if(P && isturf(P.loc))
hard_target = P.loc
if(!hard_target)
return
do_teleport(M, hard_target, 1, 1, 0, 0, channel = TELEPORT_CHANNEL_WORMHOLE) ///You will appear adjacent to the beacon