コード例 #1
0
ファイル: Armor.cs プロジェクト: SHIROKEY/argent-tournament
        public override void TakeDamage(Pointer pointer, Vector2 point)
        {
            var decreased = (int)Mathf.Round(AbsorbtionPercent * pointer.GetDamage() / 100);

            if (decreased > 0)
            {
                pointer.DecreaseDamage(decreased);
                GameLogicManager.CreateFloatingText("blocked", point - new Vector2(300, 0), new Color(0, 1, 0));
            }
        }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: SHIROKEY/argent-tournament
        public override void TakeDamage(Pointer pointer, Vector2 point)
        {
            if (!_dead)
            {
                var amount = (int)Mathf.Round(pointer.GetDamage());
                if (amount > 0)
                {
                    _animator.Play("TakingDamage");
                    pointer.DecreaseDamage(amount);
                    GameLogicManager.CreateFloatingText(amount.ToString(), point, new Color(1, 1, 1));
                }
                else
                {
                    GameLogicManager.CreateFloatingText("weak", point, new Color(1, 1, 1));
                }

                _dead = GameLogicManager.IsOutOfHP(amount);
                if (_dead)
                {
                    _animator.Play("Death");
                }
            }
        }