More parsers requested

All additions requested or suggested to improve the card coding language.
Nazar-WTH-PCgamer
Posts: 60
Joined: Sat Feb 19, 2011 5:24 am

More parsers requested

Post by Nazar-WTH-PCgamer » Mon Feb 21, 2011 7:37 am

Here are 3 requests/suggestions I would make for functions to be added.

We need to add the randomness possibility to a selection.
Restriction keyword "random" to be used along with other restrictions. In all 4 examples below, it is used as "AND RANDOM" along with another element of the code.
example1: {T}:damage:1 (player;random) -- {T}: Inflicts 1 damage to random player
example2: [email protected]:moveto(battlefield;random) all(this) -- every upkeep, this card may randomly change ownership
example3: auto(bury(creature;random|opponentbattlefield) -- randomly sacrifices an opponent's creature which is in play
example4: auto=moveto(opponentbattlefield) land[basic;random|opponentlibrary] -- opponent puts random basic land into play a from his library

In some cases, we need to define better the "decision maker" or the "action maker" that isn't obvious/automatic for the computer
Prefix/Keyword "by" to be used along with any [player] as per the miki definition of possible target [player]
example1: auto=bury(creature|opponentbattlefield) byopponent -- opponent sacrifices a creature of his choice from his battlefield
example2: auto=moveto(opponentbattlefield) land[basic|opponentlibrary] byopponent -- lets the opponent pick a land by himself instead of you (spellcaster) it for him and vice-versa when AI casts the spell on you

Some cards require for certain amounts of turns (and sometimes more specifically turns of yours or specifically opponent's turns) to elapse before you can cast them or before their effect starts/wears off. The game already counts the turns since it is displayed on the victory screen. We need to have access to that variable as an integer keyword "currentturn" to enable "<", "=" and ">" comparaisons. An ingame turn counter display would be nice too but that belongs to another section.
Nazar is meant to rule the world... Someday! Once Nazar is in charge, goblins won't have to hide or shovel orcish poops no more. Vote for Nazar!!!

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: More parsers requested

Post by Zethfox » Mon Feb 21, 2011 12:22 pm

there was only 1 card which cared about turns and i think i added support for it in 15.1/current...do you know of others?

if you can show me an exsample of a card that could use currentturn it would take but a just a few lines of code to add support for it...i just didnt see much else that needed it.

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: More parsers requested

Post by Zethfox » Mon Feb 21, 2011 12:26 pm

ill be honest about the "random" keyword you want, this just sounds like youre requesting tools to add workarounds....which we dont do anymore.
however if its meant for the astral set ive considered adding support for that set...but not for workarounds...i apologize, personally i stand very firm against adding a card as a workaround to the SVN

wololo
Site Admin
Posts: 3727
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: More parsers requested

Post by wololo » Mon Feb 21, 2011 1:58 pm

"random" could be used for many things, including "flip a coin" effects. It's just a matter of making the keyword generic enough ;)

Nazar-WTH-PCgamer
Posts: 60
Joined: Sat Feb 19, 2011 5:24 am

Re: More parsers requested

Post by Nazar-WTH-PCgamer » Mon Feb 21, 2011 10:23 pm

Like wololo said, the coin flip is the most frequent and best example of the need for "randomness" as a feature. Since the "flip a coin" topic already existed and was limited to 50/50 probability between 2 options. I wanted to expand the discussion on the need for random choices as it already exists in "discard" parser:

[cost:]discard:n [playertarget] - randomly discard n cards

This feature is good but too limited in my humble opinion. Why is the game able to randomly select a card to discard but nothing else? Both the "game" and the "discard" function should be more flexible:

- allow other origin (zone) for the card to be discarded... (hand, battlefield, library, graveyard)
---> that might mean going back to something closer to the "moveto() from()" parser with increased flexibility

- allow to specify the destination (zone) for the discarded card... (hand, battlefield, library, graveyard, exile)
---> that definitely means the "moveto()" effect has more flexibility

- the "n" part is great since it's lacking in the more complex functions like the "moveto() [target] from()"
---> that is why we could have a use for repetitive keyword (like ­­­*n after the target or after the command line)
---> it could allow to specify more than one target for same effect or to repeat a whole line "n" times
---> auto=tap land[-basic;-tapped|mybattlefield]*2 && untap land[basic;tapped|mybattlefield]*3
---> auto=[cost:]damage:m [target|playertarget]*n -- does m damage to n targets. m may be a variable.

- the random aspect of the discard effect is great and should be allowed to any target type (as a restriction or prefix)
---> it could allow to target a random...
---> - card from your library;
---> - opponent's creature to sacrifice;
---> - battlefield side on which to add a token creature;
---> - land from opponent's battlefield to return to library;
---> - etc.
---> All this could lead to coding of more card but also to fill in the blank for the decision making of AI in certain situations...

I'm not going to explain into more details because this post is already exhaustingly long, but I think you can get the big picture. I know I spoke about lots of features but the most important one for me in this post remains the need for a "random" factor.
Nazar is meant to rule the world... Someday! Once Nazar is in charge, goblins won't have to hide or shovel orcish poops no more. Vote for Nazar!!!

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: More parsers requested

Post by Zethfox » Mon Feb 21, 2011 11:37 pm

i already have a coin flip, and by design it is a little different from anything that could be used in this context...the only thing its missing is the menu choice to allow the player to "call the flip" as our menu system currently wont allow such a method without some heavy changes.

wololo
Site Admin
Posts: 3727
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: More parsers requested

Post by wololo » Mon Feb 21, 2011 11:44 pm

Discard is unfortunately not the same as move, as it needs to send a specific message to the engine

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: More parsers requested

Post by Zethfox » Mon Feb 21, 2011 11:45 pm

also, in the context your discribing its usage would be a method we are not allowing in the svn, ie: random discard in place of "target player chooses a card to discard" effect....you are intending on using it in a method such as to recreate such effects as anihilator...except ai is not really going to be allowed to "choose the creatures to sacrifice"....instead the choice would randomly sacrifice a creature instead...

this is something thats been debated by the dev team since even before i got here, and doc told me once that all the "Abyssal Specter" type creatures were once in wagic as "random discard" and that it was indeed wololo that made the call to remove them....so doc refuses to even add them to boardline.txt....

"Whenever Abyssal Specter deals damage to a player, that player discards a card." this effect is NOT supposed to be random...the player is supposed to get to choose the cards...so they were removed....

now do correct me if this is not really your intent....but from what i read originally and your 2nd explaination of it....you want this....
Blightning deals 3 damage to target player. That player discards two cards.
to have the ai randomly discard 2 cards......
and in similar fasion use the same templete on all cards which say a player needs to sacrifice a card.....just having the choice targets made randomly...

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: More parsers requested

Post by Zethfox » Mon Feb 21, 2011 11:50 pm

btw there is a keyword for targeted discard...its "reject"....however, there is no random targetting happening there, it is simply an effect keyword that sends out the correct events...same for sacrifice as a keyword....

Nazar-WTH-PCgamer
Posts: 60
Joined: Sat Feb 19, 2011 5:24 am

Re: More parsers requested

Post by Nazar-WTH-PCgamer » Tue Feb 22, 2011 2:53 pm

Sweet! I just never read about those keywords in the miki or never ran across them while reading through the mtg.txt file from v0140. Are they new since v0141?
Nazar is meant to rule the world... Someday! Once Nazar is in charge, goblins won't have to hide or shovel orcish poops no more. Vote for Nazar!!!

Post Reply