Rev 4410: Initial code for AF_ChangeZone
Post MTG Forge Related Programming Questions Here
	Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
			23 posts
			 • Page 2 of 2 • 1, 2
		
	
Re: Rev 4410: Initial code for AF_ChangeZone
 by Sloth » 20 Dec 2010, 13:28
by Sloth » 20 Dec 2010, 13:28 
Face-Down can already be checked by hasProperty() (for example creature.faceDown).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.
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.
- 
				 
 Sloth
- Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Rev 4410: Initial code for AF_ChangeZone
 by friarsol » 20 Dec 2010, 15:06
by friarsol » 20 Dec 2010, 15:06 
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?zerker2000 wrote:I'd say add it, since I don't think we have many "exile face-down" cards at the moment.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Rev 4410: Initial code for AF_ChangeZone
 by Sloth » 20 Dec 2010, 15:28
by Sloth » 20 Dec 2010, 15:28 
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.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?
- 
				 
 Sloth
- Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Rev 4410: Initial code for AF_ChangeZone
 by slapshot5 » 26 Dec 2010, 06:41
by slapshot5 » 26 Dec 2010, 06:41 
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
			
		-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Rev 4410: Initial code for AF_ChangeZone
 by Chris H. » 29 Dec 2010, 02:30
by Chris H. » 29 Dec 2010, 02:30 
`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();
- 
				 
 Chris H.
- Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Rev 4410: Initial code for AF_ChangeZone
 by slapshot5 » 29 Dec 2010, 06:09
by slapshot5 » 29 Dec 2010, 06:09 
Looks to me like it works.  Thanks Chris.
-slapshot5
			
		-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Rev 4410: Initial code for AF_ChangeZone
 by friarsol » 30 Dec 2010, 06:11
by friarsol » 30 Dec 2010, 06:11 
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.
			
		- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Rev 4410: Initial code for AF_ChangeZone
 by Chris H. » 30 Dec 2010, 13:35
by Chris H. » 30 Dec 2010, 13:35 
Thank you Slapshot5 and Sol. Yeah, one more missing piece to the AbilityFactory jigsaw puzzle added.
			
		- 
				 
 Chris H.
- Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
			23 posts
			 • Page 2 of 2 • 1, 2
		
	
Who is online
Users browsing this forum: No registered users and 21 guests
