Files
Bubberstation/code/modules/events/portal_storm.dm
+37 21b4095dfd [MDB IGNORE] [IDB IGNORE] Upstream Sync - 04/17/2026 (#5453)
Upstream 04/17/2026

fixes https://github.com/Bubberstation/Bubberstation/issues/5549

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: loganuk <fakeemail123@aol.com>
Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com>
Co-authored-by: Isratosh <Isratosh@hotmail.com>
Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com>
Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com>
Co-authored-by: Alexander V. <volas@ya.ru>
Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com>
Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Josh <josh.adam.powell@gmail.com>
Co-authored-by: Josh Powell <josh.powell@softwire.com>
Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com>
Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com>
Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com>
Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2026-05-16 00:56:00 +02:00

137 lines
4.3 KiB
Plaintext

/datum/round_event_control/portal_storm_syndicate
name = "Portal Storm: Syndicate Shocktroops"
typepath = /datum/round_event/portal_storm/syndicate_shocktroop
weight = 2
min_players = 15
earliest_start = 30 MINUTES
category = EVENT_CATEGORY_ENTITIES
description = "Syndicate troops pour out of portals."
/datum/round_event/portal_storm/syndicate_shocktroop
boss_types = list(/mob/living/basic/trooper/syndicate/melee/space/stormtrooper = 2)
hostile_types = list(
/mob/living/basic/trooper/syndicate/melee/space = 8,
/mob/living/basic/trooper/syndicate/ranged/space = 2,
)
/datum/round_event_control/portal_storm_narsie
name = "Portal Storm: Constructs"
typepath = /datum/round_event/portal_storm/portal_storm_narsie
weight = 0
max_occurrences = 0
category = EVENT_CATEGORY_ENTITIES
description = "Nar'sie constructs pour out of portals."
min_wizard_trigger_potency = 5
max_wizard_trigger_potency = 7
/datum/round_event/portal_storm/portal_storm_narsie
boss_types = list(/mob/living/basic/construct/artificer/hostile = 6)
hostile_types = list(
/mob/living/basic/construct/juggernaut/hostile = 8,
/mob/living/basic/construct/wraith/hostile = 6,
)
/datum/round_event/portal_storm
start_when = 7
end_when = 999
announce_when = 1
var/list/boss_spawn = list()
var/list/boss_types = list() //only configure this if you have hostiles
var/number_of_bosses
var/next_boss_spawn
var/list/hostiles_spawn = list()
var/list/hostile_types = list()
var/number_of_hostiles
/// List of mutable appearances in the form (plane offset + 1 -> appearance)
var/list/mutable_appearance/storm_appearances
/datum/round_event/portal_storm/setup()
storm_appearances = list()
for(var/offset in 0 to SSmapping.max_plane_offset)
var/mutable_appearance/storm = mutable_appearance('icons/obj/machines/engine/energy_ball.dmi', "energy_ball_fast", FLY_LAYER)
SET_PLANE_W_SCALAR(storm, ABOVE_GAME_PLANE, offset)
storm.color = COLOR_VIBRANT_LIME
storm_appearances += storm
number_of_bosses = 0
for(var/boss in boss_types)
number_of_bosses += boss_types[boss]
number_of_hostiles = 0
for(var/hostile in hostile_types)
number_of_hostiles += hostile_types[hostile]
while(number_of_bosses > boss_spawn.len)
boss_spawn += get_random_station_turf()
while(number_of_hostiles > hostiles_spawn.len)
hostiles_spawn += get_random_station_turf()
next_boss_spawn = start_when + ceil(2 * number_of_hostiles / number_of_bosses)
/datum/round_event/portal_storm/announce(fake)
set waitfor = 0
sound_to_playing_players('sound/effects/magic/lightning_chargeup.ogg')
sleep(8 SECONDS)
priority_announce("Massive bluespace anomaly detected en route to [station_name()]. Brace for impact.")
sleep(2 SECONDS)
sound_to_playing_players('sound/effects/magic/lightningbolt.ogg')
/datum/round_event/portal_storm/tick()
spawn_effects(get_random_station_turf())
if(spawn_hostile() && length(hostile_types))
var/type = pick(hostile_types)
hostile_types[type] = hostile_types[type] - 1
spawn_mob(type, hostiles_spawn)
if(!hostile_types[type])
hostile_types -= type
if(spawn_boss() && length(boss_types))
var/type = pick(boss_types)
boss_types[type] = boss_types[type] - 1
spawn_mob(type, boss_spawn)
if(!boss_types[type])
boss_types -= type
time_to_end()
/datum/round_event/portal_storm/proc/spawn_mob(type, spawn_list)
if(!type)
return
var/turf/T = pick_n_take(spawn_list)
if(!T)
return
new type(T)
spawn_effects(T)
/datum/round_event/portal_storm/proc/spawn_effects(turf/T)
if(!T)
log_game("Portal Storm failed to spawn effect due to an invalid location.")
return
T = get_step(T, SOUTHWEST) //align center of image with turf
T.flick_overlay_static(storm_appearances[GET_TURF_PLANE_OFFSET(T) + 1], 15)
playsound(T, 'sound/effects/magic/lightningbolt.ogg', rand(80, 100), TRUE)
/datum/round_event/portal_storm/proc/spawn_hostile()
if(!hostile_types || !hostile_types.len)
return 0
return ISMULTIPLE(activeFor, 2)
/datum/round_event/portal_storm/proc/spawn_boss()
if(!boss_types || !boss_types.len)
return FALSE
if(activeFor == next_boss_spawn)
next_boss_spawn += ceil(number_of_hostiles / number_of_bosses)
return TRUE
return FALSE
/datum/round_event/portal_storm/proc/time_to_end()
if(!hostile_types.len && !boss_types.len)
end_when = activeFor
if(!number_of_hostiles && number_of_bosses)
end_when = activeFor