From 443b3bb3ace7d057f4261de061a009f50be0ee41 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 20 Dec 2019 12:59:10 +1000 Subject: [PATCH 1/3] hide hidden effects in removal --- core/fixme.md | 2 -- core/src/construct.rs | 17 +++++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/fixme.md b/core/fixme.md index b428dc28..8264dee4 100644 --- a/core/fixme.md +++ b/core/fixme.md @@ -1,5 +1,3 @@ # FIXME game ready not auto starting resolve phase - -slay animation still looks a bit weird triaged / decayed / siphoned / electrocute effect removal with purify / purge diff --git a/core/src/construct.rs b/core/src/construct.rs index 1533c618..70cf308c 100644 --- a/core/src/construct.rs +++ b/core/src/construct.rs @@ -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; From 69c964510c0cdc181298e51a08642d6d6f0c5d4a Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 20 Dec 2019 13:11:44 +1000 Subject: [PATCH 2/3] always go to logrocket --- client/src/app.jsx | 4 ++++ client/src/events.jsx | 11 +++++------ core/fixme.md | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/src/app.jsx b/client/src/app.jsx index 1599c1ab..47a08e62 100644 --- a/client/src/app.jsx +++ b/client/src/app.jsx @@ -33,6 +33,10 @@ const ws = createSocket(events); ws.connect(); events.setWs(ws); +if (process.env.NODE_ENV !== 'development') { + LogRocket.init('yh0dy3/mnml'); +} + const App = () => ( {window.Stripe diff --git a/client/src/events.jsx b/client/src/events.jsx index ead1e49c..fa048f29 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -106,13 +106,12 @@ function registerEvents(store) { } function setAccount(account) { - if (account && process.env.NODE_ENV !== 'development') { - LogRocket.init('yh0dy3/mnml'); - LogRocket.identify(account.id, account); + if (account && window.Notification) { + window.Notification.requestPermission(); + } - if (window.Notification) { - window.Notification.requestPermission(); - } + if (process.env.NODE_ENV !== 'development') { + LogRocket.identify(account.id, account); } store.dispatch(actions.setAccount(account)); diff --git a/core/fixme.md b/core/fixme.md index 8264dee4..c3f3a70d 100644 --- a/core/fixme.md +++ b/core/fixme.md @@ -1,3 +1,2 @@ # FIXME game ready not auto starting resolve phase -triaged / decayed / siphoned / electrocute effect removal with purify / purge From b36b9553d06f739d30e2609feb13a663ae621fee Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 20 Dec 2019 13:15:40 +1000 Subject: [PATCH 3/3] cannot clear skills while ready --- core/src/game.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/game.rs b/core/src/game.rs index a729d4d0..de968301 100644 --- a/core/src/game.rs +++ b/core/src/game.rs @@ -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")); } @@ -2058,7 +2062,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, }));