[WIP] Split Cards Support
Post MTG Forge Related Programming Questions Here
	Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
Re: [WIP] Split Cards Support
 by friarsol » 06 Mar 2013, 13:17
by friarsol » 06 Mar 2013, 13:17 
That doesn't make any sense. If DeckEditor and Overlay could use the exact same code it shouldn't be inside CardDetialPanel, it should be inside either Card or maybe CardUtils.Max mtg wrote:do never write such code:It's the component's responsibility to display such odd cards like split ones. The Card MUST NOT take card of everyone who could use it
- Code: Select all
* Display for the field <code>manaCost</code>.
* </p>
*
* @return a {@link java.lang.String} object.
*/
public final String getManaDisplay() {
// If this is a split card, display mana as X / Y. Otherwise, Display it as normal
if (this.getRules() != null && this.getRules().getSplitType() == CardSplitType.Split) {
return String.format("%s / %s", this.getState(CardCharacteristicName.LeftSplit).getManaCost(),
this.getState(CardCharacteristicName.RightSplit).getManaCost());
}
return this.getCharacteristics().getManaCost().toString();
}
/**
* <p>
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: [WIP] Split Cards Support
 by Agetian » 06 Mar 2013, 13:50
by Agetian » 06 Mar 2013, 13:50 
Umm seems fine to me in the latest SVN at the moment of this writing (r20138)... :\ Does it happen to all split cards or just to some particular ones for you?swordshine wrote:It seems split cards in the stack show a golden color, not the correct color the side should be.
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
 by swordshine » 06 Mar 2013, 14:00
by swordshine » 06 Mar 2013, 14:00 
The actual color is correct(for example, Fire can be countered by Blue Elemental Blast, but Ice cannot), but you see it shows a golden color in the stack.Agetian wrote:Umm seems fine to me in the latest SVN at the moment of this writing (r20138)... :\ Does it happen to all split cards or just to some particular ones for you?swordshine wrote:It seems split cards in the stack show a golden color, not the correct color the side should be.
Edit: this proble was found when I cast them using Dev mode "Add card to play".
Last edited by swordshine on 06 Mar 2013, 14:16, edited 1 time in total.
					
				
			
		- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: [WIP] Split Cards Support
 by Agetian » 06 Mar 2013, 14:04
by Agetian » 06 Mar 2013, 14:04 
Hmmmm that's strange, for me Fire shows up as red (both on stack and in the card detail box when you hover the mouse over the stack element) and Ice shows up as blue... :\
- Agetian
			
		- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
 by swordshine » 06 Mar 2013, 14:21
by swordshine » 06 Mar 2013, 14:21 
I found this issue when I use dev mode "add card to play", also other weird things happened when I tested Order//Chaos. When I cast it from hand, everything is OK, but use "add card to play", and choose Chaos, the effect does not add static abilities to the effect token in the command zone. Quite strange.. I'm testing cards with play effect to see if this problem occurs.Agetian wrote:Hmmmm that's strange, for me Fire shows up as red (both on stack and in the card detail box when you hover the mouse over the stack element) and Ice shows up as blue... :\
- Agetian
Here is the script of Order//Chaos:
- Order//Chaos | Open
- Name:Order
 ManaCost:3 W
 AlternateMode: Split
 Types:Instant
 A:SP$ ChangeZone | Cost$ 3 W | ValidTgts$ Creature.attacking | TgtPrompt$ Select target attacking creature | Origin$ Battlefield | Destination$ Exile | SpellDescription$ Exile target attacking creature.
 SVar:Picture:http://www.wizards.com/global/images/magic/general/order_chaos.jpg
 SetInfo:APC Uncommon
 SetInfo:HOP Uncommon
 Oracle:Exile target attacking creature.
 ALTERNATE
 Name:Chaos
 ManaCost:2 R
 Types:Instant
 A:SP$ Effect | Cost$ 2 R | Name$ Chaos Effect | StaticAbilities$ KWPump | AILogic$ Evasion | SpellDescription$ Creatures can't block this turn.
 SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature | AddHiddenKeyword$ CARDNAME can't block. | Description$ Creatures can't block this turn.
 SVar:RemAIDeck:True
 Oracle:Creatures can't block this turn.
 End
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: [WIP] Split Cards Support
 by Max mtg » 06 Mar 2013, 14:23
by Max mtg » 06 Mar 2013, 14:23 
That does make sense. Deckeditor and overlay use ManaCost instances, which get iterated as shards and output as pictures (via different code paths by the way)friarsol wrote:That doesn't make any sense. If DeckEditor and Overlay could use the exact same code it shouldn't be inside CardDetialPanel, it should be inside either Card or maybe CardUtils.
What you done is converted both costs to a string, so that a consuming class will have to split it by slash, parse each manacost and draw it as symbols. Don't you find that string conversions are a bit excess?
I see you are concerned about display of manacost for split cards. Ok, let me do it in:
1. Deck editor (card table)
2. CardDetailPanel
3. Overlay for cards in hand
Single class for single responsibility.
		- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: [WIP] Split Cards Support
 by swordshine » 06 Mar 2013, 14:31
by swordshine » 06 Mar 2013, 14:31 
OK, another issue: the ultimate of Jace, Architect of Thought cannot find any split cards in the library.
			
		- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: [WIP] Split Cards Support
 by Agetian » 06 Mar 2013, 14:36
by Agetian » 06 Mar 2013, 14:36 
@ swordshine: (r20140) I fixed the card color not showing up properly when using the Add Card To Play mode. Not sure if this could have also fixed the other oddity you reported with Order // Chaos, I'll play with the script you submitted right now, will see what I can do.  EDIT: Apparently the Order // Chaos command zone token also shows up correctly now when the card is cast via the Add Card To Play mode (if I understand the nature of the issue correctly).
 EDIT: Apparently the Order // Chaos command zone token also shows up correctly now when the card is cast via the Add Card To Play mode (if I understand the nature of the issue correctly).
- Agetian
			
				 EDIT: Apparently the Order // Chaos command zone token also shows up correctly now when the card is cast via the Add Card To Play mode (if I understand the nature of the issue correctly).
 EDIT: Apparently the Order // Chaos command zone token also shows up correctly now when the card is cast via the Add Card To Play mode (if I understand the nature of the issue correctly).- Agetian
Last edited by Agetian on 06 Mar 2013, 14:41, edited 1 time in total.
					
				
			
		- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
 by Agetian » 06 Mar 2013, 14:37
by Agetian » 06 Mar 2013, 14:37 
@ Everyone: Would be very glad if someone can assist with fixing this bug...swordshine wrote:OK, another issue: the ultimate of Jace, Architect of Thought cannot find any split cards in the library.
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
 by Chris H. » 06 Mar 2013, 14:41
by Chris H. » 06 Mar 2013, 14:41 
Seven of the new split cards will download their pics while the four list below are having some sort of a problem.
Skipped Download for: res/preferences/../pics/deadgone.jpg
Skipped Download for: res/preferences/../pics/puresimple.jpg
Skipped Download for: res/preferences/../pics/supplydemand.jpg
Skipped Download for: res/preferences/../pics/trialerror.jpg
			
		Skipped Download for: res/preferences/../pics/deadgone.jpg
Skipped Download for: res/preferences/../pics/puresimple.jpg
Skipped Download for: res/preferences/../pics/supplydemand.jpg
Skipped Download for: res/preferences/../pics/trialerror.jpg
- 
				 
 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: [WIP] Split Cards Support
 by swordshine » 06 Mar 2013, 14:47
by swordshine » 06 Mar 2013, 14:47 
It seems these cards should use urls like "http://www.wizards.com/global/images/magic/general/deadgone.jpg" but not "http://www.wizards.com/global/images/magic/general/dead_gone.jpg"Chris H. wrote:Seven of the new split cards will download their pics while the four list below are having some sort of a problem.
Skipped Download for: res/preferences/../pics/deadgone.jpg
Skipped Download for: res/preferences/../pics/puresimple.jpg
Skipped Download for: res/preferences/../pics/supplydemand.jpg
Skipped Download for: res/preferences/../pics/trialerror.jpg
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: [WIP] Split Cards Support
 by Sloth » 06 Mar 2013, 15:06
by Sloth » 06 Mar 2013, 15:06 
I put Fire // Ice into my library via Brainstorm and it was found by Jace, Architect of Thought (and i could play it from exile just fine).Agetian wrote:@ Everyone: Would be very glad if someone can assist with fixing this bug...swordshine wrote:OK, another issue: the ultimate of Jace, Architect of Thought cannot find any split cards in the library.
EDIT: Same when i directly start with it in the library. What did you test swordshine?
- 
				 
 Sloth
- Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: [WIP] Split Cards Support
 by Max mtg » 06 Mar 2013, 15:15
by Max mtg » 06 Mar 2013, 15:15 
Cost display in deckeditor has been upgraded in r20143
-
			
				-
Last edited by Max mtg on 06 Mar 2013, 15:19, edited 1 time in total.
					
				
			Single class for single responsibility.
		- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: [WIP] Split Cards Support
 by Chris H. » 06 Mar 2013, 15:18
by Chris H. » 06 Mar 2013, 15:18 
swordshine wrote:It seems these cards should use urls like "http://www.wizards.com/global/images/magic/general/deadgone.jpg" but not "http://www.wizards.com/global/images/magic/general/dead_gone.jpg"
Thank you sword shine.
I just verified your suggestion and it appears to fix this problem, fixes are merged.
- 
				 
 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: [WIP] Split Cards Support
 by swordshine » 06 Mar 2013, 15:27
by swordshine » 06 Mar 2013, 15:27 
Sorry for that, it worked. But the first player Jace searched is not me(that's why I thought it didn't work). I think the order of resolving is from the activating player. Is that a bug?Sloth wrote:I put Fire // Ice into my library via Brainstorm and it was found by Jace, Architect of Thought (and i could play it from exile just fine).Agetian wrote:@ Everyone: Would be very glad if someone can assist with fixing this bug...swordshine wrote:OK, another issue: the ultimate of Jace, Architect of Thought cannot find any split cards in the library.
EDIT: Same when i directly start with it in the library. What did you test swordshine?
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Who is online
Users browsing this forum: No registered users and 26 guests
