Skip to content

Commit

Permalink
Commiting to update from master
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Jan 5, 2024
1 parent 436deae commit ee8f8a6
Show file tree
Hide file tree
Showing 38 changed files with 22 additions and 4,841 deletions.
29 changes: 7 additions & 22 deletions sim/core/mana.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,25 +213,24 @@ func (unit *Unit) TimeUntilManaRegen(desiredMana float64) time.Duration {
}

func (sim *Simulation) initManaTickAction() {
var playersWithManaBars []Agent
var petsWithManaBars []PetAgent
var unitsWithManaBars []*Unit

for _, party := range sim.Raid.Parties {
for _, player := range party.Players {
character := player.GetCharacter()
if character.HasManaBar() {
playersWithManaBars = append(playersWithManaBars, player)
unitsWithManaBars = append(unitsWithManaBars, &player.GetCharacter().Unit)
}

for _, petAgent := range character.PetAgents {
if petAgent.GetPet().HasManaBar() {
petsWithManaBars = append(petsWithManaBars, petAgent)
unitsWithManaBars = append(unitsWithManaBars, &petAgent.GetCharacter().Unit)
}
}
}
}

if len(playersWithManaBars) == 0 && len(petsWithManaBars) == 0 {
if len(unitsWithManaBars) == 0 {
return
}

Expand All @@ -241,23 +240,9 @@ func (sim *Simulation) initManaTickAction() {
Priority: ActionPriorityRegen,
}
pa.OnAction = func(sim *Simulation) {
for _, player := range playersWithManaBars {
char := player.GetCharacter()
char.ManaTick(sim)

// Only execute APL actions after mana ticks once pre-pull has completed.
if sim.CurrentTime > 0 {
if char.IsWaitingForMana() && !char.DoneWaitingForMana(sim) {
continue
}

char.Rotation.DoNextAction(sim)
}
}
for _, petAgent := range petsWithManaBars {
pet := petAgent.GetPet()
if pet.IsEnabled() {
pet.ManaTick(sim)
for _, unit := range unitsWithManaBars {
if unit.IsEnabled() {
unit.ManaTick(sim)
}
}

Expand Down
3 changes: 1 addition & 2 deletions sim/deathknight/army_of_the_dead.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ func (dk *Deathknight) registerArmyOfTheDeadCD() {
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
ChannelTime: time.Second * 4,
GCD: core.GCDDefault,
GCD: core.GCDDefault,
},
CD: core.Cooldown{
Timer: dk.NewTimer(),
Expand Down
7 changes: 0 additions & 7 deletions sim/deathknight/blood_boil.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,14 @@ func (dk *Deathknight) registerBloodBoilSpell() {
ThreatMultiplier: 1.0,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
dk.AoESpellNumTargetsHit = 0

for _, aoeTarget := range sim.Encounter.TargetUnits {
baseDamage := (sim.Roll(180, 220) + 0.06*dk.getImpurityBonus(spell)) * dk.RoRTSBonus(aoeTarget) * core.TernaryFloat64(dk.DiseasesAreActive(aoeTarget), 1.5, 1.0)
baseDamage *= sim.Encounter.AOECapMultiplier()

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

if result.Landed() {
dk.AoESpellNumTargetsHit++
}

if aoeTarget == target {
spell.SpendRefundableCost(sim, result)
dk.LastOutcome = result.Outcome
}
}
},
Expand Down
1 change: 0 additions & 1 deletion sim/deathknight/blood_strike.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func (dk *Deathknight) newBloodStrikeSpell(isMH bool) *core.Spell {
if isMH {
spell.SpendRefundableCostAndConvertBloodRune(sim, result, deathConvertChance)
dk.threatOfThassarianProc(sim, result, dk.BloodStrikeOhHit)
dk.LastOutcome = result.Outcome

if result.Landed() {
if dk.DesolationAura != nil {
Expand Down
1 change: 0 additions & 1 deletion sim/deathknight/death_strike.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func (dk *Deathknight) newDeathStrikeSpell(isMH bool) *core.Spell {

if isMH {
spell.SpendRefundableCostAndConvertFrostOrUnholyRune(sim, result, deathConvertChance)
dk.LastOutcome = result.Outcome

if result.Landed() {
healingAmount := 0.05 * dk.dkCountActiveDiseases(target) * dk.MaxHealth() * (1.0 + 0.5*float64(dk.Talents.ImprovedDeathStrike))
Expand Down
194 changes: 0 additions & 194 deletions sim/deathknight/deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ type Deathknight struct {

Inputs DeathknightInputs

RotationHelper

Ghoul *GhoulPet
RaiseDead *core.Spell

Expand Down Expand Up @@ -314,33 +312,6 @@ func (dk *Deathknight) Initialize() {
dk.registerDeathPactSpell()
dk.registerUnholyFrenzyCD()

dk.RegisterAura(core.Aura{
Label: "Last Cast Assigner",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) {
if spell.DefaultCast.GCD > 0 {
dk.LastCast = spell
}
},
})

if !dk.IsUsingAPL {
if dk.Inputs.PrecastHornOfWinter {
dk.RegisterPrepullAction(-1500*time.Millisecond, func(sim *core.Simulation) {
dk.HornOfWinter.Cast(sim, nil)
})
}

if dk.Inputs.ArmyOfTheDeadType == proto.Deathknight_Rotation_PreCast {
dk.RegisterPrepullAction(-10*time.Second, func(sim *core.Simulation) {
dk.ArmyOfTheDead.Cast(sim, nil)
})
}
}

// allows us to use these auras in the APL pre-pull actions
wotlk.CreateBlackMagicProcAura(&dk.Character)
CreateVirulenceProcAura(&dk.Character)
Expand Down Expand Up @@ -393,8 +364,6 @@ func (dk *Deathknight) ResetBonusCoeffs() {

func (dk *Deathknight) Reset(sim *core.Simulation) {
dk.LastTickTime = -1
dk.LastCast = nil
dk.NextCast = nil
dk.DeathStrikeHeals = dk.DeathStrikeHeals[:0]
dk.MakeTSRoRAssumptions = sim.Raid.Size() <= 1
}
Expand Down Expand Up @@ -475,7 +444,6 @@ func NewDeathknight(character *core.Character, inputs DeathknightInputs, talents
dk.RuneWeapon = dk.NewRuneWeapon()
}

dk.RotationSequence = &Sequence{}
// done here so enchants that modify stats are applied before stats are calculated
dk.registerItems()

Expand All @@ -498,26 +466,6 @@ func (dk *Deathknight) bonusCritMultiplier(bonusTalentPoints int32) float64 {
return dk.MeleeCritMultiplier(1, 0.15*float64(bonusTalentPoints))
}

func (dk *Deathknight) AverageDSHeal() float64 {
count := len(dk.DeathStrikeHeals)
if count >= 5 {
sum := dk.DeathStrikeHeals[count-1]
sum += dk.DeathStrikeHeals[count-2]
sum += dk.DeathStrikeHeals[count-3]
sum += dk.DeathStrikeHeals[count-4]
sum += dk.DeathStrikeHeals[count-5]
return sum / 5.0
} else if count > 0 {
sum := dk.DeathStrikeHeals[count-1]
for i := 1; i < count; i++ {
sum += dk.DeathStrikeHeals[count-i-1]
}
return sum / float64(count)
} else {
return 0
}
}

// Agent is a generic way to access underlying warrior on any of the agents.

func (dk *Deathknight) GetDeathKnight() *Deathknight {
Expand All @@ -527,145 +475,3 @@ func (dk *Deathknight) GetDeathKnight() *Deathknight {
type DeathKnightAgent interface {
GetDeathKnight() *Deathknight
}

func PointsInTalents(talents *proto.DeathknightTalents) (int, int, int) {
blood := 0
blood += int(talents.Butchery)
blood += int(talents.Subversion)
blood += int(talents.BladeBarrier)
blood += int(talents.BladedArmor)
blood += int(talents.ScentOfBlood)
blood += int(talents.TwoHandedWeaponSpecialization)
blood += int(talents.DarkConviction)
blood += int(talents.DeathRuneMastery)
blood += int(talents.ImprovedRuneTap)
blood += int(talents.SpellDeflection)
blood += int(talents.Vendetta)
blood += int(talents.BloodyStrikes)
blood += int(talents.VeteranOfTheThirdWar)
blood += int(talents.BloodyVengeance)
blood += int(talents.AbominationsMight)
blood += int(talents.Bloodworms)
blood += int(talents.ImprovedBloodPresence)
blood += int(talents.ImprovedDeathStrike)
blood += int(talents.SuddenDoom)
blood += int(talents.WillOfTheNecropolis)
blood += int(talents.MightOfMograine)
blood += int(talents.BloodGorged)
if talents.RuneTap {
blood++
}
if talents.Hysteria {
blood++
}
if talents.MarkOfBlood {
blood++
}
if talents.VampiricBlood {
blood++
}
if talents.HeartStrike {
blood++
}
if talents.DancingRuneWeapon {
blood++
}

frost := 0

frost += int(talents.ImprovedIcyTouch)
frost += int(talents.RunicPowerMastery)
frost += int(talents.Toughness)
frost += int(talents.IcyReach)
frost += int(talents.BlackIce)
frost += int(talents.NervesOfColdSteel)
frost += int(talents.IcyTalons)
frost += int(talents.Annihilation)
frost += int(talents.KillingMachine)
frost += int(talents.ChillOfTheGrave)
frost += int(talents.EndlessWinter)
frost += int(talents.FrigidDreadplate)
frost += int(talents.GlacierRot)
frost += int(talents.MercilessCombat)
frost += int(talents.Rime)
frost += int(talents.Chilblains)
frost += int(talents.ImprovedFrostPresence)
frost += int(talents.ThreatOfThassarian)
frost += int(talents.BloodOfTheNorth)
frost += int(talents.Acclimation)
frost += int(talents.GuileOfGorefiend)
frost += int(talents.TundraStalker)
if talents.HowlingBlast {
frost++
}
if talents.Lichborne {
frost++
}
if talents.Deathchill {
frost++
}
if talents.ImprovedIcyTalons {
frost++
}
if talents.HungeringCold {
frost++
}
if talents.UnbreakableArmor {
frost++
}
if talents.FrostStrike {
frost++
}

unholy := 0

unholy += int(talents.ViciousStrikes)
unholy += int(talents.Virulence)
unholy += int(talents.Anticipation)
unholy += int(talents.Epidemic)
unholy += int(talents.Morbidity)
unholy += int(talents.UnholyCommand)
unholy += int(talents.RavenousDead)
unholy += int(talents.Outbreak)
unholy += int(talents.Necrosis)
unholy += int(talents.OnAPaleHorse)
unholy += int(talents.BloodCakedBlade)
unholy += int(talents.NightOfTheDead)
unholy += int(talents.Impurity)
unholy += int(talents.Dirge)
unholy += int(talents.Desecration)
unholy += int(talents.MagicSuppression)
unholy += int(talents.Reaping)
unholy += int(talents.Desolation)
unholy += int(talents.ImprovedUnholyPresence)
unholy += int(talents.CryptFever)
unholy += int(talents.WanderingPlague)
unholy += int(talents.EbonPlaguebringer)
unholy += int(talents.RageOfRivendare)
if talents.CorpseExplosion {
unholy++
}
if talents.UnholyBlight {
unholy++
}
if talents.MasterOfGhouls {
unholy++
}
if talents.AntiMagicZone {
unholy++
}
if talents.GhoulFrenzy {
unholy++
}
if talents.BoneShield {
unholy++
}
if talents.ScourgeStrike {
unholy++
}
if talents.SummonGargoyle {
unholy++
}

return blood, frost, unholy
}
Loading

0 comments on commit ee8f8a6

Please sign in to comment.