Page 114 of 141

Re: Card Development Questions

PostPosted: 15 Mar 2013, 22:10
by pufthemajicdragon
I found a workaround for my planeswalker pet trouble. I used the DoubleFaced keyword to bring it in as a different card type (currently a land) and then transform it later. Transforming it still requires me to manually add the starting loyalty counters, but that's not too bad. The whole thing opens up some fun play possibilities.

Trouble: When I transform my land into the planeswalker, the planeswalker doesn't have any card image. Is there any way to give it one, as it's a transformed token?

Re: Card Development Questions

PostPosted: 16 Mar 2013, 20:58
by Max mtg
Is Land Equilibrium scriptable?
I would love to remove the hardcode related to this card and the inlined Input instance it is using
Or would you script at least that ability destroying extra land, please?

No longer actual, I've written that ability script.

Re: Card Development Questions

PostPosted: 16 Mar 2013, 23:33
by Sloth
friarsol wrote:
Sloth wrote:Yes, it is a good idea to convert these effects to Static Ability (i never liked the current implementation). I'm a bit busy at the moment, but will try to tackle it after the next beta.
No rush, just bringing it up because I was glancing at the Attach code for something else and it was bothering me as well.
I've commited the change. It's mostly like it was before. Steal Enchantment on Control Magic still doesn't work, because continuous static abilities are handled in timestamp order and the dependency rules aren't there yet. - Sigh.

Re: Card Development Questions

PostPosted: 03 Apr 2013, 21:01
by Max mtg
Today Comet Storm was scripted.
The problem of simultaneous use of X and Multikicker is gone.

A similiar spell Strength of the Tajuru is now forgeable too.

Re: Card Development Questions

PostPosted: 05 Apr 2013, 09:36
by Max mtg
These cards require player to reveal a specific card to prevent them from ETB tapped.
Code: Select all
        else if (cardName.equals("Ancient Amphitheater") || cardName.equals("Auntie's Hovel")
                || cardName.equals("Gilt-Leaf Palace") || cardName.equals("Secluded Glen")
                || cardName.equals("Wanderwine Hub") || cardName.equals("Rustic Clachan")
                || cardName.equals("Murmuring Bosk") || cardName.equals("Primal Beyond")) {
Is there anything missing to script this ability with UnlessCost$ Reveal<1/type>?

Re: Card Development Questions

PostPosted: 05 Apr 2013, 12:26
by friarsol
Max mtg wrote:These cards require player to reveal a specific card to prevent them from ETB tapped.
Code: Select all
        else if (cardName.equals("Ancient Amphitheater") || cardName.equals("Auntie's Hovel")
                || cardName.equals("Gilt-Leaf Palace") || cardName.equals("Secluded Glen")
                || cardName.equals("Wanderwine Hub") || cardName.equals("Rustic Clachan")
                || cardName.equals("Murmuring Bosk") || cardName.equals("Primal Beyond")) {
Is there anything missing to script this ability with UnlessCost$ Reveal<1/type>?
Nope, I think it's pretty straightforward. It just needs to happen as an ETB replacement.

Re: Card Development Questions

PostPosted: 05 Apr 2013, 13:59
by swordshine
I love the changetargets effect. =D> Some widely used cards in constructed games are forgable. :mrgreen:
Some remaining issues about changetargets:
I cast Misdirection targeting Cancel on the stack, when Misdirection resolves, it cannot change target to Misdirection.
I tried to script Goblin Flectomancer, and found:
2/1/2006: If a spell has a variable number of targets (such as Electrolyze), the number of targets chosen can't be changed.
The changetargets effect can change the number of targets of Eletrolyze currently.

Re: Card Development Questions

PostPosted: 05 Apr 2013, 14:12
by friarsol
swordshine wrote:I love the changetargets effect. =D> Some widely used cards in constructed games are forgable. :mrgreen:
Some remaining issues about changetargets:
I cast Misdirection targeting Cancel on the stack, when Misdirection resolves, it cannot change target to Misdirection.
I tried to script Goblin Flectomancer, and found:
2/1/2006: If a spell has a variable number of targets (such as Electrolyze), the number of targets chosen can't be changed.
The changetargets effect can change the number of targets of Eletrolyze currently.
Yea, that's why I started off with the single target ones first. Definitely the simplest use case for ChangeTargets. I'll take a look at Misdirection. It's definitely still on the stack, so I'm not sure why it wouldn't see it as a target.

Re: Card Development Questions

PostPosted: 05 Apr 2013, 20:16
by Max mtg
Done, r20827, r20828 - there remains a task to teach AI how to decide on 'unless cost', and I'm sorry don't know how to do that.

Re: Card Development Questions

PostPosted: 12 Apr 2013, 12:20
by swordshine
I saw someone required Blaze of Glory, and I scripted it
Blaze of Glory | Open
Name:Blaze of Glory
ManaCost:W
Types:Instant
Text:Cast CARDNAME only during combat before blockers are declared.
A:SP$ Pump | Cost$ W | ValidTgts$ Creature.DefenderCtrl | TgtPrompt$ Select target creature defending player controls | ActivationPhases$ BeginCombat->Declare Attackers - Play Instants and Abilities | ImprintCards$ Targeted | KW$ HIDDEN CARDNAME can block any number of creatures. | StackDescription$ {c:Targeted} can block any number of creatures this turn | SubAbility$ DBRepeatEach | SpellDescription$ Target creature defending player controls can block any number of creatures this turn. It blocks each attacking creature this turn if able.
SVar:DBRepeatEach:DB$ RepeatEach | RepeatCards$ Creature.attacking | RepeatSubAbility$ DBMustBlock | SubAbility$ DBCleanupImprint
SVar:DBMustBlock:DB$ MustBlock | DefinedAttacker$ Remembered | Defined$ Imprinted
SVar:DBCleanupImprint:DB$ Cleanup | ClearImprinted$ True
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/blaze_of_glory.jpg

It seems that AI could not do correct block here. I attacked with two Abattoir Ghoul and a Abbey Gargoyles, with Blaze of Glory targeting AI's Abbey Griffin, it only blocked Abbey Gargoyles.
I attacked with two Abattoir Ghoul and a Abbey Gargoyles again, targeting AI's Abbey Matron, and it blocked two Abattoir Ghouls correctly.
The third time I attacked with the three creature, and targeted one creature AI cast last turn, it only blocked one of my Abattoir Ghoul. :?

Re: Card Development Questions

PostPosted: 16 Apr 2013, 20:13
by Max mtg
Triggers and abilities now may check for alt cost used to play an ability.
This might have opened paths to script cards like Worldheart Phoenix

See revision 21038 for examples.
http://svn.slightlymagic.net/websvn/rev ... &peg=21038

Re: Card Development Questions

PostPosted: 17 Apr 2013, 04:02
by swordshine
Max mtg wrote:Triggers and abilities now may check for alt cost used to play an ability.
This might have opened paths to script cards like Worldheart Phoenix

See revision 21038 for examples.
http://svn.slightlymagic.net/websvn/rev ... &peg=21038
Worldheart Phoenix has an etb effect, the script would be a little complicated.
Edit: It would simplify the script to add an altcost condition in TriggerReplacementBase.

Re: Card Development Questions

PostPosted: 17 Apr 2013, 04:30
by Max mtg
swordshine wrote:Worldheart Phoenix has an etb effect, the script would be a little complicated.
Not really. Could use same clause as AEther Figmet uses
Code: Select all
K:etbCounter:P1P1:2:CheckSVar$ WasKicked:If CARDNAME was kicked, it enters the battlefield with two +1/+1 counters on it.
SVar:WasKicked:Count$Kicked.1.0
For Phoenix game should detemine if altCost was used - that is add a check similiar to one for Kicked but test condition would be
Code: Select all
c.isOptionalCostPaid(OptionalCost.AltCost)
in GameActionUtil in line 1560's area

Re: Card Development Questions

PostPosted: 21 Apr 2013, 19:35
by RedDeckWins
The Shaper Parasite morph trigger is broken.

From what I could debug, I found it was entering the first conditional (excerpted from SpellAbilityEffect) below, because tgt was not null. The desired behavior would be to return the defined player in ChooseGenericEffect.resolve() (line 44).

Code: Select all
 private List<Player> getTargetPlayers(SpellAbility sa, final boolean wantEmptyAsDefault, final boolean targetIsPreferred) {
            final Target tgt = sa.getTarget();
            final String defined = sa.getParam("Defined");
            if (tgt != null && (targetIsPreferred || (StringUtils.isEmpty(defined) && !wantEmptyAsDefault))) {
                return tgt.getTargetPlayers();
            }
            if (StringUtils.isEmpty(defined) && wantEmptyAsDefault) {
                return emptyPlayerList;
            }
            return AbilityUtils.getDefinedPlayers(sa.getSourceCard(), defined, sa);
        }
Honestly, I am still learning how this all works, but I looked at a bunch of other generic choice cards and noticed they were implemented as a SubAbility, so I took the same route here to fix the card. Here is my proposed fix. I am still too new to post links, but I can send a dropbox link to the patch if desired. I've pasted the patch contents below for now.

patch body:
Code: Select all
Index: res/cardsfolder/s/shaper_parasite.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>ISO-8859-1
===================================================================
--- res/cardsfolder/s/shaper_parasite.txt   (revision 21118)
+++ res/cardsfolder/s/shaper_parasite.txt   (revision )
@@ -3,8 +3,9 @@
 Types:Creature Illusion
 PT:2/3
 K:Morph:2 U
-T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ TrigChoice | TriggerZones$ Battlefield | TriggerDescription$ When CARDNAME is turned face up, target creature gets +2/-2 or -2/+2 until end of turn.
-SVar:TrigChoice:AB$ GenericChoice | ValidTgts$ Creature | TgtPrompt$ Select target creature | Cost$ 0 | Defined$ You | Choices$ TrigPump1,TrigPump2
+T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ PumpTrig | TriggerZones$ Battlefield | TriggerDescription$ When CARDNAME is turned face up, target creature gets +2/-2 or -2/+2 until end of turn.
+SVar:PumpTrig:AB$ Pump | ValidTgts$ Creature | TgtPrompt$ Select target creature | Cost$ 0 | SubAbility$ TrigChoice
+SVar:TrigChoice:DB$ GenericChoice | Defined$ You | Choices$ TrigPump1,TrigPump2
 SVar:TrigPump1:DB$Pump | Cost$ 0 | Defined$ Targeted | NumAtt$ +2 | NumDef$ -2 | IsCurse$ True | ChoiceDescription$ +2/-2
 SVar:TrigPump2:DB$Pump | Cost$ 0 | Defined$ Targeted | NumAtt$ -2 | NumDef$ +2 | IsCurse$ True | ChoiceDescription$ -2/+2
 SVar:RemAIDeck:True
\ No newline at end of file

Re: Card Development Questions

PostPosted: 21 Apr 2013, 21:01
by Sloth
RedDeckWins wrote:The Shaper Parasite morph trigger is broken.

From what I could debug, I found it was entering the first conditional (excerpted from SpellAbilityEffect) below, because tgt was not null. The desired behavior would be to return the defined player in ChooseGenericEffect.resolve() (line 44).
Yes, the Default parameter was ignored. Luckily we have a function that does it correctly. See r21119: http://svn.slightlymagic.net/websvn/log ... F&isdir=1&

Thanks for pointing it out RedDeckWins. I give green light for commit rights. Does anyone object?