tag:blogger.com,1999:blog-889604442512373664.post2771397082533979782..comments2023-10-31T08:28:52.391-07:00Comments on Computer Programming and Magic: The Gathering: Forge's ArchitectureForgehttp://www.blogger.com/profile/15838286606081721333noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-889604442512373664.post-26604356619588031212009-11-25T12:08:58.347-08:002009-11-25T12:08:58.347-08:00"Although the original canTarget was found in..."Although the original canTarget was found in GameAction.java (added mine in CardFactoryUtil, wasn't even aware one existed in GameAction until later :) )"<br /><br />In the back of my mind I knew that I might want to implement protection later but I decided to ignore the "protection issue" since it also applies to damage and combat. <br /><br />(When you are just starting, it is hard to worry about "big issues" like protection which seem very far down the road.)Forgehttps://www.blogger.com/profile/15838286606081721333noreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-29132127550450603202009-11-25T12:06:52.641-08:002009-11-25T12:06:52.641-08:00Yeah, this is probably the 2nd or 3rd time I'...Yeah, this is probably the 2nd or 3rd time I've written about protection being a huge change. I'm just very impressed with it.Forgehttps://www.blogger.com/profile/15838286606081721333noreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-42557237232142348582009-11-25T10:10:08.932-08:002009-11-25T10:10:08.932-08:00Although the original canTarget was found in GameA...Although the original canTarget was found in GameAction.java (added mine in CardFactoryUtil, wasn't even aware one existed in GameAction until later :) ).DennisBergkampnoreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-18099392478404960412009-11-25T09:57:55.779-08:002009-11-25T09:57:55.779-08:00nantuko-
I agree that you could make that determi...nantuko- <br />I agree that you could make that determination in one location before the sa.resolve() call. <br /><br />However, the AI for a card needs to check if a target is good before deciding on it as a target, so that was one location multiplied by the hundreds of cards where it was needed.<br />If the game can prevent you from playing the effect against an illegal target, then it's more fun, because you can avoid wasting resources for an effect to just simply fizzle anyway. (the game allows so many other stupid plays)<br /><br />The canTarget method was in the code a LONG time before protection was added. Some cards used it, many did not. Its presence was actually one of my first question to Forge.Unknownhttps://www.blogger.com/profile/15178010996656985441noreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-7147870885452135182009-11-25T04:19:55.716-08:002009-11-25T04:19:55.716-08:00it is the second time when I read that it was big ...it is the second time when I read that it was big deal to implement protection as it needed to update ALL targeting cards. it's awesome and a little bit suprised me as I spent only a hour or so to implement it in MagicWars that, you know, has the same architecture for targeting (I believe because of using your architecture in MW%))<br /><br />so I've just looked into mtgforge source code (dated 09-18-forge-full, not recent, but I could find the canTarget method there)<br /><br />yep, now "all" targeting spells have CardFactoryUtil.canTarget(card, getTargetCard()).<br />ant the question is: wasn't it easier to add checking before sa.resolve() and say\log\print message about spell or ability fizzle. I believe it's more flexible and takes less time;)<br />or may be I misunderstood something, did I?nantuko84https://www.blogger.com/profile/15891352523600843744noreply@blogger.com