Black Lotus
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Black Lotus
by Rob Cashwalker » 22 Jun 2009, 04:25
- Code: Select all
if (cardName.equals("Black Lotus"))
{
final SpellAbility ability = new Ability_Tap(card)
{
private static final long serialVersionUID = 8394047173115959008L;
public boolean canPlayAI(){return false;}
public void resolve()
{
if (card.getController().equals(Constant.Player.Human))
{
CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards());
list = list.getName("Mana Pool");
Card mp = list.getCard(0);
String color = new String();
String warn = new String();
int n = 0;
int nn;
while (n < 3) {
color = (String)JOptionPane.showInputDialog(null, warn+"Enter a Mana character: [W,U,B,R,G]", "Pick mana color", JOptionPane.QUESTION_MESSAGE);
color = color.trim().substring(0,1).toUpperCase();
if (!"WUBRG".contains(color))
{
n++;
nn = 3 - n;
warn = "Bad input -"+color+". "+nn+" more tries.\n";
}
else
break;
}
//System.out.println("ManaPool:"+color+":");
for (int i = 0; i < 3; i++)
mp.addExtrinsicKeyword("ManaPool:"+color);
AllZone.GameAction.sacrifice(card);
}
}
};
ability.setStackDescription("Adds 3 mana of any one color to your mana pool");
card.addSpellAbility(ability);
}
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Black Lotus
by zerker2000 » 22 Jun 2009, 10:56
Huh? "<nn> more tries"??? Wouldn't it be easier to use the familiar oldRob Cashwalker wrote:
- Code: Select all
String color = new String();
String warn = new String();
int n = 0;
int nn;
while (n < 3) {
color = (String)JOptionPane.showInputDialog(null, warn+"Enter a Mana character: [W,U,B,R,G]", "Pick mana color", JOptionPane.QUESTION_MESSAGE);
color = color.trim().substring(0,1).toUpperCase();
if (!"WUBRG".contains(color))
{
n++;
nn = 3 - n;
warn = "Bad input -"+color+". "+nn+" more tries.\n";
}
else
break;
}
- Code: Select all
AllZone.Display.getChoice("Choose mana color",Constant.Color.Colors[]);
- Code: Select all
String Colorname = AllZone.Display.getChoice("Choose color",Constant.Color.Colors[]);
String color=Input_PayManaCostUtil.getColor(Colorname);
- Code: Select all
CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards());
list = list.getName("Mana Pool");
Card mp = list.getCard(0);
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Black Lotus
by Rob Cashwalker » 22 Jun 2009, 11:46
OK, sure that makes sense. I wasn't sure how to display a multi-choice that would easily translate to the single character needed for the Mana Pool.zerker2000 wrote:Huh? "<nn> more tries"??? Wouldn't it be easier to use the familiar old, i.e. replace above "type in letter of mana color" mess with
- Code: Select all
AllZone.Display.getChoice("Choose mana color",Constant.Color.Colors[]);
- Code: Select all
String Colorname = AllZone.Display.getChoice("Choose color",Constant.Color.Colors[]);
String color=Input_PayManaCostUtil.getColor(Colorname);
Probably. Though, I don't think so, because when AllZone is created, the card hasn't been created yet. But we could create a reference to it for all of CardFactory.Also, the many instances ofare getting annoying, I think we should put that in as a constant somewhere(e.g. "AllZone.Human_Play.Mana_Pool") instead of copying it for every card that uses it
- Code: Select all
CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards());
list = list.getName("Mana Pool");
Card mp = list.getCard(0);
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Black Lotus
by zerker2000 » 22 Jun 2009, 12:30
Hmm... shouldn't GameAction.mp work?
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Black Lotus
by Rob Cashwalker » 22 Jun 2009, 13:48
What's GameAction.mp?
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Black Lotus
by zerker2000 » 22 Jun 2009, 15:40
Ooh I think I just found the skullclamp bug: It's supposed to be skullclamp's controller, not from the card it's equipping... I see why it was done so though. Anyways, as I was saying, I think GameAction.Newgame makes the manapool, which means either the card ID created with it should be used, or we should make something along the lines of :
- Code: Select all
public class ManaPool extends Card
{
\\<"Manapool:" stuff>
intrinsicKeyword.add("Shroud")
intrinsicKeyword.add("Indestructible")
}
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Black Lotus
by DennisBergkamp » 22 Jun 2009, 16:51
Yes, I've actually changed it to the card's owner instead of its controller in my version (this seems to cover the cases of Control Magic etc.).Ooh I think I just found the skullclamp bug: It's supposed to be skullclamp's controller, not from the card it's equipping... I see why it was done so though. Anyways, as I was saying, I think GameAction.Newgame makes the manapool, which means either the card ID created with it should be used, or we should make something along the lines of :
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Black Lotus
by zerker2000 » 22 Jun 2009, 17:48
Not really: then I control magic something and clamp it, and compy gets the cards
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Black Lotus
by DennisBergkamp » 22 Jun 2009, 18:34
Yikes, you're right
I'll have to look at the code again to see if I can just have the controller of the Skullclamp get the cards.
I'll have to look at the code again to see if I can just have the controller of the Skullclamp get the cards.
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Black Lotus
by Rob Cashwalker » 22 Jun 2009, 18:38
hey guys.. stay on topic....
But it has to be "in play" under the players control in order for the Input_PayManaCostUtil to access it.and put a universal one in Constant.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Black Lotus
by zerker2000 » 22 Jun 2009, 23:46
SorryRob Cashwalker wrote:hey guys.. stay on topic...
Yes, so In GameAction.newGame have e.g.But it has to be "in play" under the players control in order for the Input_PayManaCostUtil to access it.and put a universal one in Constant.
- Code: Select all
AllZone.Human_Play.add(AllZone.manaPool);
- Code: Select all
Card mp = new Card();
mp.setName("Mana Pool");
//mp.addType("Land");
mp.addIntrinsicKeyword("Indestructible");
mp.addIntrinsicKeyword("Shroud");
AllZone.Human_Play.add(mp);
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Black Lotus
by Rob Cashwalker » 23 Jun 2009, 01:09
I guess it makes sense.... But I'd still say you should try it yourself first, and see if it works out.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Black Lotus
by mtgrares » 23 Jun 2009, 18:28
I think Black Lotus is everyone's favorite card. Thanks Rob.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
14 posts
• Page 1 of 1
Who is online
Users browsing this forum: flergeVes and 36 guests