Reflecting Pool Bugs
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
4 posts
• Page 1 of 1
Reflecting Pool Bugs
by friarsol » 07 Jul 2010, 17:10
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
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
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.
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 180 times
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
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.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Reflecting Pool Bugs
by Sloth » 07 Jul 2010, 19:31
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.
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.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Reflecting Pool Bugs
by jim » 18 Jul 2010, 01:49
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.
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.
- jim
- Posts: 46
- Joined: 19 Feb 2010, 01:46
- Location: Sunny New England
- Has thanked: 0 time
- Been thanked: 0 time
Re: Reflecting Pool Bugs
by friarsol » 18 Jul 2010, 03:23
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.
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.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 36 guests