Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by moomarc » 11 Jan 2014, 07:29
The count function you're looking for is SVar:X:Count$ValidExile Card where card can be any valid type string. You can check multiple zones with this function too by stringing zones together although I can't remember the exact syntax.
Edit: not in front of my PC and suddenly not certain of the syntax. It might have an underscore before the zone, so "Valid_Exile Card". Also, "TypeInExile Creature" with a space instead of point should work, but I think that method was deprecated recently.
Edit: not in front of my PC and suddenly not certain of the syntax. It might have an underscore before the zone, so "Valid_Exile Card". Also, "TypeInExile Creature" with a space instead of point should work, but I think that method was deprecated recently.
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by torridus » 11 Jan 2014, 07:59
This does the trick! Thank you.moomarc wrote:SVar:X:Count$ValidExile Card
Re: Card Development Questions
by Max mtg » 29 Jan 2014, 17:05
Which core type stands for a permanent, and which one does not?
- Code: Select all
Artifact(true),
Creature(true),
Enchantment(true),
Instant(false),
Land(true),
Plane(false),
Planeswalker(true),
Scheme(false),
Sorcery(false),
Tribal(false),
Vanguard(false),
Phenomenon(false);
public final boolean isPermanent;
private CoreType(final boolean permanent) {
isPermanent = permanent;
}
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by friarsol » 29 Jan 2014, 17:11
Yep that's all correct, although these are referred to in the rules as "Card Types" not "Core Types", there are also "Supertypes" (Basic, Legendary etc), and "Subtypes" (Human, Aura, etc)Max mtg wrote:Which core type stands for a permanent, and which one does not?Is this correct?
- Code: Select all
Artifact(true),
Creature(true),
Enchantment(true),
Instant(false),
Land(true),
Plane(false),
Planeswalker(true),
Scheme(false),
Sorcery(false),
Tribal(false),
Vanguard(false),
Phenomenon(false);
public final boolean isPermanent;
private CoreType(final boolean permanent) {
isPermanent = permanent;
}
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Max mtg » 29 Jan 2014, 17:18
Thanks for confirmation.friarsol wrote:Yep that's all correct, although these are referred to in the rules as "Card Types" not "Core Types", there are also "Supertypes" (Basic, Legendary etc), and "Subtypes" (Human, Aura, etc)
I cannot name the enum CardType because that would lead to name clash. There's already a class named CardType that includes SuperType, CoreType and subType (the latter is alist of strings, the two former ones are EnumSets)
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by Marek14 » 29 Jan 2014, 18:13
And of course, "Subtypes" themselves are divided according to which card type (or types) they belong to.friarsol wrote:Yep that's all correct, although these are referred to in the rules as "Card Types" not "Core Types", there are also "Supertypes" (Basic, Legendary etc), and "Subtypes" (Human, Aura, etc)Max mtg wrote:Which core type stands for a permanent, and which one does not?Is this correct?
- Code: Select all
Artifact(true),
Creature(true),
Enchantment(true),
Instant(false),
Land(true),
Plane(false),
Planeswalker(true),
Scheme(false),
Sorcery(false),
Tribal(false),
Vanguard(false),
Phenomenon(false);
public final boolean isPermanent;
private CoreType(final boolean permanent) {
isPermanent = permanent;
}
Re: Card Development Questions
by Max mtg » 04 Feb 2014, 12:51
Please confirm someone that chages from r24656 are correct in terms of game rules.
I was sure that Chains of Mephisto did need a harcode.
I was sure that Chains of Mephisto did need a harcode.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by Sloth » 04 Feb 2014, 13:20
I think the script looks fine. It's a normal replacement effect.Max mtg wrote:Please confirm someone that chages from r24656 are correct in terms of game rules.
I was sure that Chains of Mephisto did need a harcode.
Do you see any case where it doesn't work?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by swordshine » 04 Feb 2014, 13:57
It's a normal replacement effect.
Similar examples: You have four Blood Scriveners when you have no cards in hand and would draw a card, you will draw 5 cards and lose 4 life because each Blood Scrivener modifies the draw.
Similar examples: You have four Blood Scriveners when you have no cards in hand and would draw a card, you will draw 5 cards and lose 4 life because each Blood Scrivener modifies the draw.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by Max mtg » 04 Feb 2014, 14:05
Ok, it replaces "draw" with "discard, then draw" or "mill"
And that resulting draw in turn can be replaced by second Chains' static ability.
I'll test if the game does not enter an infinite loop here (i.e. first card won't replace draw caused by second card)
And that resulting draw in turn can be replaced by second Chains' static ability.
I'll test if the game does not enter an infinite loop here (i.e. first card won't replace draw caused by second card)
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by friarsol » 04 Feb 2014, 15:45
Once a replacement effect influences a single action, it shouldn't be able to influence that same action again. If that doesn't work in Forge, then having two Thought Reflection in play would cause an infinite loop too.Max mtg wrote:Ok, it replaces "draw" with "discard, then draw" or "mill"
And that resulting draw in turn can be replaced by second Chains' static ability.
I'll test if the game does not enter an infinite loop here (i.e. first card won't replace draw caused by second card)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Max mtg » 04 Feb 2014, 17:51
I don't know why, but it works properly 

Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by friarsol » 04 Feb 2014, 17:55
Lots of people working different levels of Magic on this softwareMax mtg wrote:I don't know why, but it works properly

- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Marek14 » 04 Feb 2014, 19:40
What happens in these esoteric examples?friarsol wrote:Once a replacement effect influences a single action, it shouldn't be able to influence that same action again. If that doesn't work in Forge, then having two Thought Reflection in play would cause an infinite loop too.Max mtg wrote:Ok, it replaces "draw" with "discard, then draw" or "mill"
And that resulting draw in turn can be replaced by second Chains' static ability.
I'll test if the game does not enter an infinite loop here (i.e. first card won't replace draw caused by second card)
1. Lightning Bolt to Swans of Bryn Argoll, one draw replaced by Words of War, damage dealt to the Swans.
(I believe that the damage should not be replaced since it's still counts as the original action.)
2. Words of Wilding used to replace regular turn draw, Zameck Guildmage activated, Doubling Season on battlefield.
(I think that you'll get one token with one +1/+1 counter since turn draw is not an effect.)
Who is online
Users browsing this forum: No registered users and 49 guests