b451f83174
Captures the pre-Godot-port state of the codebase. This is the rollback anchor for the Godot port (M0 of theriapolis-rpg-implementation-plan-godot-port.md). All Phase 0 through Phase 6.5 work is included; Phase 7 is in flight. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
33 lines
852 B
C#
33 lines
852 B
C#
namespace Theriapolis.Core.Rules.Stats;
|
|
|
|
/// <summary>
|
|
/// Standard d20 proficiency-bonus-by-level table:
|
|
/// 1-4 → +2
|
|
/// 5-8 → +3
|
|
/// 9-12 → +4
|
|
/// 13-16 → +5
|
|
/// 17-20 → +6
|
|
/// Phase 5 only ever evaluates level 1, but the full table ships so
|
|
/// future leveling work doesn't have to revisit this file.
|
|
/// </summary>
|
|
public static class ProficiencyBonus
|
|
{
|
|
public const int MinLevel = 1;
|
|
public const int MaxLevel = 20;
|
|
|
|
public static int ForLevel(int level)
|
|
{
|
|
if (level < MinLevel || level > MaxLevel)
|
|
throw new ArgumentOutOfRangeException(nameof(level), $"Level must be {MinLevel}..{MaxLevel}, got {level}");
|
|
|
|
return level switch
|
|
{
|
|
>= 17 => 6,
|
|
>= 13 => 5,
|
|
>= 9 => 4,
|
|
>= 5 => 3,
|
|
_ => 2,
|
|
};
|
|
}
|
|
}
|