mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[C21] Fix Combat Calligrapher trigger. Closes #8580.
This commit is contained in:
parent
80446260cc
commit
7fda27cb7e
1 changed files with 8 additions and 2 deletions
|
@ -18,6 +18,8 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.InklingToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -78,10 +80,14 @@ class CombatCalligrapherTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!game.getOpponents(getControllerId()).contains(event.getTargetId())) {
|
||||
Player attacker = game.getPlayer(event.getPlayerId());
|
||||
Player defender = game.getPlayer(event.getTargetId());
|
||||
if (!game.getOpponents(getControllerId()).contains(attacker.getId())
|
||||
|| !game.getOpponents(getControllerId()).contains(defender.getId())) {
|
||||
return false;
|
||||
}
|
||||
getEffects().setValue("playerToAttack", event.getPlayerId());
|
||||
getEffects().setValue("playerToAttack", defender.getId());
|
||||
getEffects().setTargetPointer(new FixedTarget(attacker.getId()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue