#include maps\mp\_utility; #include common_scripts\utility; init() { level.nukefx = loadfx ("explosions/nuke"); level.nukefx2 = loadfx ("explosions/nuke_explosion"); level.nukeflash = loadfx ("explosions/nuke_flash"); level.nukeash = loadfx ("brodie/bro_nt_ash"); // level._effect[ "nukeash1"] = loadfx ("brodie/bro_nt_ash"); precacheShellShock( "radiation_high" ); precacheShellShock( "flash" ); level.nuke = false; } nuke() { loc = level.mapCenter; thread NukeCountdown( loc ); } NukeCountdown( position ) { origin_map = getent("origin_map", "targetname"); level notify( "nuke" ); origin_map playSound( "nuke_warning" ); nukeTimer = 10.0; team = self.pers["team"]; otherTeam = level.otherTeam[team]; maps\mp\gametypes\_globallogic::leaderDialog( "nuke_friendly", team ); wait nukeTimer; position = level.mapCenter; position2 = (250,0,0); position3 = (300,100,0); nuke = spawn( "script_origin", position ); nuke playSound( "nuke_fuse" ); wait 2; playFX( level.nukefx, position ); visionSetNaked("nuke",0); playFX( level.nukeflash, position3 ); nuke playSound( "nuke_drop" ); nuke playSound( "nuke_explode" ); wait 0.1; playFX( level.nukefx2, position2 ); level.nuke = true; wait 0.5; earthquake( 1, 1.5, position, 80000); players = getEntarray( "player", "classname" ); for( i = 0; i < players.size; i++ ) { player = players[i]; player playSound( "nuke_aftermath" ); player shellshock( "radiation_high", 1 ); player ViewKick( 127, player.origin ); player.health = player.maxhealth ; } wait 0.8; for( i = 0; i < players.size; i++ ) { player = players[i]; handOrigin = self getTagOrigin( "tag_weapon_right" ); playFX( level.nukewind, handOrigin ); } wait 5.0; for( i = 0; i < players.size; i++ ) { player = players[i]; player thread applyFlash(3, 0.75); } wait 0.8; visionSetNaked("nuke2",1); thread broeffectsash(); setExpFog(2000, 3000, 0.591, 0.578, 0.510, 0.0); AmbientStop( 20 ); { wait 20; visionSetNaked("nt_2025_nuke",1); level.nuke = false; self.health = getDvarInt( "scr_player_maxhealth" ); nuke Delete(); } } applyFlash(duration, rumbleduration) { if (!isdefined(self.flashDuration) || duration > self.flashDuration) self.flashDuration = duration; if (!isdefined(self.flashRumbleDuration) || rumbleduration > self.flashRumbleDuration) self.flashRumbleDuration = rumbleduration; wait .05; if (isdefined(self.flashDuration)) { self shellshock( "flash", self.flashDuration ); // TODO: avoid shellshock overlap self.flashEndTime = getTime() + (self.flashDuration * 1000); } if (isdefined(self.flashRumbleDuration)) { self thread flashRumbleLoop( self.flashRumbleDuration ); //TODO: Non-hacky rumble. } self.flashDuration = undefined; self.flashRumbleDuration = undefined; } flashRumbleLoop( duration ) { self endon("stop_monitoring_flash"); self endon("flash_rumble_loop"); self notify("flash_rumble_loop"); goalTime = getTime() + duration * 1000; while ( getTime() < goalTime ) { self PlayRumbleOnEntity( "damage_heavy" ); wait( 0.05 ); } } broeffectsash() { ash1p = (-315.593, 54.6812, 80); ash2p = (238.606, 284.173, 80); ash3p = (-22.6242, -416.51, 80); ash4p = (951.497, -86.9203, 80); ash5p = (1530.11, 240.228, 80); ash6p = (1266.44, 872.552, 80); ash7p = (646.321, 967.767, 80); ash8p = (-171.55, 826.166, 80); ash9p = (-845.378, 901.849, 80); ash10p = (-1397.14, 894.525, 80); ash11p = (-1511.88, 359.857, 80); ash12p = (-1026.04, -115.495, 60); playFX( level.nukeash, ash1p ); playFX( level.nukeash, ash2p ); playFX( level.nukeash, ash3p ); playFX( level.nukeash, ash4p ); playFX( level.nukeash, ash5p ); playFX( level.nukeash, ash6p ); playFX( level.nukeash, ash7p ); playFX( level.nukeash, ash8p ); playFX( level.nukeash, ash9p ); playFX( level.nukeash, ash10p ); playFX( level.nukeash, ash11p ); playFX( level.nukeash, ash12p ); wait 3; thread broeffectsash(); }