Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Shattering Throw raid buff #1319

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ message IndividualBuffs {
int32 hand_of_sacrifice_count = 25;
int32 guardian_spirit_count = 26;
int32 rallying_cry_count = 102;
int32 shattering_throw_count = 103;
bool focus_magic = 22;
bool dark_intent = 27;

Expand Down
2 changes: 1 addition & 1 deletion sim/core/armor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func TestDamageReductionFromArmor(t *testing.T) {
}

// Major Multi
shatteringThrowAura := ShatteringThrowAura(&target)
shatteringThrowAura := ShatteringThrowAura(&target, attacker.UnitIndex)
shatteringThrowAura.Activate(&sim)
expectedDamageReduction = 0.244387
if !WithinToleranceFloat64(1-expectedDamageReduction, attackTable.GetArmorDamageModifier(spell), tolerance) {
Expand Down
51 changes: 27 additions & 24 deletions sim/core/buffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ func applyBuffEffects(agent Agent, raidBuffs *proto.RaidBuffs, _ *proto.PartyBuf
registerPainSuppressionCD(agent, individualBuffs.PainSuppressionCount)
registerGuardianSpiritCD(agent, individualBuffs.GuardianSpiritCount)
registerRallyingCryCD(agent, individualBuffs.RallyingCryCount)
registerShatteringThrowCD(agent, individualBuffs.ShatteringThrowCount)

if individualBuffs.FocusMagic {
FocusMagicAura(nil, &character.Unit)
Expand Down Expand Up @@ -1677,30 +1678,32 @@ func RallyingCryAura(character *Character, actionTag int32) *Aura {

const ShatteringThrowCD = time.Minute * 5

// func registerShatteringThrowCD(agent Agent, numShatteringThrows int32) {
// if numShatteringThrows == 0 {
// return
// }

// stAura := ShatteringThrowAura(agent.GetCharacter().Env.Encounter.TargetUnits[0])

// registerExternalConsecutiveCDApproximation(
// agent,
// externalConsecutiveCDApproximation{
// ActionID: ActionID{SpellID: 64382, Tag: -1},
// AuraTag: ShatteringThrowAuraTag,
// CooldownPriority: CooldownPriorityDefault,
// AuraDuration: ShatteringThrowDuration,
// AuraCD: ShatteringThrowCD,
// Type: CooldownTypeDPS,

// ShouldActivate: func(sim *Simulation, unit *Unit) bool {
// return true
// },
// AddAura: func(sim *Simulation, unit *Unit) { stAura.Activate(sim) },
// },
// numShatteringThrows)
// }
func registerShatteringThrowCD(agent Agent, numShatteringThrows int32) {
if numShatteringThrows == 0 {
return
}

stAura := ShatteringThrowAura(agent.GetCharacter().Env.Encounter.TargetUnits[0], -1)

registerExternalConsecutiveCDApproximation(
agent,
externalConsecutiveCDApproximation{
ActionID: ActionID{SpellID: 64382, Tag: -1},
AuraTag: ShatteringThrowAuraTag,
CooldownPriority: CooldownPriorityDefault,
AuraDuration: ShatteringThrowDuration,
AuraCD: ShatteringThrowCD,
Type: CooldownTypeDPS,

ShouldActivate: func(sim *Simulation, character *Character) bool {
return true
},
AddAura: func(sim *Simulation, character *Character) {
stAura.Activate(sim)
},
},
numShatteringThrows)
}

var InnervateAuraTag = "Innervate"

Expand Down
13 changes: 6 additions & 7 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,13 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
if debuffs.FaerieFire && targetIdx == 0 {
aura := FaerieFireAura(target)
ScheduledMajorArmorAura(aura, PeriodicActionOptions{
Period: time.Millisecond * 1500,
NumTicks: 3,
TickImmediately: true,
Priority: ActionPriorityDOT,
Period: time.Millisecond * 1500,
NumTicks: 1,
Priority: ActionPriorityDOT,
OnAction: func(sim *Simulation) {
aura.Activate(sim)
if aura.IsActive() {
aura.AddStack(sim)
aura.SetStacks(sim, 3)
}
},
}, raid)
Expand Down Expand Up @@ -476,13 +475,13 @@ func ExposeArmorAura(target *Unit, hasGlyph bool) *Aura {
var ShatteringThrowAuraTag = "ShatteringThrow"
var ShatteringThrowDuration = time.Second * 10

func ShatteringThrowAura(target *Unit) *Aura {
func ShatteringThrowAura(target *Unit, actionTag int32) *Aura {
armorReduction := 0.2

return target.GetOrRegisterAura(Aura{
Label: "Shattering Throw",
Tag: ShatteringThrowAuraTag,
ActionID: ActionID{SpellID: 64382},
ActionID: ActionID{SpellID: 64382, Tag: actionTag},
Duration: ShatteringThrowDuration,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.PseudoStats.ArmorMultiplier *= (1.0 - armorReduction)
Expand Down
8 changes: 0 additions & 8 deletions sim/warrior/glyphs.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ func (warrior *Warrior) applyMinorGlyphs() {
FloatValue: 0.5,
})
}

if warrior.HasMinorGlyph(proto.WarriorMinorGlyph_GlyphOfShatteringThrow) {
warrior.AddStaticMod(core.SpellModConfig{
ClassMask: SpellMaskShatteringThrow,
Kind: core.SpellMod_CastTime_Pct,
FloatValue: -1.0,
})
}
}

func (warrior *Warrior) ApplyGlyphs() {
Expand Down
15 changes: 8 additions & 7 deletions sim/warrior/shattering_throw.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,29 @@ import (
"time"

"github.com/wowsims/cata/sim/core"
"github.com/wowsims/cata/sim/core/proto"
)

func (warrior *Warrior) RegisterShatteringThrowCD() {
hasGlyph := warrior.HasMinorGlyph(proto.WarriorMinorGlyph_GlyphOfShatteringThrow)
shattDebuffs := warrior.NewEnemyAuraArray(core.ShatteringThrowAura)
shattDebuffs := warrior.NewEnemyAuraArray(func(unit *core.Unit) *core.Aura {
return core.ShatteringThrowAura(unit, warrior.UnitIndex)
})

ShatteringThrowSpell := warrior.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 64382},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,
ClassSpellMask: SpellMaskShatteringThrow | SpellMaskSpecialAttack,
MaxRange: 30,
MissileSpeed: 50,

RageCost: core.RageCostOptions{
Cost: 25,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: core.GCDDefault,
CastTime: core.TernaryDuration(hasGlyph, time.Duration(0), time.Millisecond*1500),
CastTime: time.Millisecond * 1500,
},
CD: core.Cooldown{
Timer: warrior.NewTimer(),
Expand All @@ -37,14 +38,14 @@ func (warrior *Warrior) RegisterShatteringThrowCD() {
} else {
warrior.AutoAttacks.StopMeleeUntil(sim, sim.CurrentTime+cast.CastTime, false)
}
if !hasGlyph && !warrior.StanceMatches(BattleStance) && warrior.BattleStance.IsReady(sim) {
if !warrior.StanceMatches(BattleStance) && warrior.BattleStance.IsReady(sim) {
warrior.BattleStance.Cast(sim, nil)
}
},
IgnoreHaste: true,
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return warrior.StanceMatches(BattleStance) || hasGlyph
return warrior.StanceMatches(BattleStance)
},

DamageMultiplier: 1,
Expand Down
12 changes: 11 additions & 1 deletion ui/core/components/inputs/buffs_debuffs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,14 @@ export const ManaTideTotem = makeMultistateRaidBuffInput({ actionId: ActionId.fr
export const Innervate = makeMultistateIndividualBuffInput({ actionId: ActionId.fromSpellId(29166), numStates: 11, fieldName: 'innervateCount' });
export const PowerInfusion = makeMultistateIndividualBuffInput({ actionId: ActionId.fromSpellId(10060), numStates: 11, fieldName: 'powerInfusionCount' });
export const FocusMagic = makeBooleanIndividualBuffInput({ actionId: ActionId.fromSpellId(54648), fieldName: 'focusMagic' });
export const TricksOfTheTrade = makeTristateIndividualBuffInput({ actionId: ActionId.fromItemId(45767), impId: ActionId.fromSpellId(57933), fieldName: 'tricksOfTheTrade' });
export const TricksOfTheTrade = makeTristateIndividualBuffInput({
actionId: ActionId.fromItemId(45767),
impId: ActionId.fromSpellId(57933),
fieldName: 'tricksOfTheTrade',
});
export const UnholyFrenzy = makeMultistateIndividualBuffInput({ actionId: ActionId.fromSpellId(49016), numStates: 11, fieldName: 'unholyFrenzyCount' });
export const DarkIntent = makeBooleanIndividualBuffInput({ actionId: ActionId.fromSpellId(85759), fieldName: 'darkIntent' });
export const ShatteringThrow = makeMultistateIndividualBuffInput({ actionId: ActionId.fromSpellId(64382), numStates: 11, fieldName: 'shatteringThrowCount' });

///////////////////////////////////////////////////////////////////////////
// DEBUFFS
Expand Down Expand Up @@ -391,6 +396,11 @@ export const RAID_BUFFS_MISC_CONFIG = [
picker: IconPicker,
stats: [Stat.StatAttackPower, Stat.StatRangedAttackPower],
},
{
config: ShatteringThrow,
picker: IconPicker,
stats: [Stat.StatAttackPower, Stat.StatRangedAttackPower],
},
] as IconPickerStatOption[];

export const DEBUFFS_CONFIG = [
Expand Down
4 changes: 3 additions & 1 deletion ui/core/proto_utils/action_id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ export class ActionId {
}
break;
case 'Shattering Throw':
if (tag === playerIndex) {
if (tag === -1) {
name += ' (raid)';
} else {
name += ` (self)`;
}
break;
Expand Down
7 changes: 1 addition & 6 deletions ui/core/talents/warrior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ export const warriorGlyphsConfig: GlyphsConfig = {
name: 'Glyph of Intimidating Shout',
description: 'All targets of your Intimidating Shout now tremble in place instead of fleeing in fear.',
iconUrl: 'https://wow.zamimg.com/images/wow/icons/large/ability_golemthunderclap.jpg',
},
[WarriorMinorGlyph.GlyphOfShatteringThrow]: {
name: 'Glyph of Shattering Throw',
description: 'Your Shattering Throw is now instant and can be used in any stance, but it no longer removes invulnerabilities and cannot be used on players or player-controlled targets.',
iconUrl: 'https://wow.zamimg.com/images/wow/icons/large/inv_misc_questionmark.jpg',
},
}
},
};
2 changes: 1 addition & 1 deletion ui/scss/core/components/_icon_picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
left: 0;
right: 0;
text-align: center;
background: var(--black-alpha-30);
background: var(--bs-black-alpha-50);
color: var(--bs-success);
font-size: 0.625rem;
font-weight: bold;
Expand Down
Loading