From 39edd237ad470e722be1efa20d9e58308c2880cb Mon Sep 17 00:00:00 2001 From: Kyle Kemp Date: Thu, 15 Aug 2024 19:02:14 -0500 Subject: [PATCH] closes #28 --- .../items-editor/items-editor.component.html | 30 +++++++++++++++++++ .../items-editor/items-editor.component.ts | 12 ++++++++ src/interfaces/effect.ts | 3 ++ 3 files changed, 45 insertions(+) diff --git a/src/app/tabs/items/items-editor/items-editor.component.html b/src/app/tabs/items/items-editor/items-editor.component.html index 520d235..72eba50 100644 --- a/src/app/tabs/items/items-editor/items-editor.component.html +++ b/src/app/tabs/items/items-editor/items-editor.component.html @@ -496,6 +496,36 @@ class="form-input" /> } + + @if(editingData.itemClass === 'Trap') { +
+ +
+ +
+ } + + @if(editingData.trapEffect!.name) { +
+ Trap Potency + +
+ +
+ Trap Range + +
+ +
+ +
+ }
diff --git a/src/app/tabs/items/items-editor/items-editor.component.ts b/src/app/tabs/items/items-editor/items-editor.component.ts index 9307453..6f3fbd1 100644 --- a/src/app/tabs/items/items-editor/items-editor.component.ts +++ b/src/app/tabs/items/items-editor/items-editor.component.ts @@ -128,6 +128,14 @@ export class ItemsEditorComponent item.useEffect ??= { name: '', potency: 0, duration: 0 }; item.equipEffect ??= { name: '', potency: 0 }; item.breakEffect ??= { name: '', potency: 0 }; + item.trapEffect ??= { + name: '', + potency: 0, + uses: 1, + range: 0, + extra: { isPositive: false }, + }; + item.requirements ??= { baseClass: undefined, level: 0, quest: undefined }; item.cosmetic ??= { name: '', isPermanent: false }; item.trait ??= { name: '', level: 0 }; @@ -345,6 +353,10 @@ export class ItemsEditorComponent delete item.breakEffect; } + if (item.trapEffect && !item.trapEffect.name) { + delete item.trapEffect; + } + if ( item.requirements && !item.requirements.baseClass && diff --git a/src/interfaces/effect.ts b/src/interfaces/effect.ts index c52b5f9..2377c21 100644 --- a/src/interfaces/effect.ts +++ b/src/interfaces/effect.ts @@ -9,6 +9,9 @@ export interface IItemEffectExtra { // the stats given (food) statChanges?: StatBlock; + + // if the effect is positive + isPositive?: boolean; } export interface IItemEffect {