Permalink
Browse files

Implement Retarget() for retargeting attacks

  • Loading branch information...
jleclanche committed Sep 6, 2015
1 parent c6fa3f3 commit 6e41183f2f5f27276a9f558312be53ddc237c87f
Showing with 15 additions and 0 deletions.
  1. +15 −0 fireplace/actions.py
@@ -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.

0 comments on commit 6e41183

Please sign in to comment.