Skip to content

Commit

Permalink
Merge pull request #66 from wowsims/warlock
Browse files Browse the repository at this point in the history
imp max firebolt rank
  • Loading branch information
rosenrusinov authored Feb 5, 2024
2 parents bc08e44 + 00fec92 commit ef5be0a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
15 changes: 14 additions & 1 deletion proto/warlock.proto
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,22 @@ message WarlockOptions {
Firestone = 2;
}

enum MaxFireboltRank {
NoMaximum = 0;
Rank1 = 1;
Rank2 = 2;
Rank3 = 3;
Rank4 = 4;
Rank5 = 5;
Rank6 = 6;
Rank7 = 7;
Rank8 = 8;
}

Armor armor = 1;
Summon summon = 2;
WeaponImbue weaponImbue = 3;
WeaponImbue weapon_imbue = 3;
MaxFireboltRank max_firebolt_rank = 4;
}

message Warlock {
Expand Down
5 changes: 5 additions & 0 deletions sim/warlock/pet_abilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"time"

"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)

func (wp *WarlockPet) registerFireboltSpell() {
Expand All @@ -15,6 +16,10 @@ func (wp *WarlockPet) registerFireboltSpell() {
rank = 1
}

if wp.owner.Options.MaxFireboltRank != proto.WarlockOptions_NoMaximum {
rank = min(rank, int(wp.owner.Options.MaxFireboltRank))
}

spellCoeff := [8]float64{0, .164, .314, .529, .571, .571, .571, .571}[rank]
baseDamage := [8][]float64{{0, 0}, {7, 10}, {14, 16}, {25, 29}, {36, 41}, {52, 59}, {72, 80}, {85, 96}}[rank]
spellId := [8]int32{0, 3110, 7799, 7800, 7801, 7802, 11762, 11763}[rank]
Expand Down
19 changes: 18 additions & 1 deletion ui/warlock/inputs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
WarlockOptions_Armor as Armor,
WarlockOptions_Summon as Summon,
WarlockOptions_WeaponImbue as WeaponImbue
WarlockOptions_WeaponImbue as WeaponImbue,
WarlockOptions_MaxFireboltRank as MaxFireboltRank
} from '../core/proto/warlock.js';

import { Player } from '../core/player.js';
Expand Down Expand Up @@ -42,3 +43,19 @@ export const PetInput = InputHelpers.makeSpecOptionsEnumIconInput<Spec.SpecWarlo
],
changeEmitter: (player: Player<Spec.SpecWarlock>) => player.changeEmitter,
});

export const ImpFireboltRank = InputHelpers.makeSpecOptionsEnumIconInput<Spec.SpecWarlock, MaxFireboltRank>({
fieldName: 'maxFireboltRank',
showWhen: (player) => player.getSpecOptions().summon == Summon.Imp,
values: [
{ value: MaxFireboltRank.NoMaximum, tooltip: 'Max' },
{ actionId: () => ActionId.fromSpellId(3110), value: MaxFireboltRank.Rank1 },
{ actionId: () => ActionId.fromSpellId(7799), value: MaxFireboltRank.Rank2 },
{ actionId: () => ActionId.fromSpellId(7800), value: MaxFireboltRank.Rank3 },
{ actionId: () => ActionId.fromSpellId(7801), value: MaxFireboltRank.Rank4 },
{ actionId: () => ActionId.fromSpellId(7802), value: MaxFireboltRank.Rank5 },
{ actionId: () => ActionId.fromSpellId(11762), value: MaxFireboltRank.Rank6 },
{ actionId: () => ActionId.fromSpellId(11763), value: MaxFireboltRank.Rank7 },
],
changeEmitter: (player: Player<Spec.SpecWarlock>) => player.changeEmitter,
});
1 change: 1 addition & 0 deletions ui/warlock/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecWarlock, {
// IconInputs to include in the 'Player' section on the settings tab.
playerIconInputs: [
WarlockInputs.PetInput,
WarlockInputs.ImpFireboltRank,
WarlockInputs.ArmorInput,
WarlockInputs.WeaponImbueInput,
],
Expand Down

0 comments on commit ef5be0a

Please sign in to comment.