Example #1
0
def remove_problem(game):
    test_game.on_action_make("remove_problem")
    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)
Example #2
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 #3
0
def kill_servant(game):
    test_game.on_action_make("kill_servant")
    possible_regions = []
    for region in game.desk.regions:
        if region.problem:
            possible_regions.append(game.desk.regions.index(region))
    selected_region = test_game.select_region(possible_regions, game.playing_player)
    selected_servant = test_game.select_servant(game.desk.regions[selected_region].servants, game.playing_player)
    test_game.on_remove_servant(selected_region, selected_servant)
    test_game.on_remove_problem(selected_region)
    if ask_about_protection(game, selected_servant):
        test_game.on_new_servant(selected_region, selected_servant)
        test_game.on_new_problem(selected_region)
    else:
        game.desk.regions[selected_region].problem = False
        del (
            game.desk.regions[selected_region].servants[
                game.desk.regions[selected_region].servants.index(selected_servant)
            ]
        )
        game.players[selected_servant].servants -= 1
        ask_about_resurrection(game, selected_servant)