-
Notifications
You must be signed in to change notification settings - Fork 31
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
Implement the attack logic #26 #57
base: main
Are you sure you want to change the base?
Conversation
I have implemented the beginning of the contract as well as the attack logic tests but the implementation of the attack requires the modification of the component file as well as the implementation of the card deck system in order to verify the lenght of the players' hand.
I have implemented the beginning of the contract as well as the attack logic tests but the implementation of the attack requires the modification of the component file as well as the implementation of the card deck system in order to verify the lenght of the players' hand.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Fix error in test Attack , also finished the implementation of the create_card system , and i added some comment to the code
Attack_system update with the place_card logic. When the card has been dribbled, we remove the card from the field according to its position If the Attacker has not dribbled the opposing card , we remove the Attacker from the field + end of the turn. Added the review change.
Review Implemented. Attack_system/test update with the place_card logic . When the card has been dribbled, we remove the card from the field according to its position If the Attacker has not dribbled the opposing card , we remove the Attacker from the field + end of the turn. |
/// * `ctx` - Dojo context. | ||
/// * `game_id` - The current game_id. | ||
/// * `card_id_player1` - The token id of the card placed. | ||
/// * `card_id_player2` - The token id of the card placed. |
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.
/// * `ctx` - Dojo context. | |
/// * `game_id` - The current game_id. | |
/// * `card_id_player1` - The token id of the card placed. | |
/// * `card_id_player2` - The token id of the card placed. | |
/// Description of the function | |
/// | |
/// # Arguments | |
/// | |
/// * `ctx` - Dojo context. | |
/// * `game_id` - The current game_id. | |
/// * `card_id_player1` - The token id of the card placed. | |
/// * `card_id_player2` - The token id of the card placed. |
contracts/src/systems/attack.cairo
Outdated
match card_player1.role { | ||
Roles::Goalkeeper => value = 0, | ||
Roles::Defender => value = 0, | ||
Roles::Midfielder => value = 0, | ||
Roles::Attacker => value = 1, | ||
} |
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.
why are you doing that ?
contracts/src/systems/attack.cairo
Outdated
Roles::Attacker => value = 1, | ||
} | ||
|
||
if value == 1 { |
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 is not right, you should loop through all the players card, they'll all attack one by one starting from the Roles::Attacker
Sry wrong manipulation |
Hi, I thought attack_system contains updating the score of players when they score a goal. Current code seems not containing. Can you check? @WhoIsNac @LucasLvy |
added attack logic , but can't remove the player placement
@WhoIsNac is attempting to deploy a commit to the keep-starknet-strange Team on Vercel. A member of the Team first needs to authorize it. |
attack _system
✅ We check if the player is an Attacker
✅ If the attacker has more dribbling status than the defender, we reduce the attacker's defense by the defender dribble stats.
✅ Create_card system crated (only cost and role param missing)
✅ Attack_system update with the place_card logic.
✅ When the card has been dribbled, we remove the card from the field according to its position
✅If the Attacker has not dribbled the opposing card , we remove the Attacker from the field + end of the turn.
✅ Added 1st review change.
I started the attack logic and the contract and implemented the test, (I also created a card creation contract to do the test with the card stats).
But to finish the implementation, we need to finish the card logic system and also the place_card system to know each card in the field in order to start the attack sequence.
I've also created a create_card contract so that I can test attacks between two cards.
Fixes #26