GetSizeModifier

From NWN Lexicon
Jump to navigationJump to search


GetSizeModifier(object)

Gets the creature's applicable size modifier.

int GetSizeModifier(
    object oCreature
);

Parameters

oCreature

The creature whose size modifier you want.


Description

Gets the creature's applicable size modifier.



Remarks

According to the comments in the function's header, this is used in Bigby's Forceful hand for the 'bullrush' attack.


Requirements

#include " x0_i0_spells "


Version

???

Example

// Function source code from x0_i0_spells.
int GetSizeModifier(object oCreature)
{
    int nSize = GetCreatureSize(oCreature);
    int nModifier = 0;
    switch (nSize)
    {
    case CREATURE_SIZE_TINY: nModifier = -8;  break;
    case CREATURE_SIZE_SMALL: nModifier = -4; break;
    case CREATURE_SIZE_MEDIUM: nModifier = 0; break;
    case CREATURE_SIZE_LARGE: nModifier = 4;  break;
    case CREATURE_SIZE_HUGE: nModifier = 8;   break;
    }
    return nModifier;
}

See Also

functions: 

GetCreatureSize

constants: 

CREATURE_SIZE_*



author: Mistress