mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Merge pull request #3971 from theelk801/mairsil2
Fixed issues with Mairsil (I think) re:#3963
This commit is contained in:
commit
6802b60d21
26 changed files with 325 additions and 684 deletions
|
|
@ -25,28 +25,24 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.costs.mana.ColoredManaCost;
|
||||
import mage.abilities.condition.common.SourceAttackingCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -55,19 +51,37 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class AncientHellkite extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
public AncientHellkite(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}{R}");
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
this.addAbility(new AncientHellkiteAbility());
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}"), SourceAttackingCondition.instance);
|
||||
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
||||
originalId = ability.getOriginalId();
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public AncientHellkite(final AncientHellkite card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)) {
|
||||
ability.getTargets().clear();
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
||||
filter.add(new ControllerIdPredicate(defenderId));
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
|
||||
ability.addTarget(target);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -76,71 +90,3 @@ public class AncientHellkite extends CardImpl {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class AncientHellkiteAbility extends ActivatedAbilityImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filterTemplate = new FilterCreaturePermanent("creature defending player controls");
|
||||
|
||||
public AncientHellkiteAbility() {
|
||||
super(Zone.BATTLEFIELD, new DamageTargetEffect(1));
|
||||
addCost(new AncientHellkiteCost());
|
||||
addManaCost(new ColoredManaCost(ColoredManaSymbol.R));
|
||||
addTarget(new TargetCreaturePermanent(filterTemplate));
|
||||
}
|
||||
|
||||
public AncientHellkiteAbility(final AncientHellkiteAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AncientHellkiteAbility copy() {
|
||||
return new AncientHellkiteAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate(Game game, boolean noMana) {
|
||||
UUID defenderId = game.getCombat().getDefenderId(sourceId);
|
||||
if (defenderId != null) {
|
||||
FilterCreaturePermanent filter = filterTemplate.copy();
|
||||
filter.add(new ControllerIdPredicate(defenderId));
|
||||
|
||||
this.getTargets().clear();
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
|
||||
this.addTarget(target);
|
||||
return super.activate(game, noMana);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class AncientHellkiteCost extends CostImpl {
|
||||
|
||||
public AncientHellkiteCost() {
|
||||
this.text = "Activate this ability only if Ancient Hellkite is attacking";
|
||||
}
|
||||
|
||||
public AncientHellkiteCost(final AncientHellkiteCost cost) {
|
||||
super(cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AncientHellkiteCost copy() {
|
||||
return new AncientHellkiteCost(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
|
||||
Permanent permanent = game.getPermanent(sourceId);
|
||||
if (permanent != null && permanent.isAttacking()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
this.paid = true;
|
||||
return paid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -29,13 +29,13 @@ package mage.cards.b;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
|
|
@ -43,6 +43,7 @@ import mage.abilities.keyword.FirstStrikeAbility;
|
|||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
|
@ -55,7 +56,7 @@ import mage.players.Player;
|
|||
public class BrutalDeceiver extends CardImpl {
|
||||
|
||||
public BrutalDeceiver(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
|
|
@ -65,9 +66,7 @@ public class BrutalDeceiver extends CardImpl {
|
|||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
|
||||
|
||||
// {2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains first strike until end of turn.
|
||||
Ability ability = new BrutalDeceiverAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{2}"));
|
||||
ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BrutalDeceiverEffect(), new ManaCostsImpl("{2}")));
|
||||
}
|
||||
|
||||
public BrutalDeceiver(final BrutalDeceiver card) {
|
||||
|
|
@ -80,38 +79,39 @@ public class BrutalDeceiver extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class BrutalDeceiverAbility extends LimitedTimesPerTurnActivatedAbility {
|
||||
class BrutalDeceiverEffect extends OneShotEffect {
|
||||
|
||||
public BrutalDeceiverAbility(Zone zone, Effect effect, Cost cost) {
|
||||
super(zone, effect, cost);
|
||||
public BrutalDeceiverEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains first strike until end of turn";
|
||||
}
|
||||
|
||||
public BrutalDeceiverAbility(BrutalDeceiverAbility ability) {
|
||||
super(ability);
|
||||
public BrutalDeceiverEffect(final BrutalDeceiverEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrutalDeceiverAbility copy() {
|
||||
return new BrutalDeceiverAbility(this);
|
||||
public BrutalDeceiverEffect copy() {
|
||||
return new BrutalDeceiverEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkIfClause(Game game) {
|
||||
Player player = game.getPlayer(this.getControllerId());
|
||||
if (player != null) {
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
cards.add(card);
|
||||
player.revealCards("Brutal Deceiver", cards, game);
|
||||
if (card != null && card.isLand()) {
|
||||
return true;
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.isLand()) {
|
||||
game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source);
|
||||
game.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains first strike until end of turn. Activate this ability only once each turn.";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,11 +52,10 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
*
|
||||
* @author cbt33
|
||||
*/
|
||||
|
||||
public class CabalInquisitor extends CardImpl {
|
||||
|
||||
public CabalInquisitor(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.MINION);
|
||||
|
||||
|
|
@ -82,11 +81,8 @@ public class CabalInquisitor extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl {
|
||||
|
||||
private Condition condition;
|
||||
|
||||
private static final Effects emptyEffects = new Effects();
|
||||
|
||||
public ActivateAsSorceryConditionalActivatedAbility(Zone zone, Effect effect, ManaCosts cost, Condition condition) {
|
||||
|
|
@ -95,10 +91,8 @@ class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl
|
|||
timing = TimingRule.SORCERY;
|
||||
}
|
||||
|
||||
|
||||
public ActivateAsSorceryConditionalActivatedAbility(final ActivateAsSorceryConditionalActivatedAbility ability) {
|
||||
super(ability);
|
||||
this.condition = ability.condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -109,14 +103,6 @@ class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl
|
|||
return super.getEffects(game, effectType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if (!condition.apply(game, this)) {
|
||||
return false;
|
||||
}
|
||||
return super.canActivate(playerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivateAsSorceryConditionalActivatedAbility copy() {
|
||||
return new ActivateAsSorceryConditionalActivatedAbility(this);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ import mage.players.Player;
|
|||
public class CallousDeceiver extends CardImpl {
|
||||
|
||||
public CallousDeceiver(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
||||
this.power = new MageInt(1);
|
||||
|
|
|
|||
|
|
@ -59,14 +59,14 @@ import mage.game.permanent.token.Token;
|
|||
public class ChronatogTotem extends CardImpl {
|
||||
|
||||
public ChronatogTotem(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
// {tap}: Add {U} to your mana pool.
|
||||
this.addAbility(new BlueManaAbility());
|
||||
|
||||
|
||||
// {1}{U}: Chronatog Totem becomes a 1/2 blue Atog artifact creature until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChronatogTotemToken(), "", Duration.EndOfTurn), new ManaCostsImpl<>("{1}{U}")));
|
||||
|
||||
|
||||
// {0}: Chronatog Totem gets +3/+3 until end of turn. You skip your next turn. Activate this ability only once each turn and only if Chronatog Totem is a creature.
|
||||
Ability ability = new ChronatogTotemAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
|
|
@ -91,8 +91,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
|
||||
private static final Effects emptyEffects = new Effects();
|
||||
|
||||
private final Condition condition;
|
||||
|
||||
public ChronatogTotemAbility(Zone zone, Effect effect, Cost cost, Condition condition) {
|
||||
super(zone, effect, cost);
|
||||
this.condition = condition;
|
||||
|
|
@ -100,7 +98,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
|
||||
public ChronatogTotemAbility(ChronatogTotemAbility ability) {
|
||||
super(ability);
|
||||
this.condition = ability.condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -111,14 +108,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
return super.getEffects(game, effectType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if (!condition.apply(game, this)) {
|
||||
return false;
|
||||
}
|
||||
return super.canActivate(playerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChronatogTotemAbility copy() {
|
||||
return new ChronatogTotemAbility(this);
|
||||
|
|
|
|||
|
|
@ -29,16 +29,17 @@ package mage.cards.c;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsDamageToACreatureTriggeredAbility;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
|
@ -55,7 +56,7 @@ import mage.players.Player;
|
|||
public class CruelDeceiver extends CardImpl {
|
||||
|
||||
public CruelDeceiver(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
|
|
@ -82,7 +83,7 @@ class CruelDeceiverEffect extends OneShotEffect {
|
|||
|
||||
public CruelDeceiverEffect() {
|
||||
super(Outcome.AddAbility);
|
||||
this.staticText = "Reveal the top card of your library. If it's a land card, {this} gets +2/+2 and gains trample until end of turn";
|
||||
this.staticText = "Reveal the top card of your library. If it's a land card, {this} gains \"Whenever Cruel Deceiver deals damage to a creature, destroy that creature\" until end of turn";
|
||||
}
|
||||
|
||||
public CruelDeceiverEffect(final CruelDeceiverEffect effect) {
|
||||
|
|
@ -96,15 +97,17 @@ class CruelDeceiverEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
cards.add(card);
|
||||
player.revealCards("Cruel Deceiver", cards, game);
|
||||
if (card != null && card.isLand()) {
|
||||
game.addEffect(new BoostSourceEffect(2,2,Duration.EndOfTurn), source);
|
||||
game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn), source);
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.isLand()) {
|
||||
game.addEffect(new GainAbilitySourceEffect(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, false, true), Duration.EndOfTurn), source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,19 +27,19 @@
|
|||
*/
|
||||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -48,10 +48,15 @@ import java.util.UUID;
|
|||
public class EvolvingWilds extends CardImpl {
|
||||
|
||||
public EvolvingWilds(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},null);
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, null);
|
||||
|
||||
// {T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.
|
||||
this.addAbility(new EvolvingWildsAbility());
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD), true),
|
||||
new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public EvolvingWilds(final EvolvingWilds card) {
|
||||
|
|
@ -64,24 +69,3 @@ public class EvolvingWilds extends CardImpl {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class EvolvingWildsAbility extends ActivatedAbilityImpl {
|
||||
|
||||
public EvolvingWildsAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
addCost(new TapSourceCost());
|
||||
addCost(new SacrificeSourceCost());
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD);
|
||||
addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay));
|
||||
}
|
||||
|
||||
public EvolvingWildsAbility(final EvolvingWildsAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EvolvingWildsAbility copy() {
|
||||
return new EvolvingWildsAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,21 +29,29 @@ package mage.cards.f;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.FeralDeceiverAbility;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -52,19 +60,17 @@ import mage.constants.Zone;
|
|||
public class FeralDeceiver extends CardImpl {
|
||||
|
||||
public FeralDeceiver(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// {1}: Look at the top card of your library.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
|
||||
|
||||
// {2}: Reveal the top card of your library. If it's a land card, {this} gets +2/+2 and gains trample until end of turn.
|
||||
Ability ability = new FeralDeceiverAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2,2,Duration.EndOfTurn), new ManaCostsImpl("{2}"));
|
||||
ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new FeralDeceiverEffect(), new ManaCostsImpl("{2}")));
|
||||
}
|
||||
|
||||
public FeralDeceiver(final FeralDeceiver card) {
|
||||
|
|
@ -77,3 +83,39 @@ public class FeralDeceiver extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class FeralDeceiverEffect extends OneShotEffect {
|
||||
|
||||
public FeralDeceiverEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Reveal the top card of your library. If it's a land card, {this} gets +2/+2 and gains trample until end of turn";
|
||||
}
|
||||
|
||||
public FeralDeceiverEffect(final FeralDeceiverEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeralDeceiverEffect copy() {
|
||||
return new FeralDeceiverEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.isLand()) {
|
||||
game.addEffect(new BoostSourceEffect(2, 2, Duration.EndOfTurn), source);
|
||||
game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,10 +28,11 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -52,7 +53,13 @@ public class GargoyleCastle extends CardImpl {
|
|||
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
// {T}, {5}, Sacrifice Gargoyle Castle: Put a 3/4 colorless Gargoyle artifact creature token with flying onto the battlefield.
|
||||
this.addAbility(new GargoyleCastleAbility());
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new CreateTokenEffect(new GargoyleToken()),
|
||||
new ManaCostsImpl("{5}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public GargoyleCastle(final GargoyleCastle card) {
|
||||
|
|
@ -64,25 +71,4 @@ public class GargoyleCastle extends CardImpl {
|
|||
return new GargoyleCastle(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class GargoyleCastleAbility extends ActivatedAbilityImpl {
|
||||
|
||||
public GargoyleCastleAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
addCost(new TapSourceCost());
|
||||
addCost(new GenericManaCost(5));
|
||||
addCost(new SacrificeSourceCost());
|
||||
addEffect(new CreateTokenEffect(new GargoyleToken()));
|
||||
}
|
||||
|
||||
public GargoyleCastleAbility(final GargoyleCastleAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GargoyleCastleAbility copy() {
|
||||
return new GargoyleCastleAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ public class GroundlingPouncer extends CardImpl {
|
|||
}
|
||||
|
||||
public GroundlingPouncer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G/U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G/U}");
|
||||
this.subtype.add(SubType.FAERIE);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
|
|
@ -97,7 +97,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
|
||||
private static final Effects emptyEffects = new Effects();
|
||||
|
||||
private final Condition condition;
|
||||
private final String ruleText;
|
||||
|
||||
public GroundlingPouncerAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) {
|
||||
|
|
@ -108,7 +107,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
|
||||
public GroundlingPouncerAbility(GroundlingPouncerAbility ability) {
|
||||
super(ability);
|
||||
this.condition = ability.condition;
|
||||
this.ruleText = ability.ruleText;
|
||||
}
|
||||
|
||||
|
|
@ -120,14 +118,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
return super.getEffects(game, effectType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if (!condition.apply(game, this)) {
|
||||
return false;
|
||||
}
|
||||
return super.canActivate(playerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GroundlingPouncerAbility copy() {
|
||||
return new GroundlingPouncerAbility(this);
|
||||
|
|
|
|||
|
|
@ -29,20 +29,28 @@ package mage.cards.h;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.FeralDeceiverAbility;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
||||
import mage.abilities.effects.common.UntapSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -51,19 +59,17 @@ import mage.constants.Zone;
|
|||
public class HarshDeceiver extends CardImpl {
|
||||
|
||||
public HarshDeceiver(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// {1}: Look at the top card of your library.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
|
||||
|
||||
// {2}: Reveal the top card of your library. If it's a land card, untap {this} and it gets +1/+1 until end of turn.
|
||||
Ability ability = new FeralDeceiverAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{2}"));
|
||||
ability.addEffect(new BoostSourceEffect(1,1,Duration.EndOfTurn));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new HarshDeceiverEffect(), new ManaCostsImpl("{2}")));
|
||||
}
|
||||
|
||||
public HarshDeceiver(final HarshDeceiver card) {
|
||||
|
|
@ -75,3 +81,40 @@ public class HarshDeceiver extends CardImpl {
|
|||
return new HarshDeceiver(this);
|
||||
}
|
||||
}
|
||||
|
||||
class HarshDeceiverEffect extends OneShotEffect {
|
||||
|
||||
public HarshDeceiverEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Reveal the top card of your library. If it's a land card, untap {this} and it gets +1/+1 until end of turn";
|
||||
}
|
||||
|
||||
public HarshDeceiverEffect(final HarshDeceiverEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HarshDeceiverEffect copy() {
|
||||
return new HarshDeceiverEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.isLand()) {
|
||||
new UntapSourceEffect().apply(game, source);
|
||||
game.addEffect(new BoostSourceEffect(1, 1, Duration.EndOfTurn), source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ import mage.players.Player;
|
|||
public class KyrenToy extends CardImpl {
|
||||
|
||||
public KyrenToy(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
// {1}, {T}: Put a charge counter on Kyren Toy.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance(1)), new GenericManaCost(1));
|
||||
|
|
@ -95,7 +95,7 @@ public class KyrenToy extends CardImpl {
|
|||
|
||||
KyrenToyManaEffect() {
|
||||
super();
|
||||
staticText = "Add X mana of {C} to your mana pool, and then add {C} to your mana pool";
|
||||
staticText = "Add an amount of {C} to your mana pool equal to X plus one";
|
||||
}
|
||||
|
||||
KyrenToyManaEffect(final KyrenToyManaEffect effect) {
|
||||
|
|
|
|||
|
|
@ -27,21 +27,14 @@
|
|||
*/
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbility;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -54,7 +47,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.SubLayer;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
|
|
@ -63,15 +55,11 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
import mage.filter.predicate.other.CounterCardPredicate;
|
||||
import mage.filter.predicate.other.OwnerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.StackAbility;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -93,8 +81,7 @@ public class MairsilThePretender extends CardImpl {
|
|||
|
||||
// Mairsil, the Pretender has all activated abilities of all cards you own in exile with cage counters on them. You may activate each of those abilities only once each turn.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new MairsilThePretenderGainAbilitiesEffect());
|
||||
ability.addEffect(new MairsilThePretenderRuleModifyingEffect());
|
||||
this.addAbility(ability, new MairsilThePretenderWatcher());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public MairsilThePretender(final MairsilThePretender card) {
|
||||
|
|
@ -182,11 +169,8 @@ class MairsilThePretenderGainAbilitiesEffect extends ContinuousEffectImpl {
|
|||
if (filter.match(card, game)) {
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof ActivatedAbility) {
|
||||
UUID originaId = ability.getId();
|
||||
ActivatedAbility copyAbility = (ActivatedAbility) ability.copy();
|
||||
Effect effect = new DoNothingEffect();
|
||||
effect.setValue("key", originaId);
|
||||
copyAbility.addEffect(effect);
|
||||
ActivatedAbilityImpl copyAbility = (ActivatedAbilityImpl) ability.copy();
|
||||
copyAbility.setMaxActivationsPerTurn(1);
|
||||
perm.addAbility(copyAbility, card.getId(), game);
|
||||
}
|
||||
}
|
||||
|
|
@ -202,135 +186,3 @@ class MairsilThePretenderGainAbilitiesEffect extends ContinuousEffectImpl {
|
|||
return new MairsilThePretenderGainAbilitiesEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MairsilThePretenderWatcher extends Watcher {
|
||||
|
||||
public final Map<UUID, Set<UUID>> activatedThisTurnAbilities = new HashMap<>();
|
||||
|
||||
public MairsilThePretenderWatcher() {
|
||||
super(MairsilThePretenderWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public MairsilThePretenderWatcher(final MairsilThePretenderWatcher watcher) {
|
||||
super(watcher);
|
||||
for (Entry<UUID, Set<UUID>> entry : watcher.activatedThisTurnAbilities.entrySet()) {
|
||||
activatedThisTurnAbilities.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event instanceof ZoneChangeEvent) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
|
||||
Permanent permanent = zEvent.getTarget();
|
||||
if (permanent != null) {
|
||||
this.activatedThisTurnAbilities.remove(permanent.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) {
|
||||
Set<UUID> permAbilities;
|
||||
if (activatedThisTurnAbilities.keySet().contains(event.getSourceId())) {
|
||||
permAbilities = activatedThisTurnAbilities.get(event.getSourceId());
|
||||
} else {
|
||||
permAbilities = new HashSet<>();
|
||||
}
|
||||
StackAbility ability = (StackAbility) game.getStack().getStackObject(event.getSourceId());
|
||||
if (ability != null && ability.getStackAbility().isActivated()) {
|
||||
for (Effect effect : ability.getAllEffects()) {
|
||||
if (effect instanceof DoNothingEffect) {
|
||||
permAbilities.add((UUID) effect.getValue("key"));
|
||||
this.activatedThisTurnAbilities.put(event.getSourceId(), permAbilities);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
activatedThisTurnAbilities.clear();
|
||||
}
|
||||
|
||||
public Map<UUID, Set<UUID>> getActivatedThisTurnAbilities() {
|
||||
return this.activatedThisTurnAbilities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MairsilThePretenderWatcher copy() {
|
||||
return new MairsilThePretenderWatcher(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MairsilThePretenderRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
public MairsilThePretenderRuleModifyingEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
}
|
||||
|
||||
public MairsilThePretenderRuleModifyingEffect(final MairsilThePretenderRuleModifyingEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MairsilThePretenderRuleModifyingEffect copy() {
|
||||
return new MairsilThePretenderRuleModifyingEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ACTIVATE_ABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Optional<Ability> ability = game.getAbility(event.getTargetId(), event.getSourceId());
|
||||
MairsilThePretenderWatcher watcher = (MairsilThePretenderWatcher) game.getState().getWatchers().get(MairsilThePretenderWatcher.class.getSimpleName());
|
||||
if (watcher != null && ability != null && ability.isPresent()) {
|
||||
for (Effect effect : ability.get().getAllEffects()) {
|
||||
if (effect instanceof DoNothingEffect) {
|
||||
UUID originalID = (UUID) effect.getValue("key");
|
||||
if (watcher.getActivatedThisTurnAbilities().keySet().contains(event.getSourceId())) {
|
||||
if (watcher.getActivatedThisTurnAbilities().get(event.getSourceId()).contains(originalID)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
return "This ability can only be activated once each turn.";
|
||||
}
|
||||
}
|
||||
|
||||
class DoNothingEffect extends OneShotEffect {
|
||||
|
||||
DoNothingEffect() {
|
||||
super(Outcome.Neutral);
|
||||
}
|
||||
|
||||
DoNothingEffect(final DoNothingEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DoNothingEffect copy() {
|
||||
return new DoNothingEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,17 +30,13 @@ package mage.cards.m;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.TopLibraryCardTypeCondition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -48,7 +44,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -59,7 +54,7 @@ public class MulDayaChannelers extends CardImpl {
|
|||
private static final String rule1 = "As long as the top card of your library is a creature card, {this} gets +3/+3";
|
||||
|
||||
public MulDayaChannelers(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{G}");
|
||||
this.subtype.add(SubType.ELF);
|
||||
this.subtype.add(SubType.DRUID);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
|
|
@ -81,7 +76,7 @@ public class MulDayaChannelers extends CardImpl {
|
|||
new TopLibraryCardTypeCondition(CardType.LAND),
|
||||
"As long as the top card of your library is a land card, Mul Daya Channelers has \"{T}: Add two mana of any one color to your mana pool.\"");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public MulDayaChannelers(final MulDayaChannelers card) {
|
||||
|
|
@ -93,46 +88,3 @@ public class MulDayaChannelers extends CardImpl {
|
|||
return new MulDayaChannelers(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MulDayaChannelersActivateIfConditionManaAbility extends ActivatedManaAbilityImpl {
|
||||
|
||||
private Condition condition;
|
||||
|
||||
public MulDayaChannelersActivateIfConditionManaAbility(Zone zone, ManaEffect effect, Cost cost, Condition condition) {
|
||||
super(zone, effect, cost);
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
public MulDayaChannelersActivateIfConditionManaAbility(MulDayaChannelersActivateIfConditionManaAbility ability) {
|
||||
super(ability);
|
||||
this.condition = ability.condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if (condition.apply(game, this)) {
|
||||
return super.canActivate(playerId, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate(Game game, boolean noMana) {
|
||||
if (canActivate(this.controllerId, game)) {
|
||||
return super.activate(game, noMana);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "As long as the top card of your library is a land card, {this} has \"{T}: Add two mana of any one color to your mana pool.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public MulDayaChannelersActivateIfConditionManaAbility copy() {
|
||||
return new MulDayaChannelersActivateIfConditionManaAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
|||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.effects.AsThoughManaEffect;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
|
|
@ -89,14 +91,14 @@ public class QuicksilverElemental extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class QuicksilverElementalEffect extends ContinuousEffectImpl {
|
||||
class QuicksilverElementalEffect extends OneShotEffect {
|
||||
|
||||
public QuicksilverElementalEffect() {
|
||||
super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
QuicksilverElementalEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "{this} gains all activated abilities of target creature until end of turn";
|
||||
}
|
||||
|
||||
public QuicksilverElementalEffect(final QuicksilverElementalEffect effect) {
|
||||
QuicksilverElementalEffect(final QuicksilverElementalEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -112,13 +114,46 @@ class QuicksilverElementalEffect extends ContinuousEffectImpl {
|
|||
|
||||
if (permanent != null && creature != null) {
|
||||
for (ActivatedAbility ability : creature.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD)) {
|
||||
permanent.addAbility(ability, source.getSourceId(), game);
|
||||
Ability newAbility = ability.copy();
|
||||
newAbility.newOriginalId();
|
||||
game.addEffect(new GainAbilitySourceEffect(newAbility, Duration.EndOfTurn), source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//class QuicksilverElementalEffect extends ContinuousEffectImpl {
|
||||
//
|
||||
// public QuicksilverElementalEffect() {
|
||||
// super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
// staticText = "{this} gains all activated abilities of target creature until end of turn";
|
||||
// }
|
||||
//
|
||||
// public QuicksilverElementalEffect(final QuicksilverElementalEffect effect) {
|
||||
// super(effect);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public QuicksilverElementalEffect copy() {
|
||||
// return new QuicksilverElementalEffect(this);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean apply(Game game, Ability source) {
|
||||
// Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
// Permanent creature = game.getPermanent(source.getTargets().getFirstTarget());
|
||||
//
|
||||
// if (permanent != null && creature != null) {
|
||||
// for (ActivatedAbility ability : creature.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD)) {
|
||||
// permanent.addAbility(ability, source.getSourceId(), game);
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
|
||||
class QuickSilverElementalBlueManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect {
|
||||
|
||||
public QuickSilverElementalBlueManaEffect() {
|
||||
|
|
|
|||
|
|
@ -25,22 +25,21 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -49,8 +48,14 @@ import java.util.UUID;
|
|||
public class TerramorphicExpanse extends CardImpl {
|
||||
|
||||
public TerramorphicExpanse(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},null);
|
||||
this.addAbility(new TerramorphicExpanseAbility());
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, null);
|
||||
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD), true),
|
||||
new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public TerramorphicExpanse(final TerramorphicExpanse card) {
|
||||
|
|
@ -63,24 +68,3 @@ public class TerramorphicExpanse extends CardImpl {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class TerramorphicExpanseAbility extends ActivatedAbilityImpl {
|
||||
|
||||
public TerramorphicExpanseAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
addCost(new TapSourceCost());
|
||||
addCost(new SacrificeSourceCost());
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD);
|
||||
addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay));
|
||||
}
|
||||
|
||||
public TerramorphicExpanseAbility(final TerramorphicExpanseAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerramorphicExpanseAbility copy() {
|
||||
return new TerramorphicExpanseAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.cards.w;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.IsStepCondition;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.Effects;
|
||||
|
|
@ -71,8 +70,6 @@ public class WellOfKnowledge extends CardImpl {
|
|||
|
||||
class WellOfKnowledgeConditionalActivatedAbility extends ActivatedAbilityImpl {
|
||||
|
||||
private final Condition condition;
|
||||
|
||||
public WellOfKnowledgeConditionalActivatedAbility() {
|
||||
super(Zone.BATTLEFIELD, new WellOfKnowledgeEffect(), new GenericManaCost(2));
|
||||
condition = new IsStepCondition(PhaseStep.DRAW, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue