Advanced fight description

Advanced fight description

Welcome to the page dedicated to fight mechanics, and more specifically to the various actions that occur during an attack.

On this page, we go through the steps of an attack and explain how its outcome is calculated. Attacks fall into two categories: physical or poison.

Order

Let's start with physical attacks. Here are the values calculated, step by step:

1. Physical damage of the weapon or chip 2. Strength (of the attacker) 3. Power (of the attacker, only relevant for Battle Royale) 4. Armor (of the defender) 5. Life steal (based on the attacker's stats) 6. Damage return (based on the defender's stats) 7. Erosion/Nova (for both the attacker and the defender)

Armor, life steal and damage return only apply to physical attacks. Magic attacks are not affected, so they only go through these steps:

1. Magic damage of the weapon or chip 2. Magic (the attacker's magical strength) 3. Power (of the attacker, only relevant for Battle Royale) 4. Erosion/Nova (of the defender)

Weapon

To attack, you need to use a weapon or a chip. Its min and max damage are shown in the item's description and can be found in its list of effects, under the EFFECT_DAMAGE or EFFECT_POISON type (see the getWeaponEffects function for more details).

Note: some weapons, e.g. the Machine Gun, list several effects. You need to calculate each of these effects as a separate attack.

During an attack, the damage value is picked at random between the min and the max (inclusive). That's the first step.

For instance, for a shot with the Magnum, damage is picked in the [25,40] range.

Note: some weapons, e.g. the Grenade Launcher, deal damage over an area around the target (AoE). Damage is at its maximum (100%) on the targeted cell, then drops by 20% for each ring of cells further out. If we break down the Grenade Launcher's radius-2 circle, damage is [55,63] on the target, then [44,50] on the radius-1 circle (the 4 cells surrounding the target cell), and [33,38] on the radius-2 circle (the cells surrounding those 4 cells). With the Grenade Launcher, any cell 3 or more cells away from the center of the explosion is unaffected.

Note: if a weapon has several attacks, they all share the same base damage. For instance, the 3 shots of the Machine Gun deal the same raw damage.

Strength (or Magic)

Once the physical damage is calculated, the attacker's strength modifies the weapon's effectiveness:

For instance, a leek with 200 strength gets a ×3 multiplier (since 1 + 200/100 = 3), so a shot with the Magnum deals [75, 120] damage.

Note: a leek's strength cannot go negative: it is floored at 0, for instance when CHIP_FRACTURE would push it below zero.

For Magic, the calculation is the same, but it uses the poison damage and is boosted by the attacker's magic.

Power

To balance Battle Royale fights and discourage the smart alecks who spend the first part of the fight hiding, a new stat specific to this game mode was introduced: power. Each leek gains 2 power per turn it stays alive, and each entity killed gives 10 power for a leek and 2 for a bulb, + 50% of the power the victim had built up. You can get this value with the getPower function. Damage is calculated like this:

Note: the getPower function returns 0 when you are not playing in Battle Royale, so there is no need to handle two different cases depending on the fight type.

Armor

(This step is skipped for poison attacks)

Armor is split into two parts: relative armor and absolute armor. Both are applied during an attack and complement each other. Damage reduced by armor is calculated as follows:

As you can see, relative armor reduces damage by a percentage, while absolute armor reduces it by a flat amount.

Example: a target with 20 relative armor and 15 absolute armor will take [45,81] final damage from the [75, 120] attack calculated in the previous section.

Example 2: a Machine Gun attack [10-15]x3 on a target with 0 armor deals [30-45] damage in total. But on a target with 15 absolute armor, all the damage is ignored, because each hit deals at most: 15*(1+0/100)-15 = 0.

Example 3: on the other hand, a Shotgun attack [33,43] on the same target with 15 absolute armor deals [18,28].

We can see that absolute armor is very effective against low damage and loses effectiveness against high damage. Conversely, relative armor is very effective against high damage (since it reduces by a percentage) and not very effective against low damage. The effects of chips that give armor are boosted by Resistance.

Note: If the target has 100 relative armor, it takes 0 damage.

Vulnerability

Vulnerability is applied to the target's armor. There are two types of vulnerability: absolute and relative (EFFECT_ABSOLUTE_VULNERABILITY and EFFECT_VULNERABILITY)

Relative vulnerability is subtracted from the target's relative armor, while absolute vulnerability is subtracted from the target's absolute armor.

Note: relative and absolute armor can perfectly well be negative. In that case, damage is increased.

Example: let's simulate 2 Shotgun attacks [33,43] on a leek with 15 absolute armor. The first attack deals [18,28], then reduces the target's absolute armor by 20. The second attack [33,43] now hits a target with -5 absolute armor, and therefore deals [38,48] damage (and keeps reducing the target's absolute armor).

Example 2: a leek with -100 relative armor takes double damage from every attack.

Life steal

(This step is skipped for poison attacks)

Life steal applies after armor is calculated. Part of the damage dealt heals the attacker. This value is boosted by wisdom, like this:

So a leek with 100 wisdom heals itself for 10% of the damage dealt to the enemy.

Notes: You cannot gain more life than your max life. If you kill the target, life steal only applies to the damage actually dealt to the target. Life steal does not apply to yourself (CHIP_DEVIL_STRIKE). It does apply to allies, though.

Damage return

(This step is skipped for poison attacks)

Some chips grant damage return (EFFECT_DAMAGE_RETURN). If the target has damage return, the attacker takes a percentage of the damage dealt before it is reduced by the target's armor. The damage is calculated as follows:

For example, if A attacks B with a Magnum [25,40] and B has 20 damage return, A takes [5,8] damage.

Note: Returned damage ignores the attacker's armor. Note 2: A can take more damage than it deals if B has enough armor.

Erosion

Erosion (or Nova damage) represents the leek's fatigue as the fight goes on. Every time an entity takes damage, its max life drops proportionally. To some extent, this reduces the number of draws caused by both opponents healing enough to hold out.

Every time an entity takes damage (attack, poison or damage return), it also takes erosion damage. This is always 5% of the damage taken, except for poisons, where it is 10%. A critical hit adds a 10% erosion bonus, bringing erosion to 15%, or to 20% of the damage taken for poison.

Example: an entity that loses 100 life from an attack also has its max life reduced by 5.

Example: an entity that loses 100 life to a poison also has its max life reduced by 10.

Note: Erosion also applies to damage return.

Advanced interactions

Critical hit

When a critical hit occurs, all of the item's effects are multiplied by 1.3 (damage included). This multiplication happens when the weapon or chip damage is calculated (so during step 1). A critical hit on a damage effect also increases erosion by 10%. A critical hit on a bulb increases its characteristics by 20%. A critical hit on a movement effect has no special effect.

Forgotten weapon passive effects

Forgotten weapons have a passive effect that can come into play during attacks. For example, the EFFECT_DAMAGE_TO_ABSOLUTE_SHIELD effect turns 5% of the damage taken into absolute shield. The effect triggers immediately after the leek takes damage. So if a leek equipped with this weapon takes a multi-hit attack (DEVIL_STRIKE, MACHINE_GUN, ...), it gains armor between the first and the second hit.

----

Page made by ArtyMorty, with the help of Magestik, Nyaleph and others. Translated by Karang.