Files
Bubberstation/code/modules/events/portal_storm.dm
T
Cyberbossandduncathan salt 9e1ef0ffe2 Global variable wrappers (#25325)
* Add the system for managed global variables

* Travis ban old globals

* So you CAN inline proccall, that's neat

* Fix that

* master.dm

* Remove the hack procs

* Move InitGlobals to the proper spot

* configuration.dm

* Fix the missing pre-slash

* clockcult.dm

* This is probably for the best

* Doy

* Fix shit

* Rest of the DEFINES tree

* Fix

* Use global. for access

* Update find_references_in_globals

Always hated that proc

Whoever made it must've bee a r e a l idiot...

* __HELPERS tree

* Move global initialization to master.

Fix the declaration

* database.dm

* Dat newline

* I said DECLARATIVE order!

* Here's something you can chew on @Iamgoofball

* game_modes.dm

* Fix this

* genetics.dm

* flavor_misc.dm

* More stuff

* Do it mso's way. Keep the controllers as global

* Make master actually see it

* Fix

* Finish _globalvars/lists

* Finish the rest of the _globalvars tree

* This is weird

* Migrate the controllers

* SLOTH -> GLOB

* Lighting globals

* round_start_time -> ticker

* PAI card list -> pai SS

* record_id_num -> static

* Diseases list -> SSdisease

* More disease globals to the SS

* More disease stuff

* Emote list

* Better and better

* Bluh

* So much stuff

* Ahh

* Wires

* dview

* station_areas

* Teleportlocs

* blood_splatter_icons

* Stuff and such

* More stuff

* RAD IO

* More stuff and such

* Blob shit

* Changeling stuff

* Add "Balance" to changelogs

* Balance for changelog compiler + Auto Tagging

* Update the PR template

* hivemind_bank

* Bip

* sacrificed

* Good shit

* Better define

* More cult shit

* Devil shit

* Gang shit

* > borers

Fix shit

* Rename the define

* Nuke

* Objectives

* Sandbox

* Multiverse sword

* Announce systems

* Stuff and such

* TC con

* Airlock

* doppllllerrrrrr

* holopads

* Shut up byond you inconsistent fuck

* Sneaky fuck

* Burp

* Bip

* Fixnshit

* Port without regard

* askdlfjs;

* asdfjasoidojfi

* Protected globals and more

* SO MANY

* ajsimkvahsaoisd

* akfdsiaopwimfeoiwafaw

* gsdfigjosidjfgiosdg

* AHHHHHHHHHHHHHHHHHHHHHHH!!!!!

* facerolll

* ASDFASDFASDF

* Removes the unused parts of dmm_suite

* WIP

* Fix quote

* asdfjauwfnkjs

* afwlunhskjfda

* asfjlaiwuefhaf

* SO CLOSE

* wwwweeeeeewwwww

* agdgmoewranwg

* HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!?

* Fix syntax errors

* 100 errors

* Another 100

* So many...

* Ugh

* More shit

* kilme

* Stuuuuuufffff

* ajrgmrlshio;djfa;sdkl

* jkbhkhjbmjvjmh

* soi soi soi

* butt

* TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING

* lllllllllllllllllllllllllllllllllllllllllll

* afsdijfiawhnflnjhnwsdfs

* yugykihlugk,kj

* time to go

* STUFFF!!!

* AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

* ngoaijdjlfkamsdlkf

* Break time

* aufjsdklfalsjfi

* CONTROL KAY AND PRAY

* IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* Goteem

* Fix testing mode

* This does not belong in this PR

* Convert it to a controller

* Eh, fuck this option

* Revert controllerization Ill do it some other time

* Fix

* Working controllerization

* FOR THE LOVE OF CHRIST PROTECT THE LOGS

* Protect admins and deadmins

* Use the inbuilt proc
2017-04-06 23:26:13 -06:00

136 lines
4.1 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 = 18000
/datum/round_event/portal_storm/syndicate_shocktroop
boss_types = list(/mob/living/simple_animal/hostile/syndicate/melee/space/stormtrooper = 2)
hostile_types = list(/mob/living/simple_animal/hostile/syndicate/melee/space = 8,\
/mob/living/simple_animal/hostile/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
/datum/round_event/portal_storm/portal_storm_narsie
boss_types = list(/mob/living/simple_animal/hostile/construct/builder = 6)
hostile_types = list(/mob/living/simple_animal/hostile/construct/armored/hostile = 8,\
/mob/living/simple_animal/hostile/construct/wraith/hostile = 6)
/datum/round_event/portal_storm
startWhen = 7
endWhen = 999
announceWhen = 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
var/list/station_areas = list()
var/image/storm
/datum/round_event/portal_storm/setup()
storm = image('icons/obj/tesla_engine/energy_ball.dmi', "energy_ball_fast", layer=FLY_LAYER)
storm.color = "#00FF00"
station_areas = get_areas_in_z(ZLEVEL_STATION)
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]
var/list/b_spawns = GLOB.generic_event_spawns.Copy()
while(number_of_bosses > boss_spawn.len)
var/turf/F = get_turf(pick_n_take(b_spawns))
if(!F)
F = safepick(get_area_turfs(pick(station_areas)))
boss_spawn += F
var/list/h_spawns = GLOB.generic_event_spawns.Copy()
while(number_of_hostiles > hostiles_spawn.len)
var/turf/T = get_turf(pick_n_take(h_spawns))
if(!T)
T = safepick(get_area_turfs(pick(station_areas)))
hostiles_spawn += T
next_boss_spawn = startWhen + Ceiling(2 * number_of_hostiles / number_of_bosses)
/datum/round_event/portal_storm/announce()
set waitfor = 0
playsound_global('sound/magic/lightning_chargeup.ogg', repeat=0, channel=1, volume=100)
sleep(80)
priority_announce("Massive bluespace anomaly detected en route to [station_name()]. Brace for impact.")
sleep(20)
playsound_global('sound/magic/lightningbolt.ogg', repeat=0, channel=1, volume=100)
/datum/round_event/portal_storm/tick()
spawn_effects()
if(spawn_hostile())
var/type = safepick(hostile_types)
hostile_types[type] = hostile_types[type] - 1
spawn_mob(type, hostiles_spawn)
if(!hostile_types[type])
hostile_types -= type
if(spawn_boss())
var/type = safepick(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)
T = get_step(T, SOUTHWEST) //align center of image with turf
flick_overlay_static(storm, T, 15)
playsound(T, 'sound/magic/lightningbolt.ogg', 100, 1)
else
for(var/V in station_areas)
var/area/A = V
var/turf/F = get_turf(pick(A.contents))
flick_overlay_static(storm, F, 15)
playsound(F, 'sound/magic/lightningbolt.ogg', 80, 1)
/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 0
if(activeFor == next_boss_spawn)
next_boss_spawn += Ceiling(number_of_hostiles / number_of_bosses)
return 1
/datum/round_event/portal_storm/proc/time_to_end()
if(!hostile_types.len && !boss_types.len)
endWhen = activeFor
if(!number_of_hostiles && number_of_bosses)
endWhen = activeFor