コード例 #1
0
ファイル: Pivot.cs プロジェクト: mwaitzman/TussleOverdrive
    public override void stateTransitions()
    {
        base.stateTransitions();
        //These classes will be phased out as time goes on. Until then, we need to just exit early if we're in the builder since these don't actually use Subactions
        if (isInBuilder)
        {
            return;
        }
        StateTransitions.StopState(actor.GetAbstractFighter());
        StateTransitions.CheckGround(actor.GetAbstractFighter());

        //(key, invkey) = _actor.getForwardBackwardKeys()
        //if (self.direction == 1 and _actor.sprite.flip == "left") or(self.direction == -1 and _actor.sprite.flip == "right"):
        //    _actor.sprite.flipX()

        AbstractFighter fighter = actor.GetAbstractFighter();

        if (current_frame == last_frame)
        {
            if (fighter.KeyHeld("Forward"))
            {
                if (fighter.CheckSmash("ForwardSmash"))
                {
                    actor.SendMessage("doAction", "Dash");
                }
                else
                {
                    actor.SendMessage("doAction", "Move");
                }
            }
            else if (fighter.KeyHeld("Backward"))
            {
                actor.SendMessage("flip");
                if (fighter.CheckSmash("BackwardSmash"))
                {
                    actor.SendMessage("doAction", "Dash");
                }
                else
                {
                    actor.SendMessage("doAction", "Move");
                }
            }
            else
            {
                actor.SendMessage("doAction", "NeutralAction");
            }
        }
    }
コード例 #2
0
    public static void CrouchGetupState(AbstractFighter actor)
    {
        if (actor.KeyBuffered("Shield"))
        {
            //TODO forward backward roll
        }
        if (actor.KeyBuffered("Attack"))
        {
            if (actor.CheckSmash("DownSmash"))
            {
                actor.doAction("DownSmash");
            }
            else
            {
                actor.doAction("DownAttack");
            }
        }

        if (actor.KeyBuffered("Special"))
        {
            actor.doAction("DownSpecial");
        }
        if (actor.KeyBuffered("Jump"))
        {
            actor.doAction("Jump");
        }
    }
コード例 #3
0
 public static void MoveState(AbstractFighter actor)
 {
     if (actor.CheckSmash("ForwardSmash"))
     {
         actor.doAction("Dash");
     }
     //float direction = actor.GetControllerAxis("Horizontal") * actor.facing;
     //shield
     if (actor.KeyBuffered("Attack"))
     {
         actor.doGroundAttack();
     }
     if (actor.KeyBuffered("Special"))
     {
         actor.doGroundSpecial();
     }
     if (actor.KeyBuffered("Jump"))
     {
         actor.doAction("Jump");
     }
     // else if (actor.DirectionHeld("Down"))
     //     actor.doAction("Crouch");
     else if (actor.GetAxis("Horizontal") == 0.0f)
     {
         actor.doAction("Stop");
     }
     if (actor.KeyBuffered(InputTypeUtil.GetBackward(actor.getBattleObject())))
     {
         actor.SendMessage("flip"); //TODO PIVOT
     }
     //Two other kinds of stop? Not sure if these are needed
 }