davidchambers / tutor

JavaScript interface for the Gatherer card database
https://gatherer.wizards.com/
Do What The F*ck You Want To Public License
149 stars 18 forks source link

Supertype field #29

Closed pcastellazzi closed 12 years ago

pcastellazzi commented 12 years ago

tutor is mixing types and supertypes together. This branch add new field (supertype) which contains the proper supertype and it also remove it from the types list. The field is added only when needed.

Working on this i found a bug about how the type field is handled when the printed text is requested. Subtypes were ignored. I fixed the problem in the latest commit to this branch.

davidchambers commented 12 years ago

In 205.4a, the Comprehensive Rules state:

A card can also have one or more supertypes. These are printed directly before its card types. The supertypes are basic, legendary, ongoing, snow, and world.

Since a card may have more than one type, the attribute should be an array of strings rather than a single string. Types and subtypes are treated this way. If a card has no supertype, its supertype attribute should be an empty array.

Your list omits ongoing* and world, and includes tribal, a type.


* Whether Tutor should support Archenemy cards is a topic for another discussion.

davidchambers commented 12 years ago

I've added the supertype changes as a single commit. I'll apply the fix for "printed" types separately. Thanks for another useful pull request, Pablo.