Skip to content

Commit 8541fdf

Browse files
committed
Add GlanceBlock outcome to backend
1 parent f3fb06e commit 8541fdf

4 files changed

Lines changed: 33 additions & 23 deletions

File tree

proto/api.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ message TargetedActionMetrics {
215215
// # of times this action was a Glance.
216216
int32 glances = 8;
217217

218+
// # of times this action was a Glancing Block.
219+
int32 glance_blocks = 25;
220+
218221
// Total damage done to this target by this action.
219222
double damage = 9;
220223

sim/core/metrics_aggregator.go

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,19 @@ func (actionMetrics *ActionMetrics) ToProto(actionID ActionID) *proto.ActionMetr
148148

149149
// Metric totals for a spell against a specific target, for the current iteration.
150150
type SpellMetrics struct {
151-
Casts int32
152-
Misses int32
153-
Hits int32
154-
Crits int32
155-
Ticks int32
156-
CritTicks int32
157-
Crushes int32
158-
Dodges int32
159-
Glances int32
160-
Parries int32
161-
Blocks int32
162-
CritBlocks int32
151+
Casts int32
152+
Misses int32
153+
Hits int32
154+
Crits int32
155+
Ticks int32
156+
CritTicks int32
157+
Crushes int32
158+
Dodges int32
159+
Glances int32
160+
Parries int32
161+
Blocks int32
162+
CritBlocks int32
163+
GlanceBlocks int32
163164

164165
TotalDamage float64 // Damage done by all casts of this spell.
165166
TotalCritDamage float64 // Damage done by all critical casts of this spell.
@@ -178,17 +179,18 @@ type SpellMetrics struct {
178179
type TargetedActionMetrics struct {
179180
UnitIndex int32
180181

181-
Casts int32
182-
Hits int32
183-
Crits int32
184-
Ticks int32
185-
CritTicks int32
186-
Misses int32
187-
Dodges int32
188-
Parries int32
189-
Blocks int32
190-
CritBlocks int32
191-
Glances int32
182+
Casts int32
183+
Hits int32
184+
Crits int32
185+
Ticks int32
186+
CritTicks int32
187+
Misses int32
188+
Dodges int32
189+
Parries int32
190+
Blocks int32
191+
CritBlocks int32
192+
Glances int32
193+
GlanceBlocks int32
192194

193195
Damage float64
194196
CritDamage float64
@@ -219,6 +221,7 @@ func (tam *TargetedActionMetrics) ToProto() *proto.TargetedActionMetrics {
219221
Blocks: tam.Blocks,
220222
CritBlocks: tam.CritBlocks,
221223
Glances: tam.Glances,
224+
GlanceBlocks: tam.GlanceBlocks,
222225
Damage: tam.Damage,
223226
CritDamage: tam.CritDamage,
224227
TickDamage: tam.TickDamage,
@@ -378,6 +381,7 @@ func (unitMetrics *UnitMetrics) addSpellMetrics(spell *Spell, actionID ActionID,
378381
tam.Blocks += spellTargetMetrics.Blocks
379382
tam.CritBlocks += spellTargetMetrics.CritBlocks
380383
tam.Glances += spellTargetMetrics.Glances
384+
tam.GlanceBlocks += spellTargetMetrics.GlanceBlocks
381385
tam.Damage += spellTargetMetrics.TotalDamage
382386
tam.CritDamage += spellTargetMetrics.TotalCritDamage
383387
tam.TickDamage += spellTargetMetrics.TotalTickDamage

sim/core/sim_concurrent.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func (rsrc *raidSimResultCombiner) addActionMetrics(unit *proto.UnitMetrics, add
181181
baseTgt.Blocks += addTgt.Blocks
182182
baseTgt.CritBlocks += addTgt.CritBlocks
183183
baseTgt.Glances += addTgt.Glances
184+
baseTgt.GlanceBlocks += addTgt.GlanceBlocks
184185
baseTgt.Damage += addTgt.Damage
185186
baseTgt.CritDamage += addTgt.CritDamage
186187
baseTgt.TickDamage += addTgt.TickDamage

sim/core/spell_outcome.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ func (result *SpellResult) applyAttackTableBlock(sim *Simulation, spell *Spell,
590590
result.Outcome |= OutcomeBlock
591591
if result.DidCrit() {
592592
spell.SpellMetrics[result.Target.UnitIndex].CritBlocks++
593+
} else if result.DidGlance() {
594+
spell.SpellMetrics[result.Target.UnitIndex].GlanceBlocks++
593595
} else {
594596
spell.SpellMetrics[result.Target.UnitIndex].Blocks++
595597
}

0 commit comments

Comments
 (0)