It is currently 19 Apr 2024, 16:07
   
Text Size

Aven Riftwatcher

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

Aven Riftwatcher

Postby jpb » 12 Oct 2008, 04:04

As requested by Gando. This card required time counters so a change to Card.java and to GameActionUtil.java was required. I tested quickly one scenario as a human controlling Aven Riftwatcher and two scenarios as the computer controlling Aven Riftwatcher. Both worked fine.

In Card.java

Code: Select all
  private int timeCounter;
 
  public int getTimeCounter() {
   return timeCounter;
  }
  public void setTimeCounter(int timeCounter) {
   this.timeCounter = timeCounter;
  }


In CardFactory.java:
Code: Select all
    //*************** START *********** START **************************
    if(cardName.equals("Aven Riftwatcher"))
    {
       Command gain2Life = new Command()
         {
           public boolean firstTime = true;
            public void execute()
            {
              PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController());
              life.addLife(2);
             
              //testAndSet - only needed when comes into play.
              if(firstTime){
                 card.setTimeCounter(3); //vanishing 3
              }
              firstTime = false;
            }
          };
         
      card.setDestroy(gain2Life);
      card.setComesIntoPlay(gain2Life);
     
    }//*************** END ************ END **************************

in GameActionUtil.java before upkeep_BlackVice();

Code: Select all
upkeep_Aven_Riftwatcher();
Then in GameActionUtil.java before private static void upkeep_Defense_of_the_Heart()

Code: Select all
 private static void upkeep_Aven_Riftwatcher()
  {
     //get all Aven Riftwatcher in play under the control of this player
     final String player = AllZone.Phase.getActivePlayer();
     PlayerZone playZone =  AllZone.getZone(Constant.Zone.Play, player);
     CardList list = new CardList(playZone.getCards());
     list = list.getName("Aven Riftwatcher");
     if(list.size() > 0){
       for(int i=0;i<list.size();i++){
          Card card = list.get(i);
          card.setTimeCounter(card.getTimeCounter()-1);
          if(card.getTimeCounter() <= 0){
            AllZone.GameAction.sacrifice(card);
          }
       }       
     }
    
  }
In card-pictures.txt
Code: Select all
aven_riftwatcher.jpg http://resources.wizards.com/Gatherer/Images/console/cardborder_e.jpg
This card is a common.
jpb
 
Posts: 132
Joined: 05 Sep 2008, 13:12
Has thanked: 0 time
Been thanked: 0 time

Re: Aven Riftwatcher

Postby DennisBergkamp » 12 Oct 2008, 05:13

Very nice! Good job :) I'm sure there's more cards with time counters, no ?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Aven Riftwatcher

Postby GandoTheBard » 12 Oct 2008, 09:43

Aye nice job ! :D There are numerous cards with time counters on them. Blastoderm is not the least of which though I think those are called something else...same idea.
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


Return to Forge

Who is online

Users browsing this forum: Google [Bot] and 106 guests


Who is online

In total there are 107 users online :: 1 registered, 0 hidden and 106 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: Google [Bot] and 106 guests

Login Form