It is currently 05 Sep 2025, 06:55
   
Text Size

Reflecting Pool Bugs

Post MTG Forge Related Programming Questions Here

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

Reflecting Pool Bugs

Postby 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
ReflectingPoolFix.zip
(1.54 KiB) Downloaded 180 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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Reflecting Pool Bugs

Postby 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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Reflecting Pool Bugs

Postby 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.
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

Postby 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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 33 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 33 users online :: 0 registered, 0 hidden and 33 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 33 guests

Login Form