Merge pull request #7118 from VOREStation/vplk-shields

Ports Baystation Advanced Shield Generators
This commit is contained in:
Aronai Sieyes
2020-04-07 23:53:12 -04:00
committed by GitHub
19 changed files with 1392 additions and 125 deletions

View File

@@ -35,8 +35,16 @@
/datum/event/electrical_storm/tick()
..()
// See if shields can stop it first (It would be nice to port baystation's cooler shield gens perhaps)
// TODO - We need a better shield generator system to handle this properly.
// See if shields can stop it first
var/list/shields = list()
for(var/obj/machinery/power/shield_generator/G in global.machines)
if((G.z in affecting_z) && G.running && G.check_flag(MODEFLAG_EM))
shields += G
if(shields.len)
var/obj/machinery/power/shield_generator/shield_gen = pick(shields)
//Minor breaches aren't enough to let through frying amounts of power
if(shield_gen.deal_shield_damage(30 * severity, SHIELD_DAMTYPE_EM) <= SHIELD_BREACHED_MINOR)
return
if(!valid_apcs.len)
log_debug("No valid APCs found for electrical storm event ship=[victim]!")
return

View File

@@ -2,7 +2,8 @@
startWhen = 30 // About one minute early warning
endWhen = 60 // Adjusted automatically in tick()
has_skybox_image = TRUE
var/next_meteor = 6
var/alarmWhen = 30
var/next_meteor = 40
var/waves = 1
var/start_side
var/next_meteor_lower = 10
@@ -32,6 +33,12 @@
command_announcement.Announce("\The [location_name()] is now in a meteor shower.", "Meteor Alert")
/datum/event/meteor_wave/tick()
// Begin sending the alarm signals to shield diffusers so the field is already regenerated (if it exists) by the time actual meteors start flying around.
if(activeFor >= alarmWhen)
for(var/obj/machinery/shield_diffuser/SD in global.machines)
if(SD.z in affecting_z)
SD.meteor_alarm(10)
if(waves && activeFor >= next_meteor)
send_wave()
@@ -105,6 +112,7 @@
next_meteor_lower = 5
next_meteor_upper = 10
next_meteor = 0
alarmWhen = 0
/datum/event/meteor_wave/overmap/tick()
if(victim && !victim.is_still() && prob(90)) // Meteors mostly fly in your face