Convert INVTYPE boolean fields to flagmask (#325)

Rearranged fields from largest to smallest to remove alignment padding
This commit is contained in:
Asdow
2024-08-22 08:48:29 +03:00
committed by GitHub
parent ce02a488f0
commit 49a119e6b9
59 changed files with 1437 additions and 1336 deletions
+5 -5
View File
@@ -4297,10 +4297,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
// ADJUST BASED ON ITEM IN HAND....
usItem = pSoldier->inv[ HANDPOS ].usItem;
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !Item[usItem].rocketlauncher)
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !ItemIsRocketLauncher(usItem) )
{
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if ( (Item[ usItem ].twohanded ) )
if (ItemIsTwoHanded(usItem))
{
ubWaterHandIndex = 0;
}
@@ -4321,7 +4321,7 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
// ADJUST BASED ON ITEM IN HAND....
usItem = pSoldier->inv[ HANDPOS ].usItem;
if ( !(Item[ usItem ].usItemClass == IC_GUN ) && !(Item[ usItem ].usItemClass == IC_LAUNCHER ) || Item[usItem].rocketlauncher )
if ( !(Item[ usItem ].usItemClass == IC_GUN ) && !(Item[ usItem ].usItemClass == IC_LAUNCHER ) || ItemIsRocketLauncher(usItem) )
{
if ( usAnimState == STANDING )
{
@@ -4342,10 +4342,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
else
{
// CHECK FOR HANDGUN
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !Item[usItem].rocketlauncher )
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !ItemIsRocketLauncher(usItem) )
{
// if ( !(Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if ( !(Item[ usItem ].twohanded ) )
if ( !ItemIsTwoHanded(usItem) )
{
// SANDRO - new anim for running with pistol by PasHancock
if ( usAnimState == RUNNING )
+19 -50
View File
@@ -71,7 +71,6 @@ void GuaranteeAtLeastXItemsOfIndex( UINT8 ubArmsDealer, UINT16 usItemIndex, UIN
void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems );
void ArmsDealerGetsFreshStock( UINT8 ubArmsDealer, UINT16 usItemIndex, UINT8 ubNumItems );
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex );
UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex );
BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer );
@@ -85,8 +84,6 @@ BOOLEAN CanThisItemBeSoldToSimulatedCustomer( UINT8 ubArmsDealerID, UINT16 usIte
void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer );
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex );
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime );
ARMS_DEALER_STATUS& ARMS_DEALER_STATUS::operator=(const OLD_ARMS_DEALER_STATUS_101& status)
@@ -961,7 +958,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
return( ARMS_DEALER_HANDGUNCLASS );
break;
case RIFLECLASS:
if ( ItemIsARocketRifle( usItem ) )
if (ItemHasFingerPrintID( usItem ) )
return( ARMS_DEALER_ROCKET_RIFLE );
else
return( ARMS_DEALER_RIFLECLASS );
@@ -1010,15 +1007,15 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
{
if ( Item [usItem].alcohol > 0.0f )
return( ARMS_DEALER_ALCOHOL );
else if ( Item [usItem].electronic )
else if (ItemIsElectronic(usItem))
return( ARMS_DEALER_ELECTRONICS );
else if ( Item [usItem].hardware )
else if (ItemIsHardware(usItem))
return( ARMS_DEALER_HARDWARE );
else if ( Item [usItem].medical )
else if (ItemIsMedical(usItem))
return( ARMS_DEALER_MEDICAL );
else if ( Item [usItem].attachment )
else if (ItemIsAttachment(usItem))
return( ARMS_DEALER_ATTACHMENTS );
else if ( Item [usItem].detonator || Item [usItem].remotedetonator || Item [usItem].remotetrigger )
else if (ItemIsDetonator(usItem) || ItemIsRemoteDetonator(usItem) || ItemIsRemoteTrigger(usItem))
return( ARMS_DEALER_DETONATORS );
else
return( ARMS_DEALER_MISC );
@@ -1076,7 +1073,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
return( ARMS_DEALER_AMMO );
break;
case IC_FACE:
if (Item[usItem].electronic )
if (ItemIsElectronic(usItem))
return ARMS_DEALER_ELECTRONICS;
else
return ARMS_DEALER_FACE;
@@ -1278,8 +1275,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
// uiFlags = Item[ usItemIndex ].fFlags;
// can't repair anything that's not repairable!
// if ( !( uiFlags & ITEM_REPAIRABLE ) )
if ( !( Item[ usItemIndex ].repairable ) )
if ( !ItemIsRepairable(usItemIndex) )
{
return(FALSE);
}
@@ -1297,8 +1293,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
case ARMS_DEALER_PERKO:
#endif
// repairs ANYTHING non-electronic
// if ( !( uiFlags & ITEM_ELECTRONIC ) )
if ( !( Item[ usItemIndex ].electronic ) )
if ( !ItemIsElectronic(usItemIndex) )
{
return(TRUE);
}
@@ -1306,8 +1301,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
case ARMS_DEALER_FREDO:
// repairs ONLY electronics
// if ( uiFlags & ITEM_ELECTRONIC )
if ( Item[ usItemIndex ].electronic )
if (ItemIsElectronic(usItemIndex))
{
return(TRUE);
}
@@ -1318,7 +1312,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
// Flugente: if we set this guy to be a repairguy, and this item is NOT electronic, well, we can
if ( armsDealerInfo[ubArmsDealer].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
{
if ( !( Item[ usItemIndex ].electronic ) )
if ( !ItemIsElectronic(usItemIndex) )
return(TRUE);
else
return(FALSE);
@@ -1369,7 +1363,7 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
// if it's a damagable item, and not a liquid (those are always sold full)
// if ( ( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) && !ItemContainsLiquid( usItemIndex ) )
if ( ( Item[ usItemIndex ].damageable ) && !ItemContainsLiquid( usItemIndex ) )
if (ItemIsDamageable(usItemIndex) && !ItemContainsLiquid(usItemIndex))
{
// if he ONLY has used items, or 50% of the time if he carries both used & new items
if ( ( armsDealerInfo[ ubArmsDealer ].uiFlags & ARMS_DEALER_ONLY_USED_ITEMS ) ||
@@ -1383,25 +1377,6 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
return( ubCondition);
}
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex )
{
return Item[usItemIndex].containsliquid;
//switch ( usItemIndex )
//{
// case CANTEEN:
// case BEER:
// case ALCOHOL:
// case JAR_HUMAN_BLOOD:
// case JAR_CREATURE_BLOOD:
// case JAR_QUEEN_CREATURE_BLOOD:
// case JAR_ELIXIR:
// case GAS_CAN:
// return( TRUE );
//}
//return( FALSE );
}
bool ItemIsSpecial(DEALER_SPECIAL_ITEM& item)
{
@@ -1839,7 +1814,7 @@ void MakeObjectOutOfDealerItems( DEALER_SPECIAL_ITEM *pSpclItemInfo, OBJECTTYPE
// they don't have ammo for by selling them to Tony & buying them right back fully loaded! One could repeat this
// ad nauseum (empty the gun between visits) as a (really expensive) way to get unlimited special ammo like rockets.
//CHRISL: If we're working with a SingleShotRocketLauncher, we need ubGunShotsLeft to equal 1
if(Item[pObject->usItem].singleshotrocketlauncher == TRUE)
if(ItemIsSingleShotRocketLauncher(pObject->usItem))
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 1;
else
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 0;
@@ -1863,7 +1838,7 @@ void GiveObjectToArmsDealerForRepair( UINT8 ubArmsDealer, OBJECTTYPE *pObject, U
Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) );
// c) Actually damaged, or a rocket rifle (being reset)
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemIsARocketRifle( pObject->usItem ) );
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemHasFingerPrintID( pObject->usItem ) );
/* ARM: Can now repair with removeable attachments still attached...
// d) Already stripped of all *detachable* attachments
@@ -1898,7 +1873,7 @@ void GiveItemToArmsDealerforRepair( UINT8 ubArmsDealer, OBJECTTYPE* pObject, UIN
Assert( DoesDealerDoRepairs( ubArmsDealer ) );
Assert( (*pObject)[0]->data.objectStatus > 0 );
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemIsARocketRifle( pObject->usItem ) );
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemHasFingerPrintID( pObject->usItem ) );
// figure out the earliest the repairman will be free to start repairing this item
uiTimeWhenFreeToStartIt = WhenWillRepairmanBeAllDoneRepairing( ubArmsDealer );
@@ -1995,8 +1970,7 @@ UINT32 CalculateSimpleItemRepairTime( UINT8 ubArmsDealer, UINT16 usItemIndex, IN
// repairs on electronic items take twice as long if the guy doesn't have the skill
// for dealers, this means anyone but Fredo the Electronics guy takes twice as long (but doesn't charge double)
// (Mind you, current he's the ONLY one who CAN repair Electronics at all! Oh well.)
// if( ( Item[ usItemIndex ].fFlags & ITEM_ELECTRONIC ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
if( ( Item[ usItemIndex ].electronic ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
if( ItemIsElectronic(usItemIndex) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
{
uiTimeToRepair *= 2;
}
@@ -2065,7 +2039,7 @@ UINT32 CalculateSimpleItemRepairCost( UINT8 ubArmsDealer, UINT16 usItemIndex, IN
}
*/
if ( ItemIsARocketRifle( usItemIndex ) )
if (ItemHasFingerPrintID( usItemIndex ) )
{
// resetting imprinting for a rocket rifle costs something extra even if rifle is at 100%
uiRepairCost += 100;
@@ -2167,7 +2141,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
// the rest of this function applies only to the "general" dealers ( Jake, Keith, and Franz )
// Micky & Gabby specialize in creature parts & such, the others don't buy these at all (exception: jars)
if ( ( !Item[usItemIndex].jar ) &&
if ( ( !ItemIsJar(usItemIndex)) &&
( DoesItemAppearInDealerInventoryList( ARMS_DEALER_MICKY, usItemIndex, TRUE ) ||
DoesItemAppearInDealerInventoryList( ARMS_DEALER_GABBY, usItemIndex, TRUE ) ) )
{
@@ -2214,7 +2188,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
{
// exception: Gas (Jake's)
// if ( usItemIndex != GAS_CAN )
if ( !Item[usItemIndex].gascan )
if ( !ItemIsGascan(usItemIndex))
{
// they pay only 1/3 of true value!
usValueToThisDealer /= 3;
@@ -2244,11 +2218,6 @@ void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer )
GuaranteeAtLeastXItemsOfIndex( ubArmsDealer, ALCOHOL, ( UINT8 ) ( GetDealersMaxItemAmount( ubArmsDealer, ALCOHOL ) / 3 ) );
}
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex )
{
return( Item[sItemIndex].fingerprintid );
}
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime )
{
SOLDIERTYPE *pSoldier;
+3 -5
View File
@@ -944,8 +944,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
}
// items normally not sold at shops are unsuitable
// if ( Item[ usItemIndex ].fFlags & ITEM_NOT_BUYABLE )
if ( Item[ usItemIndex ].notbuyable )
if (ItemIsNotBuyable(usItemIndex))
{
return(ITEM_SUITABILITY_NONE);
}
@@ -971,7 +970,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
// case JAR:
// case JAR_ELIXIR:
// case JAR_CREATURE_BLOOD:
if ( Item[usItemIndex].medical || Item[usItemIndex].canteen || Item[usItemIndex].medicalkit || Item[usItemIndex].locksmithkit || Item[usItemIndex].toolkit || Item[usItemIndex].crowbar || Item[usItemIndex].jar )
if (ItemIsMedical(usItemIndex) || ItemIsCanteen(usItemIndex) || ItemIsMedicalKit(usItemIndex) || ItemIsLocksmithKit(usItemIndex) || ItemIsToolkit(usItemIndex) || ItemIsCrowbar(usItemIndex) || ItemIsJar(usItemIndex) )
return(ITEM_SUITABILITY_ALWAYS);
//}
@@ -1455,8 +1454,7 @@ UINT8 GetDealerItemCategoryNumber( UINT16 usItemIndex )
BOOLEAN CanDealerItemBeSoldUsed( UINT16 usItemIndex )
{
// if ( !( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) )
if ( !( Item[ usItemIndex ].damageable ) )
if ( !ItemIsDamageable(usItemIndex) )
return(FALSE);
// certain items, although they're damagable, shouldn't be sold in a used condition
+3 -3
View File
@@ -1274,7 +1274,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
{
case MINES_DRAW_PLAYERTEAM_NETWORKS:
{
if ( Item[pObj->usItem].tripwire == 1 )
if (ItemIsTripwire(pObj->usItem))
{
// if we're already marked as MINE_BOMB, switch to MINE_BOMB_AND_WIRE
if ( bOverlayType == MINE_BOMB )
@@ -1314,7 +1314,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
case MINES_DRAW_NETWORKCOLOURING:
{
if ( Item[pObj->usItem].tripwire == 1 )
if (ItemIsTripwire(pObj->usItem))
{
// determine if wire is of the network we're searching for
// determine this tripwire's flag
@@ -1342,7 +1342,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
case MINES_DRAW_NET_C:
case MINES_DRAW_NET_D:
{
if ( Item[pObj->usItem].tripwire == 1 )
if (ItemIsTripwire(pObj->usItem))
{
UINT32 specificnet = 0;
switch ( gubDrawMode )
+1 -1
View File
@@ -205,7 +205,7 @@ BOOLEAN ApplyDrugs_New( SOLDIERTYPE *pSoldier, UINT16 usItem, UINT16 uStatusUsed
gMercProfiles[pSoldier->ubProfile].ubNumTimesDrugUseInLifetime++;
}
if ( Item[usItem].cigarette )
if (ItemIsCigarette(usItem))
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_CIGARETTE], pSoldier->GetName( ), ShortItemNames[usItem] );
}
+3 -3
View File
@@ -1950,7 +1950,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
// check first face slot
if (uiFaceItemOne != NONE)
{
if (Item[uiFaceItemOne].gasmask)
if (ItemIsGasmask(uiFaceItemOne))
uiFaceItemOne = 1;
else if (Item[uiFaceItemOne].nightvisionrangebonus > 0)
uiFaceItemOne = 2;
@@ -1965,7 +1965,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
// check second face slot
if (uiFaceItemTwo != NONE)
{
if (Item[uiFaceItemTwo].gasmask)
if (ItemIsGasmask(uiFaceItemTwo))
uiFaceItemTwo = 21;
else if (Item[uiFaceItemTwo].nightvisionrangebonus > 0)
uiFaceItemTwo = 42;
@@ -2250,7 +2250,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
sIconIndex_Assignment = 0;
fDoIcon_Assignment = TRUE;
// Show repair points if merc has a toolkit in his hand. Otherwise show cleaning points.
if (Item[pSoldier->inv[HANDPOS].usItem].toolkit)
if (ItemIsToolkit(pSoldier->inv[HANDPOS].usItem))
sPtsAvailable = CalculateRepairPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE);
else
sPtsAvailable = CalculateCleaningPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts);
+13 -13
View File
@@ -174,7 +174,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, UINT16 usPointsTo
return( FALSE);
// workaround: canteens with 1% status are treated as 'empty'. They cannot be consumed, but refilled
if ( Item[pObject->usItem].canteen == TRUE && (*pObject)[0]->data.objectStatus == 1 )
if (ItemIsCanteen(pObject->usItem) && (*pObject)[0]->data.objectStatus == 1 )
return( FALSE);
// do we eat or drink this stuff?
@@ -693,7 +693,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
// if fcanteensonly is TRUE, omit everything that is not a canteen
if ( fcanteensonly )
{
if ( Item[pObj->usItem].canteen == FALSE )
if ( !ItemIsCanteen(pObj->usItem))
continue;
}
else
@@ -707,7 +707,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
if ( foodcondition < FOOD_BAD_THRESHOLD )
continue;
if ( Item[pObj->usItem].canteen == TRUE )
if (ItemIsCanteen(pObj->usItem))
continue;
}
@@ -741,7 +741,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
// if fcanteensonly is TRUE, omit everything that is not a canteen
if ( fcanteensonly )
{
if ( Item[pObj->usItem].canteen == FALSE )
if (!ItemIsCanteen(pObj->usItem))
continue;
}
@@ -846,7 +846,7 @@ void SectorFillCanteens( void )
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{
// ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -878,7 +878,7 @@ void SectorFillCanteens( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{
// ... if Item exists and is a canteen (only those are refillable) ...
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen && Food[Item[gWorldItems[ uiCount ].object.usItem].foodtype].bDrinkPoints > 0)
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem) && Food[Item[gWorldItems[ uiCount ].object.usItem].foodtype].bDrinkPoints > 0)
{
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -920,7 +920,7 @@ void SectorFillCanteens( void )
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{
// ... if Item exists and is canteen and is NOT a water drum...
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && (Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) && !HasItemFlag(pSoldier->inv[bLoop].usItem, (WATER_DRUM)))
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && (Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) && !HasItemFlag(pSoldier->inv[bLoop].usItem, (WATER_DRUM)))
{
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -973,7 +973,7 @@ void SectorFillCanteens( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{
// ... if Item exists and is a canteen (only those are refillable) ...
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen )
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem))
{
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -1031,7 +1031,7 @@ OBJECTTYPE* GetUsableWaterDrumInSector( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{
// ... if Item exists and is a canteen (only those are refillable) ...
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen )
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem))
{
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -1077,7 +1077,7 @@ void SoldierAutoFillCanteens(SOLDIERTYPE *pSoldier)
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{
// ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -1118,7 +1118,7 @@ BOOLEAN HasFoodInInventory( SOLDIERTYPE *pSoldier, BOOLEAN fCheckFood, BOOLEAN f
if ( fCheckDrink && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints )
{
if ( Item[pSoldier->inv[bLoop].usItem].canteen )
if (ItemIsCanteen(pSoldier->inv[bLoop].usItem))
{
// empty canteens retain 1% status, so check ether something is in them
if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 )
@@ -1170,7 +1170,7 @@ void DrinkFromWaterTap( SOLDIERTYPE* pSoldier )
for (INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{
// ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -1197,4 +1197,4 @@ void DrinkFromWaterTap( SOLDIERTYPE* pSoldier )
}
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szInteractiveActionText[8], pSoldier->GetName( ) );
}
}
+33 -34
View File
@@ -319,7 +319,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
pSoldier->ubProfile != NO_PROFILE &&
pTargetSoldier &&
Item[usHandItem].usItemClass != IC_MEDKIT &&
!Item[usHandItem].gascan &&
!ItemIsGascan(usHandItem) &&
!ItemCanBeAppliedToOthers(usHandItem) &&
!HasItemFlag(usHandItem, EMPTY_BLOOD_BAG) &&
!HasItemFlag( usHandItem, MEDICAL_SPLINT ) )
@@ -473,8 +473,8 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( Item[ usHandItem ].usItemClass == IC_GUN || Item[ usHandItem ].usItemClass == IC_THROWING_KNIFE )
{
// WEAPONS
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: checking for fingerprintID, item id = %d,id required = %d, imprint id = %d, soldier id = %d",usHandItem,Item[usHandItem].fingerprintid,pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.ubImprintID,pSoldier->ubProfile));
if ( Item[usHandItem].fingerprintid )
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: checking for fingerprintID, item id = %d,id required = %d, imprint id = %d, soldier id = %d",usHandItem, ItemHasFingerPrintID(usHandItem), pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.ubImprintID,pSoldier->ubProfile));
if (ItemHasFingerPrintID(usHandItem))
{
// check imprint ID
// NB not-imprinted value is NO_PROFILE
@@ -807,7 +807,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
}
// ATE: Here to make cursor go back to move after LAW shot...
if ( fFromUI && Item[usHandItem].singleshotrocketlauncher)
if ( fFromUI && ItemIsSingleShotRocketLauncher(usHandItem) )
{
guiPendingOverrideEvent = A_CHANGE_TO_MOVE;
}
@@ -969,7 +969,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
BOOLEAN fCorpse = FALSE;
if(pCorpse != NULL)
fCorpse = IsValidDecapitationCorpse( pCorpse );
if ( Item[usHandItem].wirecutters && pTargetSoldier == NULL && !pCorpse ) // Madd: quick fix to allow wirecutter/knives
if (ItemIsWirecutters(usHandItem) && pTargetSoldier == NULL && !pCorpse ) // Madd: quick fix to allow wirecutter/knives
{
// See if we can get there to stab
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
@@ -1025,7 +1025,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
}
}
if ( Item[usHandItem].toolkit )
if (ItemIsToolkit(usHandItem))
{
UINT8 ubMercID;
BOOLEAN fVehicle = FALSE;
@@ -1098,7 +1098,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
}
}
if ( Item[usHandItem].gascan )
if (ItemIsGascan(usHandItem))
{
UINT8 ubMercID;
INT32 sVehicleGridNo=-1;
@@ -1170,7 +1170,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
}
if ( Item[usHandItem].jar )
if (ItemIsJar(usHandItem))
{
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
@@ -1614,7 +1614,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
}
}
if ( Item[usHandItem].canandstring )
if (ItemIsCanAndString(usHandItem))
{
STRUCTURE *pStructure;
LEVELNODE *pIntTile;
@@ -1686,7 +1686,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) )
{
DeductPoints( pSoldier, sAPCost, 0 );
if ( Item[usHandItem].xray )
if (ItemHasXRay(usHandItem))
{
PlayJA2Sample( USE_X_RAY_MACHINE, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
@@ -1867,7 +1867,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
sAPCost = MinAPsToAttack( pSoldier, sTargetGridNo, TRUE, pSoldier->aiData.bAimTime, 0 );
// Check if these is room to place mortar!
if ( Item[usHandItem].mortar )
if (ItemIsMortar(usHandItem))
{
ubDirection = (UINT8)GetDirectionFromGridNo( sTargetGridNo, pSoldier );
@@ -1881,7 +1881,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
//pSoldier->flags.fDontChargeAPsForStanceChange = TRUE;//dnl ch72 270913 no reason why not charge for stance change
}
else if ( Item[usHandItem].grenadelauncher )//usHandItem == GLAUNCHER || usHandItem == UNDER_GLAUNCHER )
else if (ItemIsGrenadeLauncher(usHandItem))//usHandItem == GLAUNCHER || usHandItem == UNDER_GLAUNCHER )
{
GetAPChargeForShootOrStabWRTGunRaises( pSoldier, sTargetGridNo, TRUE, &fAddingTurningCost, &fAddingRaiseGunCost, pSoldier->aiData.bAimTime );
usTurningCost = CalculateTurningCost(pSoldier, usHandItem, fAddingTurningCost);
@@ -1960,7 +1960,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( Item[ usHandItem ].ubCursor == INVALIDCURS )
{
// Found detonator...
if ( HasAttachmentOfClass( &(pSoldier->inv[pSoldier->ubAttackingHand]), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || Item[usHandItem].tripwire )
if ( HasAttachmentOfClass( &(pSoldier->inv[pSoldier->ubAttackingHand]), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || ItemIsTripwire(usHandItem))
{
StartBombMessageBox( pSoldier, sGridNo );
@@ -1980,7 +1980,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
{
// Does this have detonator that needs info?
if ( HasAttachmentOfClass( &(pSoldier->inv[ HANDPOS ] ), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || Item[ (&(pSoldier->inv[ HANDPOS ] ))->usItem ].tripwire == 1)
if ( HasAttachmentOfClass( &(pSoldier->inv[ HANDPOS ] ), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || ItemIsTripwire((&(pSoldier->inv[ HANDPOS ] ))->usItem) )
{
StartBombMessageBox( pSoldier, sGridNo );
}
@@ -2003,7 +2003,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
if ( iResult >= 0 )
{
// Less explosives gain for placing tripwire
if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire )
if (ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem))
StatChange( pSoldier, EXPLODEAMT, 1, FALSE );
else if ( HasItemFlag( (pSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
StatChange( pSoldier, MECHANAMT, 10, FALSE );
@@ -2027,7 +2027,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
pSoldier->inv[ HANDPOS ][0]->data.bTrap++;
// anv: additional tile properties - modify trap level depending on its placement
if(gGameExternalOptions.fAdditionalTileProperties && Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
if(gGameExternalOptions.fAdditionalTileProperties && !ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem))
{
ADDITIONAL_TILE_PROPERTIES_VALUES zAllTileValues = GetAllAdditonalTilePropertiesForGrid( sGridNo, pSoldier->pathing.bLevel );
pSoldier->inv[ HANDPOS ][0]->data.bTrap += zAllTileValues.bTrapBonus;
@@ -2072,7 +2072,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
StatChange( pSoldier, EXPLODEAMT, 10, FROM_FAILURE );
// oops! How badly did we screw up?
if ( iResult < -20 && Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
if ( iResult < -20 && !ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem) )
{
// OOPS! ... BOOM!
IgniteExplosion( NOBODY, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pSoldier->inv[ HANDPOS ].usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection, &pSoldier->inv[ HANDPOS ] );
@@ -2576,7 +2576,7 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
if ( ItemExistsAtLocation( sGridNo, iItemIndex, pSoldier->pathing.bLevel ) )
{
// Flugente: if item is tripwireactivated and is a planted bomb, call the defuse dialogue. We obviously know about the items' existence already...
if ( gWorldItems[ iItemIndex ].object.exists() && gWorldItems[ iItemIndex ].object.fFlags & OBJECT_ARMED_BOMB && Item[gWorldItems[ iItemIndex ].object.usItem].tripwireactivation == 1 )
if ( gWorldItems[ iItemIndex ].object.exists() && gWorldItems[ iItemIndex ].object.fFlags & OBJECT_ARMED_BOMB && ItemHasTripwireActivation(gWorldItems[ iItemIndex ].object.usItem) )
{
gpBoobyTrapItemPool = GetItemPoolForIndex( sGridNo, iItemIndex, pSoldier->pathing.bLevel );
gpBoobyTrapSoldier = pSoldier;
@@ -2998,8 +2998,7 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
if ( TERRAIN_IS_WATER( bTerrainID) )
{
// if ( Item[ pObject->usItem ].fFlags & ITEM_SINKS )
if ( Item[ pObject->usItem ].sinks )
if (ItemSinks(pObject->usItem))
{
return( NULL );
}
@@ -3340,7 +3339,7 @@ BOOLEAN MarblesExistAtLocation( INT32 sGridNo, UINT8 ubLevel, INT32 * piItemInde
pItemPoolTemp = pItemPool;
while( pItemPoolTemp != NULL )
{
if ( Item[gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem].marbles )
if (ItemIsMarbles(gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem))
{
if ( piItemIndex )
{
@@ -5154,7 +5153,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
gpTempSoldier = pSoldier;
gsTempGridNo = sGridNo;
if (Item[ pSoldier->inv[HANDPOS].usItem].remotetrigger )
if (ItemIsRemoteTrigger(pSoldier->inv[HANDPOS].usItem))
{
wcscpy( gzUserDefinedButton[0], L"1" );
wcscpy( gzUserDefinedButton[1], L"2" );
@@ -5249,7 +5248,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
{
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_REMOTE_FREQUENCY_STR ], GAME_SCREEN, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS, BombMessageBoxCallBack, NULL );
}
else if ( Item[ (&(pSoldier->inv[HANDPOS]))->usItem ].tripwire == 1 )
else if (ItemIsTripwire((&(pSoldier->inv[HANDPOS]))->usItem))
{
wcscpy( gzUserDefinedButton[0], L"1-A" );
wcscpy( gzUserDefinedButton[1], L"1-B" );
@@ -5573,10 +5572,10 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
if (gpTempSoldier)
{
// sevenfm: remember last tripwire network settings
if(Item[ gpTempSoldier->inv[HANDPOS].usItem ].tripwire )
if(ItemIsTripwire(gpTempSoldier->inv[HANDPOS].usItem))
gubLastTripwire = ubExitValue;
if (Item[ gpTempSoldier->inv[HANDPOS].usItem ].remotetrigger )
if (ItemIsRemoteTrigger(gpTempSoldier->inv[HANDPOS].usItem))
{
// Flugente: jamming can prevent bomb activation
if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() )
@@ -5602,7 +5601,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
if ( iResult >= 0 )
{
// Less explosives gain for placing tripwire
if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].tripwire == 1 )
if (ItemIsTripwire(gpTempSoldier->inv[ HANDPOS ].usItem))
StatChange( gpTempSoldier, EXPLODEAMT, 5, FALSE );
else if ( HasItemFlag( (gpTempSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
StatChange( gpTempSoldier, MECHANAMT, 10, FALSE );
@@ -5643,7 +5642,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
else
{
// we can't blow up tripwire, no matter how bad we fail
if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
if ( !ItemIsTripwire(gpTempSoldier->inv[ HANDPOS ].usItem))
{
// OOPS! ... BOOM!
IgniteExplosion( NOBODY, gpTempSoldier->sX, gpTempSoldier->sY, (INT16) (gpWorldLevelData[gpTempSoldier->sGridNo].sHeight), gpTempSoldier->sGridNo, gpTempSoldier->inv[ HANDPOS ].usItem, gpTempSoldier->pathing.bLevel, gpTempSoldier->ubDirection, &gpTempSoldier->inv[ HANDPOS ] );
@@ -5699,7 +5698,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
gTempObject[0]->data.ubDirection = gpTempSoldier->ubDirection; // Flugente: direction of bomb is direction of soldier
// Flugente: tripwire was called through a messagebox, but has to be buried nevertheless
if ( Item[ (&gTempObject)->usItem ].tripwire == 1 )
if (ItemIsTripwire((&gTempObject)->usItem))
{
AddItemToPool( gsTempGridNo, &gTempObject, BURIED, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 );
// sevenfm: set flag only if planting tripwire
@@ -5839,7 +5838,7 @@ BOOLEAN HandItemWorks( SOLDIERTYPE *pSoldier, INT8 bSlot )
// shape to be usable, and doesn't break during use.
// Exception: land mines. You can bury them broken, they just won't blow!
// if ( (Item[ pObj->usItem ].fFlags & ITEM_DAMAGEABLE) && (pObj->usItem != MINE) && (Item[ pObj->usItem ].usItemClass != IC_MEDKIT) && pObj->usItem != GAS_CAN )
if ( Item[pObj->usItem].damageable && !Item[pObj->usItem].mine && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !Item[pObj->usItem].gascan && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) )
if (ItemIsDamageable(pObj->usItem) && !ItemIsMine(pObj->usItem) && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !ItemIsGascan(pObj->usItem) && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) )
{
// if it's still usable, check whether it breaks
if ( (*pObj)[0]->data.objectStatus >= USABLE)
@@ -6103,7 +6102,7 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
CreateItem(gTempObject[0]->data.misc.usBombItem, gTempObject[0]->data.misc.bBombStatus, &TempObject);
// also spawn attached guns/explosives
if (gTempObject.usItem != ACTION_ITEM && (Item[gTempObject.usItem].tripwire || Item[gTempObject.usItem].usItemClass & IC_EXPLOSV))
if (gTempObject.usItem != ACTION_ITEM && (ItemIsTripwire(gTempObject.usItem) || Item[gTempObject.usItem].usItemClass & IC_EXPLOSV))
{
// search for attached items
OBJECTTYPE* pAttItem = NULL;
@@ -6990,7 +6989,7 @@ INT32 FindNearestAvailableGridNoForItem( INT32 sSweetGridNo, INT8 ubRadius )
BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay )
{
if ( Item[pSoldier->inv[ pSoldier->ubAttackingHand ].usItem].fingerprintid )
if (ItemHasFingerPrintID(pSoldier->inv[ pSoldier->ubAttackingHand ].usItem))
{
// check imprint ID
// NB not-imprinted value is NO_PROFILE
@@ -7042,7 +7041,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
fStealItem = FALSE;
pObject=&pOpponent->inv[i];
if ((pObject->exists() == true) && !(Item[pObject->usItem].defaultundroppable )) // CHECK! Undroppable items cannot be stolen - SANDRO
if ((pObject->exists() == true) && !ItemIsUndroppableByDefault(pObject->usItem)) // CHECK! Undroppable items cannot be stolen - SANDRO
{
// Is the enemy collapsed
if ( pOpponent->stats.bLife < OKLIFE || pOpponent->bCollapsed )
@@ -9855,7 +9854,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
}
}
// if we want to equip a two-handed item in our first hand, also drop whatever we have in the second hand
else if ( node.slot == HANDPOS && Item[node.item].twohanded && pSoldier->inv[SECONDHANDPOS].exists( ) )
else if ( node.slot == HANDPOS && ItemIsTwoHanded(node.item) && pSoldier->inv[SECONDHANDPOS].exists( ) )
{
AutoPlaceObjectInInventoryStash( &pSoldier->inv[SECONDHANDPOS], pSoldier->sGridNo, pSoldier->pathing.bLevel );
DeleteObj( &pSoldier->inv[SECONDHANDPOS] );
@@ -10268,7 +10267,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
}
// if there is water in this sector, refill canteens
if ( refillwaterfromsector && Item[(pSoldier->inv[slot]).usItem].canteen && Food[Item[(pSoldier->inv[slot]).usItem].foodtype].bDrinkPoints > 0 )
if ( refillwaterfromsector && ItemIsCanteen(pSoldier->inv[slot].usItem) && Food[Item[(pSoldier->inv[slot]).usItem].foodtype].bDrinkPoints > 0 )
{
OBJECTTYPE* pObj = &(pSoldier->inv[slot]);
+10 -9
View File
@@ -2988,11 +2988,12 @@ UINT32 UIHandleCAMercShoot( UI_EVENT *pUIEvent )
if ( pTSoldier != NULL )
{
// If this is one of our own guys.....pop up requiester...
UINT16 usItem = pSoldier->inv[HANDPOS].usItem;
if ( ( pTSoldier->bTeam == gbPlayerNum || pTSoldier->bTeam == MILITIA_TEAM )
&& Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass != IC_MEDKIT
&& !Item[pSoldier->inv[ HANDPOS ].usItem].gascan
&& !Item[pSoldier->inv[HANDPOS].usItem].toolkit
&& !ItemCanBeAppliedToOthers( pSoldier->inv[ HANDPOS ].usItem )
&& Item[ usItem ].usItemClass != IC_MEDKIT
&& !ItemIsGascan(usItem)
&& !ItemIsToolkit(usItem)
&& !ItemCanBeAppliedToOthers( usItem )
&& gTacticalStatus.ubLastRequesterTargetID != pTSoldier->ubProfile
&& ( pTSoldier->ubID != pSoldier->ubID ) )
{
@@ -3010,7 +3011,7 @@ UINT32 UIHandleCAMercShoot( UI_EVENT *pUIEvent )
}
////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - Should we ask if we really want to do the surgery?
else if (Item[ pSoldier->inv[ HANDPOS ].usItem ].medicalkit && (NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery)
else if (ItemIsMedicalKit(usItem) && (NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery)
&& (pTSoldier->bTeam == OUR_TEAM || pTSoldier->bTeam == MILITIA_TEAM)
&& (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier ))
&& gGameOptions.fNewTraitSystem && pTSoldier->iHealableInjury >= 100
@@ -3894,7 +3895,7 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
pSoldier->inv[HANDPOS].exists() &&
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
Item[pSoldier->inv[HANDPOS].usItem].twohanded &&
ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
bNewStance == ANIM_STAND)
{
ChangeScopeMode(pSoldier, NOWHERE);
@@ -3937,7 +3938,7 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
pSoldier->inv[HANDPOS].exists() &&
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
Item[pSoldier->inv[HANDPOS].usItem].twohanded &&
ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
bNewStance == ANIM_STAND)
{
ChangeScopeMode(pSoldier, NOWHERE);
@@ -4628,7 +4629,7 @@ INT8 DrawUIMovementPath( SOLDIERTYPE *pSoldier, INT32 usMapPos, UINT32 uiFlags )
}
else if ( uiFlags == MOVEUI_TARGET_BOMB )
{
if(Item[pSoldier->inv[HANDPOS].usItem].mine == 1)
if(ItemIsMine(pSoldier->inv[HANDPOS].usItem))
sAPCost += GetAPsToPlantMine( pSoldier );
else
sAPCost += GetAPsToDropBomb( pSoldier );
@@ -5014,7 +5015,7 @@ BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier )
}
// SANDRO - doctor with medical bag trying to do the surgery
if ((NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) && Item[pSoldier->inv[ HANDPOS ].usItem].medicalkit && gGameOptions.fNewTraitSystem
if ((NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) && ItemIsMedicalKit(pSoldier->inv[ HANDPOS ].usItem) && gGameOptions.fNewTraitSystem
&& (pTSoldier->stats.bLife != pTSoldier->stats.bLifeMax) && (pTSoldier->iHealableInjury >= 100))
{
// should come a question first if you really want to do the surgery
+142 -142
View File
@@ -1555,7 +1555,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
/////////////////// DAMAGE
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_BLADE|IC_PUNCH|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher )
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_BLADE|IC_PUNCH|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) )
{
ubRegionOffset = 1;
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + ubRegionOffset ] );
@@ -1698,7 +1698,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
/////////////////// AP TO DRAW
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_PUNCH) && !Item[ gpItemDescObject->usItem].rocketlauncher )
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_PUNCH) && !ItemIsRocketLauncher(gpItemDescObject->usItem) )
{
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 13 ] );
}
@@ -1709,25 +1709,25 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
/////////////////// AP TO BURST
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[gpItemDescObject->usItem].rocketlauncher )
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsRocketLauncher(gpItemDescObject->usItem) )
{
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 15 ] );
}
/////////////////// AP TO AUTOFIRE
if ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher )
if ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) )
{
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 16 ] );
}
/////////////////// AP TO RELOAD
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher )
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) )
{
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 17 ] );
}
/////////////////// AP TO RELOAD MANUALLY
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher && Weapon[gpItemDescObject->usItem].APsToReloadManually > 0 )
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) && Weapon[gpItemDescObject->usItem].APsToReloadManually > 0 )
{
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 18 ] );
}
@@ -1735,7 +1735,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
/////////////////// RECOIL X/Y
if( UsingNewCTHSystem() == true )
{
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher && (GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 || GetShotsPerBurst(gpItemDescObject)> 0 ) )
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) && (GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 || GetShotsPerBurst(gpItemDescObject)> 0 ) )
{
// HEADROCK HAM 5: One value to rule them all.
// MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 18 ] );
@@ -1751,7 +1751,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
/////////////////// BULLETS PER 5 AP
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher && GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 )
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) && GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 )
{
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 21 ] );
}
@@ -2333,7 +2333,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
if (Item[ gpItemDescObject->usItem ].usItemClass & IC_ARMOUR)
{
//////////////////// EXPLOSIVE RESISTANCE
if (Item[ gpItemDescObject->usItem ].flakjacket)
if (ItemIsFlakJacket(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 5 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 5 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2432,7 +2432,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
if (Item[ gpItemDescObject->usItem ].usItemClass & IC_EXPLOSV)
{
////////////////// LOCK BOMB
if (Item[ gpItemDescObject->usItem ].lockbomb)
if (ItemIsLockBomb(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 25 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 25 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2445,7 +2445,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
// Draw stats that can be had by any item.
//////////////////// WATERPROOF
if (!Item[ gpItemDescObject->usItem ].waterdamages)
if (!ItemIsDamagedByWater(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 6 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 6 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2454,7 +2454,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// ELECTRONIC
if (Item[ gpItemDescObject->usItem ].electronic)
if (ItemIsElectronic(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 7 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 7 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2463,7 +2463,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// GAS MASK
if (Item[ gpItemDescObject->usItem ].gasmask)
if (ItemIsGasmask(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 8 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 8 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2472,7 +2472,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// NEEDS BATTERIES
if (Item[ gpItemDescObject->usItem ].needsbatteries)
if (ItemNeedsBatteries(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 9 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 9 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2481,7 +2481,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// LOCKSMITH'S KIT
if (Item[ gpItemDescObject->usItem ].locksmithkit)
if (ItemIsLocksmithKit(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s%d", szUDBGenSecondaryStatsTooltipText[ 10 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 10 ], (Item[ gpItemDescObject->usItem ].LockPickModifier > 0 ?
( Item[ gpItemDescObject->usItem ].LockPickModifier * (*gpItemDescObject)[0]->data.objectStatus / 100 ) : Item[ gpItemDescObject->usItem ].LockPickModifier ) );
@@ -2491,7 +2491,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// WIRE CUTTERS
if (Item[ gpItemDescObject->usItem ].wirecutters)
if (ItemIsWirecutters(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 11 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 11 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2500,7 +2500,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// CROWBAR
if (Item[ gpItemDescObject->usItem ].crowbar)
if (ItemIsCrowbar(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s%d", szUDBGenSecondaryStatsTooltipText[ 12 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 12 ], Item[ gpItemDescObject->usItem ].CrowbarModifier );
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2509,7 +2509,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// METAL DETECTOR
if (Item[ gpItemDescObject->usItem ].metaldetector)
if (ItemIsMetalDetector(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 13 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 13 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2518,7 +2518,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// REMOTE TRIGGER
if (Item[ gpItemDescObject->usItem ].remotetrigger)
if (ItemIsRemoteTrigger(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 14 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 14 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2527,7 +2527,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// REMOTE DETONATOR
if (Item[ gpItemDescObject->usItem ].remotedetonator)
if (ItemIsRemoteDetonator(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 15 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 15 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2536,7 +2536,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// TIMER DETONATOR
if (Item[ gpItemDescObject->usItem ].detonator)
if (ItemIsDetonator(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 16 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 16 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2545,7 +2545,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// GAS CAN
if (Item[ gpItemDescObject->usItem ].gascan)
if (ItemIsGascan(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 17 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 17 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2554,7 +2554,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// TOOLKIT
if (Item[ gpItemDescObject->usItem ].toolkit)
if (ItemIsToolkit(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s%d", szUDBGenSecondaryStatsTooltipText[ 18 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 18 ], Item[ gpItemDescObject->usItem ].RepairModifier );
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2563,7 +2563,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// THERMAL OPTICS
if (Item[ gpItemDescObject->usItem ].thermaloptics)
if (ItemIsThermalOptics(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 19 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 19 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2572,7 +2572,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// X-RAY DEVICE
if (Item[ gpItemDescObject->usItem ].xray)
if (ItemHasXRay(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 20 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 20 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2581,7 +2581,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// CANTEEN
if (Item[ gpItemDescObject->usItem ].canteen)
if (ItemIsCanteen(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 21 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 21 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2599,7 +2599,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// FIRST-AID KIT
if (Item[ gpItemDescObject->usItem ].firstaidkit)
if (ItemIsFirstAidKit(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 23 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 23 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2608,7 +2608,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// MEDICAL KIT
if (Item[ gpItemDescObject->usItem ].medicalkit)
if (ItemIsMedicalKit(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 24 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 24 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2681,7 +2681,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// NOT DAMAGEABLE
if ( Item[gpItemDescObject->usItem].damageable == 0 )
if (!ItemIsDamageable(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 32 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 32 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2690,7 +2690,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// METAL
if ( Item[gpItemDescObject->usItem].metal > 0 )
if (ItemIsMetal(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 33 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 33 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2699,7 +2699,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// SINKS
if ( Item[gpItemDescObject->usItem].sinks > 0 )
if (ItemSinks(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 34 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 34 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2708,7 +2708,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// TWO HANDED
if ( Item[gpItemDescObject->usItem].twohanded > 0 )
if (ItemIsTwoHanded(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 35 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 35 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -2717,7 +2717,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// BLOCKS IRON SIGHTS
if ( Item[gpItemDescObject->usItem].blockironsight > 0 )
if (ItemBlocksIronsight(gpItemDescObject->usItem))
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 36 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 36 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
@@ -4070,7 +4070,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
cnt++;
}
else if ( Item[gpItemDescObject->usItem].barrel == TRUE ) // for barrel items
else if (ItemIsBarrel(gpItemDescObject->usItem)) // for barrel items
{
if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // new index line here?
///////////////////// COOLDOWN FACTOR
@@ -4366,8 +4366,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
}
//////////////////// DAMAGE
if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher ) )
if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem) ) )
{
ubNumLine = 1;
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 5, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
@@ -4525,8 +4525,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
ubNumLine = 11;
}
if ( !Item[gpItemDescObject->usItem].repairable ||
( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) )
if ( !ItemIsRepairable(gpItemDescObject->usItem) ||
( fComparisonMode && !ItemIsRepairable(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[ubNumLine][0].sLeft + sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
@@ -4542,16 +4542,16 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
}
//////////////////// DRAW COST
if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem].rocketlauncher ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem].rocketlauncher ) )
if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsRocketLauncher(gpItemDescObject->usItem) ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
{
ubNumLine = 13;
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 1, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
//////////////////// SINGLE SHOT COST - GUN
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) )
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
{
ubNumLine = 14;
// "NO SINGLE-SHOT" ICON
@@ -4565,8 +4565,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
}
/////////////////// SINGLE SHOT COST - ROCKET
if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && Item[gpItemDescObject->usItem].rocketlauncher && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && Item[gpComparedItemDescObject->usItem].rocketlauncher ) )
if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && ItemIsRocketLauncher(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
{
ubNumLine = 14;
// SINGLE ROCKET-LAUNCH AP ICON
@@ -4574,9 +4574,9 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
}
/////////////////// SINGLE SHOT COST - GRENADE LAUNCHER
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpItemDescObject->usItem].rocketlauncher
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !ItemIsRocketLauncher(gpItemDescObject->usItem)
&& !Weapon[gpItemDescObject->usItem].NoSemiAuto && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpComparedItemDescObject->usItem].rocketlauncher
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_LAUNCHER && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem)
&& !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) )
{
ubNumLine = 14;
@@ -4608,8 +4608,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
}
/////////////////// BURST COST - GUN
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) )
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
{
ubNumLine = 15;
// "NO BURST" ICON
@@ -4625,9 +4625,9 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
}
}
////////////////// BURST COST - GRENADE LAUNCHER
else if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpItemDescObject->usItem].rocketlauncher
else if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !ItemIsRocketLauncher(gpItemDescObject->usItem)
&& GetShotsPerBurst(gpItemDescObject)> 0 ) ||
( fComparisonMode && Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpItemDescObject->usItem].rocketlauncher
( fComparisonMode && Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !ItemIsRocketLauncher(gpItemDescObject->usItem)
&& GetShotsPerBurst(gpItemDescObject)> 0 ) )
{
ubNumLine = 15;
@@ -4635,8 +4635,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
}
////////////////// AUTOFIRE COST
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) )
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
{
ubNumLine = 16;
// "NO-AUTO" ICON
@@ -4654,17 +4654,17 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
////////////////// RELOAD COST
if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher ) )
if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem) ) )
{
ubNumLine = 17;
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 2, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
////////////////// MANUAL RELOAD COST
if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher
if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem)
&& Weapon[gpItemDescObject->usItem].APsToReloadManually > 0 ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem)
&& Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 ) )
{
ubNumLine = 18;
@@ -4675,9 +4675,9 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
if( UsingNewCTHSystem() == true )
{
ubNumLine = 20;
if ( ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher
if ( ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem)
&& ( GetShotsPerBurst(gpItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 ) ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem)
&& ( GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) ) )
{
// HEADROCK HAM 5: One value to rule them all! Line 19 left empty intentionally.
@@ -4702,9 +4702,9 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
}
///////////////// AUTOFIRE SHOTS PER 5 AP ICON
if ( ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher
if ( ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem)
&& GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem)
&& GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) )
{
ubNumLine = 21;
@@ -4946,8 +4946,8 @@ void DrawExplosiveStats( OBJECTTYPE * gpItemDescObject )
}
////////////////// REPAIR EASE
if ( ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode ) ||
( fComparisonMode && !Item[ gpComparedItemDescObject->usItem ].repairable ) )
if ( ( !ItemIsRepairable(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && !ItemIsRepairable(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[11][0].sLeft + sOffsetX, gItemDescGenRegions[11][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
@@ -5036,8 +5036,8 @@ void DrawArmorStats( OBJECTTYPE * gpItemDescObject )
}
////////////////// REPAIR EASE
if ( ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode ) ||
( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) )
if ( ( !ItemIsRepairable(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && !ItemIsRepairable(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[3][0].sLeft + sOffsetX, gItemDescGenRegions[3][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
@@ -5782,8 +5782,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject )
cnt++;
}
if( ( Item[gpItemDescObject->usItem].barrel == TRUE ) || // for barrel items
( fComparisonMode && Item[gpComparedItemDescObject->usItem].barrel == TRUE ) )
if( (ItemIsBarrel(gpItemDescObject->usItem)) || // for barrel items
( fComparisonMode && ItemIsBarrel(gpComparedItemDescObject->usItem) ) )
{
if ( !fDrawGenIndexes ) fDrawGenIndexes = ++cnt; // new index line here?
@@ -5988,8 +5988,8 @@ void DrawMiscStats( OBJECTTYPE * gpItemDescObject )
// not for weapons. They have this one their primary page
if ( !(Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) )
{
if ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode ||
( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) )
if ( !ItemIsRepairable(gpItemDescObject->usItem) && !fComparisonMode ||
( fComparisonMode && !ItemIsRepairable(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[0][0].sLeft + sOffsetX, gItemDescGenRegions[0][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
@@ -6076,8 +6076,8 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_ARMOUR))
{
////////////////// FLAK JACKET
if ( ( Item[ gpItemDescObject->usItem ].flakjacket && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].flakjacket ))
if ( (ItemIsFlakJacket(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsFlakJacket(gpComparedItemDescObject->usItem) ))
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 5, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
@@ -6162,8 +6162,8 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_EXPLOSV))
{
////////////////// LOCK BOMB
if ( ( Item[ gpItemDescObject->usItem ].lockbomb && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].lockbomb ) )
if (( ItemIsLockBomb(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsLockBomb(gpComparedItemDescObject->usItem) ))
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 25, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
@@ -6174,128 +6174,128 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
// Draw stats that can be had by any item.
//////////////////// WATERPROOF
if ( ( !Item[ gpItemDescObject->usItem ].waterdamages && !fComparisonMode ) ||
( fComparisonMode && !Item[ gpComparedItemDescObject->usItem ].waterdamages ) )
if ( ( !ItemIsDamagedByWater(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && !ItemIsDamagedByWater(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 6, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// ELECTRONIC
if ( ( Item[ gpItemDescObject->usItem ].electronic && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].electronic ) )
if ( (ItemIsElectronic(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsElectronic(gpComparedItemDescObject->usItem)) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 7, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// GAS MASK
if ( ( Item[ gpItemDescObject->usItem ].gasmask && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].gasmask ) )
if ( (ItemIsGasmask(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsGasmask(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 8, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// NEEDS BATTERIES
if ( ( Item[ gpItemDescObject->usItem ].needsbatteries && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].needsbatteries ) )
if ( (ItemNeedsBatteries(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemNeedsBatteries(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 9, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// LOCKSMITH'S KIT
if ( ( Item[ gpItemDescObject->usItem ].locksmithkit && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].locksmithkit ) )
if ( (ItemIsLocksmithKit(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsLocksmithKit(gpComparedItemDescObject->usItem)) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 10, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// WIRE CUTTERS
if ( ( Item[ gpItemDescObject->usItem ].wirecutters && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].wirecutters ) )
if ( (ItemIsWirecutters(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsWirecutters(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 11, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// CROWBAR
if ( ( Item[ gpItemDescObject->usItem ].crowbar && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].crowbar ) )
if ( (ItemIsCrowbar(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsCrowbar(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 12, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// CROWBAR
if ( ( Item[ gpItemDescObject->usItem ].metaldetector && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].metaldetector ) )
if ( (ItemIsMetalDetector(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsMetalDetector(gpComparedItemDescObject->usItem)) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 13, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// REMOTE TRIGGER
if ( ( Item[ gpItemDescObject->usItem ].remotetrigger && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].remotetrigger ) )
if ( (ItemIsRemoteTrigger(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsRemoteTrigger(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 14, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// REMOTE DETONATOR
if ( ( Item[ gpItemDescObject->usItem ].remotedetonator && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].remotedetonator ) )
if ( (ItemIsRemoteDetonator(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsRemoteDetonator(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 15, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// TIMER DETONATOR
if ( ( Item[ gpItemDescObject->usItem ].detonator && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].detonator ) )
if ( (ItemIsDetonator(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsDetonator(gpComparedItemDescObject->usItem)) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 16, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// GAS CAN
if ( ( Item[ gpItemDescObject->usItem ].gascan && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].gascan ) )
if ( (ItemIsGascan(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsGascan(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 17, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// TOOLKIT
if ( ( Item[ gpItemDescObject->usItem ].toolkit && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].toolkit ) )
if ( (ItemIsToolkit(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsToolkit(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 18, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// THERMAL OPTICS
if ( ( Item[ gpItemDescObject->usItem ].thermaloptics && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].thermaloptics ) )
if ( (ItemIsThermalOptics(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsThermalOptics(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 19, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// X-RAY DEVICE
if ( ( Item[ gpItemDescObject->usItem ].xray && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].xray ) )
if ( (ItemHasXRay(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemHasXRay(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 20, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// CANTEEN
if ( ( Item[ gpItemDescObject->usItem ].canteen && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].canteen ) )
if ( (ItemIsCanteen(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsCanteen(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 21, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
@@ -6310,16 +6310,16 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
}
//////////////////// FIRST-AID KIT
if ( ( Item[ gpItemDescObject->usItem ].firstaidkit && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].firstaidkit ) )
if ( (ItemIsFirstAidKit(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsFirstAidKit(gpComparedItemDescObject->usItem)) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 23, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// MEDICAL KIT
if ( ( Item[ gpItemDescObject->usItem ].medicalkit && !fComparisonMode ) ||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].medicalkit ) )
if ( (ItemIsMedicalKit(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsMedicalKit(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 24, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
@@ -6389,40 +6389,40 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
}
//////////////////// NOT DAMAGEABLE
if ( ( Item[gpItemDescObject->usItem].damageable == 0 && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].damageable == 0 ) )
if ( (!ItemIsDamageable(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && !ItemIsDamageable(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 31, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// METAL
if ( ( Item[gpItemDescObject->usItem].metal > 0 && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].metal > 0 ) )
if ( (ItemIsMetal(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsMetal(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 32, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// SINKS
if ( ( Item[gpItemDescObject->usItem].sinks > 0 && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].sinks > 0 ) )
if ( (ItemSinks(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemSinks(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 33, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// TWO HANDED
if ( ( Item[gpItemDescObject->usItem].twohanded > 0 && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].twohanded > 0 ) )
if ( (ItemIsTwoHanded(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemIsTwoHanded(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 34, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
//////////////////// BLOCKS IRON SIGHTS
if ( ( Item[gpItemDescObject->usItem].blockironsight > 0 && !fComparisonMode ) ||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].blockironsight > 0 ) )
if ( (ItemBlocksIronsight(gpItemDescObject->usItem) && !fComparisonMode ) ||
( fComparisonMode && ItemBlocksIronsight(gpComparedItemDescObject->usItem) ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 35, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
@@ -6822,7 +6822,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// ShotsPer4Turns -> ubAttackAPs, used later for all shot AP values
// silversurfer: Knuckle Dusters count as bare hand attacks and use the AP_PUNCH constant.
if ( Item[gpItemDescObject->usItem].brassknuckles )
if (ItemIsBrassKnuckles(gpItemDescObject->usItem))
{
ubAttackAPs = APBPConstants[AP_PUNCH];
ubBasicAttackAPs = APBPConstants[AP_PUNCH];
@@ -7002,7 +7002,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
DrawPropertyValueInColour( iFinalAccuracyValue, ubNumLine, 3, fComparisonMode, FALSE, TRUE, ITEMDESC_FONTPOSITIVE );
}
/////////////// DAMAGE
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher )
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) )
{
// Set line to draw into
ubNumLine = 1;
@@ -7060,7 +7060,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
DrawPropertyValueInColour( iComparedFinalDamageValue - iFinalDamageValue, ubNumLine, 3, fComparisonMode, FALSE, TRUE );
}
}
else if( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher )
else if( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem) )
{
// Set line to draw into
ubNumLine = 1;
@@ -7840,7 +7840,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
}
// Does gun have flash suppression?
BOOLEAN iFlashValue = Item[ gpItemDescObject->usItem ].hidemuzzleflash;
BOOLEAN iFlashValue = ItemHasHiddenMuzzleFlash(gpItemDescObject->usItem);
if( !fComparisonMode )
{
@@ -7864,7 +7864,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
}
else if( IsFlashSuppressorAlt( gpComparedItemDescObject ) == TRUE )
{
BOOLEAN iComparedFlashValue = Item[ gpComparedItemDescObject->usItem ].hidemuzzleflash;
BOOLEAN iComparedFlashValue = ItemHasHiddenMuzzleFlash(gpComparedItemDescObject->usItem);
if ( iFlashValue )
{
if (iComparedFlashValue)
@@ -7921,7 +7921,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
else
ubNumLine = 8;
// Does gun have flash suppression?
BOOLEAN iFlashValue = Item[ gpComparedItemDescObject->usItem ].hidemuzzleflash;
BOOLEAN iFlashValue = ItemHasHiddenMuzzleFlash(gpComparedItemDescObject->usItem);
if ( iFlashValue )
{
// Print base value
@@ -8077,7 +8077,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
}
///////////////////// DRAW AP
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem].rocketlauncher )
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsRocketLauncher(gpItemDescObject->usItem) )
{
// Set line to draw into
ubNumLine = 13;
@@ -8137,7 +8137,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
DrawPropertyValueInColour( iComparedFinalDrawAPCost - iFinalDrawAPCost, ubNumLine, 3, fComparisonMode, FALSE, FALSE );
}
}
else if( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem].rocketlauncher )
else if( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) )
{
ubNumLine = 13;
// Get final Draw Cost
@@ -8376,7 +8376,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
}
///////////////////// RELOAD AP
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher )
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) )
{
// Set line to draw into
ubNumLine = 17;
@@ -8423,7 +8423,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Print final value
DrawPropertyValueInColour( iFinalReloadAPCost, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
}
else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher )
else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem) )
{
// Get final Reload Cost
INT16 iComparedFinalReloadAPCost = GetAPsToReload( gpComparedItemDescObject );
@@ -8471,7 +8471,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
DrawPropertyTextInColour( L"-", ubNumLine, 3, ITEMDESC_FONTPOSITIVE );
}
}
else if( fComparisonMode && ( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher ) )
else if( fComparisonMode && ( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem) ) )
{
ubNumLine = 17;
// Get final Reload Cost
@@ -8515,7 +8515,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
}
///////////////////// MANUAL RELOAD AP
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem)
&& Weapon[gpItemDescObject->usItem].APsToReloadManually > 0 )
{
// Set line to draw into
@@ -8555,7 +8555,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Print final value
DrawPropertyValueInColour( iFinalManualReloadAPCost, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
}
else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher
else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem)
&& Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 )
{
// Get final Manual Reload Cost
@@ -8597,7 +8597,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
DrawPropertyTextInColour( L"-", ubNumLine, 3, ITEMDESC_FONTPOSITIVE );
}
}
else if( fComparisonMode && ( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher
else if( fComparisonMode && ( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem)
&& Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 ) )
{
ubNumLine = 18;
@@ -8637,7 +8637,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
///////////////////// RECOIL X/Y
if ( UsingNewCTHSystem() == true )
{
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem)
&& GetShotsPerBurst(gpItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpItemDescObject) )
{
// HEADROCK HAM 5: One value to rule them all.
@@ -8677,7 +8677,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Print final value
DrawPropertyValueInColourFloat( dFinalRecoil, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE, 1.0f );
}
else if( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher
else if( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem)
&& GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) )
{
FLOAT iComparedFinalRecoilX = 0;
@@ -8775,7 +8775,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
SetFontForeground( 6 );
*/
}
else if( fComparisonMode && ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher
else if( fComparisonMode && ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem)
&& GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) ) )
{
@@ -8848,7 +8848,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Print final value
DrawPropertyValueInColour( iFinalBurstValue, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
}
else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher )
else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem) )
{
// Get base Burst Penalty value
INT16 iComparedBurstValue = Weapon[gpComparedItemDescObject->usItem].ubBurstPenalty * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1);
@@ -8961,7 +8961,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
}
/////////////////// AUTOFIRE BULLETS PER 5 AP
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem)
&& GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 )
{
// Set line to draw into
@@ -8982,7 +8982,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Print final value
DrawPropertyValueInColour( iFinalB5AP, ubNumLine, 3, fComparisonMode, FALSE, TRUE, FONT_MCOLOR_WHITE );
}
else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher
else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem)
&& GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 )
{
// Get final B/5AP
@@ -9003,7 +9003,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
DrawPropertyTextInColour( L"-", ubNumLine, 3, ITEMDESC_FONTNEGATIVE );
}
}
else if( fComparisonMode && ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher
else if( fComparisonMode && ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem)
&& GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) )
{
ubNumLine = 21;
@@ -9054,7 +9054,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Print final value
DrawPropertyValueInColour( iFinalAutoValue, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
}
else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher
else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem)
&& GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 )
{
// Get base Auto Penalty value
@@ -13805,8 +13805,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
cnt++;
}
else if ( ( Item[gpItemDescObject->usItem].barrel == TRUE ) || // display for barrel items
( fComparisonMode && Item[gpComparedItemDescObject->usItem].barrel == TRUE ) )
else if ( (ItemIsBarrel(gpItemDescObject->usItem)) || // display for barrel items
( fComparisonMode && ItemIsBarrel(gpComparedItemDescObject->usItem) ) )
{
if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // insert Indexes here?
///////////////////// COOLDOWN FACTOR
+42 -44
View File
@@ -168,7 +168,7 @@ INT16 ITEMDESC_DONE_Y;
#define DOTDOTDOT L"..."
#define COMMA_AND_SPACE L", "
#define ITEM_PROS_AND_CONS( usItem ) ( ( Item[ usItem ].usItemClass & IC_GUN && !Item[ usItem ].rocketlauncher ) )
#define ITEM_PROS_AND_CONS( usItem ) ( ( Item[ usItem ].usItemClass & IC_GUN && !ItemIsRocketLauncher(usItem) ) )
#define ITEMDESC_ITEM_STATUS_WIDTH 2
#define ITEMDESC_ITEM_WIDTH 117
@@ -2666,7 +2666,7 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
}
// IF it's the second hand and this hand cannot contain anything, remove the second hand position graphic
if (sPocket == SECONDHANDPOS && Item[pSoldier->inv[HANDPOS].usItem].twohanded )
if (sPocket == SECONDHANDPOS && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem))
{
// CHRISL: Change coords for STI that covers 2nd hand location when carrying a 2handed weapon
if( guiCurrentItemDescriptionScreen != MAP_SCREEN )
@@ -2710,7 +2710,7 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
fHatchItOut = TRUE;
}
// CHRISL: Don't hatch second hand position if we're holding a two handed item
else if ( sPocket == SECONDHANDPOS && Item[pSoldier->inv[HANDPOS].usItem].twohanded )
else if ( sPocket == SECONDHANDPOS && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) )
{
fHatchItOut = FALSE;
}
@@ -2832,8 +2832,8 @@ BOOLEAN CompatibleItemForApplyingOnMerc(OBJECTTYPE *pTestObject)
//Shadooow: rewritten to use new item flags and check canteen not empty
if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || Item[usItem].camouflagekit || usItem == JAR_ELIXIR ||
Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!Item[usItem].canteen || (*pTestObject)[0]->data.objectStatus > 1))
if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || ItemIsCamoKit(usItem) || usItem == JAR_ELIXIR ||
Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!ItemIsCanteen(usItem) || (*pTestObject)[0]->data.objectStatus > 1))
{
return( TRUE );
}
@@ -3010,14 +3010,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapScreen( SOLDIERTYPE *pSoldier, INT32 bInvPos
UINT32 invsize = pSoldier->inv.size();
// First test attachments, which almost any type of item can have....
if ( !(Item[ pTestObject->usItem ].hiddenaddon ) )
if ( !(ItemIsHiddenAddon(pTestObject->usItem)) )
{
for ( cnt = 0; cnt < invsize; ++cnt )
{
pObject = &(pSoldier->inv[ cnt ]);
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{
// don't consider for UI purposes
@@ -3116,14 +3116,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapInventory(SOLDIERTYPE *pSoldier, INT32 bInvP
}
// First test attachments, which almost any type of item can have....
if (!(Item[pTestObject->usItem].hiddenaddon))
if (!(ItemIsHiddenAddon(pTestObject->usItem)))
{
for (cnt = 0; cnt < MAP_INVENTORY_POOL_SLOT_COUNT; ++cnt)
{
pObject = &(pInventoryPoolList[iStartSlotNumber + cnt].object);
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{
// don't consider for UI purposes
@@ -3270,14 +3270,14 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
UINT32 invsize = pSoldier->inv.size();
// First test attachments, which almost any type of item can have....
if (!(Item[pTestObject->usItem].hiddenaddon))
if (!(ItemIsHiddenAddon(pTestObject->usItem)))
{
for (cnt = 0; cnt < invsize; ++cnt)
{
pObject = &(pSoldier->inv[cnt]);
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{
// don't consider for UI purposes
@@ -3302,7 +3302,7 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
}
}
//if the test object is hidden addon or attachment, it won't be ammunition or gun so skip this
if (!Item[pTestObject->usItem].hiddenaddon && !Item[pTestObject->usItem].attachment)
if (!ItemIsHiddenAddon(pTestObject->usItem) && !ItemIsAttachment(pTestObject->usItem))
{
if( ( Item [ pTestObject->usItem ].usItemClass & IC_GUN ) )
{
@@ -3816,7 +3816,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
}
}
if ( pItem->usItemClass == IC_GUN && !Item[pObject->usItem].rocketlauncher )
if ( pItem->usItemClass == IC_GUN && !ItemIsRocketLauncher(pObject->usItem) )
{
sNewY = sY + sHeight - 10;
sNewX = sX + 1;
@@ -3872,7 +3872,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
}
}
if ( pItemShown->usItemClass == IC_GUN && !Item[pObjShown->usItem].rocketlauncher )
if ( pItemShown->usItemClass == IC_GUN && !ItemIsRocketLauncher(pObjShown->usItem) )
{
SetRGBFontForeground( AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].red,
AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].green,
@@ -3950,7 +3950,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
}
// Flugente: overheating
if ( gGameExternalOptions.fWeaponOverheating && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || Item[pObject->usItem].barrel ) )
if ( gGameExternalOptions.fWeaponOverheating && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || ItemIsBarrel(pObject->usItem)) )
{
OBJECTTYPE* pObjShown = pObject;
@@ -4201,7 +4201,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
}
if ( ( ( pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO ) ||
( Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_LAUNCHER && !Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher ) ) &&
( Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_LAUNCHER && !ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem)) ) &&
pSoldier->usGLDelayMode )
{
wcscat( pStr, New113Message[MSG113_FIREMODE_GL_DELAYED] );
@@ -4231,7 +4231,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
if ( pSoldier && pObject == &(pSoldier->inv[SECONDHANDPOS] ) &&
(pSoldier->bWeaponMode == WM_BURST || pSoldier->bWeaponMode == WM_AUTOFIRE) &&
Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN &&
!(Item[ pSoldier->inv[HANDPOS ].usItem ].twohanded ) &&
!ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
pSoldier->IsValidSecondHandBurst() )
{
sNewY = sY + 13; // rather arbitrary
@@ -4565,7 +4565,7 @@ void MAPINVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pOb
}
//////////////////// GUN DATA //////////////////
if ( pItem->usItemClass & IC_GUN && !Item[pObject->usItem].rocketlauncher )
if ( pItem->usItemClass & IC_GUN && !ItemIsRocketLauncher(pObject->usItem) )
{
//////////////// AMMO REMAINING
@@ -4804,7 +4804,7 @@ void MAPINVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pOb
}
iCurAsterisk = ATTACHMENT_GENERAL;
if (Item[iter->usItem].grenadelauncher )
if (ItemIsGrenadeLauncher(iter->usItem))
{
//iCurAsterisk = ATTACHMENT_GL;
uiNumAttachmentsGL++;
@@ -5233,7 +5233,7 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
}
// Add ammo eject button for GUN type objects.
if ( (Item[ pObject->usItem ].usItemClass & IC_GUN) && !Item[pObject->usItem].rocketlauncher )
if ( (Item[ pObject->usItem ].usItemClass & IC_GUN) && !ItemIsRocketLauncher(pObject->usItem) )
{
if ( GetMagSize(gpItemDescObject) <= 99 )
{
@@ -5610,7 +5610,7 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
}
// if ( !(Item[ pObject->usItem ].fFlags & ITEM_HIDDEN_ADDON) && ( ValidAttachment( gpItemPointer->usItem, pObject->usItem ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) )
if ( !(Item[ pObject->usItem ].hiddenaddon ) && ( ValidAttachment( gpItemPointer->usItem, pObject ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) )
if ( !(ItemIsHiddenAddon(pObject->usItem)) && ( ValidAttachment( gpItemPointer->usItem, pObject ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) )
{
SetUpFastHelpListRegions(
gItemDescHelpText.iXPosition,
@@ -5750,7 +5750,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
if (Item[usLoop].nasAttachmentClass & AttachmentSlots[usLoopSlotID].nasAttachmentClass && IsAttachmentPointAvailable(point, usLoop, TRUE))
{
usAttachment = usLoop;
if (!Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment))
if (!ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment))
{
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{
@@ -5786,7 +5786,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
}
}
if (usAttachment > 0 && !Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment))
if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment))
{
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{
@@ -5822,7 +5822,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
}
}
if (usAttachment > 0 && !Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment))
if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment))
{
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{
@@ -5895,7 +5895,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
for(UINT16 loop = 0; loop < attachList.size(); loop++){
usAttachment = attachList[loop];
// If the attachment is not hidden
if (usAttachment > 0 && !Item[ usAttachment ].hiddenaddon && !Item[ usAttachment ].hiddenattachment)
if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment))
{
if (wcslen( attachStr3 ) + wcslen(Item[usAttachment].szItemName) > 3600)
{
@@ -7021,8 +7021,7 @@ void RenderItemDescriptionBox( )
//WarmSteel - This hatches out attachment slots one by one, instead of all of em.
for(cnt = 0; cnt < (INT32)(*gpItemDescObject)[gubItemDescStatusIndex]->attachments.size(); cnt++)
{
//if ( ( Item[ gpItemPointer->usItem ].fFlags & ITEM_HIDDEN_ADDON ) ||
if ( ( Item[ gpItemPointer->usItem ].hiddenaddon ) ||
if (ItemIsHiddenAddon(gpItemPointer->usItem) ||
( !ValidItemAttachmentSlot( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, cnt, FALSE, NULL, usAttachmentSlotIndexVector) &&
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
@@ -7038,8 +7037,7 @@ void RenderItemDescriptionBox( )
} else {
for(cnt = 0; cnt < OLD_MAX_ATTACHMENTS_101; cnt++)
{
//if ( ( Item[ gpItemPointer->usItem ].fFlags & ITEM_HIDDEN_ADDON ) ||
if ( ( Item[ gpItemPointer->usItem ].hiddenaddon ) ||
if (ItemIsHiddenAddon(gpItemPointer->usItem) ||
( !ValidItemAttachment( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, usAttachmentSlotIndexVector) &&
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) && !ValidLaunchable( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
@@ -7071,7 +7069,7 @@ void RenderItemDescriptionBox( )
DrawItemUIBarEx( gpItemDescObject, (UINT8)(DRAW_ITEM_STATUS_ATTACHMENT1 + cnt), sCenX, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, Get16BPPColor( STATUS_BAR ), Get16BPPColor( STATUS_BAR_SHADOW ), TRUE , guiSAVEBUFFER, gubItemDescStatusIndex );
// Flugente: overheating
if ( gGameExternalOptions.fWeaponOverheating && ( Item[ (iter)->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[ (iter)->usItem ].barrel == TRUE) ) // Flugente
if ( gGameExternalOptions.fWeaponOverheating && ( Item[ (iter)->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) || ItemIsBarrel((iter)->usItem)) ) // Flugente
{
FLOAT overheatjampercentage = GetGunOverheatDisplayPercentage( &(*iter));
@@ -7219,7 +7217,7 @@ void RenderItemDescriptionBox( )
SetFontForeground( FONT_BLACK );
SetFontShadow( ITEMDESC_FONTSHADOW2 );
// Caliber
if ( (Item[gpItemDescObject->usItem].fingerprintid ) && (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID < NO_PROFILE )
if ( ItemHasFingerPrintID(gpItemDescObject->usItem) && (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID < NO_PROFILE )
{
// Fingerprint ID
swprintf( pStr, L"%s %s (%s)", AmmoCaliber[ Weapon[ gpItemDescObject->usItem ].ubCalibre ], WeaponType[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ], gMercProfiles[ (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID ].zNickname );
@@ -7284,7 +7282,7 @@ void RenderItemDescriptionBox( )
}
// Flugente: display temperature string
if ( gGameExternalOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || Item[gpItemDescObject->usItem].barrel == TRUE ) )
if ( gGameExternalOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || ItemIsBarrel(gpItemDescObject->usItem) ) )
{
// UDB system displays a string with colored condition text.
int regionindex = 8;
@@ -7612,7 +7610,7 @@ void RenderItemDescriptionBox( )
FindFontRightCoordinates( gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sTop, gODBItemDescRegions[2][7].sRight - gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sBottom - gODBItemDescRegions[2][7].sTop ,pStr, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY, pStr );
}
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher )
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) )
{
// DAMAGE
SetFontForeground( 6 );
@@ -8365,7 +8363,7 @@ void DeleteItemDescriptionBox( )
}
if (Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && ValidLaunchable(newIter->usItem, gpItemDescObject->usItem) ||
Item[gpItemDescObject->usItem].cannon)
ItemIsCannon(gpItemDescObject->usItem))
{
//lalien: changed to charge AP's for reloading a GL/RL
ubAPCost = GetAPsToReload(gpItemDescObject);
@@ -10712,7 +10710,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason )
}
else
{
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpItemPopupObject->usItem].singleshotrocketlauncher) )
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpItemPopupObject->usItem) )
{
EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos );
InternalMAPBeginItemPointer( gpItemPopupSoldier );
@@ -10723,7 +10721,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason )
}
else
{
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpItemPopupObject->usItem].singleshotrocketlauncher) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) )
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpItemPopupObject->usItem) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) )
{
EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos );
gpItemPointer = &gItemPointer;
@@ -12629,7 +12627,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
// Fingerprint ID (Soldier Name)
if ( ( Item[pObject->usItem].fingerprintid ) && (*pObject)[subObject]->data.ubImprintID < NO_PROFILE )
if ( ItemHasFingerPrintID(pObject->usItem) && (*pObject)[subObject]->data.ubImprintID < NO_PROFILE )
{
CHAR16 pStr2[20];
swprintf( pStr2, L" [%s]", gMercProfiles[ (*pObject)[subObject]->data.ubImprintID ].zNickname );
@@ -13816,7 +13814,7 @@ void BombInventoryMessageBoxCallBack( UINT8 ubExitValue )
if (gpItemDescSoldier)
{
// no planting tripwire in our inventory...
if ( Item[ gpItemDescObject->usItem ].tripwire == 1 )
if (ItemIsTripwire(gpItemDescObject->usItem))
return;
INT32 iResult;
@@ -13965,14 +13963,14 @@ void BombInventoryDisArmMessageBoxCallBack( UINT8 ubExitValue )
if ( (*gpItemDescObject)[0]->data.misc.ubBombOwner > 1 && ( (INT32)(*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && (*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) )
{
// Flugente: get a tripwire-related bonus if we have a wire cutter in our hands
if ( ( (&gpItemDescSoldier->inv[HANDPOS])->exists() && Item[ gpItemDescSoldier->inv[HANDPOS].usItem ].wirecutters == 1 ) || ( (&gpItemDescSoldier->inv[SECONDHANDPOS])->exists() && Item[ gpItemDescSoldier->inv[SECONDHANDPOS].usItem ].wirecutters == 1 ) )
if ( ( (&gpItemDescSoldier->inv[HANDPOS])->exists() && ItemIsWirecutters(gpItemDescSoldier->inv[HANDPOS].usItem) ) || ( (&gpItemDescSoldier->inv[SECONDHANDPOS])->exists() && ItemIsWirecutters(gpItemDescSoldier->inv[SECONDHANDPOS].usItem) ) )
{
// + 10 if item gets activated by tripwire
if ( Item[gpItemDescObject->usItem].tripwireactivation == 1 )
if (ItemHasTripwireActivation(gpItemDescObject->usItem))
diff += 10;
// + 10 if item is tripwire
if ( Item[gpItemDescObject->usItem].tripwire == 1 )
if (ItemIsTripwire(gpItemDescObject->usItem))
diff += 10;
}
+9 -8
View File
@@ -3373,7 +3373,7 @@ BOOLEAN HandleNailsVestFetish( SOLDIERTYPE *pSoldier, UINT32 uiHandPos, UINT16 u
else
{
// Do we have nothing or the leather vest or kevlar leather vest?
if ( Item[usReplaceItem].leatherjacket ||
if (ItemIsLeatherJacket(usReplaceItem) ||
usReplaceItem == COMPOUND18 ||
usReplaceItem == JAR_QUEEN_CREATURE_BLOOD )
{
@@ -4044,7 +4044,7 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
{
if ( !InItemDescriptionBox( ) )
{
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (gpSMCurrentMerc->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].singleshotrocketlauncher) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) )
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (gpSMCurrentMerc->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpSMCurrentMerc->inv[ uiHandPos ].usItem) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) )
{
EmptyWeaponMagazine( &(gpSMCurrentMerc->inv[ uiHandPos ]), &gItemPointer, uiHandPos );
gpItemPointer = &gItemPointer;
@@ -7096,22 +7096,23 @@ void CheckForAndAddMercToTeamPanel( SOLDIERTYPE *pSoldier )
void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
{
INT16 bMaxPoints;
UINT16 usItem = pObj->usItem;
if ( !(Item[pObj->usItem].usItemClass & IC_AMMO || Item[pObj->usItem].usItemClass & IC_KIT || Item[pObj->usItem].usItemClass & IC_MEDKIT || Item[pObj->usItem].canteen || Item[pObj->usItem].gascan || Item[pObj->usItem].alcohol > 0.0f) )
if ( !(Item[usItem].usItemClass & IC_AMMO || Item[usItem].usItemClass & IC_KIT || Item[usItem].usItemClass & IC_MEDKIT || ItemIsCanteen(usItem) || ItemIsGascan(usItem) || Item[usItem].alcohol > 0.0f) )
{
return;
}
if ( Item[ pObj->usItem ].usItemClass & IC_AMMO )
if ( Item[ usItem ].usItemClass & IC_AMMO )
{
bMaxPoints = Magazine[ Item[ pObj->usItem ].ubClassIndex ].ubMagSize;
bMaxPoints = Magazine[ Item[ usItem ].ubClassIndex ].ubMagSize;
}
else
{
bMaxPoints = 100;
}
if ( pCursorObj && pCursorObj->usItem == pObj->usItem )
if ( pCursorObj && pCursorObj->usItem == usItem )
{
DistributeStatus(pCursorObj, pObj, bMaxPoints);
}
@@ -7120,13 +7121,13 @@ void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
// Flugente: one of the items on the stack might not be full. Make sure it is the first one, so the player can see what is missing at a glance
if ( pObj->ubNumberOfObjects > 1 )
{
if ( Item[pObj->usItem].usItemClass & IC_AMMO )
if ( Item[usItem].usItemClass & IC_AMMO )
{
UINT16 shots_first = (*pObj)[0]->data.ubShotsLeft;
(*pObj)[0]->data.ubShotsLeft = (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft;
(*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft = shots_first;
}
else if ( Item[pObj->usItem].usItemClass & IC_MAPFILTER_KIT )
else if ( Item[usItem].usItemClass & IC_MAPFILTER_KIT )
{
INT16 status_first = (*pObj)[0]->data.objectStatus;
(*pObj)[0]->data.objectStatus = (*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus;
+4 -4
View File
@@ -978,12 +978,12 @@ void PopupMovementMenu( UI_EVENT *pUIEvent )
}
else
{
if ( Item[pSoldier->inv[ HANDPOS ].usItem].toolkit )
if (ItemIsToolkit(pSoldier->inv[ HANDPOS ].usItem))
{
uiActionImages = TOOLKITACTIONC_IMAGES;
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
}
else if ( Item[pSoldier->inv[ HANDPOS ].usItem].wirecutters )
else if (ItemIsWirecutters(pSoldier->inv[ HANDPOS ].usItem))
{
uiActionImages = WIRECUTACTIONC_IMAGES;
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
@@ -6043,7 +6043,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
}
else
{ // show general name
if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask )
if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem))
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
@@ -6059,7 +6059,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
}
else
{ // show general name
if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask )
if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem))
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
+7 -7
View File
@@ -738,7 +738,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
switch( Item[ pItem->usItem ].usItemClass )
{
case IC_GUN:
if ( !Item[pItem->usItem].rocketlauncher )
if ( !ItemIsRocketLauncher(pItem->usItem) )
{
bWeaponClass *= -1;
}
@@ -873,7 +873,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
pp->Inv[ i ][0]->data.gun.ubGunAmmoType = Magazine[Item[usAmmoIndex].ubClassIndex].ubAmmoType;
pp->Inv[ i ][0]->data.gun.usGunAmmoItem = usAmmoIndex;
if ( Item[usGunIndex].fingerprintid )
if (ItemHasFingerPrintID(usGunIndex))
{
pp->Inv[ i ][0]->data.ubImprintID = (NO_PROFILE + 1);
}
@@ -951,7 +951,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
pp->Inv[ HANDPOS ].fFlags |= OBJECT_UNDROPPABLE;
// Rocket Rifles must come pre-imprinted, in case carrier gets killed without getting a shot off
if ( Item[usGunIndex].fingerprintid )
if (ItemHasFingerPrintID(usGunIndex))
{
pp->Inv[ HANDPOS ][0]->data.ubImprintID = (NO_PROFILE + 1);
}
@@ -3144,7 +3144,7 @@ void ReplaceExtendedGuns( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass )
{
usItem = pp->Inv[ uiLoop ].usItem;
if ( ( Item[ usItem ].usItemClass & IC_GUN ) && ExtendedGunListGun( usItem ) )
if ( ( Item[ usItem ].usItemClass & IC_GUN ) && ItemIsOnlyInTonsOfGuns( usItem ) )
{
if ( bSoldierClass == SOLDIER_CLASS_NONE )
{
@@ -3528,7 +3528,7 @@ UINT32 ItemFitness( OBJECTTYPE* pObj, UINT8 idx )
}
else if ( Item[ pObj->usItem ].usItemClass & IC_FACE )
{
if ( Item[ pObj->usItem ].gasmask )
if (ItemIsGasmask(pObj->usItem))
value = (*pObj)[idx]->data.objectStatus;
else if ( Item[ pObj->usItem ].hearingrangebonus )
{
@@ -4186,7 +4186,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
else if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_FACE && (!si[SI_SIGHT].done || !si[SI_FACE2].done || !si[SI_FACE_SPARESIGHT].done || !si[SI_GASMASK].done) )
{
// gasmasks are reserved for a special slot and will only be worn if we do not have 2 face items. items that increase our vision (NVGs adn sungooggles) get to slot 1, everything else in 2
if ( Item[ pWorldItem[ uiCount ].object.usItem ].gasmask )
if (ItemIsGasmask(pWorldItem[ uiCount ].object.usItem))
EvaluateObjForItem( pWorldItem, pObj, uiCount, &si[SI_GASMASK] );
else if ( Item[ pWorldItem[ uiCount ].object.usItem ].nightvisionrangebonus > 0 )
{
@@ -4265,7 +4265,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
if ( fnd == launcherhelpmap.end() )
{
LauncherHelpStruct tmp;
tmp.fNeedsAmmo = !Item[pWorldItem[ uiCount ].object.usItem].singleshotrocketlauncher;
tmp.fNeedsAmmo = !ItemIsSingleShotRocketLauncher(pWorldItem[ uiCount ].object.usItem);
launcherhelpmap[ pWorldItem[ uiCount ].object.usItem ] = tmp;
}
}
+1 -1
View File
@@ -1595,7 +1595,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
}
else if ( EXPLOSIVE_GUN( this->usItem ) )
{
if ( Item[this->usItem].singleshotrocketlauncher )
if (ItemIsSingleShotRocketLauncher(this->usItem))
{
(*this)[0]->data.gun.ubGunShotsLeft = 1;
}
+213 -250
View File
@@ -779,6 +779,98 @@ extern OBJECTTYPE gTempObject;
// extended flagmask to UINT64
#define EMPTY_BLOOD_BAG 0x0000000100000000 // this item is a empty blood bag
#define MEDICAL_SPLINT 0x0000000200000000 // this item is a medical splint that can be applied to some diseases
#define ITEM_damageable 0x0000000400000000
#define ITEM_repairable 0x0000000800000000
#define ITEM_waterdamages 0x0000001000000000
#define ITEM_metal 0x0000002000000000
#define ITEM_sinks 0x0000004000000000
#define ITEM_showstatus 0x0000008000000000
#define ITEM_hiddenaddon 0x0000010000000000
#define ITEM_twohanded 0x0000020000000000
#define ITEM_notbuyable 0x0000040000000000
#define ITEM_attachment 0x0000080000000000
#define ITEM_hiddenattachment 0x0000100000000000
#define ITEM_biggunlist 0x0000200000000000
#define ITEM_notineditor 0x0000400000000000
#define ITEM_defaultundroppable 0x0000800000000000
#define ITEM_unaerodynamic 0x0001000000000000
#define ITEM_electronic 0x0002000000000000
#define ITEM_cannon 0x0004000000000000
#define ITEM_rocketrifle 0x0008000000000000
#define ITEM_fingerprintid 0x0010000000000000
#define ITEM_metaldetector 0x0020000000000000
#define ITEM_gasmask 0x0040000000000000
#define ITEM_lockbomb 0x0080000000000000
#define ITEM_flare 0x0100000000000000
#define ITEM_grenadelauncher 0x0200000000000000
#define ITEM_mortar 0x0400000000000000
#define ITEM_duckbill 0x0800000000000000
#define ITEM_detonator 0x1000000000000000
#define ITEM_remotedetonator 0x2000000000000000
#define ITEM_hidemuzzleflash 0x4000000000000000
#define ITEM_rocketlauncher 0x8000000000000000
// New UINT64 Item Flag => usItemFlag2
#define ITEM_singleshotrocketlauncher 0x00000001
#define ITEM_brassknuckles 0x00000002
#define ITEM_crowbar 0x00000004
#define ITEM_glgrenade 0x00000008
#define ITEM_flakjacket 0x00000010
#define ITEM_leatherjacket 0x00000020
#define ITEM_batteries 0x00000040
#define ITEM_needsbatteries 0x00000080
#define ITEM_xray 0x00000100
#define ITEM_wirecutters 0x00000200
#define ITEM_toolkit 0x00000400
#define ITEM_firstaidkit 0x00000800
#define ITEM_medicalkit 0x00001000
#define ITEM_canteen 0x00002000
#define ITEM_jar 0x00004000
#define ITEM_canandstring 0x00008000
#define ITEM_marbles 0x00010000
#define ITEM_walkman 0x00020000
#define ITEM_remotetrigger 0x00040000
#define ITEM_robotremotecontrol 0x00080000
#define ITEM_camouflagekit 0x00100000
#define ITEM_locksmithkit 0x00200000
#define ITEM_mine 0x00400000
#define ITEM_antitankmine 0x00800000
#define ITEM_hardware 0x01000000
#define ITEM_medical 0x02000000
#define ITEM_gascan 0x04000000
#define ITEM_containsliquid 0x08000000
#define ITEM_rock 0x10000000
#define ITEM_thermaloptics 0x20000000
#define ITEM_scifi 0x40000000
#define ITEM_newinv 0x80000000
#define ITEM_DiseaseSystemExclusive 0x0000000100000000 // kitty: item exclusively available with disease feature
#define ITEM_barrel 0x0000000200000000 // item can be used on some guns as an exchange barrel
#define ITEM_tripwireactivation 0x0000000400000000 // item (mine) can be activated by nearby tripwire
#define ITEM_tripwire 0x0000000800000000 // item is tripwire
#define ITEM_directional 0x0000001000000000 // item is a directional mine/bomb (actual direction is set upon planting)
#define ITEM_blockironsight 0x0000002000000000 // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight)
#define ITEM_fAllowClimbing 0x0000004000000000 // JMich: BackpackClimb does item allow climbing while wearing it
#define ITEM_cigarette 0x0000008000000000 // Flugente: this item can be smoked
#define ITEM_fProvidesRobotCamo 0x0000010000000000 // rftr: robot attachments
#define ITEM_fProvidesRobotNightVision 0x0000020000000000 // rftr: robot attachments
#define ITEM_fProvidesRobotLaserBonus 0x0000040000000000 // rftr: robot attachments
// ----------------------------------------------------------------
@@ -947,160 +1039,48 @@ extern OBJECTTYPE gTempObject;
// autofiretohitbonus,
// bursttohitbonus
typedef struct
{
UINT32 usItemClass;
UINT64 nasAttachmentClass; //CHRISL: Identify the class of attachment
UINT64 nasLayoutClass;
//Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method
UINT64 ulAvailableAttachmentPoint;
UINT64 ulAttachmentPoint;
UINT8 ubAttachToPointAPCost; // cost to attach to any matching point
UINT16 ubClassIndex;
UINT8 ubCursor;
INT8 bSoundType;
UINT8 ubGraphicType;
UINT16 ubGraphicNum;
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
UINT8 ubPerPocket;
UINT16 ItemSize;
UINT16 usPrice;
UINT8 ubCoolness;
INT8 bReliability;
INT8 bRepairEase;
UINT16 fFlags;
UINT32 uiIndex; // added
CHAR16 szItemName[80]; //+1 for the null terminator //added
BOOLEAN damageable;
BOOLEAN repairable;
BOOLEAN waterdamages;
BOOLEAN metal;
BOOLEAN sinks;
BOOLEAN showstatus;
BOOLEAN hiddenaddon;
BOOLEAN twohanded;
BOOLEAN notbuyable;
BOOLEAN attachment;
BOOLEAN hiddenattachment;
BOOLEAN biggunlist;
BOOLEAN notineditor;
BOOLEAN defaultundroppable;
BOOLEAN unaerodynamic;
BOOLEAN electronic;
UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.
//But now we will make it so that these items can be replaced, but still not removed directly.
//0 = removeable (as before)
//1 = inseparable (as before)
//2 = inseparable, but replaceable
CHAR16 szLongItemName[80];
CHAR16 szItemDesc[400];
CHAR16 szBRName[80];
CHAR16 szBRDesc[400];
//TODO: quest items, boosters, money
// special item/attachment functions:
BOOLEAN cannon;
BOOLEAN rocketrifle;
BOOLEAN fingerprintid;
BOOLEAN metaldetector;
BOOLEAN gasmask;
BOOLEAN lockbomb;
BOOLEAN flare;
INT16 percentnoisereduction;
INT16 bipod;
INT16 tohitbonus;
INT16 bestlaserrange;
INT16 rangebonus;
INT16 percentrangebonus;
INT16 aimbonus;
INT16 minrangeforaimbonus;
INT16 percentapreduction;
INT16 percentstatusdrainreduction;
BOOLEAN grenadelauncher;
BOOLEAN mortar;
BOOLEAN duckbill;
BOOLEAN detonator;
BOOLEAN remotedetonator;
BOOLEAN hidemuzzleflash;
BOOLEAN rocketlauncher;
BOOLEAN singleshotrocketlauncher;
UINT16 discardedlauncheritem;
BOOLEAN brassknuckles;
//*** ddd UINT16 bloodieditem;
INT16 bloodieditem;
BOOLEAN crowbar;
BOOLEAN glgrenade;
BOOLEAN flakjacket;
INT16 hearingrangebonus;
INT16 visionrangebonus;
INT16 nightvisionrangebonus;
INT16 dayvisionrangebonus;
INT16 cavevisionrangebonus;
INT16 brightlightvisionrangebonus;
INT16 itemsizebonus;
BOOLEAN leatherjacket;
BOOLEAN batteries;
BOOLEAN needsbatteries;
BOOLEAN xray;
BOOLEAN wirecutters;
BOOLEAN toolkit;
BOOLEAN firstaidkit;
BOOLEAN medicalkit;
BOOLEAN canteen;
BOOLEAN jar;
BOOLEAN canandstring;
BOOLEAN marbles;
BOOLEAN walkman;
BOOLEAN remotetrigger;
BOOLEAN robotremotecontrol;
BOOLEAN camouflagekit;
BOOLEAN locksmithkit;
BOOLEAN mine;
BOOLEAN antitankmine;
FLOAT alcohol;
BOOLEAN hardware;
BOOLEAN medical;
BOOLEAN gascan;
BOOLEAN containsliquid;
BOOLEAN rock;
INT16 damagebonus;
INT16 meleedamagebonus;
INT16 magsizebonus;
INT16 percentautofireapreduction;
INT16 autofiretohitbonus;
INT16 APBonus;
INT16 rateoffirebonus;
INT16 burstsizebonus;
INT16 bursttohitbonus;
INT16 percentreadytimeapreduction;
INT16 bulletspeedbonus;
BOOLEAN thermaloptics;
UINT8 percenttunnelvision;
INT16 percentreloadtimeapreduction;
INT16 percentburstfireapreduction;
INT16 camobonus;
INT16 stealthbonus;
INT16 urbanCamobonus;
INT16 desertCamobonus;
INT16 snowCamobonus;
BOOLEAN scifi; // item only available in scifi mode
BOOLEAN newinv; // item only available in new inventory mode
UINT8 ubAttachmentSystem; //Item availability per attachment system: 0 = both, 1 = OAS, 2 = NAS
CHAR16 szItemName[80]; //+1 for the null terminator //added
CHAR16 szLongItemName[80];
CHAR16 szBRName[80];
UINT16 defaultattachments[MAX_DEFAULT_ATTACHMENTS]; //Need more default attachments, chose an array to do so. (no vector / list just to keep this all plain data)
UINT64 nasAttachmentClass; //CHRISL: Identify the class of attachment
UINT64 nasLayoutClass;
UINT64 ulAvailableAttachmentPoint;
UINT64 ulAttachmentPoint;
UINT64 usItemFlag; // bitflags to store various item properties (better than introducing 64 BOOLEAN values). If I only had thought of this earlier....
UINT64 usItemFlag2; // bitflags to store various item properties
UINT32 uiIndex;
UINT32 usItemClass;
UINT32 attachmentclass; // attachmentclass used
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
UINT32 foodtype;
UINT32 usActionItemFlag; // Flugente: a flag that is necessary for transforming action items to objects with new abilities (for now, tripwire networks and directional explosives)
UINT32 clothestype; // Flugente: clothes type that 'links' to an entry in Clothes.xml
//zilpin: pellet spread patterns externalized in XML
INT32 spreadPattern;
FLOAT alcohol;
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
// subjectively.
FLOAT RecoilModifierX;
FLOAT RecoilModifierY;
FLOAT scopemagfactor;
FLOAT projectionfactor;
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
FLOAT dirtIncreaseFactor; // Flugente: advanced repair/dirt system. One shot causes this much dirt on a gun
FLOAT fRobotDamageReductionModifier; // rftr: robot attachments
// HEADROCK HAM 4: New variable arrays for the New CTH system.
INT16 flatbasemodifier[3];
INT16 percentbasemodifier[3];
@@ -1113,115 +1093,98 @@ typedef struct
INT16 counterforceaccuracymodifier[3];
INT16 targettrackingmodifier[3];
INT16 aimlevelsmodifier[3];
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
// subjectively.
FLOAT RecoilModifierX;
FLOAT RecoilModifierY;
//Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method
UINT16 ubClassIndex;
UINT16 ubGraphicNum;
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
UINT16 ItemSize;
UINT16 usPrice;
UINT16 discardedlauncheritem;
UINT16 randomitem; // Flugente: a link to RandomItemsClass.xml. Out of such an item, a random object is created, depending on the entries in the xml
UINT16 usBuddyItem; // Flugente: item is connected to another item. Type of connection depends on item specifics
UINT16 usRiotShieldStrength; // Flugente: riot shields. strength of shield
UINT16 usRiotShieldGraphic; // Flugente: riot shields. graphic of shield (when deployed in tactical, taken from Tilecache/riotshield.sti)
INT16 percentnoisereduction;
INT16 bipod;
INT16 tohitbonus;
INT16 bestlaserrange;
INT16 rangebonus;
INT16 percentrangebonus;
INT16 aimbonus;
INT16 minrangeforaimbonus;
INT16 percentapreduction;
INT16 percentstatusdrainreduction;
INT16 bloodieditem;
INT16 hearingrangebonus;
INT16 visionrangebonus;
INT16 nightvisionrangebonus;
INT16 dayvisionrangebonus;
INT16 cavevisionrangebonus;
INT16 brightlightvisionrangebonus;
INT16 itemsizebonus;
INT16 damagebonus;
INT16 meleedamagebonus;
INT16 magsizebonus;
INT16 percentautofireapreduction;
INT16 autofiretohitbonus;
INT16 APBonus;
INT16 rateoffirebonus;
INT16 burstsizebonus;
INT16 bursttohitbonus;
INT16 percentreadytimeapreduction;
INT16 bulletspeedbonus;
INT16 percentreloadtimeapreduction;
INT16 percentburstfireapreduction;
INT16 camobonus;
INT16 stealthbonus;
INT16 urbanCamobonus;
INT16 desertCamobonus;
INT16 snowCamobonus;
INT16 PercentRecoilModifier;
INT16 percentaccuracymodifier;
FLOAT scopemagfactor;
FLOAT projectionfactor;
BOOLEAN speeddot;
INT16 usSpotting; // Flugente: spotting effectiveness
INT16 sBackpackWeightModifier; // JMich: BackpackClimb modifier to weight calculation to climb.
INT16 sFireResistance;
// Flugente
BOOLEAN barrel; // item can be used on some guns as an exchange barrel
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
UINT8 ubAttachToPointAPCost; // cost to attach to any matching point
UINT8 ubCursor;
UINT8 ubGraphicType;
UINT8 ubPerPocket;
UINT8 ubCoolness;
UINT8 percenttunnelvision;
UINT8 ubAttachmentSystem; //Item availability per attachment system: 0 = both, 1 = OAS, 2 = NAS
UINT8 CrowbarModifier;
UINT8 DisarmModifier;
UINT8 usHackingModifier;
UINT8 usBurialModifier; // Flugente: a modifier for burial effectiveness
UINT8 usDamageChance; // Flugente: advanced repair/dirt system. Chance that damage to the status will also damage the repair threshold
UINT8 usFlashLightRange; // Flugente: range of a flashlight (an item with usFlashLightRange > 0 is deemed a flashlight)
UINT8 usItemChoiceTimeSetting; // Flugente: determine wether the AI should pick this item for its choices only at certain times
UINT8 ubSleepModifier; // silversurfer: item provides breath regeneration bonus while resting
UINT8 usPortionSize; // Flugente: for consumables: how much of this item is consumed at once
UINT8 usAdministrationModifier; // Flugente: a modifier for administration effectiveness
UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.
//But now we will make it so that these items can be replaced, but still not removed directly.
//0 = removeable (as before)
//1 = inseparable (as before)
//2 = inseparable, but replaceable
UINT32 attachmentclass; // attachmentclass used
BOOLEAN tripwireactivation; // item (mine) can be activated by nearby tripwire
BOOLEAN tripwire; // item is tripwire
BOOLEAN directional; // item is a directional mine/bomb (actual direction is set upon planting)
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
BOOLEAN blockironsight; // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight)
UINT64 usItemFlag; // bitflags to store various item properties (better than introducing 32 BOOLEAN values). If I only had thought of this earlier....
// Flugente: food type
UINT32 foodtype;
//JMich_SkillModifiers: Adding new skill modifiers
INT8 LockPickModifier;
UINT8 CrowbarModifier;
UINT8 DisarmModifier;
INT8 RepairModifier;
// Flugente: a modifier to hacking
UINT8 usHackingModifier;
// Flugente: a modifier for burial effectiveness
UINT8 usBurialModifier;
// Flugente: advanced repair/dirt system
UINT8 usDamageChance; // chance that damage to the status will also damage the repair threshold
FLOAT dirtIncreaseFactor; // one shot causes this much dirt on a gun
// Flugente: a flag that is necessary for transforming action items to objects with new abilities (for now, tripwire networks and directional explosives)
UINT32 usActionItemFlag;
// Flugente: clothes type that 'links' to an entry in Clothes.xml
UINT32 clothestype;
// Flugente: a link to RandomItemsClass.xml. Out of such an item, a random object is created, depending on the entries in the xml
UINT16 randomitem;
INT8 randomitemcoolnessmodificator; // alters the allowed maximum coolness a random item can have
// Flugente: range of a flashlight (an item with usFlashLightRange > 0 is deemed a flashlight)
UINT8 usFlashLightRange;
// Flugente: determine wether the AI should pick this item for its choices only at certain times
UINT8 usItemChoiceTimeSetting;
// Flugente: item is connected to another item. Type of connection depends on item specifics
UINT16 usBuddyItem;
// silversurfer: item provides breath regeneration bonus while resting
UINT8 ubSleepModifier;
// Flugente: spotting effectiveness
INT16 usSpotting;
//JMich.BackpackClimb
INT16 sBackpackWeightModifier; //modifier to weight calculation to climb.
BOOLEAN fAllowClimbing; //does item allow climbing while wearing it
BOOLEAN cigarette; // Flugente: this item can be smoked
UINT8 usPortionSize; // Flugente: for consumables: how much of this item is consumed at once
// Flugente: riot shields
UINT16 usRiotShieldStrength; // strength of shield
UINT16 usRiotShieldGraphic; // graphic of shield (when deployed in tactical, taken from Tilecache/riotshield.sti)
// Flugente: fire resistance
INT16 sFireResistance;
// Flugente: a modifier for administration effectiveness
UINT8 usAdministrationModifier;
// rftr: robot attachments
FLOAT fRobotDamageReductionModifier;
INT8 bRobotStrBonus;
INT8 bRobotAgiBonus;
INT8 bRobotDexBonus;
INT8 bRobotTargetingSkillGrant;
INT8 bRobotChassisSkillGrant;
INT8 bRobotUtilitySkillGrant;
BOOLEAN fProvidesRobotCamo;
BOOLEAN fProvidesRobotNightVision;
BOOLEAN fProvidesRobotLaserBonus;
// kitty: item exclusively available with disease feature
BOOLEAN DiseaseSystemExclusive;
// rftr: the progress bounds that allow a transport group to drop an item
INT8 iTransportGroupMinProgress;
INT8 iTransportGroupMaxProgress;
INT8 bSoundType;
INT8 bReliability;
INT8 bRepairEase;
INT8 LockPickModifier;
INT8 RepairModifier;
INT8 randomitemcoolnessmodificator; // Flugente: a link to RandomItemsClass.xml. alters the allowed maximum coolness a random item can have
INT8 bRobotStrBonus; // rftr: robot attachments
INT8 bRobotAgiBonus; // rftr: robot attachments
INT8 bRobotDexBonus; // rftr: robot attachments
INT8 bRobotTargetingSkillGrant; // rftr: robot attachments
INT8 bRobotChassisSkillGrant; // rftr: robot attachments
INT8 bRobotUtilitySkillGrant; // rftr: robot attachments
INT8 iTransportGroupMinProgress; // rftr: the progress bounds that allow a transport group to drop an item
INT8 iTransportGroupMaxProgress; // rftr: the progress bounds that allow a transport group to drop an item
} INVTYPE;
+228 -164
View File
File diff suppressed because it is too large Load Diff
+74 -4
View File
@@ -179,8 +179,78 @@ BOOLEAN ValidAttachmentClass( UINT16 usAttachment, UINT16 usItem );
//Determines if it is possible to equip this weapon with this ammo.
BOOLEAN ValidAmmoType( UINT16 usItem, UINT16 usAmmoType );
//Determines if this item is a two handed item.
BOOLEAN TwoHandedItem( UINT16 usItem );
BOOLEAN ItemIsDamageable(UINT16 usItem);
BOOLEAN ItemIsRepairable(UINT16 usItem);
BOOLEAN ItemIsDamagedByWater(UINT16 usItem);
BOOLEAN ItemIsMetal(UINT16 usItem);
BOOLEAN ItemSinks(UINT16 usItem);
BOOLEAN ItemIsTwoHanded(UINT16 usItem);
BOOLEAN ItemIsHiddenAddon(UINT16 usItem);
BOOLEAN ItemIsNotBuyable(UINT16 usItem);
BOOLEAN ItemIsAttachment(UINT16 usItem);
BOOLEAN ItemIsHiddenAttachment(UINT16 usItem);
BOOLEAN ItemIsOnlyInTonsOfGuns(UINT16 usItem);
BOOLEAN ItemIsNotInEditor(UINT16 usItem);
BOOLEAN ItemIsUndroppableByDefault(UINT16 usItem);
BOOLEAN ItemIsUnaerodynamic(UINT16 usItem);
BOOLEAN ItemIsElectronic(UINT16 usItem);
BOOLEAN ItemIsCannon(UINT16 usItem);
BOOLEAN ItemIsRocketRifle(UINT16 usItem);
BOOLEAN ItemHasFingerPrintID(UINT16 usItem);
BOOLEAN ItemIsMetalDetector(UINT16 usItem);
BOOLEAN ItemIsGasmask(UINT16 usItem);
BOOLEAN ItemIsLockBomb(UINT16 usItem);
BOOLEAN ItemIsFlare(UINT16 usItem);
BOOLEAN ItemIsGrenadeLauncher(UINT16 usItem);
BOOLEAN ItemIsMortar(UINT16 usItem);
BOOLEAN ItemIsDuckbill(UINT16 usItem);
BOOLEAN ItemIsDetonator(UINT16 usItem);
BOOLEAN ItemIsRemoteDetonator(UINT16 usItem);
BOOLEAN ItemHasHiddenMuzzleFlash(UINT16 usItem);
BOOLEAN ItemIsRocketLauncher(UINT16 usItem);
BOOLEAN ItemIsSingleShotRocketLauncher(UINT16 usItem);
BOOLEAN ItemIsBrassKnuckles(UINT16 usItem);
BOOLEAN ItemIsCrowbar(UINT16 usItem);
BOOLEAN ItemIsGLgrenade(UINT16 usItem);
BOOLEAN ItemIsFlakJacket(UINT16 usItem);
BOOLEAN ItemIsLeatherJacket(UINT16 usItem);
BOOLEAN ItemIsBatteries(UINT16 usItem);
BOOLEAN ItemNeedsBatteries(UINT16 usItem);
BOOLEAN ItemHasXRay(UINT16 usItem);
BOOLEAN ItemIsWirecutters(UINT16 usItem);
BOOLEAN ItemIsToolkit(UINT16 usItem);
BOOLEAN ItemIsFirstAidKit(UINT16 usItem);
BOOLEAN ItemIsMedicalKit(UINT16 usItem);
BOOLEAN ItemIsCanteen(UINT16 usItem);
BOOLEAN ItemIsJar(UINT16 usItem);
BOOLEAN ItemIsCanAndString(UINT16 usItem);
BOOLEAN ItemIsMarbles(UINT16 usItem);
BOOLEAN ItemIsWalkman(UINT16 usItem);
BOOLEAN ItemIsRemoteTrigger(UINT16 usItem);
BOOLEAN ItemIsRobotRemote(UINT16 usItem);
BOOLEAN ItemIsCamoKit(UINT16 usItem);
BOOLEAN ItemIsLocksmithKit(UINT16 usItem);
BOOLEAN ItemIsMine(UINT16 usItem);
BOOLEAN ItemIsATMine(UINT16 usItem);
BOOLEAN ItemIsHardware(UINT16 usItem);
BOOLEAN ItemIsMedical(UINT16 usItem);
BOOLEAN ItemIsGascan(UINT16 usItem);
BOOLEAN ItemContainsLiquid(UINT16 usItem);
BOOLEAN ItemIsRock(UINT16 usItem);
BOOLEAN ItemIsThermalOptics(UINT16 usItem);
BOOLEAN ItemIsOnlyInScifi(UINT16 usItem);
BOOLEAN ItemIsOnlyInNIV(UINT16 usItem);
BOOLEAN ItemIsBarrel(UINT16 usItem);
BOOLEAN ItemHasTripwireActivation(UINT16 usItem);
BOOLEAN ItemIsTripwire(UINT16 usItem);
BOOLEAN ItemIsDirectional(UINT16 usItem);
BOOLEAN ItemBlocksIronsight(UINT16 usItem);
BOOLEAN ItemAllowsClimbing(UINT16 usItem);
BOOLEAN ItemIsCigarette(UINT16 usItem);
BOOLEAN ItemIsOnlyInDisease(UINT16 usItem);
BOOLEAN ItemProvidesRobotCamo(UINT16 usItem);
BOOLEAN ItemProvidesRobotNightvision(UINT16 usItem);
BOOLEAN ItemProvidesRobotLaserBonus(UINT16 usItem);
//Existing functions without header def's, added them here, just incase I'll need to call
//them from the editor.
@@ -222,7 +292,6 @@ UINT8 ConvertObjectTypeMoneyValueToProfileMoneyValue( UINT32 uiMoneyAmount );
BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround );
BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness = FALSE );
BOOLEAN ExtendedGunListGun( UINT16 usGun );
UINT16 StandardGunListReplacement( UINT16 usGun );
UINT16 FindReplacementMagazine( UINT8 ubCalibre, UINT16 ubMagSize, UINT8 ubAmmoType);
UINT16 FindReplacementMagazineIfNecessary( UINT16 usOldGun, UINT16 usOldAmmo, UINT16 usNewGun );
@@ -497,7 +566,8 @@ UINT64 GetAvailableAttachmentPoint ( OBJECTTYPE * pObject, UINT8 subObject );
void CheckBombSpecifics( OBJECTTYPE * pObj, INT8* detonatortype, INT8* setting, INT8* defusefrequency );
// Flugente: check for specific flags
BOOLEAN HasItemFlag( UINT16 usItem, UINT64 aFlag );
BOOLEAN HasItemFlag(UINT16 usItem, UINT64 aFlag);
BOOLEAN HasItemFlag2(UINT16 usItem, UINT64 aFlag);
// Flugente: get first item number that has this flag. Use with caution, as we search in all items
BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag );
+16 -16
View File
@@ -4840,15 +4840,15 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
{
usBulletFlags |= BULLET_FLAG_KNIFE;
}
else if ( Item[usHandItem].rocketlauncher )
else if (ItemIsRocketLauncher(usHandItem))
{
usBulletFlags |= BULLET_FLAG_MISSILE;
}
else if ( Item[usHandItem].cannon )
else if (ItemIsCannon(usHandItem))
{
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
}
else if ( Item[usHandItem].rocketrifle )
else if (ItemIsRocketRifle(usHandItem))
{
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
@@ -5237,7 +5237,7 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
{
// another shot fired
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || Item[usHandItem].grenadelauncher || Item[usHandItem].rocketlauncher || Item[usHandItem].singleshotrocketlauncher || Item[usHandItem].mortar)
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usHandItem) || ItemIsRocketLauncher(usHandItem) || ItemIsSingleShotRocketLauncher(usHandItem) || ItemIsMortar(usHandItem))
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
@@ -5335,15 +5335,15 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
{
usBulletFlags |= BULLET_FLAG_KNIFE;
}
else if ( Item[usHandItem].rocketlauncher )
else if (ItemIsRocketLauncher(usHandItem))
{
usBulletFlags |= BULLET_FLAG_MISSILE;
}
else if ( Item[usHandItem].cannon )
else if (ItemIsCannon(usHandItem))
{
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
}
else if ( Item[usHandItem].rocketrifle )
else if (ItemIsRocketRifle(usHandItem))
{
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
@@ -5753,7 +5753,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
{
// another shot fired
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || Item[usHandItem].grenadelauncher || Item[usHandItem].rocketlauncher || Item[usHandItem].singleshotrocketlauncher || Item[usHandItem].mortar)
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usHandItem) || ItemIsRocketLauncher(usHandItem) || ItemIsSingleShotRocketLauncher(usHandItem) || ItemIsMortar(usHandItem))
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
@@ -6007,15 +6007,15 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
{
usBulletFlags |= BULLET_FLAG_KNIFE;
}
else if ( Item[usItem].rocketlauncher )
else if (ItemIsRocketLauncher(usItem))
{
usBulletFlags |= BULLET_FLAG_MISSILE;
}
else if ( Item[usItem].cannon )
else if (ItemIsCannon(usItem))
{
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
}
else if ( Item[usItem].rocketrifle )
else if (ItemIsRocketRifle(usItem))
{
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
@@ -6594,15 +6594,15 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN
{
usBulletFlags |= BULLET_FLAG_KNIFE;
}
else if ( Item[usItem].rocketlauncher )
else if (ItemIsRocketLauncher(usItem))
{
usBulletFlags |= BULLET_FLAG_MISSILE;
}
else if ( Item[usItem].cannon )
else if (ItemIsCannon(usItem))
{
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
}
else if ( Item[usItem].rocketrifle )
else if (ItemIsRocketRifle(usItem))
{
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
@@ -6923,7 +6923,7 @@ INT8 ChanceToGetThrough(SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOAT dE
// sevenfm: check that weapon exists!
if (pObjHand->exists() &&
pObjHand->usItem == pFirer->usAttackingWeapon &&
(Item[pFirer->usAttackingWeapon].usItemClass == IC_GUN || Item[pFirer->usAttackingWeapon].usItemClass == IC_THROWING_KNIFE || Item[pFirer->usAttackingWeapon].rocketlauncher))
(Item[pFirer->usAttackingWeapon].usItemClass == IC_GUN || Item[pFirer->usAttackingWeapon].usItemClass == IC_THROWING_KNIFE || ItemIsRocketLauncher(pFirer->usAttackingWeapon)))
{
BOOLEAN fBuckShot = FALSE;
@@ -8643,7 +8643,7 @@ void AdjustTargetCenterPoint( SOLDIERTYPE *pShooter, INT32 iTargetGridNo, FLOAT
//INT32 iLaserRange = GetBestLaserRange(&(pShooter->inv[pSoldier->ubAttackingHand]));
INT16 sLaserRange = GetBestLaserRange(pWeapon);
if (AM_A_ROBOT(pShooter) && Item[pShooter->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus)
if (AM_A_ROBOT(pShooter) && ItemProvidesRobotLaserBonus(pShooter->inv[ROBOT_TARGETING_SLOT].usItem))
{
sLaserRange = max(sLaserRange, GetBestLaserRange(&pShooter->inv[ROBOT_TARGETING_SLOT]));
}
+2 -2
View File
@@ -214,10 +214,10 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
cmp_val = Weapon[pSoldier->inv[HANDPOS].usItem].ubCalibre;
break;
case REQ_WEAPON_TWOHANDED:
cmp_val = TwoHandedItem(pSoldier->inv[HANDPOS].usItem);
cmp_val = ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem);
break;
case REQ_LEFT_WEAPON_TWOHANDED:
cmp_val = TwoHandedItem(pSoldier->inv[SECONDHANDPOS].usItem);
cmp_val = ItemIsTwoHanded(pSoldier->inv[SECONDHANDPOS].usItem);
break;
case REQ_VEST_AMOR_PROTECTION:
cmp_val = Armour[Item[pSoldier->inv[VESTPOS].usItem].ubClassIndex].ubProtection;
+4 -4
View File
@@ -7287,7 +7287,7 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
// Check if it's supposed to be dropped
if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) || pTeamSoldier->bTeam == gbPlayerNum )
{
if ( !(Item[pObj->usItem].defaultundroppable) )
if ( !ItemIsUndroppableByDefault(pObj->usItem) )
{
//ReduceAmmoDroppedByNonPlayerSoldiers( pTeamSoldier, cnt );
@@ -7301,7 +7301,7 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
//add a flag to the item so when all enemies are killed, we can run through and reveal all the enemies items
usItemFlags |= WORLD_ITEM_DROPPED_FROM_ENEMY;
if ( Item[pObj->usItem].damageable && Item[pObj->usItem].usItemClass != IC_THROWING_KNIFE ) // Madd: drop crappier items from enemies on higher difficulty levels - note the quick fix for throwing knives
if (ItemIsDamageable(pObj->usItem) && Item[pObj->usItem].usItemClass != IC_THROWING_KNIFE ) // Madd: drop crappier items from enemies on higher difficulty levels - note the quick fix for throwing knives
{
// silversurfer: externalized this
//(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random( 20 );
@@ -9320,7 +9320,7 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
if ( gTacticalStatus.bBoxingState == BOXING )
{
// should have a check for "in boxing ring", no?
if ( ( pSoldier->usAttackingWeapon != NOTHING && !Item[pSoldier->usAttackingWeapon].brassknuckles ) || !( pSoldier->flags.uiStatusFlags & SOLDIER_BOXER ) || pSoldier->IsRiotShieldEquipped() )
if ( ( pSoldier->usAttackingWeapon != NOTHING && !ItemIsBrassKnuckles(pSoldier->usAttackingWeapon)) || !( pSoldier->flags.uiStatusFlags & SOLDIER_BOXER ) || pSoldier->IsRiotShieldEquipped() )
{
// someone's cheating!
if ( (Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_BLADE || Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_PUNCH) && (pTarget->flags.uiStatusFlags & SOLDIER_BOXER) )
@@ -9921,7 +9921,7 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
pSoldier->bDoAutofire = 1;
pSoldier->bDoBurst = TRUE;
}
if ( Item[pSoldier->inv[ HANDPOS ].usItem].twohanded && Weapon[pSoldier->inv[ HANDPOS ].usItem].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
if (ItemIsTwoHanded(pSoldier->inv[ HANDPOS ].usItem) && Weapon[pSoldier->inv[ HANDPOS ].usItem].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD;
else
pSoldier->bScopeMode = USE_BEST_SCOPE;
+18 -18
View File
@@ -2375,9 +2375,9 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
// Do we need to stand up?
bAPCost += GetAPsToChangeStance( pSoldier, ANIM_STAND );
}
else if(Item[usItem].rocketlauncher || Item[usItem].grenadelauncher || Item[usItem].mortar)//dnl ch72 260913 move this here from bottom, need to change as rocketlaucher could be fired from crouch too
else if(ItemIsRocketLauncher(usItem) || ItemIsGrenadeLauncher(usItem) || ItemIsMortar(usItem))//dnl ch72 260913 move this here from bottom, need to change as rocketlaucher could be fired from crouch too
{
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || Item[usItem].mortar && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || ItemIsMortar(usItem) && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
bAPCost += GetAPsToChangeStance(pSoldier, ANIM_CROUCH);
else
bAPCost += GetAPsToChangeStance(pSoldier, gAnimControl[pSoldier->usAnimState].ubEndHeight);
@@ -2393,9 +2393,9 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
if (!TileIsOutOfBounds(sGridNo))
{
{
if(Item[usItem].rocketlauncher || Item[usItem].grenadelauncher || Item[usItem].mortar)//dnl ch72 260913
if(ItemIsRocketLauncher(usItem) || ItemIsGrenadeLauncher(usItem) || ItemIsMortar(usItem))//dnl ch72 260913
{
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || Item[usItem].mortar && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || ItemIsMortar(usItem) && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
usTurningCost = CalculateTurningCost(pSoldier, usItem, fAddingTurningCost, ANIM_CROUCH);
else
usTurningCost = CalculateTurningCost(pSoldier, usItem, fAddingTurningCost);
@@ -2429,7 +2429,7 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
// if attacking a new target (or if the specific target is uncertain)
// Added check if the weapon is throwing knife/melee weapons - otherwise it would add APs for change target on cursor but not actually deduct them afterwards - SANDRO
if ( ubForceRaiseGunCost == TRUE || (( sGridNo != pSoldier->sLastTarget ) && !Item[usUBItem].rocketlauncher && ( Item[ usUBItem ].usItemClass != IC_THROWING_KNIFE )/* && ( Item[ usUBItem ].usItemClass != IC_PUNCH ) && ( Item[ usUBItem ].usItemClass != IC_BLADE )*/ ) )//dnl ch69 140913 //dnl ch73 290913
if ( ubForceRaiseGunCost == TRUE || (( sGridNo != pSoldier->sLastTarget ) && !ItemIsRocketLauncher(usUBItem) && ( Item[ usUBItem ].usItemClass != IC_THROWING_KNIFE )/* && ( Item[ usUBItem ].usItemClass != IC_PUNCH ) && ( Item[ usUBItem ].usItemClass != IC_BLADE )*/ ) )//dnl ch69 140913 //dnl ch73 290913
{
if ( pSoldier->IsValidAlternativeFireMode( bAimTime, sGridNo ) )
bAPCost += (APBPConstants[AP_CHANGE_TARGET] / 2);
@@ -2635,13 +2635,13 @@ BOOLEAN EnoughAmmo( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay, INT8 bInvPos )
OBJECTTYPE* pObjUsed = pSoldier->GetUsedWeapon( &(pSoldier->inv[bInvPos]) );
UINT16 usItemUsed = pSoldier->GetUsedWeaponNumber( &(pSoldier->inv[bInvPos]) );
if ( Item[usItemUsed].singleshotrocketlauncher )
if (ItemIsSingleShotRocketLauncher(usItemUsed))
{
// hack... they turn empty afterwards anyways
return( TRUE );
}
if (Item[ usItemUsed ].usItemClass == IC_LAUNCHER || Item[usItemUsed].cannon )
if (Item[ usItemUsed ].usItemClass == IC_LAUNCHER || ItemIsCannon(usItemUsed))
{
if ( FindAttachmentByClass( pObjUsed, IC_GRENADE ) != 0 )
{
@@ -2661,7 +2661,7 @@ BOOLEAN EnoughAmmo( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay, INT8 bInvPos )
}
// WANNE: If there is a tank, it always have ammo to shoot, no check!
if (Item[usItemUsed].cannon)
if (ItemIsCannon(usItemUsed))
{
return ( TRUE );
}
@@ -2715,13 +2715,13 @@ void DeductAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE* pObj )
{
// tanks never run out of MG ammo!
// unlimited cannon ammo is handled in AI
if ( (ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier )) && !Item[pObj->usItem].cannon )
if ( (ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier )) && !ItemIsCannon(pObj->usItem) )
return;
if ( Item[pObj->usItem].cannon )
if (ItemIsCannon(pObj->usItem))
{
}
else if ( Item[ pObj->usItem ].usItemClass == IC_GUN && !Item[pObj->usItem].cannon && pSoldier->bWeaponMode != WM_ATTACHED_GL && pSoldier->bWeaponMode != WM_ATTACHED_GL_BURST && pSoldier->bWeaponMode != WM_ATTACHED_GL_AUTO )
else if ( Item[ pObj->usItem ].usItemClass == IC_GUN && !ItemIsCannon(pObj->usItem) && pSoldier->bWeaponMode != WM_ATTACHED_GL && pSoldier->bWeaponMode != WM_ATTACHED_GL_BURST && pSoldier->bWeaponMode != WM_ATTACHED_GL_AUTO )
{
// Flugente: check for underbarrel weapons and use that object if necessary
OBJECTTYPE* pObjUsed = pSoldier->GetUsedWeapon( pObj );
@@ -2754,7 +2754,7 @@ void DeductAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE* pObj )
gCampaignStats.AddConsumption(CAMPAIGN_CONSUMED_AMMO, (FLOAT)(Item[(*pObjUsed)[0]->data.gun.usGunAmmoItem].ubWeight) / (FLOAT)(Magazine[ Item[ (*pObjUsed)[0]->data.gun.usGunAmmoItem ].ubClassIndex ].ubMagSize ) );
}
}
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER || Item[pObj->usItem].cannon || pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO )
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER || ItemIsCannon(pObj->usItem) || pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO )
{
OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE );
if ( !pAttachment->exists() )
@@ -3325,7 +3325,7 @@ INT16 GetAPsToReadyWeapon( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
// If we are told to go to the alt weapon holding mode
if ( gAnimControl[ usAnimState ].uiFlags & ( ANIM_ALT_WEAPON_HOLDING ) || (pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD && usAnimState == INVALID_ANIMATION) )//dnl ch71 180913
{
if ( Item[ usItem ].twohanded )
if (ItemIsTwoHanded(usItem))
{
// Raising only to hip, either charge no APs or a portion of them
ubReadyAPs = ((ubReadyAPs * gGameExternalOptions.ubToAltWeaponHoldReadyAPsPerc) + 99) / 100 ; // round up for rifles
@@ -3339,7 +3339,7 @@ INT16 GetAPsToReadyWeapon( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
// If we are told to go from alternative to standard weapon holding
else if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ( ANIM_ALT_WEAPON_HOLDING ) )
{
if ( Item[ usItem ].twohanded )
if (ItemIsTwoHanded(usItem))
{
ubReadyAPs = ubReadyAPs * gGameExternalOptions.ubFromAltWeaponHoldReadyAPsPerc / 100; // round down for rifles
}
@@ -3703,7 +3703,7 @@ UINT16 GetTotalAPsToDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
if ( sAPs > 0 )
{
if(Item[pSoldier->inv[HANDPOS].usItem].mine == 1)
if(ItemIsMine(pSoldier->inv[HANDPOS].usItem))
sAPs += GetAPsToPlantMine( pSoldier ); // changed by SANDRO
else
sAPs += GetAPsToDropBomb( pSoldier ); // changed by SANDRO
@@ -4154,7 +4154,7 @@ INT32 GetBPCostPer10APsForGunHolding( SOLDIERTYPE * pSoldier, BOOLEAN fEstimate
// Alternative weapon holding?
if (( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_ALT_WEAPON_HOLDING ) || (fEstimate && pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD) )
{
if ( Item[pSoldier->inv[pSoldier->ubAttackingHand].usItem].twohanded ) // firing from hip is not nearly ?n effort
if (ItemIsTwoHanded(pSoldier->inv[pSoldier->ubAttackingHand].usItem)) // firing from hip is not nearly ?n effort
dModifier += 80; // only 20% cost if on hip
else // holding pistol in one hand is worse in this case
dModifier -= 25; // increased cost by 25%
@@ -4265,7 +4265,7 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
iKickPower = iKickPower * (100 - sWeaponWeight) / 100;
// If one-handed gun, reduce it a bit, since the whole thing is somewhat different.
if ( !Item[pSoldier->inv[pSoldier->ubAttackingHand].usItem].twohanded )
if ( !ItemIsTwoHanded(pSoldier->inv[pSoldier->ubAttackingHand].usItem) )
iKickPower = iKickPower * 3 / 4; // -25%
// ::: overview :::
@@ -4310,7 +4310,7 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
// Alternative weapon holding?
if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_ALT_WEAPON_HOLDING )
{
if ( Item[pSoldier->inv[pSoldier->ubAttackingHand].usItem].twohanded ) // firing from hip makes the kicking rather diminishing
if (ItemIsTwoHanded(pSoldier->inv[pSoldier->ubAttackingHand].usItem)) // firing from hip makes the kicking rather diminishing
dModifier += 80; // only 20% of the regular kick power
else // holding pistol in one hand is worse in this case
dModifier -= 33; // plus 33% power
+5 -4
View File
@@ -460,7 +460,7 @@ INVTYPE* GearGetRandomFaceItem(INT8 min_coolness = -1, INT8 max_coolness = -1, U
if (HasItemFlag((*it)->uiIndex, SCUBA_MASK))
continue;
if (item_type == FACEITEM_GAS_MASK && (*it)->gasmask < 1) continue;
if (item_type == FACEITEM_GAS_MASK && !ItemIsGasmask((*it)->uiIndex)) continue;
if (item_type == FACEITEM_SPECTACLES && (*it)->brightlightvisionrangebonus < 1) continue;
if (item_type == FACEITEM_NVG && (*it)->nightvisionrangebonus < 1) continue;
if (item_type == FACEITEM_HEADSET && (*it)->hearingrangebonus < 1) continue;
@@ -643,7 +643,8 @@ std::vector<INVTYPE*> GearFindAttachmentsForWeapon(INVTYPE* weapon, BOOL attach_
{
INVTYPE* item = *it;
if (item->attachment < 1)
//if (item->attachment < 1)
if (!ItemIsAttachment(item->uiIndex))
continue;
if (!ValidAttachment(item->uiIndex, weapon->uiIndex))
@@ -680,7 +681,7 @@ std::vector<INVTYPE*> GearFindItemsForRole(std::vector<UINT8>* roles, std::vecto
INVTYPE* item = *it;
INT8 chance = 0;
if (item->glgrenade > 0)
if (ItemIsGLgrenade(item->uiIndex))
continue;
if (item->attachmentclass == AC_GRENADE || item->attachmentclass == AC_ROCKET)
@@ -1061,4 +1062,4 @@ void RandomizeMerc(UINT8 profile_id, MERCPROFILESTRUCT* merc, BOOL random_gear_k
merc->usOptionalGearCost = kit_cost;
}
}
}
}
+2 -2
View File
@@ -1014,7 +1014,7 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
{
// and make sure that it really is a droppable item type
// if ( !(Item[ pObj->usItem ].fFlags & ITEM_DEFAULT_UNDROPPABLE) )
if ( !(Item[ pObj->usItem ].defaultundroppable ) )
if ( !ItemIsUndroppableByDefault(pObj->usItem) )
{
ReduceAmmoDroppedByNonPlayerSoldiers( pSoldier, cnt );
//if this soldier was an enemy
@@ -1027,7 +1027,7 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
//add a flag to the item so when all enemies are killed, we can run through and reveal all the enemies items
usItemFlags |= WORLD_ITEM_DROPPED_FROM_ENEMY;
if ( Item[pObj->usItem].damageable && Item[pObj->usItem].usItemClass != IC_THROWING_KNIFE ) // Madd: drop crappier items from enemies on higher difficulty levels - note the quick fix for throwing knives
if (ItemIsDamageable(pObj->usItem) && Item[pObj->usItem].usItemClass != IC_THROWING_KNIFE ) // Madd: drop crappier items from enemies on higher difficulty levels - note the quick fix for throwing knives
{
// silversurfer: externalized this
//(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20);
+5 -10
View File
@@ -607,8 +607,6 @@ void EnableAllDealersOfferSlots( void );
void HatchOutInvSlot( UINT16 usPosX, UINT16 usPosY );
extern BOOLEAN ItemIsARocketRifle( INT16 sItemIndex );
#ifdef JA2TESTVERSION
BOOLEAN gfTestDisplayDealerCash = FALSE;
void DisplayAllDealersCash();
@@ -3392,8 +3390,7 @@ FLOAT ItemConditionModifier(UINT16 usItemIndex, INT16 bStatus)
// an item at 100% is worth full price...
// if ( Item[ usItemIndex ].fFlags & ITEM_REPAIRABLE )
if ( Item[ usItemIndex ].repairable )
if (ItemIsRepairable(usItemIndex))
{
// a REPAIRABLE item at 0% is still worth 50% of its full price, not 0%
dConditionModifier = 0.5f + ( bStatus / (FLOAT)200 );
@@ -5007,8 +5004,7 @@ BOOLEAN IsGunOrAmmoOfSameTypeSelected( OBJECTTYPE *pItemObject )
}
//if the highlighted object is an attachment
// if( Item[ pItemObject->usItem ].fFlags & ITEM_ATTACHMENT )
if( Item[ pItemObject->usItem ].attachment )
if(ItemIsAttachment(pItemObject->usItem))
{
if( ValidAttachment( pItemObject->usItem, gpHighLightedItemObject ) )
return( TRUE );
@@ -5646,7 +5642,7 @@ void EvaluateItemAddedToPlayersOfferArea( INT8 bSlotID, BOOLEAN fFirstOne )
}
//if the item is a rocket rifle
if( ItemIsARocketRifle( PlayersOfferArea[ bSlotID ].sItemIndex ) )
if(ItemHasFingerPrintID( PlayersOfferArea[ bSlotID ].sItemIndex ) )
{
fRocketRifleWasEvaluated = TRUE;
}
@@ -5716,8 +5712,7 @@ void EvaluateItemAddedToPlayersOfferArea( INT8 bSlotID, BOOLEAN fFirstOne )
if( armsDealerInfo[ gbSelectedArmsDealerID ].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
{
// only otherwise repairable items count as actual rejections
// if ( Item[ PlayersOfferArea[ bSlotID ].sItemIndex ].fFlags & ITEM_REPAIRABLE )
if ( Item[ PlayersOfferArea[ bSlotID ].sItemIndex ].repairable )
if (ItemIsRepairable(PlayersOfferArea[bSlotID].sItemIndex))
{
uiEvalResult = EVAL_RESULT_DONT_HANDLE;
}
@@ -6356,7 +6351,7 @@ void SplitComplexObjectIntoSubObjects( OBJECTTYPE *pComplexObject )
// strip off any loaded ammo/payload
// Exception: don't do this with rocket launchers, their "shots left" are fake and this screws 'em up!
if ( !Item[usItem].singleshotrocketlauncher ) // Madd rpg - still do this
if ( !ItemIsSingleShotRocketLauncher(usItem)) // Madd rpg - still do this
{
pData->data.gun.usGunAmmoItem = NONE;
pData->data.gun.ubGunShotsLeft = 0;
+7 -7
View File
@@ -375,8 +375,8 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
{
// sevenfm: breaking window with crowbar code
if (pSoldier->inv[HANDPOS].exists() &&
(Item[pSoldier->inv[HANDPOS].usItem].crowbar && Item[pSoldier->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN && Item[pSoldier->inv[HANDPOS].usItem].twohanded && Item[pSoldier->inv[HANDPOS].usItem].metal))
(ItemIsCrowbar(pSoldier->inv[HANDPOS].usItem) && Item[pSoldier->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && ItemIsMetal(pSoldier->inv[HANDPOS].usItem)))
{
INT32 sWindowGridNo = pSoldier->sTargetGridNo;
if (pSoldier->ubDirection == NORTH || pSoldier->ubDirection == WEST)
@@ -1135,10 +1135,10 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
UINT16 usItem = pSoldier->pTempObject->usItem;
UINT16 usBuddyItem = Item[usItem].usBuddyItem;
if (pSoldier->pThrowParams->ubActionCode == THROW_ARM_ITEM &&
(Item[usItem].flare ||
(ItemIsFlare(usItem) ||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_FLARE ||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_BURNABLEGAS ||
usBuddyItem && (Item[usBuddyItem].usItemClass & IC_EXPLOSV) && (Item[usBuddyItem].flare || Explosive[Item[usBuddyItem].ubClassIndex].ubType == EXPLOSV_FLARE)))
usBuddyItem && (Item[usBuddyItem].usItemClass & IC_EXPLOSV) && (ItemIsFlare(usBuddyItem) || Explosive[Item[usBuddyItem].ubClassIndex].ubType == EXPLOSV_FLARE)))
{
if ((pSoldier->iMuzFlash = LightSpriteCreate("L-R03.LHT", 0)) != -1)
{
@@ -1805,7 +1805,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
if ( Item[ usItem ].usItemClass == IC_GUN )
{
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if ( (Item[ usItem ].twohanded ) )
if (ItemIsTwoHanded(usItem))
{
// Set to rifle
ubRandomHandIndex = RANDOM_ANIM_RIFLEINHAND;
@@ -2714,7 +2714,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
case BIGBUY_STRECH:
case FEM_KICKSN:
case FEM_WIPE:
if ( pSoldier->inv[ HANDPOS ].exists() == true && Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass == IC_GUN && Item[ pSoldier->inv[ HANDPOS ].usItem ].twohanded )
if ( pSoldier->inv[ HANDPOS ].exists() == true && Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass == IC_GUN && ItemIsTwoHanded(pSoldier->inv[ HANDPOS ].usItem) )
{
pSoldier->EVENT_InitNewSoldierAnim( RAISE_RIFLE, 0 , FALSE );
return( TRUE );
@@ -4457,7 +4457,7 @@ void CheckForAndHandleSoldierIncompacitated( SOLDIERTYPE *pSoldier )
// SANDRO - if Martial Artist took someone down, always fall back if possible (for the fun)
if ( pSoldier->ubAttackerID != NOBODY && gGameOptions.fNewTraitSystem )
{
if ( HAS_SKILL_TRAIT( MercPtrs[ pSoldier->ubAttackerID ], MARTIAL_ARTS_NT ) && (!MercPtrs[ pSoldier->ubAttackerID ]->usAttackingWeapon || Item[MercPtrs[ pSoldier->ubAttackerID ]->inv[HANDPOS].usItem].brassknuckles ) )
if ( HAS_SKILL_TRAIT( MercPtrs[ pSoldier->ubAttackerID ], MARTIAL_ARTS_NT ) && (!MercPtrs[ pSoldier->ubAttackerID ]->usAttackingWeapon || ItemIsBrassKnuckles(MercPtrs[ pSoldier->ubAttackerID ]->inv[HANDPOS].usItem)) )
{
fAlwaysFallBack = TRUE;
}
+82 -83
View File
@@ -3017,7 +3017,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
}
else
{
if (Item[usItem].flare ||
if (ItemIsFlare(usItem) ||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_SIGNAL_SMOKE ||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_FLARE)
{
@@ -3159,7 +3159,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// Going from shoulder stance to hip stance
else if ( usNewState == READY_ALTERNATIVE_STAND && (gAnimControl[this->usAnimState].uiFlags & (ANIM_FIREREADY | ANIM_FIRE)) )
{
if ( Item[this->inv[HANDPOS].usItem].twohanded )
if (ItemIsTwoHanded(this->inv[HANDPOS].usItem))
usStartingAniCode = 1;
else
usStartingAniCode = 2;
@@ -3278,7 +3278,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// 1) We have a rifle in hand...
//usItem = this->inv[ HANDPOS ].usItem;
if ( this->inv[HANDPOS].exists( ) == true && (Item[usItem].twohanded) && !Item[usItem].rocketlauncher )
if ( this->inv[HANDPOS].exists( ) == true && ItemIsTwoHanded(usItem) && !ItemIsRocketLauncher(usItem) )
{
// Switch on height!
switch ( gAnimControl[this->usAnimState].ubEndHeight )
@@ -3301,7 +3301,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// 1) We have a rifle in hand...
//usItem = this->inv[ HANDPOS ].usItem;
if ( this->inv[HANDPOS].exists( ) == true && (Item[usItem].twohanded) && !Item[usItem].rocketlauncher )
if ( this->inv[HANDPOS].exists( ) == true && ItemIsTwoHanded(usItem) && !ItemIsRocketLauncher(usItem) )
{
// Switch on height!
switch ( gAnimControl[this->usAnimState].ubEndHeight )
@@ -3429,10 +3429,10 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
if ( this->inv[HANDPOS].exists( ) == true )
{
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if ( (Item[usItem].twohanded) )
if (ItemIsTwoHanded(usItem))
{
usNewState = BIGMERC_CROUCH_TRANS_INTO;
}
@@ -3449,10 +3449,10 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
if ( this->inv[HANDPOS].exists( ) == true )
{
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if ( (Item[usItem].twohanded) )
if (ItemIsTwoHanded(usItem))
{
usNewState = BIGMERC_CROUCH_TRANS_OUTOF;
}
@@ -3477,7 +3477,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
if ( ((gAnimControl[this->usAnimState].uiFlags & ANIM_FIREREADY) ||
(gAnimControl[this->usAnimState].uiFlags & ANIM_FIRE)) && gGameExternalOptions.fAllowWalkingWithWeaponRaised )
{
if ( this->inv[HANDPOS].exists( ) == true && Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
if ( this->inv[HANDPOS].exists( ) == true && Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{
if ( gAnimControl[this->usAnimState].ubEndHeight == ANIM_STAND )
{
@@ -3524,7 +3524,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
{
if ( gAnimControl[this->usAnimState].ubEndHeight == ANIM_CROUCH )
{
if ( this->inv[HANDPOS].exists( ) == true && Item[usItem].usItemClass == IC_GUN && Item[usItem].twohanded && !Item[usItem].rocketlauncher )
if ( this->inv[HANDPOS].exists( ) == true && Item[usItem].usItemClass == IC_GUN && ItemIsTwoHanded(usItem) && !ItemIsRocketLauncher(usItem) )
usNewState = SWAT_BACKWARDS;
else
usNewState = SWAT_BACKWARDS_NOTHING;
@@ -3595,7 +3595,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// SANDRO - check if we are gonna move with weapon raised
else if ( gGameExternalOptions.fAllowWalkingWithWeaponRaised && ( (gAnimControl[this->usAnimState].uiFlags & ANIM_FIREREADY) || (gAnimControl[this->usAnimState].uiFlags & ANIM_FIRE) ) )
{
if ( this->inv[HANDPOS].exists( ) == true && Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
if ( this->inv[HANDPOS].exists( ) == true && Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{
if ( usNewState == WALKING )
{
@@ -3618,7 +3618,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
{
usNewState = CROUCHEDMOVE_DUAL_READY;
}
else if ( !Item[this->inv[HANDPOS].usItem].twohanded )
else if (!ItemIsTwoHanded(this->inv[HANDPOS].usItem))
{
usNewState = CROUCHEDMOVE_PISTOL_READY;
}
@@ -3991,7 +3991,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
case PLANT_BOMB:
if ( Item[this->inv[HANDPOS].usItem].mine == 1 ) // bury a mine
if (ItemIsMine(this->inv[HANDPOS].usItem)) // bury a mine
DeductPoints( this, GetAPsToPlantMine( this ), APBPConstants[BP_BURY_MINE] ); // changed by SANDRO
else
DeductPoints( this, GetAPsToDropBomb( this ), APBPConstants[BP_DROP_BOMB] ); // changed by SANDRO
@@ -4960,9 +4960,9 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
usItem = GetAttachedGrenadeLauncher( &this->inv[HANDPOS] );
else
usItem = this->inv[HANDPOS].usItem;
if ( Item[usItem].rocketlauncher || Item[usItem].grenadelauncher || Item[usItem].mortar )
if (ItemIsRocketLauncher(usItem) || ItemIsGrenadeLauncher(usItem) || ItemIsMortar(usItem) )
{
if ( gAnimControl[this->usAnimState].ubEndHeight == ANIM_PRONE || Item[usItem].mortar && gAnimControl[this->usAnimState].ubEndHeight == ANIM_STAND )
if ( gAnimControl[this->usAnimState].ubEndHeight == ANIM_PRONE || ItemIsMortar(usItem) && gAnimControl[this->usAnimState].ubEndHeight == ANIM_STAND )
SendChangeSoldierStanceEvent( this, ANIM_CROUCH );
fDoFireRightAway = TRUE;
}
@@ -5118,7 +5118,7 @@ UINT16 SelectFireAnimation( SOLDIERTYPE *pSoldier, UINT8 ubHeight )
}
// Check for rocket laucncher....
if ( Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher )
if (ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem))
{
//***ddd if shoot crouched
if ( ubHeight == ANIM_STAND )
@@ -5128,14 +5128,14 @@ UINT16 SelectFireAnimation( SOLDIERTYPE *pSoldier, UINT8 ubHeight )
}
// Check for mortar....
if ( Item[pSoldier->inv[HANDPOS].usItem].mortar )
if (ItemIsMortar(pSoldier->inv[HANDPOS].usItem))
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "SelectFireAnimation: shoot_mortar" );
return(SHOOT_MORTAR);
}
// Check for tank cannon
if ( Item[pSoldier->inv[HANDPOS].usItem].cannon )
if (ItemIsCannon(pSoldier->inv[HANDPOS].usItem))
{
return(TANK_SHOOT);
}
@@ -5447,7 +5447,7 @@ BOOLEAN SOLDIERTYPE::InternalSoldierReadyWeapon( UINT8 sFacingDir, BOOLEAN fEndR
}
//dnl ch72 270913 ugly but fast fix for not charging turning APs as there is no fire ready animation for mortars and rocket launchers
UINT16 usItem = this->inv[HANDPOS].usItem;
if ( Item[usItem].rocketlauncher || Item[usItem].mortar )
if (ItemIsRocketLauncher(usItem) || ItemIsMortar(usItem) )
usForceAnimState = this->usAnimState;
EVENT_InternalSetSoldierDesiredDirection( this, sFacingDir, FALSE, usAnimState );
usForceAnimState = INVALID_ANIMATION;
@@ -5535,12 +5535,12 @@ UINT16 PickSoldierReadyAnimation( SOLDIERTYPE *pSoldier, BOOLEAN fEndReady, BOOL
}
// Check if we have a gun.....
if ( Item[pSoldier->inv[HANDPOS].usItem].usItemClass != IC_GUN && !Item[pSoldier->inv[HANDPOS].usItem].grenadelauncher )
if ( Item[pSoldier->inv[HANDPOS].usItem].usItemClass != IC_GUN && !ItemIsGrenadeLauncher(pSoldier->inv[HANDPOS].usItem) )
{
return(INVALID_ANIMATION);
}
if ( Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher )
if (ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem))
{
return(INVALID_ANIMATION);
}
@@ -5621,7 +5621,7 @@ UINT16 PickSoldierReadyAnimation( SOLDIERTYPE *pSoldier, BOOLEAN fEndReady, BOOL
// this is a specific situation when we have a gun in standard holding (shouldered rifle/two-hand pistol) and was told to go to alternative holding
else if ( (gAnimControl[pSoldier->usAnimState].uiFlags & (ANIM_FIREREADY | ANIM_FIRE)) && !(gAnimControl[pSoldier->usAnimState].uiFlags & (ANIM_ALT_WEAPON_HOLDING))
&& fAltWeaponHolding && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 && pSoldier->bScopeMode == -1 && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND
&& ((!Item[pSoldier->inv[HANDPOS].usItem].twohanded && !pSoldier->IsValidSecondHandShot( ) && !pSoldier->MercInWater( )) || Item[pSoldier->inv[HANDPOS].usItem].twohanded) )
&& ((!ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && !pSoldier->IsValidSecondHandShot( ) && !pSoldier->MercInWater( )) || ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem)) )
{
return(READY_ALTERNATIVE_STAND);
}
@@ -5641,7 +5641,7 @@ UINT16 PickSoldierReadyAnimation( SOLDIERTYPE *pSoldier, BOOLEAN fEndReady, BOOL
{
if ( gGameExternalOptions.ubAllowAlternativeWeaponHolding )
{
if ( fAltWeaponHolding || (Weapon[pSoldier->inv[pSoldier->ubAttackingHand].usItem].HeavyGun && Item[pSoldier->inv[HANDPOS].usItem].twohanded) )
if ( fAltWeaponHolding || (Weapon[pSoldier->inv[pSoldier->ubAttackingHand].usItem].HeavyGun && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem)) )
{
return(READY_ALTERNATIVE_STAND);
}
@@ -5877,7 +5877,7 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
{
if ( ubAttackerID != NOBODY )
{
if ( !(MercPtrs[ubAttackerID]->inv[HANDPOS].exists( )) || Item[MercPtrs[ubAttackerID]->inv[HANDPOS].usItem].brassknuckles )
if ( !(MercPtrs[ubAttackerID]->inv[HANDPOS].exists( )) || ItemIsBrassKnuckles(MercPtrs[ubAttackerID]->inv[HANDPOS].usItem) )
{
// with enhanced CCS, make the lost breath harder to regenerate, which makes CQC more usable
if ( gGameExternalOptions.fEnhancedCloseCombatSystem )
@@ -5944,7 +5944,7 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
if ( HasItemFlag( usWeaponIndex, TASER ) )
{
// tasers need batteries, because I say so
if ( Item[usWeaponIndex].needsbatteries )
if (ItemNeedsBatteries(usWeaponIndex))
{
// check for batteries
OBJECTTYPE* pBatteries = FindAttachedBatteries( &(MercPtrs[ubAttackerID]->inv[HANDPOS]) );
@@ -9734,7 +9734,7 @@ BOOLEAN SOLDIERTYPE::CanClimbWithCurrentBackpack()
// only apply backpack climbing limitations to player mercs
if (UsingNewInventorySystem() == true && this->inv[BPACKPOCKPOS].exists() == true && this->bTeam == OUR_TEAM
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)this->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[this->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[this->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || !ItemAllowsClimbing(this->inv[BPACKPOCKPOS].usItem)))
return FALSE;
return TRUE;
@@ -10439,7 +10439,7 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sBr
&& this->HasDiseaseWithFlag( DISEASE_PROPERTY_LIMITED_USE_ARMS ) )
{
// drop item in main hand if twohanded
if ( this->inv[HANDPOS].exists() == true && TwoHandedItem( this->inv[HANDPOS].usItem ) )
if ( this->inv[HANDPOS].exists() == true && ItemIsTwoHanded( this->inv[HANDPOS].usItem ) )
dropiteminmainhand = true;
// we can only use one hand, so drop items in second hand
@@ -12763,9 +12763,9 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio
//Ja25 No meanwhiles
#ifdef JA2UB
if ( fMartialArtist && !Item[usItem].crowbar && this->ubBodyType == REGMALE )
if ( fMartialArtist && !ItemIsCrowbar(usItem) && this->ubBodyType == REGMALE )
#else
if ( fMartialArtist && !AreInMeanwhile( ) && !Item[usItem].crowbar && this->ubBodyType == REGMALE && !IsZombie( )
if ( fMartialArtist && !AreInMeanwhile( ) && !ItemIsCrowbar(usItem) && this->ubBodyType == REGMALE && !IsZombie( )
&& !( gGameExternalOptions.fDiseaseSevereLimitations && this->HasDiseaseWithFlag( DISEASE_PROPERTY_LIMITED_USE_LEGS )) ) // SANDRO - added check for body type
#endif
{
@@ -12871,7 +12871,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio
case ANIM_STAND:
case ANIM_CROUCH:
if ( !Item[usItem].crowbar )
if ( !ItemIsCrowbar(usItem) )
{
BOOLEAN fCannotKick = (ubDirection & 1);
// SANDRO - we will determine here what type of punch we are gonna use
@@ -13095,7 +13095,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginDropBomb( )
void SOLDIERTYPE::EVENT_SoldierDefuseTripwire( INT32 sGridNo, INT32 sItem )
{
// Flugente: if item is tripwireactivated and is a planted bomb, call the defuse dialogue. We obviously know about the item's existence already...
if ( gWorldItems[sItem].object.exists( ) && gWorldItems[sItem].object.fFlags & OBJECT_ARMED_BOMB && Item[gWorldItems[sItem].object.usItem].tripwire == 1 )
if ( gWorldItems[sItem].object.exists( ) && gWorldItems[sItem].object.fFlags & OBJECT_ARMED_BOMB && ItemIsTripwire(gWorldItems[sItem].object.usItem) )
{
// Increment the number of people busy doing stuff because of an attack
switch ( gAnimControl[this->usAnimState].ubHeight )
@@ -13148,7 +13148,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginFirstAid( INT32 sGridNo, UINT8 ubDirection )
//SANDRO - hack! Find out if we are a doctor with medical bag trying to make a surgery
this->fDoingSurgery = FALSE;
if ( (NUM_SKILL_TRAITS( this, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) && Item[this->inv[HANDPOS].usItem].medicalkit && gGameOptions.fNewTraitSystem )
if ( (NUM_SKILL_TRAITS( this, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) && ItemIsMedicalKit(this->inv[HANDPOS].usItem) && gGameOptions.fNewTraitSystem )
{
if ( ((pTSoldier->bTeam == OUR_TEAM) || (pTSoldier->bTeam == MILITIA_TEAM))
&& (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier ))
@@ -13320,7 +13320,7 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
// Flugente: AI medics are allowed to perform surgery without first aid kits, and can do this on themselves
if ( pVictim->iHealableInjury > 0 && this->fDoingSurgery && (this->ubID != pVictim->ubID || (gGameExternalOptions.fEnemyMedicsHealSelf && this->bTeam == ENEMY_TEAM))
&& gGameOptions.fNewTraitSystem && (NUM_SKILL_TRAITS( this, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery)
&& (Item[this->inv[HANDPOS].usItem].medicalkit || this->bTeam == ENEMY_TEAM) )
&& (ItemIsMedicalKit(this->inv[HANDPOS].usItem) || this->bTeam == ENEMY_TEAM) )
{
fOnSurgery = TRUE;
}
@@ -13359,7 +13359,7 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
return(0);
// using the GOOD medic stuff
if ( Item[this->inv[HANDPOS].usItem].medicalkit && !(fOnSurgery) ) // added check
if (ItemIsMedicalKit(this->inv[HANDPOS].usItem) && !(fOnSurgery) ) // added check
{
uiPossible += (uiPossible / 2); // add extra 50 %
}
@@ -13417,7 +13417,7 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
}
// now make sure we HAVE that much
if ( Item[this->inv[HANDPOS].usItem].medicalkit )
if (ItemIsMedicalKit(this->inv[HANDPOS].usItem))
{
if ( fOnSurgery )
uiMedcost = (uiActual * gSkillTraitValues.usDOSurgeryMedBagConsumption) / 100; // surgery drains the kit a lot
@@ -13665,7 +13665,7 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
// usedAPs equals (actionPts) * (%of possible points actually used)
uiUsedAPs = (uiActual * uiAvailAPs) / uiPossible;
if ( Item[this->inv[HANDPOS].usItem].medicalkit && !(fOnSurgery) ) // using the GOOD medic stuff
if (ItemIsMedicalKit(this->inv[HANDPOS].usItem) && !(fOnSurgery) ) // using the GOOD medic stuff
{
uiUsedAPs = (uiUsedAPs * 2) / 3; // reverse 50% bonus by taking 2/3rds
}
@@ -14071,7 +14071,7 @@ void SOLDIERTYPE::ReLoadSoldierAnimationDueToHandItemChange( UINT16 usOldItem, U
this->bWeaponMode = WM_ATTACHED_GL;
}
if ( Item[usNewItem].twohanded && Weapon[usNewItem].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
if (ItemIsTwoHanded(usNewItem) && Weapon[usNewItem].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
this->bScopeMode = USE_ALT_WEAPON_HOLD;
else
this->bScopeMode = USE_BEST_SCOPE;
@@ -14094,8 +14094,7 @@ void SOLDIERTYPE::ReLoadSoldierAnimationDueToHandItemChange( UINT16 usOldItem, U
{
if ( Item[usOldItem].usItemClass == IC_GUN )
{
// if ( (Item[ usOldItem ].fFlags & ITEM_TWO_HANDED) && usOldItem != ROCKET_LAUNCHER )
if ( (Item[usOldItem].twohanded) && !Item[usOldItem].rocketlauncher )
if (ItemIsTwoHanded(usOldItem) && !ItemIsRocketLauncher(usOldItem))
{
fOldRifle = TRUE;
}
@@ -14106,8 +14105,7 @@ void SOLDIERTYPE::ReLoadSoldierAnimationDueToHandItemChange( UINT16 usOldItem, U
{
if ( Item[usNewItem].usItemClass == IC_GUN )
{
// if ( (Item[ usNewItem ].fFlags & ITEM_TWO_HANDED) && usNewItem != ROCKET_LAUNCHER )
if ( (Item[usNewItem].twohanded) && !Item[usNewItem].rocketlauncher )
if (ItemIsTwoHanded(usNewItem) && !ItemIsRocketLauncher(usNewItem))
{
fNewRifle = TRUE;
}
@@ -14632,7 +14630,7 @@ BOOLEAN SOLDIERTYPE::SoldierCarriesTwoHandedWeapon( void )
usItem = this->inv[HANDPOS].usItem;
if ( this->inv[HANDPOS].exists( ) == true && (Item[usItem].twohanded) )
if ( this->inv[HANDPOS].exists( ) == true && ItemIsTwoHanded(usItem) )
{
return(TRUE);
}
@@ -15529,7 +15527,7 @@ BOOLEAN SOLDIERTYPE::LooksLikeACivilian( void )
{
// if that item is a gun, explosives, military armour or facewear, we're screwed
if ( (Item[this->inv[bLoop].usItem].usItemClass & (IC_WEAPON | IC_GRENADE | IC_BOMB)) ||
((Item[this->inv[bLoop].usItem].usItemClass & (IC_ARMOUR)) && !Item[this->inv[bLoop].usItem].leatherjacket && Armour[Item[this->inv[bLoop].usItem].ubClassIndex].ubProtection > 10) ||
((Item[this->inv[bLoop].usItem].usItemClass & (IC_ARMOUR)) && !ItemIsLeatherJacket(this->inv[bLoop].usItem) && Armour[Item[this->inv[bLoop].usItem].ubClassIndex].ubProtection > 10) ||
(Item[this->inv[bLoop].usItem].nightvisionrangebonus > 0 || Item[this->inv[bLoop].usItem].hearingrangebonus > 0)
)
{
@@ -15551,7 +15549,7 @@ BOOLEAN SOLDIERTYPE::LooksLikeACivilian( void )
{
// if that item is a gun, explosives, military armour or facewear, we're screwed
if ( (Item[this->inv[bLoop].usItem].usItemClass & (IC_WEAPON | IC_GRENADE | IC_BOMB)) ||
((Item[this->inv[bLoop].usItem].usItemClass & (IC_ARMOUR)) && !Item[this->inv[bLoop].usItem].leatherjacket && Armour[Item[this->inv[bLoop].usItem].ubClassIndex].ubProtection > 10) ||
((Item[this->inv[bLoop].usItem].usItemClass & (IC_ARMOUR)) && !ItemIsLeatherJacket(this->inv[bLoop].usItem) && Armour[Item[this->inv[bLoop].usItem].ubClassIndex].ubProtection > 10) ||
(Item[this->inv[bLoop].usItem].nightvisionrangebonus > 0 || Item[this->inv[bLoop].usItem].hearingrangebonus > 0)
)
{
@@ -16848,7 +16846,7 @@ void SOLDIERTYPE::DropSectorEquipment( )
if ( pObj->exists( ) )
{
// Check if it's supposed to be dropped
if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) && !(Item[pObj->usItem].defaultundroppable) && (*pObj)[0]->data.sObjectFlag & TAKEN_BY_MILITIA )
if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) && !ItemIsUndroppableByDefault(pObj->usItem) && (*pObj)[0]->data.sObjectFlag & TAKEN_BY_MILITIA )
{
(*pObj)[0]->data.sObjectFlag &= ~TAKEN_BY_MILITIA;
@@ -16874,7 +16872,7 @@ void SOLDIERTYPE::DropSectorEquipment( )
if ( pObj->exists( ) )
{
// Check if it's supposed to be dropped
if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) && !(Item[pObj->usItem].defaultundroppable) && (*pObj)[0]->data.sObjectFlag & TAKEN_BY_MILITIA )
if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) && !ItemIsUndroppableByDefault(pObj->usItem) && (*pObj)[0]->data.sObjectFlag & TAKEN_BY_MILITIA )
{
(*pObj)[0]->data.sObjectFlag &= ~TAKEN_BY_MILITIA;
@@ -16944,12 +16942,13 @@ void SOLDIERTYPE::TakeNewBombFromInventory( UINT16 usItem )
// take tripwire-activated item only if used item is tripwire activated
for ( i = 0; i < invsize; i++ )
{
UINT16 usItem = this->inv[i].usItem;
if ( this->inv[i].exists( ) == true &&
Item[this->inv[i].usItem].usItemClass == IC_BOMB &&
Item[this->inv[i].usItem].ubCursor == BOMBCURS &&
!Item[this->inv[i].usItem].tripwire &&
((Item[this->inv[i].usItem].tripwireactivation && Item[usItem].tripwireactivation) ||
(!Item[this->inv[i].usItem].tripwireactivation && !Item[usItem].tripwireactivation)) )
Item[usItem].usItemClass == IC_BOMB &&
Item[usItem].ubCursor == BOMBCURS &&
!ItemIsTripwire(usItem) &&
((ItemHasTripwireActivation(usItem) && ItemHasTripwireActivation(usItem)) ||
(!ItemHasTripwireActivation(usItem) && !ItemHasTripwireActivation(usItem))) )
{
this->inv[i].MoveThisObjectTo( this->inv[HANDPOS], 1, this );
return;
@@ -17072,7 +17071,7 @@ void SOLDIERTYPE::SwitchWeapons( BOOLEAN fKnife, BOOLEAN fSideArm )
else
handCanMove = (CanItemFitInPosition( this, &this->inv[HANDPOS], handobjstorageslot, FALSE ) || (this->inv[HANDPOS].exists( ) == false && this->inv[SECONDHANDPOS].exists( ) == false));
if ( Item[this->inv[retrieveslot].usItem].twohanded && this->inv[SECONDHANDPOS].exists( ) == true )
if ( ItemIsTwoHanded(this->inv[retrieveslot].usItem) && this->inv[SECONDHANDPOS].exists( ) == true )
searchitemCanMove = FALSE;
else
searchitemCanMove = (CanItemFitInPosition( this, &this->inv[retrieveslot], HANDPOS, FALSE ) || this->inv[retrieveslot].exists( ) == false);
@@ -17171,7 +17170,7 @@ INT8 SOLDIERTYPE::GetTraitCTHModifier( UINT16 usItem, INT16 ubAimTime, UINT8 ubT
{
// Bonus for heavy weapons moved here from above to get instant CtH bonus and not marksmanship bonus,
// which is supressed by weapon condition
if ( Item[usItem].rocketlauncher || Item[usItem].singleshotrocketlauncher )
if (ItemIsRocketLauncher(usItem) || ItemIsSingleShotRocketLauncher(usItem))
{
modifier += gSkillTraitValues.bCtHModifierRocketLaunchers; // -25% for untrained mercs !!!
@@ -17867,7 +17866,7 @@ void SOLDIERTYPE::SoldierPropertyUpkeep( )
if ( this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT] )
this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT]--;
if (AM_A_ROBOT(this) && Item[this->inv[ROBOT_UTILITY_SLOT].usItem].xray == 1)
if (AM_A_ROBOT(this) && ItemHasXRay(this->inv[ROBOT_UTILITY_SLOT].usItem))
{
if (this->usSkillCooldown[SOLDIER_COOLDOWN_ROBOT_XRAY])
this->usSkillCooldown[SOLDIER_COOLDOWN_ROBOT_XRAY]--;
@@ -18555,7 +18554,7 @@ BOOLEAN SOLDIERTYPE::HasMortar( )
INT8 invsize = (INT8)inv.size( ); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop )
{
if ( inv[bLoop].exists( ) == true && Item[inv[bLoop].usItem].mortar )
if ( inv[bLoop].exists( ) == true && ItemIsMortar(inv[bLoop].usItem) )
{
return TRUE;
}
@@ -18571,7 +18570,7 @@ BOOLEAN SOLDIERTYPE::GetSlotOfSignalShellIfMortar( UINT8* pbLoop )
INT8 invsize = (INT8)inv.size( ); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop )
{
if ( inv[bLoop].exists( ) == true && Item[inv[bLoop].usItem].mortar )
if ( inv[bLoop].exists( ) == true && ItemIsMortar(inv[bLoop].usItem) )
{
mortaritem = inv[bLoop].usItem;
break;
@@ -18590,7 +18589,7 @@ BOOLEAN SOLDIERTYPE::GetSlotOfSignalShellIfMortar( UINT8* pbLoop )
return TRUE;
}
if ( Item[inv[bLoop].usItem].mortar )
if (ItemIsMortar(inv[bLoop].usItem))
{
OBJECTTYPE* pAttObj = FindAttachmentByClass( &(inv[bLoop]), IC_BOMB );
@@ -18878,7 +18877,7 @@ BOOLEAN SOLDIERTYPE::OrderArtilleryStrike( UINT32 usSectorNr, INT32 sTargetGridN
for ( INT8 bLoop = 0; (bLoop < invsize) && (mortaritemcnt < maxFiringMortarsAmount); ++bLoop )
{
if ( pSoldier->inv[bLoop].exists( ) == true && Item[pSoldier->inv[bLoop].usItem].mortar )
if ( pSoldier->inv[bLoop].exists( ) == true && ItemIsMortar(pSoldier->inv[bLoop].usItem))
{
// if not already in list, remember this mortar
bool alreadyInList = false;
@@ -18923,7 +18922,7 @@ BOOLEAN SOLDIERTYPE::OrderArtilleryStrike( UINT32 usSectorNr, INT32 sTargetGridN
{
if ( pSoldier->inv[bLoop].exists( ) == true )
{
if ( Item[pSoldier->inv[bLoop].usItem].mortar )
if (ItemIsMortar(pSoldier->inv[bLoop].usItem))
{
OBJECTTYPE* pAttObj = FindAttachmentByClass( &(pSoldier->inv[bLoop]), IC_BOMB );
@@ -22429,7 +22428,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginAttachCan( INT32 sGridNo, UINT8 ubDirection
// OK, find door, attach to door, do animation...., remove item....
// First make sure we still have item in hand....
if ( !Item[this->inv[HANDPOS].usItem].canandstring )
if ( !ItemIsCanAndString(this->inv[HANDPOS].usItem))
{
return;
}
@@ -22741,7 +22740,7 @@ void SOLDIERTYPE::EVENT_SoldierApplyItemToPerson( INT32 sGridNo, UINT8 ubDirecti
if ( success )
{
if ( Item[usItem].gasmask )
if (ItemIsGasmask(usItem))
{
// put this item into a (at best empty) faceslot if no gasmask is been worn
INT8 bSlot = FindGasMask( pSoldier );
@@ -23362,11 +23361,11 @@ BOOLEAN SOLDIERTYPE::PlayerSoldierStartTalking( UINT8 ubTargetID, BOOLEAN fValid
BOOLEAN SOLDIERTYPE::IsValidSecondHandShot( void )
{
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
!(Item[this->inv[SECONDHANDPOS].usItem].twohanded) &&
!ItemIsTwoHanded(this->inv[SECONDHANDPOS].usItem) &&
(!this->bDoBurst || this->IsValidSecondHandBurst( )) &&
!Item[this->inv[HANDPOS].usItem].grenadelauncher &&
!ItemIsGrenadeLauncher(this->inv[HANDPOS].usItem) &&
Item[this->inv[HANDPOS].usItem].usItemClass == IC_GUN &&
!(Item[this->inv[HANDPOS].usItem].twohanded) &&
!ItemIsTwoHanded(this->inv[HANDPOS].usItem) &&
this->inv[SECONDHANDPOS][0]->data.gun.bGunStatus >= USABLE &&
this->inv[SECONDHANDPOS][0]->data.gun.ubGunShotsLeft > 0 )
{
@@ -23380,11 +23379,11 @@ BOOLEAN SOLDIERTYPE::IsValidSecondHandBurst( void )
{
// SANDRO - a function to determine if we can autofire with both weapons
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
!(Item[this->inv[SECONDHANDPOS].usItem].twohanded) &&
!Item[this->inv[HANDPOS].usItem].grenadelauncher &&
!ItemIsTwoHanded(this->inv[SECONDHANDPOS].usItem) &&
!ItemIsGrenadeLauncher(this->inv[HANDPOS].usItem) &&
this->bDoBurst &&
Item[this->inv[HANDPOS].usItem].usItemClass == IC_GUN &&
!(Item[this->inv[HANDPOS].usItem].twohanded) &&
!ItemIsTwoHanded(this->inv[HANDPOS].usItem) &&
this->inv[SECONDHANDPOS][0]->data.gun.bGunStatus >= USABLE &&
this->inv[SECONDHANDPOS][0]->data.gun.ubGunShotsLeft > 0 )
{
@@ -23416,7 +23415,7 @@ BOOLEAN SOLDIERTYPE::IsValidSecondHandShotForReloadingPurposes( void )
// about ammo taken out!
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
//!this->bDoBurst &&
!Item[this->inv[HANDPOS].usItem].grenadelauncher &&
!ItemIsGrenadeLauncher(this->inv[HANDPOS].usItem) &&
Item[this->inv[HANDPOS].usItem].usItemClass == IC_GUN &&
this->inv[SECONDHANDPOS][0]->data.gun.bGunStatus >= USABLE //&&
// this->inv[SECONDHANDPOS][0]->data.gun.ubGunShotsLeft > 0 &&
@@ -23452,7 +23451,7 @@ BOOLEAN SOLDIERTYPE::IsValidShotFromHip( INT16 bAimTime, INT32 iTrgGridNo )
return(FALSE);
}
// must be two handed for this
if ( !Item[this->inv[HANDPOS].usItem].twohanded )
if ( !ItemIsTwoHanded(this->inv[HANDPOS].usItem) )
{
return(FALSE);
}
@@ -23509,7 +23508,7 @@ BOOLEAN SOLDIERTYPE::IsValidPistolFastShot( INT16 bAimTime, INT32 iTrgGridNo )
return(FALSE);
}
// must be one handed for this
if ( Item[this->inv[HANDPOS].usItem].twohanded )
if (ItemIsTwoHanded(this->inv[HANDPOS].usItem))
{
return(FALSE);
}
@@ -24178,8 +24177,8 @@ void SOLDIERTYPE::BreakWindow(void)
{
if (this->inv[HANDPOS].exists() &&
this->inv[HANDPOS][0]->data.objectStatus >= USABLE &&
(Item[this->inv[HANDPOS].usItem].crowbar && Item[this->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
Item[this->inv[HANDPOS].usItem].usItemClass & IC_GUN && Item[this->inv[HANDPOS].usItem].twohanded && Item[this->inv[HANDPOS].usItem].metal))
(ItemIsCrowbar(this->inv[HANDPOS].usItem) && Item[this->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
Item[this->inv[HANDPOS].usItem].usItemClass & IC_GUN && ItemIsTwoHanded(this->inv[HANDPOS].usItem) && ItemIsMetal(this->inv[HANDPOS].usItem) ))
{
this->usAttackingWeapon = this->inv[HANDPOS].usItem;
this->aiData.bAction = AI_ACTION_KNIFE_STAB;
@@ -24203,8 +24202,8 @@ BOOLEAN SOLDIERTYPE::CanBreakWindow(void)
IS_MERC_BODY_TYPE(this) &&
this->inv[HANDPOS].exists() &&
this->inv[HANDPOS][0]->data.objectStatus >= USABLE &&
(Item[this->inv[HANDPOS].usItem].crowbar && Item[this->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
Item[this->inv[HANDPOS].usItem].usItemClass & IC_GUN && Item[this->inv[HANDPOS].usItem].twohanded && Item[this->inv[HANDPOS].usItem].metal))
(ItemIsCrowbar(this->inv[HANDPOS].usItem) && Item[this->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
Item[this->inv[HANDPOS].usItem].usItemClass & IC_GUN && ItemIsTwoHanded(this->inv[HANDPOS].usItem) && ItemIsMetal(this->inv[HANDPOS].usItem) ))
{
//INT32 sWindowGridNo = this->sTargetGridNo;
INT32 sWindowGridNo = this->sGridNo;
@@ -25063,7 +25062,7 @@ BOOLEAN AIDecideHipOrShoulderStance( SOLDIERTYPE * pSoldier, INT32 iGridNo )
UINT16 usInHand = pSoldier->usAttackingWeapon;
// not 2-handed or not standing
if ( gAnimControl[pSoldier->usAnimState].ubEndHeight != ANIM_STAND || !Item[pSoldier->inv[HANDPOS].usItem].twohanded )
if ( gAnimControl[pSoldier->usAnimState].ubEndHeight != ANIM_STAND || !ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) )
{
return FALSE;
}
@@ -25596,7 +25595,7 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
if ( !uiPossible )
return 0;
if ( Item[pSoldier->inv[0].usItem].medicalkit && !(fOnSurgery) ) // using the GOOD medic stuff
if (ItemIsMedicalKit(pSoldier->inv[0].usItem) && !(fOnSurgery) ) // using the GOOD medic stuff
uiPossible += (uiPossible / 2); // add extra 50 %
// Doctor trait improves basic bandaging ability
@@ -25632,7 +25631,7 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
uiActual = uiDeficiency; // reduce actual not to waste anything
// now make sure we HAVE that much
if ( Item[pKit->usItem].medicalkit )
if (ItemIsMedicalKit(pKit->usItem))
{
if ( fOnSurgery )
uiMedcost = (uiActual * gSkillTraitValues.usDOSurgeryMedBagConsumption) / 100; // surgery drains the kit a lot
@@ -25851,7 +25850,7 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
// usedAPs equals (actionPts) * (%of possible points actually used)
uiUsedAPs = (uiActual * uiAvailAPs) / uiPossible;
if ( Item[pSoldier->inv[0].usItem].medicalkit && !(fOnSurgery) ) // using the GOOD medic stuff
if (ItemIsMedicalKit(pSoldier->inv[0].usItem) && !(fOnSurgery) ) // using the GOOD medic stuff
uiUsedAPs = (uiUsedAPs * 2) / 3; // reverse 50% bonus by taking 2/3rds
// surgery is harder so cost more BPs
@@ -25983,7 +25982,7 @@ BOOLEAN ApplyConsumable(SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce,
// how much of this item do we use up
UINT16 statusused = min(portionsize, (*pObj)[0]->data.objectStatus);
if (!statusused || (statusused == 1 && Item[pObj->usItem].canteen))
if (!statusused || (statusused == 1 && ItemIsCanteen(pObj->usItem)))
return FALSE;
INT16 apcost = 0;
@@ -26000,12 +25999,12 @@ BOOLEAN ApplyConsumable(SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce,
apcost = max( apcost, (APBPConstants[AP_CAMOFLAGE] / 2) );
}
if ( Item[pObj->usItem].camouflagekit )
if (ItemIsCamoKit(pObj->usItem))
{
apcost = max( apcost, APBPConstants[AP_CAMOFLAGE] );
}
if ( Item[pObj->usItem].canteen )
if (ItemIsCanteen(pObj->usItem))
{
apcost = max( apcost, APBPConstants[AP_DRINK] );
}
@@ -26052,7 +26051,7 @@ BOOLEAN ApplyConsumable(SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce,
}
// some mercs will refuse to smoke
if ( Item[pObj->usItem].cigarette && pSoldier->GetBackgroundValue( BG_SMOKERTYPE ) == 2 )
if (ItemIsCigarette(pObj->usItem) && pSoldier->GetBackgroundValue( BG_SMOKERTYPE ) == 2 )
{
// merc gets slightly pissed by the player even suggesting this
TacticalCharacterDialogue( pSoldier, QUOTE_REFUSE_TO_SMOKE );
@@ -26108,7 +26107,7 @@ BOOLEAN ApplyConsumable(SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce,
fSuccess = TRUE;
// no sound on consuming cigarettes, as that is very annoying
if ( !Item[pObj->usItem].cigarette )
if ( !ItemIsCigarette(pObj->usItem) )
{
fDoSound = TRUE;
}
+22 -21
View File
@@ -4163,7 +4163,7 @@ void CopyProfileItems( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCreateStruc
UINT32 invsize = pProfile->inv.size();
for ( cnt = 0; cnt < pProfile->inv.size(); ++cnt )
{
if ( pProfile->inv[ cnt ] == NOTHING || Item[pProfile->inv[cnt]].attachment) {
if ( pProfile->inv[ cnt ] == NOTHING || ItemIsAttachment(pProfile->inv[cnt]) ) {
continue;
}
fRet = CreateItems( pProfile->inv[ cnt ], pProfile->bInvStatus[ cnt ], pProfile->bInvNumber[ cnt ], &gTempObject );
@@ -4188,7 +4188,7 @@ void CopyProfileItems( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCreateStruc
if ( pProfile->inv[ cnt ] == NOTHING) {
continue;
}
if (!Item[pProfile->inv[cnt]].attachment) {
if (!ItemIsAttachment(pProfile->inv[cnt])) {
continue;
}
fRet = CreateItems( pProfile->inv[ cnt ], pProfile->bInvStatus[ cnt ], pProfile->bInvNumber[ cnt ], &gTempObject );
@@ -4293,7 +4293,7 @@ void CopyProfileItems( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCreateStruc
if(fRet)
{
pSoldier->inv[cnt] = gTempObject;
if ( Item[gTempObject.usItem].fingerprintid )
if (ItemHasFingerPrintID(gTempObject.usItem))
{
for (int x = 0; x < pProfile->bInvNumber[ cnt ]; ++x) {
gTempObject[x]->data.ubImprintID = pSoldier->ubProfile;
@@ -5090,7 +5090,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
}
}
// Chance to gain second weapon
if ( Chance( iChance / 4 ) && !Item[pCreateStruct->Inv[HANDPOS].usItem].twohanded ) // 1/4 of chance
if ( Chance( iChance / 4 ) && !ItemIsTwoHanded(pCreateStruct->Inv[HANDPOS].usItem) ) // 1/4 of chance
{
(pCreateStruct->Inv[SECONDHANDPOS]) = (pCreateStruct->Inv[HANDPOS]);
@@ -5178,7 +5178,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
BTraitAssigned = TRUE;
// elites can have third skill trait
if ( Chance( iChance / 3 ) && !Item[pCreateStruct->Inv[HANDPOS].usItem].twohanded &&
if ( Chance( iChance / 3 ) && !ItemIsTwoHanded(pCreateStruct->Inv[HANDPOS].usItem) &&
(ubSolClass == SOLDIER_CLASS_ELITE || ubSolClass == SOLDIER_CLASS_ELITE_MILITIA) )
{
pSoldier->stats.ubSkillTraits[2] = AMBIDEXTROUS_NT;
@@ -5188,7 +5188,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
}
// Chance to gain second weapon and ambidextrous trait
else if ( Chance( iChance / 2 ) && !Item[pCreateStruct->Inv[HANDPOS].usItem].twohanded && !BTraitAssigned ) // 1/2 of chance
else if ( Chance( iChance / 2 ) && !ItemIsTwoHanded(pCreateStruct->Inv[HANDPOS].usItem) && !BTraitAssigned ) // 1/2 of chance
{
if ( pCreateStruct->bTeam == MILITIA_TEAM && gGameExternalOptions.fMilitiaUseSectorInventory && gGameExternalOptions.fMilitiaUseSectorInventory_Gun )
;
@@ -5206,7 +5206,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
BTraitAssigned = TRUE;
// elites can have third skill trait
if ( Chance( iChance / 3 ) && !Item[pCreateStruct->Inv[HANDPOS].usItem].twohanded &&
if ( Chance( iChance / 3 ) && !ItemIsTwoHanded(pCreateStruct->Inv[HANDPOS].usItem) &&
(ubSolClass == SOLDIER_CLASS_ELITE || ubSolClass == SOLDIER_CLASS_ELITE_MILITIA) )
{
pSoldier->stats.ubSkillTraits[2] = AMBIDEXTROUS_NT;
@@ -5222,7 +5222,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
pSoldier->stats.ubSkillTraits[0] = AMBIDEXT_OT;
ATraitAssigned = TRUE;
// Ambidextrous trait gives us second weapon automatically
if ( !Item[pCreateStruct->Inv[HANDPOS].usItem].twohanded )
if ( !ItemIsTwoHanded(pCreateStruct->Inv[HANDPOS].usItem) )
{
(pCreateStruct->Inv[SECONDHANDPOS]) = (pCreateStruct->Inv[HANDPOS]);
}
@@ -5232,7 +5232,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
pSoldier->stats.ubSkillTraits[1] = AMBIDEXT_OT;
BTraitAssigned = TRUE;
// Ambidextrous trait gives us second weapon automatically
if ( !Item[pCreateStruct->Inv[HANDPOS].usItem].twohanded )
if ( !ItemIsTwoHanded(pCreateStruct->Inv[HANDPOS].usItem) )
{
(pCreateStruct->Inv[SECONDHANDPOS]) = (pCreateStruct->Inv[HANDPOS]);
}
@@ -5267,28 +5267,29 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
{
if ( pCreateStruct->Inv[bLoop].exists( ) == true )
{
if ( Item[pCreateStruct->Inv[bLoop].usItem].mortar )
UINT16 usItem = pCreateStruct->Inv[bLoop].usItem;
if (ItemIsMortar(usItem))
foundMortar = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].rocketlauncher )
else if (ItemIsRocketLauncher(usItem))
foundRocketlauncher = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].grenadelauncher )
else if (ItemIsGrenadeLauncher(usItem))
foundGrenadelauncher = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].usItemClass == IC_BLADE )
else if ( Item[usItem].usItemClass == IC_BLADE )
foundKnife = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].usItemClass == IC_THROWING_KNIFE )
else if ( Item[usItem].usItemClass == IC_THROWING_KNIFE )
foundThrowing = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].usItemClass == IC_GRENADE )
else if ( Item[usItem].usItemClass == IC_GRENADE )
foundGrenades = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].brassknuckles )
else if (ItemIsBrassKnuckles(usItem))
foundHtH = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].usItemClass == 128 && // 128 is an identifier of blunt melee weapons
Item[pCreateStruct->Inv[bLoop].usItem].uiIndex != 0 )
else if ( Item[usItem].usItemClass == 128 && // 128 is an identifier of blunt melee weapons
Item[usItem].uiIndex != 0 )
foundMelee = TRUE;
else if ( HasItemFlag( pCreateStruct->Inv[bLoop].usItem, RADIO_SET ) )
else if ( HasItemFlag( usItem, RADIO_SET ) )
fRadioSetFound = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].firstaidkit )
else if (ItemIsFirstAidKit(usItem))
fFirstAidKitFound = TRUE;
else if ( Item[pCreateStruct->Inv[bLoop].usItem].medicalkit )
else if (ItemIsMedicalKit(usItem))
{
// Flugente: for enemy medic purposes, med kits also count as first aid kits
fFirstAidKitFound = TRUE;
+1 -1
View File
@@ -1845,7 +1845,7 @@ BOOLEAN RecruitRPC( UINT8 ubCharNum )
if ( bSlot != NO_SLOT )
{
// if ( Item[ pNewSoldier->inv[ bSlot ].usItem ].fFlags & ITEM_TWO_HANDED )
if ( Item[ pNewSoldier->inv[ bSlot ].usItem ].twohanded )
if (ItemIsTwoHanded(pNewSoldier->inv[ bSlot ].usItem))
{
if ( bSlot != SECONDHANDPOS && pNewSoldier->inv[ SECONDHANDPOS ].exists() == true )
{
+2 -2
View File
@@ -598,7 +598,7 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
break;
}
if ( Item[ pSoldier->inv[ BigSlot ].usItem ].rocketlauncher )
if (ItemIsRocketLauncher(pSoldier->inv[ BigSlot ].usItem))
iCarriedRL = pSoldier->inv[ BigSlot ].usItem; // remember that enemy is carrying a rocket launcher when check for rocket ammo is made later on
if ( ( Item[ pSoldier->inv[ BigSlot ].usItem ].usItemClass == IC_LAUNCHER ) ||
@@ -712,7 +712,7 @@ void DisplayWeaponInfo( SOLDIERTYPE* pSoldier, CHAR16* pStrInfo, UINT8 ubSlot, U
if ( ubTooltipDetailLevel == DL_Basic || ubTooltipDetailLevel == DL_Full ) // Madd: also hidden attachments should be hidden at the full level as well... unless the mercs have x-ray vision to see that rod&spring inside the gun!! :p
{
// display only externally-visible weapon attachments
if ( Item[iter->usItem].hiddenattachment )
if (ItemIsHiddenAttachment(iter->usItem))
fDisplayAttachment = FALSE;
else
fDisplayAttachment = TRUE;
+1 -1
View File
@@ -2678,7 +2678,7 @@ BOOLEAN AddDeadSoldierToUnLoadedSector( INT16 sMapX, INT16 sMapY, UINT8 bMapZ, S
pWorldItems[ bCount ].bVisible = TRUE;
pWorldItems[ bCount ].bRenderZHeightAboveLevel = 0;
if ( Item[pSoldier->inv[i].usItem].damageable ) // Madd: drop crappier items on higher difficulty levels
if (ItemIsDamageable(pSoldier->inv[i].usItem)) // Madd: drop crappier items on higher difficulty levels
{
// silversurfer: externalized this
//pSoldier->inv[i][0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20);
+4 -4
View File
@@ -8969,7 +8969,7 @@ void HandleTacticalTakeInvItem( INT32 iType )
for(UINT8 i = GUNSLINGPOCKPOS; i < NUM_INV_SLOTS; ++i)
{
if ( pSoldier->inv[i].exists() &&
!Item[ pSoldier->inv[i].usItem ].twohanded &&
!ItemIsTwoHanded(pSoldier->inv[i].usItem) &&
( iType > 0 ? ( pSoldier->inv[i].usItem == iType ) : ( InvItemType( pSoldier->inv[i].usItem ) == iType ) ) )
{
ubItemSlot = i;
@@ -9019,7 +9019,7 @@ INT32 InvItemType( UINT16 usItem )
{
if( usItem == XRAY_DEVICE )
return INV_ITEM_TYPE_XRAY;
if( Item[ usItem ].firstaidkit )
if(ItemIsFirstAidKit(usItem))
return INV_ITEM_TYPE_FIRSTAID;
if( Item[ usItem ].usItemClass == IC_BLADE )
return INV_ITEM_TYPE_MELEE;
@@ -9033,9 +9033,9 @@ INT32 InvItemType( UINT16 usItem )
return INV_ITEM_TYPE_BINOCULARS;
if( HasItemFlag( usItem, TASER ) )
return INV_ITEM_TYPE_TASER;
if( Item[ usItem ].usItemClass == IC_GUN && !Item[ usItem ].twohanded && Weapon[Item[ usItem ].ubClassIndex].ubWeaponType <= GUN_SMG )
if( Item[ usItem ].usItemClass == IC_GUN && !ItemIsTwoHanded(usItem) && Weapon[Item[ usItem ].ubClassIndex].ubWeaponType <= GUN_SMG )
return INV_ITEM_TYPE_SIDEARM;
if( Item[ usItem ].usItemClass == IC_MISC && Item[ usItem ].metaldetector )
if( Item[ usItem ].usItemClass == IC_MISC && ItemIsMetalDetector(usItem) )
return INV_ITEM_TYPE_METALDETECTOR;
return INV_ITEM_TYPE_UNKNOWN;
+5 -5
View File
@@ -180,7 +180,7 @@ UINT8 GetProperItemCursor( UINT8 ubSoldierID, UINT16 ubItemIndex, INT32 usMapPos
//Madd: quick hack to make wirecutter cursor appear when using a knife that can cut through wire
// sevenfm: check that not using bayonet attached to the gun
//if ( Item[ubItemIndex].wirecutters && IsCuttableWireFenceAtGridNo( sTargetGridNo ) && pSoldier->pathing.bLevel == 0 )
if ( Item[ubItemIndex].wirecutters &&
if (ItemIsWirecutters(ubItemIndex) &&
IsCuttableWireFenceAtGridNo( sTargetGridNo ) &&
pSoldier->pathing.bLevel == 0 &&
pSoldier->bWeaponMode != WM_ATTACHED_BAYONET)
@@ -1281,7 +1281,7 @@ UINT8 HandleNonActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos , BO
//CHRISL: We need to only check the second hand if the weapon in the second hand is onehanded
// Check for enough ammo...
if ( !EnoughAmmo( pSoldier, FALSE, HANDPOS ) || (pSoldier->IsValidSecondHandShotForReloadingPurposes( ) && !Item[pSoldier->inv[SECONDHANDPOS].usItem].twohanded && !EnoughAmmo( pSoldier, FALSE, SECONDHANDPOS) ) )
if ( !EnoughAmmo( pSoldier, FALSE, HANDPOS ) || (pSoldier->IsValidSecondHandShotForReloadingPurposes( ) && !ItemIsTwoHanded(pSoldier->inv[SECONDHANDPOS].usItem) && !EnoughAmmo( pSoldier, FALSE, SECONDHANDPOS) ) )
{
// Check if ANY ammo exists.....
if ( FindAmmoToReload( pSoldier, HANDPOS, NO_SLOT ) == NO_SLOT )
@@ -2937,14 +2937,14 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier )
return( TRAJECTORYCURS );
}
if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || ( pSoldier->bWeaponMode == WM_BURST && Item[pSoldier->inv[HANDPOS].usItem].grenadelauncher ) )
if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || ( pSoldier->bWeaponMode == WM_BURST && ItemIsGrenadeLauncher(pSoldier->inv[HANDPOS].usItem) ) )
{
if ( gGameSettings.fOptions [ TOPTION_GL_BURST_CURSOR ] )
return( TARGETCURS );
else
return ( TRAJECTORYCURS );
}
else if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO || ( pSoldier->bWeaponMode == WM_AUTOFIRE && Item[pSoldier->inv[HANDPOS].usItem].grenadelauncher ) )
else if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO || ( pSoldier->bWeaponMode == WM_AUTOFIRE && ItemIsGrenadeLauncher(pSoldier->inv[HANDPOS].usItem) ) )
{
if ( gGameSettings.fOptions [ TOPTION_GL_BURST_CURSOR ] )
return( TARGETCURS );
@@ -2976,7 +2976,7 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier )
// Flugente: cursor for constructing/deconstructing
// at the moment the gridno is not required in these functions, thus 1 suffices
if (!Item[usInHand].wirecutters && (IsStructureConstructItem(usInHand, 1, pSoldier) || IsStructureDeconstructItem(usInHand, 1, pSoldier)))
if (!ItemIsWirecutters(usInHand) && (IsStructureConstructItem(usInHand, 1, pSoldier) || IsStructureDeconstructItem(usInHand, 1, pSoldier)))
{
ubCursor = FORTICURS;
}
+54 -54
View File
@@ -1210,7 +1210,7 @@ INT32 ExplosiveEffectiveArmour( OBJECTTYPE * pObj )
}
iValue = Armour[ Item[pObj->usItem].ubClassIndex ].ubProtection;
iValue = iValue * (*pObj)[0]->data.objectStatus * Armour[ Item[pObj->usItem].ubClassIndex ].ubCoverage / 10000;
if ( Item[pObj->usItem].flakjacket )
if (ItemIsFlakJacket(pObj->usItem))
{
// increase value for flak jackets!
iValue *= 3;
@@ -1654,7 +1654,7 @@ BOOLEAN FireWeapon( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
break;
case IC_LAUNCHER:
if ( Item[pSoldier->usAttackingWeapon].rocketlauncher ){
if (ItemIsRocketLauncher(pSoldier->usAttackingWeapon)){
UseGunWrapper( pSoldier, sTargetGridNo );
} else {
// ATE: PAtch up - bookkeeping for spreading done out of whak
@@ -2563,7 +2563,7 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
{
for (attachmentList::iterator iter = (*pObjAttHand)[0]->attachments.begin(); iter != (*pObjAttHand)[0]->attachments.end(); ++iter)
{
if (Item[iter->usItem].hidemuzzleflash )
if (ItemHasHiddenMuzzleFlash(iter->usItem))
{
OBJECTTYPE* pA= &(*iter);
if ( (*pA)[0]->data.objectStatus >=USABLE)
@@ -2704,7 +2704,7 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
// ATE: Check if we should say quote...
if ( (*pObjHand)[0]->data.gun.ubGunShotsLeft == 0 &&
!Item[usUBItem].rocketlauncher &&
!ItemIsRocketLauncher(usUBItem) &&
pSoldier->bTeam == gbPlayerNum &&
(Chance(gGameExternalOptions.iChanceSayAnnoyingPhrase) || GetMagSize(pObjHand) > 4))
{
@@ -2719,14 +2719,14 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
// Deduct knife from inv! (not here, later?)
}
if ( Item[usUBItem].rocketlauncher )
if (ItemIsRocketLauncher(usUBItem))
{
if ( WillExplosiveWeaponFail( pSoldier, pObjHand ) )
{
INT16 sX, sY;
ConvertGridNoToCenterCellXY(pSoldier->sGridNo, &sX, &sY);
if ( Item[usUBItem].singleshotrocketlauncher )
if ( ItemIsSingleShotRocketLauncher(usUBItem) )
{
CreateItem( Item[usItemNum].discardedlauncheritem , (*pObjHand)[0]->data.objectStatus, pObjHand );
@@ -2889,7 +2889,7 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
if (IS_MERC_BODY_TYPE(pSoldier) &&
pSoldier->bVisible == TRUE &&
Item[usUBItem].usItemClass == IC_GUN &&
!Item[usUBItem].rocketlauncher &&
!ItemIsRocketLauncher(usUBItem) &&
strlen(AmmoTypes[Magazine[Item[(*pObjAttHand)[0]->data.gun.usGunAmmoItem].ubClassIndex].ubAmmoType].shotAnimation) > 0)
{
ANITILE_PARAMS AniParams;
@@ -2943,9 +2943,9 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
}
DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
}
else if ( Item[usUBItem].rocketlauncher )
else if (ItemIsRocketLauncher(usUBItem))
{
if ( Item[usUBItem].singleshotrocketlauncher )
if ( ItemIsSingleShotRocketLauncher(usUBItem) )
{
CreateItem( Item[usUBItem].discardedlauncheritem, (*pObjHand)[0]->data.objectStatus, pObjHand );
@@ -3349,7 +3349,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
{
for (attachmentList::iterator iter = (*pObjUsed)[0]->attachments.begin(); iter != (*pObjUsed)[0]->attachments.end(); ++iter)
{
if (Item[iter->usItem].hidemuzzleflash )
if (ItemHasHiddenMuzzleFlash(iter->usItem))
{
OBJECTTYPE* pA= &(*iter);
if ( (*pA)[0]->data.objectStatus >=USABLE)
@@ -3527,7 +3527,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
// ATE: Check if we should say quote...
if ( (*pObjUsed)[0]->data.gun.ubGunShotsLeft == 0 &&
!Item[usUBItem].rocketlauncher &&
!ItemIsRocketLauncher(usUBItem) &&
pSoldier->bTeam == gbPlayerNum &&
(Chance(gGameExternalOptions.iChanceSayAnnoyingPhrase) || GetMagSize(pObjUsed) > 4))
{
@@ -3648,14 +3648,14 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
}
}
if ( Item[usUBItem].rocketlauncher )
if (ItemIsRocketLauncher(usUBItem))
{
if ( WillExplosiveWeaponFail( pSoldier, pObjUsed ) )
{
INT16 sX, sY;
ConvertGridNoToCenterCellXY(pSoldier->sGridNo, &sX, &sY);
if ( Item[usUBItem].singleshotrocketlauncher )
if ( ItemIsSingleShotRocketLauncher(usUBItem) )
{
CreateItem( Item[usUBItem].discardedlauncheritem , (*pObjUsed)[0]->data.objectStatus, pObjUsed );
@@ -3708,7 +3708,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
if (IS_MERC_BODY_TYPE(pSoldier) &&
pSoldier->bVisible == TRUE &&
Item[usUBItem].usItemClass == IC_GUN &&
!Item[usUBItem].rocketlauncher &&
!ItemIsRocketLauncher(usUBItem) &&
strlen(AmmoTypes[Magazine[Item[(*pObjAttHand)[0]->data.gun.usGunAmmoItem].ubClassIndex].ubAmmoType].shotAnimation) > 0)
{
ANITILE_PARAMS AniParams;
@@ -3761,9 +3761,9 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
}
DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
}
else if ( Item[usUBItem].rocketlauncher )
else if (ItemIsRocketLauncher(usUBItem))
{
if ( Item[usUBItem].singleshotrocketlauncher )
if ( ItemIsSingleShotRocketLauncher(usUBItem) )
{
CreateItem( Item[usUBItem].discardedlauncheritem, (*pObjUsed)[0]->data.objectStatus, pObjUsed );
@@ -4424,7 +4424,7 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
}
}
// if twohanded item, place the secondhand item if any to temp space
if (pSoldier->inv[SECONDHANDPOS].exists() == true && Item[pTargetSoldier->inv[HANDPOS].usItem].twohanded)
if (pSoldier->inv[SECONDHANDPOS].exists() == true && ItemIsTwoHanded(pTargetSoldier->inv[HANDPOS].usItem))
{
if( pSoldier->bTeam != gbPlayerNum ) // for enemies, ignore rules and place it anywhere
{
@@ -5266,8 +5266,8 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
/////////////////////////////////////////////////////////////////////////////////////
// SANDRO - new mercs' records
if ( Item[ usItemNum ].usItemClass == IC_LAUNCHER || Item[usItemNum].grenadelauncher ||
Item[usItemNum].rocketlauncher || Item[usItemNum].singleshotrocketlauncher || Item[usItemNum].mortar )
if ( Item[ usItemNum ].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usItemNum) ||
ItemIsRocketLauncher(usItemNum) || ItemIsSingleShotRocketLauncher(usItemNum) || ItemIsMortar(usItemNum) )
{
gMercProfiles[ pSoldier->ubProfile ].records.usMissilesLaunched++;
}
@@ -5519,9 +5519,9 @@ void WeaponHit( UINT16 usSoldierID, UINT16 usWeaponIndex, INT16 sDamage, INT16 s
//TODO: Madd --- I don't think this code will ever get called for the HE ammo -- the EXPLOSIVE_GUN check filters out regular guns
// marke test mag ammo type: pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.ubGunAmmoType
// 2cond 'or' added
if ( Item[usWeaponIndex].rocketlauncher || AmmoTypes[ubAmmoType].explosionSize > 1 )
if (ItemIsRocketLauncher(usWeaponIndex) || AmmoTypes[ubAmmoType].explosionSize > 1 )
{
if ( Item[usWeaponIndex].singleshotrocketlauncher )
if (ItemIsSingleShotRocketLauncher(usWeaponIndex))
{
if ( Item[usWeaponIndex].usBuddyItem != 0 && Item[Item[usWeaponIndex].usBuddyItem].usItemClass & IC_EXPLOSV )
{
@@ -5533,7 +5533,7 @@ void WeaponHit( UINT16 usSoldierID, UINT16 usWeaponIndex, INT16 sDamage, INT16 s
}
}
// changed rpg type to work only with two flags matching
else if ( pSoldier && !Item[usWeaponIndex].singleshotrocketlauncher && Item[usWeaponIndex].rocketlauncher)
else if ( pSoldier && !ItemIsSingleShotRocketLauncher(usWeaponIndex) && ItemIsRocketLauncher(usWeaponIndex))
//we shouldn't be able to have an underbarrel firing mode in this step, so we keep the original code :JMich
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("WeaponHit: RPG7 item: %d, Ammo: %d",pSoldier->inv[HANDPOS].usItem , pSoldier->inv[HANDPOS][0]->data.gun.usGunAmmoItem ) );
@@ -5683,7 +5683,7 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
usDirection = (UINT8)GetDirectionToGridNoFromGridNo( pSoldier->sGridNo, sGridNo );
// marke added one 'or' to get this working with HE ammo
if ( Item[usWeaponIndex].rocketlauncher || (pObj && AmmoTypes[ (*pObj)[0]->data.gun.ubGunAmmoType].explosionSize > 1 ))
if (ItemIsRocketLauncher(usWeaponIndex) || (pObj && AmmoTypes[ (*pObj)[0]->data.gun.ubGunAmmoType].explosionSize > 1 ))
{
// Reduce attacker count!
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of LAW fire") );
@@ -5694,7 +5694,7 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
INT16 sX, sY;
ConvertGridNoToCenterCellXY(sGridNo, &sX, &sY);
if ( Item[usWeaponIndex].singleshotrocketlauncher )
if (ItemIsSingleShotRocketLauncher(usWeaponIndex))
{
if ( Item[usWeaponIndex].usBuddyItem != 0 && Item[Item[usWeaponIndex].usBuddyItem].usItemClass & IC_EXPLOSV )
{
@@ -5706,7 +5706,7 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
}
}
// changed too to use 2 flag to determine
else if ( ubAttackerID != NOBODY && !Item[usWeaponIndex].singleshotrocketlauncher && Item[usWeaponIndex].rocketlauncher)
else if ( ubAttackerID != NOBODY && !ItemIsSingleShotRocketLauncher(usWeaponIndex) && ItemIsRocketLauncher(usWeaponIndex) )
//there shouldn't be a way to enter here with an UnderBarrel weapon, so retaining original code :JMich
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("StructureHit: RPG7 item: %d, Ammo: %d",pAttacker->inv[HANDPOS].usItem , pAttacker->inv[HANDPOS][0]->data.gun.usGunAmmoItem ) );
@@ -5737,7 +5737,7 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
return;
}
if ( Item[usWeaponIndex].cannon )
if (ItemIsCannon(usWeaponIndex))
{
// Reduce attacker count!
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of TANK fire") );
@@ -6763,7 +6763,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
/////////////////////////////////////////////////////////////////////////////////////
// Determine iMarksmanship and Base CTH
if (Item[usItemUsed].rocketlauncher ){
if (ItemIsRocketLauncher(usItemUsed)){
// use the same calculation as for mechanical thrown weapons
iMarksmanship = ( EffectiveDexterity( pSoldier, FALSE ) + EffectiveMarksmanship( pSoldier ) + EffectiveWisdom( pSoldier ) + (10 * EffectiveExpLevel( pSoldier ) )) / 4;
// heavy weapons trait helps out
@@ -7164,7 +7164,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
/////////////////////////////////////////////////////////////////////////////////////
// Modify for using one hand
if ( !(Item[ usInHand ].twohanded ) )
if ( !ItemIsTwoHanded(usInHand) )
//check for 2weapon, retaining original code :JMich
{
if (pSoldier->inv[SECONDHANDPOS].exists() == false)
@@ -7496,7 +7496,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
// Equipment Modifiers
iChance += GetGearToHitBonus ( pSoldier );
if (AM_A_ROBOT(pSoldier) && Item[pSoldier->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus)
if (AM_A_ROBOT(pSoldier) && ItemProvidesRobotLaserBonus(pSoldier->inv[ROBOT_TARGETING_SLOT].usItem))
{
iChance += GetToHitBonus(&(pSoldier->inv[ROBOT_TARGETING_SLOT]), iRange, bLightLevel, FALSE);
}
@@ -7995,7 +7995,7 @@ INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 i
{
INT32 protection = ArmourProtection( pTarget, Item[iter->usItem].ubClassIndex, &((*iter)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
if ( fConsiderFlak && Item[iter->usItem].flakjacket )
if ( fConsiderFlak && ItemIsFlakJacket(iter->usItem) )
{
// increase value for flak jackets!
protection *= 3;
@@ -8028,7 +8028,7 @@ INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 i
// bullet got through jacket; apply ceramic plate armour
INT32 protection = ArmourProtection( pTarget, Item[iter->usItem].ubClassIndex, &((*iter)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
if ( fConsiderFlak && Item[iter->usItem].flakjacket )
if ( fConsiderFlak && ItemIsFlakJacket(iter->usItem) )
{
// increase value for flak jackets!
protection *= 3;
@@ -8057,7 +8057,7 @@ INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 i
{
INT32 protection = ArmourProtection( pTarget, Item[pArmour->usItem].ubClassIndex, &((*pArmour)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
if ( fConsiderFlak && Item[pArmour->usItem].flakjacket )
if ( fConsiderFlak && ItemIsFlakJacket(pArmour->usItem) )
{
// increase value for flak jackets!
protection *= 3;
@@ -8860,7 +8860,7 @@ INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BO
{
if ( gGameOptions.fNewTraitSystem )
{
if (!pSoldier->usAttackingWeapon || Item[pSoldier->inv[HANDPOS].usItem].brassknuckles)
if (!pSoldier->usAttackingWeapon || ItemIsBrassKnuckles(pSoldier->inv[HANDPOS].usItem))
{
if ( gGameExternalOptions.fEnhancedCloseCombatSystem )
{
@@ -9372,7 +9372,7 @@ UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAi
iAttRating += gSkillTraitValues.ubMABonusCtHBareHands * NUM_SKILL_TRAITS( pAttacker, MARTIAL_ARTS_NT );
}
// brass knuckles - bonus for Martial Arts (but a little lesser)
else if (Item[pAttacker->inv[HANDPOS].usItem].brassknuckles && HAS_SKILL_TRAIT( pAttacker, MARTIAL_ARTS_NT ))
else if (ItemIsBrassKnuckles(pAttacker->inv[HANDPOS].usItem) && HAS_SKILL_TRAIT( pAttacker, MARTIAL_ARTS_NT ))
{
iAttRating += gSkillTraitValues.ubMABonusCtHBrassKnuckles * NUM_SKILL_TRAITS( pAttacker, MARTIAL_ARTS_NT );
}
@@ -9586,7 +9586,7 @@ UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAi
{
iDefRating += gSkillTraitValues.bModifierDodgeHtHChance; // Make HtH dodging a little more problematic for untrained mercs
if ( !pAttacker->usAttackingWeapon || Item[pAttacker->inv[HANDPOS].usItem].brassknuckles )
if ( !pAttacker->usAttackingWeapon || ItemIsBrassKnuckles(pAttacker->inv[HANDPOS].usItem) )
{
if (HAS_SKILL_TRAIT( pDefender, MARTIAL_ARTS_NT ))
{
@@ -9599,7 +9599,7 @@ UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAi
{
iDefRating += ( gSkillTraitValues.ubMAOnTopCTDHtHBareHanded * NUM_SKILL_TRAITS( pDefender, MARTIAL_ARTS_NT ) );
}
else if ( Item[pDefender->inv[HANDPOS].usItem].brassknuckles )
else if (ItemIsBrassKnuckles(pDefender->inv[HANDPOS].usItem))
{
iDefRating += ( gSkillTraitValues.ubMAOnTopCTDHtHBrassKnuckles * NUM_SKILL_TRAITS( pDefender, MARTIAL_ARTS_NT ) );
}
@@ -9869,17 +9869,17 @@ BOOLEAN IsGunWeaponModeCapable( OBJECTTYPE* pObject, WeaponMode bWpnMode, SOLDIE
case WM_AUTOFIRE:
//return ((IsGunAutofireCapable(pSoldier, ubHandPos) || Weapon[ pSoldier->inv[ ubHandPos ].usItem ].NoSemiAuto )&& !Item[pSoldier->inv[ubHandPos].usItem].grenadelauncher );
return ((IsGunAutofireCapable(pObject) || Weapon[ pObject->usItem ].NoSemiAuto )&& !Item[pObject->usItem].grenadelauncher );
return ((IsGunAutofireCapable(pObject) || Weapon[ pObject->usItem ].NoSemiAuto )&& !ItemIsGrenadeLauncher(pObject->usItem));
case WM_ATTACHED_GL:
// return (FindAttachment( &(pSoldier->inv[ubHandPos]), UNDER_GLAUNCHER ) != 0 && FindLaunchableAttachment( &(pSoldier->inv[ubHandPos]), UNDER_GLAUNCHER ) != 0 );
//return (!Item[pSoldier->inv[ubHandPos].usItem].grenadelauncher && IsGrenadeLauncherAttached( &(pSoldier->inv[ubHandPos]) ) && FindLaunchableAttachment( &(pSoldier->inv[ubHandPos]), GetAttachedGrenadeLauncher( &(pSoldier->inv[ubHandPos]) )) != 0 );
return ( (!Item[pObject->usItem].grenadelauncher && !IsAttachmentClass(pObject->usItem, AC_RIFLEGRENADE) ) && IsGrenadeLauncherAttached( pObject ) && FindLaunchableAttachment( pObject, GetAttachedGrenadeLauncher( pObject )) != 0 );
return ( (!ItemIsGrenadeLauncher(pObject->usItem) && !IsAttachmentClass(pObject->usItem, AC_RIFLEGRENADE) ) && IsGrenadeLauncherAttached( pObject ) && FindLaunchableAttachment( pObject, GetAttachedGrenadeLauncher( pObject )) != 0 );
case WM_ATTACHED_GL_BURST:
//return (!Item[pSoldier->inv[ubHandPos].usItem].grenadelauncher && IsGrenadeLauncherAttached( &(pSoldier->inv[ubHandPos]) ) && Weapon[GetAttachedGrenadeLauncher(&pSoldier->inv[ubHandPos])].ubShotsPerBurst > 0 && FindLaunchableAttachment( &(pSoldier->inv[ubHandPos]), GetAttachedGrenadeLauncher( &(pSoldier->inv[ubHandPos]))) != 0 );
return ( (!Item[pObject->usItem].grenadelauncher && !HasAttachmentOfClass( pObject, AC_RIFLEGRENADE ) ) && IsGrenadeLauncherAttached( pObject ) && Weapon[GetAttachedGrenadeLauncher(pObject)].ubShotsPerBurst > 0 && FindLaunchableAttachment( pObject, GetAttachedGrenadeLauncher( pObject)) != 0 );
return ( (!ItemIsGrenadeLauncher(pObject->usItem) && !HasAttachmentOfClass( pObject, AC_RIFLEGRENADE ) ) && IsGrenadeLauncherAttached( pObject ) && Weapon[GetAttachedGrenadeLauncher(pObject)].ubShotsPerBurst > 0 && FindLaunchableAttachment( pObject, GetAttachedGrenadeLauncher( pObject)) != 0 );
case WM_ATTACHED_GL_AUTO:
return FALSE;
@@ -9997,7 +9997,7 @@ void HandleTacticalEffectsOfEquipmentChange( SOLDIERTYPE *pSoldier, UINT32 uiInv
pSoldier->bDoBurst = TRUE;
pSoldier->bDoAutofire = 1;
}
if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].twohanded && Weapon[ pSoldier->inv[ HANDPOS ].usItem ].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
if (ItemIsTwoHanded(pSoldier->inv[ HANDPOS ].usItem) && Weapon[ pSoldier->inv[ HANDPOS ].usItem ].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD;
else
pSoldier->bScopeMode = USE_BEST_SCOPE;
@@ -10038,7 +10038,7 @@ void HandleTacticalEffectsOfEquipmentChange( SOLDIERTYPE *pSoldier, UINT32 uiInv
pSoldier->bDoAutofire = 1;
pSoldier->bDoBurst = TRUE;
}
if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].twohanded && Weapon[ pSoldier->inv[ HANDPOS ].usItem ].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
if (ItemIsTwoHanded(pSoldier->inv[ HANDPOS ].usItem) && Weapon[ pSoldier->inv[ HANDPOS ].usItem ].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD;
else
pSoldier->bScopeMode = USE_BEST_SCOPE;
@@ -10156,7 +10156,7 @@ INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed, O
else
itemWeight=Item[usItem].ubWeight;
if ( Item[ usItem ].unaerodynamic )
if (ItemIsUnaerodynamic(usItem))
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcmaxtossrange: not aerodynamic");
iRange = 1;
@@ -10180,7 +10180,7 @@ INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed, O
}
// sevenfm: for grenades and aerodynamic items - apply modifier
if ( ! Item[ usItem ].unaerodynamic )
if ( !ItemIsUnaerodynamic(usItem))
iRange = (INT32)( iRange * gItemSettings.fRangeModifierGrenade );
// adjust for thrower's remaining breath (lose up to 1/2 of range)
@@ -10310,7 +10310,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
// SANDRO - old/new traits
if (gGameOptions.fNewTraitSystem)
{
if (Item[usHandItem].mortar)
if (ItemIsMortar(usHandItem))
{
if (HAS_SKILL_TRAIT(pSoldier, HEAVY_WEAPONS_NT))
iChance += gSkillTraitValues.sCtHModifierMortar * max(0, 100 - gSkillTraitValues.ubHWMortarCtHPenaltyReduction * NUM_SKILL_TRAITS(pSoldier, HEAVY_WEAPONS_NT)) / 100;
@@ -10330,7 +10330,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
// This feature is available only if not having new traits on - SANDRO
// Also.. this was moved here before the Heavy Weapons bonus
// HEADROCK HAM 3.2: External divisor for CTH with mortars, now that they are more prevalent in the battlefield.
if (Item[usHandItem].mortar)
if (ItemIsMortar(usHandItem))
{
iChance = iChance / gGameExternalOptions.ubMortarCTHDivisor;
}
@@ -10436,7 +10436,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
// ADJUST FOR RANGE
if ( Item[usHandItem].mortar && iRange < MIN_MORTAR_RANGE)
if (ItemIsMortar(usHandItem) && iRange < MIN_MORTAR_RANGE)
{
return(0);
}
@@ -10552,7 +10552,7 @@ void ChangeWeaponMode( SOLDIERTYPE * pSoldier )
// Flugente: if we are in a GL fire mode, switch between impact/delayed mode
if (((pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO) ||
(Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_LAUNCHER && !Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher)) &&
(Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_LAUNCHER && !ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem))) &&
!pSoldier->usGLDelayMode &&
!gGameExternalOptions.fDelayedGrenadeExplosion)
{
@@ -10646,7 +10646,7 @@ void ChangeScopeMode( SOLDIERTYPE * pSoldier, INT32 iTrgGridNo )
INT8 bOldAimTime = pSoldier->aiData.bShownAimTime;
// SANDRO - if the gun is flagged as HeavyGun, then we can only fire it from hip, thus no scopes to use at all, not even iron sights
if ( Item[pSoldier->inv[HANDPOS].usItem].twohanded && Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
if (ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun && gGameExternalOptions.ubAllowAlternativeWeaponHolding == 3 )
{
pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD;
}
@@ -10667,7 +10667,7 @@ void ChangeScopeMode( SOLDIERTYPE * pSoldier, INT32 iTrgGridNo )
while( ObjList[pSoldier->bScopeMode] == NULL && pSoldier->bScopeMode != USE_ALT_WEAPON_HOLD); //USE_BEST_SCOPE);
// If this mode is not allowed, or we are not standing, or holding something weird, skip it
if ( pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD && ( gGameExternalOptions.ubAllowAlternativeWeaponHolding != 3 || gAnimControl[ pSoldier->usAnimState ].ubEndHeight != ANIM_STAND || AM_A_ROBOT(pSoldier) || Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher || Item[pSoldier->inv[HANDPOS].usItem].singleshotrocketlauncher ) )
if ( pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD && ( gGameExternalOptions.ubAllowAlternativeWeaponHolding != 3 || gAnimControl[ pSoldier->usAnimState ].ubEndHeight != ANIM_STAND || AM_A_ROBOT(pSoldier) || ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem) || ItemIsSingleShotRocketLauncher(pSoldier->inv[HANDPOS].usItem)) )
pSoldier->bScopeMode = USE_BEST_SCOPE;
}
// changing scope mode can change number of aiming levels, we should reset the aiming variable here
@@ -11228,7 +11228,7 @@ void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTi
iHighestMagFactor = 1.0;
}
if (AM_A_ROBOT(pSoldier) && Item[pSoldier->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus)
if (AM_A_ROBOT(pSoldier) && ItemProvidesRobotLaserBonus(pSoldier->inv[ROBOT_TARGETING_SLOT].usItem))
{
gCTHDisplay.iBestLaserRange = max(gCTHDisplay.iBestLaserRange, GetBestLaserRange(&pSoldier->inv[ROBOT_TARGETING_SLOT]));
}
@@ -11514,7 +11514,7 @@ FLOAT CalcNewChanceToHitBaseWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, IN
}
// FIRING 1-HANDED WEAPONS
if ( !(Item[ usInHand ].twohanded ) ) //JMich todo: underbarrel
if ( !ItemIsTwoHanded(usInHand) ) //JMich todo: underbarrel
{
if (pSoldier->inv[SECONDHANDPOS].exists() != false)
{
@@ -11553,7 +11553,7 @@ FLOAT CalcNewChanceToHitBaseWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, IN
}
// HEAVY WEAPON in OLD trait system
if (Item[usInHand].rocketlauncher && !(gGameOptions.fNewTraitSystem) )
if (ItemIsRocketLauncher(usInHand) && !(gGameOptions.fNewTraitSystem) )
{
// Penalty for shooting heavy weapons (launchers). Heavy Weapons skill halves this, once per skill level.
FLOAT fTempPenalty = (gGameCTHConstants.BASE_HEAVY_WEAPON * fGunBaseDifficulty) - fGunBaseDifficulty;
@@ -11883,7 +11883,7 @@ FLOAT CalcNewChanceToHitAimWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT
}
// FIRING 1-HANDED WEAPONS
if ( !(Item[ usInHand ].twohanded ) ) //JMich Todo: fix for UnderBarrel firing
if ( !ItemIsTwoHanded(usInHand) ) //JMich Todo: fix for UnderBarrel firing
{
if (pSoldier->inv[SECONDHANDPOS].exists() != false)
{
@@ -11922,7 +11922,7 @@ FLOAT CalcNewChanceToHitAimWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT
}
// HEAVY WEAPON in OLD trait system
if (Item[usInHand].rocketlauncher && !(gGameOptions.fNewTraitSystem) )
if (ItemIsRocketLauncher(usInHand) && !(gGameOptions.fNewTraitSystem) )
{
// Penalty for shooting heavy weapons (launchers). Heavy Weapons skill halves this, once per skill level.
FLOAT fTempPenalty = (gGameCTHConstants.AIM_HEAVY_WEAPON * fGunAimDifficulty) - fGunAimDifficulty;
+2 -2
View File
@@ -457,7 +457,7 @@ INT32 FindWorldItemForTripwireInGridNo( INT32 sGridNo, INT8 bLevel, BOOLEAN fKno
{
pObj = &( gWorldItems[ gWorldBombs[ uiBombIndex ].iItemIndex ].object );
if ( pObj && Item[pObj->usItem].tripwire )
if ( pObj && ItemIsTripwire(pObj->usItem) )
{
if ( !fKnown )
return( gWorldBombs[ uiBombIndex ].iItemIndex );
@@ -867,7 +867,7 @@ void LoadWorldItemsFromMap( INT8 **hBuffer, float dMajorMapVersion, int ubMinorM
}
}
else if ( dummyItem.bVisible == HIDDEN_ITEM && dummyItem.object[0]->data.bTrap > 0 && ( Item[dummyItem.object.usItem].mine || dummyItem.object.usItem == TRIP_FLARE || dummyItem.object.usItem == TRIP_KLAXON) )
else if ( dummyItem.bVisible == HIDDEN_ITEM && dummyItem.object[0]->data.bTrap > 0 && (ItemIsMine(dummyItem.object.usItem) || dummyItem.object.usItem == TRIP_FLARE || dummyItem.object.usItem == TRIP_KLAXON) )
{
ArmBomb( &dummyItem.object, BOMB_PRESSURE );
dummyItem.usFlags |= WORLD_ITEM_ARMED_BOMB;