Ejemplo n.º 1
0
            public override void Enter(int frameIndex, IState previousState)
            {
                jumpDir = FightingGameInputCodeDir.None;
                GivenInput(fgChar.GivenCombinations());

                switch (jumpDir)
                {
                case FightingGameInputCodeDir.UpBack:
                    Debug.Log("Jump Impulse:(7) " + jumpImpulse);
                    jumpImpulse = jump7Impulse;
                    break;

                case FightingGameInputCodeDir.Up:
                    Debug.Log("Jump Impulse:(8) " + jumpImpulse);
                    jumpImpulse = jump8Impulse;
                    break;

                case FightingGameInputCodeDir.UpForward:
                    Debug.Log("Jump Impulse:(9) " + jumpImpulse);
                    jumpImpulse = jump9Impulse;
                    break;

                default:
                    Debug.Log("Jump didn't have a dirPress");
                    break;
                }
                fgChar.Play("jump_start");
                startFrame    = frameIndex;
                frameCount    = 0;
                leavingGround = true;
            }
            public FightingGameInputCodeDir MapAbsoluteToRelative(FightingGameAbsInputCodeDir absInput)
            {
                //horizontal = ((((x - 1) mod 3) - 1) * orientation + 1);
                //vertical = floor((x - 1) / 3) * 3 + 1
                FightingGameInputCodeDir temp = (FightingGameInputCodeDir)(((int)absInput - 1) / 3 * 3 + 1 + (int)(((((int)absInput - 1) % 3) - 1) * screenOrientation.x + 1));

                //if (id == 0) Debug.Log((int) temp);
                return(temp);
            }
            public Vector3 RelativeInputToLocal(FightingGameInputCodeDir relInput, bool upJump)
            {
                int forwardBackward = (((int)relInput) - 1) % 3 - 1;
                int upDown          = (((int)relInput) - 1) / 3 - 1;

                Vector3 worldInput = new Vector3(forwardBackward, upDown, 0);

                if (!upJump)
                {
                    worldInput = Quaternion.Euler(90f, 0, 0) * worldInput;
                }

                // This sure is arbitrary... I'm not sure I have the vectors correctly set up so
                //   the part that mirrors across from side to side is the Z-axis???
                worldInput.z *= screenOrientation.x;

                //if (id == 0) Debug.Log((Quaternion.Euler(0.0f, -90.0f, 0.0f) * worldInput).ToString("F3"));

                return(Quaternion.Euler(0.0f, -90.0f, 0.0f) * worldInput);
            }
Ejemplo n.º 4
0
 private void GivenDirectionCurrent(Action stop, Combination combo)
 {
     jumpDir = fgChar.MapAbsoluteToRelative(((DirectionCurrent)combo).direction);
 }
Ejemplo n.º 5
0
 private void OnDirectionPress(Action stop, Combination combo)
 {
     direction = fgChar.MapAbsoluteToRelative(((DirectionPress)combo).direction);
 }
 public FightingGameAbsInputCodeDir MapRelativeToAbsolute(FightingGameInputCodeDir relInput)
 {
     return((FightingGameAbsInputCodeDir)(int)MapAbsoluteToRelative((FightingGameAbsInputCodeDir)(int)relInput));
 }
            private InputNotation SelectInputNotation(FightingGameInputCodeBut button, FightingGameInputCodeDir direction)
            {
                InputNotation notation = InputNotation.None;

                switch (button)
                {
                case FightingGameInputCodeBut.A:
                    switch (direction)
                    {
                    case FightingGameInputCodeDir.Neutral:
                    case FightingGameInputCodeDir.None:
                        notation = InputNotation._5A;
                        break;

                    case FightingGameInputCodeDir.DownBack:
                    case FightingGameInputCodeDir.Down:
                    case FightingGameInputCodeDir.DownForward:
                        notation = InputNotation._2A;
                        break;

                    default:
                        notation = InputNotation._5A;
                        break;
                    }
                    break;

                case FightingGameInputCodeBut.B:
                    switch (direction)
                    {
                    case FightingGameInputCodeDir.Neutral:
                    case FightingGameInputCodeDir.None:
                        notation = InputNotation._5B;
                        break;

                    case FightingGameInputCodeDir.DownBack:
                    case FightingGameInputCodeDir.Down:
                    case FightingGameInputCodeDir.DownForward:
                        notation = InputNotation._2B;
                        break;

                    default:
                        notation = InputNotation._5B;
                        break;
                    }
                    break;

                case FightingGameInputCodeBut.C:
                    switch (direction)
                    {
                    case FightingGameInputCodeDir.Neutral:
                    case FightingGameInputCodeDir.None:
                        notation = InputNotation._5C;
                        break;

                    case FightingGameInputCodeDir.DownBack:
                    case FightingGameInputCodeDir.Down:
                    case FightingGameInputCodeDir.DownForward:
                        notation = InputNotation._2C;
                        break;

                    default:
                        notation = InputNotation._5C;
                        break;
                    }
                    break;

                case FightingGameInputCodeBut.D:
                    switch (direction)
                    {
                    case FightingGameInputCodeDir.Neutral:
                    case FightingGameInputCodeDir.None:
                        notation = InputNotation._5D;
                        break;

                    case FightingGameInputCodeDir.DownBack:
                    case FightingGameInputCodeDir.Down:
                    case FightingGameInputCodeDir.DownForward:
                        notation = InputNotation._2D;
                        break;

                    default:
                        notation = InputNotation._5D;
                        break;
                    }
                    break;
                }

                return(notation);
            }
            public void ChooseAttack(CharacterStates.BaseState currState, CharacterProperties.Attack currAttack, FightingGameInputCodeBut button, FightingGameInputCodeDir direction = FightingGameInputCodeDir.None)
            {
                InputNotation notation = SelectInputNotation(button, direction);

                List <CharacterProperties.Attack> attackCandidates = charData.SelectAttacks(GetOrientation(), GetGroundRelation(), notation);

                CharacterProperties.Attack attack = charData.ChooseAttackFromSelectability(attackCandidates, currState, currAttack);

                if (attack != null)
                {
                    attackState.SetActiveAttack(attack);
                }
            }