Skip to content

Commit

Permalink
Update YaHT.lua
Browse files Browse the repository at this point in the history
Fix #30 
Fix #27 
Fix #20 
Fix #28 
Fix #26
  • Loading branch information
Aviana authored Sep 19, 2019
1 parent 5ffaba3 commit 0a0e9cb
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions YaHT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ function YaHT:Load()
self.mainFrame.lastshot = GetTime()
self.mainFrame.swingtime = UnitRangedDamage("player") - SWING_TIME
self.mainFrame:SetScript("OnUpdate", OnUpdate)
CastingBarFrame.maxValue = 0

self.mainFrame.background = self.mainFrame:CreateTexture("YaHTMainFrameBackground", "BACKGROUND")
self.mainFrame.background:SetAllPoints(self.mainFrame)
Expand All @@ -231,20 +230,15 @@ function YaHT:COMBAT_LOG_EVENT_UNFILTERED()
if event == "SWING_DAMAGE" or event == "ENVIRONMENTAL_DAMAGE" or event == "RANGE_DAMAGE" or event == "SPELL_DAMAGE" then
if resisted or blocked or absorbed then return end
if targetID == UnitGUID("player") then
if name == AimedShot then
AimedDelay = 1
castTime = 3000
else
local maxValue
maxValue = 0
if not CastingBarFrame.maxValue == nil then
maxValue = CastingBarFrame.maxValue
end
CastingBarFrame.maxValue = maxValue + math.min(CastingBarFrame:GetValue(),AimedDelay)
CastingBarFrame:SetMinMaxValues(0, CastingBarFrame.maxValue)
if AimedDelay > 0.2 then
AimedDelay = AimedDelay - 0.2
end
local maxValue
maxValue = 0
if not CastingBarFrame.maxValue == nil then
maxValue = CastingBarFrame.maxValue
end
CastingBarFrame.maxValue = maxValue + math.min(CastingBarFrame:GetValue(),AimedDelay)
CastingBarFrame:SetMinMaxValues(0, CastingBarFrame.maxValue)
if AimedDelay > 0.2 then
AimedDelay = AimedDelay - 0.2
end
end
return
Expand All @@ -271,6 +265,7 @@ function YaHT:COMBAT_LOG_EVENT_UNFILTERED()

if name == AimedShot then
AimedDelay = 1
castTime = 3000
else
castTime = 500
end
Expand Down

0 comments on commit 0a0e9cb

Please sign in to comment.