Skip to content

asacolips-projects/pbta

Repository files navigation

Foundry v11 Foundry v12

Screenshot of the PbtA system

Description

Build campaigns compatible with (most) Powered by the Apocalypse RPGs using Foundry VTT! This system is a sandbox that will allow you to configure a custom sheet (see Usage below for documentation) or to extend with modules that provide prebuilt sheets, such as the Monsters of the Week or MASKS modules.

Installation

  1. Go to the Game Systems tab in the Foundry setup page.
  2. Click Install System
  3. Search for pbta or Powered by the Apocalypse
  4. Install the system

Usage

Go to the documentation for more details on how to use and configure the system once have it installed.

Overriding Sheet Config in a Module

If you would like to create a module that supplies its own sheet out of the box without requiring users to configure their own TOML sheet config, add the following to your module's JS. The object that you use for game.pbta.sheetConfig must be consistent with the output generated by the system's TOML parser; it's recommended that you define your sheet using the system's sheet config and then run console.log(game.pbta.sheetConfig) to get a copy of the parsed object that you can then copy and paste into your module. If you're currently using tags as items or in a compendium, you can retrieve those as well using console.log(game.pbta.PbtaUtility.getDeprecatedTagList()) In the example below, I'm using the sheet config for Apocalypse World from the system's documentation.

Hooks.once('pbtaSheetConfig', () => {
  // Disable the sheet config form.
  game.settings.set('pbta', 'sheetConfigOverride', true);
  // Define custom tags.
  game.pbta.tagConfigOverride = {
    // Tags available to any actor and item
    general: '[{"value":"fire"},{"value":"water"},{"value":"earth"},{"value":"air"}]',
    actor: {
      // Tags available to all actors
      all: '[{"value":"person"}]',
      // Tags available to a specific actor type set up on game.pbta.sheetConfig.actorTypes (e.g. "character", "npc")
      character: '[{"value":"mook"}]'
    },
    item: {
      // Tags available to all actors
      all: '[{"value":"consumable"}]',
      // Tags available to a specific item type (e.g. "equipment", "move")
      move: '[{"value":"sword"}]'
    }
  }
  // Replace the game.pbta.sheetConfig with your own version.
  game.pbta.sheetConfig = {
    "rollFormula": "2d6",
    "statToggle": {
      "label": "Highlight",
      "modifier": 0
    },
    "rollResults": {
      "failure": {
        "start": null,
        "end": 6,
        "label": "Complications..."
      },
      "partial": {
        "start": 7,
        "end": 9,
        "label": "Partial success"
      },
      "success": {
        "start": 10,
        "end": 12,
        "label": "Success!"
      }
    },
    "actorTypes": {
      "character": {
        "stats": {
          "cool": {
            "label": "Cool",
            "value": 0
          },
          "hard": {
            "label": "Hard",
            "value": 0
          },
          "hot": {
            "label": "Hot",
            "value": 0
          },
          "sharp": {
            "label": "Sharp",
            "value": 0
          },
          "weird": {
            "label": "Weird",
            "value": 0
          }
        },
        "attrTop": {
          "harm": {
            "label": "Harm",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "Clock",
            "value": 0,
            "max": 6,
            "steps": [
              false,
              false,
              false,
              false,
              false,
              false
            ]
          },
          "armor": {
            "label": "Armor",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "Number",
            "value": 0
          },
          "hold": {
            "label": "Hold",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "Resource",
            "value": 0,
            "max": 0
          },
          "xp": {
            "label": "Xp",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "Xp",
            "value": 0,
            "max": 5,
            "steps": [
              false,
              false,
              false,
              false,
              false
            ]
          }
        },
        "attrLeft": {
          "harmConditions": {
            "label": "Harm Conditions",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "ListMany",
            "condition": false,
            "options": {
              "0": {
                "label": "Stabilized",
                "value": false
              },
              "1": {
                "label": "Shattered (-1COOL)",
                "value": false
              },
              "2": {
                "label": "Crippled (-1HARD)",
                "value": false
              },
              "3": {
                "label": "Disfigured (-1HOT)",
                "value": false
              },
              "4": {
                "label": "Broken (-1SHARP)",
                "value": false
              }
            }
          },
          "improvement": {
            "label": "Improvement",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "LongText",
            "value": ""
          },
          "hx": {
            "label": "HX",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "LongText",
            "value": ""
          },
          "look": {
            "label": "Look",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "LongText",
            "value": ""
          },
          "special": {
            "label": "Playbook Special",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "LongText",
            "value": ""
          }
        },
        "moveTypes": {
          "basic": {
            "label": "Basic Moves",
            "moves": []
          },
          "peripheral": {
            "label": "Peripheral Moves",
            "moves": []
          },
          "class": {
            "label": "Class Moves",
            "moves": []
          }
        },
        "equipmentTypes": {
          "gear": {
            "label": "Gear",
            "moves": []
          },
          "barter": {
            "label": "Barter",
            "moves": []
          }
        }
      },
      "npc": {
        "attrTop": {
          "harm": {
            "label": "Harm",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "Resource",
            "value": 0,
            "max": 0
          },
          "gender": {
            "label": "Gender",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "Text",
            "value": ""
          },
          "age": {
            "label": "Age",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "Text",
            "value": ""
          }
        },
        "attrLeft": {
          "look": {
            "label": "Look",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "LongText",
            "value": ""
          },
          "drive": {
            "label": "Drive",
            "description": null,
            "customLabel": false,
            "userLabel": false,
            "type": "LongText",
            "value": ""
          }
        },
        "moveTypes": {
          "mc": {
            "label": "MC Moves",
            "moves": []
          }
        }
      }
    }
  };
});

Contributing

This project is accepting issue reports and code merge requests! See the CONTRIBUTING.MD page for details.

Translations

If you would like to contribute translations directly to the system, they're written using YAML and are under src/yaml/lang, and the repo includes build tools to convert them back into JSON. If you prefer writing in JSON, you can convert from JSON to YAML at https://www.json2yaml.com/

Running builds

This repo includes a src directory with all of its actual code, and it compiles that to a dist directory that's ignored by the repo's gitignore.

To build the project, you'll need the current LTS version of Node.js (or the current release, if preferred) installed. From there, you can build with the following commands in the root of the repo:

npm ci
npm run build

There are several additional run commands defined in the scripts section of package.json, but the build command will run all relevant Gulp tasks. If you would prefer to run the compiler constantly, you can instead use npm run watch to do the same thing and watch for new changes.

Once the repo has been built, you should symlink the contents of the dist directory to your Foundry installation's systems directory using the name pbta for the linked directory.

Licensing

All HTML, CSS, and JS is licensed under the MIT license.