From 146ee51b05dfb989de82fd45ac2a04e2850f07bb Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 25 Apr 2023 09:26:55 +0200 Subject: [PATCH] do this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/4000192#context --- files/routes/awards.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index 7e40c8888..252e32cb7 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -210,13 +210,24 @@ def award_thing(v, thing_type, id): send_repeatable_notification(v.id, msg) author = v elif kind != 'spider': - awarded_coins = int(AWARDS[kind]['price'] * COSMETIC_AWARD_COIN_AWARD_PCT) if AWARDS[kind]['cosmetic'] and kind != 'shit' else 0 - if AWARDS[kind]['cosmetic'] and kind != 'shit': + if AWARDS[kind]['cosmetic']: + awarded_coins = int(AWARDS[kind]['price'] * COSMETIC_AWARD_COIN_AWARD_PCT) + else: + awarded_coins = 0 + + if kind == 'shit': + author.charge_account('coins', awarded_coins) + v.pay_account('coins', awarded_coins) + elif AWARDS[kind]['cosmetic']: author.pay_account('coins', awarded_coins) msg = f"@{v.username} has given your [{thing_type}]({thing.shortlink}) the {AWARDS[kind]['title']} Award" - if awarded_coins > 0: + + if kind == 'shit': + msg += f" and has stolen from you {awarded_coins} coins as a result" + elif awarded_coins: msg += f" and you have received {awarded_coins} coins as a result" + msg += "!" if note: note = '\n\n> '.join(note.splitlines())