Example #1
0
    protected bool DealDamageToEnemy(Actor_Player player, Actor_Enemy enemy, Vector3 position, float fRadius)
    {
        float fMultiplier = player.GetAttackDamageMultiplier();

        if (position.x <= Core.GetLevel().GetMeleeZoneLimit())
        {
            fMultiplier += player.minion.GetBuff(Stat.DAMAGE_MULTIPLIER_IN_MELEE_ZONE);
        }

        if (enemy.IsStunned())
        {
            fMultiplier += player.minion.GetBuff(Stat.ATTACK_DAMAGE_ON_STUNNED_ENEMIES);
        }

        if (damage.IsRadial())
        {
            Core.GetLevel().DamageRadius(damage,
                                         position,
                                         damage.fRadius * player.GetAttackRadiusMultiplier(),
                                         fMultiplier,
                                         player.GetStunTime(),
                                         player.minion.GetBuff(Stat.CRITICAL_CHANCE),
                                         player.minion.GetBuff(Stat.CRITICAL_DAMAGE),
                                         player.minion.GetBuff(Stat.VAMPIRISM),
                                         player.minion.GetBuff(Stat.ATTACK_DAMAGE_ABSOLUTE));

            return(enemy == null || enemy.IsDead());
        }
        else if (enemy != null)
        {
            if (enemy.IsDead())
            {
                return(true);
            }

            float fElementalMultiplier = Elements.GetDamageMultiplier(damage.GetElement(), enemy.minion.template.element);
            float fMod = enemy.GetInherentElementalResistanceModifier();
            if (fElementalMultiplier < 1.0f)
            {
                fElementalMultiplier = 1.0f - ((1.0f - fElementalMultiplier) * fMod);
            }

            fMultiplier *= fElementalMultiplier;

            player.OnDealtDamage(damage.fAmount * fMultiplier);

            return(enemy.Damage(damage,
                                fMultiplier,
                                player.GetStunTime(),
                                player.minion.GetBuff(Stat.CRITICAL_CHANCE),
                                player.minion.GetBuff(Stat.CRITICAL_DAMAGE),
                                player.minion.GetBuff(Stat.VAMPIRISM),
                                player.minion.GetBuff(Stat.ATTACK_DAMAGE_ABSOLUTE)));
        }

        return(true);
    }
Example #2
0
    public override void SimulatePlayerFixedUpdate(Actor_Player actor)
    {
        base.SimulatePlayer(actor);

        if (Core.GetCurrentRoster().afGroupHealths [(int)MinionSlotType.RANGED] / Core.GetCurrentRoster().afGroupMaxHealths [(int)MinionSlotType.RANGED] <= fHealthTrigger)
        {
            actor.fTimeToNextBurn -= Core.GetPlayerDeltaTime();
            if (actor.fTimeToNextBurn <= 0.0f)
            {
                actor.fTimeToNextBurn = fTimeBetweenBurns;
                List <Actor_Enemy> enemies = new List <Actor_Enemy> ();
                enemies.AddRange(Core.GetLevel().enemyActors);
                foreach (Actor_Enemy enemy in enemies)
                {
                    enemy.Damage(burnDamage, actor.GetAttackDamageMultiplier(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
                }
            }
        }
    }