Skip to content

Commit 6e41183

Browse files
committed
Implement Retarget() for retargeting attacks
1 parent c6fa3f3 commit 6e41183

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎fireplace/actions.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,21 @@ def do(self, source, target, amount):
611611
target.used_mana -= amount
612612

613613

614+
class Retarget(TargetedAction):
615+
class Args(Action.Args):
616+
TARGETS = 0
617+
CARDS = 1
618+
619+
def do(self, source, target, new_target):
620+
assert len(new_target) == 1
621+
new_target = new_target[0]
622+
logger.info("Retargeting %r's attack to %r", source, new_target)
623+
source.game.proposed_defender.defending = False
624+
source.game.proposed_defender = new_target
625+
626+
return new_target
627+
628+
614629
class Reveal(TargetedAction):
615630
"""
616631
Reveal secret targets.

0 commit comments

Comments
 (0)