mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Fix not being able to pay alternative costs.
This commit is contained in:
@@ -76,7 +76,7 @@ public abstract class Ability extends SpellAbility {
|
|||||||
return this.getHostCard().isInPlay() && !this.getHostCard().isFaceDown();
|
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
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return true; //if this ability is added anywhere, it can be assumed that land can be played
|
return true; //if this ability is added anywhere, it can be assumed that land can be played
|
||||||
|
|||||||
@@ -134,12 +134,12 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
private TargetRestrictions targetRestrictions = null;
|
private TargetRestrictions targetRestrictions = null;
|
||||||
private TargetChoices targetChosen = new TargetChoices();
|
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);
|
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();
|
id = nextId();
|
||||||
hostCard = iSourceCard;
|
hostCard = iSourceCard;
|
||||||
payCosts = toPay;
|
payCosts = toPay;
|
||||||
@@ -579,6 +579,10 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
try {
|
try {
|
||||||
clone = (SpellAbility) clone();
|
clone = (SpellAbility) clone();
|
||||||
clone.id = nextId();
|
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) {
|
} catch (final CloneNotSupportedException e) {
|
||||||
System.err.println(e);
|
System.err.println(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user