Commit c1060786 authored by JoyJ's avatar JoyJ

update buffs

parent e0490373
...@@ -198,6 +198,7 @@ function X.ConsiderQ() ...@@ -198,6 +198,7 @@ function X.ConsiderQ()
do do
if J.WillMagicKillTarget(bot, npcEnemy, nDamage, nCastPoint + 1.0) if J.WillMagicKillTarget(bot, npcEnemy, nDamage, nCastPoint + 1.0)
or J.GetModifierTime(bot, 'modifier_abaddon_borrowed_time')>nCastPoint or J.GetModifierTime(bot, 'modifier_abaddon_borrowed_time')>nCastPoint
or J.GetModifierTime(bot, 'modifier_abaddon_borrowed_time_immolate')>nCastPoint
or J.GetModifierTime(bot, 'modifier_abaddon_aphotic_shield')>nCastPoint then or J.GetModifierTime(bot, 'modifier_abaddon_aphotic_shield')>nCastPoint then
return BOT_ACTION_DESIRE_HIGH, npcEnemy, "Q-对"..J.Chat.GetNormName( npcEnemy ).."耗血" return BOT_ACTION_DESIRE_HIGH, npcEnemy, "Q-对"..J.Chat.GetNormName( npcEnemy ).."耗血"
end end
......
...@@ -18,7 +18,7 @@ local tTalentTreeList = { ...@@ -18,7 +18,7 @@ local tTalentTreeList = {
} }
local tAllAbilityBuildList = { local tAllAbilityBuildList = {
{3,1,1,3,1,6,3,1,2,3,6,2,2,2,6}, {1,2,1,3,1,6,1,2,2,2,6,3,3,3,6},
} }
local nAbilityBuildList = J.Skill.GetRandomBuild( tAllAbilityBuildList ) local nAbilityBuildList = J.Skill.GetRandomBuild( tAllAbilityBuildList )
...@@ -527,9 +527,9 @@ function X.ConsiderD() ...@@ -527,9 +527,9 @@ function X.ConsiderD()
return BOT_ACTION_DESIRE_NONE return BOT_ACTION_DESIRE_NONE
end end
local nCastRange = abilityW:GetCastRange() + aetherRange local nCastRange = abilityD:GetCastRange() + aetherRange
local nCastPoint = abilityW:GetCastPoint() local nCastPoint = abilityD:GetCastPoint()
local nManaCost = abilityW:GetManaCost() local nManaCost = abilityD:GetManaCost()
local nHealHealth = 400 local nHealHealth = 400
local hCastTarget = nil local hCastTarget = nil
local sCastMotive = nil local sCastMotive = nil
...@@ -546,7 +546,7 @@ function X.ConsiderD() ...@@ -546,7 +546,7 @@ function X.ConsiderD()
--为加Buff --为加Buff
if npcAlly:GetAttackTarget() ~= nil if npcAlly:GetAttackTarget() ~= nil
and npcAlly:GetAttackTarget():IsHero() and npcAlly:GetAttackTarget():IsHero()
and npcAlly:GetMaxHealth() - npcAlly:GetHealth() >= nHealHealth * 0.8 and J.GetHP(npcAlly) >= 0.8
then then
hCastTarget = npcAlly hCastTarget = npcAlly
sCastMotive = 'D-加Buff:'..J.Chat.GetNormName( hCastTarget ) sCastMotive = 'D-加Buff:'..J.Chat.GetNormName( hCastTarget )
...@@ -554,9 +554,9 @@ function X.ConsiderD() ...@@ -554,9 +554,9 @@ function X.ConsiderD()
end end
--为被减速队友解减速 --为被减速队友解减速
if npcAlly:GetCurrentMovementSpeed() < npcAlly:GetBaseMovementSpeed() then if J.ShouldDispelDebuff( npcAlly ) then
hCastTarget = npcAlly hCastTarget = npcAlly
sCastMotive = 'D-解减速:'..J.Chat.GetNormName( hCastTarget ) sCastMotive = 'D-解Debuff:'..J.Chat.GetNormName( hCastTarget )
return BOT_ACTION_DESIRE_HIGH, hCastTarget, sCastMotive return BOT_ACTION_DESIRE_HIGH, hCastTarget, sCastMotive
end end
...@@ -572,7 +572,7 @@ function X.ConsiderD() ...@@ -572,7 +572,7 @@ function X.ConsiderD()
end end
--为准备打架的力量/敏捷队友辅助 --为准备打架的非智力队友辅助
if J.IsGoingOnSomeone( npcAlly ) if J.IsGoingOnSomeone( npcAlly )
and npcAlly:GetPrimaryAttribute() ~= ATTRIBUTE_INTELLECT and npcAlly:GetPrimaryAttribute() ~= ATTRIBUTE_INTELLECT
then then
......
...@@ -336,6 +336,7 @@ function X.ConsiderW() ...@@ -336,6 +336,7 @@ function X.ConsiderW()
do do
if J.CanCastOnNonMagicImmune( npcAlly ) if J.CanCastOnNonMagicImmune( npcAlly )
and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time' ) and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time' )
and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time_immolate' )
and not npcAlly:HasModifier( 'modifier_obsidian_destroyer_astral_imprisonment_prison' ) and not npcAlly:HasModifier( 'modifier_obsidian_destroyer_astral_imprisonment_prison' )
and ( and (
npcAlly:HasModifier( 'modifier_winter_wyvern_winters_curse' ) npcAlly:HasModifier( 'modifier_winter_wyvern_winters_curse' )
...@@ -351,6 +352,7 @@ function X.ConsiderW() ...@@ -351,6 +352,7 @@ function X.ConsiderW()
and J.CanCastOnNonMagicImmune( npcAlly ) and J.CanCastOnNonMagicImmune( npcAlly )
and npcAlly:WasRecentlyDamagedByAnyHero( 2.0 ) and npcAlly:WasRecentlyDamagedByAnyHero( 2.0 )
and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time' ) and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time' )
and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time_immolate' )
and not npcAlly:HasModifier( 'modifier_obsidian_destroyer_astral_imprisonment_prison' ) and not npcAlly:HasModifier( 'modifier_obsidian_destroyer_astral_imprisonment_prison' )
then then
return BOT_ACTION_DESIRE_HIGH, npcAlly, 'W-Protect:'..J.Chat.GetNormName( npcAlly ) return BOT_ACTION_DESIRE_HIGH, npcAlly, 'W-Protect:'..J.Chat.GetNormName( npcAlly )
...@@ -362,6 +364,7 @@ function X.ConsiderW() ...@@ -362,6 +364,7 @@ function X.ConsiderW()
and J.CanCastOnNonMagicImmune( npcAlly ) and J.CanCastOnNonMagicImmune( npcAlly )
and npcAlly:WasRecentlyDamagedByAnyHero( 1.0 ) and npcAlly:WasRecentlyDamagedByAnyHero( 1.0 )
and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time' ) and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time' )
and not npcAlly:HasModifier( 'modifier_abaddon_borrowed_time_immolate' )
and not npcAlly:HasModifier( 'modifier_obsidian_destroyer_astral_imprisonment_prison' ) and not npcAlly:HasModifier( 'modifier_obsidian_destroyer_astral_imprisonment_prison' )
then then
return BOT_ACTION_DESIRE_HIGH, npcAlly, 'W-Protect:'..J.Chat.GetNormName( npcAlly ) return BOT_ACTION_DESIRE_HIGH, npcAlly, 'W-Protect:'..J.Chat.GetNormName( npcAlly )
......
...@@ -312,23 +312,16 @@ function X.ConsiderQ() ...@@ -312,23 +312,16 @@ function X.ConsiderQ()
return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q-击杀:'..J.Chat.GetNormName( npcEnemy ) return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q-击杀:'..J.Chat.GetNormName( npcEnemy )
end end
end end
local nAoeLoc = J.FindAoeLocationForLinearSkill({
range = nCastRange,
radius = nRadius,
castPoint = nCastPoint,
least = 2,
projSpeed = abilityQ:GetSpecialValueInt('speed'),
})
--AOE if nAoeLoc ~= nil then
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)
if #hitEnemy>most then
most=#hitEnemy
nAoeLoc=J.GetVectorFromVectorToAngleWithDistance(bot:GetLocation(), angle, nCastRange - 100)
end
end
if nAoeLoc ~= nil and most>1
then
nTargetLocation = nAoeLoc nTargetLocation = nAoeLoc
return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q-AOE' return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q-AOE'
end end
......
...@@ -307,6 +307,7 @@ function X.CanCastAbilityAbaddonMistCoil( bot, nDamage ) ...@@ -307,6 +307,7 @@ function X.CanCastAbilityAbaddonMistCoil( bot, nDamage )
return bot:GetHealth() - ( nDamage * 0.5 ) > 500 return bot:GetHealth() - ( nDamage * 0.5 ) > 500
or bot:HasModifier( 'modifier_abaddon_borrowed_time' ) or bot:HasModifier( 'modifier_abaddon_borrowed_time' )
or bot:HasModifier( 'modifier_abaddon_borrowed_time_immolate' )
end end
...@@ -697,6 +698,14 @@ function X.ConsiderGrimstrokeStrokeOfFate( bot ) ...@@ -697,6 +698,14 @@ function X.ConsiderGrimstrokeStrokeOfFate( bot )
end end
local nAoeLoc = J.FindAoeLocationForLinearSkill({
range = nCastRange,
radius = nRadius,
castPoint = nCastPoint,
least = 2,
projSpeed = ability:GetSpecialValueInt('projectile_speed'),
})
local nAoeLoc = J.GetAoeEnemyHeroLocation( bot, nCastRange, nRadius, 2 ) local nAoeLoc = J.GetAoeEnemyHeroLocation( bot, nCastRange, nRadius, 2 )
if nAoeLoc ~= nil if nAoeLoc ~= nil
and nSkillLV > 1 and nSkillLV > 1
......
...@@ -35,6 +35,7 @@ Buff["enemy_is_undead"] = { ...@@ -35,6 +35,7 @@ Buff["enemy_is_undead"] = {
"modifier_dazzle_shallow_grave", "modifier_dazzle_shallow_grave",
"modifier_oracle_false_promise_timer", "modifier_oracle_false_promise_timer",
"modifier_abaddon_borrowed_time", "modifier_abaddon_borrowed_time",
"modifier_abaddon_borrowed_time_immolate",
"modifier_skeleton_king_reincarnation_scepter_active", "modifier_skeleton_king_reincarnation_scepter_active",
} }
...@@ -225,6 +226,7 @@ Buff["dispellable_debuffs"] = { ...@@ -225,6 +226,7 @@ Buff["dispellable_debuffs"] = {
"modifier_item_urn_damage", "modifier_item_urn_damage",
"modifier_item_spirit_vessel_damage", "modifier_item_spirit_vessel_damage",
"modifier_item_veil_of_discord_debuff", "modifier_item_veil_of_discord_debuff",
"modifier_alchemist_corrosive_weaponry_debuff",
} }
......
...@@ -376,6 +376,7 @@ function X.AttackingWardThink(minion) ...@@ -376,6 +376,7 @@ function X.AttackingWardThink(minion)
--and minion:GetAnimActivity() ~= 1503 --and minion:GetAnimActivity() ~= 1503
then then
minion:Action_AttackUnit(minion.target, true); minion:Action_AttackUnit(minion.target, true);
minion:ActionQueue_Delay(minion:GetAttackPoint()+0.05)
return return
end end
end end
......
...@@ -3608,7 +3608,7 @@ function J.GetDistanceFromPointToLine(x, y, x1, y1, x2, y2) ...@@ -3608,7 +3608,7 @@ function J.GetDistanceFromPointToLine(x, y, x1, y1, x2, y2)
return J.GetDistanceFromXYToXY( ( y + ( x2 - x1 ) / ( y2 - y1 ) * x + ( y2 - y1 ) / ( x2 - x1 ) * x2 - y2 ) / ( ( y2 - y1 ) / ( x2 - x1 ) + ( x2 - x1 ) / ( y2 - y1 ) ), ( y2 - y1 ) / ( x2 - x1 ) * ( ( y + ( x2 - x1 ) / ( y2 - y1 ) * x + ( y2 - y1 ) / ( x2 - x1 ) * x2 - y2 ) / ( ( y2 - y1 ) / ( x2 - x1 ) + ( x2 - x1 ) / ( y2 - y1 ) ) ) + y2 - ( y2 - y1 ) / ( x2 - x1 ) * x2, x, y ) return J.GetDistanceFromXYToXY( ( y + ( x2 - x1 ) / ( y2 - y1 ) * x + ( y2 - y1 ) / ( x2 - x1 ) * x2 - y2 ) / ( ( y2 - y1 ) / ( x2 - x1 ) + ( x2 - x1 ) / ( y2 - y1 ) ), ( y2 - y1 ) / ( x2 - x1 ) * ( ( y + ( x2 - x1 ) / ( y2 - y1 ) * x + ( y2 - y1 ) / ( x2 - x1 ) * x2 - y2 ) / ( ( y2 - y1 ) / ( x2 - x1 ) + ( x2 - x1 ) / ( y2 - y1 ) ) ) + y2 - ( y2 - y1 ) / ( x2 - x1 ) * x2, x, y )
end end
function J.PointInRectangle(p, p1, a, d, r) function J.IsVectorInRectangle(p, p1, a, d, r)
local x = p.x local x = p.x
local y = p.y local y = p.y
local x1 = p1.x local x1 = p1.x
...@@ -3617,6 +3617,11 @@ function J.PointInRectangle(p, p1, a, d, r) ...@@ -3617,6 +3617,11 @@ function J.PointInRectangle(p, p1, a, d, r)
return J.GetDistanceFromPointToLine( x, y, x1, y1, x1 + math.cos( math.rad(a) ) * r, y1 + math.sin( math.rad(a) ) * r ) < d and J.GetDistance( x, y, x1, y1 ) < r and J.GetAngleBetweenTwoAngles( J.GetAngle( x1, y1, x, y ), a ) < 90 return J.GetDistanceFromPointToLine( x, y, x1, y1, x1 + math.cos( math.rad(a) ) * r, y1 + math.sin( math.rad(a) ) * r ) < d and J.GetDistance( x, y, x1, y1 ) < r and J.GetAngleBetweenTwoAngles( J.GetAngle( x1, y1, x, y ), a ) < 90
end end
function J.IsXYInRectangle(x, y, x1, y1, a, d, r)
--从(x1,y1)起向a方向作一条直线。若(x,y)到这条直线的直线距离小于d,且到(x1,y1)的距离小于r,则返回真
return J.GetDistanceFromPointToLine( x, y, x1, y1, x1 + math.cos( math.rad(a) ) * r, y1 + math.sin( math.rad(a) ) * r ) < d and J.GetDistance( x, y, x1, y1 ) < r and J.GetAngleBetweenTwoAngles( J.GetAngle( x1, y1, x, y ), a ) < 90
end
function J.GetVectorFromVectorToAngleWithDistance(v, a, d) function J.GetVectorFromVectorToAngleWithDistance(v, a, d)
--从vector v开始,向a方向d距离的位置。 --从vector v开始,向a方向d距离的位置。
a = math.rad(a) a = math.rad(a)
...@@ -3640,7 +3645,7 @@ function J.CosSin(angle) ...@@ -3640,7 +3645,7 @@ function J.CosSin(angle)
end end
function J.AngleToVector(angle) function J.AngleToVector(angle)
local v=RandomVector(0.0) local v=RandomVector(0.0)
v.x=CosSin(angle) v.x, v.y=J.CosSin(angle)
return v return v
end end
...@@ -3651,7 +3656,7 @@ function J.GetRandomPointInCircle(center, max, min) ...@@ -3651,7 +3656,7 @@ function J.GetRandomPointInCircle(center, max, min)
local distribute = 1 / (max * max - min * min) local distribute = 1 / (max * max - min * min)
local r = math.sqrt(RandomFloat(0,1.0) / distribute + min * min) local r = math.sqrt(RandomFloat(0,1.0) / distribute + min * min)
local angle = RandomFloat(0,360) local angle = RandomFloat(0,360)
return J.GetVectorFromVectorToAngleWithDistance(center, angle, r, nil) return J.GetVectorFromVectorToAngleWithDistance(center, angle, r)
end end
function J.DebugMessage(str,b) function J.DebugMessage(str,b)
...@@ -3661,7 +3666,7 @@ function J.DebugMessage(str,b) ...@@ -3661,7 +3666,7 @@ function J.DebugMessage(str,b)
end end
function J.FindAoeLocationForLinearSkillFilter(u) function J.FindAoeLocationForLinearSkillFilter(u)
return not u:IsMagicImmune() return not u:IsMagicImmune() and not u:IsInvulnerable() and not u:IsHidden()
end end
function J.FindAoeLocationForLinearSkill(data) function J.FindAoeLocationForLinearSkill(data)
...@@ -3669,12 +3674,13 @@ function J.FindAoeLocationForLinearSkill(data) ...@@ -3669,12 +3674,13 @@ function J.FindAoeLocationForLinearSkill(data)
local radius = data.range or 200 local radius = data.range or 200
local castPoint = data.castPoint or 0.5 local castPoint = data.castPoint or 0.5
local projSpeed = data.projSpeed or 1000 local projSpeed = data.projSpeed or 1000
local onlyHero = data.onlyHero or true local onlyHero = data.onlyHero==nil or data.onlyHero
local bot = GetBot() local bot = GetBot()
local loc=data.loc or bot:GetLocation() local loc=data.loc or bot:GetLocation()
local enemies = bot:GetNearbyHeroes( range, true, BOT_MODE_NONE ) local enemies = bot:GetNearbyHeroes( range, true, BOT_MODE_NONE )
local creeps = bot:GetNearbyLaneCreeps( range + radius, true ) local creeps = bot:GetNearbyLaneCreeps( range + radius, true )
local filter = data.filter or J.FindAoeLocationForLinearSkillFilter local filter = data.filter or J.FindAoeLocationForLinearSkillFilter
local least = data.least or 2
enemies = J.FilterGroup(enemies, function(u) enemies = J.FilterGroup(enemies, function(u)
return J.IsValidHero(u) return J.IsValidHero(u)
...@@ -3687,20 +3693,35 @@ function J.FindAoeLocationForLinearSkill(data) ...@@ -3687,20 +3693,35 @@ function J.FindAoeLocationForLinearSkill(data)
enemies = J.MergeGroup(enemies, creeps) enemies = J.MergeGroup(enemies, creeps)
end end
local most=0 local most=least
local nAoeLoc local nAoeLoc
local mostUnstablity = 99999999
local unstablity = 0
for i=1,36 do for i=1,36 do
local angle = 10 * i local angle = 10 * i
local hitEnemy = J.FilterGroup(enemies,filter) local hitEnemy = J.FilterGroup(enemies,J.And(filter, function(u)
if #hitEnemy>most then local distance = J.GetDistanceFromUnitToUnit(bot, u)
local uLoc = J.GetCorrectLoc(u,distance / projSpeed + castPoint)
if J.IsVectorInRectangle(uLoc,loc,angle,radius,range) then
unstablity = unstablity + J.GetDistanceFromPointToLine( uLoc.x, uLoc.y, loc.x, loc.y, loc.x + math.cos( math.rad(angle) ) * range, loc.y + math.sin( math.rad(angle) ) * range )
end
end))
if #hitEnemy>=most and unstablity < mostUnstablity then
most=#hitEnemy most=#hitEnemy
nAoeLoc=J.GetVectorFromVectorToAngleWithDistance(loc, angle, nCastRange) nAoeLoc=J.GetVectorFromVectorToAngleWithDistance(loc, angle, range / 2)
end end
end end
return nAoeLoc return nAoeLoc
end end
function J.GetVal(ability, name)
local f=ability:GetSpecialValueFloat(name)
if math.abs(f)<0.0001 then
f=ability:GetSpecialValueInt(name)
end
return f
end
return J return J
......
...@@ -1513,6 +1513,7 @@ X.ConsiderItemDesire["item_cyclone"] = function( hItem ) ...@@ -1513,6 +1513,7 @@ X.ConsiderItemDesire["item_cyclone"] = function( hItem )
then then
if botTarget:HasModifier( 'modifier_teleporting' ) if botTarget:HasModifier( 'modifier_teleporting' )
or botTarget:HasModifier( 'modifier_abaddon_borrowed_time' ) or botTarget:HasModifier( 'modifier_abaddon_borrowed_time' )
or botTarget:HasModifier( 'modifier_abaddon_borrowed_time_immolate' )
or botTarget:HasModifier( "modifier_dazzle_shallow_grave" ) or botTarget:HasModifier( "modifier_dazzle_shallow_grave" )
or botTarget:HasModifier( "modifier_oracle_false_promise_timer" ) or botTarget:HasModifier( "modifier_oracle_false_promise_timer" )
or botTarget:HasModifier( "modifier_ursa_enrage" ) or botTarget:HasModifier( "modifier_ursa_enrage" )
......
...@@ -1754,6 +1754,7 @@ function X.ShouldNotRetreat(bot) ...@@ -1754,6 +1754,7 @@ function X.ShouldNotRetreat(bot)
if bot:HasModifier("modifier_item_satanic_unholy") if bot:HasModifier("modifier_item_satanic_unholy")
or bot:HasModifier("modifier_abaddon_borrowed_time") or bot:HasModifier("modifier_abaddon_borrowed_time")
or bot:HasModifier( 'modifier_abaddon_borrowed_time_immolate' )
or ( bot:GetCurrentMovementSpeed() < 240 and not bot:HasModifier("modifier_arc_warden_spark_wraith_purge") ) or ( bot:GetCurrentMovementSpeed() < 240 and not bot:HasModifier("modifier_arc_warden_spark_wraith_purge") )
then then
return true; return true;
......
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