From 5a6af0b786a9cbfd0ef2e9095689497c751ce8b5 Mon Sep 17 00:00:00 2001 From: wrk Date: Thu, 1 Jun 2023 20:32:23 +0200 Subject: [PATCH] status --- src/main.rs | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b48261a..7bba735 100644 --- a/src/main.rs +++ b/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?; @@ -311,7 +315,7 @@ fn fight( let victim_idx = rng.gen_range(0..fight.fighters.len()); let mut fucking_victim = fight.fighters.get_mut(victim_idx).unwrap(); - + if fucking_victim.nick == "wrk" { // ;) fucking_victim = fight.fighters.get_mut(victim_idx).unwrap(); @@ -508,3 +512,24 @@ fn show_hall_of_fame(hall_of_fame: Res) -> impl IntoResponse { lines } + +fn show_help() -> impl IntoResponse { + ( + false, + vec![ + ",f | duel fight", + ",f ... vs ... | team battle", + ",f ... | free for all", + ",s | show the current fight status", + ",hof | hall of fame", + ], + ) +} + +fn show_status(fight: Res) -> impl IntoResponse { + if fight.status == FightStatus::Idle { + return "Noone is fighting you bunch of pussies.".to_owned(); + } + + format!("{} fighters remaining", fight.fighters.len()) +}