Feat: create battle system implementation#156
Merged
coxmars merged 1 commit intoAkatsukiLabs:mainfrom Jun 29, 2025
Merged
Conversation
Contributor
Author
|
Hi @coxmars, PR ready for review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create Battle System Implementation
📝 Summary
This PR implements a complete Battle system to handle battle creation, attack processing, turn management, and battle resolution. The implementation includes proper interface definition, comprehensive validation, achievement integration, and a full test suite.
Related Issues
Type of Change
🔄 Changes Made
New Battle System: Complete implementation of
IBattleinterface with four core methods:create_battle()- Creates battles between players with validationjoin_battle()- Activates waiting battles when both players are readyattack()- Processes turn-based combat using existing store logicend_battle()- Manually ends battles with winner declarationBattle Lifecycle Management: Proper state transitions (Waiting → Active → Finished).
Achievement Integration: Automatic progression of battle-related achievements (FirstBlood, Warrior, Veteran, Champion, Legend).
Event System: Comprehensive event emission for battle tracking
Comprehensive Test Suite: 13 tests covering all functionality and edge cases
Version Alignment: Updated
.tool-versionsdojo version from 1.1.1 to 1.2.1 to matchScarb.tomlspecificationImplementation Details
System Architecture:
StoreTraitfor all model interactions (battles, players, beasts)process_attack()method for combat logicKey Features:
assert_exists()patternAchievement System:
progress_achievements()functionTechnical Notes
🔧 Tests Results
Test Coverage
Evidence
Testing Notes
🔜 Next Steps