Page 1 of 1

Black Lotus

PostPosted: 22 Jun 2009, 04:25
by Rob Cashwalker
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);
    }

Re: Black Lotus

PostPosted: 22 Jun 2009, 05:32
by DennisBergkamp
Sweet, now all we have to do is add Timewalk :mrgreen:

Re: Black Lotus

PostPosted: 22 Jun 2009, 10:56
by zerker2000
Rob 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;
                    }
Huh? "<nn> more tries"??? Wouldn't it be easier to use the familiar old
Code: Select all
AllZone.Display.getChoice("Choose mana color",Constant.Color.Colors[]);
, i.e. replace above "type in letter of mana color" mess with
Code: Select all
               String Colorname =  AllZone.Display.getChoice("Choose color",Constant.Color.Colors[]);
               String color=Input_PayManaCostUtil.getColor(Colorname);
Also, the many instances of
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);
are 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 :P

Re: Black Lotus

PostPosted: 22 Jun 2009, 11:46
by Rob Cashwalker
zerker2000 wrote:Huh? "<nn> more tries"??? Wouldn't it be easier to use the familiar old
Code: Select all
AllZone.Display.getChoice("Choose mana color",Constant.Color.Colors[]);
, i.e. replace above "type in letter of mana color" mess with
Code: Select all
               String Colorname =  AllZone.Display.getChoice("Choose color",Constant.Color.Colors[]);
               String color=Input_PayManaCostUtil.getColor(Colorname);
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.
Also, the many instances of
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);
are 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 :P
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.

Re: Black Lotus

PostPosted: 22 Jun 2009, 12:30
by zerker2000
Hmm... shouldn't GameAction.mp work?

Re: Black Lotus

PostPosted: 22 Jun 2009, 13:48
by Rob Cashwalker
What's GameAction.mp?

Re: Black Lotus

PostPosted: 22 Jun 2009, 15:40
by zerker2000
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")
}
and put a universal one in Constant.

Re: Black Lotus

PostPosted: 22 Jun 2009, 16:51
by DennisBergkamp
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 :
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.).

Re: Black Lotus

PostPosted: 22 Jun 2009, 17:48
by zerker2000
Not really: then I control magic something and clamp it, and compy gets the cards :(

Re: Black Lotus

PostPosted: 22 Jun 2009, 18:34
by DennisBergkamp
Yikes, you're right :lol:

I'll have to look at the code again to see if I can just have the controller of the Skullclamp get the cards.

Re: Black Lotus

PostPosted: 22 Jun 2009, 18:38
by Rob Cashwalker
hey guys.. stay on topic....

and put a universal one in Constant.
But it has to be "in play" under the players control in order for the Input_PayManaCostUtil to access it.

Re: Black Lotus

PostPosted: 22 Jun 2009, 23:46
by zerker2000
Rob Cashwalker wrote:hey guys.. stay on topic...
Sorry :oops:
and put a universal one in Constant.
But it has to be "in play" under the players control in order for the Input_PayManaCostUtil to access it.
Yes, so In GameAction.newGame have e.g.
Code: Select all
AllZone.Human_Play.add(AllZone.manaPool);
instead of
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);

Re: Black Lotus

PostPosted: 23 Jun 2009, 01:09
by Rob Cashwalker
I guess it makes sense.... But I'd still say you should try it yourself first, and see if it works out.

Re: Black Lotus

PostPosted: 23 Jun 2009, 18:28
by mtgrares
I think Black Lotus is everyone's favorite card. Thanks Rob.