Difference between revisions of "Combat CheckBackStab"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m
m
Line 6: Line 6:
  
 
Variables:
 
Variables:
 +
 +
Returns:
  
 
Used for:
 
Used for:

Revision as of 06:55, 1 August 2011

Called by:

Calls:

Parameters:

Variables:

Returns:

Used for:

// -----------------------------------------------------------------------------
// Check if backstab conditions are true
// -----------------------------------------------------------------------------
int Combat_CheckBackstab(object oAttacker, object oTarget, object oWeapon, float fFlankingBonus)
{
 
    // -------------------------------------------------------------------------
    // If we we are a rogue
    // -------------------------------------------------------------------------
    if (!HasAbility(oAttacker, ABILITY_TALENT_HIDDEN_ROGUE))
    {
        return FALSE;
    }
 
    if (!IsHumanoid(oAttacker))
    {
        return FALSE;
    }
 
    // -------------------------------------------------------------------------
    // And target is not immune
    // -------------------------------------------------------------------------
    if (HasAbility(oTarget, ABILITY_TRAIT_CRITICAL_HIT_IMMUNITY))
    {
        return FALSE;
    }
 
    // -------------------------------------------------------------------------
    // And attacker does not use double strike mode
    // -------------------------------------------------------------------------
    if (IsModalAbilityActive(oAttacker, ABILITY_TALENT_DUAL_WEAPON_DOUBLE_STRIKE))
    {
        return FALSE;
    }
 
 
     // -------------------------------------------------------------------------
    // We can only backstab if we are flanking.
    // -------------------------------------------------------------------------
    if (fFlankingBonus>0.0)
    {
        return TRUE;
    }
    else
    {
         /* Coup de grace*/
        if (HasAbility(oAttacker, ABILITY_TALENT_BACKSTAB))
        {
            if (GetHasEffects(oTarget, EFFECT_TYPE_STUN))
            {
                return TRUE;
            }
            else if (GetHasEffects(oTarget, EFFECT_TYPE_PARALYZE))
            {
                return TRUE;
            }
        }
 
    }
 
    return FALSE;
}

Category: Combat_H