Example #1
0
def remove_problem_10(game):
    if game.players[game.playing_player].money >= 2:
        possible_regions = []
        for i in range(12):
            if game.desk.regions[i].problem:
                possible_regions.append(i)
        selected_region = test_game.select_region(possible_regions, game.playing_player)
        game.desk.regions[selected_region].problem = False
        test_game.on_remove_problem(selected_region)
        game.players[game.playing_player].money -= 2
        test_game.on_add_money(-2, game.playing_player)
Example #2
0
def add_servant_8(game):
    if game.players[game.playing_player].money >= 3:
        possible_regions = game.desk.regions[7].neigbours
        selected_region = test_game.select_region(possible_regions, game.playing_player)
        test_game.on_new_servant(selected_region, game.playing_player)
        game.players[game.playing_player].money -= 3
        test_game.on_add_money(-3, game.playing_player)
        game.players[game.playing_player].servants += 1
        game.desk.regions[selected_region].servants.append(game.playing_player)
        if len(game.desk.regions[selected_region].servants) > 1:
            test_game.on_new_problem(selected_region)
            game.desk.regions[selected_region].problem = True
    else:
        pass
Example #3
0
def build_house(game):
    possible_regions = []
    for region in game.desk.regions:
        if (
            (not region.problem)
            and game.players[game.playing_player].money >= region.costs
            and game.playing_player in region.servants
            and region.building == None
        ):
            possible_regions.append(game.desk.regions.index(region))
    if possible_regions != []:
        selected_region = test_game.select_region(possible_regions, game.playing_player)
        test_game.on_action_make("build_house")
        test_game.on_new_building(selected_region, game.playing_player)
        game.desk.regions[selected_region].played = True
        game.players[game.playing_player].money -= region.costs
        test_game.on_add_money(region.costs * (-1), game.playing_player)
        game.players[game.playing_player].buildings.append(selected_region)
        game.desk.regions[selected_region].building = game.playing_player
    else:
        pass
Example #4
0
def add_money_5(game):
    test_game.on_action_make("add_money")
    test_game.on_add_money(5, game.playing_player)
    game.players[game.playing_player].money += 5