Skip to content

Commit

Permalink
make trait scrolls bind properly if they're holiday
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Oct 6, 2024
1 parent b1e5d34 commit 2887c14
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/helpers/autocontent/traitscrolls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ export function generateTraitScrolls(mod: IModKit): IItemDefinition[] {
const returnedRuneScrolls: IItemDefinition[] = [];

const banned = ['Unimbued'];
const shouldBind: string[] = [];

const allHolidays = mod.cores.find((f) => f.name === 'holidaydescs');
if (allHolidays) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
Object.values(allHolidays.json ?? {}).forEach((holidayValue: any) => {
if (!holidayValue.traits) return;

shouldBind.push(...(holidayValue.traits as string[]));
});
}

const firstLevelFound: Record<string, number> = {};

Expand Down Expand Up @@ -95,6 +106,7 @@ export function generateTraitScrolls(mod: IModKit): IItemDefinition[] {
requirements: {
level: (firstLevelFound[scrollName] ?? 0) + i * 5,
},
binds: shouldBind.includes(scrollName),
value: 1,
itemClass: ItemClass.Scroll,
type: Skill.Martial,
Expand Down

0 comments on commit 2887c14

Please sign in to comment.