diff --git a/apps/web/src/app/core/api/game-api.models.ts b/apps/web/src/app/core/api/game-api.models.ts index f4ad3e7..a0b1387 100644 --- a/apps/web/src/app/core/api/game-api.models.ts +++ b/apps/web/src/app/core/api/game-api.models.ts @@ -132,3 +132,58 @@ export interface CombatReward { silver: number; items: CombatRewardItem[]; } + +export type EquipmentSlot = + | 'WEAPON' + | 'HEAD' + | 'CHEST' + | 'HANDS' + | 'LEGS' + | 'FEET' + | 'AMULET'; + +export interface InventoryItem { + id: string; + quantity: number; + equipped: boolean; + item: { + key: string; + name: string; + rarity: ItemRarity; + equipmentSlot: EquipmentSlot | null; + requiredLevel: number; + weaponDamage: number; + bonusAttack: number; + bonusHp: number; + bonusArmor: number; + iconPath: string; + }; +} + +export interface InventoryResponse { + items: InventoryItem[]; +} + +export interface EquipmentSlotItem { + characterItemId: string; + item: { + key: string; + name: string; + rarity: ItemRarity; + iconPath: string; + }; +} + +export type EquipmentSlots = Record; + +export interface EquipmentStats { + maxHp: number; + attack: number; + weaponDamage: number; + armor: number; +} + +export interface EquipmentResponse { + slots: EquipmentSlots; + stats: EquipmentStats; +} diff --git a/apps/web/src/app/core/api/game-api.service.ts b/apps/web/src/app/core/api/game-api.service.ts index 66c8b56..cf8af06 100644 --- a/apps/web/src/app/core/api/game-api.service.ts +++ b/apps/web/src/app/core/api/game-api.service.ts @@ -7,7 +7,9 @@ import { CombatAction, CurrentLocationResponse, CurrentTravel, + EquipmentResponse, HuntResult, + InventoryResponse, } from './game-api.models'; @Injectable({ providedIn: 'root' }) @@ -53,4 +55,16 @@ export class GameApiService { performCombatAction(combatId: string, action: CombatAction): Observable { return this.http.post(`/api/combats/${combatId}/actions`, { action }); } + + getInventory(): Observable { + return this.http.get('/api/inventory'); + } + + getEquipment(): Observable { + return this.http.get('/api/equipment'); + } + + equipItem(characterItemId: string): Observable { + return this.http.post('/api/equipment', { characterItemId }); + } }