Beispiel #1
0
            public void TrackAttack(int frameIndex, CharacterProperties.Attack attack)
            {
                startFrame = frameIndex;
                frameCount = 0;

                currentAttack = attack;
            }
Beispiel #2
0
            public override void Enter(int frameIndex, IState previousState)
            {
                // Start OnEnter with this
                GivenInput(fgChar.GivenCombinations());

                activeAttack   = queuedUpAttack;
                queuedUpAttack = null;

                activeAttack.StartPerformable(frameIndex);
                activeAttack.SetOnCompleteCallback(onCompleteAttack);
            }
            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);
                }
            }
Beispiel #4
0
 public CharacterProperties.Attack ServeAttack()
 {
     if (attackQueue.Count > 0)
     {
         CharacterProperties.Attack attack = attackQueue[0];
         attackQueue.RemoveAt(0);
         return(attack);
     }
     else
     {
         return(null);
     }
 }
Beispiel #5
0
            public void OnCompleteAttack()
            {
                //TODO: Choose a new attack, which is also possible.
                switch (direction)
                {
                case FightingGameInputCodeDir.DownBack:
                case FightingGameInputCodeDir.Down:
                case FightingGameInputCodeDir.DownForward:
                    changeState(states.Get("crouch"));
                    break;

                default:
                    changeState(states.Get("stand"));
                    break;
                }

                activeAttack = null;
            }
Beispiel #6
0
 public void SetActiveAttack(CharacterProperties.Attack atk)
 {
     queuedUpAttack = atk;
     changeState(this);
 }
Beispiel #7
0
 public override void Exit(int frameIndex)
 {
     activeAttack = null;
 }
Beispiel #8
0
 public void AddAttack(CharacterProperties.Attack attack)
 {
     attackQueue.Add(attack);
 }