1.5 KiB
1.5 KiB
Consumable Items (Potions) Implementation
Objective
Implement a consumable item system to provide immediate effects or short-term buffs during battle.
Features
1. New Item Type: Consumables
- Category:
EquipmentSlot.consumable - Items:
- Healing Potion: Restores HP immediately.
- Ironskin Potion (Armor): Grants Armor immediately.
- Strength Potion: Grants "Attack Up" buff for 1 turn.
2. Battle Mechanics
- Usage: Consumables can be used from the inventory during the player's turn.
- Action Cost: Usage is a Free Action (does not consume the turn). Players can use a potion and then Attack/Defend in the same turn.
- Effects:
- Heal:
hp += value(capped at maxHp) - Armor:
armor += value - Buff: Apply
StatusEffectType.attackUp(increases damage by 20% or flat amount).
- Heal:
3. Shop Update
- Shop now stocks 6 items total:
- 4 Equipment (Weapons/Shields/Armor/Accessories)
- 2 Consumables (Potions)
4. UI Updates
- Battle Controls: Added an "Items" button (Bag icon) to open the battle inventory.
- Shop UI: Updated to display and sell consumable items.
- Battle Inventory: A dialog to view and use owned consumable items.
Technical Details
Itemmodel updated to handlehpBonus(Heal),armorBonus(Armor), andeffects(Buffs) for consumables.BattleProvider.useItem(Item)implements the application logic.CombatCalculatorlogic handles theAttack Upstatus effect multiplier.