From b930f49d30a6bc9b198f4e5c371628e515f6852e Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 14 Feb 2020 21:53:34 +0000 Subject: [PATCH] `handle_epf_grant_reward` handler --- houdini/handlers/play/epf.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/houdini/handlers/play/epf.py b/houdini/handlers/play/epf.py index eb97a9d..e2150a4 100644 --- a/houdini/handlers/play/epf.py +++ b/houdini/handlers/play/epf.py @@ -131,3 +131,13 @@ async def handle_get_com_messages(p): await p.send_xt('epfgm', int(bool(unread_com_message)), com_messages) else: await p.send_xt('epfgm', int(bool(unread_com_message))) + + +@handlers.handler(XTPacket('f', 'epfgrantreward')) +@handlers.cooldown(60) +@handlers.player_attribute(agent_status=False) +async def handle_epf_grant_reward(p, medals: int): + medals = min(45, medals) + await p.update(career_medals=p.career_medals + medals, + agent_medals=p.agent_medals + medals).apply() + await p.send_xt('epfgr', p.career_medals, p.agent_medals)