It is currently 23 Apr 2024, 19:34
   
Text Size

New Borderpost cards

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

New Borderpost cards

Postby mtgrares » 20 Apr 2009, 19:41

This is code for the cycle of 5 "borderpost" artifacts previewed for the upcoming set Alara Reborn. The cards have the alternate cost "you may pay 1 and return a basic land you control to its owner's hand" but I programmed it as "bounce an untapped, basic land" because adding alternate costed cards is hard enough. I don't think I functional changed the card but opinions will vary.

Through many hours of work the computer CAN use these cards. When the computer uses these cards the land is bounced after the ability resolves, which is different than when you use it (the land is bounced as part of the cost). Since the land is bounced after the ability resolves, you can actually see the land before it is bounced, otherwise you just see the borderpost ability on the stack and it is a little confusing since the computer plays so fast.

(Who knew that programming commons could be this hard, lol.)

I'm not sure where what URL to put in card-pictures.txt because they aren't on Gatherer yet, you can see the pictures here - http://wizards.com/magic/tcg/article.as ... rn/spoiler. I'll let someone else crop (remove the black border) and resize them.

Marisi's Twinclaws and Ethercaste Knight from Alara Reborn can also be added.

p.s.
If you put the artifacts in WUBRG order the card names cycle: Fieldmist, Mistvein, Veinfire, Firewild, Wildfire.

Ethercaste Knight
W U
Artifact Creature Human Knight
no text
1/3
Exalted

Marisi's Twinclaws
2 RW G
Creature Cat Warrior
no text
2/5
Double Strike

Wildfire Borderpost
1 G W
Artifact
no text
Comes into play tapped.
tap: add G
tap: add W
NOTE: This ability is slightly different from the printed card text.

Firewild Borderpost
1 R G
Artifact
no text
Comes into play tapped.
tap: add R
tap: add G
NOTE: This ability is slightly different from the printed card text.

Veinfire Borderpost
1 B R
Artifact
no text
Comes into play tapped.
tap: add B
tap: add R
NOTE: This ability is slightly different from the printed card text.

Mistvein Borderpost
1 U B
Artifact
no text
Comes into play tapped.
tap: add U
tap: add B
NOTE: This ability is slightly different from the printed card text.

Fieldmist Borderpost
1 W U
Artifact
no text
Comes into play tapped.
tap: add W
tap: add U
NOTE: This ability is slightly different from the printed card text.

Code: Select all
//*************** START *********** START **************************
if(
cardName.equals("Fieldmist Borderpost") ||
cardName.equals("Mistvein Borderpost") ||
cardName.equals("Veinfire Borderpost") ||
cardName.equals("Firewild Borderpost") ||
cardName.equals("Wildfire Borderpost")
)//if
{
final SpellAbility spell = new Spell(card)
{
 CardList getBasicLands(String player)
 {
   PlayerZone zone = AllZone.getZone(Constant.Zone.Play, player);
   CardList list = new CardList(zone.getCards());

   list = list.filter(new CardListFilter()
   {
     public boolean addCard(Card c)
     {
       return c.isBasicLand() && c.isUntapped();
     }
   });
   return list;
 }//getBasicLands()

 public boolean canPlay()
 {
   //does the player have any basic lands?
   String s = getSourceCard().getController();
   return super.canPlay() && 0 < getBasicLands(s).size();
   //super.canPlay() calls Spell.canPlay() which checks for obvious stuff
 }

 public void resolve()
 {
   String player = getSourceCard().getController();

   //put card into play
   PlayerZone play = AllZone.getZone(Constant.Zone.Play, player);
   play.add(card);

   if(player.equals(Constant.Player.Computer))
   {
     //computer returns basic land to its hand
     //should be done before the ability is put on the stack
     //but I just couldn't figure it out
     AllZone.Computer_Hand.remove(card);

     CardList basic = getBasicLands(Constant.Player.Computer);

     if(basic.isEmpty())
       throw new RuntimeException("CardFactory() : getCard() error, " +getSourceCard().getName() +" - computer doesn't have any basic land");

     //shuffle so the computer doesn't always bounce the first basic land
     basic.shuffle();

     Card c = basic.get(0);
     AllZone.Computer_Play.remove(c);

     //reset card attributes by creating a new card, rare but might happen
     AllZone.Computer_Hand.add(AllZone.CardFactory.copyCard(c));
   }//if - computer player

 }//resolve()
};//SpellAbility - spell

final Input chooseBasicLand = new Input()
{
 public void showMessage()
 {
   AllZone.Display.showMessage("Select an untapped, basic land to return to your hand.");
   ButtonUtil.enableOnlyCancel();
 }
 public void selectButtonCancel() {stop();}
 public void selectCard(Card card, PlayerZone zone)
 {
   if(zone.is(Constant.Zone.Play, Constant.Player.Human) &&
      card.getType().contains("Basic") &&
      card.isUntapped())
   {
     spell.setTargetCard(card);
     done();
   }
 }//selectCard()
 void done()
 {
   AllZone.Human_Hand.remove(card);

   //return land to player's hand
   Card land = spell.getTargetCard();
   AllZone.Human_Play.remove(land);

   //reset card attributes by creating a new card, rare but might happen
   AllZone.Human_Hand.add(AllZone.CardFactory.copyCard(land));

   AllZone.Stack.add(spell);
   stop();
 }//done()

 //this is one of "pay options" that the user sees when he clicks on the card
 //see artifact.setDescription() below for the other
 public String toString()
 {
   return "Alternate Cost: bounce an untapped, basic land";
 }
};//SpellAbility - spell

SpellAbility artifact = new Spell_Permanent(card);
//this is one of "pay options" that the user sees when he clicks on the card
artifact.setDescription("Mana Cost: " +card.getManaCost());

spell.setManaCost("0");
spell.setDescription("Alternate Cost: bounce an untapped, basic land");
spell.setStackDescription(card.getName());
spell.setBeforePayMana(chooseBasicLand);

card.clearSpellAbility();
card.addSpellAbility(artifact);
card.addSpellAbility(spell);
}//*************** END ************ END **************************
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: New Borderpost cards

Postby Rob Cashwalker » 20 Apr 2009, 19:53

If it weren't for the lack of a mana pool, this looks like it could help make the Ravnica bounce lands work as well.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: New Borderpost cards

Postby DennisBergkamp » 20 Apr 2009, 20:53

Very cool!
I didn't know they were coming out with another expansion this quickly... I'll look through them and see how many of them are codable :D
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: New Borderpost cards

Postby mtgrares » 20 Apr 2009, 21:50

The Ravnica bounce lands don't work because the code presumes that you will only add one color of mana at a time. MTG Forge currently doesn't parse "tap: add RB" or "tap: add 2". I wasn't thinking about cards that produce more than one mana when I was coding.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: New Borderpost cards

Postby mtgrares » 20 Apr 2009, 21:57

These borderpost cards are very similar to dual tap lands that come into play tapped and produce 2 kinds of mana but since the borderposts cost 1, they are actually worse than the tap lands. They are new and people like new cards, especially me :+)
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: New Borderpost cards

Postby Mr.Chaos » 21 Apr 2009, 11:02

The cards state that you may pay 1 and return a basic land card to your hand, there is no mention at all about that land being an untapped land.
So: the card can be played on turn one, where as in MTG Forge, it can be played no sooner than turn two. (unless you have played both a land and a mox on your first turn)

Why did you alter the card that way?
If you cannot code a card properly, do not include it!
Sorry to sound harsh, but adding the card this way is just wrong in my opinion.
It is bad enough we have trouble getting some cards to work as they should without deliberately messing them up.
](*,) = coder at work, according to a coder.It does explain some of the bugs. :wink:
Mr.Chaos
Tester
 
Posts: 625
Joined: 06 Sep 2008, 08:15
Has thanked: 0 time
Been thanked: 0 time

Re: New Borderpost cards

Postby GandoTheBard » 21 Apr 2009, 12:30

Mr.Chaos wrote:The cards state that you may pay 1 and return a basic land card to your hand, there is no mention at all about that land being an untapped land.
So: the card can be played on turn one, where as in MTG Forge, it can be played no sooner than turn two. (unless you have played both a land and a mox on your first turn)

Why did you alter the card that way?
If you cannot code a card properly, do not include it!
Sorry to sound harsh, but adding the card this way is just wrong in my opinion.
It is bad enough we have trouble getting some cards to work as they should without deliberately messing them up.
I am of a similar opinion concerning adding new cards. Why half step? If you can't get it right, then perhaps it doesn't belong. Ironically to me the impulse to wreck mechanics/cards strikes me as very chaotic. (Ironic because Mr Chaos is opposed to it. :P)
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: New Borderpost cards

Postby Rob Cashwalker » 21 Apr 2009, 15:02

The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: New Borderpost cards

Postby jpb2 » 21 Apr 2009, 17:01

In mtg forge there is no mana pool, so in order to pay 1 colorless mana you need to have an untapped land. mtgrares may not have spelled it out, but without a mana pool what he is doing is equivalent to what the card says.

I would rather have cards half way added than not added at all. It makes it a lot easier for people to later add functionality to complete the cards. This is the whole idea of a programming project with multiple team members. Any functionality we add will originally be a rough draft. When I fixed the slow down issues there were many problems, but after a few iterations these were ironed out and you can now play many games in a row without a restart (very nice with quest mode). The same is true for cards; we have fixed many cards which were originally partially implemented or implemented incorrectly. Hopefully these cards are now complete. Having things half baked is a sacrifice we need to make in the short term in order to make progress in the longer term.

If someone doesn't want cards with limited functionality included in mtg forge they can always remove them and post a non-beta version to this forum. I am sure there is more than one person who doesn't like broken cards and would download it. Keep in mind that it will most likely be up to you to keep this version up to date; and that is a lot of work!
jpb2
 
Posts: 11
Joined: 21 Apr 2009, 16:36
Has thanked: 0 time
Been thanked: 0 time

Re: New Borderpost cards

Postby jpb2 » 21 Apr 2009, 18:04

mtgrares wrote:These borderpost cards are very similar to dual tap lands that come into play tapped and produce 2 kinds of mana but since the borderposts cost 1, they are actually worse than the tap lands. They are new and people like new cards, especially me :+)
I can see some good uses for these, but nothing really great sticks out yet.

1) They are artifacts. This fact can almost always be abused.
2) They are not lands, so do not count towards your one land per turn. This causes some combos with lands that produce more than one mana, like City of Traitors or Saprazzan Skerry.
3) They can be really helpful in avoiding land destruction. Imagine you play one of these and then Armageddon. Now you have at least 1 land in your hand and one mana producing artifact on the board. Big advantage. You could easily have 3 mana available next turn, where as it might take the other player 3 turns to even get one mana.
5) I don't see why land tax decks wouldn't include these.
6) Might work nicely with convoke. This could allow some mana acceleration in colors which normally do not have it.

So a few ok combos, but nothing out of this block. Of course I don't know new cards very well, maybe there is something there.
jpb2
 
Posts: 11
Joined: 21 Apr 2009, 16:36
Has thanked: 0 time
Been thanked: 0 time

Re: New Borderpost cards

Postby GandoTheBard » 22 Apr 2009, 03:05

jpb2 wrote:In mtg forge there is no mana pool, so in order to pay 1 colorless mana you need to have an untapped land. mtgrares may not have spelled it out, but without a mana pool what he is doing is equivalent to what the card says.

I would rather have cards half way added than not added at all. It makes it a lot easier for people to later add functionality to complete the cards. This is the whole idea of a programming project with multiple team members. Any functionality we add will originally be a rough draft. When I fixed the slow down issues there were many problems, but after a few iterations these were ironed out and you can now play many games in a row without a restart (very nice with quest mode). The same is true for cards; we have fixed many cards which were originally partially implemented or implemented incorrectly. Hopefully these cards are now complete. Having things half baked is a sacrifice we need to make in the short term in order to make progress in the longer term.

If someone doesn't want cards with limited functionality included in mtg forge they can always remove them and post a non-beta version to this forum. I am sure there is more than one person who doesn't like broken cards and would download it. Keep in mind that it will most likely be up to you to keep this version up to date; and that is a lot of work!
Id agree if we were addressing the halfbaked solutions but instead we include decks with the half baked cards and then have to test the changes in the various modes with these cards. It is irritating to realize that it is all for nothing in the long run. What would be ideal I guess would be that we do have two releases. One a stable version and one an experimental version. However doing it in a way that incorporates true fixes could be nightmarishly hard to keep coordinated.

As far as the many games in a row thing goes...well Im guessing this has something to do with how good your computer is. My current one still lags tremendously after 4-5 games depending on the decks played. Sometimes the AI lags after the very first game. So that bug is NOT fixed yet. Though I do appreciate your efforts in that regard.

Anyway every gets to blow off steam when annoyed...I get annoyed I blow off steam then you get annoyed at my annoyance and blow off steam. All is well :D
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: New Borderpost cards

Postby Mr.Chaos » 22 Apr 2009, 05:44

jpb2 wrote:In mtg forge there is no mana pool, so in order to pay 1 colorless mana you need to have an untapped land. mtgrares may not have spelled it out, but without a mana pool what he is doing is equivalent to what the card says.
Ok, I am no programmer so maybe this is too complex for me to understand.
But compared to other cards with "come into play" effects, this is how I see it work:
You click the card, signalling you play it. You then select the method of come into play (pay 1, bounce basic land), then click the basic land to pay 1 and then select the same land to bounce to your hand.

I still do not see why you need an untapped land to make this work.
It is one thing to give us a card with limited functinallity due to coding issues but in this particular case you actually alter the way the card is played just to squeeze it in here. THAT is what upsets me.

Adding cards and saying "this or that part is not implemented yet" is a whole different matter and can be added/fixed later. I have no problem with that at all. After all, this is a "learn as we progress" project.
](*,) = coder at work, according to a coder.It does explain some of the bugs. :wink:
Mr.Chaos
Tester
 
Posts: 625
Joined: 06 Sep 2008, 08:15
Has thanked: 0 time
Been thanked: 0 time

Re: New Borderpost cards

Postby GandoTheBard » 22 Apr 2009, 05:56

Similar to giving Valor Vigilance because First Strike was too hard to code at the time. I agree 100% Mr Chaos. This is like making your own cards. I like the idea of creative making of new cards that AREN"T WotC products. They certainly do not have the monopoly on good ideas. However I don't like to see cards represented here as the real thing when they aren't. Valor being the most obvious example. Tortuga is an overpowered yet fun card. It should probably have some balancing comes into play effect but it is an MTGRares original. As is Klaas, Elf Friend. We could have a whole set made up of fantasy cards. I have half a set (mainly missing art at the moment) Id love to see implemented.
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: New Borderpost cards

Postby Arcanis222 » 28 May 2009, 22:02

Maybe we could start a thread devoted to user made cards?
Arcanis222
 
Posts: 61
Joined: 26 May 2009, 20:48
Has thanked: 0 time
Been thanked: 0 time

Re: New Borderpost cards

Postby zerker2000 » 30 May 2009, 00:50

jpb2 wrote:If someone doesn't want cards with limited functionality included in mtg forge they can always remove them and post a non-beta version to this forum. I am sure there is more than one person who doesn't like broken cards and would download it. Keep in mind that it will most likely be up to you to keep this version up to date; and that is a lot of work!
Ah, at some point I asked about why there wasn't an up-to-date official version of forge anywhere, so thank you for the clarification :P
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time


Return to Forge

Who is online

Users browsing this forum: No registered users and 99 guests


Who is online

In total there are 99 users online :: 0 registered, 0 hidden and 99 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 99 guests

Login Form