Page 1 of 1

Reflecting Pool Bugs

PostPosted: 07 Jul 2010, 17:10
by friarsol
So I added the Vivid lands and Gemstone Mine recently, and one of the first things I noticed was that they didn't work with Reflecting Pool. So I started searching for where Reflecting Pool got it's info from. It seems it's trying to parse a keyword, and since the Gemstone Mine keyword is basically "any color" and a dialog box, the Pool can't parse the keyword and defaults to 1. I'm guessing this is because it knows there is a mana ability, but can't find any color.

I've resolved this with adding a new string called reflectableMana that can be manually set to what mana the land might generate. I'm going to upload the patch
ReflectingPoolFix.zip
(1.54 KiB) Downloaded 185 times
so you guys can check it out before I commit. I use TortoiseSVN, but the Patch should open in a text editor if you use something else.

The special sauce is in the getManaFromCardList function in Ability_Reflected_Mana.
where I replaced
Code: Select all
String newMana = am.mana(); // This call would break for a reflected mana ability
Code: Select all
String newMana = otherCard.getReflectableMana();
if (newMana == "")
  newMana = am.mana(); // This call would break for a reflected mana ability
Since am.mana() was returning 1 for Gemstone Mine, now it'll return the manually set reflectableMana (which is "WUBRG") and if it's not manually set, will just grab the default as before.

This should allow us to code up River of Tears and Gemstone Caverns to work properly with Reflecting Pool by toggling their ReflectableMana type as appropriate. Along with any other lands that currently do not Reflect properly.

Re: Reflecting Pool Bugs

PostPosted: 07 Jul 2010, 19:31
by Sloth
Great work friarisol!

I use this opportunity to ask if you can make the keyword abAddReflectedMana usable on non-land permanents like Fellwar Stone (I'm not so much into the code, but maybe it's enough to just move the ability from CardFactory_Lands.java to CardFactory.java).

And a card that is really similar to the vivid lands and easy to add is Tendo Ice Bridge.

Keep up the good contributions.

Re: Reflecting Pool Bugs

PostPosted: 18 Jul 2010, 01:49
by jim
friarisol,

The diagnosis and the solution both sound plausible. Nice work, and thanks for fixing up my omissions. :-)
And I agree it should be really easy to make Fellwar Stone work -- like Sloth says, moving the ability to CardFactory.java ought to be enough. There are a couple of creatures with similar abilities that could be added too.

Re: Reflecting Pool Bugs

PostPosted: 18 Jul 2010, 03:23
by friarsol
I got busy doing other stuff. But when I get finished with the different things I was trying to get done, I'll come back and put the rest of this stuff in.

Edit: Not sure if you two will see this. But I just checked in changes, moving the keyword over into the main factory, and adding Tendo Ice Bridge, Fellwar Stone, and the three creatures that could use the keyword.