Fertigkeiten: Praxispunkte (10 Kaestchen) und Wuergel je Fertigkeitsstufe in Bogen und PDF

This commit is contained in:
torsten 2026-11-22 19:31:30 +01:00
parent 3a5d366aba
commit 85fd24a0f0
10 changed files with 185 additions and 7 deletions

View file

@ -111,6 +111,16 @@ const WS_SKILL_CATALOG = [
'Zauberkunde' => ['INT', 'Wissen'],
];
/**
* Fertigkeitsstufen des Charakterbogens (RPG/6-Dokumente/Charakterbogen.pdf):
* Index = Stufe. Stufe 0 = ungelernt, ab Stufe 6 immer 3W6.
*/
const WS_SKILL_DICE = ['W4', 'W6', 'W8', 'W10', 'W12', '2W6', '3W6'];
const WS_SKILL_TIERS = ['ungelernt', 'Anfänger', 'Geselle', 'Könner', 'Profi', 'Meister', 'Großmeister'];
/** Ankreuzbare Praxispunkte je Fertigkeit (Bogen-Spalte „PP"). */
const WS_SKILL_PRACTICE_SLOTS = 10;
const WS_CHARACTER_STATUS = [
'active' => 'im Spiel',
'dead' => 'gefallen',
@ -148,6 +158,26 @@ function bonus_class(int $value): string
return $value > 0 ? 'bonus-pos' : ($value < 0 ? 'bonus-neg' : 'bonus-zero');
}
/**
* Stufe einer Fertigkeit auf die Würfelleiter abbilden (0 … 6).
*/
function skill_tier_index(int $level): int
{
return max(0, min(count(WS_SKILL_DICE) - 1, $level));
}
/** Würfel der Fertigkeitsstufe, z. B. Stufe 3 → „W10". */
function skill_die(int $level): string
{
return WS_SKILL_DICE[skill_tier_index($level)];
}
/** Bezeichnung der Fertigkeitsstufe, z. B. Stufe 0 → „ungelernt". */
function skill_tier(int $level): string
{
return WS_SKILL_TIERS[skill_tier_index($level)];
}
/** Attributkürzel (STR, GES, …) prüfen; unbekannte Werte werden zu ''. */
function skill_attribute_code(string $value): string
{