- Disable Express Mana choosing mode for paying with with cards like Vivid Crag for generic mana

This commit is contained in:
Sol
2013-05-12 02:34:18 +00:00
parent ff1e742427
commit 4ed58e2a4d
8 changed files with 48 additions and 8 deletions

View File

@@ -417,6 +417,23 @@ public class Cost {
return this.isAbility;
}
/**
* <p>
* isRenewableResource.
* </p>
*
* @return a boolean.
*/
public final boolean isRenewableResource() {
for (final CostPart part : this.costParts) {
if (!part.isRenewable()) {
return false;
}
}
return this.isAbility;
}
/**
* <p>
* toString.

View File

@@ -107,6 +107,15 @@ public abstract class CostPart {
return false;
}
/**
* Checks if is renewable.
*
* @return true, if is renewable
*/
public boolean isRenewable() {
return false;
}
/**
* Checks if is undoable.
*

View File

@@ -58,6 +58,9 @@ public class CostReveal extends CostPartWithList {
@Override
public boolean isReusable() { return true; }
@Override
public boolean isRenewable() { return true; }
/*
* (non-Javadoc)
*

View File

@@ -40,6 +40,8 @@ public class CostTap extends CostPart {
@Override
public boolean isReusable() { return true; }
@Override
public boolean isRenewable() { return true; }
/*
* (non-Javadoc)

View File

@@ -61,6 +61,8 @@ public class CostTapType extends CostPartWithList {
@Override
public boolean isReusable() { return true; }
@Override
public boolean isRenewable() { return true; }
/*
* (non-Javadoc)

View File

@@ -39,6 +39,9 @@ public class CostUntap extends CostPart {
@Override
public boolean isUndoable() { return true; }
@Override
public boolean isRenewable() { return true; }
/*
* (non-Javadoc)

View File

@@ -57,6 +57,8 @@ public class CostUntapType extends CostPartWithList {
@Override
public boolean isReusable() { return true; }
@Override
public boolean isRenewable() { return true; }
/*
* (non-Javadoc)

View File

@@ -170,12 +170,11 @@ public abstract class InputPayManaBase extends InputSyncronizedBase implements I
ma.setActivatingPlayer(player);
AbilityManaPart m = null;
SpellAbility tail = ma;
while(m == null && tail != null)
{
while (m == null && tail != null) {
m = tail.getManaPart();
tail = tail.getSubAbility();
}
if(m == null) {
if (m == null) {
continue;
} else if (!ma.canPlay()) {
continue;
@@ -190,10 +189,13 @@ public abstract class InputPayManaBase extends InputSyncronizedBase implements I
abilities.add(ma);
if (!skipExpress) {
// skip express mana if the ability is not undoable
// skip express mana if the ability is not undoable or reusable
if (!ma.isUndoable()) {
skipExpress = true;
continue;
} else if (!ma.getPayCosts().isRenewableResource()) {
skipExpress = true;
continue;
}
}
}