Add a recharge field to features and other applicable elements

Open
#992 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
json
Domain
api, data

Research direction

Look at the existing feature data structures in the repository, likely in a data directory. Understand how resources are currently represented. The issue suggests adding a 'resources' array with fields like name, dependency, amount, recharge, recharge_amount, and action. Start by examining a sample feature file (like for 'ki') to see the current schema. Determine where to add this new field and how to parse expressions like '${level}'. Check if there are existing tests for data validation.

Written by the indexing model from the issue text.

Description

Many abilities in the game can only be cast a certain amount of times until they are recharged. A few examples, not all are SRD compliant but there is no detailed info here :

  • bardic-inspiration-1 : Charisma times per long rest
  • font-of-inspiration : transforms the long rest in short rest for the bardic inspirations
  • wand of magic missiles : 7 charges, 1d6+1 recharge per long rest
  • ki : level times per short rest
  • Druid Star Map: Guiding bolt : proficiency times per long rest
  • Githzerai psionics : Either Shield or Detect through 1 times per long rest

It would be great to have a way to represent the amount of times a feature or one of its element can be used. For example on "ki":

{
    "index": "ki", 
    ...
    "resources": [ {
          "name": "Ki Point",
          "dependency": {
               "name": "ki",
               "url": "...."
          },
           "amount": "${level}",
           "amount": "min(1, ${charisma})",    // Example of a representation of something that could be parsed and evaluated
           "recharge": "short-rest",
           "recharge_amount": "full",
           "action": "various"
     }]
}

Having such a representation would help building automated resource management summaries, with checkboxes or textfield to activate or reduce the available amount of resource of a particular ability.

The current workaround would be to parse the "desc" field and hope we have guessed the right information.

Dominant language
TypeScript
Stars
656
Forks
205
Avg merge
14h 21m
Merged PRs (30d)
76

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 5e-bits/5e-srd-api

All issues in 5e-bits/5e-srd-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.