Page 1 of 1

[fixed/closed]Fellwar Stone & Tree of Tales

PostPosted: 29 Jul 2013, 10:18
by HarlequinCasts
Describe the Bug:
Fellwar Stone does not appear to interact correctly with Tree of Tales

Specifically with all five of them in play, Fellwar Stone produces all colors except for green, colorless, and also a second colorless (artifact colorless?). When isolated, Tree of Tales is giving it two colorless mana types instead of green.

Possibly related to Korath's manastripe post?

Which card did behave improperly ?
Tree of Tales or Fellwar Stone

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
Odyssey v2

What exactly should be the correct behavior/interaction ?
Fellwar Stone

Are any other cards possibly affected by this bug ?

Re: Fellwar Stone & Tree of Tales

PostPosted: 29 Jul 2013, 10:46
by Korath
The second stripe is artifact mana, yes; compare its position to the stripe on a Mishra's Workshop and on a normal colorless-producing land.

Fellwar Stone's still hardcoded. There's some weirdness going on in its EVENT_ACTIVATE handler that I don't quite follow (maybe so it auto-picks the right color mana to generate?), but the way it gets its mana stripes is fairly straightforward: there's a cache at dword_60A568 of the mana types player0's lands can generate, and one at dword_60A569 of those player1's can. (Specifically, they're each a bitwise or of the card_instance_t::card_color of all of the player's lands in play.) The appropriate cache is copied into the fellwar's card_instance_t::mana_color in response to an EVENT_VARIABLE_MANA_SRC, and that's fed into a call to choose_a_color_exe() during activation.

Re: Fellwar Stone & Tree of Tales

PostPosted: 29 Jul 2013, 12:45
by Gargaroz
Well, I did a new code, and now follows the standard protocol like Reflecting Pool, or the more similar Sylvok Explorer.

Re: [fixed by Gargaroz]Fellwar Stone & Tree of Tales

PostPosted: 29 Jul 2013, 17:06
by Aswan jaguar
Ancient Den and Tree of Tales if they are on your opponents battlefield are causing Fellwar Stone to cease working,you tap it,it taps but no menu appears and no mana is produced.
1- Ancient Den adds to Fellwar Stone 3 Mana Stripes!(colourless,BLACK!!!,Artifact) and probably that indicates the bug (the csv values are fine though)
2- Tree of Tales adds 2 Mana stripes to Fellwar Stone (Colourless and Artifact).
Could it be that they occupy hardcoded slots in the exe?
All Artifact lands call the code of Basic Lands.

Re: [fixed by Gargaroz]Fellwar Stone & Tree of Tales

PostPosted: 29 Jul 2013, 17:41
by Korath
All six of these cards have their mana_colors hardcoded to their ids in get_abilities().

The artifact lands, predictably enough, are Vault of Whispers to black, Seat of the Synod to blue, Tree of Tales to green, Great Furnace to red, and Ancient Den to white. (This is why they have the correct mana stripe when they're in play, but - except for Tree of Tales - only colorless while in hand, I assume because the cards are marked colorless in one of the csvs.) What's interesting is what comes after - for cards that fall through to get_color_of_mana_produced_by_id(), cards originally coded in the exe, cards correctly injected into get_abilities(), and cards that use the default of card_data_t::color, their card_instance_t::card_color is then set to mana_color. Tree of Tales and Ancient Den get their ids assigned there instead, which happen to match up to the colorless/artifact and colorless/black/artifact bits.

The good news is that their hardcoding comes after the call to get_color_of_mana_produced_by_id() in C. If the two broken ones get handled in there, their card_color should be set correctly; the checks for their specific ids will never be reached.

Fellwar Stone, on the other hand, assumes that card_instance_t::mana_color has already been set outside of get_abilities(), and it's checked for before the call to get_color_of_mana_produced_by_id(). If you're relying on that to set its colors, it'll never get there.

Re: [fixed by Gargaroz]Fellwar Stone & Tree of Tales

PostPosted: 30 Jul 2013, 00:07
by Gargaroz
Well, "get_color_of_mana_producer" looks at "cards_data[].card_color", so it'll get the right color, if it's properly set in "ct_all".

Re: [fixed by Gargaroz]Fellwar Stone & Tree of Tales

PostPosted: 30 Jul 2013, 01:11
by Korath
I can't find a function by that name, nor anything similar (other than get_color_of_mana_produced_by_id(), which returns -1 for ids it doesn't recognize). Point me at it?

It's true that get_abilities() will fall back to card_color for ids it doesn't have a special case for, but it does special-case Ancient Den and Tree of Tales, and special-cases them wrongly.

Re: [fixed by Gargaroz]Fellwar Stone & Tree of Tales

PostPosted: 30 Jul 2013, 02:12
by HarlequinCasts
Aswan jaguar wrote:Ancient Den and Tree of Tales if they are on your opponents battlefield are causing Fellwar Stone to cease working,you tap it,it taps but no menu appears and no mana is produced.
Yes! I forgot this was the exact situation that caused me to start testing. Ancient Den and Tree of Tales causing Fellwar Stone to stop working even with other basic lands in play.

Re: [fixed by Gargaroz]Fellwar Stone & Tree of Tales

PostPosted: 30 Jul 2013, 13:14
by Gargaroz
Korath, I meant "get_color_of_mana_produced_by_id()". And it's directly accessing to "card_data" when dealing with Reflecting Pool, Fellwar Stone (now) and Sylvok Explorer, so there shouldn't be problem, right ?

Re: [fixed by Gargaroz]Fellwar Stone & Tree of Tales

PostPosted: 30 Jul 2013, 18:28
by Korath
Fellwar Stone still looks like it won't ever call that function due to its special casing in get_abilities(), but I could be wrong.

Ancient Den and Tree of Tales both definitely need to be handled by get_color_of_mana_produced_by_id(), though - other things look at their card_instance_t::card_color, too. (The hardcoded version of Mana Flare, for example, though I'll probably change it.) And if they're both fixed, then original problem with the hardcoded Fellwar Stone will be, too.

Re: [fixed by Gargaroz]Fellwar Stone & Tree of Tales

PostPosted: 03 Aug 2013, 13:26
by Aswan jaguar
@Gargaroz have you seen this last post by Korath that says that if Ancient Den and Tree of Tales get fixed (he says how) Fellwar Stone is going to work fine and won't need new code,besides the real problem-bug was the 2 lands not the hardcoded Fellwar Stone.

Re: [new info?]Fellwar Stone & Tree of Tales

PostPosted: 04 Aug 2013, 15:12
by Gargaroz
Well, I prefer to have it recoded, we could better handle the "special cases" (like "filter lands").