mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Removed "all" from filter definition in ArenaOfTheAncients.java. Implemented BlinkmothUrn.java. Fixed bug in AmberPrison.java so that the controller is prompted whether to untap or not; before it was automatically untapping without asking.
This commit is contained in:
parent
9460be1a05
commit
9fc2b72093
3 changed files with 86 additions and 2 deletions
|
@ -26,7 +26,7 @@ import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||||
*/
|
*/
|
||||||
public class ArenaOfTheAncients extends CardImpl {
|
public class ArenaOfTheAncients extends CardImpl {
|
||||||
|
|
||||||
final static FilterCreaturePermanent legendaryFilter = new FilterCreaturePermanent("all legendary creatures");
|
final static FilterCreaturePermanent legendaryFilter = new FilterCreaturePermanent("legendary creatures");
|
||||||
static {
|
static {
|
||||||
legendaryFilter.add(new SupertypePredicate("Legendary"));
|
legendaryFilter.add(new SupertypePredicate("Legendary"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,8 @@ class AmberPrisonUntapTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
return event.getType().equals(GameEvent.EventType.UNTAPPED) && event.getTargetId().equals(this.getSourceId());
|
return event.getType().equals(GameEvent.EventType.UNTAP) && event.getTargetId().equals(this.getSourceId());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
83
Mage.Sets/src/mage/sets/mirrodin/BlinkmothUrn.java
Normal file
83
Mage.Sets/src/mage/sets/mirrodin/BlinkmothUrn.java
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package mage.sets.mirrodin;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.Mana;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.TargetController;
|
||||||
|
import mage.filter.common.FilterArtifactPermanent;
|
||||||
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author nickmyers
|
||||||
|
*/
|
||||||
|
public class BlinkmothUrn extends CardImpl {
|
||||||
|
|
||||||
|
public BlinkmothUrn(UUID ownerId) {
|
||||||
|
super(ownerId, 145, "Blinkmoth Urn", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}");
|
||||||
|
this.expansionSetCode = "MRD";
|
||||||
|
|
||||||
|
// At the beginning of each player's precombat main phase, if
|
||||||
|
// Blinkmoth Urn is untapped, that player adds {1} to his or her
|
||||||
|
// mana pool for each artifact he or she controls.
|
||||||
|
this.addAbility(new BeginningOfPreCombatMainTriggeredAbility(new BlinkmothUrnEffect(), TargetController.ANY, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlinkmothUrn(final BlinkmothUrn card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlinkmothUrn copy() {
|
||||||
|
return new BlinkmothUrn(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class BlinkmothUrnEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public BlinkmothUrnEffect() {
|
||||||
|
super(Outcome.PutManaInPool);
|
||||||
|
this.staticText = "if Blinkmoth Urn is untapped, that player adds {1} to his or her mana pool for each artifact he or she controls";
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlinkmothUrnEffect(final BlinkmothUrnEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlinkmothUrnEffect copy() {
|
||||||
|
return new BlinkmothUrnEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player player = game.getPlayer(game.getActivePlayerId());
|
||||||
|
FilterArtifactPermanent filter = new FilterArtifactPermanent("artifacts you control");
|
||||||
|
filter.add(new ControllerIdPredicate(game.getActivePlayerId()));
|
||||||
|
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||||
|
if(player != null && sourcePermanent != null && !sourcePermanent.isTapped()) {
|
||||||
|
player.getManaPool().addMana(Mana.ColorlessMana(
|
||||||
|
game.getState().
|
||||||
|
getBattlefield().
|
||||||
|
getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game).
|
||||||
|
size()), game, source, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue