Commit 547a7d40 authored by JoyJ's avatar JoyJ

add skill avoidance; reserve tango/flask for mid

parent 9142a733
......@@ -3696,9 +3696,9 @@ function J.FindAoeLocationForLinearSkill(data)
local most=least
local nAoeLoc
local mostUnstablity = 99999999
local unstablity = 0
for i=1,36 do
local angle = 10 * i
local unstablity = 0
local hitEnemy = J.FilterGroup(enemies,J.And(filter, function(u)
local distance = J.GetDistanceFromUnitToUnit(bot, u)
local uLoc = J.GetCorrectLoc(u,distance / projSpeed + castPoint)
......
......@@ -251,10 +251,41 @@ function X.EnemyCastResponse(hTable)
local ability=hTable.ability:GetName()
local loc=hTable.location
if ability=="jakiro_macropyre" then --烈焰焚身
local range=ability:GetVal('cast_range')
local radius=ability:GetVal('path_radius')
local duration=ability:GetVal('duration')
local max = math.floor(radius / range) + 1
local fromLoc=unit:GetLocation()
local angle=J.GetAngleFromVectorToVector(fromLoc, loc)
for i=1,max do
local locx = J.GetVectorFromVectorToAngleWithDistance(loc, angle, radius * i)
loc.z = radius
AddAvoidanceZone(loc, duration)
end
elseif ability=="abyssal_underlord_firestorm" then --火焰风暴
local radius=ability:GetVal('radius')
local duration=ability:GetVal('wave_duration')
loc.z=radius
AddAvoidanceZone(loc, duration)
elseif ability=="lich_chain_frost" then --连环霜冻
local radius=ability:GetVal('jump_range') + 100
for i=1,36 do
local angle = 10 * i
local avLoc = J.GetVectorFromVectorToAngleWithDistance(bot:GetLocation(), angle, radius / 2 + 100)
avLoc.z=radius
AddAvoidanceZone(avLoc, 5.0)
end
elseif ability=="winter_wyvern_winters_curse" then --寒冬诅咒
local radius=ability:GetVal('radius')
local duration=ability:GetVal('duration')
loc.z=radius
AddAvoidanceZone(loc, duration)
end
end
function X.SetReplyHumanTime( tChat )
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -82,14 +82,20 @@ local function GeneralPurchase()
or bot.currentComponentToBuy == "item_tome_of_knowledge"
or bot.currentComponentToBuy == "item_ward_observer"
or bot.currentComponentToBuy == "item_ward_sentry"
or bot.currentComponentToBuy == "item_tango"
or bot.currentComponentToBuy == "item_flask"
then
if GetItemStockCount( bot.currentComponentToBuy ) <= 0
then
return
end
end
--留1个给玩家;中单无条件购买
if bot.currentComponentToBuy == "item_tango"
or bot.currentComponentToBuy == "item_flask"
or bot:GetAssignedLane()==LANE_MID then
if GetItemStockCount( bot.currentComponentToBuy ) <= 1 then
return
end
end
local cost = itemCost
......
......@@ -93,10 +93,20 @@ end
--------------------------------
--rewrite functions CDOTA_Bot_Script
--------------------------------
CDOTA_Bot_Script.GetAttackCombatProficiency=function(u)
CDOTA_Bot_Script.GetAttackCombatProficiency=CDOTA_Bot_Script.GetAttackCombatProficiency or function(u)
return 1.0
end
local gl=CDOTA_Bot_Script.GetLocation
function CDOTA_Bot_Script.GetLocation(unit)
if not unit:CanBeSeen() then
local id=unit:GetPlayerID()
local info=GetHeroLastSeenInfo(id)
if info and info.time_since_seen < 2.0 then
return info.location
end
end
return gl(unit)
end
local gar=CDOTA_Bot_Script.GetAttackRange
local gar_data={}
CDOTA_Bot_Script.GetAttackRange=function(u)
......
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