From 185e9929b4340ba1ad42249945bf078d3cfb1925 Mon Sep 17 00:00:00 2001 From: Marisa Date: Sun, 30 Jan 2022 12:05:14 -0800 Subject: [PATCH] Resolve several Warrior Flurry issues causing slightly inflated uptime --- .../{shaman => common}/talents/Flurry.kt | 29 +++++++++++++++---- .../kotlin/character/classes/shaman/Shaman.kt | 1 + .../character/classes/warrior/Warrior.kt | 3 +- .../classes/warrior/abilities/HeroicStrike.kt | 17 ++++++++++- .../classes/warrior/talents/Cruelty.kt | 2 +- .../presets/samples/warrior_kebab_phase3.yml | 1 - 6 files changed, 43 insertions(+), 10 deletions(-) rename src/commonMain/kotlin/character/classes/{shaman => common}/talents/Flurry.kt (75%) diff --git a/src/commonMain/kotlin/character/classes/shaman/talents/Flurry.kt b/src/commonMain/kotlin/character/classes/common/talents/Flurry.kt similarity index 75% rename from src/commonMain/kotlin/character/classes/shaman/talents/Flurry.kt rename to src/commonMain/kotlin/character/classes/common/talents/Flurry.kt index fd0a2a232..83bd527c0 100644 --- a/src/commonMain/kotlin/character/classes/shaman/talents/Flurry.kt +++ b/src/commonMain/kotlin/character/classes/common/talents/Flurry.kt @@ -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 @@ -27,7 +28,9 @@ 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?, ability: Ability?, event: Event?) { sp.consumeBuff(buff) @@ -35,6 +38,21 @@ class Flurry(currentRank: Int) : Talent(currentRank) { } } + val hsProc = fun(buff: Buff): Proc { + return object : Proc() { + override val triggers: List = listOf( + Trigger.MELEE_YELLOW_HIT + ) + override val type: Type = Type.STATIC + override fun proc(sp: SimParticipant, items: List?, 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" @@ -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 @@ -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 = listOf(chargeProc) + override fun procs(sp: SimParticipant): List = listOf(chargeProc, hsProc) } val onCritProc = object : Proc() { diff --git a/src/commonMain/kotlin/character/classes/shaman/Shaman.kt b/src/commonMain/kotlin/character/classes/shaman/Shaman.kt index 01c9b92df..d92434b17 100644 --- a/src/commonMain/kotlin/character/classes/shaman/Shaman.kt +++ b/src/commonMain/kotlin/character/classes/shaman/Shaman.kt @@ -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 diff --git a/src/commonMain/kotlin/character/classes/warrior/Warrior.kt b/src/commonMain/kotlin/character/classes/warrior/Warrior.kt index a3ea27cfc..c05b06b2f 100644 --- a/src/commonMain/kotlin/character/classes/warrior/Warrior.kt +++ b/src/commonMain/kotlin/character/classes/warrior/Warrior.kt @@ -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 diff --git a/src/commonMain/kotlin/character/classes/warrior/abilities/HeroicStrike.kt b/src/commonMain/kotlin/character/classes/warrior/abilities/HeroicStrike.kt index 548310676..c46952939 100644 --- a/src/commonMain/kotlin/character/classes/warrior/abilities/HeroicStrike.kt +++ b/src/commonMain/kotlin/character/classes/warrior/abilities/HeroicStrike.kt @@ -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 @@ -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 @@ -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 @@ -86,6 +100,7 @@ class HeroicStrike : Ability() { } override fun cast(sp: SimParticipant) { + sp.addBuff(genericQueuedBuff) sp.replaceNextMainHandAutoAttack(nextHitAbility) if(sp.isDualWielding()) { sp.addBuff(offHandHitBuff) diff --git a/src/commonMain/kotlin/character/classes/warrior/talents/Cruelty.kt b/src/commonMain/kotlin/character/classes/warrior/talents/Cruelty.kt index 8f8f004ff..14fa7f512 100644 --- a/src/commonMain/kotlin/character/classes/warrior/talents/Cruelty.kt +++ b/src/commonMain/kotlin/character/classes/warrior/talents/Cruelty.kt @@ -1,4 +1,4 @@ -package character.classes.shaman.talents +package character.classes.warrior.talents import character.Buff import character.Stats diff --git a/ui/src/presets/samples/warrior_kebab_phase3.yml b/ui/src/presets/samples/warrior_kebab_phase3.yml index 6073750a6..dd2c7ce3a 100644 --- a/ui/src/presets/samples/warrior_kebab_phase3.yml +++ b/ui/src/presets/samples/warrior_kebab_phase3.yml @@ -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