pull/5/head
4n0n 2 years ago
parent fae312acfc
commit e3d52b41c4
  1. 8
      src/Spell/Spell.lua
  2. 18
      src/Unit/Unit.lua
  3. 8
      src/_bastion.lua

@ -343,6 +343,14 @@ function Spell:HasRange()
return SpellHasRange(self:GetName())
end
-- Get the range of the spell
---@return number
---@return number
function Spell:GetRange()
local name, rank, icon, castTime, minRange, maxRange, spellID, originalIcon = GetSpellInfo(self:GetID())
return maxRange, minRange
end
-- Check if the spell is in range of the unit
---@param unit Unit
---@return boolean

@ -114,6 +114,24 @@ function Unit:GetHP()
return self:GetHealth() / self:GetMaxHealth() * 100
end
-- Get realized health
---@return number
function Unit:GetRealizedHealth()
return self:GetHealth() - self:GetHealAbsorbedHealth()
end
-- get realized health percentage
---@return number
function Unit:GetRealizedHP()
return self:GetRealizedHealth() / self:GetMaxHealth() * 100
end
-- Get the abosorbed unit health
---@return number
function Unit:GetHealAbsorbedHealth()
return UnitGetTotalHealAbsorbs(self:GetOMToken())
end
-- Get the units health deficit
---@return number
function Unit:GetHealthPercent()

@ -61,7 +61,6 @@ Bastion.CombatTimer = Bastion.Timer:New('combat')
Bastion.MythicPlusUtils = Bastion.require("MythicPlusUtils"):New()
---@type NotificationsList
Bastion.Notifications = Bastion.NotificationsList:New()
Bastion.modules = {}
Bastion.Enabled = false
@ -89,7 +88,6 @@ end)
local pguid = UnitGUID("player")
local missed = {}
Bastion.EventManager:RegisterWoWEvent("COMBAT_LOG_EVENT_UNFILTERED", function()
local args = { CombatLogGetCurrentEventInfo() }
@ -133,7 +131,6 @@ Bastion.EventManager:RegisterWoWEvent("COMBAT_LOG_EVENT_UNFILTERED", function()
end
end
end)
Bastion.Ticker = C_Timer.NewTicker(0.1, function()
if not Bastion.CombatTimer:IsRunning() and UnitAffectingCombat("player") then
Bastion.CombatTimer:Start()
@ -164,7 +161,6 @@ function Bastion:FindModule(name)
return nil
end
function Bastion:Print(...)
local args = { ... }
local str = "|cFFDF362D[Bastion]|r |cFFFFFFFF"
@ -205,7 +201,6 @@ Command:Register('debug', 'Toggle debug mode on/off', function()
Bastion:Print("Debug mode disabled")
end
end)
Command:Register('dumpspells', 'Dump spells to a file', function()
local i = 1
local rand = math.random(100000, 999999)
@ -271,6 +266,9 @@ local files = ListFiles("scripts/bastion/scripts")
for i = 1, #files do
local file = files[i]
if file:sub(-4) == ".lua" or file:sub(-5) == '.luac' then
Tinkr:require("scripts/bastion/scripts/" .. file:sub(1, -5), Bastion)
end
end

Loading…
Cancel
Save