Skip to content

Commit

Permalink
#44
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Aug 19, 2024
1 parent 3f7a4d6 commit ecc6d74
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
18 changes: 16 additions & 2 deletions src/app/helpers/autocontent/traitscrolls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,27 @@ const romans: Record<number, string> = {
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<string, string[]> = {};
const allRuneScrolls = new Set<string>();

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;
Expand All @@ -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] ??= [];

Expand Down
7 changes: 5 additions & 2 deletions src/app/services/mod.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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');
}
}

0 comments on commit ecc6d74

Please sign in to comment.