Esempio n. 1
0
def ask_about_resurrection(game, selected_player):
    player_cards = []
    for card in game.players[selected_player].cards:
        player_cards.append(card.name)
    if "Fresh Stert Club" in player_cards and test_game.will_you_protect(selected_player):
        test_game.on_play_card("Fresh Stert Club", selected_player)
        test_game.on_action_make("text")
        del (game.players[selected_player].cards[player_cards.index("Fresh Stert Club")])
        selected_region = test_game.select_region(list(range(0, 12)), selected_player)
        test_game.on_new_servant(selected_region, game.playing_player)
        game.players[selected_player].servants += 1
        game.desk.regions[selected_region].servants.append(selected_player)
        if len(game.desk.regions[selected_region].servants) > 1:
            test_game.on_new_problem(selected_region)
            game.desk.regions[selected_region].problem = True
        test_game.on_end_play_card(selected_player)
    elif "Igor" in player_cards and test_game.will_you_protect(selected_player):
        test_game.on_play_card("Igor", selected_player)
        del (game.players[selected_player].cards[player_cards.index("Igor")])
        selected_region = test_game.select_region(list(range(0, 12)), selected_player)
        test_game.on_new_servant(selected_region, game.playing_player)
        game.players[selected_player].servants += 1
        game.desk.regions[selected_region].servants.append(selected_player)
        if len(game.desk.regions[selected_region].servants) > 1:
            test_game.on_new_problem(selected_region)
            game.desk.regions[selected_region].problem = True
        test_game.on_end_play_card(selected_player)
Esempio n. 2
0
def add_problem_7(game):
    regions = game.desk.regions[6].neigbours
    possible_regions = []
    for i in regions:
        if not game.desk.regions[i].problem:
            possible_regions.append(i)
    selected_region = test_game.select_region(possible_regions, game.playing_player)
    test_game.on_new_problem(selected_region)
    game.desk.regions[selected_region].problem = True
Esempio n. 3
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
Esempio n. 4
0
def remove_servant(game):
    possible_regions = []
    for region in game.desk.regions:
        if game.playing_player in region.servants:
            possible_regions.append(game.desk.regions.index(region))
    selected_region_start = test_game.select_region(possible_regions, game.playing_player)
    selected_region_finish = test_game.select_region(list(range(12)), game.playing_player)
    test_game.on_move_servant(selected_region_start, selected_region_finish, game.playing_player)
    del (
        game.desk.regions[selected_region_start].servants[
            game.desk.regions[selected_region_start].servants.index(game.playing_player)
        ]
    )
    game.desk.regions[selected_region_finish].servants.append(game.playing_player)
    if len(game.desk.regions[selected_region_finish].servants) > 1:
        test_game.on_new_problem(selected_region_finish)
        game.desk.regions[selected_region_finish].problem = True
Esempio n. 5
0
def add_servant(game):
    test_game.on_action_make("add_servant")
    if game.players[game.playing_player].servants < 12:
        possible_regions = []
        for region in game.desk.regions:
            for neigbour in region.neigbours:
                if game.playing_player in game.desk.regions[neigbour].servants:
                    possible_regions.append(game.desk.regions.index(region))
        selected_region = test_game.select_region(list(set(possible_regions)), game.playing_player)
        test_game.on_new_servant(selected_region, 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:
        remove_servant(game)
Esempio n. 6
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)