Skip to content

Commit

Permalink
- More AA Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Mar 9, 2024
1 parent 09b658e commit 98cb073
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion extras/version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = 'aa8e9cf 2024-03-09' }
return { commitId = '09b658e 2024-03-09' }
15 changes: 10 additions & 5 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,12 @@ end
---@param aaName string
---@return boolean
function RGMercUtils.CanUseAA(aaName)
return mq.TLO.Me.AltAbility(aaName)() and mq.TLO.Me.AltAbility(aaName).MinLevel() <= mq.TLO.Me.Level() and
mq.TLO.Me.AltAbility(aaName).Rank() > 0
local haveAbility = mq.TLO.Me.AltAbility(aaName)()
local levelCheck = mq.TLO.Me.AltAbility(aaName).MinLevel() <= mq.TLO.Me.Level()
local rankCheck = mq.TLO.Me.AltAbility(aaName).Rank() > 0
RGMercsLogger.log_verbose("CanUseAA(%s): haveAbility(%s) levelCheck(%s) rankCheck(%s)", aaName, RGMercUtils.BoolToColorString(haveAbility),
RGMercUtils.BoolToColorString(levelCheck), RGMercUtils.BoolToColorString(rankCheck))
return haveAbility and levelCheck and rankCheck
end

---@return boolean
Expand All @@ -264,9 +268,10 @@ end
---@param aaName string
---@return boolean
function RGMercUtils.AAReady(aaName)
local ret = RGMercUtils.CanUseAA(aaName) and mq.TLO.Me.AltAbilityReady(aaName)()
RGMercsLogger.log_verbose("AAReady(%s): %s", aaName, RGMercUtils.BoolToColorString(ret))
return ret
local canUse = RGMercUtils.CanUseAA(aaName)
local ready = mq.TLO.Me.AltAbilityReady(aaName)()
RGMercsLogger.log_verbose("AAReady(%s): ready(%s) canUse(%s)", aaName, RGMercUtils.BoolToColorString(ready), RGMercUtils.BoolToColorString(canUse))
return ready and canUse
end

---@param abilityName string
Expand Down

0 comments on commit 98cb073

Please sign in to comment.