From 8925989dce78ae241bf045267e6970e74f813a5e Mon Sep 17 00:00:00 2001 From: FelixPflaum <141590183+FelixPflaum@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:36:30 +0100 Subject: [PATCH] Misc cleanup --- sim/core/bulksim_test.go | 5 --- sim/core/consumes.go | 75 --------------------------------------- sim/core/raid.go | 4 --- sim/core/sim.go | 5 ++- sim/core/spell_outcome.go | 4 --- 5 files changed, 2 insertions(+), 91 deletions(-) diff --git a/sim/core/bulksim_test.go b/sim/core/bulksim_test.go index a639fda5a..d851b5364 100644 --- a/sim/core/bulksim_test.go +++ b/sim/core/bulksim_test.go @@ -26,11 +26,6 @@ var ( Slot: proto.ItemSlot_ItemSlotOffHand, Index: 1, } - starshardEdge2 = &itemWithSlot{ - Item: &proto.ItemSpec{Id: itemStarshardEdge}, - Slot: proto.ItemSlot_ItemSlotMainHand, - Index: 2, - } pillarOfFortitude = &itemWithSlot{ Item: &proto.ItemSpec{Id: itemPillarOfFortitude}, Slot: proto.ItemSlot_ItemSlotMainHand, diff --git a/sim/core/consumes.go b/sim/core/consumes.go index 7772e9298..67d18e61f 100644 --- a/sim/core/consumes.go +++ b/sim/core/consumes.go @@ -830,81 +830,6 @@ func (character *Character) newGoblinLandMineSpell(sharedTimer *Timer) *Spell { return character.GetOrRegisterSpell(character.newBasicExplosiveSpellConfig(sharedTimer, GoblinLandMineActionID, SpellSchoolFire, 394, 506, Cooldown{}, 0, 0)) } -// Creates a spell object for the common explosive case. -func (character *Character) newRadiationBombSpellConfig(sharedTimer *Timer, actionID ActionID, minDamage float64, maxDamage float64, dotDamage float64, cooldown Cooldown) SpellConfig { - return SpellConfig{ - ActionID: actionID, - SpellSchool: SpellSchoolFire, - DefenseType: DefenseTypeMagic, - ProcMask: ProcMaskEmpty, - Flags: SpellFlagCastTimeNoGCD, - - Cast: CastConfig{ - DefaultCast: Cast{ - CastTime: time.Second, - }, - IgnoreHaste: true, - CD: cooldown, - SharedCD: Cooldown{ - Timer: sharedTimer, - Duration: time.Minute, - }, - }, - - // Explosives always have 1% resist chance, so just give them hit cap. - BonusHitRating: 100 * SpellHitRatingPerHitChance, - - DamageMultiplier: 1, - ThreatMultiplier: 1, - - // TODO: This should use another spell (443813) as the DoT - // Also doesn't apply to bosses or something. - Dot: DotConfig{ - Aura: Aura{ - Label: actionID.String(), - }, - - NumberOfTicks: 5, - TickLength: time.Second * 2, - - OnSnapshot: func(sim *Simulation, target *Unit, dot *Dot, isRollover bool) { - // Use nature school for dot modifiers - dot.Spell.SpellSchool = SpellSchoolNature - dot.Spell.SchoolIndex = stats.SchoolIndexNature - - dot.Snapshot(target, dotDamage, isRollover) - - // Revert to fire school - dot.Spell.SpellSchool = SpellSchoolFire - dot.Spell.SchoolIndex = stats.SchoolIndexFire - }, - OnTick: func(sim *Simulation, target *Unit, dot *Dot) { - // Use nature school for dot ticks - dot.Spell.SpellSchool = SpellSchoolNature - dot.Spell.SchoolIndex = stats.SchoolIndexNature - - dot.CalcAndDealPeriodicSnapshotDamage(sim, target, dot.OutcomeTick) - - // Revert to fire school - dot.Spell.SpellSchool = SpellSchoolFire - dot.Spell.SchoolIndex = stats.SchoolIndexFire - }, - }, - - ApplyEffects: func(sim *Simulation, target *Unit, spell *Spell) { - for _, aoeTarget := range sim.Encounter.TargetUnits { - baseDamage := sim.Roll(minDamage, maxDamage) * sim.Encounter.AOECapMultiplier() - - result := spell.CalcAndDealDamage(sim, aoeTarget, baseDamage, spell.OutcomeMagicHitAndCrit) - - if result.Landed() { - spell.Dot(aoeTarget).Apply(sim) - } - } - }, - } -} - /////////////////////////////////////////////////////////////////////////// // Potions /////////////////////////////////////////////////////////////////////////// diff --git a/sim/core/raid.go b/sim/core/raid.go index 054c1aee1..58747accd 100644 --- a/sim/core/raid.go +++ b/sim/core/raid.go @@ -123,10 +123,6 @@ type Raid struct { AllUnits []*Unit // Cached list of all Units (players and pets) in the raid. nextPetIndex int32 - - replenishmentUnits []*Unit // All units who can receive replenishment. - curReplenishmentUnits [][]*Unit // Units that currently have replenishment active, separated by source. - leftoverReplenishmentUnits []*Unit // Units without replenishment currently active. } func (raid *Raid) GetActiveUnits() []*Unit { diff --git a/sim/core/sim.go b/sim/core/sim.go index 59b7e4ebf..a2be0989f 100644 --- a/sim/core/sim.go +++ b/sim/core/sim.go @@ -39,7 +39,7 @@ type Simulation struct { NeedsInput bool // Sim is in interactive mode and needs input ProgressReport func(*proto.ProgressMetrics) - Signals simsignals.Signals + Signals simsignals.Signals Log func(string, ...interface{}) @@ -58,7 +58,6 @@ type Simulation struct { minWeaponAttackTime time.Duration weaponAttacks []*WeaponAttack - extraAttacks int32 minTaskTime time.Duration tasks []Task @@ -347,7 +346,7 @@ func (sim *Simulation) run() *proto.RaidSimResult { Logs: logsBuffer.String(), FirstIterationDuration: firstIterationDuration.Seconds(), AvgIterationDuration: totalDuration.Seconds() / float64(sim.Options.Iterations), - IterationsDone: sim.Options.Iterations, + IterationsDone: sim.Options.Iterations, } // Final progress report diff --git a/sim/core/spell_outcome.go b/sim/core/spell_outcome.go index 619cdfd8f..3491180c1 100644 --- a/sim/core/spell_outcome.go +++ b/sim/core/spell_outcome.go @@ -647,10 +647,6 @@ func (spell *Spell) outcomeEnemyMeleeWhite(sim *Simulation, result *SpellResult, } } -func (spell *Spell) fixedCritCheck(sim *Simulation, critChance float64) bool { - return sim.RandomFloat("Fixed Crit Roll") < critChance -} - func (result *SpellResult) applyAttackTableMiss(spell *Spell, attackTable *AttackTable, roll float64, chance *float64, countHits bool) bool { missChance := attackTable.BaseMissChance - spell.PhysicalHitChance(attackTable) if spell.Unit.AutoAttacks.IsDualWielding && !spell.Unit.PseudoStats.DisableDWMissPenalty {