Advertisement
Jhynjhiruu

Untitled

Jan 11th, 2020
2,734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. _root.UnpausedCharEngine = function()
  2. {
  3.    tellTarget(_root.Course.Char)
  4.    {
  5.       if(_root.playpause == true)
  6.       {
  7.          _root.Controll = false;
  8.       }
  9.       blink = Math.round(blink);
  10.       blink = Math.max(blink,0);
  11.       StunTime = Math.round(StunTime);
  12.       StunTime = Math.max(StunTime,0);
  13.       if(StunTime > 0)
  14.       {
  15.          StunTime--;
  16.          if(Water == true)
  17.          {
  18.             StunTime = StunTime - 3;
  19.          }
  20.          else
  21.          {
  22.             _root.Controll = false;
  23.          }
  24.       }
  25.       if(blink > 0)
  26.       {
  27.          blink--;
  28.          if(blink / 3 == Math.round(blink / 3))
  29.          {
  30.             charClip.frame._alpha = 20;
  31.          }
  32.          else
  33.          {
  34.             charClip.frame._alpha = 70;
  35.          }
  36.       }
  37.       else
  38.       {
  39.          charClip.frame._alpha = 100;
  40.       }
  41.       if(yspeed > -3)
  42.       {
  43.          lockon = true;
  44.       }
  45.       else
  46.       {
  47.          lockon = false;
  48.       }
  49.       if(_root.CanSwitchFludd == true)
  50.       {
  51.          if(!_root.KeySHIFT())
  52.          {
  53.             canChangeFludd = true;
  54.          }
  55.          if(_root.KeySHIFT() && canChangeFludd == true)
  56.          {
  57.             changeFludd = true;
  58.             canChangeFludd = false;
  59.          }
  60.          else
  61.          {
  62.             changeFludd = false;
  63.          }
  64.          if(attack == false)
  65.          {
  66.             _root.ChangeFludd();
  67.          }
  68.       }
  69.       if(_root.newstar == true && !(attackFrame == "Star" && attack == true) && _root.Playinglevel == 0)
  70.       {
  71.          attack = true;
  72.          attackFrame = "ExitPainting";
  73.       }
  74.       if(attackFrame == "Star")
  75.       {
  76.          _root.CameraZoom = 100;
  77.          if(yspeed > 7)
  78.          {
  79.             yspeed = yspeed * 0.95;
  80.          }
  81.       }
  82.       if(attackFrame == "frontflip" && attack == true && !_root.Fluddpow == "")
  83.       {
  84.          attack = false;
  85.       }
  86.       if(_root.LastFrameJumpPress == false && _root.KeyUP())
  87.       {
  88.          _root.JumpPress = 7;
  89.       }
  90.       else
  91.       {
  92.          _root.JumpPress--;
  93.       }
  94.       _root.LastFrameJumpPress = _root.KeyUP();
  95.       if(air == true)
  96.       {
  97.          if(Water == true)
  98.          {
  99.             if(_root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall / 2) * _root.coursescale / 100 + _root.Course._y,true))
  100.             {
  101.                if(attackFrame == "Star")
  102.                {
  103.                   yspeed = yspeed + _root.gravity / 3;
  104.                }
  105.                else if(_root.Metal !== true)
  106.                {
  107.                   yspeed = yspeed + _root.gravity / 3;
  108.                }
  109.                else
  110.                {
  111.                   yspeed = yspeed + _root.gravity / 2;
  112.                }
  113.             }
  114.             yspeed = _root.groundFriction(yspeed,0.05,1.01);
  115.          }
  116.          else
  117.          {
  118.             yspeed = yspeed + _root.gravity;
  119.             if(_root.PowerTimer && _root.WingCap == true && yspeed > 3)
  120.             {
  121.                yspeed = yspeed - _root.gravity / 6;
  122.                fallingyspeed = _root.groundFriction(yspeed,_root.gravity / 4.5,1.07);
  123.             }
  124.             else
  125.             {
  126.                fallingyspeed = _root.groundFriction(yspeed,_root.gravity / 5,1.05);
  127.             }
  128.             if(yspeed > 0)
  129.             {
  130.                if(attack == false && yspeed > 7)
  131.                {
  132.                   fallcount++;
  133.                   if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
  134.                   {
  135.                      fallcount = 0;
  136.                      hurtfallcount--;
  137.                      hurtfallcount = Math.max(hurtfallcount,0);
  138.                   }
  139.                   if(fallingyspeed >= 15 && air == true && yspeed > 15 && fallingsfx !== true)
  140.                   {
  141.                      hurtfallcount++;
  142.                      hurtfallcount = Math.min(hurtfallcount,7);
  143.                      if(hurtfallcount >= 5)
  144.                      {
  145.                         fallingsfx = true;
  146.                         _root.Mariosound = new Sound(this);
  147.                         _root.Mariosound.attachSound("Mario-Fall");
  148.                         _root.Mariosound.start(0,1);
  149.                         _root.Mariosound.setVolume(_root.MarioVolume);
  150.                      }
  151.                   }
  152.                }
  153.                else
  154.                {
  155.                   fallcount = Math.round(fallcount / 2);
  156.                }
  157.                yspeed = _root.groundFriction(yspeed,_root.gravity / 5,1.05);
  158.             }
  159.             else
  160.             {
  161.                fallcount = 0;
  162.                hurtfallcount--;
  163.                hurtfallcount = Math.max(hurtfallcount,0);
  164.             }
  165.          }
  166.          yspeed = _root.groundFriction(yspeed,0,1.001);
  167.          xspeed = _root.groundFriction(xspeed,0,1.001);
  168.          if(attack == false)
  169.          {
  170.             if(Water == false)
  171.             {
  172.                if(yspeed > 2)
  173.                {
  174.                   frame = 4;
  175.                }
  176.                else
  177.                {
  178.                   frame = 3;
  179.                }
  180.             }
  181.             if(!_root.KeyDOWN() && !_root.KeyZ() || air == false)
  182.             {
  183.                divewaitcount = divewaitcount - 3;
  184.             }
  185.             divewaitcount = divewaitcount - 1;
  186.             if(_root.KeyZ() && (Water == false || _root.Metal == true) && divewaitcount <= 0 && !_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true) && !_root.Course.BPlatforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true))
  187.             {
  188.                yspeed = 0;
  189.                xspeed = 0;
  190.                attack = true;
  191.                attackFrame = "Ground";
  192.             }
  193.             if(_root.KeyDOWN() && (Water == false || _root.Metal == true) && divewaitcount <= 0)
  194.             {
  195.                attack = true;
  196.                if(_xscale < 0)
  197.                {
  198.                   xspeed = xspeed - (xspeed - _root.Divespeed) / 5;
  199.                }
  200.                else
  201.                {
  202.                   xspeed = xspeed - (xspeed + _root.Divespeed) / 5;
  203.                }
  204.                if(_root.WingCap == true)
  205.                {
  206.                   attackFrame = "Flying";
  207.                   yspeed = yspeed * 0.5;
  208.                }
  209.                else
  210.                {
  211.                   attackFrame = "Dive";
  212.                   yspeed = yspeed + 3;
  213.                   if(_root.CurrentPlayer == "Mario")
  214.                   {
  215.                      soundj = "Mario-Dive";
  216.                   }
  217.                   if(_root.CurrentPlayer == "Luigi")
  218.                   {
  219.                      if(random(2) == 1)
  220.                      {
  221.                         soundj = "Luigi - Yah!";
  222.                      }
  223.                      else
  224.                      {
  225.                         soundj = "Luigi - Yuh!";
  226.                      }
  227.                   }
  228.                   _root.Mariosound = new Sound(this);
  229.                   _root.Mariosound.attachSound(soundj);
  230.                   _root.Mariosound.start(0,1);
  231.                   _root.Mariosound.setVolume(_root.MarioVolume);
  232.                }
  233.             }
  234.             if(_root.KeyRIGHT() && _root.Controll == true)
  235.             {
  236.                xspeed = xspeed - Math.min((xspeed - _root.airwalkspeed) / (_root.airmaxWalkspeed / 3),0);
  237.                _xscale = -100;
  238.                if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
  239.                {
  240.                   _rotation = _rotation + 5;
  241.                   xspeed = xspeed - Math.min((xspeed - _root.airwalkspeed) / _root.airmaxWalkspeed,0);
  242.                }
  243.             }
  244.             if(_root.KeyLEFT() && _root.Controll == true)
  245.             {
  246.                xspeed = xspeed - Math.max((xspeed + _root.airwalkspeed) / (_root.airmaxWalkspeed / 3),0);
  247.                _xscale = 100;
  248.                if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
  249.                {
  250.                   _rotation = _rotation - 5;
  251.                   xspeed = xspeed - Math.max((xspeed + _root.airwalkspeed) / _root.airmaxWalkspeed,0);
  252.                }
  253.             }
  254.             if(_root.KeyTapRIGHT() && !_root.KeyRIGHT() && _root.Controll == true)
  255.             {
  256.                xspeed = xspeed - Math.min((xspeed - _root.airtapspeed) / (_root.airmaxtapWalkspeed / 3),0);
  257.                _xscale = -100;
  258.                if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
  259.                {
  260.                   _rotation = _rotation + 5;
  261.                   xspeed = xspeed - Math.min((xspeed - _root.airtapspeed) / _root.airmaxtapWalkspeed,0);
  262.                }
  263.             }
  264.             if(_root.KeyTapLEFT() && !_root.KeyLEFT() && _root.Controll == true)
  265.             {
  266.                xspeed = xspeed - Math.max((xspeed + _root.airtapspeed) / (_root.airmaxtapWalkspeed / 3),0);
  267.                _xscale = 100;
  268.                if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
  269.                {
  270.                   _rotation = _rotation - 5;
  271.                   xspeed = xspeed - Math.max((xspeed + _root.airtapspeed) / _root.airmaxtapWalkspeed,0);
  272.                }
  273.             }
  274.          }
  275.          if(_root.KeyUP() && !_root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - 12) * _root.coursescale / 100 + _root.Course._y,true) && _root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true) && yspeed < 1 && yspeed > -5 && _root.Controll == true && Squish == false)
  276.          {
  277.             lockon = false;
  278.             yspeed = yspeed * 0.7;
  279.             yspeed = yspeed - _root.jumpspeed / 1.5;
  280.             _root.Mariosound = new Sound(this);
  281.             _root.Mariosound.attachSound("sound - Splash");
  282.             _root.Mariosound.start(0,1);
  283.             _root.Mariosound.setVolume(_root.MarioVolume);
  284.             _root.Course.FrontGFX.attachMovie("Med-Splash","Med-Splash" + _root.Course.FrontGFX.getNextHighestDepth(),_root.Course.FrontGFX.getNextHighestDepth(),{_x:_X - _root.Course.FrontGFX._x,_y:_Y - _root.Course.FrontGFX._y});
  285.             frame = 3;
  286.          }
  287.          runcount = 0;
  288.          runtap = "";
  289.       }
  290.       else
  291.       {
  292.          fallingsfx = false;
  293.          doublejumpcount--;
  294.          doublejumpcount = Math.max(doublejumpcount,0);
  295.          if(doublejumpcount == 0)
  296.          {
  297.             doublejump = 0;
  298.          }
  299.          if(_root.Course.Ice.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 3) * _root.coursescale / 100 + _root.Course._y,true))
  300.          {
  301.             Ice = true;
  302.          }
  303.          else
  304.          {
  305.             Ice = false;
  306.          }
  307.          if(_root.Course.Puddle.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 3) * _root.coursescale / 100 + _root.Course._y,true))
  308.          {
  309.             Puddle = true;
  310.          }
  311.          else
  312.          {
  313.             Puddle = false;
  314.          }
  315.          if(frame == 3 || frame == 4)
  316.          {
  317.             frame = 1;
  318.          }
  319.          _root.FallSquish();
  320.          yspeed = Math.min(0,yspeed);
  321.          if(Puddle == false && Ice == false && !(attackFrame == "Dive" && attack == true))
  322.          {
  323.             if(StunTime == 0)
  324.             {
  325.                xspeed = _root.groundFriction(xspeed,0.3,1.15);
  326.             }
  327.             else
  328.             {
  329.                xspeed = _root.groundFriction(xspeed,0.15,1.075);
  330.             }
  331.          }
  332.          else
  333.          {
  334.             if(attackFrame == "Dive" && attack == true && Ice == false && Puddle == false)
  335.             {
  336.                if(StunTime == 0)
  337.                {
  338.                   xspeed = _root.groundFriction(xspeed,0.2,1.05);
  339.                }
  340.                else
  341.                {
  342.                   xspeed = _root.groundFriction(xspeed,0.1,1.025);
  343.                }
  344.             }
  345.             if(attack == true && attackFrame == "Dive" && Ice == false && Puddle == true)
  346.             {
  347.                if(StunTime == 0)
  348.                {
  349.                   xspeed = _root.groundFriction(xspeed,0.1,1.015);
  350.                }
  351.             }
  352.             if(!(attack == true && attackFrame == "Dive") && Puddle == true)
  353.             {
  354.                if(StunTime == 0)
  355.                {
  356.                   xspeed = _root.groundFriction(xspeed,0.15,1.07);
  357.                }
  358.                else
  359.                {
  360.                   xspeed = _root.groundFriction(xspeed,0.075,1.035);
  361.                }
  362.             }
  363.             if(attack == true && attackFrame == "Dive" && Ice == true)
  364.             {
  365.                if(StunTime == 0)
  366.                {
  367.                   xspeed = _root.groundFriction(xspeed,0.04,1.007);
  368.                }
  369.                else
  370.                {
  371.                   xspeed = _root.groundFriction(xspeed,0.02,1.0035);
  372.                }
  373.             }
  374.             if(!(attack == true && attackFrame == "Dive") && Ice == true)
  375.             {
  376.                if(StunTime == 0)
  377.                {
  378.                   xspeed = _root.groundFriction(xspeed,0.05,1.01);
  379.                }
  380.                else
  381.                {
  382.                   xspeed = _root.groundFriction(xspeed,0.025,1.005);
  383.                }
  384.             }
  385.          }
  386.          if(Puddle == true)
  387.          {
  388.             _root.WaterAmount = _root.WaterAmount + 250;
  389.          }
  390.          _root.Power = _root.TotalPower;
  391.          runcount--;
  392.          if(runcount <= 0 || isNaN(runcount))
  393.          {
  394.             runcount = 0;
  395.             runtap = "";
  396.          }
  397.          if(attack == false && _root.Controll == true && spinattackcounter <= 1)
  398.          {
  399.             if(runtap == "")
  400.             {
  401.                if(_root.KeyRIGHT())
  402.                {
  403.                   runcount = 9;
  404.                   runtap = "R";
  405.                }
  406.                if(_root.KeyLEFT())
  407.                {
  408.                   runcount = 9;
  409.                   runtap = "L";
  410.                }
  411.             }
  412.             else
  413.             {
  414.                if(!_root.KeyRIGHT() && runtap == "R")
  415.                {
  416.                   runtap = "Right";
  417.                }
  418.                if(!_root.KeyLEFT() && runtap == "L")
  419.                {
  420.                   runtap = "Left";
  421.                }
  422.                if(_root.KeyRIGHT() && runtap == "Right")
  423.                {
  424.                   attack = true;
  425.                   attackFrame = "Run";
  426.                }
  427.                if(_root.KeyLEFT() && runtap == "Left")
  428.                {
  429.                   attack = true;
  430.                   attackFrame = "Run";
  431.                }
  432.             }
  433.          }
  434.          if(attack == false && _root.Controll == true)
  435.          {
  436.             if(_root.KeyRIGHT())
  437.             {
  438.                frame = 2;
  439.                if(Ice == true)
  440.                {
  441.                   xspeed = xspeed + _root.walkspeed / _root.IceAccel;
  442.                }
  443.                else if(Puddle == true)
  444.                {
  445.                   xspeed = xspeed + _root.walkspeed / _root.PuddleAccel;
  446.                }
  447.                else
  448.                {
  449.                   xspeed = xspeed + _root.walkspeed;
  450.                }
  451.                _xscale = -100;
  452.             }
  453.             if(_root.KeyLEFT())
  454.             {
  455.                frame = 2;
  456.                if(Ice == true)
  457.                {
  458.                   xspeed = xspeed - _root.walkspeed / _root.IceAccel;
  459.                }
  460.                else if(Puddle == true)
  461.                {
  462.                   xspeed = xspeed - _root.walkspeed / _root.PuddleAccel;
  463.                }
  464.                else
  465.                {
  466.                   xspeed = xspeed - _root.walkspeed;
  467.                }
  468.                _xscale = 100;
  469.             }
  470.             if(_root.KeyTapRIGHT() && !_root.KeyRIGHT())
  471.             {
  472.                frame = 2;
  473.                if(Ice == true)
  474.                {
  475.                   xspeed = xspeed + _root.tapwalkspeed / _root.IceAccel;
  476.                }
  477.                else if(Puddle == true)
  478.                {
  479.                   xspeed = xspeed + _root.tapwalkspeed / _root.PuddleAccel;
  480.                }
  481.                else
  482.                {
  483.                   xspeed = xspeed + _root.tapwalkspeed;
  484.                }
  485.                _xscale = -100;
  486.             }
  487.             if(_root.KeyTapLEFT() && !_root.KeyLEFT())
  488.             {
  489.                frame = 2;
  490.                if(Ice == true)
  491.                {
  492.                   xspeed = xspeed - _root.tapwalkspeed / _root.IceAccel;
  493.                }
  494.                else if(Puddle == true)
  495.                {
  496.                   xspeed = xspeed - _root.tapwalkspeed / _root.PuddleAccel;
  497.                }
  498.                else
  499.                {
  500.                   xspeed = xspeed - _root.tapwalkspeed;
  501.                }
  502.                _xscale = 100;
  503.             }
  504.             if(_root.KeyDOWN())
  505.             {
  506.                attack = true;
  507.                attackFrame = "Dive";
  508.             }
  509.          }
  510.          if(attack == true && _root.Course.Char.attackFrame !== "Land")
  511.          {
  512.             doublejump = 0;
  513.          }
  514.          if(attack == false)
  515.          {
  516.             if(_root.Metal == true && _root.JumpPress > 0 && _root.KeyUP() && _root.Controll == true && Squish == false && yspeed >= -3 && Water == true)
  517.             {
  518.                frame = 3;
  519.                attack = false;
  520.                lockon = false;
  521.                yspeed = Math.min((- _root.jumpspeed) * 1.25,yspeed);
  522.             }
  523.             if(_root.KeyUP() && _root.JumpPress > 0 && _root.Controll == true && Squish == false && yspeed >= -3 && Water == false)
  524.             {
  525.                attack = false;
  526.                lockon = false;
  527.                if(Puddle == true)
  528.                {
  529.                   _root.Mariosound = new Sound(this);
  530.                   _root.Mariosound.attachSound("step - Water");
  531.                   _root.Mariosound.start(0,1);
  532.                   _root.Mariosound.setVolume(_root.MarioVolume);
  533.                }
  534.                if(doublejump == 0)
  535.                {
  536.                   yspeed = Math.min(- _root.jumpspeed,yspeed);
  537.                   doublejumpcount = 9;
  538.                   if(_root.CurrentPlayer == "Mario")
  539.                   {
  540.                      if(random(2) == 1)
  541.                      {
  542.                         soundj = "Mario Jump-1";
  543.                      }
  544.                      else
  545.                      {
  546.                         soundj = "Mario Jump-1b";
  547.                      }
  548.                   }
  549.                   else if(_root.CurrentPlayer == "Luigi")
  550.                   {
  551.                      if(random(2) == 1)
  552.                      {
  553.                         soundj = "Luigi - Yah!";
  554.                      }
  555.                      else
  556.                      {
  557.                         soundj = "Luigi - Yuh!";
  558.                      }
  559.                   }
  560.                   _root.Mariosound = new Sound(this);
  561.                   _root.Mariosound.attachSound(soundj);
  562.                   _root.Mariosound.start(0,1);
  563.                   _root.Mariosound.setVolume(_root.MarioVolume);
  564.                }
  565.                else if(doublejump == 1)
  566.                {
  567.                   yspeed = Math.min(- _root.jumpspeed - 2.5,yspeed);
  568.                   doublejumpcount = 9;
  569.                   _root.Mariosound = new Sound(this);
  570.                   if(_root.CurrentPlayer == "Mario")
  571.                   {
  572.                      _root.Mariosound.attachSound("Mario Jump-2");
  573.                   }
  574.                   else
  575.                   {
  576.                      _root.Mariosound.attachSound("Luigi - Yoho!");
  577.                   }
  578.                   _root.Mariosound.start(0,1);
  579.                   _root.Mariosound.setVolume(_root.MarioVolume);
  580.                }
  581.                else if(Math.abs(xspeed) > 3)
  582.                {
  583.                   attack = true;
  584.                   attackFrame = "frontflip";
  585.                   yspeed = Math.min(- _root.jumpspeed - 5,yspeed);
  586.                   _root.Mariosound = new Sound(this);
  587.                   if(_root.CurrentPlayer == "Mario")
  588.                   {
  589.                      _root.Mariosound.attachSound("Mario Tripple Jump");
  590.                   }
  591.                   else
  592.                   {
  593.                      _root.Mariosound.attachSound("Luigi - Yahoo!");
  594.                   }
  595.                   _root.Mariosound.start(0,1);
  596.                   _root.Mariosound.setVolume(_root.MarioVolume);
  597.                   if(_xscale < 0)
  598.                   {
  599.                      xspeed = xspeed - (xspeed - 15) / 5;
  600.                   }
  601.                   else
  602.                   {
  603.                      xspeed = xspeed - (xspeed + 15) / 5;
  604.                   }
  605.                   doublejumpcount = 0;
  606.                   doublejump = -1;
  607.                }
  608.                if(doublejump >= 3)
  609.                {
  610.                   doublejump = 0;
  611.                }
  612.                doublejump++;
  613.                frame = 3;
  614.             }
  615.          }
  616.       }
  617.       spinattackcount--;
  618.       if(spinattackcount <= 0)
  619.       {
  620.          spinattackcount = 0;
  621.          spincount = 0;
  622.          spinattackcounter = 0;
  623.       }
  624.       if(_root.KeyRIGHT() && !_root.KeyLEFT())
  625.       {
  626.          if(spincount !== "R")
  627.          {
  628.             if(spinattackcounter < 1 || spinattackcount > 0)
  629.             {
  630.                spinattackcounter++;
  631.                spinattackcount = 15 - spinattackcounter * 3;
  632.             }
  633.          }
  634.          spincount = "R";
  635.       }
  636.       if(_root.KeyLEFT() && !_root.KeyRIGHT())
  637.       {
  638.          if(spincount !== "L")
  639.          {
  640.             if(spinattackcounter < 1 || spinattackcount > 0)
  641.             {
  642.                spinattackcounter++;
  643.                spinattackcount = 11 - spinattackcounter;
  644.             }
  645.          }
  646.          spincount = "L";
  647.       }
  648.       if((_root.KeySPIN() || spinattackcounter >= 4) && attack == false && yspeed > -3)
  649.       {
  650.          attackFrame = "Spin";
  651.          attack = true;
  652.          spinattackcount = 0;
  653.          spincount = 0;
  654.          spinattackcounter = 0;
  655.       }
  656.       if(spinattackcounter >= 3 && (attackFrame == "Spin" || attackFrame == "DiveSpin" || attackFrame == "SlingStar") && attack == true)
  657.       {
  658.          _root.Course.Char.charClip.speed = _root.Course.Char.charClip.speed * 0.8;
  659.          _root.Course.Char.charClip.speed = _root.Course.Char.charClip.speed + 15;
  660.          spinattackcount = 0;
  661.          spincount = 0;
  662.          spinattackcounter = 0;
  663.       }
  664.       if(_root.KeySPACE() && _root.Power >= 100 && _root.WaterAmount > 0 && _root.Fluddpow == "R")
  665.       {
  666.          _root.waterblast = true;
  667.       }
  668.       else
  669.       {
  670.          _root.waterblast = false;
  671.       }
  672.       if(Water == true && air == true && _root.Metal !== true)
  673.       {
  674.          fallcount = 0;
  675.          hurtfallcount--;
  676.          hurtfallcount = Math.max(hurtfallcount,0);
  677.          frame = "swim1";
  678.       }
  679.       if(Water == true && air == true && _root.Metal == true)
  680.       {
  681.          if(yspeed < 0)
  682.          {
  683.             frame = 3;
  684.          }
  685.          else
  686.          {
  687.             frame = 4;
  688.          }
  689.       }
  690.       if(swimup == true && attack == false && _root.Metal !== true && _root.Controll == true)
  691.       {
  692.          swimupcount++;
  693.          frame = "swim2";
  694.          if(!_root.KeyUP() && swimupcount > 5)
  695.          {
  696.             swimup = false;
  697.          }
  698.       }
  699.       if(attack == false && _root.Controll == true && _root.playpause == false)
  700.       {
  701.          if((_root.KeyUP() || _root.KeyTapUP()) && (air == true || Water == true && _root.playpause == false))
  702.          {
  703.             yspeed = yspeed - _root.risespeed;
  704.             if(Water == true)
  705.             {
  706.                yspeed = yspeed + _root.risespeed;
  707.                if(swimup == true)
  708.                {
  709.                   yspeed = yspeed - _root.risespeed * 2;
  710.                }
  711.                if(swimup == false && _root.Metal !== true)
  712.                {
  713.                   _root.Mariosound = new Sound(this);
  714.                   _root.Mariosound.attachSound("sound - Water");
  715.                   _root.Mariosound.start(0,1);
  716.                   _root.Mariosound.setVolume(_root.MarioVolume);
  717.                   swimupcount = 0;
  718.                   if(_root.KeyDOWN() || _root.KeyTapDOWN())
  719.                   {
  720.                      yspeed = yspeed - 4;
  721.                   }
  722.                   else
  723.                   {
  724.                      yspeed = yspeed - 6;
  725.                   }
  726.                   if(_root.KeyRIGHT())
  727.                   {
  728.                      xspeed = xspeed + 2;
  729.                   }
  730.                   if(_root.KeyLEFT())
  731.                   {
  732.                      xpseed = xpseed - 2;
  733.                   }
  734.                }
  735.                swimup = true;
  736.             }
  737.          }
  738.          if(_root.KeyDOWN() || _root.KeyTapDOWN())
  739.          {
  740.             yspeed = yspeed + _root.risespeed;
  741.             if(Water == true)
  742.             {
  743.                yspeed = yspeed + _root.risespeed * 2;
  744.             }
  745.          }
  746.          if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
  747.          {
  748.             lockon = false;
  749.             yspeed = yspeed * 0.8;
  750.             yspeed = yspeed - (_root.Hoverspeed * 10 - yspeed) / 10 * (_root.Power / 175 + 0.75);
  751.             _root.WaterAmount = _root.WaterAmount - 7;
  752.             _root.Power = _root.Power - 1.5;
  753.             xspeed = _root.groundFriction(xspeed,0.05,1.03);
  754.          }
  755.          if(_root.KeySPACE() && _root.Power >= 100 && _root.WaterAmount > 0 && _root.Fluddpow == "T")
  756.          {
  757.             _root.WaterAmount = _root.WaterAmount - 5;
  758.             if(air == false && Ice == false)
  759.             {
  760.                if(_xscale < 0)
  761.                {
  762.                   xspeed = xspeed - (xspeed - _root.turbospeed) / 30;
  763.                }
  764.                else
  765.                {
  766.                   xspeed = xspeed - (xspeed + _root.turbospeed) / 30;
  767.                }
  768.             }
  769.             else if(_xscale < 0)
  770.             {
  771.                xspeed = xspeed - (xspeed - _root.turbospeed / 2) / 30;
  772.             }
  773.             else
  774.             {
  775.                xspeed = xspeed - (xspeed + _root.turbospeed / 2) / 30;
  776.             }
  777.             if(Water == true && _root.playpause == false)
  778.             {
  779.                yspeed = yspeed - _root.gravity / 3;
  780.                if(_root.KeyUP() || _root.KeyTapUP())
  781.                {
  782.                   _rotation = _rotation + _xscale / 100 * 10;
  783.                   yspeed = yspeed - _root.gravity / 1.5;
  784.                }
  785.                if(_root.KeyDOWN() || _root.KeyTapDOWN())
  786.                {
  787.                   _rotation = _rotation - _xscale / 100 * 10;
  788.                   yspeed = yspeed + _root.gravity / 1.5;
  789.                }
  790.             }
  791.             if(Water == false && _root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true))
  792.             {
  793.                fallcount = 0;
  794.                hurtfallcount--;
  795.                hurtfallcount = Math.max(hurtfallcount,0);
  796.                if(_root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,_Y * _root.coursescale / 100 + _root.Course._y,true) && _root.playpause == false)
  797.                {
  798.                   yspeed = yspeed - _root.gravity / 5;
  799.                   _Y = _Y - 1;
  800.                }
  801.                waterrepeats = 0;
  802.                while(waterrepeats < Math.abs(xspeed) / 7 + random(2))
  803.                {
  804.                   _root.Course.FrontGFX.attachMovie("Run-Splash" + (random(2) + 1),"Run-Splash" + _root.Course.FrontGFX.getNextHighestDepth(),_root.Course.FrontGFX.getNextHighestDepth(),{_x:_X - _root.Course.FrontGFX._x + (waterrepeats - 1) / Math.round(xspeed) * 100,_y:_Y - _root.Course.FrontGFX._y});
  805.                   waterrepeats++;
  806.                }
  807.                _root.WaterAmount = _root.WaterAmount + 50;
  808.                yspeed = Math.min(0,yspeed);
  809.                if(!_root.KeyRIGHT() && !_root.KeyLEFT())
  810.                {
  811.                   xspeed = _root.groundFriction(xspeed,0.1,1.05);
  812.                }
  813.                if(_xscale < 0)
  814.                {
  815.                   xspeed = xspeed - (xspeed - _root.turbospeed / 2) / 30;
  816.                }
  817.                else
  818.                {
  819.                   xspeed = xspeed - (xspeed + _root.turbospeed / 2) / 30;
  820.                }
  821.                frame = 2;
  822.                if(_root.KeySPACE() && _root.KeyUP() && Squish == false)
  823.                {
  824.                   lockon = false;
  825.                   yspeed = Math.min(yspeed,(- _root.jumpspeed) / 1.5);
  826.                   frame = 3;
  827.                }
  828.             }
  829.          }
  830.       }
  831.       if((frame == "swim1" || frame == "swim2") && Water == false)
  832.       {
  833.          if(air == true)
  834.          {
  835.             frame = 4;
  836.          }
  837.          else
  838.          {
  839.             frame = 1;
  840.          }
  841.       }
  842.       if(attackFrame !== "Star")
  843.       {
  844.          if(_root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,_Y * _root.coursescale / 100 + _root.Course._y,true))
  845.          {
  846.             if(_root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall) * _root.coursescale / 100 + _root.Course._y,true) && _root.playpause == false)
  847.             {
  848.                underwatercount++;
  849.                if(underwatercount > _root.WaterDrownSpeed && _root.Metal !== true)
  850.                {
  851.                   _root.Course.FrontGFX.attachMovie("WaterBubble","Bubble" + _root.Course.FrontGFX.getNextHighestDepth(),_root.Course.FrontGFX.getNextHighestDepth(),{_x:_X - _root.Course.FrontGFX._x,_y:_Y - _root.Course.FrontGFX._y - tall * 0.75});
  852.                   _root.Mariosound = new Sound(this);
  853.                   _root.Mariosound.attachSound("sound - Drain");
  854.                   _root.Mariosound.start(0,1);
  855.                   _root.Mariosound.setVolume(_root.MarioVolume);
  856.                   _root.WaterHP--;
  857.                   if(_root.WaterHP <= 0 && !(attack == true && attackFrame == "Drown"))
  858.                   {
  859.                      attack = true;
  860.                      attackFrame = "Drown";
  861.                   }
  862.                   _root.WaterHP = Math.max(_root.WaterHP,0);
  863.                   underwatercount = 0;
  864.                }
  865.             }
  866.             else if(_root.playpause == false)
  867.             {
  868.                abovewatercount++;
  869.                if(abovewatercount > _root.WaterHealSpeed)
  870.                {
  871.                   abovewatercount = 0;
  872.                   _root.WaterHP = _root.WaterHP + 1;
  873.                   _root.WaterHP = Math.min(_root.WaterHP,8);
  874.                }
  875.             }
  876.          }
  877.       }
  878.       if(Water == true)
  879.       {
  880.          _root.WaterAmount = _root.WaterAmount + 500;
  881.          _root.Power = _root.Power + 3;
  882.          yspeed = _root.groundFriction(yspeed,0.05,1.1);
  883.          xspeed = _root.groundFriction(xspeed,0.05,1.05);
  884.       }
  885.       else
  886.       {
  887.          underwatercount = 0;
  888.          abovewatercount++;
  889.          if(abovewatercount > _root.WaterHealSpeed)
  890.          {
  891.             abovewatercount = 0;
  892.             _root.WaterHP = _root.WaterHP + 1;
  893.             _root.WaterHP = Math.min(_root.WaterHP,8);
  894.          }
  895.       }
  896.       if(attack == true && (attackFrame == "Dive" || attackFrame == "frontflip"))
  897.       {
  898.          if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "S")
  899.          {
  900.             _root.WaterAmount = _root.WaterAmount - 5;
  901.             _root.Power = _root.Power - 1;
  902.          }
  903.          if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
  904.          {
  905.             _root.WaterAmount = _root.WaterAmount - 7;
  906.             _root.Power = _root.Power - 1.5;
  907.             yspeed = yspeed * 0.98;
  908.             xspeed = xspeed * 0.97;
  909.             if(air == true)
  910.             {
  911.                yspeed = yspeed - Math.sin(_root.angleToRadians(_root.DiveRot)) * _root.Hoverspeed;
  912.                if(_xscale > 0)
  913.                {
  914.                   xspeed = xspeed - Math.cos(_root.angleToRadians(_root.DiveRot)) * _root.Hoverspeed / 2;
  915.                }
  916.                else
  917.                {
  918.                   xspeed = xspeed + Math.cos(_root.angleToRadians(_root.DiveRot)) * _root.Hoverspeed / 2;
  919.                }
  920.             }
  921.             else if(_xscale > 0)
  922.             {
  923.                xspeed = xspeed - Math.cos(_root.angleToRadians(_root.DiveRot)) * _root.Hoverspeed;
  924.             }
  925.             else
  926.             {
  927.                xspeed = xspeed + Math.cos(_root.angleToRadians(_root.DiveRot)) * _root.Hoverspeed;
  928.             }
  929.          }
  930.          if(_root.KeySPACE() && _root.Power >= 100 && _root.WaterAmount > 0 && _root.Fluddpow == "T")
  931.          {
  932.             _root.WaterAmount = _root.WaterAmount - 10;
  933.             yspeed = yspeed - Math.sin(_root.angleToRadians(_root.DiveRot - 90)) / 2;
  934.             if(_xscale > 0)
  935.             {
  936.                xspeed = xspeed - Math.cos(_root.angleToRadians(_root.DiveRot - 90)) / 2;
  937.             }
  938.             else
  939.             {
  940.                xspeed = xspeed + Math.cos(_root.angleToRadians(_root.DiveRot - 90)) / 2;
  941.             }
  942.          }
  943.       }
  944.       if(_root.Course.Lava.hitTest(_X * _root.coursescale / 100 + _root.Course._x,_Y * _root.coursescale / 100 + _root.Course._y,true) && _root.CharHP >= 0 && !((attackFrame == "Fall" || attackFrame == "Respawn" || attackFrame == "Faint" || attackFrame == "Drown" || attackFrame == "Pause" || attackFrame == "none" || attackFrame == "Squish") && attack == true || _root.Metal == true || _root.Invincible == true) && _root.playpause == false && _root.Course.Char.yspeed > -3)
  945.       {
  946.          _root.Course.Char.blink = 0;
  947.          _root.MarioHit(3,20,0,0,20,"none");
  948.          if(_root.CharHP >= 0)
  949.          {
  950.             _root.Course.Char.yspeed = Math.min(-16,_root.Course.Char.yspeed);
  951.             attack = true;
  952.             attackFrame = "Lava";
  953.          }
  954.          else
  955.          {
  956.             _root.Course.Char.attack = true;
  957.             _root.Course.Char.attackFrame = "Faint";
  958.          }
  959.          while(_root.Course.Lava.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 1) * _root.coursescale / 100 + _root.Course._y,true))
  960.          {
  961.             _Y = _Y - 1;
  962.          }
  963.       }
  964.       _root.AntiSquish = Math.max(_root.AntiSquish,0);
  965.       if(_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall) * _root.coursescale / 100 + _root.Course._y,true) && _root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,_Y * _root.coursescale / 100 + _root.Course._y,true) && air == false && !((attackFrame == "Fall" || attackFrame == "Respawn" || attackFrame == "Faint" || attackFrame == "Drown" || attackFrame == "Pause") && attack == true) && (!_root.Course.Platforms.invisground.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true) && (!_root.Course.Platforms.invisground.hitTest(_root.Course.Char._x * _root.coursescale / 100 + _root.Course._x,_root.Course.Char._y * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true) && _root.playpause == false && _root.AntiSquish-- <= 0)
  966.       {
  967.          while(_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 100) * _root.coursescale / 100 + _root.Course._y,true))
  968.          {
  969.             _yscale = _yscale - 1;
  970.          }
  971.          if(_yscale < 70 && _root.CharHP >= 1 && !(attack == true && attackFrame == "Squish"))
  972.          {
  973.             _root.CharHP = _root.CharHP - 2;
  974.             _root.hpcoincount = 0;
  975.             xspeed = 0;
  976.             yspeed = 0;
  977.             attack = true;
  978.             attackFrame = "Squish";
  979.          }
  980.          if(attack == true && attackFrame == "Squish")
  981.          {
  982.             _yscale = 100;
  983.          }
  984.          Squish = true;
  985.       }
  986.       else if(!_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall) * _root.coursescale / 100 + _root.Course._y,true))
  987.       {
  988.          Squish = false;
  989.          _yscale = _yscale + 5;
  990.          _yscale = Math.min(_yscale,100);
  991.       }
  992.       if(_root.playpause == true && Water == true)
  993.       {
  994.          yspeed = 0;
  995.       }
  996.       if(!_root.KeySPACE() && _root.Fluddpow !== "H")
  997.       {
  998.          _root.Power = _root.Power + 1;
  999.       }
  1000.       repeats = Math.ceil((Math.abs(yspeed) + Math.abs(xspeed)) / 5);
  1001.       if(isNaN(repeats))
  1002.       {
  1003.          repeats = 0;
  1004.       }
  1005.       repeats = Math.min(repeats,50);
  1006.       repeats = Math.max(repeats,1);
  1007.       i = 1;
  1008.       while(i <= repeats)
  1009.       {
  1010.          if(_root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall / 4) * _root.coursescale / 100 + _root.Course._y,true))
  1011.          {
  1012.             if(Water == false)
  1013.             {
  1014.                if(yspeed > 7)
  1015.                {
  1016.                   yspeed = yspeed * 0.7;
  1017.                   _root.Course.FrontGFX.attachMovie("Med-Splash","Med-Splash" + _root.Course.FrontGFX.getNextHighestDepth(),_root.Course.FrontGFX.getNextHighestDepth(),{_x:_X - _root.Course.FrontGFX._x,_y:_Y - _root.Course.FrontGFX._y});
  1018.                   _root.Mariosound = new Sound(this);
  1019.                   _root.Mariosound.attachSound("sound - Splash");
  1020.                   _root.Mariosound.start(0,1);
  1021.                   _root.Mariosound.setVolume(_root.MarioVolume);
  1022.                }
  1023.                yspeed = yspeed * 0.9;
  1024.             }
  1025.             Water = true;
  1026.             doublejump = 0;
  1027.          }
  1028.          else
  1029.          {
  1030.             Water = false;
  1031.          }
  1032.          if(_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,_Y * _root.coursescale / 100 + _root.Course._y,true) && (!_root.Course.Platforms.invisground.hitTest(_X * _root.coursescale / 100 + _root.Course._x,_Y * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true) || _root.Course.BPlatforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,_Y * _root.coursescale / 100 + _root.Course._y,true))
  1033.          {
  1034.             air = false;
  1035.             if(yspeed < 16)
  1036.             {
  1037.                landtime = Math.round(fallcount / 8) - 2;
  1038.                if(_root.KeyUP())
  1039.                {
  1040.                   landtime = landtime - 3;
  1041.                   if((_root.KeyRIGHT() || _root.KeyLEFT()) && landtime >= 1)
  1042.                   {
  1043.                      landtime = landtime - 2;
  1044.                      landtime = Math.max(landtime,1);
  1045.                   }
  1046.                }
  1047.                landtime = landtime - Math.min(Math.abs(xspeed / 1.5),3);
  1048.                if(yspeed > 3 && landtime > 0 && attack == false)
  1049.                {
  1050.                   landtime = Math.max(landtime,1);
  1051.                   landtime = Math.min(landtime,3);
  1052.                   attack = true;
  1053.                   attackFrame = "land";
  1054.                }
  1055.                if(yspeed > 3 && landtime < 1 && attack == false && _root.KeyUP())
  1056.                {
  1057.                   landtime = 1;
  1058.                   attack = true;
  1059.                   attackFrame = "land";
  1060.                }
  1061.             }
  1062.             fallcount = 0;
  1063.             hurtfallcount--;
  1064.             hurtfallcount = Math.max(hurtfallcount,0);
  1065.             _root.FallSquish();
  1066.             yspeed = Math.min(0,yspeed);
  1067.          }
  1068.          else
  1069.          {
  1070.             air = true;
  1071.          }
  1072.          while(_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - 3) * _root.coursescale / 100 + _root.Course._y,true) && !(Squish == true && (_yscale < 70 || attack == true && attackFrame == "Squish")) && (!_root.Course.Platforms.invisground.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - 3) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true) || _root.Course.BPlatforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - 3) * _root.coursescale / 100 + _root.Course._y,true) && yspeed >= -3)
  1073.          {
  1074.             _Y = _Y - 1;
  1075.             if(!(attack == true && attackFrame == "Dive"))
  1076.             {
  1077.                xspeed = xspeed * 0.98;
  1078.             }
  1079.             else
  1080.             {
  1081.                xspeed = xspeed * 0.997;
  1082.             }
  1083.             _root.FallSquish();
  1084.             yspeed = Math.min(0,yspeed);
  1085.          }
  1086.          if(Water == true)
  1087.          {
  1088.             lockon = false;
  1089.          }
  1090.          if(lockon == true)
  1091.          {
  1092.             while(_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true) && !_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - 1) * _root.coursescale / 100 + _root.Course._y,true) && (!_root.Course.Platforms.invisground.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true))
  1093.             {
  1094.                _Y = _Y + 1;
  1095.                if(!(attack == true && attackFrame == "Dive"))
  1096.                {
  1097.                   xspeed = xspeed * 0.98;
  1098.                }
  1099.                else
  1100.                {
  1101.                   xspeed = xspeed * 0.998;
  1102.                }
  1103.                frame = 2;
  1104.             }
  1105.             while(_root.Course.BPlatforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true) && !_root.Course.BPlatforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - 1) * _root.coursescale / 100 + _root.Course._y,true) && yspeed >= -3)
  1106.             {
  1107.                _Y = _Y + 1;
  1108.                if(!(attack == true && attackFrame == "Dive"))
  1109.                {
  1110.                   xspeed = xspeed * 0.98;
  1111.                }
  1112.                else
  1113.                {
  1114.                   xspeed = xspeed * 0.998;
  1115.                }
  1116.                frame = 2;
  1117.             }
  1118.          }
  1119.          if(!(Squish == true && (_yscale < 70 || attack == true && attackFrame == "Squish")))
  1120.          {
  1121.             while(_root.Course.Platforms.hitTest((_X + wide - 1) * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 200) * _root.coursescale / 100 + _root.Course._y,true) && (!_root.Course.Platforms.invisground.hitTest((_X + wide - 1) * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 200) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true))
  1122.             {
  1123.                _X = _X - 1;
  1124.             }
  1125.             while(_root.Course.Platforms.hitTest((_X - wide + 1) * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 200) * _root.coursescale / 100 + _root.Course._y,true) && (!_root.Course.Platforms.invisground.hitTest((_X - wide + 1) * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 200) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true))
  1126.             {
  1127.                _X = _X + 1;
  1128.             }
  1129.          }
  1130.          if(_root.Course.Platforms.hitTest((_X + wide) * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 200) * _root.coursescale / 100 + _root.Course._y,true) && (!_root.Course.Platforms.invisground.hitTest((_X + wide) * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 200) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true))
  1131.          {
  1132.             if(Math.abs(xspeed) > 11 && (attack == false || attackFrame == "Run" || attackFrame == "Flying") || attack == true && (attackFrame == "Run" || attackFrame == "Flying") && Math.abs(xspeed) > 5 || attack == true && attackFrame == "Lava" && Math.abs(xspeed) > 4 && air == false && Water == false || attack == true && attackFrame == "Flying" && Math.abs(xspeed) > 3 && air == false && Water == false)
  1133.             {
  1134.                _root.HitWall();
  1135.             }
  1136.             else if(_root.KeyRIGHT())
  1137.             {
  1138.                xspeed = Math.min(xspeed,(- xspeed) * _root.bounce);
  1139.                xspeed = _root.groundFriction(xspeed,3,1);
  1140.             }
  1141.             else
  1142.             {
  1143.                xspeed = Math.min(xspeed - 1,(- xspeed) * _root.bounce);
  1144.             }
  1145.          }
  1146.          if(_root.Course.Platforms.hitTest((_X - wide) * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 200) * _root.coursescale / 100 + _root.Course._y,true) && (!_root.Course.Platforms.invisground.hitTest((_X - wide) * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 200) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true))
  1147.          {
  1148.             if(Math.abs(xspeed) > 11 && (attack == false || attackFrame == "Run" || attackFrame == "Flying") || attack == true && (attackFrame == "Run" || attackFrame == "Flying") && Math.abs(xspeed) > 5 || attack == true && attackFrame == "Lava" && Math.abs(xspeed) > 4 && air == false && Water == false || attack == true && attackFrame == "Flying" && Math.abs(xspeed) > 3 && air == false && Water == false)
  1149.             {
  1150.                _root.HitWall();
  1151.             }
  1152.             else if(_root.KeyLEFT())
  1153.             {
  1154.                xspeed = Math.min(xspeed,(- xspeed) * _root.bounce);
  1155.                xspeed = _root.groundFriction(xspeed,3,1);
  1156.             }
  1157.             else
  1158.             {
  1159.                xspeed = Math.max(xspeed + 1,(- xspeed) * _root.bounce);
  1160.             }
  1161.          }
  1162.          if(_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall + 1) * _root.coursescale / 100 + _root.Course._y,true) && (!_root.Course.Platforms.invisground.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall - 1) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true))
  1163.          {
  1164.             _root.FallSquish();
  1165.             yspeed = Math.max(yspeed,-3);
  1166.          }
  1167.          if(Squish == false || _root.Course.Char.yspeed < -1)
  1168.          {
  1169.             while(_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall * _yscale / 100) * _root.coursescale / 100 + _root.Course._y,true) && (!_root.Course.Platforms.invisground.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall) * _root.coursescale / 100 + _root.Course._y,true) || _root.Invisible !== true))
  1170.             {
  1171.                _Y = _Y + 1;
  1172.             }
  1173.          }
  1174.          if(_root.Course.Edge.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall / 2) * _root.coursescale / 100 + _root.Course._y,true) && !((attackFrame == "Fall" || attackFrame == "Respawn" || attackFrame == "Faint" || attackFrame == "Drown" || attackFrame == "Pause") && attack == true) && _root.playpause == false)
  1175.          {
  1176.             attack = true;
  1177.             attackFrame = "Fall";
  1178.          }
  1179.          _X = _X + xspeed / repeats;
  1180.          _Y = _Y + yspeed / repeats;
  1181.          i++;
  1182.       }
  1183.       if(air == false)
  1184.       {
  1185.          _root.CharRotationCode();
  1186.       }
  1187.       else
  1188.       {
  1189.          icedive = false;
  1190.          if(attack == false || attackFrame !== "SlingStar")
  1191.          {
  1192.             _rotation = _root.groundFriction(_rotation,3,1.3);
  1193.          }
  1194.       }
  1195.       if(attack == false || attackFrame !== "SlingStar")
  1196.       {
  1197.          _rotation = Math.max(_rotation,-30);
  1198.          _rotation = Math.min(_rotation,30);
  1199.       }
  1200.       if(_root.CharHP <= 0 && !((attackFrame == "Fall" || attackFrame == "Respawn" || attackFrame == "Faint" || attackFrame == "Drown" || attackFrame == "Pause" || attackFrame == "none" || attackFrame == "hurt1" || attackFrame == "hurt2" || attackFrame == "hurt3") && attack == true) && _root.playpause == false)
  1201.       {
  1202.          attack = true;
  1203.          attackFrame = "Faint";
  1204.          _yscale = 100;
  1205.       }
  1206.       if(_root.Invisible == true)
  1207.       {
  1208.          if(_root.Course.Platforms.invisground.hitTest(_root.Course.Char._x * _root.coursescale / 100 + _root.Course._x,(_root.Course.Char._y - _root.Course.Char.tall / 2) * _root.coursescale / 100 + _root.Course._y,true) || _root.Course.Platforms.invisground.hitTest(_root.Course.Char._x * _root.coursescale / 100 + _root.Course._x,(_root.Course.Char._y - _root.Course.Char.tall) * _root.coursescale / 100 + _root.Course._y,true) || _root.Course.Platforms.invisground.hitTest((_root.Course.Char._x + _root.Course.Char.wide) * _root.coursescale / 100 + _root.Course._x,(_root.Course.Char._y - _root.Course.Char.tall / 2) * _root.coursescale / 100 + _root.Course._y,true) || _root.Course.Platforms.invisground.hitTest((_root.Course.Char._x - _root.Course.Char.wide) * _root.coursescale / 100 + _root.Course._x,(_root.Course.Char._y - _root.Course.Char.tall / 2) * _root.coursescale / 100 + _root.Course._y,true))
  1209.          {
  1210.             _root.PowerTimer = Math.max(_root.PowerTimer,2);
  1211.             if(_root.PowerTimer < 32)
  1212.             {
  1213.                _root.PowerTimer = _root.PowerTimer + 4;
  1214.             }
  1215.          }
  1216.       }
  1217.       if(_root.CurrentPlayer == "Mario")
  1218.       {
  1219.          if(_root.PowerTimer > 160 || Math.round(_root.PowerTimer / Math.round(_root.PowerTimer / 32)) % 2 == 0)
  1220.          {
  1221.             if(_root.Metal == true && _root.Invincible !== true)
  1222.             {
  1223.                _root.Course.Char.gotoAndStop(2);
  1224.             }
  1225.             if(_root.Invisible == true)
  1226.             {
  1227.                if(_root.Metal !== true && _root.Invincible !== true)
  1228.                {
  1229.                   _root.Course.Char.gotoAndStop(1);
  1230.                }
  1231.                _root.Course.Char._alpha = 50;
  1232.             }
  1233.             if(_root.Invincible == true)
  1234.             {
  1235.                if(_root.Metal !== true)
  1236.                {
  1237.                   _root.Course.Char.gotoAndStop(3);
  1238.                }
  1239.                else
  1240.                {
  1241.                   _root.Course.Char.gotoAndStop(4);
  1242.                }
  1243.             }
  1244.          }
  1245.          else
  1246.          {
  1247.             _root.Course.Char._alpha = 100;
  1248.             _root.Course.Char.gotoAndStop(1);
  1249.          }
  1250.          _root.jumpspeed = _root.Mariojumpspeed;
  1251.       }
  1252.       if(_root.CurrentPlayer == "Luigi")
  1253.       {
  1254.          if(_root.PowerTimer > 160 || Math.round(_root.PowerTimer / Math.round(_root.PowerTimer / 32)) % 2 == 0)
  1255.          {
  1256.             if(_root.Metal == true)
  1257.             {
  1258.                _root.Course.Char.gotoAndStop(6);
  1259.             }
  1260.             if(_root.Invisible == true)
  1261.             {
  1262.                if(_root.Metal !== true && _root.Invincible !== true)
  1263.                {
  1264.                   _root.Course.Char.gotoAndStop(5);
  1265.                }
  1266.                _root.Course.Char._alpha = 50;
  1267.             }
  1268.             if(_root.Invincible == true)
  1269.             {
  1270.                if(_root.Metal !== true)
  1271.                {
  1272.                   _root.Course.Char.gotoAndStop(7);
  1273.                }
  1274.                else
  1275.                {
  1276.                   _root.Course.Char.gotoAndStop(8);
  1277.                }
  1278.             }
  1279.          }
  1280.          else
  1281.          {
  1282.             _root.Course.Char._alpha = 100;
  1283.             _root.Course.Char.gotoAndStop(5);
  1284.          }
  1285.          _root.jumpspeed = _root.Luigijumpspeed;
  1286.       }
  1287.       if(_root.Metal !== true && Puddle == false && _root.changestep-- < 0)
  1288.       {
  1289.          _root.StepSound = _root.defaultstep;
  1290.       }
  1291.       else if(_root.Metal == true)
  1292.       {
  1293.          _root.StepSound = "step-metalcap";
  1294.       }
  1295.       else if(Puddle == true)
  1296.       {
  1297.          _root.StepSound = "step - Water";
  1298.       }
  1299.       if(_root.Metal == true || _root.Invisible == true || _root.Invincible == true || _root.WingCap == true)
  1300.       {
  1301.          if(_root.Invincible == true)
  1302.          {
  1303.             _root.Course.Enemyhurt.attachMovie("EnemyHurtBox","Box" + _root.Course.Enemyhurt.getNextHighestDepth(),_root.Course.Enemyhurt.getNextHighestDepth(),{_x:_X - _root.Course.BackGFX._x,_y:_Y - _root.Course.BackGFX._y - 20,_yscale:100,_xscale:60,time:3});
  1304.          }
  1305.          _root.PowerTimer = _root.PowerTimer - 1;
  1306.          if(_root.PowerTimer <= 0)
  1307.          {
  1308.             _root.Metal = false;
  1309.             _root.Invisible = false;
  1310.             _root.Invincible = false;
  1311.             _root.WingCap = false;
  1312.             _root.PowerTimer = 0;
  1313.             _root.PlayMusicAndIntro();
  1314.          }
  1315.       }
  1316.       if((attackFrame == "Fall" || attackFrame == "Respawn" || attackFrame == "Faint" || attackFrame == "Drown" || attackFrame == "Pause" || attackFrame == "Squish" || attackFrame == "Sign" || attackFrame == "Item" || attackFrame == "Key" || attackFrame == "Door" || attackFrame == "FarDoor" || attackFrame == "FrontDoor" || attackFrame == "BigDoor" || attackFrame == "Painting" || attackFrame == "DiveSpin" || attackFrame == "grabbed" || attackFrame == "WarpPipe" || attackFrame == "Lava" || attackFrame == "hurt1" || attackFrame == "hurt2" || attackFrame == "hurt3" || attackFrame == "land" || attackFrame == "EJump" || attackFrame == "bosscinema" || attackFrame == "Talk" || attackFrame == "UnlockDoor" || attackFrame == "Run" || attackFrame == "SlingStar" || attackFrame == "Ground" || attackFrame == "Flying") && attack == true || _root.playpause == true || attackFrame == "none")
  1317.       {
  1318.          if(attackFrame !== "Lava" && attackFrame !== "hurt1" && attackFrame !== "hurt2" && attackFrame !== "hurt3" && attackFrame !== "land" && attackFrame !== "EJump" && attackFrame !== "Run" && attackFrame !== "SlingStar" && attackFrame !== "Ground" && attackFrame !== "Flying" && attack == true || _root.playpause == true || attackFrame == "none")
  1319.          {
  1320.             yspeed = - _root.gravity;
  1321.             if(Water == true)
  1322.             {
  1323.                yspeed = 0;
  1324.             }
  1325.             xspeed = 0;
  1326.          }
  1327.          if(_root.playpause == false || attackFrame == "bosscinema" || attackFrame == "Talk" || attackFrame == "UnlockDoor")
  1328.          {
  1329.             charClip.gotoAndStop(attackFrame);
  1330.          }
  1331.       }
  1332.       else if(attack == false)
  1333.       {
  1334.          charClip.gotoAndStop(_root.Fluddpow + frame);
  1335.       }
  1336.       else
  1337.       {
  1338.          charClip.gotoAndStop(_root.Fluddpow + attackFrame);
  1339.       }
  1340.       _root.CharXscale = _root.Course.Char._xscale;
  1341.    }
  1342. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement