feat(web): show authoritative silver and XP in the top bar after victory
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
runtimeMonsterArtworkPath,
|
||||
} from '../../../shared/monster-artwork';
|
||||
import { ItemCardComponent } from '../../../shared/item-card/item-card.component';
|
||||
import { WorldStore } from '../../world/world.store';
|
||||
import { CombatStore } from '../combat.store';
|
||||
|
||||
interface CombatLogRound {
|
||||
@@ -34,6 +35,7 @@ const RIPOSTE_DELAY_MS = 260;
|
||||
})
|
||||
export class CombatPageComponent implements OnInit {
|
||||
protected readonly combatStore = inject(CombatStore);
|
||||
private readonly worldStore = inject(WorldStore);
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly router = inject(Router);
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
@@ -82,6 +84,12 @@ export class CombatPageComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
if (after.status === 'WON') {
|
||||
// The server already granted XP and silver; pull the authoritative
|
||||
// character so the HUD matches (spec §35).
|
||||
void this.worldStore.refreshCharacter();
|
||||
}
|
||||
|
||||
const riposte = after.events.find(
|
||||
(event) =>
|
||||
event.round === before.round && event.type === 'DAMAGE' && event.source === 'MONSTER',
|
||||
|
||||
Reference in New Issue
Block a user