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;
|
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>
|
* <p>
|
||||||
* toString.
|
* toString.
|
||||||
|
|||||||
@@ -107,6 +107,15 @@ public abstract class CostPart {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is renewable.
|
||||||
|
*
|
||||||
|
* @return true, if is renewable
|
||||||
|
*/
|
||||||
|
public boolean isRenewable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if is undoable.
|
* Checks if is undoable.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ public class CostReveal extends CostPartWithList {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isReusable() { return true; }
|
public boolean isReusable() { return true; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRenewable() { return true; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ public class CostTap extends CostPart {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isReusable() { return true; }
|
public boolean isReusable() { return true; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRenewable() { return true; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public class CostTapType extends CostPartWithList {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isReusable() { return true; }
|
public boolean isReusable() { return true; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRenewable() { return true; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ public class CostUntap extends CostPart {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isUndoable() { return true; }
|
public boolean isUndoable() { return true; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRenewable() { return true; }
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ public class CostUntapType extends CostPartWithList {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isReusable() { return true; }
|
public boolean isReusable() { return true; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRenewable() { return true; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
|||||||
@@ -170,8 +170,7 @@ public abstract class InputPayManaBase extends InputSyncronizedBase implements I
|
|||||||
ma.setActivatingPlayer(player);
|
ma.setActivatingPlayer(player);
|
||||||
AbilityManaPart m = null;
|
AbilityManaPart m = null;
|
||||||
SpellAbility tail = ma;
|
SpellAbility tail = ma;
|
||||||
while(m == null && tail != null)
|
while (m == null && tail != null) {
|
||||||
{
|
|
||||||
m = tail.getManaPart();
|
m = tail.getManaPart();
|
||||||
tail = tail.getSubAbility();
|
tail = tail.getSubAbility();
|
||||||
}
|
}
|
||||||
@@ -190,10 +189,13 @@ public abstract class InputPayManaBase extends InputSyncronizedBase implements I
|
|||||||
abilities.add(ma);
|
abilities.add(ma);
|
||||||
|
|
||||||
if (!skipExpress) {
|
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()) {
|
if (!ma.isUndoable()) {
|
||||||
skipExpress = true;
|
skipExpress = true;
|
||||||
continue;
|
continue;
|
||||||
|
} else if (!ma.getPayCosts().isRenewableResource()) {
|
||||||
|
skipExpress = true;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user