It is currently 18 Jul 2025, 21:10
   
Text Size

Card Contributions

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

Re: Card Contributions

Postby muppet » 25 Feb 2015, 12:00

yes the graveyard parts all work not actually needed groovy yet but I guess that's how I have to get the mana to work. I'll actually read some documentation now I know a bit more what I'm doing.

Also I found getting a sane (non notepad/wordpad) text editor was a good plan as suggested earlier in thread.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: Card Contributions

Postby PalladiaMors » 26 Feb 2015, 18:06

Couple cards that didn't get pushed through Firemind:

Code: Select all
name=Wall of Roots
image=http://mtgimage.com/card/wall%20of%20roots.jpg
value=2.500
rarity=C
type=Creature
subtype=Plant,Wall
cost={1}{G}
pt=0/5
ability=Defender;\
        Put a -0/-1 counter on SN: Add {G} to your mana pool. Activate this ability only once each turn.
timing=main
oracle=Defender. Put a -0/-1 counter on Wall of Roots: Add {G} to your mana pool. Activate this ability only once each turn.
Code: Select all
name=Abzan Kin-Guard
image=http://mtgimage.com/card/abzan%20kin-guard.jpg
value=2.500
rarity=U
type=Creature
subtype=Human,Warrior
cost={3}{G}
pt=3/3
ability=SN has lifelink as long as you control a white permanent.;\
        SN has lifelink as long as you control a black permanent.
timing=main
oracle=Abzan Kin-Guard has lifelink as long as you control a white or black permanent.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby muppet » 02 Mar 2015, 14:05

Time to try another wildly optimistic making a card Ashcloud Phoenix.

Ok as usual that seems to be too optimistic I got 2/3 working ok and I got return it to owners hand not battlefield working separately but if I try to add that as 3RD option it fails so its probably beyond me as usual. One day I'll get a card to work completely :-).
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: Card Contributions

Postby ShawnieBoy » 02 Mar 2015, 22:55

muppet wrote:Time to try another wildly optimistic making a card Ashcloud Phoenix.

Ok as usual that seems to be too optimistic I got 2/3 working ok and I got return it to owners hand not battlefield working separately but if I try to add that as 3RD option it fails so its probably beyond me as usual. One day I'll get a card to work completely :-).
I'm guessing you meant 'return to the battlefield face down instead of the graveyard'

Though I'm a bit rusty these days, this could be done with groovy although the timings involved would be tricky. It's not a replacement effect as it does hit the graveyard, and making sure it's face-down before the game notices too.
The turning face up trigger may (?) be purely scripted, but I'd have to check.

Showing what you've got so far would be helpful.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby muppet » 03 Mar 2015, 10:32

Sorry I'm just playing with cards really. Here is one I just don't understand so some light on this might help me make at least 1 card.

Zhur-Taa Druid. Ok so if I make it tap for green and deal one damage to me it works fine but as soon as I change to SN deals one damage to each opponent it fails even though this works on other cards.

So I am just confused.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: Card Contributions

Postby ShawnieBoy » 03 Mar 2015, 23:13

muppet wrote:Sorry I'm just playing with cards really. Here is one I just don't understand so some light on this might help me make at least 1 card.

Zhur-Taa Druid. Ok so if I make it tap for green and deal one damage to me it works fine but as soon as I change to SN deals one damage to each opponent it fails even though this works on other cards.

So I am just confused.
That's ok, the best way to learn is to experiment :)

There's no simple way of adding new mana producing effects (for your second option). The reason that the '{T}: Add {G} to your mana pool, SN deals 1 damage to you.' works is that it is hard-coded into the game engine as a separate ability. (Have a look at the List of Abilities on the wiki to see, the mana abilities are near the top, there's a 'Sacrifice SN: Add <mana> to your mana pool' further down)

That would explain why your other option didn't work.

As mana production is closely linked with the AI system, making abilities that can produce mana with a different activation than already included won't work, although they will parse ok. (The reason that the Wall of Roots above, hasn't been included, I would guess)

As for Zhur-Taa Druid, he's a bit more tricky again. His trigger isn't linked to his 'as text' mana ability. If he taps for mana from another ability (given to him by an Aura or other effect) the trigger will still activate. As yet, there's no clear way to check if a permanent has been tapped to produce mana to produce a trigger (Melvin may know different).

Sorry it's all bad news :(
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby Huggybaby » 04 Mar 2015, 03:34

Ha, you don't sound too rusty to me ShawnieBoy. Welcome back. 8)
User avatar
Huggybaby
Administrator
 
Posts: 3226
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 742 times
Been thanked: 601 times

Re: Card Contributions

Postby ShawnieBoy » 04 Mar 2015, 08:35

An area worth looking for new submissions would be instant and sorcery cards with multiple effects. Our current parser isn't good at noticing there's more than one, and so a simple tilde ~ will make the card work by linking them together.

Bear in mind that this will only work if the second effect doesn't have a target. I remember submitting a quick 'Bolster' instant when I first came back (Abzan Advantage), and expect there's others lurking in the latest block.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby muppet » 04 Mar 2015, 08:36

Ok that explains Deathrite Shaman too, I am guessing that to add pretty much anything worthwhile I have to learn to use the groovy code. Ahh ok will look at those too.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: Card Contributions

Postby ShawnieBoy » 04 Mar 2015, 08:54

muppet wrote:Ok that explains Deathrite Shaman too, I am guessing that to add pretty much anything worthwhile I have to learn to use the groovy code. Ahh ok will look at those too.
It's a bit of a known issue with the barrier to entry, while our natural language scripter was a great milestone for scripting cards automatically, it can make things more tricky to allow simple submissions.

The groovy code isn't quite as frightening as it looks (believe me, I was only submitting scripts before I even considered looking at groovy). There is some information on the wiki, but I really need to add some more (!!) to help make that first step.

Having a look at 'simple' cards with groovy and fiddling with them, or simply cutting and pasting relevant parts, can be a good first step. And if you're feeling more creative, don't limit yourself to trying existing cards, you can very easily create your own for testing.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby Lodici » 04 Mar 2015, 12:50

ShawnieBoy wrote:...It's a bit of a known issue with the barrier to entry, while our natural language scripter was a great milestone for scripting cards automatically, it can make things more tricky to allow simple submissions..
I have always thought that although very powerful, Groovy as-is is pretty difficult to learn if you just want to script cards. But the thing is that Groovy looks to be perfect for implementing a card scripting DSL so that instead of raw groovy a card scripter could use much simpler and intuitive syntax. Maybe something like the following examples...

Code: Select all
1. When Fanatic of Mogis enters the battlefield, it deals damage to each opponent equal to your devotion to red.
-> onEntersBattlefield.dealDamageEqualTo(your.devotionTo(MagicColor.RED)).toAllOf(your.opponents);

2. Buyback {3}. Fanning the Flames deals X damage to target creature or player.
-> .onBuyBack(3).dealDamageEqualToX().toOneOf(creature, player);

3. [Feral_Lightning] Put three 3/1 red Elemental creature tokens with haste onto the battlefield. Exile them at the beginning of the next end step.
-> .onPlayCard.put(3).tokens("3/1_red_Elemental_creature").withAbilities(MagicAbility.HASTE).to(MagicZone.BATTLEFIELD).then.on(NEXT_END_STEP).sendTo(MagicZone.EXILE)

At least, that's the idea anyway! ;) I look at it from time-to-time but it is slow going.
User avatar
Lodici
Programmer
 
Posts: 399
Joined: 13 Oct 2013, 09:44
Has thanked: 29 times
Been thanked: 71 times

Re: Card Contributions

Postby ShawnieBoy » 04 Mar 2015, 17:12

That looks like a cool idea, as long as it doesn't then get incorporated into the scriptbuilder and then pushes the barrier even higher!
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby PalladiaMors » 10 Mar 2015, 17:55

This is my clumsy attempt at Thoughtcast:

Code: Select all
def FOUR_OR_MORE_ARTIFACTS_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicType.Artifact) >= 4;
    }
};

def THREE_ARTIFACTS_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicType.Artifact) == 3;
    }
};

def TWO_ARTIFACTS_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicType.Artifact) == 2;
    }
};

def ONE_ARTIFACT_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicType.Artifact) == 1;
    }
};

[
     new MagicCardActivation(
        [FOUR_OR_MORE_ARTIFACTS_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "U"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [new MagicPayManaCostEvent(source,"{U}")];
        }
    },
     new MagicCardActivation(
        [THREE_ARTIFACTS_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "1U"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [new MagicPayManaCostEvent(source,"{1}{U}")];
        }
    },
     new MagicCardActivation(
        [TWO_ARTIFACTS_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "2U"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [new MagicPayManaCostEvent(source,"{2}{U}")];
        }
    },
     new MagicCardActivation(
        [ONE_ARTIFACT_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "3U"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [new MagicPayManaCostEvent(source,"{3}{U}")];
        }
    }
]
The problem here is that the player is getting to choose between the standard cost and the cost reduced by affinity, which shouldn't happen - he's forced to pay the later. In the Avatar cards (Avatar of Woe), Melvin managed to solve this problem for cards with two possible costs. I tried to do borrow that solution here, but didn't succeed. Is there a way to deal with this issue in this case? If not, would you guys be ok with doing affinity in this manner? From testing a little the AI doesn't pick the higher cost and I can't think of a reason for a human to take the higher cost either. I know it's definitely a bit clunky, so I'd like some directions here.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 10 Mar 2015, 18:35

PalladiaMors wrote:This is my clumsy attempt at Thoughtcast:

Code: Select all
def FOUR_OR_MORE_ARTIFACTS_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicType.Artifact) >= 4;
    }
};

def THREE_ARTIFACTS_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicType.Artifact) == 3;
    }
};

def TWO_ARTIFACTS_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicType.Artifact) == 2;
    }
};

def ONE_ARTIFACT_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicType.Artifact) == 1;
    }
};

[
     new MagicCardActivation(
        [FOUR_OR_MORE_ARTIFACTS_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "U"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [new MagicPayManaCostEvent(source,"{U}")];
        }
    },
     new MagicCardActivation(
        [THREE_ARTIFACTS_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "1U"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [new MagicPayManaCostEvent(source,"{1}{U}")];
        }
    },
     new MagicCardActivation(
        [TWO_ARTIFACTS_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "2U"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [new MagicPayManaCostEvent(source,"{2}{U}")];
        }
    },
     new MagicCardActivation(
        [ONE_ARTIFACT_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "3U"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [new MagicPayManaCostEvent(source,"{3}{U}")];
        }
    }
]
The problem here is that the player is getting to choose between the standard cost and the cost reduced by affinity, which shouldn't happen - he's forced to pay the later. In the Avatar cards (Avatar of Woe), Melvin managed to solve this problem for cards with two possible costs. I tried to do borrow that solution here, but didn't succeed. Is there a way to deal with this issue in this case? If not, would you guys be ok with doing affinity in this manner? From testing a little the AI doesn't pick the higher cost and I can't think of a reason for a human to take the higher cost either. I know it's definitely a bit clunky, so I'd like some directions here.
Hmm, looking at Avatar of Woe, it could be possible to string-build the cost. Off the top of my head:

Code: Select all
[
     new MagicCardActivation(
        [MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "Cast"
    ) {
        @Override
        public void change(final MagicCardDefinition cdef) {
            cdef.setCardAct(this);
        }

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            final MagicGame game = source.getGame();
            final int n = game.filterPermanents(source.getController(),MagicTargetFilterFactory.ARTIFACT_YOU_CONTROL).size();
            final int cost= Math.max(0,4-n)
            return cost==0 ?
                [new MagicPayManaCostEvent(source,"{U}")]:
                [new MagicPayManaCostEvent(source,"{"+cost.toString()+"}{U}")];
        }
    }
]
Affinity isn't optional.

Edit for real bad syntax.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby ShawnieBoy » 10 Mar 2015, 19:04

Good news is that it works :) Worth testing it with AI, should be ok if it can manage Avatar of Woe.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

PreviousNext

Return to Magarena

Who is online

Users browsing this forum: No registered users and 0 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 0 users online :: 0 registered, 0 hidden and 0 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 0 guests

Login Form