nuke all the #if 0's

scripted commit:

find . -not -path '*/.*' -and -not -path '*/ext*' -type d -exec coan source -R -E {} ';'

https://coan2.sourceforge.net/coan_man_1.html
This commit is contained in:
Marco Antonio Jaguaribe Costa
2023-01-19 00:13:08 +02:00
committed by Asdow
parent 6afe785f4b
commit 8b1c4effa0
72 changed files with 0 additions and 6657 deletions
-52
View File
@@ -45,58 +45,6 @@ void RemoveNonIntelItems();
UINT8 gubLastSpecialItemAddedAtElement = 255;
// Flugente 2012-12-19: merchant data has been externalised - see XML_Merchants.cpp
#if 0
// THIS STRUCTURE HAS UNCHANGING INFO THAT DOESN'T GET SAVED/RESTORED/RESET
// TODO: externalize
const ARMS_DEALER_INFO DefaultarmsDealerInfo[ NUM_ARMS_DEALERS ] =
{
//Buying Selling Merc ID# Type Initial Flags
//Price Price Of Cash
//Modifier Modifier Dealer
/* Tony */ { 0.75f, 1.25f, TONY, ARMS_DEALER_BUYS_SELLS, 15000, ARMS_DEALER_SOME_USED_ITEMS | ARMS_DEALER_GIVES_CHANGE, 15000, 15000, 0, 1, 10, 1, 10, 2, 3, false, false },
/* Franz Hinkle */ { 1.0f, 1.5f, FRANZ, ARMS_DEALER_BUYS_SELLS, 5000, ARMS_DEALER_SOME_USED_ITEMS | ARMS_DEALER_GIVES_CHANGE, 5000, 5000, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Keith Hemps */ { 0.75f, 1.0f, KEITH, ARMS_DEALER_BUYS_SELLS, 1500, ARMS_DEALER_ONLY_USED_ITEMS | ARMS_DEALER_GIVES_CHANGE, 1500, 1500, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Jake Cameron */ { 0.8f, 1.1f, JAKE, ARMS_DEALER_BUYS_SELLS, 2500, ARMS_DEALER_ONLY_USED_ITEMS | ARMS_DEALER_GIVES_CHANGE, 2500, 2500, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Gabby Mulnick*/ { 1.0f, 1.0f, GABBY, ARMS_DEALER_BUYS_SELLS, 3000, ARMS_DEALER_GIVES_CHANGE , 3000, 3000, 0, 1, 10, 0, 100, 1, 2, false, true },
#ifdef JA2UB
/* Devin Connell*/ //ja25 ub Biggins//{ 0.75f, 1.25f, DEVIN, ARMS_DEALER_SELLS_ONLY, 5000, ARMS_DEALER_GIVES_CHANGE , 5000, 5000, 0, 3, 10, 0, 10, 2, 3, false, false },
#else
/* Devin Connell*/ { 0.75f, 1.25f, DEVIN, ARMS_DEALER_SELLS_ONLY, 5000, ARMS_DEALER_GIVES_CHANGE , 5000, 5000, 0, 3, 10, 0, 10, 2, 3, false, false },
#endif
/* Howard Filmore*/ { 1.0f, 1.0f, HOWARD, ARMS_DEALER_SELLS_ONLY, 3000, ARMS_DEALER_GIVES_CHANGE , 3000, 3000, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Sam Rozen */ { 1.0f, 1.0f, SAM, ARMS_DEALER_SELLS_ONLY, 3000, ARMS_DEALER_GIVES_CHANGE , 3000, 3000, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Frank */ { 1.0f, 1.0f, FRANK, ARMS_DEALER_SELLS_ONLY, 500, ARMS_DEALER_ACCEPTS_GIFTS , 500, 500, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Bar Bro 1 */ { 1.0f, 1.0f, HERVE, ARMS_DEALER_SELLS_ONLY, 250, ARMS_DEALER_ACCEPTS_GIFTS , 250, 250, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Bar Bro 2 */ { 1.0f, 1.0f, PETER, ARMS_DEALER_SELLS_ONLY, 250, ARMS_DEALER_ACCEPTS_GIFTS , 250, 250, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Bar Bro 3 */ { 1.0f, 1.0f, ALBERTO, ARMS_DEALER_SELLS_ONLY, 250, ARMS_DEALER_ACCEPTS_GIFTS , 250, 250, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Bar Bro 4 */ { 1.0f, 1.0f, CARLO, ARMS_DEALER_SELLS_ONLY, 250, ARMS_DEALER_ACCEPTS_GIFTS , 250, 250, 0, 1, 10, 0, 100, 1, 2, false, true },
/* Micky O'Brien*/ { 1.0f, 1.4f, MICKY, ARMS_DEALER_BUYS_ONLY, 10000, ARMS_DEALER_HAS_NO_INVENTORY | ARMS_DEALER_GIVES_CHANGE, 10000, 10000, 0, 1, 10, 1, 10, 1, 2, false, true },
//Repair Repair
//Speed Cost
/* Arnie Brunzwell*/{ 0.1f, 0.8f, ARNIE, ARMS_DEALER_REPAIRS, 1500, ARMS_DEALER_HAS_NO_INVENTORY | ARMS_DEALER_GIVES_CHANGE, 1500, 1500, 0, 1, 10, 1, 10, 1, 2, false, true },
/* Fredo */ { 0.6f, 0.6f, FREDO, ARMS_DEALER_REPAIRS, 1000, ARMS_DEALER_HAS_NO_INVENTORY | ARMS_DEALER_GIVES_CHANGE, 1000, 1000, 0, 1, 10, 1, 10, 1, 2, false, true },
#ifdef JA2UB
/* Raul */ { 0.80f, 1.8f, PERKO, ARMS_DEALER_BUYS_SELLS, 20000, ARMS_DEALER_SOME_USED_ITEMS | ARMS_DEALER_GIVES_CHANGE , 1000, 1000, 0, 1, 10, 1, 10, 1, 2, false, true },
#else
/* Perko */ { 1.0f, 0.4f, PERKO, ARMS_DEALER_REPAIRS, 1000, ARMS_DEALER_HAS_NO_INVENTORY | ARMS_DEALER_GIVES_CHANGE, 1000, 1000, 0, 1, 10, 1, 10, 1, 2, false, true },
#endif
/* Elgin */ { 1.0f, 1.0f, DRUGGIST, ARMS_DEALER_SELLS_ONLY, 500, ARMS_DEALER_ACCEPTS_GIFTS , 500, 500, 0, 1, 10, 1, 10, 1, 2, false, true },
/* Manny */ { 1.0f, 1.0f, MANNY, ARMS_DEALER_SELLS_ONLY, 500, ARMS_DEALER_ACCEPTS_GIFTS , 500, 500, 0, 1, 10, 1, 10, 1, 2, false, true },
#ifdef JA2UB
/* Betty */ { 0.75f, 1.25f, 73, ARMS_DEALER_BUYS_SELLS, 10000, ARMS_DEALER_SOME_USED_ITEMS | ARMS_DEALER_GIVES_CHANGE , 1000, 1000, 0, 1, 10, 1, 10, 1, 2, false, true },
#endif
};
#endif
std::vector<ARMS_DEALER_INFO> armsDealerInfo (NUM_ARMS_DEALERS);
-29
View File
@@ -10,35 +10,6 @@
SUBSEQUENTSOUNDS subsequentsounds;
#if 0
static void AILCALLBACK timer_func( UINT32 user )
{
AudioGapList *pGapList;
pGapList = (AudioGapList*)user;
pGapList->gap_monitor_timer += GAP_TIMER_INTERVAL;
if ( pGapList->audio_gap_active )
{
if ( (pGapList->gap_monitor_timer / 1000) > pGapList->end[ pGapList->gap_monitor_current] )
{
pGapList->audio_gap_active = 0;
pGapList->gap_monitor_current++;
}
}
else
{
if ( pGapList->gap_monitor_current < pGapList->count )
{
if ( ( pGapList->gap_monitor_timer / 1000) >= pGapList->start[ pGapList->gap_monitor_current ])
{
pGapList->audio_gap_active = 1;
}
}
}
}
#endif
void AudioGapListInit( CHAR8 *zSoundFile, AudioGapList *pGapList )
-8
View File
@@ -3920,14 +3920,6 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
pSoldier->usUIMovementMode = pSoldier->GetMoveStateBasedOnStance( bNewStance );
pSoldier->ubDesiredHeight = NO_DESIRED_HEIGHT;
#if 0
if ( pSoldier->usUIMovementMode == CRAWLING && gAnimControl[ pSoldier->usAnimState ].ubEndHeight != ANIM_PRONE )
{
pSoldier->usDontUpdateNewGridNoOnMoveAnimChange = LOCKED_NO_NEWGRIDNO;
pSoldier->pathing.bPathStored = FALSE;
}
else
#endif
{
pSoldier->usDontUpdateNewGridNoOnMoveAnimChange = 1;
}
-44
View File
@@ -2761,19 +2761,6 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
}
}
#if 0
if ( gbInvalidPlacementSlot[ sPocket ] )
{
if ( sPocket != SECONDHANDPOS )
{
// If we are in inv panel and our guy is not = cursor guy...
if ( !gfSMDisableForItems )
{
fHatchItOut = TRUE;
}
}
}
#endif
if (AM_A_ROBOT(pSoldier) && sPocket == HANDPOS)
fHatchItOut = FALSE;
@@ -3808,7 +3795,6 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
{
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_DKGRAY );
#if 1
//CHRISL: Moved this condition to the start so that stacked guns will show number in stack
if ( ubStatusIndex != RENDER_ITEM_NOSTATUS )
{
@@ -3833,7 +3819,6 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
gprintfinvalidate( sNewX, sNewY, pStr );
}
}
#endif
if ( pItem->usItemClass == IC_GUN && !Item[pObject->usItem].rocketlauncher )
{
@@ -3941,35 +3926,6 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
}
}
}
#if 0
else
{
if ( ubStatusIndex != RENDER_ITEM_NOSTATUS )
{
// Now display # of items
if ( pObject->ubNumberOfObjects > 1 )
{
SetFontForeground( FONT_GRAY4 );
sNewY = sY + sHeight - 10;
swprintf( pStr, L"%d", pObject->ubNumberOfObjects );
// Get length of string
uiStringLength=StringPixLength(pStr, ITEM_FONT );
sNewX = sX + sWidth - uiStringLength - 4;
if ( uiBuffer == guiSAVEBUFFER )
{
RestoreExternBackgroundRect( sNewX, sNewY, 15, 15 );
}
mprintf( sNewX, sNewY, pStr );
gprintfinvalidate( sNewX, sNewY, pStr );
}
}
}
#endif
if ( ItemHasAttachments( pObject, pSoldier, iter ) )
{
if ( !IsGrenadeLauncherAttached( pObject, iter ) )
-6
View File
@@ -594,13 +594,7 @@ LBENODE* OBJECTTYPE::GetLBEPointer(unsigned int index)
bool OBJECTTYPE::exists()
{
#if 0//dnl ch75 011113
if(this == NULL)
return(FALSE);
return (ubNumberOfObjects > 0 && usItem != NOTHING);
#else
return(this && ubNumberOfObjects && usItem);
#endif
}
void OBJECTTYPE::SpliceData(OBJECTTYPE& sourceObject, unsigned int numToSplice, StackedObjects::iterator beginIter)
-91
View File
@@ -3031,49 +3031,6 @@ UINT16 CalculateItemSize( OBJECTTYPE *pObject )
currentSize = __max(iSize + testSize, currentSize);
currentSize = __min(currentSize, maxSize);
}
#if 0
//old method
UINT16 newSize, testSize, maxSize;
UINT8 cnt=0;
newSize = 0;
maxSize = max(iSize, LoadBearingEquipment[Item[pObject->usItem].ubClassIndex].lbeFilledSize);
// Look for the ItemSize of the largest item in this LBENODE
for(UINT16 x = 0; x < invsize; ++x)
{
if(pLBE->inv[x].exists() == true)
{
testSize = CalculateItemSize(&(pLBE->inv[x]));
//Now that we have the size of one item, we want to factor in the number of items since two
// items take up more space then one.
testSize = testSize + pLBE->inv[x].ubNumberOfObjects - 1;
testSize = min(testSize,34);
//We also need to increase the size of guns so they'll fit with the rest of our calculations.
if(testSize < 5)
testSize += 10;
if(testSize < 10)
testSize += 18;
//Finally, we want to factor in multiple pockets. We'll do this by counting the number of filled
// pockets, then add this count total to our newSize when everything is finished.
cnt++;
newSize = max(testSize, newSize);
}
}
//Add the total number of filled pockets to our NewSize to account for multiple pockets being used
newSize += cnt;
newSize = min(newSize,34);
// If largest item is smaller then LBE, don't change ItemSize
if(newSize > 0 && newSize < iSize) {
iSize = iSize;
}
// if largest item is larget then LBE but smaller then max size, partially increase ItemSize
else if(newSize >= iSize && newSize < maxSize) {
iSize = newSize;
}
// if largest item is larger then max size, reset ItemSize to max size
else if(newSize >= maxSize) {
iSize = maxSize;
}
#endif
}
}
}
@@ -8458,19 +8415,7 @@ BOOLEAN CreateItem( UINT16 usItem, INT16 bStatus, OBJECTTYPE * pObj )
{
(*pObj).fFlags |= OBJECT_UNDROPPABLE;
}
#if 0//dnl ch74 201013 create default attachments rather at gun status instead of 100%
for(UINT8 cnt = 0; cnt < MAX_DEFAULT_ATTACHMENTS; cnt++){
if(Item [ usItem ].defaultattachments[cnt] == 0)
break;
//cannot use gTempObject
OBJECTTYPE defaultAttachment;
CreateItem(Item [ usItem ].defaultattachments[cnt],100,&defaultAttachment);
pObj->AttachObject(NULL,&defaultAttachment, FALSE);
}
#else
AttachDefaultAttachments(pObj);//dnl ch75 261013
#endif
}
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("CreateItem: return %d",fRet));
@@ -12644,42 +12589,6 @@ UINT16 PickARandomLaunchable(UINT16 itemIndex)
UINT16 usNumMatches = 0;
UINT16 usRandom = 0;
UINT16 lowestCoolness = LowestLaunchableCoolness(itemIndex);
#if 0
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomLaunchable: itemIndex = %d", itemIndex));
// WANNE: This should fix the hang on the merc positioning screen (fix by Razer)
//while( !usNumMatches )
{ //Count the number of valid launchables
for( i = 0; i < MAXITEMS; ++i )
{
if ( Item[i].usItemClass == 0 )
break;
//Madd: quickfix: make it not choose best grenades right away.
if( ValidLaunchable( i, itemIndex ) && ItemIsLegal(i) && Item[i].ubCoolness <= max(HighestPlayerProgressPercentage()/10,lowestCoolness) )
usNumMatches++;
}
}
if( usNumMatches )
{
usRandom = (UINT16)Random( usNumMatches );
for( i = 0; i < MAXITEMS; ++i )
{
if ( Item[i].usItemClass == 0 )
break;
if( ValidLaunchable( i, itemIndex ) && ItemIsLegal(i) && Item[i].ubCoolness <= max(HighestPlayerProgressPercentage()/10,lowestCoolness) )
{
if( usRandom )
usRandom--;
else
{
return i;
}
}
}
}
#endif
// Flugente: the above code is highly dubious.. why do we loop over all items 2 times, and why that obscure usRandom--; business? This can cause an underflow!
BOOLEAN isnight = NightTime();
-12
View File
@@ -1190,9 +1190,6 @@ BOOLEAN ModifyDoorStatus( INT32 sGridNo, BOOLEAN fOpen, BOOLEAN fPerceivedOpen )
if ( pBaseStructure == NULL )
{
#if 0
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Door structure data at %d was not found", sGridNo );
#endif
return( FALSE );
}
@@ -1314,9 +1311,6 @@ BOOLEAN IsDoorOpen( INT32 sGridNo )
if ( pBaseStructure == NULL )
{
#if 0
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Door structure data at %d was not found", sGridNo );
#endif
return( FALSE );
}
@@ -1527,9 +1521,6 @@ void SyncronizeDoorStatusToStructureData( DOOR_STATUS *pDoorStatus )
if ( pBaseStructure == NULL )
{
#if 0
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Door structure data at %d was not found", pDoorStatus->sGridNo );
#endif
return;
}
@@ -1611,9 +1602,6 @@ void InternalUpdateDoorGraphicFromStatus( DOOR_STATUS *pDoorStatus, BOOLEAN fUse
if ( pBaseStructure == NULL )
{
#if 0
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Door structure data at %d was not found", pDoorStatus->sGridNo );
#endif
return;
}
-36
View File
@@ -4805,15 +4805,7 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
dDeltaX = dEndX - dStartX;
dDeltaY = dEndY - dStartY;
dDeltaZ = dEndZ - dStartZ;
#if 0//dnl ch60 020913 isn't true see reason in FireBulletGivenTarget
//lal bugfix
if( dDeltaZ > 0 )
d2DDistance = Distance3D( dDeltaX, dDeltaY, dDeltaZ );
else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#endif
iDistance = (INT32) d2DDistance;
if ( d2DDistance != iDistance )
@@ -5304,15 +5296,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
dDeltaX = dEndX - dStartX;
dDeltaY = dEndY - dStartY;
dDeltaZ = dEndZ - dStartZ;
#if 0//dnl ch60 311009 this isn't correct, e.g. if you try head shot from prone to standing target at 1 tile, Distance3D will calculate 7,8 tile distance, this means that you will always hit target regard of CTH calculation, correct usage will be Distance3D(dDeltaX, dDeltaY, CONVERT_HEIGHTUNITS_TO_DISTANCE(dDeltaZ)) but we need here 2D distance as was in original v1.12
//lal bugfix
if( dDeltaZ > 0 )
d2DDistance = Distance3D( dDeltaX, dDeltaY, dDeltaZ );
else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#endif
iDistance = (INT32) d2DDistance;
if ( d2DDistance != iDistance )
@@ -5813,15 +5797,7 @@ INT8 FireFragmentGivenTarget( UINT8 ubOwner, FLOAT dStartX, FLOAT dStartY, FLOAT
dDeltaX = dEndX - dStartX;
dDeltaY = dEndY - dStartY;
dDeltaZ = dEndZ - dStartZ;
#if 0//dnl ch60 030913
//lal bugfix
if( dDeltaZ > 0 )
d2DDistance = Distance3D( dDeltaX, dDeltaY, dDeltaZ );
else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#endif
iDistance = (INT32) d2DDistance;
if ( d2DDistance != iDistance )
@@ -5990,15 +5966,7 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
dDeltaX = dEndX - dStartX;
dDeltaY = dEndY - dStartY;
dDeltaZ = dEndZ - dStartZ;
#if 0//dnl ch60 030913
//lal bugfix
if( dDeltaZ > 0 )
d2DDistance = Distance3D( dDeltaX, dDeltaY, dDeltaZ );
else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#endif
iDistance = (INT32) d2DDistance;
if ( d2DDistance != iDistance )
@@ -8584,11 +8552,7 @@ void AdjustTargetCenterPoint( SOLDIERTYPE *pShooter, INT32 iTargetGridNo, FLOAT
///////////////////////////////////////////////////////////////////////
// Find distance between shooter and target, in points.
FLOAT d2DDistance=0;
#if 0//dnl ch60 030913
d2DDistance = Distance3D( dDeltaX, dDeltaY, CONVERT_HEIGHTUNITS_TO_DISTANCE( dDeltaZ ) );
#else
d2DDistance = Distance2D( dDeltaX, dDeltaY );
#endif
// Round it upwards.
INT32 iDistance = (INT32) d2DDistance;
if ( d2DDistance != iDistance )
-321
View File
@@ -199,327 +199,6 @@ void SaveMapInformation(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMinorMapVe
//loading and won't be permanently updated until the map is saved, regardless of changes.
void UpdateOldVersionMap()
{
#if 0 //This code is no longer needed since the major version update from 1.0 to 4.0
//However, I am keeping it in for reference.
SOLDIERINITNODE *curr;
INT32 i;
LEVELNODE *pStruct;
//VERSION 0 -- obsolete November 14, 1997
if( gMapInformation.ubMapVersion == 0 )
{
//Soldier information contained two fixable bugs.
gMapInformation.ubMapVersion++;
curr = gSoldierInitHead;
while( curr )
{
//Bug #01) Nodes without detailed slots weren't initialized.
if( !curr->pBasicPlacement->fDetailedPlacement )
curr->pDetailedPlacement = NULL;
//Bug #02) The attitude variable was accidentally being generated like attributes
// which put it completely out of range.
if( curr->pBasicPlacement->bAttitude > 7 )
curr->pBasicPlacement->bAttitude = (INT8)Random(8);
//go to next node
curr = curr->next;
}
}
//VERSION 1 -- obsolete January 7, 1998
if( gMapInformation.ubMapVersion == 1 )
{
gMapInformation.ubMapVersion++;
//Bug #03) Removing all wall decals from map, because of new changes to the slots
// as well as certain decals found commonly in illegal places.
for( i = 0; i < WORLD_MAX; i++ )
{
RemoveAllStructsOfTypeRange( i, FIRSTWALLDECAL, LASTWALLDECAL );
RemoveAllStructsOfTypeRange( i, FIFTHWALLDECAL, SIXTHWALLDECAL );
}
}
//VERSION 2 -- obsolete February 3, 1998
if( gMapInformation.ubMapVersion == 2 )
{
gMapInformation.ubMapVersion++;
curr = gSoldierInitHead;
while( curr )
{
//Bug #04) Assign enemy mercs default army color code if applicable
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM && !curr->pBasicPlacement->ubSoldierClass )
{
if( !curr->pDetailedPlacement )
{
curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_ARMY;
}
else if( curr->pDetailedPlacement && curr->pDetailedPlacement->ubProfile == NO_PROFILE )
{
curr->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_ARMY;
curr->pDetailedPlacement->ubSoldierClass = SOLDIER_CLASS_ARMY;
}
}
curr = curr->next;
}
}
//VERSION 3 -- obsolete February 9, 1998
if( gMapInformation.ubMapVersion == 3 )
{
gMapInformation.ubMapVersion++;
//Bug #05) Move entry points down if necessary.
ValidateEntryPointGridNo( &gMapInformation.sNorthGridNo );
ValidateEntryPointGridNo( &gMapInformation.sEastGridNo );
ValidateEntryPointGridNo( &gMapInformation.sSouthGridNo );
ValidateEntryPointGridNo( &gMapInformation.sWestGridNo );
}
//VERSION 4 -- obsolete February 25, 1998
if( gMapInformation.ubMapVersion == 4 )
{
gMapInformation.ubMapVersion++;
//6) Change all doors to FIRSTDOOR
for( i = 0; i < WORLD_MAX; ++i )
{
//NOTE: Here are the index values for the various doors
//DOOR OPEN CLOSED
//FIRST 916 912
//SECOND 936 932
//THIRD 956 952
//FOURTH 976 972
pStruct = gpWorldLevelData[ i ].pStructHead;
while( pStruct )
{
//outside topleft
if( pStruct->usIndex == 932 || pStruct->usIndex == 952 || pStruct->usIndex == 972 )
{
ReplaceStructIndex( i, pStruct->usIndex, 912 );
break;
}
else if( pStruct->usIndex == 936 || pStruct->usIndex == 956 || pStruct->usIndex == 976 )
{
ReplaceStructIndex( i, pStruct->usIndex, 916 );
break;
}
//outside topright
else if( pStruct->usIndex == 927 || pStruct->usIndex == 947 || pStruct->usIndex == 967 )
{
ReplaceStructIndex( i, pStruct->usIndex, 907 );
break;
}
else if( pStruct->usIndex == 931 || pStruct->usIndex == 951 || pStruct->usIndex == 971 )
{
ReplaceStructIndex( i, pStruct->usIndex, 911 );
break;
}
//inside topleft
else if( pStruct->usIndex == 942 || pStruct->usIndex == 962 || pStruct->usIndex == 982 )
{
ReplaceStructIndex( i, pStruct->usIndex, 922 );
break;
}
else if( pStruct->usIndex == 946 || pStruct->usIndex == 966 || pStruct->usIndex == 986 )
{
ReplaceStructIndex( i, pStruct->usIndex, 926 );
break;
}
//inside topright
else if( pStruct->usIndex == 937 || pStruct->usIndex == 957 || pStruct->usIndex == 977 )
{
ReplaceStructIndex( i, pStruct->usIndex, 917 );
break;
}
else if( pStruct->usIndex == 941 || pStruct->usIndex == 961 || pStruct->usIndex == 981 )
{
ReplaceStructIndex( i, pStruct->usIndex, 921 );
break;
}
pStruct = pStruct->pNext;
}
}
}
//VERSION 5 -- obsolete March 4, 1998
if( gMapInformation.ubMapVersion == 5 )
{
gMapInformation.ubMapVersion++;
//Bug 7) Remove all exit grids (the format has changed)
for( i = 0; i < WORLD_MAX; i++ )
RemoveExitGridFromWorld( i );
}
//VERSION 6 -- obsolete March 9, 1998
if( gMapInformation.ubMapVersion == 6 )
{ //Bug 8) Change droppable status of merc items so that they are all undroppable.
gMapInformation.ubMapVersion++;
curr = gSoldierInitHead;
while( curr )
{
//Bug #04) Assign enemy mercs default army color code if applicable
if( curr->pDetailedPlacement )
{
INT32 invsize = (INT32)curr->pDetailedPlacement->Inv.size();
for( i = 0; i < invsize; ++i )
{ //make all items undroppable, even if it is empty. This will allow for
//random item generation, while empty, droppable slots are locked as empty
//during random item generation.
curr->pDetailedPlacement->Inv[ i ].fFlags |= OBJECT_UNDROPPABLE;
}
}
curr = curr->next;
}
}
//VERSION 7 -- obsolete April 14, 1998
if( gMapInformation.ubMapVersion == 7 )
{
gMapInformation.ubMapVersion++;
//Bug 9) Priority placements have been dropped in favor of splitting it into two categories.
// The first is Detailed placements, and the second is priority existance. So, all
// current detailed placements will also have priority existance.
curr = gSoldierInitHead;
while( curr )
{
if( curr->pDetailedPlacement )
{
curr->pBasicPlacement->fPriorityExistance = TRUE;
}
curr = curr->next;
}
}
if( gMapInformation.ubMapVersion == 14 )
{ //Toast all of the ambiguous road pieces that ended up wrapping the byte.
LEVELNODE *pStruct, *pStruct2;
INT32 i;
for( i = 0; i < WORLD_MAX; i++ )
{
pStruct = gpWorldLevelData[ i ].pObjectHead;
if( pStruct && pStruct->usIndex == 1078 && i < WORLD_MAX-2 && i >= 320 )
{ //This is the only detectable road piece that we can repair.
pStruct2 = gpWorldLevelData[ i+1 ].pObjectHead;
if( pStruct2 && pStruct2->usIndex == 1081 )
{
RemoveObject( i, pStruct->usIndex );
RemoveObject( i+1, pStruct->usIndex+1 );
RemoveObject( i+2, pStruct->usIndex+2 );
RemoveObject( i-160, pStruct->usIndex-160 );
RemoveObject( i-159, pStruct->usIndex-159 );
RemoveObject( i-158, pStruct->usIndex-158 );
RemoveObject( i-320, pStruct->usIndex-320 );
RemoveObject( i-319, pStruct->usIndex-319 );
RemoveObject( i-318, pStruct->usIndex-318 );
AddObjectToTail( i, 1334 );
AddObjectToTail( i-160, 1335 );
AddObjectToTail( i-320, 1336 );
AddObjectToTail( i+1, 1337 );
AddObjectToTail( i-159, 1338 );
AddObjectToTail( i-319, 1339 );
AddObjectToTail( i+2, 1340 );
AddObjectToTail( i-158, 1341 );
AddObjectToTail( i-318, 1342 );
}
}
else if( pStruct && pStruct->usIndex >= 1079 && pStruct->usIndex < 1115 )
{
RemoveObject( i, pStruct->usIndex );
}
}
}
if( gMapInformation.ubMapVersion <= 7 )
{
if( gfEditMode )
{
#ifdef JA2TESTVERSION
ScreenMsg( FONT_MCOLOR_RED, MSG_ERROR, L"Currently loaded map is corrupt! Allowing the map to load anyway!" );
#endif
}
else
{
if( gbWorldSectorZ )
{
AssertMsg( 0, String( "Currently loaded map (%c%d_b%d.dat) is invalid -- less than the minimum supported version.", gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
}
else if( !gbWorldSectorZ )
{
AssertMsg( 0, String( "Currently loaded map (%c%d.dat) is invalid -- less than the minimum supported version.", gWorldSectorY + 'A' - 1, gWorldSectorX ) );
}
}
}
//VERSION 8 -- obsolete April 18, 1998
if( gMapInformation.ubMapVersion == 8 )
{
gMapInformation.ubMapVersion++;
//Bug 10) Padding on detailed placements is uninitialized. Clear all data starting at
// fKillSlotIfOwnerDies.
curr = gSoldierInitHead;
while( curr )
{
if( curr->pDetailedPlacement )
{
//The size 120 was hand calculated. The remaining padding was 118 bytes
//and there were two one byte fields cleared, fKillSlotIfOwnerDies and ubScheduleID
memset( &curr->pDetailedPlacement->fKillSlotIfOwnerDies, 0, 120 );
}
curr = curr->next;
}
}
//Version 9 -- Kris -- obsolete April 27, 1998
if( gMapInformation.ubMapVersion == 9 )
{
gMapInformation.ubMapVersion++;
curr = gSoldierInitHead;
while( curr )
{
//Bug 11) Convert all wheelchaired placement bodytypes to cows. Result of change in the animation database.
if( curr->pDetailedPlacement && curr->pDetailedPlacement->ubBodyType == CRIPPLECIV )
{
curr->pDetailedPlacement->ubBodyType = COW;
curr->pBasicPlacement->ubBodyType = COW;
}
curr = curr->next;
}
}
if( gMapInformation.ubMapVersion < 12 )
{
gMapInformation.ubMapVersion = 12;
gMapInformation.sCenterGridNo = -1;
}
if( gMapInformation.ubMapVersion < 13 )
{ //replace all merc ammo inventory slots status value with the max ammo that the clip can hold.
INT32 cnt;
OBJECTTYPE *pItem;
gMapInformation.ubMapVersion++;
//Bug 10) Padding on detailed placements is uninitialized. Clear all data starting at
// fKillSlotIfOwnerDies.
curr = gSoldierInitHead;
while( curr )
{
if( curr->pDetailedPlacement )
{
UINT32 invsize = curr->pDetailedPlacement->Inv.size();
for ( UINT32 i = 0; i < invsize; ++i )
{
pItem = &curr->pDetailedPlacement->Inv[ i ];
if( Item[ pItem->usItem ].usItemClass & IC_AMMO )
{
for( cnt = 0; cnt < pItem->ubNumberOfObjects; ++cnt )
{
pItem->shots.ubShotsLeft[ cnt ] = Magazine[ Item[ pItem->usItem ].ubClassIndex ].ubMagSize;
}
}
}
}
curr = curr->next;
}
}
if( gMapInformation.ubMapVersion < 14 )
{
gMapInformation.ubMapVersion++;
if( !gfCaves && !gfBasement )
{
ReplaceObsoleteRoads();
}
}
if( gMapInformation.ubMapVersion < 15 )
{ //Do nothing. The object layer was expanded from 1 byte to 2 bytes, effecting the
//size of the maps. This was due to the fact that the ROADPIECES tileset contains
//over 300 pieces, hence requiring a size increase of the tileset subindex for this
//layer only.
}
#endif //end of MAJOR VERSION 3.0 obsolete code
if( gMapInformation.ubMapVersion < 15 )
{
AssertMsg( 0, "Map is less than minimum supported version." );
-15
View File
@@ -299,21 +299,6 @@ void PrepareMilitiaForTactical( BOOLEAN fPrepareAll)
// If the sector is already loaded, don't add the existing militia
for( x = 1; x < guiDirNumber ; ++x )
{
#if 0
// ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%ld,%ld,%ld,%ld", gpAttackDirs[ x ][ 0 ], gpAttackDirs[ x ][1], gpAttackDirs[ x ][2], gpAttackDirs[ x ][3] );
if( gfMSResetMilitia )
{
if( gpAttackDirs[ x ][ 3 ] != INSERTION_CODE_CENTER )
{
AddSoldierInitListMilitiaOnEdge( gpAttackDirs[ x ][ 3 ], gpAttackDirs[ x ][0], gpAttackDirs[ x ][1], gpAttackDirs[ x ][2] );
ubGreen -= gpAttackDirs[ x ][0];
ubRegs -= gpAttackDirs[ x ][1];
ubElites -= gpAttackDirs[ x ][2];
}
}
//else
//{
#endif
AddSoldierInitListMilitiaOnEdge( gpAttackDirs[ x ][ 3 ], gpAttackDirs[ x ][0], gpAttackDirs[ x ][1], gpAttackDirs[ x ][2] );
}
-77
View File
@@ -9296,11 +9296,6 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
{
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: suppression: change stance/cower"));
CancelAIAction( pSoldier, TRUE );
#if 0
pSoldier->aiData.bAction = AI_ACTION_CHANGE_STANCE;
pSoldier->aiData.usActionData = ubNewStance;
pSoldier->aiData.bActionInProgress = TRUE;
#endif
}
// go for it!
@@ -9642,38 +9637,6 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
UINT32 cnt;
UINT8 ubID;
#if 0
// 0verhaul: None of this is necessary anymore with the new attack busy system
if (ubID == NOBODY)
{
pSoldier = NULL;
pTarget = NULL;
}
else
{
pSoldier = MercPtrs[ ubID ];
if ( ubTargetID != NOBODY)
{
pTarget = MercPtrs[ ubTargetID ];
}
else
{
pTarget = NULL;
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String(">>Target ptr is null!" ) );
}
}
if (fCalledByAttacker)
{
if (pSoldier && Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN)
{
if (pSoldier->bBulletsLeft > 0)
{
return( pTarget );
}
}
}
#endif
// if ((gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT))
// {
@@ -9798,15 +9761,6 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
return( NULL );
}
#endif
#if 0
// 0verhaul: This is moved to the end loop where everybody's state is reset for the next action
if (pTarget)
{
// reset # of shotgun pellets hit by
pTarget->bNumPelletsHitBy = 0;
// reset flag for making "ow" sound on being shot
}
#endif
if (pSoldier)
{
@@ -10099,17 +10053,6 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
SOLDIERTYPE * ReduceAttackBusyCount( )
{
#if 0
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("ReduceAttackBusyCount") );
if ( ubID == NOBODY )
{
return( InternalReduceAttackBusyCount( ubID, fCalledByAttacker, NOBODY ) );
}
else
{
return( InternalReduceAttackBusyCount( ubID, fCalledByAttacker, MercPtrs[ ubID ]->ubTargetID ) );
}
#endif
// 0verhaul: This is now a simple subroutine.
return InternalReduceAttackBusyCount( );
}
@@ -10126,26 +10069,6 @@ SOLDIERTYPE * FreeUpAttacker( )
return( ReduceAttackBusyCount( ) );
}
#if 0
// 0verhaul: These routines are declared obsolete. Call ReduceAttackBusyCount instead.
SOLDIERTYPE * FreeUpAttackerGivenTarget( UINT8 ubID, UINT8 ubTargetID )
{
// Strange as this may seem, this function returns a pointer to
// the *target* in case the target has changed sides as a result
// of being attacked
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("FreeUpAttackerGivenTarget") );
return( InternalReduceAttackBusyCount( ubID, TRUE, ubTargetID ) );
}
SOLDIERTYPE * ReduceAttackBusyGivenTarget( UINT8 ubID, UINT8 ubTargetID )
{
// Strange as this may seem, this function returns a pointer to
// the *target* in case the target has changed sides as a result
// of being attacked
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("ReduceAttackBusyGivenTarget") );
return( InternalReduceAttackBusyCount( ubID, FALSE, ubTargetID ) );
}
#endif
void StopMercAnimation( BOOLEAN fStop )
-63
View File
@@ -708,7 +708,6 @@ int AStarPathfinder::GetPath(SOLDIERTYPE *s ,
guiTotalPathChecks++;
#endif
#ifdef VEHICLE
fMultiTile = ((pSoldier->flags.uiStatusFlags & SOLDIER_MULTITILE) != 0);
if ( fMultiTile == false)
@@ -758,7 +757,6 @@ int AStarPathfinder::GetPath(SOLDIERTYPE *s ,
fContinuousTurnNeeded = FALSE;
}
}
#endif
if (fContinuousTurnNeeded == false)
{
@@ -803,16 +801,6 @@ int AStarPathfinder::GetPath(SOLDIERTYPE *s ,
{
SetRenderFlags( RENDER_FLAG_FULL );
// The RenderCoverDebugInfo call is now made by RenderWorld. So don't try to call it here
#if 0
if ( guiCurrentScreen == GAME_SCREEN )
{
RenderWorld();
RenderCoverDebug( );
InvalidateScreen( );
EndFrameBufferRender();
RefreshScreen( NULL );
}
#endif
}
#endif
@@ -901,13 +889,6 @@ int AStarPathfinder::GetPath(SOLDIERTYPE *s ,
if (gfDisplayCoverValues && gfDrawPathPoints)
{
SetRenderFlags( RENDER_FLAG_FULL );
#if 0
RenderWorld();
RenderCoverDebug( );
InvalidateScreen( );
EndFrameBufferRender();
RefreshScreen( NULL );
#endif
}
#endif
@@ -1088,7 +1069,6 @@ void AStarPathfinder::ExecuteAStarLogic()
continue;
}
#ifdef VEHICLE
//has side effects, including setting loop counters
int retVal = VehicleObstacleCheck();
if (retVal == 1)
@@ -1099,7 +1079,6 @@ void AStarPathfinder::ExecuteAStarLogic()
{
return;
}
#endif
//calc the cost to move from the current node to here
INT16 terrainCost = EstimateActionPointCost( pSoldier, CurrentNode, direction, movementMode, 0, 3 );
@@ -1769,7 +1748,6 @@ int AStarPathfinder::CalcH()
int x = abs(n1->x - n2->x);
int y = abs(n1->y - n2->y);
#if 1
if (x >= y)
{
return this->travelcostDiag * y + this->travelcostOrth * (x-y);
@@ -1778,35 +1756,6 @@ int AStarPathfinder::CalcH()
{
return this->travelcostDiag * x + this->travelcostOrth * (y-x);
}
#else
// Try a real distance method. This should underestimate in some cases
// However, the distances need to be increased for the moment because running orthogonal is 1AP while running diagonal is 2AP
// so the total to reach a diagonal tile is identical for 2 moves. So we have to trick the pathing calc into thinking it's
// a longer distance and also calculate the other costs accordingly.
x *= 100;
y *= 100;
int d = x*x + y*y;
int r = 1200; // Just a guess
if (d == 0)
{
return d;
}
while (1)
{
int gr = (r + (d/r)) / 2;
if (gr == r || gr == r+1)
{
break;
}
r = gr;
}
return r * travelcostOrth;
#endif
}
#ifdef ASTAR_USING_EXTRACOVER
@@ -2116,7 +2065,6 @@ int AStarPathfinder::CalcCoverValue(INT32 sMyGridNo, INT32 iMyThreat, INT32 iMyA
}
#endif //#ifdef ASTAR_USING_EXTRACOVER
#ifdef VEHICLE
void AStarPathfinder::InitVehicle()
{
fMultiTile = ((pSoldier->flags.uiStatusFlags & SOLDIER_MULTITILE) != 0);
@@ -2263,7 +2211,6 @@ int AStarPathfinder::VehicleObstacleCheck()
}
return 0;
}
#endif
bool AStarPathfinder::WantToTraverse()
{
@@ -2523,7 +2470,6 @@ b=GetJA2Clock();//return s->sGridNo+6;
INT32 iWaterToWater;
INT16 ubCurAPCost,ubAPCost;
INT16 ubNewAPCost=0;
#ifdef VEHICLE
//BOOLEAN fTurnSlow = FALSE;
//BOOLEAN fReverse = FALSE; // stuff for vehicles turning
BOOLEAN fMultiTile, fVehicle;
@@ -2534,7 +2480,6 @@ b=GetJA2Clock();//return s->sGridNo+6;
UINT16 usAnimSurface;
//INT32 iCnt2, iCnt3;
BOOLEAN fVehicleIgnoreObstacles = FALSE;
#endif
INT32 iLastDir = 0;
@@ -2759,7 +2704,6 @@ if(!GridNoOnVisibleWorldTile(iDestination))
guiTotalPathChecks++;
#endif
#ifdef VEHICLE
fMultiTile = ((s->flags.uiStatusFlags & SOLDIER_MULTITILE) != 0);
if (fMultiTile)
@@ -2819,7 +2763,6 @@ if(!GridNoOnVisibleWorldTile(iDestination))
fContinuousTurnNeeded = FALSE;
}
#endif
if (!fContinuousTurnNeeded)
{
@@ -2962,7 +2905,6 @@ if(!GridNoOnVisibleWorldTile(iDestination))
}
#endif
#ifdef VEHICLE
/*
if (fTurnSlow)
{
@@ -2987,7 +2929,6 @@ if(!GridNoOnVisibleWorldTile(iDestination))
}
*/
#endif
if (gubNPCAPBudget)
{
@@ -3048,7 +2989,6 @@ if(!GridNoOnVisibleWorldTile(iDestination))
//for ( iCnt = iLoopStart; iCnt != iLoopEnd; iCnt = (iCnt + iLoopIncrement) % MAXDIR )
for ( iCnt = iLoopStart; ; )
{
#ifdef VEHICLE
/*
if (fTurnSlow)
{
@@ -3130,7 +3070,6 @@ if(!GridNoOnVisibleWorldTile(iDestination))
}
}
#endif
newLoc = curLoc + dirDelta[iCnt];
@@ -3479,7 +3418,6 @@ if(!GridNoOnVisibleWorldTile(iDestination))
}
}
#ifdef VEHICLE
if (fMultiTile)
{
// vehicle test for obstacles: prevent movement to next tile if
@@ -3518,7 +3456,6 @@ if(!GridNoOnVisibleWorldTile(iDestination))
}
*/
}
#endif
// NEW Apr 21 by Ian: abort if cost exceeds budget
if (gubNPCAPBudget)
-274
View File
@@ -679,7 +679,6 @@ INT16 EstimateActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir,
// Get switch value...
sSwitchValue = gubWorldMovementCosts[ sGridNo ][ bDir ][ pSoldier->pathing.bLevel ];
#if 1 //Moa: set to 0 to use original copy and paste code from ActionPointCost()
if ( sSwitchValue == TRAVELCOST_FENCE )
{
// If we are changeing stance ( either before or after getting there....
@@ -737,191 +736,6 @@ INT16 EstimateActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir,
sPoints += ActionPointCost( pSoldier, sGridNo, bDir, usMovementMode );
return (sPoints);
#else
// Tile cost should not be reduced based on movement mode...
if ( sSwitchValue == TRAVELCOST_FENCE )
{
return( sTileCost );
}
// WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
// This should fix "problems" for special modified maps
UINT8 ubTerrainID = gpWorldLevelData[ sGridNo ].ubTerrainID;
if ( TERRAIN_IS_WATER( ubTerrainID) && pSoldier->pathing.bLevel > 0 )
ubTerrainID = FLAT_GROUND;
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
if ( TERRAIN_IS_WATER( ubTerrainID) )
{
usMovementMode = WALKING;
}
// so, then we must modify it for other movement styles and accumulate
// CHRISL: Adjusted system to use different move costs while wearing a backpack
if (sTileCost > 0)
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - This part have been modified "a bit"
// Check movement modifiers
switch( usMovementMode )
{
case RUNNING:
case ADULTMONSTER_WALKING:
case BLOODCAT_RUN:
sPoints = sTileCost + APBPConstants[AP_MODIFIER_RUN];
break;
case CROW_FLY:
case SIDE_STEP:
case WALK_BACKWARDS:
case ROBOT_WALK:
case BLOODCAT_WALK_BACKWARDS:
case MONSTER_WALK_BACKWARDS:
case LARVAE_WALK:
case WALKING :
case WALKING_ALTERNATIVE_RDY :
case SIDE_STEP_ALTERNATIVE_RDY :
sPoints = sTileCost + APBPConstants[AP_MODIFIER_WALK];
if (!(pSoldier->MercInWater()) && ( (gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_FIREREADY ) || (gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_FIRE ) ) && !(gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_ALT_WEAPON_HOLDING ) )
{
sPoints += APBPConstants[AP_MODIFIER_READY];
}
break;
case SIDE_STEP_WEAPON_RDY:
case SIDE_STEP_DUAL_RDY:
case WALKING_WEAPON_RDY:
case WALKING_DUAL_RDY:
sPoints = sTileCost + APBPConstants[AP_MODIFIER_WALK] + APBPConstants[AP_MODIFIER_READY];
break;
case START_SWAT:
case SWAT_BACKWARDS:
case SWATTING:
sPoints = sTileCost + APBPConstants[AP_MODIFIER_SWAT];
break;
case CRAWLING:
sPoints = sTileCost + APBPConstants[AP_MODIFIER_CRAWL];
break;
default:
// Invalid movement mode
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Invalid movement mode %d used in ActionPointCost", usMovementMode ) );
sPoints = sTileCost;
break;
}
// Check for reverse mode
if ( pSoldier->bReverse || gUIUseReverse )
sPoints += APBPConstants[AP_REVERSE_MODIFIER];
// STOMP traits - Athletics trait decreases movement cost
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, ATHLETICS_NT ))
{
sPoints = max(1, (INT16)((sPoints * (100 - gSkillTraitValues.ubATAPsMovementReduction) / 100) + 0.5));
}
// Flugente: riot shields lower movement speed
if ( pSoldier->IsRiotShieldEquipped( ) )
sPoints *= gItemSettings.fShieldMovementAPCostModifier;
// Flugente: dragging someone
if ( pSoldier->IsDraggingSomeone( ) )
sPoints *= gItemSettings.fDragAPCostModifier;
// Check if doors if not player's merc (they have to open them manually)
if ( sSwitchValue == TRAVELCOST_DOOR && pSoldier->bTeam != gbPlayerNum )
{
sPoints += GetAPsToOpenDoor( pSoldier ) + GetAPsToOpenDoor( pSoldier ); // Include open and close costs!
}
// Check for stealth mode
if ( pSoldier->bStealthMode )
{
// STOMP traits - Stealthy trait decreases stealth AP modifier
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, STEALTHY_NT ))
{
sPoints += (max(0, (INT16)((APBPConstants[AP_STEALTH_MODIFIER] * (100 - gSkillTraitValues.ubSTStealthModeSpeedBonus) / 100) + 0.5)));
}
else
{
sPoints += APBPConstants[AP_STEALTH_MODIFIER];
}
}
// Check for backpack
if((UsingNewInventorySystem() == true) && FindBackpackOnSoldier( pSoldier ) != ITEM_NOT_FOUND )
sPoints += APBPConstants[AP_MODIFIER_PACK];
///////////////////////////////////////////////////////////////////////////////////////////////////////////
}
// Get switch value...
sSwitchValue = gubWorldMovementCosts[ sGridNo ][ bDir ][ pSoldier->pathing.bLevel ];
// ATE: If we have a 'special cost, like jump fence...
if ( sSwitchValue == TRAVELCOST_FENCE )
{
// If we are changeing stance ( either before or after getting there....
// We need to reflect that...
switch(usMovementMode)
{
case SIDE_STEP:
case SIDE_STEP_WEAPON_RDY:
case SIDE_STEP_DUAL_RDY:
case WALK_BACKWARDS:
case RUNNING:
case WALKING :
case WALKING_WEAPON_RDY:
case WALKING_DUAL_RDY:
case WALKING_ALTERNATIVE_RDY :
case SIDE_STEP_ALTERNATIVE_RDY:
// Add here cost to go from crouch to stand AFTER fence hop....
// Since it's AFTER.. make sure we will be moving after jump...
if ( ( bPathIndex + 2 ) < bPathLength )
{
sPoints += GetAPsCrouch(pSoldier, TRUE); // SANDRO changed..
}
break;
case SWATTING:
case START_SWAT:
case SWAT_BACKWARDS:
// Add cost to stand once there BEFORE....
sPoints += GetAPsCrouch(pSoldier, TRUE); // SANDRO changed..
break;
case CRAWLING:
// Can't do it here.....
break;
}
}
else if (sSwitchValue == TRAVELCOST_NOT_STANDING)
{
switch(usMovementMode)
{
case RUNNING:
case WALKING :
case WALKING_WEAPON_RDY:
case WALKING_DUAL_RDY:
case SIDE_STEP:
case SIDE_STEP_WEAPON_RDY:
case SIDE_STEP_DUAL_RDY:
case WALK_BACKWARDS:
case WALKING_ALTERNATIVE_RDY :
case SIDE_STEP_ALTERNATIVE_RDY:
// charge crouch APs for ducking head!
sPoints += GetAPsCrouch(pSoldier, TRUE); // SANDRO changed..
break;
default:
break;
}
}
return( sPoints );
#endif
}
@@ -2563,20 +2377,6 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
// Do we need to stand up?
bAPCost += GetAPsToChangeStance( pSoldier, ANIM_STAND );
}
#if 0//dnl ch73 021013 relocate this to MinAPsToPunch
// blunt weapons & blades
else if ( Item[ usUBItem ].usItemClass == IC_PUNCH || Item[ usUBItem ].usItemClass == IC_BLADE )
{
if ( usTargID != NOBODY )
{
// Check if target is prone, if so, calc cost...
if ( gAnimControl[ MercPtrs[ usTargID ]->usAnimState ].ubEndHeight == ANIM_PRONE )
bAPCost += GetAPsToChangeStance( pSoldier, ANIM_CROUCH );
else
bAPCost += GetAPsToChangeStance( pSoldier, ANIM_STAND );
}
}
#endif
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
{
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || Item[usItem].mortar && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
@@ -2594,10 +2394,6 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
//Calculate usTurningCost
if (!TileIsOutOfBounds(sGridNo))
{
#if 0//dnl ch73 021013 relocate this to MinAPsToPunch
// Buggler: actual melee ap deduction for turning applies only when target is 1 tile away
if ( !( ( Item[ usUBItem ].usItemClass == IC_PUNCH || Item[ usUBItem ].usItemClass == IC_BLADE ) && usRange > 1 ) )
#endif
{
if(Item[usItem].rocketlauncher || Item[usItem].grenadelauncher || Item[usItem].mortar)//dnl ch72 260913
{
@@ -2652,11 +2448,6 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
bAPCost += APBPConstants[AP_UNJAM];
}
#if 0//dnl ch63 240813 this seems very wrong, in most case (pSoldier->bActionPoints > bFullAps) and this will return less points then is actually required and could cancel some AI actions, like throwing grenades
// the minimum AP cost of ANY shot can NEVER be more than merc's maximum APs!
if ( bAPCost > bFullAPs )
bAPCost = bFullAPs;
#endif
// this SHOULD be impossible, but nevertheless...
if ( bAPCost < 1 )
bAPCost = 1;
@@ -3812,73 +3603,8 @@ INT16 MinAPsToThrow( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubAddTurningCos
INT32 iFullAPs;
INT32 iAPCost = APBPConstants[AP_MIN_AIM_ATTACK];
UINT16 usInHand;
#if 0//dnl ch72 180913
UINT16 usTargID;
UINT32 uiMercFlags;
UINT8 ubDirection;
if(pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO)//dnl ch63 240813
usInHand = GetAttachedGrenadeLauncher(&pSoldier->inv[HANDPOS]);
else
#endif
// make sure the guy's actually got a throwable item in his hand!
usInHand = pSoldier->inv[HANDPOS].usItem;
#if 0//dnl ch72 180913 this goes down because of new trait system
if ( ( !(Item[ usInHand ].usItemClass & IC_GRENADE) &&
!(Item[ usInHand ].usItemClass & IC_LAUNCHER)) )
{
//AXP 25.03.2007: See if we are about to throw grenade (grenade was not in hand, but in temp object)
if ( pSoldier->pTempObject != NULL && pSoldier->pThrowParams != NULL &&
pSoldier->pThrowParams->ubActionCode == THROW_ARM_ITEM && (Item[ pSoldier->pTempObject->usItem ].usItemClass & IC_GRENADE) )
{
//nothing here
}
else
{
#ifdef JA2TESTVERSION
ScreenMsg( MSG_FONT_YELLOW, MSG_DEBUG, L"MinAPsToThrow - Called when in-hand item is %d", usInHand );
#endif
return(0);
}
}
if (!TileIsOutOfBounds(sGridNo))
{
// Given a gridno here, check if we are on a guy - if so - get his gridno
if ( FindSoldier( sGridNo, &usTargID, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
{
sGridNo = MercPtrs[ usTargID ]->sGridNo;
}
/*// OK, get a direction and see if we need to turn...
if (ubAddTurningCost)
{
ubDirection = (UINT8)GetDirectionFromGridNo( sGridNo, pSoldier );
// Is it the same as he's facing?
if ( ubDirection != pSoldier->ubDirection )
{
//Lalien: disabled it again
//AXP 25.03.2007: Reenabled look cost
//iAPCost += GetAPsToLook( pSoldier );
}
}*/
}
/*else
{
// Assume we need to add cost!
//iAPCost += GetAPsToLook( pSoldier );
}*/
// if attacking a new target (or if the specific target is uncertain)
//AXP 25.03.2007: Aim-at-same-tile AP cost/bonus doesn't make any sense for thrown objects
//if ( ( sGridNo != pSoldier->sLastTarget ) )
//{
// iAPCost += APBPConstants[AP_CHANGE_TARGET];
//}
//iAPCost += GetAPsToChangeStance( pSoldier, ANIM_STAND ); // moved lower - SANDRO
#endif
// Calculate default top & bottom of the magic "aiming" formula)
-52
View File
@@ -798,28 +798,6 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
{
// ATE: Select everybody in squad and make move!
{
#if 0
SOLDIERTYPE * pTeamSoldier;
INT32 cnt;
SOLDIERTYPE *pFirstSoldier = NULL;
// OK, loop through all guys who are 'multi-selected' and
// check if our currently selected guy is amoung the
// lucky few.. if not, change to a guy who is...
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pTeamSoldier++ )
{
// Default turn off
pTeamSoldier->flags.uiStatusFlags &= (~SOLDIER_MULTI_SELECTED );
// If controllable
if ( OK_CONTROLLABLE_MERC( pTeamSoldier ) && pTeamSoldier->bAssignment == MercPtrs[ gusSelectedSoldier ]->bAssignment )
{
pTeamSoldier->flags.uiStatusFlags |= SOLDIER_MULTI_SELECTED;
}
}
EndMultiSoldierSelection( FALSE );
#endif
// Make move!
*puiNewEvent = C_MOVE_MERC;
@@ -888,36 +866,6 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
}
#if 0
fDone = FALSE;
if( GetSoldier( &pSoldier, gusUIFullTargetID ) && gpItemPointer == NULL )
{
if( ( guiUIFullTargetFlags & OWNED_MERC ) && ( guiUIFullTargetFlags & VISIBLE_MERC ) && !( guiUIFullTargetFlags & DEAD_MERC ) &&( pSoldier->bAssignment >= ON_DUTY )&&!( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) )
{
fShowAssignmentMenu = TRUE;
gfRTClickLeftHoldIntercepted = TRUE;
CreateDestroyAssignmentPopUpBoxes( );
SetTacticalPopUpAssignmentBoxXY( );
DetermineBoxPositions( );
DetermineWhichAssignmentMenusCanBeShown( );
fFirstClickInAssignmentScreenMask = TRUE;
gfIgnoreScrolling = TRUE;
fDone = TRUE;
}
else
{
fShowAssignmentMenu = FALSE;
CreateDestroyAssignmentPopUpBoxes( );
DetermineWhichAssignmentMenusCanBeShown( );
}
}
if( fDone == TRUE )
{
break;
}
#endif
break;
-50
View File
@@ -660,11 +660,7 @@ INT32 AddRottingCorpse( ROTTING_CORPSE_DEFINITION *pCorpseDef )
for (ubLoop = 0; ubLoop < pDBStructureRef->pDBStructure->ubNumberOfTiles; ubLoop++)
{
ppTile = pDBStructureRef->ppTile;
#if 0//dnl ch83 080114
sTileGridNo = pCorpseDef->sGridNo + ppTile[ ubLoop ]->sPosRelToBase;
#else
sTileGridNo = AddPosRelToBase(pCorpseDef->sGridNo, ppTile[ubLoop]);
#endif
//Remove blood
RemoveBlood( sTileGridNo, pCorpseDef->bLevel );
}
@@ -1544,52 +1540,6 @@ ROTTING_CORPSE *FindCorpseBasedOnStructure( INT32 sGridNo, INT8 asLevel, STRUCT
void CorpseHit( INT32 sGridNo, INT8 asLevel, UINT16 usStructureID )
{
#if 0
STRUCTURE *pStructure, *pBaseStructure;
ROTTING_CORPSE *pCorpse = NULL;
INT32 sBaseGridNo;
pStructure = FindStructureByID( sGridNo, usStructureID );
// Get base....
pBaseStructure = FindBaseStructure( pStructure );
// Find base gridno...
sBaseGridNo = pBaseStructure->sGridNo;
// Get corpse ID.....
pCorpse = FindCorpseBasedOnStructure( sBaseGridNo, asLevel, pBaseStructure );
if ( pCorpse == NULL )
{
#ifdef JA2TESTVERSION
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Bullet hit corpse but corpse cannot be found at: %d", sBaseGridNo );
#endif
return;
}
// Twitch the bugger...
#ifdef JA2BETAVERSION
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Corpse hit" );
#endif
if ( GridNoOnScreen( sBaseGridNo ) )
{
// Twitch....
// Set frame...
SetAniTileFrame( pCorpse->pAniTile, 1 );
// Go reverse...
pCorpse->pAniTile->uiFlags |= ( ANITILE_BACKWARD | ANITILE_PAUSE_AFTER_LOOP );
// Turn off pause...
pCorpse->pAniTile->uiFlags &= (~ANITILE_PAUSED);
}
// PLay a sound....
PlayJA2Sample( (UINT32)( BULLET_IMPACT_2 ), RATE_11025, SoundVolume( MIDVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
#endif
}
void VaporizeCorpse( INT32 sGridNo, INT8 asLevel, UINT16 usStructureID )
-42
View File
@@ -4857,48 +4857,6 @@ BOOLEAN HandleUnjamAnimation( SOLDIERTYPE *pSoldier )
#if 0
//OK, if here, if our health is still good, but we took a lot of damage, try to fall down!
if ( pSoldier->stats.bLife >= OKLIFE )
{
// Randomly fall back or forward, if we are in the standing hit animation
if ( pSoldier->usAnimState == GENERIC_HIT_STAND || pSoldier->usAnimState == RIFLE_STAND_HIT )
{
INT8 bTestDirection = pSoldier->ubDirection;
BOOLEAN fForceDirection = FALSE;
BOOLEAN fDoFallback = FALSE;
// As the damage pretty brutal?
// TRY FALLING BACKWARDS, ( ONLY IF WE ARE A MERC! )
if ( Random( 1000 ) > 40 && IS_MERC_BODY_TYPE( pSoldier ) )
{
// CHECK IF WE HAVE AN ATTACKER, TAKE OPPOSITE DIRECTION!
if ( pSoldier->ubAttackerID != NOBODY )
{
// Find direction!
bTestDirection = (INT8)GetDirectionFromGridNo( MercPtrs[ pSoldier->ubAttackerID ]->sGridNo, pSoldier );
fForceDirection = TRUE;
}
sNewGridNo = NewGridNo( pSoldier->sGridNo, (UINT16)(-1 * DirectionInc( bTestDirection ) ) );
if ( NewOKDestination( pSoldier, sNewGridNo, TRUE, pSoldier->pathing.bLevel ) && OKHeightDest( pSoldier, sNewGridNo ) )
{
// ALL'S OK HERE..... IF WE FORCED DIRECTION, SET!
if ( fForceDirection )
{
pSoldier->EVENT_SetSoldierDirection( bTestDirection );
pSoldier->EVENT_SetSoldierDesiredDirection( bTestDirection );
}
pSoldier->ChangeSoldierState( FALLBACK_HIT_STAND, 0, FALSE );
return;
}
}
}
}
#endif
BOOLEAN OKFallDirection( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT8 ubTestDirection, UINT16 usAnimState )
{
-365
View File
@@ -3633,29 +3633,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// Unset paused for no APs.....
this->AdjustNoAPToFinishMove( FALSE );
#if 0
// 0verhaul: This is a test. The only time I have been able to make this code hit is when
// the player goes prone while moving. And that is not what this part is intended for. I
// have seen the soldier in the middle of crawling, get up, turn, and then go prone again to
// continue along his path. But this code was not hit for that part. And this code seems
// to be made for that part. So apparently they found another way to deal with it. So
// I disabled the "locked" code for usDontUpdateNewGridNoOnMoveAnimChange since it can cause
// problems of its own. Now we see if we can do without this part too.
if ( usNewState == CRAWLING && this->usDontUpdateNewGridNoOnMoveAnimChange == 1 )
{
if ( this->flags.bTurningFromPronePosition != TURNING_FROM_PRONE_ENDING_UP_FROM_MOVE )
{
this->flags.bTurningFromPronePosition = TURNING_FROM_PRONE_START_UP_FROM_MOVE;
}
// ATE: IF we are starting to crawl, but have to getup to turn first......
if ( this->flags.bTurningFromPronePosition == TURNING_FROM_PRONE_START_UP_FROM_MOVE )
{
usNewState = PRONE_UP;
this->flags.bTurningFromPronePosition = TURNING_FROM_PRONE_ENDING_UP_FROM_MOVE;
}
}
#endif
// We are about to start moving
// Handle buddy beginning to move...
@@ -3795,20 +3772,8 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// 0verhaul: Okay, here is a question: Is the "non-interrupt" supposed to be transferrable to other anims?
// That is, if one anim is not interruptable but it chains to another anim, should the "not interruptable" flag
// remain? I'm going to try out the theory that new animations should reset the "don't interrupt" flag.
#if 0
if ( uiNewAnimFlags & ANIM_NONINTERRUPT )
{
this->flags.fInNonintAnim = TRUE;
}
if ( uiNewAnimFlags & ANIM_RT_NONINTERRUPT )
{
this->flags.fRTInNonintAnim = TRUE;
}
#else
this->flags.fInNonintAnim = (uiNewAnimFlags & ANIM_NONINTERRUPT) != 0;
this->flags.fRTInNonintAnim = (uiNewAnimFlags & ANIM_RT_NONINTERRUPT) != 0;
#endif
// CHECK IF WE ARE NOT AIMING, IF NOT, RESET LAST TAGRET!
if ( !(gAnimControl[this->usAnimState].uiFlags & ANIM_FIREREADY) && !(gAnimControl[usNewState].uiFlags & ANIM_FIREREADY) )
@@ -3956,31 +3921,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
{
// CHRISL
// SANDRO - APBPConstants[AP_CROUCH] changed to GetAPsCrouch()
#if 0//dnl ch70 160913 this is wrong we cannot just add constants to sAPCost this must be done in GetAPsCrouch and GetAPsProne because all preactions calculation will show incorrect values under cursor
if ( (UsingNewInventorySystem( ) == true) && FindBackpackOnSoldier( this ) != ITEM_NOT_FOUND && !this->flags.ZipperFlag )
{
if ( usNewState == KNEEL_UP || usNewState == BIGMERC_CROUCH_TRANS_OUTOF )
{
sAPCost = GetAPsCrouch( this, FALSE ) + 2;
sBPCost = APBPConstants[BP_CROUCH] + 2;
}
else if ( usNewState == KNEEL_DOWN || usNewState == BIGMERC_CROUCH_TRANS_INTO )
{
sAPCost = GetAPsCrouch( this, FALSE ) + 1;
sBPCost = APBPConstants[BP_CROUCH] + 1;
}
else
{
sAPCost = GetAPsCrouch( this, FALSE );
sBPCost = APBPConstants[BP_CROUCH];
}
}
else
{
sAPCost = GetAPsCrouch( this, FALSE );
sBPCost = APBPConstants[BP_CROUCH];
}
#else
if ( UsingNewInventorySystem( ) )
{
if ( usNewState == KNEEL_UP || usNewState == BIGMERC_CROUCH_TRANS_OUTOF )
@@ -3999,7 +3939,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
sAPCost = GetAPsCrouch( this, FALSE );
sBPCost = APBPConstants[BP_CROUCH];
}
#endif
DeductPoints( this, sAPCost, sBPCost );
}
this->flags.fDontChargeAPsForStanceChange = FALSE;
@@ -4017,26 +3956,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
//if ( this->sGridNo == this->pathing.sFinalDestination || this->pathing.usPathIndex == 0 )
//{
// CHRISL
#if 0//dnl ch70 160913 this is wrong we cannot just add constants to sAPCost this must be done in GetAPsCrouch and GetAPsProne because all preactions calculation will show incorrect values under cursor
if ( (UsingNewInventorySystem( ) == true) && FindBackpackOnSoldier( this ) != ITEM_NOT_FOUND && !this->flags.ZipperFlag )
{
if ( usNewState == PRONE_UP )
{
sAPCost = GetAPsProne( this, FALSE ) + 2;
sBPCost = APBPConstants[BP_PRONE] + 2;
}
else
{
sAPCost = GetAPsProne( this, FALSE ) + 1;
sBPCost = APBPConstants[BP_PRONE] + 1;
}
}
else
{
sAPCost = GetAPsProne( this, FALSE );
sBPCost = APBPConstants[BP_PRONE];
}
#else
if ( UsingNewInventorySystem( ) )
{
if ( usNewState == PRONE_UP )
@@ -4055,7 +3974,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
sAPCost = GetAPsProne( this, FALSE );
sBPCost = APBPConstants[BP_PRONE];
}
#endif
DeductPoints( this, sAPCost, sBPCost );
//}
}
@@ -4394,16 +4312,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
this->flags.fForceShade = FALSE;
// CHECK IF WE ARE AT AN IDLE ACTION
#if 0
if ( gAnimControl[usNewState].uiFlags & ANIM_IDLE )
{
this->aiData.bAction = ACTION_DONE;
}
else
{
this->aiData.bAction = ACTION_BUSY;
}
#endif
// ATE; For some animations that could use some variations, do so....
if ( usNewState == CHARIOTS_OF_FIRE || usNewState == BODYEXPLODING )
@@ -5030,18 +4938,6 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
// break;
//}
#if 0
// 0verhaul: This does not go here! In spite of this function's name, it is not the actual "fire" function.
// In fact this sets the muzzle flash even while the soldier may be turning to shoot, which can cause
// problems for real-time shooting.
// The correct place for this is UseGun, which already has code to set or reset the flash.
if ( IsFlashSuppressor( &this->inv[this->ubAttackingHand], this ) )
this->flags.fMuzzleFlash = FALSE;
else
this->flags.fMuzzleFlash = TRUE;
#endif
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "EVENT_FireSoldierWeapon: Muzzle flash = %d", this->flags.fMuzzleFlash ) );
@@ -5061,42 +4957,6 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
//this->sLastTarget = sTargetGridNo;
this->ubTargetID = WhoIsThere2( sTargetGridNo, this->bTargetLevel );
#if 0
// if (Item[this->inv[HANDPOS].usItem].usItemClass & IC_GUN)
{
if ( this->bDoBurst )
{
// This is NOT the bullets to fire. That is done as a check of bDoBurst against the weapon burst count or
// bDoAutofire, or single-fire. So let the bullet count be managed by the firing code.
// Set the TOTAL number of bullets to be fired
// Can't shoot more bullets than we have in our magazine!
if ( this->bDoAutofire )
this->bBulletsLeft = __min( this->bDoAutofire, this->inv[this->ubAttackingHand][0]->data.gun.ubGunShotsLeft );
else
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "EVENT_FireSoldierWeapon: do burst" );
if ( this->bWeaponMode == WM_ATTACHED_GL_BURST )
this->bBulletsLeft = __min( Weapon[GetAttachedGrenadeLauncher( &this->inv[this->ubAttackingHand] )].ubShotsPerBurst, this->inv[this->ubAttackingHand][0]->data.gun.ubGunShotsLeft );
else
this->bBulletsLeft = __min( GetShotsPerBurst( &this->inv[this->ubAttackingHand] ), this->inv[this->ubAttackingHand][0]->data.gun.ubGunShotsLeft );
}
}
else if ( IsValidSecondHandShot( this ) )
{
// two-pistol attack - two bullets!
this->bBulletsLeft = 2;
}
else
{
this->bBulletsLeft = 1;
}
if ( AmmoTypes[this->inv[this->ubAttackingHand][0]->data.gun.ubGunAmmoType].numberOfBullets > 1 )
{
this->bBulletsLeft *= AmmoTypes[this->inv[this->ubAttackingHand][0]->data.gun.ubGunAmmoType].numberOfBullets;
}
}
#endif
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "!!!!!!! Starting attack, bullets left %d", this->bBulletsLeft ) );
// Convert our grid-not into an XY
@@ -5166,26 +5026,6 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
}
else
{
#if 0//dnl ch72 250913 move this above as need to be done before calling SoldierReadyWeapon
// IF WE ARE IN REAl-TIME, FIRE IMMEDIATELY!
if ( ((gTacticalStatus.uiFlags & REALTIME) || !(gTacticalStatus.uiFlags & INCOMBAT)) )
{
//fDoFireRightAway = TRUE;
}
// Check if our weapon has no intermediate anim...
if ( Item[this->inv[HANDPOS].usItem].rocketlauncher || Item[this->inv[HANDPOS].usItem].grenadelauncher || Item[this->inv[HANDPOS].usItem].mortar )
///* switch( this->inv[ HANDPOS ].usItem )
// {
//case RPG7:
//case ROCKET_LAUNCHER:
//case MORTAR:
//case GLAUNCHER:*/
fDoFireRightAway = TRUE;
// break;
//}
#endif
if ( fDoFireRightAway )
{
// Set to true so we don't get toasted twice for APs..
@@ -5881,24 +5721,6 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "EVENT_SoldierGotHit" );
#if 0
// 0verhaul: Under the new ABC system this is no longer necessary.
// ATE: If we have gotten hit, but are still in our attack animation, reduce count!
switch ( this->usAnimState )
{
case SHOOT_ROCKET:
case SHOOT_MORTAR:
case THROW_ITEM:
// <SB> crouch throwing
case THROW_ITEM_CROUCHED:
// <SB> crouch throwing
case LOB_ITEM:
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "@@@@@@@ Freeing up attacker - ATTACK ANIMATION %s ENDED BY HIT ANIMATION, Now %d", gAnimControl[this->usAnimState].zAnimStr, gTacticalStatus.ubAttackBusyCount ) );
ReduceAttackBusyCount( this->ubID, FALSE );
break;
}
#endif
// DO STUFF COMMON FOR ALL TYPES
if ( ubAttackerID != NOBODY )
@@ -5909,22 +5731,6 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
// Set attacker's ID
this->ubAttackerID = ubAttackerID;
#if 0
// 0verhaul: Slashing out more unnecessary and reworked code
if ( !(this->flags.uiStatusFlags & SOLDIER_VEHICLE) )
{
// Increment being attacked count
this->bBeingAttackedCount++;
}
// if defender is a vehicle, there will be no hit animation played!
if ( !(this->flags.uiStatusFlags & SOLDIER_VEHICLE) )
{
// Increment the number of people busy doing stuff because of an attack (busy doing hit anim!)
gTacticalStatus.ubAttackBusyCount++;
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "!!!!!!! Person got hit, attack count now %d", gTacticalStatus.ubAttackBusyCount ) );
}
#endif
// ATE; Save hit location info...( for later anim determination stuff )
this->ubHitLocation = ubHitLocation;
@@ -6248,34 +6054,6 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
}
#if 0
// 0verhaul: None of this hairyness is necessary anymore! Hazaa!
// CJC: moved to after SoldierTakeDamage so that any quotes from the defender
// will not be said if they are knocked out or killed
if ( ubReason != TAKE_DAMAGE_TENTACLES && ubReason != TAKE_DAMAGE_OBJECT )
{
// OK, OK: THis is hairy, however, it's ness. because the normal freeup call uses the
// attckers intended target, and here we want to use thier actual target....
// ATE: If it's from GUNFIRE damage, keep in mind bullets...
if ( Item[usWeaponIndex].usItemClass & IC_GUN )
{
pNewSoldier = FreeUpAttackerGivenTarget( this->ubAttackerID, this->ubID );
}
else
{
pNewSoldier = ReduceAttackBusyGivenTarget( this->ubAttackerID, this->ubID );
}
if ( pNewSoldier != NULL )
{
//warning, if this code is ever uncommented, rename all this
//to this in this function, then init this to this
this = pNewSoldier;
}
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "!!!!!!! Tried to free up attacker, attack count now %d", gTacticalStatus.ubAttackBusyCount ) );
}
#endif
// Flugente: moved the damage calculation into a separate function
sBreathLoss = max( 1, (INT16)(sBreathLoss * (100 - this->GetDamageResistance( FALSE, TRUE )) / 100) );
@@ -7337,14 +7115,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InternalGetNewSoldierPath( INT32 sDestGridNo, UINT16
}
// we can use the soldier's level here because we don't have pathing across levels right now...
#if 0
// Uhhmmmm, the name of this function has "NEWPath" in it.
if ( this->pathing.bPathStored )
{
fContinue = TRUE;
}
else
#endif
{
iDest = FindBestPath( this, sDestGridNo, this->pathing.bLevel, usMovementAnim, COPYROUTE, fFlags );
fContinue = (iDest != 0);
@@ -8788,32 +8558,6 @@ UINT8 gRedGlowR[] =
};
#if 0
UINT8 gOrangeGlowR[] =
{
0, // Normal shades
20,
40,
60,
80,
100,
120,
140,
160,
180,
0, // For gray palettes
20,
40,
60,
80,
100,
120,
140,
160,
180,
};
#endif
UINT8 gOrangeGlowR[] =
{
@@ -8842,32 +8586,6 @@ UINT8 gOrangeGlowR[] =
};
#if 0
UINT8 gOrangeGlowG[] =
{
0, // Normal shades
5,
10,
25,
30,
35,
40,
45,
50,
55,
0, // For gray palettes
5,
10,
25,
30,
35,
40,
45,
50,
55,
};
#endif
UINT8 gOrangeGlowG[] =
{
@@ -12036,28 +11754,6 @@ UINT8 GetDirectionFromXY( INT16 sXPos, INT16 sYPos, SOLDIERTYPE *pSoldier )
return(atan8( sXPos2, sYPos2, sXPos, sYPos ));
}
#if 0
UINT8 atan8( INT16 x1, INT16 y1, INT16 x2, INT16 y2 )
{
static int trig[8] = {2, 3, 4, 5, 6, 7, 8, 1};
// returned values are N=1, NE=2, E=3, SE=4, S=5, SW=6, W=7, NW=8
double dx = (x2 - x1);
double dy = (y2 - y1);
double a;
int i, k;
if ( dx == 0 )
dx = 0.00390625; // 1/256th
#define PISLICES (8)
a = (atan2( dy, dx ) + PI / PISLICES) / (PI / (PISLICES / 2));
i = (int)a;
if ( a>0 )
k = i; else
if ( a<0 )
k = i + (PISLICES - 1); else
k = 0;
return(trig[k]);
}
#endif
//#if 0
UINT8 atan8( INT16 sXPos, INT16 sYPos, INT16 sXPos2, INT16 sYPos2 )
@@ -12420,22 +12116,6 @@ void SendGetNewSoldierPathEvent( SOLDIERTYPE *pSoldier, INT32 sDestGridNo, UINT1
void SendChangeSoldierStanceEvent( SOLDIERTYPE *pSoldier, UINT8 ubNewStance )
{
#if 0
EV_S_CHANGESTANCE SChangeStance;
#ifdef NETWORKED
if ( !IsTheSolderUnderMyControl( pSoldier->ubID ) )
return;
#endif
SChangeStance.ubNewStance = ubNewStance;
SChangeStance.usSoldierID = pSoldier->ubID;
SChangeStance.sXPos = pSoldier->sX;
SChangeStance.sYPos = pSoldier->sY;
SChangeStance.uiUniqueId = pSoldier->uiUniqueSoldierIdValue;
AddGameEvent( S_CHANGESTANCE, 0, &SChangeStance );
#endif
if ( ((pSoldier->ubID > 19 && !is_server) || (pSoldier->ubID > 119 && is_server)) && is_networked )return;
@@ -12458,51 +12138,6 @@ void SendBeginFireWeaponEvent( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
AddGameEvent( S_BEGINFIREWEAPON, 0, &SBeginFireWeapon );
}
#if 0
// This function is now obsolete. Just call ReduceAttackBusyCount.
// This function just encapolates the check for turnbased and having an attacker in the first place
void ReleaseSoldiersAttacker( SOLDIERTYPE *pSoldier )
{
INT32 cnt;
UINT8 ubNumToFree;
//if ( gTacticalStatus.uiFlags & TURNBASED && (gTacticalStatus.uiFlags & INCOMBAT) )
{
// ATE: Removed...
//if ( pSoldier->ubAttackerID != NOBODY )
{
// JA2 Gold
// set next-to-previous attacker, so long as this isn't a repeat attack
if ( pSoldier->ubPreviousAttackerID != pSoldier->ubAttackerID )
{
pSoldier->ubNextToPreviousAttackerID = pSoldier->ubPreviousAttackerID;
}
// get previous attacker id
pSoldier->ubPreviousAttackerID = pSoldier->ubAttackerID;
// Copy BeingAttackedCount here....
ubNumToFree = pSoldier->bBeingAttackedCount;
// Zero it out BEFORE, as supression may increase it again...
pSoldier->bBeingAttackedCount = 0;
for ( cnt = 0; cnt < ubNumToFree; cnt++ )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "@@@@@@@ Freeing up attacker of %d (attacker is %d) - releasesoldierattacker num to free is %d", pSoldier->ubID, pSoldier->ubAttackerID, ubNumToFree ) );
ReduceAttackBusyCount( pSoldier->ubAttackerID, FALSE );
}
// ATE: Set to NOBODY if this person is NOT dead
// otherise, we keep it so the kill can be awarded!
if ( pSoldier->stats.bLife != 0 && pSoldier->ubBodyType != QUEENMONSTER )
{
pSoldier->ubAttackerID = NOBODY;
}
}
}
}
#endif
BOOLEAN SOLDIERTYPE::MercInWater( void )
{
-12
View File
@@ -357,18 +357,6 @@ INT8 TileIsClear( SOLDIERTYPE *pSoldier, INT8 bDirection, INT32 sGridNo, INT8 b
}
else
{
#if 0
// Check if there is a reserved marker here at least....
sNewGridNo = NewGridNo( sGridNo, DirectionInc( bDirection ) );
if ( ( gpWorldLevelData[ sNewGridNo ].uiFlags & MAPELEMENT_MOVEMENT_RESERVED ) )
{
if ( gpWorldLevelData[ sNewGridNo ].ubReservedSoldierID != pSoldier->ubID )
{
return( MOVE_TILE_TEMP_BLOCKED );
}
}
#endif
}
}
-23
View File
@@ -2975,14 +2975,6 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
break;
#if 0//dnl ch75 021113
case '\"':
Testing(1);
break;
case '\'':
Testing(2);
break;
#endif
case '`':
@@ -4232,21 +4224,6 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
else if ( fCtrl )
{
#if 0
if ( INFORMATION_CHEAT_LEVEL() )
{
if ( gfUIShowCurIntTile ^= TRUE )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Turning Enhanced mouse detection ON." );
gubIntTileCheckFlags = INTILE_CHECK_FULL;
}
else
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Turning Enhanced mouse detection OFF." );
gubIntTileCheckFlags = INTILE_CHECK_SELECTIVE;
}
}
#endif
}
else
{
-14
View File
@@ -2018,20 +2018,6 @@ void HandleCriticalHitForVehicleInLocation( UINT8 ubID, INT16 sDmg, INT32 sGridN
SOLDIERTYPE *pSoldier;
BOOLEAN fMadeCorpse = FALSE;
#if 0
{
// injure someone inside
iRand = Random( gNewVehicle[ pVehicleList[ ubID ].ubVehicleType ].iNewSeatingCapacities );
if( pVehicleList[ ubID ].pPassengers[ iRand ] )
{
// hurt this person
InjurePersonInVehicle( ( INT16 )ubID, pVehicleList[ ubID ].pPassengers[ iRand ], ( UINT8 )( sDmg / 2 ) );
}
}
ScreenMsg( FONT_BLACK, MSG_INTERFACE, sCritLocationStrings[ iCrit ] );
}
#endif
pSoldier = GetSoldierStructureForVehicle( ubID );
Assert(pSoldier);
-13
View File
@@ -875,19 +875,6 @@ void LoadWorldItemsFromMap( INT8 **hBuffer, float dMajorMapVersion, int ubMinorM
{ //all armed bombs are buried
dummyItem.bVisible = BURIED;
}
#if 0//dnl ch74 201013 this is already done in OBJECTTYPE::Load()
//Madd: ok, so this drives me nuts -- why bother with default attachments if the map isn't going to load them for you?
//this should fix that...
for(UINT8 cnt = 0; cnt < MAX_DEFAULT_ATTACHMENTS; cnt++)
{
if(Item [ dummyItem.object.usItem ].defaultattachments[cnt] == 0)
break;
OBJECTTYPE defaultAttachment;
CreateItem(Item [ dummyItem.object.usItem ].defaultattachments[cnt],100,&defaultAttachment);
dummyItem.object.AttachObject(NULL,&defaultAttachment, FALSE);
}
#endif
// sevenfm: don't allow max repair threshold less than current object status
dummyItem.object[0]->data.sRepairThreshold = __max(dummyItem.object[0]->data.sRepairThreshold, dummyItem.object[0]->data.objectStatus);
AddItemToPoolAndGetIndex( dummyItem.sGridNo, &dummyItem.object, dummyItem.bVisible, dummyItem.ubLevel, dummyItem.usFlags, dummyItem.bRenderZHeightAboveLevel, dummyItem.soldierID, &iItemIndex );
-10
View File
@@ -189,18 +189,8 @@ lbepocketParseData * pData = (lbepocketParseData *)userData;
else if(strcmp(name, "pName") == 0)
{
pData->curElement = ELEMENT;
#if 0
if(MAX_CHAR_DATA_LENGTH >= strlen(pData->szCharData))
strcpy(pData->curLBEPocket.pName,pData->szCharData);
else
{
strncpy(pData->curLBEPocket.pName,pData->szCharData,MAX_CHAR_DATA_LENGTH);
pData->curLBEPocket.pName[MAX_CHAR_DATA_LENGTH] = '\0';
}
#else
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curLBEPocket.pName, sizeof(pData->curLBEPocket.pName)/sizeof(pData->curLBEPocket.pName[0]) );
pData->curLBEPocket.pName[sizeof(pData->curLBEPocket.pName)/sizeof(pData->curLBEPocket.pName[0]) - 1] = '\0';
#endif
}
else if(strcmp(name, "pSilhouette") == 0)
{
-9
View File
@@ -554,15 +554,6 @@ void AddMissileTrail( BULLET *pBullet, FIXEDPT qCurrX, FIXEDPT qCurrY, FIXEDPT q
ConvertGridNoToCenterCellXY( pBullet->sGridNo, &sXPos, &sYPos );
LightSpritePosition( pBullet->pAniTile->lightSprite, (INT16)(sXPos/CELL_X_SIZE), (INT16)(sYPos/CELL_Y_SIZE));
#if 0
if ( pBullet->pFirer->pathing.bLevel > 0 ) // if firer on roof then
{
if ( FindBuilding(AniParams.sGridNo) != NULL ) // if this spot is still within the building's grid area
{
LightSpritePower( pBullet->pAniTile->lightSprite, FALSE);
}
}
#endif
return;
}
-10
View File
@@ -1383,16 +1383,6 @@ INT16 DistanceVisible(SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir,
// let tanks see and be seen further (at night)
if ( (ARMED_VEHICLE( pSoldier ) && sDistVisible > 0) || (pSubject && ARMED_VEHICLE( pSubject )) )
{
#if 0
if ( ARMED_VEHICLE(pSoldier) && sDistVisible > 0 && pSubject)
{
sDistVisible = __max( sDistVisible + 5, pSubject->GetMaxDistanceVisible(pSoldier->sGridNo, pSoldier->pathing.bLevel) );
}
else
{
sDistVisible = __max( sDistVisible + 5, pSoldier->GetMaxDistanceVisible() );
}
#endif
// 0verhaul: This bit of code 1) seems to have no real reason to exist (MaxDistVisible just calls this function anyway),
// and 2) causes infinite recursion because MaxDistVisible just calls this function, which comes right back here. Just
// add 5 to sDistVisible and go on.