Page 1 of 4

Cost Reorganization

PostPosted: 20 Aug 2011, 16:52
by friarsol
Hey guys,

I'm almost done with my Restructuring of Costs. This will allow for cards like Viscerid Drone or Urborg Panther that have more than one type of the same cost. It also streamlines the use of X as a choice (not predefined) in non-Mana costs. In my current codebase, only Sacrifice is using this format, but once the baseline gets checked in, I can go through and add it in everywhere that makes sense. The next one on my list will be for Remove Counter, since I believe that's the most common use of this Cost.

Does anyone know any existing cards that use Cost in a weird way such as Copper-Leaf Angel, Firecat Blitz, Devastating Summons, or Kaervek's Spite? (I've already tested these 4). I wanted to do some expanded testing on anything funky we have that actually uses the Cost system to make sure nothing falls through the cracks. The inputs that do the payment were hardly altered, but a good smoke test never hurt nobody.

Even if it's not as weird as the 4 I mentioned above, I'll go through any cards that people suggest, so feel free to shout out any candidates.

On a related note, after all of this is done I'm considering changing when payment of cost actually happens. So instead of Sacrificing a card immediately when I click on it, instead the Card will be recorded, removed from the possible choices, and marked on the UI somehow (some type of "Using as Payment" icon from Moomarc would be great). This will make "refunding" canceled Abilities more realistic, since currently Forge doesn't support "un-sacrificing" cards.

Re: Cost Reorganization

PostPosted: 20 Aug 2011, 23:48
by moomarc
I'll draw up an icon on Monday if I get a chance. Do you want something in a style similar to the attack, block and summoning sickness icons, or something more splashy?

Re: Cost Reorganization

PostPosted: 21 Aug 2011, 01:07
by jeffwadsworth
As for cards, how about something like Foil, Waxmane Baku.

Re: Cost Reorganization

PostPosted: 21 Aug 2011, 01:48
by ArsenalNut
Is the cost refactoring going to effect the way cost is handled for the keywords that have a cost? At least two cards, Deepcavern Imp and Skizzik Surger, had non-mana Echo costs that didn't work previously.

Here's the script for Skizzik Surger
| Open
Name:Skizzik Surger
ManaCost:4 R R
Types:Creature Elemental
Text:no text
PT:6/4
K:Haste
K:Echo:Sac<2/Land>
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/skizzik_surger.jpg
SetInfo:FUT|Uncommon|http://magiccards.info/scans/en/fut/120.jpg
End


Another oddball cost I ran across was Sage of Fables which removes +1/+1 counters from any creature. I posted a script in
viewtopic.php?f=52&t=3877&start=567 that tried to get around using cost for the counter removal.

Cards with time counters

PostPosted: 21 Aug 2011, 02:12
by Braids
hmm, maybe your changes would allow us to add Aeon Chronicler and Rift Elemental. (i was going to suggest them for testing, but we don't currently have them.)

Re: Cost Reorganization

PostPosted: 21 Aug 2011, 02:33
by friarsol
Foil I should be able to do. Waxmane Baku will come after I add x choice to remove counter.

This is just for the base cost object. Echo would need to be updated still to use cost.

Sage of Fables will need some extra coding to be supported since the counter removal doesn't occur to the activating card.

I don't mind scripting new cards as tests. It's a good way to make sure the code is doing what it should

Re: Cost Reorganization

PostPosted: 21 Aug 2011, 05:33
by ArsenalNut
These are probably things to look at after the cost refactor is complete but I thought I'd go ahead and mention them.

1) Support for "reveal a card" as cost for things like Nightshade Assassin. If you could use it as an UnlessCost, it would also make a bunch of hard coded cards scriptable.
2) Creature cards with two alternative costs such as Goldmeadow Stalwart

Re: Cost Reorganization

PostPosted: 22 Aug 2011, 01:43
by friarsol
Each Cost is much more self-contained than my last iteration of Cost. So Reveal should be able to be coded up. It's basically the same as Discard, except the cards don't go anywhere.

I had been considering the best way to handle an "Or" Cost, but haven't quite come up with the right way to do this yet. Once that's in place, it would handle Rift Elemental. (Although this would also need the remove counters from others Cost too) Goldmeadow Stalwart is a bit trickier since we don't have any structure in place for Additional Costs for Permanent Spells (except for Auras). We could o the basic Permanent route, which would be similar to how Attach works now, to allow for Permanents with Additional Costs.

I'm going to run a few more tests tonight, and then get this checked in. If you notice anything funky, just post on this topic, and I'll get to it when I have some time.

Re: Cost Reorganization

PostPosted: 22 Aug 2011, 12:01
by friarsol
moomarc wrote:I'll draw up an icon on Monday if I get a chance. Do you want something in a style similar to the attack, block and summoning sickness icons, or something more splashy?
It doesn't need to be more splashy, just something that makes it obvious that a card is being used for a current cost.

Re: Cost Reorganization

PostPosted: 23 Aug 2011, 17:43
by moomarc
Finally had some time this evening for personal work, so here's the icon to indicate cards being used for payment. I thought it would be nice to have some sort of link to the mana symbols but obviously didn't want to infringe on copyrights seeing as we'd distribute this with the download package. All feedback is welcome as always!
Reserved-Creature.jpg
Sample creature marked as reserved

Re: Cost Reorganization

PostPosted: 23 Aug 2011, 19:00
by friarsol
Thats pretty awesome Marc. I was primarily planning on using it for things like Discard, Sacrifice (etc), and moving when a card is sacrificed until after the spell is successfully paid for (instead of during payment). That symbol should clearly mark something is going on with that card for the user.

Re: Cost Reorganization

PostPosted: 23 Aug 2011, 20:01
by Sloth
Some more odd costs:
Abandon Hope / Æther Tide / Bond of Agony : Paying {X} and doing stuff times X.

Caller of the Hunt
Kaervek's Spite
Liquid Fire
Night Soil
Weight of Conscience

Re: Cost Reorganization

PostPosted: 23 Aug 2011, 21:27
by friarsol
Good thing Sloth is back from Vacation, now I have some good cards to test.

Kaervek's Spite was already tested per my original post.
The others are quite oddballs. The first three I will definitely test and actually had considered those scenarios, there's another similar scenario that I need to test as well.

Re: Cost Reorganization

PostPosted: 24 Aug 2011, 07:37
by moomarc
friarsol wrote:Thats pretty awesome Marc. I was primarily planning on using it for things like Discard, Sacrifice (etc), and moving when a card is sacrificed until after the spell is successfully paid for (instead of during payment). That symbol should clearly mark something is going on with that card for the user.
Thanks for the positive feedback on the icon. :mrgreen:

Will this refactoring also affect those situations where an object is sacrificed to add mana to your mana pool beforehand (eg you sacrifice a Black Lotus then realise that it's your draw step) or will that only happen when we can save the game state?

Re: Cost Reorganization

PostPosted: 24 Aug 2011, 09:01
by silly freak
as I understand it, this will only influence aborting to pay partially paid costs, i.e. sacrifice something, then realize you can't pay the rest of the cost. reverting the successfully played ability of Black Lotus will only be possible with a revertible game state representation