mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Added Tetravus (to enable it I had to add a YChoice svar and ChosenY value. Only added to CostExile, not the other cost types)
This commit is contained in:
@@ -48,6 +48,7 @@ c_1_1_shapeshifter.jpg http://www.cardforge.org/fpics/tokens/c_1
|
||||
c_1_1_sliver.jpg http://www.cardforge.org/fpics/tokens/c_1_1_sliver.jpg
|
||||
c_1_1_snake.jpg http://www.cardforge.org/fpics/tokens/c_1_1_snake.jpg
|
||||
c_1_1_spirit.jpg http://www.cardforge.org/fpics/tokens/c_1_1_spirit.jpg
|
||||
c_1_1_tetravite.jpg http://www.cardforge.org/fpics/tokens/c_1_1_tetravite.jpg
|
||||
c_1_1_thopter.jpg http://www.cardforge.org/fpics/tokens/c_1_1_thopter.jpg
|
||||
c_1_1_triskelavite.jpg http://www.cardforge.org/fpics/tokens/c_1_1_triskelavite.jpg
|
||||
c_1_1_wasp.jpg http://www.cardforge.org/fpics/tokens/c_1_1_wasp.jpg
|
||||
@@ -194,10 +195,9 @@ sorin_lord_of_innistrad_emblem.jpg http://www.cardforge.org/fpics/effects/so
|
||||
morph.jpg http://www.cardforge.org/fpics/effects/morph.jpg
|
||||
|
||||
# //These tokens are not currently used by any cards in Forge, but links provided should they be scripted so the correct name is used:
|
||||
# //c_1_1_tetravite.jpg http://www.cardforge.org/fpics/tokens/c_1_1_tetravite.jpg [ATQ/4ED] Tetravus
|
||||
# //c_4_4_kaldra.jpg http://www.cardforge.org/fpics/tokens/c_4_4_kaldra.jpg [5DN] Helm of Kaldra
|
||||
# //g_1_1_wolves_of_the_hunt.jpg http://www.cardforge.org/fpics/tokens/g_1_1_wolves_of_the_hunt.jpg [LEG] Master of the Hunt
|
||||
# //r_1_1_warrior.jpg http://www.cardforge.org/fpics/tokens/r_1_1_warrior.jpg [SOK] Rally the Hoard
|
||||
# //r_1_1_warrior.jpg http://www.cardforge.org/fpics/tokens/r_1_1_warrior.jpg [SOK] Rally the Horde
|
||||
# //rg_1_1_goblin_warrior.jpg http://www.cardforge.org/fpics/tokens/rg_1_1_goblin_warrior.jpg [SHM] Wort, the Raidmother
|
||||
# //rg_4_4_giant_warrior.jpg http://www.cardforge.org/fpics/tokens/rg_4_4_giant_warrior.jpg [SHM] Giantbaiting
|
||||
# //u_1_1_merfolk.jpg http://www.cardforge.org/fpics/tokens/u_1_1_merfolk.jpg [ZEN] Lullmage Mentor
|
||||
|
||||
@@ -470,7 +470,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
private final ArrayList<Command> untapCommandList = new ArrayList<Command>();
|
||||
private final ArrayList<Command> changeControllerCommandList = new ArrayList<Command>();
|
||||
|
||||
private static String[] storableSVars = { "ChosenX" };
|
||||
private static String[] storableSVars = { "ChosenX", "ChosenY" };
|
||||
|
||||
private final ArrayList<Card> hauntedBy = new ArrayList<Card>();
|
||||
private Card haunting = null;
|
||||
|
||||
@@ -762,7 +762,7 @@ public class AbilityFactory {
|
||||
}
|
||||
|
||||
else if (this.api.equals("EndTurn")) {
|
||||
if(this.isAb) {
|
||||
if (this.isAb) {
|
||||
spellAbility = AbilityFactoryTurns.createAbilityEndTurn(this);
|
||||
} else if (this.isSp) {
|
||||
spellAbility = AbilityFactoryTurns.createSpellEndTurn(this);
|
||||
@@ -1673,7 +1673,7 @@ public class AbilityFactory {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (amount.equals("ChosenX")) {
|
||||
if (amount.equals("ChosenX") || amount.equals("ChosenY")) {
|
||||
// isn't made yet
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -189,7 +189,11 @@ public class CostExile extends CostPartWithList {
|
||||
// Generalize this
|
||||
if (sVar.equals("XChoice")) {
|
||||
c = CostUtil.chooseXValue(source, list.size());
|
||||
} else {
|
||||
}
|
||||
if (sVar.equals("YChoice")) {
|
||||
c = CostUtil.chooseYValue(source, list.size());
|
||||
}
|
||||
else {
|
||||
c = AbilityFactory.calculateAmount(source, amount, ability);
|
||||
}
|
||||
}
|
||||
@@ -226,6 +230,10 @@ public class CostExile extends CostPartWithList {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sVar.equals("YChoice")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
c = AbilityFactory.calculateAmount(source, this.getAmount(), ability);
|
||||
}
|
||||
|
||||
|
||||
@@ -248,6 +248,8 @@ public class CostUtil {
|
||||
// Generalize this
|
||||
if (sVar.equals("XChoice")) {
|
||||
c = CostUtil.chooseXValue(source, maxChoice);
|
||||
} if (sVar.equals("YChoice")) {
|
||||
c = CostUtil.chooseYValue(source, maxChoice);
|
||||
} else {
|
||||
c = AbilityFactory.calculateAmount(source, amount, ability);
|
||||
}
|
||||
@@ -281,6 +283,32 @@ public class CostUtil {
|
||||
return chosenX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Choose x value (for ChosenY).
|
||||
*
|
||||
* @param card
|
||||
* the card
|
||||
* @param maxValue
|
||||
* the max value
|
||||
* @return the int
|
||||
*/
|
||||
public static int chooseYValue(final Card card, final int maxValue) {
|
||||
final String chosen = card.getSVar("ChosenY");
|
||||
if (chosen.length() > 0) {
|
||||
return AbilityFactory.calculateAmount(card, "ChosenY", null);
|
||||
}
|
||||
|
||||
final Integer[] choiceArray = new Integer[maxValue + 1];
|
||||
for (int i = 0; i < choiceArray.length; i++) {
|
||||
choiceArray[i] = i;
|
||||
}
|
||||
final Object o = GuiUtils.getChoice(card.toString() + " - Choose a Value for Y", choiceArray);
|
||||
final int chosenY = (Integer) o;
|
||||
card.setSVar("ChosenY", "Number$" + Integer.toString(chosenY));
|
||||
|
||||
return chosenY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setInput.
|
||||
|
||||
Reference in New Issue
Block a user