Skip to content

Data Models + Sheet Improvements

Matheus Clemente requested to merge mclemente/pbta:beta into master

This originally was planned to include Playbook Improvements from #93, but it proved more complex that I thought, so it will be pushed back for a later release.

Changes

  • Added Data Models (#91).
  • Added globalThis.pbta, which is also accessible through game.pbta as before.
    • Added access to document sheets (game.pbta.applications) and roll handler (game.pbta.dice).
    • Moved documents to game.pbta.documents.
  • Added conditionCount to RollData, which means it is now possible to make rolls such as 2d6 + @conditionCount.
  • Added CONFIG.PBTA.playbooks, which lists all playbooks available.
  • Added attributes of type Clock, Resource and Number as Trackable Attributes for Tokens (Closes #105 (closed)).
  • Fixed adding/removing entire Attribute Groups (e.g. the whole Top/Left panel) not updating old actors.
  • Fixed Stats not showing up on Move sheets (Closes #101 (closed), #102 (closed), #103 (closed)).
  • Fixed Roll Shifting rendering issues (Closes #100 (closed)).
  • Fixed Condition descriptions with certain number-dash combinations (e.g. "1-fatigue") being handled as bonuses (Closes 59).
  • Moved the system's Game Settings sidebar buttons to their own section and removed the system setting that hid them.
  • Removed the icons that were bundled with the system since they are present on FoundryVTT. A migration will update documents to avoid broken links.

Playbook Improvements

  • Added a Details tab to the Playbook sheet. Visible to GMs only.
    • Added PbtA ID (variable name: slug), which is an url-safe string meant to be unique among playbooks. It is meant to be used throughout the system and supporting modules.
    • Added Actor Type, described below on Item Sheet.
  • A Playbook's PbtA ID is added as a CSS class to the Actor sheets as .playbook-[PbtA ID].
    • For example: "The Chosen" becomes playbook-the-chosen.

Actor Sheet

  • Added a "limited" sheet which only shows an actor's name and its descriptions (Closes #95 (closed)).
  • Added "Stat Clock" feature. This adds a set number of buttons that simulates XP, for mechanics similar to Apocalypse World: Burned Over.
  • Added "Stat Shift" feature. This adds a "Stat" to the list that let's you enhance a Stat up/down, for mechanics similar to the Masks.
  • Added changing moves/equipments between categories by dragging and dropping them. This also works for items without a category being dropped onto the category (Closes #38 (closed)).
  • Replaced the Playbook's input with a selector.
  • Moved the Stats' dice icons to the top of the box.
  • Fixed Stat Toggle not adding the Stat's value.

Item Sheet

  • Added Actor Type field to Equipment, Move and Playbook items.
    • Visible only if not owned and if there are more than 1 valid actor type for the item.
    • Sets which actor type's data will be used to fill in fields such as Equipment Type and Move Type. On Playbook's case, it is used to differentiate between Playbooks that are exclusive to a certain actor type.

Sheet Configuration

  • Added "Stat Clocks" TOML configuration.
statClocks = 4
  • Added "Stat Shifting" TOML configuration (Closes #96 (closed)).
statShifting = true
# or
[statShifting]
  # Everything is optional. Values shown are the defaults for English localization
  label = "Stat Shift" # String shown on Character Sheet. Otherwise localize "{stat} Shift"
  value = 1 # The value to be shifted up/down
  stat = "Stat" # String used to localize the label
  stats = "Stats" # String used to localize "Character shifts {stats}" on Chat Message
  • Added playbook property to actor attributes. You can set either a playbook's name or slug (e.g. "The Chosen" or "the-chosen") and it will only be displayed if an actor has the chosen playbook.
[character.attributesTop.foo]
  type = "Clock"
  label = "Foo"
  playbook = "The Chosen" # or "the-chosen"
  • The moveTypes can now be created as objects (e.g. [character.moveTypes.basic]) and accept the following properties: label, playbook, creation (Closes #41 (closed)).
[character.moveTypes.basic]
  label = "Basic Moves"
  creation = true # (Optional) Will add all Moves with this move type when creating a character.
  playbook = false # (Optional) Moves with this move type will display a Playbook field.
  • Added a description attribute to actors, which add new description editors to the Description tab (Closes #97 (closed)).
[character.description.foo]
  label = "Foo" # The label shown if there are more than one description. Defaults to the key if not set (e.g. "foo").
  value = "Lorem ipsum" # (Optional. Default: "") The description's text when an actor is created.
  limited = false # (Optional, default: true) The visibility of this field on the Limited sheet.
  • The ListOne and ListMany attributes now have an optional sort boolean property to sort its options based on labels (#22).

Localization

  • "Equipment Type" and "Move Type" became "Category".

Development

  • Added JSDoc to devDependencies to better document the project.
  • Added a #times Handlebars helper that loops a block of code, similar to #each.
  • (BREAKING) Added bundling to the JS files.
  • Added sourcemap to the CSS.
  • Added support for modules to include changes to the DataModel.migrateData by adding a function to game.pbta.sheetMigration.
  • (BREAKING) Renamed Handlebars Partials.
  • (BREAKING) game.pbta.utils.getPlaybooks() function has been refactored to only update the CONFIG.PBTA.playbooks list. To get the names/labels in the list (generally used for Item Sheets), use the new game.pbta.utils.getPlaybookLabels() function.
  • (BREAKING) Migrated actor.system.resources.rollFormula.value to actor.system.resources.rollFormula.
  • (BREAKING) Migrated actor.system.details.playbook to actor.system.playbook.
  • (BREAKING) Migrated actor.system.details.biography to actor.system.details.biography.value.
  • Removed duplicated scripts/lib/codemirror.toml.js in favor of the similar file under module/forms.

Module Compatibility

Modules that were tested with no issues related to the above changes or that have Merge/Pull Requests with solutions.

  • Monster of the Week
  • Fantasy World RPG
  • Root
  • Rhapsody of Blood
  • Masks: A New Generation (unofficial)
    • Masks: A New Generation Sheets
Edited by Matheus Clemente

Merge request reports