mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Disable Express Mana choosing mode for paying with with cards like Vivid Crag for generic mana
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -58,6 +58,9 @@ public class CostReveal extends CostPartWithList {
|
||||
@Override
|
||||
public boolean isReusable() { return true; }
|
||||
|
||||
@Override
|
||||
public boolean isRenewable() { return true; }
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -40,6 +40,8 @@ public class CostTap extends CostPart {
|
||||
@Override
|
||||
public boolean isReusable() { return true; }
|
||||
|
||||
@Override
|
||||
public boolean isRenewable() { return true; }
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -61,6 +61,8 @@ public class CostTapType extends CostPartWithList {
|
||||
@Override
|
||||
public boolean isReusable() { return true; }
|
||||
|
||||
@Override
|
||||
public boolean isRenewable() { return true; }
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -39,6 +39,9 @@ public class CostUntap extends CostPart {
|
||||
@Override
|
||||
public boolean isUndoable() { return true; }
|
||||
|
||||
@Override
|
||||
public boolean isRenewable() { return true; }
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -57,6 +57,8 @@ public class CostUntapType extends CostPartWithList {
|
||||
@Override
|
||||
public boolean isReusable() { return true; }
|
||||
|
||||
@Override
|
||||
public boolean isRenewable() { return true; }
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -170,8 +170,7 @@ 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();
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user