docs
This commit is contained in:
@@ -159,7 +159,10 @@ describe('CharacterStatsService', () => {
|
||||
const scope = fakeScope([]);
|
||||
const anchor = new Date('2026-08-21T11:59:30.000Z');
|
||||
|
||||
const stats = await service.calculate(character({ hpRegenSince: anchor }), scope);
|
||||
const stats = await service.calculate(
|
||||
character({ hpRegenSince: anchor }),
|
||||
scope,
|
||||
);
|
||||
|
||||
expect(stats.hpRegenPerSecond).toBe(1);
|
||||
expect(stats.hpRegenSince).toEqual(anchor);
|
||||
|
||||
@@ -30,7 +30,10 @@ describe('CharacterVitalsService', () => {
|
||||
const { clock } = fakeClock('2026-08-21T12:00:00.000Z');
|
||||
const service = new CharacterVitalsService(clock);
|
||||
|
||||
const hp = service.effectiveHp(character({ currentHp: 37, hpRegenSince: null }), 100);
|
||||
const hp = service.effectiveHp(
|
||||
character({ currentHp: 37, hpRegenSince: null }),
|
||||
100,
|
||||
);
|
||||
|
||||
expect(hp).toBe(37);
|
||||
});
|
||||
|
||||
@@ -34,7 +34,9 @@ export class CharactersService {
|
||||
maxHp: stats.maxHp,
|
||||
attack: stats.attack,
|
||||
hpRegenPerSecond: stats.hpRegenPerSecond,
|
||||
hpRegenSince: stats.hpRegenSince ? stats.hpRegenSince.toISOString() : null,
|
||||
hpRegenSince: stats.hpRegenSince
|
||||
? stats.hpRegenSince.toISOString()
|
||||
: null,
|
||||
currentLocation: {
|
||||
id: character.currentLocation.id,
|
||||
key: character.currentLocation.key,
|
||||
|
||||
Reference in New Issue
Block a user