Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish raid stats display #2282

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ui/balance_druid/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ export const StandardTalents = {
};

export const DefaultRotation = BalanceDruidRotation.create({
type: RotationType.Adaptive,
useSmartCooldowns : true,
mfUsage : BalanceDruid_Rotation_MfUsage.NoMf,
isUsage : BalanceDruid_Rotation_IsUsage.MaximizeIs,
type: RotationType.Adaptive,
maintainFaerieFire: true,
useSmartCooldowns: true,
mfUsage: BalanceDruid_Rotation_MfUsage.NoMf,
isUsage: BalanceDruid_Rotation_IsUsage.MaximizeIs,
useStarfire: true,
useWrath: true,
useBattleRes: false,
playerLatency : 200,
useBattleRes: false,
playerLatency: 200,
});

export const DefaultOptions = BalanceDruidOptions.create({
Expand Down
2 changes: 1 addition & 1 deletion ui/core/components/icon_inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export const PhysicalDamageDebuff = InputHelpers.makeMultiIconInput([
], 'Phys Vuln');

export const SpellCritDebuff = InputHelpers.makeMultiIconInput([
makeBooleanDebuffInput(ActionId.fromSpellId(17800), 'shadowMastery'),
makeBooleanDebuffInput(ActionId.fromSpellId(17803), 'shadowMastery'),
makeBooleanDebuffInput(ActionId.fromSpellId(12873), 'improvedScorch'),
makeBooleanDebuffInput(ActionId.fromSpellId(28593), 'wintersChill'),
], 'Spell Crit');
Expand Down
13 changes: 5 additions & 8 deletions ui/core/components/sim_title_dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
raidSimLabel,
specNames,
specToClass,
textCssClassForClass,
textCssClassForSpec,
titleIcons,
} from '../proto_utils/utils.js';

Expand Down Expand Up @@ -283,18 +285,13 @@ export class SimTitleDropdown extends Component {
}

private getContextualKlass(data: ClassOptions | SpecOptions | RaidOptions): string {
let klass: string;

if (data.type == 'Raid')
// Raid link
klass = 'text-white';
return 'text-white';
else if (data.type == 'Class')
// Class links
klass = `text-${classNames[data.index].toLowerCase().replace(/\s/g, '-')}`;
return textCssClassForClass(data.index);
else
// Spec links
klass = `text-${classNames[specToClass[data.index]].toLowerCase().replace(/\s/g, '-')}`;

return klass;
return textCssClassForSpec(data.index);
}
}
8 changes: 8 additions & 0 deletions ui/core/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
import { Stats } from './proto_utils/stats.js';

import {
ClassSpecs,
SpecRotation,
SpecTalents,
SpecTypeFunctions,
Expand Down Expand Up @@ -178,6 +179,13 @@ export class Player<SpecType extends Spec> {
return classColors[this.getClass()];
}

isSpec<T extends Spec>(spec: T): this is Player<T> {
return this.spec == spec;
}
isClass<T extends Class>(clazz: T): this is Player<ClassSpecs<T>> {
return this.getClass() == clazz;
}

getParty(): Party | null {
return this.party;
}
Expand Down
20 changes: 20 additions & 0 deletions ui/core/proto_utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,13 @@ export function getSpecSiteUrl(spec: Spec): string {
}
export const raidSimSiteUrl = new URL(`${window.location.protocol}//${window.location.host}/${REPO_NAME}/raid/`).toString();

export function textCssClassForClass(clazz: Class): string {
return `text-${classNames[clazz].toLowerCase().replace(/\s/g, '-')}`;
}
export function textCssClassForSpec(spec: Spec): string {
return textCssClassForClass(specToClass[spec]);
}

export type RotationUnion =
BalanceDruidRotation |
FeralDruidRotation |
Expand Down Expand Up @@ -1315,6 +1322,19 @@ export function isHealingSpec(spec: Spec): boolean {
return healingSpecs.includes(spec);
}

const rangedDpsSpecs: Array<Spec> = [
Spec.SpecBalanceDruid,
Spec.SpecHunter,
Spec.SpecMage,
Spec.SpecShadowPriest,
Spec.SpecSmitePriest,
Spec.SpecElementalShaman,
Spec.SpecWarlock,
];
export function isRangedDpsSpec(spec: Spec): boolean {
return rangedDpsSpecs.includes(spec);
}

// Prefixes used for storing browser data for each site. Even if a Spec is
// renamed, DO NOT change these values or people will lose their saved data.
export const specToLocalStorageKey: Record<Spec, string> = {
Expand Down
7 changes: 1 addition & 6 deletions ui/raid/assignments_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,7 @@ class PowerInfusionsPicker extends AssignedBuffPicker {
return this.raidSimUI.getPlayers()
.filter(player => player?.getClass() == Class.ClassPriest)
.filter(player => {
if (!(player! as Player<Spec.SpecSmitePriest>).getTalents().powerInfusion) {
return false;
}
// Don't include shadow priests even if they have the talent, because they
// don't have a raid target option for this.
return player!.spec != Spec.SpecShadowPriest;
return (player as Player<Spec.SpecSmitePriest>).getTalents().powerInfusion;
}) as Array<Player<any>>;
}

Expand Down
26 changes: 25 additions & 1 deletion ui/raid/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,30 @@ export const playerPresets: Array<PresetSpecSettings<any>> = [
tooltip: 'Frost Mage',
iconUrl: talentTreeIcons[Class.ClassMage][2],
},
{
spec: Spec.SpecRogue,
rotation: RoguePresets.DefaultRotation,
talents: RoguePresets.AssassinationTalents.data,
specOptions: RoguePresets.DefaultOptions,
consumes: RoguePresets.DefaultConsumes,
defaultName: 'Assassination Rogue',
defaultFactionRaces: {
[Faction.Unknown]: Race.RaceUnknown,
[Faction.Alliance]: Race.RaceHuman,
[Faction.Horde]: Race.RaceOrc,
},
defaultGear: {
[Faction.Unknown]: {},
[Faction.Alliance]: {
1: RoguePresets.P1_PRESET_ASSASSINATION.gear,
},
[Faction.Horde]: {
1: RoguePresets.P1_PRESET_ASSASSINATION.gear,
},
},
tooltip: 'Assassination Rogue',
iconUrl: talentTreeIcons[Class.ClassRogue][0],
},
{
spec: Spec.SpecRogue,
rotation: RoguePresets.DefaultRotation,
Expand All @@ -467,7 +491,7 @@ export const playerPresets: Array<PresetSpecSettings<any>> = [
},
},
tooltip: 'Combat Rogue',
iconUrl: specIconsLarge[Spec.SpecRogue],
iconUrl: talentTreeIcons[Class.ClassRogue][1],
},
{
spec: Spec.SpecElementalShaman,
Expand Down
Loading