Skip to content

Commit 2015e16

Browse files
committed
docs: restore Byleth early-level growth reference
1 parent 4d48857 commit 2015e16

2 files changed

Lines changed: 54 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,25 @@ vanilla random system, but it does not undo stats already earned.
8686

8787
## Early-game test reference
8888

89-
No unit should get an empty or single-stat level-up while at least two of its
90-
stats can still increase. If all effective growth rates and counters are zero,
91-
the fixed tie order grants Strength and Magic. A fallback gain leaves that
92-
stat's fractional counter unchanged, so it can also grow naturally later.
89+
For a new game with this plugin active from level 1, these are Byleth's
90+
expected *per-level increases*. Keep Byleth as a Commoner through level 5;
91+
do not equip growth-modifying abilities or reach a stat cap. Gain each level
92+
separately. Compare the stat changes, not Byleth's total stats. A class change
93+
or a save first played without the plugin will produce different results.
94+
95+
| Level | Expected gains |
96+
| --- | --- |
97+
| 1 → 2 | Str, Dex |
98+
| 2 → 3 | HP, Str, Mag, Dex, Spd, Lck, Def, Cha |
99+
| 3 → 4 | Str, Res |
100+
| 4 → 5 | HP, Str, Dex, Spd, Lck, Cha |
101+
102+
Each listed stat gains **one point**; unlisted stats do not change. Byleth's
103+
1 → 2 gains (Str, Dex) and 3 → 4 gains (Str, Res) include the two-stat
104+
minimum: those levels would otherwise have zero or only one natural gain.
105+
No unit should have an empty or single-stat level-up while at least two stats
106+
can still increase. These are predictions from the plugin's current algorithm,
107+
not yet hardware-verified results.
93108

94109
## Documentation
95110

‎src/level_up.rs‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,41 @@ mod tests {
9898
}
9999
}
100100

101+
#[test]
102+
fn matches_byleths_early_game_readme_reference() {
103+
// HP, Str, Mag, Dex, Spd, Lck, Def, Res, Mov, Cha.
104+
let sources = GrowthSources {
105+
personal: [45, 45, 35, 45, 45, 45, 35, 30, 0, 45],
106+
class: [0; STAT_COUNT], // Commoner.
107+
ability_bonus: 0,
108+
caps: [99; STAT_COUNT],
109+
};
110+
let expected = [
111+
[0, 1, 0, 1, 0, 0, 0, 0, 0, 0],
112+
[1, 1, 1, 1, 1, 1, 1, 0, 0, 1],
113+
[0, 1, 0, 0, 0, 0, 0, 1, 0, 0],
114+
[1, 1, 0, 1, 1, 1, 0, 0, 0, 1],
115+
];
116+
let mut stats = [10; STAT_COUNT];
117+
let mut persisted = None;
118+
119+
for (level, expected_gains) in (1..=4).zip(expected) {
120+
let LevelUpDecision::Apply { result, state } =
121+
decide_level_up(level, level + 1, stats, sources, persisted)
122+
else {
123+
panic!("expected Byleth's level-up result");
124+
};
125+
assert_eq!(
126+
result.gains,
127+
expected_gains,
128+
"level {level} → {}",
129+
level + 1
130+
);
131+
stats = result.stats;
132+
persisted = Some(state);
133+
}
134+
}
135+
101136
#[test]
102137
fn initializes_with_personal_growth_before_the_first_level() {
103138
let decision = decide_level_up(1, 2, [10; STAT_COUNT], sources(35, 10, 0), None);

0 commit comments

Comments
 (0)