mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18: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();
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user