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:
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user