It is currently 26 Apr 2024, 08:36
   
Text Size

Card Contributions

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

Re: Card Contributions

Postby Lodici » 01 Sep 2014, 12:24

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.
User avatar
Lodici
Programmer
 
Posts: 399
Joined: 13 Oct 2013, 09:44
Has thanked: 29 times
Been thanked: 71 times

Re: Card Contributions

Postby mike » 01 Sep 2014, 12:30

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.
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: Card Contributions

Postby PalladiaMors » 01 Sep 2014, 13:32

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...
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby mike » 01 Sep 2014, 14:31

Already on it ;)

The worker is already running on 1.53 and the cards/decks should get enabled later today.
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: Card Contributions

Postby PalladiaMors » 01 Sep 2014, 16:52

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?
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 01 Sep 2014, 17:52

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? ;)
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 » 01 Sep 2014, 18:47

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
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 03 Sep 2014, 22:41

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.
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 » 04 Sep 2014, 01:43

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.
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 » 04 Sep 2014, 01:53

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).
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 04 Sep 2014, 02:06

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 :)
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 » 04 Sep 2014, 14:54

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.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 04 Sep 2014, 16:04

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
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 » 06 Sep 2014, 01:43

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.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 06 Sep 2014, 21:04

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


Who is online

In total there are 34 users online :: 0 registered, 0 hidden and 34 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 34 guests

Login Form