From f04d17902367ca0824cbc326d594ab40356e46f4 Mon Sep 17 00:00:00 2001 From: Mashy Date: Thu, 19 Sep 2019 15:07:16 +1000 Subject: [PATCH] tennis scoring -> str8 b05 --- client/src/components/player.box.jsx | 9 +++++++++ client/src/components/welcome.jsx | 4 ++-- server/src/instance.rs | 4 ++-- server/src/item.rs | 5 +++-- server/src/player.rs | 27 ++++++++++++++++----------- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/client/src/components/player.box.jsx b/client/src/components/player.box.jsx index 4b626171..322dbdde 100644 --- a/client/src/components/player.box.jsx +++ b/client/src/components/player.box.jsx @@ -9,6 +9,14 @@ function Scoreboard(args) { leave, } = args; + const scoreText = () => { + if (player.score === 'Zero') return '▫▫▫'; + if (player.score === 'One') return '■▫▫'; + if (player.score === 'Two') return '■■▫'; + if (player.score === 'Win') return '■■■'; + return ''; + }; + /* let scoreText = () => { if (player.score === 'Zero') return '▫▫▫▫'; if (player.score === 'One') return '■▫▫▫'; @@ -18,6 +26,7 @@ function Scoreboard(args) { if (player.score === 'Win') return '■■■■'; return ''; }; + */ if (!isPlayer) { return ( diff --git a/client/src/components/welcome.jsx b/client/src/components/welcome.jsx index 16b899de..70bde16d 100644 --- a/client/src/components/welcome.jsx +++ b/client/src/components/welcome.jsx @@ -56,8 +56,8 @@ function Welcome() {

Turn-based 1v1 strategy game in an abstract setting.

Build a unique team of 3 constructs from a range of skills and specialisations.
- Outplay your opponent in multiple rounds by adapting to an always shifting meta.
- Simple rules, complex interactions and unique mechanics.
+ Outplay your opponent in multiple rounds by adapting to an always shifting meta.
+ Simple rules, complex interactions and unique mechanics.

Free to play, no pay to win. Register to start playing.
diff --git a/server/src/instance.rs b/server/src/instance.rs index 0d230dbf..22ad03e5 100644 --- a/server/src/instance.rs +++ b/server/src/instance.rs @@ -15,9 +15,9 @@ use chrono::Duration; use account::Account; use account; -use events::{EventsTx, Event}; + use player::{Player, Score, player_create}; -use construct::{Construct, construct_get}; + use mob::{bot_player, instance_mobs}; use game::{Game, Phase, game_get, game_write, game_update}; use item::{Item}; diff --git a/server/src/item.rs b/server/src/item.rs index 95284987..70f28f02 100644 --- a/server/src/item.rs +++ b/server/src/item.rs @@ -655,9 +655,10 @@ impl Item { Item::Banish| Item::BanishPlus | - Item::BanishPlusPlus => format!("Banish target for {:?}T. + Item::BanishPlusPlus => format!("Banish target for {:?}T. Deal blue damage and red damage equal to {:?}% target red and blue life. Banished constructs are immune to all skills and effects.", - self.into_skill().unwrap().effect()[0].get_duration()), + self.into_skill().unwrap().effect()[0].get_duration(), + self.into_skill().unwrap().multiplier()), Item::Blast| Item::BlastPlus | diff --git a/server/src/player.rs b/server/src/player.rs index f5711200..196585f9 100644 --- a/server/src/player.rs +++ b/server/src/player.rs @@ -27,24 +27,26 @@ pub enum Score { } impl Score { - pub fn add_win(self, opp: &Score) -> Score { + pub fn add_win(self, _opp: &Score) -> Score { match self { Score::Zero => Score::One, Score::One => Score::Two, - Score::Two => Score::Three, - Score::Three => match opp { - Score::Adv => Score::Three, - Score::Three => Score::Adv, - _ => Score::Win, - } - Score::Adv => Score::Win, + Score::Two => Score::Win, + // Tennis scoring + // Score::Three => match opp { + // Score::Adv => Score::Three, + // Score::Three => Score::Adv, + // _ => Score::Win, + // } + // Score::Adv => Score::Win, + _ => panic!("faulty score increment {:?}", self), } } pub fn add_loss(self) -> Score { match self { - Score::Adv => Score::Three, + // Score::Adv => Score::Three, _ => self, } } @@ -376,7 +378,10 @@ mod tests { player.score = player.score.add_win(&Score::Zero); player.score = player.score.add_win(&Score::Zero); player.score = player.score.add_win(&Score::Zero); - assert_eq!(player.score, Score::Three); // 40 / 0 + assert_eq!(player.score, Score::Win); // 40 / 0 + + // Bo7 tennis scoring + /*assert_eq!(player.score, Score::Three); // 40 / 0 player.score = player.score.add_loss(); // adv -> deuce assert_eq!(player.score, Score::Three); @@ -391,7 +396,7 @@ mod tests { assert_eq!(player.score, Score::Adv); player.score = player.score.add_win(&Score::Three); - assert_eq!(player.score, Score::Win); + assert_eq!(player.score, Score::Win);*/ } } \ No newline at end of file