Skip to content

Commit

Permalink
Implement Retarget() for retargeting attacks
Browse files Browse the repository at this point in the history
  • Loading branch information
jleclanche committed Sep 6, 2015
1 parent c6fa3f3 commit 6e41183
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fireplace/actions.py
Expand Up @@ -611,6 +611,21 @@ def do(self, source, target, amount):
target.used_mana -= amount


class Retarget(TargetedAction):
class Args(Action.Args):
TARGETS = 0
CARDS = 1

def do(self, source, target, new_target):
assert len(new_target) == 1
new_target = new_target[0]
logger.info("Retargeting %r's attack to %r", source, new_target)
source.game.proposed_defender.defending = False
source.game.proposed_defender = new_target

return new_target


class Reveal(TargetedAction):
"""
Reveal secret targets.
Expand Down

0 comments on commit 6e41183

Please sign in to comment.