Ejemplo n.º 1
0
    public void IceSkill(Monster monster, AbilityInfo.Info info)
    {
        monster.SetSpeedFor(0F, info.duration);
        var gObj = Object.Instantiate(effect, monster.transform.position, Quaternion.identity);

        Object.Destroy(gObj, info.duration - 0.1F);
    }
Ejemplo n.º 2
0
    public void SlowSpeedWhileEarth(AbilityInfo.Info info, int level)
    {
        bool effected = false;

        IEnumerator Coroutine()
        {
            while (true)
            {
                if (Mathf.Abs(transform.position.x) <= info.hitCount && Mathf.Abs(transform.position.y) <= info.hitCount / 2F)
                {
                    SetSpeedFor(0.2F, info.duration);
                    SetAuraFor(Aura.Earth, level, info.auraDuration);
                    effected = true;
                    yield break;
                }
                yield return(null);
            }
        }

        var coroutine = Coroutine();

        StartCoroutine(coroutine);
        DOVirtual.DelayedCall(info.duration, () => {
            if (effected)
            {
                StopCoroutine(coroutine);
                SetSpeedFor(1F, 0F);
            }
        });
    }
Ejemplo n.º 3
0
    private void LightningSkill(Monster monster, AbilityInfo.Info info)
    {
        monster.GetDamageInevitably(info.removalCount);
        monster.SetSpeedFor(0F, info.duration);
        var gObj = Object.Instantiate(effect, monster.transform.position, Quaternion.identity);

        Object.Destroy(gObj, info.duration - 0.1F);
    }
Ejemplo n.º 4
0
    private void WindSkill(Monster monster, AbilityInfo.Info info, GameObject effect)
    {
        monster.SetSpeedFor(0F, info.duration);
        var gObj = Object.Instantiate(effect, monster.transform.position, Quaternion.identity);

        Object.Destroy(gObj, info.duration - 0.5F);

        DOTween.Sequence()
        .Append(monster.transform.DOLocalMoveY(2.5F, 0.2F).SetEase(Ease.OutCubic).SetRelative())
        .AppendInterval(info.duration - 0.7F)
        .Append(monster.transform.DOLocalMoveY(-2.5F, 0.5F).SetEase(Ease.InQuad).SetRelative());
    }
Ejemplo n.º 5
0
    private void FlameSkill(Monster monster, AbilityInfo.Info info, GameObject effect)
    {
        burn?.Invoke(info.duration);
        monster.GetDamageInevitably(info.removalCount);

        var gObj = Object.Instantiate(effect, monster.transform.position, Quaternion.identity);

        Object.Destroy(gObj, 0.5F);
        var burnObj = Object.Instantiate(burnEffect, monster.transform);

        Object.Destroy(burnObj, info.duration);
    }
Ejemplo n.º 6
0
    public void Execute(List <Monster> activeMonsters, AbilityInfo.Info info, int level)
    {
        if (IsCooldown)
        {
            return;
        }
        else
        {
            IsCooldown = true;
            DOVirtual.DelayedCall(info.cooldown, () => IsCooldown = false);
        }

        var gObj = Object.Instantiate(effect, new Vector3(0F, -0.8F), Quaternion.identity);

        gObj.transform.localScale = new Vector3(info.hitCount * 1.5F, info.hitCount * 1.5F);
        Object.Destroy(gObj, info.duration);
        Debug.Log("생성");

        foreach (var monster in activeMonsters)
        {
            switch (monster.Aura)
            {
            case Aura.None:
            case Aura.Lightning:
            case Aura.Wind:
            case Aura.Flame:
            case Aura.Ice when monster.AuraLevel <= level:
                EarthSkill(monster, info, level);
                break;

            case Aura.Earth:
                monster.SetSpeedFor(0F, 0.5F);
                DOVirtual.DelayedCall(0.5F, () => EarthSkill(monster, info, level));
                break;
            }
        }
    }
Ejemplo n.º 7
0
    public void Execute(List <Monster> activeMonsters, AbilityInfo.Info info, int level)
    {
        if (IsCooldown)
        {
            return;
        }
        else
        {
            IsCooldown = true;
            DOVirtual.DelayedCall(info.cooldown, () => IsCooldown = false);
        }

        for (int i = 0; i < info.hitCount && i < activeMonsters.Count; i++)
        {
            var monster = activeMonsters[i];
            switch (monster.Aura)
            {
            case Aura.None:
                LightningSkill(monster, info);
                monster.SetAuraFor(Aura.Lightning, level, info.auraDuration);
                break;

            case Aura.Lightning:
                LightningSkill(monster, info);
                monster.SetAuraFor(Aura.Lightning, level, info.auraDuration);
                DOVirtual.DelayedCall(info.duration + 0.1F, () =>
                {
                    monster.GetDamageInevitably(1);
                    var gObj2 = Object.Instantiate(effect, monster.transform.position + new Vector3(0.5F, 0F), Quaternion.identity);
                    Object.Destroy(gObj2, 0.5F);
                });
                break;

            case Aura.Wind:
                LightningSkill(monster, info);
                DOVirtual.DelayedCall(info.duration + 0.1F, () =>
                {
                    monster.SetAuraFor(Aura.Lightning, level, info.auraDuration);
                    monster.SetSpeedFor(0F, 0.5F);
                    var windEffectObj = Object.Instantiate(windEffect, monster.transform.position + new Vector3(0.5F, 0F), Quaternion.identity);
                    Object.Destroy(windEffectObj, 0.5F);
                });
                break;

            case Aura.Flame:
                LightningSkill(monster, info);
                monster.SetHigherAuraFor(Aura.Lightning, level, info.auraDuration);
                break;

            case Aura.Ice:
                LightningSkill(monster, info);
                monster.SetHigherAuraFor(Aura.Lightning, level, info.auraDuration);
                if (level - 2 >= monster.AuraLevel)
                {
                    monster.GetDamageInevitably(1);
                }
                else
                {
                    iceSkill?.Invoke(monster, info);
                }
                break;

            case Aura.Earth:
                if (level - 2 >= monster.AuraLevel)
                {
                    monster.SetAuraFor(Aura.Lightning, level, info.auraDuration);
                }
                else
                {
                    monster.SetAuraFor(Aura.None, 0, 0F);
                }
                break;
            }
        }
    }
Ejemplo n.º 8
0
    public void Execute(List <Monster> activeMonsters, AbilityInfo.Info info, int level)
    {
        if (IsCooldown)
        {
            return;
        }
        else
        {
            IsCooldown = true;
            DOVirtual.DelayedCall(info.cooldown, () => IsCooldown = false);
        }

        for (int i = 0; i < info.hitCount && i < activeMonsters.Count; i++)
        {
            var monster = activeMonsters[i];
            switch (monster.Aura)
            {
            case Aura.None:
            case Aura.Earth:
                IceSkill(monster, info);
                monster.SetAuraFor(Aura.Ice, level, info.auraDuration);
                break;

            case Aura.Lightning:
                IceSkill(monster, info);
                monster.SetAuraFor(Aura.Ice, level, info.auraDuration);
                DOVirtual.DelayedCall(info.duration, () => monster.SetSpeedFor(0F, info.duration / 2F));
                break;

            case Aura.Wind:
                monster.SetAuraFor(Aura.Ice, level, info.auraDuration);
                if (monster.AuraLevel > level)
                {
                    var gObj = Object.Instantiate(windEffect, monster.transform.position, Quaternion.identity);
                    Object.Destroy(gObj, info.duration);
                }
                else
                {
                    IceSkill(monster, info);
                }
                break;

            case Aura.Flame:
                monster.SetHigherAuraFor(Aura.Ice, level, info.auraDuration);
                if (monster.AuraLevel <= level)
                {
                    IceSkill(monster, info);
                }
                break;

            case Aura.Ice:
                IceSkill(monster, info);
                monster.SetAuraFor(Aura.Ice, level, info.auraDuration);
                DOVirtual.DelayedCall(info.duration, () =>
                {
                    monster.SetSpeedFor(0F, info.duration * 1.5F);
                    var gObj = Object.Instantiate(effect, monster.transform.position, Quaternion.identity);
                    Object.Destroy(gObj, info.duration - 0.1F);
                });
                break;
            }
        }
    }
Ejemplo n.º 9
0
    public void Execute(List <Monster> activeMonsters, AbilityInfo.Info info, int level)
    {
        if (IsCooldown)
        {
            return;
        }
        else
        {
            IsCooldown = true;
            DOVirtual.DelayedCall(info.cooldown, () => IsCooldown = false);
        }

        for (int i = 0; i < info.hitCount && i < activeMonsters.Count; i++)
        {
            var monster = activeMonsters[i];
            switch (monster.Aura)
            {
            case Aura.None:
                monster.SetAuraFor(Aura.Flame, level, info.auraDuration);
                FlameSkill(monster, info, effect);
                break;

            case Aura.Lightning:
                monster.SetHigherAuraFor(Aura.Flame, level, info.auraDuration);
                FlameSkill(monster, info, effect);
                break;

            case Aura.Wind:
                FlameSkill(monster, info, windEffect);
                monster.SetAuraFor(Aura.Flame, level, info.auraDuration);
                DOVirtual.DelayedCall(info.duration, () =>
                {
                    burn?.Invoke(info.duration);
                    monster.GetDamageInevitably(1);
                    var burnObj = Object.Instantiate(burnEffect, monster.transform);
                    Object.Destroy(burnObj, info.duration);
                });
                break;

            case Aura.Ice:
                monster.SetHigherAuraFor(Aura.Flame, level, info.auraDuration);
                var gObj = Object.Instantiate(fog, monster.transform);
                Object.Destroy(gObj, info.duration);
                if (monster.AuraLevel > level)
                {
                    iceSkill?.Invoke(monster, info);
                }
                else
                {
                    FlameSkill(monster, info, effect);
                }
                break;

            case Aura.Earth:
                FlameSkill(monster, info, effect);
                if (monster.AuraLevel - 2 >= level)
                {
                    monster.SetHigherAuraFor(Aura.None, -1, 0F);
                }
                else
                {
                    monster.SetAuraFor(Aura.Flame, level, info.auraDuration);
                }
                break;
            }
        }
    }
Ejemplo n.º 10
0
 private void EarthSkill(Monster monster, AbilityInfo.Info info, int level)
 {
     monster.SlowSpeedWhileEarth(info, level);
 }