Skip to content

Commit

Permalink
Merge pull request #877 from adocoD/fixrangeandmsspeed
Browse files Browse the repository at this point in the history
Updated Base ranged range and MS
  • Loading branch information
kayla-glick authored Jul 8, 2024
2 parents 486886f + eb69a44 commit 6ae85d5
Show file tree
Hide file tree
Showing 21 changed files with 201 additions and 198 deletions.
8 changes: 4 additions & 4 deletions sim/core/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,14 @@ func (aa *AutoAttacks) startPull(sim *Simulation) {

aa.enabled = true

if aa.AutoSwingMelee && aa.mh.unit.DistanceFromTarget <= 5 {
if aa.AutoSwingMelee && aa.mh.unit.DistanceFromTarget <= MaxMeleeAttackDistance {
aa.mh.addWeaponAttack(sim, aa.mh.unit.SwingSpeed())
if aa.IsDualWielding {
aa.oh.addWeaponAttack(sim, aa.mh.curSwingSpeed)
}
}

if aa.AutoSwingRanged && aa.mh.unit.DistanceFromTarget >= 8 {
if aa.AutoSwingRanged && aa.mh.unit.DistanceFromTarget >= MinRangedAttackDistance {
aa.ranged.addWeaponAttack(sim, aa.ranged.unit.RangedSwingSpeed())
}
}
Expand Down Expand Up @@ -566,7 +566,7 @@ func (aa *AutoAttacks) EnableAutoSwing(sim *Simulation) {

aa.enabled = true

if aa.AutoSwingMelee && aa.mh.unit.DistanceFromTarget <= 5 {
if aa.AutoSwingMelee && aa.mh.unit.DistanceFromTarget <= MaxMeleeAttackDistance {
aa.mh.swingAt = max(aa.mh.swingAt, sim.CurrentTime, 0)
aa.mh.addWeaponAttack(sim, aa.mh.unit.SwingSpeed())
if aa.IsDualWielding {
Expand All @@ -575,7 +575,7 @@ func (aa *AutoAttacks) EnableAutoSwing(sim *Simulation) {
}
}

if aa.AutoSwingRanged && aa.mh.unit.DistanceFromTarget >= 8 {
if aa.AutoSwingRanged && aa.mh.unit.DistanceFromTarget >= MinRangedAttackDistance {
aa.ranged.swingAt = max(aa.ranged.swingAt, sim.CurrentTime, 0)
aa.ranged.addWeaponAttack(sim, aa.ranged.unit.RangedSwingSpeed())
}
Expand Down
3 changes: 3 additions & 0 deletions sim/core/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const SpellBatchWindow = time.Millisecond * 10
const DefaultAttackPowerPerDPS = 14.0
const ArmorPenPerPercentArmor = 13.99

const MaxMeleeAttackDistance = 5
const MinRangedAttackDistance = 12

const MissDodgeParryBlockCritChancePerDefense = 0.04

const DefenseRatingToChanceReduction = (1.0 / DefenseRatingPerDefense) * MissDodgeParryBlockCritChancePerDefense / 100
Expand Down
2 changes: 1 addition & 1 deletion sim/core/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func (unit *Unit) MoveTo(moveRange float64, sim *Simulation) {
unit.moveSpell.Cast(sim, unit.CurrentTarget)

sim.AddPendingAction(NewPeriodicAction(sim, PeriodicActionOptions{
Period: time.Millisecond * 500,
Period: time.Millisecond * 1000 / 7,
NumTicks: int(moveTicks),
TickImmediately: false,

Expand Down
Loading

0 comments on commit 6ae85d5

Please sign in to comment.