Charakterverwalter: Fertigkeiten-Attribut für eigene Einträge, Stufe ohne Vorzeichen
- eigenedefinierte Fertigkeiten bekommen ein Bezugsattribut (STR…CHA) im Selektor und lassen es im Bearbeiten-Abschnitt korrigieren - neue Spalte character_skills.attribute (Migration 2, schema.sql angepasst); character_skills() nutzt COALESCE aus Zeilen- und Katalogattribut - Fertigkeitsstufe startet bei max(0, Attributsbonus) und wird in Formular, Update und Anzeige (Web-Bogen, PDF) nie negativ bzw. nie mit Vorzeichen gezeigt - MOD- und Stufe-Spalte im Bogen auf gemeinsame Grundlinie gezogen
This commit is contained in:
parent
b4d4c53dd4
commit
929aa52c73
10 changed files with 86 additions and 30 deletions
|
|
@ -117,7 +117,21 @@ function bonus_class(int $value): string
|
|||
return $value > 0 ? 'bonus-pos' : ($value < 0 ? 'bonus-neg' : 'bonus-zero');
|
||||
}
|
||||
|
||||
/** Rettungswurf-Feld formatieren; leere Werte bleiben ein Gedankenstrich. */
|
||||
/** Attributkürzel (STR, DEX, …) prüfen; unbekannte Werte werden zu ''. */
|
||||
function skill_attribute_code(string $value): string
|
||||
{
|
||||
$code = strtoupper(trim($value));
|
||||
foreach (WS_ATTRIBUTES as $attribute) {
|
||||
if ($attribute[0] === $code) {
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Rettungswurf-Feld formatieren; leere Werte bleiben ein Gedankenstrich.
|
||||
*/
|
||||
function save_display(mixed $value): string
|
||||
{
|
||||
if ($value === null || $value === '') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue