mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added The Tabernacle at Pendrell Vale and Magus of the Tabernacle.
- Fixed Bog Initiate Manacost. - Some slight performance improvements for displaying cards (not sure if it helps much). - A bunch of Adarkar Valkyrie bugs should be fixed now.
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
Magus of the Tabernacle
|
||||
3 W
|
||||
Creature Human Wizard
|
||||
All creatures have "At the beginning of your upkeep, sacrifice this creature unless you pay 1."
|
||||
2/6
|
||||
|
||||
The Tabernacle at Pendrell Vale
|
||||
no cost
|
||||
Legendary Land
|
||||
All creatures have "At the beginning of your upkeep, destroy this creature unless you pay 1."
|
||||
|
||||
Donate
|
||||
2 U
|
||||
Sorcery
|
||||
@@ -3260,7 +3271,7 @@ no text
|
||||
1,tap: add WU
|
||||
|
||||
Bog Initiate
|
||||
B
|
||||
1 B
|
||||
Creature Human Wizard
|
||||
no text
|
||||
1/1
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>0</int>
|
||||
<int>244</int>
|
||||
<int>245</int>
|
||||
<int>827</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -27,8 +27,8 @@
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>0</int>
|
||||
<int>244</int>
|
||||
<int>138</int>
|
||||
<int>245</int>
|
||||
<int>132</int>
|
||||
</object>
|
||||
</void>
|
||||
<void property="name">
|
||||
@@ -47,8 +47,8 @@
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>138</int>
|
||||
<int>244</int>
|
||||
<int>132</int>
|
||||
<int>245</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -62,9 +62,9 @@
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>148</int>
|
||||
<int>244</int>
|
||||
<int>190</int>
|
||||
<int>142</int>
|
||||
<int>245</int>
|
||||
<int>196</int>
|
||||
</object>
|
||||
</void>
|
||||
<void property="name">
|
||||
@@ -84,7 +84,7 @@
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>338</int>
|
||||
<int>244</int>
|
||||
<int>245</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -99,7 +99,7 @@
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>348</int>
|
||||
<int>244</int>
|
||||
<int>245</int>
|
||||
<int>113</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -120,7 +120,7 @@
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>461</int>
|
||||
<int>244</int>
|
||||
<int>245</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -135,7 +135,7 @@
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>471</int>
|
||||
<int>244</int>
|
||||
<int>245</int>
|
||||
<int>107</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -156,7 +156,7 @@
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>578</int>
|
||||
<int>244</int>
|
||||
<int>245</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -171,7 +171,7 @@
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>0</int>
|
||||
<int>588</int>
|
||||
<int>244</int>
|
||||
<int>245</int>
|
||||
<int>239</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -202,7 +202,7 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>244</int>
|
||||
<int>245</int>
|
||||
<int>0</int>
|
||||
<int>10</int>
|
||||
<int>827</int>
|
||||
@@ -217,9 +217,9 @@
|
||||
<object id="MultiSplitLayout$Split2" class="org.jdesktop.swingx.MultiSplitLayout$Split">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>0</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>827</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -228,9 +228,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>0</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>147</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -249,9 +249,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>147</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -264,9 +264,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>157</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>169</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -285,9 +285,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>326</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -300,9 +300,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>336</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>187</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -321,9 +321,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>523</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -336,9 +336,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>533</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>145</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -357,9 +357,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>678</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -372,9 +372,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>254</int>
|
||||
<int>255</int>
|
||||
<int>688</int>
|
||||
<int>926</int>
|
||||
<int>901</int>
|
||||
<int>139</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -408,7 +408,7 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>1180</int>
|
||||
<int>1156</int>
|
||||
<int>0</int>
|
||||
<int>10</int>
|
||||
<int>827</int>
|
||||
@@ -423,9 +423,9 @@
|
||||
<object id="MultiSplitLayout$Split3" class="org.jdesktop.swingx.MultiSplitLayout$Split">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>1190</int>
|
||||
<int>1166</int>
|
||||
<int>0</int>
|
||||
<int>250</int>
|
||||
<int>274</int>
|
||||
<int>827</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -434,9 +434,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>1190</int>
|
||||
<int>1166</int>
|
||||
<int>0</int>
|
||||
<int>250</int>
|
||||
<int>274</int>
|
||||
<int>409</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -455,9 +455,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>1190</int>
|
||||
<int>1166</int>
|
||||
<int>409</int>
|
||||
<int>250</int>
|
||||
<int>274</int>
|
||||
<int>10</int>
|
||||
</object>
|
||||
</void>
|
||||
@@ -470,9 +470,9 @@
|
||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
||||
<void property="bounds">
|
||||
<object class="java.awt.Rectangle">
|
||||
<int>1190</int>
|
||||
<int>1166</int>
|
||||
<int>419</int>
|
||||
<int>250</int>
|
||||
<int>274</int>
|
||||
<int>408</int>
|
||||
</object>
|
||||
</void>
|
||||
|
||||
@@ -81,6 +81,8 @@ public class Card extends MyObservable
|
||||
private String text = "";
|
||||
private String manaCost = "";
|
||||
private String upkeepCost = "";
|
||||
private String tabernacleUpkeepCost = "";
|
||||
private String magusTabernacleUpkeepCost = "";
|
||||
private String echoCost = "";
|
||||
private String chosenType = "";
|
||||
private String chosenColor = "";
|
||||
@@ -254,6 +256,12 @@ public class Card extends MyObservable
|
||||
public String getUpkeepCost() {return upkeepCost;}
|
||||
public boolean hasUpkeepCost(){return upkeepCost.length() > 0 && !upkeepCost.equals("0");}
|
||||
|
||||
public void setTabernacleUpkeepCost(String s) { tabernacleUpkeepCost = s; }
|
||||
public String getTabernacleUpkeepCost() { return tabernacleUpkeepCost; }
|
||||
|
||||
public void setMagusTabernacleUpkeepCost(String s) { magusTabernacleUpkeepCost = s; }
|
||||
public String getMagusTabernacleUpkeepCost() { return magusTabernacleUpkeepCost; }
|
||||
|
||||
//used for cards like Belbe's Portal, Conspiracy, Cover of Darkness, etc.
|
||||
public String getChosenType() { return chosenType;}
|
||||
public void setChosenType(String s) {chosenType = s;}
|
||||
|
||||
@@ -7826,8 +7826,8 @@ public class CardFactory_Creatures {
|
||||
if(AllZone.GameAction.isCardInZone(target[0], grave))
|
||||
{
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
|
||||
AllZone.GameAction.moveTo(play, target[0]);
|
||||
target[0].setController(card.getController());
|
||||
AllZone.GameAction.moveTo(play, target[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1625,7 +1625,7 @@ class CardFactory_Lands {
|
||||
}
|
||||
}
|
||||
|
||||
if (cards.size() > 0 && AllZone.GameAction.isCardInPlay(card) && card.isUntapped())
|
||||
if (super.canPlay() && cards.size() > 0 && AllZone.GameAction.isCardInPlay(card) && card.isUntapped())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
@@ -134,8 +134,8 @@ private Card getCurrentCard(int ID)
|
||||
public void discardHand(String player)
|
||||
{
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
|
||||
for (int i=0;i<hand.size();i++)
|
||||
discardRandom(player);
|
||||
CardList list = new CardList(hand.getCards());
|
||||
discardRandom(player, list.size());
|
||||
}
|
||||
|
||||
public void AI_discardNumUnless(int numDiscard, String uType)
|
||||
|
||||
@@ -11,6 +11,8 @@ public class GameActionUtil
|
||||
upkeep_UpkeepCost();
|
||||
upkeep_CumulativeUpkeepCost();
|
||||
upkeep_Echo();
|
||||
upkeep_TabernacleUpkeepCost();
|
||||
upkeep_MagusTabernacleUpkeepCost();
|
||||
// upkeep_CheckEmptyDeck_Lose(); //still a little buggy
|
||||
upkeep_Phyrexian_Arena();
|
||||
upkeep_Honden_of_Cleansing_Fire();
|
||||
@@ -2468,7 +2470,7 @@ public class GameActionUtil
|
||||
}
|
||||
}
|
||||
|
||||
public static void upkeep_UpkeepCost()
|
||||
public static void upkeep_TabernacleUpkeepCost()
|
||||
{
|
||||
String player = AllZone.Phase.getActivePlayer();
|
||||
|
||||
@@ -2483,10 +2485,11 @@ public class GameActionUtil
|
||||
ArrayList<String> a = c.getKeyword();
|
||||
for (int i = 0; i < a.size(); i++)
|
||||
{
|
||||
if (a.get(i).toString().startsWith("At the beginning of your upkeep, sacrifice "))
|
||||
if (a.get(i).toString().startsWith("At the beginning of your upkeep, destroy this creature unless you pay"))
|
||||
{
|
||||
String k[] = a.get(i).toString().split(":");
|
||||
c.setUpkeepCost(k[1]);
|
||||
String k[] = a.get(i).toString().split("pay ");
|
||||
k[1] = k[1].substring(0, k[1].length()-1);
|
||||
c.setTabernacleUpkeepCost(k[1]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -2498,7 +2501,7 @@ public class GameActionUtil
|
||||
{
|
||||
final Card c = list.get(i);
|
||||
|
||||
final Ability sacAbility = new Ability(c, c.getUpkeepCost())
|
||||
final Ability destroyAbility = new Ability(c, c.getTabernacleUpkeepCost())
|
||||
{
|
||||
public void resolve()
|
||||
{
|
||||
@@ -2511,7 +2514,7 @@ public class GameActionUtil
|
||||
private static final long serialVersionUID = -8737736216222268696L;
|
||||
|
||||
public void execute() {
|
||||
AllZone.GameAction.sacrifice(c);
|
||||
AllZone.GameAction.destroy(c);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2525,17 +2528,86 @@ public class GameActionUtil
|
||||
|
||||
//AllZone.Stack.add(sacAbility);
|
||||
if (c.getController().equals(Constant.Player.Human)) {
|
||||
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Upkeep for "+ c +"\r\n", sacAbility.getManaCost(), paidCommand, unpaidCommand));
|
||||
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Tabernacle Upkeep for "+ c +"\r\n", destroyAbility.getManaCost(), paidCommand, unpaidCommand));
|
||||
}
|
||||
else //computer
|
||||
{
|
||||
if (ComputerUtil.canPayCost(sacAbility))
|
||||
ComputerUtil.playNoStack(sacAbility);
|
||||
if (ComputerUtil.canPayCost(destroyAbility))
|
||||
ComputerUtil.playNoStack(destroyAbility);
|
||||
else
|
||||
AllZone.GameAction.destroy(c);
|
||||
}
|
||||
}
|
||||
}//TabernacleUpkeepCost
|
||||
|
||||
public static void upkeep_MagusTabernacleUpkeepCost()
|
||||
{
|
||||
String player = AllZone.Phase.getActivePlayer();
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, player);
|
||||
CardList list = new CardList();
|
||||
list.addAll(play.getCards());
|
||||
//list = list.getType("Creature");
|
||||
list = list.filter(new CardListFilter()
|
||||
{
|
||||
public boolean addCard(Card c)
|
||||
{
|
||||
ArrayList<String> a = c.getKeyword();
|
||||
for (int i = 0; i < a.size(); i++)
|
||||
{
|
||||
if (a.get(i).toString().startsWith("At the beginning of your upkeep, sacrifice this creature unless you pay"))
|
||||
{
|
||||
String k[] = a.get(i).toString().split("pay ");
|
||||
k[1] = k[1].substring(0, k[1].length()-1);
|
||||
c.setMagusTabernacleUpkeepCost(k[1]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
for (int i=0; i<list.size();i++)
|
||||
{
|
||||
final Card c = list.get(i);
|
||||
|
||||
final Ability sacrificeAbility = new Ability(c, c.getMagusTabernacleUpkeepCost())
|
||||
{
|
||||
public void resolve()
|
||||
{
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
final Command unpaidCommand = new Command() {
|
||||
private static final long serialVersionUID = 660060621665783254L;
|
||||
|
||||
public void execute() {
|
||||
AllZone.GameAction.sacrifice(c);
|
||||
}
|
||||
};
|
||||
|
||||
final Command paidCommand = new Command() {
|
||||
private static final long serialVersionUID = 7896720208740364774L;
|
||||
|
||||
public void execute() {
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
//AllZone.Stack.add(sacAbility);
|
||||
if (c.getController().equals(Constant.Player.Human)) {
|
||||
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Magus of the Tabernacle Upkeep for "+ c +"\r\n", sacrificeAbility.getManaCost(), paidCommand, unpaidCommand));
|
||||
}
|
||||
else //computer
|
||||
{
|
||||
if (ComputerUtil.canPayCost(sacrificeAbility))
|
||||
ComputerUtil.playNoStack(sacrificeAbility);
|
||||
else
|
||||
AllZone.GameAction.sacrifice(c);
|
||||
}
|
||||
}
|
||||
}//upkeepCost
|
||||
}//MagusTabernacleUpkeepCost
|
||||
|
||||
public static void upkeep_CumulativeUpkeepCost()
|
||||
{
|
||||
@@ -2665,11 +2737,80 @@ public class GameActionUtil
|
||||
AllZone.GameAction.sacrifice(c);
|
||||
}
|
||||
|
||||
|
||||
c.removeIntrinsicKeyword("(Echo unpaid)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}//echo
|
||||
|
||||
|
||||
public static void upkeep_UpkeepCost()
|
||||
{
|
||||
String player = AllZone.Phase.getActivePlayer();
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, player);
|
||||
CardList list = new CardList();
|
||||
list.addAll(play.getCards());
|
||||
//list = list.getType("Creature");
|
||||
list = list.filter(new CardListFilter()
|
||||
{
|
||||
public boolean addCard(Card c)
|
||||
{
|
||||
ArrayList<String> a = c.getKeyword();
|
||||
for (int i = 0; i < a.size(); i++)
|
||||
{
|
||||
if (a.get(i).toString().startsWith("At the beginning of your upkeep, sacrifice " +c.getName()))
|
||||
{
|
||||
String k[] = a.get(i).toString().split(":");
|
||||
c.setUpkeepCost(k[1]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
for (int i=0; i<list.size();i++)
|
||||
{
|
||||
final Card c = list.get(i);
|
||||
|
||||
final Ability sacAbility = new Ability(c, c.getUpkeepCost())
|
||||
{
|
||||
public void resolve()
|
||||
{
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
final Command unpaidCommand = new Command() {
|
||||
|
||||
private static final long serialVersionUID = -6483405139208343935L;
|
||||
|
||||
public void execute() {
|
||||
AllZone.GameAction.sacrifice(c);
|
||||
}
|
||||
};
|
||||
|
||||
final Command paidCommand = new Command() {
|
||||
private static final long serialVersionUID = -8303368287601871955L;
|
||||
|
||||
public void execute() {
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
//AllZone.Stack.add(sacAbility);
|
||||
if (c.getController().equals(Constant.Player.Human)) {
|
||||
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Upkeep for "+ c +"\r\n", sacAbility.getManaCost(), paidCommand, unpaidCommand));
|
||||
}
|
||||
else //computer
|
||||
{
|
||||
if (ComputerUtil.canPayCost(sacAbility))
|
||||
ComputerUtil.playNoStack(sacAbility);
|
||||
else
|
||||
AllZone.GameAction.sacrifice(c);
|
||||
}
|
||||
}
|
||||
}//upkeepCost
|
||||
|
||||
|
||||
public static void removeAttackedBlockedThisTurn()
|
||||
@@ -4835,6 +4976,8 @@ public class GameActionUtil
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static void upkeep_AEther_Vial()
|
||||
{
|
||||
final String player = AllZone.Phase.getActivePlayer();
|
||||
@@ -7669,7 +7812,6 @@ public class GameActionUtil
|
||||
Wirewood_Hivemaster.execute();
|
||||
|
||||
Sacrifice_NoIslands.execute();
|
||||
|
||||
//Angelic_Chorus.execute();
|
||||
|
||||
/*
|
||||
@@ -8675,6 +8817,114 @@ public class GameActionUtil
|
||||
}// execute()
|
||||
};
|
||||
|
||||
public static Command Tabernacle = new Command()
|
||||
{
|
||||
private static final long serialVersionUID = -3233715310427996429L;
|
||||
CardList gloriousAnthemList = new CardList();
|
||||
|
||||
public void execute()
|
||||
{
|
||||
String keyword = "At the beginning of your upkeep, destroy this creature unless you pay";
|
||||
|
||||
CardList list = gloriousAnthemList;
|
||||
Card c;
|
||||
// reset all cards in list - aka "old" cards
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
c = list.get(i);
|
||||
ArrayList<String> a = c.getKeyword();
|
||||
for (String s : a)
|
||||
{
|
||||
if (s.startsWith(keyword))
|
||||
c.removeExtrinsicKeyword(s);
|
||||
}
|
||||
}
|
||||
|
||||
list.clear();
|
||||
PlayerZone cPlay = AllZone.Computer_Play;
|
||||
PlayerZone hPlay = AllZone.Human_Play;
|
||||
CardList clist = new CardList();
|
||||
clist.addAll(cPlay.getCards());
|
||||
clist.addAll(hPlay.getCards());
|
||||
clist = clist.filter(new CardListFilter(){
|
||||
public boolean addCard(Card c)
|
||||
{
|
||||
return c.getName().equals("The Tabernacle at Pendrell Vale"); /*|| c.getName().equals("Magus of the Tabernacle");*/
|
||||
}
|
||||
});
|
||||
|
||||
int number = clist.size();
|
||||
//System.out.println("Tabernacle Number:" + number);
|
||||
if (number > 0) {
|
||||
CardList creature = new CardList();
|
||||
creature.addAll(AllZone.Human_Play.getCards());
|
||||
creature.addAll(AllZone.Computer_Play.getCards());
|
||||
creature = creature.getType("Creature");
|
||||
|
||||
for (int i = 0; i < creature.size(); i++)
|
||||
{
|
||||
c = creature.get(i);
|
||||
c.addExtrinsicKeyword(keyword + " " + number + ".");
|
||||
gloriousAnthemList.add(c);
|
||||
}// for inner
|
||||
}
|
||||
}// execute()
|
||||
};
|
||||
|
||||
public static Command Magus_of_the_Tabernacle = new Command()
|
||||
{
|
||||
private static final long serialVersionUID = -249708982895077034L;
|
||||
CardList gloriousAnthemList = new CardList();
|
||||
|
||||
public void execute()
|
||||
{
|
||||
String keyword = "At the beginning of your upkeep, sacrifice this creature unless you pay";
|
||||
|
||||
CardList list = gloriousAnthemList;
|
||||
Card c;
|
||||
// reset all cards in list - aka "old" cards
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
c = list.get(i);
|
||||
ArrayList<String> a = c.getKeyword();
|
||||
for (String s : a)
|
||||
{
|
||||
if (s.startsWith(keyword))
|
||||
c.removeExtrinsicKeyword(s);
|
||||
}
|
||||
}
|
||||
|
||||
list.clear();
|
||||
PlayerZone cPlay = AllZone.Computer_Play;
|
||||
PlayerZone hPlay = AllZone.Human_Play;
|
||||
CardList clist = new CardList();
|
||||
clist.addAll(cPlay.getCards());
|
||||
clist.addAll(hPlay.getCards());
|
||||
clist = clist.filter(new CardListFilter(){
|
||||
public boolean addCard(Card c)
|
||||
{
|
||||
return c.getName().equals("Magus of the Tabernacle");
|
||||
}
|
||||
});
|
||||
|
||||
int number = clist.size();
|
||||
//System.out.println("Tabernacle Number:" + number);
|
||||
if (number > 0) {
|
||||
CardList creature = new CardList();
|
||||
creature.addAll(AllZone.Human_Play.getCards());
|
||||
creature.addAll(AllZone.Computer_Play.getCards());
|
||||
creature = creature.getType("Creature");
|
||||
|
||||
for (int i = 0; i < creature.size(); i++)
|
||||
{
|
||||
c = creature.get(i);
|
||||
c.addExtrinsicKeyword(keyword + " " + number + ".");
|
||||
gloriousAnthemList.add(c);
|
||||
}// for inner
|
||||
}
|
||||
}// execute()
|
||||
};
|
||||
|
||||
|
||||
public static Command Serras_Blessing = new Command()
|
||||
{
|
||||
@@ -15731,6 +15981,8 @@ public class GameActionUtil
|
||||
commands.put("Knighthood", Knighthood);
|
||||
commands.put("Absolute_Law", Absolute_Law);
|
||||
commands.put("Absolute_Grace", Absolute_Grace);
|
||||
commands.put("Tabernacle", Tabernacle);
|
||||
commands.put("Magus_of_the_Tabernacle", Magus_of_the_Tabernacle);
|
||||
commands.put("Mobilization", Mobilization);
|
||||
commands.put("Serras_Blessing", Serras_Blessing);
|
||||
commands.put("Cover_of_Darkness", Cover_of_Darkness);
|
||||
|
||||
@@ -83,6 +83,9 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
|
||||
public Color c3 = new Color(204,204,204);
|
||||
*/
|
||||
|
||||
private String current_picture = "";
|
||||
private int count = 0;
|
||||
|
||||
public static Color c1 = new Color(204, 204, 204);
|
||||
public static Color c2 = new Color(204, 204, 204);
|
||||
public static Color c3 = new Color(0, 164, 0);
|
||||
@@ -256,7 +259,10 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
|
||||
if(choices[0] instanceof Card) {
|
||||
list.addListSelectionListener(new ListSelectionListener() {
|
||||
public void valueChanged(ListSelectionEvent ev) {
|
||||
if(list.getSelectedValue() instanceof Card) updateCardDetail((Card) list.getSelectedValue());
|
||||
if(list.getSelectedValue() instanceof Card){
|
||||
updateCardDetailText((Card) list.getSelectedValue());
|
||||
updateCardDetailPicture((Card) list.getSelectedValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -272,7 +278,10 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
|
||||
if(choices[0] instanceof Card) {
|
||||
list.addListSelectionListener(new ListSelectionListener() {
|
||||
public void valueChanged(ListSelectionEvent ev) {
|
||||
if(list.getSelectedValue() instanceof Card) updateCardDetail((Card) list.getSelectedValue());
|
||||
if(list.getSelectedValue() instanceof Card) {
|
||||
updateCardDetailText((Card) list.getSelectedValue());
|
||||
updateCardDetailPicture((Card) list.getSelectedValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -402,7 +411,7 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
|
||||
|
||||
}//addListener()
|
||||
|
||||
public void updateCardDetail(Card c) {
|
||||
public void updateCardDetailText(Card c) {
|
||||
// if(! c.isToken())
|
||||
// System.out.println(c +" " +c.getSpellAbility()[0].canPlay() +" " +c.getSpellAbility()[0].getManaCost());
|
||||
|
||||
@@ -530,14 +539,24 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
|
||||
|
||||
cdPanel.setBorder(GuiDisplayUtil.getBorder(c));
|
||||
cCardHQ = c;
|
||||
}
|
||||
public void updateCardDetailPicture(Card c)
|
||||
{
|
||||
|
||||
if (c.getImageName().equals(current_picture) /*&& !c.isBasicLand()*/)
|
||||
return;
|
||||
|
||||
//picture
|
||||
System.out.println("UPDATING PICTURE!!! #:" + count++);
|
||||
current_picture = c.getImageName();
|
||||
picturePanel.removeAll();
|
||||
JPanel pic = GuiDisplayUtil.getPicture(c);
|
||||
pic.setSize(300, 300);
|
||||
picturePanel.add(pic);
|
||||
picturePanel.revalidate();
|
||||
System.gc();
|
||||
|
||||
//System.out.println(picturePanel.getComponentCount());
|
||||
}//updateCardDetail()
|
||||
|
||||
private void addObservers() {
|
||||
@@ -632,7 +651,8 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent me) {
|
||||
GuiDisplay3.this.updateCardDetail(cardPanel.getCard());
|
||||
GuiDisplay3.this.updateCardDetailText(cardPanel.getCard());
|
||||
GuiDisplay3.this.updateCardDetailPicture(cardPanel.getCard());
|
||||
}//mouseMoved
|
||||
});
|
||||
|
||||
@@ -1377,7 +1397,10 @@ class Gui_MultipleBlockers3 extends JFrame {
|
||||
|
||||
AllZone.GameAction.addAssignedDamage(c, att, /*c.getTotalAssignedDamage() +*/ 1);
|
||||
|
||||
if(guiDisplay != null) guiDisplay.updateCardDetail(c);
|
||||
if(guiDisplay != null) {
|
||||
guiDisplay.updateCardDetailText(c);
|
||||
guiDisplay.updateCardDetailPicture(c);
|
||||
}
|
||||
}
|
||||
//reduce damage, show new user message, exit if necessary
|
||||
assignDamage--;
|
||||
@@ -1395,7 +1418,11 @@ class Gui_MultipleBlockers3 extends JFrame {
|
||||
CardPanel cardPanel = (CardPanel) o;
|
||||
Card c = cardPanel.getCard();
|
||||
|
||||
if(guiDisplay != null) guiDisplay.updateCardDetail(c);
|
||||
if(guiDisplay != null) {
|
||||
guiDisplay.updateCardDetailText(c);
|
||||
guiDisplay.updateCardDetailPicture(c);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,8 @@ public class GuiDisplayUtil implements NewConstants {
|
||||
|
||||
if((o != null) && (o instanceof CardPanel)) {
|
||||
CardPanel cardPanel = (CardPanel) o;
|
||||
visual.updateCardDetail(cardPanel.getCard());
|
||||
visual.updateCardDetailText(cardPanel.getCard());
|
||||
visual.updateCardDetailPicture(cardPanel.getCard());
|
||||
}
|
||||
}//mouseMoved
|
||||
};
|
||||
@@ -199,6 +200,80 @@ public class GuiDisplayUtil implements NewConstants {
|
||||
return returnString;
|
||||
}
|
||||
|
||||
public static ImageIcon getImageIcon(Card c)
|
||||
{
|
||||
String suffix = ".jpg";
|
||||
String filename = "";
|
||||
if(!c.isFaceDown()) {
|
||||
String basicLandSuffix = "";
|
||||
if(c.isBasicLand()) {
|
||||
if(c.getRandomPicture() != 0) basicLandSuffix = Integer.toString(c.getRandomPicture());
|
||||
}
|
||||
|
||||
filename = cleanString(c.getImageName()) + basicLandSuffix + suffix;
|
||||
} else filename = "morph" + suffix;
|
||||
|
||||
String loc = "";
|
||||
if (!c.isToken())
|
||||
loc = IMAGE_BASE;
|
||||
else
|
||||
loc = IMAGE_TOKEN;
|
||||
|
||||
File file = new File(ForgeProps.getFile(loc), filename);
|
||||
|
||||
//try current directory
|
||||
if(!file.exists()) {
|
||||
filename = cleanString(c.getName()) + suffix;
|
||||
file = new File(filename);
|
||||
}
|
||||
|
||||
|
||||
if(file.exists()) {
|
||||
if(c.isFaceDown()){
|
||||
return new ImageIcon(filename);
|
||||
}else{
|
||||
int cWidth = 0;
|
||||
int cHeight = 0;
|
||||
try {
|
||||
cWidth = GuiDisplayUtil.getPictureHQwidth(c);
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
cHeight = GuiDisplayUtil.getPictureHQheight(c);
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(cWidth<=312 || cHeight<=445) {
|
||||
return new ImageIcon(filename);
|
||||
}else{
|
||||
return new ImageIcon(filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*else {
|
||||
ImageIcon i = new ImageIcon();
|
||||
|
||||
JTextArea text = new JTextArea("\r\n\r\n" + filename, 10, 15);
|
||||
Font f = text.getFont();
|
||||
f = f.deriveFont(f.getSize() + 2.0f);
|
||||
text.setFont(f);
|
||||
text.setBackground(p.getBackground());
|
||||
|
||||
i.add(text);
|
||||
|
||||
if(c.isToken()) return new ImageIcon();
|
||||
|
||||
return i;
|
||||
}//else
|
||||
*/
|
||||
return new ImageIcon();
|
||||
}
|
||||
|
||||
public static JPanel getPicture(Card c) {
|
||||
if(AllZone.NameChanger.shouldChangeCardName()) return new JPanel();
|
||||
|
||||
@@ -208,10 +283,13 @@ public class GuiDisplayUtil implements NewConstants {
|
||||
if(!c.isFaceDown()) {
|
||||
String basicLandSuffix = "";
|
||||
if(c.isBasicLand()) {
|
||||
if(c.getRandomPicture() != 0) basicLandSuffix = Integer.toString(c.getRandomPicture());
|
||||
}
|
||||
if(c.getRandomPicture() != 0) {
|
||||
basicLandSuffix = Integer.toString(c.getRandomPicture());
|
||||
//c.setImageName(c.getImageName() + basicLandSuffix);
|
||||
}
|
||||
|
||||
filename = cleanString(c.getImageName()) + basicLandSuffix + suffix;
|
||||
}
|
||||
filename = cleanString(c.getImageName())+ basicLandSuffix + suffix;
|
||||
} else filename = "morph" + suffix;
|
||||
|
||||
String loc = "";
|
||||
|
||||
@@ -127,6 +127,8 @@ public class StateBasedEffects
|
||||
cardToEffectsList.put("Knighthood", new String[] {"Knighthood"});
|
||||
cardToEffectsList.put("Absolute Law", new String[] {"Absolute_Law"});
|
||||
cardToEffectsList.put("Absolute Grace", new String[] {"Absolute_Grace"});
|
||||
cardToEffectsList.put("The Tabernacle at Pendrell Vale", new String[] {"Tabernacle"});
|
||||
cardToEffectsList.put("Magus of the Tabernacle", new String[] {"Magus_of_the_Tabernacle"});
|
||||
cardToEffectsList.put("Mobilization", new String[] {"Mobilization"});
|
||||
cardToEffectsList.put("Serra's Blessing", new String[] {"Serras_Blessing"});
|
||||
cardToEffectsList.put("Cover of Darkness", new String[] {"Cover_of_Darkness"});
|
||||
|
||||
Reference in New Issue
Block a user