Skip to content

Commit

Permalink
Misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixPflaum committed Nov 29, 2024
1 parent 715a028 commit 8925989
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 91 deletions.
5 changes: 0 additions & 5 deletions sim/core/bulksim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
75 changes: 0 additions & 75 deletions sim/core/consumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
///////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 0 additions & 4 deletions sim/core/raid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions sim/core/sim.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})

Expand All @@ -58,7 +58,6 @@ type Simulation struct {

minWeaponAttackTime time.Duration
weaponAttacks []*WeaponAttack
extraAttacks int32

minTaskTime time.Duration
tasks []Task
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions sim/core/spell_outcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8925989

Please sign in to comment.