def trigger(self, ttype, data, player, active, immediate): if globe.DEBUG: print("test", self.name, flush=True) if trigger.test(not immediate,\ trigger.PLAY, \ self.trigger, \ player,ttype,active) \ and data[0].ctype_eq(cardtype.HERO): hero_count = 0 for c in self.player.played.played_this_turn: if c.ctype_eq(cardtype.HERO): hero_count += 1 if hero_count == 2: instruction_text = "Would you like to put a card from the main deck under Felicity Smoak?" hint = ai_hint.ALWAYS if len(player.under_superhero.contents) > 0: hint = ai_hint.NEVER instruction_text += "\nif not, put a card from under your superhero\ninto your hand" if effects.ok_or_no(instruction_text, player, None, hint): top_card = globe.boss.main_deck.draw() top_card.set_owner(player) player.under_superhero.contents.append(top_card) elif len(player.under_superhero.contents) > 0: instruction_text = "You may put a card from under your superhero into your hand." result = effects.may_choose_one_of( instruction_text, player, player.under_superhero.contents, ai_hint.BEST)
def play_action(self, player): player.played.plus_power(3) instruction_text = "Would you like to shuffle all cards from your\ndiscard pile with cost 1 or greater into your deck." if effects.ok_or_no(instruction_text, player, self, ai_hint.ALWAYS): for c in player.discard.contents.copy(): if c.cost >= 1: c.pop_self() player.deck.contents.append(c) random.shuffle(player.deck.contents) return 0
def trigger(self, ttype, data, player, active, immediate): if trigger.test(immediate,\ trigger.GAIN_CARD, \ self.trigger, \ player,ttype,active) \ and data[1].owner_type == owners.LINEUP \ and data[0] == False \ and effects.ok_or_no(f"Would you like to put {data[1].name} on the bottom of your deck?",player,data[1],ai_hint.ALWAYS): player.deck.contents.insert(0, data[1]) return True
def trigger(self,ttype,data,player,active,immediate): if globe.DEBUG: print("test",self.name,flush=True) if trigger.test(immediate,\ trigger.DRAW, \ self.trigger, \ player,ttype,active): if globe.DEBUG: print("active",self.name,flush=True) revealed = player.reveal_card(public = True) if revealed != None and effects.ok_or_no(f"Would you like to discard the {revealed.name}?",player,revealed,ai_hint.IFBAD): player.discard_a_card(revealed)
def play_action(self, player): if len(player.under_superhero.contents) > 0: instruction_text = "Would you like to put a random card from under\nyour superhero and put it into your hand?" if effects.ok_or_no(instruction_text, player, self, ai_hint.RANDOM): random_card = random.choice(player.under_superhero.contents) random_card.pop_self() player.hand.contents.append(random_card) return 0 player.played.plus_power(2) return 0
def trigger(self, ttype, data, player, active, immediate): if globe.DEBUG: print("test", self.name, flush=True) if trigger.test(immediate,\ trigger.AVOIDED_ATTACK, \ self.trigger, \ player,ttype,active): if globe.DEBUG: print("active", self.name, flush=True) instruction_text = f"Would you like to that {data[2].name} on top of your deck?" if effects.ok_or_no(instruction_text,player,data[2],ai_hint.ALWAYS) \ and data[2].owner == player: data[2].pop_self() player.under_superhero.contents.append(data[2])
def trigger(self,ttype,data,player,active,immediate): if globe.DEBUG: print("test",self.name,flush=True) if trigger.test(immediate,\ trigger.GAIN_CARD, \ self.trigger, \ player,ttype,active) \ and data[0] == False \ and data[1].cost <= 5 \ and effects.ok_or_no(f"Would you like to put {data[1].name} on top of your deck?",player,data[1],ai_hint.ALWAYS): if globe.DEBUG: print("active",self.name,flush=True) player.deck.contents.append(data[1]) return True
def defend(self, attacker=None, defender=None): punch = None for c in self.owner.hand.contents: if c.name == "Punch": punch = c if punch != None: if effects.ok_or_no( "Would you like to discard one of your Punch cards?\nIf not, Girl Power will be discarded.", self.owner, self, ai_hint.ALWAYS): self.owner.discard_a_card(punch) self.owner.draw_card() return self.owner.discard_a_card(self) self.owner.draw_card() return
def trigger(self, ttype, data, player, active, immediate): if globe.DEBUG: print("test", self.name, flush=True) if trigger.test(immediate,\ trigger.GAIN_CARD, \ self.trigger, \ player,ttype,active) \ and data[1].owner_type == owners.LINEUP \ and data[1].ctype_eq(cardtype.VILLAIN) \ and data[0] == False \ and effects.ok_or_no(f"Would you like to put {data[1].name} under your Super Hero?",player,data[1],ai_hint.ALWAYS): if globe.DEBUG: print("active", self.name, flush=True) player.under_superhero.contents.append(data[1]) return True
def play_action(self, player): #If this is the first card played this turn if len(player.played.played_this_turn) == 1: instruction_text = f"Would you like to put {self.name} and your hand under your Super Hero?" if effects.ok_or_no(instruction_text, player, self, ai_hint.RANDOM): for c in player.hand.contents.copy(): c.pop_self() player.under_superhero.contents.append(c) self.pop_self() player.under_superhero.contents.append(self) player.draw_card(4) return 0 #Otherwise condition player.draw_card() return 0
def special_action_click(self, player): #We must ensure that we are doing this on our turn if player.pid == globe.boss.whose_turn: if self.player.played.power >= 4: self.player.played.power -= 4 card = globe.boss.main_deck.contents[-1] instruction_text = f"Would you like to put {card.name} on top of your deck?" result = effects.ok_or_no(instruction_text, self.player, card, ai_hint.ALWAYS) card = globe.boss.main_deck.contents.pop() card.set_owner(self.player) if result: self.player.deck.add(card) else: self.player.gain(card) return True return False
def trigger(self, ttype, data, player, active, immediate): if globe.DEBUG: print("test", self.name, flush=True) if trigger.test(not immediate,\ trigger.PLAY, \ self.trigger, \ player,ttype,active) \ and data[0].ctype_eq(cardtype.SUPERPOWER): if globe.DEBUG: print("active", self.name, flush=True) instruction_text = "Would you like to destory it? If you do, draw a card and gain 1 VP." if effects.ok_or_no(instruction_text, player, data[0], ai_hint.IFBAD): data[0].destroy(player) player.draw_card(from_card=False) player.gain_vp(1) player.triggers.remove(self.trigger)