Skip to content

Commit

Permalink
closes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Aug 12, 2024
1 parent 439535c commit 7035ca4
Show file tree
Hide file tree
Showing 19 changed files with 858 additions and 75 deletions.
6 changes: 6 additions & 0 deletions src/app/app.icons.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import {
heroArrowDownOnSquare,
heroArrowPathRoundedSquare,
heroArrowsRightLeft,
heroDocumentDuplicate,
heroDocumentText,
heroFaceFrown,
heroFaceSmile,
heroMinus,
heroPencil,
heroPlus,
Expand All @@ -18,4 +21,7 @@ export const appIcons = {
heroMinus,
heroTrash,
heroArrowsRightLeft,
heroFaceFrown,
heroFaceSmile,
heroArrowPathRoundedSquare,
};
20 changes: 19 additions & 1 deletion src/app/helpers/npc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ export const defaultNPC: () => INPCDefinition = () => ({
spawn: {
messages: [''],
sfx: {
name: '',
name: undefined as unknown as string,
maxChance: 0,
},
},
combat: {
messages: [],
sfx: {
name: undefined as unknown as string,
maxChance: 0,
},
},
},
items: {
Expand All @@ -100,6 +104,20 @@ export const defaultNPC: () => INPCDefinition = () => ({
ammo: [],
},
},
allegianceReputation: {
Adventurers: 0,
Enemy: 0,
GM: 0,
NaturalResource: 0,
None: 0,
Pirates: 0,
Royalty: 0,
Townsfolk: 0,
Underground: 0,
Wilderness: 0,
},
repMod: [],
skills: {},
summonSkillModifiers: {},
summonStatModifiers: {},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="relative">
<ng-select class="form-control" [items]="values" [(ngModel)]="itemSlot" placeholder="Select item slot..."
(change)="change.emit($event)"></ng-select>

<app-input-floating-label>Item Slot</app-input-floating-label>
</div>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component, model, output } from '@angular/core';
import { ItemSlot, ItemSlotType } from '../../../../interfaces';

@Component({
selector: 'app-input-itemslot',
templateUrl: './input-itemslot.component.html',
styleUrl: './input-itemslot.component.scss',
})
export class InputItemslotComponent {
public itemSlot = model.required<string | undefined>();
public change = output<ItemSlotType>();

public values = [...Object.values(ItemSlot).sort()];
}
6 changes: 6 additions & 0 deletions src/app/shared/components/input-sfx/input-sfx.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="relative">
<ng-select class="form-control" [items]="values" [(ngModel)]="sfx" placeholder="Select SFX..."
(change)="change.emit($event)"></ng-select>

<app-input-floating-label>{{ label() }}</app-input-floating-label>
</div>
Empty file.
52 changes: 52 additions & 0 deletions src/app/shared/components/input-sfx/input-sfx.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Component, input, model, output } from '@angular/core';

@Component({
selector: 'app-input-sfx',
templateUrl: './input-sfx.component.html',
styleUrl: './input-sfx.component.scss',
})
export class InputSfxComponent {
public sfx = model.required<string | undefined>();
public change = output<string>();

public label = input<string>('SFX');

public values = [
'combat-block-armor',
'combat-block-weapon',
'combat-die',
'combat-hit-melee',
'combat-hit-spell',
'combat-kill',
'combat-miss',
'combat-special-blunderbuss',

'env-door-close',
'env-door-open',
'env-stairs',

'monster-bear',
'monster-bird',
'monster-dragon',
'monster-ghost',
'monster-goblin',
'monster-rocks',
'monster-skeleton',
'monster-turkey',
'monster-wolf',

'spell-aoe-fire',
'spell-aoe-frost',
'spell-buff-magical',
'spell-buff',
'spell-buff-physical',
'spell-buff-protection',
'spell-conjure',
'spell-debuff-give',
'spell-debuff-receive',
'spell-heal',
'spell-sight-effect',
'spell-special-revive',
'spell-special-teleport',
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Skill } from '../../../../interfaces';
styleUrl: './input-skill.component.scss',
})
export class InputSkillComponent {
public skill = model.required<string>();
public skill = model.required<string | undefined>();
public label = input<string>('Skill');
public change = output<string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<ng-select class="form-control" [items]="values()" [(ngModel)]="stat" placeholder="Select stat..."
(change)="change.emit($event)"></ng-select>

<app-input-floating-label>Stat</app-input-floating-label>
<app-input-floating-label>{{ label() }}</app-input-floating-label>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { coreStats, extraStats } from '../../../helpers';
})
export class InputStatComponent {
public stat = model.required<StatType | undefined>();
public label = input<string>('Stat');
public change = output<ItemClassType>();
public allowCore = input<boolean>(true);
public allowExtra = input<boolean>(true);
Expand Down
6 changes: 6 additions & 0 deletions src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import { InputHostilityComponent } from './components/input-hostility/input-host
import { InputAllegianceComponent } from './components/input-allegiance/input-allegiance.component';
import { InputCategoryComponent } from './components/input-category/input-category.component';
import { InputChallengeratingComponent } from './components/input-challengerating/input-challengerating.component';
import { InputItemslotComponent } from './components/input-itemslot/input-itemslot.component';
import { InputSfxComponent } from './components/input-sfx/input-sfx.component';

@NgModule({
declarations: [
Expand Down Expand Up @@ -70,6 +72,8 @@ import { InputChallengeratingComponent } from './components/input-challengeratin
InputAllegianceComponent,
InputCategoryComponent,
InputChallengeratingComponent,
InputItemslotComponent,
InputSfxComponent,
],
imports: [
CommonModule,
Expand Down Expand Up @@ -111,6 +115,8 @@ import { InputChallengeratingComponent } from './components/input-challengeratin
InputAllegianceComponent,
InputCategoryComponent,
InputChallengeratingComponent,
InputItemslotComponent,
InputSfxComponent,
],
})
export class SharedModule {}
6 changes: 3 additions & 3 deletions src/app/tabs/items/items-editor/items-editor.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
</div>
</div>

<div class="form-column">
<div class="form-column button-column">
<div class="form-row w-full flex justify-end">
<button class="btn btn-accent btn-sm" [disabled]="!currentStat() || doesItemHaveCurrentStat()"
(click)="addStat(currentStat())">
Expand Down Expand Up @@ -277,7 +277,7 @@
</div>
</div>

<div class="form-column">
<div class="form-column button-column">
<div class="form-row w-full flex justify-end">
<button class="btn btn-accent btn-sm" (click)="addContainedItem()" [disabled]="!currentItem()">
<ng-icon name="heroPlus"></ng-icon>
Expand All @@ -301,7 +301,7 @@
</div>
</div>

<div class="form-column">
<div class="form-column button-column">
<div class="form-row w-full flex justify-end">
<button class="ml-1 btn btn-error btn-sm" (click)="removeContainedItem($index)">
<ng-icon name="heroMinus"></ng-icon>
Expand Down
Loading

0 comments on commit 7035ca4

Please sign in to comment.