It is currently 12 Sep 2025, 16:58
   
Text Size

Avacyn Restored Spoilers

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Avacyn Restored Spoilers

Postby friarsol » 03 Apr 2012, 00:40

Hey folks,

Looks like it's the beginning of spoiler season again.

https://fbcdn-sphotos-a.akamaihd.net/hp ... 7884_n.jpg

Branching for the set worked really well last time, so I think we should stick with that.

I've reset the claimed page, http://www.slightlymagic.net/wiki/Forge_Upcoming but everyone was pretty civil last time around. So just stick with that.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Avacyn Restored Spoilers

Postby moomarc » 03 Apr 2012, 01:47

friarsol wrote:Hey folks,

Looks like it's the beginning of spoiler season again.

https://fbcdn-sphotos-a.akamaihd.net/hp ... 7884_n.jpg

Branching for the set worked really well last time, so I think we should stick with that.

I've reset the claimed page, http://www.slightlymagic.net/wiki/Forge_Upcoming but everyone was pretty civil last time around. So just stick with that.
Thanks Sol. Miss Avacyn is pretty impressive, but she give you the impression there's going to be a fair amount of mass exile in the set (or just normal targeted exile I guess)
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Avacyn Restored Spoilers

Postby moomarc » 04 Apr 2012, 17:16

Nobody else took up the offer, so without further ado, here's Avacyn, Angel of Hope
Avacyn, Angel of Hope | Open
Name:Avacyn, Angel of Hope
ManaCost:5 W W W
Types:Legendary Creature Angel
Text:no text
PT:8/8
K:Flying
K:Vigilance
K:Indestructible
S:Mode$ Continuous | Affected$ Permanent.Other+YouCtrl | AddHiddenKeyword$ HIDDEN Indestructible | Description$ CARDNAME and other permanents you control are indestructible.
SVar:Rarity:Mythic
SVar:Picture:http://resources.wizards.com/global/images/magic/general/avacyn_angel_of_hope.jpg
End

Has a branch been started for the new scripts yet?

Edit: Oops, spelled her name wrong in the script. Fixed.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Avacyn Restored Spoilers

Postby friarsol » 07 Apr 2012, 21:03

They are announcing a bunch of spoils today at Pax East. A new mechanic is Soulbond, here's an example of how it works.

Silverblade Paladin - 1WW, 2/2, Soulbond (You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired as long as you control both of them). As long as Silverblade Paladin is paired with another creature, both creatures have double strike.

Also Miracle is a new mechanic:

Thunderous Wrath - 4RR, Instant, Thunderous Wrath deals 5 damage to target creature or player. Miracle R (You may cast this card for its Miracle cost when you draw it if it's the first card you drew this turn)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Avacyn Restored Spoilers

Postby friarsol » 07 Apr 2012, 21:50

I just Branched /res/cardsfolder into branches/AvacynRestoredCards for people who want to check in cards, now that we have a handful more.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Avacyn Restored Spoilers

Postby jeffwadsworth » 07 Apr 2012, 23:10

Soulbond is how that horrific mechanic Banding should have been done.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Avacyn Restored Spoilers

Postby ZzzzSleep » 09 Apr 2012, 06:48

New cards time!
Yay!

Demonic Taskmaster | Open
Code: Select all
Name:Demonic Taskmaster
ManaCost:2 B
Types:Creature Demon
Text:no text
PT:4/3
K:Flying
K:Trample
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ At the beginning of your upkeep, sacrifice a creature other than CARDNAME.
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ You | SacValid$ Creature.Other
SVar:RemRandomDeck:True
SVar:Rarity:Uncommon
End
Griselbrand | Open
Code: Select all
Name:Griselbrand
ManaCost:4 B B B B
Types:Legendary Creature Demon
Text:no text
PT:7/7
K:Flying
K:Lifelink
A:AB$ Draw | Cost$ PayLife<7> | NumCards$ 7 | SpellDescription$ Draw seven cards.
SVar:Rarity:Mythic
End
I'm still trying to work out some kinks in Cloudshift, so I won't include it here just yet. If somebody could add these two to source control, I'd appreciate it.

ZzzzSleep.
ZzzzSleep
 
Posts: 182
Joined: 29 Oct 2010, 02:19
Has thanked: 18 times
Been thanked: 18 times

Re: Avacyn Restored Spoilers

Postby moomarc » 09 Apr 2012, 14:20

Here's Restoration Angel and the fixed script for Cloudshift:
Cloudshift | Open
Code: Select all
Name:Cloudshift
ManaCost:W
Types:Instant
Text:no text
A:SP$ ChangeZone | Cost$ W | ValidTgts$ Creature.YouCtrl | Origin$ Battlefield | Destination$ Exile | TgtPrompt$ Select target creature you control | SubAbility$ DBReturn | SpellDescription$ Exile target creature you control, then return that card to the battlefield under your control.
SVar:DBReturn:DB$ChangeZone | Defined$ Targeted | Origin$ Exile | Destination$ Battlefield | GainControl$ True
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/cloudshift.jpg
End
Restoration Angel | Open
Code: Select all
Name:Restoration Angel
ManaCost:3 W
Types:Creature Angel
Text:no text
PT:3/4
K:Flash
K:Flying
T:Mode$ ChangesZone | ValidCard$ Creature.Self | Origin$ Any | Destination$ Battlefield | Execute$ RestorationExile | TriggerDescription$ When CARDNAME enters the battlefield, you may exile target non-Angel creature you control, then return that creature to the battlefield under your control.
SVar:RestorationExile:DB$ChangeZone | ValidTgts$ Creature.nonAngel+YouCtrl | Mandatory$ True | TgtPrompt$ Select target non-Angel creature you control | Origin$ Battlefield | Destination$ Exile | SubAbility$ RestorationReturn
SVar:RestorationReturn:DB$ChangeZone | Defined$ Targeted | Origin$ Exile | Destination$ Battlefield | GainControl$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/restoration_angel.jpg
End
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Avacyn Restored Spoilers

Postby moomarc » 09 Apr 2012, 20:34

Here's Banishing Stroke and a patch to enable the Miracle keyword:
Banishing Stroke | Open
Code: Select all
Name:Banishing Stroke
ManaCost:5 W
Types:Instant
Text:no text
K:Miracle:W
A:SP$ ChangeZone | Cost$ 5 W | ValidTgts$ Artifact,Creature,Enchantment | IsCurse$ True | TgtPrompt$ Select target artifact, creature or enchantment  | Origin$ Battlefield | Destination$ Library | LibraryPosition$ -1 | SpellDescription$ Put target artifact, creature or enchantment on the bottom of its owner's library.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/banishing_stroke.jpg
End
Miracle Patch | Open
Code: Select all
### Eclipse Workspace Patch 1.0
#P Forge
Index: src/main/java/forge/card/cardfactory/CardFactoryUtil.java
===================================================================
--- src/main/java/forge/card/cardfactory/CardFactoryUtil.java   (revision 15107)
+++ src/main/java/forge/card/cardfactory/CardFactoryUtil.java   (working copy)
@@ -5103,6 +5103,19 @@
             }
         } // madness
 
+        if (CardFactoryUtil.hasKeyword(card, "Miracle") != -1) {
+            final int n = CardFactoryUtil.hasKeyword(card, "Miracle");
+            if (n != -1) {
+                final String parse = card.getKeyword().get(n).toString();
+                // card.removeIntrinsicKeyword(parse);
+
+                final String[] k = parse.split(":");
+
+                card.setMiracle(true);
+                card.setMiracleCost(k[1]);
+            }
+        } // miracle
+
         if (CardFactoryUtil.hasKeyword(card, "Devour") != -1) {
             final int n = CardFactoryUtil.hasKeyword(card, "Devour");
             if (n != -1) {
Index: src/main/java/forge/GameAction.java
===================================================================
--- src/main/java/forge/GameAction.java   (revision 15107)
+++ src/main/java/forge/GameAction.java   (working copy)
@@ -698,6 +698,60 @@
 
     /**
      * <p>
+     * drawMiracle.
+     * </p>
+     *
+     * @param c
+     *            a {@link forge.Card} object.
+     */
+    public final void drawMiracle(final Card c) {
+        // Whenever a card with miracle is the first card drawn in a turn,
+        // you may cast it for it's miracle cost
+        if (!c.hasMiracle()) {
+            return;
+        }
+
+        final Card miracle = c;
+        final Ability cast = new Ability(miracle, miracle.getMiracleCost()) {
+            @Override
+            public void resolve() {
+                GameAction.this.playCardNoCost(miracle);
+                System.out.println("Miracle cost paid");
+            }
+        };
+
+        final StringBuilder sb = new StringBuilder();
+        sb.append(miracle.getName()).append(" - Cast via Miracle");
+        cast.setStackDescription(sb.toString());
+
+        final Ability activate = new Ability(miracle, "0") {
+            @Override
+            public void resolve() {
+                // pay miracle cost here.
+                if (miracle.getOwner().isHuman()) {
+                    if (GameActionUtil.showYesNoDialog(miracle, miracle + " - Drawn. Pay Miracle Cost?")) {
+                        if (cast.getManaCost().equals("0")) {
+                            AllZone.getStack().add(cast);
+                        } else {
+                            AllZone.getInputControl().setInput(new InputPayManaCost(cast));
+                        }
+                    }
+                } else {
+                    // computer will ALWAYS pay a miracle cost if he has the mana.
+                    ComputerUtil.playStack(cast);
+                }
+            }
+        };
+
+        final StringBuilder sbAct = new StringBuilder();
+        sbAct.append(miracle.getName()).append(" - Drawn. Pay Miracle Cost?");
+        activate.setStackDescription(sbAct.toString());
+
+        AllZone.getStack().add(activate);
+    }
+
+    /**
+     * <p>
      * discardPutIntoPlayInstead.
      * </p>
      *
Index: src/main/java/forge/Card.java
===================================================================
--- src/main/java/forge/Card.java   (revision 15107)
+++ src/main/java/forge/Card.java   (working copy)
@@ -144,6 +144,7 @@
     private boolean unearthed;
 
     private boolean madness = false;
+    private boolean miracle = false;
     private boolean suspendCast = false;
     private boolean suspend = false;
 
@@ -194,6 +195,7 @@
     private String text = "";
     private String echoCost = "";
     private String madnessCost = "";
+    private String miracleCost = "";
     private String chosenType = "";
     // private String chosenColor = "";
     private ArrayList<String> chosenColor = new ArrayList<String>();
@@ -5868,6 +5870,52 @@
 
     /**
      * <p>
+     * hasMiracle.
+     * </p>
+     *
+     * @return a boolean.
+     */
+    public final boolean hasMiracle() {
+        return this.miracle;
+    }
+
+    /**
+     * <p>
+     * Setter for the field <code>miracle</code>.
+     * </p>
+     *
+     * @param b
+     *            a boolean.
+     */
+    public final void setMiracle(final boolean b) {
+        this.miracle = b;
+    }
+
+    /**
+     * <p>
+     * Getter for the field <code>miracleCost</code>.
+     * </p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public final String getMiracleCost() {
+        return this.miracleCost;
+    }
+
+    /**
+     * <p>
+     * Setter for the field <code>miracleCost</code>.
+     * </p>
+     *
+     * @param cost
+     *            a {@link java.lang.String} object.
+     */
+    public final void setMiracleCost(final String cost) {
+        this.miracleCost = cost;
+    }
+
+    /**
+     * <p>
      * hasSuspend.
      * </p>
      *
Index: src/main/java/forge/game/player/Player.java
===================================================================
--- src/main/java/forge/game/player/Player.java   (revision 15107)
+++ src/main/java/forge/game/player/Player.java   (working copy)
@@ -1304,6 +1304,10 @@
             c.setDrawnThisTurn(true);
             this.numDrawnThisTurn++;
 
+            if ((this.numDrawnThisTurn == 1) && (Singletons.getModel().getGameState().getPhaseHandler().getTurn() != 1)) {
+                Singletons.getModel().getGameAction().drawMiracle(c);
+            }
+
             // Run triggers
             final HashMap<String, Object> runParams = new HashMap<String, Object>();
             runParams.put("Card", c);
I've based Miracle on Madness, just a few small relevant changes. It works as it should, except that it won't trigger on the first turn because if it's drawn as the first card of your opening hand, the trigger goes to stack before the mulligan choice and you can't proceed with the game after finishing mulligans, possibly because you don't then get to choose whether you want to use the miracle ability or not. I'm not actually sure how it should interact in this situation, but either way it doesn't work at the moment. I'm pretty sure this is how the keyword has to be implemented so hopefully I've saved one of the devs a few minutes with this starting point. It just needs to have the first turn interaction finalised.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Avacyn Restored Spoilers

Postby friarsol » 09 Apr 2012, 20:56

moomarc wrote:I've based Miracle on Madness, just a few small relevant changes. It works as it should, except that it won't trigger on the first turn because if it's drawn as the first card of your opening hand, the trigger goes to stack before the mulligan choice and you can't proceed with the game after finishing mulligans, possibly because you don't then get to choose whether you want to use the miracle ability or not. I'm not actually sure how it should interact in this situation, but either way it doesn't work at the moment. I'm pretty sure this is how the keyword has to be implemented so hopefully I've saved one of the devs a few minutes with this starting point. It just needs to have the first turn interaction finalised.
Miracles don't trigger for your opening hand since this occurs during the "Start of the Game" and not during the first turn. "As you draw an instant or sorcery with miracle, if it's the first card you've drawn this turn..."

However, if you manage to draw a card in your first turn, you should be able to Miracle cost that draw, since you haven't drawn anything that turn.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Avacyn Restored Spoilers

Postby moomarc » 10 Apr 2012, 05:34

Thanks Sol. It should just be a case of checking whether the player has mulliganed if its the first turn. I should be able to find how to make it work then. Hopefully I'll get a chance today to finish this (and one or two pet art sets).
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Avacyn Restored Spoilers

Postby ZzzzSleep » 10 Apr 2012, 22:11

An easy one to code, it's Latch Seeker!
Latch Seeker | Open
Code: Select all
Name:Latch Seeker
ManaCost:1 U U
Types:Creature Spirit
Text:no text
PT:3/1
K:Unblockable
SVar:Rarity:Uncommon
End
ZzzzSleep
 
Posts: 182
Joined: 29 Oct 2010, 02:19
Has thanked: 18 times
Been thanked: 18 times

Re: Avacyn Restored Spoilers

Postby Iran » 11 Apr 2012, 19:33

Is very difficult to implement Soulbond mechanic in forge?
I think this mechanic is very interesting.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Avacyn Restored Spoilers

Postby moomarc » 11 Apr 2012, 21:52

Iran wrote:Is very difficult to implement Soulbond mechanic in forge?
I think this mechanic is very interesting.
I don't think it'll be too difficult, for the most part copying equip or enchant with a few extra checks and restrictions. The biggest holdback is that the main code developers are busy with work and family outside of Forge at the moment. Its out of my comfort zone, but I am doing what I can for Miracle (but there's just one last kink in it I'm trying to smooth out.)
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Avacyn Restored Spoilers

Postby moomarc » 12 Apr 2012, 11:21

@friarsol: What would be the correct way to make NumDrawnThisTurn only start counting once the game has begun, or how can I get the value of num drawn this turn only post-mulligans? My best try was this (Player.java; ll 1308):
Code: Select all
// Miracle draws
if (PhaseHandler.getGameBegins() == 1) {
    if (Singletons.getModel().getGameState().getPhaseHandler().getTurn() == 1) {
        if (this.numDrawnThisTurn - Singletons.getModel().getGameSummary().getPlayerRating(this.getName()).getOpeningHandSize() == 1) {
            Singletons.getModel().getGameAction().drawMiracle(c);
        }
    } else {
        if (this.numDrawnThisTurn == 1) {
            Singletons.getModel().getGameAction().drawMiracle(c);
        }
    }
}
It doesn't trigger the Miracle for the opening hand, but if you take a mulligan it triggers as it did before and you have to quit the match. I'd love to get this working as my birthday present to myself, but I just can't fix this final hurdle. I think that the second card of the mulliganed hand might be triggering because the math I've used would only discount the first card of the new hand before that card increases the value of cards drawn. But this means that GameBegins is being set to one regardless of whether a mulligan is taken or not. That means that it should be simplified to this (I think NewGame java takes care of resetting the draw count)
Code: Select all
// Miracle draws
if (PhaseHandler.getGameBegins() == 1) {
    if (this.numDrawnThisTurn == 1) {
        Singletons.getModel().getGameAction().drawMiracle(c);
    }
}
Last edited by moomarc on 12 Apr 2012, 11:35, edited 1 time in total.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 55 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 55 users online :: 0 registered, 0 hidden and 55 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 55 guests

Login Form