* Fixed some cost classes that didn't hadle correctly if a cost concerning card movement is paid or not.

This commit is contained in:
LevelX2 2015-12-25 11:04:46 +01:00
parent eb0ae55257
commit 0c2abc69de
21 changed files with 141 additions and 112 deletions

View file

@ -37,7 +37,7 @@ import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
@ -73,7 +73,7 @@ public class SteelshaperApprentice extends CardImpl {
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, filter), true),
new ColoredManaCost(ColoredManaSymbol.W));
ability.addCost(new TapSourceCost());
ability.addCost(new ReturnToHandSourceCost());
ability.addCost(new ReturnToHandFromBattlefieldSourceCost());
this.addAbility(ability);
}

View file

@ -35,7 +35,7 @@ import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.combat.CantBlockAttackActivateAttachedEffect;
@ -71,7 +71,7 @@ public class KrasisIncubation extends CardImpl {
// {1}{G}{U}, Return Krasis Incubation to its owner's hand: Put two +1/+1 counters on enchanted creature.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(2), new ManaCostsImpl("{1}{G}{U}"));
ability.addCost(new ReturnToHandSourceCost());
ability.addCost(new ReturnToHandFromBattlefieldSourceCost());
this.addAbility(ability);
}

View file

@ -38,7 +38,7 @@ import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
@ -79,7 +79,7 @@ public class MazesEnd extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterCard)), new GenericManaCost(3));
ability.addEffect(new MazesEndEffect());
ability.addCost(new TapSourceCost());
ability.addCost(new ReturnToHandSourceCost());
ability.addCost(new ReturnToHandFromBattlefieldSourceCost());
this.addAbility(ability);
}

View file

@ -30,7 +30,7 @@ package mage.sets.exodus;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.cards.CardImpl;
@ -58,7 +58,7 @@ public class RecurringNightmare extends CardImpl {
// Sacrifice a creature, Return Recurring Nightmare to its owner's hand: Return target creature card from your graveyard to the battlefield. Activate this ability only any time you could cast a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filter2)));
ability.addTarget(new TargetCardInYourGraveyard(filter));
ability.addCost(new ReturnToHandSourceCost());
ability.addCost(new ReturnToHandFromBattlefieldSourceCost());
this.addAbility(ability);
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.mana.ActivateAsSorceryManaAbility;
import mage.cards.CardImpl;
@ -55,7 +55,7 @@ public class GrinningIgnus extends CardImpl {
// {R}, Return Grinning Ignus to its owner's hand: Add {C}{C}{R} to your mana pool. Activate this ability only any time you could cast a sorcery.
Ability ability = new ActivateAsSorceryManaAbility(Zone.BATTLEFIELD, new Mana(1, 0, 0, 0, 0, 2, 0), new ManaCostsImpl("{R}"));
ability.addCost(new ReturnToHandSourceCost());
ability.addCost(new ReturnToHandFromBattlefieldSourceCost());
this.addAbility(ability);
}

View file

@ -33,7 +33,7 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.effects.common.RegenerateTargetEffect;
import mage.cards.CardImpl;
import mage.constants.Zone;
@ -50,7 +50,7 @@ public class MoltingSkin extends CardImpl {
this.expansionSetCode = "SOK";
// Return Molting Skin to its owner's hand: Regenerate target creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ReturnToHandSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ReturnToHandFromBattlefieldSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}

View file

@ -33,7 +33,7 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.effects.common.RegenerateTargetEffect;
import mage.cards.CardImpl;
import mage.constants.Zone;
@ -49,7 +49,7 @@ public class BrokenFall extends CardImpl {
super(ownerId, 110, "Broken Fall", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
this.expansionSetCode = "TMP";
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ReturnToHandSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ReturnToHandFromBattlefieldSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}

View file

@ -32,7 +32,7 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.effects.common.discard.DiscardControllerEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
@ -49,7 +49,7 @@ public class Attunement extends CardImpl {
// Return Attunement to its owner's hand: Draw three cards, then discard four cards.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(3), new ReturnToHandSourceCost());
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(3), new ReturnToHandFromBattlefieldSourceCost());
ability.addEffect(new DiscardControllerEffect(4));
this.addAbility(ability);
}

View file

@ -30,7 +30,7 @@ package mage.sets.visions;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.effects.common.PreventDamageByTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -58,7 +58,7 @@ public class GossamerChains extends CardImpl {
this.expansionSetCode = "VIS";
// Return Gossamer Chains to its owner's hand: Prevent all combat damage that would be dealt by target unblocked creature this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageByTargetEffect(Duration.EndOfTurn, true), new ReturnToHandSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageByTargetEffect(Duration.EndOfTurn, true), new ReturnToHandFromBattlefieldSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}

View file

@ -32,7 +32,7 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.ReturnToHandSourceCost;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -70,7 +70,7 @@ public class MagosiTheWaterveil extends CardImpl {
// {T}, Remove an eon counter from Magosi, the Waterveil and return it to its owner's hand: Take an extra turn after this one.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddExtraTurnControllerEffect(), new TapSourceCost());
ability2.addCost(new RemoveCountersSourceCost(CounterType.EON.createInstance()));
ability2.addCost(new ReturnToHandSourceCost());
ability2.addCost(new ReturnToHandFromBattlefieldSourceCost());
this.addAbility(ability2);
}