Exemplo n.º 1
0
        public bool AdvanceCombo(CharacterBehaviorComponent.CharacterBehaviorAction action)
        {
            bool isOpener = null == _currentComboEntry;

            if (isOpener)
            {
                _currentComboEntry = Brawler.BrawlerCombo.RootComboEntry.NextEntry(action, null, Brawler.CurrentAction);
                if (null == _currentComboEntry)
                {
                    Debug.LogWarning($"Unable to find combo opener for action {action}");
                }
            }
            else
            {
                _currentComboEntry = _currentComboEntry.NextEntry(action, _currentComboEntry, Brawler.CurrentAction);
            }

            if (null == _currentComboEntry)
            {
                _currentComboEntry = FudgeFailedCombo(action);
                if (null == _currentComboEntry)
                {
                    return(false);
                }
            }

            ActionHandler.OnComboMove(isOpener, _currentComboEntry.Move, Brawler.CurrentAction);

            if (GameManager.Instance.DebugBrawlers)
            {
                DisplayDebugText($"Advance combo: {_currentComboEntry.Move.Id}", Color.green);
            }

            return(true);
        }
Exemplo n.º 2
0
        private BrawlerCombo.IComboEntry FudgeFailedCombo(CharacterBehaviorComponent.CharacterBehaviorAction action)
        {
            // if we fail a combo into a dash, just do the dash as a new opener
            // or, if we fail a combo out of a dash, try and find something out of the root instead as a new opener
            if (action is DashBehaviorComponent.DashAction || BrawlerAction.ActionType.Dash == Brawler.CurrentAction.Type)
            {
                return(Brawler.BrawlerCombo.RootComboEntry.NextEntry(action, null, Brawler.CurrentAction));
            }

            // any other fudging we might want to do?

            return(null);
        }
Exemplo n.º 3
0
        private void Combo()
        {
            if (GameManager.Instance.DebugBrawlers)
            {
                DisplayDebugText($"Attempting combo: {_currentComboEntry.Move.Id}", Color.yellow);
            }

            CharacterBehaviorComponent.CharacterBehaviorAction action = ActionHandler.NextAction;
            if (!(action is AttackBehaviorComponent.AttackAction) && !(action is Game.Characters.BehaviorComponents.DashBehaviorComponent.DashAction))
            {
                ComboFail();
                return;
            }

            ActionHandler.PopNextAction();
            ActionHandler.ActionPerformed(action);
        }
Exemplo n.º 4
0
            public IComboEntry NextEntry(CharacterBehaviorComponent.CharacterBehaviorAction action, IComboEntry previousMove, BrawlerAction currentAction)
            {
                if (action is DashBehaviorComponent.DashAction)
                {
                    foreach (IComboEntry comboEntry in comboEntries)
                    {
                        if (ComboMove.ComboMoveType.Dash == comboEntry.Move.Type)
                        {
                            return(comboEntry);
                        }
                    }
                }
                else if (action is AttackBehaviorComponent.AttackAction attackAction)
                {
                    foreach (IComboEntry comboEntry in comboEntries)
                    {
                        if (comboEntry.Move.Equals(attackAction) && (null == previousMove || !Move.RequireHit || !previousMove.Move.IsAttack || currentAction.DidHit))
                        {
                            return(comboEntry);
                        }
                    }

                    // if we failed and this is the opener
                    // we'll be kind and fall back on the directionless attack
                    if (null == previousMove)
                    {
                        if (GameManager.Instance.DebugBrawlers)
                        {
                            Debug.Log($"Fallback on directionless attack");
                        }

                        foreach (IComboEntry comboEntry in comboEntries)
                        {
                            if (comboEntry.Move.IsDirectionlessAttack)
                            {
                                return(comboEntry);
                            }
                        }
                    }
                }

                return(null);
            }
Exemplo n.º 5
0
 public ActionBufferEntry(CharacterBehaviorComponent.CharacterBehaviorAction action)
 {
     Action = action;
 }