Beispiel #1
0
        private IEnumerator CoPlayerHeal()
        {
            _player.Ready();
            _player.Animator.Cast();
            AudioController.instance.PlaySfx(AudioController.SfxCode.Heal);
            var buffRow = Game.instance.TableSheets.BuffSheet.Values.First(r =>
                                                                           r.StatModifier.Value > 0 && r.StatModifier.StatType == StatType.HP);
            var buff          = new HPBuff(buffRow);
            var castingEffect = Game.instance.Stage.BuffController.Get(_player.transform.position, buff);

            castingEffect.Play();
            yield return(new WaitForSeconds(0.6f));

            var effect = Game.instance.Stage.BuffController.Get <BuffVFX>(_player.gameObject, buff);

            effect.Play();
            var position = _player.transform.TransformPoint(0f, 1.7f, 0f);
            var force    = new Vector3(-0.1f, 0.5f);

            DamageText.Show(position, force, 64000.ToString(), DamageText.TextGroupState.Heal);
            yield return(new WaitForSeconds(1f));

            _player.Animator.Idle();
            yield return(new WaitForSeconds(1f));
        }
Beispiel #2
0
        public static void PopupDmg(int damage, GameObject target, bool isPlayer, bool critical, ElementalType elementalType, bool isFenrir)
        {
            var dmg = damage.ToString();
            var pos = target.transform.position;

            if (isFenrir)
            {
                pos.x -= 2.2f;
            }
            else
            {
                pos.x -= 0.2f;
            }
            pos.y += 0.32f;
            Vector3 position;
            Vector3 force;

            if (isPlayer)
            {
                force = new Vector3(-0.1f, 0.5f);
                var x = isFenrir ? -2f : 0f;
                position = target.transform.TransformPoint(x, 1.7f, 0f);
            }
            else
            {
                force    = new Vector3(0f, 0.8f);
                position = target.transform.TransformPoint(0f, 1.7f, 0f);
            }
            var group = !isPlayer ? DamageText.TextGroupState.Damage : DamageText.TextGroupState.Basic;

            if (critical)
            {
                ActionCamera.instance.Shake();
                AudioController.PlayDamagedCritical();
                CriticalText.Show(position, force, dmg, group);
                VFXController.instance.Create <BattleAttackCritical01VFX>(pos);
            }
            else
            {
                AudioController.PlayDamaged(elementalType);
                DamageText.Show(position, force, dmg, group);
                VFXController.instance.Create <BattleAttack01VFX>(pos);
            }
        }