-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Immersive AA Sequence (3) #11
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
var/obj/structure/anti_air_cannon/almayer_aa_cannon | ||
|
||
GLOBAL_VAR_INIT(AAgunLocation,0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not how you do global variables, look at using GLOBAL_DATUM |
||
/obj/structure/anti_air_cannon | ||
name = "\improper IX-50 MGAD Cannon" | ||
desc = "The IX-50 is a state-of-the-art Micro-Gravity and Air Defense system capable of independently tracking and neutralizing threats with rockets strapped onto them." | ||
desc = "This is one of the IX-50 MGAD defense stations. The IX-50 is a state-of-the-art Micro-Gravity and Air Defense system capable of independently tracking and neutralizing threats." | ||
icon = 'icons/effects/128x128.dmi' | ||
icon_state = "anti_air_cannon" | ||
density = 1 | ||
|
@@ -18,10 +18,12 @@ var/obj/structure/anti_air_cannon/almayer_aa_cannon | |
var/protecting_section = "" | ||
var/is_disabled = FALSE | ||
|
||
/obj/structure/anti_air_cannon/New() | ||
/obj/structure/anti_air_cannon/Initialize() | ||
. = ..() | ||
//() | ||
if(!almayer_aa_cannon) | ||
almayer_aa_cannon = src | ||
GLOB.AAgunLocation = loc | ||
|
||
/obj/structure/anti_air_cannon/ex_act() | ||
return | ||
|
@@ -70,7 +72,7 @@ var/obj/structure/anti_air_cannon/almayer_aa_cannon | |
dat += "No MGAD System Detected!<br/>" | ||
else | ||
var/tracking_desc = almayer_aa_cannon.protecting_section ? almayer_aa_cannon.protecting_section : "SYSTEM INACTIVE" | ||
dat += "<h2>MGA defense system</h2>" | ||
dat += "<h2>MGA Point Defense System</h2>" | ||
dat += "<p>Currently tracking: [tracking_desc]</p>" | ||
dat += "<hr/>" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -460,7 +460,7 @@ | |
// At halftime, we announce whether or not the AA forced the dropship to divert | ||
// The rounding is because transit time is decreased by 10 each loop. Travel time, however, might not be a multiple of 10 | ||
if(in_transit_time_left == round(travel_time / 2, 10) && true_crash_target_section != crash_target_section) | ||
marine_announcement("A hostile aircraft on course for the [true_crash_target_section] has been successfully deterred.", "IX-50 MGAD System") | ||
INVOKE_ASYNC(src, .proc/AA_sequence, turfs_int) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make this snake_case |
||
|
||
var/area/shuttle_area | ||
for(var/turf/T in turfs_int) | ||
|
@@ -590,7 +590,74 @@ | |
if(SSticker.mode) | ||
SSticker.mode.is_in_endgame = TRUE | ||
SSticker.mode.force_end_at = world.time + 15000 // 25 mins | ||
////// | ||
////// Le funny immersive crash sequence | ||
////// independent of main crash proc so sleep()s don't matter here. Try keep it under 15s as we only have 45s before crash and we run on BYOND time. We wouldn't want | ||
////// the ds still getting hit during,and after the crash. | ||
|
||
////// No combat is really occuring during this point of the round so it should give us more performance overhead to give a nice fireworks display (: | ||
/datum/shuttle/ferry/marine/proc/AA_sequence(turfs_int) | ||
set waitfor = 0 | ||
var/sound_to_play = pick(SOUND_DISTANT_AA_FIRE) | ||
var/sound_to_play2 = pick(SOUND_DISTANT_AA_FIRE) | ||
//init the funny spark system | ||
var/datum/effect_system/spark_spread/s = new | ||
var/turf/T | ||
var/mob/M | ||
Comment on lines
+605
to
+606
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need more detailed variable names |
||
var/cause = create_cause_data("IX-50 MGAD") | ||
// Used to define shuttle area during crash | ||
var/area/shuttle_area | ||
var/ship_zlevels = SSmapping.levels_by_trait(ZTRAIT_MARINE_MAIN_SHIP) | ||
// define all shuttle turfs as shuttle_area. This includes some deadspace outside of DS, in which some effects may randomly spawn there. Consider that variety, if you will. | ||
if(!shuttle_area) | ||
for(T as anything in turfs_int) | ||
if(T?.loc) | ||
shuttle_area = T.loc | ||
break | ||
marine_announcement("A hostile aircraft has been detected on course for the [true_crash_target_section]. IX-50 MGAD & ASAT missiles are locked onto target trajectory. Firing for effect.", "ARES") | ||
playsound_z(ship_zlevels, 'sound/effects/alert.ogg', 75, echo = list(-500, -2000, 1000, 500, 0, 0.8, 5, 5), y_s_offset = 10) | ||
for(M in shuttle_area) | ||
if(isXeno(M)) | ||
to_chat(M, SPAN_HIGHDANGER("Alarms blare throughout the bird! The fleshy hosts are definately trying something!")) | ||
else | ||
to_chat(M, SPAN_HIGHDANGER("Lock-on alarms and missile warnings blare from the cockpit! Oh crap!")) | ||
Comment on lines
+619
to
+623
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improve your variable names please they should not be single-letter var names.
Comment on lines
+619
to
+623
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This micro optimization is just not worth it. Just define M here instead of defining it early on |
||
playsound_area(shuttle_area, 'sound/effects/alert.ogg',75, echo = list(-500, -1500, 1000, 500, 0, 0.8, 5, 5), y_s_offset = 10) | ||
sleep(5 SECONDS) | ||
playsound(GLOB.AAgunLocation, sound_to_play, 100, sound_range = 300, falloff = 250, echo = list(-1000, -3500, 1000, 0, 0, 1, -2000, 0.5, 6, 2), y_s_offset = 10) | ||
playsound_area(shuttle_area, sound_to_play, echo = list(-500, -2000, 1000, 500, 0, 0.8, 5, 5), y_s_offset = 10) | ||
sleep(4 SECONDS) //bullet time lulz | ||
for(M in shuttle_area) | ||
to_chat(M, SPAN_HIGHDANGER("The ship jostles violently as explosions rock the ship!")) //xenos getting hit | ||
to_chat(M, SPAN_HIGHDANGER("You feel the ship turning sharply as it adjusts its course!")) | ||
shake_camera(M, 60, 2) | ||
playsound_area(shuttle_area, 'sound/effects/antiair_explosions.ogg', echo = list(-500, -1500, 1000, 500, 0, 0.8, 5, 5)) | ||
// Shit hits the fan | ||
// Everything here is and should be non lethal to even larva. Even if the RNG gods somehow smited one with all of these explosions they will still live. | ||
addtimer(CALLBACK(GLOBAL_PROC, .proc/cell_explosion,pick(turfs_int),5,1,EXPLOSION_FALLOFF_SHAPE_LINEAR,null,cause), 1 SECONDS) | ||
sleep(5) | ||
addtimer(CALLBACK(GLOBAL_PROC, .proc/cell_explosion,pick(turfs_int),5,1,EXPLOSION_FALLOFF_SHAPE_LINEAR,null,cause), 2 SECONDS) | ||
sleep(5) | ||
addtimer(CALLBACK(GLOBAL_PROC, .proc/cell_explosion,pick(turfs_int),5,1,EXPLOSION_FALLOFF_SHAPE_LINEAR,null,cause), 3 SECONDS) | ||
sleep(2 SECONDS) | ||
addtimer(CALLBACK(GLOBAL_PROC, .proc/cell_explosion,pick(turfs_int),5,1,EXPLOSION_FALLOFF_SHAPE_LINEAR,null,cause), 2 SECONDS) | ||
create_shrapnel(pick(turfs_int), rand(5,9), , ,/datum/ammo/bullet/shrapnel/light/effect/, cause) | ||
s.set_up(10, 1, pick(turfs_int)) // Spark system funny | ||
s.start() | ||
sleep(1 SECONDS) | ||
INVOKE_ASYNC(GLOBAL_PROC, .proc/flame_radius,cause, 1, pick(turfs_int), 1, 16, FLAMESHAPE_DEFAULT, null) | ||
create_shrapnel(pick(turfs_int), rand(5,9), , ,/datum/ammo/bullet/shrapnel/light/effect/ver2, cause) | ||
addtimer(CALLBACK(GLOBAL_PROC, .proc/cell_explosion,pick(turfs_int),5,1,EXPLOSION_FALLOFF_SHAPE_LINEAR,null,cause), 3 SECONDS) | ||
new /obj/effect/spawner/gibspawner/robot(pick(turfs_int)) | ||
new /obj/effect/spawner/gibspawner/robot(pick(turfs_int)) // A few random ass gibs | ||
s.set_up(10, 1, pick(turfs_int)) | ||
s.start() | ||
playsound(GLOB.AAgunLocation, sound_to_play2, 100, sound_range = 300, falloff = 250, echo = list(-1000, -3500, 1000, 0, 0, 1, -2000, 0.5, 6, 2), y_s_offset = 10) // making sure? | ||
playsound_area(shuttle_area, sound_to_play, echo = list(-500, -2000, 1000, 500, 0, 0.8, 5, 5), y_s_offset = 10) | ||
sleep(1 SECONDS) | ||
s.set_up(10, 1, pick(turfs_int)) | ||
s.start() | ||
create_shrapnel(pick(turfs_int), rand(5,9), , ,/datum/ammo/bullet/shrapnel/light/effect/ver1, cause) | ||
marine_announcement("A hostile aircraft on course for the [true_crash_target_section] has been successfully deterred. ASAT-21 Rapier IV missiles have misfired and failed to intercept target. Please check ASAT tubes number 2 and 9.", "IX-50 MGAD System") | ||
|
||
/datum/shuttle/ferry/marine/short_jump() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this variable
You don't need GLOB.AAgunLocation because you can just make a global variable called GLOB.aa_gun and then do GLOB.aa_gun.loc