From e9ca3484416b2e2af5642abca320e5da5ab0759e Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 3 Jul 2020 22:43:45 +0100 Subject: [PATCH] Support for TreasureHunt stamps --- houdini/handlers/games/treasure.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/houdini/handlers/games/treasure.py b/houdini/handlers/games/treasure.py index cc8e6c0..6883737 100644 --- a/houdini/handlers/games/treasure.py +++ b/houdini/handlers/games/treasure.py @@ -182,6 +182,21 @@ async def handle_send_move(p, movie: str, direction: str, spade: int): p.table.logic.make_move(movie, direction, spade) await p.table.send_xt('zm', movie, direction, spade) opponent = p.table.penguins[1 if p.table.logic.current_player == 1 else 0] + if p.table.logic.turns >= 9 and p.table.logic.gems_found > 0: + await p.add_stamp(p.server.stamps[420]) + await opponent.add_stamp(p.server.stamps[420]) + if p.table.logic.turns >= 5 and p.table.logic.gems_found >= 2: + await p.add_stamp(p.server.stamps[422]) + await opponent.add_stamp(p.server.stamps[422]) + if p.table.logic.gems_found >= 2: + await p.add_stamp(p.server.stamps[414]) + await opponent.add_stamp(p.server.stamps[414]) + if p.table.logic.coins_found >= 8: + await p.add_stamp(p.server.stamps[416]) + await opponent.add_stamp(p.server.stamps[416]) + if p.table.logic.emerald_found: + await p.add_stamp(p.server.stamps[418]) + await opponent.add_stamp(p.server.stamps[418]) if p.table.logic.turns == 0: winnings = p.table.logic.determine_winnings() await p.add_coins(winnings)