Forbidden Orchard
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
1 post
• Page 1 of 1
Forbidden Orchard
by Chris H. » 24 Jun 2010, 02:57
I finally found the method where the computer pays mana costs at ComputerUtil.payManaCost(). I searched high and low and found it. I added a test to see if the card paying the mana cost is a Forbidden Orchard. If true, it will make a call to CardFactoryUtil.getForbiddenOrchardAbility() … and the human will now receive a 1/1 Spirit token. Success!
I will merge this into the SVN Thursday. This will allow me to add in Snacko's Oath of Druids deck as the 20th special quest deck.
I will merge this into the SVN Thursday. This will allow me to add in Snacko's Oath of Druids deck as the 20th special quest deck.

- Code: Select all
static public void payManaCost(SpellAbility sa)
{
CardList land = getAvailableMana();
//this is to prevent errors for land cards that have abilities that cost mana.
if(sa.getSourceCard().isLand() /*&& sa.isTapAbility()*/)
{
land.remove(sa.getSourceCard());
}
ManaCost cost = new ManaCost(sa.getManaCost());
cost = AllZone.GameAction.GetSpellCostChange(sa);
// Beached - Delete old
if(cost.isPaid())
return;
// Beached - Delete old
ArrayList<String> colors;
for(int i = 0; i < land.size(); i++)
{
colors = getColors(land.get(i));
for(int j = 0; j <colors.size();j++)
{
if(cost.isNeeded(colors.get(j)) && land.get(i).isUntapped())
{
land.get(i).tap();
cost.subtractMana(colors.get(j));
if (land.get(i).getName().equals("Forbidden Orchard")) {
AllZone.Stack.add(CardFactoryUtil.getForbiddenOrchardAbility(land.get(i), Constant.Player.Human));
}
//System.out.println("just subtracted " + colors.get(j) + ", cost is now: " + cost.toString());
}
if(cost.isPaid())
break;
}
}
if(! cost.isPaid())
throw new RuntimeException("ComputerUtil : payManaCost() cost was not paid for " + sa.getSourceCard().getName());
}//payManaCost()
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
1 post
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 36 guests