mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
**********************************************************
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+57
-47
@@ -96,10 +96,10 @@ extern BOOLEAN gfNextFireJam;
|
||||
|
||||
BOOLEAN WillExplosiveWeaponFail( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj );
|
||||
|
||||
BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo );
|
||||
BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo );
|
||||
BOOLEAN UseThrown( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo );
|
||||
BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo );
|
||||
BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo );
|
||||
BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo );
|
||||
BOOLEAN UseThrown( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo );
|
||||
BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo );
|
||||
|
||||
INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BOOLEAN fBladeAttack );
|
||||
|
||||
@@ -710,8 +710,9 @@ BOOLEAN ReadInWeaponStats(STR fileName)
|
||||
//Debug code; make sure that what we got from the file is the same as what's there
|
||||
// Open a new file
|
||||
hFile = FileOpen( "TABLEDATA\\~Weapons out.xml", FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
|
||||
if ( !hFile )
|
||||
return( FALSE );
|
||||
THROWIFFALSE(hFile, BuildString().add(L"Couls not open/create file : ").add(L"TABLEDATA\\~Weapons out.xml").get());
|
||||
//if ( !hFile )
|
||||
// return( FALSE );
|
||||
|
||||
{
|
||||
UINT32 cnt;
|
||||
@@ -1309,7 +1310,7 @@ BOOLEAN OKFireWeapon( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN FireWeapon( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
BOOLEAN FireWeapon( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
{
|
||||
// ignore passed in target gridno for now
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("FireWeapon"));
|
||||
@@ -1451,7 +1452,7 @@ BOOLEAN FireWeapon( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
}
|
||||
|
||||
|
||||
void GetTargetWorldPositions( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, FLOAT *pdXPos, FLOAT *pdYPos, FLOAT *pdZPos )
|
||||
void GetTargetWorldPositions( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, FLOAT *pdXPos, FLOAT *pdYPos, FLOAT *pdZPos )
|
||||
{
|
||||
FLOAT dTargetX;
|
||||
FLOAT dTargetY;
|
||||
@@ -1559,7 +1560,7 @@ void GetTargetWorldPositions( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, FLOAT
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
{
|
||||
UINT32 uiHitChance, uiDiceRoll;
|
||||
INT16 sXMapPos, sYMapPos;
|
||||
@@ -1572,7 +1573,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
UINT8 ubVolume;
|
||||
CHAR8 zBurstString[512];
|
||||
UINT8 ubDirection;
|
||||
INT16 sNewGridNo;
|
||||
INT32 sNewGridNo;
|
||||
UINT8 ubMerc;
|
||||
BOOLEAN fGonnaHit = FALSE;
|
||||
UINT16 usExpGain = 0;
|
||||
@@ -1950,13 +1951,13 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
{
|
||||
CreateItem( Item[usItemNum].discardedlauncheritem , pSoldier->inv[ HANDPOS ][0]->data.objectStatus,&(pSoldier->inv[ HANDPOS ] ) );
|
||||
DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
|
||||
IgniteExplosion( pSoldier->ubID, (INT16)CenterX( pSoldier->sGridNo ), (INT16)CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, C1, pSoldier->pathing.bLevel );
|
||||
IgniteExplosion( pSoldier->ubID, CenterX( pSoldier->sGridNo ), CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, C1, pSoldier->pathing.bLevel );
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("StructureHit: RPG7 item: %d, Ammo: %d",pSoldier->inv[HANDPOS].usItem , pSoldier->inv[HANDPOS][0]->data.gun.usGunAmmoItem ) );
|
||||
|
||||
IgniteExplosion( pSoldier->ubID, (INT16)CenterX( pSoldier->sGridNo ), (INT16)CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.usGunAmmoItem, pSoldier->pathing.bLevel );
|
||||
IgniteExplosion( pSoldier->ubID, CenterX( pSoldier->sGridNo ), CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.usGunAmmoItem, pSoldier->pathing.bLevel );
|
||||
pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.usGunAmmoItem = NONE;
|
||||
}
|
||||
// Reduce again for attack end 'cause it has been incremented for a normal attack
|
||||
@@ -1998,7 +1999,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
|
||||
// Direction to center of explosion
|
||||
ubDirection = gOppositeDirection[ pSoldier->ubDirection ];
|
||||
sNewGridNo = NewGridNo( (INT16)pSoldier->sGridNo, (UINT16)(1 * DirectionInc( ubDirection ) ) );
|
||||
sNewGridNo = NewGridNo( pSoldier->sGridNo, (UINT16)(1 * DirectionInc( ubDirection ) ) );
|
||||
|
||||
// Check if a person exists here and is not prone....
|
||||
ubMerc = WhoIsThere2( sNewGridNo, pSoldier->pathing.bLevel );
|
||||
@@ -2068,7 +2069,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
{
|
||||
SOLDIERTYPE * pTargetSoldier;
|
||||
INT32 iHitChance, iDiceRoll;
|
||||
@@ -2247,7 +2248,7 @@ BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStealing )
|
||||
BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStealing )
|
||||
{
|
||||
SOLDIERTYPE * pTargetSoldier;
|
||||
INT32 iHitChance, iDiceRoll;
|
||||
@@ -2591,7 +2592,7 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN UseThrown( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
BOOLEAN UseThrown( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
|
||||
{
|
||||
UINT32 uiHitChance, uiDiceRoll;
|
||||
INT8 bLoop;
|
||||
@@ -2715,7 +2716,7 @@ BOOLEAN UseThrown( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
|
||||
{
|
||||
UINT32 uiHitChance, uiDiceRoll;
|
||||
INT16 sAPCost = 0;
|
||||
@@ -2769,7 +2770,7 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
|
||||
// So we still should have ABC > 0
|
||||
// Begin explosion due to failure...
|
||||
IgniteExplosion( pSoldier->ubID, (INT16)CenterX( pSoldier->sGridNo ), (INT16)CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, Launchable.usItem, pSoldier->pathing.bLevel );
|
||||
IgniteExplosion( pSoldier->ubID, CenterX( pSoldier->sGridNo ), CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, Launchable.usItem, pSoldier->pathing.bLevel );
|
||||
|
||||
// Reduce again for attack end 'cause it has been incremented for a normal attack
|
||||
// Nope, not anymore.
|
||||
@@ -2834,6 +2835,15 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
|
||||
iID = CreatePhysicalObject( pSoldier->pTempObject, pSoldier->pThrowParams->dLifeSpan, pSoldier->pThrowParams->dX, pSoldier->pThrowParams->dY, pSoldier->pThrowParams->dZ, pSoldier->pThrowParams->dForceX, pSoldier->pThrowParams->dForceY, pSoldier->pThrowParams->dForceZ, pSoldier->ubID, pSoldier->pThrowParams->ubActionCode, pSoldier->pThrowParams->uiActionData, FALSE );
|
||||
|
||||
// OJW - 20091002 - Explosives
|
||||
if (is_networked && is_client)
|
||||
{
|
||||
if (pSoldier->bTeam == 0 || (pSoldier->bTeam == 1 && is_server))
|
||||
{
|
||||
send_grenade( pSoldier->pTempObject , pSoldier->pThrowParams->dLifeSpan, pSoldier->pThrowParams->dX, pSoldier->pThrowParams->dY, pSoldier->pThrowParams->dZ, pSoldier->pThrowParams->dForceX, pSoldier->pThrowParams->dForceY, pSoldier->pThrowParams->dForceZ, sTargetGridNo, pSoldier->ubID, pSoldier->pThrowParams->ubActionCode, pSoldier->pThrowParams->uiActionData, iID , false);
|
||||
}
|
||||
}
|
||||
|
||||
pObject = &( ObjectSlots[ iID ] );
|
||||
//pObject->fPotentialForDebug = TRUE;
|
||||
|
||||
@@ -2852,7 +2862,7 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN DoSpecialEffectAmmoMiss( UINT8 ubAttackerID, INT16 sGridNo, INT16 sXPos, INT16 sYPos, INT16 sZPos, BOOLEAN fSoundOnly, BOOLEAN fFreeupAttacker, INT32 iBullet )
|
||||
BOOLEAN DoSpecialEffectAmmoMiss( UINT8 ubAttackerID, INT32 sGridNo, INT16 sXPos, INT16 sYPos, INT16 sZPos, BOOLEAN fSoundOnly, BOOLEAN fFreeupAttacker, INT32 iBullet )
|
||||
{
|
||||
ANITILE_PARAMS AniParams;
|
||||
UINT8 ubAmmoType;
|
||||
@@ -2888,8 +2898,8 @@ BOOLEAN DoSpecialEffectAmmoMiss( UINT8 ubAttackerID, INT16 sGridNo, INT16 sXPos,
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
}
|
||||
}
|
||||
|
||||
if ( sGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sGridNo))
|
||||
{
|
||||
PlayJA2Sample( SMALL_EXPLODE_1 , RATE_11025, SoundVolume( (INT8)HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
@@ -2925,8 +2935,8 @@ BOOLEAN DoSpecialEffectAmmoMiss( UINT8 ubAttackerID, INT16 sGridNo, INT16 sXPos,
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
}
|
||||
}
|
||||
|
||||
if ( sGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sGridNo))
|
||||
{
|
||||
PlayJA2Sample( EXPLOSION_1 , RATE_11025, SoundVolume( (INT8)HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
@@ -2962,8 +2972,8 @@ BOOLEAN DoSpecialEffectAmmoMiss( UINT8 ubAttackerID, INT16 sGridNo, INT16 sXPos,
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
}
|
||||
}
|
||||
|
||||
if ( sGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sGridNo))
|
||||
{
|
||||
PlayJA2Sample( EXPLOSION_BLAST_2 , RATE_11025, SoundVolume( (INT8)HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
@@ -3033,26 +3043,26 @@ void WeaponHit( UINT16 usSoldierID, UINT16 usWeaponIndex, INT16 sDamage, INT16 s
|
||||
{
|
||||
if ( Item[usWeaponIndex].singleshotrocketlauncher )
|
||||
{
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, (INT16) (GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos )), C1, pTargetSoldier->pathing.bLevel );
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos ), C1, pTargetSoldier->pathing.bLevel );
|
||||
}
|
||||
// changed rpg type to work only with two flags matching
|
||||
else if ( !Item[usWeaponIndex].singleshotrocketlauncher && Item[usWeaponIndex].rocketlauncher)
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("WeaponHit: RPG7 item: %d, Ammo: %d",pSoldier->inv[HANDPOS].usItem , pSoldier->inv[HANDPOS][0]->data.gun.usGunAmmoItem ) );
|
||||
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, (INT16) (GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos )), pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.usGunAmmoItem, pTargetSoldier->pathing.bLevel );
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos ), pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.usGunAmmoItem, pTargetSoldier->pathing.bLevel );
|
||||
pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.usGunAmmoItem = NONE;
|
||||
}
|
||||
else if ( AmmoTypes[pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.ubGunAmmoType].explosionSize > 1)
|
||||
{
|
||||
// re-routed the Highexplosive value to define exposion type
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, (INT16) (GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos )), AmmoTypes[pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.ubGunAmmoType].highExplosive , pTargetSoldier->pathing.bLevel );
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos ), AmmoTypes[pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.ubGunAmmoType].highExplosive , pTargetSoldier->pathing.bLevel );
|
||||
// pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.usGunAmmoItem = NONE;
|
||||
}
|
||||
}
|
||||
else // tank cannon
|
||||
{
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, (INT16) (GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos )), TANK_SHELL, pTargetSoldier->pathing.bLevel );
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos ), TANK_SHELL, pTargetSoldier->pathing.bLevel );
|
||||
}
|
||||
|
||||
// 0verhaul: No longer necessary
|
||||
@@ -3084,7 +3094,7 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
|
||||
{
|
||||
BOOLEAN fDoMissForGun = FALSE;
|
||||
ANITILE *pNode;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
ANITILE_PARAMS AniParams;
|
||||
UINT16 usMissTileIndex, usMissTileType;
|
||||
STRUCTURE *pStructure = NULL;
|
||||
@@ -3155,19 +3165,19 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
|
||||
// FreeUpAttacker( ubAttackerID );
|
||||
if ( Item[usWeaponIndex].singleshotrocketlauncher )
|
||||
{
|
||||
IgniteExplosion( ubAttackerID, (INT16)CenterX( sGridNo ), (INT16)CenterY( sGridNo ), 0, sGridNo, C1, (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
IgniteExplosion( ubAttackerID, CenterX( sGridNo ), CenterY( sGridNo ), 0, sGridNo, C1, (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
}
|
||||
// changed too to use 2 flag to determine
|
||||
else if ( !Item[usWeaponIndex].singleshotrocketlauncher && Item[usWeaponIndex].rocketlauncher)
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("StructureHit: RPG7 item: %d, Ammo: %d",pAttacker->inv[HANDPOS].usItem , pAttacker->inv[HANDPOS][0]->data.gun.usGunAmmoItem ) );
|
||||
IgniteExplosion( ubAttackerID, (INT16)CenterX( sGridNo ), (INT16)CenterY( sGridNo ), 0, sGridNo, pAttacker->inv[pAttacker->ubAttackingHand ][0]->data.gun.usGunAmmoItem , (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
IgniteExplosion( ubAttackerID, CenterX( sGridNo ), CenterY( sGridNo ), 0, sGridNo, pAttacker->inv[pAttacker->ubAttackingHand ][0]->data.gun.usGunAmmoItem , (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
pAttacker->inv[pAttacker->ubAttackingHand ][0]->data.gun.usGunAmmoItem = NONE;
|
||||
}
|
||||
else if ( AmmoTypes[pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.ubGunAmmoType].explosionSize > 1)
|
||||
{
|
||||
// re-routed the Highexplosive value to define exposion type
|
||||
IgniteExplosion( ubAttackerID, (INT16)CenterX( sGridNo ), (INT16)CenterY( sGridNo ), 0, sGridNo, AmmoTypes[pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.ubGunAmmoType].highExplosive , (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
IgniteExplosion( ubAttackerID, CenterX( sGridNo ), CenterY( sGridNo ), 0, sGridNo, AmmoTypes[pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.ubGunAmmoType].highExplosive , (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
// pSoldier->inv[pSoldier->ubAttackingHand ][0]->data.gun.usGunAmmoItem = NONE;
|
||||
}
|
||||
|
||||
@@ -3183,7 +3193,7 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
|
||||
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of TANK fire") );
|
||||
//FreeUpAttacker( ubAttackerID );
|
||||
|
||||
IgniteExplosion( ubAttackerID, (INT16)CenterX( sGridNo ), (INT16)CenterY( sGridNo ), 0, sGridNo, TANK_SHELL, (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
IgniteExplosion( ubAttackerID, CenterX( sGridNo ), CenterY( sGridNo ), 0, sGridNo, TANK_SHELL, (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
//FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
|
||||
// Moved here to keep ABC >0 as long as possible
|
||||
@@ -3383,11 +3393,11 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
|
||||
}
|
||||
}
|
||||
|
||||
void WindowHit( INT16 sGridNo, UINT16 usStructureID, BOOLEAN fBlowWindowSouth, BOOLEAN fLargeForce )
|
||||
void WindowHit( INT32 sGridNo, UINT16 usStructureID, BOOLEAN fBlowWindowSouth, BOOLEAN fLargeForce )
|
||||
{
|
||||
STRUCTURE * pWallAndWindow;
|
||||
DB_STRUCTURE * pWallAndWindowInDB;
|
||||
INT16 sShatterGridNo;
|
||||
INT32 sShatterGridNo;
|
||||
UINT16 usTileIndex;
|
||||
ANITILE * pNode;
|
||||
ANITILE_PARAMS AniParams;
|
||||
@@ -3509,9 +3519,9 @@ void WindowHit( INT16 sGridNo, UINT16 usStructureID, BOOLEAN fBlowWindowSouth, B
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN InRange( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
BOOLEAN InRange( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
INT16 sRange;
|
||||
INT32 sRange;
|
||||
UINT16 usInHand;
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("InRange"));
|
||||
@@ -3521,7 +3531,7 @@ BOOLEAN InRange( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
if ( pItemInHand->usItemClass == IC_GUN || pItemInHand->usItemClass == IC_THROWING_KNIFE || (pItemInHand->rocketlauncher && !pItemInHand->singleshotrocketlauncher))
|
||||
{
|
||||
// Determine range
|
||||
sRange = (INT16)GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, sGridNo );
|
||||
sRange = GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, sGridNo );
|
||||
|
||||
if ( pItemInHand->usItemClass == IC_THROWING_KNIFE )
|
||||
{
|
||||
@@ -3543,7 +3553,7 @@ BOOLEAN InRange( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT16 sGridNo, INT16 ubAimTime, UINT8 ubAimPos )
|
||||
UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime, UINT8 ubAimPos )
|
||||
{
|
||||
//SOLDIERTYPE *vicpSoldier;
|
||||
SOLDIERTYPE * pTarget;
|
||||
@@ -4479,7 +4489,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT16 sGridNo, INT16 ubAimTime,
|
||||
return (iChance);
|
||||
}
|
||||
|
||||
UINT32 AICalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT16 sGridNo, INT16 ubAimTime, UINT8 ubAimPos )
|
||||
UINT32 AICalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime, UINT8 ubAimPos )
|
||||
{
|
||||
UINT16 usTrueState;
|
||||
UINT32 uiChance;
|
||||
@@ -5216,7 +5226,7 @@ void ShotMiss( UINT8 ubAttackerID, INT32 iBullet )
|
||||
|
||||
if ( pAttacker->bTeam == gbPlayerNum )
|
||||
{
|
||||
LocateGridNo( (INT16)pBullet->sGridNo );
|
||||
LocateGridNo( pBullet->sGridNo );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5822,7 +5832,7 @@ INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed )
|
||||
}
|
||||
|
||||
|
||||
UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT16 sGridNo, INT16 ubAimTime, UINT8 ubAimPos )
|
||||
UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime, UINT8 ubAimPos )
|
||||
{
|
||||
INT32 iChance, iMaxRange, iRange;
|
||||
UINT16 usHandItem;
|
||||
@@ -5930,7 +5940,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT16 sGridNo, INT16 ubAimTi
|
||||
}
|
||||
|
||||
// calculate actual range (in world units)
|
||||
iRange = (INT16)GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, sGridNo );
|
||||
iRange = GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, sGridNo );
|
||||
|
||||
//NumMessage("ACTUAL RANGE = ",range);
|
||||
|
||||
@@ -6102,8 +6112,8 @@ void DishoutQueenSwipeDamage( SOLDIERTYPE *pQueenSoldier )
|
||||
{
|
||||
if ( pSoldier->ubID != pQueenSoldier->ubID )
|
||||
{
|
||||
// ATE: Ok, lets check for some basic things here!
|
||||
if ( pSoldier->stats.bLife >= OKLIFE && pSoldier->sGridNo != NOWHERE && pSoldier->bActive && pSoldier->bInSector )
|
||||
// ATE: Ok, lets check for some basic things here!
|
||||
if ( pSoldier->stats.bLife >= OKLIFE && !TileIsOutOfBounds(pSoldier->sGridNo) && pSoldier->bActive && pSoldier->bInSector )
|
||||
{
|
||||
// Get Pyth spaces away....
|
||||
if ( GetRangeInCellCoordsFromGridNoDiff( pQueenSoldier->sGridNo, pSoldier->sGridNo ) <= Weapon[ CREATURE_QUEEN_TENTACLES].usRange )
|
||||
@@ -6400,4 +6410,4 @@ void EstimateBulletsLeft( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj )
|
||||
swprintf(gBulletCount, L"%d", usRealBulletCount);
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user