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
987b4584
Commit
987b4584
authored
Oct 18, 2022
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix alchemist
parent
ce98ce1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
20 deletions
+24
-20
BotLib/hero_alchemist.lua
BotLib/hero_alchemist.lua
+24
-20
No files found.
BotLib/hero_alchemist.lua
View file @
987b4584
...
...
@@ -117,6 +117,9 @@ function X.SkillsComplement()
castWDesire
,
sMotive
=
X
.
ConsiderW
()
if
(
castWDesire
>
0
)
then
_G
.
W2Time
[
bot
]
=
DotaTime
()
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
true
)
...
...
@@ -124,6 +127,7 @@ function X.SkillsComplement()
bot
:
ActionQueue_UseAbility
(
abilityW
)
return
end
castQDesire
,
castQLocation
,
sMotive
=
X
.
ConsiderQ
()
if
(
castQDesire
>
0
)
then
...
...
@@ -163,15 +167,16 @@ function X.SkillsComplement()
end
function
X
.
ConsiderW2
()
if
_G
.
W2Time
[
bot
]
<
999999
and
(
abilityW2
:
IsHidden
()
or
not
abilityW2
:
IsTrained
()
or
not
abilityW2
:
IsFullyCastable
()
)
then
if
abilityW2
:
IsHidden
()
or
not
abilityW2
:
IsTrained
()
or
not
abilityW2
:
IsFullyCastable
(
)
then
_G
.
W2Time
[
bot
]
=
999999
return
0
end
if
abilityW2
:
IsHidden
()
or
not
abilityW2
:
IsTrained
()
or
not
abilityW2
:
IsFullyCastable
()
then
return
0
local
time
=
DotaTime
()
if
_G
.
W2Time
[
bot
]
==
999999
then
--异常状况
_G
.
W2Time
[
bot
]
=
time
-
0
.
5
end
local
time
=
DotaTime
()
local
nCastRange
=
abilityW2
:
GetCastRange
()
+
aetherRange
local
nEnemysHeroesInCastRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
99
,
true
,
BOT_MODE_NONE
)
...
...
@@ -193,13 +198,11 @@ function X.ConsiderW2()
end
end
print
(
time
)
print
(
_G
.
W2Time
[
bot
])
if
not
(
time
>
(
_G
.
W2Time
[
bot
]
+
2
.
0
))
then
return
0
end
if
remainTime
>
3
.
0
then
return
0
end
local
nDamage
=
16
+
14
*
nSkillLV
if
nLV
>=
28
then
nDamage
=
nDamage
+
80
end
nDamage
=
nDamage
*
(
time
-
_G
.
W2Time
[
bot
]
)
nDamage
=
nDamage
*
(
4
.
5
-
remainTime
)
--击杀
if
#
nEnemysHeroesInCastRange
>
0
then
...
...
@@ -250,9 +253,9 @@ function X.ConsiderW2()
and
J
.
CanCastOnNonMagicImmune
(
target
)
and
J
.
CanCastOnTargetAdvanced
(
target
)
and
J
.
IsInRange
(
target
,
bot
,
nCastRange
)
and
(((
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
(
nCastRange
/
4
*
3
))
and
(((
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
(
nCastRange
/
2
))
and
not
J
.
IsDisabled
(
target
)
and
not
target
:
IsDisarmed
())
or
remainTime
<=
0
.
5
or
nHP
<
0
.
2
)
and
not
target
:
IsDisarmed
())
or
remainTime
<=
1
.
0
or
nHP
<
0
.
2
or
target
:
GetHealth
()
<
500
)
then
return
BOT_ACTION_DESIRE_HIGH
,
target
,
"W-追杀"
..
J
.
Chat
.
GetNormName
(
target
)
end
...
...
@@ -262,13 +265,11 @@ function X.ConsiderW2()
if
J
.
IsRetreating
(
bot
)
then
if
J
.
IsValid
(
nEnemysHeroesInCastRange
[
1
]
)
and
J
.
CanCastOnNonMagicImmune
(
nEnemysHeroesInCastRange
[
1
]
)
and
((
J
.
CanCastOnNonMagicImmune
(
nEnemysHeroesInCastRange
[
1
]
)
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInCastRange
[
1
]
)
and
not
J
.
IsDisabled
(
nEnemysHeroesInCastRange
[
1
]
)
and
not
nEnemysHeroesInCastRange
[
1
]:
IsDisarmed
()
and
(((
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
(
nCastRange
/
4
*
3
))
and
not
J
.
IsDisabled
(
target
)
and
not
target
:
IsDisarmed
())
or
remainTime
<=
0
.
5
or
nHP
<
0
.
2
)
and
not
nEnemysHeroesInCastRange
[
1
]:
IsDisarmed
())
or
(
remainTime
<=
1
.
0
or
nHP
<
0
.
2
))
then
return
BOT_ACTION_DESIRE_HIGH
,
nEnemysHeroesInCastRange
[
1
],
"W-撤退"
..
J
.
Chat
.
GetNormName
(
nEnemysHeroesInCastRange
[
1
]
)
end
...
...
@@ -399,7 +400,6 @@ function X.ConsiderW()
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInView
[
i
]
)
and
nEnemysHeroesInView
[
i
]:
IsChanneling
()
then
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-打断-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
...
...
@@ -417,7 +417,6 @@ function X.ConsiderW()
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInCastRange
[
i
]
)
and
J
.
WillKillTarget
(
nEnemysHeroesInCastRange
[
i
],
DAMAGE_TYPE_PHYSICAL
,
nCastPoint
+
GetUnitToUnitDistance
(
bot
,
nEnemysHeroesInCastRange
[
i
])
/
900
)
then
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-击杀-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
...
...
@@ -447,7 +446,6 @@ function X.ConsiderW()
if
(
npcMostDangerousEnemy
~=
nil
)
then
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-团战晕眩高威胁目标-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
...
...
@@ -464,7 +462,6 @@ function X.ConsiderW()
and
not
J
.
IsDisabled
(
target
)
and
not
target
:
IsDisarmed
())
or
remainTime
<=
0
.
5
)
then
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-追杀-开摇"
end
end
...
...
@@ -479,7 +476,6 @@ function X.ConsiderW()
and
not
nEnemysHeroesInCastRange
[
1
]:
IsDisarmed
()
and
(
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
nCastRange
/
4
*
3
)
then
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-撤退-开摇"
end
end
...
...
@@ -501,6 +497,14 @@ function X.ConsiderR()
return
BOT_ACTION_DESIRE_HIGH
,
"R-追杀"
end
--肉山
if
bot
:
GetActiveMode
()
==
BOT_MODE_ROSHAN
then
if
J
.
IsRoshan
(
botTarget
)
and
J
.
GetHP
(
botTarget
)
>
0
.
1
and
J
.
IsInRange
(
botTarget
,
bot
,
500
)
then
return
BOT_ACTION_DESIRE_HIGH
,
'R肉山'
end
end
return
BOT_ACTION_DESIRE_NONE
end
...
...
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