mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- added new item flag for camo-removing items, to remove hard-coded value (CAMO_REMOVAL, #1024)
- fixed a bug that caused incorrect deduction of kit points git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5467 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+2
-8
@@ -192,7 +192,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, BOOLEAN fForce )
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s ate %s", pSoldier->name, Item[pObject->usItem].szItemName );
|
||||
else
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s drank %s", pSoldier->name, Item[pObject->usItem].szItemName );
|
||||
|
||||
|
||||
// now remove a portion of the food item (or the whole item altogether)
|
||||
UINT16 ptsconsumed = UseKitPoints( pObject, Food[foodtype].ubPortionSize, pSoldier );
|
||||
|
||||
@@ -200,13 +200,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, BOOLEAN fForce )
|
||||
// if the food is more of a drink, we also restore breath points
|
||||
if ( Food[foodtype].bDrinkPoints > Food[foodtype].bFoodPoints )
|
||||
{
|
||||
//UINT16 ptsconsumed = Food[foodtype].ubPortionSize - ptsleft;
|
||||
|
||||
INT16 usTotalKitPoints = TotalPoints( pObject );
|
||||
|
||||
INT16 sPointsToUse = __min( ptsconsumed, usTotalKitPoints );
|
||||
|
||||
sBPAdjustment = 2 * sPointsToUse * -(100 - pSoldier->bBreath);
|
||||
sBPAdjustment = 2 * ptsconsumed * -(100 - pSoldier->bBreath);
|
||||
}
|
||||
|
||||
DeductPoints( pSoldier, APBPConstants[type], sBPAdjustment );
|
||||
|
||||
@@ -724,8 +724,8 @@ extern OBJECTTYPE gTempObject;
|
||||
|
||||
#define AMMO_BELT 0x00000100 //256 // this item can be used to feed externally
|
||||
#define AMMO_BELT_VEST 0x00000200 //512 // this is a vest that can contain AMMO_BELT items in its medium slots
|
||||
/*#define unused 0x00000400 //1024
|
||||
#define ENEMY_NET_4_LVL_3 0x00000800 //2048
|
||||
#define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo
|
||||
/*#define ENEMY_NET_4_LVL_3 0x00000800 //2048
|
||||
|
||||
#define ENEMY_NET_1_LVL_4 0x00001000 //4096
|
||||
#define ENEMY_NET_2_LVL_4 0x00002000 //8192
|
||||
|
||||
+3
-3
@@ -7151,13 +7151,13 @@ UINT16 UseKitPoints( OBJECTTYPE * pObj, UINT16 usPoints, SOLDIERTYPE *pSoldier )
|
||||
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);
|
||||
usPoints -= (((*pObj)[bLoop]->data.objectStatus - 1) / ((max( 0, (100 - Item[pObj->usItem].percentstatusdrainreduction))) /100));
|
||||
(*pObj)[bLoop]->data.objectStatus = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// consume this kit totally
|
||||
usPoints -= (((*pObj)[bLoop]->data.objectStatus) / (max( 0, (100 - Item[pObj->usItem].percentstatusdrainreduction))) /100);
|
||||
usPoints -= (((*pObj)[bLoop]->data.objectStatus) / ((max( 0, (100 - Item[pObj->usItem].percentstatusdrainreduction))) /100));
|
||||
(*pObj)[bLoop]->data.objectStatus = 0;
|
||||
|
||||
pObj->ubNumberOfObjects--;
|
||||
@@ -8851,7 +8851,7 @@ BOOLEAN ApplyCammo( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN *pfGoodAP
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// added possibility to remove all camo by using a rag on self - SANDRO
|
||||
if (pObj->usItem == 1022 && gGameExternalOptions.fCamoRemoving)
|
||||
if ( HasItemFlag(pObj->usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving)
|
||||
{
|
||||
if (!EnoughPoints( pSoldier, (APBPConstants[AP_CAMOFLAGE]/2), 0, TRUE ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user