Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
dota2-ai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JoyJ
dota2-ai
Commits
547a7d40
Commit
547a7d40
authored
Apr 23, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add skill avoidance; reserve tango/flask for mid
parent
9142a733
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2923 additions
and
8 deletions
+2923
-8
FunLib/jmz_func.lua
FunLib/jmz_func.lua
+1
-1
ability_item_usage_generic.lua
ability_item_usage_generic.lua
+34
-3
docs/api.txt
docs/api.txt
+2868
-0
item_purchase_generic.lua
item_purchase_generic.lua
+8
-2
rewrite_functions.lua
rewrite_functions.lua
+12
-2
No files found.
FunLib/jmz_func.lua
View file @
547a7d40
...
...
@@ -3696,9 +3696,9 @@ function J.FindAoeLocationForLinearSkill(data)
local
most
=
least
local
nAoeLoc
local
mostUnstablity
=
99999999
local
unstablity
=
0
for
i
=
1
,
36
do
local
angle
=
10
*
i
local
unstablity
=
0
local
hitEnemy
=
J
.
FilterGroup
(
enemies
,
J
.
And
(
filter
,
function
(
u
)
local
distance
=
J
.
GetDistanceFromUnitToUnit
(
bot
,
u
)
local
uLoc
=
J
.
GetCorrectLoc
(
u
,
distance
/
projSpeed
+
castPoint
)
...
...
ability_item_usage_generic.lua
View file @
547a7d40
...
...
@@ -251,10 +251,41 @@ function X.EnemyCastResponse(hTable)
local
ability
=
hTable
.
ability
:
GetName
()
local
loc
=
hTable
.
location
if
ability
==
"jakiro_macropyre"
then
--烈焰焚身
local
range
=
ability
:
GetVal
(
'cast_range'
)
local
radius
=
ability
:
GetVal
(
'path_radius'
)
local
duration
=
ability
:
GetVal
(
'duration'
)
local
max
=
math.floor
(
radius
/
range
)
+
1
local
fromLoc
=
unit
:
GetLocation
()
local
angle
=
J
.
GetAngleFromVectorToVector
(
fromLoc
,
loc
)
for
i
=
1
,
max
do
local
locx
=
J
.
GetVectorFromVectorToAngleWithDistance
(
loc
,
angle
,
radius
*
i
)
loc
.
z
=
radius
AddAvoidanceZone
(
loc
,
duration
)
end
elseif
ability
==
"abyssal_underlord_firestorm"
then
--火焰风暴
local
radius
=
ability
:
GetVal
(
'radius'
)
local
duration
=
ability
:
GetVal
(
'wave_duration'
)
loc
.
z
=
radius
AddAvoidanceZone
(
loc
,
duration
)
elseif
ability
==
"lich_chain_frost"
then
--连环霜冻
local
radius
=
ability
:
GetVal
(
'jump_range'
)
+
100
for
i
=
1
,
36
do
local
angle
=
10
*
i
local
avLoc
=
J
.
GetVectorFromVectorToAngleWithDistance
(
bot
:
GetLocation
(),
angle
,
radius
/
2
+
100
)
avLoc
.
z
=
radius
AddAvoidanceZone
(
avLoc
,
5
.
0
)
end
elseif
ability
==
"winter_wyvern_winters_curse"
then
--寒冬诅咒
local
radius
=
ability
:
GetVal
(
'radius'
)
local
duration
=
ability
:
GetVal
(
'duration'
)
loc
.
z
=
radius
AddAvoidanceZone
(
loc
,
duration
)
end
end
function
X
.
SetReplyHumanTime
(
tChat
)
...
...
docs/api.txt
0 → 100644
View file @
547a7d40
This source diff could not be displayed because it is too large. You can
view the blob
instead.
item_purchase_generic.lua
View file @
547a7d40
...
...
@@ -82,14 +82,20 @@ local function GeneralPurchase()
or
bot
.
currentComponentToBuy
==
"item_tome_of_knowledge"
or
bot
.
currentComponentToBuy
==
"item_ward_observer"
or
bot
.
currentComponentToBuy
==
"item_ward_sentry"
or
bot
.
currentComponentToBuy
==
"item_tango"
or
bot
.
currentComponentToBuy
==
"item_flask"
then
if
GetItemStockCount
(
bot
.
currentComponentToBuy
)
<=
0
then
return
end
end
--留1个给玩家;中单无条件购买
if
bot
.
currentComponentToBuy
==
"item_tango"
or
bot
.
currentComponentToBuy
==
"item_flask"
or
bot
:
GetAssignedLane
()
==
LANE_MID
then
if
GetItemStockCount
(
bot
.
currentComponentToBuy
)
<=
1
then
return
end
end
local
cost
=
itemCost
...
...
rewrite_functions.lua
View file @
547a7d40
...
...
@@ -93,10 +93,20 @@ end
--------------------------------
--rewrite functions CDOTA_Bot_Script
--------------------------------
CDOTA_Bot_Script
.
GetAttackCombatProficiency
=
function
(
u
)
CDOTA_Bot_Script
.
GetAttackCombatProficiency
=
CDOTA_Bot_Script
.
GetAttackCombatProficiency
or
function
(
u
)
return
1
.
0
end
local
gl
=
CDOTA_Bot_Script
.
GetLocation
function
CDOTA_Bot_Script
.
GetLocation
(
unit
)
if
not
unit
:
CanBeSeen
()
then
local
id
=
unit
:
GetPlayerID
()
local
info
=
GetHeroLastSeenInfo
(
id
)
if
info
and
info
.
time_since_seen
<
2
.
0
then
return
info
.
location
end
end
return
gl
(
unit
)
end
local
gar
=
CDOTA_Bot_Script
.
GetAttackRange
local
gar_data
=
{}
CDOTA_Bot_Script
.
GetAttackRange
=
function
(
u
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment