zerker2000 wrote:Here's me again with my crazy parsing ideas: just how hard would it be to hava a generic SpellAbility cost parser that filtered things like mana, tap/tap(typeFilter), sacrifice/sacrifice(typeFilter), removeCounter(name), discard/discard(type), etc.? Then, it would probably be feasible to make a matching Input_PayCosts() that figured out canPlay, Inputed&placed sac/tap "flags" on relevant cards, ran a (slightly modified)Input_PayManaCost, and then when the cost was paid removed counters/executed flags(or on unpaid cleared flags and stop()-ed. Once again, this is mostly me thinking aloud about (what I see as) the optimal cost method.
You've got the right idea, but I'm not sure if it would work with the way the rest of the code is designed - might have to re-write a lot of it.
Yeah, why couldn't the mana cost system just look for "T" in a cost and know to tap the ability source card, or see "SAC" in a cost and know to sac the ability source card. I don't really know.... But the cancel button would have to also untap it (no prob) or unsac it.... Problem! Think about all the issues we have with persist and phantom card copies, and cards not remembering their abilities... not that those issues aren't fixable, and affect other aspects of play.... It's just another can of worms.
Rares programmed a number of samples for us, all we're trying to do is copy them en-Masse taking into account a few additional forms of the mechanic.
Now, I can see some value to making some helper function to filter out the "T" and "SAC", returning booleans directly instead of explicitly coding it for each keyword we come up with that can use those forms of payment. Supporting "SAC" and "SACAC" (Sac A Creature) would open up a few more cards for pumps and other keyworded abilities.
BTW, this is a related topic that I forgot why I started typing it, but it's not worth deleting. -
It sure seems like Input_PayManaCostUtil is where it parses the "tap: add _" and because of that, I was able to easily hack the "ManaPool:_" "keyword" because it had the same number of characters, not that I couldn't make it work with a different number of characters, just less needed to be changed to still make it work. I've considered that it could also look for "pain/tap:_" and it would be able to support the pain lands without explicitly naming them in the source code.