Code Monkey home page Code Monkey logo

dndbeyond-screen's Introduction

D&D Beyond DM Screen

This project provides a DM screen for D&D Beyond https://dndbeyond.com. This screen brings all of a character's public campaign members into a single page with DM-relevant stats. The idea here is to reduce the number of tabs a DM may need to open.

DM Screen

!! Important: D&D Beyond does not currently provide an official API. The functionality for this screen is based upon using endpoints that may change or go away at any point. Additionally, D&D Beyond implements rate limiting for accessing these endpoints. Accessing too many characters too frequently may cause a temporary block which requires you to complete a captcha on the main D&D Beyond website.

Requirements

Installation

git clone [email protected]:swichers/dndbeyond-screen.git
cd dndbeyond-screen
composer install
symfony serve

If you are not using the Symfony CLI then you must set up whichever webserver you plan on using. Running composer install should also build the required frontend assets for the project. After the project has finished building, and the site is accessible, open it in your browser.

Usage

Open http://127.0.0.1:8000 in your browser. Enter the Character ID for a public D&D Beyond character. You will be presented with a list of all characters in the campaign. The Character ID is the number available when viewing a character on D&D Beyond.

dndbeyond-screen's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar swichers 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

Watchers

 avatar  avatar  avatar

dndbeyond-screen's Issues

Refactor prepared Spell code into a service

Currently the logic for prepared spells is located in character-card--spells.html.twig. This needs to be pulled into a service so that we are separating our presentation from our business logic. Additionally, this will better prepare us for adjustments and enhancements in the future.

Requirements:

  • New methods exist on CharacterCalculatorService
  • A new Twig filter exists, spells that takes a filter type (only prepared for now)
  • The prepared Spells logic is removed from the aforementioned template
  • The template is updated to use the new Twig filter

The new methods on CharacterCalculatorService are:

getSpells: Gets all spells from the character, including unprepared. Includes an optional argument to restrict to only prepared spells.

getSpellsBy: Gets all spells from the character, filtered by an argument and prepared status. The argument can be an array. Filters: race, class, feat, item. The filters should be self-explanatory, with prepared status applying to any previously filtered list. The filter values should be considered OR. i.e. getSpellsBy(['race', 'class'], TRUE) will get all prepared spells provided from a character's race or class.

Note that when dealing with prepared spells there is special logic needed to grab available spells for certain classes. The logic that exists currently may not be entirely accurate.

The return values for both of these functions should be an array of spells, or an empty array. The format of the spell data should be the same array data that the original character array contained.

Files of note:

templates/sheet/character-card/components/character-card--spells.html.twig

src/Twig/CharacterCalculatorExtension.php

src/Service/Calculator/CharacterCalculatorService.php

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.