5e-database icon indicating copy to clipboard operation
5e-database copied to clipboard

Monster languages should be NamedAPIResource

Open markbastian opened this issue 4 years ago • 4 comments

The key "languages" is inconsistent across the API and so either the monster languages should be NamedAPIResources or perhaps changed to a different key (maybe "communication").

markbastian avatar Sep 20 '20 20:09 markbastian

Good shout out! I think that makes a lot of sense!

bagelbits avatar Sep 20 '20 22:09 bagelbits

So, this also falls into a similar issue with damage_vulnerabilities, damage_resistances, and damage_immunities. Most cases follow the normal amounts but there are a lot of places where this breaks down. The first two monsters are good examples of this: Aboleth has "Deep Speech, telepathy 120 ft." Acolyte has "any one language (usually Common)"

While the latter could benefit from the choice structure, the former is a bit more complicated. Here is a list of all of the ways that language will not fall into an easy structure like this:

"languages": "Abyssal, Common, Infernal, Primordial",
"languages": "Abyssal, Common, Infernal, telepathy 60 ft.",
"languages": "Abyssal, telepathy 120 ft.",
"languages": "Abyssal, telepathy 60 ft. (works only with creatures that understand Abyssal)",
"languages": "all, telepathy 120 ft.",
"languages": "any four languages",
"languages": "any languages it knew in life",
"languages": "any one language (usually Common)",
"languages": "any one language",
"languages": "any six languages",
"languages": "any two languages",
"languages": "Auran, understands Common but doesn't speak it",
"languages": "Blink Dog, understands Sylvan but can't speak it",
"languages": "Celestial, Elvish, Sylvan, telepathy 60 ft.",
"languages": "Common (can't speak in bear form)",
"languages": "Common (can't speak in boar form)",
"languages": "Common (can't speak in rat form)",
"languages": "Common (can't speak in tiger form)",
"languages": "Common (can't speak in wolf form)",
"languages": "Common plus up to five other languages",
"languages": "Common, Giant, Winter Wolf",
"languages": "Deep Speech, telepathy 120 ft.",
"languages": "Druidic plus any two languages",
"languages": "Giant Eagle, understands Common and Auran but can't speak",
"languages": "Giant Elk, understands Common, Elvish, and Sylvan but can't speak",
"languages": "Giant Owl, understands Common, Elvish, and Sylvan but can't speak",
"languages": "Gnoll",
"languages": "Goblin, Worg",
"languages": "Infernal, telepathy 120 ft.",
"languages": "one language known by its creator",
"languages": "Otyugh",
"languages": "Sahuagin",
"languages": "the languages it knew in life",
"languages": "Thieves' cant plus any two languages",
"languages": "understands Abyssal but can't speak",
"languages": "understands Abyssal, Celestial, Infernal, and Primordial but can't speak, telepathy 
"languages": "understands Abyssal, Common, and Infernal but can't speak",
"languages": "understands all languages it knew in life but can't speak",
"languages": "understands all languages it spoke in life but can't speak",
"languages": "understands Celestial, Common, Elvish, and Sylvan but can't speak",
"languages": "understands commands given in any language but can't speak",
"languages": "understands Common and Draconic but can't speak",
"languages": "understands Common and Giant but can't speak",
"languages": "understands Common but can't speak",
"languages": "understands Deep Speech but can't speak",
"languages": "understands Draconic but can't speak",
"languages": "understands Infernal but can't speak it",
"languages": "understands infernal but can't speak",
"languages": "understands the languages of its creator but can't speak",

bagelbits avatar Sep 20 '20 22:09 bagelbits

A way that we could potentially handle this is turn the string into a list of entries. All of the ones that have a corresponding language we could use the APIReference structure. And the rest stay as just a string in the list. Not sure how best to handle understands Infernal but can't speak it. Maybe a boolean for languages that it can't speak?

bagelbits avatar Sep 20 '20 22:09 bagelbits

An array of entries is a sound idea, but perhaps rather than each entry being either a string or a reference, the array (for "Blink Dog, understands Sylvan but can't speak it") could look something more like:

[
    {
        "name": "Blink Dog"
    },
    {
        "name": "Sylvan",
        "references": {
            "index": "sylvan",
            "name": "Sylvan",
            "url": "/api/languages/sylvan"
        },
        "passive": true
    }
]

Here references is optional, and only given for languages given in the SRD, and which therefore exist in the API.

passive is also optional, defaulting to false. If it is true, the monster has a passive skill, meaning it can understand but not speak the language.

Whatever we settle on, preserving the source text as a separate attribute is definitely a good call.

fergcb avatar Sep 20 '20 23:09 fergcb