mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
Due to unforseen complications, the Ability_Triggered class has been deactivated, however, InputControl was modified to delay any stacked inputs via stack(So it is possible to use two targeted ETFs with DotH or make use of LTF of creatures you sacrifice as part of a cost.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
program/mail=mtgrares@yahoo.com
|
||||
program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26
|
||||
program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 71
|
||||
program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 73
|
||||
|
||||
tokens--file=AllTokens.txt
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ public class Ability_Triggered extends Ability implements Command {
|
||||
public void execute() {
|
||||
resolve();
|
||||
}
|
||||
public CardList triggerFor(CardList c)
|
||||
public boolean triggerFor(Card c)
|
||||
{
|
||||
return c.getValidCards(restrictions);
|
||||
return !(new CardList(c)).getValidCards(restrictions).isEmpty();
|
||||
}
|
||||
public boolean triggerOnZoneChange(String sourceZone, String destinationZone)
|
||||
{
|
||||
|
||||
@@ -12,8 +12,8 @@ public class CardList implements Iterable<Card>
|
||||
//private LinkedList list = new LinkedList();
|
||||
|
||||
public CardList() {}
|
||||
public CardList(Card c[]) { addAll(c);}
|
||||
public CardList(Object c[]) {addAll(c);}
|
||||
public CardList(Card... c) { addAll(c);}
|
||||
public CardList(Object[] c) {addAll(c);}
|
||||
|
||||
// cardColor is like "R" or "G", returns a new CardList that is a subset of current CardList
|
||||
public CardList getColor(String cardColor)
|
||||
|
||||
@@ -887,7 +887,7 @@ private Card getCurrentCard(int ID)
|
||||
//changes AllZone.Computer_Library
|
||||
private Card[] smoothComputerManaCurve(Card[] in)
|
||||
{
|
||||
CardList library = new CardList(in);
|
||||
CardList library = new CardList(in);
|
||||
library.shuffle();
|
||||
|
||||
//remove all land, keep non-basicland in there, shuffled
|
||||
@@ -900,6 +900,8 @@ private Card getCurrentCard(int ID)
|
||||
//effectively use them very well
|
||||
land = threadLand(land);
|
||||
|
||||
try
|
||||
{
|
||||
//mana weave, total of 7 land
|
||||
library.add(7, land.get(0));
|
||||
library.add(8, land.get(1));
|
||||
@@ -909,6 +911,12 @@ private Card getCurrentCard(int ID)
|
||||
|
||||
library.add(13, land.get(5));
|
||||
library.add(16, land.get(6));
|
||||
}
|
||||
catch(NullPointerException e)
|
||||
{
|
||||
System.err.println("Error: cannot smooth mana curve, not enough land");
|
||||
return in;
|
||||
}
|
||||
|
||||
//add the rest of land to the end of the deck
|
||||
for(int i = 0; i < land.size(); i++)
|
||||
|
||||
@@ -233,7 +233,8 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
|
||||
|
||||
//returned Object could be null
|
||||
public <T> T getChoiceOptional(String message, T[] choices) {
|
||||
ListChooser<T> c = new ListChooser<T>(message, 0, 1, choices);
|
||||
if(choices == null || choices.length == 0) return null;
|
||||
ListChooser<T> c = new ListChooser<T>(message, 0, 1, choices);
|
||||
final JList list = c.getJList();
|
||||
if(choices[0] instanceof Card) {
|
||||
list.addListSelectionListener(new ListSelectionListener() {
|
||||
|
||||
@@ -9,9 +9,16 @@ package forge;
|
||||
private Input input;
|
||||
static int n = 0;
|
||||
|
||||
public void setInput(Input in)
|
||||
public void setInput(final Input in)
|
||||
{
|
||||
input = in;
|
||||
if(!(input == null || input instanceof Input_StackNotEmpty))
|
||||
AllZone.Stack.add(new Ability(AllZone.ManaPool, "no cost", "Delayed Input")//TODO: source other than mp?
|
||||
{
|
||||
public void resolve() {
|
||||
AllZone.InputControl.setInput(in);
|
||||
}
|
||||
});
|
||||
else input = in;
|
||||
updateObservers();
|
||||
}
|
||||
public void resetInput()
|
||||
|
||||
@@ -13,8 +13,8 @@ public class MagicStack extends MyObservable
|
||||
|
||||
public void add(SpellAbility sp)
|
||||
{
|
||||
if(sp instanceof Ability_Mana) sp.resolve(); else
|
||||
push(sp);
|
||||
if(sp instanceof Ability_Mana || sp instanceof Ability_Triggered)//TODO make working triggered abilities!
|
||||
sp.resolve(); else push(sp);
|
||||
}
|
||||
public int size()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user