Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check against ban list #11

Open
april opened this issue Jan 21, 2015 · 19 comments
Open

Check against ban list #11

april opened this issue Jan 21, 2015 · 19 comments
Assignees

Comments

@april
Copy link
Owner

april commented Jan 21, 2015

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

@april april self-assigned this Jan 21, 2015
@ChaimW
Copy link
Contributor

ChaimW commented Jul 9, 2017

I'm probably going to work on this next.

@Nightfirecat
Copy link
Contributor

Nightfirecat commented Jul 9, 2017

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

@tooomm
Copy link

tooomm commented Dec 5, 2017

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

@ChaimW
Copy link
Contributor

ChaimW commented Dec 7, 2017

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

@april
Copy link
Owner Author

april commented Dec 8, 2017

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)

@tooomm
Copy link

tooomm commented Dec 8, 2017

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?

@Nightfirecat
Copy link
Contributor

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

@april
Copy link
Owner Author

april commented Dec 8, 2017

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
Copy link
Owner Author

april commented Dec 8, 2017

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

@tooomm
Copy link

tooomm commented Dec 8, 2017

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!

@ChaimW
Copy link
Contributor

ChaimW commented Dec 8, 2017

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
Copy link
Contributor

ChaimW commented Dec 8, 2017

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

@april
Copy link
Owner Author

april commented Dec 8, 2017

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

@tooomm
Copy link

tooomm commented Dec 8, 2017

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.

@april
Copy link
Owner Author

april commented Dec 8, 2017

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

@tooomm
Copy link

tooomm commented Dec 8, 2017

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

@Fryyyyy
Copy link

Fryyyyy commented Dec 9, 2017

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

@ChaimW
Copy link
Contributor

ChaimW commented Dec 12, 2017

@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
Copy link
Contributor

ChaimW commented Dec 12, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants