mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Removed old zombie AI code.
Improved AI path tweaks: - tanks prefer moving in straight directions to avoid sliding effect - combat jeeps prefer moving on roads (PAVED_ROAD, DIRT_ROAD) - armed vehicles avoid moving into buildings (FLAT_FLOOR) - increased value to avoid light and corpses for enemy soldiers git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8770 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+32
-25
@@ -3851,37 +3851,44 @@ if(!GridNoOnVisibleWorldTile(iDestination))
|
|||||||
nextCost += 50;
|
nextCost += 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sevenfm: tanks prefer moving in straight directions to avoid sliding effect
|
if (gGameExternalOptions.fAIPathTweaks && s->bTeam != gbPlayerNum)
|
||||||
if (gGameExternalOptions.fAIPathTweaks &&
|
|
||||||
TANK(s) &&
|
|
||||||
(iCnt & 1))
|
|
||||||
{
|
{
|
||||||
nextCost += 50;
|
// tanks prefer moving in straight directions to avoid sliding effect
|
||||||
}
|
if (TANK(s) && (iCnt & 1))
|
||||||
|
|
||||||
// sevenfm: experimental path tweaks for AI
|
|
||||||
if (gGameExternalOptions.fAIPathTweaks &&
|
|
||||||
s->bTeam != gbPlayerNum &&
|
|
||||||
!(s->flags.uiStatusFlags & SOLDIER_BOXER) &&
|
|
||||||
!AreInMeanwhile() &&
|
|
||||||
IS_MERC_BODY_TYPE(s))
|
|
||||||
{
|
|
||||||
if (InGasSpot(s, newLoc, bLevel))
|
|
||||||
{
|
{
|
||||||
nextCost += 40;
|
nextCost += 50;
|
||||||
}
|
}
|
||||||
else if (DeepWater(newLoc, bLevel) && (s->numFlanks == 0 || s->numFlanks >= MAX_FLANKS_RED))
|
|
||||||
|
// combat jeeps prefer moving on roads
|
||||||
|
UINT8 ubTerrainType = GetTerrainTypeForGrid(newLoc, bLevel);
|
||||||
|
if (COMBAT_JEEP(s) && ubTerrainType != PAVED_ROAD && ubTerrainType != DIRT_ROAD)
|
||||||
{
|
{
|
||||||
nextCost += 20;
|
nextCost += 20;
|
||||||
}
|
}
|
||||||
else if (s->bTeam == ENEMY_TEAM &&
|
|
||||||
|
// armed vehicles avoid moving into buildings
|
||||||
|
if (ARMED_VEHICLE(s) && ubTerrainType == FLAT_FLOOR)
|
||||||
|
{
|
||||||
|
nextCost += 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
// experimental path tweaks for AI
|
||||||
|
if (IS_MERC_BODY_TYPE(s))
|
||||||
|
{
|
||||||
|
if (InGasSpot(s, newLoc, bLevel))
|
||||||
|
{
|
||||||
|
nextCost += 40;
|
||||||
|
}
|
||||||
|
else if (DeepWater(newLoc, bLevel) && (s->numFlanks == 0 || s->numFlanks >= MAX_FLANKS_RED))
|
||||||
|
{
|
||||||
|
nextCost += 20;
|
||||||
|
}
|
||||||
|
else if (s->bTeam == ENEMY_TEAM &&
|
||||||
s->aiData.bAlertStatus >= STATUS_RED &&
|
s->aiData.bAlertStatus >= STATUS_RED &&
|
||||||
(InLightAtNight(newLoc, bLevel) || GetNearestRottingCorpseAIWarning(newLoc) > 0))
|
(InLightAtNight(newLoc, bLevel) || GetNearestRottingCorpseAIWarning(newLoc) > 0))
|
||||||
{
|
{
|
||||||
if (s->aiData.bAttitude == CUNNINGSOLO || s->aiData.bAttitude == CUNNINGAID || s->aiData.bAIMorale < MORALE_FEARLESS)
|
|
||||||
nextCost += 20;
|
nextCost += 20;
|
||||||
else
|
}
|
||||||
nextCost += 10;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4769,12 +4776,12 @@ INT32 PlotPath( SOLDIERTYPE *pSold, INT32 sDestGridNo, INT8 bCopyRoute, INT8 bPl
|
|||||||
sMovementAPsCost += GetAPsToOpenDoor( pSold ) + GetAPsToOpenDoor( pSold ); // Include open and close costs!
|
sMovementAPsCost += GetAPsToOpenDoor( pSold ) + GetAPsToOpenDoor( pSold ); // Include open and close costs!
|
||||||
}
|
}
|
||||||
// Check for stealth mode
|
// Check for stealth mode
|
||||||
if ( pSold->bStealthMode || bStealth )
|
if (pSold->bStealthMode || bStealth)
|
||||||
{
|
{
|
||||||
// STOMP traits - Stealthy trait decreases stealth AP modifier
|
// STOMP traits - Stealthy trait decreases stealth AP modifier
|
||||||
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSold, STEALTHY_NT ))
|
if (gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT(pSold, STEALTHY_NT))
|
||||||
{
|
{
|
||||||
sMovementAPsCost += max(0, (APBPConstants[AP_STEALTH_MODIFIER] * (100 - gSkillTraitValues.ubSTStealthModeSpeedBonus) / 100.0f) );
|
sMovementAPsCost += max(0.0f, (APBPConstants[AP_STEALTH_MODIFIER] * (100.0f - gSkillTraitValues.ubSTStealthModeSpeedBonus) / 100.0f));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user