예제 #1
0
def makeDecline(user, leaveGame = False):
	raceId, specialPowerId = user.currentTokenBadge.raceId, user.currentTokenBadge.specPowId
	if user.declinedTokenBadge:
		user.killRaceInDecline()
		dbi.delete(user.declinedTokenBadge)
	callSpecialPowerMethod(specialPowerId, 'decline', user, leaveGame)	
	callRaceMethod(raceId, 'decline', user, leaveGame)	
	user.currentTokenBadge = None
예제 #2
0
파일: misc_game.py 프로젝트: NZem/webgame
def makeDecline(user, leaveGame=False):
    raceId, specialPowerId = user.currentTokenBadge.raceId, user.currentTokenBadge.specPowId
    if user.declinedTokenBadge:
        user.killRaceInDecline()
        dbi.delete(user.declinedTokenBadge)
    callSpecialPowerMethod(specialPowerId, 'decline', user, leaveGame)
    callRaceMethod(raceId, 'decline', user, leaveGame)
    user.currentTokenBadge = None
예제 #3
0
def endOfGame(game, coins = None): 
	game.state = GAME_ENDED
	if misc_const.TEST_MODE:
		return {'result': 'ok', 'coins': coins}
	else:
		gameState = getGameState(game)
		game.resetPlayersState()
		dbi.delete(game)
		dbi.flush(game)
		return {'result': 'ok', 'gameState': gameState}
예제 #4
0
파일: misc_game.py 프로젝트: NZem/webgame
def endOfGame(game, coins=None):
    game.state = GAME_ENDED
    if misc.TEST_MODE:
        return {'result': 'ok', 'coins': coins}
    else:
        gameState = getGameState(game)
        game.resetPlayersState()
        dbi.delete(game)
        dbi.flush(game)
        return {'result': 'ok', 'gameState': gameState}
예제 #5
0
파일: misc_game.py 프로젝트: NZem/webgame
def endOfGame(game, coins=None):
    game.state = GAME_ENDED
    if misc.TEST_MODE:
        return {"result": "ok", "coins": coins}
    else:
        gameState = getGameState(game)
        game.resetPlayersState()
        dbi.delete(game)
        dbi.flush(game)
        return {"result": "ok", "gameState": gameState}