Skip to content

Commit

Permalink
feat(profile): separate weapon/basic abilities, add move/flee to basic
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 18, 2023
1 parent cf3cc18 commit d2734b8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
22 changes: 19 additions & 3 deletions client/src/app/pages/me/me.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
</ion-row>

<ion-row *ngIf="view === 'abilities'">
<ion-col>
<ion-col *ngIf="data.player && data.equipment">
<ion-card>
<ion-card-header>
<ion-card-title>Basic Abilities</ion-card-title>
</ion-card-header>

<ion-card-content>
<ion-list *ngIf="data.player && data.equipment">
<ion-list>
<ion-item
*ngFor="let ability of getBasicAbilities(data.player, data.equipment)"
>
Expand All @@ -82,13 +82,29 @@
</ion-card-content>
</ion-card>

<ion-card>
<ion-card-header>
<ion-card-title>Weapon Abilities</ion-card-title>
</ion-card-header>

<ion-card-content>
<ion-list>
<ion-item
*ngFor="let ability of getWeaponAbilities(data.player, data.equipment)"
>
<app-combat-ability [ability]="ability"></app-combat-ability>
</ion-item>
</ion-list>
</ion-card-content>
</ion-card>

<ion-card>
<ion-card-header>
<ion-card-title>Job Abilities</ion-card-title>
</ion-card-header>

<ion-card-content>
<ion-list *ngIf="data.player && data.equipment">
<ion-list>
<ion-item
*ngFor="let ability of getJobAbilities(data.player, data.equipment)"
>
Expand Down
12 changes: 12 additions & 0 deletions client/src/app/pages/me/me.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,18 @@ export class MePage implements OnInit {
): ICombatAbility[] {
const itemAbilities = [
this.contentService.getAbilityByName('Unarmed Attack'),
this.contentService.getAbilityByName('Move'),
this.contentService.getAbilityByName('Flee'),
];

return [...itemAbilities].filter(Boolean) as ICombatAbility[];
}

getWeaponAbilities(
player: IPlayer,
equipment: Record<ItemSlot, IEquipment>,
): ICombatAbility[] {
const itemAbilities = [
...Object.values(equipment)
.filter(Boolean)
.map((item) => {
Expand Down

0 comments on commit d2734b8

Please sign in to comment.