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:
@@ -416,6 +416,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>
|
||||||
|
|||||||
@@ -106,6 +106,15 @@ public abstract class CostPart {
|
|||||||
public boolean isReusable() {
|
public boolean isReusable() {
|
||||||
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,7 +61,9 @@ 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)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ public class CostUntap extends CostPart {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUndoable() { return true; }
|
public boolean isUndoable() { return true; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRenewable() { return true; }
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -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,12 +170,11 @@ 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();
|
||||||
}
|
}
|
||||||
if(m == null) {
|
if (m == null) {
|
||||||
continue;
|
continue;
|
||||||
} else if (!ma.canPlay()) {
|
} else if (!ma.canPlay()) {
|
||||||
continue;
|
continue;
|
||||||
@@ -186,15 +185,18 @@ public abstract class InputPayManaBase extends InputSyncronizedBase implements I
|
|||||||
} else if (!m.meetsManaRestrictions(saPaidFor)) {
|
} else if (!m.meetsManaRestrictions(saPaidFor)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (abilities.isEmpty()) {
|
if (abilities.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user