Rob Cashwalker wrote:I was looking at this much of Saturday.
I think the main reason is because there are certain parts of the card code which get created during initialization, including the PayManaCost stuff. I don't think you can change the mana cost of a card or ability in the middle of casting or playing it. It may be hackable if part of the spell ability resolve method directly interacts with some sort of Input_PayManaCost function, but it's just a guess. For example,
Fireball - you pay the R to cast it. Then it asks you for a number. Then it dynamically creates a manaCost to be paid, which you can then use the usual mana sources for. (pool or cards with "tap: add _")
Erm no,(according to the rules) first you chose targets/{
X} costs/modes/whether you're paying for kickers/buyback/etc., then you determine the total cast cost, and then you pay that cost.
So for Forge, that would mean scan the card for keywords that mean "<Cost>,Discard this Card:..."(e.g.cycling), and show a popup window with the options listed; then(assuming the player didn't select one of them, which is the kind of thing I'll leave out from now on) it should give you an apropriate selection popup if the ability has "choose <n>"(and a checkbox for splice if applicable),a dropdown for choosing creature/card types or colors,a checkbox area if the spell is arcane and there's at least one card with splice in hand, a number input line if the spell has an

in its cost that isn't defined by the text(or "choose a number" in its textbox), more checkboxes for kickers and buyback, a menu to select alternative costs, a big complicated interface for convoke where you select creatures and which of their colors they reduce the cost by, and finally "toggle switches" for hybrid mana symbols(about which I did not know until I read that part of the rules today, and which can probably be implemented for e.g. reaper king).
Then forge should look through all the abilities being played and find any targets that need to be selected, show the ones that only have one possible choice, and let the player choose the rest.
Then the total casting cost is determined(which means technically you could have a card that says "Spells and abilities targeting <Card Name> cost 1 less to play"

), by taking the printed/alternative base cost, adding any

's or additional costs, and subtracting the cost-reduction effects. If a cost would be less than zero(e.g. having to pay -3BG or sacrifice -2 creatures), it is set to zero instead. That cost then becomes locked in, and we go on to actually paying it:
First we get to play mana abilities, just like before we started to play the spell. Then we have an interface from which you select permanents to tap/untap and sacrifice(with the number and type left on top in big bold letters, and of course the only creatures even in this window are ones of the right type), cards to discard/remove from game(in your graveyard), and any other costs. Then the spell resolves, and we get to try to make forge figure out what happens if there are any effects triggered by this.
Now that we have painstakingly gotten through the full formal format of playing a spell, there is somthing that I noticed:
a) Though this sounds insanely complicated,(to me) it feels like it would be much easier(to program at least) than what we have right now for cost paying. Definently if we strip it down to only the mana/selftap payment, which I think is what we have for forge right now(besides a few hacks).