Page 4 of 10

Re: [WIP] Split Cards Support

PostPosted: 28 Feb 2013, 17:11
by friarsol
Max mtg wrote:Ok, Sol, next time I'll send card scripts directly to you! =) (so that you commit them in a fail-safe mode) (I also hope, we won't have to make such massive changes in the foreseeable future)
Hah. It's fine, I know you didn't expect any issues, otherwise you wouldn't have done it that way. I definitely wasn't trying to say you were being malicious, just that's where the root of the issue was. We'll get a new branch setup for Agetian, and nobody will remember the great script cleanup of 2013.

Re: [WIP] Split Cards Support

PostPosted: 28 Feb 2013, 17:50
by Max mtg
Ah, I know what else should be removed from _all_ of scripts => svar:rarity!
So I will send you an archive! :twisted:

Ok, right after beta 1.3.9

Re: [WIP] Split Cards Support

PostPosted: 28 Feb 2013, 20:03
by myk
if it helps, here's a script that will split the checkins by directory:
Code: Select all
find res/cardsfolder/* -type d | while read dname; do count=$((count + 1)); svn commit -m "remove svar:rarity, part $count" "$dname"; done
edit: bash for windows is available via the cygwin library, which my windows-using coworkers swear by. There is also the win-bash project, which I haven't used but looks promising.

Re: [WIP] Split Cards Support

PostPosted: 28 Feb 2013, 20:10
by Max mtg
Sorry, I am on Windows - that sample won't work.
But a similiar batch is quite possible. I still dream of sending an archive to Sol )

Re: [WIP] Split Cards Support

PostPosted: 01 Mar 2013, 04:27
by Agetian
So, should I wait for the new branch then or just make one on my own (please tell me if I even can then :)). Thanks in advance!

- Agetian

Re: [WIP] Split Cards Support

PostPosted: 01 Mar 2013, 04:29
by friarsol
Agetian wrote:So, should I wait for the new branch then or just make one on my own (please tell me if I even can then :)). Thanks in advance!

- Agetian
Feel free to make it yourself. They aren't that hard to make. If you can't figure it out, I'll make it for you tomorrow.

Re: [WIP] Split Cards Support

PostPosted: 01 Mar 2013, 14:25
by friarsol
Ok, I deleted and recreated the branch for you since it didn't seem to be updated. Should be under the same name as before (but you may need to recheckout the branch, I can't remember how that works)

Re: [WIP] Split Cards Support

PostPosted: 02 Mar 2013, 02:16
by Agetian
Thanks a lot, sol! I'll get right to it after work today, I think I'll just go ahead and recheckout and then try merging up to the latest trunk to make sure everything works, then get on with the cards support.

- Agetian

Re: [WIP] Split Cards Support

PostPosted: 03 Mar 2013, 06:12
by Agetian
OK, my progress so far:
- Branch merge works so far. Yay! :D
- I started working on the creation of the full split card face in CardFactory. So far most of it works but some of it is likely to be implemented somewhat wrong and doesn't want to work exactly as desired. In particular, I have questions about the following:

If I only add the abilities of each face to the combined card, I wind up with three abilities assigned to the card, however, neither of them shows the correct text - so, if I click the card to play it, I'm presented with three choices (one for the combined face, one for the left split, one for the right split), all of which are called "Assault // Battery" (given that that's the card I'm experimenting with). Also, the ability texts do not show in the card detail box. What am I doing wrong here and what should I do instead?

Currently I'm using the names of each split and the associated Oracle text to force-assign the full card text via card.setText, but I'm not sure if that's actually optimal (most likely not).

Also, would it be possible to "filter out" the combined face ability itself somewhere in the code so that I'm only presented with two choices, for the left and right split respectively, when playing the card? If so, what part of the code should I be looking at?

Thanks in advance!
- Agetian

Re: [WIP] Split Cards Support

PostPosted: 03 Mar 2013, 08:10
by Max mtg
Agetian wrote:If I only add the abilities of each face to the combined card, I wind up with three abilities assigned to the card, however, neither of them shows the correct text - so, if I click the card to play it, I'm presented with three choices (one for the combined face, one for the left split, one for the right split), all of which are called "Assault // Battery" (given that that's the card I'm experimenting with). Also, the ability texts do not show in the card detail box. What am I doing wrong here and what should I do instead?
You have to arm with a debugger and see why is the third ability "for combined face" you've never added to card is being created.

Re: [WIP] Split Cards Support

PostPosted: 03 Mar 2013, 11:50
by Agetian
Ok, the problem with the combined face ability being added to the list of abilities to choose from is now fixed, but the abilities still don't show up correctly in the choice box (or in the card detail panel, for that matter, if they're just added to the combined card face. It's almost as if the SpellDescription is not being "seen" by the game for abilities coming from split card faces - does anyone have any idea why that might be happening?

EDIT: A related question - are the abilities on the split cards supposed to be spell abilities, static abilities or intrinsic abilities? I assume they are all spell abilities (from Instants and Sorceries), but I'm not sure... I'd need a consultation of a rule guru here. :)

- Agetian

Re: [WIP] Split Cards Support

PostPosted: 03 Mar 2013, 14:01
by friarsol
Agetian wrote:EDIT: A related question - are the abilities on the split cards supposed to be spell abilities, static abilities or intrinsic abilities? I assume they are all spell abilities (from Instants and Sorceries), but I'm not sure... I'd need a consultation of a rule guru here. :)
They are all spells (SpellAbilites), it's quite similar to Charm/Modal Spells. Where as you start casting it you decide which spell/mode you are casting. In your case, choosing which side will change the base Cost as well as other things. For Charms, that isn't the case (obviously).

Re: [WIP] Split Cards Support

PostPosted: 03 Mar 2013, 15:22
by Max mtg
Agetian wrote:Ok, the problem with the combined face ability being added to the list of abilities to choose from is now fixed
- Agetian
You have found the right place, but made a wrong edit...
Code: Select all
       // this is the "default" spell for permanents like creatures and artifacts
        if (card.isPermanent() && !card.isAura() && !card.isLand()) {
            if (card.getRules().getSplitType() != CardSplitType.Split) {
                card.addSpellAbility(new SpellPermanent(card)); // ignore the default spell for combined split cards
            }
        }
You have to assign a correct card type to the combined face. When card has a type of Sorcerry, it won't be considered a permanent and the "third" ability creation will be excluded by the first condition in outer if. And the internal check of splittype becomes unnessesary

Re: [WIP] Split Cards Support

PostPosted: 03 Mar 2013, 15:28
by Max mtg
Agetian wrote:EDIT: A related question - are the abilities on the split cards supposed to be spell abilities, static abilities or intrinsic abilities? I assume they are all spell abilities (from Instants and Sorceries), but I'm not sure... I'd need a consultation of a rule guru here. :)

- Agetian
You begin with intrinsic abilities filled by unprocessed lines of text. As they are parsed by factory you get the same amount of instances of SpellApiBased.

Re: [WIP] Split Cards Support

PostPosted: 03 Mar 2013, 17:59
by Agetian
@ Max: Oh, OK, gotcha! I'll tinker with setting the card type then instead of checking for the split type. Btw, I tried adding intrinsic abilities to the card but it did not make any difference as far as displaying the abilities went... :( I'll keep looking.

- Agetian