-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit army #1141
Limit army #1141
Conversation
credence0x
commented
Jul 26, 2024
- limit armies a realm can have
- combat bug fixes
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request implements a limit on the number of armies a realm can have, based on the number of military buildings. It also includes some combat bug fixes and improvements. The changes look well-thought-out and properly implemented. The new army limit feature is a good addition that adds strategic depth to the game. The bug fixes, especially in the battle health calculation, should improve the overall stability of the combat system.
Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!
@@ -447,9 +453,33 @@ mod combat_systems { | |||
army_id | |||
} | |||
|
|||
fn army_delete(ref world: IWorldDispatcher, army_id: u128) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good implementation of the army deletion function. It checks important conditions like ensuring the army is dead and not a defensive army before deletion.
@@ -1203,8 +1239,44 @@ mod combat_systems { | |||
fn create_base_army( | |||
world: IWorldDispatcher, army_owner_id: u128, owner_address: starknet::ContractAddress | |||
) -> u128 { | |||
let mut army_id: u128 = world.uuid().into(); | |||
// ensure army owner is a structure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The army creation logic now includes checks for military buildings and enforces limits based on the TroopConfig. This is a good way to implement the new army limit feature.
@@ -1242,6 +1314,68 @@ mod combat_systems { | |||
set!(world, (army_quantity)); | |||
} | |||
|
|||
fn delete_army(world: IWorldDispatcher, ref entity_owner: EntityOwner, ref army: Army) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The delete_army function is well implemented, properly cleaning up all related components and decrementing the army count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* contract: limit armies and enable deletion * contracts: delete army if merging kills troop * contracts: bug fixes from v1 branch * update test
* Beginning of changes to UI/UX for battles * Heavily modify battle systems * Build and prettier * Create util function to get percentage of remaining troops in battle * Rename resources function * Limit army (#1141) * contract: limit armies and enable deletion * contracts: delete army if merging kills troop * contracts: bug fixes from v1 branch * update test * remove tooltip library * Add function to delete armies and limit number of armies in UI * prettier + remove unused imports * address PR comments * Fix "ennemy" typo * Remove biome and add hintmodal in entity details panel * Remove bigint casts * Change sdk values back * Fix small bugs in battleview + fix deposit of resources on structure in battle + small optimizations * prettier * Changes to army limit contracts/UI + way of selecting army in entity details * Change ArmyQuantityTracker to AttackingArmyQuantityTracker --------- Co-authored-by: Credence <[email protected]>