-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from wowsims/hunter
Hunter: Carve and Explosive Shot runes
- Loading branch information
Showing
7 changed files
with
243 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package hunter | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/wowsims/sod/sim/core" | ||
"github.com/wowsims/sod/sim/core/proto" | ||
) | ||
|
||
func (hunter *Hunter) registerCarveSpell() { | ||
if !hunter.HasRune(proto.HunterRune_RuneHandsCarve) { | ||
return | ||
} | ||
|
||
actionID := core.ActionID{SpellID: 425711} | ||
numHits := hunter.Env.GetNumTargets() | ||
results := make([]*core.SpellResult, numHits) | ||
|
||
if hunter.AutoAttacks.IsDualWielding { | ||
hunter.CarveOh = hunter.RegisterSpell(core.SpellConfig{ | ||
ActionID: actionID.WithTag(1), | ||
SpellSchool: core.SpellSchoolPhysical, | ||
ProcMask: core.ProcMaskMeleeOHSpecial, | ||
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagNoOnCastComplete, | ||
|
||
DamageMultiplier: 1, | ||
CritMultiplier: hunter.critMultiplier(true, hunter.CurrentTarget), | ||
}) | ||
} | ||
|
||
hunter.CarveMh = hunter.RegisterSpell(core.SpellConfig{ | ||
ActionID: core.ActionID{SpellID: 425711}, | ||
SpellSchool: core.SpellSchoolPhysical, | ||
ProcMask: core.ProcMaskMeleeMHSpecial, | ||
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL | core.SpellFlagIncludeTargetBonusDamage, | ||
|
||
ManaCost: core.ManaCostOptions{ | ||
BaseCost: 0.04, | ||
}, | ||
Cast: core.CastConfig{ | ||
DefaultCast: core.Cast{ | ||
GCD: core.GCDDefault, | ||
}, | ||
IgnoreHaste: true, // Hunter GCD is locked at 1.5s | ||
CD: core.Cooldown{ | ||
Timer: hunter.NewTimer(), | ||
Duration: time.Second * 6, | ||
}, | ||
}, | ||
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool { | ||
return hunter.DistanceFromTarget <= 5 | ||
}, | ||
|
||
DamageMultiplier: 1, | ||
CritMultiplier: hunter.critMultiplier(true, hunter.CurrentTarget), | ||
ThreatMultiplier: 1, | ||
|
||
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { | ||
curTarget := target | ||
for hitIndex := int32(0); hitIndex < numHits; hitIndex++ { | ||
baseDamage := 0.5*spell.Unit.MHNormalizedWeaponDamage(sim, spell.MeleeAttackPower()) + | ||
spell.BonusWeaponDamage() | ||
|
||
results[hitIndex] = spell.CalcDamage(sim, curTarget, baseDamage, spell.OutcomeMeleeWeaponSpecialHitAndCrit) | ||
|
||
curTarget = sim.Environment.NextTargetUnit(curTarget) | ||
} | ||
|
||
curTarget = target | ||
for hitIndex := int32(0); hitIndex < numHits; hitIndex++ { | ||
spell.DealDamage(sim, results[hitIndex]) | ||
curTarget = sim.Environment.NextTargetUnit(curTarget) | ||
} | ||
|
||
if hunter.CarveOh != nil { | ||
hunter.CarveOh.Cast(sim, target) | ||
|
||
curTarget = target | ||
for hitIndex := int32(0); hitIndex < numHits; hitIndex++ { | ||
baseDamage := 0.5*spell.Unit.OHNormalizedWeaponDamage(sim, spell.MeleeAttackPower()) + | ||
spell.BonusWeaponDamage() | ||
|
||
results[hitIndex] = hunter.CarveOh.CalcDamage(sim, curTarget, baseDamage, hunter.CarveOh.OutcomeMeleeWeaponSpecialHitAndCrit) | ||
|
||
curTarget = sim.Environment.NextTargetUnit(curTarget) | ||
} | ||
|
||
curTarget = target | ||
for hitIndex := int32(0); hitIndex < numHits; hitIndex++ { | ||
hunter.CarveOh.DealDamage(sim, results[hitIndex]) | ||
curTarget = sim.Environment.NextTargetUnit(curTarget) | ||
} | ||
} | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
package hunter | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/wowsims/sod/sim/core" | ||
"github.com/wowsims/sod/sim/core/proto" | ||
) | ||
|
||
func (hunter *Hunter) registerExplosiveShotSpell(timer *core.Timer) { | ||
if !hunter.HasRune(proto.HunterRune_RuneHandsExplosiveShot) { | ||
return | ||
} | ||
|
||
actionID := core.ActionID{SpellID: 409552} | ||
numHits := hunter.Env.GetNumTargets() | ||
|
||
level := float64(hunter.GetCharacter().Level) | ||
baseCalc := (2.976264 + 0.641066*level + 0.022519*level*level) | ||
baseLowDamage := baseCalc * 0.36 | ||
baseHighDamage := baseCalc * 0.54 | ||
|
||
manaCostMultiplier := 1 - 0.02*float64(hunter.Talents.Efficiency) | ||
if hunter.HasRune(proto.HunterRune_RuneChestMasterMarksman) { | ||
manaCostMultiplier -= 0.25 | ||
} | ||
hunter.ExplosiveShot = hunter.RegisterSpell(core.SpellConfig{ | ||
ActionID: actionID, | ||
SpellSchool: core.SpellSchoolFire, | ||
ProcMask: core.ProcMaskRangedSpecial, | ||
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL | core.SpellFlagIgnoreResists | core.SpellFlagBinary, | ||
MissileSpeed: 24, | ||
|
||
ManaCost: core.ManaCostOptions{ | ||
BaseCost: 0.035, | ||
Multiplier: manaCostMultiplier, | ||
}, | ||
Cast: core.CastConfig{ | ||
DefaultCast: core.Cast{ | ||
GCD: core.GCDDefault, | ||
}, | ||
IgnoreHaste: true, | ||
CD: core.Cooldown{ | ||
Timer: timer, | ||
Duration: time.Second * 6, | ||
}, | ||
}, | ||
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool { | ||
return hunter.DistanceFromTarget >= 8 | ||
}, | ||
|
||
BonusCritRating: 0, | ||
DamageMultiplierAdditive: 1, | ||
DamageMultiplier: 1, | ||
CritMultiplier: hunter.critMultiplier(true, hunter.CurrentTarget), | ||
ThreatMultiplier: 1, | ||
|
||
Dot: core.DotConfig{ | ||
Aura: core.Aura{ | ||
Label: fmt.Sprintf("ExplosiveShot-%d", actionID.SpellID), | ||
}, | ||
NumberOfTicks: 2, | ||
TickLength: time.Second * 1, | ||
OnSnapshot: func(sim *core.Simulation, target *core.Unit, dot *core.Dot, isRollover bool) { | ||
dot.SnapshotBaseDamage = sim.Roll(baseLowDamage, baseHighDamage) + 0.039*dot.Spell.RangedAttackPower(target) | ||
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex] | ||
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable) | ||
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable) | ||
}, | ||
OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) { | ||
dot.CalcAndDealPeriodicSnapshotDamage(sim, target, dot.OutcomeTickSnapshotCrit) | ||
}, | ||
}, | ||
|
||
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { | ||
baseDamage := sim.Roll(baseLowDamage, baseHighDamage) + 0.039*spell.RangedAttackPower(target) | ||
result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeRangedHitAndCrit) | ||
|
||
spell.WaitTravelTime(sim, func(s *core.Simulation) { | ||
spell.DealDamage(sim, result) | ||
|
||
if result.Landed() { | ||
curTarget := target | ||
for hitIndex := int32(0); hitIndex < numHits; hitIndex++ { | ||
if curTarget != target { | ||
baseDamage = sim.Roll(baseLowDamage, baseHighDamage) + 0.039*spell.RangedAttackPower(curTarget) | ||
spell.CalcAndDealDamage(sim, curTarget, baseDamage, spell.OutcomeRangedCritOnly) | ||
} | ||
|
||
dot := spell.Dot(curTarget) | ||
dot.Apply(sim) | ||
|
||
curTarget = sim.Environment.NextTargetUnit(curTarget) | ||
} | ||
} | ||
}) | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.