Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by friarsol » 11 Feb 2013, 20:30
I'm not sure what you mean by this Unless isn't really an effect, it's more like a conditional of an effect.Max mtg wrote:What about making a separate api for unless? It gets more and more parameters
- 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 » 12 Feb 2013, 02:04
I mean A:SP$ Unless | PayCost$ 2 | Payer$ You | IfPaid$ SubAbTrue | Else$ SubAbFalse | AIHint$ ... |friarsol wrote:I'm not sure what you mean by this Unless isn't really an effect, it's more like a conditional of an effect.Max mtg wrote:What about making a separate api for unless? It gets more and more parameters
Charm is also more like a conditional (it's like switch operator in java), yet it has its own api. This 'unless' is like 'if' operator.
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 Rooger » 12 Feb 2013, 04:18
I assume you are talking about the skin, i will post in the skins thread the psd, thanks btwmoomarc wrote:Looks fantastic Rooger. Any chance you could send me the open photoshop file for the background so I can modify it for a 4:3 resolution?

I was looking for cards that do the same but couldn't find any, can you guide me on how to do it, i've read the forge's wiki but was unlucky to find the info to do itswordshine wrote:For Flickerform, remember the enchanted creature and all auras attached, then use an effect to trigger at the end step.

Re: Card Development Questions
by swordshine » 12 Feb 2013, 08:06
Obzedat uses such effect. This can be scripted by delayed trigger probably. Flickerform should remember the enchanted creature first, using "Pump | RememberObjects$ Enchanted ", then auras are "Aura.AttachedTo Creature.IsRemembered". Sounds trickyRooger wrote:I was looking for cards that do the same but couldn't find any, can you guide me on how to do it, i've read the forge's wiki but was unlucky to find the info to do itswordshine wrote:For Flickerform, remember the enchanted creature and all auras attached, then use an effect to trigger at the end step.

- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by swordshine » 12 Feb 2013, 09:14
I used storesvar and conditioncheck to script cards like Rhystic Syphon.Max mtg wrote:I mean A:SP$ Unless | PayCost$ 2 | Payer$ You | IfPaid$ SubAbTrue | Else$ SubAbFalse | AIHint$ ... |
Charm is also more like a conditional (it's like switch operator in java), yet it has its own api. This 'unless' is like 'if' operator.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by Rooger » 13 Feb 2013, 07:30
Yeah that sounds too complicated for a newbie like me i'll leave it to anyone more able ahah i almost had an heart attack when i saw the Obzedat code lol, i'm currently trying to code Spellshift but there are some things i'm failing to get. Here is the code i have so far:swordshine wrote:Obzedat uses such effect. This can be scripted by delayed trigger probably. Flickerform should remember the enchanted creature first, using "Pump | RememberObjects$ Enchanted ", then auras are "Aura.AttachedTo Creature.IsRemembered". Sounds trickyRooger wrote:I was looking for cards that do the same but couldn't find any, can you guide me on how to do it, i've read the forge's wiki but was unlucky to find the info to do itswordshine wrote:For Flickerform, remember the enchanted creature and all auras attached, then use an effect to trigger at the end step.
- Code: Select all
A:SP$ Counter | Cost$ 3 U | TargetType$ Spell | ValidTgts$ Instant,Sorcery | TgtPrompt$ Select target Instant or Sorcery Spell | SubAbility$ DBDig | SpellDescription$ Counter target instant or sorcery spell. Its controller reveals cards from the top of his or her library until he or she reveals an instant or sorcery card. That player may cast that card without paying its mana cost. Then he or she shuffles his or her library.
SVar:DBDig:DB$ DigUntil | Defined$ TargetedController | Valid$ Sorcery | ValidDescription$ sorcery | FoundDestination$ Battlefield | RevealedDestination$ Library | Shuffle$ True

Re: Card Development Questions
by swordshine » 13 Feb 2013, 15:40
I've completed the basic script of Flickerform, but it cannot work with Copy Enchantment. "10/1/2005: If the enchanted creature was also enchanted by Copy Enchantment, Copy Enchantment will come back onto the battlefield attached to that permanent. As Copy Enchantment returns to the battlefield, its controller may choose any enchantment on the battlefield for it to copy. It can't copy Flickerformor any other Aura returning to the battlefield at the same time. If it copies a non-Aura enchantment, it will become unattached from the permanent and remain on the battlefield." I'm not sure if it is a long-existed issue for Copy Enchantment.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by friarsol » 13 Feb 2013, 16:22
Potential Forgotten Ancient script:
1. Trigger on upkeep
2. Repeat as an option as long as Self has +1/+1 counters on it (AI should stop repeating if there aren't any creatures it wants to put counters on)
3. Choose a non-remembered creature and remember it (AI should only choose "useful" creatures he controls)
4. Choose a number (0 - Number of Counters on Ancient)
5. Move X counters from Ancient to Chosen creature
6. Clear ChosenCreature and ChosenNumber
7(After repeat finishes). Clear Remembered
Originally I was going to write a pseudo-script, but I'm not at my codebase, so it's harder for me to look up the exact APIs/parameters.
1. Trigger on upkeep
2. Repeat as an option as long as Self has +1/+1 counters on it (AI should stop repeating if there aren't any creatures it wants to put counters on)
3. Choose a non-remembered creature and remember it (AI should only choose "useful" creatures he controls)
4. Choose a number (0 - Number of Counters on Ancient)
5. Move X counters from Ancient to Chosen creature
6. Clear ChosenCreature and ChosenNumber
7(After repeat finishes). Clear Remembered
Originally I was going to write a pseudo-script, but I'm not at my codebase, so it's harder for me to look up the exact APIs/parameters.
- 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 » 14 Feb 2013, 14:16
Is Rite of Ruin scriptable using GenericChoice? Seems like six different orders. It might be a little complicated because sacrificing one type of cards must be done at the same time. "Sacrifice | Defined$ Each" cannot do this, should probably use choosecard, rememberchosem, and sacrificeall remembered.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by friarsol » 14 Feb 2013, 15:20
It sounds like that could work. It may be a little awkward, but the only stuff we have that's related to Ordering is inside certain effects (like RearrangeTopOfLibrary etc)swordshine wrote:Is Rite of Ruin scriptable using GenericChoice? Seems like six different orders. It might be a little complicated because sacrificing one type of cards must be done at the same time. "Sacrifice | Defined$ Each" cannot do this, should probably use choosecard, rememberchosem, and sacrificeall remembered.
- 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 » 18 Feb 2013, 11:15
Done.friarsol wrote:Potential Forgotten Ancient script:
1. Trigger on upkeep
2. Repeat as an option as long as Self has +1/+1 counters on it (AI should stop repeating if there aren't any creatures it wants to put counters on)
3. Choose a non-remembered creature and remember it (AI should only choose "useful" creatures he controls)
4. Choose a number (0 - Number of Counters on Ancient)
5. Move X counters from Ancient to Chosen creature
6. Clear ChosenCreature and ChosenNumber
7(After repeat finishes). Clear Remembered
Originally I was going to write a pseudo-script, but I'm not at my codebase, so it's harder for me to look up the exact APIs/parameters.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by swordshine » 19 Feb 2013, 11:21
I've tested other cards using "ChangeZoneAll | Destination$ Battlefield", e.g. Faith's Reward. It turns out Copy Enchantment can enchant the simultaneously entered card, but other auras cannot. I'll commit Flickerform.swordshine wrote:I've completed the basic script of Flickerform, but it cannot work with Copy Enchantment. "10/1/2005: If the enchanted creature was also enchanted by Copy Enchantment, Copy Enchantment will come back onto the battlefield attached to that permanent. As Copy Enchantment returns to the battlefield, its controller may choose any enchantment on the battlefield for it to copy. It can't copy Flickerformor any other Aura returning to the battlefield at the same time. If it copies a non-Aura enchantment, it will become unattached from the permanent and remain on the battlefield." I'm not sure if it is a long-existed issue for Copy Enchantment.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by swordshine » 19 Feb 2013, 12:10
http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=9147&p=108243&hilit=Bane+Alley+Broker#p108243
I think the basic script of Bane Alley Broker is correct and I updated it to a new version, though the display issue is still remaining.
I have no idea to fix the display issue. Maybe just add a note to Text: "#Please click the exile zone to see the faced down cards before you activate the second ability".
I think the basic script of Bane Alley Broker is correct and I updated it to a new version, though the display issue is still remaining.
- Bane Alley Broker | Open
- Name:Bane Alley Broker
ManaCost:1 U B
Types:Creature Human Rogue
Text:no text
PT:0/3
A:AB$ Draw | Cost$ T | NumCards$ 1 | SubAbility$ DBExile | SpellDescription$ Draw a card, then exile a card from your hand face down.
SVar:DBExile:DB$ ChangeZone | Origin$ Hand | Destination$ Exile | ChangeType$ Card | ChangeNum$ 1 | ExileFaceDown$ True | Mandatory$ True | RememberChanged$ True
S:Mode$ Continuous | Affected$ Card.IsRemembered+YouOwn | AffectedZone$ Exile | AddHiddenKeyword$ You may look at this card. | Description$ You may look at cards exiled with CARDNAME.
S:Mode$ Continuous | Affected$ Card.IsRemembered+OppOwn | AffectedZone$ Exile | AddHiddenKeyword$ Your opponent may look at this card.
A:AB$ ChooseCard | Cost$ U B T | Defined$ You | Amount$ 1 | Mandatory$ True | ChoiceTitle$ Choose a card to put into your hand | Choices$ Card.IsRemembered | ChoiceZone$ Exile | SubAbility$ MoveChosen | SpellDescription$ Return a card exiled with CARDNAME to its owner's hand.
SVar:MoveChosen:DB$ ChangeZone | Origin$ Exile | Destination$ Hand | Defined$ ChosenCard
T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered | Execute$ DBForget
SVar:DBForget:DB$ Pump | ForgetObjects$ TriggeredCard
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Static$ True | ValidCard$ Card.Self | Execute$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/bane_alley_broker.jpg
SetInfo:GTC|Uncommon|http://magiccards.info/scans/en/gtc/145.jpg
Oracle:{T}: Draw a card, then exile a card from your hand face down.\nYou may look at cards exiled with Bane Alley Broker.\n{U}{B},: Return a card exiled with Bane Alley Broker to its owner's hand.
End
I have no idea to fix the display issue. Maybe just add a note to Text: "#Please click the exile zone to see the faced down cards before you activate the second ability".
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by Sloth » 19 Feb 2013, 21:18
The "You may look at this card." keyword isn't really working as it should at the moment (it actually permanently changes the face down state when the card is shown). The current structure of the code is not really suitable to fix the keyword.swordshine wrote:I think the basic script of Bane Alley Broker is correct and I updated it to a new version, though the display issue is still remaining.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by moomarc » 20 Feb 2013, 09:57
Trying to script Razor Boomerang in an AI-friendly way (avoiding Pump:RememberObjects as the base ability) so I need to remember the unattached card by getting it from the sa's paidList. I've added the necessary code in AbilityUtils:HandleRemembering for RememberCostCards for "Unattached". I've also put in this.addListToHash(ability,"Unattach"); for human and AI, but it only works for the human. For the AI, it crashes at
I just had the AI's addListToHash using "Attach".
- Code: Select all
final List<Card> paidListUnattached = sa.getPaidList("Unattached");

-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Who is online
Users browsing this forum: No registered users and 13 guests