Fix not being able to pay alternative costs.

This commit is contained in:
elcnesh
2015-03-16 09:23:24 +00:00
parent 82deb0c537
commit 2c671efedb
2 changed files with 8 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ public abstract class Ability extends SpellAbility {
return this.getHostCard().isInPlay() && !this.getHostCard().isFaceDown();
}
public static final Ability PLAY_LAND_SURROGATE = new Ability(null, (Cost)null, null){
public static final Ability PLAY_LAND_SURROGATE = new Ability(null, (Cost) null) {
@Override
public boolean canPlay() {
return true; //if this ability is added anywhere, it can be assumed that land can be played

View File

@@ -134,12 +134,12 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
private TargetRestrictions targetRestrictions = null;
private TargetChoices targetChosen = new TargetChoices();
private final SpellAbilityView view;
private SpellAbilityView view;
protected SpellAbility(final Card iSourceCard, Cost toPay) {
protected SpellAbility(final Card iSourceCard, final Cost toPay) {
this(iSourceCard, toPay, null);
}
protected SpellAbility(final Card iSourceCard, Cost toPay, SpellAbilityView view0) {
protected SpellAbility(final Card iSourceCard, final Cost toPay, SpellAbilityView view0) {
id = nextId();
hostCard = iSourceCard;
payCosts = toPay;
@@ -579,6 +579,10 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
try {
clone = (SpellAbility) clone();
clone.id = nextId();
clone.view = new SpellAbilityView(clone);
if (clone.hostCard != null && clone.hostCard.getGame() != null) {
clone.hostCard.getGame().addSpellAbility(clone.id, clone);
}
} catch (final CloneNotSupportedException e) {
System.err.println(e);
}