Damage mechanics: Difference between revisions

Jump to navigation Jump to search
(Edit by user Okfs877)
(Added technical details section explaining the different functions used to implement damage riders)
Line 292: Line 292:
|}
|}


== Technical details ==
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:


==Potential Bugs==
* <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>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]].
 
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.
==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:  
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: