implementation for threshold

6 views
Skip to first unread message

a. benedict balbuena

unread,
May 29, 2013, 12:20:21 PM5/29/13
to maga...@googlegroups.com
Anurid Barkripper English

Creature — Frog Beast 2/2, 1GG (3)

Threshold — Anurid Barkripper gets +2/+2 as long as seven or more cards are in your graveyard.



Can we implement this on groovy using the following (which I based on the groovy code for Lord of Extinction)?

[
    new MagicCDA() {
        @Override
        public void modPowerToughness(final MagicGame game,final MagicPlayer player,final MagicPowerToughness pt) {
            final int amount=game.getPlayer(0).getGraveyard().size();
             if (amount > 7) {
                pt.add(1,1);
            }
        }
    }
]


Melvin Zhang

unread,
May 29, 2013, 9:57:04 PM5/29/13
to maga...@googlegroups.com
It should be player.getGraveyard().size() as getPlayer(0) refers to the first player (typically the human player) and not the controller of the object.

It will be great if you can send in new cards in smaller batches as it can get rather hectic trying to integrate a lot of new cards when the release date draws near. Around 10 cards each time would be good, thanks for all the help in programming new cards.

Regards,
Melvin






--
You received this message because you are subscribed to the Google Groups "Magarena" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magarena+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

a. benedict balbuena

unread,
Jun 2, 2013, 3:39:41 AM6/2/13
to maga...@googlegroups.com
Ok. I'll break them up into smaller batches. Here's a batch of cards with the mechanic: "As long as you control a..."
asLongAsYouControl.zip

a. benedict balbuena

unread,
Jun 2, 2013, 3:46:58 AM6/2/13
to maga...@googlegroups.com
let me clarify, is it:

final int amount=game.player.getGraveyard().size();

or 

final int amount=player.getGraveyard().size();

I'm not really a programmer, so I apologize if this seems like a dumb question.





On Thursday, May 30, 2013 9:57:04 AM UTC+8, Melvin Zhang wrote:

Melvin Zhang

unread,
Jun 2, 2013, 9:38:42 PM6/2/13
to maga...@googlegroups.com
You can just try it out and see what happens :) Just put the new files in the scripts folder and create a deck with the new card. When you start the duel, the game will try to evaluate the scripts. 

> final int amount=game.player.getGraveyard().size();
Will result in an error and a crash as there is no player property of game. 

> final int amount=player.getGraveyard().size();
This is the correct one.

Regards,
Melvin
Reply all
Reply to author
Forward
0 new messages