Page 1 of 1

Aven Riftwatcher

PostPosted: 12 Oct 2008, 04:04
by jpb
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.

Re: Aven Riftwatcher

PostPosted: 12 Oct 2008, 05:13
by DennisBergkamp
Very nice! Good job :) I'm sure there's more cards with time counters, no ?

Re: Aven Riftwatcher

PostPosted: 12 Oct 2008, 09:43
by GandoTheBard
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.