Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( PlayState.currentLevel == 10 && Global.levelselect == 0)
- {
- if (frames <= 150)
- {
- Global.musicvolume = GML.scaleclamp(frames, 0, 150, 1, 0) * Global.musicenabled;
- if (Global.musicvolume <= 0)
- {
- Global.musicabove.stop();
- Global.musicabove.stop();
- Global.musicvolume = 0;
- }
- Global.musicabove.volume = Global.musicvolume;
- }
- //debug ending:
- if ( FlxG.keys.justPressed("E") )
- {
- //1792 992
- PlayState.player.mask.x = 1792;
- PlayState.player.mask.y = 992;
- }
- //if the special ending has been activated, then start
- //the timer to do the sequence.
- if ( special_ending > 0)
- {
- special_ending += GML.roomSpeed * FlxG.elapsed;
- Global.soundnoise.volume = 0;
- if (special_ending >= 2 && special_ending < 5)
- {
- special_ending = 5;
- PlayState.player.visible = false;
- //obj_player.solid = false;
- }
- if (special_ending >= 60 && special_ending < 63)
- {
- special_ending = 63;
- PlayState.angel.angel.play( "hurt", true );
- Angel.sprite_shake = 10;
- PlayState.angel.create_particles = false;
- World.soundManager.playSound(souldeathsnd);
- PlayState.angel.square_speed = 0;
- for ( var i:int = 0; i < 20 ; i++ )
- {
- var angelTrail:AngelTrail = AngelTrailGroup.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) , PlayState.angel.angel._curAnim.name, PlayState.angel.dir );
- angelTrail.velocity.x *= GML.random(10);
- angelTrail.velocity.y *= GML.random(10);
- }
- var sound:JoySound = World.soundManager.playSound(snd_noise);
- sound.isLooped = true;
- }
- if (special_ending >= 60)
- {
- if ( Angel.sprite_shake < 2)
- {
- Angel.sprite_shake = 2;
- }
- }
- if (special_ending >= 90)
- {
- if ( Math.floor(special_ending) % 25 == 0)
- {
- SmokePuffs.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ), 16, true );
- }
- }
- if (special_ending >= 180 && special_ending < 183)
- {
- special_ending = 183;
- World.soundManager.playSound(snd_explodebig);
- }
- if (special_ending >= 180 && special_ending < 1000)
- {
- if ( Math.round(special_ending) % 15 == 0)
- {
- SmokePuffs.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ), 32, true );
- }
- if ( Math.round(special_ending) % 4 == 0)
- {
- SmokePuffs.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ), 4, false, true);
- }
- if ( Math.round(special_ending) % 6 == 0)
- {
- AngelTrailGroup.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) , PlayState.angel.angel._curAnim.name, PlayState.angel.dir );
- }
- }
- if (special_ending >= 320 && special_ending < 1000)
- {
- if ( Math.round(special_ending) % 2 == 0)
- {
- SmokePuffs.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ), 8, false, true);
- }
- }
- if (special_ending >= 180 && special_ending < 1000 && Math.round(special_ending) % Math.round(light_beam_rate) == 0)
- {
- light_beam_rate -= 3 * GML.roomSpeed * FlxG.elapsed;
- white_flash = 25;
- if (light_beam_rate < 6)
- {
- light_beam_rate = 6;
- }
- if (special_ending < 600)
- {
- World.soundManager.playSound(snd_burst);
- }
- LightBeamSpawner.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) );
- }
- if (special_ending >= 240)
- {
- if ( Math.round(special_ending) % 15 == 0)
- {
- AngelPartSpawner.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) );
- }
- }
- if (special_ending >= 320)
- {
- if ( Math.round(special_ending) % 7 == 0)
- {
- AngelPartSpawner.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) );
- }
- }
- if ( Math.round(special_ending) >= 400)
- {
- if ( Math.round(special_ending) % 3 == 0)
- {
- AngelPartSpawner.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) );
- }
- }
- if ( Math.round(special_ending) > 508 && Math.round( special_ending ) < 600)
- {
- special_ending = 600;
- World.soundManager.playSound(snd_blackhole);
- Global.soundnoise.stop();
- }
- if (special_ending >= 600)
- {
- var spiralPuff:SpiralPuff = SpiralPuffSpawner.createEffect( new Point( PlayState.angel.angel.x, PlayState.angel.angel.y ) );
- spiralPuff.position_value = special_ending - 600;
- spiralPuff = SpiralPuffSpawner.createEffect( new Point( PlayState.angel.angel.x, PlayState.angel.angel.y ) );
- spiralPuff.position_value = special_ending - 600;
- spiralPuff.inverse = 1;
- }
- if (special_ending == 1100)
- {
- PlayState.currentLevel = 11;
- FlxG.switchState( new PlayState );
- }
- PlayState.angel.square_alpha = GML.scaleclamp(special_ending, 120, 180, 1, 0);
- }
- else
- {
- //handle the ending if the player is above the water
- if (PlayState.player.mask.y < Gravline.yPos)
- {
- if ( PlayState.player.mask.x > 1000)
- {
- if ( Global.noise_volume < 1 && Global.soundenabled)
- {
- Global.noise_volume += ( 0.002 * GML.roomSpeed * FlxG.elapsed );
- }
- }
- if ( PlayState.player.mask.x >= PlayState.angel.angel.x - 16)
- {
- //go to normal ending
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement