Commit bacd194c authored by JoyJ's avatar JoyJ

add disruptor

parent 688807e9
......@@ -169,6 +169,10 @@ function X.SkillsComplement()
if itemGungir and itemGungir:IsFullyCastable() then
bot:ActionQueue_UseAbilityOnLocation( itemGungir, lastWLocation )
end
local itemAtos = J.IsItemAvailable("item_rod_of_atos")
if itemAtos and itemAtos:IsFullyCastable() and GetUnitToLocationDistance(bot:GetTarget(),lastWLocation) < 400 then
bot:ActionQueue_UseAbilityOnEntity( itemAtos, bot:GetTarget() )
end
lastWTime = 0
lastWLocation = nil
end
......@@ -211,11 +215,13 @@ function X.ConsiderQ()
end
end
--消耗,保持一定魔量
--消耗,保持一定魔量;仅在兵线相持时消耗
local nCanHurtEnemyAoE = bot:FindAoELocation( true, true, bot:GetLocation(), nCastRange, nRadius + 20, 0, 0 )
if nSkillLV>1 and J.IsAllowedToSpam( bot, nManaCost) and nCanHurtEnemyAoE.count >= 2 then
nTargetLocation = nCanHurtEnemyAoE.targetloc
return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q消耗'
if J.GetAllyCreepNearLoc(bot, nTargetLocation, 400)>1 then
return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q消耗'
end
end
--团战
......
......@@ -300,11 +300,13 @@ function X.ConsiderQ()
local nTargetLocation = nil
--消耗,保持一定魔量
--消耗,保持一定魔量;仅在兵线相持时消耗
local nCanHurtEnemyAoE = bot:FindAoELocation( true, false, bot:GetLocation(), nCastRange, nRadius + 20, 0, 0 )
if J.IsAllowedToSpam( bot, nManaCost) and nCanHurtEnemyAoE.count >= 3 then
nTargetLocation = nCanHurtEnemyAoE.targetloc
return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q消耗'
if J.GetAllyCreepNearLoc(bot, nTargetLocation, 400)>1 then
return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q消耗'
end
end
--团战
......@@ -323,7 +325,7 @@ function X.ConsiderQ()
if J.IsValidHero( botTarget )
and J.CanCastOnNonMagicImmune( botTarget )
and J.IsInRange( botTarget, bot, nCastRange - 30 )
and (botTarget:GetCurrentMovementSpeed() < 240 or botTarget:IsStunned())
and (botTarget:GetCurrentMovementSpeed() < 240 or botTarget:IsStunned() or botTarget:IsRooted())
then
nTargetLocation = J.GetDelayCastLocation( bot, botTarget, nCastRange, nRadius, nCastPoint )
if nTargetLocation ~= nil
......
This diff is collapsed.
......@@ -436,6 +436,13 @@ function J.GetAlliesNearLoc( vLoc, nRadius )
end
function J.GetEnemiesNearLoc(bot, vLoc, nRadius)
local enemies = bot:GetNearbyHeroes( 99999, true, BOT_MODE_NONE )
return J.FilterGroup(enemies,function(u)
return u:IsAlive()
and GetUnitToLocationDistance( u, vLoc ) <= nRadius
end)
end
function J.IsAllyHeroBetweenAllyAndEnemy( hAlly, hEnemy, vLoc, nRadius )
......@@ -3211,6 +3218,45 @@ function J.GetMagicToPhysicalDamage( bot, nUnit, nMagicDamage )
end
function J.FilterGroup(nList,func)
local newGroup={}
for _, npc in pairs( nList ) do
if func(npc) then
table.insert(newGroup,npc)
end
end
return newGroup
end
function J.Not(f)
return function(...)
return not f(...)
end
end
function J.And(...)
local funcList=table.unpack(...)
return function(...)
for _,func in pairs(funcList) do
if not func(...) then
return false
end
end
return true
end
end
function J.Or(...)
local funcList=table.unpack(...)
return function(...)
for _,func in pairs(funcList) do
if func(...) then
return true
end
end
return false
end
end
return J
......
......@@ -67,7 +67,7 @@ local sUserKeyDir = Chat.GetUserKeyDir()
'npc_dota_hero_dark_seer',
'npc_dota_hero_dark_willow',
--'npc_dota_hero_dazzle',
'npc_dota_hero_disruptor',
--'npc_dota_hero_disruptor',
--'npc_dota_hero_death_prophet',
'npc_dota_hero_doom_bringer',
--'npc_dota_hero_dragon_knight',
......@@ -176,6 +176,7 @@ local sHasDevelopmentHeroList = {
"npc_dota_hero_abyssal_underlord",
"npc_dota_hero_alchemist",
"npc_dota_hero_life_stealer",
"npc_dota_hero_disruptor",
"npc_dota_hero_silencer",
"npc_dota_hero_warlock",
"npc_dota_hero_necrolyte",
......@@ -230,9 +231,6 @@ local sHasDevelopmentHeroList = {
"npc_dota_hero_razor",
"npc_dota_hero_mirana",
}
......@@ -344,7 +342,7 @@ local sPriestList = {
"npc_dota_hero_bane",
-- "npc_dota_hero_windrunner",
"npc_dota_hero_queenofpain",
"npc_dota_hero_disruptor",
}
local sMageList = {
......@@ -369,6 +367,7 @@ local sMageList = {
"npc_dota_hero_bane",
-- "npc_dota_hero_windrunner",
"npc_dota_hero_queenofpain",
"npc_dota_hero_disruptor",
}
......
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