Aven Riftwatcher

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
In CardFactory.java:
in GameActionUtil.java before upkeep_BlackVice();
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();
- 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);
}
}
}
}
- Code: Select all
aven_riftwatcher.jpg http://resources.wizards.com/Gatherer/Images/console/cardborder_e.jpg