cannot clear skills while ready
This commit is contained in:
parent
69c964510c
commit
b36b9553d0
@ -336,7 +336,11 @@ impl Game {
|
|||||||
|
|
||||||
|
|
||||||
pub fn clear_skill(&mut self, player_id: Uuid) -> Result<&mut Game, Error> {
|
pub fn clear_skill(&mut self, player_id: Uuid) -> Result<&mut Game, Error> {
|
||||||
self.player_by_id(player_id)?;
|
let player = self.player_by_id(player_id)?;
|
||||||
|
if player.ready {
|
||||||
|
return Err(err_msg("cannot clear skills while ready"));
|
||||||
|
}
|
||||||
|
|
||||||
if self.phase != Phase::Skill {
|
if self.phase != Phase::Skill {
|
||||||
return Err(err_msg("game not in skill phase"));
|
return Err(err_msg("game not in skill phase"));
|
||||||
}
|
}
|
||||||
@ -2058,7 +2062,7 @@ mod tests {
|
|||||||
let resolutions = &game.resolutions[last];
|
let resolutions = &game.resolutions[last];
|
||||||
|
|
||||||
assert!(resolutions.iter().any(|r| match r.event {
|
assert!(resolutions.iter().any(|r| match r.event {
|
||||||
Event::Damage { construct, colour, amount, mitigation: _, display: _ } =>
|
Event::Damage { construct, colour, amount, mitigation: _, display: _ } =>
|
||||||
construct == target && amount == 320.pct(50) && colour == Colour::Blue,
|
construct == target && amount == 320.pct(50) && colour == Colour::Blue,
|
||||||
_ => false,
|
_ => false,
|
||||||
}));
|
}));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user