Merge branch 'release/1.11.0' of ssh://git.mnml.gg:40022/~/mnml into release/1.11.0

This commit is contained in:
Mashy
2019-12-20 13:40:32 +10:00
5 changed files with 26 additions and 17 deletions
+11 -6
View File
@@ -950,7 +950,10 @@ impl Construct {
if self.is_ko() { return vec![Event::TargetKo { construct: self.id }] }
if let Some(p) = self.effects.iter().position(|ce| ce.effect == effect) {
self.effects.remove(p);
let ce = self.effects.remove(p);
if ce.effect.hidden() { return vec![] }
return vec![Event::Removal {
construct: self.id,
effect: effect,
@@ -986,11 +989,13 @@ impl Construct {
if self.is_ko() { return vec![Event::TargetKo { construct: self.id }] }
while let Some(ce) = self.effects.pop() {
removals.push(Event::Removal {
construct: self.id,
effect: ce.effect,
display: EventConstruct::new(self),
});
if !ce.effect.hidden() {
removals.push(Event::Removal {
construct: self.id,
effect: ce.effect,
display: EventConstruct::new(self),
});
}
}
return removals;
+6 -2
View File
@@ -336,7 +336,11 @@ impl Game {
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 {
return Err(err_msg("game not in skill phase"));
}
@@ -2060,7 +2064,7 @@ mod tests {
let resolutions = &game.resolutions[last];
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,
_ => false,
}));