It is currently 31 Oct 2025, 05:31
   
Text Size

[WIP] Split Cards Support

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

Re: [WIP] Split Cards Support

Postby friarsol » 06 Mar 2013, 13:17

Max mtg wrote:do never write such code:
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>
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
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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: [WIP] Split Cards Support

Postby Agetian » 06 Mar 2013, 13:50

swordshine wrote:It seems split cards in the stack show a golden color, not the correct color the side should be.
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?

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby swordshine » 06 Mar 2013, 14:00

Agetian wrote:
swordshine wrote:It seems split cards in the stack show a golden color, not the correct color the side should be.
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?
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.
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

Postby 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
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby swordshine » 06 Mar 2013, 14:21

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
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.
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

Postby Max mtg » 06 Mar 2013, 14:23

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.
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)

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

Postby 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

Postby 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).

- 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

Postby Agetian » 06 Mar 2013, 14:37

swordshine wrote:OK, another issue: the ultimate of Jace, Architect of Thought cannot find any split cards in the library.
@ Everyone: Would be very glad if someone can assist with fixing this bug...

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby 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
User avatar
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

Postby swordshine » 06 Mar 2013, 14:47

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
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"
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: [WIP] Split Cards Support

Postby Sloth » 06 Mar 2013, 15:06

Agetian wrote:
swordshine wrote:OK, another issue: the ultimate of Jace, Architect of Thought cannot find any split cards in the library.
@ Everyone: Would be very glad if someone can assist with fixing this bug...
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).

EDIT: Same when i directly start with it in the library. What did you test swordshine?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: [WIP] Split Cards Support

Postby 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

Postby 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.
User avatar
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

Postby swordshine » 06 Mar 2013, 15:27

Sloth wrote:
Agetian wrote:
swordshine wrote:OK, another issue: the ultimate of Jace, Architect of Thought cannot find any split cards in the library.
@ Everyone: Would be very glad if someone can assist with fixing this bug...
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).

EDIT: Same when i directly start with it in the library. What did you test swordshine?
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?
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 26 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 26 users online :: 0 registered, 0 hidden and 26 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 26 guests

Login Form