tennis scoring -> str8 b05
This commit is contained in:
parent
948c62f9ef
commit
f04d179023
@ -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 (
|
||||
|
||||
@ -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};
|
||||
|
||||
@ -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 |
|
||||
|
||||
@ -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);*/
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user