mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +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.events.GameEvent;
|
||||
import mage.game.permanent.token.TreasureToken;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
@ -93,14 +94,15 @@ class VaziKeenNegotiatorOpponentCastsOrActivatesTriggeredAbility extends Trigger
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Player controller = game.getPlayer(getControllerId());
|
||||
Player caster = game.getPlayer(event.getPlayerId());
|
||||
Optional<Ability> optionalAbility = game.getAbility(event.getTargetId(), this.sourceId);
|
||||
if (controller == null
|
||||
|| caster == null
|
||||
|| !game.getOpponents(controller.getId()).contains(caster.getId())
|
||||
|| !optionalAbility.isPresent()) {
|
||||
|| !game.getOpponents(controller.getId()).contains(caster.getId())) {
|
||||
return false;
|
||||
}
|
||||
return TreasureSpentToCastCondition.instance.apply(game, optionalAbility.get());
|
||||
|
||||
Ability ability = game.getStack().getStackObject(event.getTargetId()).getStackAbility();
|
||||
|
||||
return TreasureSpentToCastCondition.instance.apply(game, ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue