Skip to content

Commit

Permalink
Fix an issue where undead tried to build a high level base but isn't …
Browse files Browse the repository at this point in the history
…yet at tier to do so #453
  • Loading branch information
SMUnlimited committed Dec 1, 2024
1 parent 94fe250 commit ce3f4f2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- This also helps protect all races from building initial base buildings at the wrong mine.
- Fixed issue where harvested mines is calculated incorrectly for humans and orcs for various use cases.
- Small fix so that ai does not retreat from creeps sleeping or are not fully engaged.
- Fixed an issue where undead would try and tier up due to base defense instead of tiering up through the strategy.
- Multiple mine control fixes (jzy-chitong56)
- Fixed 4th mine chance was evaluated incorrectly. (jzy-chitong56)
- (Classic) Include missing hero harass attacks that are applicable from reforged scripts.
Expand Down
7 changes: 5 additions & 2 deletions REFORGED/Undead/BuildSequence.ai
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ function global_build_sequence takes nothing returns nothing
call BuildUnit(1, ZIGGURAT_2, 45)
call BuildUnit(1, ZIGGURAT_FROST, 40)
if GetGold() > 2000 then
call DefendTownsDone(1, NECROPOLIS_1, 95)
call DefendTownsDone(3, ZIGGURAT_2, 90)
call DefendTownsDone(1, ZIGGURAT_FROST, 50)
call DefendTownsCond(1, ZIGGURAT_FROST, 0, 8000, 0, 80)
call DefendTownsCond(1, NECROPOLIS_2, 7600, 99999, 0, 90)
if tier >= 2 then
call DefendTownsCond(1, NECROPOLIS_2, 7600, 99999, 0, 90)
elseif tier >= 1 then
call DefendTownsDone(1, NECROPOLIS_1, 95)
endif
if TownCount(ZIGGURAT_2) >= 2 and TownCount(TOMB_OF_RELICS) < 2 then
call DefendTownsDone(1, TOMB_OF_RELICS, 40)
endif
Expand Down
4 changes: 3 additions & 1 deletion ROC/Undead/BuildSequence.ai
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ endfunction
function global_build_sequence takes nothing returns nothing

call DefendTownsDone(2, ZIGGURAT_2, 65)
call DefendTownsDone(1, NECROPOLIS_2, 70)
if tier >= 2 then
call DefendTownsDone(1, NECROPOLIS_2, 70)
endif

call BuildUnit(3, ZIGGURAT_2, 30)

Expand Down
7 changes: 5 additions & 2 deletions TFT/Undead/BuildSequence.ai
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ function global_build_sequence takes nothing returns nothing
call BuildUnit(1, ZIGGURAT_2, 45)
call BuildUnit(1, ZIGGURAT_FROST, 40)
if GetGold() > 2000 then
call DefendTownsDone(1, NECROPOLIS_1, 95)
call DefendTownsDone(3, ZIGGURAT_2, 90)
call DefendTownsDone(1, ZIGGURAT_FROST, 50)
call DefendTownsCond(1, ZIGGURAT_FROST, 0, 8000, 0, 80)
call DefendTownsCond(1, NECROPOLIS_2, 7600, 99999, 0, 90)
if tier >= 2 then
call DefendTownsCond(1, NECROPOLIS_2, 7600, 99999, 0, 90)
elseif tier >= 1 then
call DefendTownsDone(1, NECROPOLIS_1, 95)
endif
if TownCount(ZIGGURAT_2) >= 2 and TownCount(TOMB_OF_RELICS) < 2 then
call DefendTownsDone(1, TOMB_OF_RELICS, 40)
endif
Expand Down
5 changes: 3 additions & 2 deletions common.eai
Original file line number Diff line number Diff line change
Expand Up @@ -10183,10 +10183,11 @@ function DefendTownsEx takes boolean only_done, boolean at_front, integer qty, i
local integer i = twm
//call Trace("DefendTownsEx TownWithMine:" + Int2Str(twm))
if not at_front then
set twm = Max(twm, 1) // Home town is town 0
set twm = Max(twm, 1) // Home town is town 0 and exclude if at_front is not set
else
set twm = Max(twm, 0)
endif
endif
set i = twm
loop
exitwhen i > twm + 2
if TownHasMine(i) and TownCountEx(racial_expansion,only_done,i) > 0 then
Expand Down

0 comments on commit ce3f4f2

Please sign in to comment.