Skip to content

Commit

Permalink
Merge pull request #553 from EndlesNights/master
Browse files Browse the repository at this point in the history
Update dnd4e support
  • Loading branch information
Haxxer authored Apr 11, 2024
2 parents 89f0561 + cb8e2e9 commit 5b210d5
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/systems.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// ↓ IMPORT SYSTEMS HERE ↓
import dnd4e from "./systems/dnd4e.js";
import dnd4e0443 from "./systems/dnd4e-0.4.43.js";
import dnd5e from "./systems/dnd5e.js";
import dnd5e203 from "./systems/dnd5e-2.0.3.js";
import pf1 from "./systems/pf1.js";
Expand Down Expand Up @@ -52,7 +53,8 @@ export const SYSTEMS = {
"latest": alienrpg
},
"dnd4e": {
"latest": dnd4e
"latest": dnd4e,
"0.4.43": dnd4e0443,
},
"dnd5e": {
"latest": dnd5e,
Expand Down
151 changes: 151 additions & 0 deletions src/systems/dnd4e-0.4.43.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
export default {

"VERSION": "1.0.4",

// 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": "Player Character",

// 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.quantity",

// The item price attribute is the path to the attribute on each item that determine how much it costs
"ITEM_PRICE_ATTRIBUTE": "system.price",

// 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": "classFeats,feat,raceFeats,pathFeats,destinyFeats,ritual,power"
}
],

// This function is an optional system handler that specifically transforms an item when it is added to actors
"ITEM_TRANSFORMER": async (itemData) => {
["equipped", "proficient", "prepared"].forEach(key => {
if (itemData?.system?.[key] !== undefined) {
delete itemData.system[key];
}
});
setProperty(itemData, "system.attunement", 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: "DND4EBETA.CurrencyAD",
img: "icons/commodities/gems/gem-faceted-round-white.webp",
abbreviation: "{#}AD",
data: {
path: "system.currency.ad"
},
primary: false,
exchangeRate: 10000
},
{
type: "attribute",
name: "DND4EBETA.CurrencyPP",
img: "icons/commodities/currency/coin-inset-snail-silver.webp",
abbreviation: "{#}PP",
data: {
path: "system.currency.pp"
},
primary: false,
exchangeRate: 100
},
{
type: "attribute",
name: "DND4EBETA.CurrencyGP",
img: "icons/commodities/currency/coin-embossed-crown-gold.webp",
abbreviation: "{#}GP",
data: {
path: "system.currency.gp",
},
primary: true,
exchangeRate: 1
},
{
type: "attribute",
name: "DND4EBETA.CurrencySP",
img: "icons/commodities/currency/coin-engraved-moon-silver.webp",
abbreviation: "{#}SP",
data: {
path: "system.currency.sp",
},
primary: false,
exchangeRate: 0.1
},
{
type: "attribute",
name: "DND4EBETA.CurrencyCP",
img: "icons/commodities/currency/coin-engraved-waves-copper.webp",
abbreviation: "{#}CP",
data: {
path: "system.currency.cp",
},
primary: false,
exchangeRate: 0.01
},
{
type: "attribute",
name: "DND4EBETA.RitualCompAR",
img: "icons/commodities/materials/bowl-powder-teal.webp",
abbreviation: "{#}AR",
data: {
path: "system.ritualcomp.ar",
},
primary: false,
exchangeRate: 1
},
{
type: "attribute",
name: "DND4EBETA.RitualCompMS",
img: "icons/commodities/materials/bowl-liquid-white.webp",
abbreviation: "{#}MS",
data: {
path: "system.ritualcomp.ms",
},
primary: false,
exchangeRate: 1
},
{
type: "attribute",
name: "DND4EBETA.RitualCompRH",
img: "icons/commodities/materials/plant-sprout-seed-brown-green.webp",
abbreviation: "{#}RH",
data: {
path: "system.ritualcomp.rh",
},
primary: false,
exchangeRate: 1
},
{
type: "attribute",
name: "DND4EBETA.RitualCompSI",
img: "icons/commodities/materials/bowl-liquid-red.webp",
abbreviation: "{#}SI",
data: {
path: "system.ritualcomp.si",
},
primary: false,
exchangeRate: 1
},
{
type: "attribute",
name: "DND4EBETA.RitualCompRS",
img: "icons/commodities/gems/gem-faceted-cushion-teal.webp",
abbreviation: "{#}RS",
data: {
path: "system.ritualcomp.rs",
},
primary: false,
exchangeRate: 1
}
]
}
22 changes: 11 additions & 11 deletions src/systems/dnd4e.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {

"VERSION": "1.0.4",
"VERSION": "1.0.5",

// 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": "Player Character",
Expand Down Expand Up @@ -48,7 +48,7 @@ export default {
"CURRENCIES": [
{
type: "attribute",
name: "DND4EBETA.CurrencyAD",
name: "DND4E.CurrencyAD",
img: "icons/commodities/gems/gem-faceted-round-white.webp",
abbreviation: "{#}AD",
data: {
Expand All @@ -59,7 +59,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.CurrencyPP",
name: "DND4E.CurrencyPP",
img: "icons/commodities/currency/coin-inset-snail-silver.webp",
abbreviation: "{#}PP",
data: {
Expand All @@ -70,7 +70,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.CurrencyGP",
name: "DND4E.CurrencyGP",
img: "icons/commodities/currency/coin-embossed-crown-gold.webp",
abbreviation: "{#}GP",
data: {
Expand All @@ -81,7 +81,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.CurrencySP",
name: "DND4E.CurrencySP",
img: "icons/commodities/currency/coin-engraved-moon-silver.webp",
abbreviation: "{#}SP",
data: {
Expand All @@ -92,7 +92,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.CurrencyCP",
name: "DND4E.CurrencyCP",
img: "icons/commodities/currency/coin-engraved-waves-copper.webp",
abbreviation: "{#}CP",
data: {
Expand All @@ -103,7 +103,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.RitualCompAR",
name: "DND4E.RitualCompAR",
img: "icons/commodities/materials/bowl-powder-teal.webp",
abbreviation: "{#}AR",
data: {
Expand All @@ -114,7 +114,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.RitualCompMS",
name: "DND4E.RitualCompMS",
img: "icons/commodities/materials/bowl-liquid-white.webp",
abbreviation: "{#}MS",
data: {
Expand All @@ -125,7 +125,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.RitualCompRH",
name: "DND4E.RitualCompRH",
img: "icons/commodities/materials/plant-sprout-seed-brown-green.webp",
abbreviation: "{#}RH",
data: {
Expand All @@ -136,7 +136,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.RitualCompSI",
name: "DND4E.RitualCompSI",
img: "icons/commodities/materials/bowl-liquid-red.webp",
abbreviation: "{#}SI",
data: {
Expand All @@ -147,7 +147,7 @@ export default {
},
{
type: "attribute",
name: "DND4EBETA.RitualCompRS",
name: "DND4E.RitualCompRS",
img: "icons/commodities/gems/gem-faceted-cushion-teal.webp",
abbreviation: "{#}RS",
data: {
Expand Down

0 comments on commit 5b210d5

Please sign in to comment.