Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A first pass on warlock #15

Merged
merged 8 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed assets/img/tank_warlock_background.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ HTML_INDECIES := ui/balance_druid/index.html \
ui/healing_priest/index.html \
ui/shadow_priest/index.html \
ui/warlock/index.html \
ui/tank_warlock/index.html \
ui/warrior/index.html \
ui/tank_warrior/index.html \
ui/raid/index.html \
Expand Down
5 changes: 2 additions & 3 deletions proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import "shaman.proto";
import "warlock.proto";
import "warrior.proto";

// NextIndex: 49
// NextIndex: 47
message Player {
// Label used for logging.
string name = 1;
Expand Down Expand Up @@ -76,9 +76,8 @@ message Player {
ElementalShaman elemental_shaman = 33;
EnhancementShaman enhancement_shaman = 34;
RestorationShaman restoration_shaman = 35;
WardenShaman warden_shaman = 47;
WardenShaman warden_shaman = 39;
Warlock warlock = 36;
TankWarlock tank_warlock = 39;
Warrior warrior = 37;
TankWarrior tank_warrior = 38;
}
Expand Down
5 changes: 2 additions & 3 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package proto;

option go_package = "./proto";

// NextIndex: 24
// NextIndex: 23
enum Spec {
SpecBalanceDruid = 0;
SpecFeralDruid = 12;
Expand All @@ -12,7 +12,7 @@ enum Spec {
SpecElementalShaman = 1;
SpecEnhancementShaman = 9;
SpecRestorationShaman = 19;
SpecWardenShaman = 23;
SpecWardenShaman = 21;
SpecHunter = 8;
SpecMage = 2;
SpecHolyPaladin = 20;
Expand All @@ -23,7 +23,6 @@ enum Spec {
SpecHealingPriest = 17;
SpecShadowPriest = 4;
SpecWarlock = 5;
SpecTankWarlock = 21;
SpecWarrior = 6;
SpecTankWarrior = 11;
}
Expand Down
42 changes: 0 additions & 42 deletions proto/warlock.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,46 +61,6 @@ message WarlockTalents {
bool conflagrate = 50;
}

enum WarlockRune {
WarlockRuneNone = 0;

RuneHelmVengeance = 426195;
RuneHelmPandemic = 427712;
RuneHelmBackdraft = 427713;

RuneCloakMarkOfChaos = 440892;
RuneCloakInfernalArmor = 440882;
RuneCloakSoulSiphon = 403511;

RuneChestLakeOfFire = 403666;
RuneChestMasterChanneler = 403668;
RuneChestDemonicTactics = 412727;

RuneBracerUnstableAffliction = 427717;
RuneBracerImmolationAura = 427726;
RuneBracerIncinerate = 412758;
RuneBracerSummonFelguard = 427733;

RuneHandsHaunt = 403501;
RuneHandsChaosBolt = 403629;
RuneHandsShadowBoltVolley = 403628;
RuneHandsMetamorphosis = 403789;

RuneBeltInvocation = 426243;
RuneBeltGrimoireOfSynergy = 426301;
RuneBeltShadowAndFlame = 426316;

RuneLegsEverlastingAffliction = 412689;
RuneLegsDemonicGrace = 425463;
RuneLegsDemonicPact = 425464;

RuneBootsDemonicKnowledge = 412732;
RuneBootsDanceOfTheWicked = 412798;
RuneBootsShadowflame = 426320;
RuneBootsDecimation = 440870;

}

message WarlockRotation {
}

Expand All @@ -111,13 +71,11 @@ message WarlockOptions {
Voidwalker = 2;
Succubus = 3;
Felhunter = 4;
Felguard = 5;
}

enum Armor {
NoArmor = 0;
DemonArmor = 1;
FelArmor = 2;
}

enum WeaponImbue {
Expand Down
2 changes: 0 additions & 2 deletions sim/register_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

// restoShaman "github.com/wowsims/classic/sim/shaman/restoration"
dpsWarlock "github.com/wowsims/classic/sim/warlock/dps"
tankWarlock "github.com/wowsims/classic/sim/warlock/tank"
dpsWarrior "github.com/wowsims/classic/sim/warrior/dps_warrior"
tankWarrior "github.com/wowsims/classic/sim/warrior/tank_warrior"
)
Expand Down Expand Up @@ -58,5 +57,4 @@ func RegisterAll() {
protection.RegisterProtectionPaladin()
retribution.RegisterRetributionPaladin()
dpsWarlock.RegisterDpsWarlock()
tankWarlock.RegisterTankWarlock()
}
5 changes: 0 additions & 5 deletions sim/warlock/apl_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ func (value *APLValueWarlockShouldRecastDrainSoul) GetBool(sim *core.Simulation)
}

hauntRefresh := 1000 * time.Second
if warlock.HauntDebuffAuras != nil {
hauntRefresh = warlock.HauntDebuffAuras.Get(warlock.CurrentTarget).RemainingDuration(sim) -
warlock.Haunt.CastTime() -
warlock.Haunt.TravelTime()
}

// the amount of ticks we have left, assuming we continue channeling
dsDot := warlock.ChanneledDot
Expand Down
28 changes: 0 additions & 28 deletions sim/warlock/armors.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package warlock

import (
"time"

"github.com/wowsims/classic/sim/core"
"github.com/wowsims/classic/sim/core/stats"
)
Expand Down Expand Up @@ -41,29 +39,3 @@ func (warlock *Warlock) applyDemonArmor() {
},
})
}

// Surrounds the caster with fel energy, increasing spell damage and healing by 1 plus additional spell damage and healing equal to 50% of your Spirit.
// In addition, you regain 2% of your maximum health every 5 sec.
func (warlock *Warlock) applyFelArmor() {
actionID := core.ActionID{SpellID: 403619}

warlock.AddStat(stats.SpellPower, 60)
warlock.AddStatDependency(stats.Spirit, stats.SpellPower, .50)

healthMetrics := warlock.NewHealthMetrics(actionID)
warlock.GetOrRegisterAura(core.Aura{
Label: "Fel Armor",
ActionID: actionID,
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
core.StartPeriodicAction(sim, core.PeriodicActionOptions{
Period: time.Second * 5,
Priority: core.ActionPriorityAuto,
OnAction: func(sim *core.Simulation) {
warlock.GainHealth(sim, warlock.MaxHealth()*.02, healthMetrics)
},
})
},
})
}
51 changes: 0 additions & 51 deletions sim/warlock/chaos_bolt.go

This file was deleted.

36 changes: 5 additions & 31 deletions sim/warlock/conflagrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ import (
"time"

"github.com/wowsims/classic/sim/core"
"github.com/wowsims/classic/sim/core/proto"
)

const ConflagrateRanks = 4

func (warlock *Warlock) getConflagrateConfig(rank int) core.SpellConfig {
hasBackdraftRune := warlock.HasRune(proto.WarlockRune_RuneHelmBackdraft)
hasShadowflameRune := warlock.HasRune(proto.WarlockRune_RuneBootsShadowflame)

spellId := [ConflagrateRanks + 1]int32{0, 17962, 18930, 18931, 18932}[rank]
baseDamageMin := [ConflagrateRanks + 1]float64{0, 249, 319, 395, 447}[rank]
baseDamageMax := [ConflagrateRanks + 1]float64{0, 316, 400, 491, 557}[rank]
Expand Down Expand Up @@ -44,7 +40,7 @@ func (warlock *Warlock) getConflagrateConfig(rank int) core.SpellConfig {
},
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return warlock.getActiveImmolateSpell(target) != nil || (hasShadowflameRune && warlock.Shadowflame.Dot(target).IsActive())
return warlock.getActiveImmolateSpell(target) != nil
},

DamageMultiplier: 1,
Expand All @@ -54,33 +50,11 @@ func (warlock *Warlock) getConflagrateConfig(rank int) core.SpellConfig {
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.Roll(baseDamageMin, baseDamageMax)

result := spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit)

if result.Landed() && hasBackdraftRune {
warlock.BackdraftAura.Activate(sim)
}

// Conflag now doesn't consume Immo or Shadowflame when using Backdraft
if !hasBackdraftRune {
immoTime := core.NeverExpires
shadowflameTime := core.NeverExpires

immoSpell := warlock.getActiveImmolateSpell(target)
if immoSpell != nil {
immoDot := immoSpell.Dot(target)
immoTime = core.TernaryDuration(immoDot.IsActive(), immoDot.RemainingDuration(sim), core.NeverExpires)
}

if hasShadowflameRune {
sfDot := warlock.Shadowflame.Dot(target)
shadowflameTime = core.TernaryDuration(sfDot.IsActive(), sfDot.RemainingDuration(sim), core.NeverExpires)
}
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit)

if immoTime < shadowflameTime {
immoSpell.Dot(target).Deactivate(sim)
} else {
warlock.Shadowflame.Dot(target).Deactivate(sim)
}
immoSpell := warlock.getActiveImmolateSpell(target)
if immoSpell != nil {
immoSpell.Dot(target).Deactivate(sim)
}
},
}
Expand Down
30 changes: 3 additions & 27 deletions sim/warlock/corruption.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"

"github.com/wowsims/classic/sim/core"
"github.com/wowsims/classic/sim/core/proto"
)

const CorruptionRanks = 7
Expand All @@ -19,16 +18,14 @@ func (warlock *Warlock) getCorruptionConfig(rank int) core.SpellConfig {
level := [CorruptionRanks + 1]int{0, 4, 14, 24, 34, 44, 54, 60}[rank]

castTime := time.Millisecond * (2000 - (400 * time.Duration(warlock.Talents.ImprovedCorruption)))
hasInvocationRune := warlock.HasRune(proto.WarlockRune_RuneBeltInvocation)
hasPandemicRune := warlock.HasRune(proto.WarlockRune_RuneHelmPandemic)

return core.SpellConfig{
ActionID: core.ActionID{SpellID: spellId},
SpellSchool: core.SpellSchoolShadow,
SpellCode: SpellCode_WarlockCorruption,
ProcMask: core.ProcMaskSpellDamage,
DefenseType: core.DefenseTypeMagic,
Flags: core.SpellFlagAPL | core.SpellFlagResetAttackSwing | core.SpellFlagPureDot | WarlockFlagAffliction | WarlockFlagHaunt,
Flags: core.SpellFlagAPL | core.SpellFlagResetAttackSwing | core.SpellFlagPureDot | WarlockFlagAffliction,
Rank: rank,
RequiredLevel: level,

Expand All @@ -42,7 +39,7 @@ func (warlock *Warlock) getCorruptionConfig(rank int) core.SpellConfig {
},
},

CritDamageBonus: core.TernaryFloat64(hasPandemicRune, 1, 0),
CritDamageBonus: 0,

DamageMultiplier: 1,
ThreatMultiplier: 1,
Expand All @@ -58,47 +55,26 @@ func (warlock *Warlock) getCorruptionConfig(rank int) core.SpellConfig {

OnSnapshot: func(sim *core.Simulation, target *core.Unit, dot *core.Dot, isRollover bool) {
dot.Snapshot(target, baseDamage, isRollover)
if !isRollover {
if warlock.zilaGularAura.IsActive() {
dot.SnapshotAttackerMultiplier *= 1.25
warlock.zilaGularAura.Deactivate(sim)
}
}
},
OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) {
if hasPandemicRune {
dot.CalcAndDealPeriodicSnapshotDamage(sim, target, dot.OutcomeSnapshotCrit)
} else {
dot.CalcAndDealPeriodicSnapshotDamage(sim, target, dot.OutcomeTick)
}
dot.CalcAndDealPeriodicSnapshotDamage(sim, target, dot.OutcomeTick)
},
},

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
result := spell.CalcOutcome(sim, target, spell.OutcomeMagicHitNoHitCounter)
if result.Landed() {
dot := spell.Dot(target)

if hasInvocationRune && dot.IsActive() {
warlock.InvocationRefresh(sim, dot)
}

dot.Apply(sim)
}
spell.DealOutcome(sim, result)
},
ExpectedTickDamage: func(sim *core.Simulation, target *core.Unit, spell *core.Spell, useSnapshot bool) *core.SpellResult {
if useSnapshot {
dot := spell.Dot(target)
if hasPandemicRune {
return dot.CalcSnapshotDamage(sim, target, dot.Spell.OutcomeExpectedMagicCrit)
}
return dot.CalcSnapshotDamage(sim, target, dot.Spell.OutcomeExpectedMagicAlwaysHit)
} else {
baseDamage := baseDamage / float64(ticks)
if hasPandemicRune {
return spell.CalcPeriodicDamage(sim, target, baseDamage, spell.OutcomeExpectedMagicCrit)
}
return spell.CalcPeriodicDamage(sim, target, baseDamage, spell.OutcomeExpectedMagicAlwaysHit)
}
},
Expand Down
Loading
Loading