コード例 #1
0
ファイル: Player.py プロジェクト: trunghuynh/incantus
 def create_copy(self, card):
     copy = CardCopy.create(name=str(card.name), owner=self)
     copy.clone(card)
     # Make sure it copies when it moves to the stack
     def modifyNewRole(self, new, zone):
         if str(zone) == "stack": new.clone(card)
     override(copy, "modifyNewRole", modifyNewRole)
     return self.exile.add_new_card(copy)
コード例 #2
0
ファイル: Player.py プロジェクト: Incantus/incantus
 def create_copy(self, card):
     copy = CardCopy.create(name=str(card.name), owner=self)
     copy.clone(card)
     # Make sure it copies when it moves to the stack
     def modifyNewRole(self, new, zone):
         if str(zone) == "stack": new.clone(card)
     override(copy, "modifyNewRole", modifyNewRole)
     return self.exile.add_new_card(copy)
コード例 #3
0
ファイル: GameKeeper.py プロジェクト: Incantus/incantus
    def run(self):
        self.send(GameStartEvent())

        # skip the first draw step
        def skipDraw(self): skipDraw.expire()
        override(self, "drawStep", skipDraw)

        _phases = ("newTurn", ("untapStep", "upkeepStep", "drawStep"), "mainPhase1", "combatPhase", "mainPhase2", "endPhase")
        for phase in itertools.cycle(_phases):
            if isinstance(phase, tuple):
                for step in phase:
                    getattr(self, step)()
                    self.emptyManaPools()
            else: 
                getattr(self, phase)()
                self.emptyManaPools()
コード例 #4
0
    def run(self):
        self.send(GameStartEvent())

        # skip the first draw step
        def skipDraw(self):
            skipDraw.expire()

        override(self, "drawStep", skipDraw)

        _phases = ("newTurn", ("untapStep", "upkeepStep", "drawStep"),
                   "mainPhase1", "combatPhase", "mainPhase2", "endPhase")
        for phase in itertools.cycle(_phases):
            if isinstance(phase, tuple):
                for step in phase:
                    getattr(self, step)()
                    self.emptyManaPools()
            else:
                getattr(self, phase)()
                self.emptyManaPools()
コード例 #5
0
ファイル: Player.py プロジェクト: Incantus/incantus
 def setup_special_action(self, action):
     #408.2i. Some effects allow a player to take an action at a later time, usually to end a continuous effect or to stop a delayed triggered ability. This is a special action. A player can stop a delayed triggered ability from triggering or end a continuous effect only if the ability or effect allows it and only when he or she has priority. The player who took the action gets priority after this special action.
     #408.2j. Some effects from static abilities allow a player to take an action to ignore the effect from that ability for a duration. This is a special action. A player can take an action to ignore an effect only when he or she has priority. The player who took the action gets priority after this special action. (Only 3 cards use this: Damping Engine, Lost in Thought, Volrath's Curse)
     return override(self, "get_special_actions", lambda self: [action])