User:NtCarlson/Sandbox: Difference between revisions

Jump to navigation Jump to search
(Added universal damage rider discussion)
(Added DRS intro and made some minor edits)
Line 199: Line 199:
The top 5 '''damage riders''' in the above list are '''universal'''. They will apply to any damage instance, even ones '''detached''' from a spell or attack. All the other '''damage riders''' involve conditions like <code>IsSpell()</code> or <code>IsMeleeAttack()</code> so any damage instance that is not a part of a spell or weapon attack cannot be boosted by these non-'''universal damage riders'''. Status effect damage like {{Cond|Simple Toxin}} is an example of damage '''detached''' from any attack or spell that can only be boosted by '''universal damage riders'''. See below for a more detailed discussion of '''detached''' damage instances.
The top 5 '''damage riders''' in the above list are '''universal'''. They will apply to any damage instance, even ones '''detached''' from a spell or attack. All the other '''damage riders''' involve conditions like <code>IsSpell()</code> or <code>IsMeleeAttack()</code> so any damage instance that is not a part of a spell or weapon attack cannot be boosted by these non-'''universal damage riders'''. Status effect damage like {{Cond|Simple Toxin}} is an example of damage '''detached''' from any attack or spell that can only be boosted by '''universal damage riders'''. See below for a more detailed discussion of '''detached''' damage instances.


== <code>DealDamage()</code>==
== Damage rider sources (<code>DealDamage())</code> ==
Damage bonus implemented with <code>DealDamage()</code> (i.e. '''Damage rider sources''') are the underlying cause for much of the unintuitive damage mechanics in Baldur's Gate 3.
 
All attacks or damaging spells are implemented using <code>DealDamage()</code>, so any damage bonus implemented using that same function will behave somewhat like an independent attack or spell.
Importantly, this means that '''damage rider sources''' can potentially trigger each other causing an exponential explosion in the number of damage instances (with the right combination of '''DRS''' effects).
As previously stated, adding '''DRS''' effects to an attack will also multiple the effectiveness of '''damage riders'''.
 
=== Exponential behavior when combining DRS effects ===


=== Attached vs detached instances ===
=== Attached vs detached instances ===
There are two sub-categories of <code>DealDamage()</code> instances: '''attached''' and '''detached'''.
There are two sub-categories of '''DRS''' effects that determine how they interact with '''damage riders''': '''attached''' and '''detached'''.
*A <code>DealDamage()</code> instance '''attached''' to an attack or spell will be grouped and indented under a heading like "X used Main Hand Attack" or "X cast Fire Ball". Most '''DRS''' effects will be attached to the triggering attack.
*A '''DRS''' effect '''attached''' to an attack or spell will be grouped and indented under a heading like "X used Main Hand Attack" or "X cast Fire Ball". Most '''DRS''' effects will be attached to the triggering attack.
*A '''detached''' <code>DealDamage()</code> instance will appear separately in the damage log, not grouped with the triggering attack. '''DRS''' effects wind up detached because they call <code>DealDamage()</code> indirectly. For example:
*A '''detached''' instance will appear separately in the damage log, not grouped with the triggering attack. '''DRS''' effects wind up detached because they call <code>DealDamage()</code> indirectly. For example:
**When standing in a Burning surface, the {{RarityItem|Amulet of Elemental Torment}} will effectively add a {{DamageText|1d4|Fire}} '''DRS'''. The amulet's effect doesn't call <code>DealDamage()</code> directly, but instead calls <code>ApplyStatus(BURNING)</code>. On application, the {{Cond|Burning}} status effect calls <code>DealDamage()</code> immediately.
**When standing in a Burning surface, the {{RarityItem|Amulet of Elemental Torment}} will effectively add a {{DamageText|1d4|Fire}} '''DRS'''. The amulet's effect doesn't call <code>DealDamage()</code> directly, but instead calls <code>ApplyStatus(BURNING)</code>. On application, the {{Cond|Burning}} status effect calls <code>DealDamage()</code> immediately.
**To apply its {{DamageText|1d4|Thunder}} damage, the {{RarityItem|Punch-Drunk Bastard}} calls <code>CreateExplosion()</code> which then calls <code>DealDamage()</code>.
**To apply its {{DamageText|1d4|Thunder}} damage, the {{RarityItem|Punch-Drunk Bastard}} calls <code>CreateExplosion()</code> which then calls <code>DealDamage()</code>.