It is currently 26 Apr 2024, 14:21
   
Text Size

Updated Necropotence and Yawgmoth's Bargain

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

Updated Necropotence and Yawgmoth's Bargain

Postby mtgrares » 27 Oct 2008, 23:50

This is updated code for Necropotence and Yawgmoth's Bargain. When you use the ability your life points are subtracted and the ability is added to that stack.

Attached also is a new version of the class Gui_Deckeditor_Menu.java which lets users upload and download sealed and draft decks. Also when you export any deck, a text file is created that lists the contents of that deck.

Code: Select all
else if(cardName.equals("Yawgmoth's Bargain")){
      final SpellAbility ability = new Ability(card, "0")
      {
        public void resolve()
        {
          PlayerZone library = AllZone.getZone(Constant.Zone.Library, card.getController());
          PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
          if(library.size() != 0)
          {
            Card c = library.get(0);
            library.remove(0);
            hand.add(c);
          }
        }

        public boolean canPlayAI()
        {
          return false;
        }
      };//SpellAbility

      ability.setDescription("Pay 1 life: Draw a card.");
      ability.setStackDescription(card.getName() +" - Pay 1 life: Draw a card.");

      card.addSpellAbility(ability);

      //instead of paying mana, pay life and add to stack
      //Input showMessage() is always the first method called
      Input payLife = new Input()
      {
        public void showMessage()
        {
          AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(1);

          //this order is very important, do not change
          stop();
          AllZone.Stack.push(ability);
        }
      };//Input
      ability.setBeforePayMana(payLife);
    }//*************** END ************ END **************************


    //*************** START *********** START **************************
    else if(cardName.equals("Necropotence"))
    {
      final CardList necroCards = new CardList();

      final Command necro = new Command()
      {
        public void execute()
        {
          if(AllZone.GameAction.isCardInPlay(card))
          {
            //put cards removed by Necropotence into player's hand
            if(necroCards.size() > 0){
              PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());

              for(int i = 0;i<necroCards.size();i++){
                hand.add(necroCards.get(i));
              }
              necroCards.clear();
            }
          }
        }
      };

      final SpellAbility ability = new Ability(card, "0")
      {
        public void resolve()
        {
          PlayerZone library = AllZone.getZone(Constant.Zone.Library, card.getController());

          if(library.size() != 0)
          {
            Card c = library.get(0);
            library.remove(0);
            necroCards.add(c); //add card to necro so that it goes into hand at end of turn
            AllZone.EndOfTurn.addAt(necro);
          }
        }

        public boolean canPlayAI()
        {
          return false;
        }
      };//SpellAbility

      ability.setDescription("1 life: Set aside the top card of your library face down. At the end of your turn, put that card into your hand.");
      ability.setStackDescription(card.getName() +" - 1 life: Set aside the top card of your library face down. At the end of your turn, put that card into your hand.");

      card.addSpellAbility(ability);

      //instead of paying mana, pay life and add to stack
      //Input showMessage() is always the first method called
      Input payLife = new Input()
      {
        public void showMessage()
        {
          AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(1);

          //this order is very important, do not change
          stop();
          AllZone.Stack.push(ability);
        }
      };//Input
      ability.setBeforePayMana(payLife);

    }//*************** END ************ END **************************
Attachments
Gui_DeckEditor_Menu.zip
(5.78 KiB) Downloaded 306 times
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: Updated Necropotence and Yawgmoth's Bargain

Postby GandoTheBard » 28 Oct 2008, 02:11

Now we just need someone to compile and upload that :)
visit my personal homepage here: http://outofthebrokensky.com

Listen to my podcast with famed AJ_Impy "Freed from the Real" on http://puremtgo.com
User avatar
GandoTheBard
Tester
 
Posts: 1043
Joined: 06 Sep 2008, 18:43
Has thanked: 0 time
Been thanked: 0 time

Re: Updated Necropotence and Yawgmoth's Bargain

Postby jpb » 28 Oct 2008, 17:41

Whenever anyone compiles the new version, remember to include the fix for laying a land when Necropotence or Yawgmoth's Bargain are in play.
jpb
 
Posts: 132
Joined: 05 Sep 2008, 13:12
Has thanked: 0 time
Been thanked: 0 time


Return to Forge

Who is online

Users browsing this forum: No registered users and 162 guests


Who is online

In total there are 162 users online :: 0 registered, 0 hidden and 162 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 162 guests

Login Form