From ef2276d455cb7b4c7b21b28427553d7bdf2e26db Mon Sep 17 00:00:00 2001 From: Kyle Kemp Date: Tue, 20 Aug 2024 09:51:51 -0500 Subject: [PATCH] start core work --- src/app/helpers/core.ts | 8 +++ src/app/helpers/exporter.ts | 1 + src/app/home/home.component.html | 10 ++- src/app/home/home.component.ts | 6 +- src/app/home/home.module.ts | 22 ++++++- src/app/services/mod.service.ts | 14 ++++ .../cores-editor/cores-editor.component.html | 18 +++++ .../cores-editor/cores-editor.component.scss | 0 .../cores-editor/cores-editor.component.ts | 17 +++++ src/app/tabs/cores/cores.component.html | 10 +++ src/app/tabs/cores/cores.component.scss | 0 src/app/tabs/cores/cores.component.ts | 65 ++++++++++++++++++ .../stems-editor/stems-editor.component.html | 1 + .../stems-editor/stems-editor.component.scss | 0 .../stems-editor/stems-editor.component.ts | 10 +++ src/app/tabs/stems/stems.component.html | 1 + src/app/tabs/stems/stems.component.scss | 0 src/app/tabs/stems/stems.component.ts | 10 +++ .../trait-trees-editor.component.html | 1 + .../trait-trees-editor.component.scss | 0 .../trait-trees-editor.component.ts | 10 +++ .../trait-trees/trait-trees.component.html | 1 + .../trait-trees/trait-trees.component.scss | 0 .../tabs/trait-trees/trait-trees.component.ts | 10 +++ src/interfaces/core.ts | 6 ++ src/interfaces/effect.ts | 66 ++++++++++--------- src/interfaces/index.ts | 4 ++ src/interfaces/item.ts | 2 +- src/interfaces/itemeffect.ts | 41 ++++++++++++ src/interfaces/macro.ts | 20 ++++++ src/interfaces/modkit.ts | 2 + src/interfaces/spell.ts | 45 +++++++++++++ src/interfaces/stem.ts | 19 ++++++ src/interfaces/trait-tree.ts | 22 +++++++ src/interfaces/trait.ts | 10 +++ 35 files changed, 414 insertions(+), 38 deletions(-) create mode 100644 src/app/helpers/core.ts create mode 100644 src/app/tabs/cores/cores-editor/cores-editor.component.html create mode 100644 src/app/tabs/cores/cores-editor/cores-editor.component.scss create mode 100644 src/app/tabs/cores/cores-editor/cores-editor.component.ts create mode 100644 src/app/tabs/cores/cores.component.html create mode 100644 src/app/tabs/cores/cores.component.scss create mode 100644 src/app/tabs/cores/cores.component.ts create mode 100644 src/app/tabs/stems/stems-editor/stems-editor.component.html create mode 100644 src/app/tabs/stems/stems-editor/stems-editor.component.scss create mode 100644 src/app/tabs/stems/stems-editor/stems-editor.component.ts create mode 100644 src/app/tabs/stems/stems.component.html create mode 100644 src/app/tabs/stems/stems.component.scss create mode 100644 src/app/tabs/stems/stems.component.ts create mode 100644 src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.html create mode 100644 src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.scss create mode 100644 src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.ts create mode 100644 src/app/tabs/trait-trees/trait-trees.component.html create mode 100644 src/app/tabs/trait-trees/trait-trees.component.scss create mode 100644 src/app/tabs/trait-trees/trait-trees.component.ts create mode 100644 src/interfaces/core.ts create mode 100644 src/interfaces/itemeffect.ts create mode 100644 src/interfaces/macro.ts create mode 100644 src/interfaces/spell.ts create mode 100644 src/interfaces/stem.ts create mode 100644 src/interfaces/trait-tree.ts create mode 100644 src/interfaces/trait.ts diff --git a/src/app/helpers/core.ts b/src/app/helpers/core.ts new file mode 100644 index 0000000..2173f52 --- /dev/null +++ b/src/app/helpers/core.ts @@ -0,0 +1,8 @@ +import { ICoreContent } from '../../interfaces'; +import { id } from './id'; + +export const defaultCore: () => ICoreContent = () => ({ + _id: id(), + name: '', + yaml: '', +}); diff --git a/src/app/helpers/exporter.ts b/src/app/helpers/exporter.ts index ed496b2..7460103 100644 --- a/src/app/helpers/exporter.ts +++ b/src/app/helpers/exporter.ts @@ -18,6 +18,7 @@ export function formatMod(modData: IModKit): IModKit { quests: modData.quests, recipes: modData.recipes, spawners: formatSpawners(modData.spawners), + cores: modData.cores, }; return exported; diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index f4e51ba..8788a9d 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -61,11 +61,11 @@ } @else {
-
+
@for(tab of tabOrder; track tab.name; let i = $index) { - {{ tab.name + {{ tab.name }} ({{ tab.count() }}) } @@ -118,6 +118,10 @@ } + @case (8) { + + } + }
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 1cb8a68..b4d2640 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -52,13 +52,17 @@ export class HomeComponent { count: computed(() => this.modService.mod().spawners.length), }, { - name: 'NPC Scripts/Dialogs', + name: 'NPC Scripts', count: computed(() => this.modService.mod().dialogs.length), }, { name: 'Quests', count: computed(() => this.modService.mod().quests.length), }, + { + name: 'Cores', + count: computed(() => this.modService.mod().cores.length), + }, ]; constructor() { diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index 53c41d7..d6d6a25 100644 --- a/src/app/home/home.module.ts +++ b/src/app/home/home.module.ts @@ -9,6 +9,8 @@ import { SweetAlert2Module } from '@sweetalert2/ngx-sweetalert2'; import { AgGridModule } from 'ag-grid-angular'; import { NgxFloatUiModule } from 'ngx-float-ui'; import { SharedModule } from '../shared/shared.module'; +import { CoresEditorComponent } from '../tabs/cores/cores-editor/cores-editor.component'; +import { CoresComponent } from '../tabs/cores/cores.component'; import { DialogsEditorComponent } from '../tabs/dialogs/dialogs-editor/dialogs-editor.component'; import { DialogsComponent } from '../tabs/dialogs/dialogs.component'; import { DroptablesEditorComponent } from '../tabs/droptables/droptables-editor/droptables-editor.component'; @@ -24,8 +26,12 @@ import { RecipesEditorComponent } from '../tabs/recipes/recipes-editor/recipes-e import { RecipesComponent } from '../tabs/recipes/recipes.component'; import { SpawnersEditorComponent } from '../tabs/spawners/spawners-editor/spawners-editor.component'; import { SpawnersComponent } from '../tabs/spawners/spawners.component'; -import { HomeComponent } from './home.component'; +import { StemsEditorComponent } from '../tabs/stems/stems-editor/stems-editor.component'; +import { StemsComponent } from '../tabs/stems/stems.component'; +import { TraitTreesEditorComponent } from '../tabs/trait-trees/trait-trees-editor/trait-trees-editor.component'; +import { TraitTreesComponent } from '../tabs/trait-trees/trait-trees.component'; import { ValidationComponent } from '../validation/validation.component'; +import { HomeComponent } from './home.component'; @NgModule({ declarations: [ @@ -46,6 +52,12 @@ import { ValidationComponent } from '../validation/validation.component'; QuestsEditorComponent, DialogsEditorComponent, ValidationComponent, + CoresComponent, + CoresEditorComponent, + TraitTreesComponent, + TraitTreesEditorComponent, + StemsComponent, + StemsEditorComponent, ], imports: [ CommonModule, @@ -58,7 +70,13 @@ import { ValidationComponent } from '../validation/validation.component'; CodeEditorModule, ], exports: [ - ValidationComponent + ValidationComponent, + CoresComponent, + CoresEditorComponent, + TraitTreesComponent, + TraitTreesEditorComponent, + StemsComponent, + StemsEditorComponent, ], }) export class HomeModule {} diff --git a/src/app/services/mod.service.ts b/src/app/services/mod.service.ts index 66e177f..275ade6 100644 --- a/src/app/services/mod.service.ts +++ b/src/app/services/mod.service.ts @@ -1,4 +1,5 @@ import { computed, effect, inject, Injectable, signal } from '@angular/core'; +import { isUndefined } from 'lodash'; import { LocalStorageService } from 'ngx-webstorage'; import { HasIdentification, @@ -38,6 +39,7 @@ export function defaultModKit(): IModKit { quests: [], recipes: [], spawners: [], + cores: [], }; } @@ -63,6 +65,7 @@ export class ModService { const oldModData: IModKit = this.localStorage.retrieve('mod'); if (oldModData) { ensureIds(oldModData); + this.migrateMod(oldModData); this.updateMod(oldModData); } @@ -79,6 +82,17 @@ export class ModService { } // mod functions + private migrateMod(mod: IModKit) { + const check = defaultModKit(); + Object.keys(check).forEach((checkKeyString) => { + const checkKey = checkKeyString as keyof IModKit; + + if (!isUndefined(mod[checkKey])) return; + + mod[checkKey] = structuredClone(check[checkKey]) as unknown as any; + }); + } + public resetMod(): void { this.updateMod(defaultModKit()); } diff --git a/src/app/tabs/cores/cores-editor/cores-editor.component.html b/src/app/tabs/cores/cores-editor/cores-editor.component.html new file mode 100644 index 0000000..a0c5f05 --- /dev/null +++ b/src/app/tabs/cores/cores-editor/cores-editor.component.html @@ -0,0 +1,18 @@ +@let editingData = editing(); + +
+ +
+ + +
+ +
+ +
+
+ +
+
+
+
\ No newline at end of file diff --git a/src/app/tabs/cores/cores-editor/cores-editor.component.scss b/src/app/tabs/cores/cores-editor/cores-editor.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tabs/cores/cores-editor/cores-editor.component.ts b/src/app/tabs/cores/cores-editor/cores-editor.component.ts new file mode 100644 index 0000000..16a1d40 --- /dev/null +++ b/src/app/tabs/cores/cores-editor/cores-editor.component.ts @@ -0,0 +1,17 @@ +import { Component, computed, signal } from '@angular/core'; +import { ICoreContent } from '../../../../interfaces'; +import { EditorBaseComponent } from '../../../shared/components/editor-base/editor-base.component'; + +@Component({ + selector: 'app-cores-editor', + templateUrl: './cores-editor.component.html', + styleUrl: './cores-editor.component.scss', +}) +export class CoresEditorComponent extends EditorBaseComponent { + public currentItem = signal(undefined); + + public canSave = computed(() => { + const data = this.editing(); + return data.yaml; + }); +} diff --git a/src/app/tabs/cores/cores.component.html b/src/app/tabs/cores/cores.component.html new file mode 100644 index 0000000..704bde7 --- /dev/null +++ b/src/app/tabs/cores/cores.component.html @@ -0,0 +1,10 @@ +@let editing = isEditing(); + + + +@if(editing) { + +} \ No newline at end of file diff --git a/src/app/tabs/cores/cores.component.scss b/src/app/tabs/cores/cores.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tabs/cores/cores.component.ts b/src/app/tabs/cores/cores.component.ts new file mode 100644 index 0000000..19664f1 --- /dev/null +++ b/src/app/tabs/cores/cores.component.ts @@ -0,0 +1,65 @@ +import { Component, computed } from '@angular/core'; +import { ColDef } from 'ag-grid-community'; + +import { ICoreContent, IModKit } from '../../../interfaces'; +import { defaultCore } from '../../helpers/core'; +import { CellButtonsComponent } from '../../shared/components/cell-buttons/cell-buttons.component'; +import { EditorBaseTableComponent } from '../../shared/components/editor-base-table/editor-base-table.component'; +import { HeaderButtonsComponent } from '../../shared/components/header-buttons/header-buttons.component'; + +type EditingType = ICoreContent; + +@Component({ + selector: 'app-cores', + templateUrl: './cores.component.html', + styleUrl: './cores.component.scss', +}) +export class CoresComponent extends EditorBaseTableComponent { + protected dataKey: keyof Omit = 'drops'; + + public defaultData = defaultCore; + + public tableItems = computed(() => this.modService.mod().cores); + public tableColumns: ColDef[] = [ + { + field: 'mapName', + flex: 1, + cellDataType: 'text', + filter: 'agTextColumnFilter', + sort: 'asc', + }, + { + field: 'regionName', + flex: 1, + cellDataType: 'text', + filter: 'agTextColumnFilter', + sort: 'asc', + }, + { + field: 'isGlobal', + flex: 1, + cellDataType: 'boolean', + sort: 'asc', + }, + { + field: '', + width: 200, + sortable: false, + suppressMovable: true, + headerComponent: HeaderButtonsComponent, + headerComponentParams: { + showNewButton: true, + newCallback: () => this.createNew(), + }, + cellRenderer: CellButtonsComponent, + cellClass: 'no-adjust', + cellRendererParams: { + showCopyButton: false, + showEditButton: true, + editCallback: (item: EditingType) => this.editExisting(item), + showDeleteButton: true, + deleteCallback: (item: EditingType) => this.deleteData(item), + }, + }, + ]; +} diff --git a/src/app/tabs/stems/stems-editor/stems-editor.component.html b/src/app/tabs/stems/stems-editor/stems-editor.component.html new file mode 100644 index 0000000..8ce9cbf --- /dev/null +++ b/src/app/tabs/stems/stems-editor/stems-editor.component.html @@ -0,0 +1 @@ +

stems-editor works!

diff --git a/src/app/tabs/stems/stems-editor/stems-editor.component.scss b/src/app/tabs/stems/stems-editor/stems-editor.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tabs/stems/stems-editor/stems-editor.component.ts b/src/app/tabs/stems/stems-editor/stems-editor.component.ts new file mode 100644 index 0000000..b82d568 --- /dev/null +++ b/src/app/tabs/stems/stems-editor/stems-editor.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-stems-editor', + templateUrl: './stems-editor.component.html', + styleUrl: './stems-editor.component.scss' +}) +export class StemsEditorComponent { + +} diff --git a/src/app/tabs/stems/stems.component.html b/src/app/tabs/stems/stems.component.html new file mode 100644 index 0000000..959b8cc --- /dev/null +++ b/src/app/tabs/stems/stems.component.html @@ -0,0 +1 @@ +

stems works!

diff --git a/src/app/tabs/stems/stems.component.scss b/src/app/tabs/stems/stems.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tabs/stems/stems.component.ts b/src/app/tabs/stems/stems.component.ts new file mode 100644 index 0000000..b67fd5a --- /dev/null +++ b/src/app/tabs/stems/stems.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-stems', + templateUrl: './stems.component.html', + styleUrl: './stems.component.scss' +}) +export class StemsComponent { + +} diff --git a/src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.html b/src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.html new file mode 100644 index 0000000..a3e0bb9 --- /dev/null +++ b/src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.html @@ -0,0 +1 @@ +

trait-trees-editor works!

diff --git a/src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.scss b/src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.ts b/src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.ts new file mode 100644 index 0000000..5bade1f --- /dev/null +++ b/src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-trait-trees-editor', + templateUrl: './trait-trees-editor.component.html', + styleUrl: './trait-trees-editor.component.scss' +}) +export class TraitTreesEditorComponent { + +} diff --git a/src/app/tabs/trait-trees/trait-trees.component.html b/src/app/tabs/trait-trees/trait-trees.component.html new file mode 100644 index 0000000..18bf172 --- /dev/null +++ b/src/app/tabs/trait-trees/trait-trees.component.html @@ -0,0 +1 @@ +

trait-trees works!

diff --git a/src/app/tabs/trait-trees/trait-trees.component.scss b/src/app/tabs/trait-trees/trait-trees.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tabs/trait-trees/trait-trees.component.ts b/src/app/tabs/trait-trees/trait-trees.component.ts new file mode 100644 index 0000000..f83aba2 --- /dev/null +++ b/src/app/tabs/trait-trees/trait-trees.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-trait-trees', + templateUrl: './trait-trees.component.html', + styleUrl: './trait-trees.component.scss' +}) +export class TraitTreesComponent { + +} diff --git a/src/interfaces/core.ts b/src/interfaces/core.ts new file mode 100644 index 0000000..a4a8e30 --- /dev/null +++ b/src/interfaces/core.ts @@ -0,0 +1,6 @@ +import { HasIdentification } from './identified'; + +export interface ICoreContent extends HasIdentification { + name: string; + yaml: string; +} diff --git a/src/interfaces/effect.ts b/src/interfaces/effect.ts index 2377c21..69db822 100644 --- a/src/interfaces/effect.ts +++ b/src/interfaces/effect.ts @@ -1,41 +1,45 @@ -import { StatBlock } from './building-blocks'; - -export interface IItemEffectExtra { - // the tooltip to be displayed (food) - tooltip?: string; - - // the message to be sent (food) - message?: string; - - // the stats given (food) - statChanges?: StatBlock; - - // if the effect is positive - isPositive?: boolean; +import { IStatusEffectInfo } from './mod-stripped'; + +export enum BuffType { + Buff = 'buff', + Debuff = 'debuff', + Incoming = 'incoming', + Outgoing = 'outgoing', + UseOnly = 'useonly', } -export interface IItemEffect { - name: string; - potency: number; +export type BuffTypeType = `${BuffType}`; - // if true, effect can be applied to a weapon via Apply - canApply?: boolean; +export interface IEffectTooltip { + name?: string; + color?: string; + bgColor?: string; + desc?: string; + icon?: string; +} - // if exists, the % chance the effect will be applied - chance?: number; +export interface IEffectEffect { + type: BuffType; + duration: number; + extra: IStatusEffectInfo; +} - // if exists, the number of charges the spell will have - charges?: number; +export interface IEffectMeta { + effectRef?: string; + recentlyRef?: string; - // the number of seconds the ability lasts - duration?: number; + castMessage?: string; + applyMessage?: string; + unapplyMesage?: string; - // the number of uses the ability has left before the item breaks (-1 = infinite) - uses?: number; + castSfx?: string; + applySfx?: string; - // the number of tiles for the AoE effect to go (0 = current tile only) - range?: number; + noStack?: boolean; +} - // extra data that is used by different items - extra?: IItemEffectExtra; +export interface IEffect { + tooltip: IEffectTooltip; + effect: IEffectEffect; + effectMeta: IEffectMeta; } diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts index daf5236..e05a18f 100644 --- a/src/interfaces/index.ts +++ b/src/interfaces/index.ts @@ -1,10 +1,12 @@ export * from './behavior'; export * from './building-blocks'; +export * from './core'; export * from './droptable'; export * from './effect'; export * from './identified'; export * from './item'; export * from './itemtypes'; +export * from './macro'; export * from './map'; export * from './mod-stripped'; export * from './modkit'; @@ -14,4 +16,6 @@ export * from './quest'; export * from './recipe'; export * from './schema'; export * from './spawner'; +export * from './trait'; +export * from './trait-tree'; export * from './validation'; diff --git a/src/interfaces/item.ts b/src/interfaces/item.ts index 2a6e5f4..bb4b713 100644 --- a/src/interfaces/item.ts +++ b/src/interfaces/item.ts @@ -12,8 +12,8 @@ import { Stat, StatBlock, } from './building-blocks'; -import { IItemEffect } from './effect'; import { HasIdentification } from './identified'; +import { IItemEffect } from './itemeffect'; import { ItemClassType } from './itemtypes'; export enum ItemQuality { diff --git a/src/interfaces/itemeffect.ts b/src/interfaces/itemeffect.ts new file mode 100644 index 0000000..2377c21 --- /dev/null +++ b/src/interfaces/itemeffect.ts @@ -0,0 +1,41 @@ +import { StatBlock } from './building-blocks'; + +export interface IItemEffectExtra { + // the tooltip to be displayed (food) + tooltip?: string; + + // the message to be sent (food) + message?: string; + + // the stats given (food) + statChanges?: StatBlock; + + // if the effect is positive + isPositive?: boolean; +} + +export interface IItemEffect { + name: string; + potency: number; + + // if true, effect can be applied to a weapon via Apply + canApply?: boolean; + + // if exists, the % chance the effect will be applied + chance?: number; + + // if exists, the number of charges the spell will have + charges?: number; + + // the number of seconds the ability lasts + duration?: number; + + // the number of uses the ability has left before the item breaks (-1 = infinite) + uses?: number; + + // the number of tiles for the AoE effect to go (0 = current tile only) + range?: number; + + // extra data that is used by different items + extra?: IItemEffectExtra; +} diff --git a/src/interfaces/macro.ts b/src/interfaces/macro.ts new file mode 100644 index 0000000..79d2333 --- /dev/null +++ b/src/interfaces/macro.ts @@ -0,0 +1,20 @@ +export enum IMacroActivation { + AutoActivate = 'autoActivate', + LockActivation = 'lockActivation', + ClickToTarget = 'clickToTarget', + AutoTarget = 'autoTarget', +} + +export type IMacroActivationType = `${IMacroActivation}`; + +export interface IMacro { + name: string; + macro: string; + icon: string; + color: string; + bgColor?: string; + mode: IMacroActivationType; + key: string; + tooltipDesc: string; + isDefault?: boolean; +} diff --git a/src/interfaces/modkit.ts b/src/interfaces/modkit.ts index 5046ec9..bdec6c6 100644 --- a/src/interfaces/modkit.ts +++ b/src/interfaces/modkit.ts @@ -1,3 +1,4 @@ +import { ICoreContent } from './core'; import { IDroptable } from './droptable'; import { IItemDefinition } from './item'; import { IEditorMap } from './map'; @@ -25,4 +26,5 @@ export interface IModKit { maps: IEditorMap[]; quests: IQuest[]; dialogs: INPCScript[]; + cores: ICoreContent[]; } diff --git a/src/interfaces/spell.ts b/src/interfaces/spell.ts new file mode 100644 index 0000000..491c1fd --- /dev/null +++ b/src/interfaces/spell.ts @@ -0,0 +1,45 @@ +import { DamageClassType } from './building-blocks'; + +export interface ISpell { + spellName: string; // the name of the spell + maxSkillForGain: number; // the max skill we can gain skill points from this spell for + mpCost: number; // the mp cost of the skill + + castTime?: number; // the time (in seconds) it takes to channel this spell + cooldown?: number; // the cooldown (in seconds) for recasting this spell + damageClass?: DamageClassType; // the damage class of the spell + willSaveThreshold?: number; // the will save threshold. will roll (1, defWIL) and if it's >= willSaveThreshold, it saves + willSavePercent?: number; // the % damage reduced when will save is met + potencyMultiplier?: number; // the overall multiplier to the potency of the skill + bonusRollsMin?: number; // the number of bonus rolls this spell will roll at minimum (default 0) + bonusRollsMax?: number; // the number of bonus rolls this spell will roll at maximum (default 0) + skillMultiplierChanges?: number[][]; // the skill multiplier buffs when you reach a certain skill threshold + + spellMeta: { + aoe?: boolean; // whether or not this spell is an aoe + aoeRangeTrait?: string; // the trait that boosts the aoe of this spell + allowDirectional?: boolean; // whether or not the spell can be directionally targetted + bonusAgro?: number; // bonus agro given from the caster to the target - primarily used for debuffs + canBeResisted?: boolean; // whether or not the spell can be resisted outright + noReflect?: boolean; // whether or not the spell can NOT be reflected (useful for cures, etc) + staticPotency?: boolean; // whether or not the potency for this spell should be static (buffs should be consistent) + creatureSummoned?: string[]; // if this spell summons a creature, this is the npc id + doesHeal?: boolean; // if the spell does a heal (inverse attack), it calls this first + doesAttack?: boolean; // if the spell does an attack, it calls this first + doesOvertime?: boolean; // if the spell has an over-time component, it is applied automatically + extraAttackTrait?: string; // if the spell doesAttack and can get bonus attack procs, this trait is what specifies how many + noHostileTarget?: boolean; // if the spell heals or buffs, this is set to true so it can't hit enemies + casterMessage?: string; // if the spell sends a message to the caster, it sends this if the caster is NOT the target + casterAttackMessage?: string; // if the spell does an attack, this is the unformatted message to send to the caster + casterSfx?: string; // if the spell attacks or sends the caster a message, it uses this SFX + targetMessage?: string; // if the spell sends a message to the target, it sends this + targetAttackMessage?: string; // if the spell does an attack, this is the unformatted message to send to the caster + targetSfx?: string; // if the spell does NOT attack, this is the SFX it sends along with targetMessage + targetsParty?: boolean; // if the spell targets the entire casters party (aka, powerwords) + range?: number; // if the spell is an aoe, this is the default range from the center it targets (default 0) + resistLowerTrait?: string; // if the spell canBeResisted, this trait will improve the chance of the spell cast going through + spellRef: string; // the reference to the spell for casting purposes + useSkillAsPotency?: boolean; // if true, the spell will use only the casters skill as the potency (unless there is already a potency set) + fizzledBy?: string[]; // if set, the spell will not take hold on any target if they contain an effect listed in this array + }; +} diff --git a/src/interfaces/stem.ts b/src/interfaces/stem.ts new file mode 100644 index 0000000..e38a7a5 --- /dev/null +++ b/src/interfaces/stem.ts @@ -0,0 +1,19 @@ +import { IEffect } from './effect'; +import { IMacro } from './macro'; +import { ISpell } from './spell'; +import { ITrait } from './trait'; + +export interface ISTEM { + name: string; + + all: { + desc: string; + icon: string; + color: string; + }; + + spell: ISpell; + trait: ITrait; + effect: IEffect; + macro: IMacro; +} diff --git a/src/interfaces/trait-tree.ts b/src/interfaces/trait-tree.ts new file mode 100644 index 0000000..a65c3b8 --- /dev/null +++ b/src/interfaces/trait-tree.ts @@ -0,0 +1,22 @@ +export type ITraitTree = Record; + +export interface ITraitTreeData { + treeOrder: string[]; + + trees: Record; +} + +export interface ITraitTreeTab { + desc: string; + tree: ITraitTreeRow[]; +} + +export interface ITraitTreeRow { + traits: ITraitTreeRowTrait[]; +} + +export interface ITraitTreeRowTrait { + name: string; + maxLevel: number; + requires?: string; +} diff --git a/src/interfaces/trait.ts b/src/interfaces/trait.ts new file mode 100644 index 0000000..eb32087 --- /dev/null +++ b/src/interfaces/trait.ts @@ -0,0 +1,10 @@ +import { StatType } from './building-blocks'; + +export interface ITrait { + name: string; + desc: string; + icon: string; + isAncient?: boolean; + valuePerTier?: number; + statsGiven?: Partial>; +}