It is currently 18 Jul 2025, 22:14
   
Text Size

Adding new cards with Groovy

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

Re: Adding new cards with Groovy

Postby jerichopumpkin » 26 Feb 2014, 17:50

ShawnieBoy wrote:As the UI buttons can accept the mana symbols - maybe a symbol to represent payment of life. So Birthing Pod would have hints of: [ {G} :Search] [ {2Life} :Search] - Omitting the {1}, {T} and 'Sacrifice a creature' as they appear on both?
That seems a really good idea. What about using a grayed Phyrexian Mana symbol to represent {2Life}?

And it is possible to set the mana cost as text for the choices in the alternate cost options? This way we could represent the alternate cost (or costs) more accurately.
jerichopumpkin
 
Posts: 212
Joined: 12 Sep 2013, 11:21
Has thanked: 19 times
Been thanked: 13 times

Re: Adding new cards with Groovy

Postby melvin » 27 Feb 2014, 02:11

Using the cost : effect syntax might be confusing if we don't give the full cost. Suggest removing the colon, so {G}Search and ImageSearch

Not sure if using the black Phyrexian mana would be be confusing... but lose of life is associated with black so that may be fine. Or we could use the same symbol as that on the card, eg ImageSearch
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Adding new cards with Groovy

Postby ShawnieBoy » 27 Feb 2014, 03:19

I think a separate icon entirely to represent loss of life would be better - Phyrexian mana of the same color could work, but could be confusing as Phyrexian mana itself represents a choice.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Adding new cards with Groovy

Postby melvin » 27 Feb 2014, 03:26

Agree, a new icon that represent lose of 2 life would be even better
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Adding new cards with Groovy

Postby ShawnieBoy » 28 Feb 2014, 13:47

Just had a thought - this way of implementing Phyrexian mana will also work for colorless hybrid (Although with far more alt costs!) Flame Javelin, Beseech the Queen etc.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Adding new cards with Groovy

Postby melvin » 01 Mar 2014, 01:01

ShawnieBoy wrote:Just had a thought - this way of implementing Phyrexian mana will also work for colorless hybrid (Although with far more alt costs!) Flame Javelin, Beseech the Queen etc.
Yes, in a way. To ensure CMC is computed correctly, the cost in the card script should be the colorless one, then use the color property to indicate the card's color. The alternate costs would replace the colorless cost with colored ones.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Adding new cards with Groovy

Postby ShawnieBoy » 01 Mar 2014, 01:32

Wasn't there a CMC entry for card scripts? If so would that override the need to give it a purely colorless casting cost and go the opposite way, all colored first?
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Adding new cards with Groovy

Postby melvin » 01 Mar 2014, 01:58

There was, but it was removed in favor of getting it directly from the MagicManaCost object directly using getConvertedCost rather than tracking a separate number to reduce discrepancy between the two.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Adding new cards with Groovy

Postby ShawnieBoy » 01 Mar 2014, 02:07

I understand - Just trying to see ways of {2/R} etc being recognised as {2} for getConvertedCost - Giving the colorless hybrids a colourless mana cost means they appear in the card lists/deck editor as colorless spells in regards to mana symbols.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Adding new cards with Groovy

Postby melvin » 01 Mar 2014, 02:17

Good point, I didn't consider the deck list. Hmm, also in the hand the mana cost shown on the card would be completely colorless as well. This means for display to work correctly, we should put the colored cost for the cost property.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Adding new cards with Groovy

Postby melvin » 01 Mar 2014, 02:23

Going with your approach, we can modify MagicCostManaType to return converted cost of a single cost symbol, then use this value in MagicManaCost.addType to compute converted mana cost of the whole mana cost. i.e. instead of
Code: Select all
MagicManaCost:83 convertedArr[0] += amount;
change it to
Code: Select all
MagicManaCost:83 convertedArr[0] += amount * type.getConvertedCost();
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Adding new cards with Groovy

Postby ShawnieBoy » 01 Mar 2014, 02:26

Yeah, that sounds perfect!

The only thing that's missing, is that the choice buttons don't render mana symbols - would be useful to have the alt cost names as the mana payment options, eg. [ {R} {R} {R} ] [ {2} {R} {R} ] [ {4} {R} ] [ {6} ]

And also then having the default name for alt cost as the casting cost :D That would also work for the Phyrexian mana as they are identified as the base color.


edit: sry, can't stop editing this post
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Adding new cards with Groovy

Postby ShawnieBoy » 01 Mar 2014, 03:26

Just had a freakout looking at Reaper King - possibly the biggest script ever? Can the choice window have a scroll-bar? lol
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Adding new cards with Groovy

Postby ShawnieBoy » 01 Mar 2014, 04:50

Image

Code: Select all
name=Reaper King
url=http://magiccards.info/shm/en/260.html
image=http://mtgimage.com/card/reaper%20king.jpg
value=4.162
rarity=R
type=Legendary,Artifact,Creature
subtype=Scarecrow
cost={2/W}{2/U}{2/B}{2/R}{2/G}
pt=6/6
ability=alt cost {2}{W}{U}{B}{R} named {2}{W}{U}{B}{R};\
        alt cost {2}{U}{B}{R}{G} named {2}{U}{B}{R}{G};\
        alt cost {2}{B}{R}{G}{W} named {2}{B}{R}{G}{W};\
        alt cost {2}{R}{G}{W}{U} named {2}{R}{G}{W}{U};\
        alt cost {2}{G}{W}{U}{B} named {2}{G}{W}{U}{B};\
        alt cost {4}{W}{U}{B} named {4}{W}{U}{B};\
        alt cost {4}{W}{B}{R} named {4}{W}{B}{R};\
        alt cost {4}{W}{B}{G} named {4}{W}{B}{G};\
        alt cost {4}{U}{B}{R} named {4}{U}{B}{R};\
        alt cost {4}{U}{R}{G} named {4}{U}{R}{G};\
        alt cost {4}{B}{R}{G} named {4}{B}{R}{G};\
        alt cost {4}{R}{G}{W} named {4}{R}{G}{W};\
        alt cost {4}{R}{W}{U} named {4}{R}{W}{U};\
        alt cost {4}{G}{W}{U} named {4}{G}{W}{U};\
        alt cost {4}{G}{U}{B} named {4}{G}{U}{B};\
        alt cost {6}{W}{U} named {6}{W}{U};\
        alt cost {6}{W}{B} named [6}{W}{B};\
        alt cost {6}{U}{B} named {6}{U}{B};\
        alt cost {6}{U}{R} named {6}{U}{R};\
        alt cost {6}{B}{R} named {6}{B}{R};\
        alt cost {6}{B}{G} named {6}{B}{G};\
        alt cost {6}{W}{R} named {6}{R}{W};\
        alt cost {6}{R}{G} named {6}{R}{G};\
        alt cost {6}{G}{W} named {6}{G}{W};\
        alt cost {6}{G}{U} named {6}{G}{U};\
        alt cost {8}{W} named {8}{W};\
        alt cost {8}{U} named {8}{U};\
        alt cost {8}{B} named {8}{B};\
        alt cost {8}{R} named {8}{R};\
        alt cost {8}{G} named {8}{G};\
        alt cost {10} named {10};\
        lord other Scarecrow creatures you control get +1/+1
timing=main
requires_groovy_code
Code: Select all
[
    new MagicWhenOtherComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
            return (otherPermanent != permanent &&
                    otherPermanent.isCreature() &&
                    otherPermanent.isFriend(permanent) &&
                    otherPermanent.hasSubType(MagicSubType.Scarecrow)) ?
                new MagicEvent(
                    permanent,
                    MagicTargetChoice.NEG_TARGET_PERMANENT,
                    MagicDestroyTargetPicker.Destroy,
                    this,
                    "Destroy target permanent\$."
                ) :
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPermanent(game, {
                final MagicPermanent permanent ->
                game.doAction(new MagicDestroyAction(permanent));
            });
        }
    }
]
I just couldn't resist - There's a UI challenge for you right there Lodici ;)

This is fairly unplayable due to the amount of alternate costs, unless you cast as {W} {U} {B} {R} {G}
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Adding new cards with Groovy

Postby Lodici » 01 Mar 2014, 05:24

ShawnieBoy wrote:I just couldn't resist - There's a UI challenge for you right there Lodici ;)

This is fairly unplayable due to the amount of alternate costs, unless you cast as {W} {U} {B} {R} {G}
If you could setup a test scenario with this card in Hand then I will take a look.
User avatar
Lodici
Programmer
 
Posts: 399
Joined: 13 Oct 2013, 09:44
Has thanked: 29 times
Been thanked: 71 times

PreviousNext

Return to Magarena

Who is online

Users browsing this forum: No registered users and 4 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 4 guests

Login Form