Commit 1da3f7e1 authored by JoyJ's avatar JoyJ

update jmz_func

parent 7725cdd2
...@@ -3477,6 +3477,7 @@ function J.MergeGroup(nList,...) ...@@ -3477,6 +3477,7 @@ function J.MergeGroup(nList,...)
for a in arg do for a in arg do
table.insert(nList,a) table.insert(nList,a)
end end
return nList
end end
function J.Not(f) function J.Not(f)
...@@ -3659,6 +3660,10 @@ function J.DebugMessage(str,b) ...@@ -3659,6 +3660,10 @@ function J.DebugMessage(str,b)
end end
end end
function J.FindAoeLocationForLinearSkillFilter(u)
return not u:IsMagicImmune()
end
function J.FindAoeLocationForLinearSkill(data) function J.FindAoeLocationForLinearSkill(data)
local range = data.range or 600 local range = data.range or 600
local radius = data.range or 200 local radius = data.range or 200
...@@ -3667,22 +3672,33 @@ function J.FindAoeLocationForLinearSkill(data) ...@@ -3667,22 +3672,33 @@ function J.FindAoeLocationForLinearSkill(data)
local onlyHero = data.onlyHero or true local onlyHero = data.onlyHero or true
local bot = GetBot() local bot = GetBot()
local loc=data.loc or bot:GetLocation() local loc=data.loc or bot:GetLocation()
local enemyHeroes = bot:GetNearbyHeroes( range, true, BOT_MODE_NONE ) local enemies = bot:GetNearbyHeroes( range, true, BOT_MODE_NONE )
local creeps = bot:GetNearbyLaneCreeps( range + nRadius, true ) local creeps = bot:GetNearbyLaneCreeps( range + radius, true )
--AOE 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 most=0
local nAoeLoc local nAoeLoc
for i=1,36 do for i=1,36 do
local angle = 10 * i local angle = 10 * i
local hitEnemy = J.FilterGroup(nEnemyHeroesInRange,function(u) local hitEnemy = J.FilterGroup(enemies,filter)
return J.IsValidHero(u) and not u:IsMagicImmune()
and J.PointInRectangle(u:GetLocation(),bot:GetLocation(),angle,nCastRange,nRadius)
end)
if #hitEnemy>most then if #hitEnemy>most then
most=#hitEnemy most=#hitEnemy
nAoeLoc=J.GetVectorFromVectorToAngleWithDistance(bot:GetLocation(), angle, nCastRange - 100) nAoeLoc=J.GetVectorFromVectorToAngleWithDistance(loc, angle, nCastRange)
end end
end end
return nAoeLoc
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment