commit c33fb44677b3fa99970a0752b08323872773cafa
parent 20fe3e844d4f9afdca719028f9713767a193e820
Author: anon <anon@example.com>
Date: Mon, 2 Nov 2026 14:59:05 +0000
Cover level-ten Stamina and training gates
Diffstat:
3 files changed, 116 insertions(+), 0 deletions(-)
diff --git a/TODO.md b/TODO.md
@@ -852,6 +852,13 @@ for exact records, protocol, tests and remaining reconstruction assumptions.
level regressions plus fifteen skill-training tests pass with 77 results; the expanded
level-nine regression passes under the race detector, and vet passes. Higher
player/encounter levels, broader families and original NPC scaling remain open.
+ The public-handler level9 -> 10 regression now verifies the next level cap,
+ 4000-IP award, Stamina-bound atomic refusal and qualified 1115-IP training.
+ Current HP remains 180 while maximum HP reaches 339, and unbuffed 1h Blunt
+ reaches 62. Each phase cold-loads retained equipment, supplies and wallet.
+ Six level regressions and fifteen training tests pass with 78 results; the
+ new regression passes under race and vet passes. Ordinary earned level ten
+ remains pending; see [later earned-level regression](docs/character-progression.md#later-earned-level-regression).
- [x] Verify mapped Tiny Stalkers as a second ordinary early combat family.
Admit only SR01 at levels 2..4 through shared profiles, preserving medium
identity confidence, attack-selection uncertainty and provisional balance.
diff --git a/docs/character-progression.md b/docs/character-progression.md
@@ -378,6 +378,24 @@ under `local/earned-ninth-boundary/`. The separate
[native earned level-nine run](mission-levels.md#native-earned-level-nine)
verifies ordinary full-health combat and the accepted 839-IP training batch.
+`TestEarnedTenthLevelNeedsStaminaForBodyDevelopmentTraining` checks the next
+boundary with a controlled one-health level-ten encounter. At level nine, a
+batch requesting Stamina 28 and raw Body Development/1h Blunt 55 exceeds the
+level cap and changes nothing. The kill crosses 6350 current XP to level ten
+with 150 remaining, awarding exactly 4000 IP. Maximum HP rises from 288 to 295
+while current HP stays 180. The same skill batch without the Stamina increase
+still fails atomically at the ability cap.
+
+Stamina 23 -> 28 and both raw skills 45 -> 55 cost exactly 1115 IP, leaving
+30678. Effective unbuffed 1h Blunt becomes 62 and maximum HP becomes 339,
+without refilling current HP. Every phase cold-loads the same worn QL10
+bat/body/pants, laboratory/recharger quantities and wallet. This shortened
+fixture checks progression bookkeeping, rather than earned native level ten
+or original encounter balance. Six level-five through level-ten regressions
+and fifteen skill-training tests pass with 78 tests/subtests. The new regression
+also passes under the race detector; vet passes. Evidence is retained under
+`local/earned-tenth-boundary/`.
+
## Retained evidence
The selected relocated `kkr.dll` has SHA-256
diff --git a/server/tenth_level_training_test.go b/server/tenth_level_training_test.go
@@ -0,0 +1,91 @@
+package main
+
+import (
+ "ao/server/gamedata"
+ "slices"
+ "testing"
+ "time"
+)
+
+func TestEarnedTenthLevelNeedsStaminaForBodyDevelopmentTraining(t *testing.T) {
+ world, _ := newKillExperienceWorld(t, "unarmed")
+ player, client := world.characters[1], world.clients[1]
+ player.appearance = player.appearance&^(7<<4) | 4<<4
+ player.profession, player.level, player.experience = 9, 9, 6350
+ player.stats = defaultCharacterStats(4)
+ player.stats.Abilities = characterAbilitiesStats{28, 31, 23, 6, 8, 3}
+ player.stats.Body.BodyDevelopment, player.stats.Melee.OneHandBlunt = 45, 45
+ player.stats.ImprovementPoints, player.health = 27793, 180
+ if err := world.saveUser_locked(player); err != nil {
+ t.Fatal(err)
+ }
+
+ // Retain earned equipment and bought supplies across training and cold loads.
+ items := []ownedItem{
+ {ID: 3, Type: 51018, Template: 122691, Quality: 10, Slot: 6, Count: 1},
+ {ID: 4, Type: 51022, Template: 85686, Quality: 10, Slot: 21, Count: 1},
+ {ID: 5, Type: 51022, Template: 85512, Quality: 10, Slot: 27, Count: 1},
+ {ID: 6, Type: 51005, Template: 25812, Quality: 1, Slot: 64, Count: 21},
+ {ID: 7, Type: 51005, Template: 25820, Quality: 1, Slot: 65, Count: 47},
+ }
+ if err := world.saveInventory_locked(player, playerInventory{LastID: 7, Items: slices.Clone(items), Credits: 1303}); err != nil {
+ t.Fatal(err)
+ }
+
+ // Isolate the level-ten award with a one-health level-ten encounter.
+ world.combatRoll = func(uint32) uint32 { return 0 }
+ world.characters[1000000].level = 10
+ world.characters[1000000].combatProfile = gamedata.NPCCombatProfiles[17655][10]
+ trained := player.baseStats()
+ trained.Abilities.Stamina = 28
+ trained.Body.BodyDevelopment, trained.Melee.OneHandBlunt = 55, 55
+
+ if err := world.handleSkillTraining(client, skillTrainingRequest(trained)[20:]); err != nil {
+ t.Fatal(err)
+ }
+ cold := newTestInventoryServer(t)
+
+ for _, current := range []*server{world, cold} {
+ owner := current.characters[1]
+ if owner.level != 9 || owner.experience != 6350 || owner.stats.ImprovementPoints != 27793 ||
+ owner.stats.Abilities.Stamina != 23 || owner.stats.Body.BodyDevelopment != 45 || owner.stats.Melee.OneHandBlunt != 45 ||
+ owner.health != 180 || owner.maximumHealth() != 288 || !slices.Equal(owner.inventory.Items, items) {
+ t.Fatal("level-nine cap changed training, health or retained items", owner.profile(), owner.inventory)
+ }
+ }
+
+ attackForExperience(t, world, "unarmed")
+ world.advanceCombat(player.rechargeUntil.Add(time.Second))
+ trained.Abilities.Stamina = 23
+ if err := world.handleSkillTraining(client, skillTrainingRequest(trained)[20:]); err != nil {
+ t.Fatal(err)
+ }
+ cold = newTestInventoryServer(t)
+
+ for _, current := range []*server{world, cold} {
+ owner := current.characters[1]
+ if owner.level != 10 || owner.experience != 150 || owner.stats.ImprovementPoints != 31793 ||
+ owner.stats.Abilities.Stamina != 23 || owner.stats.Body.BodyDevelopment != 45 || owner.stats.Melee.OneHandBlunt != 45 ||
+ owner.health != 180 || owner.maximumHealth() != 295 || !slices.Equal(owner.inventory.Items, items) {
+ t.Fatal("ability-capped batch changed the earned award or retained state", owner.profile(), owner.inventory)
+ }
+ }
+
+ trained.Abilities.Stamina = 28
+ if err := world.handleSkillTraining(client, skillTrainingRequest(trained)[20:]); err != nil {
+ t.Fatal(err)
+ }
+ cold = newTestInventoryServer(t)
+
+ for _, current := range []*server{world, cold} {
+ owner := current.characters[1]
+ if owner.level != 10 || owner.experience != 150 || owner.stats.ImprovementPoints != 30678 ||
+ owner.stats.Abilities != (characterAbilitiesStats{28, 31, 28, 6, 8, 3}) ||
+ owner.stats.Body.BodyDevelopment != 55 || owner.stats.Melee.OneHandBlunt != 55 ||
+ owner.combatSkill(102) != 62 ||
+ owner.health != 180 || owner.maximumHealth() != 339 || owner.inventory.Credits != 1303 ||
+ !slices.Equal(owner.inventory.Items, items) {
+ t.Fatal("qualified training lost its 1115-IP cost, health or retained items", owner.profile(), owner.inventory)
+ }
+ }
+}