コード例 #1
0
 def first_apearance(self):
     heros_in_lineup = globe.boss.lineup.get_count(cardtype.HERO)
     for p in globe.boss.players:
         if effects.attack(p, self):
             for i in range(heros_in_lineup):
                 p.gain_a_weakness()
     return
コード例 #2
0
    def first_apearance(self):
        for p in globe.boss.players:
            if effects.attack(p, self):
                top_cards = []
                for i in range(2):
                    next_card = p.reveal_card(public=False)
                    if next_card != None:
                        next_card.pop_self()
                        top_cards.append(next_card)
                if len(top_cards) > 0:
                    effects.reveal("There were what {} drew.", p, top_cards)
                    to_left = None
                    if p.pid + 1 == len(globe.boss.players):
                        to_left = globe.boss.players[0]
                    else:
                        to_left = globe.boss.players[p.pid + 1]

                    instruction_text = f"Choose one to put under your Super Hero,\nthe other will go under {to_left.persona.name}'s Super Hero."
                    result = effects.choose_one_of(instruction_text, p,
                                                   top_cards, ai_hint.BEST)
                    p.under_superhero.contents.append(result)
                    top_cards.remove(result)
                if len(top_cards) > 0:
                    result = top_cards[0]
                    result.set_owner(to_left)
                    to_left.under_superhero.contents.append(result)
        return
コード例 #3
0
 def first_apearance(self):
     for p in globe.boss.players:
         if effects.attack(p, self):
             revealed = []
             for i in range(5):
                 to_reveal = p.reveal_card(public=False)
                 if to_reveal != None:
                     revealed.append(to_reveal)
                     to_reveal.pop_self()
             effects.reveal(
                 f"These were on the top of {p.persona.name}'s deck.", p,
                 revealed)
             for c in revealed.copy():
                 if c.cost >= 1:
                     #put back into deck so that it is  discarded from a place
                     p.deck.contents.append(c)
                     p.discard_a_card(c)
                     revealed.remove(c)
             while len(revealed) > 0:
                 result = effects.choose_one_of(
                     "Put cards back on top of your deck", p, revealed,
                     ai_hint.WORST)
                 p.deck.contents.append(result)
                 revealed.remove(result)
     return
コード例 #4
0
 def attack_action(self, by_player):
     did_not_reveal_costly_card = False
     for p in globe.boss.players:
         if p != by_player and effects.attack(p, self, by_player):
             if len(p.hand.contents) > 0:
                 instruction_text = f"Reveal a card to put under your Super Hero.\nIf one or more foes does not reveal a card with cost 1 or\ngreater, {by_player.persona.name} will draw two cards."
                 result = effects.choose_one_of(instruction_text, p,
                                                p.hand.contents,
                                                ai_hint.WORST)
                 if not result.cost >= 1:
                     did_not_reveal_costly_card = True
                 effects.reveal(
                     f"This {result.name} will be under {p.persona.name}'s super hero",
                     p, [result])
                 result.pop_self()
                 p.under_superhero.contents.append(result)
             else:
                 did_not_reveal_costly_card = True
         #This is a rulebook specific ruling.  I had guessed that avoiding that attack did
         #not count towards not revealing a costly card, but the rulebook says it does
         else:
             did_not_reveal_costly_card = True
     if did_not_reveal_costly_card:
         by_player.draw_card(2)
     return
コード例 #5
0
 def attack_action(self, by_player):
     p = effects.choose_a_player(
         "Choose a player.\nThey will discard a random card.",
         by_player,
         includes_self=False,
         hint=ai_hint.BEST)
     if effects.attack(p, self, by_player):
         if len(p.hand.contents) > 0:
             result = random.choice(p.hand.contents)
             p.discard_a_card(result)
コード例 #6
0
 def attack_action(self, by_player):
     for p in globe.boss.players:
         if p != by_player and effects.attack(p, self, by_player):
             has_starter = False
             for c in p.hand.contents:
                 if c.ctype_eq(cardtype.STARTER):
                     has_starter = True
             if not has_starter:
                 p.gain_a_weakness()
     return
コード例 #7
0
 def trigger(self, ttype, data, player, active, immediate):
     if trigger.test(immediate,\
         trigger.ATTACKING, \
         self.trigger, \
         player,ttype):
         player.triggers.remove(self.trigger)
         return effects.attack(data[0],
                               data[1],
                               by_player=player,
                               avoid_twise=True)
コード例 #8
0
 def first_apearance(self):
     for p in globe.boss.players:
         if effects.attack(p, self):
             for i in range(2):
                 if p.gain_a_weakness():
                     already_moved = False
                     for c in p.discard.contents.copy():
                         if not already_moved and c.name == "Weakness":
                             c.pop_self()
                             p.deck.contents.insert(0, c)
                             already_moved = True
     return
コード例 #9
0
 def first_apearance(self):
     for p in globe.boss.players:
         if effects.attack(p, self):
             top_card = globe.boss.main_deck.draw()
             effects.reveal(
                 f"This will be under {p.persona.name}'s Super Hero.", p,
                 [top_card])
             top_card.set_owner(p)
             p.under_superhero.contents.append(top_card)
             if not top_card.ctype_eq(cardtype.EQUIPMENT):
                 p.gain_a_weakness()
     return
コード例 #10
0
 def first_apearance(self):
     for p in globe.boss.players:
         if effects.attack(p, self):
             assemble = []
             for c in p.hand.contents:
                 if c.cost >= 3:
                     assemble.append(c)
             if len(assemble) > 0:
                 result = effects.choose_one_of(
                     "Choose a card with cost 3 or greater to discard", p,
                     assemble, ai_hint.WORST)
                 p.discard_a_card(result)
     return
コード例 #11
0
 def first_apearance(self):
     for p in globe.boss.players:
         if effects.attack(p, self):
             #effects.reveal(f"This was {p.persona.name}'s hand",p,p.hand.contents)
             num_heros = p.hand.get_count(cardtype.VILLAIN)
             for i in range(num_heros):
                 instruction_text = f"You had {num_heros} heros in you hand.  Choose a card to discard ({i+1}/{num_heros})"
                 if p.hand.size() > 0:
                     choose = effects.choose_one_of(instruction_text, p,
                                                    p.hand.contents,
                                                    ai_hint.WORST)
                     p.discard_a_card(choose)
     return
コード例 #12
0
 def attack_action(self, by_player):
     p = effects.choose_a_player(
         "Choose a player.\nYou will destory a card under that players Super Hero.",
         by_player,
         includes_self=False,
         hint=ai_hint.BEST)
     if effects.attack(p, self, by_player):
         if len(p.under_superhero.contents) > 0:
             result = effects.choose_one_of(
                 f"Choose a card to destory from uder {p.persona.name}'s Superhero",
                 by_player, p.under_superhero.contents, ai_hint.BEST)
             result.destroy(p)
         self.pop_self()
         by_player.under_superhero.contents.append(self)
コード例 #13
0
 def first_apearance(self):
     for p in globe.boss.players:
         if effects.attack(p, self):
             top_card = globe.boss.main_deck.draw()
             effects.reveal(
                 f"This will be under {p.persona.name}'s Super Hero.", p,
                 [top_card])
             top_card.set_owner(p)
             p.under_superhero.contents.append(top_card)
             if not top_card.ctype_eq(cardtype.HERO):
                 if len(p.hand.contents) > 0:
                     result = random.choice(p.hand.contents)
                     p.discard_a_card(result)
     return
コード例 #14
0
 def attack_action(self, by_player):
     p = effects.choose_a_player(
         "Choose a player.\nYou will put a card from under their Super Hero, under your Super Hero",
         by_player,
         includes_self=False,
         hint=ai_hint.BEST)
     if effects.attack(p, self, by_player):
         if len(p.under_superhero.contents) > 0:
             result = effects.choose_one_of(
                 f"Put one of these cards from {p.persona.name} under your Super Hero.",
                 by_player, p.under_superhero.contents, ai_hint.BEST)
             result.pop_self()
             result.set_owner(by_player)
             by_player.under_superhero.contents.append(result)
コード例 #15
0
    def first_apearance(self):
        for p in globe.boss.players:
            if effects.attack(p, self):
                top_card = globe.boss.main_deck.draw()
                effects.reveal(
                    f"This will be under {p.persona.name}'s Super Hero.", p,
                    [top_card])
                top_card.set_owner(p)
                p.under_superhero.contents.append(top_card)
                if not top_card.ctype_eq(cardtype.SUPERPOWER):
                    for c in p.hand.contents.copy():
                        if c.cost >= 4:
                            p.discard_a_card(c)

        return
コード例 #16
0
    def first_apearance(self):
        discarded = {}
        highest_cost = -1
        for p in globe.boss.players:
            if effects.attack(p, self):
                if len(p.hand.contents) > 0:
                    card_to_discard = random.choice(p.hand.contents)
                    discarded[p] = card_to_discard
                    p.discard_a_card(card_to_discard)
                    if card_to_discard.cost > highest_cost:
                        highest_cost += 1

        for p in discarded:
            if discarded[p].cost == highest_cost:
                p.discard_a_card(random.choice(p.hand.contents))
        return
コード例 #17
0
 def special_action_click(self, player):
     instruction_text = "You may destory one of the villains you\nhave played this turn.  If you do, draw a card and Attack::\nEach foes gains a Weakness."
     assemble = []
     for c in player.played.played_this_turn:
         if c.ctype_eq(cardtype.VILLAIN):
             assemble.append(c)
     result = effects.may_choose_one_of(instruction_text, player, assemble,
                                        ai_hint.IFBAD)
     if result != None:
         result.destroy(player)
         player.draw_card(from_card=False)
         for p in globe.boss.players:
             if p != player:
                 if effects.attack(p, self, player):
                     p.gain_a_weakness()
         self.player.played.special_options.remove(self.action)
         return True
     return False
コード例 #18
0
 def first_apearance(self):
     for p in globe.boss.players:
         if effects.attack(p, self):
             highest_costs = []
             cost = -1
             for c in p.hand.contents:
                 if c.cost > cost:
                     cost = c.cost
                     highest_costs = [c]
                 elif c.cost == cost:
                     highest_costs.append(c)
             #Hand is not empty
             if len(highest_costs) > 1:
                 instruction_text = "Choose a highest cost to put under your Super Hero."
                 result = effects.choose_one_of(instruction_text, p,
                                                highest_costs,
                                                ai_hint.WORST)
                 result.pop_self()
                 p.under_superhero.contents.append(result)
     return
コード例 #19
0
 def first_apearance(self):
     for p in globe.boss.players:
         if effects.attack(p, self):
             top_card = globe.boss.main_deck.draw()
             effects.reveal(
                 f"This will be under {p.persona.name}'s Super Hero.", p,
                 [top_card])
             top_card.set_owner(p)
             p.under_superhero.contents.append(top_card)
             if not top_card.ctype_eq(cardtype.VILLAIN):
                 assemble = []
                 for c in p.hand.contents:
                     if c.cost <= 3:
                         assemble.append(c)
                 for c in p.discard.contents:
                     if c.cost <= 3:
                         assemble.append(c)
                 if len(assemble) > 0:
                     result = effects.choose_one_of(
                         "Choose a card with cost 3 or less to discard.", p,
                         assemble, ai_hint.WORST)
                     result.destroy(p)
     return
コード例 #20
0
    def first_apearance(self):
        for p in globe.boss.players:
            if effects.attack(p, self):
                assemble = []
                for c in p.discard.contents:
                    if c.cost >= 1:
                        assemble.append(c)
                if len(assemble) > 0:
                    instruction_text = "Destory a card with cost 1 or greater in your discard pile (1/2)."
                    result = effects.choose_one_of(instruction_text, p,
                                                   assemble, ai_hint.WORST)
                    result.destroy(p)
                    assemble = []
                    for c in p.discard.contents:
                        #two different cards?
                        if c.cost >= 1 and c.name != result.name:
                            assemble.append(c)
                    if len(assemble) > 0:
                        instruction_text = "Destory a card with cost 1 or greater in your discard pile (2/2)."
                        result = effects.choose_one_of(instruction_text, p,
                                                       assemble, ai_hint.WORST)
                        result.destroy(p)

        return