3.5 KiB
3.5 KiB
Bleeding Logic and Item Selling Fixes
1. Magic Item Prefix Chance
- Issue: Users felt that magic items often lacked prefixes, making them indistinguishable from normal items in terms of stats.
- Fix: Increased
ItemConfig.magicPrefixChancefrom0.5(50%) to1.0(100%). Now, all items generated withItemRarity.magicwill guaranteed have a prefix (and associated stat boost).
2. Enemy Bleed Damage Bug
- Issue: Enemies were applying bleed to players, but when enemies themselves were bleeding, they took no damage at the start of their turn.
- Fix: Updated
BattleProvider._startEnemyTurnto properly call_processStartTurnEffects(enemy). This ensures that bleed damage is calculated and applied to the enemy's HP, and stun status is checked correctly.
3. Item Selling Price UI
- Issue: The "Sell Item" confirmation dialog displayed the item's base price instead of the actual selling price (which is 60% of base). This confused players into thinking they were getting full price, or that the system was broken when they received less gold.
- Fix: Updated
InventoryGridWidget(_showItemActionDialogand_showSellConfirmationDialog) to calculate and display the final sell price:floor(item.price * GameConfig.sellPriceMultiplier).
4. Bleed Application Logic
- Issue: Bleed status was being applied even when an attack was fully blocked by armor (0 HP damage).
- Change: Modified
BattleProvider._tryApplyStatusEffectsand its call site in_processAttackImpact. - New Logic: Bleed status is now only applied if
damageToHp > 0. If an attack is fully absorbed by armor, bleed will not be applied. - Note: Once applied, bleed damage (at start of turn) continues to ignore armor and directly reduces HP, regardless of how much armor the target gains afterwards.
5. Dynamic Attack Animation Images
- Feature: Added support for changing character images during attack animation phases (Start, Middle, End).
- Implementation:
- Modified
BattleAnimationWidgetto accept callbacks foronAnimationStart,onAnimationMiddle, andonAnimationEnd. - Updated
BattleScreento manage animation phase state and pass override images toCharacterStatusCard. - Configured phase logic:
- Risky: Start -> ScaleUp -> Middle -> Dash -> End -> Impact.
- Safe/Normal: Start -> Middle -> Impact (No End phase).
- Modified
- Assets: Applied
warrior_attack_1.pngfor Start andwarrior_attack_2.pngfor End phases.
6. Story Screen & Navigation
- Feature: Added a
StoryScreensequence after character selection and before the main game. - Details: 3-page PageView with "Next" and "Skip" buttons. Uses
ResponsiveContainerand consistent styling. - Navigation:
CharacterSelectionScreen->StoryScreen->MainWrapper.
7. Player Image & UI Fixes
- Fix: Corrected
PlayerTemplate.createCharacterto pass the image path properly. - Fix: Added logic in
BattleProvider.loadFromSaveto force update the player's image path from the latest data, fixing issues with old save files. - Refactor: Extracted hardcoded UI constants in
CharacterStatusCardtoThemeConfig.
Files Changed
lib/game/config/item_config.dartlib/providers/battle_provider.dartlib/widgets/inventory/inventory_grid_widget.dartlib/screens/battle_screen.dartlib/widgets/battle/battle_animation_widget.dartlib/widgets/battle/character_status_card.dartlib/screens/story_screen.dartlib/game/data/player_table.dartlib/game/config/theme_config.dart