Remove most "has been deprecated" errors

This commit is contained in:
Luna Skyrise 2015-05-18 18:35:51 -03:00
parent cc638261d8
commit d82b57d6bb
25 changed files with 292 additions and 289 deletions

View file

@ -105,7 +105,7 @@ class DarkImpostorContinuousEffect extends ContinuousEffectImpl {
if (card != null) { if (card != null) {
for (Ability ability: card.getAbilities()) { for (Ability ability: card.getAbilities()) {
if (ability instanceof ActivatedAbility) { if (ability instanceof ActivatedAbility) {
perm.addAbility(ability, game); perm.addAbility(ability, source.getSourceId(), game);
} }
} }
} }

View file

@ -110,7 +110,7 @@ class RidersOfGavonyEffect extends OneShotEffect {
if (typeChoice.getChoice() != null) { if (typeChoice.getChoice() != null) {
game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice());
game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice()); game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice());
permanent.addInfo("chosen type", "<i>Chosen type: " + typeChoice.getChoice().toString() + "</i>", game); permanent.addInfo("chosen type", "<i>Chosen type: " + typeChoice.getChoice() + "</i>", game);
} }
} }
return false; return false;
@ -162,7 +162,7 @@ class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl {
} }
if (protectionFilter != null) { if (protectionFilter != null) {
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
perm.addAbility(new ProtectionAbility(protectionFilter), game); perm.addAbility(new ProtectionAbility(protectionFilter), source.getSourceId(), game);
} }
return true; return true;
} }

View file

@ -110,7 +110,7 @@ public class SkullmaneBaku extends CardImpl {
} }
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
if (creature != null && numberToUnboost != 0) { if (creature != null && numberToUnboost != 0) {
creature.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(numberToUnboost, numberToUnboost, Duration.EndOfTurn)), game); creature.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(numberToUnboost, numberToUnboost, Duration.EndOfTurn)), source.getSourceId(), game, false);
} }
return true; return true;
} }

View file

@ -140,7 +140,7 @@ class CurseOfChaosEffect extends OneShotEffect {
Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source)); Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (attacker != null) { if (attacker != null) {
if (attacker.getHand().size() > 0 && attacker.chooseUse(outcome, "Discard a card and draw a card?", game)){ if (attacker.getHand().size() > 0 && attacker.chooseUse(outcome, "Discard a card and draw a card?", game)){
attacker.discard(1, source, game); attacker.discard(1, false, source, game);
attacker.drawCards(1, game); attacker.drawCards(1, game);
} }
return true; return true;

View file

@ -126,7 +126,7 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl {
break; break;
case AbilityAddingRemovingEffects_6: case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) { if (sublayer == SubLayer.NA) {
creature.addAbility(FlyingAbility.getInstance(), game); creature.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game);
} }
break; break;
default: default:

View file

@ -98,7 +98,7 @@ class NeedleSpecterEffect extends OneShotEffect {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (targetPlayer != null) { if (targetPlayer != null) {
int damage = (Integer)getValue("damage"); int damage = (Integer)getValue("damage");
targetPlayer.discard(damage, source, game); targetPlayer.discard(damage, false, source, game);
game.informPlayers(targetPlayer.getLogName() + "discards " + damage + " card(s)"); game.informPlayers(targetPlayer.getLogName() + "discards " + damage + " card(s)");
return true; return true;
} }

View file

@ -34,6 +34,7 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -116,7 +117,7 @@ class RiseOfTheHobgoblinsEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId()); Player you = game.getPlayer(source.getControllerId());
ManaCosts cost = new ManaCostsImpl("{X}"); ManaCosts<ManaCost> cost = new ManaCostsImpl<>("{X}");
if (you != null && you.chooseUse(Outcome.Neutral, "Do you want to to pay {X}?", game)) { if (you != null && you.chooseUse(Outcome.Neutral, "Do you want to to pay {X}?", game)) {
int costX = you.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source); int costX = you.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
cost.add(new GenericManaCost(costX)); cost.add(new GenericManaCost(costX));

View file

@ -93,7 +93,7 @@ class RecallEffect extends OneShotEffect {
// Discard X cards // Discard X cards
int amount = source.getManaCostsToPay().getX(); int amount = source.getManaCostsToPay().getX();
int discarded = Math.min(amount, player.getHand().size()); int discarded = Math.min(amount, player.getHand().size());
player.discard(amount, source, game); player.discard(amount, false, source, game);
// then return a card from your graveyard to your hand for each card discarded this way // then return a card from your graveyard to your hand for each card discarded this way
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(discarded, new FilterCard()); TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(discarded, new FilterCard());

View file

@ -94,7 +94,7 @@ class FrightfulDelusionEffect extends OneShotEffect {
if (player != null) { if (player != null) {
cost.clearPaid(); cost.clearPaid();
game.getPlayer(spell.getControllerId()).discard( game.getPlayer(spell.getControllerId()).discard(
1, source, game); 1, false, source, game);
if (!cost.pay(source, game, spell.getControllerId(), if (!cost.pay(source, game, spell.getControllerId(),
spell.getControllerId(), false)) { spell.getControllerId(), false)) {
return game.getStack().counter(source.getFirstTarget(), return game.getStack().counter(source.getFirstTarget(),

View file

@ -105,7 +105,7 @@ class TormentedThoughtsDiscardEffect extends OneShotEffect {
} }
} }
if (power > 0) { if (power > 0) {
targetPlayer.discard(power, source, game); targetPlayer.discard(power, false, source, game);
} }
return true; return true;
} }

View file

@ -103,7 +103,7 @@ class ChainsOfMephistophelesReplacementEffect extends ReplacementEffectImpl {
return true; return true;
} else { } else {
// discards a card instead. If the player discards a card this way, he or she draws a card. // discards a card instead. If the player discards a card this way, he or she draws a card.
player.discard(1, source, game); player.discard(1, false, source, game);
return false; // because player draws a card, the draw event is kept return false; // because player draws a card, the draw event is kept
} }
} }

View file

@ -1,127 +1,127 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 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 * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * 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 * 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 * 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 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * 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 * 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 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * 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 * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.magic2011; package mage.sets.magic2011;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType; import mage.abilities.Ability;
import mage.constants.Duration; import mage.abilities.common.SimpleStaticAbility;
import mage.constants.Layer; import mage.abilities.effects.ContinuousEffectImpl;
import mage.constants.Outcome; import mage.abilities.effects.common.AttachEffect;
import mage.constants.Rarity; import mage.abilities.keyword.EnchantAbility;
import mage.constants.SubLayer; import mage.abilities.keyword.ForestwalkAbility;
import mage.constants.Zone; import mage.cards.CardImpl;
import mage.abilities.Ability; import mage.constants.CardType;
import mage.abilities.common.SimpleStaticAbility; import mage.constants.Duration;
import mage.abilities.effects.ContinuousEffectImpl; import mage.constants.Layer;
import mage.abilities.effects.common.AttachEffect; import mage.constants.Outcome;
import mage.abilities.keyword.EnchantAbility; import mage.constants.Rarity;
import mage.abilities.keyword.ForestwalkAbility; import mage.constants.SubLayer;
import mage.cards.CardImpl; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class DryadsFavor extends CardImpl { public class DryadsFavor extends CardImpl {
public DryadsFavor(UUID ownerId) { public DryadsFavor(UUID ownerId) {
super(ownerId, 169, "Dryad's Favor", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); super(ownerId, 169, "Dryad's Favor", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.expansionSetCode = "M11"; this.expansionSetCode = "M11";
this.color.setGreen(true); this.subtype.add("Aura");
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DryadsFavorEffect())); // Enchanted creature has forestwalk.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DryadsFavorEffect()));
} }
public DryadsFavor(final DryadsFavor card) { public DryadsFavor(final DryadsFavor card) {
super(card); super(card);
} }
@Override @Override
public DryadsFavor copy() { public DryadsFavor copy() {
return new DryadsFavor(this); return new DryadsFavor(this);
} }
} }
class DryadsFavorEffect extends ContinuousEffectImpl { class DryadsFavorEffect extends ContinuousEffectImpl {
public DryadsFavorEffect() { public DryadsFavorEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment); super(Duration.WhileOnBattlefield, Outcome.Detriment);
staticText = "Enchanted creature has forestwalk"; staticText = "Enchanted creature has forestwalk";
} }
public DryadsFavorEffect(final DryadsFavorEffect effect) { public DryadsFavorEffect(final DryadsFavorEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public DryadsFavorEffect copy() { public DryadsFavorEffect copy() {
return new DryadsFavorEffect(this); return new DryadsFavorEffect(this);
} }
@Override @Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent enchantment = game.getPermanent(source.getSourceId()); Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null && enchantment.getAttachedTo() != null) { if (enchantment != null && enchantment.getAttachedTo() != null) {
Permanent creature = game.getPermanent(enchantment.getAttachedTo()); Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature != null) { if (creature != null) {
switch (layer) { switch (layer) {
case AbilityAddingRemovingEffects_6: case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) { if (sublayer == SubLayer.NA) {
creature.addAbility(new ForestwalkAbility(), game); creature.addAbility(new ForestwalkAbility(), source.getSourceId(), game);
} }
break; break;
} }
return true; return true;
} }
} }
return false; return false;
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
return false; return false;
} }
@Override @Override
public boolean hasLayer(Layer layer) { public boolean hasLayer(Layer layer) {
return layer == Layer.AbilityAddingRemovingEffects_6; return layer == Layer.AbilityAddingRemovingEffects_6;
} }
} }

View file

@ -1,133 +1,132 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 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 * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * 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 * 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 * 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 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * 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 * 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 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * 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 * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.magic2011;
package mage.sets.magic2011;
import java.util.UUID;
import java.util.UUID; import mage.abilities.Ability;
import mage.constants.CardType; import mage.abilities.common.SimpleStaticAbility;
import mage.constants.Duration; import mage.abilities.effects.ContinuousEffectImpl;
import mage.constants.Layer; import mage.abilities.effects.common.AttachEffect;
import mage.constants.Outcome; import mage.abilities.keyword.EnchantAbility;
import mage.constants.Rarity; import mage.abilities.keyword.MountainwalkAbility;
import mage.constants.SubLayer; import mage.cards.CardImpl;
import mage.constants.Zone; import mage.constants.CardType;
import mage.abilities.Ability; import mage.constants.Duration;
import mage.abilities.common.SimpleStaticAbility; import mage.constants.Layer;
import mage.abilities.effects.ContinuousEffectImpl; import mage.constants.Outcome;
import mage.abilities.effects.common.AttachEffect; import mage.constants.Rarity;
import mage.abilities.keyword.EnchantAbility; import mage.constants.SubLayer;
import mage.abilities.keyword.MountainwalkAbility; import mage.constants.Zone;
import mage.cards.CardImpl; import mage.game.Game;
import mage.game.Game; import mage.game.permanent.Permanent;
import mage.game.permanent.Permanent; import mage.target.TargetPermanent;
import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
/**
/** *
* * @author BetaSteward_at_googlemail.com
* @author BetaSteward_at_googlemail.com */
*/ public class VolcanicStrength extends CardImpl {
public class VolcanicStrength extends CardImpl {
public VolcanicStrength(UUID ownerId) {
public VolcanicStrength(UUID ownerId) { super(ownerId, 158, "Volcanic Strength", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
super(ownerId, 158, "Volcanic Strength", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); this.expansionSetCode = "M11";
this.expansionSetCode = "M11"; this.subtype.add("Aura");
this.color.setRed(true);
this.subtype.add("Aura"); // Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName());
Ability ability = new EnchantAbility(auraTarget.getTargetName()); // Enchanted creature gets +2/+2 and has mountainwalk.
this.addAbility(ability); this.addAbility(ability);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VolcanicStrengthEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VolcanicStrengthEffect()));
}
}
public VolcanicStrength(final VolcanicStrength card) {
public VolcanicStrength(final VolcanicStrength card) { super(card);
super(card); }
}
@Override
@Override public VolcanicStrength copy() {
public VolcanicStrength copy() { return new VolcanicStrength(this);
return new VolcanicStrength(this); }
} }
}
class VolcanicStrengthEffect extends ContinuousEffectImpl {
class VolcanicStrengthEffect extends ContinuousEffectImpl {
public VolcanicStrengthEffect() {
public VolcanicStrengthEffect() { super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
super(Duration.WhileOnBattlefield, Outcome.BoostCreature); staticText = "Enchanted creature gets +2/+2 and has mountainwalk";
staticText = "Enchanted creature gets +2/+2 and has mountainwalk"; }
}
public VolcanicStrengthEffect(final VolcanicStrengthEffect effect) {
public VolcanicStrengthEffect(final VolcanicStrengthEffect effect) { super(effect);
super(effect); }
}
@Override
@Override public VolcanicStrengthEffect copy() {
public VolcanicStrengthEffect copy() { return new VolcanicStrengthEffect(this);
return new VolcanicStrengthEffect(this); }
}
@Override
@Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId());
Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) {
if (enchantment != null && enchantment.getAttachedTo() != null) { Permanent creature = game.getPermanent(enchantment.getAttachedTo());
Permanent creature = game.getPermanent(enchantment.getAttachedTo()); if (creature != null) {
if (creature != null) { switch (layer) {
switch (layer) { case PTChangingEffects_7:
case PTChangingEffects_7: if (sublayer == SubLayer.ModifyPT_7c) {
if (sublayer == SubLayer.ModifyPT_7c) { creature.addPower(2);
creature.addPower(2); creature.addToughness(2);
creature.addToughness(2); }
} break;
break; case AbilityAddingRemovingEffects_6:
case AbilityAddingRemovingEffects_6: if (sublayer == SubLayer.NA) {
if (sublayer == SubLayer.NA) { creature.addAbility(new MountainwalkAbility(), game);
creature.addAbility(new MountainwalkAbility(), game); }
} break;
break; }
} return true;
return true; }
} }
} return false;
return false; }
}
@Override
@Override public boolean apply(Game game, Ability source) {
public boolean apply(Game game, Ability source) { return false;
return false; }
}
@Override
@Override public boolean hasLayer(Layer layer) {
public boolean hasLayer(Layer layer) { return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7;
return layer == Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7; }
}
}
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/** /**
* *
* @author North * @author anonymous
*/ */
public class VolcanicStrength extends mage.sets.magic2011.VolcanicStrength { public class VolcanicStrength extends mage.sets.magic2011.VolcanicStrength {

View file

@ -87,7 +87,7 @@ class LaquatussCreativityEffect extends OneShotEffect {
Player player = game.getPlayer(source.getFirstTarget()); Player player = game.getPlayer(source.getFirstTarget());
int handCount = player.getHand().count(new FilterCard(), game); int handCount = player.getHand().count(new FilterCard(), game);
player.drawCards(handCount, game); player.drawCards(handCount, game);
player.discard(handCount, source, game); player.discard(handCount, false, source, game);
return false; return false;
} }
} }

View file

@ -137,7 +137,7 @@ class TestamentOfFaithBecomesCreatureSourceEffect extends ContinuousEffectImpl i
if (sublayer == SubLayer.NA) { if (sublayer == SubLayer.NA) {
if (token.getAbilities().size() > 0) { if (token.getAbilities().size() > 0) {
for (Ability ability: token.getAbilities()) { for (Ability ability: token.getAbilities()) {
permanent.addAbility(ability, game); permanent.addAbility(ability, source.getSourceId(), game, false);
} }
} }
} }

View file

@ -135,7 +135,7 @@ class LastStandEffect extends OneShotEffect {
int islands = game.getBattlefield().count(filterIsland, source.getSourceId(), source.getControllerId(), game); int islands = game.getBattlefield().count(filterIsland, source.getSourceId(), source.getControllerId(), game);
if (islands > 0) { if (islands > 0) {
controller.drawCards(islands, game); controller.drawCards(islands, game);
controller.discard(islands, source, game); controller.discard(islands, false, source, game);
} }
} }

View file

@ -94,7 +94,7 @@ class CompulsiveResearchDiscardEffect extends OneShotEffect {
if (card != null) { if (card != null) {
targetPlayer.discard(card, source, game); targetPlayer.discard(card, source, game);
if (!card.getCardType().contains(CardType.LAND) && !targetPlayer.getHand().isEmpty()) { if (!card.getCardType().contains(CardType.LAND) && !targetPlayer.getHand().isEmpty()) {
targetPlayer.discard(1, source, game); targetPlayer.discard(1, false, source, game);
} }
return true; return true;
} }

View file

@ -92,7 +92,7 @@ class AssassinsStrikeEffect extends OneShotEffect {
if (permanent != null) { if (permanent != null) {
Player player = game.getPlayer(permanent.getControllerId()); Player player = game.getPlayer(permanent.getControllerId());
if (player != null) { if (player != null) {
player.discard(1, source, game); player.discard(1, false, source, game);
return true; return true;
} }
} }

View file

@ -91,7 +91,7 @@ class InduceDespairEffect extends OneShotEffect {
if (cost != null) { if (cost != null) {
int CMC = -1 * cost.convertedManaCosts; int CMC = -1 * cost.convertedManaCosts;
if (creature != null) { if (creature != null) {
creature.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(CMC, CMC, Duration.EndOfTurn)), game); creature.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(CMC, CMC, Duration.EndOfTurn)), source.getSourceId(), game, false);
} }
} }
return true; return true;

View file

@ -104,7 +104,7 @@ class ThoughtGorgerEffectEnters extends OneShotEffect {
if (player != null && player.getHand().size() > 0 && thoughtGorger != null ) { if (player != null && player.getHand().size() > 0 && thoughtGorger != null ) {
int cardsInHand = player.getHand().size(); int cardsInHand = player.getHand().size();
thoughtGorger.addCounters(CounterType.P1P1.createInstance(cardsInHand), game); thoughtGorger.addCounters(CounterType.P1P1.createInstance(cardsInHand), game);
player.discard(cardsInHand, source, game); player.discard(cardsInHand, false, source, game);
return true; return true;
} }
return false; return false;

View file

@ -93,7 +93,7 @@ class GloomlanceEffect extends OneShotEffect {
Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
if (destroyedCreature.getColor().isGreen() if (destroyedCreature.getColor().isGreen()
|| destroyedCreature.getColor().isWhite()) { || destroyedCreature.getColor().isWhite()) {
targetController.discard(1, source, game); targetController.discard(1, false, source, game);
return true; return true;
} }
} }

View file

@ -167,7 +167,7 @@ class MemoryJarDelayedEffect extends OneShotEffect {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) if (player != null)
{ {
player.discard(player.getHand().size(), source, game); player.discard(player.getHand().size(), false, source, game);
} }
} }
//Return to hand //Return to hand

View file

@ -53,17 +53,15 @@ public class DacksDuplicate extends CardImpl {
this.expansionSetCode = "VMA"; this.expansionSetCode = "VMA";
this.subtype.add("Shapeshifter"); this.subtype.add("Shapeshifter");
this.color.setRed(true);
this.color.setBlue(true);
this.power = new MageInt(0); this.power = new MageInt(0);
this.toughness = new MageInt(0); this.toughness = new MageInt(0);
// You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone. // You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone.
this.addAbility(new SimpleStaticAbility( this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new EntersBattlefieldEffect(new CopyPermanentEffect(new DacksDuplicateApplyToPermanent()), new EntersBattlefieldEffect(new CopyPermanentEffect(new DacksDuplicateApplyToPermanent()),
"You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone", "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone",
true))); true)));
} }
public DacksDuplicate(final DacksDuplicate card) { public DacksDuplicate(final DacksDuplicate card) {
@ -77,8 +75,13 @@ public class DacksDuplicate extends CardImpl {
} }
class DacksDuplicateApplyToPermanent extends ApplyToPermanent { class DacksDuplicateApplyToPermanent extends ApplyToPermanent {
@Override @Override
public Boolean apply(Game game, Permanent permanent) { public Boolean apply(Game game, Permanent permanent) {
/**
* 29/05/2014 The ability of Dacks Duplicate doesnt target the
* creature.
*/
permanent.addAbility(new DethroneAbility(), game); permanent.addAbility(new DethroneAbility(), game);
permanent.addAbility(HasteAbility.getInstance(), game); permanent.addAbility(HasteAbility.getInstance(), game);
return true; return true;

View file

@ -90,7 +90,7 @@ class AnvilOfBogardanEffect extends OneShotEffect {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (targetPlayer != null) { if (targetPlayer != null) {
targetPlayer.drawCards(1, game); targetPlayer.drawCards(1, game);
targetPlayer.discard(1, source, game); targetPlayer.discard(1, false, source, game);
return true; return true;
} }
return false; return false;