Skip to content

Commit

Permalink
Resolve several Warrior Flurry issues causing slightly inflated uptime
Browse files Browse the repository at this point in the history
  • Loading branch information
secretbis committed Jan 30, 2022
1 parent 90a8994 commit 185e992
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package character.classes.shaman.talents
package character.classes.common.talents

import character.*
import character.classes.shaman.Shaman
import character.classes.warrior.abilities.HeroicStrike
import data.itemsets.CataclysmHarness
import data.model.Item
import sim.Event
Expand All @@ -27,14 +28,31 @@ class Flurry(currentRank: Int) : Talent(currentRank) {
)
override val type: Type = Type.STATIC
// Shaman Flurry stacks are not consumed on every hit - a small ICD is observed on the beta
override fun cooldownMs(sp: SimParticipant): Int = 500
override fun cooldownMs(sp: SimParticipant): Int {
return if(sp.character.klass is Shaman) 500 else 0
}

override fun proc(sp: SimParticipant, items: List<Item>?, ability: Ability?, event: Event?) {
sp.consumeBuff(buff)
}
}
}

val hsProc = fun(buff: Buff): Proc {
return object : Proc() {
override val triggers: List<Trigger> = listOf(
Trigger.MELEE_YELLOW_HIT
)
override val type: Type = Type.STATIC
override fun proc(sp: SimParticipant, items: List<Item>?, ability: Ability?, event: Event?) {
// TODO: Cleave
if(ability?.name == HeroicStrike.name) {
sp.consumeBuff(buff)
}
}
}
}

val hasteBuff = object : Buff() {
override val name: String = "Flurry"
override val icon: String = "ability_ghoulfrenzy.jpg"
Expand All @@ -43,11 +61,11 @@ class Flurry(currentRank: Int) : Talent(currentRank) {

// Increase melee haste for as long as we have charges
override fun modifyStats(sp: SimParticipant): Stats {
val talentRanks = sp.character.klass.talents[Flurry.name]?.currentRank ?: 0
val talentRanks = sp.character.klass.talents[Companion.name]?.currentRank ?: 0

val state = state(sp)
val modifier = if (talentRanks > 0 && state.currentCharges > 0) {
1.05 + (0.05 * talentRanks)
1.0 + (0.05 * talentRanks)
} else 1.0

// If this is Shaman flurry, check the T5 bonus
Expand All @@ -62,9 +80,10 @@ class Flurry(currentRank: Int) : Talent(currentRank) {
}

val chargeProc = chargeProc(this)
val hsProc = hsProc(this)

// Proc off of melee auto hits to reduce our stacks
override fun procs(sp: SimParticipant): List<Proc> = listOf(chargeProc)
override fun procs(sp: SimParticipant): List<Proc> = listOf(chargeProc, hsProc)
}

val onCritProc = object : Proc() {
Expand Down
1 change: 1 addition & 0 deletions src/commonMain/kotlin/character/classes/shaman/Shaman.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package character.classes.shaman

import character.*
import character.classes.common.talents.Flurry
import character.classes.shaman.abilities.*
import character.classes.shaman.talents.*
import character.classes.shaman.talents.ElementalMastery as ElementalMasteryTalent
Expand Down
3 changes: 1 addition & 2 deletions src/commonMain/kotlin/character/classes/warrior/Warrior.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package character.classes.warrior

import character.*
import character.classes.shaman.talents.Cruelty
import character.classes.shaman.talents.Flurry
import character.classes.common.talents.Flurry
import character.classes.warrior.abilities.*
import character.classes.warrior.abilities.Bloodthirst
import character.classes.warrior.abilities.DeathWish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class HeroicStrike : Ability() {

// Model the off-hand hit bonus when HS is queued
val offHandHitBuff = object : Buff() {
override val name: String = "Heroic Strike (Queued)"
override val name: String = "Heroic Strike (Queued, DW)"
override val icon: String = "ability_rogue_ambush.jpg"
override val durationMs: Int = -1
override val maxCharges: Int = 1
Expand All @@ -42,6 +42,19 @@ class HeroicStrike : Ability() {
}
}

val genericQueuedBuff = object : Buff() {
override val name: String = "Heroic Strike (Queued)"
override val icon: String = "ability_rogue_ambush.jpg"
override val durationMs: Int = -1
override val maxCharges: Int = 1
override val hidden: Boolean = true
}

override fun available(sp: SimParticipant): Boolean {
val isQueued = sp.buffs[genericQueuedBuff.name] != null
return !isQueued && super.available(sp)
}

val bonusDamage = 176.0
val nextHitAbility = object : Ability() {
override val id: Int = 29707
Expand All @@ -52,6 +65,7 @@ class HeroicStrike : Ability() {

override fun cast(sp: SimParticipant) {
sp.consumeBuff(offHandHitBuff)
sp.consumeBuff(genericQueuedBuff)

val mhItem = sp.character.gear.mainHand
val damage = Melee.baseDamageRoll(sp, mhItem, isNormalized = false) + bonusDamage
Expand Down Expand Up @@ -86,6 +100,7 @@ class HeroicStrike : Ability() {
}

override fun cast(sp: SimParticipant) {
sp.addBuff(genericQueuedBuff)
sp.replaceNextMainHandAutoAttack(nextHitAbility)
if(sp.isDualWielding()) {
sp.addBuff(offHandHitBuff)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package character.classes.shaman.talents
package character.classes.warrior.talents

import character.Buff
import character.Stats
Expand Down
1 change: 0 additions & 1 deletion ui/src/presets/samples/warrior_kebab_phase3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ rotation:
- name: Mortal Strike
- name: Heroic Strike
criteria:
# Cast HS if we have 60 rage or more
- type: RESOURCE_PCT_GTE
pct: 60
resourceType: RAGE
Expand Down

0 comments on commit 185e992

Please sign in to comment.