mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +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:
+21
-14
@@ -3851,20 +3851,29 @@ 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) &&
|
// tanks prefer moving in straight directions to avoid sliding effect
|
||||||
(iCnt & 1))
|
if (TANK(s) && (iCnt & 1))
|
||||||
{
|
{
|
||||||
nextCost += 50;
|
nextCost += 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sevenfm: experimental path tweaks for AI
|
// combat jeeps prefer moving on roads
|
||||||
if (gGameExternalOptions.fAIPathTweaks &&
|
UINT8 ubTerrainType = GetTerrainTypeForGrid(newLoc, bLevel);
|
||||||
s->bTeam != gbPlayerNum &&
|
if (COMBAT_JEEP(s) && ubTerrainType != PAVED_ROAD && ubTerrainType != DIRT_ROAD)
|
||||||
!(s->flags.uiStatusFlags & SOLDIER_BOXER) &&
|
{
|
||||||
!AreInMeanwhile() &&
|
nextCost += 20;
|
||||||
IS_MERC_BODY_TYPE(s))
|
}
|
||||||
|
|
||||||
|
// 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))
|
if (InGasSpot(s, newLoc, bLevel))
|
||||||
{
|
{
|
||||||
@@ -3878,10 +3887,8 @@ if(!GridNoOnVisibleWorldTile(iDestination))
|
|||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4774,7 +4781,7 @@ INT32 PlotPath( SOLDIERTYPE *pSold, INT32 sDestGridNo, INT8 bCopyRoute, INT8 bPl
|
|||||||
// 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