Convert to SoldierID

This commit is contained in:
Asdow
2024-11-17 22:29:31 +02:00
parent b6e8b0c5ff
commit ef9aa1b027
26 changed files with 318 additions and 319 deletions
+68 -68
View File
@@ -63,7 +63,7 @@ BOOLEAN HookerInRoom( UINT16 usRoom );
// MODULE FOR EXPLOSIONS
// Spreads the effects of explosions...
BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usItem, UINT16 ubOwner, INT16 sSubsequent, BOOLEAN *pfMercHit, INT8 bLevel, INT32 iSmokeEffectID );
BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usItem, SoldierID ubOwner, INT16 sSubsequent, BOOLEAN *pfMercHit, INT8 bLevel, INT32 iSmokeEffectID );
// Flashbang effect on soldier
UINT8 DetermineFlashbangEffect( SOLDIERTYPE *pSoldier, INT8 ubExplosionDir, BOOLEAN fInBuilding);
@@ -192,7 +192,7 @@ UINT32 guiNumExplosions = 0;
INT32 GetFreeExplosion( void );
void RecountExplosions( void );
void GenerateExplosionFromExplosionPointer( EXPLOSIONTYPE *pExplosion );
void HandleBuldingDestruction( INT32 sGridNo, UINT16 ubOwner );
void HandleBuldingDestruction( INT32 sGridNo, SoldierID ubOwner );
#ifdef JA2UB
//JA25 UB
@@ -650,13 +650,13 @@ void HandleFencePartnerCheck( INT32 sStructGridNo )
INT8 ExplosiveDamageStructureAtGridNo( STRUCTURE * pCurrent, STRUCTURE **ppNextCurrent, INT32 sGridNo, INT16 sWoundAmt,
UINT32 uiDist,
BOOLEAN *pfRecompileMovementCosts, BOOLEAN fOnlyWalls, BOOLEAN fSubSequentMultiTilesTransitionDamage, UINT16 ubOwner, INT8 bLevel,
BOOLEAN *pfRecompileMovementCosts, BOOLEAN fOnlyWalls, BOOLEAN fSubSequentMultiTilesTransitionDamage, SoldierID ubOwner, INT8 bLevel,
UINT8 ubReason )
{
#ifdef JA2BETAVERSION
if (is_networked) {
CHAR tmpMPDbgString[512];
sprintf(tmpMPDbgString,"ExplosiveDamageStructureAtGridNo ( sGridNo : %i , sWoundAmt : %i , uiDist : %i , fRecompMoveCosts : %i , fOnlyWalls : %i , SubsMulTilTransDmg : %i , ubOwner : %i , bLevel : %i )\n", sGridNo, sWoundAmt , uiDist, (int)*pfRecompileMovementCosts , (int)fOnlyWalls , (int)fSubSequentMultiTilesTransitionDamage , ubOwner , bLevel );
sprintf(tmpMPDbgString,"ExplosiveDamageStructureAtGridNo ( sGridNo : %i , sWoundAmt : %i , uiDist : %i , fRecompMoveCosts : %i , fOnlyWalls : %i , SubsMulTilTransDmg : %i , ubOwner : %i , bLevel : %i )\n", sGridNo, sWoundAmt , uiDist, (int)*pfRecompileMovementCosts , (int)fOnlyWalls , (int)fSubSequentMultiTilesTransitionDamage , ubOwner.i , bLevel );
MPDebugMsg(tmpMPDbgString);
}
#endif
@@ -1329,14 +1329,14 @@ STRUCTURE *gStruct;
void ExplosiveDamageGridNo( INT32 sGridNo, INT16 sWoundAmt, UINT32 uiDist,
BOOLEAN *pfRecompileMovementCosts,
BOOLEAN fOnlyWalls, INT8 bMultiStructSpecialFlag, BOOLEAN fSubSequentMultiTilesTransitionDamage, UINT16 ubOwner,
BOOLEAN fOnlyWalls, INT8 bMultiStructSpecialFlag, BOOLEAN fSubSequentMultiTilesTransitionDamage, SoldierID ubOwner,
INT8 bLevel,
UINT8 ubReason )
{
#ifdef JA2BETAVERSION
if (is_networked) {
CHAR tmpMPDbgString[512];
sprintf(tmpMPDbgString,"ExplosiveDamageGridNo ( sGridNo : %i , sWoundAmt : %i , uiDist : %i , fRecompileMoveCosts : %i , fOnlyWalls : %i , MultiStructSpecialFlag : %i ,fSubsequentMultiTilesTransDmg : %i , ubOwner : %i , bLevel : %i )\n", sGridNo, sWoundAmt ,uiDist, (int)*pfRecompileMovementCosts , (int)fOnlyWalls , bMultiStructSpecialFlag , (int)fSubSequentMultiTilesTransitionDamage , ubOwner , bLevel );
sprintf(tmpMPDbgString,"ExplosiveDamageGridNo ( sGridNo : %i , sWoundAmt : %i , uiDist : %i , fRecompileMoveCosts : %i , fOnlyWalls : %i , MultiStructSpecialFlag : %i ,fSubsequentMultiTilesTransDmg : %i , ubOwner : %i , bLevel : %i )\n", sGridNo, sWoundAmt ,uiDist, (int)*pfRecompileMovementCosts , (int)fOnlyWalls , bMultiStructSpecialFlag , (int)fSubSequentMultiTilesTransitionDamage , ubOwner.i , bLevel );
MPDebugMsg(tmpMPDbgString);
}
#endif
@@ -1511,12 +1511,12 @@ void ExplosiveDamageGridNo( INT32 sGridNo, INT16 sWoundAmt, UINT32 uiDist,
}
BOOLEAN DamageSoldierFromBlast( UINT16 ubPerson, UINT16 ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent, BOOL fFromRemoteClient )
BOOLEAN DamageSoldierFromBlast( SoldierID ubPerson, SoldierID ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent, BOOL fFromRemoteClient )
{
// OJW - 20091028
if (is_networked && is_client)
{
SOLDIERTYPE* pSoldier = MercPtrs[ubPerson];
SOLDIERTYPE* pSoldier = ubPerson;
if (pSoldier != NULL)
{
// only the owner of a merc may send damage (as this takes into account equipped armor)
@@ -1532,9 +1532,9 @@ BOOLEAN DamageSoldierFromBlast( UINT16 ubPerson, UINT16 ubOwner, INT32 sBombGrid
}
}
#ifdef JA2BETAVERSION
CHAR tmpMPDbgString[512];
sprintf(tmpMPDbgString,"DamageSoldierFromBlast ( ubPerson : %i , ubOwner : %i , sBombGridNo : %i , sWoundAmt : %i , sBreathAmt : %i , uiDist : %i , usItem : %i , sSubs : %i , fFromRemoteClient : %i )\n",ubPerson, ubOwner , sBombGridNo , sWoundAmt , sBreathAmt , uiDist , usItem , sSubsequent , fFromRemoteClient );
MPDebugMsg(tmpMPDbgString);
CHAR tmpMPDbgString[512];
sprintf(tmpMPDbgString,"DamageSoldierFromBlast ( ubPerson : %i , ubOwner : %i , sBombGridNo : %i , sWoundAmt : %i , sBreathAmt : %i , uiDist : %i , usItem : %i , sSubs : %i , fFromRemoteClient : %i )\n",ubPerson.i, ubOwner.i , sBombGridNo , sWoundAmt , sBreathAmt , uiDist , usItem , sSubsequent , fFromRemoteClient );
MPDebugMsg(tmpMPDbgString);
#endif
}
@@ -1547,7 +1547,7 @@ BOOLEAN DamageSoldierFromBlast( UINT16 ubPerson, UINT16 ubOwner, INT32 sBombGrid
BOOLEAN fFlashbang = Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_FLASHBANG;
UINT16 usHalfExplosionRadius;
pSoldier = MercPtrs[ ubPerson ]; // someone is here, and they're gonna get hurt
pSoldier = ubPerson; // someone is here, and they're gonna get hurt
if (!pSoldier->bActive || !pSoldier->bInSector || !pSoldier->stats.bLife )
return( FALSE );
@@ -1612,29 +1612,29 @@ BOOLEAN DamageSoldierFromBlast( UINT16 ubPerson, UINT16 ubOwner, INT32 sBombGrid
// SANDRO - STOMP traits
else
{
if ( ubOwner < TOTAL_SOLDIERS && (MercPtrs[ ubOwner ] != NULL) && gGameOptions.fNewTraitSystem)
if ( ubOwner < TOTAL_SOLDIERS && gGameOptions.fNewTraitSystem)
{
// Demolitions damage bonus with bombs and mines
if ( HAS_SKILL_TRAIT( MercPtrs[ ubOwner ], DEMOLITIONS_NT ) &&
if ( HAS_SKILL_TRAIT( ubOwner, DEMOLITIONS_NT ) &&
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_NORMAL && Item[usItem].usItemClass == IC_BOMB &&
(!ItemIsAttachment(usItem) || ItemIsMine(usItem)))
{
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 + gSkillTraitValues.ubDEDamageOfBombsAndMines) / 100.0f + 0.5f);
}
// Heavy Weapons trait bonus damage to tanks
if ( HAS_SKILL_TRAIT( MercPtrs[ubOwner], HEAVY_WEAPONS_NT ) && (ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier )) &&
if ( HAS_SKILL_TRAIT( ubOwner, HEAVY_WEAPONS_NT ) && (ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier )) &&
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_NORMAL )
{
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 + gSkillTraitValues.ubHWDamageTanksBonusPercent * NUM_SKILL_TRAITS( MercPtrs[ ubOwner ], HEAVY_WEAPONS_NT )) / 100.0f + 0.5f); // +30%
sNewWoundAmt = (INT16)(sNewWoundAmt * (100 + gSkillTraitValues.ubHWDamageTanksBonusPercent * NUM_SKILL_TRAITS( ubOwner, HEAVY_WEAPONS_NT )) / 100.0f + 0.5f); // +30%
}
// 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( ubOwner, HEAVY_WEAPONS_NT ) &&
Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_NORMAL &&
((Item[usItem].usItemClass == IC_BOMB && ItemIsAttachment(usItem) && !ItemIsMine(usItem) ) || // mortar shells
(Item[usItem].usItemClass == IC_GRENADE && (ItemIsGLgrenade(usItem) || ItemIsElectronic(usItem)) ) || // rockets for rocketlaunchers (I haven't found any other way)
(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( ubOwner, HEAVY_WEAPONS_NT )) / 100.0f + 0.5f); // +15%
}
}
@@ -1890,9 +1890,9 @@ BOOLEAN DamageSoldierFromBlast( UINT16 ubPerson, UINT16 ubOwner, INT32 sBombGrid
pSoldier->ubMiscSoldierFlags |= SOLDIER_MISC_HURT_BY_EXPLOSION;
if ( ubOwner != NOBODY && MercPtrs[ ubOwner ]->bTeam == gbPlayerNum && pSoldier->bTeam != gbPlayerNum )
if ( ubOwner != NOBODY && ubOwner->bTeam == gbPlayerNum && pSoldier->bTeam != gbPlayerNum )
{
ProcessImplicationsOfPCAttack( MercPtrs[ ubOwner ], &pSoldier, REASON_EXPLOSION );
ProcessImplicationsOfPCAttack( ubOwner, &pSoldier, REASON_EXPLOSION );
}
return( TRUE );
@@ -2163,7 +2163,7 @@ BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, IN
return( fRecompileMovementCosts );
}
BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usItem, UINT16 ubOwner, INT16 sSubsequent, BOOLEAN *pfMercHit, INT8 bLevel, INT32 iSmokeEffectID )
BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usItem, SoldierID ubOwner, INT16 sSubsequent, BOOLEAN *pfMercHit, INT8 bLevel, INT32 iSmokeEffectID )
{
#ifdef JA2BETAVERSION
if (is_networked) {
@@ -2174,7 +2174,7 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte
#endif
INT16 sWoundAmt = 0,sBreathAmt = 0, /* sNewWoundAmt = 0, sNewBreathAmt = 0, */ sStructDmgAmt;
UINT16 ubPerson;
SoldierID ubPerson;
SOLDIERTYPE *pSoldier;
EXPLOSIVETYPE *pExplosive;
INT16 sX, sY;
@@ -2533,7 +2533,7 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte
return( fRecompileMovementCosts );
}
pSoldier = MercPtrs[ ubPerson ]; // someone is here, and they're gonna get hurt
pSoldier = ubPerson; // someone is here, and they're gonna get hurt
// silversurfer: Gas now only has an effect when the container had time to emit some. Initially it will do nothing.
// This prevents the problem that we have to suffer two times without a chance to react (1st when the grenade hits our position, 2nd when our turn starts)
@@ -2918,11 +2918,11 @@ void GetRayStopInfo( UINT32 uiNewSpot, UINT8 ubDir, INT8 bLevel, BOOLEAN fSmokeE
void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT16 ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectID, BOOL fFromRemoteClient, BOOL fNewSmokeEffect )
void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, SoldierID ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectID, BOOL fFromRemoteClient, BOOL fNewSmokeEffect )
{
if (is_networked && is_client)
{
SOLDIERTYPE* pAttacker = MercPtrs[ubOwner];
SOLDIERTYPE* pAttacker = ubOwner;
if (pAttacker != NULL)
{
if (IsOurSoldier(pAttacker) || (pAttacker->bTeam == 1 && is_server))
@@ -2932,7 +2932,7 @@ void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT16 ubOwner,
{
// let all the other clients know we are spawning this effect
// and align them with our random number generator
send_spreadeffect(sGridNo,ubRadius,usItem,ubOwner,fSubsequent,bLevel,iSmokeEffectID);
send_spreadeffect(sGridNo, ubRadius, usItem, ubOwner, fSubsequent, bLevel, iSmokeEffectID);
}
}
else if (!fFromRemoteClient)
@@ -3803,7 +3803,7 @@ void AddBombToQueue( UINT32 uiWorldBombIndex, UINT32 uiTimeStamp, BOOL fFromRemo
if (IsOurSoldier((SOLDIERTYPE*)gubPersonToSetOffExplosions) || IsOurSoldier((SOLDIERTYPE*)soldierID))
{
// we set off the bomb (could be failed disarm) or we own it, tell the other clients we are setting it off
send_detonate_explosive(iWorldIndex,gubPersonToSetOffExplosions);
send_detonate_explosive(iWorldIndex, gubPersonToSetOffExplosions);
}
else if (gWorldBombs[uiWorldBombIndex].bIsFromRemotePlayer && !fFromRemoteClient)
{
@@ -3932,10 +3932,10 @@ BOOLEAN ActivateSurroundingTripwire( SoldierID ubID, INT32 sGridNo, INT8 bLevel,
// SANDRO - merc records
// only if we blew up somebody not in our team(no achievement for blowing our guys :)), only if owner exists and have profile
if ( (MercPtrs[ubID]->bTeam != gbPlayerNum) && ((*pObj)[0]->data.misc.ubBombOwner > 1) )
if ( (ubID->bTeam != gbPlayerNum) && ((*pObj)[0]->data.misc.ubBombOwner > 1) )
{
if ( MercPtrs[ ((*pObj)[0]->data.misc.ubBombOwner - 2) ]->ubProfile != NO_PROFILE && MercPtrs[ ((*pObj)[0]->data.misc.ubBombOwner - 2) ]->bTeam == gbPlayerNum )
gMercProfiles[ MercPtrs[ ((*pObj)[0]->data.misc.ubBombOwner - 2) ]->ubProfile ].records.usExpDetonated++;
if ( ((*pObj)[0]->data.misc.ubBombOwner - 2)->ubProfile != NO_PROFILE && ((*pObj)[0]->data.misc.ubBombOwner - 2)->bTeam == gbPlayerNum )
gMercProfiles[ ((*pObj)[0]->data.misc.ubBombOwner - 2)->ubProfile ].records.usExpDetonated++;
}
/*if (pObj->usItem != ACTION_ITEM || (*pObj)[0]->data.misc.bActionValue == ACTION_ITEM_BLOW_UP)
@@ -3962,7 +3962,7 @@ BOOLEAN ActivateSurroundingTripwire( SoldierID ubID, INT32 sGridNo, INT8 bLevel,
}
// Flugente: A special function for tripwire gun traps. Search if pObj has a gun attached. If so, fire a shot from that gun in a specific direction. Afterwards place the gun on the ground
void CheckAndFireTripwireGun( OBJECTTYPE* pObj, INT32 sGridNo, INT8 bLevel, UINT16 ubId, UINT8 ubDirection )
void CheckAndFireTripwireGun( OBJECTTYPE* pObj, INT32 sGridNo, INT8 bLevel, SoldierID ubId, UINT8 ubDirection )
{
if ( !pObj )
return;
@@ -3980,7 +3980,7 @@ void CheckAndFireTripwireGun( OBJECTTYPE* pObj, INT32 sGridNo, INT8 bLevel, UINT
gTacticalStatus.uiFlags |= (DISALLOW_SIGHT | CHECK_SIGHT_AT_END_OF_ATTACK);
}
FireFragmentsTrapGun( MercPtrs[ubId], sGridNo, 0, pObj, ubDirection );
FireFragmentsTrapGun( ubId, sGridNo, 0, pObj, ubDirection );
// this is important... if not set, the game will remain in a loop
gTacticalStatus.ubAttackBusyCount = 0;
@@ -4055,11 +4055,11 @@ void HandleExplosionQueue( void )
if ( sSoundID > NO_ALT_SOUND )
PlayJA2Sample( sSoundID, RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
UINT16 ubID = WhoIsThere2( sGridNo, ubLevel );
SoldierID ubID = WhoIsThere2( sGridNo, ubLevel );
if ( ubID != NOBODY )
{
SOLDIERTYPE* pSoldier = MercPtrs[ubID];
SOLDIERTYPE* pSoldier = ubID;
INT16 damage = Explosive[Item[pObj->usItem].ubClassIndex].ubDamage * 0.67f + Random( Explosive[Item[pObj->usItem].ubClassIndex].ubDamage * 0.67f );
INT16 breathdamage = Explosive[Item[pObj->usItem].ubClassIndex].ubStunDamage * 0.67f + Random( Explosive[Item[pObj->usItem].ubClassIndex].ubStunDamage * 0.67f );
@@ -4172,7 +4172,7 @@ void HandleExplosionQueue( void )
INT16 sX, sY;
ConvertGridNoToCenterCellXY(sGridNo, &sX, &sY);
fAttFound=HandleAttachedExplosions( (UINT8) ((*pObj)[0]->data.misc.ubBombOwner - 2), sX, sY, 0,
fAttFound = HandleAttachedExplosions( ((*pObj)[0]->data.misc.ubBombOwner - 2), sX, sY, 0,
sGridNo, (*pObj)[0]->data.misc.usBombItem, FALSE, ubLevel, (*pObj)[0]->data.ubDirection, pObj);
}
}
@@ -4219,7 +4219,7 @@ void HandleExplosionQueue( void )
// determine gridno to attack - smoke signal required. Otherwise, it is assumed the radio operator ordered the bombing of his OWN position
// if we cannot even find a radio operator, all bets are off - target a random gridno
// the usual +/- 2 shenanigans
UINT16 usOwner = NOBODY;
SoldierID usOwner = NOBODY;
if ( (*pObj)[0]->data.misc.ubBombOwner > 1 )
usOwner = (*pObj)[0]->data.misc.ubBombOwner - 2;
@@ -4251,7 +4251,7 @@ void HandleExplosionQueue( void )
// bomb objects only store the SIDE who placed the bomb! :-(
if ( (*pObj)[0]->data.misc.ubBombOwner > 1 )
{
IgniteExplosion( (UINT8) ((*pObj)[0]->data.misc.ubBombOwner - 2), sX, sY, 0, sGridNo, (*pObj)[0]->data.misc.usBombItem, ubLevel, (*pObj)[0]->data.ubDirection, pObj);
IgniteExplosion( ((*pObj)[0]->data.misc.ubBombOwner - 2), sX, sY, 0, sGridNo, (*pObj)[0]->data.misc.usBombItem, ubLevel, (*pObj)[0]->data.ubDirection, pObj);
}
else
{
@@ -4704,12 +4704,12 @@ void SetOffBombsByFrequency( SoldierID ubID, INT8 bFrequency )
// SANDRO - added merc records and some exp
if ( ((*pObj)[0]->data.misc.ubBombOwner) > 1 )
{
if ( MercPtrs[((*pObj)[0]->data.misc.ubBombOwner - 2)]->ubProfile != NO_PROFILE &&
MercPtrs[((*pObj)[0]->data.misc.ubBombOwner - 2)]->bTeam == gbPlayerNum )
if ( ((*pObj)[0]->data.misc.ubBombOwner - 2)->ubProfile != NO_PROFILE &&
((*pObj)[0]->data.misc.ubBombOwner - 2)->bTeam == gbPlayerNum )
{
gMercProfiles[MercPtrs[((*pObj)[0]->data.misc.ubBombOwner - 2)]->ubProfile].records.usExpDetonated++;
gMercProfiles[((*pObj)[0]->data.misc.ubBombOwner - 2)->ubProfile].records.usExpDetonated++;
StatChange( MercPtrs[((*pObj)[0]->data.misc.ubBombOwner - 2)], EXPLODEAMT, ( 5 ), FALSE );
StatChange( ((*pObj)[0]->data.misc.ubBombOwner - 2), EXPLODEAMT, ( 5 ), FALSE );
}
}
@@ -4804,12 +4804,12 @@ void SetOffBombsByFrequency( SoldierID ubID, INT8 bFrequency )
// SANDRO - added merc records and some exp
if ( ((*pObj)[0]->data.misc.ubBombOwner) > 1 )
{
if ( MercPtrs[((*pObj)[0]->data.misc.ubBombOwner - 2)]->ubProfile != NO_PROFILE &&
MercPtrs[((*pObj)[0]->data.misc.ubBombOwner - 2)]->bTeam == gbPlayerNum )
if ( ((*pObj)[0]->data.misc.ubBombOwner - 2)->ubProfile != NO_PROFILE &&
((*pObj)[0]->data.misc.ubBombOwner - 2)->bTeam == gbPlayerNum )
{
gMercProfiles[MercPtrs[((*pObj)[0]->data.misc.ubBombOwner - 2)]->ubProfile].records.usExpDetonated++;
gMercProfiles[((*pObj)[0]->data.misc.ubBombOwner - 2)->ubProfile].records.usExpDetonated++;
StatChange( MercPtrs[((*pObj)[0]->data.misc.ubBombOwner - 2)], EXPLODEAMT, ( 5 ), FALSE );
StatChange( ((*pObj)[0]->data.misc.ubBombOwner - 2), EXPLODEAMT, ( 5 ), FALSE );
}
}
@@ -4979,8 +4979,8 @@ BOOLEAN SetOffBombsInGridNo( SoldierID ubID, INT32 sGridNo, BOOLEAN fAllBombs, I
// only if we blew up somebody not in our team(no achievement for blowing our guys :)), only if owner exists and have profile
if ( (ubID->bTeam != gbPlayerNum) && ((*pObj)[0]->data.misc.ubBombOwner > 1) )
{
if ( MercPtrs[ ((*pObj)[0]->data.misc.ubBombOwner - 2) ]->ubProfile != NO_PROFILE && MercPtrs[ ((*pObj)[0]->data.misc.ubBombOwner - 2) ]->bTeam == gbPlayerNum )
gMercProfiles[ MercPtrs[ ((*pObj)[0]->data.misc.ubBombOwner - 2) ]->ubProfile ].records.usExpDetonated++;
if ( ((*pObj)[0]->data.misc.ubBombOwner - 2)->ubProfile != NO_PROFILE && ((*pObj)[0]->data.misc.ubBombOwner - 2)->bTeam == gbPlayerNum )
gMercProfiles[ ((*pObj)[0]->data.misc.ubBombOwner - 2)->ubProfile ].records.usExpDetonated++;
}
/*if (pObj->usItem != ACTION_ITEM || (*pObj)[0]->data.misc.bActionValue == ACTION_ITEM_BLOW_UP)
@@ -5305,7 +5305,7 @@ void UpdateSAMDoneRepair( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
// loop through civ team and find
// anybody who is an NPC and
// see if they get angry
void HandleBuldingDestruction( INT32 sGridNo, UINT16 ubOwner )
void HandleBuldingDestruction( INT32 sGridNo, SoldierID ubOwner )
{
SOLDIERTYPE * pSoldier;
UINT16 cnt;
@@ -5315,7 +5315,7 @@ void HandleBuldingDestruction( INT32 sGridNo, UINT16 ubOwner )
return;
}
if ( MercPtrs[ ubOwner ]->bTeam != gbPlayerNum )
if ( ubOwner->bTeam != gbPlayerNum )
{
return;
}
@@ -5339,7 +5339,7 @@ void HandleBuldingDestruction( INT32 sGridNo, UINT16 ubOwner )
if ( DoesNPCOwnBuilding( pSoldier, sGridNo ) )
{
MakeNPCGrumpyForMinorOffense( pSoldier, MercPtrs[ ubOwner ] );
MakeNPCGrumpyForMinorOffense( pSoldier, ubOwner );
}
}
}
@@ -5624,9 +5624,9 @@ void HavePersonAtGridnoStop( UINT32 sGridNo )
SoldierID ubID = WhoIsThere2( sGridNo, 0 );
//is it a valid person
if ( (ubID != NOBODY) && (MercPtrs[ ubID ]->bTeam == gbPlayerNum) )
if ( (ubID != NOBODY) && (ubID->bTeam == gbPlayerNum) )
{
SOLDIERTYPE *pSoldier = MercPtrs[ ubID ];
SOLDIERTYPE *pSoldier = ubID;
//Stop the merc
pSoldier->EVENT_StopMerc( pSoldier->sGridNo, pSoldier->ubDirection );
@@ -5732,10 +5732,10 @@ void HandleDestructionOfPowerGenFan()
// Have a qualified merc say a quote
//
//Get a random qualified merc to say the quote
INT16 bID = RandomSoldierIdFromNewMercsOnPlayerTeam();
if( bID != -1 )
SoldierID bID = RandomSoldierIdFromNewMercsOnPlayerTeam();
if( bID != NOBODY )
{
DelayedMercQuote( Menptr[ bID ].ubProfile, QUOTE_ACCEPT_CONTRACT_RENEWAL, GetWorldTotalSeconds() + 2 );
DelayedMercQuote( bID->ubProfile, QUOTE_ACCEPT_CONTRACT_RENEWAL, GetWorldTotalSeconds() + 2 );
}
}
@@ -5773,8 +5773,8 @@ void HandleSeeingFortifiedDoor( UINT32 sGridNo )
gJa25SaveStruct.uiJa25GeneralFlags |= JA_GF__PLAYER_HAS_SEEN_FORTIFIED_DOOR;
//find out whos is the one walking across the trap
INT16 sID = WhoIsThere2( sGridNo, 0 );
if( sID != NOBODY && IsSoldierQualifiedMerc( &Menptr[ sID ] ) )
SoldierID sID = WhoIsThere2( sGridNo, 0 );
if( sID != NOBODY && IsSoldierQualifiedMerc( sID ) )
{
}
else
@@ -5783,10 +5783,10 @@ void HandleSeeingFortifiedDoor( UINT32 sGridNo )
sID = RandomSoldierIdFromNewMercsOnPlayerTeam();
}
if( sID != -1 )
if( sID != NOBODY )
{
//say the quote
TacticalCharacterDialogue( &Menptr[ sID ], QUOTE_LENGTH_OF_CONTRACT );
TacticalCharacterDialogue( sID, QUOTE_LENGTH_OF_CONTRACT );
}
}
@@ -5801,11 +5801,11 @@ void HandleSwitchToOpenFortifiedDoor( UINT32 sGridNo )
//remeber that the switch to open the forified door on level 1, has been pulled
gJa25SaveStruct.ubStatusOfFortifiedDoor = FD__OPEN;
INT16 bID = RandomSoldierIdFromNewMercsOnPlayerTeam();
SoldierID bID = RandomSoldierIdFromNewMercsOnPlayerTeam();
if( bID != -1 )
if( bID != NOBODY )
{
TacticalCharacterDialogue( &Menptr[ bID ], QUOTE_COMMENT_BEFORE_HANG_UP );
TacticalCharacterDialogue( bID, QUOTE_COMMENT_BEFORE_HANG_UP );
}
}
@@ -5834,7 +5834,7 @@ void HandleSeeingPowerGenFan( UINT32 sGridNo )
if( ubPerson != NOBODY )
{
pSoldier = &Menptr[ ubPerson ];
pSoldier = ubPerson;
//if the fan is stopped And is this merc is a qualified merc but Not a power gen fan qualified merc?
if( IsSoldierQualifiedMerc( pSoldier ) && fFanIsStopped )
@@ -5886,7 +5886,7 @@ void HandleSeeingPowerGenFan( UINT32 sGridNo )
}
#endif
void HandleBuddyExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection )
void HandleBuddyExplosions(SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection )
{
// Flugente: Items can have secondary explosions
if ( Item[usItem].usBuddyItem )
@@ -5907,7 +5907,7 @@ void HandleBuddyExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sG
}
// sevenfm: handle explosive items from attachments
BOOLEAN HandleAttachedExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj)
BOOLEAN HandleAttachedExplosions( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj)
{
BOOLEAN binderFound = FALSE;
BOOLEAN detonator = FALSE;
@@ -6264,10 +6264,10 @@ void RoofDestruction( INT32 sGridNo, BOOLEAN fWithExplosion )
// if there is anybody at the floor level, damage them with the debris
// we have to do this BEFORE people drop down. It would otherwise be possible for a falling person to avoid this damage, depending on order of collapsing and possible gridno-shifts.
UINT16 ubId = WhoIsThere2( sGridNo, 0 );
SoldierID ubId = WhoIsThere2( sGridNo, 0 );
if ( ubId != NOBODY )
{
pSoldier = MercPtrs[ubId];
pSoldier = ubId;
pSoldier->EVENT_StopMerc( pSoldier->sGridNo, pSoldier->ubDirection );
@@ -6283,7 +6283,7 @@ void RoofDestruction( INT32 sGridNo, BOOLEAN fWithExplosion )
ubId = WhoIsThere2( sGridNo, 1 );
if ( ubId != NOBODY )
{
pSoldier = MercPtrs[ubId];
pSoldier = ubId;
INT32 soldierdropoffgridno = sGridNo;
if ( !IsLocationSittable( soldierdropoffgridno, FALSE ) )
+6 -6
View File
@@ -132,16 +132,16 @@ void RemoveActiveExplosionMarkers();
#define GASMASK_MIN_STATUS 70
// OJW - 20091028 - Explosion damage sync
BOOLEAN DamageSoldierFromBlast( UINT16 ubPerson, UINT16 ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent, BOOL fFromRemoteClient = FALSE );
BOOLEAN DamageSoldierFromBlast( SoldierID ubPerson, SoldierID ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent, BOOL fFromRemoteClient = FALSE );
BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, SoldierID ubOwner, BOOL fFromRemoteClient = FALSE );
void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT16 ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectNum, BOOL fFromRemoteClient = FALSE, BOOL fNewSmokeEffect = FALSE );
void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, SoldierID ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectNum, BOOL fFromRemoteClient = FALSE, BOOL fNewSmokeEffect = FALSE );
void AddBombToQueue( UINT32 uiWorldBombIndex, UINT32 uiTimeStamp, BOOL fFromRemoteClient = FALSE );
// Flugente: activate everything connected to a tripwire in the surrounding if sGridNo on level bLevel with regard to the tripwire netwrok and hierarchy determined by ubFlag
BOOLEAN ActivateSurroundingTripwire( SoldierID ubID, INT32 sGridNo, INT8 bLevel, UINT32 ubFlag );
// Flugente: A special function for tripwire gun traps. Search if pObj has a gun attached. If so, fire a shot from that gun in a specific direction. Afterwards place the gun on the ground
void CheckAndFireTripwireGun( OBJECTTYPE* pObj, INT32 sGridNo, INT8 bLevel, UINT16 ubId, UINT8 ubDirection );
void CheckAndFireTripwireGun( OBJECTTYPE* pObj, INT32 sGridNo, INT8 bLevel, SoldierID ubId, UINT8 ubDirection );
extern void ToggleActionItemsByFrequency( INT8 bFrequency );
extern void PerformItemAction( INT32 sGridNo, OBJECTTYPE * pObj );
@@ -166,15 +166,15 @@ extern void HandleSeeingFortifiedDoor( UINT32 sGridNo );//Ja25 UB
void ExplosiveDamageGridNo( INT32 sGridNo, INT16 sWoundAmt, UINT32 uiDist,
BOOLEAN *pfRecompileMovementCosts,
BOOLEAN fOnlyWalls, INT8 bMultiStructSpecialFlag, BOOLEAN fSubSequentMultiTilesTransitionDamage, UINT16 ubOwner,
BOOLEAN fOnlyWalls, INT8 bMultiStructSpecialFlag, BOOLEAN fSubSequentMultiTilesTransitionDamage, SoldierID ubOwner,
INT8 bLevel,
UINT8 ubReason );
// Flugente: handle secondary explosive effects
void HandleBuddyExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection );
void HandleBuddyExplosions( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection );
// sevenfm: handle explosive items from attachments
BOOLEAN HandleAttachedExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj );
BOOLEAN HandleAttachedExplosions( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj );
void CheckForBuriedBombsAndRemoveFlags( INT32 sGridNo, INT8 bLevel );
UINT16 CalcTotalVolatility(OBJECTTYPE * pObj);
BOOLEAN FindBinderAttachment (OBJECTTYPE * pObj);
+1 -1
View File
@@ -332,7 +332,7 @@ INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT16 ubOwner,
return( iSmokeIndex );
}
INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT16 ubOwner, BOOLEAN fFromRemoteClient, UINT8 ubDuration, UINT8 ubRadius, UINT8 ubGeneration)
INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwner, BOOLEAN fFromRemoteClient, UINT8 ubDuration, UINT8 ubRadius, UINT8 ubGeneration)
{
SMOKEEFFECT *pSmoke;
INT32 iSmokeIndex;
+2 -2
View File
@@ -57,7 +57,7 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT32 sGridNo, INT8
void RemoveSmokeEffectFromTile( INT32 sGridNo, INT8 bLevel );
INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT16 ubOwner, BOOLEAN fFromRemoteClient = 0, UINT8 ubDuration = 0, UINT8 ubRadius = 0, UINT8 ubGeneration = 0);
INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwner, BOOLEAN fFromRemoteClient = 0, UINT8 ubDuration = 0, UINT8 ubRadius = 0, UINT8 ubGeneration = 0);
BOOLEAN SaveSmokeEffectsToSaveGameFile( HWFILE hFile );
BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile );
@@ -77,4 +77,4 @@ BOOLEAN CheckSmokeEffect(INT32 sGridNo, INT8 bLevel, INT8 bType);
// find smoke effect on visible screen
BOOLEAN FindVisibleSmokeEffect(INT8 bType);
#endif
#endif
+50 -50
View File
@@ -38,70 +38,70 @@
typedef struct TAG_anitile
{
struct TAG_anitile *pNext;
UINT32 uiFlags; // flags struct
UINT32 uiTimeLastUpdate; // Stuff for animated tiles
struct TAG_anitile *pNext;
UINT32 uiFlags; // flags struct
UINT32 uiTimeLastUpdate; // Stuff for animated tiles
LEVELNODE *pLevelNode;
UINT8 ubLevelID;
INT16 sCurrentFrame;
INT16 sStartFrame;
INT16 sDelay;
UINT16 usTileType;
UINT16 usNumFrames;
LEVELNODE *pLevelNode;
UINT8 ubLevelID;
INT16 sCurrentFrame;
INT16 sStartFrame;
INT16 sDelay;
UINT16 usTileType;
UINT16 usNumFrames;
UINT16 usMissAnimationPlayed;
UINT16 ubAttackerMissed;
INT16 sRelativeX;
INT16 sRelativeY;
INT16 sRelativeZ;
INT32 sGridNo;
UINT16 usTileIndex;
UINT16 usMissAnimationPlayed;
SoldierID ubAttackerMissed;
INT16 sRelativeX;
INT16 sRelativeY;
INT16 sRelativeZ;
INT32 sGridNo;
UINT16 usTileIndex;
UINT16 usCachedTileSubIndex; // sub Index
INT16 sCachedTileID; // Index into cached tile ID
UINT16 usCachedTileSubIndex; // sub Index
INT16 sCachedTileID; // Index into cached tile ID
UINT8 ubOwner;
UINT8 ubKeyFrame1;
UINT32 uiKeyFrame1Code;
UINT8 ubKeyFrame2;
UINT32 uiKeyFrame2Code;
UINT8 ubOwner;
UINT8 ubKeyFrame1;
UINT32 uiKeyFrame1Code;
UINT8 ubKeyFrame2;
UINT32 uiKeyFrame2Code;
UINT32 uiUserData;
UINT8 ubUserData2;
UINT32 uiUserData3;
UINT32 uiUserData;
UINT8 ubUserData2;
UINT32 uiUserData3;
INT8 bFrameCountAfterStart;
INT32 lightSprite;
INT8 bFrameCountAfterStart;
INT32 lightSprite;
} ANITILE;
typedef struct TAG_anitile_params
{
UINT32 uiFlags; // flags struct
UINT8 ubLevelID; // Level ID for rendering layer
INT16 sStartFrame; // Start frame
INT16 sDelay; // Delay time
UINT16 usTileType; // Tile databse type ( optional )
UINT16 usTileIndex; // Tile database index ( optional )
INT16 sX; // World X ( optional )
INT16 sY; // World Y ( optional )
INT16 sZ; // World Z ( optional )
INT32 sGridNo; // World GridNo
UINT32 uiFlags; // flags struct
UINT8 ubLevelID; // Level ID for rendering layer
INT16 sStartFrame; // Start frame
INT16 sDelay; // Delay time
UINT16 usTileType; // Tile databse type ( optional )
UINT16 usTileIndex; // Tile database index ( optional )
INT16 sX; // World X ( optional )
INT16 sY; // World Y ( optional )
INT16 sZ; // World Z ( optional )
INT32 sGridNo; // World GridNo
LEVELNODE *pGivenLevelNode; // Levelnode for existing tile ( optional )
CHAR8 zCachedFile[ 100 ]; // Filename for cached tile name ( optional )
LEVELNODE *pGivenLevelNode; // Levelnode for existing tile ( optional )
CHAR8 zCachedFile[ 100 ]; // Filename for cached tile name ( optional )
UINT8 ubOwner; // UBID for the owner
UINT8 ubKeyFrame1; // Key frame 1
UINT32 uiKeyFrame1Code; // Key frame code
UINT8 ubKeyFrame2; // Key frame 2
UINT32 uiKeyFrame2Code; // Key frame code
UINT8 ubOwner; // UBID for the owner
UINT8 ubKeyFrame1; // Key frame 1
UINT32 uiKeyFrame1Code; // Key frame code
UINT8 ubKeyFrame2; // Key frame 2
UINT32 uiKeyFrame2Code; // Key frame code
UINT32 uiUserData;
UINT8 ubUserData2;
UINT32 uiUserData3;
INT32 lightSprite;
UINT32 uiUserData;
UINT8 ubUserData2;
UINT32 uiUserData3;
INT32 lightSprite;
} ANITILE_PARAMS;
+1 -1
View File
@@ -1764,7 +1764,7 @@ BOOLEAN StructureDensity( STRUCTURE * pStructure, UINT8 * pubLevel0, UINT8 * pub
return( TRUE );
}
INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT32 sGridNo, INT16 sX, INT16 sY, UINT16 ubOwner, INT32 sAntiMaterialImpact )
INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT32 sGridNo, INT16 sX, INT16 sY, SoldierID ubOwner, INT32 sAntiMaterialImpact )
{
// do damage to a structure; returns TRUE if the structure should be removed
STRUCTURE *pBase;
+1 -1
View File
@@ -91,7 +91,7 @@ STRUCTURE* GetTallestStructureOnGridnoDrag( INT32 sGridNo, INT8 bLevel );
// FUNCTIONS FOR DETERMINING STUFF THAT BLOCKS VIEW FOR TILE_bASED LOS
INT8 GetBlockingStructureInfo( INT32 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLevel, INT8 *pStructHeight, STRUCTURE ** ppTallestStructure, BOOLEAN fWallsBlock );
INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT32 sGridNo, INT16 sX, INT16 sY, UINT16 ubOwner, INT32 sAntiMaterialImpact = 0 );
INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT32 sGridNo, INT16 sX, INT16 sY, SoldierID ubOwner, INT32 sAntiMaterialImpact = 0 );
// Material armour type enumeration
enum