Пример #1
0
 void attackWithDOT(string name, BuffManager.BuffType statType, int modifier, int duration, int frequency, GameObject target)
 {
     if (!BuffManager.buffs.ContainsKey(name) && !enemyObject.GetComponent <Enemy>().isDead)
     {
         BuffManager.instance.CreateDOT(name, statType, modifier, duration, frequency, target);
     }
 }
Пример #2
0
 public void removeAccessory(BuffManager.BuffType type, float attrib)
 {
     if (type == BuffManager.BuffType.attack)
     {
         attackModifier -= attrib;
         print("reduce attack");
     }
     if (type == BuffManager.BuffType.crit)
     {
         critModifier -= attrib;
         print("reduce crit");
     }
     if (type == BuffManager.BuffType.defense)
     {
         defenseModifier -= attrib;
         print("reduce defense");
     }
     if (type == BuffManager.BuffType.fire)
     {
         isDOT   = false;
         dotHit -= Mathf.RoundToInt(attrib);
         print("nomoreDOT (TM)");
     }
     if (type == BuffManager.BuffType.heal)
     {
         isHeal      = false;
         healAmount -= Mathf.RoundToInt(attrib);
     }
     if (type == BuffManager.BuffType.health)
     {
         maxHealth -= Mathf.RoundToInt(attrib);
     }
 }
Пример #3
0
    public void setBuff(string statName, BuffManager.BuffType statType, float modifier, int frequency, int duration, GameObject target)
    {
        this.statName = statName;

        this.statType  = statType;
        this.modifier  = modifier;
        this.frequency = frequency;
        this.duration  = duration;
        this.target    = target;

        if (target.GetComponent <Player>() != null)
        {
            StartCoroutine(hurtPlayer());
        }
        else
        {
            StartCoroutine(hurtEnemy(target.GetComponent <Enemy>()));
        }
    }
Пример #4
0
    public void setBuff(string statName, BuffManager.BuffType statType, float modifier, int duration, GameObject target)
    {
        this.statName = statName;
        this.statType = statType;
        this.modifier = modifier;
        this.duration = duration;
        this.target   = target;

        if (target.GetComponent <Player>() != null)
        {
            if (statType == BuffManager.BuffType.attack)
            {
                Player.attackModifier += modifier;
                BuffManager.attackParticlesInstance.SetActive(true);
                attackActive = true;
                print(Player.attackModifier);
                StartCoroutine(timer(() => {
                    Player.attackModifier -= modifier;
                    if (BuffManager.attackParticlesInstance != null)
                    {
                        BuffManager.attackParticlesInstance.SetActive(false);
                    }
                    Destroy(this.gameObject);
                    attackActive = false;
                    return(true);
                }));
            }
            else if (statType == BuffManager.BuffType.defense)
            {
                Player.defenseModifier += modifier;
                StartCoroutine(timer(() => {
                    Player.defenseModifier -= modifier;
                    Destroy(this.gameObject);
                    return(true);
                }));
            }
            else if (statType == BuffManager.BuffType.crit)
            {
                Player.critModifier += modifier;
                BuffManager.critParticlesInstance.SetActive(true);
                critActive = true;

                StartCoroutine(timer(() => {
                    Player.critModifier -= modifier;
                    if (BuffManager.critParticlesInstance != null)
                    {
                        BuffManager.critParticlesInstance.SetActive(false);
                    }
                    Destroy(this.gameObject);
                    critActive = false;
                    return(true);
                }));
            }
        }
        else
        {
            if (statType == BuffManager.BuffType.attack)
            {
                Enemy.attackModifierEnemy += modifier;
                StartCoroutine(timer(() => {
                    Enemy.attackModifierEnemy -= modifier;
                    Destroy(this.gameObject);
                    return(true);
                }));
            }
            else if (statType == BuffManager.BuffType.defense)
            {
                Enemy.defenseModifierEnemy += modifier;
                StartCoroutine(timer(() => {
                    Enemy.defenseModifierEnemy -= modifier;
                    Destroy(this.gameObject);
                    return(true);
                }));
            }
        }
    }