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
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
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
def special_action_click(self,player): #We must ensure that we are doing this on our turn if player.pid == globe.boss.whose_turn: for c in self.player.hand.contents: if c.name == "Punch" and self.action in self.player.played.special_options: self.player.discard_a_card(c) assemble = [] for i in range(3): to_add = player.reveal_card(public = False) if to_add != None: assemble.append(to_add) player.deck.contents.pop() equipment_assemble = [] for c in assemble: if c.ctype_eq(cardtype.EQUIPMENT): equipment_assemble.append(c) effects.reveal(f"These were the top 3 cards on {player.persona.name}'s deck",player,assemble) if len(equipment_assemble) > 0: result = effects.choose_one_of("Choose one of these to draw.",player,assemble,ai_hint.BEST) #must be there to be drawn player.deck.contents.append(result) player.draw_card(from_card = False) assemble.remove(result) total_times = len(assemble) while len(assemble) > 0: result = effects.choose_one_of(f"Place card back on top of your deck ({total_times - len(assemble) + 1}/{total_times})?",player,assemble,ai_hint.WORST) assemble.remove(result) player.deck.contents.append(result) self.player.played.special_options.remove(self.action) return True return False
def reveal_card(self, public=True): if not self.manage_reveal(): return None top_card = self.deck.contents[-1] if public: reveal_text = f"{top_card.name} was on the top of {self.persona.name}'s deck." effects.reveal(reveal_text, self, [top_card]) return top_card
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
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
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
def play_action(self, player): player.played.plus_power(2) assemble_names = set() assemble = [] grand_assemble = [] grand_assemble.extend(player.deck.contents) grand_assemble.extend(player.under_superhero.contents) grand_assemble.extend(player.over_superhero.contents) grand_assemble.extend(player.discard.contents) grand_assemble.extend(player.hand.contents) grand_assemble.extend(player.played.contents) for c in grand_assemble: if not c.name in assemble_names: assemble_names.add(c.name) assemble.append(c) chosen_name = "" if len(assemble) > 0: result = effects.choose_one_of( "Choose a card name.\nReveal the top three cards of your deck\nand put any cards with that name into\nyour hand.", player, assemble, ai_hint.RANDOM) chosen_name = result.name revealed = [] for i in range(3): revealing = player.reveal_card(public=False) if revealing != None: revealing.pop_self() revealed.append(revealing) if len(revealed) > 0: effects.reveal( f"These were on top of {player.persona.name}'s deck", player, revealed) for c in revealed.copy(): if c.name == chosen_name: player.hand.contents.append(c) revealed.remove(c) while len(revealed) > 0: result = effects.choose_one_of( "Put one of the revealed cards on top of your deck", player, revealed, ai_hint.WORST) player.deck.contents.append(result) revealed.remove(result) return 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
def defend(self, attacker=None, defender=None): effects.reveal(f"{self.owner.persona.name} defended with this card.", self.owner, [self]) return