From 9b82f220bb88a762e581324556fe8337b6453139 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Thu, 5 Mar 2020 02:31:26 +0100 Subject: [PATCH] improve some random things --- MultiServer.py | 8 ++++---- Mystery.py | 11 ++++++----- Text.py | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index b8f12197..81ed3503 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -192,17 +192,17 @@ async def countdown(ctx: Context, timer): def get_connected_players_string(ctx: Context): auth_clients = [c for c in ctx.clients if c.auth] if not auth_clients: - return 'No player connected' + return f'No player connected, of {len(ctx.player_names)} expected players' auth_clients.sort(key=lambda c: (c.team, c.slot)) - current_team = 0 - text = 'Team #1: ' + current_team = -1 + text = '' for c in auth_clients: if c.team != current_team: text += f':: Team #{c.team + 1}: ' current_team = c.team text += f'{c.name} ' - return 'Connected players: ' + text[:-1] + return f'Connected players ({len(auth_clients)} of {len(ctx.player_names)}) ' + text[:-1] def get_received_items(ctx: Context, team: int, player: int): diff --git a/Mystery.py b/Mystery.py index 693884f5..ebca4f6e 100644 --- a/Mystery.py +++ b/Mystery.py @@ -70,12 +70,13 @@ def main(): for player in range(1, args.multi + 1): path = getattr(args, f'p{player}') if path: - if path not in weights_cache: - try: + try: + if path not in weights_cache: weights_cache[path] = get_weights(path) - except Exception as e: - raise ValueError(f"File {path} is destroyed. Please fix your yaml.") from e - print(f"P{player} Weights: {path} >> {weights_cache[path]['description']}") + print(f"P{player} Weights: {path} >> {weights_cache[path]['description']}") + + except Exception as e: + raise ValueError(f"File {path} is destroyed. Please fix your yaml.") from e erargs = parse_arguments(['--multi', str(args.multi)]) erargs.seed = seed erargs.name = {x: "" for x in range(1, args.multi + 1)} # only so it can be overwrittin in mystery diff --git a/Text.py b/Text.py index 123d37b9..d673e2da 100644 --- a/Text.py +++ b/Text.py @@ -107,6 +107,7 @@ Triforce_texts = [ "You get one\nwish. Choose\nwisely, hero!", "Can you please\nbreak us three\nup? Thanks.", " Pick us up\n before we\n get dizzy!", + "\n Honk." ] BombShop2_texts = ['Bombs!\nBombs!\nBiggest!\nBestest!\nGreatest!\nBoomest!'] Sahasrahla2_texts = ['You already got my item, idiot.', 'Why are you still talking to me?', 'This text won\'t change.', 'Have you met my brother, Hasarahshla?']