Skip to content

Commit

Permalink
Update:fixed bugs for mult-turns battle
Browse files Browse the repository at this point in the history
  • Loading branch information
LidamaoHub committed Oct 25, 2023
1 parent 132ac4d commit 92ce78c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/contracts/src/systems/BattleSystem.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ contract BattleSystem is System {
uint256 defenderFirepower = Player.getAttack(battle.defender);
Buff attackerBuff = Buff(battle.defenderArg);
Buff defenderBuff = Buff(battle.defenderArg);

if (battle.attackerAction == bytes32("attack") && battle.defenderAction == bytes32("attack")) {
allAttack(_battleId, battle, attackerBuff, defenderBuff, attackerFirepower, defenderFirepower);
} else if (battle.attackerAction == bytes32("escape") && battle.defenderAction == bytes32("escape")) {
Expand All @@ -68,6 +67,10 @@ contract BattleSystem is System {
if (!battle.isEnd) {
console.log(" round end ");
emit BattleEnd(_battleId, BattleEndType.RoundEnd, address(0));
BattleList.setDefenderState(_battleId, BattleState.Inited);
BattleList.setAttackerState(_battleId, BattleState.Inited);


} else {
// set explore state
Player.setState(battle.attacker, PlayerState.Exploring);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/worlds.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"blockNumber": 27950347
},
"31337": {
"address": "0x4C4a2f8c81640e47606d3fd77B353E87Ba015584"
"address": "0x0b27a79cb9C0B38eE06Ca3d94DAA68e0Ed17F953"
},
"421613": {
"address": "0x2Bc1034975c3df48D6f3026802f372677844b85d",
Expand Down

0 comments on commit 92ce78c

Please sign in to comment.