Page 7 of 141

Re: Card Development Questions

PostPosted: 07 Jan 2011, 03:17
by slapshot5
: Sailmonger as written in your post works fine for me. Is your creature a valid target?
My test deck was just Moxen, Sailmonger and Merfolk of the Pearl Trident.
-slapshot5

Re: Card Development Questions

PostPosted: 07 Jan 2011, 03:48
by Jaedayr
slapshot5 wrote:
Jaedayr wrote:Also I noticed that the info box in game has an extra hyphen in the name "Creature - - Human Monger"
You don't need to add hyphens in the Types: field. Just list them as:
Code: Select all
Creature Human Monger
Don't know why that card isn't working for you.
-slapshot5
I removed the extra hyphen and it works. Thank you for the help!

Re: Card Development Questions

PostPosted: 10 Jan 2011, 00:56
by Chris H.
I would like to welcome Sentient6 to the list of committers. :D We appreciate the help.

Re: Card Development Questions

PostPosted: 10 Jan 2011, 02:26
by sentient6
Thanks for welcome. I hope my contributions actually help somewhat.

Not sure if this is the right thread to ask this, but it seems that you can't put a SpellDescription on a drawback created from an AbilityFactory without getting a null pointer error.

The code to blame is in AbilityFactory.getAbility. When called for a Drawback, abCost is never instantiated and thus a null pointer error occurs below.
AbilityFactory.getAbility Snippets | Open
Code: Select all
      if (!isDb){
         if (!mapParams.containsKey("Cost"))
            throw new RuntimeException("AbilityFact1ory : getAbility -- no Cost in " + hostCard.getName());
         abCost = new Ability_Cost(mapParams.get("Cost"), hostCard.getName(), isAb);
      }
Code: Select all
        if (hasSpDesc)
        {
           StringBuilder sb = new StringBuilder();
           
           if (mapParams.containsKey("PrecostDesc"))
              sb.append(mapParams.get("PrecostDesc")).append(" ");
           if (mapParams.containsKey("CostDesc"))
              sb.append(mapParams.get("CostDesc")).append(" ");
           else sb.append(abCost.toString());
           
           sb.append(mapParams.get("SpellDescription"));
           
           SA.setDescription(sb.toString());
        }
Would it be worth it to check for abCost being null here or is the idea that a drawback should always be described in the ability it falls under? I wanted to ask before doing anything myself so I don't accidently step on somebody's toes somehow.

Either way, what is the general consensus on where the description of multi-part abilities/spells should go?

Re: Card Development Questions

PostPosted: 10 Jan 2011, 02:34
by Chris H.
sentient6 wrote:Not sure if this is the right thread to ask this, but it seems that you can't put a SpellDescription on a drawback created from an AbilityFactory without getting a null pointer error.
Either way, what is the general consensus on where the description of multi-part abilities/spells should go?
`
I think that you are right, we include the DB description as part of the SpellDescription included in the AF sa.

Re: Card Development Questions

PostPosted: 10 Jan 2011, 02:37
by sentient6
Chris H. wrote:
sentient6 wrote:Not sure if this is the right thread to ask this, but it seems that you can't put a SpellDescription on a drawback created from an AbilityFactory without getting a null pointer error.
Either way, what is the general consensus on where the description of multi-part abilities/spells should go?
`
I think that you are right, we include the DB description as part of the SpellDescription included in the AF sa.
Alright, that's the way I'll do it from here on out. Perhaps it might make sense to provide some sort of error message, though, to warn people not to put a SpellDescription on a drawback. The thrown exception was not exactly the clearest message.

Re: Card Development Questions

PostPosted: 10 Jan 2011, 03:41
by Chris H.
sentient6 wrote:Alright, that's the way I'll do it from here on out. Perhaps it might make sense to provide some sort of error message, though, to warn people not to put a SpellDescription on a drawback. The thrown exception was not exactly the clearest message.
`
Easy to read error messages are always a good thing. :)

Re: Card Development Questions

PostPosted: 10 Jan 2011, 14:32
by friarsol
Drawbacks were written to never have costs, and the full SpellDescription should appear on the the root AF, since it's one whole ability. We can add a section in the
Code: Select all
if (hasSpDesc)
        {
block to check if this is a Drawback and popup a warning message, but skip the attempt at using the null Cost variable.

Edit: I'm going to add some code to make this scenario simpler to allow either front-loading of SpellDescription (as we have now) or chaining of the Descriptions

Re: Card Development Questions

PostPosted: 10 Jan 2011, 21:22
by Jaedayr
I created Zhalfirin Commander and when I checked on rarity at gatherer.wizards.com it says "Special". I am adding it to the SVN as "Rare" but do we or should we have a special tag for rarity? Or do we treat all specials as rare.

Re: Card Development Questions

PostPosted: 10 Jan 2011, 21:32
by friarsol
Zhalfrin Commander was Uncommon in Mirage, so list it as that. It was one of the Timeshifted cards in Time Spiral. The SetInfoScript will handle the Special portion as normal.

Re: Card Development Questions

PostPosted: 14 Jan 2011, 21:41
by jeffwadsworth
Does anyone see an issue with this line for the card Time Spiral?

Code: Select all
A:SP$Untap | Cost$ 4 U U | TargetMin$ 0 | TargetMax$ 6 | ValidTgts$ Land | TgtPrompt$ Select target land | SpellDescription$ You untap up to six lands.
It won't work whereas the "SP$Untap" works fine with other cards. Just making sure I am not missing something.

Re: Card Development Questions

PostPosted: 14 Jan 2011, 21:46
by friarsol
This untapping isn't targeted and happens during resolution. It's probably better to just wait until Untap is written to handle this type of untargeted untapping. We probably also need ChangeZoneAll to be written for the card as well.

Re: Card Development Questions

PostPosted: 15 Jan 2011, 03:40
by jeffwadsworth
Fooling with Hellfish's new trigger code and was wondering about Pandemonium.

Code: Select all
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Creature.YouCtrl | Execute$ TrigDamage | TriggerDescription$ Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice.
SVar:TrigDamage:SP$DealDamage | Tgt$ TgtCP | NumDmg$ X
SVar:X:Count$?Power
Is there anyway to count the power of a creature that just entered the battlefield?

Re: Card Development Questions

PostPosted: 15 Jan 2011, 03:52
by friarsol
Not currently, but there's another problem with Pandemonium. The controller of the creature doesn't get to choose the target, the controller of Pandemonium does. That card is going to need a decent amount of more work to get it to be 100% scriptable.

Re: Card Development Questions

PostPosted: 16 Jan 2011, 22:34
by jeffwadsworth
Is there a way to script the removal of a keyword like flying? Testing Emerald Charm.