mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
add Exiled$ so it can be used like Sacrificed$ and Discarded$ as in (SVar:X:Sacrificed$CardPower) i.e. SVar:X:Exiled$CardManaCost
This commit is contained in:
@@ -698,6 +698,10 @@ public class AbilityFactory {
|
||||
else if (calcX[0].startsWith("Discarded"))
|
||||
list = findRootAbility(ability).getDiscardedCost();
|
||||
|
||||
else if( calcX[0].startsWith("Exiled")) {
|
||||
list = findRootAbility(ability).getExiledCost();
|
||||
}
|
||||
|
||||
else if (calcX[0].startsWith("Targeted")){
|
||||
SpellAbility saTargeting = (ability.getTarget() == null) ? findParentsTargetedCard(ability) : ability;
|
||||
list = new CardList(saTargeting.getTarget().getTargetCards().toArray());
|
||||
|
||||
@@ -946,6 +946,7 @@ public class Cost_Payment {
|
||||
null, possibleValues, possibleValues[0]);
|
||||
if(choice.equals(0)) {
|
||||
payment.setPayExile(true);
|
||||
payment.getAbility().addExiledCost(card);
|
||||
AllZone.GameAction.exile(card);
|
||||
stop();
|
||||
payment.payCost();
|
||||
@@ -1060,6 +1061,7 @@ public class Cost_Payment {
|
||||
public void selectCard(Card card, PlayerZone zone) {
|
||||
if(typeList.contains(card)) {
|
||||
nExiles++;
|
||||
payment.getAbility().addExiledCost(card);
|
||||
AllZone.GameAction.exile(card);
|
||||
typeList.remove(card);
|
||||
//in case nothing else to exile
|
||||
|
||||
@@ -62,6 +62,7 @@ public abstract class SpellAbility {
|
||||
|
||||
private CardList sacrificedCards = null;
|
||||
private CardList discardedCards = null;
|
||||
private CardList exiledCards = null;
|
||||
|
||||
private Command cancelCommand = Command.Blank;
|
||||
private Command beforePayManaAI = Command.Blank;
|
||||
@@ -324,6 +325,21 @@ public abstract class SpellAbility {
|
||||
sacrificedCards = null;
|
||||
}
|
||||
|
||||
public void addExiledCost(Card c){
|
||||
if (exiledCards == null)
|
||||
exiledCards = new CardList();
|
||||
|
||||
exiledCards.add(c);
|
||||
}
|
||||
|
||||
public CardList getExiledCost(){
|
||||
return exiledCards;
|
||||
}
|
||||
|
||||
public void resetExiledCost(){
|
||||
exiledCards = null;
|
||||
}
|
||||
|
||||
public void addDiscardedCost(Card c){
|
||||
if (discardedCards == null)
|
||||
discardedCards = new CardList();
|
||||
@@ -341,6 +357,7 @@ public abstract class SpellAbility {
|
||||
public void resetOnceResolved(){
|
||||
resetDiscardedCost();
|
||||
resetSacrificedCost();
|
||||
resetExiledCost();
|
||||
|
||||
if (chosenTarget != null)
|
||||
chosenTarget.resetTargets();
|
||||
|
||||
@@ -410,6 +410,11 @@ public class TriggerHandler {
|
||||
return sa[0].getSacrificedCost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardList getExiledCost() {
|
||||
return sa[0].getExiledCost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Card getSourceCard()
|
||||
{
|
||||
@@ -569,6 +574,12 @@ public class TriggerHandler {
|
||||
sa[0].resetSacrificedCost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetExiledCost()
|
||||
{
|
||||
sa[0].resetExiledCost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAbilityFactory(AbilityFactory af)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user