Skip to content

Commit

Permalink
WW: If we just cast Tiger Palm but we refreshed before the Chi was ge…
Browse files Browse the repository at this point in the history
…nerated, fake it.
  • Loading branch information
Hekili committed Apr 3, 2020
1 parent 225e532 commit d2295ea
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Classes/MonkWindwalker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ if UnitClassBase( 'player' ) == 'MONK' then
end )


local tp_chi_pending = false

-- If a Tiger Palm missed, pretend we never cast it.
-- Use RegisterEvent since we're looking outside the state table.
spec:RegisterEvent( "COMBAT_LOG_EVENT_UNFILTERED", function( event )
Expand All @@ -402,6 +404,10 @@ if UnitClassBase( 'player' ) == 'MONK' then
prev_combo = actual_combo
actual_combo = ability

if ability == "tiger_palm" then
tp_chi_pending = true
end

elseif subtype == "SPELL_DAMAGE" and spellID == 148187 then
-- track the last tick.
state.buff.rushing_jade_wind.last_tick = GetTime()
Expand All @@ -410,6 +416,12 @@ if UnitClassBase( 'player' ) == 'MONK' then
end
end )

spec:RegisterEvent( "UNIT_POWER_UPDATE", function( event, unit, power )
if unit == "player" and power == "CHI" and state.player.lastcast == "tiger_palm" and GetTime() - state.action.tiger_palm.lastCast < 0.2 then
tp_chi_pending = false
end
end )


spec:RegisterHook( "runHandler", function( key, noStart )
if combos[ key ] then
Expand Down Expand Up @@ -448,6 +460,10 @@ if UnitClassBase( 'player' ) == 'MONK' then
actual_combo = "none"
end

if tp_chi_pending then
gain( 2, "chi" )
end

if buff.rushing_jade_wind.up then setCooldown( "rushing_jade_wind", 0 ) end

spinning_crane_kick.count = nil
Expand Down

0 comments on commit d2295ea

Please sign in to comment.