Skip to content

Commit

Permalink
core: only roll for hit if we can actually miss
Browse files Browse the repository at this point in the history
This changes tests because we call RandomFloat less.
  • Loading branch information
Tharre committed Jun 26, 2023
1 parent d2511a9 commit 380ae35
Show file tree
Hide file tree
Showing 39 changed files with 6,035 additions and 6,035 deletions.
2 changes: 1 addition & 1 deletion sim/core/spell_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (spell *Spell) SpellChanceToMiss(attackTable *AttackTable) float64 {
return math.Max(0, attackTable.BaseSpellMissChance-spell.SpellHitChance(attackTable.Defender))
}
func (spell *Spell) MagicHitCheck(sim *Simulation, attackTable *AttackTable) bool {
return sim.RandomFloat("Magical Hit Roll") > spell.SpellChanceToMiss(attackTable)
return sim.Proc(1.0-spell.SpellChanceToMiss(attackTable), "Magical Hit Roll")
}

func (spell *Spell) spellCritRating(target *Unit) float64 {
Expand Down
Loading

0 comments on commit 380ae35

Please sign in to comment.