mirror of
https://github.com/correl/mage.git
synced 2024-12-27 20:06:31 +00:00
Fixed Vazi's triggered ability (#9883)
This commit is contained in:
parent
383c83f74a
commit
94ff57f992
1 changed files with 6 additions and 4 deletions
|
@ -23,6 +23,7 @@ import mage.counters.CounterType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.token.TreasureToken;
|
import mage.game.permanent.token.TreasureToken;
|
||||||
|
import mage.game.stack.StackObject;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
|
@ -93,14 +94,15 @@ class VaziKeenNegotiatorOpponentCastsOrActivatesTriggeredAbility extends Trigger
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Player controller = game.getPlayer(getControllerId());
|
Player controller = game.getPlayer(getControllerId());
|
||||||
Player caster = game.getPlayer(event.getPlayerId());
|
Player caster = game.getPlayer(event.getPlayerId());
|
||||||
Optional<Ability> optionalAbility = game.getAbility(event.getTargetId(), this.sourceId);
|
|
||||||
if (controller == null
|
if (controller == null
|
||||||
|| caster == null
|
|| caster == null
|
||||||
|| !game.getOpponents(controller.getId()).contains(caster.getId())
|
|| !game.getOpponents(controller.getId()).contains(caster.getId())) {
|
||||||
|| !optionalAbility.isPresent()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return TreasureSpentToCastCondition.instance.apply(game, optionalAbility.get());
|
|
||||||
|
Ability ability = game.getStack().getStackObject(event.getTargetId()).getStackAbility();
|
||||||
|
|
||||||
|
return TreasureSpentToCastCondition.instance.apply(game, ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue