javalent / fantasy-statblocks

Create Dungeons and Dragons style statblocks for Obsidian.md
MIT License
341 stars 71 forks source link

5e.tools import ignores strings in the AC #340

Closed zoccer5555 closed 4 months ago

zoccer5555 commented 6 months ago

Check for existing bug reports before submitting.

Expected Behavior

If i add a monster from a JSON coming from 5e.tools, the AC should be fully transfered. grafik In the Picture for example i would expect to get AC: 22 (natural armor)

Current behaviour

Right now it only takes the numeric AC. In the above example its AC: 22

Reproduction

  1. Install the Fantasy Statblock Plugin
  2. Go to 5e.tools and download the JSON file from the Ancient Black Dragon
  3. Import the file
  4. See that it ignores the "from keyword

Which Operating Systems are you using?

Obsidian Version Check

1.5.3

Plugin Version

3.17.0

Confirmation

Possible solution

At the point where it takes the numeric ac it would be enough to look for the "from" key and if it exists, ac would need to be structured as in the 5e.tools JSON. So key ac, value {ac: 22, "from": ["natural armor"]}. The reason for the array is that for example the monster "Azer" from the Monster Manual has two sources of their ac grafik The problem here is the maybe needed sanitization needed to make "{@item shield|phb}" to "shield". And if its in the database, it only needs to put the value of "from" in brackets after the numeric ac.