Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
sanguinerarogue committed Sep 9, 2024
1 parent 99fa93a commit 7676c81
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
6 changes: 4 additions & 2 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1138,10 +1138,12 @@ func MeleeHunterBonusAura(target *Unit) *Aura {
ActionID: ActionID{SpellID: 456389},
Duration: time.Second * 30,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Dodge, -1)
// target.BaseDodgeChance -= 1
// target.AttackTables[target.CurrentTarget.UnitIndex][proto.CastType_CastTypeMainHand].BaseDodgeChance -= 1
},
OnExpire: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Dodge, 1)
// target.BaseDodgeChance += 1
// target.AttackTables[target.CurrentTarget.UnitIndex][proto.CastType_CastTypeMainHand].BaseDodgeChance += 1
},
})
}
Expand Down
23 changes: 12 additions & 11 deletions sim/core/spell_outcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (spell *Spell) outcomeMeleeWhite(sim *Simulation, result *SpellResult, atta

if unit.PseudoStats.InFrontOfTarget {
if !result.applyAttackTableMiss(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) &&
!result.applyAttackTableParry(spell, attackTable, roll, &chance) &&
!result.applyAttackTableGlance(spell, attackTable, roll, &chance, glanceRoll) &&
!result.applyAttackTableBlock(spell, attackTable, roll, &chance) &&
Expand All @@ -261,7 +261,7 @@ func (spell *Spell) outcomeMeleeWhite(sim *Simulation, result *SpellResult, atta
}
} else {
if !result.applyAttackTableMiss(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) &&
!result.applyAttackTableGlance(spell, attackTable, roll, &chance, glanceRoll) &&
!result.applyAttackTableCrit(spell, attackTable, roll, &chance, countHits) {
result.applyAttackTableHit(spell, countHits)
Expand All @@ -282,13 +282,13 @@ func (spell *Spell) outcomeMeleeSpecialHit(sim *Simulation, result *SpellResult,

if unit.PseudoStats.InFrontOfTarget {
if !result.applyAttackTableMissNoDWPenalty(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) &&
!result.applyAttackTableParry(spell, attackTable, roll, &chance) {
result.applyAttackTableHit(spell, countHits)
}
} else {
if !result.applyAttackTableMissNoDWPenalty(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) {
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) {
result.applyAttackTableHit(spell, countHits)
}
}
Expand All @@ -307,7 +307,7 @@ func (spell *Spell) outcomeMeleeSpecialHitAndCrit(sim *Simulation, result *Spell

if unit.PseudoStats.InFrontOfTarget {
if !result.applyAttackTableMissNoDWPenalty(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) &&
!result.applyAttackTableParry(spell, attackTable, roll, &chance) {
if result.applyAttackTableCritSeparateRoll(sim, spell, attackTable, countHits) {
result.applyAttackTableBlock(spell, attackTable, roll, &chance)
Expand All @@ -319,7 +319,7 @@ func (spell *Spell) outcomeMeleeSpecialHitAndCrit(sim *Simulation, result *Spell
}
} else {
if !result.applyAttackTableMissNoDWPenalty(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) &&
!result.applyAttackTableCritSeparateRoll(sim, spell, attackTable, countHits) {
result.applyAttackTableHit(spell, countHits)
}
Expand All @@ -338,9 +338,10 @@ func (spell *Spell) outcomeMeleeWeaponSpecialHitAndCrit(sim *Simulation, result
if spell.Unit.PseudoStats.InFrontOfTarget {
roll := sim.RandomFloat("White Hit Table")
chance := 0.0
unit := spell.Unit

if !result.applyAttackTableMissNoDWPenalty(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) &&
!result.applyAttackTableParry(spell, attackTable, roll, &chance) &&
!result.applyAttackTableBlock(spell, attackTable, roll, &chance) &&
!result.applyAttackTableCritSeparateRoll(sim, spell, attackTable, countHits) {
Expand Down Expand Up @@ -377,14 +378,14 @@ func (spell *Spell) outcomeMeleeWeaponSpecialNoCrit(sim *Simulation, result *Spe

if unit.PseudoStats.InFrontOfTarget {
if !result.applyAttackTableMissNoDWPenalty(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) &&
!result.applyAttackTableParry(spell, attackTable, roll, &chance) &&
!result.applyAttackTableBlock(spell, attackTable, roll, &chance) {
result.applyAttackTableHit(spell, countHits)
}
} else {
if !result.applyAttackTableMissNoDWPenalty(spell, attackTable, roll, &chance) &&
!result.applyAttackTableDodge(spell, attackTable, roll, &chance) {
!result.applyAttackTableDodge(spell, unit, attackTable, roll, &chance) {
result.applyAttackTableHit(spell, countHits)
}
}
Expand Down Expand Up @@ -684,8 +685,8 @@ func (result *SpellResult) applyAttackTableBlock(spell *Spell, attackTable *Atta
return false
}

func (result *SpellResult) applyAttackTableDodge(spell *Spell, attackTable *AttackTable, roll float64, chance *float64) bool {
*chance += max(0, attackTable.BaseDodgeChance)
func (result *SpellResult) applyAttackTableDodge(spell *Spell, unit *Unit, attackTable *AttackTable, roll float64, chance *float64) bool {
*chance += max(0, attackTable.BaseDodgeChance-unit.PseudoStats.DodgeReduction)

if roll < *chance {
result.Outcome = OutcomeDodge
Expand Down
5 changes: 3 additions & 2 deletions sim/hunter/item_sets_pve.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,20 @@ var ItemSetGiantstalkerProwess = core.NewItemSet(core.ItemSet{
// Your Mongoose Bite also reduces its target's chance to Dodge by 1% and increases your chance to hit by 1% for 30 sec.
2: func(agent core.Agent) {
hunter := agent.(HunterAgent).GetHunter()
hunter.PseudoStats.DodgeReduction += .01

debuffAuras := hunter.NewEnemyAuraArray(func(target *core.Unit, level int32) *core.Aura {
return target.RegisterAura(core.Aura{
Label: "S03 - Item - T1 - Hunter - Melee 2P Bonus",
ActionID: core.ActionID{SpellID: 456389},
Duration: time.Second * 30,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Dodge, -1)

aura.Unit.PseudoStats.BonusMeleeHitRatingTaken += 1 * core.MeleeHitRatingPerHitChance
aura.Unit.PseudoStats.BonusSpellHitRatingTaken += 1 * core.SpellHitRatingPerHitChance
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Dodge, 1)

aura.Unit.PseudoStats.BonusMeleeHitRatingTaken += 1 * core.MeleeHitRatingPerHitChance
aura.Unit.PseudoStats.BonusSpellHitRatingTaken += 1 * core.SpellHitRatingPerHitChance
},
Expand Down

0 comments on commit 7676c81

Please sign in to comment.