Tabyltop / CC-SRD

The CC-SRD 5.1 converted to other file types and data formats
39 stars 12 forks source link

Using more programmatically-friendly values instead of strings where applicable #2

Open ccjmk opened 1 year ago

ccjmk commented 1 year ago

Breaking down strings into parsed values where appropriate would make the data a lot more usable programmatically without pre-digesting it. Parsing them will be a nightmare though so I think this issue more of an exploratory one and not a "please do this now or I will cry and complain"

Immediate examples that come to mind are HP/armor/attacks (splitting dice and bonuses). e.g:

    ...
    "monsters": [
        {
            "name": "Aboleth",
            "size": "Large",
            "type": "aberration",
            "alignment": "lawful evil",
            "armor_class": "17 (natural armor)",
            "hit_points": "135 (18d10 + 36)",
            "speed": "10 ft., swim 40 ft.",
            ... // more stuff

into something like:

    ...
    "monsters": [
        {
            "name": "Aboleth",
            "size": "Large",
            "type": "aberration",
            "alignment": "lawful evil",
            "armor": {
                "class": 17,
                "type": "natural armor"
            },
            "hit_points": {
                "avg": 135,
                "formula": "18d10 + 36"     // alternative 1
                "roll": "18d10",                   // alternative 2
                "bonus": 36
            }
            "speed": {
                "walk": "10 ft.",           // alternative 1
                "swim": {                     // alternative 2
                    "value": 40 ,
                    "units": "feet",
                }
            },
            ... // more stuff
JustinJM76 commented 1 year ago

I think this is a great suggestion. We'll take a look at it over the next couple of days. Thanks for your interest in the project.