foundryvtt / dnd5e

An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com).
MIT License
339 stars 226 forks source link

Add spellcasting section to actor data with more detailed information & multiple spellcasting class support #1618

Open arbron opened 2 years ago

arbron commented 2 years ago

Currently spellcasting configuration is represented very simply in actor data using attributes.spellcasting and attributes.spelldc which isn't able to represent the complexities of actor's with multiple spellcasting classes. Replacing these values with a top-level spellcasting definition with more detailed information would be a major step towards #1580.

"spellcasting": {
  "default": {
    "type": "pact",
    "progression": "full",
    "ability": "cha",
    "preparation": false,
    "ritual": false,
    "mod": 3
    "attack": 4,       // Higher than base mod because of an item like Rod of the Pact Keeper
    "save": 14,
  },
  "defaultClass": "warlock",
  "classes": {
    "cleric": {
      "type": "leveled",
      "progression": "full",
      "ability": "wis",
      "preparation": true,
      "ritual": true,
      "mod": 1,
      "attack": 1,
      "save": 11
    },
    "warlock": {
      // Same as `default` above
    }
  }
}
arbron commented 2 years ago

In addition, the should also add the ability to have bonuses that target the spell save DC & spell attack modifier for individual classes to make something like a "Rod of the Pact Keeper" possible.

"bonuses": {  // Expanding the existing bonuses section in character data
  "spell": {
    "attack": 0,
    "dc": 0,
    "class": {
      "warlock": {
        "attack": 1,
        "save": 1
      },
      "cleric": {
        "attack": 0,
        "save": 0
      }
    }
  }
}

These can be configurable from the spellbook page for each class, rather than from the special traits menu like the global ones are currently.

These would all be strictly numeric bonuses, still leaving in the @bonuses.rsak.attack and @bonuses.msak.attack values to allow for dice-based modifiers. This will ensure that numeric values can be properly calculated and displayed on the spellbook page.