diff --git a/src/app/helpers/autocontent/traitscrolls.ts b/src/app/helpers/autocontent/traitscrolls.ts index 71f96bb..4bea98e 100644 --- a/src/app/helpers/autocontent/traitscrolls.ts +++ b/src/app/helpers/autocontent/traitscrolls.ts @@ -15,10 +15,11 @@ const romans: Record = { 5: 'V', }; -const TRAIT_PREFIX = `Rune Scroll - `; +const TRAIT_PREFIX = `Rune Scroll -`; export function generateTraitScrolls( mod: IModKit, + allTraits: any = {}, allTraitTrees: any = {} ): IItemDefinition[] { const scrollToClass: Record = {}; @@ -26,6 +27,15 @@ export function generateTraitScrolls( const returnedRuneScrolls: IItemDefinition[] = []; + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + Object.keys(allTraits).forEach((traitName) => { + const traitData = allTraits[traitName]; + + if (traitData.spellGiven) return; + + allRuneScrolls.add(traitName); + }); + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument Object.keys(allTraitTrees).forEach((classTree) => { if (classTree === 'Ancient') return; @@ -38,7 +48,11 @@ export function generateTraitScrolls( tree.forEach(({ traits }: any) => { traits.forEach(({ name, maxLevel }: any) => { - if (!name || maxLevel <= 1) return; + if (!name) return; + if (maxLevel <= 1) { + allRuneScrolls.delete(name as string); + return; + } scrollToClass[name] ??= []; diff --git a/src/app/services/mod.service.ts b/src/app/services/mod.service.ts index 07378ce..d2a6ac6 100644 --- a/src/app/services/mod.service.ts +++ b/src/app/services/mod.service.ts @@ -478,8 +478,11 @@ export class ModService { message: `Created and updated ${loreItems.length} lore scrolls.`, }); - console.log(this.json()['trait-trees']); - const runeItems = generateTraitScrolls(mod, this.json()['trait-trees']); + const runeItems = generateTraitScrolls( + mod, + this.json()['traits'], + this.json()['trait-trees'] + ); cleanOldTraitScrolls(mod); applyTraitScrolls(mod, runeItems); diff --git a/src/app/shared/components/page-not-found/page-not-found.component.ts b/src/app/shared/components/page-not-found/page-not-found.component.ts index 7f917c1..db812fa 100644 --- a/src/app/shared/components/page-not-found/page-not-found.component.ts +++ b/src/app/shared/components/page-not-found/page-not-found.component.ts @@ -1,14 +1,10 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-page-not-found', templateUrl: './page-not-found.component.html', - styleUrls: ['./page-not-found.component.scss'] + styleUrls: ['./page-not-found.component.scss'], }) -export class PageNotFoundComponent implements OnInit { +export class PageNotFoundComponent { constructor() {} - - ngOnInit(): void { - console.log('PageNotFoundComponent INIT'); - } }