mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Focus skill: no watched location interrupt bonus if focus is active.
Improved data initialization. Smart tree top hiding: increased max distance to hide tree in vertical direction. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8950 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+1
-14
@@ -2913,20 +2913,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sevenfm: initialize other SOLDIERTYPE data
|
// sevenfm: initialize other SOLDIERTYPE data
|
||||||
this->ubLastShock=0;
|
this->InitializeExtraData();
|
||||||
this->ubLastSuppression=0;
|
|
||||||
this->ubLastAP=0;
|
|
||||||
this->ubLastMorale=0;
|
|
||||||
this->ubLastShockFromHit=0;
|
|
||||||
this->ubLastAPFromHit=0;
|
|
||||||
this->ubLastMoraleFromHit=0;
|
|
||||||
this->iLastBulletImpact = 0;
|
|
||||||
this->iLastArmourProtection = 0;
|
|
||||||
|
|
||||||
this->usQuickItemId = 0;
|
|
||||||
this->ubQuickItemSlot = 0;
|
|
||||||
|
|
||||||
this->usGrenadeItem = 0;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1073,20 +1073,7 @@ SOLDIERTYPE& SOLDIERTYPE::operator=(const OLDSOLDIERTYPE_101& src)
|
|||||||
for ( UINT8 i = 0; i < SOLDIER_COUNTER_MAX; ++i ) this->usSkillCounter[i] = 0;
|
for ( UINT8 i = 0; i < SOLDIER_COUNTER_MAX; ++i ) this->usSkillCounter[i] = 0;
|
||||||
for ( UINT8 i = 0; i < SOLDIER_COOLDOWN_MAX; ++i ) this->usSkillCooldown[i] = 0;
|
for ( UINT8 i = 0; i < SOLDIER_COOLDOWN_MAX; ++i ) this->usSkillCooldown[i] = 0;
|
||||||
|
|
||||||
this->ubLastShock = 0;
|
this->InitializeExtraData();
|
||||||
this->ubLastSuppression = 0;
|
|
||||||
this->ubLastAP = 0;
|
|
||||||
this->ubLastMorale = 0;
|
|
||||||
this->ubLastShockFromHit = 0;
|
|
||||||
this->ubLastMoraleFromHit = 0;
|
|
||||||
this->ubLastAPFromHit = 0;
|
|
||||||
this->iLastBulletImpact = 0;
|
|
||||||
this->iLastArmourProtection = 0;
|
|
||||||
|
|
||||||
this->usQuickItemId = 0;
|
|
||||||
this->ubQuickItemSlot = 0;
|
|
||||||
|
|
||||||
this->usGrenadeItem = 0;
|
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -1150,19 +1137,7 @@ void SOLDIERTYPE::initialize( )
|
|||||||
memset( &pathing, 0, sizeof(STRUCT_Pathing) );
|
memset( &pathing, 0, sizeof(STRUCT_Pathing) );
|
||||||
|
|
||||||
// sevenfm:initialize additional data
|
// sevenfm:initialize additional data
|
||||||
this->ubLastShock = 0;
|
this->InitializeExtraData();
|
||||||
this->ubLastSuppression = 0;
|
|
||||||
this->ubLastAP = 0;
|
|
||||||
this->ubLastMorale = 0;
|
|
||||||
this->ubLastShockFromHit = 0;
|
|
||||||
this->ubLastMoraleFromHit = 0;
|
|
||||||
this->ubLastAPFromHit = 0;
|
|
||||||
this->iLastBulletImpact = 0;
|
|
||||||
this->iLastArmourProtection = 0;
|
|
||||||
this->usQuickItemId = 0;
|
|
||||||
this->ubQuickItemSlot = 0;
|
|
||||||
this->usDisabilityFlagMask = 0;
|
|
||||||
this->sDragGridNo = NOWHERE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SOLDIERTYPE::exists( )
|
bool SOLDIERTYPE::exists( )
|
||||||
@@ -26013,3 +25988,21 @@ void SOLDIERTYPE::StartRadioAnimation(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SOLDIERTYPE::InitializeExtraData(void)
|
||||||
|
{
|
||||||
|
this->ubLastShock = 0;
|
||||||
|
this->ubLastSuppression = 0;
|
||||||
|
this->ubLastAP = 0;
|
||||||
|
this->ubLastMorale = 0;
|
||||||
|
this->ubLastShockFromHit = 0;
|
||||||
|
this->ubLastMoraleFromHit = 0;
|
||||||
|
this->ubLastAPFromHit = 0;
|
||||||
|
this->iLastBulletImpact = 0;
|
||||||
|
this->iLastArmourProtection = 0;
|
||||||
|
|
||||||
|
this->usQuickItemId = 0;
|
||||||
|
this->ubQuickItemSlot = 0;
|
||||||
|
|
||||||
|
this->usGrenadeItem = 0;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1878,6 +1878,8 @@ public:
|
|||||||
|
|
||||||
void StartRadioAnimation(void);
|
void StartRadioAnimation(void);
|
||||||
|
|
||||||
|
void InitializeExtraData(void);
|
||||||
|
|
||||||
// Flugente: prisoner system
|
// Flugente: prisoner system
|
||||||
BOOLEAN CanProcessPrisoners();
|
BOOLEAN CanProcessPrisoners();
|
||||||
UINT32 GetSurrenderStrength();
|
UINT32 GetSurrenderStrength();
|
||||||
|
|||||||
@@ -2118,20 +2118,10 @@ void InitSoldierStruct( SOLDIERTYPE *pSoldier )
|
|||||||
pSoldier->usChatPartnerID = NOBODY;
|
pSoldier->usChatPartnerID = NOBODY;
|
||||||
|
|
||||||
// sevenfm: initialize additional data
|
// sevenfm: initialize additional data
|
||||||
pSoldier->ubLastShock = 0;
|
pSoldier->InitializeExtraData();
|
||||||
pSoldier->ubLastSuppression = 0;
|
|
||||||
pSoldier->ubLastAP = 0;
|
|
||||||
pSoldier->ubLastMorale = 0;
|
|
||||||
pSoldier->ubLastShockFromHit = 0;
|
|
||||||
pSoldier->ubLastMoraleFromHit = 0;
|
|
||||||
pSoldier->ubLastAPFromHit = 0;
|
|
||||||
pSoldier->iLastBulletImpact = 0;
|
|
||||||
pSoldier->iLastArmourProtection = 0;
|
|
||||||
|
|
||||||
pSoldier->usQuickItemId = 0;
|
pSoldier->sDragGridNo = NOWHERE;
|
||||||
pSoldier->ubQuickItemSlot = 0;
|
pSoldier->sFocusGridNo = NOWHERE;
|
||||||
|
|
||||||
pSoldier->usGrenadeItem = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1804,6 +1804,9 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f
|
|||||||
UINT8 ubDistance;
|
UINT8 ubDistance;
|
||||||
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"CalcInterruptDuelPts");
|
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"CalcInterruptDuelPts");
|
||||||
|
|
||||||
|
// sevenfm: safety check
|
||||||
|
Assert(pSoldier);
|
||||||
|
|
||||||
// extra check to make sure neutral folks never get interrupts
|
// extra check to make sure neutral folks never get interrupts
|
||||||
if (pSoldier->aiData.bNeutral)
|
if (pSoldier->aiData.bNeutral)
|
||||||
{
|
{
|
||||||
@@ -1846,7 +1849,8 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fUseWatchSpots)
|
// sevenfm: no watch spot bonus when focusing
|
||||||
|
if (fUseWatchSpots && !(pSoldier->usSoldierFlagMask2 & SOLDIER_TRAIT_FOCUS))
|
||||||
{
|
{
|
||||||
// if this is a previously noted spot of enemies, give bonus points!
|
// if this is a previously noted spot of enemies, give bonus points!
|
||||||
iPoints += GetWatchedLocPoints( pSoldier->ubID, MercPtrs[ ubOpponentID ]->sGridNo, MercPtrs[ ubOpponentID ]->pathing.bLevel );
|
iPoints += GetWatchedLocPoints( pSoldier->ubID, MercPtrs[ ubOpponentID ]->sGridNo, MercPtrs[ ubOpponentID ]->pathing.bLevel );
|
||||||
|
|||||||
@@ -4112,7 +4112,7 @@ void UpdateTreeVisibility()
|
|||||||
// check trees near cursor position
|
// check trees near cursor position
|
||||||
if (!TileIsOutOfBounds(usMouseSpot) &&
|
if (!TileIsOutOfBounds(usMouseSpot) &&
|
||||||
(PythSpacesAway(sSpot, usMouseSpot) <= 2 && AIDirection(sSpot, usMouseSpot) == 0 ||
|
(PythSpacesAway(sSpot, usMouseSpot) <= 2 && AIDirection(sSpot, usMouseSpot) == 0 ||
|
||||||
PythSpacesAway(sSpot, usMouseSpot) <= 5 && AIDirection(sSpot, usMouseSpot) == 7 ||
|
PythSpacesAway(sSpot, usMouseSpot) <= 6 && AIDirection(sSpot, usMouseSpot) == 7 ||
|
||||||
PythSpacesAway(sSpot, usMouseSpot) <= 2 && AIDirection(sSpot, usMouseSpot) == 6))
|
PythSpacesAway(sSpot, usMouseSpot) <= 2 && AIDirection(sSpot, usMouseSpot) == 6))
|
||||||
{
|
{
|
||||||
fHideTree = TRUE;
|
fHideTree = TRUE;
|
||||||
@@ -4129,7 +4129,7 @@ void UpdateTreeVisibility()
|
|||||||
pOpponent->bVisible != -1 &&
|
pOpponent->bVisible != -1 &&
|
||||||
!TileIsOutOfBounds(pOpponent->sGridNo) &&
|
!TileIsOutOfBounds(pOpponent->sGridNo) &&
|
||||||
(PythSpacesAway(sSpot, pOpponent->sGridNo) <= 2 && AIDirection(sSpot, pOpponent->sGridNo) == 0 ||
|
(PythSpacesAway(sSpot, pOpponent->sGridNo) <= 2 && AIDirection(sSpot, pOpponent->sGridNo) == 0 ||
|
||||||
PythSpacesAway(sSpot, pOpponent->sGridNo) <= 5 && AIDirection(sSpot, pOpponent->sGridNo) == 7 ||
|
PythSpacesAway(sSpot, pOpponent->sGridNo) <= 6 && AIDirection(sSpot, pOpponent->sGridNo) == 7 ||
|
||||||
PythSpacesAway(sSpot, pOpponent->sGridNo) <= 2 && AIDirection(sSpot, pOpponent->sGridNo) == 6))
|
PythSpacesAway(sSpot, pOpponent->sGridNo) <= 2 && AIDirection(sSpot, pOpponent->sGridNo) == 6))
|
||||||
{
|
{
|
||||||
fHideTree = TRUE;
|
fHideTree = TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user