mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Convert INVTYPE boolean fields to flagmask (#325)
Rearranged fields from largest to smallest to remove alignment padding
This commit is contained in:
@@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
|
|||||||
item = &Item[i];
|
item = &Item[i];
|
||||||
//if( Item[i].fFlags & ITEM_NOT_EDITOR )
|
//if( Item[i].fFlags & ITEM_NOT_EDITOR )
|
||||||
// continue;
|
// continue;
|
||||||
if(item->notineditor)
|
if(ItemIsNotInEditor(i))
|
||||||
continue;
|
continue;
|
||||||
if( i == SWITCH || i == ACTION_ITEM )
|
if( i == SWITCH || i == ACTION_ITEM )
|
||||||
{
|
{
|
||||||
@@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
item = &Item[usCounter];
|
item = &Item[usCounter];
|
||||||
if(item->notineditor)
|
if(ItemIsNotInEditor(usCounter))
|
||||||
{
|
{
|
||||||
usCounter++;
|
usCounter++;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
+11
-11
@@ -1765,11 +1765,11 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
|
|||||||
{
|
{
|
||||||
if ( iSubFilter > -1 ) // Madd: new BR filters
|
if ( iSubFilter > -1 ) // Madd: new BR filters
|
||||||
{
|
{
|
||||||
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter )
|
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter )
|
||||||
bAddItem = TRUE;
|
bAddItem = TRUE;
|
||||||
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
|
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
|
||||||
bAddItem = TRUE;
|
bAddItem = TRUE;
|
||||||
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
|
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
|
||||||
bAddItem = TRUE;
|
bAddItem = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2653,11 +2653,11 @@ void SetFirstLastPagesForNew( UINT32 uiClassMask, INT32 iFilter, INT32 iSubFilte
|
|||||||
{
|
{
|
||||||
if (iSubFilter > -1 )
|
if (iSubFilter > -1 )
|
||||||
{
|
{
|
||||||
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter)
|
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter)
|
||||||
bCntNumItems = TRUE;
|
bCntNumItems = TRUE;
|
||||||
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
|
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
|
||||||
bCntNumItems = TRUE;
|
bCntNumItems = TRUE;
|
||||||
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment )
|
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
|
||||||
bCntNumItems = TRUE;
|
bCntNumItems = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3641,11 +3641,11 @@ void CalcFirstIndexForPage( STORE_INVENTORY *pInv, UINT32 uiItemClass )
|
|||||||
{
|
{
|
||||||
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
|
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
|
||||||
{
|
{
|
||||||
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
|
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
|
||||||
bCntItem = TRUE;
|
bCntItem = TRUE;
|
||||||
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
|
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
|
||||||
bCntItem = TRUE;
|
bCntItem = TRUE;
|
||||||
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
|
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
|
||||||
bCntItem = TRUE;
|
bCntItem = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -4181,7 +4181,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
|||||||
for (it = range.first; it != range.second; it++)
|
for (it = range.first; it != range.second; it++)
|
||||||
{
|
{
|
||||||
UINT16 attachmentId = it->second.attachmentIndex;
|
UINT16 attachmentId = it->second.attachmentIndex;
|
||||||
if (!Item[attachmentId].hiddenaddon && !Item[attachmentId].hiddenattachment && ItemIsLegal(attachmentId, TRUE))
|
if (!ItemIsHiddenAddon(attachmentId) && !ItemIsHiddenAttachment(attachmentId) && ItemIsLegal(attachmentId, TRUE))
|
||||||
{
|
{
|
||||||
fAttachmentsFound = TRUE;
|
fAttachmentsFound = TRUE;
|
||||||
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE)
|
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE)
|
||||||
@@ -4194,7 +4194,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
|||||||
for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++)
|
for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++)
|
||||||
{
|
{
|
||||||
// If the attachment is not hidden and attachable to the gun (usItemNumber)
|
// If the attachment is not hidden and attachable to the gun (usItemNumber)
|
||||||
if (!Item[itemId].hiddenaddon && !Item[itemId].hiddenattachment &&
|
if (!ItemIsHiddenAddon(itemId) && !ItemIsHiddenAttachment(itemId) &&
|
||||||
ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId))
|
ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId))
|
||||||
{
|
{
|
||||||
fAttachmentsFound = TRUE;
|
fAttachmentsFound = TRUE;
|
||||||
|
|||||||
@@ -526,7 +526,7 @@ void DistributeInitialGear(MERCPROFILESTRUCT *pProfile)
|
|||||||
if(iOrder[i]!=-1)
|
if(iOrder[i]!=-1)
|
||||||
{
|
{
|
||||||
// skip if this item is an attachment
|
// skip if this item is an attachment
|
||||||
if(Item[tInv[iOrder[i]].inv].attachment)
|
if(ItemIsAttachment(tInv[iOrder[i]].inv))
|
||||||
continue;
|
continue;
|
||||||
iSet = FALSE;
|
iSet = FALSE;
|
||||||
number = tInv[iOrder[i]].iNumber;
|
number = tInv[iOrder[i]].iNumber;
|
||||||
@@ -1103,7 +1103,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
|
|||||||
return HELMETPOS;
|
return HELMETPOS;
|
||||||
if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST )
|
if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST )
|
||||||
return VESTPOS;
|
return VESTPOS;
|
||||||
if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !(Item[usItem].attachment))
|
if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !ItemIsAttachment(usItem) )
|
||||||
return LEGPOS;
|
return LEGPOS;
|
||||||
break;
|
break;
|
||||||
case IC_BLADE:
|
case IC_BLADE:
|
||||||
@@ -1132,7 +1132,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
|
|||||||
case IC_GUN:
|
case IC_GUN:
|
||||||
if ( pProfile->inv[HANDPOS] == NONE )
|
if ( pProfile->inv[HANDPOS] == NONE )
|
||||||
return HANDPOS;
|
return HANDPOS;
|
||||||
if ( pProfile->inv[SECONDHANDPOS] == NONE && !(Item[pProfile->inv[HANDPOS]].twohanded))
|
if ( pProfile->inv[SECONDHANDPOS] == NONE && !(ItemIsTwoHanded(pProfile->inv[HANDPOS])))
|
||||||
return SECONDHANDPOS;
|
return SECONDHANDPOS;
|
||||||
if((UsingNewInventorySystem() == true))
|
if((UsingNewInventorySystem() == true))
|
||||||
if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0)
|
if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0)
|
||||||
@@ -1681,7 +1681,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
|
|||||||
|
|
||||||
// give ammo for guns
|
// give ammo for guns
|
||||||
Assert( usItem < gMAXITEMS_READ );
|
Assert( usItem < gMAXITEMS_READ );
|
||||||
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
|
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
|
||||||
{
|
{
|
||||||
usItem = DefaultMagazine(usItem);
|
usItem = DefaultMagazine(usItem);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem ));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem ));
|
||||||
@@ -1726,7 +1726,7 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
|
|||||||
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
|
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
|
||||||
|
|
||||||
// give ammo for guns
|
// give ammo for guns
|
||||||
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
|
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
|
||||||
{
|
{
|
||||||
usItem = DefaultMagazine(usItem);
|
usItem = DefaultMagazine(usItem);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
|
||||||
|
|||||||
+1
-1
@@ -1285,7 +1285,7 @@ void DistributePossibleItemsToVectors(void)
|
|||||||
{
|
{
|
||||||
gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
|
gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
|
||||||
|
|
||||||
if (Item[usItem].twohanded) {
|
if (ItemIsTwoHanded(usItem)) {
|
||||||
gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
|
gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
+2
-2
@@ -1198,7 +1198,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
|
|||||||
if ( pObj )
|
if ( pObj )
|
||||||
{
|
{
|
||||||
// abort if this is a launcher without ammo
|
// abort if this is a launcher without ammo
|
||||||
if ( Item[pObj->usItem].rocketlauncher && !Item[pObj->usItem].singleshotrocketlauncher )
|
if (ItemIsRocketLauncher(pObj->usItem) && !ItemIsSingleShotRocketLauncher(pObj->usItem))
|
||||||
{
|
{
|
||||||
OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE );
|
OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE );
|
||||||
if ( !pAttachment->exists( ) )
|
if ( !pAttachment->exists( ) )
|
||||||
@@ -1227,7 +1227,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
|
|||||||
MapScreenMessage( FONT_MCOLOR_LTRED, MSG_INTERFACE, szEnemyHeliText[7], pSoldier->GetName( ), Item[pObj->usItem].szItemName, pStrSectorName );
|
MapScreenMessage( FONT_MCOLOR_LTRED, MSG_INTERFACE, szEnemyHeliText[7], pSoldier->GetName( ), Item[pObj->usItem].szItemName, pStrSectorName );
|
||||||
|
|
||||||
// 'fire' (remove shot)
|
// 'fire' (remove shot)
|
||||||
if ( Item[pObj->usItem].singleshotrocketlauncher )
|
if (ItemIsSingleShotRocketLauncher(pObj->usItem))
|
||||||
{
|
{
|
||||||
CreateItem( Item[pObj->usItem].discardedlauncheritem, (*pObj)[0]->data.objectStatus, pObj );
|
CreateItem( Item[pObj->usItem].discardedlauncheritem, (*pObj)[0]->data.objectStatus, pObj );
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -3349,7 +3349,7 @@ UINT8 CalculateRepairPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts
|
|||||||
}
|
}
|
||||||
|
|
||||||
// can't repair at all without a toolkit
|
// can't repair at all without a toolkit
|
||||||
if (!Item[pSoldier->inv[HANDPOS].usItem].toolkit )
|
if (!ItemIsToolkit(pSoldier->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
*pusMaxPts = 0;
|
*pusMaxPts = 0;
|
||||||
return(0);
|
return(0);
|
||||||
@@ -4063,7 +4063,7 @@ UINT16 ToolKitPoints(SOLDIERTYPE *pSoldier)
|
|||||||
// CHRISL: Changed to dynamically determine max inventory locations.
|
// CHRISL: Changed to dynamically determine max inventory locations.
|
||||||
for (int ubPocket=HANDPOS; ubPocket < NUM_INV_SLOTS; ++ubPocket)
|
for (int ubPocket=HANDPOS; ubPocket < NUM_INV_SLOTS; ++ubPocket)
|
||||||
{
|
{
|
||||||
if( Item[pSoldier->inv[ ubPocket ].usItem].toolkit )
|
if(ItemIsToolkit(pSoldier->inv[ ubPocket ].usItem))
|
||||||
{
|
{
|
||||||
usKitpts += TotalPoints( &( pSoldier->inv[ ubPocket ] ) );
|
usKitpts += TotalPoints( &( pSoldier->inv[ ubPocket ] ) );
|
||||||
}
|
}
|
||||||
@@ -5138,7 +5138,7 @@ void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, IN
|
|||||||
|
|
||||||
// repairs on electronic items take twice as long if the guy doesn't have the skill
|
// repairs on electronic items take twice as long if the guy doesn't have the skill
|
||||||
// Technician/Electronic traits - repairing electronic items - SANDRO
|
// Technician/Electronic traits - repairing electronic items - SANDRO
|
||||||
if ( Item[ usItem ].electronic )
|
if (ItemIsElectronic(usItem))
|
||||||
{
|
{
|
||||||
if (gGameOptions.fNewTraitSystem)
|
if (gGameOptions.fNewTraitSystem)
|
||||||
{
|
{
|
||||||
@@ -5745,7 +5745,7 @@ void HandleRepairBySoldier( SOLDIERTYPE *pSoldier )
|
|||||||
BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, INT16 bThreshold )
|
BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, INT16 bThreshold )
|
||||||
{
|
{
|
||||||
// check to see if item can/needs to be repaired
|
// check to see if item can/needs to be repaired
|
||||||
if ( ( bStatus < 100) && ( Item[ usItem ].repairable ) )
|
if ( ( bStatus < 100) && ItemIsRepairable(usItem) )
|
||||||
{
|
{
|
||||||
if ( gGameExternalOptions.fAdvRepairSystem )
|
if ( gGameExternalOptions.fAdvRepairSystem )
|
||||||
{
|
{
|
||||||
@@ -10459,7 +10459,7 @@ BOOLEAN MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier )
|
|||||||
INT8 bPocket = 0, bonus = -101, bToolkitPocket = NO_SLOT;
|
INT8 bPocket = 0, bonus = -101, bToolkitPocket = NO_SLOT;
|
||||||
|
|
||||||
// if there isn't a toolkit in his hand
|
// if there isn't a toolkit in his hand
|
||||||
if( Item[pSoldier->inv[ HANDPOS].usItem].toolkit )
|
if(ItemIsToolkit(pSoldier->inv[ HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
bonus = Item[pSoldier->inv[ HANDPOS].usItem].RepairModifier;
|
bonus = Item[pSoldier->inv[ HANDPOS].usItem].RepairModifier;
|
||||||
bToolkitPocket = HANDPOS;
|
bToolkitPocket = HANDPOS;
|
||||||
@@ -10469,7 +10469,7 @@ BOOLEAN MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier )
|
|||||||
// CHRISL: Changed to dynamically determine max inventory locations.
|
// CHRISL: Changed to dynamically determine max inventory locations.
|
||||||
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
|
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
|
||||||
{
|
{
|
||||||
if( Item[pSoldier->inv[ bPocket ].usItem].toolkit && Item[pSoldier->inv[ bPocket ].usItem].RepairModifier > bonus)
|
if(ItemIsToolkit(pSoldier->inv[ bPocket ].usItem) && Item[pSoldier->inv[ bPocket ].usItem].RepairModifier > bonus)
|
||||||
{
|
{
|
||||||
bonus = Item[pSoldier->inv[ bPocket ].usItem].RepairModifier;
|
bonus = Item[pSoldier->inv[ bPocket ].usItem].RepairModifier;
|
||||||
bToolkitPocket = bPocket;
|
bToolkitPocket = bPocket;
|
||||||
@@ -10503,7 +10503,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
|
|||||||
fTeamPanelDirty = TRUE;
|
fTeamPanelDirty = TRUE;
|
||||||
|
|
||||||
// if there is a MEDICAL BAG in his hand, we're set
|
// if there is a MEDICAL BAG in his hand, we're set
|
||||||
if ( Item[pSoldier->inv[ HANDPOS ].usItem].medicalkit )
|
if (ItemIsMedicalKit(pSoldier->inv[ HANDPOS ].usItem))
|
||||||
{
|
{
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@@ -10511,7 +10511,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
|
|||||||
// run through rest of inventory looking 1st for MEDICAL BAGS, swap the first one into hand if found
|
// run through rest of inventory looking 1st for MEDICAL BAGS, swap the first one into hand if found
|
||||||
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
|
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
|
||||||
{
|
{
|
||||||
if ( Item[pSoldier->inv[ bPocket ].usItem].medicalkit )
|
if (ItemIsMedicalKit(pSoldier->inv[ bPocket ].usItem))
|
||||||
{
|
{
|
||||||
medkit_found = true;
|
medkit_found = true;
|
||||||
can_swap = true;
|
can_swap = true;
|
||||||
@@ -10579,7 +10579,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// we didn't find a medical bag, so settle for a FIRST AID KIT
|
// we didn't find a medical bag, so settle for a FIRST AID KIT
|
||||||
if ( Item[pSoldier->inv[ HANDPOS ].usItem].firstaidkit )
|
if (ItemIsFirstAidKit(pSoldier->inv[ HANDPOS ].usItem))
|
||||||
{
|
{
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@@ -10588,10 +10588,10 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
|
|||||||
// CHRISL: Changed to dynamically determine max inventory locations.
|
// CHRISL: Changed to dynamically determine max inventory locations.
|
||||||
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
|
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
|
||||||
{
|
{
|
||||||
if ( Item[pSoldier->inv[ bPocket ].usItem].firstaidkit )
|
if (ItemIsFirstAidKit(pSoldier->inv[ bPocket ].usItem))
|
||||||
{
|
{
|
||||||
// CHRISL: This needs to start with the first "non-big" pocket.
|
// CHRISL: This needs to start with the first "non-big" pocket.
|
||||||
if( ( Item[ pSoldier -> inv[ HANDPOS ].usItem ].twohanded ) && ( bPocket >= SMALLPOCKSTART ) )
|
if( (ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && (bPocket >= SMALLPOCKSTART)))
|
||||||
{
|
{
|
||||||
// first move from hand to second hand
|
// first move from hand to second hand
|
||||||
SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE );
|
SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE );
|
||||||
|
|||||||
@@ -4257,7 +4257,7 @@ BOOLEAN FireTankCannon( SOLDIERCELL *pAttacker )
|
|||||||
{
|
{
|
||||||
pItem = &pSoldier->inv[i];
|
pItem = &pSoldier->inv[i];
|
||||||
|
|
||||||
if ( Item[pItem->usItem].cannon )
|
if (ItemIsCannon(pItem->usItem))
|
||||||
{
|
{
|
||||||
PlayAutoResolveSample( Weapon[pItem->usItem].sSound, RATE_11025, 50, 1, MIDDLEPAN );
|
PlayAutoResolveSample( Weapon[pItem->usItem].sSound, RATE_11025, 50, 1, MIDDLEPAN );
|
||||||
|
|
||||||
@@ -4291,7 +4291,7 @@ BOOLEAN FireAntiTankWeapon( SOLDIERCELL *pAttacker )
|
|||||||
{
|
{
|
||||||
pItem = &pSoldier->inv[i];
|
pItem = &pSoldier->inv[i];
|
||||||
|
|
||||||
if ( Item[pItem->usItem].usItemClass == IC_LAUNCHER || Item[pItem->usItem].cannon )
|
if ( Item[pItem->usItem].usItemClass == IC_LAUNCHER || ItemIsCannon(pItem->usItem))
|
||||||
{
|
{
|
||||||
pAttacker->bWeaponSlot = (INT8)i;
|
pAttacker->bWeaponSlot = (INT8)i;
|
||||||
if ( gpAR->fUnlimitedAmmo )
|
if ( gpAR->fUnlimitedAmmo )
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ void HourlySmokerUpdate( )
|
|||||||
INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly
|
INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly
|
||||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ...
|
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ...
|
||||||
{
|
{
|
||||||
if ( pSoldier->inv[bLoop].exists( ) && Item[pSoldier->inv[bLoop].usItem].cigarette )
|
if ( pSoldier->inv[bLoop].exists( ) && ItemIsCigarette(pSoldier->inv[bLoop].usItem) )
|
||||||
{
|
{
|
||||||
pObj = &(pSoldier->inv[bLoop]);
|
pObj = &(pSoldier->inv[bLoop]);
|
||||||
|
|
||||||
|
|||||||
@@ -1481,7 +1481,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !(Item[twItem->object.usItem].singleshotrocketlauncher))
|
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !ItemIsSingleShotRocketLauncher(twItem->object.usItem))
|
||||||
{
|
{
|
||||||
EmptyWeaponMagazine( &twItem->object, &gItemPointer );
|
EmptyWeaponMagazine( &twItem->object, &gItemPointer );
|
||||||
InternalMAPBeginItemPointer( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
|
InternalMAPBeginItemPointer( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
|
||||||
@@ -6009,7 +6009,7 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO
|
|||||||
|
|
||||||
//original code by flugente, renamed variables to fit here, removed "min (OVERHEATING_MAX_TEMPERATURE, newValue)" for dirt to allow to go beyond maximum and deduct later the same amount if neccessary.
|
//original code by flugente, renamed variables to fit here, removed "min (OVERHEATING_MAX_TEMPERATURE, newValue)" for dirt to allow to go beyond maximum and deduct later the same amount if neccessary.
|
||||||
// ... if we use overheating and item is a gun, a launcher or a barrel ...
|
// ... if we use overheating and item is a gun, a launcher or a barrel ...
|
||||||
if ( gGameExternalOptions.fWeaponOverheating && ( Item[itemStack->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[itemStack->usItem].barrel == TRUE ) )
|
if ( gGameExternalOptions.fWeaponOverheating && ( Item[itemStack->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || ItemIsBarrel(itemStack->usItem) ) )
|
||||||
{
|
{
|
||||||
for(INT16 i = 0; i < itemStack->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
|
for(INT16 i = 0; i < itemStack->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
|
||||||
{
|
{
|
||||||
@@ -6017,7 +6017,7 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO
|
|||||||
|
|
||||||
FLOAT cooldownfactor = GetItemCooldownFactor(itemStack); // ... get item cooldown factor provided of attachments ...
|
FLOAT cooldownfactor = GetItemCooldownFactor(itemStack); // ... get item cooldown factor provided of attachments ...
|
||||||
|
|
||||||
if ( Item[itemStack->usItem].barrel == TRUE ) // ... a barrel lying around cools down a bit faster ...
|
if (ItemIsBarrel(itemStack->usItem)) // ... a barrel lying around cools down a bit faster ...
|
||||||
cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel;
|
cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel;
|
||||||
|
|
||||||
FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ...
|
FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ...
|
||||||
|
|||||||
@@ -4417,16 +4417,16 @@ void SetupInfo()
|
|||||||
// (Item[i].usItemClass & IC_AMMO) && (Magazine[ Item[i].ubClassIndex ].ubMagType == AMMO_BOX or AMMO_CRATE?)
|
// (Item[i].usItemClass & IC_AMMO) && (Magazine[ Item[i].ubClassIndex ].ubMagType == AMMO_BOX or AMMO_CRATE?)
|
||||||
for (UINT16 i = 0; i < MAXITEMS; ++i)
|
for (UINT16 i = 0; i < MAXITEMS; ++i)
|
||||||
{
|
{
|
||||||
if (Item[i].gascan) ItemIdCache::gasCans.push_back(i);
|
if (ItemIsGascan(i)) ItemIdCache::gasCans.push_back(i);
|
||||||
else if (Item[i].firstaidkit) ItemIdCache::firstAidKits.push_back(i);
|
else if (ItemIsFirstAidKit(i)) ItemIdCache::firstAidKits.push_back(i);
|
||||||
else if (Item[i].medicalkit) ItemIdCache::medKits.push_back(i);
|
else if (ItemIsMedicalKit(i)) ItemIdCache::medKits.push_back(i);
|
||||||
else if (Item[i].toolkit) ItemIdCache::toolKits.push_back(i);
|
else if (ItemIsToolkit(i)) ItemIdCache::toolKits.push_back(i);
|
||||||
else if (Item[i].usItemClass & IC_AMMO)
|
else if (Item[i].usItemClass & IC_AMMO)
|
||||||
{
|
{
|
||||||
if (Magazine[Item[i].ubClassIndex].ubMagType == AMMO_BOX)
|
if (Magazine[Item[i].ubClassIndex].ubMagType == AMMO_BOX)
|
||||||
{
|
{
|
||||||
if ((gGameOptions.fGunNut || !Item[i].biggunlist)
|
if ((gGameOptions.fGunNut || !ItemIsOnlyInTonsOfGuns(i))
|
||||||
&& (gGameOptions.ubGameStyle == STYLE_SCIFI || !Item[i].scifi))
|
&& (gGameOptions.ubGameStyle == STYLE_SCIFI || !ItemIsOnlyInScifi(i)))
|
||||||
{
|
{
|
||||||
// coolness runs from 1-10, so apply offset
|
// coolness runs from 1-10, so apply offset
|
||||||
const UINT8 coolness = min(max(1, Item[i].ubCoolness), 10);
|
const UINT8 coolness = min(max(1, Item[i].ubCoolness), 10);
|
||||||
|
|||||||
@@ -1334,7 +1334,7 @@ void CheckForMissingHospitalSupplies( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif//obsoleteCode
|
#endif//obsoleteCode
|
||||||
if ( Item[pObj->usItem].firstaidkit || Item[pObj->usItem].medicalkit || pObj->usItem == REGEN_BOOSTER || pObj->usItem == ADRENALINE_BOOSTER )
|
if (ItemIsFirstAidKit(pObj->usItem) || ItemIsMedicalKit(pObj->usItem) || pObj->usItem == REGEN_BOOSTER || pObj->usItem == ADRENALINE_BOOSTER )
|
||||||
{
|
{
|
||||||
for (StackedObjects::iterator iter = pObj->objectStack.begin(); iter != pObj->objectStack.end(); ++iter) {
|
for (StackedObjects::iterator iter = pObj->objectStack.begin(); iter != pObj->objectStack.end(); ++iter) {
|
||||||
if ( iter->data.objectStatus > 60 )
|
if ( iter->data.objectStatus > 60 )
|
||||||
|
|||||||
@@ -5137,7 +5137,7 @@ void AddFuelToVehicle( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVehicle )
|
|||||||
OBJECTTYPE *pItem;
|
OBJECTTYPE *pItem;
|
||||||
INT16 sFuelNeeded, sFuelAvailable, sFuelAdded;
|
INT16 sFuelNeeded, sFuelAvailable, sFuelAdded;
|
||||||
pItem = &pSoldier->inv[ HANDPOS ];
|
pItem = &pSoldier->inv[ HANDPOS ];
|
||||||
if( !Item[pItem->usItem].gascan )
|
if( !ItemIsGascan(pItem->usItem))
|
||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR16 str[ 100 ];
|
CHAR16 str[ 100 ];
|
||||||
|
|||||||
@@ -500,18 +500,18 @@ void UpdateTransportGroupInventory()
|
|||||||
if (!ItemIsLegal(i, TRUE)) continue;
|
if (!ItemIsLegal(i, TRUE)) continue;
|
||||||
if ((Item[i].usItemClass & IC_AMMO) == 0 && (Item[i].iTransportGroupMaxProgress == 0 || Item[i].iTransportGroupMinProgress > progress || progress > Item[i].iTransportGroupMaxProgress)) continue;
|
if ((Item[i].usItemClass & IC_AMMO) == 0 && (Item[i].iTransportGroupMaxProgress == 0 || Item[i].iTransportGroupMinProgress > progress || progress > Item[i].iTransportGroupMaxProgress)) continue;
|
||||||
|
|
||||||
if (Item[i].medical)
|
if (ItemIsMedical(i))
|
||||||
{
|
{
|
||||||
if (Item[i].firstaidkit) itemMap[MEDICAL_FIRSTAIDKITS].push_back(i);
|
if (ItemIsFirstAidKit(i)) itemMap[MEDICAL_FIRSTAIDKITS].push_back(i);
|
||||||
else if (Item[i].medicalkit) itemMap[MEDICAL_MEDKITS].push_back(i);
|
else if (ItemIsMedicalKit(i)) itemMap[MEDICAL_MEDKITS].push_back(i);
|
||||||
else itemMap[MEDICAL_OTHER].push_back(i);
|
else itemMap[MEDICAL_OTHER].push_back(i);
|
||||||
}
|
}
|
||||||
else if (Item[i].gascan) itemMap[GAS_CANS].push_back(i);
|
else if (ItemIsGascan(i)) itemMap[GAS_CANS].push_back(i);
|
||||||
else if (Item[i].toolkit) itemMap[TOOL_KITS].push_back(i);
|
else if (ItemIsToolkit(i)) itemMap[TOOL_KITS].push_back(i);
|
||||||
else if (HasItemFlag(i, RADIO_SET)) itemMap[RADIOS].push_back(i);
|
else if (HasItemFlag(i, RADIO_SET)) itemMap[RADIOS].push_back(i);
|
||||||
else if (Item[i].usItemClass & IC_GRENADE)
|
else if (Item[i].usItemClass & IC_GRENADE)
|
||||||
{
|
{
|
||||||
if (Item[i].glgrenade == 0
|
if (!ItemIsGLgrenade(i)
|
||||||
&& Item[i].attachmentclass != AC_GRENADE // not for a grenade launcher
|
&& Item[i].attachmentclass != AC_GRENADE // not for a grenade launcher
|
||||||
&& Item[i].attachmentclass != AC_ROCKET) // not for a rocket launcher
|
&& Item[i].attachmentclass != AC_ROCKET) // not for a rocket launcher
|
||||||
itemMap[GRENADE_THROWN].push_back(i);
|
itemMap[GRENADE_THROWN].push_back(i);
|
||||||
@@ -523,7 +523,7 @@ void UpdateTransportGroupInventory()
|
|||||||
itemMap[BACKPACKS].push_back(i);
|
itemMap[BACKPACKS].push_back(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Item[i].camouflagekit) itemMap[CAMO_KITS].push_back(i);
|
else if (ItemIsCamoKit(i)) itemMap[CAMO_KITS].push_back(i);
|
||||||
else if (Item[i].usItemClass & IC_MISC)
|
else if (Item[i].usItemClass & IC_MISC)
|
||||||
{
|
{
|
||||||
switch (Item[i].attachmentclass)
|
switch (Item[i].attachmentclass)
|
||||||
@@ -555,11 +555,11 @@ void UpdateTransportGroupInventory()
|
|||||||
{
|
{
|
||||||
itemMap[GUNS].push_back(i);
|
itemMap[GUNS].push_back(i);
|
||||||
}
|
}
|
||||||
else if (Item[i].grenadelauncher)
|
else if (ItemIsGrenadeLauncher(i))
|
||||||
{
|
{
|
||||||
itemMap[GRENADELAUNCHERS].push_back(i);
|
itemMap[GRENADELAUNCHERS].push_back(i);
|
||||||
}
|
}
|
||||||
else if (Item[i].rocketlauncher)
|
else if (ItemIsRocketLauncher(i))
|
||||||
{
|
{
|
||||||
itemMap[ROCKETLAUNCHERS].push_back(i);
|
itemMap[ROCKETLAUNCHERS].push_back(i);
|
||||||
}
|
}
|
||||||
@@ -713,7 +713,7 @@ void UpdateTransportGroupInventory()
|
|||||||
|
|
||||||
case ROCKETLAUNCHERS:
|
case ROCKETLAUNCHERS:
|
||||||
{
|
{
|
||||||
addItemToInventory(pSoldier, id, Item[id].singleshotrocketlauncher ? 3 : 1);
|
addItemToInventory(pSoldier, id, ItemIsSingleShotRocketLauncher(id) ? 3 : 1);
|
||||||
|
|
||||||
const UINT16 launchableId = PickARandomLaunchable(id);
|
const UINT16 launchableId = PickARandomLaunchable(id);
|
||||||
if (launchableId == 0) continue; // no launchable matches, skip
|
if (launchableId == 0) continue; // no launchable matches, skip
|
||||||
@@ -773,7 +773,7 @@ void UpdateTransportGroupInventory()
|
|||||||
for (int i = 0; i < pSoldier->inv.size(); ++i)
|
for (int i = 0; i < pSoldier->inv.size(); ++i)
|
||||||
{
|
{
|
||||||
OBJECTTYPE* item = &pSoldier->inv[i];
|
OBJECTTYPE* item = &pSoldier->inv[i];
|
||||||
if (item->exists() && Item[item->usItem].defaultundroppable == FALSE)
|
if (item->exists() && ItemIsUndroppableByDefault(item->usItem) == FALSE)
|
||||||
{
|
{
|
||||||
item->fFlags &= ~OBJECT_UNDROPPABLE;
|
item->fFlags &= ~OBJECT_UNDROPPABLE;
|
||||||
}
|
}
|
||||||
@@ -861,7 +861,7 @@ void UpdateTransportGroupInventory()
|
|||||||
for (int i = 0; i < pSoldier->inv.size(); ++i)
|
for (int i = 0; i < pSoldier->inv.size(); ++i)
|
||||||
{
|
{
|
||||||
OBJECTTYPE* item = &pSoldier->inv[i];
|
OBJECTTYPE* item = &pSoldier->inv[i];
|
||||||
if (item->exists() && Item[item->usItem].defaultundroppable == FALSE)
|
if (item->exists() && ItemIsUndroppableByDefault(item->usItem) == FALSE)
|
||||||
{
|
{
|
||||||
item->fFlags &= ~OBJECT_UNDROPPABLE;
|
item->fFlags &= ~OBJECT_UNDROPPABLE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9797,12 +9797,12 @@ void BltCharInvPanel()
|
|||||||
UINT32 fontColour = FONT_MCOLOR_RED;
|
UINT32 fontColour = FONT_MCOLOR_RED;
|
||||||
|
|
||||||
// robot targeting bonus
|
// robot targeting bonus
|
||||||
if (Item[pSoldier->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus)
|
if (ItemProvidesRobotLaserBonus(pSoldier->inv[ROBOT_TARGETING_SLOT].usItem))
|
||||||
{
|
{
|
||||||
swprintf(text, szRobotText[ROBOT_TEXT_LASER]);
|
swprintf(text, szRobotText[ROBOT_TEXT_LASER]);
|
||||||
fontColour = FONT_MCOLOR_LTGREEN;
|
fontColour = FONT_MCOLOR_LTGREEN;
|
||||||
}
|
}
|
||||||
else if (Item[pSoldier->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotNightVision)
|
else if (ItemProvidesRobotNightvision(pSoldier->inv[ROBOT_TARGETING_SLOT].usItem))
|
||||||
{
|
{
|
||||||
swprintf(text, szRobotText[ROBOT_TEXT_NIGHT_VISION]);
|
swprintf(text, szRobotText[ROBOT_TEXT_NIGHT_VISION]);
|
||||||
fontColour = FONT_MCOLOR_LTGREEN;
|
fontColour = FONT_MCOLOR_LTGREEN;
|
||||||
@@ -9825,7 +9825,7 @@ void BltCharInvPanel()
|
|||||||
swprintf(text, szRobotText[ROBOT_TEXT_STAT_BONUSES]);
|
swprintf(text, szRobotText[ROBOT_TEXT_STAT_BONUSES]);
|
||||||
fontColour = FONT_MCOLOR_LTGREEN;
|
fontColour = FONT_MCOLOR_LTGREEN;
|
||||||
}
|
}
|
||||||
else if (Item[pSoldier->inv[ROBOT_CHASSIS_SLOT].usItem].fProvidesRobotCamo)
|
else if (ItemProvidesRobotCamo(pSoldier->inv[ROBOT_CHASSIS_SLOT].usItem))
|
||||||
{
|
{
|
||||||
swprintf(text, szRobotText[ROBOT_TEXT_CAMO]);
|
swprintf(text, szRobotText[ROBOT_TEXT_CAMO]);
|
||||||
fontColour = FONT_MCOLOR_LTGREEN;
|
fontColour = FONT_MCOLOR_LTGREEN;
|
||||||
@@ -9858,12 +9858,12 @@ void BltCharInvPanel()
|
|||||||
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_RADIO]);
|
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_RADIO]);
|
||||||
fontColour = FONT_MCOLOR_LTGREEN;
|
fontColour = FONT_MCOLOR_LTGREEN;
|
||||||
}
|
}
|
||||||
else if (Item[pSoldier->inv[ROBOT_UTILITY_SLOT].usItem].metaldetector == 1)
|
else if (ItemIsMetalDetector(pSoldier->inv[ROBOT_UTILITY_SLOT].usItem))
|
||||||
{
|
{
|
||||||
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_METAL_DETECTOR]);
|
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_METAL_DETECTOR]);
|
||||||
fontColour = FONT_MCOLOR_LTGREEN;
|
fontColour = FONT_MCOLOR_LTGREEN;
|
||||||
}
|
}
|
||||||
else if (Item[pSoldier->inv[ROBOT_UTILITY_SLOT].usItem].xray == 1)
|
else if (ItemHasXRay(pSoldier->inv[ROBOT_UTILITY_SLOT].usItem))
|
||||||
{
|
{
|
||||||
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_XRAY]);
|
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_XRAY]);
|
||||||
fontColour = FONT_MCOLOR_LTGREEN;
|
fontColour = FONT_MCOLOR_LTGREEN;
|
||||||
@@ -10442,7 +10442,7 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason )
|
|||||||
{
|
{
|
||||||
if ( !InItemDescriptionBox( ) )
|
if ( !InItemDescriptionBox( ) )
|
||||||
{
|
{
|
||||||
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[pSoldier->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (pSoldier->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !(Item[pSoldier->inv[ uiHandPos ].usItem].singleshotrocketlauncher) )
|
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[pSoldier->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (pSoldier->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(pSoldier->inv[ uiHandPos ].usItem) )
|
||||||
{
|
{
|
||||||
EmptyWeaponMagazine( &(pSoldier->inv[ uiHandPos ]), &gItemPointer, uiHandPos );
|
EmptyWeaponMagazine( &(pSoldier->inv[ uiHandPos ]), &gItemPointer, uiHandPos );
|
||||||
InternalMAPBeginItemPointer( pSoldier );
|
InternalMAPBeginItemPointer( pSoldier );
|
||||||
|
|||||||
@@ -4297,10 +4297,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
|
|||||||
// ADJUST BASED ON ITEM IN HAND....
|
// ADJUST BASED ON ITEM IN HAND....
|
||||||
usItem = pSoldier->inv[ HANDPOS ].usItem;
|
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 ].fFlags & ITEM_TWO_HANDED) )
|
||||||
if ( (Item[ usItem ].twohanded ) )
|
if (ItemIsTwoHanded(usItem))
|
||||||
{
|
{
|
||||||
ubWaterHandIndex = 0;
|
ubWaterHandIndex = 0;
|
||||||
}
|
}
|
||||||
@@ -4321,7 +4321,7 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
|
|||||||
// ADJUST BASED ON ITEM IN HAND....
|
// ADJUST BASED ON ITEM IN HAND....
|
||||||
usItem = pSoldier->inv[ HANDPOS ].usItem;
|
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 )
|
if ( usAnimState == STANDING )
|
||||||
{
|
{
|
||||||
@@ -4342,10 +4342,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// CHECK FOR HANDGUN
|
// 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 ].fFlags & ITEM_TWO_HANDED) )
|
||||||
if ( !(Item[ usItem ].twohanded ) )
|
if ( !ItemIsTwoHanded(usItem) )
|
||||||
{
|
{
|
||||||
// SANDRO - new anim for running with pistol by PasHancock
|
// SANDRO - new anim for running with pistol by PasHancock
|
||||||
if ( usAnimState == RUNNING )
|
if ( usAnimState == RUNNING )
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ void GuaranteeAtLeastXItemsOfIndex( UINT8 ubArmsDealer, UINT16 usItemIndex, UIN
|
|||||||
void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems );
|
void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems );
|
||||||
|
|
||||||
void ArmsDealerGetsFreshStock( UINT8 ubArmsDealer, UINT16 usItemIndex, UINT8 ubNumItems );
|
void ArmsDealerGetsFreshStock( UINT8 ubArmsDealer, UINT16 usItemIndex, UINT8 ubNumItems );
|
||||||
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex );
|
|
||||||
UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex );
|
UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex );
|
||||||
|
|
||||||
BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer );
|
BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer );
|
||||||
@@ -85,8 +84,6 @@ BOOLEAN CanThisItemBeSoldToSimulatedCustomer( UINT8 ubArmsDealerID, UINT16 usIte
|
|||||||
|
|
||||||
void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer );
|
void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer );
|
||||||
|
|
||||||
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex );
|
|
||||||
|
|
||||||
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime );
|
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime );
|
||||||
|
|
||||||
ARMS_DEALER_STATUS& ARMS_DEALER_STATUS::operator=(const OLD_ARMS_DEALER_STATUS_101& status)
|
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 );
|
return( ARMS_DEALER_HANDGUNCLASS );
|
||||||
break;
|
break;
|
||||||
case RIFLECLASS:
|
case RIFLECLASS:
|
||||||
if ( ItemIsARocketRifle( usItem ) )
|
if (ItemHasFingerPrintID( usItem ) )
|
||||||
return( ARMS_DEALER_ROCKET_RIFLE );
|
return( ARMS_DEALER_ROCKET_RIFLE );
|
||||||
else
|
else
|
||||||
return( ARMS_DEALER_RIFLECLASS );
|
return( ARMS_DEALER_RIFLECLASS );
|
||||||
@@ -1010,15 +1007,15 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
|
|||||||
{
|
{
|
||||||
if ( Item [usItem].alcohol > 0.0f )
|
if ( Item [usItem].alcohol > 0.0f )
|
||||||
return( ARMS_DEALER_ALCOHOL );
|
return( ARMS_DEALER_ALCOHOL );
|
||||||
else if ( Item [usItem].electronic )
|
else if (ItemIsElectronic(usItem))
|
||||||
return( ARMS_DEALER_ELECTRONICS );
|
return( ARMS_DEALER_ELECTRONICS );
|
||||||
else if ( Item [usItem].hardware )
|
else if (ItemIsHardware(usItem))
|
||||||
return( ARMS_DEALER_HARDWARE );
|
return( ARMS_DEALER_HARDWARE );
|
||||||
else if ( Item [usItem].medical )
|
else if (ItemIsMedical(usItem))
|
||||||
return( ARMS_DEALER_MEDICAL );
|
return( ARMS_DEALER_MEDICAL );
|
||||||
else if ( Item [usItem].attachment )
|
else if (ItemIsAttachment(usItem))
|
||||||
return( ARMS_DEALER_ATTACHMENTS );
|
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 );
|
return( ARMS_DEALER_DETONATORS );
|
||||||
else
|
else
|
||||||
return( ARMS_DEALER_MISC );
|
return( ARMS_DEALER_MISC );
|
||||||
@@ -1076,7 +1073,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
|
|||||||
return( ARMS_DEALER_AMMO );
|
return( ARMS_DEALER_AMMO );
|
||||||
break;
|
break;
|
||||||
case IC_FACE:
|
case IC_FACE:
|
||||||
if (Item[usItem].electronic )
|
if (ItemIsElectronic(usItem))
|
||||||
return ARMS_DEALER_ELECTRONICS;
|
return ARMS_DEALER_ELECTRONICS;
|
||||||
else
|
else
|
||||||
return ARMS_DEALER_FACE;
|
return ARMS_DEALER_FACE;
|
||||||
@@ -1278,8 +1275,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
|||||||
// uiFlags = Item[ usItemIndex ].fFlags;
|
// uiFlags = Item[ usItemIndex ].fFlags;
|
||||||
|
|
||||||
// can't repair anything that's not repairable!
|
// can't repair anything that's not repairable!
|
||||||
// if ( !( uiFlags & ITEM_REPAIRABLE ) )
|
if ( !ItemIsRepairable(usItemIndex) )
|
||||||
if ( !( Item[ usItemIndex ].repairable ) )
|
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
@@ -1297,8 +1293,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
|||||||
case ARMS_DEALER_PERKO:
|
case ARMS_DEALER_PERKO:
|
||||||
#endif
|
#endif
|
||||||
// repairs ANYTHING non-electronic
|
// repairs ANYTHING non-electronic
|
||||||
// if ( !( uiFlags & ITEM_ELECTRONIC ) )
|
if ( !ItemIsElectronic(usItemIndex) )
|
||||||
if ( !( Item[ usItemIndex ].electronic ) )
|
|
||||||
{
|
{
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@@ -1306,8 +1301,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
|||||||
|
|
||||||
case ARMS_DEALER_FREDO:
|
case ARMS_DEALER_FREDO:
|
||||||
// repairs ONLY electronics
|
// repairs ONLY electronics
|
||||||
// if ( uiFlags & ITEM_ELECTRONIC )
|
if (ItemIsElectronic(usItemIndex))
|
||||||
if ( Item[ usItemIndex ].electronic )
|
|
||||||
{
|
{
|
||||||
return(TRUE);
|
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
|
// 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 ( armsDealerInfo[ubArmsDealer].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
|
||||||
{
|
{
|
||||||
if ( !( Item[ usItemIndex ].electronic ) )
|
if ( !ItemIsElectronic(usItemIndex) )
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
else
|
else
|
||||||
return(FALSE);
|
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 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 ].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 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 ) ||
|
if ( ( armsDealerInfo[ ubArmsDealer ].uiFlags & ARMS_DEALER_ONLY_USED_ITEMS ) ||
|
||||||
@@ -1383,25 +1377,6 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
|||||||
return( ubCondition);
|
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)
|
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
|
// 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.
|
// 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
|
//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;
|
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 1;
|
||||||
else
|
else
|
||||||
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 0;
|
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 0;
|
||||||
@@ -1863,7 +1838,7 @@ void GiveObjectToArmsDealerForRepair( UINT8 ubArmsDealer, OBJECTTYPE *pObject, U
|
|||||||
Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) );
|
Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) );
|
||||||
|
|
||||||
// c) Actually damaged, or a rocket rifle (being reset)
|
// 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...
|
/* ARM: Can now repair with removeable attachments still attached...
|
||||||
// d) Already stripped of all *detachable* attachments
|
// d) Already stripped of all *detachable* attachments
|
||||||
@@ -1898,7 +1873,7 @@ void GiveItemToArmsDealerforRepair( UINT8 ubArmsDealer, OBJECTTYPE* pObject, UIN
|
|||||||
|
|
||||||
Assert( DoesDealerDoRepairs( ubArmsDealer ) );
|
Assert( DoesDealerDoRepairs( ubArmsDealer ) );
|
||||||
Assert( (*pObject)[0]->data.objectStatus > 0 );
|
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
|
// figure out the earliest the repairman will be free to start repairing this item
|
||||||
uiTimeWhenFreeToStartIt = WhenWillRepairmanBeAllDoneRepairing( ubArmsDealer );
|
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
|
// 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)
|
// 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.)
|
// (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( ItemIsElectronic(usItemIndex) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
|
||||||
if( ( Item[ usItemIndex ].electronic ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
|
|
||||||
{
|
{
|
||||||
uiTimeToRepair *= 2;
|
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%
|
// resetting imprinting for a rocket rifle costs something extra even if rifle is at 100%
|
||||||
uiRepairCost += 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 )
|
// 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)
|
// 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_MICKY, usItemIndex, TRUE ) ||
|
||||||
DoesItemAppearInDealerInventoryList( ARMS_DEALER_GABBY, usItemIndex, TRUE ) ) )
|
DoesItemAppearInDealerInventoryList( ARMS_DEALER_GABBY, usItemIndex, TRUE ) ) )
|
||||||
{
|
{
|
||||||
@@ -2214,7 +2188,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
|
|||||||
{
|
{
|
||||||
// exception: Gas (Jake's)
|
// exception: Gas (Jake's)
|
||||||
// if ( usItemIndex != GAS_CAN )
|
// if ( usItemIndex != GAS_CAN )
|
||||||
if ( !Item[usItemIndex].gascan )
|
if ( !ItemIsGascan(usItemIndex))
|
||||||
{
|
{
|
||||||
// they pay only 1/3 of true value!
|
// they pay only 1/3 of true value!
|
||||||
usValueToThisDealer /= 3;
|
usValueToThisDealer /= 3;
|
||||||
@@ -2244,11 +2218,6 @@ void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer )
|
|||||||
GuaranteeAtLeastXItemsOfIndex( ubArmsDealer, ALCOHOL, ( UINT8 ) ( GetDealersMaxItemAmount( ubArmsDealer, ALCOHOL ) / 3 ) );
|
GuaranteeAtLeastXItemsOfIndex( ubArmsDealer, ALCOHOL, ( UINT8 ) ( GetDealersMaxItemAmount( ubArmsDealer, ALCOHOL ) / 3 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex )
|
|
||||||
{
|
|
||||||
return( Item[sItemIndex].fingerprintid );
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime )
|
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
|
|||||||
@@ -944,8 +944,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
|
|||||||
}
|
}
|
||||||
|
|
||||||
// items normally not sold at shops are unsuitable
|
// items normally not sold at shops are unsuitable
|
||||||
// if ( Item[ usItemIndex ].fFlags & ITEM_NOT_BUYABLE )
|
if (ItemIsNotBuyable(usItemIndex))
|
||||||
if ( Item[ usItemIndex ].notbuyable )
|
|
||||||
{
|
{
|
||||||
return(ITEM_SUITABILITY_NONE);
|
return(ITEM_SUITABILITY_NONE);
|
||||||
}
|
}
|
||||||
@@ -971,7 +970,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
|
|||||||
// case JAR:
|
// case JAR:
|
||||||
// case JAR_ELIXIR:
|
// case JAR_ELIXIR:
|
||||||
// case JAR_CREATURE_BLOOD:
|
// 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);
|
return(ITEM_SUITABILITY_ALWAYS);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
@@ -1455,8 +1454,7 @@ UINT8 GetDealerItemCategoryNumber( UINT16 usItemIndex )
|
|||||||
|
|
||||||
BOOLEAN CanDealerItemBeSoldUsed( UINT16 usItemIndex )
|
BOOLEAN CanDealerItemBeSoldUsed( UINT16 usItemIndex )
|
||||||
{
|
{
|
||||||
// if ( !( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) )
|
if ( !ItemIsDamageable(usItemIndex) )
|
||||||
if ( !( Item[ usItemIndex ].damageable ) )
|
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
|
|
||||||
// certain items, although they're damagable, shouldn't be sold in a used condition
|
// certain items, although they're damagable, shouldn't be sold in a used condition
|
||||||
|
|||||||
@@ -1274,7 +1274,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
|
|||||||
{
|
{
|
||||||
case MINES_DRAW_PLAYERTEAM_NETWORKS:
|
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 we're already marked as MINE_BOMB, switch to MINE_BOMB_AND_WIRE
|
||||||
if ( bOverlayType == MINE_BOMB )
|
if ( bOverlayType == MINE_BOMB )
|
||||||
@@ -1314,7 +1314,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
|
|||||||
|
|
||||||
case MINES_DRAW_NETWORKCOLOURING:
|
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 if wire is of the network we're searching for
|
||||||
// determine this tripwire's flag
|
// 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_C:
|
||||||
case MINES_DRAW_NET_D:
|
case MINES_DRAW_NET_D:
|
||||||
{
|
{
|
||||||
if ( Item[pObj->usItem].tripwire == 1 )
|
if (ItemIsTripwire(pObj->usItem))
|
||||||
{
|
{
|
||||||
UINT32 specificnet = 0;
|
UINT32 specificnet = 0;
|
||||||
switch ( gubDrawMode )
|
switch ( gubDrawMode )
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ BOOLEAN ApplyDrugs_New( SOLDIERTYPE *pSoldier, UINT16 usItem, UINT16 uStatusUsed
|
|||||||
gMercProfiles[pSoldier->ubProfile].ubNumTimesDrugUseInLifetime++;
|
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] );
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_CIGARETTE], pSoldier->GetName( ), ShortItemNames[usItem] );
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1950,7 +1950,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
|||||||
// check first face slot
|
// check first face slot
|
||||||
if (uiFaceItemOne != NONE)
|
if (uiFaceItemOne != NONE)
|
||||||
{
|
{
|
||||||
if (Item[uiFaceItemOne].gasmask)
|
if (ItemIsGasmask(uiFaceItemOne))
|
||||||
uiFaceItemOne = 1;
|
uiFaceItemOne = 1;
|
||||||
else if (Item[uiFaceItemOne].nightvisionrangebonus > 0)
|
else if (Item[uiFaceItemOne].nightvisionrangebonus > 0)
|
||||||
uiFaceItemOne = 2;
|
uiFaceItemOne = 2;
|
||||||
@@ -1965,7 +1965,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
|||||||
// check second face slot
|
// check second face slot
|
||||||
if (uiFaceItemTwo != NONE)
|
if (uiFaceItemTwo != NONE)
|
||||||
{
|
{
|
||||||
if (Item[uiFaceItemTwo].gasmask)
|
if (ItemIsGasmask(uiFaceItemTwo))
|
||||||
uiFaceItemTwo = 21;
|
uiFaceItemTwo = 21;
|
||||||
else if (Item[uiFaceItemTwo].nightvisionrangebonus > 0)
|
else if (Item[uiFaceItemTwo].nightvisionrangebonus > 0)
|
||||||
uiFaceItemTwo = 42;
|
uiFaceItemTwo = 42;
|
||||||
@@ -2250,7 +2250,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
|||||||
sIconIndex_Assignment = 0;
|
sIconIndex_Assignment = 0;
|
||||||
fDoIcon_Assignment = TRUE;
|
fDoIcon_Assignment = TRUE;
|
||||||
// Show repair points if merc has a toolkit in his hand. Otherwise show cleaning points.
|
// 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);
|
sPtsAvailable = CalculateRepairPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE);
|
||||||
else
|
else
|
||||||
sPtsAvailable = CalculateCleaningPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts);
|
sPtsAvailable = CalculateCleaningPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts);
|
||||||
|
|||||||
+13
-13
@@ -174,7 +174,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, UINT16 usPointsTo
|
|||||||
return( FALSE);
|
return( FALSE);
|
||||||
|
|
||||||
// workaround: canteens with 1% status are treated as 'empty'. They cannot be consumed, but refilled
|
// 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);
|
return( FALSE);
|
||||||
|
|
||||||
// do we eat or drink this stuff?
|
// 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 is TRUE, omit everything that is not a canteen
|
||||||
if ( fcanteensonly )
|
if ( fcanteensonly )
|
||||||
{
|
{
|
||||||
if ( Item[pObj->usItem].canteen == FALSE )
|
if ( !ItemIsCanteen(pObj->usItem))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -707,7 +707,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
|
|||||||
if ( foodcondition < FOOD_BAD_THRESHOLD )
|
if ( foodcondition < FOOD_BAD_THRESHOLD )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( Item[pObj->usItem].canteen == TRUE )
|
if (ItemIsCanteen(pObj->usItem))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -741,7 +741,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
|
|||||||
// if fcanteensonly is TRUE, omit everything that is not a canteen
|
// if fcanteensonly is TRUE, omit everything that is not a canteen
|
||||||
if ( fcanteensonly )
|
if ( fcanteensonly )
|
||||||
{
|
{
|
||||||
if ( Item[pObj->usItem].canteen == FALSE )
|
if (!ItemIsCanteen(pObj->usItem))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -846,7 +846,7 @@ void SectorFillCanteens( void )
|
|||||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
|
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 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 ...
|
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( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
|
||||||
{
|
{
|
||||||
// ... if Item exists and is a canteen (only those are refillable) ...
|
// ... 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 ...
|
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 ...
|
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 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 ...
|
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( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
|
||||||
{
|
{
|
||||||
// ... if Item exists and is a canteen (only those are refillable) ...
|
// ... 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 ...
|
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( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
|
||||||
{
|
{
|
||||||
// ... if Item exists and is a canteen (only those are refillable) ...
|
// ... 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 ...
|
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 ...
|
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 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 ...
|
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 ( 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
|
// empty canteens retain 1% status, so check ether something is in them
|
||||||
if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 )
|
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 ...
|
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 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 ...
|
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( ) );
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szInteractiveActionText[8], pSoldier->GetName( ) );
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-34
@@ -319,7 +319,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
|||||||
pSoldier->ubProfile != NO_PROFILE &&
|
pSoldier->ubProfile != NO_PROFILE &&
|
||||||
pTargetSoldier &&
|
pTargetSoldier &&
|
||||||
Item[usHandItem].usItemClass != IC_MEDKIT &&
|
Item[usHandItem].usItemClass != IC_MEDKIT &&
|
||||||
!Item[usHandItem].gascan &&
|
!ItemIsGascan(usHandItem) &&
|
||||||
!ItemCanBeAppliedToOthers(usHandItem) &&
|
!ItemCanBeAppliedToOthers(usHandItem) &&
|
||||||
!HasItemFlag(usHandItem, EMPTY_BLOOD_BAG) &&
|
!HasItemFlag(usHandItem, EMPTY_BLOOD_BAG) &&
|
||||||
!HasItemFlag( usHandItem, MEDICAL_SPLINT ) )
|
!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 )
|
if ( Item[ usHandItem ].usItemClass == IC_GUN || Item[ usHandItem ].usItemClass == IC_THROWING_KNIFE )
|
||||||
{
|
{
|
||||||
// WEAPONS
|
// 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));
|
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 ( Item[usHandItem].fingerprintid )
|
if (ItemHasFingerPrintID(usHandItem))
|
||||||
{
|
{
|
||||||
// check imprint ID
|
// check imprint ID
|
||||||
// NB not-imprinted value is NO_PROFILE
|
// 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...
|
// 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;
|
guiPendingOverrideEvent = A_CHANGE_TO_MOVE;
|
||||||
}
|
}
|
||||||
@@ -969,7 +969,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
|||||||
BOOLEAN fCorpse = FALSE;
|
BOOLEAN fCorpse = FALSE;
|
||||||
if(pCorpse != NULL)
|
if(pCorpse != NULL)
|
||||||
fCorpse = IsValidDecapitationCorpse( pCorpse );
|
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
|
// See if we can get there to stab
|
||||||
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
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;
|
UINT8 ubMercID;
|
||||||
BOOLEAN fVehicle = FALSE;
|
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;
|
UINT8 ubMercID;
|
||||||
INT32 sVehicleGridNo=-1;
|
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 );
|
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;
|
STRUCTURE *pStructure;
|
||||||
LEVELNODE *pIntTile;
|
LEVELNODE *pIntTile;
|
||||||
@@ -1686,7 +1686,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
|||||||
if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) )
|
if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) )
|
||||||
{
|
{
|
||||||
DeductPoints( pSoldier, sAPCost, 0 );
|
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 ) );
|
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 );
|
sAPCost = MinAPsToAttack( pSoldier, sTargetGridNo, TRUE, pSoldier->aiData.bAimTime, 0 );
|
||||||
|
|
||||||
// Check if these is room to place mortar!
|
// Check if these is room to place mortar!
|
||||||
if ( Item[usHandItem].mortar )
|
if (ItemIsMortar(usHandItem))
|
||||||
{
|
{
|
||||||
ubDirection = (UINT8)GetDirectionFromGridNo( sTargetGridNo, pSoldier );
|
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
|
//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 );
|
GetAPChargeForShootOrStabWRTGunRaises( pSoldier, sTargetGridNo, TRUE, &fAddingTurningCost, &fAddingRaiseGunCost, pSoldier->aiData.bAimTime );
|
||||||
usTurningCost = CalculateTurningCost(pSoldier, usHandItem, fAddingTurningCost);
|
usTurningCost = CalculateTurningCost(pSoldier, usHandItem, fAddingTurningCost);
|
||||||
@@ -1960,7 +1960,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
|||||||
if ( Item[ usHandItem ].ubCursor == INVALIDCURS )
|
if ( Item[ usHandItem ].ubCursor == INVALIDCURS )
|
||||||
{
|
{
|
||||||
// Found detonator...
|
// 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 );
|
StartBombMessageBox( pSoldier, sGridNo );
|
||||||
|
|
||||||
@@ -1980,7 +1980,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
|||||||
void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||||
{
|
{
|
||||||
// Does this have detonator that needs info?
|
// 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 );
|
StartBombMessageBox( pSoldier, sGridNo );
|
||||||
}
|
}
|
||||||
@@ -2003,7 +2003,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
|||||||
if ( iResult >= 0 )
|
if ( iResult >= 0 )
|
||||||
{
|
{
|
||||||
// Less explosives gain for placing tripwire
|
// Less explosives gain for placing tripwire
|
||||||
if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire )
|
if (ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem))
|
||||||
StatChange( pSoldier, EXPLODEAMT, 1, FALSE );
|
StatChange( pSoldier, EXPLODEAMT, 1, FALSE );
|
||||||
else if ( HasItemFlag( (pSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
|
else if ( HasItemFlag( (pSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
|
||||||
StatChange( pSoldier, MECHANAMT, 10, FALSE );
|
StatChange( pSoldier, MECHANAMT, 10, FALSE );
|
||||||
@@ -2027,7 +2027,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
|||||||
pSoldier->inv[ HANDPOS ][0]->data.bTrap++;
|
pSoldier->inv[ HANDPOS ][0]->data.bTrap++;
|
||||||
|
|
||||||
// anv: additional tile properties - modify trap level depending on its placement
|
// 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 );
|
ADDITIONAL_TILE_PROPERTIES_VALUES zAllTileValues = GetAllAdditonalTilePropertiesForGrid( sGridNo, pSoldier->pathing.bLevel );
|
||||||
pSoldier->inv[ HANDPOS ][0]->data.bTrap += zAllTileValues.bTrapBonus;
|
pSoldier->inv[ HANDPOS ][0]->data.bTrap += zAllTileValues.bTrapBonus;
|
||||||
@@ -2072,7 +2072,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
|||||||
StatChange( pSoldier, EXPLODEAMT, 10, FROM_FAILURE );
|
StatChange( pSoldier, EXPLODEAMT, 10, FROM_FAILURE );
|
||||||
|
|
||||||
// oops! How badly did we screw up?
|
// 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!
|
// 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 ] );
|
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 ) )
|
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...
|
// 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 );
|
gpBoobyTrapItemPool = GetItemPoolForIndex( sGridNo, iItemIndex, pSoldier->pathing.bLevel );
|
||||||
gpBoobyTrapSoldier = pSoldier;
|
gpBoobyTrapSoldier = pSoldier;
|
||||||
@@ -2998,8 +2998,7 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
|
|||||||
|
|
||||||
if ( TERRAIN_IS_WATER( bTerrainID) )
|
if ( TERRAIN_IS_WATER( bTerrainID) )
|
||||||
{
|
{
|
||||||
// if ( Item[ pObject->usItem ].fFlags & ITEM_SINKS )
|
if (ItemSinks(pObject->usItem))
|
||||||
if ( Item[ pObject->usItem ].sinks )
|
|
||||||
{
|
{
|
||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
@@ -3340,7 +3339,7 @@ BOOLEAN MarblesExistAtLocation( INT32 sGridNo, UINT8 ubLevel, INT32 * piItemInde
|
|||||||
pItemPoolTemp = pItemPool;
|
pItemPoolTemp = pItemPool;
|
||||||
while( pItemPoolTemp != NULL )
|
while( pItemPoolTemp != NULL )
|
||||||
{
|
{
|
||||||
if ( Item[gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem].marbles )
|
if (ItemIsMarbles(gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem))
|
||||||
{
|
{
|
||||||
if ( piItemIndex )
|
if ( piItemIndex )
|
||||||
{
|
{
|
||||||
@@ -5154,7 +5153,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
|
|||||||
|
|
||||||
gpTempSoldier = pSoldier;
|
gpTempSoldier = pSoldier;
|
||||||
gsTempGridNo = sGridNo;
|
gsTempGridNo = sGridNo;
|
||||||
if (Item[ pSoldier->inv[HANDPOS].usItem].remotetrigger )
|
if (ItemIsRemoteTrigger(pSoldier->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
wcscpy( gzUserDefinedButton[0], L"1" );
|
wcscpy( gzUserDefinedButton[0], L"1" );
|
||||||
wcscpy( gzUserDefinedButton[1], L"2" );
|
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 );
|
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[0], L"1-A" );
|
||||||
wcscpy( gzUserDefinedButton[1], L"1-B" );
|
wcscpy( gzUserDefinedButton[1], L"1-B" );
|
||||||
@@ -5573,10 +5572,10 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
|||||||
if (gpTempSoldier)
|
if (gpTempSoldier)
|
||||||
{
|
{
|
||||||
// sevenfm: remember last tripwire network settings
|
// sevenfm: remember last tripwire network settings
|
||||||
if(Item[ gpTempSoldier->inv[HANDPOS].usItem ].tripwire )
|
if(ItemIsTripwire(gpTempSoldier->inv[HANDPOS].usItem))
|
||||||
gubLastTripwire = ubExitValue;
|
gubLastTripwire = ubExitValue;
|
||||||
|
|
||||||
if (Item[ gpTempSoldier->inv[HANDPOS].usItem ].remotetrigger )
|
if (ItemIsRemoteTrigger(gpTempSoldier->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
// Flugente: jamming can prevent bomb activation
|
// Flugente: jamming can prevent bomb activation
|
||||||
if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() )
|
if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() )
|
||||||
@@ -5602,7 +5601,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
|||||||
if ( iResult >= 0 )
|
if ( iResult >= 0 )
|
||||||
{
|
{
|
||||||
// Less explosives gain for placing tripwire
|
// 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 );
|
StatChange( gpTempSoldier, EXPLODEAMT, 5, FALSE );
|
||||||
else if ( HasItemFlag( (gpTempSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
|
else if ( HasItemFlag( (gpTempSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
|
||||||
StatChange( gpTempSoldier, MECHANAMT, 10, FALSE );
|
StatChange( gpTempSoldier, MECHANAMT, 10, FALSE );
|
||||||
@@ -5643,7 +5642,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// we can't blow up tripwire, no matter how bad we fail
|
// 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!
|
// 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 ] );
|
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
|
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
|
// 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 );
|
AddItemToPool( gsTempGridNo, &gTempObject, BURIED, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 );
|
||||||
// sevenfm: set flag only if planting tripwire
|
// 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.
|
// shape to be usable, and doesn't break during use.
|
||||||
// Exception: land mines. You can bury them broken, they just won't blow!
|
// 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 ].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 it's still usable, check whether it breaks
|
||||||
if ( (*pObj)[0]->data.objectStatus >= USABLE)
|
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);
|
CreateItem(gTempObject[0]->data.misc.usBombItem, gTempObject[0]->data.misc.bBombStatus, &TempObject);
|
||||||
|
|
||||||
// also spawn attached guns/explosives
|
// 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
|
// search for attached items
|
||||||
OBJECTTYPE* pAttItem = NULL;
|
OBJECTTYPE* pAttItem = NULL;
|
||||||
@@ -6990,7 +6989,7 @@ INT32 FindNearestAvailableGridNoForItem( INT32 sSweetGridNo, INT8 ubRadius )
|
|||||||
|
|
||||||
BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay )
|
BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay )
|
||||||
{
|
{
|
||||||
if ( Item[pSoldier->inv[ pSoldier->ubAttackingHand ].usItem].fingerprintid )
|
if (ItemHasFingerPrintID(pSoldier->inv[ pSoldier->ubAttackingHand ].usItem))
|
||||||
{
|
{
|
||||||
// check imprint ID
|
// check imprint ID
|
||||||
// NB not-imprinted value is NO_PROFILE
|
// NB not-imprinted value is NO_PROFILE
|
||||||
@@ -7042,7 +7041,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
|
|||||||
fStealItem = FALSE;
|
fStealItem = FALSE;
|
||||||
|
|
||||||
pObject=&pOpponent->inv[i];
|
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
|
// Is the enemy collapsed
|
||||||
if ( pOpponent->stats.bLife < OKLIFE || pOpponent->bCollapsed )
|
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
|
// 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 );
|
AutoPlaceObjectInInventoryStash( &pSoldier->inv[SECONDHANDPOS], pSoldier->sGridNo, pSoldier->pathing.bLevel );
|
||||||
DeleteObj( &pSoldier->inv[SECONDHANDPOS] );
|
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 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]);
|
OBJECTTYPE* pObj = &(pSoldier->inv[slot]);
|
||||||
|
|
||||||
|
|||||||
+10
-9
@@ -2988,11 +2988,12 @@ UINT32 UIHandleCAMercShoot( UI_EVENT *pUIEvent )
|
|||||||
if ( pTSoldier != NULL )
|
if ( pTSoldier != NULL )
|
||||||
{
|
{
|
||||||
// If this is one of our own guys.....pop up requiester...
|
// 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 )
|
if ( ( pTSoldier->bTeam == gbPlayerNum || pTSoldier->bTeam == MILITIA_TEAM )
|
||||||
&& Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass != IC_MEDKIT
|
&& Item[ usItem ].usItemClass != IC_MEDKIT
|
||||||
&& !Item[pSoldier->inv[ HANDPOS ].usItem].gascan
|
&& !ItemIsGascan(usItem)
|
||||||
&& !Item[pSoldier->inv[HANDPOS].usItem].toolkit
|
&& !ItemIsToolkit(usItem)
|
||||||
&& !ItemCanBeAppliedToOthers( pSoldier->inv[ HANDPOS ].usItem )
|
&& !ItemCanBeAppliedToOthers( usItem )
|
||||||
&& gTacticalStatus.ubLastRequesterTargetID != pTSoldier->ubProfile
|
&& gTacticalStatus.ubLastRequesterTargetID != pTSoldier->ubProfile
|
||||||
&& ( pTSoldier->ubID != pSoldier->ubID ) )
|
&& ( 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?
|
// 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)
|
&& (pTSoldier->bTeam == OUR_TEAM || pTSoldier->bTeam == MILITIA_TEAM)
|
||||||
&& (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier ))
|
&& (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier ))
|
||||||
&& gGameOptions.fNewTraitSystem && pTSoldier->iHealableInjury >= 100
|
&& gGameOptions.fNewTraitSystem && pTSoldier->iHealableInjury >= 100
|
||||||
@@ -3894,7 +3895,7 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
|
|||||||
gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
|
gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
|
||||||
pSoldier->inv[HANDPOS].exists() &&
|
pSoldier->inv[HANDPOS].exists() &&
|
||||||
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
|
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
|
||||||
Item[pSoldier->inv[HANDPOS].usItem].twohanded &&
|
ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
|
||||||
bNewStance == ANIM_STAND)
|
bNewStance == ANIM_STAND)
|
||||||
{
|
{
|
||||||
ChangeScopeMode(pSoldier, NOWHERE);
|
ChangeScopeMode(pSoldier, NOWHERE);
|
||||||
@@ -3937,7 +3938,7 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
|
|||||||
gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
|
gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
|
||||||
pSoldier->inv[HANDPOS].exists() &&
|
pSoldier->inv[HANDPOS].exists() &&
|
||||||
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
|
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
|
||||||
Item[pSoldier->inv[HANDPOS].usItem].twohanded &&
|
ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
|
||||||
bNewStance == ANIM_STAND)
|
bNewStance == ANIM_STAND)
|
||||||
{
|
{
|
||||||
ChangeScopeMode(pSoldier, NOWHERE);
|
ChangeScopeMode(pSoldier, NOWHERE);
|
||||||
@@ -4628,7 +4629,7 @@ INT8 DrawUIMovementPath( SOLDIERTYPE *pSoldier, INT32 usMapPos, UINT32 uiFlags )
|
|||||||
}
|
}
|
||||||
else if ( uiFlags == MOVEUI_TARGET_BOMB )
|
else if ( uiFlags == MOVEUI_TARGET_BOMB )
|
||||||
{
|
{
|
||||||
if(Item[pSoldier->inv[HANDPOS].usItem].mine == 1)
|
if(ItemIsMine(pSoldier->inv[HANDPOS].usItem))
|
||||||
sAPCost += GetAPsToPlantMine( pSoldier );
|
sAPCost += GetAPsToPlantMine( pSoldier );
|
||||||
else
|
else
|
||||||
sAPCost += GetAPsToDropBomb( pSoldier );
|
sAPCost += GetAPsToDropBomb( pSoldier );
|
||||||
@@ -5014,7 +5015,7 @@ BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SANDRO - doctor with medical bag trying to do the surgery
|
// 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))
|
&& (pTSoldier->stats.bLife != pTSoldier->stats.bLifeMax) && (pTSoldier->iHealableInjury >= 100))
|
||||||
{
|
{
|
||||||
// should come a question first if you really want to do the surgery
|
// should come a question first if you really want to do the surgery
|
||||||
|
|||||||
+142
-142
@@ -1555,7 +1555,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// DAMAGE
|
/////////////////// 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;
|
ubRegionOffset = 1;
|
||||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + ubRegionOffset ] );
|
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + ubRegionOffset ] );
|
||||||
@@ -1698,7 +1698,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// AP TO DRAW
|
/////////////////// 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 ] );
|
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 13 ] );
|
||||||
}
|
}
|
||||||
@@ -1709,25 +1709,25 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// AP TO BURST
|
/////////////////// 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 ] );
|
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 15 ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// AP TO AUTOFIRE
|
/////////////////// 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 ] );
|
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 16 ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// AP TO RELOAD
|
/////////////////// 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 ] );
|
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 17 ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// AP TO RELOAD MANUALLY
|
/////////////////// 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 ] );
|
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 18 ] );
|
||||||
}
|
}
|
||||||
@@ -1735,7 +1735,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
/////////////////// RECOIL X/Y
|
/////////////////// RECOIL X/Y
|
||||||
if( UsingNewCTHSystem() == true )
|
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.
|
// HEADROCK HAM 5: One value to rule them all.
|
||||||
// MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 18 ] );
|
// MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 18 ] );
|
||||||
@@ -1751,7 +1751,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// BULLETS PER 5 AP
|
/////////////////// 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 ] );
|
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 21 ] );
|
||||||
}
|
}
|
||||||
@@ -2333,7 +2333,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
if (Item[ gpItemDescObject->usItem ].usItemClass & IC_ARMOUR)
|
if (Item[ gpItemDescObject->usItem ].usItemClass & IC_ARMOUR)
|
||||||
{
|
{
|
||||||
//////////////////// EXPLOSIVE RESISTANCE
|
//////////////////// EXPLOSIVE RESISTANCE
|
||||||
if (Item[ gpItemDescObject->usItem ].flakjacket)
|
if (ItemIsFlakJacket(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 5 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 5 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 5 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 5 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2432,7 +2432,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
if (Item[ gpItemDescObject->usItem ].usItemClass & IC_EXPLOSV)
|
if (Item[ gpItemDescObject->usItem ].usItemClass & IC_EXPLOSV)
|
||||||
{
|
{
|
||||||
////////////////// LOCK BOMB
|
////////////////// LOCK BOMB
|
||||||
if (Item[ gpItemDescObject->usItem ].lockbomb)
|
if (ItemIsLockBomb(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 25 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 25 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 25 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 25 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2445,7 +2445,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
// Draw stats that can be had by any item.
|
// Draw stats that can be had by any item.
|
||||||
|
|
||||||
//////////////////// WATERPROOF
|
//////////////////// WATERPROOF
|
||||||
if (!Item[ gpItemDescObject->usItem ].waterdamages)
|
if (!ItemIsDamagedByWater(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 6 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 6 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 6 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 6 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2454,7 +2454,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// ELECTRONIC
|
//////////////////// ELECTRONIC
|
||||||
if (Item[ gpItemDescObject->usItem ].electronic)
|
if (ItemIsElectronic(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 7 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 7 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 7 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 7 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2463,7 +2463,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// GAS MASK
|
//////////////////// GAS MASK
|
||||||
if (Item[ gpItemDescObject->usItem ].gasmask)
|
if (ItemIsGasmask(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 8 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 8 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 8 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 8 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2472,7 +2472,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// NEEDS BATTERIES
|
//////////////////// NEEDS BATTERIES
|
||||||
if (Item[ gpItemDescObject->usItem ].needsbatteries)
|
if (ItemNeedsBatteries(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 9 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 9 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 9 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 9 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2481,7 +2481,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// LOCKSMITH'S KIT
|
//////////////////// 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 ?
|
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 ) );
|
( 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
|
//////////////////// WIRE CUTTERS
|
||||||
if (Item[ gpItemDescObject->usItem ].wirecutters)
|
if (ItemIsWirecutters(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 11 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 11 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 11 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 11 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2500,7 +2500,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// CROWBAR
|
//////////////////// CROWBAR
|
||||||
if (Item[ gpItemDescObject->usItem ].crowbar)
|
if (ItemIsCrowbar(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s%d", szUDBGenSecondaryStatsTooltipText[ 12 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 12 ], Item[ gpItemDescObject->usItem ].CrowbarModifier );
|
swprintf( pStr, L"%s%s%d", szUDBGenSecondaryStatsTooltipText[ 12 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 12 ], Item[ gpItemDescObject->usItem ].CrowbarModifier );
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2509,7 +2509,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// METAL DETECTOR
|
//////////////////// METAL DETECTOR
|
||||||
if (Item[ gpItemDescObject->usItem ].metaldetector)
|
if (ItemIsMetalDetector(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 13 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 13 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 13 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 13 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2518,7 +2518,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// REMOTE TRIGGER
|
//////////////////// REMOTE TRIGGER
|
||||||
if (Item[ gpItemDescObject->usItem ].remotetrigger)
|
if (ItemIsRemoteTrigger(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 14 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 14 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 14 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 14 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2527,7 +2527,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// REMOTE DETONATOR
|
//////////////////// REMOTE DETONATOR
|
||||||
if (Item[ gpItemDescObject->usItem ].remotedetonator)
|
if (ItemIsRemoteDetonator(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 15 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 15 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 15 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 15 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2536,7 +2536,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// TIMER DETONATOR
|
//////////////////// TIMER DETONATOR
|
||||||
if (Item[ gpItemDescObject->usItem ].detonator)
|
if (ItemIsDetonator(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 16 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 16 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 16 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 16 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2545,7 +2545,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// GAS CAN
|
//////////////////// GAS CAN
|
||||||
if (Item[ gpItemDescObject->usItem ].gascan)
|
if (ItemIsGascan(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 17 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 17 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 17 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 17 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2554,7 +2554,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// TOOLKIT
|
//////////////////// TOOLKIT
|
||||||
if (Item[ gpItemDescObject->usItem ].toolkit)
|
if (ItemIsToolkit(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s%d", szUDBGenSecondaryStatsTooltipText[ 18 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 18 ], Item[ gpItemDescObject->usItem ].RepairModifier );
|
swprintf( pStr, L"%s%s%d", szUDBGenSecondaryStatsTooltipText[ 18 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 18 ], Item[ gpItemDescObject->usItem ].RepairModifier );
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2563,7 +2563,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// THERMAL OPTICS
|
//////////////////// THERMAL OPTICS
|
||||||
if (Item[ gpItemDescObject->usItem ].thermaloptics)
|
if (ItemIsThermalOptics(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 19 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 19 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 19 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 19 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2572,7 +2572,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// X-RAY DEVICE
|
//////////////////// X-RAY DEVICE
|
||||||
if (Item[ gpItemDescObject->usItem ].xray)
|
if (ItemHasXRay(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 20 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 20 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 20 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 20 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2581,7 +2581,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// CANTEEN
|
//////////////////// CANTEEN
|
||||||
if (Item[ gpItemDescObject->usItem ].canteen)
|
if (ItemIsCanteen(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 21 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 21 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 21 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 21 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2599,7 +2599,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// FIRST-AID KIT
|
//////////////////// FIRST-AID KIT
|
||||||
if (Item[ gpItemDescObject->usItem ].firstaidkit)
|
if (ItemIsFirstAidKit(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 23 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 23 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 23 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 23 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2608,7 +2608,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// MEDICAL KIT
|
//////////////////// MEDICAL KIT
|
||||||
if (Item[ gpItemDescObject->usItem ].medicalkit)
|
if (ItemIsMedicalKit(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 24 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 24 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 24 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 24 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2681,7 +2681,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// NOT DAMAGEABLE
|
//////////////////// NOT DAMAGEABLE
|
||||||
if ( Item[gpItemDescObject->usItem].damageable == 0 )
|
if (!ItemIsDamageable(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 32 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 32 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 32 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 32 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2690,7 +2690,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// METAL
|
//////////////////// METAL
|
||||||
if ( Item[gpItemDescObject->usItem].metal > 0 )
|
if (ItemIsMetal(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 33 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 33 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 33 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 33 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2699,7 +2699,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// SINKS
|
//////////////////// SINKS
|
||||||
if ( Item[gpItemDescObject->usItem].sinks > 0 )
|
if (ItemSinks(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 34 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 34 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 34 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 34 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2708,7 +2708,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// TWO HANDED
|
//////////////////// TWO HANDED
|
||||||
if ( Item[gpItemDescObject->usItem].twohanded > 0 )
|
if (ItemIsTwoHanded(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 35 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 35 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 35 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 35 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -2717,7 +2717,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// BLOCKS IRON SIGHTS
|
//////////////////// BLOCKS IRON SIGHTS
|
||||||
if ( Item[gpItemDescObject->usItem].blockironsight > 0 )
|
if (ItemBlocksIronsight(gpItemDescObject->usItem))
|
||||||
{
|
{
|
||||||
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 36 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 36 ]);
|
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[ 36 ], szUDBGenSecondaryStatsExplanationsTooltipText[ 36 ]);
|
||||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + cnt ]), pStr );
|
||||||
@@ -4070,7 +4070,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
|||||||
}
|
}
|
||||||
cnt++;
|
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?
|
if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // new index line here?
|
||||||
///////////////////// COOLDOWN FACTOR
|
///////////////////// COOLDOWN FACTOR
|
||||||
@@ -4366,8 +4366,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// DAMAGE
|
//////////////////// 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) ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher ) )
|
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 1;
|
ubNumLine = 1;
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 5, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
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;
|
ubNumLine = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !Item[gpItemDescObject->usItem].repairable ||
|
if ( !ItemIsRepairable(gpItemDescObject->usItem) ||
|
||||||
( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) )
|
( fComparisonMode && !ItemIsRepairable(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[ubNumLine][0].sLeft + sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
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
|
//////////////////// DRAW COST
|
||||||
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) ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem].rocketlauncher ) )
|
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 13;
|
ubNumLine = 13;
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 1, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 1, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// SINGLE SHOT COST - GUN
|
//////////////////// SINGLE SHOT COST - GUN
|
||||||
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher && !fComparisonMode ) ||
|
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) )
|
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 14;
|
ubNumLine = 14;
|
||||||
// "NO SINGLE-SHOT" ICON
|
// "NO SINGLE-SHOT" ICON
|
||||||
@@ -4565,8 +4565,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// SINGLE SHOT COST - ROCKET
|
/////////////////// SINGLE SHOT COST - ROCKET
|
||||||
if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && Item[gpItemDescObject->usItem].rocketlauncher && !fComparisonMode ) ||
|
if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && ItemIsRocketLauncher(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && Item[gpComparedItemDescObject->usItem].rocketlauncher ) )
|
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 14;
|
ubNumLine = 14;
|
||||||
// SINGLE ROCKET-LAUNCH AP ICON
|
// SINGLE ROCKET-LAUNCH AP ICON
|
||||||
@@ -4574,9 +4574,9 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// SINGLE SHOT COST - GRENADE LAUNCHER
|
/////////////////// 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 ) ||
|
&& !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 ) )
|
&& !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 14;
|
ubNumLine = 14;
|
||||||
@@ -4608,8 +4608,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// BURST COST - GUN
|
/////////////////// BURST COST - GUN
|
||||||
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) ||
|
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) )
|
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 15;
|
ubNumLine = 15;
|
||||||
// "NO BURST" ICON
|
// "NO BURST" ICON
|
||||||
@@ -4625,9 +4625,9 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
////////////////// BURST COST - GRENADE LAUNCHER
|
////////////////// 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 ) ||
|
&& 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 ) )
|
&& GetShotsPerBurst(gpItemDescObject)> 0 ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 15;
|
ubNumLine = 15;
|
||||||
@@ -4635,8 +4635,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////// AUTOFIRE COST
|
////////////////// AUTOFIRE COST
|
||||||
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) ||
|
if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpItemDescObject->usItem) ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) )
|
( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 16;
|
ubNumLine = 16;
|
||||||
// "NO-AUTO" ICON
|
// "NO-AUTO" ICON
|
||||||
@@ -4654,17 +4654,17 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
|
|
||||||
|
|
||||||
////////////////// RELOAD COST
|
////////////////// 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) ) ||
|
||||||
( 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) ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 17;
|
ubNumLine = 17;
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 2, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 2, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////// MANUAL RELOAD COST
|
////////////////// 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 ) ||
|
&& 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 ) )
|
&& Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 18;
|
ubNumLine = 18;
|
||||||
@@ -4675,9 +4675,9 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
if( UsingNewCTHSystem() == true )
|
if( UsingNewCTHSystem() == true )
|
||||||
{
|
{
|
||||||
ubNumLine = 20;
|
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 ) ) ||
|
&& ( 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 ) ) )
|
&& ( GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) ) )
|
||||||
{
|
{
|
||||||
// HEADROCK HAM 5: One value to rule them all! Line 19 left empty intentionally.
|
// 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
|
///////////////// 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 ) ||
|
&& 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 ) )
|
&& GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 21;
|
ubNumLine = 21;
|
||||||
@@ -4946,8 +4946,8 @@ void DrawExplosiveStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////// REPAIR EASE
|
////////////////// REPAIR EASE
|
||||||
if ( ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode ) ||
|
if ( ( !ItemIsRepairable(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && !Item[ gpComparedItemDescObject->usItem ].repairable ) )
|
( fComparisonMode && !ItemIsRepairable(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[11][0].sLeft + sOffsetX, gItemDescGenRegions[11][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
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
|
////////////////// REPAIR EASE
|
||||||
if ( ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode ) ||
|
if ( ( !ItemIsRepairable(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) )
|
( fComparisonMode && !ItemIsRepairable(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[3][0].sLeft + sOffsetX, gItemDescGenRegions[3][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
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++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( Item[gpItemDescObject->usItem].barrel == TRUE ) || // for barrel items
|
if( (ItemIsBarrel(gpItemDescObject->usItem)) || // for barrel items
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].barrel == TRUE ) )
|
( fComparisonMode && ItemIsBarrel(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
if ( !fDrawGenIndexes ) fDrawGenIndexes = ++cnt; // new index line here?
|
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
|
// 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 ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) )
|
||||||
{
|
{
|
||||||
if ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode ||
|
if ( !ItemIsRepairable(gpItemDescObject->usItem) && !fComparisonMode ||
|
||||||
( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) )
|
( fComparisonMode && !ItemIsRepairable(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[0][0].sLeft + sOffsetX, gItemDescGenRegions[0][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
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))
|
if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_ARMOUR))
|
||||||
{
|
{
|
||||||
////////////////// FLAK JACKET
|
////////////////// FLAK JACKET
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].flakjacket && !fComparisonMode ) ||
|
if ( (ItemIsFlakJacket(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].flakjacket ))
|
( fComparisonMode && ItemIsFlakJacket(gpComparedItemDescObject->usItem) ))
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 5, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 5, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
@@ -6162,8 +6162,8 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_EXPLOSV))
|
if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_EXPLOSV))
|
||||||
{
|
{
|
||||||
////////////////// LOCK BOMB
|
////////////////// LOCK BOMB
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].lockbomb && !fComparisonMode ) ||
|
if (( ItemIsLockBomb(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].lockbomb ) )
|
( fComparisonMode && ItemIsLockBomb(gpComparedItemDescObject->usItem) ))
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 25, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 25, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
@@ -6174,128 +6174,128 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
// Draw stats that can be had by any item.
|
// Draw stats that can be had by any item.
|
||||||
|
|
||||||
//////////////////// WATERPROOF
|
//////////////////// WATERPROOF
|
||||||
if ( ( !Item[ gpItemDescObject->usItem ].waterdamages && !fComparisonMode ) ||
|
if ( ( !ItemIsDamagedByWater(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && !Item[ gpComparedItemDescObject->usItem ].waterdamages ) )
|
( fComparisonMode && !ItemIsDamagedByWater(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 6, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 6, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// ELECTRONIC
|
//////////////////// ELECTRONIC
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].electronic && !fComparisonMode ) ||
|
if ( (ItemIsElectronic(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].electronic ) )
|
( fComparisonMode && ItemIsElectronic(gpComparedItemDescObject->usItem)) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 7, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 7, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// GAS MASK
|
//////////////////// GAS MASK
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].gasmask && !fComparisonMode ) ||
|
if ( (ItemIsGasmask(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].gasmask ) )
|
( fComparisonMode && ItemIsGasmask(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 8, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 8, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// NEEDS BATTERIES
|
//////////////////// NEEDS BATTERIES
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].needsbatteries && !fComparisonMode ) ||
|
if ( (ItemNeedsBatteries(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].needsbatteries ) )
|
( fComparisonMode && ItemNeedsBatteries(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 9, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 9, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// LOCKSMITH'S KIT
|
//////////////////// LOCKSMITH'S KIT
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].locksmithkit && !fComparisonMode ) ||
|
if ( (ItemIsLocksmithKit(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].locksmithkit ) )
|
( fComparisonMode && ItemIsLocksmithKit(gpComparedItemDescObject->usItem)) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 10, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 10, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// WIRE CUTTERS
|
//////////////////// WIRE CUTTERS
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].wirecutters && !fComparisonMode ) ||
|
if ( (ItemIsWirecutters(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].wirecutters ) )
|
( fComparisonMode && ItemIsWirecutters(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 11, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 11, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// CROWBAR
|
//////////////////// CROWBAR
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].crowbar && !fComparisonMode ) ||
|
if ( (ItemIsCrowbar(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].crowbar ) )
|
( fComparisonMode && ItemIsCrowbar(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 12, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 12, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// CROWBAR
|
//////////////////// CROWBAR
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].metaldetector && !fComparisonMode ) ||
|
if ( (ItemIsMetalDetector(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].metaldetector ) )
|
( fComparisonMode && ItemIsMetalDetector(gpComparedItemDescObject->usItem)) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 13, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 13, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// REMOTE TRIGGER
|
//////////////////// REMOTE TRIGGER
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].remotetrigger && !fComparisonMode ) ||
|
if ( (ItemIsRemoteTrigger(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].remotetrigger ) )
|
( fComparisonMode && ItemIsRemoteTrigger(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 14, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 14, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// REMOTE DETONATOR
|
//////////////////// REMOTE DETONATOR
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].remotedetonator && !fComparisonMode ) ||
|
if ( (ItemIsRemoteDetonator(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].remotedetonator ) )
|
( fComparisonMode && ItemIsRemoteDetonator(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 15, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 15, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// TIMER DETONATOR
|
//////////////////// TIMER DETONATOR
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].detonator && !fComparisonMode ) ||
|
if ( (ItemIsDetonator(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].detonator ) )
|
( fComparisonMode && ItemIsDetonator(gpComparedItemDescObject->usItem)) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 16, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 16, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// GAS CAN
|
//////////////////// GAS CAN
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].gascan && !fComparisonMode ) ||
|
if ( (ItemIsGascan(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].gascan ) )
|
( fComparisonMode && ItemIsGascan(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 17, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 17, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// TOOLKIT
|
//////////////////// TOOLKIT
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].toolkit && !fComparisonMode ) ||
|
if ( (ItemIsToolkit(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].toolkit ) )
|
( fComparisonMode && ItemIsToolkit(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 18, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 18, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// THERMAL OPTICS
|
//////////////////// THERMAL OPTICS
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].thermaloptics && !fComparisonMode ) ||
|
if ( (ItemIsThermalOptics(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].thermaloptics ) )
|
( fComparisonMode && ItemIsThermalOptics(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 19, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 19, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// X-RAY DEVICE
|
//////////////////// X-RAY DEVICE
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].xray && !fComparisonMode ) ||
|
if ( (ItemHasXRay(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].xray ) )
|
( fComparisonMode && ItemHasXRay(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 20, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 20, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// CANTEEN
|
//////////////////// CANTEEN
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].canteen && !fComparisonMode ) ||
|
if ( (ItemIsCanteen(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].canteen ) )
|
( fComparisonMode && ItemIsCanteen(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 21, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 21, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
@@ -6310,16 +6310,16 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// FIRST-AID KIT
|
//////////////////// FIRST-AID KIT
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].firstaidkit && !fComparisonMode ) ||
|
if ( (ItemIsFirstAidKit(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].firstaidkit ) )
|
( fComparisonMode && ItemIsFirstAidKit(gpComparedItemDescObject->usItem)) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 23, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 23, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// MEDICAL KIT
|
//////////////////// MEDICAL KIT
|
||||||
if ( ( Item[ gpItemDescObject->usItem ].medicalkit && !fComparisonMode ) ||
|
if ( (ItemIsMedicalKit(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].medicalkit ) )
|
( fComparisonMode && ItemIsMedicalKit(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 24, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 24, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
@@ -6389,40 +6389,40 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// NOT DAMAGEABLE
|
//////////////////// NOT DAMAGEABLE
|
||||||
if ( ( Item[gpItemDescObject->usItem].damageable == 0 && !fComparisonMode ) ||
|
if ( (!ItemIsDamageable(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].damageable == 0 ) )
|
( fComparisonMode && !ItemIsDamageable(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 31, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 31, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// METAL
|
//////////////////// METAL
|
||||||
if ( ( Item[gpItemDescObject->usItem].metal > 0 && !fComparisonMode ) ||
|
if ( (ItemIsMetal(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].metal > 0 ) )
|
( fComparisonMode && ItemIsMetal(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 32, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 32, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// SINKS
|
//////////////////// SINKS
|
||||||
if ( ( Item[gpItemDescObject->usItem].sinks > 0 && !fComparisonMode ) ||
|
if ( (ItemSinks(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].sinks > 0 ) )
|
( fComparisonMode && ItemSinks(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 33, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 33, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// TWO HANDED
|
//////////////////// TWO HANDED
|
||||||
if ( ( Item[gpItemDescObject->usItem].twohanded > 0 && !fComparisonMode ) ||
|
if ( (ItemIsTwoHanded(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].twohanded > 0 ) )
|
( fComparisonMode && ItemIsTwoHanded(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 34, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 34, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// BLOCKS IRON SIGHTS
|
//////////////////// BLOCKS IRON SIGHTS
|
||||||
if ( ( Item[gpItemDescObject->usItem].blockironsight > 0 && !fComparisonMode ) ||
|
if ( (ItemBlocksIronsight(gpItemDescObject->usItem) && !fComparisonMode ) ||
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].blockironsight > 0 ) )
|
( fComparisonMode && ItemBlocksIronsight(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 35, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 35, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||||
cnt++;
|
cnt++;
|
||||||
@@ -6822,7 +6822,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
|
|
||||||
// ShotsPer4Turns -> ubAttackAPs, used later for all shot AP values
|
// ShotsPer4Turns -> ubAttackAPs, used later for all shot AP values
|
||||||
// silversurfer: Knuckle Dusters count as bare hand attacks and use the AP_PUNCH constant.
|
// 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];
|
ubAttackAPs = APBPConstants[AP_PUNCH];
|
||||||
ubBasicAttackAPs = APBPConstants[AP_PUNCH];
|
ubBasicAttackAPs = APBPConstants[AP_PUNCH];
|
||||||
@@ -7002,7 +7002,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
DrawPropertyValueInColour( iFinalAccuracyValue, ubNumLine, 3, fComparisonMode, FALSE, TRUE, ITEMDESC_FONTPOSITIVE );
|
DrawPropertyValueInColour( iFinalAccuracyValue, ubNumLine, 3, fComparisonMode, FALSE, TRUE, ITEMDESC_FONTPOSITIVE );
|
||||||
}
|
}
|
||||||
/////////////// DAMAGE
|
/////////////// 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
|
// Set line to draw into
|
||||||
ubNumLine = 1;
|
ubNumLine = 1;
|
||||||
@@ -7060,7 +7060,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
DrawPropertyValueInColour( iComparedFinalDamageValue - iFinalDamageValue, ubNumLine, 3, fComparisonMode, FALSE, TRUE );
|
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
|
// Set line to draw into
|
||||||
ubNumLine = 1;
|
ubNumLine = 1;
|
||||||
@@ -7840,7 +7840,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Does gun have flash suppression?
|
// Does gun have flash suppression?
|
||||||
BOOLEAN iFlashValue = Item[ gpItemDescObject->usItem ].hidemuzzleflash;
|
BOOLEAN iFlashValue = ItemHasHiddenMuzzleFlash(gpItemDescObject->usItem);
|
||||||
|
|
||||||
if( !fComparisonMode )
|
if( !fComparisonMode )
|
||||||
{
|
{
|
||||||
@@ -7864,7 +7864,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
else if( IsFlashSuppressorAlt( gpComparedItemDescObject ) == TRUE )
|
else if( IsFlashSuppressorAlt( gpComparedItemDescObject ) == TRUE )
|
||||||
{
|
{
|
||||||
BOOLEAN iComparedFlashValue = Item[ gpComparedItemDescObject->usItem ].hidemuzzleflash;
|
BOOLEAN iComparedFlashValue = ItemHasHiddenMuzzleFlash(gpComparedItemDescObject->usItem);
|
||||||
if ( iFlashValue )
|
if ( iFlashValue )
|
||||||
{
|
{
|
||||||
if (iComparedFlashValue)
|
if (iComparedFlashValue)
|
||||||
@@ -7921,7 +7921,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
else
|
else
|
||||||
ubNumLine = 8;
|
ubNumLine = 8;
|
||||||
// Does gun have flash suppression?
|
// Does gun have flash suppression?
|
||||||
BOOLEAN iFlashValue = Item[ gpComparedItemDescObject->usItem ].hidemuzzleflash;
|
BOOLEAN iFlashValue = ItemHasHiddenMuzzleFlash(gpComparedItemDescObject->usItem);
|
||||||
if ( iFlashValue )
|
if ( iFlashValue )
|
||||||
{
|
{
|
||||||
// Print base value
|
// Print base value
|
||||||
@@ -8077,7 +8077,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////// DRAW AP
|
///////////////////// 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
|
// Set line to draw into
|
||||||
ubNumLine = 13;
|
ubNumLine = 13;
|
||||||
@@ -8137,7 +8137,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
DrawPropertyValueInColour( iComparedFinalDrawAPCost - iFinalDrawAPCost, ubNumLine, 3, fComparisonMode, FALSE, FALSE );
|
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;
|
ubNumLine = 13;
|
||||||
// Get final Draw Cost
|
// Get final Draw Cost
|
||||||
@@ -8376,7 +8376,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////// RELOAD AP
|
///////////////////// 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
|
// Set line to draw into
|
||||||
ubNumLine = 17;
|
ubNumLine = 17;
|
||||||
@@ -8423,7 +8423,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
// Print final value
|
// Print final value
|
||||||
DrawPropertyValueInColour( iFinalReloadAPCost, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
|
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
|
// Get final Reload Cost
|
||||||
INT16 iComparedFinalReloadAPCost = GetAPsToReload( gpComparedItemDescObject );
|
INT16 iComparedFinalReloadAPCost = GetAPsToReload( gpComparedItemDescObject );
|
||||||
@@ -8471,7 +8471,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
DrawPropertyTextInColour( L"-", ubNumLine, 3, ITEMDESC_FONTPOSITIVE );
|
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;
|
ubNumLine = 17;
|
||||||
// Get final Reload Cost
|
// Get final Reload Cost
|
||||||
@@ -8515,7 +8515,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////// MANUAL RELOAD AP
|
///////////////////// 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 )
|
&& Weapon[gpItemDescObject->usItem].APsToReloadManually > 0 )
|
||||||
{
|
{
|
||||||
// Set line to draw into
|
// Set line to draw into
|
||||||
@@ -8555,7 +8555,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
// Print final value
|
// Print final value
|
||||||
DrawPropertyValueInColour( iFinalManualReloadAPCost, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
|
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 )
|
&& Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 )
|
||||||
{
|
{
|
||||||
// Get final Manual Reload Cost
|
// Get final Manual Reload Cost
|
||||||
@@ -8597,7 +8597,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
DrawPropertyTextInColour( L"-", ubNumLine, 3, ITEMDESC_FONTPOSITIVE );
|
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 ) )
|
&& Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 18;
|
ubNumLine = 18;
|
||||||
@@ -8637,7 +8637,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
///////////////////// RECOIL X/Y
|
///////////////////// RECOIL X/Y
|
||||||
if ( UsingNewCTHSystem() == true )
|
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) )
|
&& GetShotsPerBurst(gpItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpItemDescObject) )
|
||||||
{
|
{
|
||||||
// HEADROCK HAM 5: One value to rule them all.
|
// HEADROCK HAM 5: One value to rule them all.
|
||||||
@@ -8677,7 +8677,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
// Print final value
|
// Print final value
|
||||||
DrawPropertyValueInColourFloat( dFinalRecoil, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE, 1.0f );
|
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) )
|
&& GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) )
|
||||||
{
|
{
|
||||||
FLOAT iComparedFinalRecoilX = 0;
|
FLOAT iComparedFinalRecoilX = 0;
|
||||||
@@ -8775,7 +8775,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
SetFontForeground( 6 );
|
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) ) )
|
&& GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -8848,7 +8848,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
// Print final value
|
// Print final value
|
||||||
DrawPropertyValueInColour( iFinalBurstValue, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
|
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
|
// Get base Burst Penalty value
|
||||||
INT16 iComparedBurstValue = Weapon[gpComparedItemDescObject->usItem].ubBurstPenalty * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1);
|
INT16 iComparedBurstValue = Weapon[gpComparedItemDescObject->usItem].ubBurstPenalty * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1);
|
||||||
@@ -8961,7 +8961,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// AUTOFIRE BULLETS PER 5 AP
|
/////////////////// 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 )
|
&& GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 )
|
||||||
{
|
{
|
||||||
// Set line to draw into
|
// Set line to draw into
|
||||||
@@ -8982,7 +8982,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
// Print final value
|
// Print final value
|
||||||
DrawPropertyValueInColour( iFinalB5AP, ubNumLine, 3, fComparisonMode, FALSE, TRUE, FONT_MCOLOR_WHITE );
|
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 )
|
&& GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 )
|
||||||
{
|
{
|
||||||
// Get final B/5AP
|
// Get final B/5AP
|
||||||
@@ -9003,7 +9003,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
DrawPropertyTextInColour( L"-", ubNumLine, 3, ITEMDESC_FONTNEGATIVE );
|
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 ) )
|
&& GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) )
|
||||||
{
|
{
|
||||||
ubNumLine = 21;
|
ubNumLine = 21;
|
||||||
@@ -9054,7 +9054,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
|||||||
// Print final value
|
// Print final value
|
||||||
DrawPropertyValueInColour( iFinalAutoValue, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
|
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 )
|
&& GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 )
|
||||||
{
|
{
|
||||||
// Get base Auto Penalty value
|
// Get base Auto Penalty value
|
||||||
@@ -13805,8 +13805,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
|
|||||||
cnt++;
|
cnt++;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ( ( Item[gpItemDescObject->usItem].barrel == TRUE ) || // display for barrel items
|
else if ( (ItemIsBarrel(gpItemDescObject->usItem)) || // display for barrel items
|
||||||
( fComparisonMode && Item[gpComparedItemDescObject->usItem].barrel == TRUE ) )
|
( fComparisonMode && ItemIsBarrel(gpComparedItemDescObject->usItem) ) )
|
||||||
{
|
{
|
||||||
if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // insert Indexes here?
|
if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // insert Indexes here?
|
||||||
///////////////////// COOLDOWN FACTOR
|
///////////////////// COOLDOWN FACTOR
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ INT16 ITEMDESC_DONE_Y;
|
|||||||
#define DOTDOTDOT L"..."
|
#define DOTDOTDOT L"..."
|
||||||
#define COMMA_AND_SPACE 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_STATUS_WIDTH 2
|
||||||
#define ITEMDESC_ITEM_WIDTH 117
|
#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 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
|
// CHRISL: Change coords for STI that covers 2nd hand location when carrying a 2handed weapon
|
||||||
if( guiCurrentItemDescriptionScreen != MAP_SCREEN )
|
if( guiCurrentItemDescriptionScreen != MAP_SCREEN )
|
||||||
@@ -2710,7 +2710,7 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
|
|||||||
fHatchItOut = TRUE;
|
fHatchItOut = TRUE;
|
||||||
}
|
}
|
||||||
// CHRISL: Don't hatch second hand position if we're holding a two handed item
|
// 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;
|
fHatchItOut = FALSE;
|
||||||
}
|
}
|
||||||
@@ -2832,8 +2832,8 @@ BOOLEAN CompatibleItemForApplyingOnMerc(OBJECTTYPE *pTestObject)
|
|||||||
|
|
||||||
|
|
||||||
//Shadooow: rewritten to use new item flags and check canteen not empty
|
//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 ||
|
if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || ItemIsCamoKit(usItem) || usItem == JAR_ELIXIR ||
|
||||||
Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!Item[usItem].canteen || (*pTestObject)[0]->data.objectStatus > 1))
|
Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!ItemIsCanteen(usItem) || (*pTestObject)[0]->data.objectStatus > 1))
|
||||||
{
|
{
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
@@ -3010,14 +3010,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapScreen( SOLDIERTYPE *pSoldier, INT32 bInvPos
|
|||||||
|
|
||||||
UINT32 invsize = pSoldier->inv.size();
|
UINT32 invsize = pSoldier->inv.size();
|
||||||
// First test attachments, which almost any type of item can have....
|
// 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 )
|
for ( cnt = 0; cnt < invsize; ++cnt )
|
||||||
{
|
{
|
||||||
pObject = &(pSoldier->inv[ cnt ]);
|
pObject = &(pSoldier->inv[ cnt ]);
|
||||||
|
|
||||||
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
|
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
|
||||||
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
|
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
|
||||||
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
|
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
|
||||||
{
|
{
|
||||||
// don't consider for UI purposes
|
// 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....
|
// 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)
|
for (cnt = 0; cnt < MAP_INVENTORY_POOL_SLOT_COUNT; ++cnt)
|
||||||
{
|
{
|
||||||
pObject = &(pInventoryPoolList[iStartSlotNumber + cnt].object);
|
pObject = &(pInventoryPoolList[iStartSlotNumber + cnt].object);
|
||||||
|
|
||||||
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
|
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
|
||||||
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
|
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
|
||||||
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
|
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
|
||||||
{
|
{
|
||||||
// don't consider for UI purposes
|
// don't consider for UI purposes
|
||||||
@@ -3270,14 +3270,14 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
|
|||||||
|
|
||||||
UINT32 invsize = pSoldier->inv.size();
|
UINT32 invsize = pSoldier->inv.size();
|
||||||
// First test attachments, which almost any type of item can have....
|
// 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)
|
for (cnt = 0; cnt < invsize; ++cnt)
|
||||||
{
|
{
|
||||||
pObject = &(pSoldier->inv[cnt]);
|
pObject = &(pSoldier->inv[cnt]);
|
||||||
|
|
||||||
if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
|
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) &&
|
||||||
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
|
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) &&
|
||||||
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
|
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
|
||||||
{
|
{
|
||||||
// don't consider for UI purposes
|
// 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 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 ) )
|
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;
|
sNewY = sY + sHeight - 10;
|
||||||
sNewX = sX + 1;
|
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,
|
SetRGBFontForeground( AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].red,
|
||||||
AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].green,
|
AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].green,
|
||||||
@@ -3950,7 +3950,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Flugente: overheating
|
// 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;
|
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 ) ||
|
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 )
|
pSoldier->usGLDelayMode )
|
||||||
{
|
{
|
||||||
wcscat( pStr, New113Message[MSG113_FIREMODE_GL_DELAYED] );
|
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] ) &&
|
if ( pSoldier && pObject == &(pSoldier->inv[SECONDHANDPOS] ) &&
|
||||||
(pSoldier->bWeaponMode == WM_BURST || pSoldier->bWeaponMode == WM_AUTOFIRE) &&
|
(pSoldier->bWeaponMode == WM_BURST || pSoldier->bWeaponMode == WM_AUTOFIRE) &&
|
||||||
Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN &&
|
Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN &&
|
||||||
!(Item[ pSoldier->inv[HANDPOS ].usItem ].twohanded ) &&
|
!ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) &&
|
||||||
pSoldier->IsValidSecondHandBurst() )
|
pSoldier->IsValidSecondHandBurst() )
|
||||||
{
|
{
|
||||||
sNewY = sY + 13; // rather arbitrary
|
sNewY = sY + 13; // rather arbitrary
|
||||||
@@ -4565,7 +4565,7 @@ void MAPINVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pOb
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// GUN DATA //////////////////
|
//////////////////// GUN DATA //////////////////
|
||||||
if ( pItem->usItemClass & IC_GUN && !Item[pObject->usItem].rocketlauncher )
|
if ( pItem->usItemClass & IC_GUN && !ItemIsRocketLauncher(pObject->usItem) )
|
||||||
{
|
{
|
||||||
//////////////// AMMO REMAINING
|
//////////////// AMMO REMAINING
|
||||||
|
|
||||||
@@ -4804,7 +4804,7 @@ void MAPINVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pOb
|
|||||||
}
|
}
|
||||||
|
|
||||||
iCurAsterisk = ATTACHMENT_GENERAL;
|
iCurAsterisk = ATTACHMENT_GENERAL;
|
||||||
if (Item[iter->usItem].grenadelauncher )
|
if (ItemIsGrenadeLauncher(iter->usItem))
|
||||||
{
|
{
|
||||||
//iCurAsterisk = ATTACHMENT_GL;
|
//iCurAsterisk = ATTACHMENT_GL;
|
||||||
uiNumAttachmentsGL++;
|
uiNumAttachmentsGL++;
|
||||||
@@ -5233,7 +5233,7 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add ammo eject button for GUN type objects.
|
// 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 )
|
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 ].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(
|
SetUpFastHelpListRegions(
|
||||||
gItemDescHelpText.iXPosition,
|
gItemDescHelpText.iXPosition,
|
||||||
@@ -5750,7 +5750,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
|
|||||||
if (Item[usLoop].nasAttachmentClass & AttachmentSlots[usLoopSlotID].nasAttachmentClass && IsAttachmentPointAvailable(point, usLoop, TRUE))
|
if (Item[usLoop].nasAttachmentClass & AttachmentSlots[usLoopSlotID].nasAttachmentClass && IsAttachmentPointAvailable(point, usLoop, TRUE))
|
||||||
{
|
{
|
||||||
usAttachment = usLoop;
|
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())
|
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())
|
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())
|
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++){
|
for(UINT16 loop = 0; loop < attachList.size(); loop++){
|
||||||
usAttachment = attachList[loop];
|
usAttachment = attachList[loop];
|
||||||
// If the attachment is not hidden
|
// 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)
|
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.
|
//WarmSteel - This hatches out attachment slots one by one, instead of all of em.
|
||||||
for(cnt = 0; cnt < (INT32)(*gpItemDescObject)[gubItemDescStatusIndex]->attachments.size(); cnt++)
|
for(cnt = 0; cnt < (INT32)(*gpItemDescObject)[gubItemDescStatusIndex]->attachments.size(); cnt++)
|
||||||
{
|
{
|
||||||
//if ( ( Item[ gpItemPointer->usItem ].fFlags & ITEM_HIDDEN_ADDON ) ||
|
if (ItemIsHiddenAddon(gpItemPointer->usItem) ||
|
||||||
if ( ( Item[ gpItemPointer->usItem ].hiddenaddon ) ||
|
|
||||||
|
|
||||||
( !ValidItemAttachmentSlot( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, cnt, FALSE, NULL, usAttachmentSlotIndexVector) &&
|
( !ValidItemAttachmentSlot( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, cnt, FALSE, NULL, usAttachmentSlotIndexVector) &&
|
||||||
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
|
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
|
||||||
@@ -7038,8 +7037,7 @@ void RenderItemDescriptionBox( )
|
|||||||
} else {
|
} else {
|
||||||
for(cnt = 0; cnt < OLD_MAX_ATTACHMENTS_101; cnt++)
|
for(cnt = 0; cnt < OLD_MAX_ATTACHMENTS_101; cnt++)
|
||||||
{
|
{
|
||||||
//if ( ( Item[ gpItemPointer->usItem ].fFlags & ITEM_HIDDEN_ADDON ) ||
|
if (ItemIsHiddenAddon(gpItemPointer->usItem) ||
|
||||||
if ( ( Item[ gpItemPointer->usItem ].hiddenaddon ) ||
|
|
||||||
|
|
||||||
( !ValidItemAttachment( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, usAttachmentSlotIndexVector) &&
|
( !ValidItemAttachment( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, usAttachmentSlotIndexVector) &&
|
||||||
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) && !ValidLaunchable( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
|
!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 );
|
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
|
// 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));
|
FLOAT overheatjampercentage = GetGunOverheatDisplayPercentage( &(*iter));
|
||||||
|
|
||||||
@@ -7219,7 +7217,7 @@ void RenderItemDescriptionBox( )
|
|||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
SetFontShadow( ITEMDESC_FONTSHADOW2 );
|
SetFontShadow( ITEMDESC_FONTSHADOW2 );
|
||||||
// Caliber
|
// Caliber
|
||||||
if ( (Item[gpItemDescObject->usItem].fingerprintid ) && (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID < NO_PROFILE )
|
if ( ItemHasFingerPrintID(gpItemDescObject->usItem) && (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID < NO_PROFILE )
|
||||||
{
|
{
|
||||||
// Fingerprint ID
|
// Fingerprint ID
|
||||||
swprintf( pStr, L"%s %s (%s)", AmmoCaliber[ Weapon[ gpItemDescObject->usItem ].ubCalibre ], WeaponType[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ], gMercProfiles[ (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID ].zNickname );
|
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
|
// 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.
|
// UDB system displays a string with colored condition text.
|
||||||
int regionindex = 8;
|
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);
|
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 );
|
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
|
// DAMAGE
|
||||||
SetFontForeground( 6 );
|
SetFontForeground( 6 );
|
||||||
@@ -8365,7 +8363,7 @@ void DeleteItemDescriptionBox( )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && ValidLaunchable(newIter->usItem, gpItemDescObject->usItem) ||
|
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
|
//lalien: changed to charge AP's for reloading a GL/RL
|
||||||
ubAPCost = GetAPsToReload(gpItemDescObject);
|
ubAPCost = GetAPsToReload(gpItemDescObject);
|
||||||
@@ -10712,7 +10710,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
else
|
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 );
|
EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos );
|
||||||
InternalMAPBeginItemPointer( gpItemPopupSoldier );
|
InternalMAPBeginItemPointer( gpItemPopupSoldier );
|
||||||
@@ -10723,7 +10721,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
else
|
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 );
|
EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos );
|
||||||
gpItemPointer = &gItemPointer;
|
gpItemPointer = &gItemPointer;
|
||||||
@@ -12629,7 +12627,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
|||||||
|
|
||||||
|
|
||||||
// Fingerprint ID (Soldier Name)
|
// 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];
|
CHAR16 pStr2[20];
|
||||||
swprintf( pStr2, L" [%s]", gMercProfiles[ (*pObject)[subObject]->data.ubImprintID ].zNickname );
|
swprintf( pStr2, L" [%s]", gMercProfiles[ (*pObject)[subObject]->data.ubImprintID ].zNickname );
|
||||||
@@ -13816,7 +13814,7 @@ void BombInventoryMessageBoxCallBack( UINT8 ubExitValue )
|
|||||||
if (gpItemDescSoldier)
|
if (gpItemDescSoldier)
|
||||||
{
|
{
|
||||||
// no planting tripwire in our inventory...
|
// no planting tripwire in our inventory...
|
||||||
if ( Item[ gpItemDescObject->usItem ].tripwire == 1 )
|
if (ItemIsTripwire(gpItemDescObject->usItem))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
INT32 iResult;
|
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 ) )
|
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
|
// 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
|
// + 10 if item gets activated by tripwire
|
||||||
if ( Item[gpItemDescObject->usItem].tripwireactivation == 1 )
|
if (ItemHasTripwireActivation(gpItemDescObject->usItem))
|
||||||
diff += 10;
|
diff += 10;
|
||||||
|
|
||||||
// + 10 if item is tripwire
|
// + 10 if item is tripwire
|
||||||
if ( Item[gpItemDescObject->usItem].tripwire == 1 )
|
if (ItemIsTripwire(gpItemDescObject->usItem))
|
||||||
diff += 10;
|
diff += 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3373,7 +3373,7 @@ BOOLEAN HandleNailsVestFetish( SOLDIERTYPE *pSoldier, UINT32 uiHandPos, UINT16 u
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Do we have nothing or the leather vest or kevlar leather vest?
|
// Do we have nothing or the leather vest or kevlar leather vest?
|
||||||
if ( Item[usReplaceItem].leatherjacket ||
|
if (ItemIsLeatherJacket(usReplaceItem) ||
|
||||||
usReplaceItem == COMPOUND18 ||
|
usReplaceItem == COMPOUND18 ||
|
||||||
usReplaceItem == JAR_QUEEN_CREATURE_BLOOD )
|
usReplaceItem == JAR_QUEEN_CREATURE_BLOOD )
|
||||||
{
|
{
|
||||||
@@ -4044,7 +4044,7 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
{
|
{
|
||||||
if ( !InItemDescriptionBox( ) )
|
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 );
|
EmptyWeaponMagazine( &(gpSMCurrentMerc->inv[ uiHandPos ]), &gItemPointer, uiHandPos );
|
||||||
gpItemPointer = &gItemPointer;
|
gpItemPointer = &gItemPointer;
|
||||||
@@ -7096,22 +7096,23 @@ void CheckForAndAddMercToTeamPanel( SOLDIERTYPE *pSoldier )
|
|||||||
void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
|
void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
|
||||||
{
|
{
|
||||||
INT16 bMaxPoints;
|
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;
|
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
|
else
|
||||||
{
|
{
|
||||||
bMaxPoints = 100;
|
bMaxPoints = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pCursorObj && pCursorObj->usItem == pObj->usItem )
|
if ( pCursorObj && pCursorObj->usItem == usItem )
|
||||||
{
|
{
|
||||||
DistributeStatus(pCursorObj, pObj, bMaxPoints);
|
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
|
// 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 ( pObj->ubNumberOfObjects > 1 )
|
||||||
{
|
{
|
||||||
if ( Item[pObj->usItem].usItemClass & IC_AMMO )
|
if ( Item[usItem].usItemClass & IC_AMMO )
|
||||||
{
|
{
|
||||||
UINT16 shots_first = (*pObj)[0]->data.ubShotsLeft;
|
UINT16 shots_first = (*pObj)[0]->data.ubShotsLeft;
|
||||||
(*pObj)[0]->data.ubShotsLeft = (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft;
|
(*pObj)[0]->data.ubShotsLeft = (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft;
|
||||||
(*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft = shots_first;
|
(*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;
|
INT16 status_first = (*pObj)[0]->data.objectStatus;
|
||||||
(*pObj)[0]->data.objectStatus = (*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus;
|
(*pObj)[0]->data.objectStatus = (*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus;
|
||||||
|
|||||||
@@ -978,12 +978,12 @@ void PopupMovementMenu( UI_EVENT *pUIEvent )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( Item[pSoldier->inv[ HANDPOS ].usItem].toolkit )
|
if (ItemIsToolkit(pSoldier->inv[ HANDPOS ].usItem))
|
||||||
{
|
{
|
||||||
uiActionImages = TOOLKITACTIONC_IMAGES;
|
uiActionImages = TOOLKITACTIONC_IMAGES;
|
||||||
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
|
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
|
||||||
}
|
}
|
||||||
else if ( Item[pSoldier->inv[ HANDPOS ].usItem].wirecutters )
|
else if (ItemIsWirecutters(pSoldier->inv[ HANDPOS ].usItem))
|
||||||
{
|
{
|
||||||
uiActionImages = WIRECUTACTIONC_IMAGES;
|
uiActionImages = WIRECUTACTIONC_IMAGES;
|
||||||
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
|
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
|
||||||
@@ -6043,7 +6043,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // show general name
|
{ // show general name
|
||||||
if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask )
|
if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem))
|
||||||
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
|
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
|
||||||
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
|
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
|
||||||
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
|
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
|
||||||
@@ -6059,7 +6059,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // show general name
|
{ // show general name
|
||||||
if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask )
|
if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem))
|
||||||
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
|
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
|
||||||
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
|
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
|
||||||
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
|
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
|
||||||
|
|||||||
@@ -738,7 +738,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
|
|||||||
switch( Item[ pItem->usItem ].usItemClass )
|
switch( Item[ pItem->usItem ].usItemClass )
|
||||||
{
|
{
|
||||||
case IC_GUN:
|
case IC_GUN:
|
||||||
if ( !Item[pItem->usItem].rocketlauncher )
|
if ( !ItemIsRocketLauncher(pItem->usItem) )
|
||||||
{
|
{
|
||||||
bWeaponClass *= -1;
|
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.ubGunAmmoType = Magazine[Item[usAmmoIndex].ubClassIndex].ubAmmoType;
|
||||||
pp->Inv[ i ][0]->data.gun.usGunAmmoItem = usAmmoIndex;
|
pp->Inv[ i ][0]->data.gun.usGunAmmoItem = usAmmoIndex;
|
||||||
|
|
||||||
if ( Item[usGunIndex].fingerprintid )
|
if (ItemHasFingerPrintID(usGunIndex))
|
||||||
{
|
{
|
||||||
pp->Inv[ i ][0]->data.ubImprintID = (NO_PROFILE + 1);
|
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;
|
pp->Inv[ HANDPOS ].fFlags |= OBJECT_UNDROPPABLE;
|
||||||
|
|
||||||
// Rocket Rifles must come pre-imprinted, in case carrier gets killed without getting a shot off
|
// 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);
|
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;
|
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 )
|
if ( bSoldierClass == SOLDIER_CLASS_NONE )
|
||||||
{
|
{
|
||||||
@@ -3528,7 +3528,7 @@ UINT32 ItemFitness( OBJECTTYPE* pObj, UINT8 idx )
|
|||||||
}
|
}
|
||||||
else if ( Item[ pObj->usItem ].usItemClass & IC_FACE )
|
else if ( Item[ pObj->usItem ].usItemClass & IC_FACE )
|
||||||
{
|
{
|
||||||
if ( Item[ pObj->usItem ].gasmask )
|
if (ItemIsGasmask(pObj->usItem))
|
||||||
value = (*pObj)[idx]->data.objectStatus;
|
value = (*pObj)[idx]->data.objectStatus;
|
||||||
else if ( Item[ pObj->usItem ].hearingrangebonus )
|
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) )
|
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
|
// 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] );
|
EvaluateObjForItem( pWorldItem, pObj, uiCount, &si[SI_GASMASK] );
|
||||||
else if ( Item[ pWorldItem[ uiCount ].object.usItem ].nightvisionrangebonus > 0 )
|
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() )
|
if ( fnd == launcherhelpmap.end() )
|
||||||
{
|
{
|
||||||
LauncherHelpStruct tmp;
|
LauncherHelpStruct tmp;
|
||||||
tmp.fNeedsAmmo = !Item[pWorldItem[ uiCount ].object.usItem].singleshotrocketlauncher;
|
tmp.fNeedsAmmo = !ItemIsSingleShotRocketLauncher(pWorldItem[ uiCount ].object.usItem);
|
||||||
launcherhelpmap[ pWorldItem[ uiCount ].object.usItem ] = tmp;
|
launcherhelpmap[ pWorldItem[ uiCount ].object.usItem ] = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1595,7 +1595,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
|
|||||||
}
|
}
|
||||||
else if ( EXPLOSIVE_GUN( this->usItem ) )
|
else if ( EXPLOSIVE_GUN( this->usItem ) )
|
||||||
{
|
{
|
||||||
if ( Item[this->usItem].singleshotrocketlauncher )
|
if (ItemIsSingleShotRocketLauncher(this->usItem))
|
||||||
{
|
{
|
||||||
(*this)[0]->data.gun.ubGunShotsLeft = 1;
|
(*this)[0]->data.gun.ubGunShotsLeft = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
+213
-250
@@ -779,6 +779,98 @@ extern OBJECTTYPE gTempObject;
|
|||||||
// extended flagmask to UINT64
|
// extended flagmask to UINT64
|
||||||
#define EMPTY_BLOOD_BAG 0x0000000100000000 // this item is a empty blood bag
|
#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 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,
|
// autofiretohitbonus,
|
||||||
// bursttohitbonus
|
// bursttohitbonus
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
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 szItemDesc[400];
|
||||||
CHAR16 szBRName[80];
|
|
||||||
CHAR16 szBRDesc[400];
|
CHAR16 szBRDesc[400];
|
||||||
|
CHAR16 szItemName[80]; //+1 for the null terminator //added
|
||||||
//TODO: quest items, boosters, money
|
CHAR16 szLongItemName[80];
|
||||||
|
CHAR16 szBRName[80];
|
||||||
// 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
|
|
||||||
|
|
||||||
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)
|
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
|
//zilpin: pellet spread patterns externalized in XML
|
||||||
INT32 spreadPattern;
|
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.
|
// HEADROCK HAM 4: New variable arrays for the New CTH system.
|
||||||
INT16 flatbasemodifier[3];
|
INT16 flatbasemodifier[3];
|
||||||
INT16 percentbasemodifier[3];
|
INT16 percentbasemodifier[3];
|
||||||
@@ -1113,115 +1093,98 @@ typedef struct
|
|||||||
INT16 counterforceaccuracymodifier[3];
|
INT16 counterforceaccuracymodifier[3];
|
||||||
INT16 targettrackingmodifier[3];
|
INT16 targettrackingmodifier[3];
|
||||||
INT16 aimlevelsmodifier[3];
|
INT16 aimlevelsmodifier[3];
|
||||||
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
|
|
||||||
// subjectively.
|
//Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method
|
||||||
FLOAT RecoilModifierX;
|
UINT16 ubClassIndex;
|
||||||
FLOAT RecoilModifierY;
|
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 PercentRecoilModifier;
|
||||||
INT16 percentaccuracymodifier;
|
INT16 percentaccuracymodifier;
|
||||||
FLOAT scopemagfactor;
|
INT16 usSpotting; // Flugente: spotting effectiveness
|
||||||
FLOAT projectionfactor;
|
INT16 sBackpackWeightModifier; // JMich: BackpackClimb modifier to weight calculation to climb.
|
||||||
BOOLEAN speeddot;
|
INT16 sFireResistance;
|
||||||
|
|
||||||
// Flugente
|
UINT8 ubAttachToPointAPCost; // cost to attach to any matching point
|
||||||
BOOLEAN barrel; // item can be used on some guns as an exchange barrel
|
UINT8 ubCursor;
|
||||||
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
|
UINT8 ubGraphicType;
|
||||||
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
|
UINT8 ubPerPocket;
|
||||||
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
|
UINT8 ubCoolness;
|
||||||
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
|
UINT8 percenttunnelvision;
|
||||||
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
|
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
|
INT8 bSoundType;
|
||||||
|
INT8 bReliability;
|
||||||
BOOLEAN tripwireactivation; // item (mine) can be activated by nearby tripwire
|
INT8 bRepairEase;
|
||||||
BOOLEAN tripwire; // item is tripwire
|
INT8 LockPickModifier;
|
||||||
BOOLEAN directional; // item is a directional mine/bomb (actual direction is set upon planting)
|
INT8 RepairModifier;
|
||||||
|
INT8 randomitemcoolnessmodificator; // Flugente: a link to RandomItemsClass.xml. alters the allowed maximum coolness a random item can have
|
||||||
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
|
INT8 bRobotStrBonus; // rftr: robot attachments
|
||||||
|
INT8 bRobotAgiBonus; // rftr: robot attachments
|
||||||
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)
|
INT8 bRobotDexBonus; // rftr: robot attachments
|
||||||
|
INT8 bRobotTargetingSkillGrant; // rftr: robot attachments
|
||||||
UINT64 usItemFlag; // bitflags to store various item properties (better than introducing 32 BOOLEAN values). If I only had thought of this earlier....
|
INT8 bRobotChassisSkillGrant; // rftr: robot attachments
|
||||||
|
INT8 bRobotUtilitySkillGrant; // rftr: robot attachments
|
||||||
// Flugente: food type
|
INT8 iTransportGroupMinProgress; // rftr: the progress bounds that allow a transport group to drop an item
|
||||||
UINT32 foodtype;
|
INT8 iTransportGroupMaxProgress; // rftr: the progress bounds that allow a transport group to drop an item
|
||||||
|
|
||||||
//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;
|
|
||||||
} INVTYPE;
|
} INVTYPE;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+228
-164
File diff suppressed because it is too large
Load Diff
+74
-4
@@ -179,8 +179,78 @@ BOOLEAN ValidAttachmentClass( UINT16 usAttachment, UINT16 usItem );
|
|||||||
//Determines if it is possible to equip this weapon with this ammo.
|
//Determines if it is possible to equip this weapon with this ammo.
|
||||||
BOOLEAN ValidAmmoType( UINT16 usItem, UINT16 usAmmoType );
|
BOOLEAN ValidAmmoType( UINT16 usItem, UINT16 usAmmoType );
|
||||||
|
|
||||||
//Determines if this item is a two handed item.
|
BOOLEAN ItemIsDamageable(UINT16 usItem);
|
||||||
BOOLEAN TwoHandedItem( 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
|
//Existing functions without header def's, added them here, just incase I'll need to call
|
||||||
//them from the editor.
|
//them from the editor.
|
||||||
@@ -222,7 +292,6 @@ UINT8 ConvertObjectTypeMoneyValueToProfileMoneyValue( UINT32 uiMoneyAmount );
|
|||||||
BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround );
|
BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround );
|
||||||
|
|
||||||
BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness = FALSE );
|
BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness = FALSE );
|
||||||
BOOLEAN ExtendedGunListGun( UINT16 usGun );
|
|
||||||
UINT16 StandardGunListReplacement( UINT16 usGun );
|
UINT16 StandardGunListReplacement( UINT16 usGun );
|
||||||
UINT16 FindReplacementMagazine( UINT8 ubCalibre, UINT16 ubMagSize, UINT8 ubAmmoType);
|
UINT16 FindReplacementMagazine( UINT8 ubCalibre, UINT16 ubMagSize, UINT8 ubAmmoType);
|
||||||
UINT16 FindReplacementMagazineIfNecessary( UINT16 usOldGun, UINT16 usOldAmmo, UINT16 usNewGun );
|
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 );
|
void CheckBombSpecifics( OBJECTTYPE * pObj, INT8* detonatortype, INT8* setting, INT8* defusefrequency );
|
||||||
|
|
||||||
// Flugente: check for specific flags
|
// 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
|
// Flugente: get first item number that has this flag. Use with caution, as we search in all items
|
||||||
BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag );
|
BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag );
|
||||||
|
|||||||
+16
-16
@@ -4840,15 +4840,15 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
|
|||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_KNIFE;
|
usBulletFlags |= BULLET_FLAG_KNIFE;
|
||||||
}
|
}
|
||||||
else if ( Item[usHandItem].rocketlauncher )
|
else if (ItemIsRocketLauncher(usHandItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_MISSILE;
|
usBulletFlags |= BULLET_FLAG_MISSILE;
|
||||||
}
|
}
|
||||||
else if ( Item[usHandItem].cannon )
|
else if (ItemIsCannon(usHandItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
||||||
}
|
}
|
||||||
else if ( Item[usHandItem].rocketrifle )
|
else if (ItemIsRocketRifle(usHandItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
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 ) )
|
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
|
||||||
{
|
{
|
||||||
// another shot fired
|
// 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++;
|
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
|
||||||
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
|
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
|
||||||
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
|
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
|
||||||
@@ -5335,15 +5335,15 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
|||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_KNIFE;
|
usBulletFlags |= BULLET_FLAG_KNIFE;
|
||||||
}
|
}
|
||||||
else if ( Item[usHandItem].rocketlauncher )
|
else if (ItemIsRocketLauncher(usHandItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_MISSILE;
|
usBulletFlags |= BULLET_FLAG_MISSILE;
|
||||||
}
|
}
|
||||||
else if ( Item[usHandItem].cannon )
|
else if (ItemIsCannon(usHandItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
||||||
}
|
}
|
||||||
else if ( Item[usHandItem].rocketrifle )
|
else if (ItemIsRocketRifle(usHandItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
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 ) )
|
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
|
||||||
{
|
{
|
||||||
// another shot fired
|
// 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++;
|
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
|
||||||
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
|
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
|
||||||
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
|
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
|
||||||
@@ -6007,15 +6007,15 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
|
|||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_KNIFE;
|
usBulletFlags |= BULLET_FLAG_KNIFE;
|
||||||
}
|
}
|
||||||
else if ( Item[usItem].rocketlauncher )
|
else if (ItemIsRocketLauncher(usItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_MISSILE;
|
usBulletFlags |= BULLET_FLAG_MISSILE;
|
||||||
}
|
}
|
||||||
else if ( Item[usItem].cannon )
|
else if (ItemIsCannon(usItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
||||||
}
|
}
|
||||||
else if ( Item[usItem].rocketrifle )
|
else if (ItemIsRocketRifle(usItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
||||||
}
|
}
|
||||||
@@ -6594,15 +6594,15 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN
|
|||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_KNIFE;
|
usBulletFlags |= BULLET_FLAG_KNIFE;
|
||||||
}
|
}
|
||||||
else if ( Item[usItem].rocketlauncher )
|
else if (ItemIsRocketLauncher(usItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_MISSILE;
|
usBulletFlags |= BULLET_FLAG_MISSILE;
|
||||||
}
|
}
|
||||||
else if ( Item[usItem].cannon )
|
else if (ItemIsCannon(usItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
||||||
}
|
}
|
||||||
else if ( Item[usItem].rocketrifle )
|
else if (ItemIsRocketRifle(usItem))
|
||||||
{
|
{
|
||||||
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
||||||
}
|
}
|
||||||
@@ -6923,7 +6923,7 @@ INT8 ChanceToGetThrough(SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOAT dE
|
|||||||
// sevenfm: check that weapon exists!
|
// sevenfm: check that weapon exists!
|
||||||
if (pObjHand->exists() &&
|
if (pObjHand->exists() &&
|
||||||
pObjHand->usItem == pFirer->usAttackingWeapon &&
|
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;
|
BOOLEAN fBuckShot = FALSE;
|
||||||
|
|
||||||
@@ -8643,7 +8643,7 @@ void AdjustTargetCenterPoint( SOLDIERTYPE *pShooter, INT32 iTargetGridNo, FLOAT
|
|||||||
|
|
||||||
//INT32 iLaserRange = GetBestLaserRange(&(pShooter->inv[pSoldier->ubAttackingHand]));
|
//INT32 iLaserRange = GetBestLaserRange(&(pShooter->inv[pSoldier->ubAttackingHand]));
|
||||||
INT16 sLaserRange = GetBestLaserRange(pWeapon);
|
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]));
|
sLaserRange = max(sLaserRange, GetBestLaserRange(&pShooter->inv[ROBOT_TARGETING_SLOT]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,10 +214,10 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
|
|||||||
cmp_val = Weapon[pSoldier->inv[HANDPOS].usItem].ubCalibre;
|
cmp_val = Weapon[pSoldier->inv[HANDPOS].usItem].ubCalibre;
|
||||||
break;
|
break;
|
||||||
case REQ_WEAPON_TWOHANDED:
|
case REQ_WEAPON_TWOHANDED:
|
||||||
cmp_val = TwoHandedItem(pSoldier->inv[HANDPOS].usItem);
|
cmp_val = ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem);
|
||||||
break;
|
break;
|
||||||
case REQ_LEFT_WEAPON_TWOHANDED:
|
case REQ_LEFT_WEAPON_TWOHANDED:
|
||||||
cmp_val = TwoHandedItem(pSoldier->inv[SECONDHANDPOS].usItem);
|
cmp_val = ItemIsTwoHanded(pSoldier->inv[SECONDHANDPOS].usItem);
|
||||||
break;
|
break;
|
||||||
case REQ_VEST_AMOR_PROTECTION:
|
case REQ_VEST_AMOR_PROTECTION:
|
||||||
cmp_val = Armour[Item[pSoldier->inv[VESTPOS].usItem].ubClassIndex].ubProtection;
|
cmp_val = Armour[Item[pSoldier->inv[VESTPOS].usItem].ubClassIndex].ubProtection;
|
||||||
|
|||||||
@@ -7287,7 +7287,7 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
|||||||
// Check if it's supposed to be dropped
|
// Check if it's supposed to be dropped
|
||||||
if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) || pTeamSoldier->bTeam == gbPlayerNum )
|
if ( !((*pObj).fFlags & OBJECT_UNDROPPABLE) || pTeamSoldier->bTeam == gbPlayerNum )
|
||||||
{
|
{
|
||||||
if ( !(Item[pObj->usItem].defaultundroppable) )
|
if ( !ItemIsUndroppableByDefault(pObj->usItem) )
|
||||||
{
|
{
|
||||||
//ReduceAmmoDroppedByNonPlayerSoldiers( pTeamSoldier, cnt );
|
//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
|
//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;
|
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
|
// silversurfer: externalized this
|
||||||
//(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random( 20 );
|
//(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random( 20 );
|
||||||
@@ -9320,7 +9320,7 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
|
|||||||
if ( gTacticalStatus.bBoxingState == BOXING )
|
if ( gTacticalStatus.bBoxingState == BOXING )
|
||||||
{
|
{
|
||||||
// should have a check for "in boxing ring", no?
|
// 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!
|
// someone's cheating!
|
||||||
if ( (Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_BLADE || Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_PUNCH) && (pTarget->flags.uiStatusFlags & SOLDIER_BOXER) )
|
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->bDoAutofire = 1;
|
||||||
pSoldier->bDoBurst = TRUE;
|
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;
|
pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD;
|
||||||
else
|
else
|
||||||
pSoldier->bScopeMode = USE_BEST_SCOPE;
|
pSoldier->bScopeMode = USE_BEST_SCOPE;
|
||||||
|
|||||||
+18
-18
@@ -2375,9 +2375,9 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
|
|||||||
// Do we need to stand up?
|
// Do we need to stand up?
|
||||||
bAPCost += GetAPsToChangeStance( pSoldier, ANIM_STAND );
|
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);
|
bAPCost += GetAPsToChangeStance(pSoldier, ANIM_CROUCH);
|
||||||
else
|
else
|
||||||
bAPCost += GetAPsToChangeStance(pSoldier, gAnimControl[pSoldier->usAnimState].ubEndHeight);
|
bAPCost += GetAPsToChangeStance(pSoldier, gAnimControl[pSoldier->usAnimState].ubEndHeight);
|
||||||
@@ -2393,9 +2393,9 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
|
|||||||
if (!TileIsOutOfBounds(sGridNo))
|
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);
|
usTurningCost = CalculateTurningCost(pSoldier, usItem, fAddingTurningCost, ANIM_CROUCH);
|
||||||
else
|
else
|
||||||
usTurningCost = CalculateTurningCost(pSoldier, usItem, fAddingTurningCost);
|
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)
|
// 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
|
// 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 ) )
|
if ( pSoldier->IsValidAlternativeFireMode( bAimTime, sGridNo ) )
|
||||||
bAPCost += (APBPConstants[AP_CHANGE_TARGET] / 2);
|
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]) );
|
OBJECTTYPE* pObjUsed = pSoldier->GetUsedWeapon( &(pSoldier->inv[bInvPos]) );
|
||||||
UINT16 usItemUsed = pSoldier->GetUsedWeaponNumber( &(pSoldier->inv[bInvPos]) );
|
UINT16 usItemUsed = pSoldier->GetUsedWeaponNumber( &(pSoldier->inv[bInvPos]) );
|
||||||
|
|
||||||
if ( Item[usItemUsed].singleshotrocketlauncher )
|
if (ItemIsSingleShotRocketLauncher(usItemUsed))
|
||||||
{
|
{
|
||||||
// hack... they turn empty afterwards anyways
|
// hack... they turn empty afterwards anyways
|
||||||
return( TRUE );
|
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 )
|
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!
|
// WANNE: If there is a tank, it always have ammo to shoot, no check!
|
||||||
if (Item[usItemUsed].cannon)
|
if (ItemIsCannon(usItemUsed))
|
||||||
{
|
{
|
||||||
return ( TRUE );
|
return ( TRUE );
|
||||||
}
|
}
|
||||||
@@ -2715,13 +2715,13 @@ void DeductAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE* pObj )
|
|||||||
{
|
{
|
||||||
// tanks never run out of MG ammo!
|
// tanks never run out of MG ammo!
|
||||||
// unlimited cannon ammo is handled in AI
|
// 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;
|
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
|
// Flugente: check for underbarrel weapons and use that object if necessary
|
||||||
OBJECTTYPE* pObjUsed = pSoldier->GetUsedWeapon( pObj );
|
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 ) );
|
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 );
|
OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE );
|
||||||
if ( !pAttachment->exists() )
|
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 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 ( 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
|
// Raising only to hip, either charge no APs or a portion of them
|
||||||
ubReadyAPs = ((ubReadyAPs * gGameExternalOptions.ubToAltWeaponHoldReadyAPsPerc) + 99) / 100 ; // round up for rifles
|
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
|
// If we are told to go from alternative to standard weapon holding
|
||||||
else if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ( ANIM_ALT_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
|
ubReadyAPs = ubReadyAPs * gGameExternalOptions.ubFromAltWeaponHoldReadyAPsPerc / 100; // round down for rifles
|
||||||
}
|
}
|
||||||
@@ -3703,7 +3703,7 @@ UINT16 GetTotalAPsToDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
|||||||
|
|
||||||
if ( sAPs > 0 )
|
if ( sAPs > 0 )
|
||||||
{
|
{
|
||||||
if(Item[pSoldier->inv[HANDPOS].usItem].mine == 1)
|
if(ItemIsMine(pSoldier->inv[HANDPOS].usItem))
|
||||||
sAPs += GetAPsToPlantMine( pSoldier ); // changed by SANDRO
|
sAPs += GetAPsToPlantMine( pSoldier ); // changed by SANDRO
|
||||||
else
|
else
|
||||||
sAPs += GetAPsToDropBomb( pSoldier ); // changed by SANDRO
|
sAPs += GetAPsToDropBomb( pSoldier ); // changed by SANDRO
|
||||||
@@ -4154,7 +4154,7 @@ INT32 GetBPCostPer10APsForGunHolding( SOLDIERTYPE * pSoldier, BOOLEAN fEstimate
|
|||||||
// Alternative weapon holding?
|
// Alternative weapon holding?
|
||||||
if (( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_ALT_WEAPON_HOLDING ) || (fEstimate && pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD) )
|
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
|
dModifier += 80; // only 20% cost if on hip
|
||||||
else // holding pistol in one hand is worse in this case
|
else // holding pistol in one hand is worse in this case
|
||||||
dModifier -= 25; // increased cost by 25%
|
dModifier -= 25; // increased cost by 25%
|
||||||
@@ -4265,7 +4265,7 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
|
|||||||
iKickPower = iKickPower * (100 - sWeaponWeight) / 100;
|
iKickPower = iKickPower * (100 - sWeaponWeight) / 100;
|
||||||
|
|
||||||
// If one-handed gun, reduce it a bit, since the whole thing is somewhat different.
|
// 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%
|
iKickPower = iKickPower * 3 / 4; // -25%
|
||||||
|
|
||||||
// ::: overview :::
|
// ::: overview :::
|
||||||
@@ -4310,7 +4310,7 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
|
|||||||
// Alternative weapon holding?
|
// Alternative weapon holding?
|
||||||
if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_ALT_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
|
dModifier += 80; // only 20% of the regular kick power
|
||||||
else // holding pistol in one hand is worse in this case
|
else // holding pistol in one hand is worse in this case
|
||||||
dModifier -= 33; // plus 33% power
|
dModifier -= 33; // plus 33% power
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ INVTYPE* GearGetRandomFaceItem(INT8 min_coolness = -1, INT8 max_coolness = -1, U
|
|||||||
if (HasItemFlag((*it)->uiIndex, SCUBA_MASK))
|
if (HasItemFlag((*it)->uiIndex, SCUBA_MASK))
|
||||||
continue;
|
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_SPECTACLES && (*it)->brightlightvisionrangebonus < 1) continue;
|
||||||
if (item_type == FACEITEM_NVG && (*it)->nightvisionrangebonus < 1) continue;
|
if (item_type == FACEITEM_NVG && (*it)->nightvisionrangebonus < 1) continue;
|
||||||
if (item_type == FACEITEM_HEADSET && (*it)->hearingrangebonus < 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;
|
INVTYPE* item = *it;
|
||||||
|
|
||||||
if (item->attachment < 1)
|
//if (item->attachment < 1)
|
||||||
|
if (!ItemIsAttachment(item->uiIndex))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!ValidAttachment(item->uiIndex, weapon->uiIndex))
|
if (!ValidAttachment(item->uiIndex, weapon->uiIndex))
|
||||||
@@ -680,7 +681,7 @@ std::vector<INVTYPE*> GearFindItemsForRole(std::vector<UINT8>* roles, std::vecto
|
|||||||
INVTYPE* item = *it;
|
INVTYPE* item = *it;
|
||||||
INT8 chance = 0;
|
INT8 chance = 0;
|
||||||
|
|
||||||
if (item->glgrenade > 0)
|
if (ItemIsGLgrenade(item->uiIndex))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (item->attachmentclass == AC_GRENADE || item->attachmentclass == AC_ROCKET)
|
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;
|
merc->usOptionalGearCost = kit_cost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1014,7 +1014,7 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
|
|||||||
{
|
{
|
||||||
// and make sure that it really is a droppable item type
|
// and make sure that it really is a droppable item type
|
||||||
// if ( !(Item[ pObj->usItem ].fFlags & ITEM_DEFAULT_UNDROPPABLE) )
|
// if ( !(Item[ pObj->usItem ].fFlags & ITEM_DEFAULT_UNDROPPABLE) )
|
||||||
if ( !(Item[ pObj->usItem ].defaultundroppable ) )
|
if ( !ItemIsUndroppableByDefault(pObj->usItem) )
|
||||||
{
|
{
|
||||||
ReduceAmmoDroppedByNonPlayerSoldiers( pSoldier, cnt );
|
ReduceAmmoDroppedByNonPlayerSoldiers( pSoldier, cnt );
|
||||||
//if this soldier was an enemy
|
//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
|
//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;
|
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
|
// silversurfer: externalized this
|
||||||
//(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20);
|
//(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20);
|
||||||
|
|||||||
@@ -607,8 +607,6 @@ void EnableAllDealersOfferSlots( void );
|
|||||||
|
|
||||||
void HatchOutInvSlot( UINT16 usPosX, UINT16 usPosY );
|
void HatchOutInvSlot( UINT16 usPosX, UINT16 usPosY );
|
||||||
|
|
||||||
extern BOOLEAN ItemIsARocketRifle( INT16 sItemIndex );
|
|
||||||
|
|
||||||
#ifdef JA2TESTVERSION
|
#ifdef JA2TESTVERSION
|
||||||
BOOLEAN gfTestDisplayDealerCash = FALSE;
|
BOOLEAN gfTestDisplayDealerCash = FALSE;
|
||||||
void DisplayAllDealersCash();
|
void DisplayAllDealersCash();
|
||||||
@@ -3392,8 +3390,7 @@ FLOAT ItemConditionModifier(UINT16 usItemIndex, INT16 bStatus)
|
|||||||
|
|
||||||
// an item at 100% is worth full price...
|
// an item at 100% is worth full price...
|
||||||
|
|
||||||
// if ( Item[ usItemIndex ].fFlags & ITEM_REPAIRABLE )
|
if (ItemIsRepairable(usItemIndex))
|
||||||
if ( Item[ usItemIndex ].repairable )
|
|
||||||
{
|
{
|
||||||
// a REPAIRABLE item at 0% is still worth 50% of its full price, not 0%
|
// a REPAIRABLE item at 0% is still worth 50% of its full price, not 0%
|
||||||
dConditionModifier = 0.5f + ( bStatus / (FLOAT)200 );
|
dConditionModifier = 0.5f + ( bStatus / (FLOAT)200 );
|
||||||
@@ -5007,8 +5004,7 @@ BOOLEAN IsGunOrAmmoOfSameTypeSelected( OBJECTTYPE *pItemObject )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if the highlighted object is an attachment
|
//if the highlighted object is an attachment
|
||||||
// if( Item[ pItemObject->usItem ].fFlags & ITEM_ATTACHMENT )
|
if(ItemIsAttachment(pItemObject->usItem))
|
||||||
if( Item[ pItemObject->usItem ].attachment )
|
|
||||||
{
|
{
|
||||||
if( ValidAttachment( pItemObject->usItem, gpHighLightedItemObject ) )
|
if( ValidAttachment( pItemObject->usItem, gpHighLightedItemObject ) )
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
@@ -5646,7 +5642,7 @@ void EvaluateItemAddedToPlayersOfferArea( INT8 bSlotID, BOOLEAN fFirstOne )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if the item is a rocket rifle
|
//if the item is a rocket rifle
|
||||||
if( ItemIsARocketRifle( PlayersOfferArea[ bSlotID ].sItemIndex ) )
|
if(ItemHasFingerPrintID( PlayersOfferArea[ bSlotID ].sItemIndex ) )
|
||||||
{
|
{
|
||||||
fRocketRifleWasEvaluated = TRUE;
|
fRocketRifleWasEvaluated = TRUE;
|
||||||
}
|
}
|
||||||
@@ -5716,8 +5712,7 @@ void EvaluateItemAddedToPlayersOfferArea( INT8 bSlotID, BOOLEAN fFirstOne )
|
|||||||
if( armsDealerInfo[ gbSelectedArmsDealerID ].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
|
if( armsDealerInfo[ gbSelectedArmsDealerID ].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
|
||||||
{
|
{
|
||||||
// only otherwise repairable items count as actual rejections
|
// only otherwise repairable items count as actual rejections
|
||||||
// if ( Item[ PlayersOfferArea[ bSlotID ].sItemIndex ].fFlags & ITEM_REPAIRABLE )
|
if (ItemIsRepairable(PlayersOfferArea[bSlotID].sItemIndex))
|
||||||
if ( Item[ PlayersOfferArea[ bSlotID ].sItemIndex ].repairable )
|
|
||||||
{
|
{
|
||||||
uiEvalResult = EVAL_RESULT_DONT_HANDLE;
|
uiEvalResult = EVAL_RESULT_DONT_HANDLE;
|
||||||
}
|
}
|
||||||
@@ -6356,7 +6351,7 @@ void SplitComplexObjectIntoSubObjects( OBJECTTYPE *pComplexObject )
|
|||||||
|
|
||||||
// strip off any loaded ammo/payload
|
// strip off any loaded ammo/payload
|
||||||
// Exception: don't do this with rocket launchers, their "shots left" are fake and this screws 'em up!
|
// 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.usGunAmmoItem = NONE;
|
||||||
pData->data.gun.ubGunShotsLeft = 0;
|
pData->data.gun.ubGunShotsLeft = 0;
|
||||||
|
|||||||
@@ -375,8 +375,8 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
|||||||
{
|
{
|
||||||
// sevenfm: breaking window with crowbar code
|
// sevenfm: breaking window with crowbar code
|
||||||
if (pSoldier->inv[HANDPOS].exists() &&
|
if (pSoldier->inv[HANDPOS].exists() &&
|
||||||
(Item[pSoldier->inv[HANDPOS].usItem].crowbar && Item[pSoldier->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
|
(ItemIsCrowbar(pSoldier->inv[HANDPOS].usItem) && 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))
|
Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && ItemIsMetal(pSoldier->inv[HANDPOS].usItem)))
|
||||||
{
|
{
|
||||||
INT32 sWindowGridNo = pSoldier->sTargetGridNo;
|
INT32 sWindowGridNo = pSoldier->sTargetGridNo;
|
||||||
if (pSoldier->ubDirection == NORTH || pSoldier->ubDirection == WEST)
|
if (pSoldier->ubDirection == NORTH || pSoldier->ubDirection == WEST)
|
||||||
@@ -1135,10 +1135,10 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
|||||||
UINT16 usItem = pSoldier->pTempObject->usItem;
|
UINT16 usItem = pSoldier->pTempObject->usItem;
|
||||||
UINT16 usBuddyItem = Item[usItem].usBuddyItem;
|
UINT16 usBuddyItem = Item[usItem].usBuddyItem;
|
||||||
if (pSoldier->pThrowParams->ubActionCode == THROW_ARM_ITEM &&
|
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_FLARE ||
|
||||||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_BURNABLEGAS ||
|
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)
|
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 ].usItemClass == IC_GUN )
|
||||||
{
|
{
|
||||||
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
|
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
|
||||||
if ( (Item[ usItem ].twohanded ) )
|
if (ItemIsTwoHanded(usItem))
|
||||||
{
|
{
|
||||||
// Set to rifle
|
// Set to rifle
|
||||||
ubRandomHandIndex = RANDOM_ANIM_RIFLEINHAND;
|
ubRandomHandIndex = RANDOM_ANIM_RIFLEINHAND;
|
||||||
@@ -2714,7 +2714,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
|||||||
case BIGBUY_STRECH:
|
case BIGBUY_STRECH:
|
||||||
case FEM_KICKSN:
|
case FEM_KICKSN:
|
||||||
case FEM_WIPE:
|
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 );
|
pSoldier->EVENT_InitNewSoldierAnim( RAISE_RIFLE, 0 , FALSE );
|
||||||
return( TRUE );
|
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)
|
// SANDRO - if Martial Artist took someone down, always fall back if possible (for the fun)
|
||||||
if ( pSoldier->ubAttackerID != NOBODY && gGameOptions.fNewTraitSystem )
|
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;
|
fAlwaysFallBack = TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3017,7 +3017,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Item[usItem].flare ||
|
if (ItemIsFlare(usItem) ||
|
||||||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_SIGNAL_SMOKE ||
|
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_SIGNAL_SMOKE ||
|
||||||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_FLARE)
|
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
|
// Going from shoulder stance to hip stance
|
||||||
else if ( usNewState == READY_ALTERNATIVE_STAND && (gAnimControl[this->usAnimState].uiFlags & (ANIM_FIREREADY | ANIM_FIRE)) )
|
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;
|
usStartingAniCode = 1;
|
||||||
else
|
else
|
||||||
usStartingAniCode = 2;
|
usStartingAniCode = 2;
|
||||||
@@ -3278,7 +3278,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
|||||||
// 1) We have a rifle in hand...
|
// 1) We have a rifle in hand...
|
||||||
//usItem = this->inv[ HANDPOS ].usItem;
|
//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 on height!
|
||||||
switch ( gAnimControl[this->usAnimState].ubEndHeight )
|
switch ( gAnimControl[this->usAnimState].ubEndHeight )
|
||||||
@@ -3301,7 +3301,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
|||||||
// 1) We have a rifle in hand...
|
// 1) We have a rifle in hand...
|
||||||
//usItem = this->inv[ HANDPOS ].usItem;
|
//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 on height!
|
||||||
switch ( gAnimControl[this->usAnimState].ubEndHeight )
|
switch ( gAnimControl[this->usAnimState].ubEndHeight )
|
||||||
@@ -3429,10 +3429,10 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
|||||||
|
|
||||||
if ( this->inv[HANDPOS].exists( ) == true )
|
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 ].fFlags & ITEM_TWO_HANDED) )
|
||||||
if ( (Item[usItem].twohanded) )
|
if (ItemIsTwoHanded(usItem))
|
||||||
{
|
{
|
||||||
usNewState = BIGMERC_CROUCH_TRANS_INTO;
|
usNewState = BIGMERC_CROUCH_TRANS_INTO;
|
||||||
}
|
}
|
||||||
@@ -3449,10 +3449,10 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
|||||||
|
|
||||||
if ( this->inv[HANDPOS].exists( ) == true )
|
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 ].fFlags & ITEM_TWO_HANDED) )
|
||||||
if ( (Item[usItem].twohanded) )
|
if (ItemIsTwoHanded(usItem))
|
||||||
{
|
{
|
||||||
usNewState = BIGMERC_CROUCH_TRANS_OUTOF;
|
usNewState = BIGMERC_CROUCH_TRANS_OUTOF;
|
||||||
}
|
}
|
||||||
@@ -3477,7 +3477,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
|||||||
if ( ((gAnimControl[this->usAnimState].uiFlags & ANIM_FIREREADY) ||
|
if ( ((gAnimControl[this->usAnimState].uiFlags & ANIM_FIREREADY) ||
|
||||||
(gAnimControl[this->usAnimState].uiFlags & ANIM_FIRE)) && gGameExternalOptions.fAllowWalkingWithWeaponRaised )
|
(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 )
|
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 ( 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;
|
usNewState = SWAT_BACKWARDS;
|
||||||
else
|
else
|
||||||
usNewState = SWAT_BACKWARDS_NOTHING;
|
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
|
// 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) ) )
|
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 )
|
if ( usNewState == WALKING )
|
||||||
{
|
{
|
||||||
@@ -3618,7 +3618,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
|||||||
{
|
{
|
||||||
usNewState = CROUCHEDMOVE_DUAL_READY;
|
usNewState = CROUCHEDMOVE_DUAL_READY;
|
||||||
}
|
}
|
||||||
else if ( !Item[this->inv[HANDPOS].usItem].twohanded )
|
else if (!ItemIsTwoHanded(this->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
usNewState = CROUCHEDMOVE_PISTOL_READY;
|
usNewState = CROUCHEDMOVE_PISTOL_READY;
|
||||||
}
|
}
|
||||||
@@ -3991,7 +3991,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
|||||||
|
|
||||||
case PLANT_BOMB:
|
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
|
DeductPoints( this, GetAPsToPlantMine( this ), APBPConstants[BP_BURY_MINE] ); // changed by SANDRO
|
||||||
else
|
else
|
||||||
DeductPoints( this, GetAPsToDropBomb( this ), APBPConstants[BP_DROP_BOMB] ); // changed by SANDRO
|
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] );
|
usItem = GetAttachedGrenadeLauncher( &this->inv[HANDPOS] );
|
||||||
else
|
else
|
||||||
usItem = this->inv[HANDPOS].usItem;
|
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 );
|
SendChangeSoldierStanceEvent( this, ANIM_CROUCH );
|
||||||
fDoFireRightAway = TRUE;
|
fDoFireRightAway = TRUE;
|
||||||
}
|
}
|
||||||
@@ -5118,7 +5118,7 @@ UINT16 SelectFireAnimation( SOLDIERTYPE *pSoldier, UINT8 ubHeight )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for rocket laucncher....
|
// Check for rocket laucncher....
|
||||||
if ( Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher )
|
if (ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
//***ddd if shoot crouched
|
//***ddd if shoot crouched
|
||||||
if ( ubHeight == ANIM_STAND )
|
if ( ubHeight == ANIM_STAND )
|
||||||
@@ -5128,14 +5128,14 @@ UINT16 SelectFireAnimation( SOLDIERTYPE *pSoldier, UINT8 ubHeight )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for mortar....
|
// 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" );
|
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "SelectFireAnimation: shoot_mortar" );
|
||||||
return(SHOOT_MORTAR);
|
return(SHOOT_MORTAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for tank cannon
|
// Check for tank cannon
|
||||||
if ( Item[pSoldier->inv[HANDPOS].usItem].cannon )
|
if (ItemIsCannon(pSoldier->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
return(TANK_SHOOT);
|
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
|
//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;
|
UINT16 usItem = this->inv[HANDPOS].usItem;
|
||||||
if ( Item[usItem].rocketlauncher || Item[usItem].mortar )
|
if (ItemIsRocketLauncher(usItem) || ItemIsMortar(usItem) )
|
||||||
usForceAnimState = this->usAnimState;
|
usForceAnimState = this->usAnimState;
|
||||||
EVENT_InternalSetSoldierDesiredDirection( this, sFacingDir, FALSE, usAnimState );
|
EVENT_InternalSetSoldierDesiredDirection( this, sFacingDir, FALSE, usAnimState );
|
||||||
usForceAnimState = INVALID_ANIMATION;
|
usForceAnimState = INVALID_ANIMATION;
|
||||||
@@ -5535,12 +5535,12 @@ UINT16 PickSoldierReadyAnimation( SOLDIERTYPE *pSoldier, BOOLEAN fEndReady, BOOL
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if we have a gun.....
|
// 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);
|
return(INVALID_ANIMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher )
|
if (ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
return(INVALID_ANIMATION);
|
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
|
// 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))
|
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
|
&& 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);
|
return(READY_ALTERNATIVE_STAND);
|
||||||
}
|
}
|
||||||
@@ -5641,7 +5641,7 @@ UINT16 PickSoldierReadyAnimation( SOLDIERTYPE *pSoldier, BOOLEAN fEndReady, BOOL
|
|||||||
{
|
{
|
||||||
if ( gGameExternalOptions.ubAllowAlternativeWeaponHolding )
|
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);
|
return(READY_ALTERNATIVE_STAND);
|
||||||
}
|
}
|
||||||
@@ -5877,7 +5877,7 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
|
|||||||
{
|
{
|
||||||
if ( ubAttackerID != NOBODY )
|
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
|
// with enhanced CCS, make the lost breath harder to regenerate, which makes CQC more usable
|
||||||
if ( gGameExternalOptions.fEnhancedCloseCombatSystem )
|
if ( gGameExternalOptions.fEnhancedCloseCombatSystem )
|
||||||
@@ -5944,7 +5944,7 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
|
|||||||
if ( HasItemFlag( usWeaponIndex, TASER ) )
|
if ( HasItemFlag( usWeaponIndex, TASER ) )
|
||||||
{
|
{
|
||||||
// tasers need batteries, because I say so
|
// tasers need batteries, because I say so
|
||||||
if ( Item[usWeaponIndex].needsbatteries )
|
if (ItemNeedsBatteries(usWeaponIndex))
|
||||||
{
|
{
|
||||||
// check for batteries
|
// check for batteries
|
||||||
OBJECTTYPE* pBatteries = FindAttachedBatteries( &(MercPtrs[ubAttackerID]->inv[HANDPOS]) );
|
OBJECTTYPE* pBatteries = FindAttachedBatteries( &(MercPtrs[ubAttackerID]->inv[HANDPOS]) );
|
||||||
@@ -9734,7 +9734,7 @@ BOOLEAN SOLDIERTYPE::CanClimbWithCurrentBackpack()
|
|||||||
// only apply backpack climbing limitations to player mercs
|
// only apply backpack climbing limitations to player mercs
|
||||||
if (UsingNewInventorySystem() == true && this->inv[BPACKPOCKPOS].exists() == true && this->bTeam == OUR_TEAM
|
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.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 FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -10439,7 +10439,7 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sBr
|
|||||||
&& this->HasDiseaseWithFlag( DISEASE_PROPERTY_LIMITED_USE_ARMS ) )
|
&& this->HasDiseaseWithFlag( DISEASE_PROPERTY_LIMITED_USE_ARMS ) )
|
||||||
{
|
{
|
||||||
// drop item in main hand if twohanded
|
// 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;
|
dropiteminmainhand = true;
|
||||||
|
|
||||||
// we can only use one hand, so drop items in second hand
|
// 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
|
//Ja25 No meanwhiles
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
if ( fMartialArtist && !Item[usItem].crowbar && this->ubBodyType == REGMALE )
|
if ( fMartialArtist && !ItemIsCrowbar(usItem) && this->ubBodyType == REGMALE )
|
||||||
#else
|
#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
|
&& !( gGameExternalOptions.fDiseaseSevereLimitations && this->HasDiseaseWithFlag( DISEASE_PROPERTY_LIMITED_USE_LEGS )) ) // SANDRO - added check for body type
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -12871,7 +12871,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio
|
|||||||
case ANIM_STAND:
|
case ANIM_STAND:
|
||||||
case ANIM_CROUCH:
|
case ANIM_CROUCH:
|
||||||
|
|
||||||
if ( !Item[usItem].crowbar )
|
if ( !ItemIsCrowbar(usItem) )
|
||||||
{
|
{
|
||||||
BOOLEAN fCannotKick = (ubDirection & 1);
|
BOOLEAN fCannotKick = (ubDirection & 1);
|
||||||
// SANDRO - we will determine here what type of punch we are gonna use
|
// 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 )
|
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...
|
// 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
|
// Increment the number of people busy doing stuff because of an attack
|
||||||
switch ( gAnimControl[this->usAnimState].ubHeight )
|
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
|
//SANDRO - hack! Find out if we are a doctor with medical bag trying to make a surgery
|
||||||
this->fDoingSurgery = FALSE;
|
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))
|
if ( ((pTSoldier->bTeam == OUR_TEAM) || (pTSoldier->bTeam == MILITIA_TEAM))
|
||||||
&& (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier ))
|
&& (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
|
// 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))
|
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)
|
&& 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;
|
fOnSurgery = TRUE;
|
||||||
}
|
}
|
||||||
@@ -13359,7 +13359,7 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
|
|||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
// using the GOOD medic stuff
|
// 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 %
|
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
|
// now make sure we HAVE that much
|
||||||
if ( Item[this->inv[HANDPOS].usItem].medicalkit )
|
if (ItemIsMedicalKit(this->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
if ( fOnSurgery )
|
if ( fOnSurgery )
|
||||||
uiMedcost = (uiActual * gSkillTraitValues.usDOSurgeryMedBagConsumption) / 100; // surgery drains the kit a lot
|
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)
|
// usedAPs equals (actionPts) * (%of possible points actually used)
|
||||||
uiUsedAPs = (uiActual * uiAvailAPs) / uiPossible;
|
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
|
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;
|
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;
|
this->bScopeMode = USE_ALT_WEAPON_HOLD;
|
||||||
else
|
else
|
||||||
this->bScopeMode = USE_BEST_SCOPE;
|
this->bScopeMode = USE_BEST_SCOPE;
|
||||||
@@ -14094,8 +14094,7 @@ void SOLDIERTYPE::ReLoadSoldierAnimationDueToHandItemChange( UINT16 usOldItem, U
|
|||||||
{
|
{
|
||||||
if ( Item[usOldItem].usItemClass == IC_GUN )
|
if ( Item[usOldItem].usItemClass == IC_GUN )
|
||||||
{
|
{
|
||||||
// if ( (Item[ usOldItem ].fFlags & ITEM_TWO_HANDED) && usOldItem != ROCKET_LAUNCHER )
|
if (ItemIsTwoHanded(usOldItem) && !ItemIsRocketLauncher(usOldItem))
|
||||||
if ( (Item[usOldItem].twohanded) && !Item[usOldItem].rocketlauncher )
|
|
||||||
{
|
{
|
||||||
fOldRifle = TRUE;
|
fOldRifle = TRUE;
|
||||||
}
|
}
|
||||||
@@ -14106,8 +14105,7 @@ void SOLDIERTYPE::ReLoadSoldierAnimationDueToHandItemChange( UINT16 usOldItem, U
|
|||||||
{
|
{
|
||||||
if ( Item[usNewItem].usItemClass == IC_GUN )
|
if ( Item[usNewItem].usItemClass == IC_GUN )
|
||||||
{
|
{
|
||||||
// if ( (Item[ usNewItem ].fFlags & ITEM_TWO_HANDED) && usNewItem != ROCKET_LAUNCHER )
|
if (ItemIsTwoHanded(usNewItem) && !ItemIsRocketLauncher(usNewItem))
|
||||||
if ( (Item[usNewItem].twohanded) && !Item[usNewItem].rocketlauncher )
|
|
||||||
{
|
{
|
||||||
fNewRifle = TRUE;
|
fNewRifle = TRUE;
|
||||||
}
|
}
|
||||||
@@ -14632,7 +14630,7 @@ BOOLEAN SOLDIERTYPE::SoldierCarriesTwoHandedWeapon( void )
|
|||||||
|
|
||||||
usItem = this->inv[HANDPOS].usItem;
|
usItem = this->inv[HANDPOS].usItem;
|
||||||
|
|
||||||
if ( this->inv[HANDPOS].exists( ) == true && (Item[usItem].twohanded) )
|
if ( this->inv[HANDPOS].exists( ) == true && ItemIsTwoHanded(usItem) )
|
||||||
{
|
{
|
||||||
return(TRUE);
|
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 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)) ||
|
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)
|
(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 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)) ||
|
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)
|
(Item[this->inv[bLoop].usItem].nightvisionrangebonus > 0 || Item[this->inv[bLoop].usItem].hearingrangebonus > 0)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -16848,7 +16846,7 @@ void SOLDIERTYPE::DropSectorEquipment( )
|
|||||||
if ( pObj->exists( ) )
|
if ( pObj->exists( ) )
|
||||||
{
|
{
|
||||||
// Check if it's supposed to be dropped
|
// 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;
|
(*pObj)[0]->data.sObjectFlag &= ~TAKEN_BY_MILITIA;
|
||||||
|
|
||||||
@@ -16874,7 +16872,7 @@ void SOLDIERTYPE::DropSectorEquipment( )
|
|||||||
if ( pObj->exists( ) )
|
if ( pObj->exists( ) )
|
||||||
{
|
{
|
||||||
// Check if it's supposed to be dropped
|
// 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;
|
(*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
|
// take tripwire-activated item only if used item is tripwire activated
|
||||||
for ( i = 0; i < invsize; i++ )
|
for ( i = 0; i < invsize; i++ )
|
||||||
{
|
{
|
||||||
|
UINT16 usItem = this->inv[i].usItem;
|
||||||
if ( this->inv[i].exists( ) == true &&
|
if ( this->inv[i].exists( ) == true &&
|
||||||
Item[this->inv[i].usItem].usItemClass == IC_BOMB &&
|
Item[usItem].usItemClass == IC_BOMB &&
|
||||||
Item[this->inv[i].usItem].ubCursor == BOMBCURS &&
|
Item[usItem].ubCursor == BOMBCURS &&
|
||||||
!Item[this->inv[i].usItem].tripwire &&
|
!ItemIsTripwire(usItem) &&
|
||||||
((Item[this->inv[i].usItem].tripwireactivation && Item[usItem].tripwireactivation) ||
|
((ItemHasTripwireActivation(usItem) && ItemHasTripwireActivation(usItem)) ||
|
||||||
(!Item[this->inv[i].usItem].tripwireactivation && !Item[usItem].tripwireactivation)) )
|
(!ItemHasTripwireActivation(usItem) && !ItemHasTripwireActivation(usItem))) )
|
||||||
{
|
{
|
||||||
this->inv[i].MoveThisObjectTo( this->inv[HANDPOS], 1, this );
|
this->inv[i].MoveThisObjectTo( this->inv[HANDPOS], 1, this );
|
||||||
return;
|
return;
|
||||||
@@ -17072,7 +17071,7 @@ void SOLDIERTYPE::SwitchWeapons( BOOLEAN fKnife, BOOLEAN fSideArm )
|
|||||||
else
|
else
|
||||||
handCanMove = (CanItemFitInPosition( this, &this->inv[HANDPOS], handobjstorageslot, FALSE ) || (this->inv[HANDPOS].exists( ) == false && this->inv[SECONDHANDPOS].exists( ) == false));
|
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;
|
searchitemCanMove = FALSE;
|
||||||
else
|
else
|
||||||
searchitemCanMove = (CanItemFitInPosition( this, &this->inv[retrieveslot], HANDPOS, FALSE ) || this->inv[retrieveslot].exists( ) == false);
|
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,
|
// Bonus for heavy weapons moved here from above to get instant CtH bonus and not marksmanship bonus,
|
||||||
// which is supressed by weapon condition
|
// 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 !!!
|
modifier += gSkillTraitValues.bCtHModifierRocketLaunchers; // -25% for untrained mercs !!!
|
||||||
|
|
||||||
@@ -17867,7 +17866,7 @@ void SOLDIERTYPE::SoldierPropertyUpkeep( )
|
|||||||
if ( this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT] )
|
if ( this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT] )
|
||||||
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])
|
if (this->usSkillCooldown[SOLDIER_COOLDOWN_ROBOT_XRAY])
|
||||||
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
|
INT8 invsize = (INT8)inv.size( ); // remember inventorysize, so we don't call size() repeatedly
|
||||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop )
|
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;
|
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
|
INT8 invsize = (INT8)inv.size( ); // remember inventorysize, so we don't call size() repeatedly
|
||||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop )
|
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;
|
mortaritem = inv[bLoop].usItem;
|
||||||
break;
|
break;
|
||||||
@@ -18590,7 +18589,7 @@ BOOLEAN SOLDIERTYPE::GetSlotOfSignalShellIfMortar( UINT8* pbLoop )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Item[inv[bLoop].usItem].mortar )
|
if (ItemIsMortar(inv[bLoop].usItem))
|
||||||
{
|
{
|
||||||
OBJECTTYPE* pAttObj = FindAttachmentByClass( &(inv[bLoop]), IC_BOMB );
|
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 )
|
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
|
// if not already in list, remember this mortar
|
||||||
bool alreadyInList = false;
|
bool alreadyInList = false;
|
||||||
@@ -18923,7 +18922,7 @@ BOOLEAN SOLDIERTYPE::OrderArtilleryStrike( UINT32 usSectorNr, INT32 sTargetGridN
|
|||||||
{
|
{
|
||||||
if ( pSoldier->inv[bLoop].exists( ) == true )
|
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 );
|
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....
|
// OK, find door, attach to door, do animation...., remove item....
|
||||||
|
|
||||||
// First make sure we still have item in hand....
|
// First make sure we still have item in hand....
|
||||||
if ( !Item[this->inv[HANDPOS].usItem].canandstring )
|
if ( !ItemIsCanAndString(this->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -22741,7 +22740,7 @@ void SOLDIERTYPE::EVENT_SoldierApplyItemToPerson( INT32 sGridNo, UINT8 ubDirecti
|
|||||||
|
|
||||||
if ( success )
|
if ( success )
|
||||||
{
|
{
|
||||||
if ( Item[usItem].gasmask )
|
if (ItemIsGasmask(usItem))
|
||||||
{
|
{
|
||||||
// put this item into a (at best empty) faceslot if no gasmask is been worn
|
// put this item into a (at best empty) faceslot if no gasmask is been worn
|
||||||
INT8 bSlot = FindGasMask( pSoldier );
|
INT8 bSlot = FindGasMask( pSoldier );
|
||||||
@@ -23362,11 +23361,11 @@ BOOLEAN SOLDIERTYPE::PlayerSoldierStartTalking( UINT8 ubTargetID, BOOLEAN fValid
|
|||||||
BOOLEAN SOLDIERTYPE::IsValidSecondHandShot( void )
|
BOOLEAN SOLDIERTYPE::IsValidSecondHandShot( void )
|
||||||
{
|
{
|
||||||
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
|
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
|
||||||
!(Item[this->inv[SECONDHANDPOS].usItem].twohanded) &&
|
!ItemIsTwoHanded(this->inv[SECONDHANDPOS].usItem) &&
|
||||||
(!this->bDoBurst || this->IsValidSecondHandBurst( )) &&
|
(!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].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.bGunStatus >= USABLE &&
|
||||||
this->inv[SECONDHANDPOS][0]->data.gun.ubGunShotsLeft > 0 )
|
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
|
// SANDRO - a function to determine if we can autofire with both weapons
|
||||||
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
|
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
|
||||||
!(Item[this->inv[SECONDHANDPOS].usItem].twohanded) &&
|
!ItemIsTwoHanded(this->inv[SECONDHANDPOS].usItem) &&
|
||||||
!Item[this->inv[HANDPOS].usItem].grenadelauncher &&
|
!ItemIsGrenadeLauncher(this->inv[HANDPOS].usItem) &&
|
||||||
this->bDoBurst &&
|
this->bDoBurst &&
|
||||||
Item[this->inv[HANDPOS].usItem].usItemClass == IC_GUN &&
|
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.bGunStatus >= USABLE &&
|
||||||
this->inv[SECONDHANDPOS][0]->data.gun.ubGunShotsLeft > 0 )
|
this->inv[SECONDHANDPOS][0]->data.gun.ubGunShotsLeft > 0 )
|
||||||
{
|
{
|
||||||
@@ -23416,7 +23415,7 @@ BOOLEAN SOLDIERTYPE::IsValidSecondHandShotForReloadingPurposes( void )
|
|||||||
// about ammo taken out!
|
// about ammo taken out!
|
||||||
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
|
if ( Item[this->inv[SECONDHANDPOS].usItem].usItemClass == IC_GUN &&
|
||||||
//!this->bDoBurst &&
|
//!this->bDoBurst &&
|
||||||
!Item[this->inv[HANDPOS].usItem].grenadelauncher &&
|
!ItemIsGrenadeLauncher(this->inv[HANDPOS].usItem) &&
|
||||||
Item[this->inv[HANDPOS].usItem].usItemClass == IC_GUN &&
|
Item[this->inv[HANDPOS].usItem].usItemClass == IC_GUN &&
|
||||||
this->inv[SECONDHANDPOS][0]->data.gun.bGunStatus >= USABLE //&&
|
this->inv[SECONDHANDPOS][0]->data.gun.bGunStatus >= USABLE //&&
|
||||||
// this->inv[SECONDHANDPOS][0]->data.gun.ubGunShotsLeft > 0 &&
|
// this->inv[SECONDHANDPOS][0]->data.gun.ubGunShotsLeft > 0 &&
|
||||||
@@ -23452,7 +23451,7 @@ BOOLEAN SOLDIERTYPE::IsValidShotFromHip( INT16 bAimTime, INT32 iTrgGridNo )
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
// must be two handed for this
|
// must be two handed for this
|
||||||
if ( !Item[this->inv[HANDPOS].usItem].twohanded )
|
if ( !ItemIsTwoHanded(this->inv[HANDPOS].usItem) )
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
@@ -23509,7 +23508,7 @@ BOOLEAN SOLDIERTYPE::IsValidPistolFastShot( INT16 bAimTime, INT32 iTrgGridNo )
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
// must be one handed for this
|
// must be one handed for this
|
||||||
if ( Item[this->inv[HANDPOS].usItem].twohanded )
|
if (ItemIsTwoHanded(this->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
@@ -24178,8 +24177,8 @@ void SOLDIERTYPE::BreakWindow(void)
|
|||||||
{
|
{
|
||||||
if (this->inv[HANDPOS].exists() &&
|
if (this->inv[HANDPOS].exists() &&
|
||||||
this->inv[HANDPOS][0]->data.objectStatus >= USABLE &&
|
this->inv[HANDPOS][0]->data.objectStatus >= USABLE &&
|
||||||
(Item[this->inv[HANDPOS].usItem].crowbar && Item[this->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
|
(ItemIsCrowbar(this->inv[HANDPOS].usItem) && 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))
|
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->usAttackingWeapon = this->inv[HANDPOS].usItem;
|
||||||
this->aiData.bAction = AI_ACTION_KNIFE_STAB;
|
this->aiData.bAction = AI_ACTION_KNIFE_STAB;
|
||||||
@@ -24203,8 +24202,8 @@ BOOLEAN SOLDIERTYPE::CanBreakWindow(void)
|
|||||||
IS_MERC_BODY_TYPE(this) &&
|
IS_MERC_BODY_TYPE(this) &&
|
||||||
this->inv[HANDPOS].exists() &&
|
this->inv[HANDPOS].exists() &&
|
||||||
this->inv[HANDPOS][0]->data.objectStatus >= USABLE &&
|
this->inv[HANDPOS][0]->data.objectStatus >= USABLE &&
|
||||||
(Item[this->inv[HANDPOS].usItem].crowbar && Item[this->inv[HANDPOS].usItem].usItemClass & (IC_PUNCH) ||
|
(ItemIsCrowbar(this->inv[HANDPOS].usItem) && 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))
|
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->sTargetGridNo;
|
||||||
INT32 sWindowGridNo = this->sGridNo;
|
INT32 sWindowGridNo = this->sGridNo;
|
||||||
@@ -25063,7 +25062,7 @@ BOOLEAN AIDecideHipOrShoulderStance( SOLDIERTYPE * pSoldier, INT32 iGridNo )
|
|||||||
UINT16 usInHand = pSoldier->usAttackingWeapon;
|
UINT16 usInHand = pSoldier->usAttackingWeapon;
|
||||||
|
|
||||||
// not 2-handed or not standing
|
// 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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -25596,7 +25595,7 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
|
|||||||
if ( !uiPossible )
|
if ( !uiPossible )
|
||||||
return 0;
|
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 %
|
uiPossible += (uiPossible / 2); // add extra 50 %
|
||||||
|
|
||||||
// Doctor trait improves basic bandaging ability
|
// 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
|
uiActual = uiDeficiency; // reduce actual not to waste anything
|
||||||
|
|
||||||
// now make sure we HAVE that much
|
// now make sure we HAVE that much
|
||||||
if ( Item[pKit->usItem].medicalkit )
|
if (ItemIsMedicalKit(pKit->usItem))
|
||||||
{
|
{
|
||||||
if ( fOnSurgery )
|
if ( fOnSurgery )
|
||||||
uiMedcost = (uiActual * gSkillTraitValues.usDOSurgeryMedBagConsumption) / 100; // surgery drains the kit a lot
|
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)
|
// usedAPs equals (actionPts) * (%of possible points actually used)
|
||||||
uiUsedAPs = (uiActual * uiAvailAPs) / uiPossible;
|
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
|
uiUsedAPs = (uiUsedAPs * 2) / 3; // reverse 50% bonus by taking 2/3rds
|
||||||
|
|
||||||
// surgery is harder so cost more BPs
|
// 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
|
// how much of this item do we use up
|
||||||
UINT16 statusused = min(portionsize, (*pObj)[0]->data.objectStatus);
|
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;
|
return FALSE;
|
||||||
|
|
||||||
INT16 apcost = 0;
|
INT16 apcost = 0;
|
||||||
@@ -26000,12 +25999,12 @@ BOOLEAN ApplyConsumable(SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce,
|
|||||||
apcost = max( apcost, (APBPConstants[AP_CAMOFLAGE] / 2) );
|
apcost = max( apcost, (APBPConstants[AP_CAMOFLAGE] / 2) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Item[pObj->usItem].camouflagekit )
|
if (ItemIsCamoKit(pObj->usItem))
|
||||||
{
|
{
|
||||||
apcost = max( apcost, APBPConstants[AP_CAMOFLAGE] );
|
apcost = max( apcost, APBPConstants[AP_CAMOFLAGE] );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Item[pObj->usItem].canteen )
|
if (ItemIsCanteen(pObj->usItem))
|
||||||
{
|
{
|
||||||
apcost = max( apcost, APBPConstants[AP_DRINK] );
|
apcost = max( apcost, APBPConstants[AP_DRINK] );
|
||||||
}
|
}
|
||||||
@@ -26052,7 +26051,7 @@ BOOLEAN ApplyConsumable(SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// some mercs will refuse to smoke
|
// 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
|
// merc gets slightly pissed by the player even suggesting this
|
||||||
TacticalCharacterDialogue( pSoldier, QUOTE_REFUSE_TO_SMOKE );
|
TacticalCharacterDialogue( pSoldier, QUOTE_REFUSE_TO_SMOKE );
|
||||||
@@ -26108,7 +26107,7 @@ BOOLEAN ApplyConsumable(SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce,
|
|||||||
fSuccess = TRUE;
|
fSuccess = TRUE;
|
||||||
|
|
||||||
// no sound on consuming cigarettes, as that is very annoying
|
// no sound on consuming cigarettes, as that is very annoying
|
||||||
if ( !Item[pObj->usItem].cigarette )
|
if ( !ItemIsCigarette(pObj->usItem) )
|
||||||
{
|
{
|
||||||
fDoSound = TRUE;
|
fDoSound = TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-21
@@ -4163,7 +4163,7 @@ void CopyProfileItems( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCreateStruc
|
|||||||
UINT32 invsize = pProfile->inv.size();
|
UINT32 invsize = pProfile->inv.size();
|
||||||
for ( cnt = 0; cnt < pProfile->inv.size(); ++cnt )
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
fRet = CreateItems( pProfile->inv[ cnt ], pProfile->bInvStatus[ cnt ], pProfile->bInvNumber[ cnt ], &gTempObject );
|
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) {
|
if ( pProfile->inv[ cnt ] == NOTHING) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!Item[pProfile->inv[cnt]].attachment) {
|
if (!ItemIsAttachment(pProfile->inv[cnt])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fRet = CreateItems( pProfile->inv[ cnt ], pProfile->bInvStatus[ cnt ], pProfile->bInvNumber[ cnt ], &gTempObject );
|
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)
|
if(fRet)
|
||||||
{
|
{
|
||||||
pSoldier->inv[cnt] = gTempObject;
|
pSoldier->inv[cnt] = gTempObject;
|
||||||
if ( Item[gTempObject.usItem].fingerprintid )
|
if (ItemHasFingerPrintID(gTempObject.usItem))
|
||||||
{
|
{
|
||||||
for (int x = 0; x < pProfile->bInvNumber[ cnt ]; ++x) {
|
for (int x = 0; x < pProfile->bInvNumber[ cnt ]; ++x) {
|
||||||
gTempObject[x]->data.ubImprintID = pSoldier->ubProfile;
|
gTempObject[x]->data.ubImprintID = pSoldier->ubProfile;
|
||||||
@@ -5090,7 +5090,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Chance to gain second weapon
|
// 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]);
|
(pCreateStruct->Inv[SECONDHANDPOS]) = (pCreateStruct->Inv[HANDPOS]);
|
||||||
|
|
||||||
@@ -5178,7 +5178,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
|
|||||||
BTraitAssigned = TRUE;
|
BTraitAssigned = TRUE;
|
||||||
|
|
||||||
// elites can have third skill trait
|
// 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) )
|
(ubSolClass == SOLDIER_CLASS_ELITE || ubSolClass == SOLDIER_CLASS_ELITE_MILITIA) )
|
||||||
{
|
{
|
||||||
pSoldier->stats.ubSkillTraits[2] = AMBIDEXTROUS_NT;
|
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
|
// 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 )
|
if ( pCreateStruct->bTeam == MILITIA_TEAM && gGameExternalOptions.fMilitiaUseSectorInventory && gGameExternalOptions.fMilitiaUseSectorInventory_Gun )
|
||||||
;
|
;
|
||||||
@@ -5206,7 +5206,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
|
|||||||
BTraitAssigned = TRUE;
|
BTraitAssigned = TRUE;
|
||||||
|
|
||||||
// elites can have third skill trait
|
// 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) )
|
(ubSolClass == SOLDIER_CLASS_ELITE || ubSolClass == SOLDIER_CLASS_ELITE_MILITIA) )
|
||||||
{
|
{
|
||||||
pSoldier->stats.ubSkillTraits[2] = AMBIDEXTROUS_NT;
|
pSoldier->stats.ubSkillTraits[2] = AMBIDEXTROUS_NT;
|
||||||
@@ -5222,7 +5222,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
|
|||||||
pSoldier->stats.ubSkillTraits[0] = AMBIDEXT_OT;
|
pSoldier->stats.ubSkillTraits[0] = AMBIDEXT_OT;
|
||||||
ATraitAssigned = TRUE;
|
ATraitAssigned = TRUE;
|
||||||
// Ambidextrous trait gives us second weapon automatically
|
// 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]);
|
(pCreateStruct->Inv[SECONDHANDPOS]) = (pCreateStruct->Inv[HANDPOS]);
|
||||||
}
|
}
|
||||||
@@ -5232,7 +5232,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
|
|||||||
pSoldier->stats.ubSkillTraits[1] = AMBIDEXT_OT;
|
pSoldier->stats.ubSkillTraits[1] = AMBIDEXT_OT;
|
||||||
BTraitAssigned = TRUE;
|
BTraitAssigned = TRUE;
|
||||||
// Ambidextrous trait gives us second weapon automatically
|
// 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]);
|
(pCreateStruct->Inv[SECONDHANDPOS]) = (pCreateStruct->Inv[HANDPOS]);
|
||||||
}
|
}
|
||||||
@@ -5267,28 +5267,29 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
|
|||||||
{
|
{
|
||||||
if ( pCreateStruct->Inv[bLoop].exists( ) == true )
|
if ( pCreateStruct->Inv[bLoop].exists( ) == true )
|
||||||
{
|
{
|
||||||
if ( Item[pCreateStruct->Inv[bLoop].usItem].mortar )
|
UINT16 usItem = pCreateStruct->Inv[bLoop].usItem;
|
||||||
|
if (ItemIsMortar(usItem))
|
||||||
foundMortar = TRUE;
|
foundMortar = TRUE;
|
||||||
else if ( Item[pCreateStruct->Inv[bLoop].usItem].rocketlauncher )
|
else if (ItemIsRocketLauncher(usItem))
|
||||||
foundRocketlauncher = TRUE;
|
foundRocketlauncher = TRUE;
|
||||||
else if ( Item[pCreateStruct->Inv[bLoop].usItem].grenadelauncher )
|
else if (ItemIsGrenadeLauncher(usItem))
|
||||||
foundGrenadelauncher = TRUE;
|
foundGrenadelauncher = TRUE;
|
||||||
else if ( Item[pCreateStruct->Inv[bLoop].usItem].usItemClass == IC_BLADE )
|
else if ( Item[usItem].usItemClass == IC_BLADE )
|
||||||
foundKnife = TRUE;
|
foundKnife = TRUE;
|
||||||
else if ( Item[pCreateStruct->Inv[bLoop].usItem].usItemClass == IC_THROWING_KNIFE )
|
else if ( Item[usItem].usItemClass == IC_THROWING_KNIFE )
|
||||||
foundThrowing = TRUE;
|
foundThrowing = TRUE;
|
||||||
else if ( Item[pCreateStruct->Inv[bLoop].usItem].usItemClass == IC_GRENADE )
|
else if ( Item[usItem].usItemClass == IC_GRENADE )
|
||||||
foundGrenades = TRUE;
|
foundGrenades = TRUE;
|
||||||
else if ( Item[pCreateStruct->Inv[bLoop].usItem].brassknuckles )
|
else if (ItemIsBrassKnuckles(usItem))
|
||||||
foundHtH = TRUE;
|
foundHtH = TRUE;
|
||||||
else if ( Item[pCreateStruct->Inv[bLoop].usItem].usItemClass == 128 && // 128 is an identifier of blunt melee weapons
|
else if ( Item[usItem].usItemClass == 128 && // 128 is an identifier of blunt melee weapons
|
||||||
Item[pCreateStruct->Inv[bLoop].usItem].uiIndex != 0 )
|
Item[usItem].uiIndex != 0 )
|
||||||
foundMelee = TRUE;
|
foundMelee = TRUE;
|
||||||
else if ( HasItemFlag( pCreateStruct->Inv[bLoop].usItem, RADIO_SET ) )
|
else if ( HasItemFlag( usItem, RADIO_SET ) )
|
||||||
fRadioSetFound = TRUE;
|
fRadioSetFound = TRUE;
|
||||||
else if ( Item[pCreateStruct->Inv[bLoop].usItem].firstaidkit )
|
else if (ItemIsFirstAidKit(usItem))
|
||||||
fFirstAidKitFound = TRUE;
|
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
|
// Flugente: for enemy medic purposes, med kits also count as first aid kits
|
||||||
fFirstAidKitFound = TRUE;
|
fFirstAidKitFound = TRUE;
|
||||||
|
|||||||
@@ -1845,7 +1845,7 @@ BOOLEAN RecruitRPC( UINT8 ubCharNum )
|
|||||||
if ( bSlot != NO_SLOT )
|
if ( bSlot != NO_SLOT )
|
||||||
{
|
{
|
||||||
// if ( Item[ pNewSoldier->inv[ bSlot ].usItem ].fFlags & ITEM_TWO_HANDED )
|
// 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 )
|
if ( bSlot != SECONDHANDPOS && pNewSoldier->inv[ SECONDHANDPOS ].exists() == true )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
|||||||
break;
|
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
|
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 ) ||
|
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
|
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
|
// display only externally-visible weapon attachments
|
||||||
if ( Item[iter->usItem].hiddenattachment )
|
if (ItemIsHiddenAttachment(iter->usItem))
|
||||||
fDisplayAttachment = FALSE;
|
fDisplayAttachment = FALSE;
|
||||||
else
|
else
|
||||||
fDisplayAttachment = TRUE;
|
fDisplayAttachment = TRUE;
|
||||||
|
|||||||
@@ -2678,7 +2678,7 @@ BOOLEAN AddDeadSoldierToUnLoadedSector( INT16 sMapX, INT16 sMapY, UINT8 bMapZ, S
|
|||||||
pWorldItems[ bCount ].bVisible = TRUE;
|
pWorldItems[ bCount ].bVisible = TRUE;
|
||||||
pWorldItems[ bCount ].bRenderZHeightAboveLevel = 0;
|
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
|
// silversurfer: externalized this
|
||||||
//pSoldier->inv[i][0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20);
|
//pSoldier->inv[i][0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20);
|
||||||
|
|||||||
@@ -8969,7 +8969,7 @@ void HandleTacticalTakeInvItem( INT32 iType )
|
|||||||
for(UINT8 i = GUNSLINGPOCKPOS; i < NUM_INV_SLOTS; ++i)
|
for(UINT8 i = GUNSLINGPOCKPOS; i < NUM_INV_SLOTS; ++i)
|
||||||
{
|
{
|
||||||
if ( pSoldier->inv[i].exists() &&
|
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 ) ) )
|
( iType > 0 ? ( pSoldier->inv[i].usItem == iType ) : ( InvItemType( pSoldier->inv[i].usItem ) == iType ) ) )
|
||||||
{
|
{
|
||||||
ubItemSlot = i;
|
ubItemSlot = i;
|
||||||
@@ -9019,7 +9019,7 @@ INT32 InvItemType( UINT16 usItem )
|
|||||||
{
|
{
|
||||||
if( usItem == XRAY_DEVICE )
|
if( usItem == XRAY_DEVICE )
|
||||||
return INV_ITEM_TYPE_XRAY;
|
return INV_ITEM_TYPE_XRAY;
|
||||||
if( Item[ usItem ].firstaidkit )
|
if(ItemIsFirstAidKit(usItem))
|
||||||
return INV_ITEM_TYPE_FIRSTAID;
|
return INV_ITEM_TYPE_FIRSTAID;
|
||||||
if( Item[ usItem ].usItemClass == IC_BLADE )
|
if( Item[ usItem ].usItemClass == IC_BLADE )
|
||||||
return INV_ITEM_TYPE_MELEE;
|
return INV_ITEM_TYPE_MELEE;
|
||||||
@@ -9033,9 +9033,9 @@ INT32 InvItemType( UINT16 usItem )
|
|||||||
return INV_ITEM_TYPE_BINOCULARS;
|
return INV_ITEM_TYPE_BINOCULARS;
|
||||||
if( HasItemFlag( usItem, TASER ) )
|
if( HasItemFlag( usItem, TASER ) )
|
||||||
return INV_ITEM_TYPE_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;
|
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_METALDETECTOR;
|
||||||
|
|
||||||
return INV_ITEM_TYPE_UNKNOWN;
|
return INV_ITEM_TYPE_UNKNOWN;
|
||||||
|
|||||||
@@ -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
|
//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
|
// sevenfm: check that not using bayonet attached to the gun
|
||||||
//if ( Item[ubItemIndex].wirecutters && IsCuttableWireFenceAtGridNo( sTargetGridNo ) && pSoldier->pathing.bLevel == 0 )
|
//if ( Item[ubItemIndex].wirecutters && IsCuttableWireFenceAtGridNo( sTargetGridNo ) && pSoldier->pathing.bLevel == 0 )
|
||||||
if ( Item[ubItemIndex].wirecutters &&
|
if (ItemIsWirecutters(ubItemIndex) &&
|
||||||
IsCuttableWireFenceAtGridNo( sTargetGridNo ) &&
|
IsCuttableWireFenceAtGridNo( sTargetGridNo ) &&
|
||||||
pSoldier->pathing.bLevel == 0 &&
|
pSoldier->pathing.bLevel == 0 &&
|
||||||
pSoldier->bWeaponMode != WM_ATTACHED_BAYONET)
|
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
|
//CHRISL: We need to only check the second hand if the weapon in the second hand is onehanded
|
||||||
// Check for enough ammo...
|
// 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.....
|
// Check if ANY ammo exists.....
|
||||||
if ( FindAmmoToReload( pSoldier, HANDPOS, NO_SLOT ) == NO_SLOT )
|
if ( FindAmmoToReload( pSoldier, HANDPOS, NO_SLOT ) == NO_SLOT )
|
||||||
@@ -2937,14 +2937,14 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier )
|
|||||||
return( TRAJECTORYCURS );
|
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 ] )
|
if ( gGameSettings.fOptions [ TOPTION_GL_BURST_CURSOR ] )
|
||||||
return( TARGETCURS );
|
return( TARGETCURS );
|
||||||
else
|
else
|
||||||
return ( TRAJECTORYCURS );
|
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 ] )
|
if ( gGameSettings.fOptions [ TOPTION_GL_BURST_CURSOR ] )
|
||||||
return( TARGETCURS );
|
return( TARGETCURS );
|
||||||
@@ -2976,7 +2976,7 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier )
|
|||||||
|
|
||||||
// Flugente: cursor for constructing/deconstructing
|
// Flugente: cursor for constructing/deconstructing
|
||||||
// at the moment the gridno is not required in these functions, thus 1 suffices
|
// 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;
|
ubCursor = FORTICURS;
|
||||||
}
|
}
|
||||||
|
|||||||
+54
-54
@@ -1210,7 +1210,7 @@ INT32 ExplosiveEffectiveArmour( OBJECTTYPE * pObj )
|
|||||||
}
|
}
|
||||||
iValue = Armour[ Item[pObj->usItem].ubClassIndex ].ubProtection;
|
iValue = Armour[ Item[pObj->usItem].ubClassIndex ].ubProtection;
|
||||||
iValue = iValue * (*pObj)[0]->data.objectStatus * Armour[ Item[pObj->usItem].ubClassIndex ].ubCoverage / 10000;
|
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!
|
// increase value for flak jackets!
|
||||||
iValue *= 3;
|
iValue *= 3;
|
||||||
@@ -1654,7 +1654,7 @@ BOOLEAN FireWeapon( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IC_LAUNCHER:
|
case IC_LAUNCHER:
|
||||||
if ( Item[pSoldier->usAttackingWeapon].rocketlauncher ){
|
if (ItemIsRocketLauncher(pSoldier->usAttackingWeapon)){
|
||||||
UseGunWrapper( pSoldier, sTargetGridNo );
|
UseGunWrapper( pSoldier, sTargetGridNo );
|
||||||
} else {
|
} else {
|
||||||
// ATE: PAtch up - bookkeeping for spreading done out of whak
|
// 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)
|
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);
|
OBJECTTYPE* pA= &(*iter);
|
||||||
if ( (*pA)[0]->data.objectStatus >=USABLE)
|
if ( (*pA)[0]->data.objectStatus >=USABLE)
|
||||||
@@ -2704,7 +2704,7 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
|
|
||||||
// ATE: Check if we should say quote...
|
// ATE: Check if we should say quote...
|
||||||
if ( (*pObjHand)[0]->data.gun.ubGunShotsLeft == 0 &&
|
if ( (*pObjHand)[0]->data.gun.ubGunShotsLeft == 0 &&
|
||||||
!Item[usUBItem].rocketlauncher &&
|
!ItemIsRocketLauncher(usUBItem) &&
|
||||||
pSoldier->bTeam == gbPlayerNum &&
|
pSoldier->bTeam == gbPlayerNum &&
|
||||||
(Chance(gGameExternalOptions.iChanceSayAnnoyingPhrase) || GetMagSize(pObjHand) > 4))
|
(Chance(gGameExternalOptions.iChanceSayAnnoyingPhrase) || GetMagSize(pObjHand) > 4))
|
||||||
{
|
{
|
||||||
@@ -2719,14 +2719,14 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
// Deduct knife from inv! (not here, later?)
|
// Deduct knife from inv! (not here, later?)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Item[usUBItem].rocketlauncher )
|
if (ItemIsRocketLauncher(usUBItem))
|
||||||
{
|
{
|
||||||
if ( WillExplosiveWeaponFail( pSoldier, pObjHand ) )
|
if ( WillExplosiveWeaponFail( pSoldier, pObjHand ) )
|
||||||
{
|
{
|
||||||
INT16 sX, sY;
|
INT16 sX, sY;
|
||||||
ConvertGridNoToCenterCellXY(pSoldier->sGridNo, &sX, &sY);
|
ConvertGridNoToCenterCellXY(pSoldier->sGridNo, &sX, &sY);
|
||||||
|
|
||||||
if ( Item[usUBItem].singleshotrocketlauncher )
|
if ( ItemIsSingleShotRocketLauncher(usUBItem) )
|
||||||
{
|
{
|
||||||
CreateItem( Item[usItemNum].discardedlauncheritem , (*pObjHand)[0]->data.objectStatus, pObjHand );
|
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) &&
|
if (IS_MERC_BODY_TYPE(pSoldier) &&
|
||||||
pSoldier->bVisible == TRUE &&
|
pSoldier->bVisible == TRUE &&
|
||||||
Item[usUBItem].usItemClass == IC_GUN &&
|
Item[usUBItem].usItemClass == IC_GUN &&
|
||||||
!Item[usUBItem].rocketlauncher &&
|
!ItemIsRocketLauncher(usUBItem) &&
|
||||||
strlen(AmmoTypes[Magazine[Item[(*pObjAttHand)[0]->data.gun.usGunAmmoItem].ubClassIndex].ubAmmoType].shotAnimation) > 0)
|
strlen(AmmoTypes[Magazine[Item[(*pObjAttHand)[0]->data.gun.usGunAmmoItem].ubClassIndex].ubAmmoType].shotAnimation) > 0)
|
||||||
{
|
{
|
||||||
ANITILE_PARAMS AniParams;
|
ANITILE_PARAMS AniParams;
|
||||||
@@ -2943,9 +2943,9 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
}
|
}
|
||||||
DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
|
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 );
|
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)
|
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);
|
OBJECTTYPE* pA= &(*iter);
|
||||||
if ( (*pA)[0]->data.objectStatus >=USABLE)
|
if ( (*pA)[0]->data.objectStatus >=USABLE)
|
||||||
@@ -3527,7 +3527,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
|
|
||||||
// ATE: Check if we should say quote...
|
// ATE: Check if we should say quote...
|
||||||
if ( (*pObjUsed)[0]->data.gun.ubGunShotsLeft == 0 &&
|
if ( (*pObjUsed)[0]->data.gun.ubGunShotsLeft == 0 &&
|
||||||
!Item[usUBItem].rocketlauncher &&
|
!ItemIsRocketLauncher(usUBItem) &&
|
||||||
pSoldier->bTeam == gbPlayerNum &&
|
pSoldier->bTeam == gbPlayerNum &&
|
||||||
(Chance(gGameExternalOptions.iChanceSayAnnoyingPhrase) || GetMagSize(pObjUsed) > 4))
|
(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 ) )
|
if ( WillExplosiveWeaponFail( pSoldier, pObjUsed ) )
|
||||||
{
|
{
|
||||||
INT16 sX, sY;
|
INT16 sX, sY;
|
||||||
ConvertGridNoToCenterCellXY(pSoldier->sGridNo, &sX, &sY);
|
ConvertGridNoToCenterCellXY(pSoldier->sGridNo, &sX, &sY);
|
||||||
|
|
||||||
if ( Item[usUBItem].singleshotrocketlauncher )
|
if ( ItemIsSingleShotRocketLauncher(usUBItem) )
|
||||||
{
|
{
|
||||||
CreateItem( Item[usUBItem].discardedlauncheritem , (*pObjUsed)[0]->data.objectStatus, pObjUsed );
|
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) &&
|
if (IS_MERC_BODY_TYPE(pSoldier) &&
|
||||||
pSoldier->bVisible == TRUE &&
|
pSoldier->bVisible == TRUE &&
|
||||||
Item[usUBItem].usItemClass == IC_GUN &&
|
Item[usUBItem].usItemClass == IC_GUN &&
|
||||||
!Item[usUBItem].rocketlauncher &&
|
!ItemIsRocketLauncher(usUBItem) &&
|
||||||
strlen(AmmoTypes[Magazine[Item[(*pObjAttHand)[0]->data.gun.usGunAmmoItem].ubClassIndex].ubAmmoType].shotAnimation) > 0)
|
strlen(AmmoTypes[Magazine[Item[(*pObjAttHand)[0]->data.gun.usGunAmmoItem].ubClassIndex].ubAmmoType].shotAnimation) > 0)
|
||||||
{
|
{
|
||||||
ANITILE_PARAMS AniParams;
|
ANITILE_PARAMS AniParams;
|
||||||
@@ -3761,9 +3761,9 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
}
|
}
|
||||||
DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
|
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 );
|
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 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
|
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
|
// SANDRO - new mercs' records
|
||||||
if ( Item[ usItemNum ].usItemClass == IC_LAUNCHER || Item[usItemNum].grenadelauncher ||
|
if ( Item[ usItemNum ].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usItemNum) ||
|
||||||
Item[usItemNum].rocketlauncher || Item[usItemNum].singleshotrocketlauncher || Item[usItemNum].mortar )
|
ItemIsRocketLauncher(usItemNum) || ItemIsSingleShotRocketLauncher(usItemNum) || ItemIsMortar(usItemNum) )
|
||||||
{
|
{
|
||||||
gMercProfiles[ pSoldier->ubProfile ].records.usMissilesLaunched++;
|
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
|
//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
|
// marke test mag ammo type: pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.ubGunAmmoType
|
||||||
// 2cond 'or' added
|
// 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 )
|
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
|
// 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
|
//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 ) );
|
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 );
|
usDirection = (UINT8)GetDirectionToGridNoFromGridNo( pSoldier->sGridNo, sGridNo );
|
||||||
|
|
||||||
// marke added one 'or' to get this working with HE ammo
|
// 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!
|
// Reduce attacker count!
|
||||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of LAW fire") );
|
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;
|
INT16 sX, sY;
|
||||||
ConvertGridNoToCenterCellXY(sGridNo, &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 )
|
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
|
// 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
|
//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 ) );
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Item[usWeaponIndex].cannon )
|
if (ItemIsCannon(usWeaponIndex))
|
||||||
{
|
{
|
||||||
// Reduce attacker count!
|
// Reduce attacker count!
|
||||||
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of TANK fire") );
|
//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
|
// Determine iMarksmanship and Base CTH
|
||||||
if (Item[usItemUsed].rocketlauncher ){
|
if (ItemIsRocketLauncher(usItemUsed)){
|
||||||
// use the same calculation as for mechanical thrown weapons
|
// use the same calculation as for mechanical thrown weapons
|
||||||
iMarksmanship = ( EffectiveDexterity( pSoldier, FALSE ) + EffectiveMarksmanship( pSoldier ) + EffectiveWisdom( pSoldier ) + (10 * EffectiveExpLevel( pSoldier ) )) / 4;
|
iMarksmanship = ( EffectiveDexterity( pSoldier, FALSE ) + EffectiveMarksmanship( pSoldier ) + EffectiveWisdom( pSoldier ) + (10 * EffectiveExpLevel( pSoldier ) )) / 4;
|
||||||
// heavy weapons trait helps out
|
// heavy weapons trait helps out
|
||||||
@@ -7164,7 +7164,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Modify for using one hand
|
// Modify for using one hand
|
||||||
if ( !(Item[ usInHand ].twohanded ) )
|
if ( !ItemIsTwoHanded(usInHand) )
|
||||||
//check for 2weapon, retaining original code :JMich
|
//check for 2weapon, retaining original code :JMich
|
||||||
{
|
{
|
||||||
if (pSoldier->inv[SECONDHANDPOS].exists() == false)
|
if (pSoldier->inv[SECONDHANDPOS].exists() == false)
|
||||||
@@ -7496,7 +7496,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
|
|||||||
// Equipment Modifiers
|
// Equipment Modifiers
|
||||||
iChance += GetGearToHitBonus ( pSoldier );
|
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);
|
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 );
|
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!
|
// increase value for flak jackets!
|
||||||
protection *= 3;
|
protection *= 3;
|
||||||
@@ -8028,7 +8028,7 @@ INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 i
|
|||||||
// bullet got through jacket; apply ceramic plate armour
|
// bullet got through jacket; apply ceramic plate armour
|
||||||
INT32 protection = ArmourProtection( pTarget, Item[iter->usItem].ubClassIndex, &((*iter)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
|
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!
|
// increase value for flak jackets!
|
||||||
protection *= 3;
|
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 );
|
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!
|
// increase value for flak jackets!
|
||||||
protection *= 3;
|
protection *= 3;
|
||||||
@@ -8860,7 +8860,7 @@ INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BO
|
|||||||
{
|
{
|
||||||
if ( gGameOptions.fNewTraitSystem )
|
if ( gGameOptions.fNewTraitSystem )
|
||||||
{
|
{
|
||||||
if (!pSoldier->usAttackingWeapon || Item[pSoldier->inv[HANDPOS].usItem].brassknuckles)
|
if (!pSoldier->usAttackingWeapon || ItemIsBrassKnuckles(pSoldier->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
if ( gGameExternalOptions.fEnhancedCloseCombatSystem )
|
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 );
|
iAttRating += gSkillTraitValues.ubMABonusCtHBareHands * NUM_SKILL_TRAITS( pAttacker, MARTIAL_ARTS_NT );
|
||||||
}
|
}
|
||||||
// brass knuckles - bonus for Martial Arts (but a little lesser)
|
// 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 );
|
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
|
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 ))
|
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 ) );
|
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 ) );
|
iDefRating += ( gSkillTraitValues.ubMAOnTopCTDHtHBrassKnuckles * NUM_SKILL_TRAITS( pDefender, MARTIAL_ARTS_NT ) );
|
||||||
}
|
}
|
||||||
@@ -9869,17 +9869,17 @@ BOOLEAN IsGunWeaponModeCapable( OBJECTTYPE* pObject, WeaponMode bWpnMode, SOLDIE
|
|||||||
|
|
||||||
case WM_AUTOFIRE:
|
case WM_AUTOFIRE:
|
||||||
//return ((IsGunAutofireCapable(pSoldier, ubHandPos) || Weapon[ pSoldier->inv[ ubHandPos ].usItem ].NoSemiAuto )&& !Item[pSoldier->inv[ubHandPos].usItem].grenadelauncher );
|
//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:
|
case WM_ATTACHED_GL:
|
||||||
// return (FindAttachment( &(pSoldier->inv[ubHandPos]), UNDER_GLAUNCHER ) != 0 && FindLaunchableAttachment( &(pSoldier->inv[ubHandPos]), UNDER_GLAUNCHER ) != 0 );
|
// 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[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:
|
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[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:
|
case WM_ATTACHED_GL_AUTO:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -9997,7 +9997,7 @@ void HandleTacticalEffectsOfEquipmentChange( SOLDIERTYPE *pSoldier, UINT32 uiInv
|
|||||||
pSoldier->bDoBurst = TRUE;
|
pSoldier->bDoBurst = TRUE;
|
||||||
pSoldier->bDoAutofire = 1;
|
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;
|
pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD;
|
||||||
else
|
else
|
||||||
pSoldier->bScopeMode = USE_BEST_SCOPE;
|
pSoldier->bScopeMode = USE_BEST_SCOPE;
|
||||||
@@ -10038,7 +10038,7 @@ void HandleTacticalEffectsOfEquipmentChange( SOLDIERTYPE *pSoldier, UINT32 uiInv
|
|||||||
pSoldier->bDoAutofire = 1;
|
pSoldier->bDoAutofire = 1;
|
||||||
pSoldier->bDoBurst = TRUE;
|
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;
|
pSoldier->bScopeMode = USE_ALT_WEAPON_HOLD;
|
||||||
else
|
else
|
||||||
pSoldier->bScopeMode = USE_BEST_SCOPE;
|
pSoldier->bScopeMode = USE_BEST_SCOPE;
|
||||||
@@ -10156,7 +10156,7 @@ INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed, O
|
|||||||
else
|
else
|
||||||
itemWeight=Item[usItem].ubWeight;
|
itemWeight=Item[usItem].ubWeight;
|
||||||
|
|
||||||
if ( Item[ usItem ].unaerodynamic )
|
if (ItemIsUnaerodynamic(usItem))
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcmaxtossrange: not aerodynamic");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcmaxtossrange: not aerodynamic");
|
||||||
iRange = 1;
|
iRange = 1;
|
||||||
@@ -10180,7 +10180,7 @@ INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sevenfm: for grenades and aerodynamic items - apply modifier
|
// sevenfm: for grenades and aerodynamic items - apply modifier
|
||||||
if ( ! Item[ usItem ].unaerodynamic )
|
if ( !ItemIsUnaerodynamic(usItem))
|
||||||
iRange = (INT32)( iRange * gItemSettings.fRangeModifierGrenade );
|
iRange = (INT32)( iRange * gItemSettings.fRangeModifierGrenade );
|
||||||
|
|
||||||
// adjust for thrower's remaining breath (lose up to 1/2 of range)
|
// 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
|
// SANDRO - old/new traits
|
||||||
if (gGameOptions.fNewTraitSystem)
|
if (gGameOptions.fNewTraitSystem)
|
||||||
{
|
{
|
||||||
if (Item[usHandItem].mortar)
|
if (ItemIsMortar(usHandItem))
|
||||||
{
|
{
|
||||||
if (HAS_SKILL_TRAIT(pSoldier, HEAVY_WEAPONS_NT))
|
if (HAS_SKILL_TRAIT(pSoldier, HEAVY_WEAPONS_NT))
|
||||||
iChance += gSkillTraitValues.sCtHModifierMortar * max(0, 100 - gSkillTraitValues.ubHWMortarCtHPenaltyReduction * NUM_SKILL_TRAITS(pSoldier, HEAVY_WEAPONS_NT)) / 100;
|
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
|
// This feature is available only if not having new traits on - SANDRO
|
||||||
// Also.. this was moved here before the Heavy Weapons bonus
|
// 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.
|
// 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;
|
iChance = iChance / gGameExternalOptions.ubMortarCTHDivisor;
|
||||||
}
|
}
|
||||||
@@ -10436,7 +10436,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
|
|||||||
|
|
||||||
// ADJUST FOR RANGE
|
// ADJUST FOR RANGE
|
||||||
|
|
||||||
if ( Item[usHandItem].mortar && iRange < MIN_MORTAR_RANGE)
|
if (ItemIsMortar(usHandItem) && iRange < MIN_MORTAR_RANGE)
|
||||||
{
|
{
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
@@ -10552,7 +10552,7 @@ void ChangeWeaponMode( SOLDIERTYPE * pSoldier )
|
|||||||
|
|
||||||
// Flugente: if we are in a GL fire mode, switch between impact/delayed mode
|
// 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) ||
|
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 &&
|
!pSoldier->usGLDelayMode &&
|
||||||
!gGameExternalOptions.fDelayedGrenadeExplosion)
|
!gGameExternalOptions.fDelayedGrenadeExplosion)
|
||||||
{
|
{
|
||||||
@@ -10646,7 +10646,7 @@ void ChangeScopeMode( SOLDIERTYPE * pSoldier, INT32 iTrgGridNo )
|
|||||||
INT8 bOldAimTime = pSoldier->aiData.bShownAimTime;
|
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
|
// 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;
|
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);
|
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 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;
|
pSoldier->bScopeMode = USE_BEST_SCOPE;
|
||||||
}
|
}
|
||||||
// changing scope mode can change number of aiming levels, we should reset the aiming variable here
|
// 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;
|
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]));
|
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
|
// FIRING 1-HANDED WEAPONS
|
||||||
if ( !(Item[ usInHand ].twohanded ) ) //JMich todo: underbarrel
|
if ( !ItemIsTwoHanded(usInHand) ) //JMich todo: underbarrel
|
||||||
{
|
{
|
||||||
if (pSoldier->inv[SECONDHANDPOS].exists() != false)
|
if (pSoldier->inv[SECONDHANDPOS].exists() != false)
|
||||||
{
|
{
|
||||||
@@ -11553,7 +11553,7 @@ FLOAT CalcNewChanceToHitBaseWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, IN
|
|||||||
}
|
}
|
||||||
|
|
||||||
// HEAVY WEAPON in OLD trait system
|
// 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.
|
// Penalty for shooting heavy weapons (launchers). Heavy Weapons skill halves this, once per skill level.
|
||||||
FLOAT fTempPenalty = (gGameCTHConstants.BASE_HEAVY_WEAPON * fGunBaseDifficulty) - fGunBaseDifficulty;
|
FLOAT fTempPenalty = (gGameCTHConstants.BASE_HEAVY_WEAPON * fGunBaseDifficulty) - fGunBaseDifficulty;
|
||||||
@@ -11883,7 +11883,7 @@ FLOAT CalcNewChanceToHitAimWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIRING 1-HANDED WEAPONS
|
// 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)
|
if (pSoldier->inv[SECONDHANDPOS].exists() != false)
|
||||||
{
|
{
|
||||||
@@ -11922,7 +11922,7 @@ FLOAT CalcNewChanceToHitAimWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT
|
|||||||
}
|
}
|
||||||
|
|
||||||
// HEAVY WEAPON in OLD trait system
|
// 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.
|
// Penalty for shooting heavy weapons (launchers). Heavy Weapons skill halves this, once per skill level.
|
||||||
FLOAT fTempPenalty = (gGameCTHConstants.AIM_HEAVY_WEAPON * fGunAimDifficulty) - fGunAimDifficulty;
|
FLOAT fTempPenalty = (gGameCTHConstants.AIM_HEAVY_WEAPON * fGunAimDifficulty) - fGunAimDifficulty;
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ INT32 FindWorldItemForTripwireInGridNo( INT32 sGridNo, INT8 bLevel, BOOLEAN fKno
|
|||||||
{
|
{
|
||||||
pObj = &( gWorldItems[ gWorldBombs[ uiBombIndex ].iItemIndex ].object );
|
pObj = &( gWorldItems[ gWorldBombs[ uiBombIndex ].iItemIndex ].object );
|
||||||
|
|
||||||
if ( pObj && Item[pObj->usItem].tripwire )
|
if ( pObj && ItemIsTripwire(pObj->usItem) )
|
||||||
{
|
{
|
||||||
if ( !fKnown )
|
if ( !fKnown )
|
||||||
return( gWorldBombs[ uiBombIndex ].iItemIndex );
|
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 );
|
ArmBomb( &dummyItem.object, BOMB_PRESSURE );
|
||||||
dummyItem.usFlags |= WORLD_ITEM_ARMED_BOMB;
|
dummyItem.usFlags |= WORLD_ITEM_ARMED_BOMB;
|
||||||
|
|||||||
+19
-18
@@ -1888,7 +1888,7 @@ UINT32 GetTankCannonIndex()
|
|||||||
{
|
{
|
||||||
for ( UINT32 i = 0; i < gMAXITEMS_READ; ++i )
|
for ( UINT32 i = 0; i < gMAXITEMS_READ; ++i )
|
||||||
{
|
{
|
||||||
if (Item[i].cannon)
|
if (ItemIsCannon(i))
|
||||||
{
|
{
|
||||||
return Item[i].uiIndex;
|
return Item[i].uiIndex;
|
||||||
}
|
}
|
||||||
@@ -2239,23 +2239,24 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
|
|||||||
|
|
||||||
// fall through
|
// fall through
|
||||||
case AI_ACTION_FIRE_GUN: // shoot at nearby opponent
|
case AI_ACTION_FIRE_GUN: // shoot at nearby opponent
|
||||||
case AI_ACTION_THROW_KNIFE: // throw knife at nearby opponent
|
case AI_ACTION_THROW_KNIFE: // throw knife at nearby opponent
|
||||||
// randomly decide whether to say civ quote
|
// randomly decide whether to say civ quote
|
||||||
|
{
|
||||||
if (Item[pSoldier->inv[HANDPOS].usItem].usItemClass == IC_GUN )
|
UINT16 usItem = pSoldier->inv[HANDPOS].usItem;
|
||||||
PossiblyStartEnemyTaunt( pSoldier, TAUNT_FIRE_GUN, pSoldier->ubOppNum );
|
if (Item[usItem].usItemClass == IC_GUN)
|
||||||
else if (Item[pSoldier->inv[HANDPOS].usItem].grenadelauncher || Item[pSoldier->inv[HANDPOS].usItem].mortar || Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher )
|
PossiblyStartEnemyTaunt(pSoldier, TAUNT_FIRE_GUN, pSoldier->ubOppNum);
|
||||||
PossiblyStartEnemyTaunt( pSoldier, TAUNT_FIRE_LAUNCHER, pSoldier->ubOppNum );
|
else if (ItemIsGrenadeLauncher(usItem) || ItemIsMortar(usItem) || ItemIsRocketLauncher(usItem))
|
||||||
else if (pSoldier->aiData.bAction == AI_ACTION_TOSS_PROJECTILE && Item[pSoldier->inv[HANDPOS].usItem].usItemClass == IC_THROWN && !Item[pSoldier->inv[HANDPOS].usItem].flare )
|
PossiblyStartEnemyTaunt(pSoldier, TAUNT_FIRE_LAUNCHER, pSoldier->ubOppNum);
|
||||||
PossiblyStartEnemyTaunt( pSoldier, TAUNT_THROW_KNIFE, pSoldier->ubOppNum );
|
else if (pSoldier->aiData.bAction == AI_ACTION_TOSS_PROJECTILE && Item[usItem].usItemClass == IC_THROWN && !ItemIsFlare(usItem))
|
||||||
else if (pSoldier->aiData.bAction == AI_ACTION_KNIFE_MOVE )
|
PossiblyStartEnemyTaunt(pSoldier, TAUNT_THROW_KNIFE, pSoldier->ubOppNum);
|
||||||
{
|
else if (pSoldier->aiData.bAction == AI_ACTION_KNIFE_MOVE)
|
||||||
if (Item[pSoldier->inv[HANDPOS].usItem].usItemClass == IC_BLADE )
|
{
|
||||||
PossiblyStartEnemyTaunt( pSoldier, TAUNT_CHARGE_BLADE );
|
if (Item[usItem].usItemClass == IC_BLADE)
|
||||||
else if (Item[pSoldier->inv[HANDPOS].usItem].usItemClass == IC_PUNCH )
|
PossiblyStartEnemyTaunt(pSoldier, TAUNT_CHARGE_BLADE);
|
||||||
PossiblyStartEnemyTaunt( pSoldier, TAUNT_CHARGE_HTH );
|
else if (Item[usItem].usItemClass == IC_PUNCH)
|
||||||
}
|
PossiblyStartEnemyTaunt(pSoldier, TAUNT_CHARGE_HTH);
|
||||||
|
}
|
||||||
|
}
|
||||||
// CC, ATE here - I put in some TEMP randomness...
|
// CC, ATE here - I put in some TEMP randomness...
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ INT8 OKToAttack(SOLDIERTYPE * pSoldier, int target)
|
|||||||
|
|
||||||
if ( Item[pSoldier->inv[HANDPOS].usItem].usItemClass == IC_GUN)
|
if ( Item[pSoldier->inv[HANDPOS].usItem].usItemClass == IC_GUN)
|
||||||
{
|
{
|
||||||
if ( Item[pSoldier->inv[HANDPOS].usItem].cannon )
|
if (ItemIsCannon(pSoldier->inv[HANDPOS].usItem))
|
||||||
{
|
{
|
||||||
// look for another tank shell ELSEWHERE IN INVENTORY
|
// look for another tank shell ELSEWHERE IN INVENTORY
|
||||||
if ( FindLaunchable( pSoldier, pSoldier->inv[HANDPOS].usItem ) == NO_SLOT )
|
if ( FindLaunchable( pSoldier, pSoldier->inv[HANDPOS].usItem ) == NO_SLOT )
|
||||||
|
|||||||
+35
-34
@@ -63,7 +63,7 @@ void LoadWeaponIfNeeded(SOLDIERTYPE *pSoldier)
|
|||||||
usInHand = GetAttachedGrenadeLauncher(&pSoldier->inv[HANDPOS]);
|
usInHand = GetAttachedGrenadeLauncher(&pSoldier->inv[HANDPOS]);
|
||||||
|
|
||||||
// if he's got a MORTAR in his hand, make sure he has a MORTARSHELL avail.
|
// if he's got a MORTAR in his hand, make sure he has a MORTARSHELL avail.
|
||||||
if (Item[usInHand].mortar )
|
if (ItemIsMortar(usInHand))
|
||||||
{
|
{
|
||||||
// bPayloadPocket = FindObj( pSoldier, MORTAR_SHELL );
|
// bPayloadPocket = FindObj( pSoldier, MORTAR_SHELL );
|
||||||
bPayloadPocket = FindLaunchable( pSoldier, usInHand );
|
bPayloadPocket = FindLaunchable( pSoldier, usInHand );
|
||||||
@@ -76,7 +76,7 @@ void LoadWeaponIfNeeded(SOLDIERTYPE *pSoldier)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if he's got a GL in his hand, make sure he has some type of GRENADE avail.
|
// if he's got a GL in his hand, make sure he has some type of GRENADE avail.
|
||||||
else if (Item[usInHand].grenadelauncher )
|
else if (ItemIsGrenadeLauncher(usInHand))
|
||||||
{
|
{
|
||||||
bPayloadPocket = FindGLGrenade( pSoldier );
|
bPayloadPocket = FindGLGrenade( pSoldier );
|
||||||
if (bPayloadPocket == NO_SLOT || FindNonSmokeLaunchableAttachment( &pSoldier->inv[HANDPOS],usInHand ) != 0 )
|
if (bPayloadPocket == NO_SLOT || FindNonSmokeLaunchableAttachment( &pSoldier->inv[HANDPOS],usInHand ) != 0 )
|
||||||
@@ -88,7 +88,7 @@ void LoadWeaponIfNeeded(SOLDIERTYPE *pSoldier)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if he's got a RPG7 in his hand, make sure he has some type of RPG avail.
|
// if he's got a RPG7 in his hand, make sure he has some type of RPG avail.
|
||||||
else if (Item[usInHand].rocketlauncher && !Item[usInHand].singleshotrocketlauncher )
|
else if (ItemIsRocketLauncher(usInHand) && !ItemIsSingleShotRocketLauncher(usInHand))
|
||||||
{
|
{
|
||||||
bPayloadPocket = FindLaunchable (pSoldier, usInHand );
|
bPayloadPocket = FindLaunchable (pSoldier, usInHand );
|
||||||
if (bPayloadPocket == NO_SLOT)
|
if (bPayloadPocket == NO_SLOT)
|
||||||
@@ -96,7 +96,7 @@ void LoadWeaponIfNeeded(SOLDIERTYPE *pSoldier)
|
|||||||
return; // no grenades, can't fire
|
return; // no grenades, can't fire
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Item[usInHand].cannon )
|
else if (ItemIsCannon(usInHand))
|
||||||
{
|
{
|
||||||
bPayloadPocket = FindLaunchable( pSoldier, usInHand );
|
bPayloadPocket = FindLaunchable( pSoldier, usInHand );
|
||||||
if (bPayloadPocket == NO_SLOT)
|
if (bPayloadPocket == NO_SLOT)
|
||||||
@@ -444,7 +444,7 @@ void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot)
|
|||||||
// sevenfm: take into account direction when checking stance
|
// sevenfm: take into account direction when checking stance
|
||||||
// sevenfm: shoot heavy guns in standing stance only when using hip fire
|
// sevenfm: shoot heavy guns in standing stance only when using hip fire
|
||||||
if (pSoldier->InternalIsValidStance(AIDirection(pSoldier->sGridNo, sTarget), ubStance) &&
|
if (pSoldier->InternalIsValidStance(AIDirection(pSoldier->sGridNo, sTarget), ubStance) &&
|
||||||
(pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD || !Weapon[pSoldier->usAttackingWeapon].HeavyGun || !Item[pSoldier->usAttackingWeapon].twohanded || !gGameExternalOptions.ubAllowAlternativeWeaponHolding))
|
(pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD || !Weapon[pSoldier->usAttackingWeapon].HeavyGun || !ItemIsTwoHanded(pSoldier->usAttackingWeapon) || !gGameExternalOptions.ubAllowAlternativeWeaponHolding))
|
||||||
{
|
{
|
||||||
sStanceAPcost = GetAPsToChangeStance(pSoldier, ubStance);
|
sStanceAPcost = GetAPsToChangeStance(pSoldier, ubStance);
|
||||||
if(sStanceAPcost)
|
if(sStanceAPcost)
|
||||||
@@ -887,7 +887,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if he's got a MORTAR in his hand, make sure he has a MORTARSHELL avail.
|
// if he's got a MORTAR in his hand, make sure he has a MORTARSHELL avail.
|
||||||
if (Item[usInHand].mortar )
|
if (ItemIsMortar(usInHand))
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcbestthrow: buddy's got a mortar");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcbestthrow: buddy's got a mortar");
|
||||||
bPayloadPocket = FindNonSmokeLaunchable(pSoldier, usInHand);
|
bPayloadPocket = FindNonSmokeLaunchable(pSoldier, usInHand);
|
||||||
@@ -911,7 +911,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
fMortar = TRUE;
|
fMortar = TRUE;
|
||||||
}
|
}
|
||||||
// if he's got a GL in his hand, make sure he has some type of GRENADE avail.
|
// if he's got a GL in his hand, make sure he has some type of GRENADE avail.
|
||||||
else if (Item[usInHand].grenadelauncher )
|
else if (ItemIsGrenadeLauncher(usInHand))
|
||||||
{
|
{
|
||||||
// use up pocket 2 first, they get left as drop items
|
// use up pocket 2 first, they get left as drop items
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcbestthrow: buddy's got a GL");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcbestthrow: buddy's got a GL");
|
||||||
@@ -943,7 +943,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
}
|
}
|
||||||
fGrenadeLauncher = TRUE;
|
fGrenadeLauncher = TRUE;
|
||||||
}
|
}
|
||||||
else if ( Item[usInHand].rocketlauncher )
|
else if (ItemIsRocketLauncher(usInHand))
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcbestthrow: buddy's got a rocket launcher");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcbestthrow: buddy's got a rocket launcher");
|
||||||
|
|
||||||
@@ -952,7 +952,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// put in hand
|
// put in hand
|
||||||
bPayloadPocket = HANDPOS;//dnl ch63 240813
|
bPayloadPocket = HANDPOS;//dnl ch63 240813
|
||||||
if (Item[usInHand].singleshotrocketlauncher)
|
if (ItemIsSingleShotRocketLauncher(usInHand))
|
||||||
{
|
{
|
||||||
// sevenfm: for single shot rocket launchers, use buddy item instead
|
// sevenfm: for single shot rocket launchers, use buddy item instead
|
||||||
if (Item[usInHand].usBuddyItem && Item[Item[usInHand].usBuddyItem].usItemClass & IC_EXPLOSV)
|
if (Item[usInHand].usBuddyItem && Item[Item[usInHand].usBuddyItem].usItemClass & IC_EXPLOSV)
|
||||||
@@ -983,7 +983,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
}
|
}
|
||||||
fRocketLauncher = TRUE;
|
fRocketLauncher = TRUE;
|
||||||
}
|
}
|
||||||
else if (Item[usInHand].cannon )
|
else if (ItemIsCannon(usInHand))
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcbestthrow: buddy's got a tank");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcbestthrow: buddy's got a tank");
|
||||||
bPayloadPocket = FindNonSmokeLaunchable(pSoldier, usInHand);
|
bPayloadPocket = FindNonSmokeLaunchable(pSoldier, usInHand);
|
||||||
@@ -1008,7 +1008,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
usGrenade = pSoldier->inv[bPayloadPocket].usItem;
|
usGrenade = pSoldier->inv[bPayloadPocket].usItem;
|
||||||
ubSafetyMargin = (UINT8)(1 + max(Explosive[Item[usGrenade].ubClassIndex].ubRadius, min((UINT8)TACTICAL_RANGE / 4, Explosive[Item[usGrenade].ubClassIndex].ubFragRange / CELL_X_SIZE)));
|
ubSafetyMargin = (UINT8)(1 + max(Explosive[Item[usGrenade].ubClassIndex].ubRadius, min((UINT8)TACTICAL_RANGE / 4, Explosive[Item[usGrenade].ubClassIndex].ubFragRange / CELL_X_SIZE)));
|
||||||
|
|
||||||
if ( Item[usGrenade].flare )
|
if (ItemIsFlare(usGrenade))
|
||||||
{
|
{
|
||||||
// JA2Gold: light isn't as nasty as explosives
|
// JA2Gold: light isn't as nasty as explosives
|
||||||
ubSafetyMargin /= 2;
|
ubSafetyMargin /= 2;
|
||||||
@@ -1032,7 +1032,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// use flares only at night
|
// use flares only at night
|
||||||
if (usGrenade != NOTHING &&
|
if (usGrenade != NOTHING &&
|
||||||
Item[usGrenade].flare &&
|
ItemIsFlare(usGrenade) &&
|
||||||
!NightLight())
|
!NightLight())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -1121,7 +1121,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// limit explosives type when attacking zombies
|
// limit explosives type when attacking zombies
|
||||||
if (usGrenade != NOTHING &&
|
if (usGrenade != NOTHING &&
|
||||||
!Item[usGrenade].flare &&
|
!ItemIsFlare(usGrenade) &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_NORMAL &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_NORMAL &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_CREATUREGAS &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_CREATUREGAS &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_BURNABLEGAS &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_BURNABLEGAS &&
|
||||||
@@ -1143,7 +1143,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// limit explosives type when attacking robots, vehicles and tanks
|
// limit explosives type when attacking robots, vehicles and tanks
|
||||||
if (usGrenade != NOTHING &&
|
if (usGrenade != NOTHING &&
|
||||||
!Item[usGrenade].flare &&
|
!ItemIsFlare(usGrenade) &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_NORMAL &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_NORMAL &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_CREATUREGAS &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_CREATUREGAS &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_BURNABLEGAS &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_BURNABLEGAS &&
|
||||||
@@ -1161,7 +1161,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// limit explosives type when attacking collapsed enemies
|
// limit explosives type when attacking collapsed enemies
|
||||||
if (usGrenade != NOTHING &&
|
if (usGrenade != NOTHING &&
|
||||||
!Item[usGrenade].flare &&
|
!ItemIsFlare(usGrenade) &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_NORMAL &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_NORMAL &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_CREATUREGAS &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_CREATUREGAS &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_BURNABLEGAS &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType != EXPLOSV_BURNABLEGAS &&
|
||||||
@@ -1173,7 +1173,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// don't use flare if soldier is in light
|
// don't use flare if soldier is in light
|
||||||
if (usGrenade != NOTHING &&
|
if (usGrenade != NOTHING &&
|
||||||
Item[usGrenade].flare &&
|
ItemIsFlare(usGrenade) &&
|
||||||
InLightAtNight(pOpponent->sGridNo, pOpponent->pathing.bLevel))
|
InLightAtNight(pOpponent->sGridNo, pOpponent->pathing.bLevel))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -1181,13 +1181,13 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// don't use flares against opponents on roof
|
// don't use flares against opponents on roof
|
||||||
if (usGrenade != NOTHING &&
|
if (usGrenade != NOTHING &&
|
||||||
Item[usGrenade].flare &&
|
ItemIsFlare(usGrenade) &&
|
||||||
pOpponent->pathing.bLevel > 0)
|
pOpponent->pathing.bLevel > 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Item[usInHand].mortar)
|
if (ItemIsMortar(usInHand))
|
||||||
{
|
{
|
||||||
// active KNOWN opponent, remember where he is so that we DO blow him up!
|
// active KNOWN opponent, remember where he is so that we DO blow him up!
|
||||||
if (bPersonalKnowledge == SEEN_CURRENTLY ||
|
if (bPersonalKnowledge == SEEN_CURRENTLY ||
|
||||||
@@ -1209,7 +1209,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
continue; // next soldier
|
continue; // next soldier
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Item[usInHand].rocketlauncher)
|
else if (ItemIsRocketLauncher(usInHand))
|
||||||
{
|
{
|
||||||
if (bPersonalKnowledge == SEEN_CURRENTLY || bPublicKnowledge == SEEN_CURRENTLY)
|
if (bPersonalKnowledge == SEEN_CURRENTLY || bPublicKnowledge == SEEN_CURRENTLY)
|
||||||
{
|
{
|
||||||
@@ -1231,7 +1231,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( Item[usInHand].grenadelauncher )
|
else if(ItemIsGrenadeLauncher(usInHand))
|
||||||
{
|
{
|
||||||
if (bPersonalKnowledge == SEEN_CURRENTLY || bPublicKnowledge == SEEN_CURRENTLY)
|
if (bPersonalKnowledge == SEEN_CURRENTLY || bPublicKnowledge == SEEN_CURRENTLY)
|
||||||
{
|
{
|
||||||
@@ -1262,7 +1262,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
else if ((bKnowledge == SEEN_THIS_TURN || bKnowledge == SEEN_LAST_TURN || bKnowledge == HEARD_THIS_TURN || bKnowledge == HEARD_LAST_TURN) &&
|
else if ((bKnowledge == SEEN_THIS_TURN || bKnowledge == SEEN_LAST_TURN || bKnowledge == HEARD_THIS_TURN || bKnowledge == HEARD_LAST_TURN) &&
|
||||||
!TileIsOutOfBounds(KnownLocation(pSoldier, pOpponent->ubID)) &&
|
!TileIsOutOfBounds(KnownLocation(pSoldier, pOpponent->ubID)) &&
|
||||||
CloseEnoughForGrenadeToss(pOpponent->sGridNo, KnownLocation(pSoldier, pOpponent->ubID)) &&
|
CloseEnoughForGrenadeToss(pOpponent->sGridNo, KnownLocation(pSoldier, pOpponent->ubID)) &&
|
||||||
(usGrenade != NOTHING && Item[usGrenade].flare || pSoldier->aiData.bUnderFire || pSoldier->aiData.bShock))
|
(usGrenade != NOTHING && ItemIsFlare(usGrenade) || pSoldier->aiData.bUnderFire || pSoldier->aiData.bShock))
|
||||||
{
|
{
|
||||||
sOpponentTile[ubOpponentCnt] = KnownLocation(pSoldier, pOpponent->ubID);
|
sOpponentTile[ubOpponentCnt] = KnownLocation(pSoldier, pOpponent->ubID);
|
||||||
bOpponentLevel[ubOpponentCnt] = KnownLevel(pSoldier, pOpponent->ubID);
|
bOpponentLevel[ubOpponentCnt] = KnownLevel(pSoldier, pOpponent->ubID);
|
||||||
@@ -1299,7 +1299,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// don't spare non lethal grenades
|
// don't spare non lethal grenades
|
||||||
if (usGrenade != NOTHING &&
|
if (usGrenade != NOTHING &&
|
||||||
(Item[usGrenade].flare ||
|
(ItemIsFlare(usGrenade) ||
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType == EXPLOSV_STUN ||
|
Explosive[Item[usGrenade].ubClassIndex].ubType == EXPLOSV_STUN ||
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType == EXPLOSV_SMOKE ||
|
Explosive[Item[usGrenade].ubClassIndex].ubType == EXPLOSV_SMOKE ||
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType == EXPLOSV_TEARGAS ||
|
Explosive[Item[usGrenade].ubClassIndex].ubType == EXPLOSV_TEARGAS ||
|
||||||
@@ -1328,7 +1328,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
// militia always try to spare grenades unless under attack or using flares
|
// militia always try to spare grenades unless under attack or using flares
|
||||||
if (pSoldier->bTeam == MILITIA_TEAM &&
|
if (pSoldier->bTeam == MILITIA_TEAM &&
|
||||||
!pSoldier->aiData.bUnderFire &&
|
!pSoldier->aiData.bUnderFire &&
|
||||||
!Item[usGrenade].flare &&
|
!ItemIsFlare(usGrenade) &&
|
||||||
!fRocketLauncher)
|
!fRocketLauncher)
|
||||||
{
|
{
|
||||||
fSpare = TRUE;
|
fSpare = TRUE;
|
||||||
@@ -1563,7 +1563,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
ubChanceToGetThrough = 100 - (UINT8) uiPenalty;
|
ubChanceToGetThrough = 100 - (UINT8) uiPenalty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Item[usInHand].mortar &&
|
else if (ItemIsMortar(usInHand) &&
|
||||||
usGrenade != NOTHING &&
|
usGrenade != NOTHING &&
|
||||||
Explosive[Item[usGrenade].ubClassIndex].ubType == EXPLOSV_NORMAL &&
|
Explosive[Item[usGrenade].ubClassIndex].ubType == EXPLOSV_NORMAL &&
|
||||||
bOpponentLevel[ubLoop] == 0 &&
|
bOpponentLevel[ubLoop] == 0 &&
|
||||||
@@ -1589,7 +1589,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
|
|
||||||
// this is try to minimize enemies wasting their (few) mortar shells or LAWs
|
// this is try to minimize enemies wasting their (few) mortar shells or LAWs
|
||||||
// they won't use them on less than 2 targets as long as half life left
|
// they won't use them on less than 2 targets as long as half life left
|
||||||
if ((Item[usInHand].mortar || Item[usInHand].rocketlauncher) && (ubOppsInRange < 2) &&
|
if ((ItemIsMortar(usInHand) || ItemIsRocketLauncher(usInHand)) && (ubOppsInRange < 2) &&
|
||||||
(!gGameExternalOptions.fEnemyTanksDontSpareShells || !ARMED_VEHICLE(pSoldier)) &&
|
(!gGameExternalOptions.fEnemyTanksDontSpareShells || !ARMED_VEHICLE(pSoldier)) &&
|
||||||
!gGameExternalOptions.fEnemiesDontSpareLaunchables)
|
!gGameExternalOptions.fEnemiesDontSpareLaunchables)
|
||||||
{
|
{
|
||||||
@@ -1597,7 +1597,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// limit RPG use, unless can hit several enemies, shooting at tank or opponent is in a room
|
// limit RPG use, unless can hit several enemies, shooting at tank or opponent is in a room
|
||||||
if (Item[usInHand].rocketlauncher &&
|
if (ItemIsRocketLauncher(usInHand) &&
|
||||||
ubOppsInRange < 2 &&
|
ubOppsInRange < 2 &&
|
||||||
!ARMED_VEHICLE(MercPtrs[ubOpponentID[ubLoop]]) &&
|
!ARMED_VEHICLE(MercPtrs[ubOpponentID[ubLoop]]) &&
|
||||||
(!InARoom(sOpponentTile[ubLoop], NULL) || pSoldier->bTeam != ENEMY_TEAM))
|
(!InARoom(sOpponentTile[ubLoop], NULL) || pSoldier->bTeam != ENEMY_TEAM))
|
||||||
@@ -1687,7 +1687,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
// this is try to minimize enemies wasting their (limited) toss attacks:
|
// this is try to minimize enemies wasting their (limited) toss attacks:
|
||||||
UINT8 ubMinChanceToReallyHit;
|
UINT8 ubMinChanceToReallyHit;
|
||||||
|
|
||||||
if( usGrenade != NOTHING && Item[usGrenade].flare )
|
if( usGrenade != NOTHING && ItemIsFlare(usGrenade) )
|
||||||
{
|
{
|
||||||
ubMinChanceToReallyHit = 30;
|
ubMinChanceToReallyHit = 30;
|
||||||
}
|
}
|
||||||
@@ -2305,11 +2305,12 @@ INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *
|
|||||||
// ubExplosiveIndex = Item[ C1 ].ubClassIndex;
|
// ubExplosiveIndex = Item[ C1 ].ubClassIndex;
|
||||||
// break;
|
// break;
|
||||||
//default:
|
//default:
|
||||||
if ( Item[pSoldier->inv[ ubItemPos ].usItem].singleshotrocketlauncher )
|
UINT16 usItem = pSoldier->inv[ubItemPos].usItem;
|
||||||
|
if (ItemIsSingleShotRocketLauncher(usItem))
|
||||||
ubExplosiveIndex = Item[ C1 ].ubClassIndex;
|
ubExplosiveIndex = Item[ C1 ].ubClassIndex;
|
||||||
else if ( Item[pSoldier->inv[ ubItemPos ].usItem].rocketlauncher || Item[pSoldier->inv[ ubItemPos ].usItem].grenadelauncher || Item[pSoldier->inv[ ubItemPos ].usItem].mortar )
|
else if (ItemIsRocketLauncher(usItem) || ItemIsGrenadeLauncher(usItem) || ItemIsMortar(usItem) )
|
||||||
{
|
{
|
||||||
OBJECTTYPE* pAttachment = FindLaunchableAttachment(&pSoldier->inv[ ubItemPos ],pSoldier->inv[ ubItemPos ].usItem ) ;
|
OBJECTTYPE* pAttachment = FindLaunchableAttachment(&pSoldier->inv[ ubItemPos ],usItem ) ;
|
||||||
if ( pAttachment->exists() )
|
if ( pAttachment->exists() )
|
||||||
ubExplosiveIndex = Item[pAttachment->usItem].ubClassIndex;
|
ubExplosiveIndex = Item[pAttachment->usItem].ubClassIndex;
|
||||||
else
|
else
|
||||||
@@ -2331,7 +2332,7 @@ INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *
|
|||||||
// break;
|
// break;
|
||||||
//}
|
//}
|
||||||
// JA2Gold: added
|
// JA2Gold: added
|
||||||
if ( Item[pSoldier->inv[ubItemPos].usItem].flare )
|
if (ItemIsFlare(pSoldier->inv[ubItemPos].usItem))
|
||||||
{
|
{
|
||||||
return( 5 * ( LightTrueLevel( pOpponent->sGridNo, pOpponent->pathing.bLevel ) - NORMAL_LIGHTLEVEL_DAY ) );
|
return( 5 * ( LightTrueLevel( pOpponent->sGridNo, pOpponent->pathing.bLevel ) - NORMAL_LIGHTLEVEL_DAY ) );
|
||||||
}
|
}
|
||||||
@@ -2496,7 +2497,7 @@ INT32 EstimateStabDamage( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 u
|
|||||||
{
|
{
|
||||||
if (gGameOptions.fNewTraitSystem)
|
if (gGameOptions.fNewTraitSystem)
|
||||||
{
|
{
|
||||||
if (!pSoldier->usAttackingWeapon || Item[usItem].brassknuckles)
|
if (!pSoldier->usAttackingWeapon || ItemIsBrassKnuckles(usItem))
|
||||||
{
|
{
|
||||||
// add bonus for martial arts
|
// add bonus for martial arts
|
||||||
if (HAS_SKILL_TRAIT(pSoldier, MARTIAL_ARTS_NT))
|
if (HAS_SKILL_TRAIT(pSoldier, MARTIAL_ARTS_NT))
|
||||||
@@ -2765,13 +2766,13 @@ INT8 CanNPCAttack(SOLDIERTYPE *pSoldier)
|
|||||||
RearrangePocket( pSoldier, HANDPOS, bWeaponIn, FOREVER );
|
RearrangePocket( pSoldier, HANDPOS, bWeaponIn, FOREVER );
|
||||||
// look for another weapon if this one is 1-handed
|
// look for another weapon if this one is 1-handed
|
||||||
// if ( (Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass == IC_GUN) && !(Item[ pSoldier->inv[ HANDPOS ].usItem ].fFlags & ITEM_TWO_HANDED ) )
|
// if ( (Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass == IC_GUN) && !(Item[ pSoldier->inv[ HANDPOS ].usItem ].fFlags & ITEM_TWO_HANDED ) )
|
||||||
if ( (Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass == IC_GUN) && !(Item[ pSoldier->inv[ HANDPOS ].usItem ].twohanded ) )
|
if ( (Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass == IC_GUN) && !ItemIsTwoHanded(pSoldier->inv[ HANDPOS ].usItem) )
|
||||||
{
|
{
|
||||||
// look for another pistol/SMG if available
|
// look for another pistol/SMG if available
|
||||||
// CHRISL: Change final parameter to use dynamic pocket definition
|
// CHRISL: Change final parameter to use dynamic pocket definition
|
||||||
bWeaponIn = FindAIUsableObjClassWithin( pSoldier, IC_WEAPON, BIGPOCKSTART, NUM_INV_SLOTS );
|
bWeaponIn = FindAIUsableObjClassWithin( pSoldier, IC_WEAPON, BIGPOCKSTART, NUM_INV_SLOTS );
|
||||||
// if (bWeaponIn != NO_SLOT && (Item[ pSoldier->inv[ bWeaponIn ].usItem ].usItemClass == IC_GUN) && !(Item[ pSoldier->inv[ bWeaponIn ].usItem ].fFlags & ITEM_TWO_HANDED ) )
|
// if (bWeaponIn != NO_SLOT && (Item[ pSoldier->inv[ bWeaponIn ].usItem ].usItemClass == IC_GUN) && !(Item[ pSoldier->inv[ bWeaponIn ].usItem ].fFlags & ITEM_TWO_HANDED ) )
|
||||||
if (bWeaponIn != NO_SLOT && (Item[ pSoldier->inv[ bWeaponIn ].usItem ].usItemClass == IC_GUN) && !(Item[ pSoldier->inv[ bWeaponIn ].usItem ].twohanded ) )
|
if (bWeaponIn != NO_SLOT && (Item[ pSoldier->inv[ bWeaponIn ].usItem ].usItemClass == IC_GUN) && !ItemIsTwoHanded(pSoldier->inv[ bWeaponIn ].usItem) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"cannpcattack: swapping weapon into holster");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"cannpcattack: swapping weapon into holster");
|
||||||
RearrangePocket( pSoldier, SECONDHANDPOS, bWeaponIn, FOREVER );
|
RearrangePocket( pSoldier, SECONDHANDPOS, bWeaponIn, FOREVER );
|
||||||
|
|||||||
+16
-15
@@ -2735,15 +2735,16 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier)
|
|||||||
if (BestThrow.ubPossible)
|
if (BestThrow.ubPossible)
|
||||||
{
|
{
|
||||||
// sevenfm: allow using mortars, grenade launchers, flares and grenades in RED state
|
// sevenfm: allow using mortars, grenade launchers, flares and grenades in RED state
|
||||||
if (Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].mortar ||
|
UINT16 usItem = pSoldier->inv[BestThrow.bWeaponIn].usItem;
|
||||||
//Item[pSoldier->inv[ BestThrow.bWeaponIn ].usItem].cannon ||
|
if (ItemIsMortar(usItem) ||
|
||||||
Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].rocketlauncher ||
|
//Item[usItem].cannon ||
|
||||||
Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].grenadelauncher ||
|
ItemIsRocketLauncher(usItem) ||
|
||||||
Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].flare ||
|
ItemIsGrenadeLauncher(usItem) ||
|
||||||
Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].usItemClass & IC_GRENADE)
|
ItemIsFlare(usItem) ||
|
||||||
|
Item[usItem].usItemClass & IC_GRENADE)
|
||||||
{
|
{
|
||||||
// if firing mortar make sure we have room
|
// if firing mortar make sure we have room
|
||||||
if (Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].mortar)
|
if (ItemIsMortar(usItem))
|
||||||
{
|
{
|
||||||
DebugAI(AI_MSG_INFO, pSoldier, String("using mortar, check room to deploy"));
|
DebugAI(AI_MSG_INFO, pSoldier, String("using mortar, check room to deploy"));
|
||||||
ubOpponentDir = AIDirection(pSoldier->sGridNo, BestThrow.sTarget);
|
ubOpponentDir = AIDirection(pSoldier->sGridNo, BestThrow.sTarget);
|
||||||
@@ -5503,7 +5504,7 @@ INT16 ubMinAPCost;
|
|||||||
if (BestThrow.ubPossible)
|
if (BestThrow.ubPossible)
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"good throw possible");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"good throw possible");
|
||||||
if ( Item[pSoldier->inv[ BestThrow.bWeaponIn ].usItem].mortar )
|
if (ItemIsMortar(pSoldier->inv[ BestThrow.bWeaponIn ].usItem))
|
||||||
{
|
{
|
||||||
ubOpponentDir = AIDirection(pSoldier->sGridNo, BestThrow.sTarget);
|
ubOpponentDir = AIDirection(pSoldier->sGridNo, BestThrow.sTarget);
|
||||||
|
|
||||||
@@ -6323,7 +6324,7 @@ INT16 ubMinAPCost;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SANDRO: more likely to burst when firing from hip
|
// SANDRO: more likely to burst when firing from hip
|
||||||
if ( BestAttack.bScopeMode == USE_ALT_WEAPON_HOLD && Item[pSoldier->inv[BestAttack.bWeaponIn].usItem].twohanded )
|
if ( BestAttack.bScopeMode == USE_ALT_WEAPON_HOLD && ItemIsTwoHanded(pSoldier->inv[BestAttack.bWeaponIn].usItem) )
|
||||||
iChance += 40;
|
iChance += 40;
|
||||||
|
|
||||||
// CHRISL: Changed from a simple flag to two externalized values for more modder control over AI suppression
|
// CHRISL: Changed from a simple flag to two externalized values for more modder control over AI suppression
|
||||||
@@ -6440,7 +6441,7 @@ L_NEWAIM:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SANDRO: more likely to burst when firing from hip
|
// SANDRO: more likely to burst when firing from hip
|
||||||
if ( BestAttack.bScopeMode == USE_ALT_WEAPON_HOLD && Item[pSoldier->inv[BestAttack.bWeaponIn].usItem].twohanded )
|
if ( BestAttack.bScopeMode == USE_ALT_WEAPON_HOLD && ItemIsTwoHanded(pSoldier->inv[BestAttack.bWeaponIn].usItem) )
|
||||||
iChance += 40;
|
iChance += 40;
|
||||||
|
|
||||||
// CHRISL: Changed from a simple flag to two externalized values for more modder control over AI suppression
|
// CHRISL: Changed from a simple flag to two externalized values for more modder control over AI suppression
|
||||||
@@ -8403,10 +8404,10 @@ INT8 ArmedVehicleDecideActionRed( SOLDIERTYPE *pSoldier)
|
|||||||
if ( BestThrow.ubPossible )
|
if ( BestThrow.ubPossible )
|
||||||
{
|
{
|
||||||
// if firing mortar make sure we have room
|
// if firing mortar make sure we have room
|
||||||
//if ( Item[pSoldier->inv[ BestThrow.bWeaponIn ].usItem].mortar ) //comm by ddd
|
UINT16 usItem = pSoldier->inv[BestThrow.bWeaponIn].usItem;
|
||||||
if ( Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].mortar
|
if (ItemIsMortar(usItem)
|
||||||
|| Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].grenadelauncher
|
|| ItemIsGrenadeLauncher(usItem)
|
||||||
|| Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].flare )
|
|| ItemIsFlare(usItem) )
|
||||||
{
|
{
|
||||||
ubOpponentDir = GetDirectionFromGridNo( BestThrow.sTarget, pSoldier );
|
ubOpponentDir = GetDirectionFromGridNo( BestThrow.sTarget, pSoldier );
|
||||||
|
|
||||||
@@ -9799,7 +9800,7 @@ INT8 ArmedVehicleDecideActionBlack( SOLDIERTYPE *pSoldier )
|
|||||||
if ( BestThrow.ubPossible )
|
if ( BestThrow.ubPossible )
|
||||||
{
|
{
|
||||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "good throw possible" );
|
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "good throw possible" );
|
||||||
if ( Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].mortar )
|
if (ItemIsMortar(pSoldier->inv[BestThrow.bWeaponIn].usItem))
|
||||||
{
|
{
|
||||||
ubOpponentDir = (UINT8)GetDirectionFromGridNo( BestThrow.sTarget, pSoldier );
|
ubOpponentDir = (UINT8)GetDirectionFromGridNo( BestThrow.sTarget, pSoldier );
|
||||||
|
|
||||||
|
|||||||
@@ -1987,7 +1987,7 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
|||||||
if ( pItem->usItemClass == IC_GUN && (*pObj)[0]->data.objectStatus >= MINIMUM_REQUIRED_STATUS )
|
if ( pItem->usItemClass == IC_GUN && (*pObj)[0]->data.objectStatus >= MINIMUM_REQUIRED_STATUS )
|
||||||
{
|
{
|
||||||
// maybe this gun has ammo (adjust for whether it is better than ours!)
|
// maybe this gun has ammo (adjust for whether it is better than ours!)
|
||||||
if ( (*pObj)[0]->data.gun.bGunAmmoStatus < 0 || (*pObj)[0]->data.gun.ubGunShotsLeft == 0 || (Item[pObj->usItem].fingerprintid && (*pObj)[0]->data.ubImprintID != NOBODY && (*pObj)[0]->data.ubImprintID != pSoldier->ubID) )
|
if ( (*pObj)[0]->data.gun.bGunAmmoStatus < 0 || (*pObj)[0]->data.gun.ubGunShotsLeft == 0 || (ItemHasFingerPrintID(pObj->usItem) && (*pObj)[0]->data.ubImprintID != NOBODY && (*pObj)[0]->data.ubImprintID != pSoldier->ubID) )
|
||||||
{
|
{
|
||||||
iTempValue = 0;
|
iTempValue = 0;
|
||||||
}
|
}
|
||||||
@@ -2028,7 +2028,7 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
|||||||
if (pItem->usItemClass & IC_WEAPON && (*pObj)[0]->data.objectStatus >= MINIMUM_REQUIRED_STATUS )
|
if (pItem->usItemClass & IC_WEAPON && (*pObj)[0]->data.objectStatus >= MINIMUM_REQUIRED_STATUS )
|
||||||
{
|
{
|
||||||
DebugAI(AI_MSG_INFO, pSoldier, String("weapon has good status"));
|
DebugAI(AI_MSG_INFO, pSoldier, String("weapon has good status"));
|
||||||
if ( (pItem->usItemClass & IC_GUN) && ((*pObj)[0]->data.gun.bGunAmmoStatus < 0 || (*pObj)[0]->data.gun.ubGunShotsLeft == 0 || (( Item[pObj->usItem].fingerprintid ) && (*pObj)[0]->data.ubImprintID != NOBODY && (*pObj)[0]->data.ubImprintID != pSoldier->ubID) ) )
|
if ( (pItem->usItemClass & IC_GUN) && ((*pObj)[0]->data.gun.bGunAmmoStatus < 0 || (*pObj)[0]->data.gun.ubGunShotsLeft == 0 || (ItemHasFingerPrintID(pObj->usItem) && (*pObj)[0]->data.ubImprintID != NOBODY && (*pObj)[0]->data.ubImprintID != pSoldier->ubID) ) )
|
||||||
{
|
{
|
||||||
// jammed or out of ammo, skip it!
|
// jammed or out of ammo, skip it!
|
||||||
DebugAI(AI_MSG_INFO, pSoldier, String("jammed or out of ammo, skip it!"));
|
DebugAI(AI_MSG_INFO, pSoldier, String("jammed or out of ammo, skip it!"));
|
||||||
@@ -2079,7 +2079,7 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
|||||||
if ( pItem->usItemClass & IC_WEAPON && (*pObj)[0]->data.objectStatus >= MINIMUM_REQUIRED_STATUS )
|
if ( pItem->usItemClass & IC_WEAPON && (*pObj)[0]->data.objectStatus >= MINIMUM_REQUIRED_STATUS )
|
||||||
{
|
{
|
||||||
DebugAI(AI_MSG_INFO, pSoldier, String("gun has good status"));
|
DebugAI(AI_MSG_INFO, pSoldier, String("gun has good status"));
|
||||||
if ( (pItem->usItemClass & IC_GUN) && ((*pObj)[0]->data.gun.bGunAmmoStatus < 0 || (*pObj)[0]->data.gun.ubGunShotsLeft == 0 || (( Item[pObj->usItem].fingerprintid ) && (*pObj)[0]->data.ubImprintID != NOBODY && (*pObj)[0]->data.ubImprintID != pSoldier->ubID) ) )
|
if ( (pItem->usItemClass & IC_GUN) && ((*pObj)[0]->data.gun.bGunAmmoStatus < 0 || (*pObj)[0]->data.gun.ubGunShotsLeft == 0 || (ItemHasFingerPrintID(pObj->usItem) && (*pObj)[0]->data.ubImprintID != NOBODY && (*pObj)[0]->data.ubImprintID != pSoldier->ubID) ) )
|
||||||
{
|
{
|
||||||
// jammed or out of ammo, skip it!
|
// jammed or out of ammo, skip it!
|
||||||
DebugAI(AI_MSG_INFO, pSoldier, String("jammed or out of ammo, skip it!"));
|
DebugAI(AI_MSG_INFO, pSoldier, String("jammed or out of ammo, skip it!"));
|
||||||
|
|||||||
+1
-1
@@ -1149,7 +1149,7 @@ UINT8 NPCConsiderReceivingItemFromMerc( UINT8 ubNPC, UINT8 ubMerc, OBJECTTYPE *
|
|||||||
ubLastQuoteRecord = NUM_NPC_QUOTE_RECORDS - 1;
|
ubLastQuoteRecord = NUM_NPC_QUOTE_RECORDS - 1;
|
||||||
|
|
||||||
usItemToConsider = pObj->usItem;
|
usItemToConsider = pObj->usItem;
|
||||||
if ( Item[ usItemToConsider ].usItemClass == IC_GUN && !Item[usItemToConsider].rocketlauncher )
|
if ( Item[ usItemToConsider ].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItemToConsider) )
|
||||||
{
|
{
|
||||||
UINT8 ubWeaponClass;
|
UINT8 ubWeaponClass;
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include "Queen Command.h"
|
#include "Queen Command.h"
|
||||||
|
|
||||||
|
|
||||||
void MakeClosestEnemyChosenOne()
|
void MakeClosestEnemyChosenOne()
|
||||||
{
|
{
|
||||||
UINT32 cnt;
|
UINT32 cnt;
|
||||||
|
|||||||
@@ -1614,7 +1614,7 @@ BOOLEAN DamageSoldierFromBlast( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo
|
|||||||
// Demolitions damage bonus with bombs and mines
|
// Demolitions damage bonus with bombs and mines
|
||||||
if ( HAS_SKILL_TRAIT( MercPtrs[ ubOwner ], DEMOLITIONS_NT ) &&
|
if ( HAS_SKILL_TRAIT( MercPtrs[ ubOwner ], DEMOLITIONS_NT ) &&
|
||||||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_NORMAL && Item[usItem].usItemClass == IC_BOMB &&
|
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_NORMAL && Item[usItem].usItemClass == IC_BOMB &&
|
||||||
(!Item[usItem].attachment || Item[usItem].mine ))
|
(!ItemIsAttachment(usItem) || ItemIsMine(usItem)))
|
||||||
{
|
{
|
||||||
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 + gSkillTraitValues.ubDEDamageOfBombsAndMines) / 100.0f + 0.5f);
|
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 + gSkillTraitValues.ubDEDamageOfBombsAndMines) / 100.0f + 0.5f);
|
||||||
}
|
}
|
||||||
@@ -1627,9 +1627,9 @@ BOOLEAN DamageSoldierFromBlast( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo
|
|||||||
// Heavy Weapons trait bonus damage with rocket, grenade launchers and mortar
|
// Heavy Weapons trait bonus damage with rocket, grenade launchers and mortar
|
||||||
else if ( HAS_SKILL_TRAIT( MercPtrs[ ubOwner ], HEAVY_WEAPONS_NT ) &&
|
else if ( HAS_SKILL_TRAIT( MercPtrs[ ubOwner ], HEAVY_WEAPONS_NT ) &&
|
||||||
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_NORMAL &&
|
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_NORMAL &&
|
||||||
((Item[usItem].usItemClass == IC_BOMB && Item[usItem].attachment && !Item[usItem].mine ) || // mortar shells
|
((Item[usItem].usItemClass == IC_BOMB && ItemIsAttachment(usItem) && !ItemIsMine(usItem) ) || // mortar shells
|
||||||
(Item[usItem].usItemClass == IC_GRENADE && (Item[usItem].glgrenade || Item[usItem].electronic) ) || // rockets for rocketlaunchers (I haven't found any other way)
|
(Item[usItem].usItemClass == IC_GRENADE && (ItemIsGLgrenade(usItem) || ItemIsElectronic(usItem)) ) || // rockets for rocketlaunchers (I haven't found any other way)
|
||||||
(Item[usItem].usItemClass == IC_LAUNCHER ) || Item[usItem].rocketlauncher || Item[usItem].singleshotrocketlauncher ) )
|
(Item[usItem].usItemClass == IC_LAUNCHER ) || ItemIsRocketLauncher(usItem) || ItemIsSingleShotRocketLauncher(usItem) ) )
|
||||||
{
|
{
|
||||||
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 + gSkillTraitValues.ubHWDamageBonusPercentForHW * NUM_SKILL_TRAITS( MercPtrs[ ubOwner ], HEAVY_WEAPONS_NT )) / 100.0f + 0.5f); // +15%
|
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 + gSkillTraitValues.ubHWDamageBonusPercentForHW * NUM_SKILL_TRAITS( MercPtrs[ ubOwner ], HEAVY_WEAPONS_NT )) / 100.0f + 0.5f); // +15%
|
||||||
}
|
}
|
||||||
@@ -1640,7 +1640,7 @@ BOOLEAN DamageSoldierFromBlast( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo
|
|||||||
{
|
{
|
||||||
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 - gSkillTraitValues.bTanksDamageResistanceModifier) / 100);
|
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 - gSkillTraitValues.bTanksDamageResistanceModifier) / 100);
|
||||||
// another half of this for ordinary grenades
|
// another half of this for ordinary grenades
|
||||||
if ( (( Item[usItem].usItemClass == IC_GRENADE ) || Item[usItem].glgrenade ) && !Item[usItem].electronic )
|
if ( (( Item[usItem].usItemClass == IC_GRENADE ) || ItemIsGLgrenade(usItem) ) && !ItemIsElectronic(usItem))
|
||||||
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 - (gSkillTraitValues.bTanksDamageResistanceModifier / 2)) / 100);
|
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 - (gSkillTraitValues.bTanksDamageResistanceModifier / 2)) / 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3858,10 +3858,10 @@ BOOLEAN ActivateSurroundingTripwire( UINT8 ubID, INT32 sGridNo, INT8 bLevel, UIN
|
|||||||
usBombItem = (*pObj)[0]->data.misc.usBombItem;
|
usBombItem = (*pObj)[0]->data.misc.usBombItem;
|
||||||
|
|
||||||
// if item can be activated by tripwire, detonate it
|
// if item can be activated by tripwire, detonate it
|
||||||
if ( Item[usBombItem].tripwireactivation == 1 )
|
if (ItemHasTripwireActivation(usBombItem))
|
||||||
{
|
{
|
||||||
// tripwire just gets activated
|
// tripwire just gets activated
|
||||||
if ( Item[usBombItem].tripwire == 1 )
|
if (ItemIsTripwire(usBombItem))
|
||||||
{
|
{
|
||||||
// this is important - we have to check wether the wire has already been activated
|
// this is important - we have to check wether the wire has already been activated
|
||||||
if ( ( (*pObj)[0]->data.sObjectFlag & TRIPWIRE_ACTIVATED ) == 0 )
|
if ( ( (*pObj)[0]->data.sObjectFlag & TRIPWIRE_ACTIVATED ) == 0 )
|
||||||
@@ -4029,7 +4029,7 @@ void HandleExplosionQueue( void )
|
|||||||
CallAvailableEnemiesTo( sGridNo );
|
CallAvailableEnemiesTo( sGridNo );
|
||||||
//RemoveItemFromPool( sGridNo, gWorldBombs[ uiWorldBombIndex ].iItemIndex, 0 );
|
//RemoveItemFromPool( sGridNo, gWorldBombs[ uiWorldBombIndex ].iItemIndex, 0 );
|
||||||
}
|
}
|
||||||
else if ( (*pObj)[0]->data.misc.usBombItem == TRIP_FLARE || Item[pObj->usItem].flare)
|
else if ( (*pObj)[0]->data.misc.usBombItem == TRIP_FLARE || ItemIsFlare(pObj->usItem))
|
||||||
{
|
{
|
||||||
// sevenfm: changed pObj->usItem to Item[pObj->usItem].ubClassIndex as it should be correct explosives index
|
// sevenfm: changed pObj->usItem to Item[pObj->usItem].ubClassIndex as it should be correct explosives index
|
||||||
// NewLightEffect( sGridNo, (UINT8)Explosive[pObj->usItem].ubDuration, (UINT8)Explosive[pObj->usItem].ubStartRadius );
|
// NewLightEffect( sGridNo, (UINT8)Explosive[pObj->usItem].ubDuration, (UINT8)Explosive[pObj->usItem].ubStartRadius );
|
||||||
@@ -4128,7 +4128,7 @@ void HandleExplosionQueue( void )
|
|||||||
}
|
}
|
||||||
// Flugente: handle tripwire gun traps here...
|
// Flugente: handle tripwire gun traps here...
|
||||||
// tripwire gets called and activated in ActivateSurroundingTripwire
|
// tripwire gets called and activated in ActivateSurroundingTripwire
|
||||||
else if ( Item[pObj->usItem].tripwire == 1 )
|
else if (ItemIsTripwire(pObj->usItem))
|
||||||
{
|
{
|
||||||
OBJECTTYPE newtripwireObject;
|
OBJECTTYPE newtripwireObject;
|
||||||
CreateItem( pObj->usItem, (*pObj)[0]->data.objectStatus, &newtripwireObject );
|
CreateItem( pObj->usItem, (*pObj)[0]->data.objectStatus, &newtripwireObject );
|
||||||
@@ -4189,7 +4189,7 @@ void HandleExplosionQueue( void )
|
|||||||
// Flugente: handle tripwire gun traps here...
|
// Flugente: handle tripwire gun traps here...
|
||||||
// tripwire gets called and activated in ActivateSurroundingTripwire
|
// tripwire gets called and activated in ActivateSurroundingTripwire
|
||||||
// now for action item tripwire
|
// now for action item tripwire
|
||||||
else if ( pObj->usItem == ACTION_ITEM && (*pObj)[0]->data.misc.bActionValue == ACTION_ITEM_BLOW_UP && Item[(*pObj)[0]->data.misc.usBombItem].tripwire == 1 )
|
else if ( pObj->usItem == ACTION_ITEM && (*pObj)[0]->data.misc.bActionValue == ACTION_ITEM_BLOW_UP && ItemIsTripwire((*pObj)[0]->data.misc.usBombItem) )
|
||||||
{
|
{
|
||||||
OBJECTTYPE newtripwireObject;
|
OBJECTTYPE newtripwireObject;
|
||||||
CreateItem( (*pObj)[0]->data.misc.usBombItem, (*pObj)[0]->data.objectStatus, &newtripwireObject );
|
CreateItem( (*pObj)[0]->data.misc.usBombItem, (*pObj)[0]->data.objectStatus, &newtripwireObject );
|
||||||
@@ -4910,7 +4910,7 @@ BOOLEAN SetOffBombsInGridNo( UINT8 ubID, INT32 sGridNo, BOOLEAN fAllBombs, INT8
|
|||||||
if (fAllBombs || (*pObj)[0]->data.misc.bDetonatorType == BOMB_PRESSURE)
|
if (fAllBombs || (*pObj)[0]->data.misc.bDetonatorType == BOMB_PRESSURE)
|
||||||
{
|
{
|
||||||
// Flugente: if this is a anti-tank mine, only detonate it if the person triggering it is (in) a vehicle, or if we detonate everything unconditional
|
// Flugente: if this is a anti-tank mine, only detonate it if the person triggering it is (in) a vehicle, or if we detonate everything unconditional
|
||||||
if ( !fAllBombs && ubID != NOBODY && Item[pObj->usItem].antitankmine )
|
if ( !fAllBombs && ubID != NOBODY && ItemIsATMine(pObj->usItem))
|
||||||
{
|
{
|
||||||
// if this is not a vehicle, not a robot and not a tank, don't activate
|
// if this is not a vehicle, not a robot and not a tank, don't activate
|
||||||
if ( !(MercPtrs[ubID]->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( MercPtrs[ubID] ) && !ARMED_VEHICLE( MercPtrs[ubID] ) && !ENEMYROBOT( MercPtrs[ubID] ) )
|
if ( !(MercPtrs[ubID]->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( MercPtrs[ubID] ) && !ARMED_VEHICLE( MercPtrs[ubID] ) && !ENEMYROBOT( MercPtrs[ubID] ) )
|
||||||
@@ -4942,7 +4942,7 @@ BOOLEAN SetOffBombsInGridNo( UINT8 ubID, INT32 sGridNo, BOOLEAN fAllBombs, INT8
|
|||||||
SetOffBombsByFrequency( ubID, (*pObj)[0]->data.misc.bFrequency );
|
SetOffBombsByFrequency( ubID, (*pObj)[0]->data.misc.bFrequency );
|
||||||
}
|
}
|
||||||
// Flugente: a tripwire activates all other tripwires in connection, and detonates all bombs in connection that are tripwire-activated
|
// Flugente: a tripwire activates all other tripwires in connection, and detonates all bombs in connection that are tripwire-activated
|
||||||
else if ( Item[pObj->usItem].tripwire == 1 || (pObj->usItem == ACTION_ITEM && (*pObj)[0]->data.misc.bActionValue == ACTION_ITEM_BLOW_UP && Item[(*pObj)[0]->data.misc.usBombItem].tripwire == 1 ) )
|
else if (ItemIsTripwire(pObj->usItem) || (pObj->usItem == ACTION_ITEM && (*pObj)[0]->data.misc.bActionValue == ACTION_ITEM_BLOW_UP && ItemIsTripwire((*pObj)[0]->data.misc.usBombItem) ) )
|
||||||
{
|
{
|
||||||
gubPersonToSetOffExplosions = ubID;
|
gubPersonToSetOffExplosions = ubID;
|
||||||
|
|
||||||
@@ -5449,7 +5449,7 @@ void FireFragments( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, UINT16 usItem,
|
|||||||
FLOAT dRandomZ = 0;
|
FLOAT dRandomZ = 0;
|
||||||
|
|
||||||
// if explosive is directional, calculation of frags is different
|
// if explosive is directional, calculation of frags is different
|
||||||
if ( Item[usItem].directional == TRUE )
|
if (ItemIsDirectional(usItem))
|
||||||
{
|
{
|
||||||
// Flugente: if item is a directional explosive, determine in what direction the frags should fly
|
// Flugente: if item is a directional explosive, determine in what direction the frags should fly
|
||||||
INT16 degree = (45 + ubDirection * 45) % 360; // modulo 360 to prevent nonsense from nonsensical input
|
INT16 degree = (45 + ubDirection * 45) % 360; // modulo 360 to prevent nonsense from nonsensical input
|
||||||
@@ -5891,7 +5891,7 @@ void HandleBuddyExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sG
|
|||||||
// Flugente: Items can have secondary explosions
|
// Flugente: Items can have secondary explosions
|
||||||
if ( Item[usItem].usBuddyItem )
|
if ( Item[usItem].usBuddyItem )
|
||||||
{
|
{
|
||||||
if ( Item[Item[usItem].usBuddyItem].flare )
|
if (ItemIsFlare(Item[usItem].usBuddyItem))
|
||||||
{
|
{
|
||||||
if( !sZ || !FindBuilding(sGridNo) )
|
if( !sZ || !FindBuilding(sGridNo) )
|
||||||
{
|
{
|
||||||
@@ -5929,10 +5929,10 @@ BOOLEAN HandleAttachedExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, IN
|
|||||||
if ( iter->exists() && Item[iter->usItem].usItemClass & (IC_GRENADE|IC_BOMB) )
|
if ( iter->exists() && Item[iter->usItem].usItemClass & (IC_GRENADE|IC_BOMB) )
|
||||||
{
|
{
|
||||||
// no need for binder if both item and attachment are tripwire-activated
|
// no need for binder if both item and attachment are tripwire-activated
|
||||||
if( ( Item[pObj->usItem].tripwireactivation && Item[iter->usItem].tripwireactivation ) ||
|
if( (ItemHasTripwireActivation(pObj->usItem) && ItemHasTripwireActivation(iter->usItem)) ||
|
||||||
( binderFound && detonator && Explosive[Item[iter->usItem].ubClassIndex].ubVolatility > 0 ) )
|
( binderFound && detonator && Explosive[Item[iter->usItem].ubClassIndex].ubVolatility > 0 ) )
|
||||||
{
|
{
|
||||||
if(Item[iter->usItem].directional && ubDirection == DIRECTION_IRRELEVANT)
|
if(ItemIsDirectional(iter->usItem) && ubDirection == DIRECTION_IRRELEVANT)
|
||||||
direction=Random(8);
|
direction=Random(8);
|
||||||
else
|
else
|
||||||
direction=ubDirection;
|
direction=ubDirection;
|
||||||
@@ -5953,7 +5953,7 @@ BOOLEAN HandleAttachedExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, IN
|
|||||||
}
|
}
|
||||||
if ( binderFound && detonator && gGameExternalOptions.bAllowSpecialExplosiveAttachments && iter->exists() && Item[iter->usItem].usItemClass & IC_MISC )
|
if ( binderFound && detonator && gGameExternalOptions.bAllowSpecialExplosiveAttachments && iter->exists() && Item[iter->usItem].usItemClass & IC_MISC )
|
||||||
{
|
{
|
||||||
if(Item[iter->usItem].gascan)
|
if(ItemIsGascan(iter->usItem))
|
||||||
{
|
{
|
||||||
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, GAS_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, GAS_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
||||||
fAttFound = TRUE;
|
fAttFound = TRUE;
|
||||||
@@ -5963,7 +5963,7 @@ BOOLEAN HandleAttachedExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, IN
|
|||||||
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, MOLOTOV_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, MOLOTOV_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
||||||
fAttFound = TRUE;
|
fAttFound = TRUE;
|
||||||
}
|
}
|
||||||
if(Item[iter->usItem].marbles)
|
if(ItemIsMarbles(iter->usItem))
|
||||||
{
|
{
|
||||||
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, FRAG_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, FRAG_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
||||||
fAttFound = TRUE;
|
fAttFound = TRUE;
|
||||||
@@ -6017,7 +6017,7 @@ UINT16 CalcTotalVolatility(OBJECTTYPE * pObj)
|
|||||||
if ( iter->exists() && Item[iter->usItem].usItemClass & (IC_GRENADE|IC_BOMB) )
|
if ( iter->exists() && Item[iter->usItem].usItemClass & (IC_GRENADE|IC_BOMB) )
|
||||||
{
|
{
|
||||||
// no need for binder if both item and attachment are tripwire-activated
|
// no need for binder if both item and attachment are tripwire-activated
|
||||||
if( ( Item[usItem].tripwireactivation && Item[iter->usItem].tripwireactivation ) ||
|
if( (ItemHasTripwireActivation(usItem) && ItemHasTripwireActivation(iter->usItem)) ||
|
||||||
( binderFound && detonator && Explosive[Item[iter->usItem].ubClassIndex].ubVolatility > 0 ) )
|
( binderFound && detonator && Explosive[Item[iter->usItem].ubClassIndex].ubVolatility > 0 ) )
|
||||||
{
|
{
|
||||||
totalVolatility += Explosive[Item[iter->usItem].ubClassIndex].ubVolatility;
|
totalVolatility += Explosive[Item[iter->usItem].ubClassIndex].ubVolatility;
|
||||||
|
|||||||
+13
-13
@@ -531,8 +531,7 @@ BOOLEAN PhysicsUpdateLife( REAL_OBJECT *pObject, real DeltaTime )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If we are in water, and we are a sinkable item...
|
// If we are in water, and we are a sinkable item...
|
||||||
// if ( !pObject->fInWater || !( Item[ pObject->Obj.usItem ].fFlags & ITEM_SINKS ) )
|
if ( !pObject->fInWater || !ItemSinks(pObject->Obj.usItem) )
|
||||||
if ( !pObject->fInWater || !( Item[ pObject->Obj.usItem ].sinks ) )
|
|
||||||
{
|
{
|
||||||
if ( pObject->fDropItem )
|
if ( pObject->fDropItem )
|
||||||
{
|
{
|
||||||
@@ -562,7 +561,7 @@ BOOLEAN PhysicsUpdateLife( REAL_OBJECT *pObject, real DeltaTime )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make impact noise....
|
// Make impact noise....
|
||||||
if ( Item[pObject->Obj.usItem].rock )
|
if (ItemIsRock(pObject->Obj.usItem))
|
||||||
{
|
{
|
||||||
MakeNoise( pObject->ubOwner, pObject->sGridNo, 0, gpWorldLevelData[ pObject->sGridNo ].ubTerrainID, (UINT8) (9 + PreRandom( 9 ) ), NOISE_ROCK_IMPACT );
|
MakeNoise( pObject->ubOwner, pObject->sGridNo, 0, gpWorldLevelData[ pObject->sGridNo ].ubTerrainID, (UINT8) (9 + PreRandom( 9 ) ), NOISE_ROCK_IMPACT );
|
||||||
}
|
}
|
||||||
@@ -1013,10 +1012,11 @@ BOOLEAN PhysicsCheckForCollisions( REAL_OBJECT *pObject, INT32 *piCollisionID )
|
|||||||
if ( iCollisionCode == COLLISION_WINDOW_NORTHWEST || iCollisionCode == COLLISION_WINDOW_NORTHEAST || iCollisionCode == COLLISION_WINDOW_SOUTHWEST || iCollisionCode == COLLISION_WINDOW_SOUTHEAST )
|
if ( iCollisionCode == COLLISION_WINDOW_NORTHWEST || iCollisionCode == COLLISION_WINDOW_NORTHEAST || iCollisionCode == COLLISION_WINDOW_SOUTHWEST || iCollisionCode == COLLISION_WINDOW_SOUTHEAST )
|
||||||
{
|
{
|
||||||
// sevenfm: added requirements for object to break window
|
// sevenfm: added requirements for object to break window
|
||||||
if (Item[pObject->Obj.usItem].ubWeight >= 4 &&
|
UINT16 usItem = pObject->Obj.usItem;
|
||||||
Item[pObject->Obj.usItem].sinks &&
|
if (Item[usItem].ubWeight >= 4 &&
|
||||||
!Item[pObject->Obj.usItem].unaerodynamic &&
|
ItemSinks(usItem) &&
|
||||||
(Item[pObject->Obj.usItem].metal || Item[pObject->Obj.usItem].rock))
|
!ItemIsUnaerodynamic(usItem) &&
|
||||||
|
(ItemIsMetal(usItem) || ItemIsRock(usItem)))
|
||||||
{
|
{
|
||||||
if (!pObject->fTestObject)
|
if (!pObject->fTestObject)
|
||||||
{
|
{
|
||||||
@@ -1927,7 +1927,7 @@ void CalculateLaunchItemBasicParams( SOLDIERTYPE *pSoldier, OBJECTTYPE *pItem, I
|
|||||||
|
|
||||||
|
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 1741"));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 1741"));
|
||||||
if ( fArmed && ( Item[usLauncher].mortar || Item[pItem->usItem].mortar ) )
|
if ( fArmed && (ItemIsMortar(usLauncher) || ItemIsMortar(pItem->usItem)) )
|
||||||
{
|
{
|
||||||
// Start at 0....
|
// Start at 0....
|
||||||
sStartZ = ( pSoldier->pathing.bLevel * 256 );
|
sStartZ = ( pSoldier->pathing.bLevel * 256 );
|
||||||
@@ -1937,7 +1937,7 @@ void CalculateLaunchItemBasicParams( SOLDIERTYPE *pSoldier, OBJECTTYPE *pItem, I
|
|||||||
}
|
}
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 1750"));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 1750"));
|
||||||
|
|
||||||
if ( fArmed && ( Item[usLauncher].grenadelauncher || Item[pItem->usItem].grenadelauncher ) )
|
if ( fArmed && (ItemIsGrenadeLauncher(usLauncher) || ItemIsGrenadeLauncher(pItem->usItem)) )
|
||||||
{
|
{
|
||||||
// OK, look at target level and decide angle to use...
|
// OK, look at target level and decide angle to use...
|
||||||
if ( ubLevel == 1 )
|
if ( ubLevel == 1 )
|
||||||
@@ -2327,7 +2327,7 @@ void CalculateLaunchItemParamsForThrow( SOLDIERTYPE *pSoldier, INT32 sGridNo, UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set the max miss radius
|
// set the max miss radius
|
||||||
if ( Item[usItemNum].mortar )
|
if (ItemIsMortar(usItemNum))
|
||||||
{
|
{
|
||||||
bMaxRadius = gItemSettings.usMissMaxRadiusMortar;
|
bMaxRadius = gItemSettings.usMissMaxRadiusMortar;
|
||||||
}
|
}
|
||||||
@@ -2413,7 +2413,7 @@ void CalculateLaunchItemParamsForThrow( SOLDIERTYPE *pSoldier, INT32 sGridNo, UI
|
|||||||
|
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 2103"));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 2103"));
|
||||||
|
|
||||||
if ( fArmed && Item[usLauncher].mortar )
|
if ( fArmed && ItemIsMortar(usLauncher))
|
||||||
{
|
{
|
||||||
// Start at 0....
|
// Start at 0....
|
||||||
sStartZ = ( pSoldier->pathing.bLevel * 256 ) + 50;
|
sStartZ = ( pSoldier->pathing.bLevel * 256 ) + 50;
|
||||||
@@ -2665,7 +2665,7 @@ void HandleArmedObjectImpact( REAL_OBJECT *pObject )
|
|||||||
{
|
{
|
||||||
fCheckForDuds = TRUE;
|
fCheckForDuds = TRUE;
|
||||||
|
|
||||||
if (CanDelayGrenadeExplosion(pObj->usItem) && (Item[pObj->usItem].ubCursor == TOSSCURS || Item[pObj->usItem].glgrenade))
|
if (CanDelayGrenadeExplosion(pObj->usItem) && (Item[pObj->usItem].ubCursor == TOSSCURS || ItemIsGLgrenade(pObj->usItem)))
|
||||||
{
|
{
|
||||||
fCanDelayExplosion = TRUE;
|
fCanDelayExplosion = TRUE;
|
||||||
}
|
}
|
||||||
@@ -2780,7 +2780,7 @@ void HandleArmedObjectImpact( REAL_OBJECT *pObject )
|
|||||||
|
|
||||||
if ( fDoImpact )
|
if ( fDoImpact )
|
||||||
{
|
{
|
||||||
if ( Item[pObject->Obj.usItem].flare )
|
if (ItemIsFlare(pObject->Obj.usItem))
|
||||||
{
|
{
|
||||||
//if the light object will be created OFF the ground
|
//if the light object will be created OFF the ground
|
||||||
if( pObject->Position.z > 0 && FindBuilding(pObject->sGridNo) )
|
if( pObject->Position.z > 0 && FindBuilding(pObject->sGridNo) )
|
||||||
|
|||||||
+223
-185
@@ -561,90 +561,101 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.bRepairEase = (INT8) atol(pData->szCharData);
|
pData->curItem.bRepairEase = (INT8) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
//else if(strcmp(name, "fFlags") == 0)
|
|
||||||
//{
|
|
||||||
// pData->curElement = ELEMENT;
|
|
||||||
// pData->curItem.fFlags = (BOOLEAN) atol(pData->szCharData);
|
|
||||||
//}
|
|
||||||
else if(strcmp(name, "Damageable") == 0)
|
else if(strcmp(name, "Damageable") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.damageable = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_damageable;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Repairable") == 0)
|
else if(strcmp(name, "Repairable") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.repairable = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_repairable;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "WaterDamages") == 0)
|
else if(strcmp(name, "WaterDamages") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.waterdamages = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_waterdamages;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Metal") == 0)
|
else if(strcmp(name, "Metal") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.metal = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_metal;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Sinks") == 0)
|
else if(strcmp(name, "Sinks") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.sinks = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_sinks;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "ShowStatus") == 0)
|
else if(strcmp(name, "ShowStatus") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.showstatus = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_showstatus;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "HiddenAddon") == 0)
|
else if(strcmp(name, "HiddenAddon") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.hiddenaddon = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_hiddenaddon;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "TwoHanded") == 0)
|
else if(strcmp(name, "TwoHanded") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.twohanded = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_twohanded;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "NotBuyable") == 0)
|
else if(strcmp(name, "NotBuyable") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.notbuyable = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_notbuyable;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Attachment") == 0)
|
else if(strcmp(name, "Attachment") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.attachment = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_attachment;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "HiddenAttachment") == 0)
|
else if(strcmp(name, "HiddenAttachment") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.hiddenattachment = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_hiddenattachment;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "BigGunList") == 0)
|
else if(strcmp(name, "BigGunList") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.biggunlist = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_biggunlist;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "NotInEditor") == 0)
|
else if(strcmp(name, "NotInEditor") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.notineditor = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_notineditor;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "DefaultUndroppable") == 0)
|
else if(strcmp(name, "DefaultUndroppable") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.defaultundroppable = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_defaultundroppable;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Unaerodynamic") == 0)
|
else if(strcmp(name, "Unaerodynamic") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.unaerodynamic = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_unaerodynamic;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Electronic") == 0)
|
else if(strcmp(name, "Electronic") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.electronic = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_electronic;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Inseparable") == 0)
|
else if(strcmp(name, "Inseparable") == 0)
|
||||||
{
|
{
|
||||||
@@ -699,7 +710,8 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "GasMask") == 0)
|
else if(strcmp(name, "GasMask") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.gasmask = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_gasmask;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Bipod") == 0)
|
else if(strcmp(name, "Bipod") == 0)
|
||||||
{
|
{
|
||||||
@@ -802,47 +814,56 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "GrenadeLauncher") == 0)
|
else if(strcmp(name, "GrenadeLauncher") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.grenadelauncher = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_grenadelauncher;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "LockBomb") == 0)
|
else if(strcmp(name, "LockBomb") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.lockbomb = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_lockbomb;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Flare") == 0)
|
else if(strcmp(name, "Flare") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.flare = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_flare;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Duckbill") == 0)
|
else if(strcmp(name, "Duckbill") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.duckbill = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_duckbill;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Detonator") == 0)
|
else if(strcmp(name, "Detonator") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.detonator = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_detonator;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RemoteDetonator") == 0)
|
else if(strcmp(name, "RemoteDetonator") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.remotedetonator = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_remotedetonator;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "ThermalOptics") == 0)
|
else if(strcmp(name, "ThermalOptics") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.thermaloptics = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_thermaloptics;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "SciFi") == 0)
|
else if(strcmp(name, "SciFi") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.scifi = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_scifi;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "NewInv") == 0)
|
else if(strcmp(name, "NewInv") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.newinv = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_newinv;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "AttachmentSystem") == 0)
|
else if(strcmp(name, "AttachmentSystem") == 0)
|
||||||
{
|
{
|
||||||
@@ -852,17 +873,20 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "HideMuzzleFlash") == 0)
|
else if(strcmp(name, "HideMuzzleFlash") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.hidemuzzleflash = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_hidemuzzleflash;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Cannon") == 0)
|
else if(strcmp(name, "Cannon") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.cannon = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_cannon;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RocketRifle") == 0)
|
else if(strcmp(name, "RocketRifle") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.rocketrifle = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_rocketrifle;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Alcohol") == 0)
|
else if(strcmp(name, "Alcohol") == 0)
|
||||||
{
|
{
|
||||||
@@ -874,12 +898,14 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "Hardware") == 0)
|
else if(strcmp(name, "Hardware") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.hardware = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_hardware;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Medical") == 0)
|
else if(strcmp(name, "Medical") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.medical = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_medical;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "DamageBonus") == 0)
|
else if(strcmp(name, "DamageBonus") == 0)
|
||||||
{
|
{
|
||||||
@@ -894,28 +920,26 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "Mortar") == 0)
|
else if(strcmp(name, "Mortar") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.mortar = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_mortar;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RocketLauncher") == 0)
|
else if(strcmp(name, "RocketLauncher") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.rocketlauncher = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_rocketlauncher;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "SingleShotRocketLauncher") == 0)
|
else if(strcmp(name, "SingleShotRocketLauncher") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.singleshotrocketlauncher = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_singleshotrocketlauncher;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "DiscardedLauncherItem") == 0)
|
else if(strcmp(name, "DiscardedLauncherItem") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.discardedlauncheritem = (UINT16) atol(pData->szCharData);
|
pData->curItem.discardedlauncheritem = (UINT16) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "SingleShotRocketLauncher") == 0)
|
|
||||||
{
|
|
||||||
pData->curElement = ELEMENT;
|
|
||||||
pData->curItem.singleshotrocketlauncher = (BOOLEAN) atol(pData->szCharData);
|
|
||||||
}
|
|
||||||
else if(strcmp(name, "BloodiedItem") == 0)
|
else if(strcmp(name, "BloodiedItem") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
@@ -934,22 +958,26 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "BrassKnuckles") == 0)
|
else if(strcmp(name, "BrassKnuckles") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.brassknuckles = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_brassknuckles;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Crowbar") == 0)
|
else if(strcmp(name, "Crowbar") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.crowbar = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_crowbar;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "GLGrenade") == 0)
|
else if(strcmp(name, "GLGrenade") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.glgrenade = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_glgrenade;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "FlakJacket") == 0)
|
else if(strcmp(name, "FlakJacket") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.flakjacket = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_flakjacket;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "HearingRangeBonus") == 0)
|
else if(strcmp(name, "HearingRangeBonus") == 0)
|
||||||
{
|
{
|
||||||
@@ -989,117 +1017,140 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "LeatherJacket") == 0)
|
else if(strcmp(name, "LeatherJacket") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.leatherjacket = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_leatherjacket;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "NeedsBatteries") == 0)
|
else if(strcmp(name, "NeedsBatteries") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.needsbatteries = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_needsbatteries;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Batteries") == 0)
|
else if(strcmp(name, "Batteries") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.batteries = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_batteries;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "XRay") == 0)
|
else if(strcmp(name, "XRay") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.xray = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_xray;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "WireCutters") == 0)
|
else if(strcmp(name, "WireCutters") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.wirecutters = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_wirecutters;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Toolkit") == 0)
|
else if(strcmp(name, "Toolkit") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.toolkit = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_toolkit;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Canteen") == 0)
|
else if(strcmp(name, "Canteen") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.canteen = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_canteen;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Marbles") == 0)
|
else if(strcmp(name, "Marbles") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.marbles = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_marbles;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Walkman") == 0)
|
else if(strcmp(name, "Walkman") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.walkman = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_walkman;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RemoteTrigger") == 0)
|
else if(strcmp(name, "RemoteTrigger") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.remotetrigger = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_remotetrigger;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RobotRemoteControl") == 0)
|
else if(strcmp(name, "RobotRemoteControl") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.robotremotecontrol = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_robotremotecontrol;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "CamouflageKit") == 0)
|
else if(strcmp(name, "CamouflageKit") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.camouflagekit = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_camouflagekit;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "LocksmithKit") == 0)
|
else if(strcmp(name, "LocksmithKit") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.locksmithkit = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_locksmithkit;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Mine") == 0)
|
else if(strcmp(name, "Mine") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.mine = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_mine;
|
||||||
}
|
}
|
||||||
else if ( strcmp( name, "antitankmine" ) == 0 )
|
else if ( strcmp( name, "antitankmine" ) == 0 )
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.antitankmine = (BOOLEAN)atol( pData->szCharData );
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_antitankmine;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "GasCan") == 0)
|
else if(strcmp(name, "GasCan") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.gascan = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_gascan;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "CanAndString") == 0)
|
else if(strcmp(name, "CanAndString") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.canandstring = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_canandstring;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "ContainsLiquid") == 0)
|
else if(strcmp(name, "ContainsLiquid") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.containsliquid = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_containsliquid;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "FingerPrintID") == 0)
|
else if(strcmp(name, "FingerPrintID") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.fingerprintid = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_fingerprintid;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Rock") == 0)
|
else if(strcmp(name, "Rock") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.rock = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_rock;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "MedicalKit") == 0)
|
else if(strcmp(name, "MedicalKit") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.medicalkit = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_medicalkit;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "FirstAidKit") == 0)
|
else if(strcmp(name, "FirstAidKit") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.firstaidkit = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_firstaidkit;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "MetalDetector") == 0)
|
else if(strcmp(name, "MetalDetector") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.metaldetector = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag |= ITEM_metaldetector;
|
||||||
}
|
}
|
||||||
if(strcmp(name, "PercentTunnelVision") == 0) //Madd: had to scrap the "else" due to a compiler limit
|
if(strcmp(name, "PercentTunnelVision") == 0) //Madd: had to scrap the "else" due to a compiler limit
|
||||||
{
|
{
|
||||||
@@ -1109,7 +1160,8 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
if(strcmp(name, "Jar") == 0)
|
if(strcmp(name, "Jar") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.jar = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_jar;
|
||||||
}
|
}
|
||||||
if(strcmp(name, "BestLaserRange") == 0)
|
if(strcmp(name, "BestLaserRange") == 0)
|
||||||
{
|
{
|
||||||
@@ -1228,7 +1280,8 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "barrel") == 0)
|
else if(strcmp(name, "barrel") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.barrel = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_barrel;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "usOverheatingCooldownFactor") == 0)
|
else if(strcmp(name, "usOverheatingCooldownFactor") == 0)
|
||||||
{
|
{
|
||||||
@@ -1263,17 +1316,20 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "TripWireActivation") == 0)
|
else if(strcmp(name, "TripWireActivation") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.tripwireactivation = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_tripwireactivation;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "TripWire") == 0)
|
else if(strcmp(name, "TripWire") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.tripwire = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_tripwire;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "Directional") == 0)
|
else if(strcmp(name, "Directional") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.directional = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_directional;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "DrugType") == 0)
|
else if(strcmp(name, "DrugType") == 0)
|
||||||
{
|
{
|
||||||
@@ -1283,7 +1339,8 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "BlockIronSight") == 0)
|
else if(strcmp(name, "BlockIronSight") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.blockironsight = (BOOLEAN) atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_blockironsight;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "ItemFlag") == 0)
|
else if(strcmp(name, "ItemFlag") == 0)
|
||||||
{
|
{
|
||||||
@@ -1394,12 +1451,14 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if (strcmp(name, "fAllowClimbing") == 0)
|
else if (strcmp(name, "fAllowClimbing") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.fAllowClimbing = (BOOLEAN)atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_fAllowClimbing;
|
||||||
}
|
}
|
||||||
else if ( strcmp( name, "cigarette" ) == 0 )
|
else if ( strcmp( name, "cigarette" ) == 0 )
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.cigarette = (BOOLEAN)atol( pData->szCharData );
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_cigarette;
|
||||||
}
|
}
|
||||||
else if ( strcmp( name, "usPortionSize" ) == 0 )
|
else if ( strcmp( name, "usPortionSize" ) == 0 )
|
||||||
{
|
{
|
||||||
@@ -1502,22 +1561,26 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if (strcmp(name, "ProvidesRobotCamo") == 0)
|
else if (strcmp(name, "ProvidesRobotCamo") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.fProvidesRobotCamo = (BOOLEAN)atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_fProvidesRobotCamo;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "ProvidesRobotNightVision") == 0)
|
else if (strcmp(name, "ProvidesRobotNightVision") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.fProvidesRobotNightVision = (BOOLEAN)atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_fProvidesRobotNightVision;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "ProvidesRobotLaserBonus") == 0)
|
else if (strcmp(name, "ProvidesRobotLaserBonus") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.fProvidesRobotLaserBonus = (BOOLEAN)atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_fProvidesRobotLaserBonus;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "DiseaseSystemExclusive") == 0)
|
else if (strcmp(name, "DiseaseSystemExclusive") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curItem.DiseaseSystemExclusive = (BOOLEAN)atol(pData->szCharData);
|
if ((BOOLEAN)atol(pData->szCharData))
|
||||||
|
pData->curItem.usItemFlag2 |= ITEM_DiseaseSystemExclusive;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "TransportGroupMinProgress") == 0)
|
else if (strcmp(name, "TransportGroupMinProgress") == 0)
|
||||||
{
|
{
|
||||||
@@ -1907,12 +1970,6 @@ BOOLEAN WriteItemStats()
|
|||||||
}
|
}
|
||||||
FilePrintf(hFile,"</szBRDesc>\r\n");
|
FilePrintf(hFile,"</szBRDesc>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<usItemClass>%d</usItemClass>\r\n", Item[cnt].usItemClass);
|
FilePrintf(hFile,"\t\t<usItemClass>%d</usItemClass>\r\n", Item[cnt].usItemClass);
|
||||||
FilePrintf(hFile,"\t\t<nasAttachmentClass>%d</nasAttachmentClass>\r\n", Item[cnt].nasAttachmentClass);
|
FilePrintf(hFile,"\t\t<nasAttachmentClass>%d</nasAttachmentClass>\r\n", Item[cnt].nasAttachmentClass);
|
||||||
FilePrintf(hFile,"\t\t<nasLayoutClass>%d</nasLayoutClass>\r\n", Item[cnt].nasLayoutClass);
|
FilePrintf(hFile,"\t\t<nasLayoutClass>%d</nasLayoutClass>\r\n", Item[cnt].nasLayoutClass);
|
||||||
@@ -1929,41 +1986,27 @@ BOOLEAN WriteItemStats()
|
|||||||
FilePrintf(hFile,"\t\t<bReliability>%d</bReliability>\r\n", Item[cnt].bReliability);
|
FilePrintf(hFile,"\t\t<bReliability>%d</bReliability>\r\n", Item[cnt].bReliability);
|
||||||
FilePrintf(hFile,"\t\t<bRepairEase>%d</bRepairEase>\r\n", Item[cnt].bRepairEase);
|
FilePrintf(hFile,"\t\t<bRepairEase>%d</bRepairEase>\r\n", Item[cnt].bRepairEase);
|
||||||
|
|
||||||
//FilePrintf(hFile,"\t\t<damageable>%d</damageable>\r\n", Item[cnt].fFlags & ITEM_DAMAGEABLE ? TRUE : FALSE);
|
if (ItemIsDamageable(cnt)) FilePrintf(hFile, "\t\t<Damageable>%d</Damageable>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<repairable>%d</repairable>\r\n", Item[cnt].fFlags & ITEM_REPAIRABLE ? TRUE : FALSE );
|
if (ItemIsRepairable(cnt)) FilePrintf(hFile, "\t\t<Repairable>%d</Repairable>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<waterdamages>%d</waterdamages>\r\n", Item[cnt].fFlags & ITEM_WATER_DAMAGES ? TRUE : FALSE );
|
if (ItemIsDamagedByWater(cnt)) FilePrintf(hFile, "\t\t<WaterDamages>%d</WaterDamages>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<metal>%d</metal>\r\n", Item[cnt].fFlags & ITEM_METAL ? TRUE : FALSE );
|
if (ItemIsMetal(cnt)) FilePrintf(hFile, "\t\t<Metal>%d</Metal>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<sinks>%d</sinks>\r\n", Item[cnt].fFlags & ITEM_SINKS ? TRUE : FALSE );
|
if (ItemSinks(cnt)) FilePrintf(hFile, "\t\t<Sinks>%d</Sinks>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<showstatus>%d</showstatus>\r\n", Item[cnt].fFlags & ITEM_SHOW_STATUS ? TRUE : FALSE );
|
if (HasItemFlag2(cnt, ITEM_showstatus)) FilePrintf(hFile, "\t\t<ShowStatus>%d</ShowStatus>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<hiddenaddon>%d</hiddenaddon>\r\n", Item[cnt].fFlags & ITEM_HIDDEN_ADDON ? TRUE : FALSE );
|
if (ItemIsHiddenAddon(cnt)) FilePrintf(hFile, "\t\t<HiddenAddon>%d</HiddenAddon>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<twohanded>%d</twohanded>\r\n", Item[cnt].fFlags & ITEM_TWO_HANDED ? TRUE : FALSE );
|
if (ItemIsTwoHanded(cnt)) FilePrintf(hFile, "\t\t<TwoHanded>%d</TwoHanded>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<notbuyable>%d</notbuyable>\r\n", Item[cnt].fFlags & ITEM_NOT_BUYABLE ? TRUE : FALSE );
|
if (ItemIsNotBuyable(cnt)) FilePrintf(hFile, "\t\t<NotBuyable>%d</NotBuyable>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<attachment>%d</attachment>\r\n", Item[cnt].fFlags & ITEM_ATTACHMENT ? TRUE : FALSE );
|
if (ItemIsAttachment(cnt)) FilePrintf(hFile, "\t\t<Attachment>%d</Attachment>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<biggunlist>%d</biggunlist>\r\n", Item[cnt].fFlags & ITEM_BIGGUNLIST ? TRUE : FALSE );
|
if (ItemIsHiddenAttachment(cnt)) FilePrintf(hFile, "\t\t<HiddenAttachment>%d</HiddenAttachment>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<notineditor>%d</notineditor>\r\n", Item[cnt].fFlags & ITEM_NOT_EDITOR ? TRUE : FALSE );
|
if (ItemIsOnlyInTonsOfGuns(cnt)) FilePrintf(hFile, "\t\t<BigGunList>%d</BigGunList>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<defaultundroppable>%d</defaultundroppable>\r\n", Item[cnt].fFlags & ITEM_DEFAULT_UNDROPPABLE ? TRUE : FALSE );
|
if (ItemIsOnlyInScifi(cnt)) FilePrintf(hFile, "\t\t<SciFi>%d</SciFi>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<unaerodynamic>%d</unaerodynamic>\r\n", Item[cnt].fFlags & ITEM_UNAERODYNAMIC ? TRUE : FALSE );
|
if (ItemIsOnlyInNIV(cnt)) FilePrintf(hFile, "\t\t<NewInv>%d</NewInv>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<electronic>%d</electronic>\r\n", Item[cnt].fFlags & ITEM_ELECTRONIC ? TRUE : FALSE );
|
if (ItemIsNotInEditor(cnt)) FilePrintf(hFile, "\t\t<NotInEditor>%d</NotInEditor>\r\n", 1);
|
||||||
//FilePrintf(hFile,"\t\t<inseparable>%d</inseparable>\r\n", Item[cnt].fFlags & ITEM_INSEPARABLE ? TRUE : FALSE );
|
if (ItemIsUndroppableByDefault(cnt)) FilePrintf(hFile, "\t\t<DefaultUndroppable>%d</DefaultUndroppable>\r\n", 1);
|
||||||
|
if (ItemIsUnaerodynamic(cnt)) FilePrintf(hFile, "\t\t<Unaerodynamic>%d</Unaerodynamic>\r\n", 1);
|
||||||
|
if (ItemIsElectronic(cnt)) FilePrintf(hFile, "\t\t<Electronic>%d</Electronic>\r\n", 1);
|
||||||
|
if (ItemHasHiddenMuzzleFlash(cnt)) FilePrintf(hFile, "\t\t<HideMuzzleFlash>%d</HideMuzzleFlash>\r\n", 1);
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<Damageable>%d</Damageable>\r\n", Item[cnt].damageable );
|
|
||||||
FilePrintf(hFile,"\t\t<Repairable>%d</Repairable>\r\n", Item[cnt].repairable );
|
|
||||||
FilePrintf(hFile,"\t\t<WaterDamages>%d</WaterDamages>\r\n", Item[cnt].waterdamages );
|
|
||||||
FilePrintf(hFile,"\t\t<Metal>%d</Metal>\r\n", Item[cnt].metal );
|
|
||||||
FilePrintf(hFile,"\t\t<Sinks>%d</Sinks>\r\n", Item[cnt].sinks );
|
|
||||||
FilePrintf(hFile,"\t\t<ShowStatus>%d</ShowStatus>\r\n", Item[cnt].showstatus );
|
|
||||||
FilePrintf(hFile,"\t\t<HiddenAddon>%d</HiddenAddon>\r\n", Item[cnt].hiddenaddon );
|
|
||||||
FilePrintf(hFile,"\t\t<TwoHanded>%d</TwoHanded>\r\n", Item[cnt].twohanded );
|
|
||||||
FilePrintf(hFile,"\t\t<NotBuyable>%d</NotBuyable>\r\n", Item[cnt].notbuyable );
|
|
||||||
FilePrintf(hFile,"\t\t<Attachment>%d</Attachment>\r\n", Item[cnt].attachment );
|
|
||||||
FilePrintf(hFile,"\t\t<BigGunList>%d</BigGunList>\r\n", Item[cnt].biggunlist );
|
|
||||||
FilePrintf(hFile,"\t\t<SciFi>%d</SciFi>\r\n", Item[cnt].scifi );
|
|
||||||
FilePrintf(hFile,"\t\t<NewInv>%d</NewInv>\r\n", Item[cnt].newinv );
|
|
||||||
FilePrintf(hFile,"\t\t<AttachmentSystem>%d</AttachmentSystem>\r\n", Item[cnt].ubAttachmentSystem );
|
FilePrintf(hFile,"\t\t<AttachmentSystem>%d</AttachmentSystem>\r\n", Item[cnt].ubAttachmentSystem );
|
||||||
FilePrintf(hFile,"\t\t<NotInEditor>%d</NotInEditor>\r\n", Item[cnt].notineditor );
|
|
||||||
FilePrintf(hFile,"\t\t<DefaultUndroppable>%d</DefaultUndroppable>\r\n", Item[cnt].defaultundroppable );
|
|
||||||
FilePrintf(hFile,"\t\t<Unaerodynamic>%d</Unaerodynamic>\r\n", Item[cnt].unaerodynamic );
|
|
||||||
FilePrintf(hFile,"\t\t<Electronic>%d</Electronic>\r\n", Item[cnt].electronic );
|
|
||||||
FilePrintf(hFile,"\t\t<Inseparable>%d</Inseparable>\r\n", Item[cnt].inseparable );
|
FilePrintf(hFile,"\t\t<Inseparable>%d</Inseparable>\r\n", Item[cnt].inseparable );
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<BR_NewInventory>%d</BR_NewInventory>\r\n", StoreInventory[cnt][0] );
|
FilePrintf(hFile,"\t\t<BR_NewInventory>%d</BR_NewInventory>\r\n", StoreInventory[cnt][0] );
|
||||||
@@ -1971,7 +2014,6 @@ BOOLEAN WriteItemStats()
|
|||||||
FilePrintf(hFile,"\t\t<BR_ROF>%d</BR_ROF>\r\n", WeaponROF[cnt]);
|
FilePrintf(hFile,"\t\t<BR_ROF>%d</BR_ROF>\r\n", WeaponROF[cnt]);
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<PercentNoiseReduction>%d</PercentNoiseReduction>\r\n", Item[cnt].percentnoisereduction );
|
FilePrintf(hFile,"\t\t<PercentNoiseReduction>%d</PercentNoiseReduction>\r\n", Item[cnt].percentnoisereduction );
|
||||||
FilePrintf(hFile,"\t\t<HideMuzzleFlash>%d</HideMuzzleFlash>\r\n", Item[cnt].hidemuzzleflash );
|
|
||||||
FilePrintf(hFile,"\t\t<Bipod>%d</Bipod>\r\n", Item[cnt].bipod );
|
FilePrintf(hFile,"\t\t<Bipod>%d</Bipod>\r\n", Item[cnt].bipod );
|
||||||
FilePrintf(hFile,"\t\t<RangeBonus>%d</RangeBonus>\r\n", Item[cnt].rangebonus );
|
FilePrintf(hFile,"\t\t<RangeBonus>%d</RangeBonus>\r\n", Item[cnt].rangebonus );
|
||||||
FilePrintf(hFile,"\t\t<PercentRangeBonus>%d</PercentRangeBonus>\r\n", Item[cnt].rangebonus );
|
FilePrintf(hFile,"\t\t<PercentRangeBonus>%d</PercentRangeBonus>\r\n", Item[cnt].rangebonus );
|
||||||
@@ -1997,17 +2039,19 @@ BOOLEAN WriteItemStats()
|
|||||||
|
|
||||||
FilePrintf(hFile,"\t\t<DamageBonus>%d</DamageBonus>\r\n", Item[cnt].damagebonus );
|
FilePrintf(hFile,"\t\t<DamageBonus>%d</DamageBonus>\r\n", Item[cnt].damagebonus );
|
||||||
FilePrintf(hFile,"\t\t<MeleeDamageBonus>%d</MeleeDamageBonus>\r\n", Item[cnt].meleedamagebonus );
|
FilePrintf(hFile,"\t\t<MeleeDamageBonus>%d</MeleeDamageBonus>\r\n", Item[cnt].meleedamagebonus );
|
||||||
FilePrintf(hFile,"\t\t<GrenadeLauncher>%d</GrenadeLauncher>\r\n", Item[cnt].grenadelauncher );
|
|
||||||
FilePrintf(hFile,"\t\t<Duckbill>%d</Duckbill>\r\n", Item[cnt].duckbill );
|
|
||||||
FilePrintf(hFile,"\t\t<GLGrenade>%d</GLGrenade>\r\n", Item[cnt].glgrenade );
|
|
||||||
FilePrintf(hFile,"\t\t<Mine>%d</Mine>\r\n", Item[cnt].mine );
|
|
||||||
FilePrintf(hFile,"\t\t<antitankmine>%d</antitankmine>\r\n", Item[cnt].antitankmine );
|
|
||||||
FilePrintf(hFile,"\t\t<Mortar>%d</Mortar>\r\n", Item[cnt].mortar );
|
|
||||||
FilePrintf(hFile,"\t\t<RocketLauncher>%d</RocketLauncher>\r\n", Item[cnt].rocketlauncher );
|
|
||||||
FilePrintf(hFile,"\t\t<SingleShotRocketLauncher>%d</SingleShotRocketLauncher>\r\n", Item[cnt].singleshotrocketlauncher );
|
|
||||||
FilePrintf(hFile,"\t\t<DiscardedLauncherItem>%d</DiscardedLauncherItem>\r\n", Item[cnt].discardedlauncheritem );
|
FilePrintf(hFile,"\t\t<DiscardedLauncherItem>%d</DiscardedLauncherItem>\r\n", Item[cnt].discardedlauncheritem );
|
||||||
FilePrintf(hFile,"\t\t<RocketRifle>%d</RocketRifle>\r\n", Item[cnt].rocketrifle);
|
|
||||||
FilePrintf(hFile,"\t\t<Cannon>%d</Cannon>\r\n", Item[cnt].cannon);
|
if (ItemIsMortar(cnt)) FilePrintf(hFile, "\t\t<Mortar>%d</Mortar>\r\n", 1);
|
||||||
|
if (ItemIsRocketLauncher(cnt)) FilePrintf(hFile, "\t\t<RocketLauncher>%d</RocketLauncher>\r\n", 1);
|
||||||
|
if (ItemIsSingleShotRocketLauncher(cnt)) FilePrintf(hFile, "\t\t<SingleShotRocketLauncher>%d</SingleShotRocketLauncher>\r\n", 1);
|
||||||
|
if (ItemIsGrenadeLauncher(cnt)) FilePrintf(hFile, "\t\t<GrenadeLauncher>%d</GrenadeLauncher>\r\n", 1);
|
||||||
|
if (ItemIsDuckbill(cnt)) FilePrintf(hFile, "\t\t<Duckbill>%d</Duckbill>\r\n", 1);
|
||||||
|
if (ItemIsGLgrenade(cnt)) FilePrintf(hFile, "\t\t<GLGrenade>%d</GLGrenade>\r\n", 1);
|
||||||
|
if (ItemIsMine(cnt)) FilePrintf(hFile, "\t\t<Mine>%d</Mine>\r\n", 1);
|
||||||
|
if (ItemIsATMine(cnt)) FilePrintf(hFile, "\t\t<antitankmine>%d</antitankmine>\r\n", 1);
|
||||||
|
if (ItemIsRocketRifle(cnt)) FilePrintf(hFile, "\t\t<RocketRifle>%d</RocketRifle>\r\n", 1);
|
||||||
|
if (ItemHasFingerPrintID(cnt)) FilePrintf(hFile, "\t\t<FingerPrintID>%d</FingerPrintID>\r\n", 1);
|
||||||
|
if (ItemIsCannon(cnt)) FilePrintf(hFile, "\t\t<Cannon>%d</Cannon>\r\n", 1);
|
||||||
|
|
||||||
for(UINT8 cnt2 = 0; cnt2 < MAX_DEFAULT_ATTACHMENTS; cnt2++){
|
for(UINT8 cnt2 = 0; cnt2 < MAX_DEFAULT_ATTACHMENTS; cnt2++){
|
||||||
if(Item[cnt].defaultattachments[cnt2] != 0){
|
if(Item[cnt].defaultattachments[cnt2] != 0){
|
||||||
@@ -2015,29 +2059,30 @@ BOOLEAN WriteItemStats()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<BrassKnuckles>%d</BrassKnuckles>\r\n", Item[cnt].brassknuckles );
|
if (ItemIsBrassKnuckles(cnt)) FilePrintf(hFile, "\t\t<BrassKnuckles>%d</BrassKnuckles>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Crowbar>%d</Crowbar>\r\n", Item[cnt].crowbar );
|
if (ItemIsCrowbar(cnt)) FilePrintf(hFile, "\t\t<Crowbar>%d</Crowbar>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<BloodiedItem>%d</BloodiedItem>\r\n", Item[cnt].bloodieditem );
|
if (ItemIsRock(cnt)) FilePrintf(hFile, "\t\t<Rock>%d</Rock>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Rock>%d</Rock>\r\n", Item[cnt].rock );
|
|
||||||
|
|
||||||
|
FilePrintf(hFile,"\t\t<BloodiedItem>%d</BloodiedItem>\r\n", Item[cnt].bloodieditem );
|
||||||
FilePrintf(hFile,"\t\t<CamoBonus>%d</CamoBonus>\r\n", Item[cnt].camobonus );
|
FilePrintf(hFile,"\t\t<CamoBonus>%d</CamoBonus>\r\n", Item[cnt].camobonus );
|
||||||
FilePrintf(hFile,"\t\t<UrbanCamoBonus>%d</UrbanCamoBonus>\r\n", Item[cnt].urbanCamobonus );
|
FilePrintf(hFile,"\t\t<UrbanCamoBonus>%d</UrbanCamoBonus>\r\n", Item[cnt].urbanCamobonus );
|
||||||
FilePrintf(hFile,"\t\t<DesertCamoBonus>%d</DesertCamoBonus>\r\n", Item[cnt].desertCamobonus );
|
FilePrintf(hFile,"\t\t<DesertCamoBonus>%d</DesertCamoBonus>\r\n", Item[cnt].desertCamobonus );
|
||||||
FilePrintf(hFile,"\t\t<SnowCamoBonus>%d</SnowCamoBonus>\r\n", Item[cnt].snowCamobonus );
|
FilePrintf(hFile,"\t\t<SnowCamoBonus>%d</SnowCamoBonus>\r\n", Item[cnt].snowCamobonus );
|
||||||
FilePrintf(hFile,"\t\t<StealthBonus>%d</StealthBonus>\r\n", Item[cnt].stealthbonus );
|
FilePrintf(hFile,"\t\t<StealthBonus>%d</StealthBonus>\r\n", Item[cnt].stealthbonus );
|
||||||
FilePrintf(hFile,"\t\t<FlakJacket>%d</FlakJacket>\r\n", Item[cnt].flakjacket );
|
|
||||||
FilePrintf(hFile,"\t\t<LeatherJacket>%d</LeatherJacket>\r\n", Item[cnt].leatherjacket );
|
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<Detonator>%d</Detonator>\r\n", Item[cnt].detonator );
|
if (ItemIsFlakJacket(cnt)) FilePrintf(hFile, "\t\t<FlakJacket>%d</FlakJacket>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<RemoteDetonator>%d</RemoteDetonator>\r\n", Item[cnt].remotedetonator );
|
if (ItemIsLeatherJacket(cnt)) FilePrintf(hFile, "\t\t<LeatherJacket>%d</LeatherJacket>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<RemoteTrigger>%d</RemoteTrigger>\r\n", Item[cnt].remotetrigger );
|
if (ItemIsDetonator(cnt)) FilePrintf(hFile, "\t\t<Detonator>%d</Detonator>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<LockBomb>%d</LockBomb>\r\n", Item[cnt].lockbomb );
|
if (ItemIsRemoteDetonator(cnt)) FilePrintf(hFile, "\t\t<RemoteDetonator>%d</RemoteDetonator>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Flare>%d</Flare>\r\n", Item[cnt].flare );
|
if (ItemIsRemoteTrigger(cnt)) FilePrintf(hFile, "\t\t<RemoteTrigger>%d</RemoteTrigger>\r\n", 1);
|
||||||
|
if (ItemIsLockBomb(cnt)) FilePrintf(hFile, "\t\t<LockBomb>%d</LockBomb>\r\n", 1);
|
||||||
|
if (ItemIsFlare(cnt)) FilePrintf(hFile, "\t\t<Flare>%d</Flare>\r\n", 1);
|
||||||
|
if (ItemIsRobotRemote(cnt)) FilePrintf(hFile, "\t\t<RobotRemoteControl>%d</RobotRemoteControl>\r\n", 1);
|
||||||
|
if (ItemIsWalkman(cnt)) FilePrintf(hFile, "\t\t<Walkman>%d</Walkman>\r\n", 1);
|
||||||
|
if (ItemIsThermalOptics(cnt)) FilePrintf(hFile, "\t\t<ThermalOptics>%d</ThermalOptics>\r\n", 1);
|
||||||
|
if (ItemIsGasmask(cnt)) FilePrintf(hFile, "\t\t<GasMask>%d</GasMask>\r\n", 1);
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<RobotRemoteControl>%d</RobotRemoteControl>\r\n", Item[cnt].robotremotecontrol );
|
|
||||||
FilePrintf(hFile,"\t\t<Walkman>%d</Walkman>\r\n", Item[cnt].walkman );
|
|
||||||
FilePrintf(hFile,"\t\t<HearingRangeBonus>%d</HearingRangeBonus>\r\n", Item[cnt].hearingrangebonus );
|
FilePrintf(hFile,"\t\t<HearingRangeBonus>%d</HearingRangeBonus>\r\n", Item[cnt].hearingrangebonus );
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<VisionRangeBonus>%d</VisionRangeBonus>\r\n", Item[cnt].visionrangebonus );
|
FilePrintf(hFile,"\t\t<VisionRangeBonus>%d</VisionRangeBonus>\r\n", Item[cnt].visionrangebonus );
|
||||||
FilePrintf(hFile,"\t\t<NightVisionRangeBonus>%d</NightVisionRangeBonus>\r\n", Item[cnt].nightvisionrangebonus );
|
FilePrintf(hFile,"\t\t<NightVisionRangeBonus>%d</NightVisionRangeBonus>\r\n", Item[cnt].nightvisionrangebonus );
|
||||||
FilePrintf(hFile,"\t\t<DayVisionRangeBonus>%d</DayVisionRangeBonus>\r\n", Item[cnt].dayvisionrangebonus );
|
FilePrintf(hFile,"\t\t<DayVisionRangeBonus>%d</DayVisionRangeBonus>\r\n", Item[cnt].dayvisionrangebonus );
|
||||||
@@ -2045,30 +2090,26 @@ BOOLEAN WriteItemStats()
|
|||||||
FilePrintf(hFile,"\t\t<BrightLightVisionRangeBonus>%d</BrightLightVisionRangeBonus>\r\n", Item[cnt].brightlightvisionrangebonus );
|
FilePrintf(hFile,"\t\t<BrightLightVisionRangeBonus>%d</BrightLightVisionRangeBonus>\r\n", Item[cnt].brightlightvisionrangebonus );
|
||||||
FilePrintf(hFile,"\t\t<ItemSizeBonus>%d</ItemSizeBonus>\r\n", Item[cnt].itemsizebonus );
|
FilePrintf(hFile,"\t\t<ItemSizeBonus>%d</ItemSizeBonus>\r\n", Item[cnt].itemsizebonus );
|
||||||
FilePrintf(hFile,"\t\t<PercentTunnelVision>%d</PercentTunnelVision>\r\n", Item[cnt].percenttunnelvision );
|
FilePrintf(hFile,"\t\t<PercentTunnelVision>%d</PercentTunnelVision>\r\n", Item[cnt].percenttunnelvision );
|
||||||
FilePrintf(hFile,"\t\t<ThermalOptics>%d</ThermalOptics>\r\n", Item[cnt].thermaloptics );
|
|
||||||
FilePrintf(hFile,"\t\t<GasMask>%d</GasMask>\r\n", Item[cnt].gasmask );
|
|
||||||
|
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<Alcohol>%3.2f</Alcohol>\r\n", Item[cnt].alcohol );
|
FilePrintf(hFile,"\t\t<Alcohol>%3.2f</Alcohol>\r\n", Item[cnt].alcohol );
|
||||||
FilePrintf(hFile,"\t\t<Hardware>%d</Hardware>\r\n", Item[cnt].hardware );
|
|
||||||
FilePrintf(hFile,"\t\t<Medical>%d</Medical>\r\n", Item[cnt].medical );
|
if (ItemIsHardware(cnt)) FilePrintf(hFile, "\t\t<Hardware>%d</Hardware>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<CamouflageKit>%d</CamouflageKit>\r\n", Item[cnt].camouflagekit );
|
if (ItemIsMedical(cnt)) FilePrintf(hFile, "\t\t<Medical>%d</Medical>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<LocksmithKit>%d</LocksmithKit>\r\n", Item[cnt].locksmithkit );
|
if (ItemIsCamoKit(cnt)) FilePrintf(hFile, "\t\t<CamouflageKit>%d</CamouflageKit>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Toolkit>%d</Toolkit>\r\n", Item[cnt].toolkit );
|
if (ItemIsLocksmithKit(cnt)) FilePrintf(hFile, "\t\t<LocksmithKit>%d</LocksmithKit>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<FirstAidKit>%d</FirstAidKit>\r\n", Item[cnt].firstaidkit );
|
if (ItemIsToolkit(cnt)) FilePrintf(hFile, "\t\t<Toolkit>%d</Toolkit>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<MedicalKit>%d</MedicalKit>\r\n", Item[cnt].medicalkit );
|
if (ItemIsFirstAidKit(cnt)) FilePrintf(hFile, "\t\t<FirstAidKit>%d</FirstAidKit>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<WireCutters>%d</WireCutters>\r\n", Item[cnt].wirecutters );
|
if (ItemIsMedicalKit(cnt)) FilePrintf(hFile, "\t\t<MedicalKit>%d</MedicalKit>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Canteen>%d</Canteen>\r\n", Item[cnt].canteen );
|
if (ItemIsWirecutters(cnt)) FilePrintf(hFile, "\t\t<WireCutters>%d</WireCutters>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<GasCan>%d</GasCan>\r\n", Item[cnt].gascan );
|
if (ItemIsCanteen(cnt)) FilePrintf(hFile, "\t\t<Canteen>%d</Canteen>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Marbles>%d</Marbles>\r\n", Item[cnt].marbles );
|
if (ItemIsGascan(cnt)) FilePrintf(hFile, "\t\t<GasCan>%d</GasCan>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<CanAndString>%d</CanAndString>\r\n", Item[cnt].canandstring );
|
if (ItemIsMarbles(cnt)) FilePrintf(hFile, "\t\t<Marbles>%d</Marbles>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Jar>%d</Jar>\r\n", Item[cnt].jar );
|
if (ItemIsCanAndString(cnt)) FilePrintf(hFile, "\t\t<CanAndString>%d</CanAndString>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<XRay>%d</XRay>\r\n", Item[cnt].xray );
|
if (ItemIsJar(cnt)) FilePrintf(hFile, "\t\t<Jar>%d</Jar>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Batteries>%d</Batteries>\r\n", Item[cnt].batteries );
|
if (ItemHasXRay(cnt)) FilePrintf(hFile, "\t\t<XRay>%d</XRay>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<NeedsBatteries>%d</NeedsBatteries>\r\n", Item[cnt].needsbatteries );
|
if (ItemIsBatteries(cnt)) FilePrintf(hFile, "\t\t<Batteries>%d</Batteries>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<ContainsLiquid>%d</ContainsLiquid>\r\n", Item[cnt].containsliquid );
|
if (ItemNeedsBatteries(cnt)) FilePrintf(hFile, "\t\t<NeedsBatteries>%d</NeedsBatteries>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<MetalDetector>%d</MetalDetector>\r\n", Item[cnt].metaldetector );
|
if (ItemContainsLiquid(cnt)) FilePrintf(hFile, "\t\t<ContainsLiquid>%d</ContainsLiquid>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<FingerPrintID>%d</FingerPrintID>\r\n", Item[cnt].fingerprintid );
|
if (ItemIsMetalDetector(cnt)) FilePrintf(hFile, "\t\t<MetalDetector>%d</MetalDetector>\r\n", 1);
|
||||||
|
|
||||||
// HEADROCK HAM 4: Print out new values
|
// HEADROCK HAM 4: Print out new values
|
||||||
FilePrintf(hFile,"\t\t<ScopeMagFactor>%d</ScopeMagFactor>\r\n", Item[cnt].scopemagfactor );
|
FilePrintf(hFile,"\t\t<ScopeMagFactor>%d</ScopeMagFactor>\r\n", Item[cnt].scopemagfactor );
|
||||||
@@ -2119,7 +2160,7 @@ BOOLEAN WriteItemStats()
|
|||||||
FilePrintf(hFile,"\t\t</PRONE_MODIFIERS>\r\n");
|
FilePrintf(hFile,"\t\t</PRONE_MODIFIERS>\r\n");
|
||||||
|
|
||||||
// Flugente FTW 1.2
|
// Flugente FTW 1.2
|
||||||
FilePrintf(hFile,"\t\t<barrel>%d</barrel>\r\n", Item[cnt].barrel );
|
if (ItemIsBarrel(cnt)) FilePrintf(hFile, "\t\t<barrel>%d</barrel>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<usOverheatingCooldownFactor>%4.2f</usOverheatingCooldownFactor>\r\n", Item[cnt].usOverheatingCooldownFactor );
|
FilePrintf(hFile,"\t\t<usOverheatingCooldownFactor>%4.2f</usOverheatingCooldownFactor>\r\n", Item[cnt].usOverheatingCooldownFactor );
|
||||||
FilePrintf(hFile,"\t\t<overheatTemperatureModificator>%4.2f</overheatTemperatureModificator>\r\n", Item[cnt].overheatTemperatureModificator );
|
FilePrintf(hFile,"\t\t<overheatTemperatureModificator>%4.2f</overheatTemperatureModificator>\r\n", Item[cnt].overheatTemperatureModificator );
|
||||||
FilePrintf(hFile,"\t\t<overheatCooldownModificator>%4.2f</overheatCooldownModificator>\r\n", Item[cnt].overheatCooldownModificator );
|
FilePrintf(hFile,"\t\t<overheatCooldownModificator>%4.2f</overheatCooldownModificator>\r\n", Item[cnt].overheatCooldownModificator );
|
||||||
@@ -2128,16 +2169,13 @@ BOOLEAN WriteItemStats()
|
|||||||
|
|
||||||
FilePrintf(hFile,"\t\t<AttachmentClass>%4.2f</AttachmentClass>\r\n", Item[cnt].attachmentclass );
|
FilePrintf(hFile,"\t\t<AttachmentClass>%4.2f</AttachmentClass>\r\n", Item[cnt].attachmentclass );
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<TripwireActivation>%d</TripwireActivation>\r\n", Item[cnt].tripwireactivation );
|
if (ItemHasTripwireActivation(cnt)) FilePrintf(hFile, "\t\t<TripwireActivation>%d</TripwireActivation>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<TripWire>%d</TripWire>\r\n", Item[cnt].tripwire );
|
if (ItemIsTripwire(cnt)) FilePrintf(hFile, "\t\t<TripWire>%d</TripWire>\r\n", 1);
|
||||||
FilePrintf(hFile,"\t\t<Directional>%d</Directional>\r\n", Item[cnt].directional );
|
if (ItemIsDirectional(cnt)) FilePrintf(hFile, "\t\t<Directional>%d</Directional>\r\n", 1);
|
||||||
|
if (ItemBlocksIronsight(cnt)) FilePrintf(hFile, "\t\t<BlockIronSight>%d</BlockIronSight>\r\n", 1);
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<DrugType>%d</DrugType>\r\n", Item[cnt].drugtype );
|
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<BlockIronSight>%d</BlockIronSight>\r\n", Item[cnt].blockironsight );
|
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<ItemFlag>%d</ItemFlag>\r\n", Item[cnt].usItemFlag );
|
FilePrintf(hFile,"\t\t<ItemFlag>%d</ItemFlag>\r\n", Item[cnt].usItemFlag );
|
||||||
|
FilePrintf(hFile,"\t\t<DrugType>%d</DrugType>\r\n", Item[cnt].drugtype );
|
||||||
FilePrintf(hFile,"\t\t<FoodType>%d</FoodType>\r\n", Item[cnt].foodtype );
|
FilePrintf(hFile,"\t\t<FoodType>%d</FoodType>\r\n", Item[cnt].foodtype );
|
||||||
|
|
||||||
//JMich_SkillModifiers: Adding the values here as well
|
//JMich_SkillModifiers: Adding the values here as well
|
||||||
@@ -2161,10 +2199,10 @@ BOOLEAN WriteItemStats()
|
|||||||
FilePrintf(hFile,"\t\t<SleepModifier>%d</SleepModifier>\r\n", Item[cnt].ubSleepModifier );
|
FilePrintf(hFile,"\t\t<SleepModifier>%d</SleepModifier>\r\n", Item[cnt].ubSleepModifier );
|
||||||
FilePrintf(hFile,"\t\t<usSpotting>%d</usSpotting>\r\n", Item[cnt].usSpotting );
|
FilePrintf(hFile,"\t\t<usSpotting>%d</usSpotting>\r\n", Item[cnt].usSpotting );
|
||||||
FilePrintf(hFile,"\t\t<sBackpackWeightModifier>%d</sBackpackWeightModifier>\r\n", Item[cnt].sBackpackWeightModifier);
|
FilePrintf(hFile,"\t\t<sBackpackWeightModifier>%d</sBackpackWeightModifier>\r\n", Item[cnt].sBackpackWeightModifier);
|
||||||
FilePrintf(hFile,"\t\t<fAllowClimbing>%d</fAllowClimbing>\r\n", Item[cnt].fAllowClimbing);
|
|
||||||
FilePrintf(hFile,"\t\t<cigarette>%d</cigarette>\r\n", Item[cnt].cigarette );
|
|
||||||
FilePrintf(hFile,"\t\t<usPortionSize>%d</usPortionSize>\r\n", Item[cnt].usPortionSize );
|
FilePrintf(hFile,"\t\t<usPortionSize>%d</usPortionSize>\r\n", Item[cnt].usPortionSize );
|
||||||
|
|
||||||
|
if (ItemAllowsClimbing(cnt)) FilePrintf(hFile, "\t\t<fAllowClimbing>%d</fAllowClimbing>\r\n", 1);
|
||||||
|
if (ItemIsCigarette(cnt)) FilePrintf(hFile, "\t\t<cigarette>%d</cigarette>\r\n", 1);
|
||||||
if ( HasItemFlag( cnt, DISEASEPROTECTION_1 ) ) FilePrintf( hFile, "\t\t<diseaseprotectionface>%d</diseaseprotectionface>\r\n", 1 );
|
if ( HasItemFlag( cnt, DISEASEPROTECTION_1 ) ) FilePrintf( hFile, "\t\t<diseaseprotectionface>%d</diseaseprotectionface>\r\n", 1 );
|
||||||
if ( HasItemFlag( cnt, DISEASEPROTECTION_2 ) ) FilePrintf( hFile, "\t\t<diseaseprotectionhand>%d</diseaseprotectionhand>\r\n", 1 );
|
if ( HasItemFlag( cnt, DISEASEPROTECTION_2 ) ) FilePrintf( hFile, "\t\t<diseaseprotectionhand>%d</diseaseprotectionhand>\r\n", 1 );
|
||||||
if ( HasItemFlag( cnt, BLOOD_BAG) ) FilePrintf( hFile, "\t\t<bloodbag>%d</bloodbag>\r\n", 1 );
|
if ( HasItemFlag( cnt, BLOOD_BAG) ) FilePrintf( hFile, "\t\t<bloodbag>%d</bloodbag>\r\n", 1 );
|
||||||
@@ -2182,11 +2220,11 @@ BOOLEAN WriteItemStats()
|
|||||||
FilePrintf(hFile,"\t\t<RobotTargetingSkillGrant>%d</RobotTargetingSkillGrant>\r\n", Item[cnt].bRobotTargetingSkillGrant );
|
FilePrintf(hFile,"\t\t<RobotTargetingSkillGrant>%d</RobotTargetingSkillGrant>\r\n", Item[cnt].bRobotTargetingSkillGrant );
|
||||||
FilePrintf(hFile,"\t\t<RobotChassisSkillGrant>%d</RobotChassisSkillGrant>\r\n", Item[cnt].bRobotChassisSkillGrant );
|
FilePrintf(hFile,"\t\t<RobotChassisSkillGrant>%d</RobotChassisSkillGrant>\r\n", Item[cnt].bRobotChassisSkillGrant );
|
||||||
FilePrintf(hFile,"\t\t<RobotUtilitySkillGrant>%d</RobotUtilitySkillGrant>\r\n", Item[cnt].bRobotUtilitySkillGrant );
|
FilePrintf(hFile,"\t\t<RobotUtilitySkillGrant>%d</RobotUtilitySkillGrant>\r\n", Item[cnt].bRobotUtilitySkillGrant );
|
||||||
FilePrintf(hFile,"\t\t<ProvidesRobotCamo>%d</ProvidesRobotCamo>\r\n", Item[cnt].fProvidesRobotCamo );
|
|
||||||
FilePrintf(hFile,"\t\t<ProvidesRobotNightVision>%d</ProvidesRobotNightVision>\r\n", Item[cnt].fProvidesRobotNightVision );
|
|
||||||
FilePrintf(hFile,"\t\t<ProvidesRobotLaserBonus>%d</ProvidesRobotLaserBonus>\r\n", Item[cnt].fProvidesRobotLaserBonus );
|
|
||||||
|
|
||||||
FilePrintf(hFile, "\t\t<DiseaseSystemExclusive>%d</DiseaseSystemExclusive>\r\n", Item[cnt].DiseaseSystemExclusive);
|
if (ItemProvidesRobotCamo(cnt)) FilePrintf(hFile, "\t\t<ProvidesRobotCamo>%d</ProvidesRobotCamo>\r\n", 1);
|
||||||
|
if (ItemProvidesRobotNightvision(cnt)) FilePrintf(hFile, "\t\t<ProvidesRobotNightVision>%d</ProvidesRobotNightVision>\r\n", 1);
|
||||||
|
if (ItemProvidesRobotLaserBonus(cnt)) FilePrintf(hFile, "\t\t<ProvidesRobotLaserBonus>%d</ProvidesRobotLaserBonus>\r\n", 1);
|
||||||
|
if (ItemIsOnlyInDisease(cnt)) FilePrintf(hFile, "\t\t<DiseaseSystemExclusive>%d</DiseaseSystemExclusive>\r\n", 1);
|
||||||
|
|
||||||
FilePrintf(hFile,"\t</ITEM>\r\n");
|
FilePrintf(hFile,"\t</ITEM>\r\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user