Skip to content

Commit

Permalink
Merge pull request #215 from wowsims/gnomeregan-resistances
Browse files Browse the repository at this point in the history
Gnomeregan mechanical encounter
  • Loading branch information
kayla-glick authored Feb 18, 2024
2 parents d1ee9a0 + f274ef6 commit 9b016c5
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 17 deletions.
Binary file modified assets/database/db.bin
Binary file not shown.
3 changes: 2 additions & 1 deletion assets/database/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -12015,7 +12015,8 @@
],
"encounters":[
{"path":"SoD/Level 25","targets":[{"path":"SoD/Level 25","target":{"id":213334,"name":"Level 25","level":27,"mobType":8,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,574,0,0,0,0,0,0,0,0,1104,0,0,0,0,0,0,0,127393,0,0,0,0,0,0,0,0,0],"minBaseDamage":400,"damageSpread":0.3333,"swingSpeed":2,"parryHaste":true}}]},
{"path":"SoD/Level 40","targets":[{"path":"SoD/Level 40","target":{"id":213334,"name":"Level 40","level":42,"mobType":7,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,574,0,0,0,0,0,0,0,0,2053,0,0,0,0,0,0,0,127393,0,0,0,0,0,0,0,0,0],"minBaseDamage":1000,"damageSpread":0.3333,"swingSpeed":2,"parryHaste":true}}]},
{"path":"SoD/Level 40","targets":[{"path":"SoD/Level 40","target":{"id":218537,"name":"Level 40","level":42,"mobType":7,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,574,0,0,0,0,0,0,0,0,2053,0,0,0,0,0,0,0,279345,0,0,0,0,0,0,0,0,0],"minBaseDamage":1000,"damageSpread":0.3333,"swingSpeed":2,"parryHaste":true}}]},
{"path":"SoD/Level 40 Mechanical","targets":[{"path":"SoD/Level 40 Mechanical","target":{"id":218537,"name":"Level 40 Mechanical","level":42,"mobType":7,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,574,0,0,0,0,0,0,0,0,4000,0,0,0,0,0,0,0,279345,0,0,0,0,0,0,0,0,0],"minBaseDamage":1000,"damageSpread":0.3333,"swingSpeed":2,"parryHaste":true}}]},
{"path":"SoD/Level 50","targets":[{"path":"SoD/Level 50","target":{"id":213334,"name":"Level 50","level":52,"mobType":8,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,574,0,0,0,0,0,0,0,0,2053,0,0,0,0,0,0,0,127393,0,0,0,0,0,0,0,0,0],"minBaseDamage":2000,"damageSpread":0.3333,"swingSpeed":2,"parryHaste":true}}]},
{"path":"SoD/Level 60","targets":[{"path":"SoD/Level 60","target":{"id":213334,"name":"Level 60","level":63,"mobType":8,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,805,0,0,0,0,0,0,0,0,3731,0,0,0,0,0,0,0,127393,0,0,0,0,0,0,0,0,0],"minBaseDamage":3000,"damageSpread":0.3333,"swingSpeed":2,"parryHaste":true}}]}
]
Expand Down
Binary file modified assets/database/leftover_db.bin
Binary file not shown.
11 changes: 7 additions & 4 deletions sim/core/apl.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ func (unit *Unit) newAPLRotation(config *proto.APLRotation) *APLRotation {

// Remove MCDs that are referenced by APL actions, so that the Autocast Other Cooldowns
// action does not include them.
character := unit.Env.Raid.GetPlayerFromUnit(unit).GetCharacter()
for _, action := range rotation.allAPLActions() {
if castSpellAction, ok := action.impl.(*APLActionCastSpell); ok {
character.removeInitialMajorCooldown(castSpellAction.spell.ActionID)
agent := unit.Env.GetAgentFromUnit(unit)
if agent != nil {
character := agent.GetCharacter()
for _, action := range rotation.allAPLActions() {
if castSpellAction, ok := action.impl.(*APLActionCastSpell); ok {
character.removeInitialMajorCooldown(castSpellAction.spell.ActionID)
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions sim/core/spell_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ func (spell *Spell) TargetDamageMultiplier(attackTable *AttackTable, isPeriodic

if spell.SpellSchool.Matches(SpellSchoolNature) {
multiplier *= attackTable.NatureDamageTakenMultiplier

if spell.ProcMask.Matches(ProcMaskWeaponProc) {
multiplier *= attackTable.Defender.PseudoStats.PoisonDamageTakenMultiplier
}
} else if isPeriodic && spell.SpellSchool.Matches(SpellSchoolPhysical) {
multiplier *= attackTable.Defender.PseudoStats.PeriodicPhysicalDamageTakenMultiplier
}
Expand Down
8 changes: 6 additions & 2 deletions sim/core/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ type PseudoStats struct {
SchoolDamageTakenMultiplier [SchoolLen]float64 // For specific spell schools (arcane, fire, shadow, etc.)
SchoolCritTakenMultiplier [SchoolLen]float64 // For spell school crit (arcane, fire, shadow, etc.)

DiseaseDamageTakenMultiplier float64
PeriodicPhysicalDamageTakenMultiplier float64
BleedDamageTakenMultiplier float64 // Modifies damage taken from bleed effects
DiseaseDamageTakenMultiplier float64 // Modifies damage taken from disease effects
PeriodicPhysicalDamageTakenMultiplier float64 // Modifies damage taken from periodic physical effects NOT bleeds
PoisonDamageTakenMultiplier float64 // Modifies damage taken from poison effects

ArmorMultiplier float64 // Major/minor/special multiplicative armor modifiers

Expand Down Expand Up @@ -478,8 +480,10 @@ func NewPseudoStats() PseudoStats {
SchoolDamageTakenMultiplier: NewSchoolFloatArray(),
SchoolCritTakenMultiplier: NewSchoolFloatArray(),

BleedDamageTakenMultiplier: 1,
DiseaseDamageTakenMultiplier: 1,
PeriodicPhysicalDamageTakenMultiplier: 1,
PoisonDamageTakenMultiplier: 1,

ArmorMultiplier: 1,

Expand Down
6 changes: 3 additions & 3 deletions sim/encounters/default_presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ func addLevel40(bossPrefix string) {
core.AddPresetTarget(&core.PresetTarget{
PathPrefix: bossPrefix,
Config: &proto.Target{
Id: 213334, // TODO:
Id: 218537, // TODO:
Name: "Level 40",
Level: 42,
MobType: proto.MobType_MobTypeMechanical,
TankIndex: 0,

Stats: stats.Stats{
stats.Health: 127_393, // TODO:
stats.Armor: 2053, // TODO:
stats.Health: 279_345, // TODO:
stats.Armor: 2053, // Approx average armor of Gnomeregan bosses
stats.AttackPower: 574, // TODO:
}.ToFloatArray(),

Expand Down
63 changes: 63 additions & 0 deletions sim/encounters/gnomeregan.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package encounters

import (
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core/stats"
)

func addGnomereganMechanical(bossPrefix string) {
core.AddPresetTarget(&core.PresetTarget{
PathPrefix: bossPrefix,
Config: &proto.Target{
Id: 218537, // TODO:
Name: "Level 40 Mechanical",
Level: 42,
MobType: proto.MobType_MobTypeMechanical,
TankIndex: 0,

Stats: stats.Stats{
stats.Health: 279_345, // Electrocutioner 6000 health
stats.Armor: 4000, // Approx average armor of Gnomeregan bosses
stats.AttackPower: 574, // TODO:
// TODO: Resistances
}.ToFloatArray(),

SpellSchool: proto.SpellSchool_SpellSchoolPhysical,
SwingSpeed: 2, // TODO:
MinBaseDamage: 1000, // TODO:
DamageSpread: 0.3333, // TODO:
ParryHaste: true,
DualWield: false,
DualWieldPenalty: false,
TargetInputs: make([]*proto.TargetInput, 0),
},
AI: NewGnomereganMechanicalAI(),
})
core.AddPresetEncounter("Level 40 Mechanical", []string{
bossPrefix + "/Level 40 Mechanical",
})
}

type GnomereganMechanicalAI struct {
Target *core.Target
}

func NewGnomereganMechanicalAI() core.AIFactory {
return func() core.TargetAI {
return &GnomereganMechanicalAI{}
}
}

func (ai *GnomereganMechanicalAI) Initialize(target *core.Target, _ *proto.Target) {
target.Unit.PseudoStats.PeriodicPhysicalDamageTakenMultiplier = .8
target.Unit.PseudoStats.PoisonDamageTakenMultiplier = .8

ai.Target = target
}

func (ai *GnomereganMechanicalAI) Reset(*core.Simulation) {
}

func (ai *GnomereganMechanicalAI) ExecuteCustomRotation(sim *core.Simulation) {
}
1 change: 1 addition & 0 deletions sim/encounters/register_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ func init() {
// naxxramas.Register()
addLevel25("SoD")
addLevel40("SoD")
addGnomereganMechanical("SoD")
addLevel50("SoD")
addLevel60("SoD")
}
Expand Down
2 changes: 1 addition & 1 deletion sim/register_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/wowsims/sod/sim/druid/feral"
// restoDruid "github.com/wowsims/sod/sim/druid/restoration"
// feralTank "github.com/wowsims/sod/sim/druid/tank"
// _ "github.com/wowsims/sod/sim/encounters"
_ "github.com/wowsims/sod/sim/encounters"
"github.com/wowsims/sod/sim/hunter"
"github.com/wowsims/sod/sim/mage"

Expand Down
7 changes: 1 addition & 6 deletions ui/core/encounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ export class Encounter {

constructor(sim: Sim) {
this.sim = sim;

sim.waitForInit().then(() => {
this.presetTargets = sim.db.getAllPresetTargets();
this.targets = [this.presetTargets[0].target!];
});

this.targets = [Encounter.defaultTargetProto()];
this.targetsMetadata = new UnitMetadataList();

[
Expand Down

0 comments on commit 9b016c5

Please sign in to comment.