Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wowsims/sod
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Nov 16, 2024
2 parents 010d531 + 0e7e0e2 commit 43ba8d0
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 23 deletions.
17 changes: 16 additions & 1 deletion proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ enum TristateEffect {
TristateEffectImproved = 2;
}

enum SapperExplosive {
SapperUnknown = 0;
SapperGoblinSapper = 1;
SapperFumigator = 2;
}

enum Explosive {
ExplosiveUnknown = 0;
ExplosiveSolidDynamite = 1;
Expand All @@ -316,6 +322,7 @@ enum Explosive {
ExplosiveEzThroRadiationBomb = 4;
ExplosiveHighYieldRadiationBomb = 5;
ExplosiveGoblinLandMine = 6;
ExplosiveObsidianBomb = 7;
}

// NextIndex: 28
Expand Down Expand Up @@ -374,6 +381,7 @@ enum EnchantedSigil {
InnovationSigil = 1;
LivingDreamsSigil = 2;
FlowingWatersSigil = 3;
WrathOfTheStormSigil = 4;
}

enum Flask {
Expand All @@ -384,6 +392,10 @@ enum Flask {
FlaskOfChromaticResistance = 4;
FlaskOfRestlessDreams = 5;
FlaskOfEverlastingNightmares = 6;
FlaskOfMadness = 7;
FlaskOfUnyieldingSorrow = 8;
FlaskOfAncientKnowledge = 9;
FlaskOfTheOldGods = 10;
}

enum Alcohol {
Expand All @@ -402,6 +414,7 @@ enum AgilityElixir {
ElixirOfLesserAgility = 3;
ScrollOfAgility = 4;
ElixirOfAgility = 5;
ElixirOfTheHoneyBadger = 6;
}

enum ArmorElixir {
Expand All @@ -411,6 +424,7 @@ enum ArmorElixir {
ElixirOfDefense = 3;
ElixirOfMinorDefense = 4;
ScrollOfProtection = 5;
ElixirOfTheIronside = 6;
}

enum HealthElixir {
Expand Down Expand Up @@ -443,6 +457,7 @@ enum SpellPowerBuff {
ArcaneElixir = 1;
GreaterArcaneElixir = 2;
LesserArcaneElixir = 3;
ElixirOfTheMageLord = 4;
}

enum ShadowPowerBuff {
Expand Down Expand Up @@ -714,7 +729,7 @@ message Consumes {
ShadowPowerBuff shadow_power_buff = 10;
FirePowerBuff fire_power_buff = 11;
FrostPowerBuff frost_power_buff = 12;
bool sapper = 13;
SapperExplosive sapper_explosive = 34;
Explosive filler_explosive = 14;
WeaponImbue main_hand_imbue = 15;
WeaponImbue off_hand_imbue = 16;
Expand Down
59 changes: 58 additions & 1 deletion sim/common/vanilla/item_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const (
TheUntamedBladeShadowflame = 232566
ScarabBrooch = 233601 // 21625
KalimdorsRevenge = 233621
JomGabbar = 233627 // 23570
NeretzekBloodDrinker = 233647
Speedstone = 233990
ManslayerOfTheQiraji = 234067
Expand Down Expand Up @@ -2335,7 +2336,8 @@ func init() {

// https://www.wowhead.com/classic/item=234462/earthstrike
// Use: Increases your melee and ranged attack power by 328. Effect lasts for 20 sec. (2 Min Cooldown)
core.NewSimpleStatOffensiveTrinketEffect(Earthstrike, stats.Stats{stats.AttackPower: 328}, time.Second*20, time.Minute*2)

core.NewSimpleStatOffensiveTrinketEffect(Earthstrike, stats.Stats{stats.AttackPower: 328, stats.RangedAttackPower: 328,}, time.Second*20, time.Second*120)

// https://www.wowhead.com/classic/item=228293/essence-of-the-pure-flame
// Equip: When struck in combat inflicts 50 Fire damage to the attacker.
Expand Down Expand Up @@ -2457,6 +2459,61 @@ func init() {
})
})

// https://www.wowhead.com/classic/item=233627/jom-gabbar
// Use: Increases attack power by 70 and an additional 70 every 2 sec. Lasts 20 sec. (2 Min Cooldown)
core.NewItemEffect(JomGabbar, func(agent core.Agent) {
character := agent.GetCharacter()
actionID := core.ActionID{SpellID: 1213366}
duration := time.Second * 20
bonusPerStack := stats.Stats{
stats.AttackPower: 70,
stats.RangedAttackPower: 70,
}

jomGabbarAura := character.GetOrRegisterAura(core.Aura{
Label: "Jom Gabbar",
ActionID: actionID,
Duration: duration,
MaxStacks: 10,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
core.StartPeriodicAction(sim, core.PeriodicActionOptions{
Period: time.Second * 2,
NumTicks: 10,
Priority: core.ActionPriorityAuto,
TickImmediately: true,
OnAction: func(sim *core.Simulation) {
aura.AddStack(sim)
},
})
},
OnStacksChange: func(aura *core.Aura, sim *core.Simulation, oldStacks, newStacks int32) {
bonusStats := bonusPerStack.Multiply(float64(newStacks - oldStacks))
character.AddStatsDynamic(sim, bonusStats)
},
})
spell := character.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagOffensiveEquipment,
Cast: core.CastConfig{
CD: core.Cooldown{
Timer: character.NewTimer(),
Duration: time.Minute * 2,
},
SharedCD: core.Cooldown{
Timer: character.GetOffensiveTrinketCD(),
Duration: duration,
},
},
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
jomGabbarAura.Activate(sim)
},
})
character.AddMajorCooldown(core.MajorCooldown{
Type: core.CooldownTypeDPS,
Spell: spell,
})
})

// Not yet in SoD
// core.NewItemEffect(MarkOfTheChampionPhys, func(agent core.Agent) {
// character := agent.GetCharacter()
Expand Down
77 changes: 72 additions & 5 deletions sim/core/consumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ func applyFlaskConsumes(character *Character, consumes *proto.Consumes) {
character.AddStats(stats.Stats{
stats.Mana: 2000,
})
case proto.Flask_FlaskOfUnyieldingSorrow:
character.AddStats(stats.Stats{
stats.SpellDamage: 27,
stats.HealingPower: 80,
stats.MP5: 12,
})
case proto.Flask_FlaskOfAncientKnowledge:
character.AddStats(stats.Stats{
stats.SpellPower: 180,
})
case proto.Flask_FlaskOfTheOldGods:
character.AddStats(stats.Stats{
stats.Stamina: 100,
stats.Defense: 10,
})
case proto.Flask_FlaskOfSupremePower:
character.AddStats(stats.Stats{
stats.SpellPower: 150,
Expand All @@ -75,6 +90,11 @@ func applyFlaskConsumes(character *Character, consumes *proto.Consumes) {
stats.AttackPower: 45,
stats.RangedAttackPower: 45,
})
case proto.Flask_FlaskOfMadness:
character.AddStats(stats.Stats{
stats.AttackPower: 50,
stats.RangedAttackPower: 50,
})
}
}

Expand Down Expand Up @@ -436,6 +456,12 @@ func DragonBreathChiliAura(character *Character) *Aura {
func applyDefensiveBuffConsumes(character *Character, consumes *proto.Consumes) {
if consumes.ArmorElixir != proto.ArmorElixir_ArmorElixirUnknown {
switch consumes.ArmorElixir {
case proto.ArmorElixir_ElixirOfTheIronside:
character.AddStats(stats.Stats{
stats.BonusArmor: 350,
stats.Defense: 5,
stats.NatureResistance: 15,
})
case proto.ArmorElixir_ElixirOfSuperiorDefense:
character.AddStats(stats.Stats{
stats.BonusArmor: 450,
Expand Down Expand Up @@ -492,6 +518,12 @@ func applyPhysicalBuffConsumes(character *Character, consumes *proto.Consumes) {

if consumes.AgilityElixir != proto.AgilityElixir_AgilityElixirUnknown {
switch consumes.AgilityElixir {
case proto.AgilityElixir_ElixirOfTheHoneyBadger:
character.AddStats(stats.Stats{
stats.Agility: 30,
stats.MeleeCrit: 2 * CritRatingPerCritChance,
stats.NatureResistance: 15,
})
case proto.AgilityElixir_ElixirOfTheMongoose:
character.AddStats(stats.Stats{
stats.Agility: 25,
Expand Down Expand Up @@ -553,6 +585,11 @@ func applySpellBuffConsumes(character *Character, consumes *proto.Consumes) {
character.AddStats(stats.Stats{
stats.SpellDamage: 35,
})
case proto.SpellPowerBuff_ElixirOfTheMageLord:
character.AddStats(stats.Stats{
stats.SpellDamage: 40,
stats.NatureResistance: 15,
})
}
}

Expand Down Expand Up @@ -858,33 +895,54 @@ func applyEnchantingConsumes(character *Character, consumes *proto.Consumes) {
stats.SpellPower: 30,
})
}
}
case proto.EnchantedSigil_WrathOfTheStormSigil:
for _, player := range character.Env.Raid.AllPlayerUnits {
player.AddStats(stats.Stats{
stats.AttackPower: 40,
stats.RangedAttackPower: 40,
stats.SpellPower: 40,
})
}
}
}

///////////////////////////////////////////////////////////////////////////
// Engineering Explosives
///////////////////////////////////////////////////////////////////////////

var SapperActionID = ActionID{ItemID: 10646}
var FumigatorActionID = ActionID{ItemID: 233985}
var SolidDynamiteActionID = ActionID{ItemID: 10507}
var DenseDynamiteActionID = ActionID{ItemID: 18641}
var ThoriumGrenadeActionID = ActionID{ItemID: 15993}
var EzThroRadiationBombActionID = ActionID{ItemID: 215168}
var HighYieldRadiationBombActionID = ActionID{ItemID: 215127}
var GoblinLandMineActionID = ActionID{ItemID: 4395}
var ObsidianBombActionID = ActionID{ItemID: 233986}

func registerExplosivesCD(agent Agent, consumes *proto.Consumes) {
character := agent.GetCharacter()
hasFiller := consumes.FillerExplosive != proto.Explosive_ExplosiveUnknown
hasSapper := consumes.SapperExplosive != proto.SapperExplosive_SapperUnknown

if !consumes.Sapper && !hasFiller {
if !hasSapper && !hasFiller {
return
}
sharedTimer := character.NewTimer()

if consumes.Sapper && character.HasProfession(proto.Profession_Engineering) {
if hasSapper {
if consumes.SapperExplosive != proto.SapperExplosive_SapperFumigator && !character.HasProfession(proto.Profession_Engineering) {
return
}
var filler *Spell
switch consumes.SapperExplosive {
case proto.SapperExplosive_SapperGoblinSapper:
filler = character.newSapperSpell(sharedTimer)
case proto.SapperExplosive_SapperFumigator:
filler = character.newFumigatorSpell(sharedTimer)
}
character.AddMajorCooldown(MajorCooldown{
Spell: character.newSapperSpell(sharedTimer),
Spell: filler,
Type: CooldownTypeDPS | CooldownTypeExplosive,
Priority: CooldownPriorityLow + 30,
ShouldActivate: func(s *Simulation, c *Character) bool {
Expand All @@ -900,6 +958,8 @@ func registerExplosivesCD(agent Agent, consumes *proto.Consumes) {

var filler *Spell
switch consumes.FillerExplosive {
case proto.Explosive_ExplosiveObsidianBomb:
filler = character.newObisidianBombSpell(sharedTimer)
case proto.Explosive_ExplosiveSolidDynamite:
filler = character.newSolidDynamiteSpell(sharedTimer)
case proto.Explosive_ExplosiveDenseDynamite:
Expand Down Expand Up @@ -928,7 +988,7 @@ func registerExplosivesCD(agent Agent, consumes *proto.Consumes) {
// Creates a spell object for the common explosive case.
// TODO: create 10s delay on Goblin Landmine cast to damage
func (character *Character) newBasicExplosiveSpellConfig(sharedTimer *Timer, actionID ActionID, school SpellSchool, minDamage float64, maxDamage float64, cooldown Cooldown, selfMinDamage float64, selfMaxDamage float64) SpellConfig {
isSapper := actionID.SameAction(SapperActionID)
isSapper := actionID.SameAction(SapperActionID) || actionID.SameAction(FumigatorActionID)

var defaultCast Cast
if !isSapper {
Expand Down Expand Up @@ -979,6 +1039,13 @@ func (character *Character) newBasicExplosiveSpellConfig(sharedTimer *Timer, act
func (character *Character) newSapperSpell(sharedTimer *Timer) *Spell {
return character.GetOrRegisterSpell(character.newBasicExplosiveSpellConfig(sharedTimer, SapperActionID, SpellSchoolFire, 450, 750, Cooldown{Timer: character.NewTimer(), Duration: time.Minute * 5}, 375, 625))
}
// Needs testing for Silithid interaction if in raid
func (character *Character) newFumigatorSpell(sharedTimer *Timer) *Spell {
return character.GetOrRegisterSpell(character.newBasicExplosiveSpellConfig(sharedTimer, FumigatorActionID, SpellSchoolFire, 650, 950, Cooldown{Timer: character.NewTimer(), Duration: time.Minute * 5}, 475, 725))
}
func (character *Character) newObisidianBombSpell(sharedTimer *Timer) *Spell {
return character.GetOrRegisterSpell(character.newBasicExplosiveSpellConfig(sharedTimer, ObsidianBombActionID, SpellSchoolFire, 530, 670, Cooldown{}, 0, 0))
}
func (character *Character) newSolidDynamiteSpell(sharedTimer *Timer) *Spell {
return character.GetOrRegisterSpell(character.newBasicExplosiveSpellConfig(sharedTimer, SolidDynamiteActionID, SpellSchoolFire, 213, 287, Cooldown{}, 0, 0))
}
Expand Down
3 changes: 2 additions & 1 deletion ui/core/components/individual_sim_ui/consumes_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,10 @@ export class ConsumesPicker extends Component {
const engiConsumesElem = this.rootElem.querySelector('.consumes-engi') as HTMLElement;

const explosiveOptions = ConsumablesInputs.makeExplosivesInput(relevantStatOptions(ConsumablesInputs.EXPLOSIVES_CONFIG, this.simUI), 'Explosives');
const sapperOptions = ConsumablesInputs.makeSappersInput(relevantStatOptions(ConsumablesInputs.SAPPER_CONFIG, this.simUI), 'Sappers');

const pickers = [
buildIconInput(engiConsumesElem, this.simUI.player, ConsumablesInputs.Sapper),
buildIconInput(engiConsumesElem, this.simUI.player, sapperOptions),
buildIconInput(engiConsumesElem, this.simUI.player, explosiveOptions),
];

Expand Down
Loading

0 comments on commit 43ba8d0

Please sign in to comment.