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,
|
weaponDamage: 8,
|
||||||
armor: 0,
|
armor: 0,
|
||||||
combatPower: 0,
|
combatPower: 0,
|
||||||
|
hpRegenPerSecond: 1,
|
||||||
|
hpRegenSince: new Date('2026-08-18T09:00:00.000Z'),
|
||||||
}),
|
}),
|
||||||
} as unknown as CharacterStatsService;
|
} as unknown as CharacterStatsService;
|
||||||
}
|
}
|
||||||
@@ -52,6 +54,8 @@ describe('CharactersService', () => {
|
|||||||
currentHp: 100,
|
currentHp: 100,
|
||||||
maxHp: 115,
|
maxHp: 115,
|
||||||
attack: 7,
|
attack: 7,
|
||||||
|
hpRegenPerSecond: 1,
|
||||||
|
hpRegenSince: '2026-08-18T09:00:00.000Z',
|
||||||
currentLocation: {
|
currentLocation: {
|
||||||
id: SOUTH_GATE_ID,
|
id: SOUTH_GATE_ID,
|
||||||
key: 'south-gate',
|
key: 'south-gate',
|
||||||
|
|||||||
@@ -31,9 +31,11 @@ export class CharactersService {
|
|||||||
level: character.level,
|
level: character.level,
|
||||||
experience: character.experience,
|
experience: character.experience,
|
||||||
silver: character.silver,
|
silver: character.silver,
|
||||||
currentHp: character.currentHp,
|
currentHp: stats.currentHp,
|
||||||
maxHp: stats.maxHp,
|
maxHp: stats.maxHp,
|
||||||
attack: stats.attack,
|
attack: stats.attack,
|
||||||
|
hpRegenPerSecond: stats.hpRegenPerSecond,
|
||||||
|
hpRegenSince: stats.hpRegenSince ? stats.hpRegenSince.toISOString() : null,
|
||||||
currentLocation: {
|
currentLocation: {
|
||||||
id: character.currentLocation.id,
|
id: character.currentLocation.id,
|
||||||
key: character.currentLocation.key,
|
key: character.currentLocation.key,
|
||||||
|
|||||||
Reference in New Issue
Block a user