Skip to content

Commit

Permalink
better hedgehog moves for AI
Browse files Browse the repository at this point in the history
  • Loading branch information
ilteroi authored and RecursiveVision committed Dec 15, 2023
1 parent c12b085 commit a325bea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions CvGameCoreDLL_Expansion2/CvTacticalAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2035,10 +2035,10 @@ void CvTacticalAI::PlotHedgehogMoves(CvTacticalDominanceZone* pZone)
{
ClearCurrentMoveUnits(AI_TACTICAL_HEDGEHOG);

// Attack priority unit targets
ExecuteDestroyUnitMoves(AI_TACTICAL_TARGET_HIGH_PRIORITY_UNIT, true);
ExecuteDestroyUnitMoves(AI_TACTICAL_TARGET_MEDIUM_PRIORITY_UNIT, true);
ExecuteDestroyUnitMoves(AI_TACTICAL_TARGET_LOW_PRIORITY_UNIT, true);
// Be careful with our units, we don't have so many
ExecuteDestroyUnitMoves(AI_TACTICAL_TARGET_HIGH_PRIORITY_UNIT, false, AL_LOW);
ExecuteDestroyUnitMoves(AI_TACTICAL_TARGET_MEDIUM_PRIORITY_UNIT, false, AL_LOW);
ExecuteDestroyUnitMoves(AI_TACTICAL_TARGET_LOW_PRIORITY_UNIT, false, AL_LOW);

// exception : early reinforcement before attacks in other zones are considered
PlotReinforcementMoves(pZone);
Expand Down
2 changes: 1 addition & 1 deletion CvGameCoreDLL_Expansion2/CvTacticalAnalysisMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ eTacticalPosture CvTacticalDominanceZone::SelectPostureSingleZone(int iDominance
}
case TACTICAL_TERRITORY_FRIENDLY:
{
m_ePosture = TACTICAL_POSTURE_COUNTERATTACK;
m_ePosture = (eOverallDominance == TACTICAL_DOMINANCE_ENEMY) ? TACTICAL_POSTURE_HEDGEHOG : TACTICAL_POSTURE_COUNTERATTACK;
break;
}
}
Expand Down
3 changes: 3 additions & 0 deletions CvGameCoreDLL_Expansion2/NatvisFile.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
</Type>

<Type Name="CvUnit">
<DisplayString Condition="m_pUnitInfo->m_iDomainType==0">(id {m_iID}, C{m_iBaseCombat}R{m_iBaseRangedCombat}, M{m_iMoves}, P{m_eOwner}, at {m_iX}:{m_iY} SEA)</DisplayString>
<DisplayString Condition="m_pUnitInfo->m_iDomainType==1">(id {m_iID}, C{m_iBaseCombat}R{m_iBaseRangedCombat}, M{m_iMoves}, P{m_eOwner}, at {m_iX}:{m_iY} AIR)</DisplayString>
<DisplayString Condition="m_pUnitInfo->m_iDomainType==2">(id {m_iID}, C{m_iBaseCombat}R{m_iBaseRangedCombat}, M{m_iMoves}, P{m_eOwner}, at {m_iX}:{m_iY} LAND)</DisplayString>
<DisplayString>(id {m_iID}, C{m_iBaseCombat}R{m_iBaseRangedCombat}, M{m_iMoves}, P{m_eOwner}, at {m_iX}:{m_iY})</DisplayString>
<Expand>
<Item Name="m_iID">m_iID</Item>
Expand Down

0 comments on commit a325bea

Please sign in to comment.