Page 14 of 25

Re: Card Contributions

PostPosted: 01 Sep 2014, 12:24
by Lodici
Hold fire PalladiaMors. Your scripts are safely stored in the source control system at http://code.google.com/r/projectfiremin ... ource/list. No need to re-write.

Re: Card Contributions

PostPosted: 01 Sep 2014, 12:30
by mike
Yeah, sorry about the downtime yesterday. Some servers crashed and I had to restore some VMs from backup. The Database was unaffected though so no data was lost there. But since the server who does the pushing of the scripts to the google code repo was down I had to restart those jobs manually today. Which is why they don't appear in the order they were submitted.

Edit:
For future reference. There is a public status page at https://www.firemind.ch/status
which can be used to check if a script has been submitted properly.

Re: Card Contributions

PostPosted: 01 Sep 2014, 13:32
by PalladiaMors
Thanks for the quick reply, guys! Also, don't worry, Mike, I've been using Firemind all the time and this is the first time anything out of the ordinary happened. Plus everything seems to have worked out perfectly after all. Taking advantage of you showing up here, I'd like to ask if you're considering updating Firemind to 1.53 when you have time? 673 new cards is quite significant, and there's stuff in there that's going to see a lot of play! Blood Moon, Maze of Ith, Stroke of Genius, Aetherling in Standard...

Re: Card Contributions

PostPosted: 01 Sep 2014, 14:31
by mike
Already on it ;)

The worker is already running on 1.53 and the cards/decks should get enabled later today.

Re: Card Contributions

PostPosted: 01 Sep 2014, 16:52
by PalladiaMors
I was trying to do some cards that require exiling cards from the top of your library as part of the activation cost, such as Royal Herbalist or Whirling Catapult (bit of an effort to raise Alliances' %). The cards load alright but then crash later during play, the crash log points at the cost part of the script as the reason. I was adding both the remove and the move actions, too. Did I make some kind of mistake or did I stumble upon something that can't be done yet?

Re: Card Contributions

PostPosted: 01 Sep 2014, 17:52
by ShawnieBoy
PalladiaMors wrote:I was trying to do some cards that require exiling cards from the top of your library as part of the activation cost, such as Royal Herbalist or Whirling Catapult (bit of an effort to raise Alliances' %). The cards load alright but then crash later during play, the crash log points at the cost part of the script as the reason. I was adding both the remove and the move actions, too. Did I make some kind of mistake or did I stumble upon something that can't be done yet?
Do you have any code? ;)

Re: Card Contributions

PostPosted: 01 Sep 2014, 18:47
by PalladiaMors
Whirling Catapult

Code: Select all
[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Removal),
        "Damage"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
      new MagicPayManaCostEvent(source,"{2}"),
      new MagicRemoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary),
             new MagicMoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary,MagicLocationType.Exile),
             new MagicRemoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary),
             new MagicMoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary,MagicLocationType.Exile)
      ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
      this,
                "SN deals 1 damage to each creature and player."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int amount = 1;
            final Collection<MagicPermanent> targets=
                game.filterPermanents(event.getPlayer(),MagicTargetFilterFactory.CREATURE_WITHOUT_FLYING);
            for (final MagicPermanent target : targets) {
                final MagicDamage damage=new MagicDamage(event.getSource(),target,amount);
                game.doAction(new MagicDealDamageAction(damage));
            }
            for (final MagicPlayer player : game.getAPNAP()) {
                final MagicDamage damage=new MagicDamage(event.getSource(),player,amount);
                game.doAction(new MagicDealDamageAction(damage));
            }
        }
    }
]
I studied this a bit more an am now pretty much convinced that it won't work, everything that goes in the costs is always "events", I can't find anything at all with "action". Crashes as soon as I get the card into play, crash log: "Exception from controller.runGame: magic.model.action.MagicRemoveCardAction cannot be cast to magic.model.event.MagicEvent
java.lang.ClassCastException: magic.model.action.MagicRemoveCardAction cannot be cast to magic.model.event.MagicEvent"

Don't worry about this, it's just me trying to learn a bit more #-o

Re: Card Contributions

PostPosted: 03 Sep 2014, 22:41
by ShawnieBoy
PalladiaMors wrote:Whirling Catapult

Code: Select all
[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Removal),
        "Damage"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
      new MagicPayManaCostEvent(source,"{2}"),
      new MagicRemoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary),
             new MagicMoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary,MagicLocationType.Exile),
             new MagicRemoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary),
             new MagicMoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary,MagicLocationType.Exile)
      ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
      this,
                "SN deals 1 damage to each creature and player."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int amount = 1;
            final Collection<MagicPermanent> targets=
                game.filterPermanents(event.getPlayer(),MagicTargetFilterFactory.CREATURE_WITHOUT_FLYING);
            for (final MagicPermanent target : targets) {
                final MagicDamage damage=new MagicDamage(event.getSource(),target,amount);
                game.doAction(new MagicDealDamageAction(damage));
            }
            for (final MagicPlayer player : game.getAPNAP()) {
                final MagicDamage damage=new MagicDamage(event.getSource(),player,amount);
                game.doAction(new MagicDealDamageAction(damage));
            }
        }
    }
]
I studied this a bit more an am now pretty much convinced that it won't work, everything that goes in the costs is always "events", I can't find anything at all with "action". Crashes as soon as I get the card into play, crash log: "Exception from controller.runGame: magic.model.action.MagicRemoveCardAction cannot be cast to magic.model.event.MagicEvent
java.lang.ClassCastException: magic.model.action.MagicRemoveCardAction cannot be cast to magic.model.event.MagicEvent"

Don't worry about this, it's just me trying to learn a bit more #-o
Always good to test the boundaries ;) Yes, all costs are events, or event-actions. I'll have a look at an exile-mill-self cost-event.

Re: Card Contributions

PostPosted: 04 Sep 2014, 01:43
by ShawnieBoy
Exiling from the top of your library as a cost is now enabled in scripts. Let me know if you find any issues with it.

In groovy its a MagicExileTopLibraryEvent(source,player,int), omit the player if it's for self, int is the amount.

May need to be eagle-eyed: I've had a look at the exile top of library cards, some are a cost, some are part of the effect.

Re: Card Contributions

PostPosted: 04 Sep 2014, 01:53
by PalladiaMors
By the way, I wanted to ask about the cycling triggers, since I couldn't find them on the wiki's list. My guess would be WhenCyclesTrigger and WhenOtherCyclesTrigger? I haven't tried those yet but there are some cards that look simple enough even for me if I can get that part right (i.e. Onslaught block staples Astral Slide and Gempalm Incinerator).

Re: Card Contributions

PostPosted: 04 Sep 2014, 02:06
by ShawnieBoy
Ahh yes, lots of new things to put on/take off that list - thanks for reminding me.

They are WhenCycleTrigger and WhenOtherCycleTrigger

Blissfully small files :)

Re: Card Contributions

PostPosted: 04 Sep 2014, 14:54
by PalladiaMors
Wow, what a disappointment. All that work ended up netting just 3 cards, two of which are terrible. At least Arc-Slogger is a very popular card, but seems like I kind of lead you guys into a false path this time... Sorry about that.

Re: Card Contributions

PostPosted: 04 Sep 2014, 16:04
by ShawnieBoy
PalladiaMors wrote:Wow, what a disappointment. All that work ended up netting just 3 cards, two of which are terrible. At least Arc-Slogger is a very popular card, but seems like I kind of lead you guys into a false path this time... Sorry about that.
Oh, not at all - the exile top of library appears elsewhere, though not always as a cost. Crumbling Sanctuary, Chaos Harlequin, Primal Surge to name a few

Re: Card Contributions

PostPosted: 06 Sep 2014, 01:43
by PalladiaMors
I've submitted Flickerwisp with MagicTargetHint.Negative, but now noticed that's a massive error. Most of the time, the card seems to be used with your own permanents for enters/leaves battlefield combos.

Re: Card Contributions

PostPosted: 06 Sep 2014, 21:04
by ShawnieBoy
PalladiaMors wrote:I've submitted Flickerwisp with MagicTargetHint.Negative, but now noticed that's a massive error. Most of the time, the card seems to be used with your own permanents for enters/leaves battlefield combos.
The exile target picker only assumes it's targeting an opponent's permanent, so calculates values that way. Flicker type cards should really allow for resetting damage and etb tricks, but the vast majority use a negative picker. This is possibly for speeding up the AI.

Exile target picker also doesn't take into account any etb abilities, unlike the bounce target picker, which may be more appropriate in this case.