def handle(self, evt_type, act): if evt_type == 'action_after' and isinstance(act, ActionStage): tgt = act.target if not tgt.has_skill(LittleLegion): return act c, = user_choose_cards( self, tgt, ('cards', 'showncards', 'equips')) or (None, ) if c is None: return act g = Game.getgame() assert 'equipment' in c.category category = c.equipment_category g.process_action(Reforge(tgt, tgt, c)) if tgt.dead: return act if category == 'weapon': g.process_action(LittleLegionAttackAction(tgt, tgt)) elif category == 'shield': g.process_action(LittleLegionCoverAction(tgt, tgt)) elif category == 'accessories': g.process_action(LittleLegionHoldAction(tgt, tgt)) elif category in ('redufo', 'greenufo'): g.process_action(LittleLegionControlAction(tgt, tgt)) return act
def apply_action(self): tgt = self.target c = self.card g = Game.getgame() tgt.reveal(c) migrate_cards([c], tgt.cards, unwrap=True) choice = user_input([tgt], ChooseOptionInputlet(self, ('reforge', 'action'))) if choice == 'reforge': g.process_action(TeachTargetReforgeAction(tgt, tgt)) else: act = TeachTargetActionStage(tgt) g.process_action(act) if act.action_count == 1: return False c = random_choose_card([tgt.cards, tgt.showncards, tgt.equips]) if not c: return False g.players.reveal(c) g.process_action(Reforge(tgt, tgt, c)) return True
def apply_action(self): g = Game.getgame() src, tgt, tl = self.source, self.target, self.target_list g.process_action(Reforge(src, tgt, self.card)) assert tgt in tl tl.remove(tgt) return True
def apply_action(self): src, tgt, c = self.source, self.target, self.card g = Game.getgame() g.process_action(Reforge(src, src, c)) g.process_action( LaunchCard(src, [tgt], XianshizhanAttackCard(src), bypass_check=True)) return True
def apply_action(self): g = Game.getgame() tgt = self.target c = user_choose_cards(self, tgt, ('cards', 'showncards', 'equips')) c = c[0] if c else random_choose_card( [tgt.cards, tgt.showncards, tgt.equips]) if not c: return False g.process_action(Reforge(tgt, tgt, c)) return True
def apply_action(self): src, tgt = self.source, self.target cl = VirtualCard.unwrap([self.associated_card]) assert len(cl) == 1 g = Game.getgame() ttags(src)['teach_used'] = True g.process_action(Reforge(src, src, cl[0])) cl = user_choose_cards(self, src, ('cards', 'showncards', 'equips')) c = cl[0] if cl else random_choose_card([src.cards, src.showncards, src.equips]) g.process_action(TeachTargetEffect(src, tgt, c)) return True
def apply_action(self): src, tgt = self.source, self.target ttags(src)['dismantle'] = True g = Game.getgame() c = user_input([src], ChoosePeerCardInputlet(self, tgt, ('equips', ))) c = c or random_choose_card([tgt.equips]) if not c: return False g.process_action(Reforge(src, tgt, c)) g.process_action(DrawCards(tgt, 1)) return True
def apply_action(self): src, tgt, cl = self.source, self.target, self.cards g = Game.getgame() c = user_input([src], ChooseIndividualCardInputlet(self, cl)) or random_choose_card([cl]) g.process_action(Reforge(src, tgt, c)) ''' candidates = [i for i in g.players if not i.dead] p, = user_choose_players(self, src, candidates) or (src,) g.process_action(DrawCards(p, 1)) ''' return True