Page 9 of 10

Re: Words that Cards.txt recognizes

PostPosted: 02 Jan 2010, 00:25
by Chris H.
See new topic located at Keywords recognized by Forge.

Re: Words that Cards.txt recognizes

PostPosted: 18 Jan 2010, 02:13
by Chris H.
See new topic located at Keywords recognized by Forge.

Re: Words that Cards.txt recognizes

PostPosted: 27 Jan 2010, 00:48
by Chris H.
See new topic located at Keywords recognized by Forge.

Re: Words that Cards.txt recognizes

PostPosted: 27 Jan 2010, 17:08
by Rob Cashwalker
TgtKPump {cost}:{keyword} will become abTgtKPump
Actually all pump abilities got rolled into abPump, so just remove this line, abTgtPTPump, KPump, PTPump, PTKPump and TgtKPump; add abPump[Tgt].

Re: Words that Cards.txt recognizes

PostPosted: 27 Jan 2010, 17:41
by Chris H.
Thank you, Rob.

Re: Words that Cards.txt recognizes

PostPosted: 28 Jan 2010, 04:21
by frwololo
I wrote a "translation" for Wagic at: viewtopic.php?f=47&t=2208 based on Chris H.'s latest update
Who knows, maybe someday someone will write a tool to convert from one to the other :)

The complete syntax for Wagic can be found at http://wololo.net/miki/index.php/Wagic/CardCode

Re: Words that Cards.txt recognizes

PostPosted: 28 Jan 2010, 20:16
by mtgrares
The number of keywords is astounding. Thanks Rob and Chris.

It is interesting that many of the keywords are similar to the Wagic project. Maybe great minds think alike. (Or great minds steal from each other, who knows.)

Re: Words that Cards.txt recognizes

PostPosted: 29 Jan 2010, 02:02
by zerker2000
Many great minds feel the compulsion to outdo each others' accomplishments...

Re: Words that Cards.txt recognizes

PostPosted: 29 Jan 2010, 04:03
by Rob Cashwalker
Actually, I'm not responsible for most of them.... Dennis did a lot of work on making all of those "Whenevers" into functional abilities.
My keywords center on many of the basic game tasks, which vary in scale, but are all essentially the same thing and same code.

I read the wagic translation table, and I don't see very much similarity. I can say for sure, that some of the actions are shorter and the targeting restriction is easily applied to just about everything. But if I didn't have a reference, I wouldn't know what half of them did.... Take the P/T Pump ability.... "auto=p/t" OK, so is this a one time effect or a global continuous effect? Is it an ability of a permanent or the effect of a spell? Target any creature or only self?
Most people could read "abPump R:+1/+0" and know immediately what it does, or "spPumpTgt:+3/+3" (when I get to it, one-time multi pumps would be "spMultiPump:+1/+1:{Restrictions}"

Magic Wars is another example of where the scripting language is modeled after the mechanics to the point where non-coders can understand the bulk of what a card does without looking at the card text.

Re: Words that Cards.txt recognizes

PostPosted: 29 Jan 2010, 10:13
by frwololo
Rob Cashwalker wrote:I read the wagic translation table, and I don't see very much similarity. I can say for sure, that some of the actions are shorter and the targeting restriction is easily applied to just about everything. But if I didn't have a reference, I wouldn't know what half of them did.... Take the P/T Pump ability.... "auto=p/t" OK, so is this a one time effect or a global continuous effect? Is it an ability of a permanent or the effect of a spell? Target any creature or only self?
Haha, that's actually the magic of it :mrgreen: it does what you think it'll do. Basically Wagic does the thinking for you, especially for p/t modifiers.

Example:
auto={R}:1/0 means: pay one red mana and (this creature) gets +1/+0 until end of turn. Where does the "until end of turn" comes from? It's because whenever a cost is involved, a p/t boost ALWAYS lasts until end of turn, otherwise it's called a counter and is a different mechanics. Where does the "this creature" comes from? It's because no other target is specified. If the card is an aura, obviously we mean "the target of the aura" unless another target is specified, etc...
auto=1/0 means: +1/+0. If the card is an aura, it means: "my target gets +1/+0" (continuous effect, obviously, since no cost is involved). If the card is an instant or a sorcery, the effect lasts until end of turn.

Basically Wagic does the thinking based on 1) the type of the card that has the ability 2) the cost involved with the ability
This works fairly well for most of the cards :) . This also mean that some cards cannot be coded with that system, but there are few of them and I can't think of any on top of my head.

Regarding target, the rule is simple. If no "target" is mentioned in the ability itself, it means "self" for a creature or "my target" for an aura, and instant, or a sorcery.

The whole system avoids redundancy.

examples:
text=enchanted creature gets +1/+0
type=aura
target=creature
auto=1/0
text={R}:enchanted creature gets +1/+0 until end of turn
type=aura
target=creature
auto={R}:1/0
text=target creature gets +1/+0 until end of turn
type=sorcery
target=creature
auto=1/0
name=Super Goblin
text={R}:Super Goblin gets +3/+3 until end of turn
type=creature
auto={R}:3/3
name=Super Goblin Shaman
text={R}:Target goblin gets +3/+3 until end of turn
type=creature
auto={R}:3/3 target(goblin)
The idea is that if you write it the most simple way you can think about, it will most likely do what you expect it to do. That's less control for the card creator's point of view but it "feels" easier (at least that was the initial goal...)

One note: I think you're mistaken in believing that the effects of a spell or an activated ability should be different keywords. Until end of turn (one shot) and continuous are a different problem, but activated abilities VS spells is a false problem.
This also means that when we add a keyword in Wagic, it immediately works for activated abilities as well as instants/sorceries, whereas I'm assuming you have to add a different keyword for spells VS abilities in Forge.

Re: Words that Cards.txt recognizes

PostPosted: 29 Jan 2010, 17:02
by Rob Cashwalker
One note: I think you're mistaken in believing that the effects of a spell or an activated ability should be different keywords. Until end of turn (one shot) and continuous are a different problem, but activated abilities VS spells is a false problem.
This also means that when we add a keyword in Wagic, it immediately works for activated abilities as well as instants/sorceries, whereas I'm assuming you have to add a different keyword for spells VS abilities in Forge.
I agree it would be good to provide that kind of uniformity, but the reason I didn't do it that way is simple - Java doesn't have goto. So if I tried to use the card type alone, it would turn into an even bigger if-elseif-else party than CardFactory already is. Another issue would be when Wizards does weird stuff with the card types that might trigger the wrong section of code.

With a goto, I could just jump to the sections of code that dealt with the difference in AI between self-targeting, target-other and spell-target. The resolve code is the same in all cases.

Continuous effects would need to be different, as those cards have code in a different file. The current architecture makes some of these concepts difficult. If all card code was really in a CardFactory file, then maybe it makes sense, and I would've done it that way.

Great thing is, that now the code for spPumpTgt and abPumpTgt are both able to deal with the same types of parameters, so if we wanted to try to unify the keyword, this would be a prime candidate....

Re: Words that Cards.txt recognizes

PostPosted: 10 Feb 2010, 12:34
by Chris H.
See new topic located at Keywords recognized by Forge.

Re: Words that Cards.txt recognizes

PostPosted: 23 Feb 2010, 02:40
by Chris H.
See new topic located at Keywords recognized by Forge.

Re: Words that Cards.txt recognizes

PostPosted: 27 Feb 2010, 14:27
by Chris H.
See new topic located at Keywords recognized by Forge.

Re: Words that Cards.txt recognizes

PostPosted: 01 Mar 2010, 06:22
by Rob Cashwalker
There were two 2/21/2010 releases? #-o