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
+280 -48
View File
@@ -59,7 +59,7 @@
//self explanatory
#define MERC_IS_DEAD -5
//set when the merc is returning home. A delay for 1,2 or 3 days
//set when the merc is returning home. A delay for 1,2 or 3 days
#define MERC_RETURNING_HOME -6
// used when merc starts game on assignment, goes on assignment later, or leaves to go on another contract
@@ -95,7 +95,7 @@ typedef enum
THIEF,
MARTIALARTS,
KNIFING,
ONROOF,
PROF_SNIPER,
CAMOUFLAGED,
CAMOUFLAGED_URBAN,
CAMOUFLAGED_DESERT,
@@ -161,38 +161,42 @@ typedef enum{
#define BUDDY_OPINION +25
#define HATED_OPINION -25
// WDS - Clean up inventory handling
//typedef struct
class MERCPROFILESTRUCT {
// CHRISL: Class to handle profile equipment from XML_MercStartingGear
class MERCPROFILEGEAR {
public:
// Constructor
MERCPROFILESTRUCT();
// Copy Constructor
MERCPROFILESTRUCT(const MERCPROFILESTRUCT&);
MERCPROFILEGEAR();
// Assignment operator
MERCPROFILESTRUCT& operator=(const MERCPROFILESTRUCT&);
MERCPROFILEGEAR& operator=(const MERCPROFILEGEAR&);
// Destructor
~MERCPROFILESTRUCT();
~MERCPROFILEGEAR();
// Initialize the mercenary profile.
// Use this instead of the old method of calling memset.
// Note that the constructor does this automatically.
// Initialize the mercenary profile gear
void initialize();
// Clear out the mercenary profile's invetory
// Use this instead of the old method of calling memset.
// Note that the constructor does this automatically.
void clearInventory();
// Ugly temporary solution
void CopyOldInventoryToNew();
void CopyNewInventoryToOld();
// Note: Place all non-POD items at the end (after endOfPOD)
// The format of this structure affects what is written into and read from various
// files (maps, save files, etc.). If you change it then that code will not work
// properly until it is all fixed and the files updated.
public:
UINT16 mIndex;
CHAR8 mName[80];
char endOfPOD; // marker for end of POD (plain old data)
std::vector<int> inv;
std::vector<int> iStatus;
std::vector<int> iDrop;
std::vector<int> iNumber;
std::vector<int> lbe;
std::vector<int> lStatus;
private:
int invCnt;
int lbeCnt;
};
#define SIZEOF_MERCPROFILEGEAR_POD offsetof( MERCPROFILEGEAR, endOfPOD )
class OLD_MERCPROFILESTRUCT_101
{
public:
// Constructor
OLD_MERCPROFILESTRUCT_101();
CHAR16 zName[ NAME_LENGTH ];
CHAR16 zNickname[ NICKNAME_LENGTH ];
UINT32 uiAttnSound;
@@ -201,7 +205,7 @@ public:
UINT32 uiGoodSound;
UINT32 uiGruntSound;
UINT32 uiGrunt2Sound;
UINT32 uiOkSound;
UINT32 uiOkSound;
UINT8 ubFaceIndex;
PaletteRepID PANTS;
PaletteRepID VEST;
@@ -246,7 +250,7 @@ public:
UINT16 sSectorX;
UINT16 sSectorY;
UINT32 uiDayBecomesAvailable; //day the merc will be available. used with the bMercStatus
UINT32 uiDayBecomesAvailable; //day the merc will be available. used with the bMercStatus
INT8 bStrength;
@@ -260,15 +264,15 @@ public:
INT8 bMedicalDelta;
INT8 bMechanicDelta;
INT8 bExplosivesDelta;
INT8 bStrengthDelta;
INT8 bLeadershipDelta;
UINT16 usKills;
UINT16 usAssists;
UINT16 usShotsFired;
UINT16 usShotsHit;
UINT16 usBattlesFought;
UINT16 usTimesWounded;
UINT16 usTotalDaysServed;
INT8 bStrengthDelta;
INT8 bLeadershipDelta;
UINT16 usKills;
UINT16 usAssists;
UINT16 usShotsFired;
UINT16 usShotsHit;
UINT16 usBattlesFought;
UINT16 usTimesWounded;
UINT16 usTotalDaysServed;
INT16 sLeadershipGain;
INT16 sStrengthGain;
@@ -299,10 +303,8 @@ public:
UINT8 bResigned;
UINT8 bActive;
private:
UINT8 DO_NOT_USE_bInvStatus[OldInventory::NUM_INV_SLOTS];
UINT8 DO_NOT_USE_bInvNumber[OldInventory::NUM_INV_SLOTS];
public:
UINT8 DO_NOT_USE_bInvNumber[OldInventory::NUM_INV_SLOTS];
UINT16 usApproachFactor[4];
INT8 bMainGunAttractiveness;
@@ -315,9 +317,7 @@ public:
UINT8 ubInvUndroppable;
UINT8 ubRoomRangeStart[2];
private:
UINT16 DO_NOT_USE_inv[OldInventory::NUM_INV_SLOTS];
public:
INT8 bMercTownReputation[ 20 ];
UINT16 usStatChangeChances[ 12 ]; // used strictly for balancing, never shown!
@@ -355,7 +355,7 @@ public:
UINT16 usOptionalGearCost;
INT8 bMercOpinion[75];
INT8 bApproached;
INT8 bMercStatus; //The status of the merc. If negative, see flags at the top of this file. Positive: The number of days the merc is away for. 0: Not hired but ready to be.
INT8 bMercStatus; //The status of the merc. If negative, see flags at the top of this file. Positive: The number of days the merc is away for. 0: Not hired but ready to be.
INT8 bHatedTime[5];
INT8 bLearnToLikeTime;
INT8 bLearnToHateTime;
@@ -382,7 +382,7 @@ public:
UINT8 ubDaysOfMoraleHangover; // used only when merc leaves team while having poor morale
UINT8 ubNumTimesDrugUseInLifetime; // The # times a drug has been used in the player's lifetime...
// Flags used for the precedent to repeating oneself in Contract negotiations. Used for quote 80 - ~107. Gets reset every day
// Flags used for the precedent to repeating oneself in Contract negotiations. Used for quote 80 - ~107. Gets reset every day
UINT32 uiPrecedentQuoteSaid;
UINT32 uiProfileChecksum;
INT16 sPreCombatGridNo;
@@ -395,19 +395,251 @@ public:
UINT8 ubBuffer[4];
//
// New and OO stuff goes after here. Above this point any changes will goof up reading from files.
// New and OO stuff goes after here. Above this point any changes will goof up reading from files.
//
char endOfPOD; // marker for end of POD (plain old data)
};
#define SIZEOF_OLD_MERCPROFILESTRUCT_101_POD offsetof( OLD_MERCPROFILESTRUCT_101, endOfPOD )
class MERCPROFILESTRUCT {
public:
// Constructor
MERCPROFILESTRUCT();
// Copy Constructor
MERCPROFILESTRUCT(const MERCPROFILESTRUCT&);
// Conversion operator
MERCPROFILESTRUCT& operator=(const OLD_MERCPROFILESTRUCT_101& src);
// Assignment operator
MERCPROFILESTRUCT& operator=(const MERCPROFILESTRUCT&);
// Destructor
~MERCPROFILESTRUCT();
void CopyOldInventoryToNew(const OLD_MERCPROFILESTRUCT_101& src);
// Changed by ADB, rev 1513
//BOOLEAN Load(HWFILE hFile, bool forceLoadOldVersion);
BOOLEAN Load(HWFILE hFile, bool forceLoadOldVersion, bool forceLoadOldEncryption, bool wasSavedWithEncryption);
BOOLEAN Save(HWFILE hFile);
UINT32 GetChecksum();
// Initialize the mercenary profile.
// Use this instead of the old method of calling memset.
// Note that the constructor does this automatically.
void initialize();
// Clear out the mercenary profile's invetory
// Use this instead of the old method of calling memset.
// Note that the constructor does this automatically.
void clearInventory();
// Note: Place all non-POD items at the end (after endOfPOD)
// The format of this structure affects what is written into and read from various
// files (maps, save files, etc.). If you change it then that code will not work
// properly until it is all fixed and the files updated.
public:
CHAR16 zName[ NAME_LENGTH ];
CHAR16 zNickname[ NICKNAME_LENGTH ];
UINT32 uiAttnSound;
UINT32 uiCurseSound;
UINT32 uiDieSound;
UINT32 uiGoodSound;
UINT32 uiGruntSound;
UINT32 uiGrunt2Sound;
UINT32 uiOkSound;
UINT8 ubFaceIndex;
PaletteRepID PANTS;
PaletteRepID VEST;
PaletteRepID SKIN;
PaletteRepID HAIR;
INT8 bSex;
INT8 bArmourAttractiveness;
UINT8 ubMiscFlags2;
INT8 bEvolution;
UINT8 ubMiscFlags;
UINT8 bSexist;
INT8 bLearnToHate;
// skills
INT8 bStealRate;
INT8 bVocalVolume;
UINT8 ubQuoteRecord;
INT8 bDeathRate;
INT8 bScientific;
INT16 sExpLevelGain;
INT16 sLifeGain;
INT16 sAgilityGain;
INT16 sDexterityGain;
INT16 sWisdomGain;
INT16 sMarksmanshipGain;
INT16 sMedicalGain;
INT16 sMechanicGain;
INT16 sExplosivesGain;
UINT8 ubBodyType;
INT8 bMedical;
UINT16 usEyesX;
UINT16 usEyesY;
UINT16 usMouthX;
UINT16 usMouthY;
UINT32 uiEyeDelay;
UINT32 uiMouthDelay;
UINT32 uiBlinkFrequency;
UINT32 uiExpressionFrequency;
UINT16 sSectorX;
UINT16 sSectorY;
UINT32 uiDayBecomesAvailable; //day the merc will be available. used with the bMercStatus
INT8 bStrength;
INT8 bLifeMax;
INT8 bExpLevelDelta;
INT8 bLifeDelta;
INT8 bAgilityDelta;
INT8 bDexterityDelta;
INT8 bWisdomDelta;
INT8 bMarksmanshipDelta;
INT8 bMedicalDelta;
INT8 bMechanicDelta;
INT8 bExplosivesDelta;
INT8 bStrengthDelta;
INT8 bLeadershipDelta;
UINT16 usKills;
UINT16 usAssists;
UINT16 usShotsFired;
UINT16 usShotsHit;
UINT16 usBattlesFought;
UINT16 usTimesWounded;
UINT16 usTotalDaysServed;
INT16 sLeadershipGain;
INT16 sStrengthGain;
// BODY TYPE SUBSITUTIONS
UINT32 uiBodyTypeSubFlags;
INT16 sSalary;
INT8 bLife;
INT8 bDexterity; // dexterity (hand coord) value
INT8 bPersonalityTrait;
INT8 bSkillTrait;
INT8 bReputationTolerance;
INT8 bExplosive;
INT8 bSkillTrait2;
INT8 bLeadership;
INT8 bBuddy[5];
INT8 bHated[5];
INT8 bExpLevel; // general experience level
INT8 bMarksmanship;
UINT8 bMinService;
INT8 bWisdom;
UINT8 bResigned;
UINT8 bActive;
UINT16 usApproachFactor[4];
INT8 bMainGunAttractiveness;
INT8 bAgility; // agility (speed) value
BOOLEAN fUseProfileInsertionInfo; // Set to various flags, ( contained in TacticalSave.h )
INT16 sGridNo; // The Gridno the NPC was in before leaving the sector
UINT8 ubQuoteActionID;
INT8 bMechanical;
UINT8 ubInvUndroppable;
UINT8 ubRoomRangeStart[2];
INT8 bMercTownReputation[ 20 ];
UINT16 usStatChangeChances[ 12 ]; // used strictly for balancing, never shown!
UINT16 usStatChangeSuccesses[ 12 ]; // used strictly for balancing, never shown!
UINT8 ubStrategicInsertionCode;
UINT8 ubRoomRangeEnd[2];
UINT8 ubLastQuoteSaid;
INT8 bRace;
INT8 bNationality;
INT8 bAppearance;
INT8 bAppearanceCareLevel;
INT8 bRefinement;
INT8 bRefinementCareLevel;
INT8 bHatedNationality;
INT8 bHatedNationalityCareLevel;
INT8 bRacist;
UINT32 uiWeeklySalary;
UINT32 uiBiWeeklySalary;
INT8 bMedicalDeposit;
INT8 bAttitude;
INT8 bBaseMorale;
UINT16 sMedicalDepositAmount;
INT8 bLearnToLike;
UINT8 ubApproachVal[4];
UINT8 ubApproachMod[3][4];
INT8 bTown;
INT8 bTownAttachment;
UINT16 usOptionalGearCost;
INT8 bMercOpinion[75];
INT8 bApproached;
INT8 bMercStatus; //The status of the merc. If negative, see flags at the top of this file. Positive: The number of days the merc is away for. 0: Not hired but ready to be.
INT8 bHatedTime[5];
INT8 bLearnToLikeTime;
INT8 bLearnToHateTime;
INT8 bHatedCount[5];
INT8 bLearnToLikeCount;
INT8 bLearnToHateCount;
UINT8 ubLastDateSpokenTo;
UINT8 bLastQuoteSaidWasSpecial;
INT8 bSectorZ;
UINT16 usStrategicInsertionData;
INT8 bFriendlyOrDirectDefaultResponseUsedRecently;
INT8 bRecruitDefaultResponseUsedRecently;
INT8 bThreatenDefaultResponseUsedRecently;
INT8 bNPCData; // NPC specific
INT32 iBalance;
INT16 sTrueSalary; // for use when the person is working for us for free but has a positive salary value
UINT8 ubCivilianGroup;
UINT8 ubNeedForSleep;
UINT32 uiMoney;
INT8 bNPCData2; // NPC specific
UINT8 ubMiscFlags3;
UINT8 ubDaysOfMoraleHangover; // used only when merc leaves team while having poor morale
UINT8 ubNumTimesDrugUseInLifetime; // The # times a drug has been used in the player's lifetime...
// Flags used for the precedent to repeating oneself in Contract negotiations. Used for quote 80 - ~107. Gets reset every day
UINT32 uiPrecedentQuoteSaid;
UINT32 uiProfileChecksum;
INT16 sPreCombatGridNo;
UINT8 ubTimeTillNextHatedComplaint;
UINT8 ubSuspiciousDeath;
INT32 iMercMercContractLength; //Used for MERC mercs, specifies how many days the merc has gone since last page
UINT32 uiTotalCostToDate; // The total amount of money that has been paid to the merc for their salary
//
// New and OO stuff goes after here. Above this point any changes will goof up reading from files.
//
//char ef1; // Extra filler to get "offsetof(endOfPOD)" to match SIZEOF(oldstruct)
char endOfPOD; // marker for end of POD (plain old data)
vector<int> inv;
vector<int> bInvStatus;
vector<int> bInvNumber;
std::vector<int> inv;
std::vector<int> bInvStatus;
std::vector<int> bInvNumber;
}; // MERCPROFILESTRUCT;
#define SIZEOF_MERCPROFILESTRUCT_POD offsetof( MERCPROFILESTRUCT, endOfPOD )
#define SIZEOF_MERCPROFILESTRUCT sizeof( MERCPROFILESTRUCT )
#define TIME_BETWEEN_HATED_COMPLAINTS 24