tag:blogger.com,1999:blog-7523569453469773247.post6516916193253900390..comments2015-02-11T12:13:10.578+01:00Comments on Laterna Magica: MtG programming: The card editorUnknownnoreply@blogger.comBlogger7125tag:blogger.com,1999:blog-7523569453469773247.post-54177838848270128962010-05-13T15:55:11.901+02:002010-05-13T15:55:11.901+02:00thanks for reading my blog ;)thanks for reading my blog ;)Silly Freakhttps://www.blogger.com/profile/09963238585847993157noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-61373282607003097292010-05-13T14:34:33.897+02:002010-05-13T14:34:33.897+02:00thanks for your detailed answers ;)thanks for your detailed answers ;)nantuko84https://www.blogger.com/profile/15891352523600843744noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-78487725702182742242010-05-13T14:05:32.001+02:002010-05-13T14:05:32.001+02:00>> about effects and abilities: I've see...>> about effects and abilities: I've seen an example with "apply laterna.magica.cards.DestroyAllCreatures". so it means that your would implement separate classes for such cards, right?<br /><br />exactly. there is no class for "apply" yet, but that is what it means. in this case, DestroyAllCreatures would mean that it adds a single spell effect to the card, but you could also make a card solely through an "apply" line<br /><br />>> and also I'm interested in your idea how to implement cards that combine basic effects, e.g.<br />"Destroy target creature. Draw 2 cards.".<br /><br />I have this already with costs: "{W/U}, {T}" for example is splitted at the comma, and each partial cost is added separately. The same could be done for effects, altough my ActivatedAbilityParser doesn't do such things yet. how combining effects work is already <a href="http://laterna--magica.blogspot.com/2010/05/implementing-activated-abilities-divide.html" rel="nofollow">here</a>Silly Freakhttps://www.blogger.com/profile/09963238585847993157noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-8952966546669856342010-05-13T13:13:53.306+02:002010-05-13T13:13:53.306+02:00looked through the code. it makes sense ;) and I l...looked through the code. it makes sense ;) and I like it.<br /><br />about effects and abilities: I've seen an example with "apply laterna.magica.cards.DestroyAllCreatures". so it means that your would implement separate classes for such cards, right?<br /><br />and also I'm interested in your idea how to implement cards that combine basic effects, e.g. <br />"Destroy target creature. Draw 2 cards.".nantuko84https://www.blogger.com/profile/15891352523600843744noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-4662802249016044322010-05-13T12:00:00.714+02:002010-05-13T12:00:00.714+02:00Oh, and you would have to implement targets first ...Oh, and you would have to implement targets first ;)Silly Freakhttps://www.blogger.com/profile/09963238585847993157noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-3499039271644300422010-05-13T11:54:24.045+02:002010-05-13T11:54:24.045+02:00Yes, it is. The code is already on the SVN, so I&#...Yes, it is. The code is already on the SVN, so I'll just link you to it: <a href="http://code.google.com/p/laterna-magica/source/browse/trunk/laterna/src/laterna/magica/cards/AllCards.java" rel="nofollow">AllCards</a> is the "entry point". It finds the <a href="http://code.google.com/p/laterna-magica/source/browse/trunk/laterna/src/laterna/magica/cards/CardCompiler.java" rel="nofollow">parsers</a> and uses them. The configuration works through <a href="http://code.google.com/p/laterna-magica/source/browse/trunk/laterna/props/res/cards/cards.properties" rel="nofollow">cards.properties</a>. here, you declare which parsers exist. Currently, only a <a href="http://code.google.com/p/laterna-magica/source/browse/trunk/laterna/props/res/cards/text.properties" rel="nofollow">text</a> <a href="http://code.google.com/p/laterna-magica/source/browse/trunk/laterna/src/laterna/magica/cards/text/TextCardCompiler.java" rel="nofollow">parser</a> exists.<br /><br />Now, if you wanted to create a new parser, you just have to <br />-implement the <a href="http://code.google.com/p/laterna-magica/source/browse/trunk/laterna/src/laterna/magica/cards/CardCompiler.java" rel="nofollow">CardCompiler</a> interface (and of course any classes your parser needs internally)<br />-add the class and path properties to cards.properties and<br />-create a new directory for the card files.<br /><br />Extra: If you look at <a href="http://code.google.com/p/laterna-magica/source/browse/trunk/laterna/props/res/cards/text.properties" rel="nofollow">text.properties</a>, there's much more than the minimum. As I wrote, the text parser uses individual parsers for the lines, and they use the same plugin system.<br />The TextHandler class uses individual classes for parsing different abilities, the ActivatedAbilityParser class uses separate classes for parsing sorts of costs and effects. And I'll do the same some time for targets ;)Silly Freakhttps://www.blogger.com/profile/09963238585847993157noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-45767783881507098842010-05-13T09:02:01.353+02:002010-05-13T09:02:01.353+02:00such downloader is very usefull tool. you don'...such downloader is very usefull tool. you don't realize this until you start implementing lots of cards. even perl script that generates card templates from gatherer spoiler saved hours for me.<br /><br />could you please give an example how you are planning to use different formats (didn't understand from article, sorry).<br />let's say we have Llanowar Elves in your (text) format, and I want to add Shock in xml format. what should I do? is it some type of plugin system?nantuko84https://www.blogger.com/profile/15891352523600843744noreply@blogger.com