It is currently 16 Apr 2021, 02:00
   
Text Size

Sensei's Divining Top

Moderators: timmermac, friarsol, Blacksmith, KrazyTheFox, Agetian, CCGHQ Admins

Sensei's Divining Top

Postby DennisBergkamp » 12 Oct 2008, 17:20

I made this card awhile ago... but since I've been busy with real life things lately, I haven't found much time to add that many new cards :(

So I figured, I might as well post this one for the people that know how to compile things!

In CardFactory.java:

Code: Select all
 //*************** START *********** START **************************
    if(cardName.equals("Sensei's Divining Top"))
    {
      //ability2: Draw card, and put divining top on top of library
      final SpellAbility ability2 = new Ability_Tap(card, "0")
      {
        public void resolve()
        {
          String player = card.getController();
          String owner = card.getOwner();
         
          PlayerZone play =  AllZone.getZone(Constant.Zone.Play, player);
          PlayerZone lib =  AllZone.getZone(Constant.Zone.Library, owner);
             
          AllZone.GameAction.drawCard(player);
          play.remove(card);
          lib.add(card,0); //move divining top to top of library
          card.untap();
     
        }

        public boolean canPlayAI()
        {
          return false;
        }

        public boolean canPlay()
        {
           if (AllZone.getZone(card).is(Constant.Zone.Play))
               return true;
            else
               return false;
        }//canPlay()
      };//SpellAbility ability2

      ability2.setBeforePayMana(new Input()
      {
        int check = -1;
         public void showMessage()
         {
             AllZone.Stack.push(ability2);
             stop();
         }//showMessage()
      });

     

      //ability (rearrange top 3 cards) :
      final SpellAbility ability1 = new Ability(card, "1")
      {
        public void resolve()
        {
           
           String player = card.getController();
           PlayerZone lib =  AllZone.getZone(Constant.Zone.Library, player);
           
           if (lib.size() < 3)
              return;
           
           CardList topThree = new CardList();
           
           //show top 3 cards:
           topThree.add(lib.get(0));
           topThree.add(lib.get(1));
           topThree.add(lib.get(2));
           
           Object o = AllZone.Display.getChoiceOptional("Put on top: ", topThree.toArray());
           if(o != null)
            {
              Card c1 = (Card)o;
              topThree.remove(c1);
              lib.remove(c1);
              lib.add(c1,0);
            }
             
           o = AllZone.Display.getChoiceOptional("Put second from top: ", topThree.toArray());
           if(o != null)
            {
              Card c2 = (Card)o;
              topThree.remove(c2);
              lib.remove(c2);
              lib.add(c2,1);
            }
           o = AllZone.Display.getChoiceOptional("Put third from top: ", topThree.toArray());
           if(o != null)
            {
              Card c3 = (Card)o;
              topThree.remove(c3);
              lib.remove(c3);
              lib.add(c3,2);
            }
           
        }
        public boolean canPlayAI()
        {
           return false;
         
        }
        public boolean canPlay()
        {
          if (AllZone.getZone(card).is(Constant.Zone.Play))
             return true;
          else
             return false;
        }//canPlay()
      };//SpellAbility ability1


      ability1.setDescription("1: Look at the top three cards of your library, then put them back in any order.");
      ability1.setStackDescription("Sensei's Divining Top - rearrange top 3 cards");
      card.addSpellAbility(ability1);
      ability1.setBeforePayMana(new Input_PayManaCost(ability1));

      ability2.setDescription("tap: Draw a card, then put Sensei's Divining Top on top of its owner's library.");
      ability2.setStackDescription("Sensei's Divining Top - draw a card, then put back on owner's library");
      ability2.setBeforePayMana(new Input_NoCost_TapAbility((Ability_Tap) ability2));
      card.addSpellAbility(ability2);
     

    }
    //*************** END ************ END **************************
In cards.txt:

Code: Select all
Sensei's Divining Top
1
Artifact
no text
I haven't added any AI code, since I don't think the AI will find much use for it. I haven't done much AI on cards, but it would be great to have the AI use this in conjunction with cards like Leaf-Crowned Elder, Dark Confidant, Wolf-Skull Shaman, etc. or maybe even more advanced: cards like Counterbalance.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Sensei's Divining Top

Postby Rob Cashwalker » 13 Oct 2008, 00:48

wow... that's amazing.

I recently just picked up my fourth Top, from a walmart promo re-pack... just in time for its banning.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times


Return to Forge

Who is online

Users browsing this forum: No registered users and 17 guests


Who is online

In total there are 17 users online :: 0 registered, 0 hidden and 17 guests (based on users active over the past 10 minutes)
Most users ever online was 1371 on 09 Feb 2020, 16:22

Users browsing this forum: No registered users and 17 guests

Login Form