Skip to content

Commit

Permalink
add strength of wrynn 30% + raid sim buff
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Feb 16, 2024
1 parent 4bb6c17 commit f68fe14
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 40 deletions.
6 changes: 3 additions & 3 deletions sim/core/buffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ func applyBuffEffects(agent Agent, raidBuffs *proto.RaidBuffs, partyBuffs *proto
}

if raidBuffs.StrengthOfWrynn {
character.MultiplyStat(stats.Health, 1.25)
character.PseudoStats.DamageDealtMultiplier *= 1.25
character.PseudoStats.HealingTakenMultiplier *= 1.25
character.MultiplyStat(stats.Health, 1.30)
character.PseudoStats.DamageDealtMultiplier *= 1.30
character.PseudoStats.HealingTakenMultiplier *= 1.30
}

if raidBuffs.ArcaneEmpowerment || raidBuffs.FerociousInspiration || raidBuffs.SanctifiedRetribution {
Expand Down
39 changes: 24 additions & 15 deletions ui/core/components/icon_inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface BooleanInputConfig<T> {
}

export function makeBooleanRaidBuffInput<SpecType extends Spec>(config: BooleanInputConfig<RaidBuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, boolean> {
return InputHelpers.makeBooleanIconInput<any, RaidBuffs, Player<SpecType>>({
return InputHelpers.makeBooleanIconInput<RaidBuffs, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
showWhen: (player: Player<SpecType>) =>
(!config.faction || config.faction == player.getFaction()),
Expand All @@ -55,8 +55,17 @@ export function makeBooleanRaidBuffInput<SpecType extends Spec>(config: BooleanI
changeEmitter: (player: Player<SpecType>) => TypedEvent.onAny([player.getRaid()!.buffsChangeEmitter, player.raceChangeEmitter]),
}, config.actionId, config.fieldName, config.value);
}
export function makeBooleanRaidwideBuffInput(config: BooleanInputConfig<RaidBuffs>): InputHelpers.TypedIconPickerConfig<Raid, boolean> {
return InputHelpers.makeBooleanIconInput<RaidBuffs, Raid, Raid>({
getModObject: (raid: Raid) => raid,
showWhen: (_) => true,
getValue: (raid) => raid.getBuffs(),
setValue: (eventID, raid, newVal) => raid.setBuffs(eventID, newVal),
changeEmitter: (raid) => TypedEvent.onAny([raid.buffsChangeEmitter]),
}, config.actionId, config.fieldName, config.value);
}
export function makeBooleanPartyBuffInput<SpecType extends Spec>(config: BooleanInputConfig<PartyBuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, boolean> {
return InputHelpers.makeBooleanIconInput<any, PartyBuffs, Party>({
return InputHelpers.makeBooleanIconInput<PartyBuffs, Player<SpecType>, Party>({
getModObject: (player: Player<SpecType>) => player.getParty()!,
getValue: (party: Party) => party.getBuffs(),
setValue: (eventID: EventID, party: Party, newVal: PartyBuffs) => party.setBuffs(eventID, newVal),
Expand All @@ -65,7 +74,7 @@ export function makeBooleanPartyBuffInput<SpecType extends Spec>(config: Boolean
}

export function makeBooleanIndividualBuffInput<SpecType extends Spec>(config: BooleanInputConfig<IndividualBuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, boolean> {
return InputHelpers.makeBooleanIconInput<any, IndividualBuffs, Player<SpecType>>({
return InputHelpers.makeBooleanIconInput<IndividualBuffs, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
showWhen: (player: Player<SpecType>) =>
(!config.faction || config.faction == player.getFaction()),
Expand All @@ -76,15 +85,15 @@ export function makeBooleanIndividualBuffInput<SpecType extends Spec>(config: Bo
}

export function makeBooleanConsumeInput<SpecType extends Spec>(config: BooleanInputConfig<Consumes>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, boolean> {
return InputHelpers.makeBooleanIconInput<any, Consumes, Player<SpecType>>({
return InputHelpers.makeBooleanIconInput<Consumes, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
getValue: (player: Player<SpecType>) => player.getConsumes(),
setValue: (eventID: EventID, player: Player<SpecType>, newVal: Consumes) => player.setConsumes(eventID, newVal),
changeEmitter: (player: Player<SpecType>) => TypedEvent.onAny([player.consumesChangeEmitter])
}, config.actionId, config.fieldName, config.value);
}
export function makeBooleanDebuffInput<SpecType extends Spec>(config: BooleanInputConfig<Debuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, boolean> {
return InputHelpers.makeBooleanIconInput<any, Debuffs, Player<SpecType>>({
return InputHelpers.makeBooleanIconInput<Debuffs, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
getValue: (player: Player<SpecType>) => player.getRaid()!.getDebuffs(),
setValue: (eventID: EventID, player: Player<SpecType>, newVal: Debuffs) => player.getRaid()!.setDebuffs(eventID, newVal),
Expand All @@ -100,7 +109,7 @@ interface TristateInputConfig<T> {
}

export function makeTristateRaidBuffInput<SpecType extends Spec>(config: TristateInputConfig<RaidBuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, number> {
return InputHelpers.makeTristateIconInput<any, RaidBuffs, Player<SpecType>>({
return InputHelpers.makeTristateIconInput<RaidBuffs, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
showWhen: (player: Player<SpecType>) =>
(!config.faction || config.faction == player.getFaction()),
Expand All @@ -111,7 +120,7 @@ export function makeTristateRaidBuffInput<SpecType extends Spec>(config: Tristat
}

export function makeTristateIndividualBuffInput<SpecType extends Spec>(config: TristateInputConfig<IndividualBuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, number> {
return InputHelpers.makeTristateIconInput<any, IndividualBuffs, Player<SpecType>>({
return InputHelpers.makeTristateIconInput<IndividualBuffs, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
showWhen: (player: Player<SpecType>) =>
(!config.faction || config.faction == player.getFaction()),
Expand All @@ -122,7 +131,7 @@ export function makeTristateIndividualBuffInput<SpecType extends Spec>(config: T
}

export function makeTristateDebuffInput<SpecType extends Spec>(config: TristateInputConfig<Debuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, number> {
return InputHelpers.makeTristateIconInput<any, Debuffs, Raid>({
return InputHelpers.makeTristateIconInput<Debuffs, Player<SpecType>, Raid>({
getModObject: (player: Player<SpecType>) => player.getRaid()!,
getValue: (raid: Raid) => raid.getDebuffs(),
setValue: (eventID: EventID, raid: Raid, newVal: Debuffs) => raid.setDebuffs(eventID, newVal),
Expand All @@ -139,7 +148,7 @@ interface QuadStateInputConfig<T> {
}

export function makeQuadstateDebuffInput<SpecType extends Spec>(config: QuadStateInputConfig<Debuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, number> {
return InputHelpers.makeQuadstateIconInput<any, Debuffs, Raid>({
return InputHelpers.makeQuadstateIconInput<Debuffs, Player<SpecType>, Raid>({
getModObject: (player: Player<SpecType>) => player.getRaid()!,
getValue: (raid: Raid) => raid.getDebuffs(),
setValue: (eventID: EventID, raid: Raid, newVal: Debuffs) => raid.setDebuffs(eventID, newVal),
Expand All @@ -156,7 +165,7 @@ interface MultiStateInputConfig<T> {
}

export function makeMultistateRaidBuffInput<SpecType extends Spec>(config: MultiStateInputConfig<RaidBuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, number> {
return InputHelpers.makeMultistateIconInput<any, RaidBuffs, Player<SpecType>>({
return InputHelpers.makeMultistateIconInput<RaidBuffs, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
showWhen: (player: Player<SpecType>) =>
(!config.faction || config.faction == player.getFaction()),
Expand All @@ -166,15 +175,15 @@ export function makeMultistateRaidBuffInput<SpecType extends Spec>(config: Multi
}, config.actionId, config.numStates, config.fieldName, config.multiplier);
}
export function makeMultistatePartyBuffInput<SpecType extends Spec>(actionId: ActionId, numStates: number, fieldName: keyof PartyBuffs): InputHelpers.TypedIconPickerConfig<Player<SpecType>, number> {
return InputHelpers.makeMultistateIconInput<any, PartyBuffs, Party>({
return InputHelpers.makeMultistateIconInput<PartyBuffs, Player<SpecType>, Party>({
getModObject: (player: Player<SpecType>) => player.getParty()!,
getValue: (party: Party) => party.getBuffs(),
setValue: (eventID: EventID, party: Party, newVal: PartyBuffs) => party.setBuffs(eventID, newVal),
changeEmitter: (party: Party) => party.buffsChangeEmitter,
}, actionId, numStates, fieldName);
}
export function makeMultistateIndividualBuffInput<SpecType extends Spec>(config: MultiStateInputConfig<IndividualBuffs>): InputHelpers.TypedIconPickerConfig<Player<SpecType>, number> {
return InputHelpers.makeMultistateIconInput<any, IndividualBuffs, Player<SpecType>>({
return InputHelpers.makeMultistateIconInput<IndividualBuffs, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
showWhen: (player: Player<SpecType>) =>
(!config.faction || config.faction == player.getFaction()),
Expand All @@ -185,7 +194,7 @@ export function makeMultistateIndividualBuffInput<SpecType extends Spec>(config:
}

export function makeMultistateMultiplierIndividualBuffInput<SpecType extends Spec>(actionId: ActionId, numStates: number, multiplier: number, fieldName: keyof IndividualBuffs): InputHelpers.TypedIconPickerConfig<Player<SpecType>, number> {
return InputHelpers.makeMultistateIconInput<any, IndividualBuffs, Player<SpecType>>({
return InputHelpers.makeMultistateIconInput<IndividualBuffs, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
getValue: (player: Player<SpecType>) => player.getBuffs(),
setValue: (eventID: EventID, player: Player<SpecType>, newVal: IndividualBuffs) => player.setBuffs(eventID, newVal),
Expand All @@ -194,7 +203,7 @@ export function makeMultistateMultiplierIndividualBuffInput<SpecType extends Spe
}

export function makeMultistateMultiplierDebuffInput<SpecType extends Spec>(actionId: ActionId, numStates: number, multiplier: number, fieldName: keyof Debuffs): InputHelpers.TypedIconPickerConfig<Player<any>, number> {
return InputHelpers.makeMultistateIconInput<any, Debuffs, Raid>({
return InputHelpers.makeMultistateIconInput<Debuffs, Player<SpecType>, Raid>({
getModObject: (player: Player<SpecType>) => player.getRaid()!,
getValue: (raid: Raid) => raid.getDebuffs(),
setValue: (eventID: EventID, raid: Raid, newVal: Debuffs) => raid.setDebuffs(eventID, newVal),
Expand All @@ -211,7 +220,7 @@ export function makeMultistateMultiplierDebuffInput<SpecType extends Spec>(actio
// }

// export function makeEnumIndividualBuffInput<SpecType extends Spec>(config: EnumInputConfig<Player<SpecType>, IndividualBuffs, number>): InputHelpers.TypedIconEnumPickerConfig<Player<SpecType>, number> {
// return InputHelpers.makeEnumIconInput<any, IndividualBuffs, Player<SpecType>, number>({
// return InputHelpers.makeEnumIconInput<IndividualBuffs, Player<SpecType>, number>({
// getModObject: (player: Player<SpecType>) => player,
// showWhen: (player: Player<SpecType>) =>
// (!config.faction || config.faction == player.getFaction()),
Expand Down
32 changes: 16 additions & 16 deletions ui/core/components/input_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,24 +266,24 @@ export interface TypedIconPickerConfig<ModObject, T> extends IconPickerConfig<Mo
type: 'icon',
}

interface WrappedIconInputConfig<SpecType extends Spec, ModObject, T> extends IconPickerConfig<ModObject, T> {
getModObject: (player: Player<SpecType>) => ModObject,
interface WrappedIconInputConfig<BaseObject, ModObject, T> extends IconPickerConfig<ModObject, T> {
getModObject: (baseObj: BaseObject) => ModObject,
}
function makeWrappedIconInput<SpecType extends Spec, ModObject, T>(config: WrappedIconInputConfig<SpecType, ModObject, T>): TypedIconPickerConfig<Player<SpecType>, T> {
function makeWrappedIconInput<BaseObject, ModObject, T>(config: WrappedIconInputConfig<BaseObject, ModObject, T>): TypedIconPickerConfig<BaseObject, T> {
const getModObject = config.getModObject;
return {
type: 'icon',
actionId: config.actionId,
states: config.states,
changedEvent: (player: Player<SpecType>) => config.changedEvent(getModObject(player)),
getValue: (player: Player<SpecType>) => config.getValue(getModObject(player)),
setValue: (eventID: EventID, player: Player<SpecType>, newValue: T) => config.setValue(eventID, getModObject(player), newValue),
changedEvent: (baseObj) => config.changedEvent(getModObject(baseObj)),
getValue: (baseObj) => config.getValue(getModObject(baseObj)),
setValue: (eventID: EventID, baseObj, newValue: T) => config.setValue(eventID, getModObject(baseObj), newValue),
extraCssClasses: config.extraCssClasses,
}
}

interface WrappedTypedInputConfig<Message, ModObject, T> {
getModObject: (player: Player<any>) => ModObject,
interface WrappedTypedInputConfig<Message, BaseObject, ModObject, T> {
getModObject: (baseObj: BaseObject) => ModObject,
getValue: (modObj: ModObject) => Message,
setValue: (eventID: EventID, modObj: ModObject, messageVal: Message) => void,
changeEmitter: (modObj: ModObject) => TypedEvent<any>,
Expand All @@ -294,8 +294,8 @@ interface WrappedTypedInputConfig<Message, ModObject, T> {
setFieldValue?: (eventID: EventID, modObj: ModObject, newValue: T) => void,
}

export function makeBooleanIconInput<SpecType extends Spec, Message, ModObject>(config: WrappedTypedInputConfig<Message, ModObject, boolean>, actionId: ActionId, fieldName: keyof Message, value?: number): TypedIconPickerConfig<Player<SpecType>, boolean> {
return makeWrappedIconInput<SpecType, ModObject, boolean>({
export function makeBooleanIconInput<Message, BaseObject, ModObject>(config: WrappedTypedInputConfig<Message, BaseObject, ModObject, boolean>, actionId: ActionId, fieldName: keyof Message, value?: number): TypedIconPickerConfig<BaseObject, boolean> {
return makeWrappedIconInput<BaseObject, ModObject, boolean>({
getModObject: config.getModObject,
actionId: actionId,
states: 2,
Expand Down Expand Up @@ -324,7 +324,7 @@ export interface PlayerBooleanIconInputConfig<SpecType extends Spec, Message, T>
value?: number,
}
export function makeSpecOptionsBooleanIconInput<SpecType extends Spec>(config: PlayerBooleanIconInputConfig<SpecType, SpecOptions<SpecType>, boolean>): TypedIconPickerConfig<Player<SpecType>, boolean> {
return makeBooleanIconInput<SpecType, SpecOptions<SpecType>, Player<SpecType>>({
return makeBooleanIconInput<SpecOptions<SpecType>, Player<SpecType>, Player<SpecType>>({
getModObject: (player: Player<SpecType>) => player,
getValue: (player: Player<SpecType>) => player.getSpecOptions(),
setValue: (eventID: EventID, player: Player<SpecType>, newVal: SpecOptions<SpecType>) => player.setSpecOptions(eventID, newVal),
Expand All @@ -335,8 +335,8 @@ export function makeSpecOptionsBooleanIconInput<SpecType extends Spec>(config: P
}, config.id, config.fieldName, config.value);
}

function makeNumberIconInput<SpecType extends Spec, Message, ModObject>(config: WrappedTypedInputConfig<Message, ModObject, number>, actionId: ActionId, fieldName: keyof Message, multiplier?: number): TypedIconPickerConfig<Player<SpecType>, number> {
return makeWrappedIconInput<SpecType, ModObject, number>({
function makeNumberIconInput<Message, BaseObject, ModObject>(config: WrappedTypedInputConfig<Message, BaseObject, ModObject, number>, actionId: ActionId, fieldName: keyof Message, multiplier?: number): TypedIconPickerConfig<BaseObject, number> {
return makeWrappedIconInput<BaseObject, ModObject, number>({
getModObject: config.getModObject,
actionId: actionId,
states: 0, // Must be assigned externally.
Expand All @@ -356,20 +356,20 @@ function makeNumberIconInput<SpecType extends Spec, Message, ModObject>(config:
},
});
}
export function makeTristateIconInput<SpecType extends Spec, Message, ModObject>(config: WrappedTypedInputConfig<Message, ModObject, number>, id: ActionId, impId: ActionId, fieldName: keyof Message): TypedIconPickerConfig<Player<SpecType>, number> {
export function makeTristateIconInput<Message, BaseObject, ModObject>(config: WrappedTypedInputConfig<Message, BaseObject, ModObject, number>, id: ActionId, impId: ActionId, fieldName: keyof Message): TypedIconPickerConfig<BaseObject, number> {
const input = makeNumberIconInput(config, id, fieldName);
input.states = 3;
input.improvedId = impId;
return input;
}
export function makeQuadstateIconInput<SpecType extends Spec, Message, ModObject>(config: WrappedTypedInputConfig<Message, ModObject, number>, id: ActionId, impId: ActionId, impId2: ActionId, fieldName: keyof Message): TypedIconPickerConfig<Player<SpecType>, number> {
export function makeQuadstateIconInput<Message, BaseObject, ModObject>(config: WrappedTypedInputConfig<Message, BaseObject, ModObject, number>, id: ActionId, impId: ActionId, impId2: ActionId, fieldName: keyof Message): TypedIconPickerConfig<BaseObject, number> {
const input = makeNumberIconInput(config, id, fieldName);
input.states = 4;
input.improvedId = impId;
input.improvedId2 = impId2;
return input;
}
export function makeMultistateIconInput<SpecType extends Spec, Message, ModObject>(config: WrappedTypedInputConfig<Message, ModObject, number>, id: ActionId, numStates: number, fieldName: keyof Message, multiplier?: number): TypedIconPickerConfig<Player<SpecType>, number> {
export function makeMultistateIconInput<Message, BaseObject, ModObject>(config: WrappedTypedInputConfig<Message, BaseObject, ModObject, number>, id: ActionId, numStates: number, fieldName: keyof Message, multiplier?: number): TypedIconPickerConfig<BaseObject, number> {
const input = makeNumberIconInput(config, id, fieldName, multiplier);
input.states = numStates;
return input;
Expand Down
2 changes: 1 addition & 1 deletion ui/core/components/inputs/buffs_debuffs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const StrengthAndAgilityBuff = InputHelpers.makeMultiIconInput([
], 'Str/Agi');

// Misc Buffs
export const StrengthOfWrynn = makeBooleanRaidBuffInput({actionId: ActionId.fromSpellId(73827), fieldName: 'strengthOfWrynn'});
export const StrengthOfWrynn = makeBooleanRaidBuffInput({actionId: ActionId.fromSpellId(73828), fieldName: 'strengthOfWrynn'});
export const RetributionAura = makeBooleanRaidBuffInput({actionId: ActionId.fromSpellId(54043), fieldName: 'retributionAura'});
export const BraidedEterniumChain = makeBooleanPartyBuffInput({actionId: ActionId.fromSpellId(31025), fieldName: 'braidedEterniumChain'});
export const ChainOfTheTwilightOwl = makeBooleanPartyBuffInput({actionId: ActionId.fromSpellId(31035), fieldName: 'chainOfTheTwilightOwl'});
Expand Down
11 changes: 6 additions & 5 deletions ui/raid/settings_tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export class SettingsTab extends SimTab {
protected buildTabContent() {
this.buildEncounterSettings();
this.buildConsumesSettings();
this.buildOtherSettings();

this.buildTankSettings();
this.buildAssignmentSettings();
this.buildOtherSettings();

this.buildBlessingsPicker();
this.buildSavedDataPickers();
Expand Down Expand Up @@ -90,10 +90,11 @@ export class SettingsTab extends SimTab {
}

private buildOtherSettings() {
// const raid = this.simUI.sim.raid;
// const contentBlock = new ContentBlock(this.column1, 'other-settings', {
// header: {title: 'Other'}
// });
const contentBlock = new ContentBlock(this.column2, 'other-settings', {
header: {title: 'Other'}
});

this.makeBooleanRaidIconBuffInput(contentBlock.bodyElement, ActionId.fromSpellId(73828), 'strengthOfWrynn');

// new BooleanPicker(contentBlock.bodyElement, this.simUI.sim.raid, {
// label: 'Stagger Stormstrikes',
Expand Down

0 comments on commit f68fe14

Please sign in to comment.