Fixed Tezzeret, Master of Metal gain control effect. Fixed Whir of Invention card type.

This commit is contained in:
fireshoes 2017-01-09 15:42:43 -06:00
parent de3c6168d8
commit 8078e178e5
3 changed files with 158 additions and 159 deletions

View file

@ -1,156 +1,156 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.t;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.RevealCardsFromLibraryUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactCard;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author Styxo
*/
public class TezzeretMasterOfMetal extends CardImpl {
public TezzeretMasterOfMetal(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{U}{B}");
this.subtype.add("Tezzeret");
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
// +1: Reveal cards from the top of your library until you reveal an artifact card. Put that card into your hand and the rest on the bottom of your library in a random order.
this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(new FilterArtifactCard(), Zone.HAND, Zone.LIBRARY), 1));
// -3: Target opponent loses life equal to the number of artifacts you control.
Ability ability = new LoyaltyAbility(new LoseLifeTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent())), -3);
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
// -8: Gain control of all artifacts and creatures target opponent controls.
ability = new LoyaltyAbility(new TezzeretMasterOfMetalEffect(), -8);
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
}
public TezzeretMasterOfMetal(final TezzeretMasterOfMetal card) {
super(card);
}
@Override
public TezzeretMasterOfMetal copy() {
return new TezzeretMasterOfMetal(this);
}
}
class TezzeretMasterOfMetalEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterPermanent("artifacts and creatures");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.ARTIFACT)));
}
public TezzeretMasterOfMetalEffect() {
super(Outcome.GainControl);
this.staticText = "Gain control of all artifacts and creatures target opponent controls";
}
public TezzeretMasterOfMetalEffect(final TezzeretMasterOfMetalEffect effect) {
super(effect);
}
@Override
public TezzeretMasterOfMetalEffect copy() {
return new TezzeretMasterOfMetalEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, targetPointer.getFirst(game, source), game);
for (Permanent permanent : permanents) {
ContinuousEffect effect = new TibaltTheFiendBloodedControlEffect(source.getControllerId());
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
}
return true;
}
}
class TezzeretMasterOfMetalControlEffect extends ContinuousEffectImpl {
private final UUID controllerId;
public TezzeretMasterOfMetalControlEffect(UUID controllerId) {
super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl);
this.controllerId = controllerId;
}
public TezzeretMasterOfMetalControlEffect(final TezzeretMasterOfMetalControlEffect effect) {
super(effect);
this.controllerId = effect.controllerId;
}
@Override
public TezzeretMasterOfMetalControlEffect copy() {
return new TezzeretMasterOfMetalControlEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null && controllerId != null) {
return permanent.changeControllerId(controllerId, game);
}
return false;
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.t;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.RevealCardsFromLibraryUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactCard;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author Styxo
*/
public class TezzeretMasterOfMetal extends CardImpl {
public TezzeretMasterOfMetal(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{U}{B}");
this.subtype.add("Tezzeret");
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
// +1: Reveal cards from the top of your library until you reveal an artifact card. Put that card into your hand and the rest on the bottom of your library in a random order.
this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(new FilterArtifactCard(), Zone.HAND, Zone.LIBRARY), 1));
// -3: Target opponent loses life equal to the number of artifacts you control.
Ability ability = new LoyaltyAbility(new LoseLifeTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent())), -3);
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
// -8: Gain control of all artifacts and creatures target opponent controls.
ability = new LoyaltyAbility(new TezzeretMasterOfMetalEffect(), -8);
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
}
public TezzeretMasterOfMetal(final TezzeretMasterOfMetal card) {
super(card);
}
@Override
public TezzeretMasterOfMetal copy() {
return new TezzeretMasterOfMetal(this);
}
}
class TezzeretMasterOfMetalEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterPermanent("artifacts and creatures");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.ARTIFACT)));
}
public TezzeretMasterOfMetalEffect() {
super(Outcome.GainControl);
this.staticText = "Gain control of all artifacts and creatures target opponent controls";
}
public TezzeretMasterOfMetalEffect(final TezzeretMasterOfMetalEffect effect) {
super(effect);
}
@Override
public TezzeretMasterOfMetalEffect copy() {
return new TezzeretMasterOfMetalEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, targetPointer.getFirst(game, source), game);
for (Permanent permanent : permanents) {
ContinuousEffect effect = new TezzeretMasterOfMetalControlEffect(source.getControllerId());
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
}
return true;
}
}
class TezzeretMasterOfMetalControlEffect extends ContinuousEffectImpl {
private final UUID controllerId;
public TezzeretMasterOfMetalControlEffect(UUID controllerId) {
super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl);
this.controllerId = controllerId;
}
public TezzeretMasterOfMetalControlEffect(final TezzeretMasterOfMetalControlEffect effect) {
super(effect);
this.controllerId = effect.controllerId;
}
@Override
public TezzeretMasterOfMetalControlEffect copy() {
return new TezzeretMasterOfMetalControlEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null && controllerId != null) {
return permanent.changeControllerId(controllerId, game);
}
return false;
}
}

View file

@ -52,8 +52,7 @@ import mage.target.common.TargetCardInLibrary;
public class WhirOfInvention extends CardImpl {
public WhirOfInvention(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}{U}{U}");
// Improvise <i>(Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)
addAbility(new ImproviseAbility());

View file

@ -30403,7 +30403,7 @@ Shipwreck Moray|Aether Revolt|45|C|{3}{U}|Creature - Fish|0|5|When Shipwreck Mor
Skyship Plunderer|Aether Revolt|46|U|{1}{U}|Creature - Human Pirate|2|1|Flying$Whenever Skyship Plunderer deals combat damage to a player, for each kind of counter on target permanent or player, give that permanent or player another counter of that kind.|
Take into Custody|Aether Revolt|47|C|{U}|Instant|||Tap target creature. It doesn't untap during its controller's next untap step.|
Trophy Mage|Aether Revolt|48|U|{2}{U}|Creature - Human Wizard|2|2|When Trophy Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 3, reveal it, put it into your hand, then shuffle your library.|
Whir of Invention|Aether Revolt|49|R|{X}{U}{U}{U}|Sorcery|||Improvise <i>(Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Search your library for an artifact card with converted mana cost X or less, put it onto the battlefield, then shuffle your library.|
Whir of Invention|Aether Revolt|49|R|{X}{U}{U}{U}|Instant|||Improvise <i>(Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Search your library for an artifact card with converted mana cost X or less, put it onto the battlefield, then shuffle your library.|
Wind-King Raiders|Aether Revolt|50|U|{4}{U}{U}|Creature - Human Artificer|4|3|Improvise <i>(Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)</i>$Flying|
Aether Poisoner|Aether Revolt|51|C|{1}{B}|Creature - Human Artificer|1|1|Deathtouch <i>(Any amount of damage this deals to a creature is enough to destroy it.)</i>$When Aether Poisoner enters the battlefield, you get {E}{E} <i>(two energy counters)</i>.$Whenever Aether Poisoner attacks, you may pay {E}{E}. If you do, create a 1/1 colorless Servo artifact creature token.|
Alley Strangler|Aether Revolt|52|C|{2}{B}|Creature - Aetherborn Rogue|2|3|Menace|