Exemplo n.º 1
0
def CheckMatchBully(g):
    """Played an attack every turn after turn 4"""
    if g.any_resigned():
        return []
    players = set(g.all_player_names())

    for turn in g.get_turns():
        if turn.get_turn_no() <= 4:
            continue
        player = turn.player.player_name
        if player not in players:
            continue
        attack = False
        for play in turn.plays:
            if card_info.is_attack(play):
                attack = True
                break
        if not attack:
            players.remove(player)
            if len(players) == 0:
                break
    return [
        achievement(player, 'Played an attack every turn after turn 4')
        for player in players
    ]
Exemplo n.º 2
0
def CheckMatchBully(g):
    """Played an attack every turn after turn 4"""
    if g.any_resigned():
        return []
    players = set(g.all_player_names())

    for turn in g.get_turns():
        if turn.get_turn_no() <= 4:
            continue
        player = turn.player.player_name
        if player not in players:
            continue
        attack = False
        for play in turn.plays:
            if card_info.is_attack(play):
                attack = True
                break
        if not attack:
            players.remove(player)
            if len(players) == 0:
                break
    return [achievement(player, 'Played an attack every turn after turn 4') for player in players] 
Exemplo n.º 3
0
        if acceptable_func(card):
            new_mat[len(new_cards)] = row
            new_cards.append(card)
    return new_mat, new_cards


# http://forum.dominionstrategy.com/index.php?topic=647.msg8951#msg8951
bonus_feature_funcs = [
    lambda x: 2 * card_info.coin_cost(x),
    lambda x: 3 * card_info.potion_cost(x),
    lambda x: 3 * card_info.num_plus_actions(x),
    lambda x: 4 * card_info.num_plus_cards(x),
    lambda x: 4 * card_info.is_action(x),
    lambda x: 4 * card_info.is_victory(x),
    lambda x: 4 * card_info.is_treasure(x),
    lambda x: 5 * card_info.is_attack(x),
    lambda x: 1 * card_info.is_reaction(x),
    lambda x: 2 * card_info.vp_per_card(x),
    lambda x: 1 * card_info.money_value(x),
    lambda x: 1 * card_info.num_plus_buys(x),
    # 1 * gains (remodel, upgrade, workshop, ...)
    lambda x: 1 * max(card_info.trashes(x), 5)
    # 6 * pollute (can add to other deck)
    # 3 * combo (conspirator, peddler, ...
    # 3 * special (goons, gardens, uniqueness in general)
    # 3 * discard (militia, minion,
    # 1 * cycle (vault, cellar, .. )
    # 100 * win rate
]

Exemplo n.º 4
0
    for card, row in zip(existing_card_names, existing_matrix):
        if acceptable_func(card):            
            new_mat[len(new_cards)] = row
            new_cards.append(card)
    return new_mat, new_cards

# http://forum.dominionstrategy.com/index.php?topic=647.msg8951#msg8951
bonus_feature_funcs = [
    lambda x: 2 * card_info.coin_cost(x),
    lambda x: 3 * card_info.potion_cost(x),
    lambda x: 3 * card_info.num_plus_actions(x),
    lambda x: 4 * card_info.num_plus_cards(x),
    lambda x: 4 * card_info.is_action(x),
    lambda x: 4 * card_info.is_victory(x),
    lambda x: 4 * card_info.is_treasure(x),
    lambda x: 5 * card_info.is_attack(x),
    lambda x: 1 * card_info.is_reaction(x),
    lambda x: 2 * card_info.vp_per_card(x),
    lambda x: 1 * card_info.money_value(x),
    lambda x: 1 * card_info.num_plus_buys(x),
    # 1 * gains (remodel, upgrade, workshop, ...)
    lambda x: 1 * max(card_info.trashes(x), 5)
    # 6 * pollute (can add to other deck)
    # 3 * combo (conspirator, peddler, ...
    # 3 * special (goons, gardens, uniqueness in general)
    # 3 * discard (militia, minion, 
    # 1 * cycle (vault, cellar, .. )
    # 100 * win rate
    ]

def get_bonus_vec(card_name):