It is currently 02 Dec 2020, 22:14
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

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

Re: Card Development Questions

Postby Marek14 » 28 Mar 2015, 15:08

Also, there's not much connection between the two parts. I think better would be to populate, then put a +1/+1 counter on the newly created token. A "megapopulate", if you will.

And as an ultimate, how about an emblem that works like Doubling Season, but triples instead of doubling? :)
Marek14
Tester
 
Posts: 2679
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 271 times

Re: Card Development Questions

Postby rikkusguardian » 28 Mar 2015, 17:10

Targets are chosen before an ability goes on the stack. So the token that might be created can never be a legal target for that ability. You would need an ability like Bolster, which chooses the creature as it resolves.

Also, +0/+2 counters have only been used once (21 years ago), and while Forge handles them just fine, it's probably better not to use these types of counter.
Ah, I understand. Will using the +0/+2 counter break the game, or are you mentioning it as it's not the best competitive/aggressive ability? (Though this particular planeswalker I'm making is more casual, it's just her character not being very aggressive.) If it's for the latter I could always change the appearance of my card in question to look more practical and competitive, taking a que from what Marek14 mentioned.

Name: Selesnya Plainswalker
Cost: 2 W G
Loyalty: 3
+1: Put a 1/1 white and red human solider token with haste on the battlefield.
-2: Populate, then put a +1/+1 counter on the newly created token.
-9: You gain an emblem with "If an effect would put one or more tokens onto the battlefield under your control, it puts three times that many of those tokens onto the battlefield instead.
If an effect would place one or more counters on a permanent you control, it places three times that many of those counters on that permanent instead."
Then once I had my answer, change the name and numbers back to what I intended for the card I'm actually making.

| Open
Name: Fluttershy, Mother of Life ("My apologies, I don't like your card, i won't help ya code that, brony boi ." XP )
Cost: 2 W G
Loyalty: 3
+1: Put a 1/1 white bird token with flying on the battlefield.
-2: Populate, then put a +0/+2 counter on target creature you control.
-8: You gain an emblem with “Creatures you control gain +0/+2 and T: Populate.”


However, if toughness only counters WILL break the game, and this wasn't about personal opinoun, then I apologize for my wall of text and needing to lie to get help on coding cards everyone but me will hate.
rikkusguardian
 
Posts: 15
Joined: 04 Jul 2013, 10:29
Has thanked: 6 times
Been thanked: 0 time

Re: Card Development Questions

Postby Marek14 » 28 Mar 2015, 17:14

Well, the first ability makes no senes -- why does a white/green planeswalker create a white/red token with haste? (Also, you mentioned her character is not aggressive -- 1/1 haste token IS aggressive.)
A defensive planeswalker could create, for example, 1/3 Spiders with reach.
Marek14
Tester
 
Posts: 2679
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 271 times

Re: Card Development Questions

Postby rikkusguardian » 28 Mar 2015, 17:21

Marek14 wrote:Well, the first ability makes no senes -- why does a white/green planeswalker create a white/red token with haste? (Also, you mentioned her character is not aggressive -- 1/1 haste token IS aggressive.)
A defensive planeswalker could create, for example, 1/3 Spiders with reach.
Oh, the white red was an accident, i copy pasted from the a different fake card idea of a Boros planeswalker that i thought would help me get my answer easier. XP

But I never played the boros faction before, so i didn't know what a boros player would like, so i was just going to pretend that I was making a Selesnya planewalker. I completely forgot to edit the abilitys after i edited the name
rikkusguardian
 
Posts: 15
Joined: 04 Jul 2013, 10:29
Has thanked: 6 times
Been thanked: 0 time

Re: Card Development Questions

Postby friarsol » 28 Mar 2015, 17:58

No, Forge handles the +0/+2 counters just fine, but those counter types just don't interact with anything because they only exist on one card. As Marek says, I'd much rather remember the token that gets added to play and add a counter to that or as I mentioned just straight up Bolstering (which often can give the counter to that creature). It is a -2, I think a Megapopulate is probably fine. Especially since Populate requires you to have a creature token in play to begin with.

In the token effect you'd need this parameter "RememberTokens$ True"

and then SubAbility to:

SVar:DBPutCounter:DB$ PutCounter | Defined$ Remembered | CounterType$ <> | CounterNum$ 1
friarsol
Global Moderator
 
Posts: 7557
Joined: 15 May 2010, 04:20
Has thanked: 242 times
Been thanked: 952 times

Re: Card Development Questions

Postby rikkusguardian » 28 Mar 2015, 18:19

friarsol wrote:No, Forge handles the +0/+2 counters just fine, but those counter types just don't interact with anything because they only exist on one card. As Marek says, I'd much rather remember the token that gets added to play and add a counter to that or as I mentioned just straight up Bolstering (which often can give the counter to that creature). It is a -2, I think a Megapopulate is probably fine. Especially since Populate requires you to have a creature token in play to begin with.

In the token effect you'd need this parameter "RememberTokens$ True"

and then SubAbility to:

SVar:DBPutCounter:DB$ PutCounter | Defined$ Remembered | CounterType$ <> | CounterNum$ 1
Ah, I understand now! Thank you so much, Friarsol!

So like this then?

Code: Select all
A:AB$ ChooseCard | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | Defined$ You | Amount$ 1 | Choices$ Creature.token+YouCtrl | AILogic$ AtLeast1 | SubAbility$ DBCopy | Mandatory$ True | RememberTokens$ True |  SpellDescription$ Populate, then put a +1/+1 counter on target creature you control.(Put a token onto the battlefield that's a copy of a creature token you control.)
SVar:DBCopy:DB$ CopyPermanent | Defined$ ChosenCard | SubAbility$ DBPutCounter
SVar:DBPutCounter:DB$ PutCounter | Defined$ Remembered | CounterType$ <> | CounterNum$ 1| CounterType$ P1P1 | TargetMin$ 0 | TargetMax$ 1 | ValidTgts$ Creature+YouCtrl | TgtPrompt$ Select target creature | SpellDescription$ Put a +1/+1 counter on up to one target creature.
rikkusguardian
 
Posts: 15
Joined: 04 Jul 2013, 10:29
Has thanked: 6 times
Been thanked: 0 time

Re: Card Development Questions

Postby onderzeeboot » 15 Feb 2016, 23:18

I'm trying to get a custom land to work, but I can't figure out how to do it. I was hoping someone here might help. I was looking for a fetchable dual that could also help cast the new colorless Eldrazi monsters, and the idea I settled on is painlands with basic land types, e.g.

Crater Lake
Land - Island Mountain
(T: Add U or R to your mana pool.)
T: Add C to your mana pool.
Whenever you tap Crater Lake for colored mana, you lose 1 life.

The problem is, I can't get the colorless ability to not lose 1 life. Here's the code:

Code: Select all
Name:Crater Lake
ManaCost:no cost
Types:Land Island Mountain
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool.
T:Mode$ TapsForMana | ValidCard$ Card.Self | Produced$ U,R | Execute$ TrigLoseLife | TriggerZones$ Battlefield | TriggerDescription$ Whenever you tap CARDNAME for colored mana, you lose 1 life.
SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ You | LifeAmount$ 1
Oracle:({T}: Add {U} or {R} to your mana pool.)\n{T}: Add {C} to your mana pool.\nWhenever you tap Crater Lake for colored mana, you lose 1 life.
I tried "Produced$ U,R" and "Produced$ Blue,Red", and neither works.

I got the wording off of Gauntlet of Power, which is about the only card in Magic with a somewhat similar ability that I could find:

Code: Select all
Name:Gauntlet of Power
ManaCost:5
Types:Artifact
K:ETBReplacement:Other:ChooseColor
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInComputerDeck | SpellDescription$ As CARDNAME enters the battlefield, choose a color.
S:Mode$ Continuous | Affected$ Creature.ChosenColor | AddPower$ 1 | AddToughness$ 1 | Description$ Creatures of the chosen color get +1/+1.
T:Mode$ TapsForMana | ValidCard$ Land.Basic | Produced$ ChosenColor | Execute$ TrigMana | TriggerZones$ Battlefield | Static$ True | TriggerDescription$ Whenever a basic land is tapped for mana of the chosen color, its controller adds one mana of that color to his or her mana pool (in addition to the mana the land produces).
SVar:TrigMana:AB$ Mana | Cost$ 0 | Produced$ Chosen | Amount$ 1 | Defined$ TriggeredPlayer
SVar:Picture:http://www.wizards.com/global/images/magic/general/gauntlet_of_power.jpg
Oracle:As Gauntlet of Power enters the battlefield, choose a color.\nCreatures of the chosen color get +1/+1.\nWhenever a basic land is tapped for mana of the chosen color, its controller adds one mana of that color to his or her mana pool (in addition to the mana the land produces).
But alas, that line don't work. Can anyone help me?
onderzeeboot
 
Posts: 31
Joined: 29 Nov 2014, 19:37
Has thanked: 5 times
Been thanked: 0 time

Re: Card Development Questions

Postby Marek14 » 15 Feb 2016, 23:27

A minor nitpick: shouldn't you include all five colors of mana to trigger the ability if it says "colored"? There are various ways to make a land produce mana of other colors, like Prismatic Omen.
Marek14
Tester
 
Posts: 2679
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 271 times

Re: Card Development Questions

Postby onderzeeboot » 16 Feb 2016, 07:44

Marek14 wrote:A minor nitpick: shouldn't you include all five colors of mana to trigger the ability if it says "colored"? There are various ways to make a land produce mana of other colors, like Prismatic Omen.
Oh yeah, for sure! I actually started out with all five colors, but that was getting a bit tiresome while testing. If I get the code working all five colors should cause loss of life (and tapping for colorless shouldn't).

Prismatic Omen unfortunately doesn't work:

Code: Select all
Name:Prismatic Omen
ManaCost:1 G
Types:Enchantment
S:Mode$ Continuous | Affected$ Land.YouCtrl | AddType$ Plains & Island & Swamp & Mountain & Forest | Description$ Lands you control are every basic land type in addition to their other types.
SVar:NonStackingEffect:True
SVar:RemRandomDeck:True
Is there a way to tweak the Contamination code?

Code: Select all
Name:Contamination
ManaCost:2 B
Types:Enchantment
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigSacUnless | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME unless you sacrifice a creature.
SVar:TrigSacUnless:AB$ Sacrifice | Cost$ 0 | UnlessCost$ Sac<1/Creature> | UnlessPayer$ You
R:Event$ ProduceMana | ActiveZones$ Battlefield | ValidCard$ Land | ManaReplacement$ ProduceB | Description$ If a land is tapped for mana, it produces {B} instead of any other type and amount.
SVar:ProduceB:Any->B
SVar:RemAIDeck:True
SVar:NonStackingEffect:True
If you could change the "SVar:ProduceB:Any->B" line into something like "SVar:ProduceU:U->U | SubAbility$ DBLifeLoss", but I'm not sure if that'll work?

Edit: Cards like Mana Reflection suggest that this is not going to work, I think? It seems like every tap for mana ends up in that subvar, including tapping for colorless, which would mean you won't change the color, but still end up with life loss, no matter what kind of mana you tap the land for.

Code: Select all
Name:Mana Reflection
ManaCost:4 G G
Types:Enchantment
R:Event$ ProduceMana | ActiveZones$ Battlefield | ValidCard$ Permanent.YouCtrl | ManaReplacement$ ProduceTwice | Description$ If you tap a permanent for mana, it produces twice as much of that mana instead.
SVar:ProduceTwice:Colorless->2 & R->R R & B->B B & U->U U & G->G G & W->W W
Edit edit:

Code: Select all
        if (this.mapParams.containsKey("Produced")) {
            Object prod = runParams2.get("Produced");
            if (prod == null || !(prod instanceof String)) {
                return false;
            }
            String produced = (String) prod;
            if ("ChosenColor".equals(mapParams.get("Produced"))) {
                if (!this.getHostCard().hasChosenColor() || !produced.contains(MagicColor.toShortString(this.getHostCard().getChosenColor()))) {
                    return false;
                }
            }
        }

        return true;
Huh. I'm not that good at reading Java, but to me it looks like the Produced key only works with ChosenColor, which is exactly what Gauntlet of Power is doing ("T:Mode$ TapsForMana | [...] | Produced$ ChosenColor | [...]"). So that's probably why my earlier try didn't work? It just walks past this line of code and hops to the return true, resulting in always losing life, despite the color of mana produced. Is there a way to feed colors into that variable rather then set it with the choice dialog as usual?
onderzeeboot
 
Posts: 31
Joined: 29 Nov 2014, 19:37
Has thanked: 5 times
Been thanked: 0 time

Re: Card Development Questions

Postby friarsol » 16 Feb 2016, 14:18

I mean, you're looking at Replacement cards, but that ability is a trigger. As you mentioned, no card in Magic actually does this (caring about what type of mana is produced when a land is tapped for mana) so we don't support it in the TapsForMana trigger. It would need to be in the code snippet you posted, checking if a certain colored mana is produced going into the trigger.
friarsol
Global Moderator
 
Posts: 7557
Joined: 15 May 2010, 04:20
Has thanked: 242 times
Been thanked: 952 times

Re: Card Development Questions

Postby onderzeeboot » 16 Feb 2016, 22:30

friarsol wrote:I mean, you're looking at Replacement cards, but that ability is a trigger. As you mentioned, no card in Magic actually does this (caring about what type of mana is produced when a land is tapped for mana) so we don't support it in the TapsForMana trigger. It would need to be in the code snippet you posted, checking if a certain colored mana is produced going into the trigger.
Ok, thanks for answering my question! It's nice to know I was looking at the right code as well :) I guess I can "emulate" the card's intended behavior by adding a gain 1 life subability to the tap for colorless ability, since there isn't any card in my cube that triggers off lifegain.

PS. Can I just thank all of you for your great work by the way? Forge is an awesome tool for testing my cube, much quicker than playtesting with the real cards. Thanks!
onderzeeboot
 
Posts: 31
Joined: 29 Nov 2014, 19:37
Has thanked: 5 times
Been thanked: 0 time

Re: Card Development Questions

Postby Hanmac » 18 Jun 2016, 09:27

i am currently reworking the damage prevention effects again after doing some changes with ChosenCard.

i found this:
609.7a If the player chooses a permanent spell, the effect will apply to any damage dealt by that spell and any damage dealt by the permanent that spell becomes when it resolves.
currently there is no ChangesZone Trigger that does disable the Effect before the turn end or the Effect does apply, but what does happen if i choose a red source with Circle of Protection: Red then the owner does cancel it with Remand and then does cast it again? currently the Prevent Effect does still apply but i am not sure if that is correct.

also when adding a ChangesZone Trigger, how does it need to be done for permanent spell?

my current idea, exile the Effect if:
  • non-permanent spell on stack moves to other zone
  • permanent spell on the stack moves to other zone except Battlefield
  • card on zone other than stack moves to any other zone

is my idea correct or what do you guys think what happens to the Effect?
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Marek14 » 18 Jun 2016, 09:35

Hanmac wrote:i am currently reworking the damage prevention effects again after doing some changes with ChosenCard.

i found this:
609.7a If the player chooses a permanent spell, the effect will apply to any damage dealt by that spell and any damage dealt by the permanent that spell becomes when it resolves.
currently there is no ChangesZone Trigger that does disable the Effect before the turn end or the Effect does apply, but what does happen if i choose a red source with Circle of Protection: Red then the owner does cancel it with Remand and then does cast it again? currently the Prevent Effect does still apply but i am not sure if that is correct.

also when adding a ChangesZone Trigger, how does it need to be done for permanent spell?

my current idea, exile the Effect if:
  • non-permanent spell on stack moves to other zone
  • permanent spell on the stack moves to other zone except Battlefield
  • card on zone other than stack moves to any other zone

is my idea correct or what do you guys think what happens to the Effect?
Well, first two could be combined to "spell on stack moves to any zone except battlefield". Moving from stack to battlefield is a special thing because any modifiers and effects can track this change. Technically, the card becomes a new object even in this case, but modifiers and effects "switch over" to the new object.

It might be fun to have a general function "are these two objects the same?" with results "same object", "different objects, but created by moving from stack to battlefield", "different objects, but represented by the same card", and "different cards" :)
Marek14
Tester
 
Posts: 2679
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 271 times

Re: Card Development Questions

Postby Hanmac » 18 Jun 2016, 09:45

you are right, i forgot that non-permanent spells can't enter the battlefield
that can combine the first two triggers into one.

i will implement that Triggers into the cards if thats okay.

Edit: i got this answer:
When a permanent leaves the battlefield, it can still be chosen as a damage source as long as something else that currently exists refers to that object (for example, you can prevent the damage from Mogg Fanatic even after it leaves the battlefield).
means i need to rethink about the third trigger. maybe if something is moved from non-Stack to the battlefield. OR from non-Stack/non-Battlefield to somewhere else.

i think "from other zone than Battlefield to other zone than Battlefield" would be working.

EDIT: some one did say for when it does moves from the Battlefield i need LastKnownInformation ... that makes everything more complicated :/

==
hm yeah a check if two objects are the same, and not a different object would help ... it's also about that whole LKI stuff.
i recently had the problem with the Basilisk Effect with destroy a creature at the end of battle, even if the creature got blinked ... i need to check if it does still happen, or if had fixed that.

===

EDIT: i updated the PreventEffect cards again using ChosenCard directly.
the values are now stored in with EffectEffect. Also the CardView now use Proper Property for ChosenCard (it did use ChosenColors for unknown reason)

i didnt found a best way for adding to add the Trigger yet.
means Counter and casting a spell again does work as it shouldn't.
a possible way would be to use TriggerCountered but thats not the right way imo.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 19 Jun 2016, 08:08

while i did Reflect Damage, i noticed something:

when there is a Damage Source that deals damage to multiple targets simultaneous and the ReplaceDamage trigger is not a continuous one,
(a "The next time" or "The next 1 damage") then the user can't choose which of the damage to prevent.

Code: Select all
Name:Reflect Damage
ManaCost:3 W R
Types:Instant
A:SP$ ChooseSource | Cost$ 3 W R | Choices$ Card | SubAbility$ DBEffect | StackDescription$ SpellDescription | SpellDescription$ The next time a source of your choice would deal damage this turn, that damage is dealt to that source's controller instead.

SVar:DBEffect:DB$ Effect | ReplacementEffects$ SelflessCombat,SelflessNonCombat | SVars$ CombatDmg,NonCombatDmg,ExileEffect,X | References$ Combat,NonCombat,CombatDmg,NonCombatDmg,ExileEffect,X | SubAbility$ DBCleanup

SVar:SelflessCombat:Event$ DamageDone | ValidSource$ Card.ChosenCard | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next time a source of your choice would deal damage this turn, that damage is dealt to that source's controller instead.
SVar:SelflessNonCombat:Event$ DamageDone | ValidSource$ Card.ChosenCard | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next time a source of your choice would deal damage this turn, that damage is dealt to that source's controller instead.
SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ ChosenCardController | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect
SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ ChosenCardController | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect

SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True
SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True
SVar:X:ReplaceCount$DamageAmount
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/reflect_damage.jpg
Oracle:The next time a source of your choice would deal damage this turn, that damage is dealt to that source's controller instead.
i tested it with Anger of the Gods against three of my own creatures.
Only the first did survive, but i think i should choose which one does.
(Or do i understand the card wrong and all my creatures should survive like with Reverberation?)

===
thats also what prevents me from doing cards like Harm's Way with does have "your and/or permanents you control" because it has this special ruling about "simultaneously dealt damage".
10/1/2009: If the chosen source would simultaneously deal damage to multiple permanents you control (like Pyroclasm could) or to you and at least one permanent you control (like Earthquake could), Harm's Way will redirect just 2 of that damage. It won't redirect the next 2 damage that would be dealt to each recipient. You choose which 2 damage is redirected. If you like, you can choose to redirect 1 damage that would be dealt by the chosen source to each of two different recipients.
i think thats something i can't script or easy fix myself but need to be done how Forge does deal damage to the Targets to select where the Prevent Effect should apply.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

In total there are 24 users online :: 0 registered, 0 hidden and 24 guests (based on users active over the past 10 minutes)
Most users ever online was 1371 on 09 Feb 2020, 16:22

Users browsing this forum: No registered users and 24 guests

Login Form