Damage mechanics: Difference between revisions

Jump to navigation Jump to search
(Added technical details section explaining the different functions used to implement damage riders)
m (Fixed line breaks in 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>: 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: {{DamageText|2|Acid}} from [[Caustic Band]].
* <code>WeaponDamage()</code>, <code>CharacterWeaponDamage()</code>, and <code>CharacterUnarmedDamage()</code>: 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: {{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>: 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>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>: 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]].