More Cards with the new keywords
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
38 posts
• Page 3 of 3 • 1, 2, 3
Re: More Cards with the new keywords
by silly freak » 27 Oct 2009, 18:25
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.
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: More Cards with the new keywords
by DennisBergkamp » 27 Oct 2009, 18:29
Yes, exactly. Currently, Psychic Venom just isn't possible to build using cards.txt 
-

DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: More Cards with the new keywords
by Marek14 » 27 Oct 2009, 21:18
I wonder - is there any chance of having two-layered keyword system for triggered abilities, so trigger/effect could be matched freely?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.
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
by silly freak » 27 Oct 2009, 21:23
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
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: More Cards with the new keywords
by frwololo » 30 Oct 2009, 04:59
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
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
by mtgrares » 30 Oct 2009, 18:14
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.
Incantus has a wide variety of events, around 70, that I presume are used for state cards, see the post here.
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.
Incantus has a wide variety of events, around 70, that I presume are used for state cards, see the post here.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: More Cards with the new keywords
by mtgrares » 30 Oct 2009, 18:17
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).
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).
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: More Cards with the new keywords
by Triadasoul » 29 Nov 2009, 17:09
Tried to add this to card.txt, and morph keyword doesn't work. Theoretically it should work
. 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
- Triadasoul
- Posts: 223
- Joined: 21 Jun 2008, 20:17
- Has thanked: 0 time
- Been thanked: 4 times
38 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 34 guests
