Difference between revisions of "Combat damage h.nss"
From Dragon Age Toolset Wiki
(→GetCriticalDamageModifier) |
BryanDerksen (Talk | contribs) m (Category:Scripts) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 21: | Line 21: | ||
==== Combat_Damage_GetBackstabDamage ==== | ==== Combat_Damage_GetBackstabDamage ==== | ||
− | Determines the backstab damage given attacker and attack damage. (weapon is passed in for future use) | + | Determines the backstab damage given an attacker and attack damage. (weapon is passed in for future use) |
Note: This function was slightly modified from the toolset version to remove some non-essential elements for clarity. | Note: This function was slightly modified from the toolset version to remove some non-essential elements for clarity. | ||
Line 28: | Line 28: | ||
{ | { | ||
// ------------------------------------------------------------------------ | // ------------------------------------------------------------------------ | ||
− | // Each backstab | + | // Each backstab does critical damage. |
// ------------------------------------------------------------------------ | // ------------------------------------------------------------------------ | ||
fDamage *= GetCriticalDamageModifier(oAttacker); | fDamage *= GetCriticalDamageModifier(oAttacker); | ||
Line 45: | Line 45: | ||
} | } | ||
</dascript> | </dascript> | ||
+ | |||
+ | [[Category:Scripts]] |
Latest revision as of 18:47, 14 January 2010
Contents
Overview
combat_damage_h.nss handles the core rule resolution logic for non-spell damage.
Notable Functions
GetCriticalDamageModifier
Returns the multiplier for critical hit damage.
Combat_Damage_GetBackstabDamage
Determines the backstab damage given an attacker and attack damage. (weapon is passed in for future use) Note: This function was slightly modified from the toolset version to remove some non-essential elements for clarity.
float Combat_Damage_GetBackstabDamage(object oAttacker, object oWeapon, float fDamage) { // ------------------------------------------------------------------------ // Each backstab does critical damage. // ------------------------------------------------------------------------ fDamage *= GetCriticalDamageModifier(oAttacker); // ------------------------------------------------------------------------- // Exploit Weakness: Backstab Damage + max(CUN-10,0) / 3.0 // ------------------------------------------------------------------------- if (HasAbility(oAttacker,ABILITY_TALENT_EXPLOIT_WEAKNESS)) { float fBase = MaxF(0.0,(GetAttributeModifier(oAttacker,PROPERTY_ATTRIBUTE_CUNNING)/3.0)) ; float fMod = MaxF(0.2,RandomFloat()); fDamage += (fBase * fMod); } return fDamage; }