feat(gear): add final unbreakable Elytra reward
This commit is contained in:
@@ -22,3 +22,4 @@
|
||||
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)
|
||||
23. [US-023: Complete the legacy collection with an unbreakable Elytra](us-023-complete-legacy-collection-with-elytra.md)
|
||||
|
||||
@@ -26,6 +26,12 @@ 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-023 extension
|
||||
|
||||
Verified with 221 passing tests via `./gradlew clean check jar`; see [US-023 verification and limitations](us-023-complete-legacy-collection-with-elytra.md#verification-scope-and-limitations).
|
||||
|
||||
- [x] After those nine independent claims, one further choice buys the final once-per-reign [unbreakable Elytra](us-023-complete-legacy-collection-with-elytra.md); prior item possession is irrelevant.
|
||||
|
||||
## 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).
|
||||
|
||||
@@ -23,6 +23,12 @@ As a **server operator**, I want configurable and durable game behavior so that
|
||||
|
||||
- [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-023 extension
|
||||
|
||||
Verified with 221 passing tests via `./gradlew clean check jar`; see [US-023 verification and limitations](us-023-complete-legacy-collection-with-elytra.md#verification-scope-and-limitations).
|
||||
|
||||
- [x] Final [Elytra claims](us-023-complete-legacy-collection-with-elytra.md) use `game.claimed-armor`, load older missing/armor/tool claim state, survive restart, and reset with the reign without changing delivered items.
|
||||
|
||||
## 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).
|
||||
|
||||
@@ -34,6 +34,12 @@ As the **Tyrant**, I want a control panel for my reign so that I can inspect pro
|
||||
- [x] Existing `/tyrant choices`, `/tyrant buy`, `/tyrant assign`, and `/tyrant intelligence` commands remain available as alternatives.
|
||||
- [x] The active Tyrant can open the control panel by using the bound Tyrant control item.
|
||||
|
||||
## US-023 extension
|
||||
|
||||
Verified with 221 passing tests via `./gradlew clean check jar`; see [US-023 verification and limitations](us-023-complete-legacy-collection-with-elytra.md#verification-scope-and-limitations).
|
||||
|
||||
- [x] The tenth reward is the final [Elytra](us-023-complete-legacy-collection-with-elytra.md); its menu explains missing standard unlocks, nine current-reign regular claims, and choices, and confirms unbreakability and one-choice cost through the authoritative command path.
|
||||
|
||||
## Validation
|
||||
|
||||
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.
|
||||
|
||||
@@ -13,7 +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 gear` suggests `axe`, `pickaxe`, `sword`, `hoe`, `shovel`, and `elytra` and accepts no further arguments; see [US-022](us-022-purchase-legacy-tools-and-weapons.md) and [US-023](us-023-complete-legacy-collection-with-elytra.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`.
|
||||
@@ -34,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-023 validation
|
||||
|
||||
Verified Elytra completion, case-insensitive prefix matching, argument positions, and unchanged armor completion with 221 passing tests via `./gradlew clean check jar`; see [US-023 verification and limitations](us-023-complete-legacy-collection-with-elytra.md#verification-scope-and-limitations).
|
||||
|
||||
## 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).
|
||||
|
||||
@@ -24,7 +24,13 @@ 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.
|
||||
- [x] The four armor claims coexist with five independent [tool and weapon claims](us-022-purchase-legacy-tools-and-weapons.md), for nine regular rewards without any armor-first requirement; armor commands, enchantments, and saved claims remain compatible.
|
||||
|
||||
## US-023 extension
|
||||
|
||||
Verified with 221 passing tests via `./gradlew clean check jar`; see [US-023 verification and limitations](us-023-complete-legacy-collection-with-elytra.md#verification-scope-and-limitations).
|
||||
|
||||
- [x] Armor remains independently purchasable and unchanged; its four current-reign claims count toward the final [Elytra](us-023-complete-legacy-collection-with-elytra.md), which is not an armor prerequisite or armor-command option.
|
||||
|
||||
## US-022 validation
|
||||
|
||||
|
||||
@@ -20,6 +20,12 @@ As the **fully unlocked Tyrant**, I want to purchase named tools and weapons so
|
||||
- [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.
|
||||
|
||||
## US-023 extension
|
||||
|
||||
Verified with 221 passing tests via `./gradlew clean check jar`; see [US-023 verification and limitations](us-023-complete-legacy-collection-with-elytra.md#verification-scope-and-limitations).
|
||||
|
||||
- [x] The nine regular rewards remain independent and unchanged; all nine current-reign claims unlock eligibility for the tenth [unbreakable Elytra](us-023-complete-legacy-collection-with-elytra.md), purchased separately for one choice through the expanded gear command/menu.
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
type: User Story
|
||||
title: "US-023: Complete the legacy collection with an unbreakable Elytra"
|
||||
description: Reward a completed current-reign legacy collection with one final transferable Elytra.
|
||||
status: done
|
||||
---
|
||||
|
||||
# US-023: Complete the legacy collection with an unbreakable Elytra
|
||||
|
||||
As the **active Tyrant**, I want a final unbreakable Elytra after completing my reign's collection so that continued victories earn a lasting trophy.
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- [x] After all six standard unlocks and all nine regular armor, tool, and weapon claims in the current reign, the active Tyrant can spend one additional choice on one Elytra; possession of earlier rewards is not required.
|
||||
- [x] The nine regular rewards remain independent of one another and of Elytra; Elytra is not its own prerequisite.
|
||||
- [x] The reward is Minecraft Elytra with the Unbreakable flag and no enchantments, including no Mending or Unbreaking.
|
||||
- [x] The gold display name is `Tyrant's <player name> Elytra`; gray lore is `Forged for Tyrant <name>.`, `A lasting reward from <name>'s reign.`, and `Earned by completing the Tyrant's legacy collection.`.
|
||||
- [x] The ordinary item can be traded, stored, repaired, retained after the reign, lost, or destroyed; no binding or replacement is provided.
|
||||
- [x] The menu explains unmet prerequisites and confirms Elytra, unbreakability, and the one-choice cost before using the authoritative command path.
|
||||
- [x] `/tyrant gear elytra` purchases the reward and contextual completion includes Elytra, case-insensitive prefixes, and no extra arguments; armor commands remain unchanged.
|
||||
- [x] Claims persist under backward-compatible storage and reset each reign without touching delivered items.
|
||||
- [x] Full inventory, paused/inactive games, unauthorized claimants, incomplete prerequisites, no choices, and duplicate or stale requests cannot issue rewards or consume choices.
|
||||
|
||||
## Implementation
|
||||
|
||||
Reuse historical armor-named reward types and the `game.claimed-armor` key. Use an explicit nine-item prerequisite set, not all reward enum values. The approved Unbreakable design replaces the initial enchantment proposal.
|
||||
|
||||
### Implementation references
|
||||
|
||||
- [Explicit reward set and parsing](../../src/main/java/games/dmg/spigottyrant/TyrantArmorPiece.java) and [claim rules](../../src/main/java/games/dmg/spigottyrant/TyrantArmorService.java)
|
||||
- [Item specification](../../src/main/java/games/dmg/spigottyrant/TyrantArmorSpec.java) and [Bukkit metadata creation](../../src/main/java/games/dmg/spigottyrant/BukkitTyrantArmorItemFactory.java)
|
||||
- [Command delivery](../../src/main/java/games/dmg/spigottyrant/TyrantCommand.java), [contextual completion](../../src/main/java/games/dmg/spigottyrant/TyrantTabCompleter.java), [menu policy](../../src/main/java/games/dmg/spigottyrant/TyrantControlPanelModel.java), and [renderer/confirmation dispatch](../../src/main/java/games/dmg/spigottyrant/BukkitTyrantControlPanelRenderer.java)
|
||||
- [Historical-key persistence](../../src/main/java/games/dmg/spigottyrant/YamlTyrantStateRepository.java) and [restart/reset tests](../../src/test/java/games/dmg/spigottyrant/YamlTyrantStateRepositoryTest.java)
|
||||
|
||||
## Verification scope and limitations
|
||||
|
||||
Verified on 2026-09-09: `./gradlew clean check jar` passed with 221 tests, zero failures/errors/skips, Java 17 warnings-as-errors compilation, and JAR packaging. OKF v0.1 structural validation passed for all 30 design Markdown documents (YAML frontmatter, required story fields/statuses/criteria, reserved index/log structure, and local links); `git diff --check` passed.
|
||||
|
||||
Automated coverage includes each missing regular claim and standard unlock, no prior item possession, one-choice purchase, repeated command input, full inventory, lifecycle/authorization guards, malformed and cross-category requests, contextual completion, exact item metadata and confirmation text, ten distinct menu slots, missing-prerequisite menu explanations, older saves, Elytra restart round trips, and succession reset. The initial test run failed to compile because the partial implementation lacked the Elytra enum value; the first complete build also caught three obsolete nine-reward regression assumptions.
|
||||
|
||||
No live Spigot smoke test has been performed. Item metadata calls are verified with Mockito; actual flight, durability, trading, storage, loss/destruction, and post-reign inventory behavior rely on ordinary Minecraft item semantics and are not live-server tested. Renderer layout, menu policy, confirmation specification, and command delivery are tested separately rather than through a real client click sequence. Bukkit serializes these command and inventory handlers on the server thread; this does not provide arbitrary asynchronous callers with thread safety.
|
||||
|
||||
The existing persistence/delivery path is retained: YAML claims and Minecraft inventory saves are not a cross-store atomic transaction. Abrupt crashes or disk failures during delivery retain the preexisting risk of loss or duplication, and the existing state manager performs synchronous saves. No persistence architecture change or crash-atomicity guarantee is introduced. Backward compatibility means loading old saves in the new plugin, not downgrading to older binaries that do not recognize `ELYTRA`.
|
||||
|
||||
## Related
|
||||
|
||||
- [Progression](us-003-progress-and-purchase-unlocks.md)
|
||||
- [Persistence](us-012-configure-and-persist-state.md)
|
||||
- [Control panel](us-015-manage-tyrant-control-panel.md)
|
||||
- [Completion](us-018-complete-commands-contextually.md)
|
||||
- [Armor](us-021-claim-tyrant-legacy-armor.md)
|
||||
- [Tools and weapons](us-022-purchase-legacy-tools-and-weapons.md)
|
||||
Reference in New Issue
Block a user