Commit c1060786 authored by JoyJ's avatar JoyJ

update buffs

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