GlovePIE:MAME/MAME32 - Mortal Kombat

From WiiLi

Jump to: navigation, search


The following is an algorithm for the original Mortal Kombat written for GlovePIE. The control is mapped for M.A.M.E and support an enhanced special moves control. You have to select the character you want to fight with on your wiimote. You select the character by pressing 1 and 2 to change.

Contents

[edit] Wiimote Setup

Controls Setup
Controls Setup

[edit] Accessory

The Nunchuk is mandatory to control the character. The DPad is reserved for fighting.

[edit] Button Mapping

[edit] Wiimote

[edit] Classic attacks
       Left: HIGH PUNCH
       Right: LOW KICK
       Up: HIGH KICK
       Down: LOW PUNCH        
[edit] Enhanced attacks
       A+Down: Uppercut
       A+(else) : Low Kick
[edit] Switch character profile
       1: Switch Previous character' moves list
       2: Switch Next character' moves list
[edit] Emulator controls
       Minus: P1 Coin
       Home: M.A.M.E Throttle
       Plus: P1 Start
[edit] Specials
       B+Swing wiimote in the opponent direction: Weapon attack
       B+nunchuk C+Swing wiimote in the opponent direction*: body attack  
       (*Swing away with Scorpion)
       B+Swing wiimote down: Johnny Cage: Ball Breaker, Raiden: Teleport, Sonya: Leg Grab

[edit] Nunchuk

       Thumbstick: Character' movements
       Z: BLOCK
       C+Z: Pause Emulator
       Nunchuk C+ WiimoteDPAD in the opponent direction: FATALITY  


[edit] Moves List

[edit] Johnny Cage

LED:(o,x,x,x)


Green Bolt: Hold B + Swing the Wiimote in the opponent direction.

Shadow Kick: Hold B + Hold Nunchuk C + Swing the Wiimote in the opponent direction.

Ball Breaker: Hold B + Swing the Wiimote down.


FATALITY (Close): Hold Nunchuk C + DPAD in the opponent direction.


[edit] Kano

LED:(o,o,x,x)


Knife Throw: Hold B + Swing the Wiimote in the opponent direction.

Spin Attack: Hold B + Hold Nunchuk C + Swing the Wiimote in the opponent direction.


FATALITY: Hold Nunchuk C + DPAD in the opponent direction.


[edit] Raiden

LED:(o,o,o,x)


Lightning: Hold B + Swing the Wiimote in the opponent direction.

Torpedo: Hold B + Hold Nunchuk C + Swing the Wiimote in the opponent direction.

Teleport: Hold B + Swing the Wiimote down.


FATALITY: Hold Nunchuk C + DPAD in the opponent direction.


[edit] Liu Kang

LED:(o,o,o,o)


Fireball: Hold B + Swing the Wiimote in the opponent direction.

Flying Kick: Hold B + Hold Nunchuk C + Swing the Wiimote in the opponent direction.


FATALITY: Hold Nunchuk C + DPAD in the opponent direction.


[edit] Scorpion

LED:(x,o,o,o)


Spear: Hold B + Swing the Wiimote in the opponent direction.

Teleport: Hold B + Hold Nunchuk C + Swing the Wiimote away from the opponent.


FATALITY: Hold Nunchuk C + DPAD in the opponent direction.


[edit] Sub-Zero

LED:(x,x,o,o)


Ice Freeze: Hold B + Swing the Wiimote in the opponent direction.

Slide: Hold B + Hold Nunchuk C + Swing the Wiimote in the opponent direction.


FATALITY: Hold Nunchuk C + DPAD in the opponent direction.


[edit] Sonya

LED:(x,x,x,o)


Ring Toss: Hold B + Swing the Wiimote in the opponent direction.

Square Flight: Hold B + Hold Nunchuk C + Swing the Wiimote in the opponent direction.

Leg Grab: Hold B + Swing the Wiimote down.


FATALITY: Hold Nunchuk C + DPAD in the opponent direction.

[edit] GlovePIE Script

/*******************************************************************/
// This code must be use with the original Mortal Kombat (on MAME*)
// Tested on MAME32
// Created by Marc-Andre Larouche
// marclar83@gmail.com
// The Nunchuk is mandatory.
// Version 0.2
// tested on GlovePIE 0.29
// September 2007
/********************************************************************/

  //////////Emulator mapping////////////
   Key.one = Wiimote.Plus;
   Key.Five = Wiimote.Minus;
   Key.F10 = Wiimote.Home;
   //
   //! Pause (Nunchuk C+Z)
   if Wiimote.Nunchuk.CButton == true and Wiimote.Nunchuk.ZButton == true then
      Key.P = true;
      Wait 0.5seconds
      Key.P = false;
   end if
   //
   //! DPAD Mapping (default Left:HIGH PUNCH, Right:LOW KICK)
   //!    (FATALITIES Left+Nunchuk C:Fatality to opponent on your left)
   if Wiimote.Left == true and Wiimote.Nunchuk.CButton == true and Var.LeftK != true then
     Var.LeftK = true;
     Var.Fatality = "Left";
   else if Wiimote.Left == true and Wiimote.Nunchuk.CButton != true and Var.LeftK != true then
     Var.LeftK = true;
     Key.LeftAlt = true;
   else if Wiimote.Left != true and Var.LeftK == true then
     Var.LeftK = false;
     Key.LeftAlt = false;
     Var.Fatality = "";
   end if
   //
   //!    (FATALITIES Right+Nunchuk C:Fatality to opponent on your Right)
   if Wiimote.Right == true and Wiimote.Nunchuk.CButton == true and Var.RightK != true then
     Var.RightK = true;
     Var.Fatality = "Right";
   else if Wiimote.Right == true and Wiimote.Nunchuk.CButton != true and Var.RightK != true then
     Var.RightK = true;
     Key.Z = true;
   else if Wiimote.Right != true and Var.RightK == true then
     Var.RightK = false;
     Key.Z = false;
     Var.Fatality = "";
   end if
   //
   //! DPAD Mapping (Down:LOW PUNCH, Up:HIGH KICK)
   Key.LeftShift = Wiimote.Down;
   Key.LeftControl = Wiimote.Up;
   //! Z Nunchuk: BLOCK
   Key.Space = Wiimote.Nunchuk.ZButton;
    //////////script initialization////////////
   if Var.init != true then
     Var.init= true;
     Var.cpt = 0;
     Var.command = "";
     Var.charChange = true;
     //! Character moves (default:Cage)
     // 0: Johnny Cage, 1: Kano , 2: Rayden,
     // 3: Liu Kang, 4: Scorpion, 5: SubZero, 6: Sonya
     Var.char = 0;
   end if
   //! Switch Character
   //! One: Previous Character
   if Wiimote.one == true and Var.one != true then
   Var.one = true;
   Var.charChange = true;
     if Var.char == 0 then
        Var.char = 6;
     else
        Var.char--;
     end if
   end if
   if Wiimote.one != true and Var.one == true then
     Var.one = false;
   end if
   //! Two: Next Character
   if Wiimote.two == true and Var.two != true then
   Var.two = true;
   Var.charChange = true;
     if Var.char == 6 then
        Var.char = 0;
     else
        Var.char++;
     end if
   end if
   if Wiimote.two != true and Var.two == true then
     Var.two = false;
   end if
   //! Switch LED to indicate selected moves list
   //! Johnny Cage LED configuration (o,x,x,x)
   if Var.char == 0 and Var.charChange == true then
       Wiimote.Led1 = true;
       Wiimote.Led2 = false;
       Wiimote.Led3 = false;
       Wiimote.Led4 = false;
       Var.charChange = false;
   end if
   //! Kano LED configuration (o,o,x,x)
   if Var.char == 1 and Var.charChange == true then
       Wiimote.Led1 = true;
       Wiimote.Led2 = true;
       Wiimote.Led3 = false;
       Wiimote.Led4 = false;
       Var.charChange = false;
   end if
   //! Raiden LED configuration (o,o,o,x)
   if Var.char == 2 and Var.charChange == true then
       Wiimote.Led1 = true;
       Wiimote.Led2 = true;
       Wiimote.Led3 = true;
       Wiimote.Led4 = false;
       Var.charChange = false;
   end if
   //! Liu Kang LED configuration (o,o,o,o)
   if Var.char == 3 and Var.charChange == true then
       Wiimote.Led1 = true;
       Wiimote.Led2 = true;
       Wiimote.Led3 = true;
       Wiimote.Led4 = true;
       Var.charChange = false;
   end if
   //! Scorpion LED configuration (x,o,o,o)
   if Var.char == 4 and Var.charChange == true then
       Wiimote.Led1 = false;
       Wiimote.Led2 = true;
       Wiimote.Led3 = true;
       Wiimote.Led4 = true;
       Var.charChange = false;
   end if
   //! Sub-Zero LED configuration (x,x,o,o)
   if Var.char == 5 and Var.charChange == true then
       Wiimote.Led1 = false;
       Wiimote.Led2 = false;
       Wiimote.Led3 = true;
       Wiimote.Led4 = true;
       Var.charChange = false;
   end if
   //! Sonya LED configuration (x,x,x,o)
   if Var.char == 6 and Var.charChange == true then
       Wiimote.Led1 = false;
       Wiimote.Led2 = false;
       Wiimote.Led3 = false;
       Wiimote.Led4 = true;
       Var.charChange = false;
   end if
     //
     //////////Special moves "B" button////////////
     if Wiimote.B == true and Var.cmd != true then
        Var.cmd = true;
        Var.cpt = 0;
        Var.command = "";
        Var.Prev = false;
     end if
     if Wiimote.B == true and Var.cmd == true then
        Var.cpt++;
     end if
     if Wiimote.B != true and Var.cmd == true then
        Var.cmd = false;
     end if
     //! Reset after delay
     if Var.cpt >= 25 and Var.cmd == true then
        Var.command = "";
        Var.cpt = 0;
        Var.Prev = false;
     end if
     //
     //////////Context A button////////////
     if (Var.Joy1Down_en != true and Wiimote.A == true and Wiimote.B != true and Var.Context != true) then
       Var.Context = true;
       Var.KContext = "Z";
       Key.Z = true;
     end if

     if (Var.Joy1Down_en == true and Wiimote.A == true and Wiimote.B != true and Var.Context != true) then
       Var.Context = true;
       Var.KContext = "LeftAlt";
       Key.LeftAlt = true;
     end if

     if Wiimote.A != true and Var.Context == true then
       if Var.KContext == "LeftAlt" then
          Key.LeftAlt = false;
       else
          Key.Z = false;
       end if
       Var.KContext = "";
       Var.Context = false;
     end if
     //
     //////////Motions recongnition////////////
     if Wiimote.gx >= 1.0 and Var.Prev != true and Var.cmd == true then
     Var.Prev = true;
        Var.command = "R";
     end if
     if Wiimote.gx <= -1.0 and Var.Prev != true and Var.cmd == true then
     Var.Prev = true;
        Var.command = "L";
     end if
     if Wiimote.gy <= -1.25 and Var.Prev != true and Var.cmd == true then
     Var.Prev = true;
        Var.command = "D";
     end if
     //
     //////////Special moves Execution////////////
     /**************
      Johnny Cage
     **************/
     if Var.char == 0 and Var.command == "R" then
        if Wiimote.Nunchuk.CButton != true then
          //  Green Bolt: B, F, LP
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.LeftShift = true;
          wait 0.05seconds;
          Key.LeftShift = false;
        else  //  Shadow Kick: B, F, LK
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.Z = true;
          wait 0.05seconds;
          Key.Z = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
      if Var.char == 0 and Var.command == "L" then
        if Wiimote.Nunchuk.CButton != true then
          //  Green Bolt: B, F, LP
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.LeftShift = true;
          wait 0.05seconds;
          Key.LeftShift = false;
        else
          //  Shadow Kick: B, F, LK
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.Z = true;
          wait 0.05seconds;
          Key.Z = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
     //  Ball Breaker: BL + LP
     if Var.char == 0 and Var.command == "D" and Wiimote.Nunchuk.CButton != true then
        Space+LeftShift = true;
        wait 0.05seconds;
        Key.Space = false;
        Key.LeftShift = false;
        Var.command = ""
        Var.cpt = 0;
      end if
        //  Fatality:  F, F, F, HP(Close)
     if Var.char == 0 and  Var.Fatality == "Right" then
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        Key.LeftAlt = true;
        wait 0.05seconds;
        Key.LeftAlt = false;
        Var.Fatality = "Done";
      end if
        //  Fatality:  F, F, F, HP(Close)
     if Var.char == 0 and  Var.Fatality == "Left" then
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        Key.LeftAlt = true;
        wait 0.05seconds;
        Key.LeftAlt = false;
        Var.Fatality = "Done";
      end if
       /**************
            Kano
       **************/
     if Var.char == 1 and Var.command == "R" then
        if Wiimote.Nunchuk.CButton != true then
          //  Knife Throw: Hold Block, B, F
          Key.Space = true;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.Space = false;
        else
          //  Spin Attack: Back from opponent, then circle counter clockwise.
          Key.Right = true;
          wait 0.01seconds;
          Key.Down = true;
          wait 0.01seconds;
          Key.Right = false;
          wait 0.01seconds;
          Key.Left = true;
          wait 0.01seconds;
          Key.Down = false;
          wait 0.01seconds;
          Key.Up = true;
          wait 0.01seconds;
          Key.Left = false;
          wait 0.01seconds;
          Key.Right = true;
          wait 0.01seconds;
          Key.Up = false;
          wait 0.01seconds;
          Key.Right = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
      if Var.char == 1 and Var.command == "L" then
        if Wiimote.Nunchuk.CButton != true then
          //  Knife Throw: Hold Block, B, F
          Key.Space = true;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.Space = false;
        else
          //  Spin Attack: Back from opponent, then circle counter clockwise.
          Key.Left = true;
          wait 0.01seconds;
          Key.Down = true;
          wait 0.01seconds;
          Key.Left = false;
          wait 0.01seconds;
          Key.Right = true;
          wait 0.01seconds;
          Key.Down = false;
          wait 0.01seconds;
          Key.Up = true;
          wait 0.01seconds;
          Key.Right = false;
          wait 0.01seconds;
          Key.Left = true;
          wait 0.01seconds;
          Key.Up = false;
          wait 0.01seconds;
          Key.Left = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
        //  Fatality: B, D, F, LP (close)
      if Var.char == 1 and  Var.Fatality == "Right" then
        Key.Left = true;
        wait 0.25seconds;
        Key.Left = false;
        Key.Down = true;
        wait 0.25seconds;
        Key.Down = false;
        Key.Right = true;
        wait 0.25seconds;
        Key.Right = false;
        Key.LeftShift = true;
        wait 0.25seconds;
        Key.LeftShift = false;
        Var.Fatality = "Done";
      end if
        //  Fatality: B, D, F, LP (close)
     if Var.char == 1 and  Var.Fatality == "Left" then
        Key.Right = true;
        wait 0.25seconds;
        Key.Right = false;
        Key.Down = true;
        wait 0.25seconds;
        Key.Down = false;
        Key.Left = true;
        wait 0.25seconds;
        Key.Left = false;
        Key.LeftShift = true;
        wait 0.25seconds;
        Key.LeftShift = false;
        Var.Fatality = "Done";
      end if
       /**************
           Raiden
       **************/
     if Var.char == 2 and Var.command == "R" then
        if Wiimote.Nunchuk.CButton != true then
          //  Lightning: D, F, LP
          Key.Down = true;
          wait 0.02seconds;
          Key.Down = false;
          Key.Right = true;
          wait 0.02seconds;
          Key.Right = false;
          Key.LeftShift = true;
          wait 0.02seconds;
          Key.LeftShift = false;
        else
          //  Torpedo: B, B, F
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          wait 0.03seconds;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          wait 0.03seconds;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
      if Var.char == 2 and Var.command == "L" then
        if Wiimote.Nunchuk.CButton != true then
          //  Lightning: D, F, LP
          Key.Down = true;
          wait 0.02seconds;
          Key.Down = false;
          Key.Left = true;
          wait 0.02seconds;
          Key.Left = false;
          Key.LeftShift = true;
          wait 0.02seconds;
          Key.LeftShift = false;
        else
          //  Torpedo: B, B, F
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          wait 0.03seconds;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          wait 0.03seconds;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
        // Teleport: D, Up
     if Var.char == 2 and Var.command == "D" and Wiimote.Nunchuk.CButton != true then
        Key.Down = true;
        wait 0.02seconds;
        Key.Down = false;
        Key.Up = true;
        wait 0.02seconds;
        Key.Up = false;
        Var.command = ""
        Var.cpt = 0;
      end if
        //  Fatality: F, B, B, B, HP (close)
     if Var.char == 2 and  Var.Fatality == "Right" then
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        Key.LeftAlt = true;
        wait 0.05seconds;
        Key.LeftAlt = false;
        Var.Fatality = "Done";
      end if
        //  Fatality: F, B, B, B, HP (close)
     if Var.char == 2 and  Var.Fatality == "Left" then
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        Key.LeftAlt = true;
        wait 0.05seconds;
        Key.LeftAlt = false;
        Var.Fatality = "Done";
      end if
       /**************
           Liu Kang
       **************/
     if Var.char == 3 and Var.command == "R" then
        if Wiimote.Nunchuk.CButton != true then
          //  Fireball: F, F, HP
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          wait 0.02seconds;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.LeftAlt = true;
          wait 0.02seconds;
          Key.LeftAlt = false;
        else
          //  Flying Kick: F, F, HK
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          wait 0.02seconds;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.LeftControl = true;
          wait 0.02seconds;
          Key.LeftControl = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
      if Var.char == 3 and Var.command == "L" then
        if Wiimote.Nunchuk.CButton != true then
          //  Fireball: F, F, HP
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          wait 0.02seconds;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.LeftAlt = true;
          wait 0.02seconds;
          Key.LeftAlt = false;
        else
          //  Flying Kick: F, F, HK
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          wait 0.02seconds;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.LeftControl = true;
          wait 0.02seconds;
          Key.LeftControl = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
     //  Fatality: Rotate Counter-clockwise F
     if Var.char == 3 and  Var.Fatality == "Right" then
        Key.Space = true;
        Key.Up = true;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.02seconds;
        Key.Up = false;
        wait 0.02seconds;
        Key.Down = true;
        wait 0.02seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.02seconds;
        Key.Down = false;
        wait 0.02seconds;
        Key.Up = true;
        wait 0.02seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Up = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.02seconds;
        Key.Up = false;
        wait 0.02seconds;
        Key.Down = true;
        wait 0.02seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.02seconds;
        Key.Down = false;
        wait 0.02seconds;
        Key.Up = true;
        wait 0.02seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Up = false;
        Key.Space = false;
        Var.Fatality = "Done";
      end if
        //  Fatality: Rotate Counter-clockwise F
     if Var.char == 3 and  Var.Fatality == "Left" then
        Key.Space = true;
        Key.Up = true;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.02seconds;
        Key.Up = false;
        wait 0.02seconds;
        Key.Down = true;
        wait 0.02seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.02seconds;
        Key.Down = false;
        wait 0.02seconds;
        Key.Up = true;
        wait 0.02seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Up = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.02seconds;
        Key.Up = false;
        wait 0.02seconds;
        Key.Down = true;
        wait 0.02seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.02seconds;
        Key.Down = false;
        wait 0.02seconds;
        Key.Up = true;
        wait 0.02seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Up = false;
        Key.Space = false;
        Var.Fatality = "Done";
      end if
       /**************
           Scorpion
       **************/
     if Var.char == 4 and Var.command == "R" then
        if Wiimote.Nunchuk.CButton != true then
          //  Spear: B, B, LP
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          wait 0.02seconds;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.LeftShift = true;
          wait 0.05seconds;
          Key.LeftShift = false;
        else
          //  Teleport: D, B, HP
          Key.Down = true;
          wait 0.05seconds;
          Key.Down = false;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.LeftAlt = true;
          wait 0.05seconds;
          Key.LeftAlt = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
      if Var.char == 4 and Var.command == "L" then
        if Wiimote.Nunchuk.CButton != true then
          //  Spear: B, B, LP
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          wait 0.02seconds;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.LeftShift = true;
          wait 0.05seconds;
          Key.LeftShift = false;
        else
          //  Teleport: D, B, HP
          Key.Down = true;
          wait 0.05seconds;
          Key.Down = false;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.LeftAlt = true;
          wait 0.05seconds;
          Key.LeftAlt = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
        //  Fatality: Hold BL, Up, Up (1/2 screen)
     if Var.char == 4 and  (Var.Fatality == "Right" or Var.Fatality == "Left") then
        Key.Space = true;
        Key.Up = true;
        wait 0.05seconds;
        Key.Up = false;
        wait 0.02seconds;
        Key.Up = true;
        wait 0.05seconds;
        Key.Up = false;
        Key.Space = false;
        Var.Fatality = "Done";
      end if
      /**************
           Sub Zero
       **************/
     if Var.char == 5 and Var.command == "R" then
        if Wiimote.Nunchuk.CButton != true then
          //  Ice Freeze: D, F, LP
          Key.Down = true;
          wait 0.02seconds;
          Key.Down = false;
          Key.Right = true;
          wait 0.02seconds;
          Key.Right = false;
          Key.LeftShift = true;
          wait 0.02seconds;
          Key.LeftShift = false;
          else
          //  Slide: Hold B + LP + LK + BL
          Left+Space+LeftShift+Z = true;
          wait 0.05seconds;
          Left+Space+LeftShift+Z = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
      if Var.char == 5 and Var.command == "L" then
        if Wiimote.Nunchuk.CButton != true then
          //  Ice Freeze: D, F, LP
          Key.Down = true;
          wait 0.02seconds;
          Key.Down = false;
          Key.Left = true;
          wait 0.02seconds;
          Key.Left = false;
          Key.LeftShift = true;
          wait 0.02seconds;
          Key.LeftShift = false;
        else
          //  Slide: Hold B + LP + LK + BL
          Right+Space+LeftShift+Z = true;
          wait 0.05seconds;
          Right+Space+LeftShift+Z = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
        //  FFatality: F, D, F, HP (close)
     if Var.char == 5 and Var.Fatality == "Right"  then
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        Key.Down = true;
        wait 0.05seconds;
        Key.Down = false;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        Key.LeftAlt = true;
        wait 0.05seconds;
        Key.LeftAlt = false;
        Var.Fatality = "Done";
      end if
        //  FFatality: F, D, F, HP (close)
      if Var.char == 5 and Var.Fatality == "Left"  then
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        Key.Down = true;
        wait 0.05seconds;
        Key.Down = false;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        Key.LeftAlt = true;
        wait 0.05seconds;
        Key.LeftAlt = false;
        Var.Fatality = "Done";
      end if
       /**************
           Sonya
       **************/
     if Var.char == 6 and Var.command == "R" then
        if Wiimote.Nunchuk.CButton != true then
          //  Ring Toss: B, LP
          Key.Left = true;
          wait 0.02seconds;
          Key.LeftShift = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.LeftShift = false;
          wait 0.03seconds;
          Key.Left = true;
          wait 0.02seconds;
          Key.LeftShift = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.LeftShift = false;
        else
          //  Square Flight: F, B, HP
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.LeftAlt = true;
          wait 0.05seconds;
          Key.LeftAlt = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
      if Var.char == 6 and Var.command == "L" then
        if Wiimote.Nunchuk.CButton != true then
          //  Ring Toss: B + LP
          Key.Right = true;
          wait 0.01seconds;
          Key.LeftShift = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.LeftShift = false;
          wait 0.02seconds;
          Key.Right = true;
          wait 0.01seconds;
          Key.LeftShift = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.LeftShift = false;
        else
          //  Square Flight: F, B, HP
          Key.Left = true;
          wait 0.05seconds;
          Key.Left = false;
          Key.Right = true;
          wait 0.05seconds;
          Key.Right = false;
          Key.LeftAlt = true;
          wait 0.05seconds;
          Key.LeftAlt = false;
        end if
        Var.command = ""
        Var.cpt = 0;
      end if
     //  Leg Grab: D + BL + LP + LK
     if Var.char == 6 and Var.command == "D" and Wiimote.Nunchuk.CButton != true then
        Space+LeftShift+Z+Down = true;
        wait 0.05seconds;
        Space+LeftShift+Z+Down = false;
        Var.command = ""
        Var.cpt = 0;
      end if
     //  Fatality: F, F, B, B, BL
     if Var.char == 6 and Var.Fatality == "Right"  then
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        Key.Space = true;
        wait 0.05seconds;
        Key.Space = false;
        Var.Fatality = "Done";
      end if
      //  Fatality: F, F, B, B, BL
      if Var.char == 6 and Var.Fatality == "Left"  then
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        wait 0.02seconds;
        Key.Left = true;
        wait 0.05seconds;
        Key.Left = false;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        wait 0.02seconds;
        Key.Right = true;
        wait 0.05seconds;
        Key.Right = false;
        Key.Space = true;
        wait 0.05seconds;
        Key.Space = false;
        Var.Fatality = "Done";
      end if
     //
     //! nunchuck analog stick mapped to the character' displacement
        Key.left = Wiimote.Nunchuk.JoyX <= -25%
        Key.right = Wiimote.Nunchuk.JoyX >= 25%
        Key.up = Wiimote.Nunchuk.JoyY <= -25%
        Key.down = Wiimote.Nunchuk.JoyY >= 25%
Personal tools