- Cards like Priest of Titania, Gaea's Cradle and Serra Sanctum are keywordable, don't use the stack anymore and can be used directly when a spell/ability is being paid for.

The keywords would look like this: "tap: add {ManaSymbol} to your mana pool for each {Type} {on the battlefield / you control}."
- Face down cards should show "morph.jpg" on the full-size picture now (hiding its true identity).
- Right-clicking on an attacker during the Declare Attackers phase will untap and remove the attacker from combat.
This commit is contained in:
jendave
2011-08-06 03:16:45 +00:00
parent 9472cc88a7
commit a522c0d7bf
9 changed files with 93 additions and 311 deletions

View File

@@ -2172,11 +2172,13 @@ Magus of the Coffers
Creature Human Wizard
no text
4/4
2,tap: add B to your mana pool for each Swamp you control.
Cabal Coffers
no cost
Land
no text
2,tap: add B to your mana pool for each Swamp you control.
Xiahou Dun, the One-Eyed
2 B B
@@ -5821,6 +5823,7 @@ Elvish Archdruid
Creature Elf Druid
Other Elf creatures you control get +1/+1.
2/2
tap: add G to your mana pool for each Elf you control.
Warren-Scourge Elf
1 G
@@ -6488,21 +6491,25 @@ Priest of Titania
Creature Elf Druid
no text
1/1
tap: add G to your mana pool for each Elf on the battlefield.
Serra's Sanctum
no cost
Legendary Land
no text
tap: add W to your mana pool for each Enchantment you control.
Tolarian Academy
no cost
Legendary Land
no text
tap: add U to your mana pool for each Artifact you control.
Gaea's Cradle
no cost
Legendary Land
no text
tap: add G to your mana pool for each Creature you control.
Sol Ring
1

View File

@@ -1,6 +1,6 @@
program/mail=mtgerror@yahoo.com
program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26
program/version=Forge -- official beta: 10/01/17, SVN revision: 302
program/version=Forge -- official beta: 10/01/17, SVN revision: 304
tokens--file=AllTokens.txt

View File

@@ -6,6 +6,7 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria
private ArrayList<Command> runcommands = new ArrayList<Command>();
public String orig;
private String Mana;
private Card sourceCard;
public boolean isBasic()
{
@@ -42,8 +43,23 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria
}
*/
this.sourceCard = sourceCard;
this.orig=orig;
setDescription(orig);
/*
String parts[] = orig.split(":");
System.out.println("0:" +parts[0]);
System.out.println("1:" +parts[1]);
StringBuilder sb = new StringBuilder();
sb.append(parts[0]);
sb.append(parts[1]);
sb.append(" to your mana pool for each ");
setDescription(sb.toString());
*/
if(isBasic())//lowers memory usage drastically
{
Mana = "" + orig.charAt(9);
@@ -76,9 +92,6 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria
if(pain.contains(sourceCard.getName()) && !Mana.equals("1"))
runcommands.add(new Command()
{
/**
*
*/
private static final long serialVersionUID = -5904507275105961979L;
public void execute(){
@@ -155,7 +168,43 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria
}
public int getX(){return getSourceCard().getX();}//override these when not defined by card,
public void setX(int X){getSourceCard().setX(X);}//i.e. "T, remove X charge counters from {name}: add X+1 <color> mana to your mana pool"
public String Mana(){return Mana;}//override for all non-X variable mana,
public String Mana(){
if(!orig.contains("for each"))
return Mana;
else
{
String[] manaPart = orig.split(":");
String m = manaPart[1];
m = m.replaceAll(" add ", "");
//TODO: make this handle "multiple-mana symbol" cases, if they are ever needed
m = m.substring(0, 2);
String[] parts = orig.split(" for each ");
int index = parts[1].indexOf(' ');
String s1 = parts[1].substring(0, index);
String s2 = parts[1].substring(index);
if (s2.equals(" on the battlefield."))
s2 = "TypeOnBattlefield";
else if (s2.equals(" you control."))
s2 = "TypeYouCtrl";
StringBuilder countSB = new StringBuilder();
countSB.append("Count$");
countSB.append(s2);
countSB.append(".");
countSB.append(s1);
int count = CardFactoryUtil.xCount(sourceCard, countSB.toString());
StringBuilder sb = new StringBuilder();
for (int i=0;i<count;i++)
sb.append(m);
return sb.toString();
}
}//override for all non-X variable mana,
public String getController(){return getSourceCard().getController();}
public boolean canPlayAI(){return false;}

View File

@@ -15938,121 +15938,6 @@ public class CardFactory_Creatures {
card.addSpellAbility(ability);
}//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Elvish Archdruid"))
{
final SpellAbility ability = new Ability_Tap(card)
{
private static final long serialVersionUID = -7073759752440531772L;
public void resolve()
{
/*CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards());
list = list.getName("Mana Pool");*/
Card mp = AllZone.ManaPool;//list.getCard(0);
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
CardList creats = new CardList();
creats.addAll(play.getCards());
creats = creats.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.getType().contains("Elf") || c.getKeyword().contains("Changeling");
}
});
for(int i=0;i<creats.size();i++)
{
mp.addExtrinsicKeyword("ManaPool:G");
}
}
public boolean canPlayAI()
{
return false;
}
};
ability.setDescription("tap: add G to your mana pool for each Elf you control.");
ability.setStackDescription(cardName + " adds G to your mana pool for each Elf you control.");
//card.clearSpellAbility();
card.addSpellAbility(ability);
return card;
}//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Priest of Titania"))
{
final SpellAbility ability = new Ability_Tap(card)
{
private static final long serialVersionUID = -9155272432379335551L;
public void resolve()
{
Card mp = AllZone.ManaPool;
PlayerZone hum = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human);
PlayerZone comp = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
CardList creats = new CardList();
creats.addAll(hum.getCards());
creats.addAll(comp.getCards());
creats = creats.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.getType().contains("Elf") || c.getKeyword().contains("Changeling");
}
});
for(int i=0;i<creats.size();i++)
{
mp.addExtrinsicKeyword("ManaPool:G");
}
}
public boolean canPlayAI()
{
return false;
}
};
ability.setDescription("tap: add G to your mana pool for each Elf in play.");
ability.setStackDescription(cardName + " adds G to your mana pool for each Elf in play.");
//card.clearSpellAbility();
card.addSpellAbility(ability);
return card;
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
if (cardName.equals("Priest of Titania"))
{
String countString = "Count$TypeOnBattlefield.Elf";
SpellAbility ability = new Ability_Mana(card, "tap: add G:"+countString)
{
private static final long serialVersionUID = -5461196759660196802L;
};
ability.setDescription("tap: add G to your mana pool for each Elf in play.");
ability.setStackDescription(cardName + " adds G to your mana pool for each Elf in play.");
//card.clearSpellAbility();
card.addSpellAbility(ability);
return card;
}//*************** END ************ END **************************
*/
//*************** START ************ START **************************
if (cardName.equals("Rats of Rath"))
{
@@ -18147,40 +18032,6 @@ public class CardFactory_Creatures {
}//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Magus of the Coffers"))
{
final SpellAbility ability = new Ability_Tap(card, "2")
{
private static final long serialVersionUID = 138661285416402582L;
public void resolve()
{
Card mp = AllZone.ManaPool;//list.getCard(0);
CardList swamps = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
swamps = swamps.getType("Swamp");
for(int i=0;i<swamps.size();i++)
{
mp.addExtrinsicKeyword("ManaPool:B");
}
}
public boolean canPlayAI()
{
return false;
}
};
ability.setDescription("2, tap: Add B to your mana pool for each Swamp you control.");
ability.setStackDescription(cardName + " adds B to your mana pool for each Swamp you control.");
//card.clearSpellAbility();
//card.setText(card.getText() + ability.toString());
card.addSpellAbility(ability);
return card;
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Fire Bowman"))
{
final Ability ability = new Ability(card, "0")

View File

@@ -2006,149 +2006,7 @@ class CardFactory_Lands {
}//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Gaea's Cradle"))
{
final SpellAbility ability = new Ability_Tap(card)
{
private static final long serialVersionUID = -1631970749273122485L;
public void resolve()
{
/*CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards());
list = list.getName("Mana Pool");*/
Card mp = AllZone.ManaPool;//list.getCard(0);
CardList creats = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
creats = creats.getType("Creature");
for(int i=0;i<creats.size();i++)
{
mp.addExtrinsicKeyword("ManaPool:G");
}
}
public boolean canPlayAI()
{
return false;
}
};
ability.setDescription("tap: Add G to your mana pool for each creature you control.");
ability.setStackDescription(cardName + " adds G to your mana pool for each creature you control.");
//card.clearSpellAbility();
//card.setText(card.getText() + ability.toString());
card.addSpellAbility(ability);
return card;
}//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Tolarian Academy"))
{
final SpellAbility ability = new Ability_Tap(card)
{
private static final long serialVersionUID = -9155272432379335551L;
public void resolve()
{
/*CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards());
list = list.getName("Mana Pool");*/
Card mp = AllZone.ManaPool;//list.getCard(0);
CardList arts = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
arts = arts.getType("Artifact");
for(int i=0;i<arts.size();i++)
{
mp.addExtrinsicKeyword("ManaPool:U");
}
}
public boolean canPlayAI()
{
return false;
}
};
ability.setDescription("tap: Add U to your mana pool for each artifact you control.");
ability.setStackDescription(cardName + " adds U to your mana pool for each artifact you control.");
//card.clearSpellAbility();
//card.setText(card.getText() + ability.toString());
card.addSpellAbility(ability);
return card;
}//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Serra's Sanctum"))
{
final SpellAbility ability = new Ability_Tap(card)
{
private static final long serialVersionUID = 6337899963974773375L;
public void resolve()
{
/*CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards());
list = list.getName("Mana Pool");*/
Card mp = AllZone.ManaPool;//list.getCard(0);
CardList ench = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
ench = ench.getType("Enchantment");
for(int i=0;i<ench.size();i++)
{
mp.addExtrinsicKeyword("ManaPool:W");
}
}
public boolean canPlayAI()
{
return false;
}
};
ability.setDescription("tap: Add W to your mana pool for each enchantment you control.");
ability.setStackDescription(cardName + " adds W to your mana pool for each enchantment you control.");
//card.clearSpellAbility();
//card.setText(card.getText() + ability.toString());
card.addSpellAbility(ability);
return card;
}//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Cabal Coffers"))
{
final SpellAbility ability = new Ability_Tap(card, "2")
{
private static final long serialVersionUID = -3561865824450791583L;
public void resolve()
{
/*CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards());
list = list.getName("Mana Pool");*/
Card mp = AllZone.ManaPool;//list.getCard(0);
CardList swamps = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
swamps = swamps.getType("Swamp");
for(int i=0;i<swamps.size();i++)
{
mp.addExtrinsicKeyword("ManaPool:B");
}
}
public boolean canPlayAI()
{
return false;
}
};
ability.setDescription("2, tap: Add B to your mana pool for each Swamp you control.");
ability.setStackDescription(cardName + " adds B to your mana pool for each Swamp you control.");
//card.clearSpellAbility();
//card.setText(card.getText() + ability.toString());
card.addSpellAbility(ability);
return card;
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Spawning Pool"))
{

View File

@@ -385,8 +385,17 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
}
}
}
//right click:
if (e.isMetaDown()) {
if (att.contains(cardPanel.getCard()) )
{
cardPanel.getCard().untap();
AllZone.Combat.removeFromCombat(cardPanel.getCard());
}
}
inputControl.selectCard(cardPanel.getCard(), AllZone.Human_Play);
else
inputControl.selectCard(cardPanel.getCard(), AllZone.Human_Play);
}
}
});
@@ -625,9 +634,12 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
cCardHQ = c;
}
public void updateCardDetailPicture(Card c)
{
{
String imageName = c.getImageName();
if (c.isFaceDown())
imageName = "Morph";
if (c.getImageName().equals(current_picture) /*&& !c.isBasicLand()*/)
if (imageName.equals(current_picture) /*&& !c.isBasicLand()*/)
return;
//picture
@@ -642,18 +654,18 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
*/
current_picture = c.getImageName();
current_picture = imageName;
BufferedImage srcImage = null;
if(imageCache.containsKey(c.getImageName()))
srcImage = imageCache.get(c.getImageName());
if(imageCache.containsKey(imageName))
srcImage = imageCache.get(imageName);
else {
InputStream stream;
try {
//stream = new URL(GuiDisplayUtil.getURL(c)).openStream();
stream = GuiDisplayUtil.getURL(c).openStream();
srcImage = ImageIO.read(stream);
imageCache.put(c.getImageName(), srcImage);
imageCache.put(imageName, srcImage);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();

View File

@@ -315,13 +315,13 @@ import java.util.*;
return new Input()
{
private static final long serialVersionUID = 7378891097354547936L;
private static final long serialVersionUID = 7378891097354547936L;
public void showMessage()
{
AllZone.Display.showMessage("InputControl : Error nothing found");
throw new RuntimeException("InputControl : getInput() error, should not be here, phase " +phase +", player " +player);
}
public void showMessage()
{
AllZone.Display.showMessage("InputControl : Error nothing found");
throw new RuntimeException("InputControl : getInput() error, should not be here, phase " +phase +", player " +player);
}
};
}//getInput()
private boolean skipPhase()

View File

@@ -80,4 +80,9 @@ public void showMessage()
CombatUtil.showCombat();
}
}//selectCard()
public void unselectCard(Card card, PlayerZone zone)
{
}
}

View File

@@ -134,7 +134,7 @@ public void execute(Object o) {}};
//setDescription() includes mana cost and everything like
//"G, tap: put target creature from your hand into play"
public void setDescription(String s) {description = s;}
public void setDescription(String s) {description = s;}
public String toString() {return description;}
public Card getTargetCard()