Charakterverwalter: Stufe aus Erfahrungspunkten und Klasse ableiten (WS_XP_TABLES)

This commit is contained in:
torsten 2026-11-21 10:15:56 +01:00
parent f21b714d82
commit b4d4c53dd4
8 changed files with 138 additions and 11 deletions

View file

@ -23,7 +23,7 @@ $equipped = array_values(array_filter($items, static fn ($item) => (int) $item['
<?php endif; ?></h1>
<p class="lede">
<?= e((string) $character['class_name']) ?> · Stufe <?= (int) $character['level'] ?>
· <?= (int) $character['xp'] ?> EP
· <?= number_format((int) $character['xp'], 0, ',', '.') ?> EP<?php $xpProgress = xp_progress((string) $character['class_name'], (int) $character['xp']); ?><?php if ($xpProgress['next'] !== null): ?> (noch <?= number_format((int) $xpProgress['missing'], 0, ',', '.') ?> EP bis Stufe <?= (int) $xpProgress['level'] + 1 ?>)<?php endif; ?>
<?php if ((string) $character['alignment'] !== '' && (string) $character['alignment'] !== '–'): ?>
· <?= e((string) $character['alignment']) ?>
<?php endif; ?>
@ -84,6 +84,9 @@ $equipped = array_values(array_filter($items, static fn ($item) => (int) $item['
<span style="display:block;height:100%;width:<?= (int) round($derived['hp_ratio'] * 100) ?>%;
background: linear-gradient(90deg, <?= $derived['hp_state'] === 'healthy' ? 'var(--moss), var(--gold-bright)' : 'var(--blood), var(--ember)' ?>);"></span>
</div>
<div class="xp-bar" title="Erfahrung bis zur nächsten Stufe">
<span style="width:<?= (int) round($xpProgress['ratio'] * 100) ?>%"></span>
</div>
<?php
$saves = [];