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
1da3f7e1
Commit
1da3f7e1
authored
Apr 21, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update jmz_func
parent
7725cdd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
8 deletions
+24
-8
FunLib/jmz_func.lua
FunLib/jmz_func.lua
+24
-8
No files found.
FunLib/jmz_func.lua
View file @
1da3f7e1
...
...
@@ -3477,6 +3477,7 @@ function J.MergeGroup(nList,...)
for
a
in
arg
do
table.insert
(
nList
,
a
)
end
return
nList
end
function
J
.
Not
(
f
)
...
...
@@ -3659,6 +3660,10 @@ function J.DebugMessage(str,b)
end
end
function
J
.
FindAoeLocationForLinearSkillFilter
(
u
)
return
not
u
:
IsMagicImmune
()
end
function
J
.
FindAoeLocationForLinearSkill
(
data
)
local
range
=
data
.
range
or
600
local
radius
=
data
.
range
or
200
...
...
@@ -3667,22 +3672,33 @@ function J.FindAoeLocationForLinearSkill(data)
local
onlyHero
=
data
.
onlyHero
or
true
local
bot
=
GetBot
()
local
loc
=
data
.
loc
or
bot
:
GetLocation
()
local
enemyHeroes
=
bot
:
GetNearbyHeroes
(
range
,
true
,
BOT_MODE_NONE
)
local
creeps
=
bot
:
GetNearbyLaneCreeps
(
range
+
nRadius
,
true
)
--AOE
local
enemies
=
bot
:
GetNearbyHeroes
(
range
,
true
,
BOT_MODE_NONE
)
local
creeps
=
bot
:
GetNearbyLaneCreeps
(
range
+
radius
,
true
)
local
filter
=
data
.
filter
or
J
.
FindAoeLocationForLinearSkillFilter
enemies
=
J
.
FilterGroup
(
enemies
,
function
(
u
)
return
J
.
IsValidHero
(
u
)
end
)
creeps
=
J
.
FilterGroup
(
creeps
,
function
(
u
)
return
J
.
IsValid
(
u
)
end
)
if
not
onlyHero
then
enemies
=
J
.
MergeGroup
(
enemies
,
creeps
)
end
local
most
=
0
local
nAoeLoc
for
i
=
1
,
36
do
local
angle
=
10
*
i
local
hitEnemy
=
J
.
FilterGroup
(
nEnemyHeroesInRange
,
function
(
u
)
return
J
.
IsValidHero
(
u
)
and
not
u
:
IsMagicImmune
()
and
J
.
PointInRectangle
(
u
:
GetLocation
(),
bot
:
GetLocation
(),
angle
,
nCastRange
,
nRadius
)
end
)
local
hitEnemy
=
J
.
FilterGroup
(
enemies
,
filter
)
if
#
hitEnemy
>
most
then
most
=#
hitEnemy
nAoeLoc
=
J
.
GetVectorFromVectorToAngleWithDistance
(
bot
:
GetLocation
(),
angle
,
nCastRange
-
100
)
nAoeLoc
=
J
.
GetVectorFromVectorToAngleWithDistance
(
loc
,
angle
,
nCastRange
)
end
end
return
nAoeLoc
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