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

Monster's damage vulnerabilities, resistances and immunities should be NamedAPIResource structures #246

Open
fergcb opened this issue Aug 17, 2020 · 7 comments

Comments

@fergcb
Copy link
Member

fergcb commented Aug 17, 2020

Using full references makes the content better digestible by data-consuming applications, and also brings the structure of monsters' damage immunities/etc. in line with the structure of their condition immunities.

Instead of this:

damage_immunities: [
    "acid"
]

We should see this:

damage_immunities: [
    {
        "index": "acid",
        "name": "Acid",
        "url": "/api/damage-types/acid"
    }
]
@bagelbits
Copy link
Collaborator

I see your 100% reasonable suggestion and raise you Erinyes:

    "damage_resistances": [
      "cold",
      "bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered"
    ],

There's a bunch of other examples in monsters that make this a rather complicated problem. I suggestion taking a stroll through them. :D

@fergcb
Copy link
Member Author

fergcb commented Aug 18, 2020

Perhaps other field(s) could be useful for information about the conditions necessary for the resistance/vulnerabilities?

@ogregoire
Copy link
Collaborator

ogregoire commented Aug 18, 2020

Side question: what is that NamedAPIResource? It's the structure with name, index and url? Is it defined somewhere? I don't see it anywhere in the repo...

The damage resistance is the worst in terms of dataifying the SRD. I couldn't find anything rather simple without having a full-fledged interpreter.

@fergcb
Copy link
Member Author

fergcb commented Aug 18, 2020

It's defined in the API documentation (which does actually need updating), but the definition there is this:

Name Description Data Type
index The resource index for shorthand searching. string
name The name of the referenced resource string
url The URL of the referenced resource string

Quite a few places in the actual data are missing the index attribute, but I'm looking to address that with a different issue I've opened, #243.

@bagelbits
Copy link
Collaborator

Perhaps other field(s) could be useful for information about the conditions necessary for the resistance/vulnerabilities?

We might be able to take a similar approach with what I suggested for languages. Keep the original string as is and break it apart into things that can be referenced and things that are weird.

@JaysonMendoza
Copy link

Hmmm, @bagelbits has quite the monster enigma there lol.

I think that it may be best to leave it as a list of strings. Really, damage types are nothing but an enumeration type since in DND5e the individual damage type themselves don't actually have a any game rules associated with them. The concequence of a damage type is generally left to the description of the attack.

With that being said, it could potentially work if there was a "special" damage type in the resource. That could allow the subdocument version in the monster docs to be customized with a description key added in. It would mostly just serve as a way for a programmer to identify special cases that they will need to resolve.

@bagelbits
Copy link
Collaborator

bagelbits commented Dec 20, 2020

Really, damage types are nothing but an enumeration type since in DND5e the individual damage type themselves don't actually have a any game rules associated with them.

Though they are also left up to the imagination of the DM and players with certain damage types.

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

No branches or pull requests

4 participants