feat(api): expose effective HP and regen anchor from GET /characters/me

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Bastian Wagner
2026-08-21 14:45:31 +02:00
parent 02037b2917
commit 909f793eb6
2 changed files with 7 additions and 1 deletions

View File

@@ -17,6 +17,8 @@ function fakeCharacterStats(
weaponDamage: 8,
armor: 0,
combatPower: 0,
hpRegenPerSecond: 1,
hpRegenSince: new Date('2026-08-18T09:00:00.000Z'),
}),
} as unknown as CharacterStatsService;
}
@@ -52,6 +54,8 @@ describe('CharactersService', () => {
currentHp: 100,
maxHp: 115,
attack: 7,
hpRegenPerSecond: 1,
hpRegenSince: '2026-08-18T09:00:00.000Z',
currentLocation: {
id: SOUTH_GATE_ID,
key: 'south-gate',

View File

@@ -31,9 +31,11 @@ export class CharactersService {
level: character.level,
experience: character.experience,
silver: character.silver,
currentHp: character.currentHp,
currentHp: stats.currentHp,
maxHp: stats.maxHp,
attack: stats.attack,
hpRegenPerSecond: stats.hpRegenPerSecond,
hpRegenSince: stats.hpRegenSince ? stats.hpRegenSince.toISOString() : null,
currentLocation: {
id: character.currentLocation.id,
key: character.currentLocation.key,