Skip to content

Commit

Permalink
modify ifs (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzn authored Nov 4, 2024
1 parent fbb3be6 commit 53921f3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/models/status/round/beast.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ impl BeastImpl of BeastTrait {
_ => Option::None
}.unwrap();
IRageSystemDispatcher { contract_address: rage_system_address.try_into().unwrap() }.calculate(game.id);
// create_level(world, ref store, game); TODO:
} else if player_beast.energy.is_zero() {
_attack_beast(world, ref store, ref game, ref player_beast, ref beast, ref game_mode_beast);
} else {
let mut cards = array![];
let mut idx = 0;
Expand Down Expand Up @@ -152,6 +149,9 @@ impl BeastImpl of BeastTrait {
}
}
store.set_game(game);
if player_beast.energy.is_zero() && game.substate != GameSubState::CREATE_REWARD {
Self::end_turn(world, game_id);
}
}

fn discard(world: IWorldDispatcher, game_id: u32, cards_index: Array<u32>, modifiers_index: Array<u32>) {
Expand Down Expand Up @@ -207,8 +207,7 @@ impl BeastImpl of BeastTrait {
}

if player_beast.energy.is_zero() {
let mut beast = BeastStore::get(world, game.id);
_attack_beast(world, ref store, ref game, ref player_beast, ref beast, ref game_mode_beast);
Self::end_turn(world, game_id);
}
}

Expand Down

0 comments on commit 53921f3

Please sign in to comment.