feat(gear): add Tyrant legacy tools and weapons
Release / release (push) Successful in 2m56s
CI / build (push) Successful in 1m12s

This commit is contained in:
dmg
2026-09-09 22:02:59 -04:00
parent 553db666e1
commit 0c4a95801a
27 changed files with 411 additions and 44 deletions
+1
View File
@@ -21,3 +21,4 @@
19. [US-019: Claim the Vigilante role in the arena](us-019-claim-vigilante-in-arena.md)
20. [US-020: Claim the Tyrant role in the arena](us-020-claim-tyrant-in-arena.md)
21. [US-021: Claim Tyrant legacy armor](us-021-claim-tyrant-legacy-armor.md)
22. [US-022: Purchase legacy tools and weapons](us-022-purchase-legacy-tools-and-weapons.md)
@@ -14,7 +14,7 @@ As the **Tyrant**, I want to earn one meaningful choice for defeating the Vigila
- [x] The Tyrant gains one level and one unlock choice only when personally credited with killing the current Vigilante.
- [x] An administrator can grant the current Tyrant one level and one unlock choice without changing purchases or unrelated game state.
- [x] Each successful administrative grant adds exactly one level and one choice, including across repeated invocations.
- [x] After purchasing all six standard unlocks, the Tyrant may spend later choices on one of each legacy armor slot during the reign.
- [x] After purchasing all six standard unlocks, the Tyrant may spend later choices on each of nine legacy armor, tool, and weapon rewards in any order during the reign, without armor prerequisites; see [US-022](us-022-purchase-legacy-tools-and-weapons.md).
- [x] A Vigilante death caused by another player, the environment, or the Vigilante does not level the Tyrant.
- [x] Available purchases are Assassin, Fixer, Tamer, roster intelligence, permanent Resistance, and permanent Strength.
- [x] Each class or ability can be purchased at most once during a reign.
@@ -26,6 +26,10 @@ As the **Tyrant**, I want to earn one meaningful choice for defeating the Vigila
- [x] A confirmation displays the selected unlock and choice cost before purchase.
- [x] The control panel refreshes the available choices immediately after a successful purchase.
## US-022 validation
Verified all nine independent one-choice legacy purchases and duplicate prevention with `./gradlew clean check jar` (177 passing tests); see [US-022 verification](us-022-purchase-legacy-tools-and-weapons.md#validation-scope).
## Related
- [Role and class model](../concepts/role-and-class-model.md)
@@ -21,6 +21,12 @@ As a **server operator**, I want configurable and durable game behavior so that
- [x] Unknown forward-compatible configuration and state fields are preserved where practical.
- [x] Plugin disable removes transient effects and presentation safely while preserving durable state.
- [x] Tool and weapon claims persist alongside existing armor claims with backward-compatible loading and per-reign reset; see [US-022](us-022-purchase-legacy-tools-and-weapons.md).
## US-022 validation
Verified older armor-only YAML, absent claim state, mixed armor/tool restart round trips, and nine-item reign reset with `./gradlew clean check jar` (177 passing tests); see [US-022 verification and limitations](us-022-purchase-legacy-tools-and-weapons.md#validation-scope).
## Related
- [Persistence model](../concepts/persistence-model.md)
@@ -22,7 +22,7 @@ As the **Tyrant**, I want a control panel for my reign so that I can inspect pro
- [x] Purchased, available, unavailable, and cooldown-gated actions are visually distinguishable and explain why they cannot currently be used.
- [x] The Tyrant can navigate between overview, unlock, class-assignment, and ability screens and can close the panel without changing gameplay state.
- [x] The Tyrant can review and purchase an available unlock after confirming the selected unlock and its choice cost.
- [x] After all standard unlocks are purchased, the Tyrant can select and confirm an unclaimed legacy armor slot through the control panel.
- [x] After all standard unlocks are purchased, the Tyrant can select and confirm any of nine unclaimed legacy rewards through the control panel, including [US-022 tools and weapons](us-022-purchase-legacy-tools-and-weapons.md).
- [x] The Tyrant can select a purchased class and assign or reassign it to an eligible online player.
- [x] The class player selector excludes the Tyrant and clearly identifies players who are opted out or otherwise ineligible.
- [x] Class reassignment identifies the current holder and requires confirmation before replacing that holder.
@@ -38,6 +38,10 @@ As the **Tyrant**, I want a control panel for my reign so that I can inspect pro
Automated tests verify command entry points, active-Tyrant authorization, authoritative overview state, the exact 100-tick login delay, lifecycle cancellation, and duplicate-opening prevention. The complete `./gradlew clean check jar` lifecycle passes.
## US-022 validation
Verified nine distinct reward slots, authoritative availability after claims, and exact confirmation enchantments/cost with `./gradlew clean check jar` (177 passing tests). The renderer dispatches confirmation through the tested armor/gear command paths; see [US-022 verification](us-022-purchase-legacy-tools-and-weapons.md#validation-scope). Live-server rendering remains a smoke-test follow-up.
## Related
- [Progress and purchase Tyrant unlocks](us-003-progress-and-purchase-unlocks.md)
@@ -13,6 +13,7 @@ As a **player or administrator**, I want contextual command suggestions so that
- [x] `/tyrant` suggests its available subcommands instead of arbitrary player names.
- [x] `/tyrant buy` suggests Tyrant unlock names.
- [x] `/tyrant gear` suggests `axe`, `pickaxe`, `sword`, `hoe`, and `shovel` and accepts no further arguments; see [US-022](us-022-purchase-legacy-tools-and-weapons.md).
- [x] `/tyrant armor` suggests `helmet`, `chestplate`, `leggings`, and `boots` and accepts no further arguments.
- [x] `/tyrant assign` suggests `assassin`, `fixer`, and `tamer`, followed by eligible online players.
- [x] `/tyrant relinquish` suggests `confirm`.
@@ -33,6 +34,10 @@ As a **player or administrator**, I want contextual command suggestions so that
Automated tests verify root syntax, unlocks, legacy armor pieces, classes, confirmations, eligible recruits, current Followers, permission gating, online administrative candidates, the argument-free `grantpoint` command, argument positions, and case-insensitive prefix filtering. The complete `./gradlew clean check jar` lifecycle passes.
## US-022 validation
Verified gear discovery, all five alphabetically sorted tool names, case-insensitive prefix matching, no extra arguments, and unchanged armor-only suggestions with `./gradlew clean check jar` (177 passing tests); see [US-022 verification](us-022-purchase-legacy-tools-and-weapons.md#validation-scope).
## Related
- [Start, pause, and administer the game](us-001-start-pause-and-administer.md)
@@ -24,6 +24,12 @@ As a **fully unlocked Tyrant**, I want to turn later progression choices into na
- [x] The Tyrant can select and confirm an available armor piece through the existing control panel, using the same domain and persistence rules as the command path.
- [x] `/tyrant armor <helmet|chestplate|leggings|boots>` remains available as an alternative and supports contextual completion.
- [x] The four armor claims coexist with five independent [tool and weapon claims](us-022-purchase-legacy-tools-and-weapons.md), for nine total rewards without any armor-first requirement; armor commands, enchantments, and saved claims remain compatible.
## US-022 validation
Verified armor delivery/full-inventory safety across all four pieces, armor-only command parsing/completion, existing item specification, older saved claims, and tool-first purchasing with `./gradlew clean check jar` (177 passing tests); see [US-022 verification](us-022-purchase-legacy-tools-and-weapons.md#validation-scope).
## Related
- [Progress and purchase Tyrant unlocks](us-003-progress-and-purchase-unlocks.md)
@@ -0,0 +1,46 @@
---
type: User Story
title: "US-022: Purchase legacy tools and weapons"
description: Let a fully unlocked Tyrant spend choices on lasting Netherite tools and weapons alongside legacy armor.
status: done
---
# US-022: Purchase legacy tools and weapons
As the **fully unlocked Tyrant**, I want to purchase named tools and weapons so that continued victories create useful, transferable reign trophies.
## Acceptance criteria
- [x] After all six standard unlocks, the active Tyrant may spend one choice each on Axe, Pickaxe, Sword, Hoe, and Shovel in any order alongside armor, with no armor prerequisites.
- [x] All five items are Netherite: Axe has Sharpness VI, Efficiency VI, Mending I; Pickaxe, Hoe, and Shovel have Efficiency VI, Mending I; Sword has Sharpness VI, Mending I.
- [x] Each item uses the armor naming/lore convention and remains ordinary transferable, persistent, repairable equipment without role binding or recovery.
- [x] Each of nine distinct legacy rewards can be purchased once per reign; losing or transferring an item does not restore eligibility.
- [x] Claims survive restart, preserve existing saved armor claims, and reset with the reign while delivered items remain untouched.
- [x] Full inventory, paused games, unauthorized players, incomplete unlocks, no choices, malformed requests, and repeated interactions cannot consume choices or issue rewards.
- [x] The control panel lists all nine rewards and confirms the selected item, enchantments, and one-choice cost before executing the authoritative claim path and refreshing.
- [x] `/tyrant gear <axe|pickaxe|sword|hoe|shovel>` offers contextual, case-insensitive completion with no extra arguments; `/tyrant armor` remains unchanged.
## Implementation
Extend the existing legacy reward service and historical armor-named state types to share one durable claim set. Preserve the `game.claimed-armor` storage key and original enum values for compatibility; new tool values are additional claims, not armor prerequisites.
- [Reward types and command parsing](../../src/main/java/games/dmg/spigottyrant/TyrantArmorPiece.java)
- [Item specification](../../src/main/java/games/dmg/spigottyrant/TyrantArmorSpec.java) and [Bukkit item creation](../../src/main/java/games/dmg/spigottyrant/BukkitTyrantArmorItemFactory.java)
- [Shared claim rules](../../src/main/java/games/dmg/spigottyrant/TyrantArmorService.java), [command delivery](../../src/main/java/games/dmg/spigottyrant/TyrantCommand.java), and [panel confirmation](../../src/main/java/games/dmg/spigottyrant/BukkitTyrantControlPanelRenderer.java)
- [State persistence](../../src/main/java/games/dmg/spigottyrant/YamlTyrantStateRepository.java)
## Validation scope
Verified `./gradlew clean check jar`: 177 tests passed, zero failures/errors/skips, Java compilation with `-Xlint:all -Werror`, and JAR packaging. OKF v0.1 validation checks all 29 Markdown documents for YAML frontmatter, story statuses and acceptance criteria, reserved index/log structure, and repository-local links. Initial red tests failed on missing tool rewards and gear completion before implementation.
Automated coverage includes all nine inventory deliveries and full-inventory rejections, tool-first claims and duplicate prevention, lifecycle/authorization/progression guards, repeated gear command execution against updated state, malformed and cross-category requests, sorted case-insensitive completion, exact item specifications and confirmation lore, unique panel slots, backward-compatible YAML loading and mixed-claim restart round trips, and succession reset.
No live-server smoke test has been performed. Persistence uses the existing state manager: saving YAML and saving Minecraft inventory are not a cross-store atomic transaction, so abrupt crashes or disk failures during delivery retain the preexisting armor-path risk. Older plugin binaries do not understand new tool enum values; backward compatibility means loading older armor saves in this version, not safe downgrade after new claims.
## Related
- [Progress and purchase unlocks](us-003-progress-and-purchase-unlocks.md)
- [Configure and persist state](us-012-configure-and-persist-state.md)
- [Tyrant control panel](us-015-manage-tyrant-control-panel.md)
- [Contextual completion](us-018-complete-commands-contextually.md)
- [Legacy armor](us-021-claim-tyrant-legacy-armor.md)