Ejemplo n.º 1
0
 public static void CrouchState(AbstractFighter actor)
 {
     //The getup state has everything we need, except for actually calling "getup" so we use that, and then add our extra bit at the end
     CrouchGetupState(actor);
     if (!actor.DirectionHeld("Down"))
     {
         actor.doAction("CrouchGetup");
     }
 }
Ejemplo n.º 2
0
 public static void CheckLedges(AbstractFighter actor)
 {
     if (!actor.LedgeLock) //If the lock is active, no need to bother calculating anything
     {
         foreach (Ledge ledge in actor.GetLedges())
         {
             if (!actor.DirectionHeld("Down"))
             {
                 if ((ledge.grabSide == Ledge.Side.LEFT) && actor.DirectionHeld("Right"))
                 {
                     ledge.SendMessage("FighterGrabs", actor);
                 }
                 else if ((ledge.grabSide == Ledge.Side.RIGHT) && actor.DirectionHeld("Left"))
                 {
                     ledge.SendMessage("FighterGrabs", actor);
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
    public static void NeutralState(AbstractFighter actor)
    {
        //shield
        if (actor.KeyBuffered("Attack"))
        {
            actor.doGroundAttack();
        }
        if (actor.KeyBuffered("Special"))
        {
            actor.doGroundSpecial();
        }
        if (actor.KeyBuffered("Jump"))
        {
            actor.doAction("Jump");
        }
        //if (actor.KeyBuffered("Shield"))
        //    actor.doAction("Shield");
        // if (actor.DirectionHeld("Down"))
        //     actor.doAction("Crouch");
        if (actor.DirectionHeld("Forward"))
        {
            actor.doAction("Move");
        }
        if (actor.DirectionHeld("Backward"))
        {
            actor.SendMessage("flip"); //TODO PIVOT
            actor.doAction("Move");
        }

        /*
         * if (actor.GetControllerAxis("Horizontal") != 0.0f)
         * {
         *  float direction = actor.GetControllerAxis("Horizontal");
         *  if (direction * actor.facing < 0.0f) //If the movement and facing do not match
         *      actor.flip();
         *  actor.doAction("Move");
         * }
         */
    }
Ejemplo n.º 4
0
 public static void LedgeState(AbstractFighter actor)
 {
     /*
      * (key,invkey) = _actor.getForwardBackwardKeys()
      * _actor.setSpeed(0, _actor.getFacingDirection())
      * if _actor.keyHeld('shield'):
      * _actor.ledge_lock = True
      * _actor.doAction('LedgeRoll')
      * elif _actor.keyHeld('attack'):
      * _actor.ledge_lock = True
      * _actor.doAction('LedgeAttack')
      * elif _actor.keyHeld('jump'):
      * _actor.ledge_lock = True
      * apply_invuln = statusEffect.TemporaryHitFilter(_actor,hurtbox.Intangibility(_actor),6)
      * apply_invuln.activate()
      * _actor.doAction('Jump')
      * elif _actor.keyHeld(key):
      * _actor.ledge_lock = True
      * _actor.doAction('LedgeGetup')
      * elif _actor.keyHeld(invkey):
      * _actor.ledge_lock = True
      * apply_invuln = statusEffect.TemporaryHitFilter(_actor,hurtbox.Intangibility(_actor),6)
      * apply_invuln.activate()
      * _actor.doAction('Fall')
      * elif _actor.keyHeld('down'):
      * _actor.ledge_lock = True
      * apply_invuln = statusEffect.TemporaryHitFilter(_actor,hurtbox.Intangibility(_actor),6)
      * apply_invuln.activate()
      * _actor.doAction('Fall')
      */
     if (actor.KeyBuffered("Jump"))
     {
         actor.doAction("Jump");
     }
     else if (actor.DirectionHeld("Backward"))
     {
         actor.doAction("Fall");
     }
 }