decklist icon indicating copy to clipboard operation
decklist copied to clipboard

Check against ban list

Open april opened this issue 11 years ago • 19 comments

For Standard, Modern, or Legacy, verify cards against the ban list.

april avatar Jan 21 '15 03:01 april

I'm probably going to work on this next.

ChaimW avatar Jul 09 '17 05:07 ChaimW

For Standard, you may want to look into using http://whatsinstandard.com to help with set verification logic.

Nightfirecat avatar Jul 09 '17 15:07 Nightfirecat

Where do you get your card info from or how do you create it? @april

In case you use https://github.com/mtgjson/mtgjson as source for your minimized database, they might have data on banned cards for several tournament types, too.

All changes are posted to Banned and Restricted Announcement articles in the official News on magic.wiazrds.com on a monthly basis. Official up-to-date lists from wizards are always available and could be scraped from here: https://magic.wizards.com/en/game-info/gameplay/rules-and-formats/banned-restricted

tooomm avatar Dec 05 '17 14:12 tooomm

a good portion of the necessary information is there, it is just not checked @tooomm

ChaimW avatar Dec 07 '17 02:12 ChaimW

Yes, it's all pulled from mtgjson. Note that the site is designed to work completely offline, so it includes an entire copy of the card database in the JavaScript, for example:

"spikeshot elder":{c:"D",b:"s",m:1,t:"2",n:"Spikeshot Elder"}

Could probably add a ban key, such as:

b:"sm" (aka banned in Standard and Modern)

april avatar Dec 08 '17 15:12 april

You use b: already, but no idea what it stands for, haha. That file and it's values is a bit cryptic to be honest. Besides m for cmc and n for name I have no real clue. Also, why do you double the name information? Using mtgjson for legality info should be the easiest implementation then because you use it already.

If possible I suggest you get the information from wizards directly at one point, if one can parse that page properly...

I guess you use some kind of script to generate your database? Is that part of the repo?

tooomm avatar Dec 08 '17 16:12 tooomm

generatecards.sh does the work of updating the cards definition file.

Nightfirecat avatar Dec 08 '17 17:12 Nightfirecat

This is the comment in the code for what the keys mean:

# Just FYI!
# b (banned) = [sml] (standard, modern, legacy)
# c (color) = White = A, Blue = B, Black = C, Red = D, Green = E, Gold = F, Artifact = G , Split = S, Unknown = X, Land = Z
# m (CMC) = N  (Split = 98, Land = 99)
# n (actual name) = 'true name nemesis' to 'True Name Nemesis'
# t (type) = 1 = land, 2 = creature, 3 = instant or sorcery 4 = other

april avatar Dec 08 '17 17:12 april

So I guess I already have the ban list in there, it's just not exposed obviously. :)

april avatar Dec 08 '17 17:12 april

Haha, I was about to link to that in parsecards.py @april :D Found it thanks to @Nightfirecat's link.

Yep, it looks like it's already included. Great!

tooomm avatar Dec 08 '17 17:12 tooomm

Yeah, it's a partial ban list (no legacy yet, because of banned v. restricted), since my semester has nearly finished, I'll probably go back to working on that soon.

I've started working on that (locally)

ChaimW avatar Dec 08 '17 19:12 ChaimW

I was thinking v for vintage banned, r for vintage restricted.

ChaimW avatar Dec 08 '17 19:12 ChaimW

Legacy is already in there, there's only Vintage that isn't.

april avatar Dec 08 '17 20:12 april

Why are card names printed twice in the database?

Another thing to consider for the ban-feature: Until a event actually happen, there might be another ban list valid or our database (or mtgjson) has mistakes or delayed changes for example. There might be false alarms for different reasons. So the page can only give a warning instead an error, because we can never be sure. The ban check could be optional, and needs special explanation in any case! We can link to the official ban announcement from wizards for example. But at least players are aware of potential problems and can double check for themselves.

tooomm avatar Dec 08 '17 20:12 tooomm

The key is what is likely to be entered into a decklist and the name is the canonical name that appears on the PDF.

april avatar Dec 08 '17 21:12 april

Are they any different? All entries I checked were identical... besides capitalization. Or is there another reason why you keep both?

tooomm avatar Dec 08 '17 21:12 tooomm

Much like the multiple pages, I also do format legality checking in my fork - so feel free to copy that too if you like

Fryyyyy avatar Dec 09 '17 21:12 Fryyyyy

@tooomm The idea is that the key used to locate the correct card is all lowercase, and the output is the properly capitalized form.

ChaimW avatar Dec 12 '17 04:12 ChaimW

@Fryyyyy I'll probably do that when I get to this issue.

ChaimW avatar Dec 12 '17 04:12 ChaimW