Cleanup code and comments.

- Refactor ion_storm to actually operate using start()/end()/announce()
- Remove unused variable and enhance comments.
This commit is contained in:
Leshana
2020-04-07 01:24:19 -04:00
parent 91e161a73b
commit aaa0fa5539
4 changed files with 9 additions and 11 deletions

View File

@@ -58,7 +58,7 @@
var/datum/event_meta/event_meta = null
var/list/affecting_z = null // List of z-levels to affect, null lets the event choose (usally station_levels)
var/has_skybox_image = FALSE // True if SSskybox should query this event for an image to put in the skybox.
var/obj/effect/overmap/visitable/ship/victim = null // Ship that triggered this event on itself. Some messages might be different etc.
var/obj/effect/overmap/visitable/ship/victim = null // Ship this event is acting upon (If this is event is due to overmap travel).nt etc.
/datum/event/nothing

View File

@@ -2,6 +2,7 @@
/datum/event/ionstorm
has_skybox_image = TRUE
announceWhen = -1 // Never (setup may override)
var/botEmagChance = 0 //VOREStation Edit
var/cloud_hueshift
var/list/players = list()
@@ -17,10 +18,13 @@
/datum/event/ionstorm/setup()
endWhen = rand(500, 1500)
if(prob(50))
announceWhen = endWhen + rand(250, 400)
// Interestingly enough, announce() actually *DOES* this event for some reason.
/datum/event/ionstorm/announce()
// command_alert("The station has entered an ion storm. Monitor all electronic equipment for malfunctions", "Anomaly Alert")
command_announcement.Announce("It has come to our attention that \the [location_name()] passed through an ion storm. Please monitor all electronic equipment for malfunctions.", "Anomaly Alert")
/datum/event/ionstorm/start()
for (var/mob/living/carbon/human/player in player_list)
if( !player.mind || player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > MinutesToTicks(10))
continue
@@ -67,11 +71,6 @@
if(prob(botEmagChance))
bot.emag_act(1)
/datum/event/ionstorm/end()
..()
if(prob(50))
spawn(rand(5000,8000))
command_announcement.Announce("It has come to our attention that \the [location_name()] passed through an ion storm. Please monitor all electronic equipment for malfunctions.", "Anomaly Alert")
// Overmap version
/datum/event/ionstorm/overmap/announce()

View File

@@ -107,8 +107,8 @@
next_meteor = 0
/datum/event/meteor_wave/overmap/tick()
if(victim && !victim.is_still()) // Meteors mostly fly in your face
start_side = prob(90) ? victim.fore_dir : pick(GLOB.cardinal)
if(victim && !victim.is_still() && prob(90)) // Meteors mostly fly in your face
start_side = victim.fore_dir
else //Unless you're standing still
start_side = pick(GLOB.cardinal)
..()

View File

@@ -13,7 +13,6 @@
var/list/event_icon_states // Randomly picked from
var/difficulty = EVENT_LEVEL_MODERATE
var/weaknesses //if the BSA can destroy them and with what
var/list/victims //basically cached events on which Z level
/obj/effect/overmap/event/Initialize()
. = ..()