示例#1
0
 def basicEffect(self, match, player):
     options = [effects.AttackPoints(2),
                effects.BlockPoints(2),
                effects.AttackPoints(1, range=AttackRange.range)
               ]
     effect = dialogs.choose(options)
     match.effects.add(effect)
示例#2
0
 def _effect(self, match, player, amount):
     card = dialogs.chooseCard(player)
     player.handCards.remove(card)
     options = [effects.MovePoints(amount),
                effects.InfluencePoints(amount),
                effects.AttackPoints(amount),
                effects.BlockPoints(amount)
               ]
     match.effects.add(dialogs.choose(options))
示例#3
0
 def strongEffect(self, match, player):
     options = [effects.AttackPoints(4),
                effects.BlockPoints(4),
                effects.AttackPoints(3, element=Element.fire),
                effects.BlockPoints(3, element=Element.fire),
                effects.AttackPoints(3, range=AttackRange.range),
                effects.AttackPoints(2, range=AttackRange.siege)
               ]
     effect = dialogs.choose(options)
     match.effects.add(effect)
示例#4
0
 def _getUnit(self, player, unit, reward):
     # This helper function is used in recruitUnit (reward=False)
     # and when a player gets a unit as reward (reward=True)
     if player.unitLimit <= len(player.units): # TODO: special case (reward+level-up)
         unitToDisband = dialogs.choose(player.units,
                                        text=self.tr("All slots occupied. Choose a unit to disband."))
         player.units.remove(unitToDisband)
     if not reward:
         self.payInfluencePoints(unit.cost)
     self.shop.units.remove(unit)
     player.units.append(unit)
示例#5
0
 def payMana(self, color):
     """Pay a mana in the given color."""
     options = self._manaOptions(self.currentPlayer, color)
     if len(options) == 0:
         if self.source.limit == 0:
             raise InvalidAction("You don't have mana (cannot use another die).")
         else: raise InvalidAction("You don't have mana.")
     
     if len(options) == 1 and options[0][0] != 'crystal': # always ask before using crystals
         type, color, _ = options[0]
     else:            
         type, color, _ = dialogs.choose(options, labelFunc=lambda t: t[2], title=self.tr("Pay mana"))
     if type == 'token':
         self.effects.remove(effects.ManaTokens(color))
     elif type == 'die':
         self.source.take(color)
     else:
         self.currentPlayer.removeCrystal(color)
示例#6
0
 def onEndOfTurn(self, match, player):
     options = []
     if any(card.isWound for card in player.handCards):
         options.append(('hand', translate('sites', "Yes, from hand")))
     if any(card.isWound for card in player.discardPile):
         options.append(('discardPile', translate('sites', "Yes, from discard pile")))
     
     if len(options) > 0:
         options.append(('no', translate('sites', "No")))
         option = dialogs.choose(
                         options,
                         labelFunc = lambda t: t[1],
                         text = translate('sites', "Magical glade: Do you wish to discard a wound?"),
                         default = options[-1])
         
         if option[0] == 'hand':
             player.heal()
         elif option[0] == 'discardPile':
             player.heal(fromDiscardPile=True)
示例#7
0
 def ability1(self, match, player):
     options = [effects.AttackPoints(2), effects.BlockPoints(2)]
     match.effects.add(dialogs.choose(options))
示例#8
0
 def ability2(self, match, player):
     options = [effects.AttackPoints(6), effects.BlockPoints(6)]
     match.effects.add(dialogs.choose(options))
     player.woundUnit(self)
示例#9
0
 def ability2(self, match, player):
     options = [effects.AttackPoints(4, element=Element.fire),
                effects.BlockPoints(4, element=Element.fire)]
     match.effects.add(dialogs.choose(options))
示例#10
0
 def basicEffect(self, match, player):
     options = [effects.AttackPoints(2, element=Element.ice),
                effects.BlockPoints(3, element=Element.ice),
               ]
     effect = dialogs.choose(options)
     match.effects.add(effect)