public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is AttackAction attackAction))
            {
                return(false);
            }

            if (!_brawlerBehavior.AdvanceCombo(attackAction))
            {
                _brawlerBehavior.ComboFail();
                return(true);
            }

            if (GameManager.Instance.DebugBrawlers)
            {
                _brawlerBehavior.DisplayDebugText($"Attack: {_brawlerBehavior.CurrentAttack.Name}", Color.cyan);
            }

            // TODO: calling Initialize() here is dumb, but we can't do it in our own Initialize()
            // because the models haven't been initialized yet (and that NEEDS to get changed cuz this is dumb)
            _attackVolume.Initialize(_brawlerBehavior.Brawler.Model.SpineModel);
            _attackVolume.SetAttack(_brawlerBehavior.Brawler, _brawlerBehavior.CurrentAttack, Behavior.Owner.FacingDirection);

            _attackAnimationEffectTriggerComponent.SpineAnimationName = _brawlerBehavior.CurrentAttack.AnimationName;
            _attackAudioEffectTriggerComponent.AudioClip = _brawlerBehavior.CurrentAttack.AttackAudioClip;

            _brawlerBehavior.Brawler.CurrentAction = new BrawlerAction(BrawlerAction.ActionType.Attack);

            _attackEffectTrigger.Trigger(() => {
                _brawlerBehavior.Idle();
            });

            return(true);
        }
Exemple #2
0
        // NOTE: we want to consume jump actions if we're hovering
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is JumpBehaviorComponent.JumpAction))
            {
                return(false);
            }

            return(_isHovering);
        }
Exemple #3
0
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is BlockAction blockAction))
            {
                return(false);
            }

            return(blockAction.Cancel ? EndBlock() : StartBlock());
        }
Exemple #4
0
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (action is GrabAction)
            {
                if (IsClimbing)
                {
                    return(true);
                }

                if (CanGrabLeft && CanGrabRight)
                {
                    StartClimbing();

                    if (null != _leftHandHitResult)
                    {
                        AttachToSurface(_leftHandHitResult.Value, false);
                    }
                    else if (null != _rightHandHitResult)
                    {
                        AttachToSurface(_rightHandHitResult.Value, false);
                    }
                }
                else if (CanHangLeft && CanHangRight)
                {
                    StartHanging();

                    if (null != _leftHandHangHitResult)
                    {
                        AttachToSurface(_leftHandHangHitResult.Value, true);
                    }
                    else if (null != _rightHandHangHitResult)
                    {
                        AttachToSurface(_rightHandHangHitResult.Value, true);
                    }
                }
                else
                {
                    return(false);
                }

                return(true);
            }

            if (action is ReleaseAction)
            {
                if (IsClimbing)
                {
                    StopClimbing();
                }

                return(true);
            }

            return(false);
        }
Exemple #5
0
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is GatherAction))
            {
                return(false);
            }

            GamePlayer.GamePlayerBehavior.OnGather();

            return(true);
        }
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is ContextAction))
            {
                return(false);
            }

            //GamePlayer.GamePlayerBehavior.OnContext();

            return(true);
        }
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is JumpBehaviorComponent3D.JumpAction))
            {
                return(false);
            }

            _isHeld      = false;
            _heldSeconds = 0;

            return(_didLongJump);
        }
Exemple #8
0
        public override bool OnStarted(CharacterBehaviorAction action)
        {
            if (!(action is HoverAction))
            {
                return(false);
            }

            if (Behavior.IsGrounded && !_data.HoverWhenGrounded)
            {
                return(false);
            }

            _isHeld      = true;
            _heldSeconds = 0;

            return(true);
        }
        public override bool OnStarted(CharacterBehaviorAction action)
        {
            if (!(action is JumpBehaviorComponent3D.JumpAction))
            {
                return(false);
            }

            if (!Behavior.IsGrounded || Behavior.IsSliding)
            {
                return(false);
            }

            _isHeld      = true;
            _heldSeconds = 0;
            _didLongJump = false;

            return(true);
        }
Exemple #10
0
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is JumpAction))
            {
                return(false);
            }

            if (!Behavior.IsGrounded || Behavior.IsSliding)
            {
                return(false);
            }

            Behavior.CharacterMovement3D.Jump(_data.JumpHeight);
            if (null != _jumpEffect)
            {
                _jumpEffect.Trigger();
            }

            return(true);
        }
Exemple #11
0
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is JumpBehaviorComponent3D.JumpAction))
            {
                return(false);
            }

            if (!CanDoubleJump)
            {
                return(false);
            }

            Behavior.CharacterMovement3D.Jump(_data.DoubleJumpHeight);
            if (null != _doubleJumpEffect)
            {
                _doubleJumpEffect.Trigger();
            }

            _doubleJumpCount++;
            return(true);
        }
Exemple #12
0
        public override bool OnCancelled(CharacterBehaviorAction action)
        {
            if (!(action is HoverAction))
            {
                return(false);
            }

            if (!IsHovering)
            {
                return(false);
            }

            _isHeld      = false;
            _heldSeconds = 0;

            bool wasHover = _isHovering;

            StopHovering();

            return(wasHover);
        }
Exemple #13
0
        public override bool OnPerformed(CharacterBehaviorAction action)
        {
            if (!(action is DashAction))
            {
                return(false);
            }

            if (!_brawlerBehavior.AdvanceCombo(action))
            {
                _brawlerBehavior.ComboFail();
                return(true);
            }

            if (GameManager.Instance.DebugBrawlers)
            {
                _brawlerBehavior.DisplayDebugText("Dash", Color.cyan);
            }

            _brawlerBehavior.Brawler.CurrentAction = new BrawlerAction(BrawlerAction.ActionType.Dash);

            base.OnPerformed(action);

            return(true);
        }
Exemple #14
0
 public virtual bool OnCancelled(CharacterBehaviorAction action)
 {
     return(false);
 }
Exemple #15
0
 public virtual bool OnPerformed(CharacterBehaviorAction action)
 {
     return(false);
 }
Exemple #16
0
 public virtual bool OnStarted(CharacterBehaviorAction action)
 {
     return(false);
 }