Ad placeholder
Damage mechanics: Difference between revisions
m (Fixed line breaks in technical details section) |
m (Actually fixed the line breaks in the technical details section?) |
||
Line 295: | Line 295: | ||
The scripts defining all the effects in the game are found in <code>.txt</code> files inside <code>Gustav.pak</code> and <code>Shared.pak</code>. (See [[Modding:Unpacking and converting files]]). In these scripts, damage rider effects are implemented with one of several damage functions. These are: | The scripts defining all the effects in the game are found in <code>.txt</code> files inside <code>Gustav.pak</code> and <code>Shared.pak</code>. (See [[Modding:Unpacking and converting files]]). In these scripts, damage rider effects are implemented with one of several damage functions. These are: | ||
* <code>WeaponDamage()</code>, <code>CharacterWeaponDamage()</code>, and <code>CharacterUnarmedDamage()</code>: | * <code>WeaponDamage()</code>, <code>CharacterWeaponDamage()</code>, and <code>CharacterUnarmedDamage()</code>:<br />The basic, well-behaved damage bonuses are implemented with this function. The bonus will apply ''only'' to the triggering attack, and nothing else.<br />Example effect: {{DamageText|2|Acid}} from [[Caustic Band]]. | ||
* <code>DamageBonus()</code>: Damage riders using this function will apply their bonus damage to each independent damage instance. When combined with damage riders using <code>DealDamage()</code> (see below), a single attack can create numerous independent damage instances. In these cases, <code>DamageBonus()</code> will apply its bonus damage multiple times, but <code>WeaponDamage()</code> only once. Example effect: {{DamageText|2|Radiant}} from [[Callous Glow Ring]]. | * <code>DamageBonus()</code>:<br />Damage riders using this function will apply their bonus damage to each independent damage instance. When combined with damage riders using <code>DealDamage()</code> (see below), a single attack can create numerous independent damage instances. In these cases, <code>DamageBonus()</code> will apply its bonus damage multiple times, but <code>WeaponDamage()</code> only once.<br />Example effect: {{DamageText|2|Radiant}} from [[Callous Glow Ring]]. | ||
* <code>DealDamage()</code>: This function is used by all damaging attacks, spells, and status effects to apply their damage. It is also used by "'''damage riders treated as damage sources'''" to apply their bonus damage. It creates a separate damage instance that can be independently boosted by applicable <code>DamageBonus()</code> effects. Furthermore, damage riders using <code>DealDamage()</code> can trigger each other in some cases, creating far more damage instances than might be expected. Example effect: {{DamageText|1d8|Physical}} from [[Colossus Slayer]]. | * <code>DealDamage()</code>:<br />This function is used by all damaging attacks, spells, and status effects to apply their damage. It is also used by "'''damage riders treated as damage sources'''" to apply their bonus damage. It creates a separate damage instance that can be independently boosted by applicable <code>DamageBonus()</code> effects. Furthermore, damage riders using <code>DealDamage()</code> can trigger each other in some cases, creating far more damage instances than might be expected.<br />Example effect: {{DamageText|1d8|Physical}} from [[Colossus Slayer]]. | ||
Each of these functions can optionally specify the damage type. If not specified, the damage type will be inherited from the triggering <code>DealDamage()</code> instance. | Each of these functions can optionally specify the damage type. If not specified, the damage type will be inherited from the triggering <code>DealDamage()</code> instance. |
Revision as of 22:10, 21 October 2023
Damage Sources (DS) vs. Damage Riders (DR)
A damage source could be described as what initializes the damage. Examples include striking a target with your weapon, a spell, or thrown items such as an Alchemist's Fire. Damage sources often require the use of an action (e.g. throwing an object such as a grenade), bonus action (e.g. making an attack with your offhand weapon while dual wielding), or reaction (e.g. the spell).
A damage rider is something which adds additional damage onto the damage source. It can only be present in the event there is an applicable damage source for it to "ride along" with, hence the name of a damage rider. Examples of damage riders include the coatings applied to weapons providing additional damage to a weapon attack, a 6th level applying their elemental affinity to a spell of the appropriate damage type, or a raging adding rage damage to their weapon attacks. Many damage riders are gained from passives or other forms of buffs. Any eligible damage riders from a damaging effect will be applied to a damage source which is a part of that damaging effect.
spell adding damage to the damage from a Warlock's or weapon attacks,
Damage Riders treated as Damage Sources (DRS)
There are some damage riders which defy the typical trends described above. They still must "ride along" with a damage source in order to be applied, but when the damage is calculated they are treated as damage sources instead of damage riders. This means that these "damage riders which are treated as damage sources" can then cause normal damage riders to be applied once again as part of the same ability (e.g. attack or spell) which caused the damage.
Example Calculation
A character with 18 Strength, the Tavern Brawler Feat, , and the Ring of Flinging uses the Returning Pike to make a thrown weapon attack against a target which is affected by .
Damage Sources (DS):
- Thrown weapon attack using the Returning Pike applies 1d10 (damage die) + 1 (weapon enchantment) + 4 (Strength modifier) piercing damage
Damage Riders (DR):
- add +1 Lightning Damage to each damage source
- The Ring of Flinging adds 1d4 damage which is of the same type as the weapon used (piercing in this example) to each damage source.
- adds 1d6 necrotic damage to each damage source.
Damage Riders treated as Damage Sources (DRS):
- The Tavern Brawler feat allows characters to add their Strength modifier an additional time to damage rolls when using unarmed strikes, improvised weapons, or thrown weapons. When applied to melee attacks this damage bonus is treated as a damage rider. But as of Patch 3 with thrown weapons, this +4 piercing damage from the character's strength score being applied a second time due to the tavern brawler feat being treated as a damage source.
Calculating total damage:
To determine the total damage applied take each DS and DRS. Then apply the damage riders onto each of these. In this example that means one should evaluate the pike damage source plus all damage riders, followed by the Tavern Brawler damage source and all damage riders applied again.
Tavern Brawler on thrown weapon attacks is a DRS, meaning the damage roll in the above scenario would on average yield 28.5 total damage (ignoring resistances) calculated as follows:
- 1d10 (5.5 avg) (weapon damage die) + 1 (weapon enchantment) + 4 (Strength modifier) Piercing from the Returning Pike thrown weapon attack, [DS]
- +1d4 (2.5 avg) Piercing damage from the Ring of Flinging, [DR]
- +1 Lightning damage from , [DR]
- +1d6 (3.5 avg) Necrotic damage from , [DR]
- +4 Piercing damage from Tavern Brawler, [DRS]
- +1d4 (2.5 avg) Piercing damage from the Ring of Flinging being applied to Tavern Brawler damage source, [DR]
- +1 Lightning damage from being applied to Tavern Brawler damage source, [DR]
- +1d6 (3.5 avg) Necrotic damage from being applied to Tavern Brawler damage source [DR]
As a hypothetical scenario to show the impact that this minor detail can have, instead imagine Tavern Brawler were to be treated as a DR in the above scenairo. In this hypothetical scenario the above damage roll would yield 21.5 total damage on average (ignoring resistances) calculated as follows:
- 1d10 (5.5 avg) (weapon damage die) + 1 (weapon enchantment) + 4 (Strength modifier) Piercing from the Returning Pike thrown weapon attack, [DS]
- +1d4 (2.5 avg) Piercing damage from the Ring of Flinging, [DR]
- +1 Lightning damage from , [DR]
- +1d6 (3.5 avg) Necrotic damage from , [DR]
- +4 Piercing damage from Tavern Brawler, [If Tavern Brawler were to hypothetically be treated as a DR with thrown weapon attacks]
DRS Effects
The following are a list of items and abilities which have DRS effects, and what the relevant DRS effect is.
Item | Act Found | Relevant Effect | Notes |
---|---|---|---|
Arrow of Acid | All | Deals Weapon Damage + 2d4Acid (Dexterity Save to negate). Creates a permanent Acid Surface. | N/a |
Arrow of Fire | All | Deals weapon damage + 2d4Fire (Dexterity Save to negate). Creates a Fire Surface for 2 turns. | N/a |
Arrow of Ice | All | Deals weapon damage + 2d4Cold (Dexterity Save to negate). Creates an Ice Surface for 2 turns. | N/a |
Arrow of Lightning | All | Deals weapon damage + 2d4Lightning (Dexterity Save to negate). | N/a |
All | Spend 6 m / 20 ft of your movement to deal additional physical damage (minimum 1) on each successful weapon attack for the rest of the turn. | Weapon Action available to all Greataxes. Recharges on Short Rest | |
Assassin's Touch | One | Deathly Slumber: Deals an additional 1d4 Necrotic damage to creatures that are or . | N/a |
Hoppy: Revitalising Strike | One | Revitalising Strike: Smash into a foe, wounding them and healing your own injuries. On a hit, heal 1d6hit points. You deal additional Necrotic damage equal to your Proficiency Bonus. | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
Very Heavy Greataxe: Gargantuan Cleave | One or Two | Gargantuan Cleave: Swing your weapon with all your might. You can attack multiple targets, but become . | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
The Undead Bane: Profane Scourge | Three | Profane Scourge: Strike with subjugating fury, adding your Proficiency Bonus to the damage roll. If you hit a Fiend or Undead creature, deal an additional 2d6Slashing damage and possibly it. Undead and Constructs can't . | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. This weapons special bonus damage vs undead and fiends is applied to both the weapons base damage and the damage applied by the Profane Scourge weapon action. |
The Sacred Star: Dawnburst Strike | Three | Dawnburst Strike: Deal additional Radiant damage equal to your Proficiency Bonus. On a hit, light erupts around you in a 3m / 10ft area. Enemies in the light must succeed a DC 13 Constitution Saving Throw or be . | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
Soulbreaker Greatsword: Soulbreaker | One | Soulbreaker: Rend the enemy's body and soul, dealing an additional 4Psychic damage, and possibly them. | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
Silver Sword of the Astral Plane: Soulbreaker | One or Three | Soulbreaker: Rend the enemy's body and soul, dealing an additional 4Psychic damage, and possibly them. | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
Ritual Dagger: Blood Sacrifice | One | Blood Sacrifice: Pain is a path to power. Take 1d4Slashing damage to receive a +1d4 bonus to Attack Rolls and Saving Throws. | Damage riders are applied to the self inflicted damage. |
Loviatar's Scourge: Willing Whip | One | Willing Whip: Grants Resistance to Necrotic damage. Deals an additional 1d6Necrotic damage to nearby targets, including the wielder. | This damage does not benefit from many damage riders that are applied to the base weapon attack. For instance when used as part of a smite attack, bonus damage applied to spells is not applied to the damage caused by the willing whip ability. |
Shortsword of First Blood | One | Break the Unbroken: Deal an additional 1d8Piercing damage to targets that still have all their hitpoints. | The target must be at full health. |
Moonlight Glaive: Moonlight Butterflies | Two | Moonlight Butterflies: Strike a foe, conjuring an illusory swarm of moon-pale butterflies, gaining Advantage on attacks against the target. Deal additional Psychic damage equal to your Proficiency Bonus. When the target moves away from your illusion, it takes 1d6Psychic damage. | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
Justiciar's Scimitar: Shadowsoaked Blow | Two | Shadowsoaked Blow: Strike an enemy, adding your Proficiency Bonus to the damage. Moreover, if the attack hits, it also deals an additional 1d6Psychic damage. This attack doesn't break concealment. | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
Punch-Drunk Bastard | Three | Tippler's Rage: When you have the condition, you have Advantage on Attack Rolls. You also create a blast with each attack, dealing 1d4Thunder damage for 3m / 10ft. | This damage does not benefit from many damage riders that are applied to the base weapon attack. For instance when used as part of a smite attack, bonus damage applied to spells is not applied to the damage caused by the Tippler's Rage ability. |
The Blast Pendant: Lightning Blast | One | Lightning Blast: Once per Long Rest you may focus the electricity in your veins as a bonus action. Your next lightning spell or cantrip deals additional Lightning Lightning damage equal to your remaining . On a hit, all of your Lightning Charges are consumed. | This is a usable once per long rest and only applies to Lightning Spells or cantrips. |
Lightning Jabber | Two | Throwing: Lighting Damage: When launched at a target, deal an additional 1d4Lightning damage. | This is only works when thrown. |
Nyrulna: Zephyr Connection | Three | Zephyr Connection: This weapon will return to your hand when thrown. You cannot be forced to drop the trident. When thrown, the weapon creates an explosion that deals 3d4Thunder damage in a 6m/20ft blast centered on the target. | This is only works when thrown.
This damage does not benefit from many damage riders that are applied to the base weapon attack. |
Phalar Aluve: Shriek | One | All enemies within 6m of range have a 1d4 penalty to Charisma, Wisdom and Intelligence Saving Throws. Affected creatures receive an extra 1d4Thunder damage. The sword will stop Shrieking if unequipped. | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
Dragon's Grasp: Burned Alive | One | Deals an additional 1d4Slashing damage to targets. | Can apply multiple times. |
Firestoker: Burned Alive | One | Deals an additional 1d4Piercing damage to targets. | Can apply multiple times. |
Exterminator's Axe: Scourge of Pets | One | Deals an additional 1d6Fire damage to Plants, Insects or Small creatures. | N/a |
Deep Delver: Dig Deep | One | Inflicts Shattered on hit. When attacking a Shattered target, deal an additional 1d4Piercing damage. | N/a |
Blooded Greataxe: Relentless Revenge | One | When the wielder has 50% hit points or less, they deal an additional 1d4Slashing damage. | N/a |
Sword of Life Stealing | Two | On a Critical Hit, the target takes an extra 10Necrotic damage as long as it isn't a construct or an undead. You also gain 10 temporary hit points. | N/a |
Render of Mind and Body: Psychic Steel Virtuoso | Two | When the wielder attacks with Advantage, they deal an additional 1d8Psychic damage | N/a |
Stalker Gloves: Skullduggery Attack | Three | Your 1d4Force damage | deals an additionalN/a |
Craterflesh Gloves: Craterous Wounds | Three | Whenever you score a Critical Hit, deal an additional 1d6Force damage. | N/a |
Balduran's Giantslayer: Topple the Big Folk | Three | Deal additional damage equal to your Proficiency Bonus. On a hit, Large, Huge, or Gargantuan creatures take an additional 2d6Slashing damage and must suceed a Strength Saving Throw or fall Prone. | This is a weapon action specific to this weapon. As with all weapon actions, it recharges on a short rest. |
Crimson Mischief: Redvein Savagery | Three | (Only when wielded in main hand) When you make an attack with Advantage, the target takes an additional 7Piercing damage. | This applies for most damage sources in the base attack, It does not apply on some DRSs eg the ranger colossus slayer ability. |
Duelist's Prerogative: Withering Cut | Three | (Only when wielded in main hand) On a hit with a melee weapon, use a reaction to deal additional Necrotic damage equal to your Proficiency Bonus. | N/a |
Class | Level
Obtained |
Relevant Effect | Notes |
---|---|---|---|
1 | Advantage against. You can also use Sneak Attack if you have an ally within 1.5m / 5ft of the target and you don't have Disadvantage.
|
: Deal an extra 1d6 damage to a foe you have Sneak Attack is only treated as a damage source if you use the automatic reaction. Using the Sneak Attack action is instead treated as a damage rider. | |
2 | 2d8Radiant damage. Deals an additional 1d8Radiant damage to Fiends and Undead. | : Your weapon emanates divine might as you strike, dealing an additionalN/a | |
3 | 1d8Physical damage if the target is below its hit point maximum | : Once per turn, your weapon attack deals an extraThis can be applied multiple times for each damage source in the portion of the attack that triggers it. This could include the entire attack or just portions of it. | |
8 | : Once per turn, deal 1d8 damage (damage type depends on Cleric Domain) in addition to your weapon's damage. | The 1d8Physical variant from is treated as a damage source only when triggered as a reaction. All other variants of work as damage sources either when used as a reaction or when used directly. | |
11 | 3d8Psychic damage. | : Teleport to a foe from a hidden position, striking them with the creeping, psychic ferocity of the shadows themselves, dealing an additionalN/a | |
12 | Necrotic equal to your Charisma modifier. | : Your melee attacks deal additionalN/a |
Ability | Ability Type | Relevant Effect | Notes |
---|---|---|---|
1st Level Spell | Mark a creature as your quarry to deal an additional 1d6Physical damage whenever you hit it with a weapon attack. | Only when used with thrown weapon attacks. | |
Feat | When you make an unarmed attack, use an improvised weapon, or throw something, your strength modifier is added twice to the damage and Attack Roll | Only when used with thrown weapon attacks. |
Technical details
The scripts defining all the effects in the game are found in .txt
files inside Gustav.pak
and Shared.pak
. (See Modding:Unpacking and converting files). In these scripts, damage rider effects are implemented with one of several damage functions. These are:
WeaponDamage()
,CharacterWeaponDamage()
, andCharacterUnarmedDamage()
:
The basic, well-behaved damage bonuses are implemented with this function. The bonus will apply only to the triggering attack, and nothing else.
Example effect: 2Acid from Caustic Band.DamageBonus()
:
Damage riders using this function will apply their bonus damage to each independent damage instance. When combined with damage riders usingDealDamage()
(see below), a single attack can create numerous independent damage instances. In these cases,DamageBonus()
will apply its bonus damage multiple times, butWeaponDamage()
only once.
Example effect: 2Radiant from Callous Glow Ring.DealDamage()
:
This function is used by all damaging attacks, spells, and status effects to apply their damage. It is also used by "damage riders treated as damage sources" to apply their bonus damage. It creates a separate damage instance that can be independently boosted by applicableDamageBonus()
effects. Furthermore, damage riders usingDealDamage()
can trigger each other in some cases, creating far more damage instances than might be expected.
Example effect: 1d8Physical from Colossus Slayer.
Each of these functions can optionally specify the damage type. If not specified, the damage type will be inherited from the triggering DealDamage()
instance.
Potential bugs
The following items compose a non-exhaustive list which indicates that the "Damage Riders" as compared to "Damage Riders treated as Damage Sources" may include several bugs and therefore many of these abilities may change in future patches:
- Patch 3 changed Lightning Charges from a "Damage Rider treated as a Damage Source" to a "Damage Rider."
- Tavern Brawler is treated as a Damage Rider with unarmed attacks and improvised weapon attacks, but as a "Damage Rider treated as a Damage Source" when it comes to thrown weapon attacks.
- Sneak Attack is treated as a Damage Rider when a character uses the Sneak Attack action, but as a "Damage Rider treated as a Damage Source" when Sneak Attack is applied by the automatic reaction system.