You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
199 lines
5.3 KiB
199 lines
5.3 KiB
/** |
|
* @file items.h |
|
* |
|
* Interface of item functionality. |
|
*/ |
|
#ifndef __ITEMS_H__ |
|
#define __ITEMS_H__ |
|
|
|
DEVILUTION_BEGIN_NAMESPACE |
|
|
|
#ifdef __cplusplus |
|
extern "C" { |
|
#endif |
|
|
|
typedef struct ItemStruct { |
|
int _iSeed; |
|
WORD _iCreateInfo; |
|
int _itype; |
|
int _ix; |
|
int _iy; |
|
BOOL _iAnimFlag; |
|
unsigned char *_iAnimData; // PSX name -> ItemFrame |
|
int _iAnimLen; // Number of frames in current animation |
|
int _iAnimFrame; // Current frame of animation. |
|
int _iAnimWidth; |
|
int _iAnimWidth2; // width 2? |
|
BOOL _iDelFlag; // set when item is flagged for deletion, deprecated in 1.02 |
|
char _iSelFlag; |
|
BOOL _iPostDraw; |
|
BOOL _iIdentified; |
|
char _iMagical; |
|
char _iName[64]; |
|
char _iIName[64]; |
|
char _iLoc; |
|
// item_class enum |
|
char _iClass; |
|
int _iCurs; |
|
int _ivalue; |
|
int _iIvalue; |
|
int _iMinDam; |
|
int _iMaxDam; |
|
int _iAC; |
|
// item_special_effect |
|
int _iFlags; |
|
// item_misc_id |
|
int _iMiscId; |
|
// spell_id |
|
int _iSpell; |
|
int _iCharges; |
|
int _iMaxCharges; |
|
int _iDurability; |
|
int _iMaxDur; |
|
int _iPLDam; |
|
int _iPLToHit; |
|
int _iPLAC; |
|
int _iPLStr; |
|
int _iPLMag; |
|
int _iPLDex; |
|
int _iPLVit; |
|
int _iPLFR; |
|
int _iPLLR; |
|
int _iPLMR; |
|
int _iPLMana; |
|
int _iPLHP; |
|
int _iPLDamMod; |
|
int _iPLGetHit; |
|
int _iPLLight; |
|
char _iSplLvlAdd; |
|
char _iRequest; |
|
int _iUid; |
|
int _iFMinDam; |
|
int _iFMaxDam; |
|
int _iLMinDam; |
|
int _iLMaxDam; |
|
int _iPLEnAc; |
|
char _iPrePower; |
|
char _iSufPower; |
|
int _iVAdd1; |
|
int _iVMult1; |
|
int _iVAdd2; |
|
int _iVMult2; |
|
char _iMinStr; |
|
unsigned char _iMinMag; |
|
char _iMinDex; |
|
BOOL _iStatFlag; |
|
int IDidx; |
|
int offs016C; // _oldlight or _iInvalid |
|
int _iDamAcFlags; |
|
|
|
/** |
|
* @brief Checks whether this item is empty or not. |
|
* @return 'True' in case the item is empty and 'False' otherwise. |
|
*/ |
|
bool isEmpty() const { |
|
return this->_itype == ITYPE_NONE; |
|
} |
|
|
|
} ItemStruct; |
|
|
|
typedef struct CornerStoneStruct { |
|
int x; |
|
int y; |
|
bool activated; |
|
ItemStruct item; |
|
} CornerStoneStruct; |
|
|
|
extern int itemactive[MAXITEMS]; |
|
extern BOOL uitemflag; |
|
extern int itemavail[MAXITEMS]; |
|
extern ItemStruct item[MAXITEMS + 1]; |
|
extern CornerStoneStruct CornerStone; |
|
extern BOOL UniqueItemFlag[128]; |
|
extern int auricGold; |
|
extern int numitems; |
|
|
|
bool IsItemAvailable(int i); |
|
void InitItemGFX(); |
|
void InitItems(); |
|
void CalcPlrItemVals(int p, BOOL Loadgfx); |
|
void CalcPlrScrolls(int p); |
|
void CalcPlrStaff(int p); |
|
void CalcPlrInv(int p, BOOL Loadgfx); |
|
void SetPlrHandItem(ItemStruct *h, int idata); |
|
void GetPlrHandSeed(ItemStruct *h); |
|
void GetGoldSeed(int pnum, ItemStruct *h); |
|
int GetGoldCursor(int value); |
|
void SetPlrHandGoldCurs(ItemStruct *h); |
|
void CreatePlrItems(int p); |
|
BOOL ItemSpaceOk(int i, int j); |
|
int AllocateItem(); |
|
void GetSuperItemLoc(int x, int y, int *xx, int *yy); |
|
void GetItemAttrs(int i, int idata, int lvl); |
|
void SaveItemPower(int i, int power, int param1, int param2, int minval, int maxval, int multval); |
|
void GetItemPower(int i, int minlvl, int maxlvl, int flgs, BOOL onlygood); |
|
void SetupItem(int i); |
|
int RndItem(int m); |
|
void SpawnUnique(int uid, int x, int y); |
|
void SpawnItem(int m, int x, int y, BOOL sendmsg); |
|
void CreateRndItem(int x, int y, BOOL onlygood, BOOL sendmsg, BOOL delta); |
|
void CreateRndUseful(int pnum, int x, int y, BOOL sendmsg); |
|
void CreateTypeItem(int x, int y, BOOL onlygood, int itype, int imisc, BOOL sendmsg, BOOL delta); |
|
void RecreateItem(int ii, int idx, WORD icreateinfo, int iseed, int ivalue); |
|
void RecreateEar(int ii, WORD ic, int iseed, int Id, int dur, int mdur, int ch, int mch, int ivalue, int ibuff); |
|
void items_427A72(); |
|
void items_427ABA(int x, int y); |
|
void SpawnQuestItem(int itemid, int x, int y, int randarea, int selflag); |
|
void SpawnRock(); |
|
void SpawnRewardItem(int itemid, int xx, int yy); |
|
void SpawnMapOfDoom(int xx, int yy); |
|
void SpawnRuneBomb(int xx, int yy); |
|
void SpawnTheodore(int xx, int yy); |
|
void RespawnItem(int i, BOOL FlipFlag); |
|
void DeleteItem(int ii, int i); |
|
void ProcessItems(); |
|
void FreeItemGFX(); |
|
void GetItemFrm(int i); |
|
void GetItemStr(int i); |
|
void CheckIdentify(int pnum, int cii); |
|
void DoRepair(int pnum, int cii); |
|
void DoRecharge(int pnum, int cii); |
|
void DoOil(int pnum, int cii); |
|
void PrintItemPower(char plidx, ItemStruct *x); |
|
void DrawUniqueInfo(CelOutputBuffer out); |
|
void PrintItemDetails(ItemStruct *x); |
|
void PrintItemDur(ItemStruct *x); |
|
void UseItem(int p, int Mid, int spl); |
|
BOOL StoreStatOk(ItemStruct *h); |
|
void SpawnSmith(int lvl); |
|
void SpawnPremium(int pnum); |
|
void WitchBookLevel(int ii); |
|
void SpawnWitch(int lvl); |
|
void SpawnBoy(int lvl); |
|
void SpawnHealer(int lvl); |
|
void SpawnStoreGold(); |
|
void RecreateTownItem(int ii, int idx, WORD icreateinfo, int iseed, int ivalue); |
|
void RecalcStoreStats(); |
|
int ItemNoFlippy(); |
|
void CreateSpellBook(int x, int y, int ispell, BOOL sendmsg, BOOL delta); |
|
void CreateMagicArmor(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta); |
|
void CreateAmulet(int x, int y, int curlv, BOOL sendmsg, BOOL delta); |
|
void CreateMagicWeapon(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta); |
|
BOOL GetItemRecord(int nSeed, WORD wCI, int nIndex); |
|
void SetItemRecord(int nSeed, WORD wCI, int nIndex); |
|
void PutItemRecord(int nSeed, WORD wCI, int nIndex); |
|
|
|
/* data */ |
|
|
|
extern int MaxGold; |
|
|
|
extern BYTE ItemCAnimTbl[]; |
|
extern int ItemInvSnds[]; |
|
|
|
#ifdef __cplusplus |
|
} |
|
#endif |
|
|
|
DEVILUTION_END_NAMESPACE |
|
|
|
#endif /* __ITEMS_H__ */
|
|
|