Beispiel #1
0
def new_user_boom(user_id, user_self_boom=0, group_id=''):
    """
    玩家开启数字炸弹,并且将boom设置为玩家定好的数字
    要是存在group_id,则随机设定boom
    同时设定boom_owner和boom_type
    :param user_id:
    :param user_self_boom:用户自定义boom
    :param group_id:
    :return:
    """
    global boom, boom_owner, boom_type
    user_self_boom = can_to_int(user_self_boom)
    if boom_type:
        return get_return('已经有游戏正在进行!')
    to_zero()
    if not 0 < user_self_boom < 100:
        return get_return('给爷爬!游戏范围都不知道了?')
    to_zero()
    boom = user_self_boom
    if group_id:
        boom = random.randint(1, 99)
    score = enough_score(user_id, USER_BOOM_PRICE)
    if not score:
        # 此处预留银行贷款功能,等银行写好后再补充
        return pa
    add_score(user_id, -USER_BOOM_PRICE)
    boom_owner = user_id
    boom_type = 2
    return get_return('创建成功')
Beispiel #2
0
def rumor(user_id, message):
    """
    制造谣言
    :param user_id:
    :param message: 谣言内容
    :return:
    """
    score = enough_score(user_id, RUMOR_PRICE)
    if not score:
        return get_return('爬', code=1)
Beispiel #3
0
def is_not_continue(user_id):
    """
    验证游戏是否可以继续玩
    :param user_id:
    :return:
    """
    time_remain = cannot_play_secondary(user_id)
    if not boom:
        return get_return('没有游戏进行')
    if not enough_score(user_id, BOOM_PRICE):
        return get_return('积分不足!')
    if time_remain:
        return get_return(time_remain)
    return False