Page 1 of 3

More parsers requested

Posted: Mon Feb 21, 2011 7:37 am
by Nazar-WTH-PCgamer
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: auto=@eachupkeep: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.

Re: More parsers requested

Posted: Mon Feb 21, 2011 12:22 pm
by Zethfox
there was only 1 card which cared about turns and i think i added support for it in 15.1/ 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.

Re: More parsers requested

Posted: Mon Feb 21, 2011 12:26 pm
by Zethfox
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

Re: More parsers requested

Posted: Mon Feb 21, 2011 1:58 pm
by wololo
"random" could be used for many things, including "flip a coin" effects. It's just a matter of making the keyword generic enough ;)

Re: More parsers requested

Posted: Mon Feb 21, 2011 10:23 pm
by Nazar-WTH-PCgamer
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.

Re: More parsers requested

Posted: Mon Feb 21, 2011 11:37 pm
by Zethfox
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.

Re: More parsers requested

Posted: Mon Feb 21, 2011 11:44 pm
by wololo
Discard is unfortunately not the same as move, as it needs to send a specific message to the engine

Re: More parsers requested

Posted: Mon Feb 21, 2011 11:45 pm
by Zethfox
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" 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 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 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 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...

Re: More parsers requested

Posted: Mon Feb 21, 2011 11:50 pm
by Zethfox
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....

Re: More parsers requested

Posted: Tue Feb 22, 2011 2:53 pm
by Nazar-WTH-PCgamer
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?