Add equipment unequip flow
This commit is contained in:
@@ -344,7 +344,7 @@ Consumables use `kind: "consumable"` with effect records. `heal_hp` restores HP,
|
||||
|
||||
Scenario `shop.items` controls which positive-price items appear in the current pre-battle shop. `shop.conditional_items` can append extra stock when saved campaign flags match. Entries can be plain item ids or objects with `id` and optional non-negative `stock`; `shop.stock` and conditional block `stock` objects can also set finite limits by item id. Items omitted from stock data are unlimited. Finite stock is tracked as per-scenario purchase counts in the campaign save, so buying an item decrements that scenario's remaining stock and manual checkpoint saves preserve it. Purchases spend campaign gold, increment the campaign inventory count, save immediately, and then refresh the battle inventory copy if a scenario briefing is already loaded. The shop can also sell unequipped inventory stock back for 50% of base `price`, saving immediately and refreshing the loaded battle inventory copy. Later campaign data should add broader unlock flags.
|
||||
|
||||
The pre-battle Armory operates on the currently loaded player deployments and the copied battle inventory, then saves the changed roster entries and inventory counts back into `CampaignState`. Unlike in-battle equipment swaps, Armory changes persist immediately and survive defeat or restart. Completed-scenario replays keep Shop and Armory disabled so replay setup cannot alter the campaign save.
|
||||
The pre-battle Armory operates on the currently loaded player deployments and the copied battle inventory, then saves the changed roster entries and inventory counts back into `CampaignState`. Gear can also be unequipped back into inventory stock before combat, making it available for later Armory swaps or shop selling. Unlike in-battle equipment swaps, Armory changes persist immediately and survive defeat or restart. Completed-scenario replays keep Shop and Armory disabled so replay setup cannot alter the campaign save.
|
||||
|
||||
Scenario `roster.max_units`, `roster.required_officers`, and `roster.required_units` control the first pre-battle Roster selection pass. Required officers and required scenario units always deploy, optional player deployments can move between sortie and reserve, and reserve units do not participate in map occupancy, targeting, or living-unit victory checks. If all loaded player units are required, the rules still apply but the pre-battle Roster button stays disabled because there is no meaningful sortie choice. If `roster` is omitted, all player deployments sortie as before.
|
||||
|
||||
@@ -577,7 +577,7 @@ Event-spawned units use the same compact deployment shape as scenario starting u
|
||||
|
||||
After a first-time victory, `CampaignState` advances `current_scenario_id` to the next entry in `data/campaign/campaign.json`. Completed-scenario replays return a result summary without rewriting the save or moving `current_scenario_id`. The battle scene passes `CampaignState.get_roster_overrides()`, `CampaignState.get_inventory_snapshot()`, `CampaignState.get_flags_snapshot()`, and `CampaignState.get_joined_officers_snapshot()` into `BattleState.load_battle()`, so officers can keep level/EXP/stat progression, equipped gear, consumable/equipment stock counts, recruitment gates, and branch flags into the next scenario.
|
||||
|
||||
During a battle, item consumption, event item pickups, and equipment swaps affect `BattleState.battle_inventory`. `CampaignState.apply_battle_result()` commits that inventory snapshot only for a first-time victory, then adds the victory rewards. Equipped gear is stored in the player roster snapshot together with the current derived stats; a later stat-model refactor should split base stats, growth, and equipment bonuses.
|
||||
During a battle, item consumption, event item pickups, equipment swaps, and unequipped gear returned to stock affect `BattleState.battle_inventory`. `CampaignState.apply_battle_result()` commits that inventory snapshot only for a first-time victory, then adds the victory rewards. Equipped gear is stored in the player roster snapshot together with the current derived stats; a later stat-model refactor should split base stats, growth, and equipment bonuses.
|
||||
|
||||
`BattleState` records player-only `progression_events` when a unit levels up or promotes. `CampaignState.apply_battle_result()` includes those events in the victory summary only when the first-time victory save succeeds, so completed-scenario replays and failed saves do not present unsaved growth as campaign progress. The result panel presents saved rewards, roster changes, growth, campaign status, and pending choices as separate sections; failed saves explicitly show rewards as not applied.
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
- Unit classes and class growth tables. Basic version exists.
|
||||
- Automatic class promotion routes. Basic level-threshold promotion exists for core first-tier battle classes.
|
||||
- Weapon, armor, and accessory slots. Basic stat bonuses and first weapon-vs-move-type physical damage bonuses exist.
|
||||
- Equipment rewards can be stored, displayed, compared, and swapped from the battle HUD.
|
||||
- Equipment rewards can be stored, displayed, compared, equipped, unequipped, and swapped from the battle HUD.
|
||||
- Terrain movement, defense, and avoid modifiers affect combat.
|
||||
- Skills, tactics, and MP. Multiple damage/heal tactics, first area damage/healing/status tactics, ally support buffs, enemy debuffs, movement and accuracy/evasion modifiers, poison damage-over-time, seal/snare/disarm action locks, a skill list menu with range/effect hints, and enemy tactic AI exist.
|
||||
- Consumable item use. Basic global inventory, Bean HP recovery, Wine MP recovery, Antidote poison cure, Panacea poison/seal/snare/disarm cure, item menu, preview, and target overlay exist.
|
||||
@@ -59,7 +59,7 @@
|
||||
- Save reset exists.
|
||||
- Victory rewards, consumable counts, equipment stock, and equipped gear persist.
|
||||
- A basic pre-battle shop with scenario-specific stock, optional finite item limits, and 50% sell-back exists. Richer item management beyond stock limits is still planned.
|
||||
- A basic pre-battle Armory exists for saved equipment changes before combat.
|
||||
- A basic pre-battle Armory exists for saved equipment changes and unequipping before combat.
|
||||
- A basic pre-battle Roster exists for required officers, required scenario units, optional officers, and sortie limits.
|
||||
- A basic pre-battle Formation screen exists for scenario-defined starting cells.
|
||||
- Officer join/leave rewards, choice membership changes, and joined-officer deployment gates exist in a basic form.
|
||||
|
||||
Reference in New Issue
Block a user