This commit is contained in:
Bastian Wagner
2026-08-22 16:41:47 +02:00
parent dfa62fd152
commit 081c9f83f9
137 changed files with 11594 additions and 1302 deletions

View File

@@ -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);

View File

@@ -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);
});

View File

@@ -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,