Page 2 of 2

Re: Rev 4410: Initial code for AF_ChangeZone

PostPosted: 20 Dec 2010, 13:28
by Sloth
friarsol wrote:We probably should start tracking that at some point. And we also should probably add Face-Up and Face-Down to hasProperty() since there is a fair amount of caring for those properties in Morph related cards.
Face-Down can already be checked by hasProperty() (for example creature.faceDown).

What we have to do is not displaying exiled face down cards to the opponent (like with morph). But exiled face down cards are pretty rare anyway (Bottled Cloister, Colfenor's Plans, Duplicity etc.)

EDIT: I just noticed, the only card we have that should use exiled face down cards is Necropotence.

Re: Rev 4410: Initial code for AF_ChangeZone

PostPosted: 20 Dec 2010, 15:06
by friarsol
zerker2000 wrote:I'd say add it, since I don't think we have many "exile face-down" cards at the moment.
I've gone to a lot of effort fixing cards that worked incorrectly and getting infrastructure in place that would streamline cards so they can be correct. I don't like the idea of adding cards because they are "close enough." Is this singleton card really in that high of a demand?

Re: Rev 4410: Initial code for AF_ChangeZone

PostPosted: 20 Dec 2010, 15:28
by Sloth
friarsol wrote:I've gone to a lot of effort fixing cards that worked incorrectly and getting infrastructure in place that would streamline cards so they can be correct. I don't like the idea of adding cards because they are "close enough." Is this singleton card really in that high of a demand?
Pull from Eternity can be added with ValidTgt$ Card.faceUp and it will be fine now (besides with Necropotence) and work correct in the future.

Re: Rev 4410: Initial code for AF_ChangeZone

PostPosted: 26 Dec 2010, 06:41
by slapshot5
What about abilities where Origin$ and Destination$ are both library? This would be for cards like Congregation at Dawn . The shuffle happens after the cards are placed in Destination. Which screws up top of library. Can this be made so that the shuffle happens before the cards are placed in the destination?

-slapshot5

Re: Rev 4410: Initial code for AF_ChangeZone

PostPosted: 29 Dec 2010, 02:30
by Chris H.
slapshot5 wrote:What about abilities where Origin$ and Destination$ are both library? This would be for cards like Congregation at Dawn . The shuffle happens after the cards are placed in Destination. Which screws up top of library. Can this be made so that the shuffle happens before the cards are placed in the destination?
`
slapshot5 wrote:Does that work when ChangeNum > 1?
`
I took the liberty of moving my bug fix here so as not to overwhelm the users with too much java code.

I see the problem referred to in the second quote. I think that this minor mod will address the "ChangeNum > 1" problem:

Code: Select all
        for (int i=0; i < changeNum; i++) {
            if (fetchList.size() == 0 || destination == null)
                break;
               
            Object o = AllZone.Display.getChoiceOptional("Select a card", fetchList.toArray());
           
            if (o != null) {
                origZone.remove(o);
                Card c = (Card) o;
                fetchList.remove(c);

                if (destination.equals("Library")) {
                    // this needs to be zero indexed. Top = 0, Third = 2
                    int libraryPos = params.containsKey("LibraryPosition") ? Integer.parseInt(params.get("LibraryPosition")) : 0;
                    // do not shuffle the library once we have placed a fetched card on top.
                    if (origin.equals("Library") && i < 1) {
                        player.shuffle();
                    }
                    destZone.add(c, libraryPos);
                }
                else {
                    destZone.add(c);
                    if (destination.equals("Battlefield") && params.containsKey("Tapped"))
                        c.tap();
                }
            }
        }
       
        if (origin.equals("Library") && !destination.equals("Library"))
            player.shuffle();

Re: Rev 4410: Initial code for AF_ChangeZone

PostPosted: 29 Dec 2010, 06:09
by slapshot5
Looks to me like it works. Thanks Chris.

-slapshot5

Re: Rev 4410: Initial code for AF_ChangeZone

PostPosted: 30 Dec 2010, 06:11
by friarsol
Good stuff Chris. I figured there had to be a few things that weren't accounted for when I was creating those functions, but didn't really have enough time to test them more thoroughly.

Re: Rev 4410: Initial code for AF_ChangeZone

PostPosted: 30 Dec 2010, 13:35
by Chris H.
Thank you Slapshot5 and Sol. Yeah, one more missing piece to the AbilityFactory jigsaw puzzle added.