Giter VIP home page Giter VIP logo

decklist's Introduction

decklist

The code behind decklist.org, which generates DCI Registration Sheets.

Direct Linking

Interested in directly linking to decklist.org for your tournament or for your deck building application? It's super easy! Simply set the following GET parameters to have the fields automatically populated:

  • firstname: the participant's first name (e.g. April)
  • lastname: the participant's last name (e.g. King)
  • dcinumber: the participant's DCI number (e.g. 1234567890, no dashes needed)
  • event: the name of the event (e.g. Grand Prix Minneapolis)
  • eventdate: the date of the event (e.g. 2027-12-31)
  • eventlocation: the physical location of the event (e.g. Minneapolis Convention Center)
  • decksheet: the deck sheet to use (either wotc or scg, defaults to wotc)
  • deckname: name of the deck (e.g. Hot Garbage)
  • deckdesigner: designer of the deck (e.g. CubeApril)
  • deckmain: the deck itself; this can be in any format the website understands (use %0A for newlines)
  • deckside: the side itself; this can be in any format the website understands (use %0A for newlines)
  • disableediting: prevent users from editing the fields above
  • logo: please contact [email protected], if you'd like to replace the DCI logo

Please note that any field not specifically set will simply be left blank on the form.

Tournament organizer example, for an unregistered player:

https://www.decklist.org/?eventdate=2027-12-31&event=Grand%20Prix%20Minneapolis&eventlocation=Minneapolis%20Convention%20Center

Or a preregistered player:

https://www.decklist.org/?firstname=April&lastname=King&dcinumber=7060000004&eventdate=2027-12-31&event=Grand%20Prix%20Minneapolis&eventlocation=Minneapolis%20Convention%20Center

Just replace the values above with your tournament's values; that's all! Please note that when creating a link, to replace spaces with %20; this is important! :)

Deck building website example:

https://www.decklist.org/?deckmain=2%09Arid%20Mesa%0A4%09Brainstorm%0A1%09Council%27s%20Judgment%0A4%09Counterbalance%0A2%09Counterspell%0A2%09Entreat%20the%20Angels%0A4%09Flooded%20Strand%0A4%09Force%20of%20Will%0A4%09Island%0A3%09Jace%2C%20the%20Mind%20Sculptor%0A2%09Plains%0A2%09Polluted%20Delta%0A4%09Ponder%0A2%09Scalding%20Tarn%0A4%09Sensei%27s%20Divining%20Top%0A3%09Snapcaster%20Mage%0A4%09Swords%20to%20Plowshares%0A4%09Terminus%0A3%09Tundra%0A2%09Volcanic%20Island&deckside=1%09Council%27s%20Judgment%0A1%09Counterspell%0A1%09Disenchant%0A3%09Flusterstorm%0A1%09Keranos%2C%20God%20of%20Storms%0A1%09Path%20to%20Exile%0A1%09Pyroblast%0A2%09Red%20Elemental%20Blast%0A2%09Rest%20in%20Peace%0A1%09Supreme%20Verdict%0A1%09Surgical%20Extraction%0A

Everything all together:

https://www.decklist.org/?firstname=April&lastname=King&dcinumber=7060000004&eventdate=2027-12-31&event=Grand%20Prix%20Minneapolis&eventlocation=Minneapolis%20Convention%20Center&deckname=Miracles&deckdesigner=CubeApril&deckmain=2%09Arid%20Mesa%0A4%09Brainstorm%0A1%09Council%27s%20Judgment%0A4%09Counterbalance%0A2%09Counterspell%0A2%09Entreat%20the%20Angels%0A4%09Flooded%20Strand%0A4%09Force%20of%20Will%0A4%09Island%0A3%09Jace%2C%20the%20Mind%20Sculptor%0A2%09Plains%0A2%09Polluted%20Delta%0A4%09Ponder%0A2%09Scalding%20Tarn%0A4%09Sensei%27s%20Divining%20Top%0A3%09Snapcaster%20Mage%0A4%09Swords%20to%20Plowshares%0A4%09Terminus%0A3%09Tundra%0A2%09Volcanic%20Island&deckside=1%09Council%27s%20Judgment%0A1%09Counterspell%0A1%09Disenchant%0A3%09Flusterstorm%0A1%09Keranos%2C%20God%20of%20Storms%0A1%09Path%20to%20Exile%0A1%09Pyroblast%0A2%09Red%20Elemental%20Blast%0A2%09Rest%20in%20Peace%0A1%09Supreme%20Verdict%0A1%09Surgical%20Extraction%0A

decklist's People

Contributors

april avatar chaimw avatar daniel-beck avatar jaeiclee avatar kerrick avatar nightfirecat avatar richardneal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

decklist's Issues

Warhammer 40k cards are not recognized

The Warhammer 40k cards aren't recognized and are put in a separate section rather than being grouped with the appropriate type.

I verified that this issue is fixed by #76 (I see the 40k cards in decklist-cards-min.js).

Screenshot

Screenshot from 2023-02-03 08-49-45

Should the PDF update on keyup rather than on change?

I find it a bit odd to see the PDF display update when I tab between fields or use the arrow keys / Home + Down keys to navigate within one of the textareas. Is there any reason we need to update it whenever keys are pressed?

cut down on sideboard cards?

Would it make sense to cut down the maximum entries in the sideboard to 15 different card names?
As that is the maximum lines available and all further entries mess the judge box up, basically rendering all list unusable or unreadable:
untitled

I think cutting down to 15 entries (no matter how much cards there are in total) keeps readability at least.
Same could apply to the decklist and the number of available lines for card entries, too.

There should be an appropriate (and additional) warning for sure if not all cards make it to the list!

Suggestion: Create contribution guide

Most projects will include a CONTRIBUTING.md file (like the README) in the root directory of the project to help define certain style guidelines and principles that a project adheres to. This is an exmaple, which is used by the Cockatrice project. I noticed that the most recent commit made some changes to the code to start making a consistent style (tabs->spaces, apostrophe-surrounded strings, etc.), so I figured that now may be a good time to establish your preferred style so others can use it as well.

Add integration tests

Given past issues with cards with special characters—and the edge cases therein—and the implementation of error handling, we may benefit from starting to write a set of test cases to ensure we don't introduce regressions or partial fixes to these issues. (ref: #19, #24)

Since we can identify cards by their card name, we could confirm their inclusion in the computed deck list after parsing some given text. This would be a more secure and automated method of testing problem cases, rather than confirming by-eye.

IMO, this is a low-priority effort, but would be worth putting effort toward at some point in the future.

"Single right quote" is not recognized in card names

Some websites and applications use the "single right quote" character ("’", U+2019) rather than the normal apostrophe. The decklist generator does not know to convert this to a regular apostrophe and will not recognize the card name.

UNH split card not recognized

The card Who/What/When/Where/Why isn't correctly recognized, even though its name is correct.

Update: #33 (comment)

With the UNS Oracle Update, it is now officially Who // What // Where // When // Why


untitled
Compare for yourself:

It's an error in your database creation. Because you handle that card the same as any other split card and therefore it ends up in your database with double // separation with spaces "Side1 // Side2":

  • "who // what // when // where // why":{c:"S",b:"sml",m:98,n:"Who // What // When // Where // Why"}

But it should be single / separation without spaces "Side1/Side2" for that particular card:

  • "who/what/when/where/why":{c:"S",b:"sml",m:98,n:"Who/What/When/Where/Why"}

That's actually the same issue with the Cockatrice app, because mtgjson (used as source for the card database) has no split cards but all single halves. In order to create a database one has to combine them to a single card with its combined names.
Problem is the unique and different naming scheme for the UNH split card in comparison to aftermath or fuse cards for example.

Old DCI Number Conversion

Older (smaller) DCI numbers will need to be converted into the new format. Currently don't know the formula to do this, though.

Separate lands in decklist

A vast majority of handwritten lists will have lands separate from non-lands. It'd be nice if this could also do that while still allowing all of the different sort mechanisms.

Use capitalization on actual cards

Survival of the Fittest should always show as Survival of the Fittest, no matter if you use:

1 survival of the fittest
1 Survival of the Fittest
1 Survival of THE Fittest

etc.

Apostrophes in unrecognized cards output as e'

I uploaded a decklist with 3 Uro, Titan of Nature's Wrath, which isn't recognized quite yet, but on the decklist it shows up as 3 Uro, Titan of Nature's Wrath. Same happens with 2 Rakdos's Return -> 2 Rakdos's Return, but 2 Rakdos' Return -> 2 Rakdos' Return.

Sorting by CMC just sorts alphabetically

When I put in my Jund Sacrifice decklist and hit sort by CMC I get all of the cards sorted in alphabetical order instead. I've seen this issue before with my Dredge decklist too.

Screenshot included for clarity:
decklist-org-sort-by-cmc-broken

If it helps, this is the maindeck and sideboard I used:

3 Beanstalk Giant
4 Blood Crypt
1 Castle Locthwain
4 Casualties of War
4 Cauldron Familiar
4 Fabled Passage
5 Forest
4 Gilded Goose
3 Korvold, Fae-Cursed King
1 Massacre Girl
4 Mayhem Devil
1 Mountain
3 Murderous Rider
4 Overgrown Tomb
4 Stomping Ground
2 Swamp
1 Thrashing Brontodon
4 Trail of Crumbs
4 Witch's Oven
2 Duress
3 Lovestruck Beast
1 Massacre Girl
4 Noxious Grasp
2 Shifting Ceratops
1 Thrashing Brontodon
2 Wicked Wolf

Sorting by colour seems to be broken

I always use the "color" settings for sorting and it seems to be recently broken. I filed out my fairly stock Modern Dredge list and it sorts Prized Amalgam first by itself, then every other spell in a section, then the lands in a section. Maybe it thinks all the monocoloured cards are colourless for some reason? Happy to give more specific information if needed.

Support additional registration sheet pages

Mostly for Battle of Wits decks. They're so long!

For example:

https://www.decklist.org/?deckmain=4%09Abzan%20Charm%0A4%09Anticipate%0A4%09Arcane%20Sanctum%0A4%09Axebane%20Guardian%0A4%09Azorius%20Guildgate%0A2%09Azure%20Mage%0A4%09Battle%20of%20Wits%0A4%09Blossoming%20Sands%0A4%09Bonded%20Fetch%0A4%09Carven%20Caryatid%0A2%09Congregate%0A4%09Crystal%20Ball%0A4%09Darksteel%20Ingot%0A4%09Deadly%20Recluse%0A4%09Demonic%20Collusion%0A4%09Diabolic%20Tutor%0A4%09Dimir%20Guildgate%0A4%09Dismal%20Backwater%0A4%09Dissolve%0A4%09Doom%20Blade%0A1%09Elixir%20of%20Immortality%0A4%09Evolving%20Wilds%0A4%09Fate%20Forgotten%0A4%09Fog%20Bank%0A2%09Forest%0A2%09Golgari%20Guildgate%0A2%09Grip%20of%20Desolation%0A4%09Guard%20Gomazoa%0A4%09Hedron%20Archive%0A4%09Increasing%20Ambition%0A4%09Island%0A2%09Jar%20of%20Eyeballs%0A4%09Jungle%20Hollow%0A4%09Krosan%20Grip%0A4%09Mnemonic%20Wall%0A4%09Mulldrifter%0A4%09Negate%0A4%09Oblivion%20Ring%0A4%09Omenspeaker%0A4%09Opulent%20Palace%0A2%09Orzhov%20Guildgate%0A4%09Overgrown%20Battlement%0A1%09Plague%20Wind%0A2%09Plains%0A1%09Planar%20Portal%0A1%09Profound%20Journey%0A4%09Rewind%0A4%09Sandsteppe%20Citadel%0A4%09Scoured%20Barrens%0A4%09Seaside%20Citadel%0A2%09Selesnya%20Guildgate%0A4%09Shadowmage%20Infiltrator%0A2%09Silence%20the%20Believers%0A4%09Simic%20Guildgate%0A2%09Spear%20of%20Heliod%0A2%09Swamp%0A4%09Sylvan%20Caryatid%0A4%09Temple%20of%20Deceit%0A4%09Temple%20of%20Mystery%0A4%09Temple%20of%20Silence%0A4%09Terramorphic%20Expanse%0A4%09Thornwood%20Falls%0A4%09Tower%20Geist%0A4%09Tranquil%20Cove%0A2%09Ugin%27s%20Insight%0A4%09Wall%20of%20Denial&deckside=

Add Field Validation

Need to validate the following:

  • DCI Number (needs to be <11 digits, only digits)
  • Verify main deck >= 60 cards, SB <= 15 cards (warning if not)
  • Verify main deck does not exceed lines available (44 unique cards)
  • Verify names are not too long
  • Verify date is future-set
  • Card not recognized
  • Duplicate cards (4x Terminus and 4x Terminus listed twice)
  • Any card quantity over 4, aside from basics, relentless rats, and shadowborn apostle
  • Banned cards for selected format (different update)

Keep line breaks when using "original" sort order

As the title says, it is very common to use the line breaks for visually separating card blocks. The rest of the sort orders do it this way. But the "original" sort order, ignores any line breaks in the text area and clumps all cards together.

Add tooltips

Add tooltips, particularly to the main deck and sideboard sections.

Sorting by type, Planeswalkers are grouped with Artifacts and Enchantments

Under 'Deck Sort Order,' when choosing to sort by type, cards are sorted as follows:

Lands,
Creatures,
Instants / Sorceries (mixed),
Artifacts / Enchantments / Planeswalkers (mixed)

I can see the logic of combining Instants and Sorceries, and even Artifacts and Enchantments to a lesser degree, though I'm not sure if mixing types at all is intended behavior or not. Planeswalkers may make more sense being grouped alone (or with creatures, if types are intended to be mixed).

Cards of many recent sets not recognized

Many cards from the following sets are not recognized by the decklist system:

  • KLD
  • JOU
  • KTK
  • NEO
  • M20

Just for example, Bomat Courier from the basic Pioneer burn challenger premade deck, is not recognized by the decklist system.

The same missing sets/cards are fully recognized by the Gatherer, Magic Online, TappedOut, MTG Print, and Cockatrice.

I appreciate that this project is a labor of love. If someone can help to validate the card database for completeness, that would be super.

Improve README

Currently, README is pretty sparse, not explaining how cards are generated, under-the-covers details of how the site works, or how to use it (like directlinking.html does). At the least, it seems that directlinking could be moved entirely into README as a section, and the link could point to it rather than being a separate page.

Ignore trailing spaces after card names

I've run into the issue when copy/pasting from other sources (especially PDF) that trailing spaces cause card names to not be recognized – it'd be great if they could be ignored.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.