Fixed some exception problems.

This commit is contained in:
LevelX2 2018-01-27 11:42:43 +01:00
parent 9eb71e24be
commit 6b90c1fd7f
7 changed files with 32 additions and 19 deletions

View file

@ -53,14 +53,15 @@ import mage.target.common.TargetOpponent;
public class EternalDominion extends CardImpl {
public EternalDominion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{7}{U}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{7}{U}{U}{U}");
// Search target opponent's library for an artifact, creature, enchantment, or land card.
// Put that card onto the battlefield under your control. Then that player shuffles his or her library.
this.getSpellAbility().addEffect(new EternalDominionEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
// Epic
// Epic (For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps
// for the rest of the game, copy this spell except for its epic ability. If the spell has targets, you may choose new targets for the copy)
this.getSpellAbility().addEffect(new EpicEffect());
}

View file

@ -126,13 +126,15 @@ class PathOfMettleTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
int attackerCount = 0;
if (game.getCombat().getAttackingPlayerId().equals(getControllerId())) {
for (UUID attacker : game.getCombat().getAttackers()) {
if (filter.match(game.getPermanent(attacker), game)) {
attackerCount++;
if (game.getCombat() != null) {
if (getControllerId().equals(game.getCombat().getAttackingPlayerId())) {
for (UUID attacker : game.getCombat().getAttackers()) {
if (filter.match(game.getPermanent(attacker), game)) {
attackerCount++;
}
}
return attackerCount >= 2;
}
return attackerCount >= 2;
}
return false;