Skip to content

Commit

Permalink
Next version update (#64)
Browse files Browse the repository at this point in the history
Ogre_magi prefers to use bloodbust on allies with higher battle power;
Decreate desire of zeus using thundergods_wrath at far enemies;
Decrease necrolyte and zeus (again) use ultimate to steal kills;
Fix omniknight never use purification on damaged allies when mana is enough;
Fix faceless_void item purchase;
Fix tusk, ember_spirit abilities;
Add guardian_greaves to team item purchase;
Disable brewmaster drunken_brawler for now;
Add team arcane_boots purchase;
Remove battle_fury and radiance from item build lists of some heroes;
Fix shadow_demon, nyx_assasin cast certain abilities on creep heroes (i.e. lone_druid_bear, visage_familiar);
  • Loading branch information
AaronSong321 authored Apr 30, 2022
1 parent 4f5b601 commit 7f3ba05
Show file tree
Hide file tree
Showing 87 changed files with 7,089 additions and 1,495 deletions.
14 changes: 7 additions & 7 deletions ability_item_usage_abaddon.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---------------------------------------------
-- Generated from Mirana Compiler version 1.6.1
-- Generated from Mirana Compiler version 1.6.2
-- Do not modify
-- https://github.com/AaronSong321/Mirana
---------------------------------------------
Expand Down Expand Up @@ -106,11 +106,11 @@ Consider[1] = function()
table.remove(allys, _)
end
end
local WeakestAlly,AllyHealth = utility.GetWeakestUnit(allys)
local WeakestAlly, AllyHealth = utility.GetWeakestUnit(allys)
local enemys = npcBot:GetNearbyHeroes(CastRange + 150, true, BOT_MODE_NONE)
local WeakestEnemy,HeroHealth = utility.GetWeakestUnit(enemys)
local WeakestEnemy, HeroHealth = utility.GetWeakestUnit(enemys)
local creeps = npcBot:GetNearbyCreeps(CastRange + 300, true)
local WeakestCreep,CreepHealth = utility.GetWeakestUnit(creeps)
local WeakestCreep, CreepHealth = utility.GetWeakestUnit(creeps)
if npcBot:GetActiveMode() ~= BOT_MODE_RETREAT then
if WeakestEnemy ~= nil then
if CanCast[abilityNumber](WeakestEnemy) then
Expand Down Expand Up @@ -178,11 +178,11 @@ Consider[2] = function()
local allys = fun1:GetNearbyNonIllusionHeroes(npcBot, CastRange + 200, false):Filter(CanCast[2]):Filter(function(it)
return it:WasRecentlyDamagedByAnyHero(4) or it:WasRecentlyDamagedByTower(2)
end)
local WeakestAlly,AllyHealth = utility.GetWeakestUnit(allys)
local WeakestAlly, AllyHealth = utility.GetWeakestUnit(allys)
local enemys = npcBot:GetNearbyHeroes(CastRange + 300, true, BOT_MODE_NONE)
local WeakestEnemy,HeroHealth = utility.GetWeakestUnit(enemys)
local WeakestEnemy, HeroHealth = utility.GetWeakestUnit(enemys)
local creeps = npcBot:GetNearbyCreeps(CastRange + 300, true)
local WeakestCreep,CreepHealth = utility.GetWeakestUnit(creeps)
local WeakestCreep, CreepHealth = utility.GetWeakestUnit(creeps)
local function Rate(it)
local rate = 0
if it == npcBot then
Expand Down
8 changes: 4 additions & 4 deletions ability_item_usage_abyssal_underlord.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Consider[1]=function() --Location AOE Example
-- Mode based usage
--------------------------------------
-- If we're farming and can kill 3+ creeps with LSA
if npcBot:GetActiveMode() == BOT_MODE_FARM and mana > maxMana * 0.3 + manaCost then
if npcBot:GetActiveMode() == BOT_MODE_FARM and mana > maxMana * 0.55 + manaCost then
local locationAoE = npcBot:FindAoELocation( true, false, npcBot:GetLocation(), CastRange, Radius, 0, Damage );

if ( locationAoE.count >= 3 ) then
Expand Down Expand Up @@ -314,9 +314,9 @@ end
local function FindNearbyTeleportTarget(target)
local isEnemy = not AbilityExtensions:IsOnSameTeam(npcBot, target)
local castDelay = AbilitiesReal[4]:GetSpecialValueInt("cast_delay")
local creeps = target:GetNearbyCreeps(600, isEnemy)
creeps = AbilityExtensions:Filter(creeps, function(t) return not t:WasRecentlyDamagedByAnyHero(3) and #AbilityExtensions:GetNearbyHeroes(t, 500, true, BOT_MODE_NONE) == 0 end)
creeps = AbilityExtensions:Max(creeps, function(t) return t:GetHealth() end)
local creeps = AbilityExtensions:GetNearbyCreeps(target, 600, isEnemy)
:Filter(function(t) return not t:WasRecentlyDamagedByAnyHero(3) and #AbilityExtensions:GetNearbyHeroes(t, 500, true, BOT_MODE_NONE) == 0 end)
:Max(function(t) return t:GetHealth() end)
local buildings = AbilityExtensions:Concat(target:GetNearbyTowers(700, isEnemy), target:GetNearbyBarracks(700, isEnemy))
buildings = AbilityExtensions:Filter(buildings, function(t) return t:HasModifier("modifier_backdoor_protection_active") and t:GetHealth() >= 100 or t:GetHealth() >= 300 and not t:WasRecentlyDamagedByAnyHero(castDelay-2) or t:GetHealth() >= 800 or t:HasModifier("modifier_fountain_glyph") end)
buildings = AbilityExtensions:Max(buildings, function(t) return AbilityExtensions:GetBuildingPhysicalHealth(t) end)
Expand Down
1 change: 1 addition & 0 deletions ability_item_usage_alchemist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
local utility = require( GetScriptDirectory().."/utility" )
require(GetScriptDirectory() .. "/ability_item_usage_generic")
local AbilityExtensions = require(GetScriptDirectory().."/util/AbilityAbstraction")
local A = require(GetScriptDirectory().."/util/MiraDota")
local ItemUsage = require(GetScriptDirectory().."/util/ItemUsage-New")

local debugmode=false
Expand Down
19 changes: 0 additions & 19 deletions ability_item_usage_ancient_apparition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ Consider[1]=function()
end

Consider[2]=function()

local abilityNumber=2
--------------------------------------
-- Generic Variable Setting
Expand All @@ -256,24 +255,6 @@ Consider[2]=function()
local creeps = npcBot:GetNearbyCreeps(1600,true)
local WeakestCreep,CreepHealth=utility.GetWeakestUnit(creeps)

--------------------------------------
-- Mode based usage
--------------------------------------
-- If we're pushing or defending a lane and can hit 4+ creeps, go for it
if ( npcBot:GetActiveMode() == BOT_MODE_PUSH_TOWER_TOP or
npcBot:GetActiveMode() == BOT_MODE_PUSH_TOWER_MID or
npcBot:GetActiveMode() == BOT_MODE_PUSH_TOWER_BOT or
npcBot:GetActiveMode() == BOT_MODE_DEFEND_TOWER_TOP or
npcBot:GetActiveMode() == BOT_MODE_DEFEND_TOWER_MID or
npcBot:GetActiveMode() == BOT_MODE_DEFEND_TOWER_BOT )
then
local locationAoE = npcBot:FindAoELocation( true, false, npcBot:GetLocation(), CastRange, Radius, 0, 0 );

if ( locationAoE.count >= 4 )
then
return BOT_ACTION_DESIRE_LOW, locationAoE.targetloc;
end
end

-- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently
if ( npcBot:GetActiveMode() == BOT_MODE_RETREAT and npcBot:GetActiveModeDesire() >= BOT_MODE_DESIRE_HIGH )
Expand Down
13 changes: 2 additions & 11 deletions ability_item_usage_antimage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ local utility = require( GetScriptDirectory().."/utility" )
require(GetScriptDirectory() .. "/ability_item_usage_generic")
local AbilityExtensions = require(GetScriptDirectory().."/util/AbilityAbstraction")

-- for k,v in pairs(GetUnitList(UNIT_LIST_ALLIED_WARDS)) do
-- print("unit: "..v:GetUnitName()..", "..AbilityExtensions:ToStringVector(v:GetLocation()))
-- end
-- for k,v in pairs(GetUnitList(UNIT_LIST_ENEMY_WARDS)) do
-- print("unit: "..v:GetUnitName()..", "..AbilityExtensions:ToStringVector(v:GetLocation()))
-- end
-- for k,v in pairs(GetUnitList(UNIT_LIST_ENEMY_HEROES)) do
-- print("unit: "..v:GetUnitName()..", "..AbilityExtensions:ToStringVector(v:GetLocation()))
-- end

local debugmode=false
local npcBot = GetBot()
Expand Down Expand Up @@ -168,7 +159,7 @@ Consider[2]=function()
end

-- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently
if ( npcBot:GetActiveMode() == BOT_MODE_RETREAT and npcBot:DistanceFromFountain()>=2000 and (ManaPercentage>=0.6 or npcBot:GetActiveModeDesire() >= BOT_MODE_DESIRE_HIGH or HealthPercentage<=0.6))
if ( AbilityExtensions:IsRetreating(npcBot) and npcBot:DistanceFromFountain()>=2000 and (ManaPercentage>=0.6 or npcBot:GetActiveModeDesire() >= BOT_MODE_DESIRE_HIGH or HealthPercentage<=0.6))
then
return BOT_ACTION_DESIRE_HIGH, utility.GetUnitsTowardsLocation(npcBot,GetAncient(GetTeam()),CastRange)
end
Expand Down Expand Up @@ -207,7 +198,7 @@ Consider[2]=function()
if #projectiles ~= 0 and not AbilitiesReal[3]:IsFullyCastable() and not npcBot:HasModifier("modifier_antimage_counterspell") then
for _, projectile in pairs(projectiles) do
if GetUnitToLocationDistance(npcBot, projectile.location) > castPoint * defaultProjectileVelocity then
local escapeLocation = utility.GetUnitsTowardsLocation(npcBot, projectile.location, 400)
local escapeLocation = AbilityExtensions:GetPointFromLineByDistance(npcBot:GetLocation(), projectile.location, 400)
return BOT_ACTION_DESIRE_MODERATE, escapeLocation
end
end
Expand Down
Loading

0 comments on commit 7f3ba05

Please sign in to comment.