Beispiel #1
0
        protected override void ApplyEffect(Tower source, Npc target)
        {
            var dmg = 0f;

            if (source.HasAttribute(AttributeName.AttackDamage))
            {
                dmg = source.Attributes.GetAttribute(AttributeName.AttackDamage).Value;
            }

            var offset       = new Vector3(0, target.transform.lossyScale.y, 0);
            var effectText   = (int)(2 * dmg) + "!";
            var textSize     = 2;
            var textDuration = 2.0f;
            var textEffect   =
                new TextEffectData(effectText, textSize, GameSettings.MagicalCritColor, target.gameObject, offset, textDuration);

            GameManager.Instance.SpecialEffectManager.PlayTextEffect(textEffect);

            target.DealDamage(dmg, source);
        }
Beispiel #2
0
        private void MultiToss(Npc target)
        {
            var p = 0.5f;

            if (MathHelper.RandomFloat() <= p)
            {
                _tossComboCount++;
            }
            else
            {
                if (_tossComboCount == 0)
                {
                    return;
                }

                StartCoroutine(ExecuteAttacks(_tossComboCount));

                var offset     = new Vector3(0, Height, 0);
                var textEffect = new TextEffectData(_tossComboCount + "x!", 1.5f, GameSettings.CritColor, gameObject, offset, 1.75f);
                GameManager.Instance.SpecialEffectManager.PlayTextEffect(textEffect);
                _tossComboCount = 0;
            }
        }