Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for alchemist concoction bug #100

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions ability_item_usage_alchemist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ cast.Target = {}
cast.Type = {}
local Consider = {}
local CanCast = { utility.NCanCast, utility.NCanCast, utility.NCanCast, utility.UCanCast, utility.CanCastNoTarget,
utility.NCanCast }
utility.NCanCast, utility.NCanCast }
local enemyDisabled = utility.enemyDisabled

function GetComboDamage()
Expand Down Expand Up @@ -119,6 +119,7 @@ end
-- end
-- end

-- alchemist_acid_spray
Consider[1] = function()

local abilityNumber = 1
Expand Down Expand Up @@ -237,6 +238,7 @@ Consider[1] = function()

end

-- alchemist_unstable_concoction
Consider[2] = function()

local desire = Consider2()
Expand Down Expand Up @@ -338,8 +340,9 @@ function Consider2()

end

Consider[5] = function()
local abilityNumber = 5
-- alchemist_chemical_rage
Consider[6] = function()
local abilityNumber = 6
--------------------------------------
-- Generic Variable Setting
--------------------------------------
Expand All @@ -361,6 +364,7 @@ Consider[5] = function()
--------------------------------------
-- Global high-priorty usage
--------------------------------------
-- As our health gets low, good time to rage
if HealthPercentage <= 0.2 then
return BOT_ACTION_DESIRE_HIGH
end
Expand All @@ -369,7 +373,7 @@ Consider[5] = function()
return BOT_ACTION_DESIRE_LOW
end

-- If we're in a teamfight, use it on the scariest enemy
-- If we're in a teamfight, good time to rage
local tableNearbyAttackingAlliedHeroes = npcBot:GetNearbyHeroes(1000, false, BOT_MODE_ATTACK);
if (#tableNearbyAttackingAlliedHeroes >= 2)
then
Expand All @@ -378,7 +382,7 @@ Consider[5] = function()
--------------------------------------
-- Mode based usage
--------------------------------------
-- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently
-- If we're seriously retreating, good time to rage
if (npcBot:GetActiveMode() == BOT_MODE_RETREAT and npcBot:GetActiveModeDesire() >= BOT_MODE_DESIRE_HIGH)
then
if (npcBot:WasRecentlyDamagedByAnyHero(2.0) and HealthPercentage <= 0.70 + #enemys * 0.05)
Expand All @@ -387,7 +391,7 @@ Consider[5] = function()
end
end

-- If we're going after someone
-- If we're going after someone, good time to rage
if (npcBot:GetActiveMode() == BOT_MODE_ROAM or
npcBot:GetActiveMode() == BOT_MODE_TEAM_ROAM or
npcBot:GetActiveMode() == BOT_MODE_DEFEND_ALLY or
Expand Down Expand Up @@ -424,7 +428,7 @@ Consider[4] = function()
local useTable = {}
if not npcBot:HasModifier("modifier_alchemist_chemical_rage") and
not npcBot:HasModifier("modifier_alchemist_berserk_potion") then
local useChemicalRageDesire = Consider[5]()
local useChemicalRageDesire = Consider[6]()
if useChemicalRageDesire ~= 0 then
table.insert(useTable, { useChemicalRageDesire, npcBot })
end
Expand Down Expand Up @@ -495,8 +499,9 @@ Consider[4] = function()
end
end

Consider[6] = function()
local abilityNumber = 6
-- alchemist_unstable_concoction_throw
Consider[7] = function()
local abilityNumber = 7
--------------------------------------
-- Generic Variable Setting
--------------------------------------
Expand Down