7,623
editsAd placeholder
Damage mechanics: Difference between revisions
Jump to navigation
Jump to search
m
Actually fixed the line breaks in the technical details section?
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. |