mirror of
https://github.com/ayywrk/hardfight.git
synced 2024-12-22 05:36:38 +00:00
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",
|
||||
"stomps",
|
||||
"packets",
|
||||
"casts hadoken at",
|
||||
"sues",
|
||||
"hacks",
|
||||
"doxes",
|
||||
@ -90,7 +91,6 @@ const ACTIONS: &'static [&'static str] = &[
|
||||
];
|
||||
|
||||
const COLORS: &'static [&'static Color] = &[
|
||||
&Color::Black,
|
||||
&Color::Blue,
|
||||
&Color::Brown,
|
||||
&Color::Cyan,
|
||||
@ -229,6 +229,10 @@ async fn main() -> std::io::Result<()> {
|
||||
.add_system("f", new_fight)
|
||||
.await
|
||||
.add_system("hof", show_hall_of_fame)
|
||||
.await
|
||||
.add_system("h", show_help)
|
||||
.await
|
||||
.add_system("s", show_status)
|
||||
.await;
|
||||
|
||||
irc.run().await?;
|
||||
@ -508,3 +512,24 @@ fn show_hall_of_fame(hall_of_fame: Res<HallOfFame>) -> impl IntoResponse {
|
||||
|
||||
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