mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
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:
@@ -58,7 +58,7 @@
|
|||||||
var/datum/event_meta/event_meta = null
|
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/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/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
|
/datum/event/nothing
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
/datum/event/ionstorm
|
/datum/event/ionstorm
|
||||||
has_skybox_image = TRUE
|
has_skybox_image = TRUE
|
||||||
|
announceWhen = -1 // Never (setup may override)
|
||||||
var/botEmagChance = 0 //VOREStation Edit
|
var/botEmagChance = 0 //VOREStation Edit
|
||||||
var/cloud_hueshift
|
var/cloud_hueshift
|
||||||
var/list/players = list()
|
var/list/players = list()
|
||||||
@@ -17,10 +18,13 @@
|
|||||||
|
|
||||||
/datum/event/ionstorm/setup()
|
/datum/event/ionstorm/setup()
|
||||||
endWhen = rand(500, 1500)
|
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()
|
/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)
|
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))
|
if( !player.mind || player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > MinutesToTicks(10))
|
||||||
continue
|
continue
|
||||||
@@ -67,11 +71,6 @@
|
|||||||
if(prob(botEmagChance))
|
if(prob(botEmagChance))
|
||||||
bot.emag_act(1)
|
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
|
// Overmap version
|
||||||
/datum/event/ionstorm/overmap/announce()
|
/datum/event/ionstorm/overmap/announce()
|
||||||
|
|||||||
@@ -107,8 +107,8 @@
|
|||||||
next_meteor = 0
|
next_meteor = 0
|
||||||
|
|
||||||
/datum/event/meteor_wave/overmap/tick()
|
/datum/event/meteor_wave/overmap/tick()
|
||||||
if(victim && !victim.is_still()) // Meteors mostly fly in your face
|
if(victim && !victim.is_still() && prob(90)) // Meteors mostly fly in your face
|
||||||
start_side = prob(90) ? victim.fore_dir : pick(GLOB.cardinal)
|
start_side = victim.fore_dir
|
||||||
else //Unless you're standing still
|
else //Unless you're standing still
|
||||||
start_side = pick(GLOB.cardinal)
|
start_side = pick(GLOB.cardinal)
|
||||||
..()
|
..()
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
var/list/event_icon_states // Randomly picked from
|
var/list/event_icon_states // Randomly picked from
|
||||||
var/difficulty = EVENT_LEVEL_MODERATE
|
var/difficulty = EVENT_LEVEL_MODERATE
|
||||||
var/weaknesses //if the BSA can destroy them and with what
|
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()
|
/obj/effect/overmap/event/Initialize()
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|||||||
Reference in New Issue
Block a user