Coin dig handler

This commit is contained in:
Ben 2019-12-02 23:25:11 +00:00
parent dac0db8945
commit ad8119a4d5

View File

@ -0,0 +1,14 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.data.penguin import Penguin
import random
@handlers.handler(XTPacket('r', 'cdu'))
@handlers.cooldown(1)
async def handle_get_coin_reward(p):
if random.random() < 0.3:
coins = random.choice([1, 2, 5, 10, 20, 50, 100])
await p.update(coins=Penguin.coins + coins).apply()
await p.send_xt('cdu', coins, p.coins)