コード例 #1
0
ファイル: bequeathed_strategy.py プロジェクト: neuront/sgs
 def _hint_detail(self):
     targets = self.game_control.players_from_current()
     targets.remove(self.player)
     import ext.src.hint_common as hints
     return hints.filter_empty(hints.allow_abort(hints.add_method_to(
                     hints.basic_cards_hint(), 'bequeathed strategy',
                     hints.join_req(hints.min_card_count(self.cards, 1),
                                    hints.fixed_target_count(targets, 1)))))
コード例 #2
0
ファイル: heavenly_scent.py プロジェクト: neuront/sgs
 def _hint_detail(self):
     cards = self.game_control.player_cards_at(self.player, 'onhand')
     cards = filter(lambda c: c.suit() == card.HEART, cards)
     targets = self.game_control.players_from_current()
     targets.remove(self.player)
     import ext.src.hint_common as hints
     return hints.filter_empty(hints.allow_abort(hints.add_method_to(
                     hints.basic_cards_hint(), SKILL,
                     hints.join_req(hints.fixed_card_count(cards, 1),
                                    hints.fixed_target_count(targets, 1)))))
コード例 #3
0
ファイル: surprise_raid.py プロジェクト: neuront/sgs
def black_as_sabotage_using_hint(hint, game_control, user, interfaces):
    @invoke_on_success(user, SKILL)
    def to_sabotage(gc, args):
        checking.only_one_card_of_color(gc.cards_by_ids(args['use']),
                                        card.BLACK)
        return sabotage.sabotage_check(gc, args)
    interfaces[SKILL] = to_sabotage
    cards = filter(lambda c: c.color() == card.BLACK,
                   game_control.player_cards_at(user, 'all'))
    targets = sabotage.sabotage_targets(game_control, user)
    if len(targets) == 0:
        return
    hints.add_method_to(hint, SKILL,
                        hints.join_req(hints.fixed_card_count(cards, 1),
                                       hints.fixed_target_count(targets, 1)))
コード例 #4
0
ファイル: zhangba_serpent_spear.py プロジェクト: neuront/sgs
def using_hint(hint, gc, user, interfaces):
    @invoke_on_success(user, EQUIP_NAME)
    def to_slash(gc, args):
        two_cards(gc.cards_by_ids(args['use']))
        args['action'] = 'slash'
        return slash.slash_check(gc, args)
    if 'slash' in interfaces:
        interfaces[EQUIP_NAME] = to_slash
        cards = gc.player_cards_at(user, 'onhand')
        targets = slash.slash_targets(gc, user)
        if len(targets) == 0:
            return
        hints.add_method_to(
                hint, EQUIP_NAME,
                hints.join_req(hints.fixed_card_count(cards, 2),
                               hints.fixed_target_count(targets, 1)))
    elif EQUIP_NAME in interfaces:
        del interfaces[EQUIP_NAME]
コード例 #5
0
ファイル: martial_saint.py プロジェクト: neuront/sgs
def _add_region(gc, user, region, interfaces, hint):
    @invoke_on_success(user, SKILL)
    def to_slash(gc, args):
        cards = gc.cards_by_ids(args['use'])
        checking.cards_region(cards, region)
        red_as_slash_response(cards)
        args['action'] = 'slash'
        with EquipmentRestore(user, region):
            return slash.slash_check(gc, args)
    interfaces[SKILL + ':' + region] = to_slash
    cards = filter(lambda c: c.color() == card.RED,
                   gc.player_cards_at(user, region))
    targets = slash.slash_targets(gc, user)
    if len(targets) == 0 or len(cards) == 0:
        return
    hints.add_method_to(hint, SKILL + ':' + region,
                        hints.join_req(hints.fixed_card_count(cards, 1),
                                       hints.fixed_target_count(targets, 1)))
コード例 #6
0
ファイル: dragon_heart.py プロジェクト: neuront/sgs
def dodge_as_slash_using_hint(hint, game_control, user, interfaces):
    @invoke_on_success(user, SKILL)
    def to_slash(gc, args):
        dodge_as_slash_check(gc.cards_by_ids(args['use']))
        args['action'] = 'slash'
        return slash.slash_check(gc, args)
    if 'slash' in interfaces:
        interfaces[SKILL] = to_slash
        cards = filter(lambda c: c.name() == 'dodge',
                       game_control.player_cards_at(user, 'onhand'))
        targets = slash.slash_targets(game_control, user)
        if len(targets) == 0:
            return
        hints.add_method_to(
                hint, SKILL,
                hints.join_req(hints.fixed_card_count(cards, 1),
                               hints.fixed_target_count(targets, 1)))
    elif SKILL in interfaces:
        del interfaces[SKILL]