Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.             if ( PlayState.currentLevel == 10 && Global.levelselect == 0)
  3.             {
  4.                 if (frames <= 150)
  5.                 {
  6.                     Global.musicvolume = GML.scaleclamp(frames, 0, 150, 1, 0) * Global.musicenabled;
  7.                     if (Global.musicvolume <= 0)
  8.                     {
  9.                         Global.musicabove.stop();
  10.                         Global.musicabove.stop();
  11.                         Global.musicvolume = 0;
  12.                     }
  13.                     Global.musicabove.volume =  Global.musicvolume;
  14.                 }
  15.                
  16.                 //debug ending:
  17.                 if ( FlxG.keys.justPressed("E") )
  18.                 {
  19.                     //1792 992
  20.                     PlayState.player.mask.x = 1792;
  21.                     PlayState.player.mask.y = 992;
  22.                 }
  23.                
  24.                 //if the special ending has been activated, then start
  25.                 //the timer to do the sequence.
  26.            
  27.                 if ( special_ending > 0)
  28.                 {
  29.                     special_ending += GML.roomSpeed * FlxG.elapsed;
  30.                    
  31.                     Global.soundnoise.volume = 0;
  32.                    
  33.                     if (special_ending >= 2 && special_ending < 5)
  34.                     {
  35.                         special_ending = 5;
  36.                         PlayState.player.visible = false;
  37.                         //obj_player.solid = false;
  38.                        
  39.                     }
  40.                    
  41.                     if (special_ending >= 60 && special_ending < 63)
  42.                     {
  43.                         special_ending = 63;
  44.                         PlayState.angel.angel.play( "hurt", true );
  45.                         Angel.sprite_shake = 10;
  46.                         PlayState.angel.create_particles = false;
  47.                         World.soundManager.playSound(souldeathsnd);
  48.                         PlayState.angel.square_speed = 0;
  49.                         for ( var i:int = 0; i < 20 ; i++ )
  50.                         {
  51.                             var angelTrail:AngelTrail = AngelTrailGroup.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) , PlayState.angel.angel._curAnim.name, PlayState.angel.dir );
  52.                             angelTrail.velocity.x *= GML.random(10);
  53.                             angelTrail.velocity.y *= GML.random(10);
  54.                         }
  55.                         var sound:JoySound = World.soundManager.playSound(snd_noise);
  56.                         sound.isLooped = true;
  57.                     }
  58.                    
  59.                     if (special_ending >= 60)
  60.                     {
  61.                         if ( Angel.sprite_shake < 2)
  62.                         {
  63.                             Angel.sprite_shake = 2;
  64.                         }
  65.                     }
  66.                    
  67.                     if (special_ending >= 90)
  68.                     {
  69.                         if ( Math.floor(special_ending) % 25 == 0)
  70.                         {
  71.                             SmokePuffs.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ), 16, true );
  72.                         }
  73.                     }
  74.                    
  75.                     if (special_ending >= 180 && special_ending < 183)
  76.                     {
  77.                         special_ending = 183;
  78.                         World.soundManager.playSound(snd_explodebig);
  79.                     }
  80.                    
  81.                     if (special_ending >= 180 && special_ending < 1000)
  82.                     {
  83.                         if ( Math.round(special_ending) % 15 == 0)
  84.                         {
  85.                             SmokePuffs.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ), 32, true );
  86.                         }
  87.                         if (  Math.round(special_ending) % 4 == 0)
  88.                         {
  89.                             SmokePuffs.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ), 4, false, true);
  90.                         }
  91.                         if (  Math.round(special_ending) % 6 == 0)
  92.                         {
  93.                             AngelTrailGroup.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) , PlayState.angel.angel._curAnim.name, PlayState.angel.dir );
  94.                         }
  95.                     }
  96.                    
  97.                     if (special_ending >= 320 && special_ending < 1000)
  98.                     {
  99.                         if ( Math.round(special_ending) % 2 == 0)
  100.                         {
  101.                             SmokePuffs.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ), 8, false, true);
  102.                         }
  103.                     }
  104.                    
  105.                     if (special_ending >= 180 && special_ending < 1000 && Math.round(special_ending) % Math.round(light_beam_rate) == 0)
  106.                     {
  107.                         light_beam_rate -= 3 * GML.roomSpeed * FlxG.elapsed;
  108.                         white_flash = 25;
  109.                         if (light_beam_rate < 6)
  110.                         {
  111.                             light_beam_rate = 6;
  112.                         }
  113.                        
  114.                         if (special_ending < 600)
  115.                         {
  116.                             World.soundManager.playSound(snd_burst);
  117.                         }
  118.  
  119.                         LightBeamSpawner.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) );
  120.                     }
  121.                    
  122.                     if (special_ending >= 240)
  123.                     {
  124.                         if ( Math.round(special_ending) % 15 == 0)
  125.                         {
  126.                             AngelPartSpawner.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) );
  127.                         }
  128.                    
  129.                     }
  130.                    
  131.                     if (special_ending >= 320)
  132.                     {
  133.                         if ( Math.round(special_ending) % 7 == 0)
  134.                         {
  135.                             AngelPartSpawner.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) );
  136.                         }
  137.                    
  138.                     }
  139.                    
  140.                     if ( Math.round(special_ending) >= 400)
  141.                     {
  142.                         if ( Math.round(special_ending) % 3 == 0)
  143.                         {
  144.                             AngelPartSpawner.createEffect( new Point( PlayState.angel.originalX, PlayState.angel.originalY ) );
  145.                         }
  146.                    
  147.                     }
  148.  
  149.                    
  150.                     if ( Math.round(special_ending) > 508 && Math.round( special_ending ) < 600)
  151.                     {
  152.                         special_ending = 600;
  153.                         World.soundManager.playSound(snd_blackhole);
  154.                         Global.soundnoise.stop();
  155.                     }
  156.                    
  157.                     if (special_ending >= 600)
  158.                     {
  159.                         var spiralPuff:SpiralPuff = SpiralPuffSpawner.createEffect( new Point( PlayState.angel.angel.x, PlayState.angel.angel.y ) );
  160.                         spiralPuff.position_value = special_ending - 600;
  161.                         spiralPuff = SpiralPuffSpawner.createEffect( new Point( PlayState.angel.angel.x, PlayState.angel.angel.y ) );
  162.                         spiralPuff.position_value = special_ending - 600;
  163.                         spiralPuff.inverse = 1;
  164.                     }
  165.                    
  166.                     if (special_ending == 1100)
  167.                     {
  168.                         PlayState.currentLevel = 11;
  169.                         FlxG.switchState( new PlayState );
  170.                     }
  171.                    
  172.                     PlayState.angel.square_alpha = GML.scaleclamp(special_ending, 120, 180, 1, 0);
  173.                 }
  174.                 else
  175.                 {
  176.                     //handle the ending if the player is above the water
  177.                     if (PlayState.player.mask.y < Gravline.yPos)
  178.                     {
  179.                         if ( PlayState.player.mask.x > 1000)
  180.                         {
  181.                             if ( Global.noise_volume < 1 && Global.soundenabled)
  182.                             {
  183.                                 Global.noise_volume += ( 0.002 * GML.roomSpeed * FlxG.elapsed );
  184.                             }
  185.                         }
  186.                        
  187.                         if ( PlayState.player.mask.x >= PlayState.angel.angel.x - 16)
  188.                         {
  189.                             //go to normal ending
  190.                         }
  191.                     }
  192.                 }
  193.                
  194.                
  195.                
  196.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement