Mecânicas de Combate

From Ymirheim Wiki
This page is a translated version of the page Combat Mechanics and the translation is 83% complete.
Outdated translations are marked like this.

Esta página descreve várias mecânicas de combate e seus cálculos.


A Fórmula da Chance de Acerto

A fórmula de Chance de Acerto é 85% + (PrecisãoDoAtacante - EvasãoDoAlvo) A Chance de Acerto é limitada a 2% (o que significa que seus ataques agora têm apenas 2% de chance de errar, mesmo que sua Precisão seja muito maior que a Evasão do alvo) e a 95% (o que significa que seus ataques agora têm 5% de chance de acertar o alvo, independentemente da evasão do alvo).

A Fórmula do Tempo de Lançamento

A fórmula do Tempo de Lançamento é TempoDeLançamentoBase / (1 + (VelocidadeDeLançamento / 100))

Damage Calculation

Skill attack value

Damage calculation for any combat skill (including normal weapon skill, aka auto attack) starts with calculating the attack value:

  1. Depending on the type of the attack (melee/ranged/magic), the maximum attack value is taken from the corresponding attack attribute (for example, for the melee attacks, the MeleeAttack attribute total value is taken).
    maxAttack = MeleeAttackAttribute.Total
  2. To determine the minimal attack value, balance factor is applied to the maximum attack value (using the result of the MinAttackModifierPerBalance function). For example, if your balance is 60%, your minimal attack value is 60% of your maximum attack.
    minAttack = (int)(maxAttack * MinAttackModifierPerBalance(MeleeBalanceAttribute.Total))
  3. The same two steps are done to determine the minimal and maximum weapon attack (using the values of the `WeaponMeleeAttack`/`WeaponRangedAttack`/`WeaponMagicalPower` attributes:
    maxWeaponAttack = WeaponMeleeAttackAttribute.Total
    minWeaponAttack = (int)(maxWeaponAttack * MinAttackModifierPerBalance(MeleeBalanceAttribute.Total))
  4. If the attack is critical, the resulting attack is always the maximum attack value multiplied by the critical attack value (140% by default). This applies only to the character's attack, not to the weapon attack values. If the attack is not critical, the resulting attack value is a random value in between the minimal and maximum attack.
    attack = EffectKind == Critical ? (int)(maxAttack * (1.0 + (MeleeCriticalAttackAttribute.Total / 1000.0))) : Random.Next(minAttack, maxAttack + 1)
  5. Then attack power multiplier is applied to the resulting value. This can come from skills that say, for example, "200% Attack Power".
    attack = (int)(attack * (1f + AttackPowerAttribute.Modifier)) + AttackPowerAttribute.Bonus
  6. If the resulting value is lower than 1, it gets brought up to 1.
    attack = Math.Max(attack, 1);
  7. Then the weapon attack (which is random between the minimal and maximum weapon attack) is added to the resulting value.
    attack = attack + Random.Next(minWeaponAttack, maxWeaponAttack + 1)
  8. Finally, in case of an offensive skill attack, any attack modifiers based on the target type, and then on the target size, are applied if suitable. For example, if the attacker has +20% attack against the Fish type enemies and the target is Fish, the resulting attack will be multiplied by 20%. This is considered final skill attack value, for example:
    attackModifier = 1.0f + (FishAttackAttribute.Total / 1000.0f)
    attack = (int)Math.Max(attack * attackModifier, 1)

Damage reduction

After the final attack value is calculated, it can be reduced by the target's defenses:

  1. The defense value is first taken from the target's defense attribute that corresponds to the type of the attack: `MeleeDefense`/`RangedDefense`/`MagicResistance`
  2. Attacker's defense penetration then gets subtracted from the defense value, which gets taken from the attacker's `MeleeDefensePenetration`/`RangedDefensePenetration`/`MagicPenetration` attributes depending on the type of the attack. But the resulting value cannot go below 0.
    var defense = Math.Max(target.MagicResistanceAttribute.Total - attacker.MagicPenetrationAttribute.Total, 0)
  3. The damage is then calculated from the attack value multiplied by the value from the DamageReductionFactorPerDefense and then DamageReductionPerDefense gets subtracted as well: var damage = (int)Math.Max((attack * DamageReductionFactorPerDefense(defense)) - DamageReductionPerDefense(defense), 1);
  4. After that, any additional elemental, size, type defenses are getting applied as well, in the same order. These defenses don't have any flat damage reduction, they only have the factors, and are calculated using DamageReductionFactorPerElementalDefense like this:
    damage = (int)Math.Max(damage * DamageReductionFactorPerElementalDefense(elementalDefense), 1);
  5. The resulting damage cannot be lower than 1.