public void TrackAttack(int frameIndex, CharacterProperties.Attack attack) { startFrame = frameIndex; frameCount = 0; currentAttack = attack; }
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); } }
public CharacterProperties.Attack ServeAttack() { if (attackQueue.Count > 0) { CharacterProperties.Attack attack = attackQueue[0]; attackQueue.RemoveAt(0); return(attack); } else { return(null); } }
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; }
public void SetActiveAttack(CharacterProperties.Attack atk) { queuedUpAttack = atk; changeState(this); }
public override void Exit(int frameIndex) { activeAttack = null; }
public void AddAttack(CharacterProperties.Attack attack) { attackQueue.Add(attack); }