From 38ada9dc7057f8bf8cf428b4fa31ccd8b6aae23a Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 2 Jul 2023 15:07:09 -0400 Subject: [PATCH] add crystal yield (#3236) --- proto/common.proto | 2 ++ sim/core/debuffs.go | 18 ++++++++++++++++++ ui/core/components/icon_inputs.ts | 1 + .../individual_sim_ui/settings_tab.ts | 1 + 4 files changed, 22 insertions(+) diff --git a/proto/common.proto b/proto/common.proto index 72c30b3a26..104189be97 100644 --- a/proto/common.proto +++ b/proto/common.proto @@ -601,6 +601,8 @@ message Debuffs { // 1 = normal, 2 = talented, 3 = talented+glyphed int32 hunters_mark = 35; + + bool crystal_yield = 38; } enum MobType { diff --git a/sim/core/debuffs.go b/sim/core/debuffs.go index f220fa0a4d..81ae75d7c4 100644 --- a/sim/core/debuffs.go +++ b/sim/core/debuffs.go @@ -57,6 +57,10 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai MakePermanent(SporeCloudAura(target)) } + if debuffs.CrystalYield { + MakePermanent(CrystalYieldAura(target)) + } + if debuffs.Mangle && targetIdx == 0 { MakePermanent(MangleAura(target)) } else if debuffs.Trauma && targetIdx == 0 { @@ -952,3 +956,17 @@ func critBonusEffect(aura *Aura, critBonus float64) *ExclusiveEffect { }, }) } + +func CrystalYieldAura(target *Unit) *Aura { + return target.GetOrRegisterAura(Aura{ + Label: "Crystal Yield", + ActionID: ActionID{SpellID: 15235}, + Duration: 2 * time.Minute, + OnGain: func(aura *Aura, sim *Simulation) { + aura.Unit.stats[stats.Armor] -= 200 + }, + OnExpire: func(aura *Aura, sim *Simulation) { + aura.Unit.stats[stats.Armor] += 200 + }, + }) +} diff --git a/ui/core/components/icon_inputs.ts b/ui/core/components/icon_inputs.ts index ec74f5e710..b3174defea 100644 --- a/ui/core/components/icon_inputs.ts +++ b/ui/core/components/icon_inputs.ts @@ -251,6 +251,7 @@ export const JudgementOfWisdom = withLabel(makeBooleanDebuffInput(ActionId.fromS export const JudgementOfLight = makeBooleanDebuffInput(ActionId.fromSpellId(20271), 'judgementOfLight'); export const ShatteringThrow = makeMultistateIndividualBuffInput(ActionId.fromSpellId(64382), 20, 'shatteringThrows'); export const GiftOfArthas = makeBooleanDebuffInput(ActionId.fromSpellId(11374), 'giftOfArthas'); +export const CrystalYield = makeBooleanDebuffInput(ActionId.fromSpellId(15235), 'crystalYield'); // Consumes export const ThermalSapper = makeBooleanConsumeInput(ActionId.fromItemId(42641), 'thermalSapper'); diff --git a/ui/core/components/individual_sim_ui/settings_tab.ts b/ui/core/components/individual_sim_ui/settings_tab.ts index fd6f58796c..484e56c6e8 100644 --- a/ui/core/components/individual_sim_ui/settings_tab.ts +++ b/ui/core/components/individual_sim_ui/settings_tab.ts @@ -349,6 +349,7 @@ export class SettingsTab extends SimTab { { item: IconInputs.JudgementOfLight, stats: [Stat.StatStamina] }, { item: IconInputs.ShatteringThrow, stats: [Stat.StatArmorPenetration] }, { item: IconInputs.GiftOfArthas, stats: [Stat.StatAttackPower, Stat.StatRangedAttackPower] }, + { item: IconInputs.CrystalYield, stats: [Stat.StatArmorPenetration] }, ] as Array, any>>>); if (miscDebuffOptions.length > 0) { new MultiIconPicker(contentBlock.bodyElement, this.simUI.player, {