Ejemplo n.º 1
0
    private void ApplyEffects(GameObject player)
    {
        if (healing)
        {
            origin.GetComponent <Health>().Heal(healingAmount);
        }

        if (poison)
        {
            if (currentDot)
            {
                currentDot.Reapply();
            }
            else
            {
                currentDot = player.AddComponent <DotDamage>();
                currentDot.SetInitial(null, Random.Range(3f, 5f));
                currentDot.SetStats(1, damageMultiplier, 1f);
            }
        }

        if (slowing)
        {
            SlowingEffect newDebuff = player.AddComponent <SlowingEffect>();
            newDebuff.SetInitial(null, Random.Range(1f, 2f));
            newDebuff.SetStats(Random.Range(0f, 0.3f));
        }
    }
Ejemplo n.º 2
0
 public void RemoveDot(DotDamage dotDamage)
 {
     if (_dotMap.ContainsKey(dotDamage.DamageType))
     {
         _dotMap.Remove(dotDamage.DamageType);
     }
     OnDotRemove(dotDamage.DamageType);
 }
Ejemplo n.º 3
0
    public void AddDot(DamageType damageType, float damageValue, float applyTime, float applyPeriod)
    {
        if (!enableDamage || _dotMap.ContainsKey(damageType)) //do not attach similar dot twice
        {
            return;
        }

        DotDamage dotDamage = new DotDamage();

        dotDamage.Init(this, damageType, damageValue, applyTime, applyPeriod);
        _dotMap.Add(damageType, dotDamage);
        onDotAdd(damageType);
    }
Ejemplo n.º 4
0
    private void AddDotDamage()
    {
        if (player.TryGetComponent(out DotDamage _))
        {
            foreach (DotDamage dotdamage in player.GetComponents <DotDamage>())
            {
                Destroy(dotdamage);
            }
        }
        DotDamage newDot = player.AddComponent <DotDamage>();

        newDot.SetInitial(vfx, stats.dotLifetime);
        newDot.SetStats(stats.damage, damageMultiplier, stats.damageCooldown);
    }
    private const float forever = 1000000; // Pseudo-eternity

    protected override void EnterEffect()
    {
        player.GetComponent <Health>().TakeDamage(damage);

        if (current)
        {
            current.Reapply();
        }
        else
        {
            current = player.AddComponent <DotDamage>();
            current.SetInitial(fireVFX, forever);
            current.SetStats(damage, difficultyMultiplier, cooldown);
        }
    }
Ejemplo n.º 6
0
    private void DealBleedDmg()
    {
        float RawDamage = BleedAmount;
        bool  Crit      = false;

        if (applyer != null && UnityEngine.Random.value < (applyer.GetCurrStats(STATSTYPE.CRIT_CHANCE) / 100))
        {
            RawDamage = RawDamage * (applyer.GetCurrStats(STATSTYPE.CRIT_DMG) / 100);
        }
        DotDamage BleedDamage = new DotDamage(RawDamage, Crit, applyer, typeof(BleedDebuff));

        target.ON_DMG_TAKEN += target.DeductHealth;
        target.ON_DMG_TAKEN(BleedDamage);
        target.ON_DMG_TAKEN -= target.DeductHealth;
        AudioSource.PlayClipAtPoint(SFX, transform.position, GameManager.SFX_Volume);
    }
    public void Attack()
    {
        if (player == null)
        {
            player = boss.player.GetComponent <Player>();
            DotDamage newDebuff = player.gameObject.AddComponent <DotDamage>();
            newDebuff.SetInitial(null, forever);
            newDebuff.SetStats(damagePerTick, 1, timeBetweenTicks);
            return;
        }

        boss.SetDirection((player.transform.position - transform.position).normalized);
        boss.keepDirection   = true;
        boss.speedMultiplier = chargeSpeedMultiplier;

        chargeTimer = chargeCooldown;
    }