From 0beabfa5957701c22dd52cd165fe9dc5efeb2de6 Mon Sep 17 00:00:00 2001 From: Haxxer Date: Sun, 2 Jul 2023 21:43:45 +0100 Subject: [PATCH] Added support for blade runner system --- changelog.md | 1 + docs/README.md | 1 + src/systems.js | 4 ++ src/systems/blade-runner.js | 110 ++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 src/systems/blade-runner.js diff --git a/changelog.md b/changelog.md index aec4a8d4..ce0e6359 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## Version 2.7.0 - Updated Polish, French, and Chinese (Simplified) localization (thank you Lioheart, rectulo, and TravelingK on Weblate!) +- Added support for the Blade Runner system (thank you Stefouch on github!) - Added a "Restrict Access" setting and "View" permissions to vault access configuration - with these two configured, only characters with the permissions set up can view the contents of the vault - Added services to the "Populate Items" tab in merchants, and buttons to clear them - Added an export button to the settings UI to export and import the system specific settings diff --git a/docs/README.md b/docs/README.md index 6883532c..1d351d5b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -79,6 +79,7 @@ Item Piles is designed to work in all systems, but may require some setup for it - [Savage Worlds Adventure Edition](https://foundryvtt.com/packages/swade) - [Tormenta20](https://foundryvtt.com/packages/tormenta20) - [Warhammer Fantasy Roleplay 4th Ed](https://foundryvtt.com/packages/wfrp4e) +- [Blade Runner](https://foundryvtt.com/packages/blade-runner) - [Splittermond](https://foundryvtt.com/packages/splittermond) - [Starfinder](https://foundryvtt.com/packages/sfrpg) - [Star Wars: Saga Edition](https://github.com/kypvalanx/Foundry-VTT-StarWars-SagaEdition) diff --git a/src/systems.js b/src/systems.js index b3723ea4..5d41b275 100644 --- a/src/systems.js +++ b/src/systems.js @@ -31,6 +31,7 @@ import a5e from "./systems/a5e.js"; import darkHeresy2e from "./systems/dark-heresy.js"; import naheulbeuk from "./systems/naheulbeuk.js"; import icrpgme from "./systems/icrpgme.js"; +import bladeRunner from "./systems/blade-runner.js"; // ↑ IMPORT SYSTEMS HERE ↑ /** @@ -60,6 +61,9 @@ export const SYSTEMS = { "d35e": { "latest": d35e }, + "blade-runner": { + "latest": bladeRunner + }, "sfrpg": { "latest": sfrpg }, diff --git a/src/systems/blade-runner.js b/src/systems/blade-runner.js new file mode 100644 index 00000000..b0c6b1da --- /dev/null +++ b/src/systems/blade-runner.js @@ -0,0 +1,110 @@ +export default { + + "VERSION": "1.0.0", + + // The actor class type is the type of actor that will be used for the default item pile actor that is created on first item drop. + "ACTOR_CLASS_TYPE": "loot", + + // The item quantity attribute is the path to the attribute on items that denote how many of that item that exists + "ITEM_QUANTITY_ATTRIBUTE": "system.qty", + + // The item price attribute is the path to the attribute on each item that determine how much it costs + "ITEM_PRICE_ATTRIBUTE": "system.cost", + + // Item filters actively remove items from the item pile inventory UI that users cannot loot, such as spells, feats, and classes + "ITEM_FILTERS": [ + { + "path": "type", + "filters": "upgrade,specialty,injury" + } + ], + + "UNSTACKABLE_ITEM_TYPES": ["weapon", "armor"], + + "PILE_DEFAULTS": { + merchantColumns: [{ + label: "FLBR.ItemAvailability", + path: "system.availability", + formatting: "{#}", + mapping: { + 5: 'FLBR.ITEM_AVAILABILITY.Incidental', + 4: 'FLBR.ITEM_AVAILABILITY.Standard', + 3: 'FLBR.ITEM_AVAILABILITY.Premium', + 2: 'FLBR.ITEM_AVAILABILITY.Rare', + 1: 'FLBR.ITEM_AVAILABILITY.Luxury', + } + }] + }, + + // This function is an optional system handler that specifically transforms an item when it is added to actors + "ITEM_TRANSFORMER": async (itemData) => { + if (itemData?.system?.mounted) itemData.system.mounted = false; + return itemData; + }, + + // Item similarities determines how item piles detect similarities and differences in the system + "ITEM_SIMILARITIES": ["name", "type"], + + // Currencies in item piles is a versatile system that can accept actor attributes (a number field on the actor's sheet) or items (actual items in their inventory) + // In the case of attributes, the path is relative to the "actor.system" + // In the case of items, it is recommended you export the item with `.toObject()` and strip out any module data + "CURRENCIES": [ + { + type: "attribute", + name: "FLBR.HEADER.ChinyenPoints", + img: "icons/commodities/currency/coins-plain-stack-silver.webp", + abbreviation: "{#}C¥", + data: { + path: "system.metaCurrencies.chinyen", + }, + primary: true, + exchangeRate: 1 + }, + { + type: "attribute", + name: "FLBR.HEADER.PromotionPoints", + img: "icons/commodities/treasure/medal-ribbon-gold-blue.webp", + abbreviation: "{#}PP", + data: { + path: "system.metaCurrencies.promotion", + }, + primary: false, + exchangeRate: 1 + }, + { + type: "attribute", + name: "FLBR.HEADER.HumanityPoints", + img: "icons/sundries/gaming/chess-knight-white.webp", + abbreviation: "{#}HP", + data: { + path: "system.metaCurrencies.humanity", + }, + primary: false, + exchangeRate: 1 + } + ], + + "VAULT_STYLES": [ + { + path: "system.availability", + value: 1, + styling: { + "box-shadow": "inset 0px 0px 7px 0px rgba(255,119,0,1)" + } + }, + { + path: "system.availability", + value: 2, + styling: { + "box-shadow": "inset 0px 0px 7px 0px rgba(255,0,247,1)" + } + }, + { + path: "system.availability", + value: 3, + styling: { + "box-shadow": "inset 0px 0px 7px 0px rgba(0,136,255,1)" + } + } + ] +}