Aven Riftwatcher
by mtgrares
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Aven Riftwatcher
by 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
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
- jpb
- Posts: 132
- Joined: 05 Sep 2008, 13:12
- Has thanked: 0 time
- Been thanked: 0 time
Re: Aven Riftwatcher
by DennisBergkamp » 12 Oct 2008, 05:13
Very nice! Good job I'm sure there's more cards with time counters, no ?
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Aven Riftwatcher
by GandoTheBard » 12 Oct 2008, 09:43
Aye nice job ! 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
Listen to my podcast with famed AJ_Impy "Freed from the Real" on http://puremtgo.com
-
GandoTheBard - Tester
- Posts: 1043
- Joined: 06 Sep 2008, 18:43
- Has thanked: 0 time
- Been thanked: 0 time
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 106 guests