Skip to content

Commit

Permalink
better handling of skill levels
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 16, 2024
1 parent db12379 commit e0a2ffc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/tabs/npcs/npcs-editor/npcs-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import {
ItemSlot,
ItemSlotType,
Rollable,
Skill,
SkillType,
StatType,
} from '../../../../interfaces';
import { levelFromSkillXP } from '../../../helpers/export';
import { levelFromSkillXP, skillXPFromLevel } from '../../../helpers/export';
import { EditorBaseComponent } from '../../../shared/components/editor-base/editor-base.component';

@Component({
Expand Down Expand Up @@ -508,6 +509,12 @@ export class NpcsEditorComponent
delete (npc as any).triggers;
}

Object.values(Skill).forEach((skill) => {
npc.skills[skill.toLowerCase() as SkillType] = skillXPFromLevel(
npc.skillLevels
);
});

this.editing.set(npc);

super.doSave();
Expand Down
7 changes: 7 additions & 0 deletions src/app/tabs/npcs/npcs.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ export class NpcsComponent extends EditorBaseTableComponent<EditingType> {
cellDataType: 'number',
filter: 'agNumberColumnFilter',
},
{
field: 'skillLevels',
headerName: 'Skill',
flex: 1,
cellDataType: 'number',
filter: 'agNumberColumnFilter',
},
{
field: 'cr',
headerName: 'Challenge Rating',
Expand Down

0 comments on commit e0a2ffc

Please sign in to comment.