New feature: food system requires mercs to eat and drink in order to survive

- food and water levels are lowered every hour, eat food to survive
- not doing so leads to various penalties and ultimately death
- added food items for that purpose. Food can degrade over time. Rotten food poisons.
- Mercs automatically consume food if hungry/thirsty and food is in their inventories
- for more info, see http://www.bears-pit.com/board/ubbthreads.php/topics/307396/Re_Mercs_need_food_and_water_t.html#Post307396
- this feature requires new STI files from the GameDir trunk.

- added a bunch of filler variable to the soldier type, so hopefully savegame compatibility can be maintained easier in the future.

WARNING: This will break savegame compatibility

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5411 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-07-21 16:41:04 +00:00
parent b95d001812
commit f6bf6bf4aa
54 changed files with 2660 additions and 144 deletions
+16
View File
@@ -60,6 +60,7 @@
#include "popup_definition.h"
#include "drugs and alcohol.h"
#include "Food.h"
#endif
#ifdef JA2UB
@@ -1255,6 +1256,8 @@ std::map<UINT8,popupDef> LBEPocketPopup;
DRUGTYPE Drug[DRUG_TYPE_MAX];
FOODTYPE Food[FOOD_TYPE_MAX];
BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness )
{
if ( Item[usItemIndex].ubCoolness == 0 && !fIgnoreCoolness )
@@ -7117,6 +7120,13 @@ UINT16 UseKitPoints( OBJECTTYPE * pObj, UINT16 usPoints, SOLDIERTYPE *pSoldier )
(*pObj)[bLoop]->data.objectStatus -= (INT8)(usPoints * (max( 0, (100 - Item[pObj->usItem].percentstatusdrainreduction) ) )/100);
return( usOriginalPoints );
}
// Flugente: we no longer destroy canteens upon emtptying them - as we can now refill them
else if ( Item[pObj->usItem].canteen == TRUE )
{
// consume this kit totally
usPoints -= (((*pObj)[bLoop]->data.objectStatus - 1) / (max( 0, (100 - Item[pObj->usItem].percentstatusdrainreduction))) /100);
(*pObj)[bLoop]->data.objectStatus = 1;
}
else
{
// consume this kit totally
@@ -7597,6 +7607,12 @@ BOOLEAN CreateItem( UINT16 usItem, INT16 bStatus, OBJECTTYPE * pObj )
(*pObj)[0]->data.objectStatus = bStatus;
}
// Flugente: the temperature variable determines the quality of the food, begin with being fresh
if ( Item[usItem].foodtype > 0 )
{
(*pObj)[0]->data.bTemperature = OVERHEATING_MAX_TEMPERATURE;
}
//ADB ubWeight has been removed, see comments in OBJECTTYPE
//pObj->ubWeight = CalculateObjectWeight( pObj );
fRet = TRUE;