It is currently 30 May 2025, 16:17
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

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

Re: Card Development Questions

Postby jeffwadsworth » 03 Nov 2011, 20:03

Sloth wrote:
jeffwadsworth wrote:Very true. Unfortunately, this card has issues with NPE's even with the first SP$ Counter if you do not pay the UnlessCost. I will leave it alone for now.
Well I did try to fix the NPE you posted. Is it still happening? If yes, this might be a more general problem.
My mistake. The first counter works now. The second triggered counter will still allow the spell to resolve if you cancel the unlesscost. I did not refresh the codebase after your NPE fix.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 04 Nov 2011, 16:50

Testing Overwhelming Instinct:

| Open
Name:Overwhelming Instinct
ManaCost:2 G
Types:Enchantment
Text:no text
T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Creature.YouCtrl+attacking | PresentCompare$ GE3 | Execute$ TrigDraw | TriggerDescription$ Whenever you attack with three or more creatures, draw a card.
SVar:TrigDraw:DB$ Draw | NumCards$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/overwhelming_instinct.jpg
End


Now, this will trigger continuously. Does anyone note a non-hack solution?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby Iran » 04 Nov 2011, 18:44

I think I see the AF choose color affects spells too.
Is possible to script Eight-and-a-Half-Tails now?


Thanks
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby Hellfish » 04 Nov 2011, 18:57

Changing the color of spells is not possible atm, I don't think.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Card Development Questions

Postby jeffwadsworth » 05 Nov 2011, 01:22

While fooling around with Mindmoil, I notice that the "put them back in any order" part is apparently not operational for AB ChangeZone, etc. Teferi's Puzzle Box suffers from this as well. Am I mistaken?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby friarsol » 05 Nov 2011, 01:33

jeffwadsworth wrote:While fooling around with Mindmoil, I notice that the "put them back in any order" part is apparently not operational for AB ChangeZone, etc. Teferi's Puzzle Box suffers from this as well. Am I mistaken?
That's probably true. But it looks like Mindmoil should look basically the same as the Puzzle Box.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby slapshot5 » 05 Nov 2011, 03:02

jeffwadsworth wrote:
slowe wrote:
friarsol wrote:Ah. Well ChosenX is right for the Variable. CMC (as well as power and toughness) just don't use variables in the right manner.

Code: Select all
            if (property.substring(z).equals("X")) {
                x = CardFactoryUtil.xCount(source, source.getSVar("X"));
            } else if (property.substring(z).equals("Y")) {
                x = CardFactoryUtil.xCount(source, source.getSVar("Y"));
            } else {
                x = Integer.parseInt(property.substring(z));
            }
I just worked through all of these Tezzeret scripting issues myself ... wish I'd checked here in the middle. Anyway, I used Hellfish's ValidCard-counters solution to fix the cmc/p/t comparison:
Code: Select all
else if (property.startsWith("power") ||
                property.startsWith("toughness") || property.startsWith("cmc")) {
            int x = 0;
            int y = 0;
            String rhs = "";

            if (property.startsWith("power")) {
                rhs = property.substring(7);
                y = getNetAttack();
            } else if (property.startsWith("toughness")) {
                rhs = property.substring(11);
                y = getNetDefense();
            } else if (property.startsWith("cmc")) {
                 rhs = property.substring(5);
                y = getCMC();
            }
            try {
                x = Integer.parseInt(rhs);
            } catch (NumberFormatException e) {
                x = CardFactoryUtil.xCount(source, source.getSVar(rhs));
            }

            if (!AllZoneUtil.compare(y, property, x)) {
                return false;
            }
With that, it's worked in the tests I did.
script | Open
Name:Tezzeret the Seeker
ManaCost:3 U U
Types:Planeswalker Tezzeret
Text:no text
Loyalty:4
A:AB$ Untap | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | ValidTgts$ Artifact | TgtPrompt$ Select target artifact | TargetMin$ 0 | TargetMax$ 2 | SpellDescription$ Untap up to two target artifacts.
A:AB$ ChangeZone | Cost$ SubCounter<X/LOYALTY> | Origin$ Library | Destination$ Battlefield | ChangeType$ Artifact.cmcLEChosenX | ChangeNum$ 1 | Shuffle$ True | Planeswalker$ True | SpellDescription$ Search your library for an artifact with converted mana cost X or less and put it onto the battlefield.
A:AB$ AnimateAll | Cost$ SubCounter<5/LOYALTY> | ValidCards$ Artifact.YouCtrl | Types$ Artifact,Creature | Power$ 5 | Toughness$ 5 | Planeswalker$ True | Ultimate$ True | SpellDescription$ Artifacts you control become 5/5 artifact creatures until end of turn.
#ChosenX SVar created by Cost payment
SVar:X:XChoice
SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/tezzeret_the_seeker.jpg
SetInfo:ALA|Mythic|http://magiccards.info/scans/en/ala/60.jpg
Oracle:[+1] Untap up to two target artifacts.\n-X: Search your library for an artifact card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library.\n[-5] Artifacts you control become 5/5 artifact creatures until end of turn.
End
Slowe, are you going to commit your code and script here?
Are we comfortable committing this code now? If all works out, I think this is a very worthwhile improvement. I'm happy to do the commit myself.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby friarsol » 05 Nov 2011, 03:15

slapshot5 wrote:Are we comfortable committing this code now? If all works out, I think this is a very worthwhile improvement. I'm happy to do the commit myself.

-slapshot5
Oh right, that's what happened to Tez. I'm all for adding these changes in for that part of xCount. There's no reason our variables should be limited to certain variable names.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Iran » 05 Nov 2011, 03:39

Are possible to script the cards Ixidron and Vesuvan Shapeshifter?
Is complicate to turn creatures in play face down?

I see a deck that use Ixidron and Vesuvan Shapeshifter

"A Blue Moon Rises" | Open
4 Breeding Pool
8 Forest
4 Hinterland Harbor
7 Island
23 lands

4 Gatstaf Shepherd
3 Ixidron
4 Mayor of Avabruck
3 Ulvenwald Mystics
4 Vesuvan Shapeshifter
4 Villagers of Estwald
22 creatures

3 Cackling Counterpart
3 Harrow
3 Moonmist
4 Ponder
2 Rite of Replication
15 other spells



Thanks
Last edited by Iran on 08 Nov 2011, 12:26, edited 1 time in total.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby slapshot5 » 05 Nov 2011, 04:27

friarsol wrote:
slapshot5 wrote:Are we comfortable committing this code now? If all works out, I think this is a very worthwhile improvement. I'm happy to do the commit myself.

-slapshot5
Oh right, that's what happened to Tez. I'm all for adding these changes in for that part of xCount. There's no reason our variables should be limited to certain variable names.
I've got Tez scripted up locally. I'll add this code, test it out and commit.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby slowe » 05 Nov 2011, 05:47

slapshot5 wrote:
jeffwadsworth wrote:
slowe wrote:[Tezz stuff]
Slowe, are you going to commit your code and script here?
Are we comfortable committing this code now? If all works out, I think this is a very worthwhile improvement. I'm happy to do the commit myself.

-slapshot5
Whoops, sorry about that. :oops:
I don't have commit privileges or a clean build, so I just wanted to get feedback that it was working and let someone else add it, which I wasn't at all clear about. Of course, then work picked back up and I disappeared.
I don't work much on Forge because I get sidetracked or busy too easily ... but I still get sucked in sometimes. :wink:
Thanks for committing.
slowe
 
Posts: 127
Joined: 05 Jan 2010, 14:04
Has thanked: 6 times
Been thanked: 10 times

Re: Card Development Questions

Postby jeffwadsworth » 05 Nov 2011, 21:06

Testing Crown of Convergence. Does anyone spot the issue with this part of the script?

| Open
S:Mode$ Continuous | Affected$ TopLibrary.SharesColorWith+Creature+YouCtrl | AddPower$ 1 | AddToughness$ 1 | TopCardOfLibraryIs$ Creature | Description$ As long as the top card of your library is a creature card, creatures you control that share a color with that card get +1/+1.


Now this works for something like ValidCards$, but has issues with Affected$.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby Iran » 07 Nov 2011, 19:03

I think that can have an AF_AddPhase in forge (cards like Aggravated Assault, Savage Beating, Hellkite Charger, Paradox Haze, etc... can be added to forge). :D

I think this must be hard to implement. Change the order of the phases. :(
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby jeffwadsworth » 07 Nov 2011, 21:03

Testing Cloud Cover. This fires even if the target of the spell or ability is a permanent you do not control.

| Open
Name:Cloud Cover
ManaCost:2 W U
Types:Enchantment
Text:no text
T:Mode$ BecomesTarget | TargetsValid$ Permanent.YouCtrl+Other | TriggerZones$ Battlefield | Execute$ TrigBounce | OptionalDecider$ You | TriggerDescription$ Whenever another permanent you control becomes the target of a spell or ability an opponent controls, you may return that permanent to its owner's hand.
SVar:TrigBounce:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand | Defined$ TriggeredTarget
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/cloud_cover.jpg
End


Does anyone see the issue?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby slowe » 08 Nov 2011, 03:58

jeffwadsworth wrote:Testing Cloud Cover. This fires even if the target of the spell or ability is a permanent you do not control.

| Open
Name:Cloud Cover
ManaCost:2 W U
Types:Enchantment
Text:no text
T:Mode$ BecomesTarget | TargetsValid$ Permanent.YouCtrl+Other | TriggerZones$ Battlefield | Execute$ TrigBounce | OptionalDecider$ You | TriggerDescription$ Whenever another permanent you control becomes the target of a spell or ability an opponent controls, you may return that permanent to its owner's hand.
SVar:TrigBounce:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand | Defined$ TriggeredTarget
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/cloud_cover.jpg
End


Does anyone see the issue?
That's strange ... I don't see anything wrong with it. It needs to be ValidTarget, not TargetsValid. I've done the same sort of thing plenty of times.
It does need a ValidSource$ parameter (SpellAbility.YouDontCtrl ?), though, because the card has that restriction.
slowe
 
Posts: 127
Joined: 05 Jan 2010, 14:04
Has thanked: 6 times
Been thanked: 10 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 9 guests


Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 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 9 guests

Login Form