* Soul Foundry - Fixed that the activation cost for the ability to put a copy of the imprinted card to the battlefield was calculated wrongly (fixes #1019).

This commit is contained in:
LevelX2 2015-06-13 21:11:16 +02:00
parent f98e370331
commit d738a5ccce
3 changed files with 83 additions and 13 deletions

View file

@ -67,7 +67,7 @@ public class BloodlineKeeper extends CardImpl {
this.secondSideCard = new LordOfLineage(ownerId);
this.addAbility(FlyingAbility.getInstance());
// {tap}: Put a 2/2 black Vampire creature token with flying onto the battlefield.
// {T}: Put a 2/2 black Vampire creature token with flying onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost()));
// {B}: Transform Bloodline Keeper. Activate this ability only if you control five or more Vampires.
this.addAbility(new TransformAbility());

View file

@ -65,7 +65,7 @@ public class SoulFoundry extends CardImpl {
// Imprint - When Soul Foundry enters the battlefield, you may exile a creature card from your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SoulFoundryImprintEffect(), true, "<i>Imprint - </i>"));
// {X}, {tap}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card.
// {X}, {T}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoulFoundryEffect(), new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
@ -78,20 +78,23 @@ public class SoulFoundry extends CardImpl {
@Override
public void adjustCosts(Ability ability, Game game) {
Permanent card = game.getPermanent(ability.getSourceId());
if (card != null) {
if (card.getImprinted().size() > 0) {
Card imprinted = game.getCard(card.getImprinted().get(0));
if (imprinted != null) {
ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost()));
if (ability instanceof SimpleActivatedAbility) {
Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
if (sourcePermanent != null) {
if (sourcePermanent.getImprinted().size() > 0) {
Card imprinted = game.getCard(sourcePermanent.getImprinted().get(0));
if (imprinted != null) {
ability.getManaCostsToPay().clear();
ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost()));
}
}
}
}
// no {X} anymore as we already have imprinted the card with defined manacost
for (ManaCost cost : ability.getManaCostsToPay()) {
if (cost instanceof VariableCost) {
cost.setPaid();
// no {X} anymore as we already have imprinted the card with defined manacost
for (ManaCost cost : ability.getManaCostsToPay()) {
if (cost instanceof VariableCost) {
cost.setPaid();
}
}
}
}