Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Implement Retarget() for retargeting attacks
- Loading branch information
Showing
with
15 additions
and
0 deletions.
-
+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. |
|
|