예제 #1
0
def evening(group_id, user_id):
    # 処刑
    ParaUpdate.die(VarManager.fetch_value(group_id, 'executed_player_id'))
    # 終了条件
    if isGameOver.is_village_win(group_id) != 2:
        return flask.redirect(flask.url_for('end_view', group_id=group_id, user_id=user_id))
    else:
        return flask.redirect(flask.url_for('night_view', group_id=group_id, user_id=user_id))
예제 #2
0
def vote():
    # formから受け取る
    group_id = int(flask.request.form['group_id'])
    user_id = int(flask.request.form['user_id'])
    voted_id = int(flask.request.form['vote'])
    # 投票してパラメータを更新
    ParaUpdate.vote_done(user_id, voted_id)  # 自作メソッド
    return flask.redirect(flask.url_for('vote_result', group_id=group_id, user_id=user_id))
예제 #3
0
def night_action():
    # formから受け取る
    group_id = int(flask.request.form['group_id'])
    user_id = int(flask.request.form['user_id'])
    login_user = Player.query.get(user_id)
    if login_user.role == "人狼":
        bitten_id = int(flask.request.form['bite'])
        ParaUpdate.bite_done(user_id, bitten_id)
    return flask.redirect(flask.url_for('morning_view', group_id=group_id, user_id=user_id))
예제 #4
0
def noon(group_id, user_id):
    # ここでパラメータを整理する
    Reset.para_refresh(group_id)  # パラメーターリフレッシュ
    if VarManager.fetch_value(group_id, 'killed_player_id'):  # 昨晩襲撃されていれば
        ParaUpdate.die(VarManager.fetch_value(group_id, 'killed_player_id'))
    # 終了条件
    if isGameOver.is_village_win(group_id) != 2:
        return flask.redirect(flask.url_for('end_view', group_id=group_id, user_id=user_id))
    else:
        return flask.redirect(flask.url_for('day_view', group_id=group_id, user_id=user_id))
예제 #5
0
def morning_view(group_id, user_id):
    return ParaUpdate.bite_completed(group_id, user_id)
예제 #6
0
def prepareration_okay():
    group_id = int(flask.request.form['group_id'])
    user_id = int(flask.request.form['user_id'])
    # メンバーが集まったと判断した人はis_got_togetherを更新
    ParaUpdate.all_member_gathered(user_id)
    return ParaUpdate.gather_completed(group_id, user_id)
예제 #7
0
def wait_view(group_id, user_id):
    return ParaUpdate.gather_completed(group_id, user_id)
예제 #8
0
def vote_result(group_id, user_id):
    return ParaUpdate.vote_completed(group_id, user_id)