status
This commit is contained in:
parent
39ca2a27dd
commit
5a6af0b786
27
src/main.rs
27
src/main.rs
@ -78,6 +78,7 @@ const ACTIONS: &'static [&'static str] = &[
|
|||||||
"front kicks",
|
"front kicks",
|
||||||
"stomps",
|
"stomps",
|
||||||
"packets",
|
"packets",
|
||||||
|
"casts hadoken at",
|
||||||
"sues",
|
"sues",
|
||||||
"hacks",
|
"hacks",
|
||||||
"doxes",
|
"doxes",
|
||||||
@ -90,7 +91,6 @@ const ACTIONS: &'static [&'static str] = &[
|
|||||||
];
|
];
|
||||||
|
|
||||||
const COLORS: &'static [&'static Color] = &[
|
const COLORS: &'static [&'static Color] = &[
|
||||||
&Color::Black,
|
|
||||||
&Color::Blue,
|
&Color::Blue,
|
||||||
&Color::Brown,
|
&Color::Brown,
|
||||||
&Color::Cyan,
|
&Color::Cyan,
|
||||||
@ -229,6 +229,10 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.add_system("f", new_fight)
|
.add_system("f", new_fight)
|
||||||
.await
|
.await
|
||||||
.add_system("hof", show_hall_of_fame)
|
.add_system("hof", show_hall_of_fame)
|
||||||
|
.await
|
||||||
|
.add_system("h", show_help)
|
||||||
|
.await
|
||||||
|
.add_system("s", show_status)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
irc.run().await?;
|
irc.run().await?;
|
||||||
@ -508,3 +512,24 @@ fn show_hall_of_fame(hall_of_fame: Res<HallOfFame>) -> impl IntoResponse {
|
|||||||
|
|
||||||
lines
|
lines
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn show_help() -> impl IntoResponse {
|
||||||
|
(
|
||||||
|
false,
|
||||||
|
vec![
|
||||||
|
",f <nick> <nick> | duel fight",
|
||||||
|
",f <nick> ... vs <nick> ... | team battle",
|
||||||
|
",f <nick> <nick> <nick> ... | free for all",
|
||||||
|
",s | show the current fight status",
|
||||||
|
",hof | hall of fame",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn show_status(fight: Res<Fight>) -> impl IntoResponse {
|
||||||
|
if fight.status == FightStatus::Idle {
|
||||||
|
return "Noone is fighting you bunch of pussies.".to_owned();
|
||||||
|
}
|
||||||
|
|
||||||
|
format!("{} fighters remaining", fight.fighters.len())
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user