Ejemplo n.º 1
0
        public bool OnDamage(Game.Actors.DamageData damageData)
        {
            DamageData dd = (DamageData)damageData;

            _floatingTextEffectTriggerComponent.Text = $"{dd.AttackData.DamageAmount}";

            _damageEffect.Trigger();
            return(true);
        }
Ejemplo n.º 2
0
        public bool Damage(Game.Actors.DamageData damageData)
        {
            if (ActionHandler.IsDead)
            {
                return(false);
            }

            Actors.DamageData dd = (Actors.DamageData)damageData;

            // did we block the damage?
            if (!dd.AttackData.Unblockable && Brawler.CurrentAction.IsBlocking && _blockVolume.Intersects(dd.Bounds))
            {
                if (BrawlerAction.ActionType.Parry == Brawler.CurrentAction.Type)
                {
                    Debug.Log($"TODO: Brawler {Owner.Id} can parry");
                }

                if (GameManager.Instance.DebugBrawlers)
                {
                    DisplayDebugText($"Blocked damage for {dd.AttackData.DamageAmount} (took {dd.AttackData.BlockDamageAmount})", Color.blue);
                }

                if (null != dd.SourceBrawlerActionHandler)
                {
                    BrawlerAction currentAction = Brawler.CurrentAction;
                    currentAction.WasBlocked = true;
                    Brawler.CurrentAction    = currentAction;
                }

                if (DoDamage(dd, true))
                {
                    return(true);
                }

                //_blockAudioEffectTriggerComponent.AudioClip = dd.AttackData.BlockAudioCip;
                _blockEffectTrigger.Trigger();

                ActionHandler.ClearActionBuffer();
                ActionHandler.OnHit(true);

                return(false);
            }

            if (GameManager.Instance.DebugBrawlers)
            {
                DisplayDebugText($"Damage: {dd.AttackData.DamageAmount}", Color.red);
            }

            CancelActions(false);

            DoDamage(dd, false);

            return(true);
        }
Ejemplo n.º 3
0
 public bool Damage(Game.Actors.DamageData damageData)
 {
     return(TrainingDummyBehavior.OnDamage(damageData));
 }