diff --git a/CHANGELOG.md b/CHANGELOG.md index 8085d977..2c872b59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - 5e now shows proper lift capacities for STR values under 5. [#709](https://github.com/dmdorman/hero6e-foundryvtt/issues/709) - Skill levels now apply when rolling skills. Skill rolls can now auto succeed or fail. - A number of perks/talents/disadvantages/complications should now be rollable and can be dragged to the macro bar too. +- AOE no longer needs to be associated with an attack power. [#779](https://github.com/dmdorman/hero6e-foundryvtt/issues/779) ## Version 3.0.59 diff --git a/module/config.js b/module/config.js index 3f2ae595..9978a126 100644 --- a/module/config.js +++ b/module/config.js @@ -282,7 +282,7 @@ HERO.powers5e = []; */ function addPower(powerDescription6e, powerOverrideFor5e) { if (powerDescription6e) { - HERO.powers6e.push(powerDescription6e); + HERO.powers6e.push(foundry.utils.deepClone(powerDescription6e)); } if (powerOverrideFor5e) { @@ -1159,7 +1159,7 @@ function addPower(powerDescription6e, powerOverrideFor5e) { { key: "KNOWLEDGE_SKILL", type: ["skill"], - behaviors: [], + behaviors: ["success"], costPerLevel: 1, }, {}, @@ -1309,7 +1309,7 @@ function addPower(powerDescription6e, powerOverrideFor5e) { { key: "PROFESSIONAL_SKILL", type: ["skill"], - behaviors: [], + behaviors: ["success"], }, {}, ); diff --git a/module/item/item.js b/module/item/item.js index 66cfcf46..6d79859a 100644 --- a/module/item/item.js +++ b/module/item/item.js @@ -1152,6 +1152,11 @@ export class HeroSystem6eItem extends Item { } } + const aoeModifier = this.getAoeModifier(); + if (aoeModifier) { + this.buildAoeAttackParameters(aoeModifier); + } + if (this.system.XMLID == "COMBAT_LEVELS") { // Make sure CSLs are defined this.system.csl = {}; @@ -3236,11 +3241,6 @@ export class HeroSystem6eItem extends Item { this.system.extraDice = "one-pip"; } - const aoeModifier = this.getAoeModifier(); - if (aoeModifier) { - this.buildAoeAttackParameters(aoeModifier); - } - // TODO: Investigate why this is required. It is wrong for 1/2d6 vs d6-1. if (xmlid === "HKA" || this.system.EFFECT?.indexOf("KILLING") > -1) { this.system.killing = true; diff --git a/module/testing/testing-upload.js b/module/testing/testing-upload.js index 511cb8fa..3eab1399 100644 --- a/module/testing/testing-upload.js +++ b/module/testing/testing-upload.js @@ -7,55 +7,128 @@ export function registerUploadTests(quench) { (context) => { const { assert, before, describe, expect, it } = context; - describe("NAKEDMODIFIER Kaden", function () { - const contents = ` + describe("NAKEDMODIFIER", function () { + describe("NAKEDMODIFIER Kaden", function () { + const contents = ` - - - - - - - - - - - - + + + + + + + + + + + + `; - let item; + let item; - before(async () => { - const actor = new HeroSystem6eActor( - { - name: "Quench Actor", - type: "pc", - }, - { temporary: true }, - ); + before(async () => { + const actor = new HeroSystem6eActor( + { + name: "Quench Actor", + type: "pc", + }, + { temporary: true }, + ); - item = await new HeroSystem6eItem( - HeroSystem6eItem.itemDataFromXml(contents), - { temporary: true, parent: actor }, - ); - await item._postUpload(); - }); + item = await new HeroSystem6eItem( + HeroSystem6eItem.itemDataFromXml(contents), + { temporary: true, parent: actor }, + ); + await item._postUpload(); + }); - it("description", function () { - assert.equal( - item.system.description, - "Naked Advantage for up to 70 Active points, Reduced Endurance (0 END; +1/2) (35 Active Points); Gestures (Requires both hands, -1/2), Visible (Tattoos of flames encompass the biceps and shoulders. When this power is active, these flames appear to burn, emitting firelight.; -1/4)", - ); - }); + it("description", function () { + assert.equal( + item.system.description, + "Naked Advantage for up to 70 Active points, Reduced Endurance (0 END; +1/2) (35 Active Points); Gestures (Requires both hands, -1/2), Visible (Tattoos of flames encompass the biceps and shoulders. When this power is active, these flames appear to burn, emitting firelight.; -1/4)", + ); + }); - it("realCost", function () { - assert.equal(item.system.realCost, "20"); + it("realCost", function () { + assert.equal(item.system.realCost, "20"); + }); + + it("activePoints", function () { + assert.equal(item.system.activePoints, "35"); + }); }); - it("activePoints", function () { - assert.equal(item.system.activePoints, "35"); + describe("non attack AOE", function () { + const contents = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + `; + let item; + + before(async () => { + const actor = new HeroSystem6eActor( + { + name: "Quench Actor", + type: "pc", + }, + { temporary: true }, + ); + + item = await new HeroSystem6eItem( + HeroSystem6eItem.itemDataFromXml(contents), + { temporary: true, parent: actor }, + ); + await item._postUpload(); + }); + + it("description", function () { + assert.equal( + item.system.description, + "Naked Advantage for up to 53 Active points of STR (STR), Area Of Effect (8m Radius; +1/2) (26 Active Points); Linked (Greater Power is Constant or in use most or all of the time, Lesser Power can only be used when character uses greater Power at full value, -1/2), Linked (Greater Power is Constant or in use most or all of the time, Lesser Power can only be used when character uses greater Power at full value, -1/2), Only In Alternate Identity (-1/4), Perceivable (-1/4)", + ); + }); + + it("realCost", function () { + assert.equal(item.system.realCost, "10"); + }); + + it("activePoints", function () { + assert.equal(item.system.activePoints, "26"); + }); + + it("end", function () { + assert.equal(item.system.end, 3); + }); }); }); @@ -2645,7 +2718,10 @@ export function registerUploadTests(quench) { }); it("description", function () { - assert.equal(item.system.description, "(20 END, 5 REC)"); + assert.equal( + item.system.description, + "Endurance Reserve (20 END, 5 REC)", + ); }); it("realCost", function () { @@ -3227,54 +3303,110 @@ export function registerUploadTests(quench) { }); describe("STRETCHING", async function () { - const contents = ` - - Remember up to 3d6 (1d6 for 3") for Velocity - 5" for 1" available - - - - - `; - let item; + describe("6e", async function () { + const contents = ` + + + + + + + `; + let item; - before(async () => { - const actor = new HeroSystem6eActor( - { - name: "Quench Actor", - type: "pc", - }, - { temporary: true }, - ); - item = await new HeroSystem6eItem( - HeroSystem6eItem.itemDataFromXml(contents), - { temporary: true, parent: actor }, - ); - await item._postUpload(); - actor.items.set(item.system.XMLID, item); - item.skillRollUpdateValue(); - }); + before(async () => { + const actor = new HeroSystem6eActor( + { + name: "Quench Actor", + type: "pc", + }, + { temporary: true }, + ); + item = await new HeroSystem6eItem( + HeroSystem6eItem.itemDataFromXml(contents), + { temporary: true, parent: actor }, + ); + await item._postUpload(); + actor.items.set(item.system.XMLID, item); + item.skillRollUpdateValue(); + }); - it("description", function () { - assert.equal( - item.system.description, - "Stretching 9m, Reduced Endurance (1/2 END; +1/4)", - ); - }); + it("description", function () { + assert.equal( + item.system.description, + "Stretching 9m, Reduced Endurance (1/2 END; +1/4)", + ); + }); - it("realCost", function () { - assert.equal(item.system.realCost, 56); - }); + it("realCost", function () { + assert.equal(item.system.realCost, 11); + }); - it("activePoints", function () { - assert.equal(item.system.activePoints, 56); - }); + it("activePoints", function () { + assert.equal(item.system.activePoints, 11); + }); - it("end", function () { - assert.equal(item.system.end, 2); + it("end", function () { + assert.equal(item.system.end, 1); + }); + + it("levels", function () { + assert.equal(item.system.value, 9); + }); }); - it("levels", function () { - assert.equal(item.system.value, 9); + describe("5e", async function () { + const contents = ` + + + + + + + `; + let item; + + before(async () => { + const actor = new HeroSystem6eActor( + { + name: "Quench Actor", + type: "pc", + }, + { temporary: true }, + ); + actor.system.is5e = true; + + item = await new HeroSystem6eItem( + HeroSystem6eItem.itemDataFromXml(contents), + { temporary: true, parent: actor }, + ); + await item._postUpload(); + actor.items.set(item.system.XMLID, item); + item.skillRollUpdateValue(); + }); + + it("description", function () { + assert.equal( + item.system.description, + 'Stretching 9", Reduced Endurance (1/2 END; +1/4)', + ); + }); + + it("realCost", function () { + assert.equal(item.system.realCost, 56); + }); + + it("activePoints", function () { + assert.equal(item.system.activePoints, 56); + }); + + it("end", function () { + assert.equal(item.system.end, 2); + }); + + it("levels", function () { + assert.equal(item.system.value, 9); + }); }); }); @@ -3964,7 +4096,7 @@ export function registerUploadTests(quench) { it("description", function () { assert.equal( item.system.description, - "Succor END 7½d6 (END)", + "Succor END 5½d6 (END)", ); });