Merged New Inventory Project into main branch

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2008-03-08 15:15:25 +00:00
parent e16d166277
commit 43ca24dda8
649 changed files with 93359 additions and 82507 deletions
+35 -11
View File
@@ -15,35 +15,59 @@
//Kaiden: This constant is to flag items that an enemy drops when they die.
#define WORLD_ITEM_DROPPED_FROM_ENEMY 0x0800
//typedef struct
struct WORLDITEM
class OLD_WORLDITEM_101
{
BOOLEAN fExists;
public:
BOOLEAN fExists;
INT16 sGridNo;
UINT8 ubLevel;
OBJECTTYPE o;
UINT16 usFlags;
OLD_OBJECTTYPE_101 oldObject;
UINT16 usFlags;
INT8 bRenderZHeightAboveLevel;
INT8 bVisible;
UINT8 ubNonExistChance;
};
class WORLDITEM
{
public:
WORLDITEM() {initialize();};
WORLDITEM& operator=(OLD_WORLDITEM_101& src);
WORLDITEM& operator=(const WORLDITEM& src);
bool operator<(WORLDITEM& compare);
BOOLEAN Save( HWFILE hFile, bool fSavingMap );
BOOLEAN Load( HWFILE hFile );
BOOLEAN Load( INT8** hBuffer, float dMajorMapVersion, UINT8 ubMinorMapVersion );
void initialize();
BOOLEAN fExists;
INT16 sGridNo;
UINT8 ubLevel;
UINT16 usFlags;
INT8 bRenderZHeightAboveLevel;
INT8 bVisible;
//This is the chance associated with an item or a trap not-existing in the world. The reason why
//This is the chance associated with an item or a trap not-existing in the world. The reason why
//this is reversed (10 meaning item has 90% chance of appearing, is because the order that the map
//is saved, we don't know if the version is older or not until after the items are loaded and added.
//Because this value is zero in the saved maps, we can't change it to 100, hence the reversal method.
//This check is only performed the first time a map is loaded. Later, it is entirely skipped.
UINT8 ubNonExistChance;
//This check is only performed the first time a map is loaded. Later, it is entirely skipped.
UINT8 ubNonExistChance;
INT8 soldierID;
}; // WORLDITEM;
char endOfPod;
OBJECTTYPE object;
};
#define SIZEOF_WORLDITEM_POD (offsetof(WORLDITEM, endOfPod))
extern WORLDITEM *gWorldItems;
extern UINT32 guiNumWorldItems;
INT32 AddItemToWorld( INT16 sGridNo, OBJECTTYPE *pObject, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 bVisible );
INT32 AddItemToWorld( INT16 sGridNo, OBJECTTYPE *pObject, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 bVisible, INT8 soldierID );
void RemoveItemFromWorld( INT32 iItemIndex );
INT32 FindWorldItem( UINT16 usItem );
void LoadWorldItemsFromMap( INT8 **hBuffer );
void LoadWorldItemsFromMap( INT8 **hBuffer, float dMajorMapVersion, int ubMinorMapVersion );
void SaveWorldItemsToMap( HWFILE fp );
void TrashWorldItems();