Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TR #214

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open

TR #214

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
4eac530
4.0.0.908
jzy-chitong56 Jan 3, 2024
ba7bf9e
TR and Skills fix
jzy-chitong56 Jan 3, 2024
548a310
TR and Skills fix
jzy-chitong56 Jan 3, 2024
2eebee3
TR and Skills fix
jzy-chitong56 Jan 3, 2024
92e3324
TR
jzy-chitong56 Jan 3, 2024
c74e747
TR
jzy-chitong56 Jan 3, 2024
00c9127
TR
jzy-chitong56 Jan 3, 2024
ee95f95
TR and fix DETECT_DEFEAT
jzy-chitong56 Jan 3, 2024
d691478
TR
jzy-chitong56 Jan 3, 2024
18cdc55
fix later stages of the game harvest
jzy-chitong56 Jan 6, 2024
d17aa35
fix later stages of the game harvest
jzy-chitong56 Jan 6, 2024
d9cf4be
fix Forced Harvest
jzy-chitong56 Jan 7, 2024
791536b
fix GetNearestEnemyDistance check when c_enemy_user_total is 0
jzy-chitong56 Jan 14, 2024
5b2e5c5
Add files via upload
jzy-chitong56 Jan 23, 2024
208b5a1
fix TR FAIL TO START
jzy-chitong56 Jan 27, 2024
f23bc05
fix lastcaptain
jzy-chitong56 Feb 18, 2024
d78fd63
Reduce TR's TP threshold
jzy-chitong56 Feb 18, 2024
48a27c7
Update common.eai
jzy-chitong56 Feb 18, 2024
413f264
use job sys path wait
jzy-chitong56 Feb 22, 2024
c843f23
use job sys path wait
jzy-chitong56 Feb 22, 2024
9ad9250
fix TR cannot start
jzy-chitong56 Feb 23, 2024
c288d5c
Improve closure judgment
jzy-chitong56 Feb 24, 2024
f1b745f
Prevent TR from continuously training elementary unit
jzy-chitong56 Feb 25, 2024
813d1e9
let ELF tower move too closer
jzy-chitong56 Feb 25, 2024
05e6ae5
fix
jzy-chitong56 Feb 25, 2024
02a9d1c
TR can buy item , even if attack_running
jzy-chitong56 Mar 1, 2024
1cf83e2
fix TR buy item not check buy_type is BT_RACIAL_ITEM
jzy-chitong56 Mar 1, 2024
7262bda
fix peon
jzy-chitong56 Mar 1, 2024
7f21e8a
fix
jzy-chitong56 Mar 1, 2024
c921db0
fix set ally target
jzy-chitong56 Mar 2, 2024
ae636a3
Update common.eai
jzy-chitong56 Mar 2, 2024
a7ab1e1
add peon loc
jzy-chitong56 Mar 4, 2024
8582132
fix TR ATTACK
jzy-chitong56 Mar 4, 2024
15246dd
fix
jzy-chitong56 Mar 4, 2024
402b251
up to 3.3.3a
jzy-chitong56 Mar 4, 2024
e5d03e6
fix
jzy-chitong56 Mar 4, 2024
b8fde27
Update BuildSequence.ai
jzy-chitong56 Mar 4, 2024
53f1102
Update BuildSequence.ai
jzy-chitong56 Mar 4, 2024
45d67b9
fix
jzy-chitong56 Mar 4, 2024
aa0f935
Update common.eai
jzy-chitong56 Mar 4, 2024
aafde93
fix not Recycle hero Guard Position
jzy-chitong56 Mar 5, 2024
7c035b2
fix Recycle hero Guard Position
jzy-chitong56 Mar 6, 2024
29477d9
add Recycle Guard
jzy-chitong56 Mar 7, 2024
691da06
fix
jzy-chitong56 Mar 8, 2024
ed82ada
fix
jzy-chitong56 Mar 8, 2024
91d2600
Update NEUTRAL_GUARDED.eai
jzy-chitong56 Mar 8, 2024
f231880
fix
jzy-chitong56 Mar 8, 2024
043f8d8
up 3.3.3a
jzy-chitong56 Mar 8, 2024
24f02ef
Update custom_common.eai
jzy-chitong56 Mar 8, 2024
24d3551
Add files via upload
jzy-chitong56 Mar 10, 2024
e32c218
Add files via upload
jzy-chitong56 Mar 10, 2024
acabb99
Update BUILD_EXPANSION.eai
jzy-chitong56 Mar 10, 2024
515cda3
fix peon some bug
jzy-chitong56 Mar 11, 2024
6685956
Update TR attack
jzy-chitong56 Mar 12, 2024
bfcbc44
Update TR attack
jzy-chitong56 Mar 12, 2024
ba5ee9f
fix
jzy-chitong56 Mar 20, 2024
447f716
FIX TR attack
jzy-chitong56 Apr 6, 2024
16da979
Update common.eai
jzy-chitong56 Apr 7, 2024
fe1043f
Update common.eai
jzy-chitong56 Apr 7, 2024
b284633
down race_towerrush_probability
jzy-chitong56 Apr 7, 2024
db02970
down race_towerrush_probability
jzy-chitong56 Apr 7, 2024
1b4c4e1
down race_towerrush_probability
jzy-chitong56 Apr 7, 2024
bc65837
down race_towerrush_probability
jzy-chitong56 Apr 7, 2024
c7de256
down race_towerrush_probability
jzy-chitong56 Apr 7, 2024
3efeb00
down race_towerrush_probability
jzy-chitong56 Apr 7, 2024
ba1ee8b
down race_towerrush_probability
jzy-chitong56 Apr 7, 2024
5fcc258
down race_towerrush_probability
jzy-chitong56 Apr 7, 2024
9e25537
Optimize code
jzy-chitong56 Apr 7, 2024
aa6e02a
4.0.0.918 en x64
jzy-chitong56 Jun 3, 2024
b21df8c
Update TOWER_RUSH.eai
jzy-chitong56 Jun 3, 2024
062d624
Update TOWER_RUSH_CHECK.eai
jzy-chitong56 Jun 3, 2024
2731ec0
TR can EXP mine
jzy-chitong56 Jun 3, 2024
da20e5d
4.0.0.921 en x64
jzy-chitong56 Jun 18, 2024
3a52424
recovery TR build
jzy-chitong56 Jun 19, 2024
353946b
fix
jzy-chitong56 Jun 27, 2024
c7d83bc
fix
jzy-chitong56 Jun 27, 2024
21827b6
fix TR attack
jzy-chitong56 Jun 29, 2024
f816b7d
fix GetLocationEnemyStrength
jzy-chitong56 Jul 4, 2024
1e69fc3
fix GetLocationEnemyStrength
jzy-chitong56 Jul 4, 2024
67e4956
fix GetLocationEnemyStrength
jzy-chitong56 Jul 4, 2024
73edb62
fix TR break_attack
jzy-chitong56 Jul 20, 2024
660fb17
fix GetLocationEnemyStrength
jzy-chitong56 Jul 21, 2024
684701e
fix GetLocationEnemyStrength
jzy-chitong56 Jul 21, 2024
708f2e5
fix GetLocationEnemyStrength
jzy-chitong56 Jul 21, 2024
862a199
FIX TR GetExpFoe current_expansion_creeps error
jzy-chitong56 Aug 16, 2024
804e861
fix
jzy-chitong56 Aug 17, 2024
f8e7fd1
fix attack
jzy-chitong56 Sep 6, 2024
c1ddbe6
fix attack
jzy-chitong56 Sep 6, 2024
6a50eed
check most_threatened_town > 0
jzy-chitong56 Sep 9, 2024
5aa3f80
break_attack no check teleporting
jzy-chitong56 Oct 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ BUILD FARMS 24 -4 -1 -1 Build 66 Farms 70 # 0 I will build farms now.
BUILD TOWERS 25 -4 -1 -1 Build 66 Towers 84 # 0 I will build towers now.
ATTACK HERE 13 0 -30 -31 Attack/Guard 65 Current screen 67 0 I will Attack/Guard the location of current screen position.
ATTACK SELECT 16 -40 -1 -1 Attack/Guard 65 Selected unit 83 0 I will Attack/Guard the currently selected unit.
ATTACK TOWERRUSH 17 -1 -1 -1 Attack/Guard 65 Towerrush (Orc only) 84 0
ATTACK TOWERRUSH 17 -1 -1 -1 Attack/Guard 65 Towerrush 84 0 I will prepare to execute command towerrush.
ATTACK 12 -103 -1 -1 Attack/Guard 65 Enemy 69 e 0 I will Attack/Guard the specified player.
START 33 -1 -1 -1 Queue 81 Start/Restart 83 0 I have Started or Restarted your Queued commands.
RESTART 33 -1 -1 -1 0 0 0 I have Started or Restarted your Queued commands.
Expand Down
4 changes: 2 additions & 2 deletions Jobs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ ARMY_TRACK 30 ArmyTrackJob() false 50 60
TOWN_TRACK 15 TownTrackJob() true 50 60
MILITIA_CHECK 10 MilitiaCheckJob() race_militia_available 80 90
TOWER_RUSH 10 TowerRushJob() false 0 0
TOWER_RUSH_CHECK 30 TowerRushCheck() race_towerrush_available 0 10
TOWER_RUSH_CHECK 30 TowerRushCheck(par) false 0 10
ANCIENT_EXPANSION 6 AncientExpansionJob() false 0 0
ANCIENT_EXPANSION_CHECK 30 AncientExpansionCheck() race_ancient_expansion_available 10 20
CHAT_VARS 15 ChatVarsJob() true 1 2
SELL_ZIGGURATS 4 SellZigguratJob() race_sell_ziggurats 300 400
FOCUSFIRE_CONTROL 10 FocusFireJob() true 40 60
MOON_WELL_CONTROL 20 MoonWellJob(unit_par, par) false 0 0
FAST_BUILD 10 FastBuild() race_has_power_build 10 20
MILITIA_EXPAND 10 TryMilitiaExpansionFoot() militia 40 50
MILITIA_EXPAND 10 TryMilitiaExpansionFoot() race_militia_expansion_available 40 50
SEND_HOME 20 SendUnitHomeJob(unit_par, par) false 0 0
RESET_WINDWALKER 9 ResetWindWalkerGuardPosition(unit_par) false 0 0
BUILD_EXPANSION 10 BuildExpansionJob(unit_par) false 0 0
Expand Down
64 changes: 32 additions & 32 deletions Jobs/BUILD_EXPANSION.eai
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
#IFDEF GLOBAL
#ELSE


// Extra prevention against AMAI building two townhalls at the same location
// GetotherExpansionNearby dosn't yet detect haunted mines so they are still the exception
function BuildExpansionJob takes unit u returns nothing
local unit v = null
local player p = null
if UnitAlive(u) == false then
return
endif
set v = GetOtherExpansionNearby(v,GetUnitX(current_expansion), GetUnitY(current_expansion))
if v != null then
set p = GetOwningPlayer(v)
if IsPlayerEnemy(ai_player, p) then
call Trace("Cancelling Expansion - Enemy double expansion detected")
call IssueImmediateOrder(u, "stop")
elseif IsPlayerAlly(ai_player, p) and GetTotalClaimedMinesNearby(v, GetUnitX(u), GetUnitY(u)) >= GetTotalMinesNearby(v, GetUnitX(u), GetUnitY(u)) then
call Trace("Cancelling Expansion - Enemy ally expansion detected")
call IssueImmediateOrder(u, "stop")
endif
set v = null
return
endif
if DistanceBetweenUnits(u, current_expansion) > race_max_expa_mine_distance then
call TQAddUnitJob(2 * sleep_multiplier, BUILD_EXPANSION, 0, u)
endif

endfunction

#ENDIF
#IFDEF GLOBAL
#ELSE
// Extra prevention against AMAI building two townhalls at the same location
// GetotherExpansionNearby dosn't yet detect haunted mines so they are still the exception
function BuildExpansionJob takes unit u returns nothing
local unit v = null
local player p = null
if UnitAlive(u) == false then
return
endif
set v = GetOtherExpansionNearby(v,GetUnitX(current_expansion), GetUnitY(current_expansion))
if v != null then
set p = GetOwningPlayer(v)
if IsPlayerEnemy(ai_player, p) then
call Trace("Cancelling Expansion - Enemy double expansion detected")
call IssueImmediateOrder(u, "stop")
elseif IsPlayerAlly(ai_player, p) and GetTotalClaimedMinesNearby(v, GetUnitX(u), GetUnitY(u)) >= GetTotalMinesNearby(v, GetUnitX(u), GetUnitY(u)) then
call Trace("Cancelling Expansion - Enemy ally expansion detected")
call IssueImmediateOrder(u, "stop")
endif
set v = null
return
endif
if DistanceBetweenUnits(u, current_expansion) > race_max_expa_mine_distance then
call TQAddUnitJob(2 * sleep_multiplier, BUILD_EXPANSION, 0, u)
endif
endfunction
#ENDIF
6 changes: 4 additions & 2 deletions Jobs/DETECT_DEFEAT.eai
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function SaveYourself takes nothing returns boolean
set ancient_expanding = true
set SaveYourselfMode = ANCIENT_EXPANSION
return true
elseif race_militia_available == true then
elseif race_militia_expansion_available == true and not militia_expanding then
call TQAddJob(2, MILITIA_EXPAND, 0)
set SaveYourselfMode = MILITIA_EXPAND
return true
Expand All @@ -37,7 +37,9 @@ function SaveYourself takes nothing returns boolean
return true
endif
elseif SaveYourselfMode == MILITIA_EXPAND then
if not HallsCompleted(racial_expansion) or GetMinesOwned() > 0 then
if militia_expanding then
return true // In self rescue, wait
elseif not HallsCompleted(racial_expansion) or GetMinesOwned() > 0 then
set SaveYourselfMode = -1
return true
endif
Expand Down
2 changes: 1 addition & 1 deletion Jobs/MILITIA_CHECK.eai
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function MilitiaCheckJob takes nothing returns nothing
if militia_hall == null or GetUnitState(militia_hall, UNIT_STATE_LIFE) <= 0 then
set militia_hall = GetMilitiaHall(militia_hall)
endif
if race_militia_available and (militia_hall == null or towerrush) then
if race_militia_available and militia_hall == null then
call TQAddJob(30, MILITIA_CHECK, 0)
return
endif
Expand Down
2 changes: 1 addition & 1 deletion Jobs/MILITIA_EXPAND.eai
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#IFDEF GLOBAL

boolean militia_expanding = false
boolean militia = true
//boolean militia = true
integer militia_time_count = 0
integer militia_time_out = 100 // value * 3 seconds
integer militia_state = 0
Expand Down
4 changes: 2 additions & 2 deletions Jobs/NEUTRAL_GUARDED.eai
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#ELSE
function NeutralGuardedJob takes integer nn returns nothing
call DisplayToAllJobDebug("NEUTRAL_GUARDED JOB START")
set neutral_guarded[nn] = GetNeutralGuard(nn)
call GetNeutralGuard(nn)
if not UnitAlive(nearest_neutral[nn]) then
set nearest_neutral[nn] = GetNearestNeutralQuick(nearest_neutral[nn], neutral_id[nn])
endif
if neutral_guarded[nn] and not pathing_done and nearest_neutral[nn] != null then // pathing_done give PathingThread continue check
call TQAddJob(30 * sleep_multiplier, NEUTRAL_GUARDED, nn)
endif
endfunction
#ENDIF
#ENDIF
74 changes: 60 additions & 14 deletions Jobs/SELL_ZIGGURATS.eai
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
#IFDEF GLOBAL
location TRrecovery = null
unit sellbuild = null
unit sellpeon = null
#ELSE

function RecoveryTRBuild takes group g returns nothing
if sellbuild == null or not UnitAlive(sellbuild) then
call GroupEnumUnitsInRange(g, GetLocationX(TRrecovery), GetLocationY(TRrecovery), 2000, null)
set g = SelectByPlayer(g, ai_player, true)
set g = SelectUnittype(g, UNIT_TYPE_STRUCTURE, true)
set g = SelectByAlive(g, true)
set g = SelectByHidden(g, false)
set sellbuild = FirstOfGroup(g)
endif
if sellpeon == null or not UnitAlive(sellpeon) then
set sellpeon = GetExpansionPeon2(sellpeon)
endif
if sellbuild != null and sellpeon != null then
call IssueTargetOrder(sellpeon, "unsummon", sellbuild)
elseif sellbuild == null then
call RemoveLocation(TRrecovery)
set TRrecovery = null
set sellbuild = null
set sellpeon = null
endif
endfunction

function SelectByZiggurat takes group rg returns group
local unit u = null
local integer i = 0
Expand All @@ -13,11 +38,11 @@ function SelectByZiggurat takes group rg returns group
loop
exitwhen i > ziggarray
if GetUnitTypeId(u) == racial_zigg[i] then
call GroupAddUnit(rg, u )
call GroupAddUnit(rg, u)
endif
set i = i + 1
endloop
call GroupRemoveUnit(g, u )
call GroupRemoveUnit(g, u)
endloop
call DestroyGroup(g)
set g = null
Expand All @@ -29,7 +54,10 @@ function CheckSellZiggurat takes unit u returns nothing
call GroupEnumUnitsInRange(g, GetUnitX(u), GetUnitY(u), race_ziggurat_keep_distance, null)
set g = SelectByPlayer(g, ai_player, true)
set g = SelectUnittype(g, UNIT_TYPE_STRUCTURE, true)
if (BlzGroupGetSize(g) <= 1) then
set g = SelectByAlive(g, true)
set g = SelectByHidden(g, false)
call GroupRemoveUnit(g, FirstOfGroup(g))
if FirstOfGroup(g) == null then
call Unsummon(u)
endif
call DestroyGroup(g)
Expand All @@ -39,19 +67,37 @@ endfunction
function SellZigguratJob takes nothing returns nothing
local group g = CreateGroup()
local unit u = null
local integer i = 0
//local integer i = 0

call DisplayToAllJobDebug("SELL_ZIGGURATS JOB START")
call GroupEnumUnitsOfPlayer(g, ai_player, null)
set g = SelectByZiggurat(g)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call CheckSellZiggurat(u)
call GroupRemoveUnit(g,u)
endloop
if not towerrush then
if TRrecovery == null then
call GroupEnumUnitsOfPlayer(g, ai_player, null)
set g = SelectByAlive(g, true)
set g = SelectByHidden(g, false)
set g = SelectByZiggurat(g)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call CheckSellZiggurat(u)
call GroupRemoveUnit(g,u)
endloop
else
if sellbuild != null and UnitAlive(sellbuild) and sellpeon != null and UnitAlive(sellpeon) then
call IssueTargetOrder(sellpeon, "unsummon", sellbuild)
else
call RecoveryTRBuild(g)
endif
call DestroyGroup(g)
set g = null
call TQAddJob(6, SELL_ZIGGURATS, 0)
return
endif
endif
call DestroyGroup(g)
set g = null
call TQAddJob(30, SELL_ZIGGURATS, 0)
if not pathing_done then
call TQAddJob(30, SELL_ZIGGURATS, 0)
endif
endfunction
#ENDIF
#ENDIF
Loading