[CODE] Counterspell to zone

All code submission.
Locked
excessum
Posts: 220
Joined: Wed Jan 16, 2013 5:03 am
Contact:

[CODE] Counterspell to zone

Post by excessum »

[25/9/13] Just realised that I posted this in the wrong forum previously...

This is my first attempt at messing with the source code so it is just a simple addition. I added an overloaded version of the AAFizzler class in order to support moving counterspell-ed spells to specific zones instead of the default graveyard. At present, it supports moving to graveyard, hand, top of library and exile and I have included examples of the three new modes below. It is technically possible to code "bottom of library" but it is more complicated than the other examples so I am leaving it till later. It should be straightforward to incorporate the existing "fizzle" keyword into this new class but I have not done that in case my new code is unacceptable or broken in some way.

Code: Select all

[card]
name=Remand
target=*|stack
auto=fizhand
auto=draw:1 controller
text=Counter target spell. If that spell is countered this way, put it into its owner's hand instead of into that player's graveyard. -- Draw a card.
mana={1}{U}
type=Instant
[/card]
[card]
name=Memory Lapse
target=*|stack
auto=fizlibrary
text=Counter target spell. If that spell is countered this way, put it on top of its owner's library instead of into that player's graveyard.
mana={1}{U}
type=Instant
[/card]
[card]
name=Dissipate
target=*|stack
auto=fizexile
text=Counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard.
mana={1}{U}{U}
type=Instant
[/card]
Attachments

[The extension zip has been deactivated and can no longer be displayed.]

pankdm
Posts: 50
Joined: Tue Sep 17, 2013 6:34 am

Re: [CODE] Counterspell to zone

Post by pankdm »

Thank you for this patch!
I've started testing and reviewing it: see commits (https://github.com/pankdm/wagic/commit/ ... eeb67b5c4e, https://github.com/pankdm/wagic/commit/ ... 8f5437850d) in my experimental branch on github.
Looks good to me, except a few styling and architectural changes (see the second commit).
I am going to merge it to svn with some other patches from this section (I hope to find some spare time to review them as well).
excessum
Posts: 220
Joined: Wed Jan 16, 2013 5:03 am
Contact:

Re: [CODE] Counterspell to zone

Post by excessum »

I have actually updated this code and added a separate patch for "counterspell unless controller pays {x}". They can be found in the link in my forum profile because posting source code or even SVN patch files here tend to trigger the anti-spam for some reason...

If possible, can you verify the two patches for the parser fix and memory leak fix? I have been emailing wololo to change my email address on the committers so that I can commit them myself but he has yet to reply...
pankdm
Posts: 50
Joined: Tue Sep 17, 2013 6:34 am

Re: [CODE] Counterspell to zone

Post by pankdm »

Wow, great! It seems like you have a lot of patches available! I will try to verify and commit them as long as I have time (I can't commit new code without checking it first, and it takes time to dig deeper into the mazes of wagic project :))
excessum
Posts: 220
Joined: Wed Jan 16, 2013 5:03 am
Contact:

Re: [CODE] Counterspell to zone

Post by excessum »

As far as I know, my existing patches are fully compatible with the latest SVN release (r4876) other than my own "Fizzle to zone" patch for obvious reasons so they can be applied directly. Hopefully they can be committed soon as there are literally dozens are cards that can be added with those new mechanics.
afrikas
Posts: 3
Joined: Wed Sep 04, 2013 4:07 pm

Re: [CODE] Counterspell to zone

Post by afrikas »

excessum wrote:I have actually updated this code and added a separate patch for "counterspell unless controller pays {x}". They can be found in the link in my forum profile because posting source code or even SVN patch files here tend to trigger the anti-spam for some reason...

If possible, can you verify the two patches for the parser fix and memory leak fix? I have been emailing wololo to change my email address on the committers so that I can commit them myself but he has yet to reply...
excessum i tried to patch all your files into the wagic source but it gives an error when i try to compile:


"src/AllAbilities.cpp: In member function 'virtual int GenericPaidAbility::resolve()':
src/AllAbilities.cpp:1150: error: comparison between signed and unsigned expressions
make: *** [ojs/AllAbilities.o] Error 1"

can you tell me whats wrong?
or can you give an eboot already compiled whith your patches?

Thanks
Locked