Code Monkey home page Code Monkey logo

mtggauntlet's Introduction

A Magic the Gathering Gauntler editor/printer

An HTML/Javascript tool to make and print an MtG Gauntlet based on mzabsky/GauntletPrinter.

A fully functional (hopefully) live version is available on my site.

Gauntlet Example

Features

  • Create a print-ready HTML gauntlet (print to PDF to get a PDF version)
  • Export/Import your gauntlets as JSON files
  • Sideboard cards are printed on separate set of cards and visibly marked to be easily recognizable
  • A title card with the deck names
  • Rules text shortening engine, which compacts the card text without significantly impacting its clarity, stolen and updated from mzabsky/GauntletPrinter
  • Handles 2-sided cards! (6-sided cards might not work well)
  • Adjusts font size to make the text fit in the card. Should be able to handle rendering 5 decks in one gauntlet
  • Card name autocompletion to deck editor (with fuzzy matching, so no need to type the spaces in the card names for the autocompletion to find it)

Planned Features

  • Import decklists from MtGTop8, and MtGGoldfish
  • Merging common cards between decks to save on space and clarity
  • Display card images in small somewhere (?)
  • Configuration options, such as:
    • Toggling the back side of each double-faced card individually
    • Manual font-size edition
    • Enabling/Disabling rules from the shortening engine
    • Deck colors
    • Hide card text to save even more space

How to install

This tool is relatively simple to setup, as it is only an HTML/Javascript page. A setup example can be seen in index.html.

The file AllCards.json must be generated before the tool can be used, and everytime new cards are added to the game, using the following python code:

request = 'https://mtgjson.com/api/v5/AtomicCards.json'
resp = requests.get(request).json()['data']
if len(resp) == 0:
    raise ErrorNotFound(request)
data = {}
for card_name, card in resp.items():
    data[card_name] = []
    for side in card:
        data[card_name].append({})
        for key in ['name', 'faceName', 'manaCost', 'text', 'supertypes', 'types', 'subtypes', 'type', 'colorIdentity', 'power', 'toughness', 'loyalty', 'defense']:
            if key in side:
                data[card_name][-1][key] = side[key]
with open(dataPath, 'w') as f:
    json.dump(data, f)

Finally, update the submodules to download Tribute:

git submodule init
git submodule update

mtggauntlet's People

Contributors

akulen avatar

Watchers

 avatar

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.