diff --git a/css/ds4.css b/css/ds4.css index c0ddd652..17160adc 100644 --- a/css/ds4.css +++ b/css/ds4.css @@ -26,6 +26,11 @@ padding: 0; } +.grid-1col { + grid-column: span 1 / span 1; + grid-template-columns: repeat(1, minmax(0, 1fr)); +} + .grid-3col { grid-column: span 3 / span 3; grid-template-columns: repeat(3, minmax(0, 1fr)); diff --git a/lang/en.json b/lang/en.json index f6007966..b73e6081 100644 --- a/lang/en.json +++ b/lang/en.json @@ -18,6 +18,22 @@ "DS4.ItemAvailabilityCity": "City", "DS4.ItemAvailabilityElves": "Elves", "DS4.ItemAvailabilityDwarves": "Dwarves", + "DS4.ItemAvailabilityNone": "None", "DS4.ItemTypeWeapon": "Weapon", - "DS4.ItemTypeEquipment": "Equipment" + "DS4.ItemTypeArmor": "Armor", + "DS4.ItemTypeShield": "Shield", + "DS4.ItemTypeTrinket": "Trinket", + "DS4.ItemTypeEquipment": "Equipment", + "DS4.ArmorType": "Armor Type", + "DS4.ArmorMaterialType": "Material Type", + "DS4.ArmorValue": "Armor Value", + "DS4.ArmorTypeBody": "Body", + "DS4.ArmorTypeHelmet": "Helmet", + "DS4.ArmorTypeVambrace": "Vambrace", + "DS4.ArmorTypeGreaves": "Greaves", + "DS4.ArmorTypeVambraceGreaves": "Vambrace + Greaves", + "DS4.ArmorMaterialTypeCloth": "Cloth", + "DS4.ArmorMaterialTypeLeather": "Leather", + "DS4.ArmorMaterialTypeChain": "Chain", + "DS4.ArmorMaterialTypePlate": "Plate" } diff --git a/module/config.js b/module/config.js index acf5ea0d..cdd53556 100644 --- a/module/config.js +++ b/module/config.js @@ -29,6 +29,7 @@ DS4.itemAvailabilities = { city: "DS4.ItemAvailabilityCity", elves: "DS4.ItemAvailabilityElves", dwarves: "DS4.ItemAvailabilityDwarves", + none: "DS4.ItemAvailabilityNone", }; /** @@ -37,5 +38,31 @@ DS4.itemAvailabilities = { */ DS4.itemTypes = { weapon: "DS4.ItemTypeWeapon", + armor: "DS4.ItemTypeArmor", + shield: "DS4.ItemTypeShield", + trinket: "DS4.ItemTypeTrinket", equipment: "DS4.ItemTypeEquipment", }; + +/** + * * Define the set of armor types, a character may only wear one item of each at any given time + * @type {Object} + */ +DS4.armorTypes = { + body: "DS4.ArmorTypeBody", + helment: "DS4.ArmorTypeHelmet", + vambrace: "DS4.ArmorTypeVambrace", + greaves: "DS4.ArmorTypeGreaves", + vambraceGreaves: "DS4.ArmorTypeVambraceGreaves", +}; + +/** + * * Define the set of armor materials, used to determine if a characer may wear the armor without additional penalties + * @type {Object} + */ +DS4.armorMaterialTypes = { + cloth: "DS4.ArmorMaterialTypeCloth", + leather: "DS4.ArmorMaterialTypeLeather", + chain: "DS4.ArmorMaterialTypeChain", + plate: "DS4.ArmorMaterialTypePlate", +}; diff --git a/module/ds4.js b/module/ds4.js index 8ef0fba6..95f86ec9 100644 --- a/module/ds4.js +++ b/module/ds4.js @@ -26,8 +26,15 @@ Hooks.once("init", async function () { Actors.registerSheet("ds4", DS4ActorSheet, { makeDefault: true }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("ds4", DS4ItemSheet, { makeDefault: true }); + + registerHandlebarsPartials(); }); +async function registerHandlebarsPartials() { + const templatePaths = ["systems/ds4/templates/item/partials/description.hbs"]; + return loadTemplates(templatePaths); +} + /* -------------------------------------------- */ /* Foundry VTT Setup */ /* -------------------------------------------- */ @@ -37,7 +44,7 @@ Hooks.once("init", async function () { */ Hooks.once("setup", function () { // Localize CONFIG objects once up-front - const toLocalize = ["attackTypes", "itemAvailabilities", "itemTypes"]; + const toLocalize = ["attackTypes", "itemAvailabilities", "itemTypes", "armorTypes", "armorMaterialTypes"]; // Exclude some from sorting where the default order matters const noSort = []; diff --git a/scss/global/_grid.scss b/scss/global/_grid.scss index bbdfb3ec..21b14001 100644 --- a/scss/global/_grid.scss +++ b/scss/global/_grid.scss @@ -7,6 +7,11 @@ padding: 0; } +.grid-1col { + grid-column: span 1 / span 1; + grid-template-columns: repeat(1, minmax(0, 1fr)); +} + .grid-3col { grid-column: span 3 / span 3; grid-template-columns: repeat(3, minmax(0, 1fr)); diff --git a/template.json b/template.json index 47b675be..d528720f 100644 --- a/template.json +++ b/template.json @@ -46,7 +46,7 @@ } }, "Item": { - "types": ["weapon", "equipment"], + "types": ["weapon", "armor", "shield", "trinket", "equipment"], "templates": { "base": { "description": "" @@ -54,16 +54,32 @@ "physical": { "quantity": 1, "price": 0, - "availability": "Hamlet" + "availability": "none" + }, + "equipable": { + "equipped": false } }, "weapon": { - "templates": ["base", "physical"], + "templates": ["base", "physical", "equipable"], "attackType": "melee", "weaponBonus": 0, "opponentDefense": 0, "properties": {} }, + "armor": { + "templates": ["base", "physical", "equipable"], + "armorMaterialType": "cloth", + "armorType": "body", + "armorValue": 0 + }, + "shield": { + "templates": ["base", "physical", "equipable"], + "armorValue": 0 + }, + "trinket": { + "templates": ["base", "physical", "equipable"] + }, "equipment": { "templates": ["base", "physical"] } diff --git a/templates/item/armor-sheet.hbs b/templates/item/armor-sheet.hbs new file mode 100644 index 00000000..64974483 --- /dev/null +++ b/templates/item/armor-sheet.hbs @@ -0,0 +1,54 @@ +
+
+ +
+

+

{{localize (lookup config.itemTypes item.type)}}

+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + {{!-- Sheet Tab Navigation --}} + + + {{!-- Sheet Body --}} +
+ + {{!-- Description Tab --}} + {{> systems/ds4/templates/item/partials/description.hbs}} + + {{!-- Attributes Tab --}} +
+ {{!-- As you add new fields, add them in here! --}} +
+
+
\ No newline at end of file diff --git a/templates/item/equipment-sheet.hbs b/templates/item/equipment-sheet.hbs new file mode 100644 index 00000000..79d4832a --- /dev/null +++ b/templates/item/equipment-sheet.hbs @@ -0,0 +1,27 @@ +
+
+ +
+

+

{{localize (lookup config.itemTypes item.type)}}

+
+
+ + {{!-- Sheet Tab Navigation --}} + + + {{!-- Sheet Body --}} +
+ + {{!-- Description Tab --}} + {{> systems/ds4/templates/item/partials/description.hbs}} + + {{!-- Attributes Tab --}} +
+ {{!-- As you add new fields, add them in here! --}} +
+
+
\ No newline at end of file diff --git a/templates/item/partials/description.hbs b/templates/item/partials/description.hbs new file mode 100644 index 00000000..5d46f9b5 --- /dev/null +++ b/templates/item/partials/description.hbs @@ -0,0 +1,24 @@ +
+
+
+ + +
+
+ + +
+
+ + +
+ +
+ {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
\ No newline at end of file diff --git a/templates/item/shield-sheet.hbs b/templates/item/shield-sheet.hbs new file mode 100644 index 00000000..ae1166f9 --- /dev/null +++ b/templates/item/shield-sheet.hbs @@ -0,0 +1,34 @@ +
+
+ +
+

+

{{localize (lookup config.itemTypes item.type)}}

+
+
+ + +
+
+
+
+ + {{!-- Sheet Tab Navigation --}} + + + {{!-- Sheet Body --}} +
+ + {{!-- Description Tab --}} + {{> systems/ds4/templates/item/partials/description.hbs}} + + {{!-- Attributes Tab --}} +
+ {{!-- As you add new fields, add them in here! --}} +
+
+
\ No newline at end of file diff --git a/templates/item/trinket-sheet.hbs b/templates/item/trinket-sheet.hbs new file mode 100644 index 00000000..79d4832a --- /dev/null +++ b/templates/item/trinket-sheet.hbs @@ -0,0 +1,27 @@ +
+
+ +
+

+

{{localize (lookup config.itemTypes item.type)}}

+
+
+ + {{!-- Sheet Tab Navigation --}} + + + {{!-- Sheet Body --}} +
+ + {{!-- Description Tab --}} + {{> systems/ds4/templates/item/partials/description.hbs}} + + {{!-- Attributes Tab --}} +
+ {{!-- As you add new fields, add them in here! --}} +
+
+
\ No newline at end of file diff --git a/templates/item/weapon-sheet.hbs b/templates/item/weapon-sheet.hbs index fab7812d..4c0f89be 100644 --- a/templates/item/weapon-sheet.hbs +++ b/templates/item/weapon-sheet.hbs @@ -39,30 +39,7 @@
{{!-- Description Tab --}} -
-
-
- - -
-
- - -
-
- - -
- -
- {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} -
+ {{> systems/ds4/templates/item/partials/description.hbs}} {{!-- Attributes Tab --}}