This commit is contained in:
2025-12-01 18:38:47 +09:00
parent 514b49f7d9
commit ae1ebdc6bf
27 changed files with 1965 additions and 597 deletions
+91
View File
@@ -0,0 +1,91 @@
# Role
You are a Senior Flutter Developer.
Your task is to build a functional prototype for a "Text/UI-based Turn-based Roguelike Game" called "Colosseum's Choice".
# Technology Stack
- **Framework:** Flutter (Pure Flutter, NO Game Engine like Flame)
- **State Management:** Provider
- **Architecture:** MVVM (Model - Provider - Screen)
- **Theme:** Dark Mode
# Core Game Mechanics
1. **Risk vs Return:** The player chooses an action (Attack/Defend) and then selects a Risk Level (Safe/Normal/Risky). Higher risk means lower success chance but higher effect.
2. **Armor System:** Armor reduces incoming damage. Player's Armor decays by 50% at the start of their turn.
3. **Turn-Based:** Player acts -> Result processing -> Delay (1 sec) -> Enemy acts -> Result processing.
# Required Files & Implementation Details
Please generate the complete Dart code for the following 4 files.
**IMPORTANT:** The code must be complete, error-free, and ready to run after adding the `provider` package.
---
## 1. `lib/models/character.dart`
**Description:** Data model for Player and Enemy.
- **Fields:** `String name`, `int hp`, `int maxHp`, `int armor`, `int atk`.
- **Constructor:** Initialize properties. `hp` defaults to `maxHp` if not provided.
- **Methods:**
- `bool get isDead => hp <= 0;`
## 2. `lib/providers/battle_provider.dart`
**Description:** Central logic controller using `ChangeNotifier`.
- **Properties:**
- `Character player`, `Character enemy`
- `List<String> battleLogs` (Stores combat history)
- `bool isPlayerTurn` (To disable buttons during enemy turn)
- **Methods:**
- `void initializeBattle()`: Reset stats, clear logs. Player(HP:100, ATK:10), Enemy(HP:100, ATK:8).
- `void playerAction(ActionType type, RiskLevel risk)`:
1. **Risk Logic:**
- **Safe:** 100% Success, 50% Efficiency.
- **Normal:** 80% Success, 100% Efficiency.
- **Risky:** 40% Success, 200% Efficiency.
2. **Calculate Result:** Roll dice. If success, apply Damage (Attack) or Gain Armor (Defend). If fail, log "Miss".
3. **Turn End:** Call `_enemyTurn()` after a short delay.
- `Future<void> _enemyTurn()`:
- Wait 1 second (simulating thinking).
- Enemy attacks player. (Damage = Enemy ATK - Player Armor).
- Start Player's new turn: **Reduce Player Armor by 50%**.
- `void _addLog(String message)`: Add to list and notify listeners.
**Enums:**
- `enum ActionType { attack, defend }`
- `enum RiskLevel { safe, normal, risky }`
## 3. `lib/screens/battle_screen.dart`
**Description:** The main UI.
- **Layout (Column):**
- **Top (Status Area):** Row displaying [Enemy Name/HP] and [Player HP/Armor]. Use `LinearProgressIndicator` for HP bars.
- **Middle (Log Area):** `Expanded` -> `ListView.builder`.
- **Crucial:** Use `ScrollController` to auto-scroll to the bottom whenever a new log is added.
- Style: Black background, green/white text font `Monospace`.
- **Bottom (Control Area):**
- Two large buttons: [ATTACK], [DEFEND].
- On press, show a `SimpleDialog` or `BottomSheet` to select Risk Level (Safe/Normal/Risky).
- Disable buttons if `!isPlayerTurn` or `game over`.
## 4. `lib/main.dart`
**Description:** Entry point.
- `main()`: `runApp`.
- `MyApp`: Uses `MultiProvider` to provide `BattleProvider`.
- `MaterialApp`:
- `theme`: `ThemeData.dark()`.
- `home`: `BattleScreen`.
---
# Output Format
Please provide the code for each file in separate code blocks.
+73
View File
@@ -0,0 +1,73 @@
# Role
You are a Senior Flutter Developer.
You are continuing the development of "Colosseum's Choice".
The basic battle prototype is already working.
Now, you need to implement the **Item & Progression System**.
# Goal
Modify the existing code to implement the following features:
1. **Item Model:** Create items that boost stats (ATK, MaxHP).
2. **Inventory System:** Player can equip items, and stats are calculated dynamically (Base + Item Bonus).
3. **Battle Loop:**
- **Victory:** When Enemy HP <= 0, show a dialog to choose 1 of 3 random items.
- **Progression:** After picking an item, the next battle starts immediately with a slightly stronger enemy.
- **HP Rule:** Player HP is NOT fully restored between battles (Roguelike element).
# Required Changes & Implementation Details
Please generate the updated code for the following files.
**IMPORTANT:** Preserve the existing "Risk vs Return" and "Armor Decay" logic.
---
## 1. `lib/models/item.dart` (New File)
**Description:**
- **Fields:** `String name`, `String description`, `int atkBonus`, `int hpBonus`.
- **Constructor:** Standard constructor.
## 2. `lib/models/character.dart` (Modify)
**Description:** Update to support equipment.
- **New Fields:** `List<Item> equipment`.
- **Stat Logic:**
- `int get totalAtk`: Returns `baseAtk` + sum of all equipped items' `atkBonus`.
- `int get totalMaxHp`: Returns `baseMaxHp` + sum of all equipped items' `hpBonus`.
- **Important:** Use `totalAtk` and `totalMaxHp` for battle logic instead of raw fields.
- **Methods:**
- `void equip(Item item)`: Add to equipment. If `hpBonus` > 0, increase current `hp` by that amount as well (optional heal).
## 3. `lib/providers/battle_provider.dart` (Modify)
**Description:** Handle Victory and Stage Progression.
- **New Properties:**
- `int stage`: Tracks current stage number (starts at 1).
- `List<Item> rewardOptions`: Stores the 3 random items generated upon victory.
- `bool showRewardPopup`: Flag to trigger UI dialog.
- **Methods:**
- `initializeBattle()`: Reset Player (Stage 1).
- `_onVictory()` (Internal): Called when Enemy dies. Generate 3 random items (e.g., "Rusty Sword (+2 ATK)", "Leather Vest (+10 HP)"). Set `showRewardPopup = true`.
- `selectReward(Item item)`: Equip item to player -> Increase Stage -> Spawn stronger Enemy (Scale Enemy stats by Stage) -> Reset `showRewardPopup`.
- **Update `playerAction`**: Ensure it uses `player.totalAtk` for damage calculation.
## 4. `lib/screens/battle_screen.dart` (Modify)
**Description:** Add UI for stats and rewards.
- **Top Area:** Display `Stage: X`. Update HP bars to show `current / totalMaxHp`.
- **Victory Handling:**
- Use `Consumer` to listen to `battleProvider`.
- If `provider.showRewardPopup` is true, show a `SimpleDialog` (or similar) listing the `rewardOptions`.
- Clicking an option calls `provider.selectReward(item)`.
---
# Output Format
Please provide the complete code for the modified/new files.
+65
View File
@@ -0,0 +1,65 @@
# Role
You are a Senior Flutter Developer working on "Colosseum's Choice".
The core battle and item system are working perfectly.
Your goal is to implement the **Inventory UI** and **Navigation System**.
# Requirements
1. **Navigation (`BottomNavigationBar`):**
- Create a main wrapper screen to switch between "Battle" and "Inventory".
- **Critical:** Use `IndexedStack` to preserve the state of the `BattleScreen` (keep the fight running) while viewing the Inventory.
2. **Inventory Screen:**
- Display the Player's detailed Stats (Total ATK, Total HP, Armor, etc.).
- List all collected/equipped items (`player.equipment`).
- Show each item's name and bonus stats (e.g., "Rusty Sword (+2 ATK)").
3. **Refactoring:**
- Update `main.dart` to point to the new Main Wrapper Screen.
# Required Files
Please generate the code for the following files.
---
## 1. `lib/screens/inventory_screen.dart` (New File)
**Description:**
- **Header:** Show Player Name, Stage, Total HP, Total ATK, Current Armor.
- **Body:** A `ListView` of `player.equipment`.
- **Item Tile:** `Card` or `ListTile` showing:
- Leading: Icon (e.g., `Icons.shield` or `Icons.security`).
- Title: Item Name.
- Subtitle: Description & Stat Bonuses.
- **State:** Use `Consumer<BattleProvider>` to display live data.
## 2. `lib/screens/main_wrapper.dart` (New File)
**Description:**
- **Widget:** `StatefulWidget`.
- **State:** Holds `_currentIndex` (0 = Battle, 1 = Inventory).
- **Build:**
- Return a `Scaffold`.
- `body`: `IndexedStack` with children `[BattleScreen(), InventoryScreen()]`.
- `bottomNavigationBar`: `BottomNavigationBar` with 2 items:
- Battle (`Icons.sports_kabaddi` or `Icons.flash_on`).
- Inventory (`Icons.backpack` or `Icons.inventory`).
- **Theme:** Ensure the bottom bar matches the Dark Theme.
## 3. `lib/main.dart` (Update)
**Description:**
- Change `home` from `BattleScreen` to `MainWrapper`.
---
# Output Format
Please provide the complete code for the 3 files above.
+66
View File
@@ -0,0 +1,66 @@
# Role
You are a Senior Flutter Developer working on "Colosseum's Choice".
You need to upgrade the Inventory System to a **Grid-based Slot System**.
# Goal
Separate "Equipped Items" from "Inventory Items" and create a fixed 16-slot inventory interface.
# Key Requirements
1. **Character Model Update:**
- Maintain `equipment` list (Items currently providing stats).
- Add `inventory` list (Items in the bag, providing NO stats).
- Limit `inventory` size to **16 slots**.
- Add methods: `equipItem(item)`, `unequipItem(item)`.
2. **Battle Logic Update:**
- **Victory Reward:** When an item is selected, add it to `inventory` (not `equipment`).
- If inventory is full (16 items), show a "Inventory Full" message (Snack bar or Log) and discard the item (Simple logic for now).
3. **UI Update (Inventory Screen):**
- **Section 1: Equipment:** Show currently equipped items (List or Row). Tap to Unequip.
- **Section 2: Inventory (Bag):** Use `GridView` with **fixed 16 slots** (4x4 grid).
- If a slot has an item: Show Icon & Name. Tap to Equip.
- If a slot is empty: Show an empty box container.
# Required Files
Please generate the updated code for the following files.
---
## 1. `lib/models/character.dart` (Update)
**Changes:**
- Add `List<Item> inventory = [];`.
- Add `int maxInventorySize = 16;`.
- Method `addToInventory(Item item)`: Adds to inventory if length < 16. Returns success boolean.
- Method `equip(Item item)`: Moves item from `inventory` to `equipment`.
- Method `unequip(Item item)`: Moves item from `equipment` to `inventory` (check space first).
## 2. `lib/providers/battle_provider.dart` (Update)
**Changes:**
- `selectReward(Item item)`: Now calls `player.addToInventory(item)`.
- If false (full), add a log "Inventory is full! Item discarded.".
- Add `equipItem(Item item)`: Calls player logic and notifies listeners.
- Add `unequipItem(Item item)`: Calls player logic and notifies listeners.
## 3. `lib/screens/inventory_screen.dart` (Update)
**Layout:**
- **Top (Stats):** Keep existing stat display.
- **Middle (Equipped):** "Currently Equipped" Label -> `ListView` (horizontal or vertical, compact). OnTap -> `provider.unequipItem`.
- **Bottom (Inventory):** "Bag (X/16)" Label -> `GridView.builder` with `itemCount: 16`.
- Loop 0 to 15.
- If index < `player.inventory.length`, render the Item Tile (Tap to `equipItem`).
- Else, render an Empty Slot (Grey container with border).
---
# Output Format
Please provide the complete code for the 3 modified files.
+65
View File
@@ -0,0 +1,65 @@
# Role
You are a Senior Flutter Developer working on "Colosseum's Choice".
You need to refactor the **Equipment System** to enforce **Slot-based restrictions**.
# Current Problem
Currently, `equipment` is a `List<Item>`, allowing the player to equip multiple weapons or armors simultaneously.
# Solution
Refactor the code to use an `Enum` based Map system: `Map<EquipmentSlot, Item>`.
- **Slots:** `weapon`, `armor`, `accessory`.
- **Rule:** Only one item per slot. Equipping a new item into an occupied slot should **SWAP** them (Old item goes to Inventory, New item goes to Equipment).
# Required Changes
Please generate the updated code for the following files.
---
## 1. `lib/models/item.dart` (Update)
- **Enum:** Create `enum EquipmentSlot { weapon, armor, accessory }`.
- **Class:** Add `final EquipmentSlot slot;` to the `Item` class.
- **Constructor:** Update to require `slot`.
- **Helper:** Add a getter `String get typeName` (returns "Weapon", "Armor", etc. based on enum).
## 2. `lib/models/character.dart` (Update)
- **Field Change:** Change `List<Item> equipment` to `Map<EquipmentSlot, Item> equipment = {};`.
- **Stat Logic:** Update `totalAtk` / `totalMaxHp` to iterate over `equipment.values`.
- **Method `equip(Item newItem)`:**
1. Check `newItem.slot`.
2. If `equipment[newItem.slot]` exists:
- Move the _existing_ item to `inventory`.
3. Remove `newItem` from `inventory`.
4. Set `equipment[newItem.slot] = newItem`.
- **Method `unequip(Item item)`:**
1. Check if inventory has space.
2. Remove from `equipment`.
3. Add to `inventory`.
## 3. `lib/providers/battle_provider.dart` (Update)
- **Item Generation (`_onVictory`):**
- When generating random items, assign appropriate slots.
- Example: "Sword" -> `EquipmentSlot.weapon`, "Plate" -> `EquipmentSlot.armor`.
- **Equip Logic:** `equipItem` now just calls `player.equip(item)` (Swap logic is inside Character).
## 4. `lib/screens/inventory_screen.dart` (Update)
- **Equipped Area (UI Change):**
- Instead of a ListView, create a **Row with 3 fixed Cards** (Weapon / Armor / Accessory).
- **Loop:** Iterate through `EquipmentSlot.values`.
- **Content:**
- If `player.equipment[slot]` exists: Show Item Icon & Name. Tap to Unequip.
- If null: Show "Empty [Slot Name]" placeholder.
---
# Output Format
Please provide the complete code for the 4 modified files.
+38
View File
@@ -0,0 +1,38 @@
# Role
You are a Senior Flutter Developer working on "Colosseum's Choice".
You need to fix a critical bug in the **HP Calculation Logic** within the `Character` model.
# Problem
1. **Sudden Death:** Unequipping an item subtracts the HP bonus from Current HP. If Current HP is low, the player dies instantly.
2. **Accidental Revive:** Equipping an item adds the HP bonus to Current HP. If the player is dead (0 HP), this revives them.
# Solution
1. **Unequip Logic:** Do NOT subtract the bonus. Instead, check if `Current HP > New Total Max HP`. If so, set `Current HP = New Total Max HP`. (Clamp logic).
2. **Equip Logic:** Only add the HP bonus to Current HP if the player is **Alive** (`hp > 0`).
# Required Changes
Please generate the updated code for the following file.
---
## 1. `lib/models/character.dart` (Fix)
**Methods to Update:**
- `equip(Item item)`:
- Handle swapping (unequip old item first).
- Add new item to `equipment`.
- **Fix:** Only execute `hp += item.hpBonus` if `hp > 0` (Player is alive).
- `unequip(Item item)`:
- Remove item from `equipment`.
- **Fix:** Do NOT do `hp -= hpBonus`. Instead, calculate `totalMaxHp` (which uses the updated equipment list) and ensure `hp` does not exceed it (`if (hp > totalMaxHp) hp = totalMaxHp;`).
---
# Output Format
Please provide the complete code for `lib/models/character.dart`.
+51
View File
@@ -0,0 +1,51 @@
# Role
You are a Senior Flutter Developer working on "Colosseum's Choice".
You need to implement a **Stage Recovery System** and a **Global Math Utility**.
# Goals
1. **Global Math Utility:** Create a central place to handle math logic (specifically "flooring" values) to be used across the game for consistency.
2. **Stage Recovery:** When a player clears a stage (selects a reward), heal the player for **50% of their Total Max HP** (rounded down).
3. **Character Logic:** Ensure the `Character` class has a proper `heal` method that respects `maxHp`.
# Required Changes
Please generate the code for the following files.
---
## 1. `lib/utils/game_math.dart` (New File)
**Description:** A static utility class for game calculations.
**Methods:**
- `static int floor(double value)`: Returns the integer part of the value (rounds down). Use this for all percentage-based calculations in the game.
## 2. `lib/models/character.dart` (Update)
**Description:** Add healing capability.
**Methods:**
- `void heal(int amount)`:
- Add `amount` to `hp`.
- Clamp `hp` so it does not exceed `totalMaxHp`.
- **Important:** Only allow healing if `hp > 0` (Dead characters cannot be healed).
## 3. `lib/providers/battle_provider.dart` (Update)
**Description:** Implement the healing logic upon stage completion.
**Methods:**
- `selectReward(Item item)`:
- (Existing logic: Add item to inventory, increase stage...).
- **New Logic:**
1. Calculate heal amount: `GameMath.floor(player.totalMaxHp * 0.5)`.
2. Call `player.heal(healAmount)`.
3. Add a log message: "Stage Cleared! Recovered $healAmount HP.".
---
# Output Format
Please provide the complete code for `lib/utils/game_math.dart` and the updated `character.dart`, `battle_provider.dart`.
+21
View File
@@ -0,0 +1,21 @@
# 장비 착용/해제 시 HP 처리 로직 수정
## 현재 상황 및 문제점
현재 시스템에서는 방어구나 장신구 등 최대 체력(Max HP)을 올려주는 장비를 착용하거나 해제할 때, 체력 처리 방식에 따라 예상치 못한 동작(예: 체력 회복 꼼수 등)이 발생할 수 있습니다.
## 요청 사항
장비를 착용하거나 해제할 때, **최대 체력(Max HP)의 변동에 관계없이 현재 체력(Current HP)의 퍼센트(%) 비율을 유지**하도록 로직을 수정해주세요.
### 구체적인 요구조건
1. **장비 변경 전 현재 HP 비율 계산:** 장비 착용/해제 전에 `Current HP / Max HP` 비율을 계산합니다.
2. **장비 변경 후 HP 적용:** 장비 변경(Max HP 변화)이 발생한 후, 이전에 계산한 HP 비율을 새로운 `Max HP`에 적용하여 `Current HP`를 설정합니다.
* 예시: 현재 50/100 (50%) -> 장비 착용으로 Max HP가 150이 되면, Current HP는 75 (150의 50%)로 조정됩니다.
* 예시: 현재 150/150 (100%) -> 장비 해제로 Max HP가 100이 되면, Current HP는 100 (100의 100%)으로 조정됩니다.
3. **최소값 및 최대값 보정:** `Current HP`는 항상 0보다 크거나 같아야 하며, 새로운 `Max HP`를 초과할 수 없습니다.
## 목표
- 장비 변경 시 `Current HP``Max HP`의 비율에 맞춰 일관성 있게 변화하도록 합니다.
## 참고 코드
- `lib/game/model/entity.dart` (Character 클래스 내 장비 착용/해제 로직)
- `lib/providers/battle_provider.dart` (장비 장착/해제 액션 처리)
+36
View File
@@ -0,0 +1,36 @@
# 전투 UI 개선 및 장비 변경 UX 강화
## 목표
전투 화면에서의 사용자 선택에 대한 정보를 명확히 제공하고, 인벤토리에서 장비 변경 시 사용자의 실수를 방지하며 변경 사항을 미리 확인할 수 있도록 UX를 개선합니다.
## 요청 사항
### 1. 전투 행동 UI 개선 (공격/방어 확률 및 예상 수치 명시)
현재 전투 화면에서 공격(Attack) 및 방어(Defend) 버튼을 누를 때 나타나는 리스크 수준(Safe, Normal, Risky)에 대한 성공 확률과 효율 정보뿐만 아니라, **실제 적용될 예상 수치**를 함께 표시해주세요.
- **변경 전:** 단순히 버튼만 존재하거나 텍스트로만 표시됨.
- **변경 후:** 각 행동 선택지 옆이나 하단에 구체적인 확률과 **예상 데미지/방어량**을 명시합니다.
- **Safe:** 성공률 100%, 효율 50% (예: 데미지 5)
- **Normal:** 성공률 80%, 효율 100% (예: 데미지 10)
- **Risky:** 성공률 40%, 효율 200% (예: 데미지 20)
- **계산식:** `Player Total ATK * Efficiency`
- 사용자가 선택하기 전에 자신이 입힐 데미지나 얻을 방어도가 얼마인지 직관적으로 알 수 있어야 합니다.
### 2. 장비 변경/해제 Preview 및 확인 절차 추가
인벤토리에서 장비를 **장착(교체)**하거나 **해제(Unequip)**할 때, 변경되는 스탯 정보를 미리 보여주고 사용자에게 최종 확인을 받는 팝업을 구현해주세요.
- **동작 흐름:**
1. 인벤토리의 아이템을 선택(장착 시도)하거나 장착된 슬롯을 선택(해제 시도).
2. **"장비 변경 확인" 팝업**이 표시됨.
3. 팝업 내용:
- **변경 전 스탯:** 현재 공격력(ATK), 체력(HP/MaxHP), 방어력(Armor) 등
- **변경 후 스탯:** 장비 교체/해제 시 예상되는 공격력, 체력, 방어력
- **스탯 변화량:** 상승(초록색), 하락(빨간색) 등으로 시각적 차별화 권장
- **Current HP 예측:** 장비 변경 전후 HP 퍼센트 유지 로직 적용
4. **"변경하시겠습니까?"** (또는 "해제하시겠습니까?") 문구와 함께 [확인] / [취소] 버튼 제공.
5. [확인] 클릭 시 장비 교체 또는 해제 로직 실행.
## 관련 파일
- `lib/screens/battle_screen.dart`: 전투 UI, 예상 데미지/방어량 계산 및 표시
- `lib/screens/inventory_screen.dart`: 인벤토리 UI, 장착 및 해제 시 스탯 프리뷰 팝업
- `lib/providers/battle_provider.dart`: 전투 로직 및 확률 데이터 참조
@@ -0,0 +1,34 @@
# 방패 아이템 추가 및 방어 메커니즘 개편
## 목표
게임에 '방패(Shield)' 장비 슬롯을 추가하고, 전투 중 '방어(Defend)' 행동의 효율 계산 방식을 공격력(ATK) 기반에서 방어력(Armor) 기반으로 변경합니다.
## 요청 사항
### 1. 장비 슬롯 및 아이템 속성 확장
- **EquipmentSlot 추가:** `shield` 슬롯을 추가합니다. (기존: weapon, armor, accessory)
- **Item 속성 추가:** 아이템에 물리적 방어력을 나타내는 `armorBonus` 속성을 추가합니다.
- 방패(Shield)와 갑옷(Armor) 아이템은 주로 `armorBonus`를 제공해야 합니다.
- 기존 갑옷(Armor) 아이템이 MaxHP를 올려주던 컨셉을 유지할지, 방어력으로 변경할지 결정이 필요하나, 요청에 따라 **방패는 Armor 포인트**를 올려주는 역할을 합니다.
### 2. 캐릭터 스탯 로직 변경
- **Total Armor 계산:** 캐릭터의 총 방어력(`totalArmor`)은 `기본 방어력 + 장착 아이템의 armorBonus 합계`로 계산됩니다.
- **기본 스탯:** 캐릭터 생성 시 적절한 기본 방어력(Base Armor)을 부여하거나 0으로 시작합니다.
### 3. 전투 시스템 (방어 행동) 변경
- **Defend 메커니즘 수정:**
- 기존: `Armor Gained = Total ATK * Efficiency`
- **변경:** `Armor Gained = Total Armor * Efficiency`
- 즉, 방어력이 높을수록 방어 행동(Defend) 시 더 단단한 일시적 보호막(Temporary Armor)을 얻게 됩니다.
- *주의:* `totalArmor`가 0이면 방어 행동의 효과가 0이 되므로, 최소한의 기본 방어력을 보장하거나 로직을 조정해야 합니다.
### 4. UI 및 아이템 생성 로직 업데이트
- **인벤토리 화면:** 방패 슬롯을 UI에 표시하고, 아이콘을 지정합니다.
- **보상 시스템:** 전투 승리 보상 목록에 '방패'가 등장하도록 추가합니다.
- **스탯 프리뷰:** 장비 교체 팝업 등에서 `Armor` 스탯의 변화도 보여주어야 합니다.
## 관련 파일
- `lib/game/model/item.dart`: `EquipmentSlot`, `Item` 필드 수정
- `lib/game/model/entity.dart`: `totalArmor` getter 추가 및 관련 로직
- `lib/providers/battle_provider.dart`: `defend` 로직 수정, 방패 드랍 로직 추가
- `lib/screens/inventory_screen.dart`: UI 업데이트
+44
View File
@@ -0,0 +1,44 @@
# 아이템 테이블 구축 및 보상 시스템 개편
## 목표
하드코딩된 랜덤 아이템 생성 로직을 제거하고, 사전에 정의된 **아이템 드랍 테이블(Item Drop Table)**을 기반으로 보상을 생성하도록 시스템을 개편합니다. 또한, 게임 시작 시 기본 장비 지급 로직을 공식화합니다.
## 요청 사항
### 1. 아이템 데이터 테이블 생성
부위별로 다양한 아이템의 이름과 스탯 옵션을 정의하는 데이터 구조(List 또는 Map)를 만들어주세요.
각 아이템은 고정된 이름과 기본 스탯 범위를 가지거나, 티어별로 구분될 수 있습니다.
**예시 데이터 구조 (개념):**
* **Weapons:**
* "Rusty Sword" (ATK +3)
* "Iron Sword" (ATK +8)
* "Steel Claymore" (ATK +15)
* **Armors:**
* "Tattered Shirt" (HP +10)
* "Leather Vest" (HP +30)
* "Chainmail" (HP +60)
* **Shields:**
* "Wooden Lid" (DEF +2)
* "Round Shield" (DEF +5)
* "Tower Shield" (DEF +10)
* **Accessories:**
* "Old Ring" (ATK +1, HP +5)
* "Ruby Ring" (ATK +5, HP +10)
### 2. 스테이지 보상 로직 변경
- **기존:** `Random`으로 이름과 수치를 즉석에서 생성.
- **변경:**
1. 정의된 **아이템 테이블**에서 3개의 아이템을 무작위로 선택합니다. (중복 방지 권장)
2. 스테이지가 높아질수록 더 좋은 아이템이 나올 확률을 높이거나, 테이블 자체가 스테이지별로 나뉘어 있다면 해당 스테이지 그룹에서 선택합니다. (단순하게는 전체 풀에서 랜덤 선택하되, 스탯에 `stage` 변수를 약간 반영하여 강화된 상태로 드랍되게 할 수도 있습니다.)
### 3. 초기 장비 지급 (이미 적용됨, 확인 차원)
- 게임 시작(`initializeBattle`) 시, 플레이어에게 다음 기본 장비 세트를 지급하고 자동 장착시킵니다.
- **Weapon:** Wooden Sword (ATK+5)
- **Armor:** Leather Armor (HP+20)
- **Shield:** Wooden Shield (DEF+3)
- **Accessory:** Copper Ring (ATK+1, HP+5)
## 관련 파일
- `lib/game/data/item_table.dart` (새로 생성 필요: 아이템 데이터 관리)
- `lib/providers/battle_provider.dart` (보상 생성 로직 수정)
+31
View File
@@ -0,0 +1,31 @@
# 아이템 선택 및 인벤토리 UI에 상세 옵션 표시
## 목표
업그레이드된 아이템 시스템에 맞춰, 아이템의 이름뿐만 아니라 해당 아이템이 제공하는 실제 스탯 보너스(공격력, 최대 체력, 방어력 등)를 사용자 인터페이스에 명확하게 표시하여 사용자가 아이템의 가치를 쉽게 파악할 수 있도록 합니다.
## 요청 사항
### 1. 아이템 선택창 (보상 팝업) 상세 옵션 표시
스테이지 클리어 후 보상 아이템을 선택하는 팝업(`SimpleDialog``SimpleDialogOption`)에 각 아이템의 이름과 설명 외에, 해당 아이템이 부여하는 **ATK 보너스, MaxHP 보너스, DEF 보너스**를 명확하게 표시해주세요.
- **표시 형식 예시:**
- "Iron Sword (+8 ATK)"
- "Leather Vest (+30 MaxHP)"
- "Wooden Shield (+3 DEF)"
- "Ruby Amulet (+3 ATK, +15 MaxHP)"
- 아이템의 description에 이 정보가 이미 포함되어 있더라도, 스탯 정보는 별도로 강조하여 시각적으로 쉽게 구분되도록 해주세요.
### 2. 인벤토리 UI (장착된 아이템 및 가방) 상세 옵션 표시
인벤토리 화면에서 장착된 아이템과 가방(인벤토리)에 있는 아이템 모두에 대해 상세 옵션을 표시해주세요.
- **장착된 아이템:** 각 슬롯에 장착된 아이템의 이름 아래에 해당 아이템이 부여하는 **ATK 보너스, MaxHP 보너스, DEF 보너스**를 표시합니다.
- **가방 아이템:** `GridView`로 표시되는 각 아이템 카드에 이름 아래에 **ATK 보너스, MaxHP 보너스, DEF 보너스**를 표시합니다.
- **표시 형식 예시:** (아이템 선택창과 유사하게)
- "Iron Sword"
- "+8 ATK"
- "Leather Vest"
- "+30 MaxHP"
- 스탯이 0인 경우(예: ATK 보너스만 있는 아이템의 HP 보너스)는 표시하지 않거나, "N/A" 등으로 표시할 수 있습니다. (표시하지 않는 것을 권장)
## 관련 파일
- `lib/screens/battle_screen.dart` (아이템 선택창/보상 팝업)
- `lib/screens/inventory_screen.dart` (인벤토리 및 장착 아이템 UI)
- `lib/game/model/item.dart` (Item 객체의 속성 참조)