This page explains, step by step, how fights work in Leek Wars, describing how attacks are calculated and applied. It also covers the specifics of each damage type, as well as the advanced mechanics (life steal, damage return, erosion, critical hits, etc.).
In Leek Wars, each attack can involve one (or more) of the following effects:
Each damage type broadly follows the same resolution logic, with a few exceptions (armor is ignored for poison, no life steal for LIFE_DAMAGE, etc.). The following sections describe the steps for each attack type in detail.
When a weapon or a chip is used, its base damage (listed in its description and returned by getWeaponEffects or getChipEffects) is rolled only once within the [min, max] range, using a uniform distribution.
> Example: > For the Magnum, whose damage range is [25, 40], the attack rolls a single random value between 25 and 40.
If the weapon (or chip) has several damage effects, the same rolled value is reused for each effect (for example, the 3 hits of the Machine Gun have the same base value). However, all the steps (strength, armor, etc.) are repeated separately for each effect.
> Strength: used for EFFECT_DAMAGE (not for EFFECT_LIFE_DAMAGE). > Magic: used for EFFECT_POISON. > Science: used for EFFECT_NOVA_DAMAGE.
For physical and nova attacks, the general formula is:
where stat is Strength, Magic or Science depending on the damage type.
Damage from the Punishment chip (EFFECT_LIFE_DAMAGE) is a special case:
(This damage does not grant any life steal.)
In Battle Royale mode (or when a chest is destroyed), the Power stat builds up (see getPower) and also comes into the calculation:
It works the same way for EFFECT_LIFE_DAMAGE:
> Note: The getPower function returns 0 outside of Battle Royale mode, so the same generic code works for every game mode.
If the weapon or chip has an area of effect (e.g. the Grenade Launcher), damage drops by 20% for each cell away from the center of the explosion.
> Example: > At the center, the Grenade Launcher deals 100% of its damage ([55,63] with 0 strength). One cell away, it deals 80% ([44, 50]); two cells away, 60% ([33,37]), and so on.
> (Skip this step for poison and nova attacks.)
Armor comes in two kinds: relative (as a %) and absolute (a flat value). It is applied after the total damage is calculated, using this formula:
> Example: > With 20 relative armor and 15 absolute armor, ignoring strength, an attack of [75,120] deals [45,81] final damage to the target.
> Example 2: > Against a Machine Gun [10-15] x3 with 15 absolute armor, ignoring strength, each bullet deals at most 15 - 15 = 0 damage. So the target takes no damage at all.
Note: If the target has 100 relative armor, it is immune to damage (unless it has vulnerability or another negative mechanic lowers its armor).
There are two kinds: absolute (EFFECT_ABSOLUTE_VULNERABILITY) and relative (EFFECT_VULNERABILITY). They are subtracted from the target's absolute or relative armor respectively, and can even make it negative (which then increases the damage taken).
> Example: > - A Shotgun [33,43] hits a target with 15 absolute armor: [18,28] damage. > - Right after, -20 absolute armor is applied (vulnerability). The target's absolute armor drops to -5. > - A second [33,43] attack then deals [38,48] (because negative armor increases the damage taken).
Depending on the attack type, the final damage (after strength/magic/science, power, AoE, armor and vulnerability) is then applied to the target.
Erosion lowers an entity's max life whenever it takes damage.
> Examples: > - Losing 100 life to a direct attack = max life drops by 5. > - Losing 100 life to poison = max life drops by 10.
> *(Only for EFFECT_DAMAGE: no life steal on yourself, nor with EFFECT_LIFE_DAMAGE, poison or nova.)*
After armor is applied, the attacker can recover a percentage of the damage dealt, proportional to its Wisdom:
> (Ignored for poison and nova attacks.)
If the target has damage return (EFFECT_DAMAGE_RETURN), the attacker takes a percentage of the damage dealt before the target's armor is applied.
This damage ignores the attacker's armor, so it can be higher than the final damage if the target has a lot of armor or more than 100% damage return.
In Battle Royale, or when destroying a chest, killing an entity grants a Power bonus (10 for a leek, 2 for a bulb, plus 50% of the power the victim had built up). This can affect the damage of the following attacks if several effects are chained in the same action.
1. Random roll of the base damage (only once). 2. Passive effects of forgotten weapons (attacker). 3. Characteristics applied (Strength/Power). 4. AoE reduction (if any). 5. Armor (defender) + any vulnerability. 6. Damage applied (defender). 7. Erosion (defender). 8. Passive effects of forgotten weapons (defender). 9. Life Steal (attacker). 10. Damage return (defender) and Erosion from the return (attacker). 11. Power gain on a kill (in BR or on a chest).
> Notes: > - For EFFECT_LIFE_DAMAGE (Punishment chip), damage is based on the attacker's life, and there is no life steal. > - If the attacker and the defender are the same entity (e.g. hitting yourself), life steal and damage return do not apply.
Poisons ignore armor, life steal and damage return. The resolution order is:
1. Random roll of the base damage (only once). 2. Passive effects of forgotten weapons (attacker). 3. Characteristics applied (Magic/Power). 4. AoE reduction (if any).
Then, at the start of the target's turn:
1. Damage applied (defender). 2. Erosion (defender). 3. Passive effects of forgotten weapons (defender). 4. Power gain on a kill.
> Note > At the start of each turn, the active leek's effects are computed in the order returned by getEffects. This means the order of heals and poison damage matters, since a leek can die before it gets healed, or the other way around.
Similar to poisons, but they also deal immediate damage when applied:
1. Random roll of the base aftereffect value (damage) (only once). 2. Passive effects of forgotten weapons (caster). 3. Characteristics applied (the caster's Science) + AoE reduction. 4. Damage applied (recipient) + Erosion. 5. Passive effects of forgotten weapons (recipient).
Then, at the start of each of the recipient's turns:
1. Damage applied again (recipient). 2. Erosion (recipient). 3. Passive effects of forgotten weapons (recipient). 4. Power gain on a kill (in BR or on a chest).
Aftereffects cannot be removed with the Antidote chip.
Nova damage hits the target's max life, capped at the amount of life it is missing:
1. Random roll of the base nova damage (only once). 2. Passive effects of forgotten weapons (attacker). 3. Characteristics applied (Science/Power). 4. AoE reduction (if any). 5. Nova damage applied (defender) (ignores armor and damage return, no life steal). 6. Passive effects of forgotten weapons (defender).
When a critical hit occurs, a 1.3 multiplier (the CRITICAL_FACTOR constant) is applied right at the random roll of the damage (step 1). The whole effect of the item (damage, etc.) is therefore boosted by +30%. In addition:
Forgotten weapons can have passive effects (such as EFFECT_DAMAGE_TO_ABSOLUTE_SHIELD, which turns a percentage of the damage taken into absolute shield). These passives:
Passive effects have names of the form EFFECT_[event]_TO_[characteristic]. When the event is detected, an effect is applied to the entity holding the forgotten weapon. This effect is always a raw (non-amplified) effect, usually of type EFFECT_RAW_BUFF_[characteristic] (EFFECT_RAW_ABSOLUTE_SHIELD for absolute shield, EFFECT_RAW_HEAL for healing). For example, EFFECT_MOVED_TO_MP triggers when the entity is moved. When that happens, it receives an EFFECT_RAW_BUFF_MP effect.
Each effect type (physical, poison, aftereffects, nova) has its own quirks, with specific interactions (armor, erosion, damage return, life steal). The key points to remember are:
1. Base damage is rolled only once (even for multi-hit attacks). 2. Characteristics (Strength, Magic, Science, Power) then modify that damage. 3. Armor (relative and absolute) applies to physical attacks, but not to poison or nova damage. 4. The damage taken causes erosion, which lowers the leeks' max life. 5. Extra mechanics (life steal, damage return, critical hits, forgotten weapon passives) can also kick in at each step.
By understanding exactly how each step unfolds, you will be better equipped to fine-tune your attack and defense strategies to the situation. Good luck in the arena!
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.