Page 3 of 3

Re: More Cards with the new keywords

PostPosted: 27 Oct 2009, 18:25
by silly freak
most (if not all?) of the ab... keywords are for activated abilities. there are hardly any for triggered ones, so they (like Dingus Egg) are hard coded.

Re: More Cards with the new keywords

PostPosted: 27 Oct 2009, 18:29
by DennisBergkamp
Yes, exactly. Currently, Psychic Venom just isn't possible to build using cards.txt :(

Re: More Cards with the new keywords

PostPosted: 27 Oct 2009, 21:18
by Marek14
silly freak wrote:most (if not all?) of the ab... keywords are for activated abilities. there are hardly any for triggered ones, so they (like Dingus Egg) are hard coded.
I wonder - is there any chance of having two-layered keyword system for triggered abilities, so trigger/effect could be matched freely?

Or even three-layered, trigger/target/effect.

Dingus Egg could be schematically shown as trigger Graveyard Trigger(Land), pass land and effect "Deal 2 damage to passed object's controller."

Re: More Cards with the new keywords

PostPosted: 27 Oct 2009, 21:23
by silly freak
in an ideal world, trigger events, activation costs, targets and choices, and effects were separated. to what extent that is possible, i don't know

Re: More Cards with the new keywords

PostPosted: 30 Oct 2009, 04:59
by frwololo
Ideally, Triggers, "targetters", and effects should be different objects linked together.

Wagic has the following kind of structure. I'm not saying it should be taken as an example, but it allows more flexibility than Forge (at least last time I checked the code of cardFactory):

TriggeredAbility is a class with 2 attributes:
- a Trigger object
- an effect object (which happens to be of the class MTGAbility)

The effect itself has a Cost, and a TargetChooser Object, as well as functions that describe what happens when it activates.


From the parser perspective, it allows us to create effects from a text such as:
@movedTo(ally|mybattlefield):may foreach(ally|mybattlefield) damage:1 target(creature)

@movedTo(ally|mybattlefield): is parsed into a Trigger object
may foreach(ally|mybattlefield) damage:1 is parsed into an MTGAbility
target(creature) is parsed into a targetChooser, associated to the effect above

For reference:
parsing of triggered abilities: http://code.google.com/p/wagic/source/b ... ty.cpp#167

Parsing of "TargetChooser": http://code.google.com/p/wagic/source/b ... ser.cpp#10

TriggeredAbilities: http://code.google.com/p/wagic/source/b ... y.cpp#2099

Re: More Cards with the new keywords

PostPosted: 30 Oct 2009, 18:14
by mtgrares
In my mind I see Glorious Anthem, Dingus Egg and Psychic Venom as cards that look at the board (game state) and generate effects, so mentally I call these cards "state cards". State cards are probably the most difficult type because they can do anything. State cards often have the template "When X happens, do Y". Obviously these types of cards can become very complicated because they observe the game state for variety of events (past and present) and do a wide variety of effects.

Things can become very complicated when state cards affect each other, a simple example would be Glorious Anthem and Nightmare which in the past didn't work together in MTG Forge but now I'm very happen that they work correctly. :D

Incantus has a wide variety of events, around 70, that I presume are used for state cards, see the post here.

Re: More Cards with the new keywords

PostPosted: 30 Oct 2009, 18:17
by mtgrares
frwololo,

Your scripting language looks very good, I'm sure you have spent alot of time developing it. It is always best to script versus hardcoding in a computer language. Hardcoding takes longer and it requires more lines of code (which makes it harder to debug and maintain).

Re: More Cards with the new keywords

PostPosted: 29 Nov 2009, 17:09
by Triadasoul
Tried to add this to card.txt, and morph keyword doesn't work. Theoretically it should work :roll:. Have i made a mistake?

Code: Select all
card.txt
Zoetic Cavern
no cost
Land
no text
tap: add 1
Morph:2

card_pictures.txt
zoetic_cavern.jpg            http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=132215