Пример #1
0
void UItem::InitializeItem(AProtuXPlayer* initializer)
{
	if (initializer->IsValidLowLevelFast())
	{
		this->Player = initializer;
		Stats = Player->Stats.ClampAddStats(Stats); //applying the stats to the player, clamping values
		ApplyItem();
	}
}
Пример #2
0
WORD W_EXPORT KppEnumItem(WORD wType, 
                          WORD (W_EXPORT *lpFunc)(LPSTR, LPSTR),
                          LPSTR lpArg)
{
    GLOBALHANDLE hChunk;
    WORD wItemSize;

    GetHandle (wType, &hChunk, &wItemSize, GET_CHUNK);
    if (!hChunk)
        return FALSE;

    bAppChanged = TRUE;

    return ApplyItem(hChunk, 0, lpFunc, lpArg, wItemSize, (BITS) kENUMMODE);
}
Пример #3
0
/*  Given the name of an itemm, return the handle of that item
*/
ITEMID W_EXPORT KppGetItemFromName(WORD wType, ATOMID idName, LPLPSTR lpItem)
{
    ITEMID idItem = NULLID;
    GLOBALHANDLE hChunk;
    WORD wItemSize, wMax;

    if (wType == OBJECT || wType == CLASS || wType == OBJCLA)
    {
        ITEMID idObj = Get_AtomObject(wType, idName);

        if (lpItem && idObj)
            *lpItem = KppGetItem(OBJECT_TYPE(idObj), idObj);
        
        return idObj;
    }

    wMax = GetHandle(wType, &hChunk, &wItemSize, GET_CHUNK);
    
    if (!hChunk)
        return NULLID;

    if (wType == FUNC || wType == GOAL || wType == RULE)
    {
        ITEMID idCode = GetItemFromAccessTable(wType, hChunk, idName, 
                                               wMax, wItemSize, lpItem);
        if (idCode && lpItem)
            *lpItem = KppGetItem(wType, idCode);
        
        return idCode;
    }

    bAppChanged = TRUE;
    
    idItem = ApplyItem(hChunk, (LPSTR FAR *) lpItem, 
                       (WORD (W_EXPORT *)()) NULL,
                       (LPSTR) ((DWORD) idName), wItemSize, (BITS) kNAMEMODE);

    if (idItem && wType == CLASS)
        ADD_CLASS_FLAG(idItem);
    
    return idItem;
}