From a920be3aca3c8139e7abf120c80cae805736a9c5 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 14 Feb 2020 21:49:48 +0000 Subject: [PATCH] Base ninja handlers --- houdini/handlers/play/ninja.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/houdini/handlers/play/ninja.py b/houdini/handlers/play/ninja.py index 5b5f296..439ecac 100644 --- a/houdini/handlers/play/ninja.py +++ b/houdini/handlers/play/ninja.py @@ -13,3 +13,34 @@ async def cards_load(server): @handlers.allow_once async def load_ninja_inventory(p): p.cards = await PenguinCardCollection.get_collection(p.id) + + +@handlers.handler(XTPacket('ni', 'gnr')) +async def handle_get_ninja_ranks(p): + await p.send_xt('gnr', p.id, p.ninja_rank, p.fire_ninja_rank, p.water_ninja_rank, 0) + + +@handlers.handler(XTPacket('ni', 'gnl')) +async def handle_get_ninja_level(p): + await p.send_xt('gnl', p.ninja_rank, p.ninja_progress) + + +@handlers.handler(XTPacket('ni', 'gfl')) +async def handle_get_fire_level(p): + await p.send_xt('gfl', p.fire_ninja_rank, p.fire_ninja_progress) + + +@handlers.handler(XTPacket('ni', 'gwl')) +async def handle_get_water_level(p): + await p.send_xt('gwl', p.water_ninja_rank, p.water_ninja_progress) + + +@handlers.handler(XTPacket('ni', 'gsl')) +async def handle_get_snow_level(p): + await p.send_xt('gsl', 0, 0) + + +@handlers.handler(XTPacket('cd', 'gcd')) +async def handle_get_card_data(p): + await p.send_xt('gcd', '|'.join(f'{card.card_id},{card.quantity},{card.member_quantity}' + for card in p.cards.values()))