Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by swordshine » 04 Mar 2013, 07:25
The Hive Mind and pacts combo does not work right now, I tried to convert pact by using Effects, something like:
I've tested once, cast Pact of the Titan with Hive Mind on the battlefield, AI copied it and lost the game at his upkeep.
So shall I convert all the pacts or wait the bug fix of delayed trigger?
- Pact of the Titan | Open
- Name:Pact of the Titan
ManaCost:0
Types:Instant
Colors:red
A:SP$ Token | Cost$ 0| TokenAmount$ 1 | TokenName$ Giant | TokenTypes$ Creature,Giant | TokenOwner$ You | TokenColors$ Red | TokenPower$ 4 | TokenToughness$ 4 | SubAbility$ DBDelTrig | SpellDescription$ Put a 4/4 red Giant creature token onto the battlefield. At the beginning of your next upkeep, pay 4 R. If you don't, you lose the game.
SVar:DBDelTrig:DB$ Effect | Triggers$ UpkeepTrig | SVars$ TrigLoseGame,RemoveEffect | Duration$ Permanent
SVar:UpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigLoseGame | TriggerZones$ Command | TriggerDescription$ At the beginning of your next upkeep, pay 4 R. If you don't, you lose the game.
SVar:TrigLoseGame:AB$ LosesGame | Cost$ 0 | UnlessCost$ 4 R | UnlessPayer$ You | Defined$ You | SubAbility$ RemoveEffect
SVar:RemoveEffect:DB$ ChangeZone | Origin$ Command | Destination$ Exile | Defined$ Self
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/pact_of_the_titan.jpg
SetInfo:FUT|Rare|http://magiccards.info/scans/en/fut/103.jpg
Oracle:Pact of the Titan is red.\nPut a 4/4 red Giant creature token onto the battlefield.\nAt the beginning of your next upkeep, pay{R}. If you don't, you lose the game.
I've tested once, cast Pact of the Titan with Hive Mind on the battlefield, AI copied it and lost the game at his upkeep.
So shall I convert all the pacts or wait the bug fix of delayed trigger?
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by friarsol » 04 Mar 2013, 13:14
Looks good to me. I think I prefer having Effects represent delayed triggers just in case you forget about them.swordshine wrote:I've tested once, cast Pact of the Titan with Hive Mind on the battlefield, AI copied it and lost the game at his upkeep.
So shall I convert all the pacts or wait the bug fix of delayed trigger?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Sloth » 04 Mar 2013, 16:34
I fixed some weird bugs in copySpellontoStack, which fixed the interaction of Hive Mind and the Pacts.
That said, i've just tested Intervention Pact and seems to have other problems with Hive Mind (it doesn't get copied at all).
That said, i've just tested Intervention Pact and seems to have other problems with Hive Mind (it doesn't get copied at all).
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by pufthemajicdragon » 05 Mar 2013, 00:17
OK so I know this goes back a while but I haven't had a chance to install any IDE and play with the source myself. But I have done a little looking at it on the SVN web interface.pufthemajicdragon wrote:Here's the script, just because. But what I think I'll do is download the source and see if I can fix it myself, probably by adding pets to the battlefield later.
Correct me if I'm wrong, but if we move the line putCardsOnBattlefield(player, psc.getCardsOnBattlefield(player)); from the newGame method and put it down at the bottom of the actuateGame method (in the GameNew class), that might solve my problem of having a planeswalker pet starting the game with no loyalty counters.
Please keep in mind I haven't been able to really look closely at anything, especially all of the references behind putCardsOnBattlefield. I'm actually assuming from context that that is the call to populate the battlefield with pets/starting cards.
Yes, no, maybe?
- pufthemajicdragon
- Posts: 23
- Joined: 08 Jan 2013, 04:17
- Has thanked: 7 times
- Been thanked: 2 times
Re: Card Development Questions
by friarsol » 05 Mar 2013, 03:02
Leaving this here for now:
- Cycle of Life | Open
- Name:Cycle of Life
ManaCost:1 G G
Types:Enchantment
A:AB$ Animate | Cost$ Return<1/CARDNAME> | ValidTgts$ Creature.ThisTurnCast | TgtPrompt$ Select target creature you cast this turn | Power$ 0 | Toughness$ 1 | RememberTargets$ True | UntilYourNextUpkeep$ True | SubAbility$ DelTrig | SpellDescription$ Target creature you cast this turn becomes 0/1 until your next upkeep. At the beginning of your next upkeep, put a +1/+1 counter on that creature.
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigAddCounter | TriggerDescription$ At the beginning of your next upkeep, put a +1/+1 counter on that creature.
SVar:TrigAddCounter:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 1 | Defined$ Remembered
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/cycle_of_life.jpg
Oracle:Return Cycle of Life to its owner's hand: Target creature you cast this turn becomes 0/1 until your next upkeep. At the beginning of your next upkeep, put a +1/+1 counter on that creature.
SetInfo:MIR Rare
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by friarsol » 09 Mar 2013, 04:03
I'm not sure who added it, but while looking for something that might be appropriate for Balance I came across this in xCount
This xCount choice is already covered, so I'll be getting rid of it. For whoever was using it in the recent past, please use:
SVar:RemCount:Remembered$Amount
not
SVar:RemCount:Count$RememberedSize.
If you need to do other calculations with the Remembered list, you can use the Remembered$ shortcut. It's very handy.
- RememberedSize | Open
- if (l[0].startsWith("RememberedSize")) {
return CardFactoryUtil.doXMath(c.getRemembered().size(), m, c);
}
This xCount choice is already covered, so I'll be getting rid of it. For whoever was using it in the recent past, please use:
SVar:RemCount:Remembered$Amount
not
SVar:RemCount:Count$RememberedSize.
If you need to do other calculations with the Remembered list, you can use the Remembered$ shortcut. It's very handy.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by swordshine » 09 Mar 2013, 04:22
IIRC, "Remembered$Amount" does not work when removed counters are remembered.friarsol wrote:I'm not sure who added it, but while looking for something that might be appropriate for Balance I came across this in xCount
- RememberedSize | Open
- if (l[0].startsWith("RememberedSize")) {
return CardFactoryUtil.doXMath(c.getRemembered().size(), m, c);
}
This xCount choice is already covered, so I'll be getting rid of it. For whoever was using it in the recent past, please use:
SVar:RemCount:Remembered$Amount
not
SVar:RemCount:Count$RememberedSize.
If you need to do other calculations with the Remembered list, you can use the Remembered$ shortcut. It's very handy.
Edit: just checked, "Amount" is from objectXCount, obviously not compatible with remembered counters. I think this change should be reverted.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by moomarc » 09 Mar 2013, 04:52
As swordshine said, its meant to be used only for remembered counters. I think Remembered in calculateAmount passes a card list and that's where the issue comes in. It might have been changed at some point to pass a list of objects to objectXCount in which case it might work.
-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 friarsol » 09 Mar 2013, 05:21
Hmm alright. The name is too similar for me. And it looks like it's doing the same thing that Remembered$Amount would do, hence the confusion.swordshine wrote:IIRC, "Remembered$Amount" does not work when removed counters are remembered.
Edit: just checked, "Amount" is from objectXCount, obviously not compatible with remembered counters. I think this change should be reverted.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by swordshine » 09 Mar 2013, 07:16
I'm considering to add cards widely used in constructed games, e.g. Chain of Vapor, Chain Lightning, basic script is:
The remaining issue is AI logic. AI will always pay the cost even when there is no legal target on the battlefield.
- Chain of Vapor | Open
- Name:Chain of Vapor
ManaCost:U
Types:Instant
A:SP$ ChangeZone | Cost$ U | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent | Origin$ Battlefield | Destination$ Hand | SubAbility$ DBCopy | SpellDescription$ Return target nonland permanent to its owner's hand. Then that permanent's controller may sacrifice a land. If the player does, he or she may copy this spell and may choose a new target for that copy.
SVar:DBCopy:DB$ Play | Defined$ Self | Controller$ TargetedController | WithoutManaCost$ True | CopyCard$ True | UnlessPayer$ TargetedController | UnlessCost$ Sac<1/Land> | UnlessSwitched$ True
SVar:Picture:http://www.wizards.com/global/images/magic/general/chain_of_vapor.jpg
The remaining issue is AI logic. AI will always pay the cost even when there is no legal target on the battlefield.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by swordshine » 09 Mar 2013, 08:08
Chain lightning:
It works in 1.3.9, and in current version I encounter an input issue. When I targeted myself, the "pay mana cost: R R" did not show up, then I clicked the mana pool, it showed up but I couldn't click "Cancel" button to cancel it.
- Chain Lightning | Open
- Name:Chain Lightning
ManaCost:R
Types:Sorcery
A:SP$ DealDamage | Cost$ R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 3 | SubAbility$ DBCopy1 | SpellDescription$ CARDNAME deals 3 damage to target creature or player. Then that player or that creature's controller may pay R R. If the player does, he or she may copy this spell and may choose a new target for that copy.
SVar:DBCopy1:DB$ Play | Defined$ Self | Controller$ TargetedController | WithoutManaCost$ True | CopyCard$ True | UnlessPayer$ TargetedController | UnlessCost$ R R | UnlessSwitched$ True | ConditionDefined$ Targeted | ConditionPresent$ Creature | ConditionCompare$ GE1 | SubAbility$ DBCopy2
SVar:DBCopy2:DB$ Play | Defined$ Self | Controller$ Targeted | WithoutManaCost$ True | CopyCard$ True | UnlessPayer$ Targeted | UnlessCost$ R R | UnlessSwitched$ True | ConditionDefined$ Targeted | ConditionPresent$ Creature | ConditionCompare$ EQ0
SVar:Picture:http://www.wizards.com/global/images/magic/general/chain_lightning.jpg
It works in 1.3.9, and in current version I encounter an input issue. When I targeted myself, the "pay mana cost: R R" did not show up, then I clicked the mana pool, it showed up but I couldn't click "Cancel" button to cancel it.

- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by friarsol » 10 Mar 2013, 03:00
Sloth,
How much work would it be to change Control changing cards like Control Magic to a Static Ability (either Continuous or its own, whichever would be more useful)? I remember someone on the forums saying that casting Steal Enchantment on a Control Magic didn't cause the creature to switch controllers as it should, and changing this ability to static would probably do that.
Obviously not as important as resolving issues before the next release, but it'd be nice to iron that out.
How much work would it be to change Control changing cards like Control Magic to a Static Ability (either Continuous or its own, whichever would be more useful)? I remember someone on the forums saying that casting Steal Enchantment on a Control Magic didn't cause the creature to switch controllers as it should, and changing this ability to static would probably do that.
Obviously not as important as resolving issues before the next release, but it'd be nice to iron that out.
- 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 » 10 Mar 2013, 17:44
Guess after r20224 that reverts the method of switching input, the spell will become functional again.swordshine wrote:Chain lightning:
It works in 1.3.9, and in current version I encounter an input issue. When I targeted myself, the "pay mana cost: R R" did not show up, then I clicked the mana pool, it showed up but I couldn't click "Cancel" button to cancel it.
My experiment with threads has failed... for now.
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 » 10 Mar 2013, 19:42
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.friarsol wrote:Sloth,
How much work would it be to change Control changing cards like Control Magic to a Static Ability (either Continuous or its own, whichever would be more useful)? I remember someone on the forums saying that casting Steal Enchantment on a Control Magic didn't cause the creature to switch controllers as it should, and changing this ability to static would probably do that.
Obviously not as important as resolving issues before the next release, but it'd be nice to iron that out.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by friarsol » 11 Mar 2013, 03:13
No rush, just bringing it up because I was glancing at the Attach code for something else and it was bothering me as well.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.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Who is online
Users browsing this forum: No registered users and 14 guests