Skip to content

Commit

Permalink
Merge pull request #174 from Moerill/v2.20.1
Browse files Browse the repository at this point in the history
v2.20.1, Resolves [BUG] Randomize HP doesn't work #173
  • Loading branch information
Geekswordsman authored Jul 5, 2023
2 parents ad7f4e0 + 8594e35 commit b1d7f4b
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
foundryconfig.json
package-lock.json
token-mold.lock
yarn-error.log
.vs
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# v2.2.0
# v2.20.1
- Corrected bug with HP not rolling correctly ( [#173](https://github.com/Moerill/token-mold/issues/173)) )

# v2.20.0
- Foundry v11 Compatibility Update ( [#167](https://github.com/Moerill/token-mold/issues/167))
- Corrected bug that caused Token Mold to conflict with other modules due to overwriting certain data within the token ([#150](https://github.com/Moerill/token-mold/issues/150))
- Corrected issue where bar attributes were being retrieved from the base Token Document, causing a problem if that document was overriden by the system ([#160](https://github.com/Moerill/token-mold/issues/160))
Expand Down
2 changes: 1 addition & 1 deletion assets/.gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/**binary
/** binary
File renamed without changes.
2 changes: 1 addition & 1 deletion assets/adjectives/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000002
MANIFEST-000010
8 changes: 3 additions & 5 deletions assets/adjectives/LOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
2023/07/05-08:51:17.862579 7fd999ffb700 Delete type=3 #1
2023/07/05-09:21:22.410729 7fd6f7a9a700 Level-0 table #5: started
2023/07/05-09:21:22.488341 7fd6f7a9a700 Level-0 table #5: 653947 bytes OK
2023/07/05-09:21:22.531945 7fd6f7a9a700 Delete type=0 #3
2023/07/05-09:21:22.532442 7fd6f7a9a700 Manual compaction at level-0 from '!tables!BGNM2VPUyFfA5ZMJ' @ 72057594037927935 : 1 .. '!tables.results!nrPtDYJkckptGsmr.zykUiQZzIwvwqBJl' @ 0 : 0; will stop at (end)
2023/07/05-18:26:53.718751 7f3b04ff9700 Recovering log #8
2023/07/05-18:26:53.876663 7f3b04ff9700 Delete type=3 #6
2023/07/05-18:26:53.876841 7f3b04ff9700 Delete type=0 #8
8 changes: 8 additions & 0 deletions assets/adjectives/LOG.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
2023/07/05-18:16:01.918273 7f3b04ff9700 Recovering log #4
2023/07/05-18:16:02.063980 7f3b04ff9700 Delete type=0 #4
2023/07/05-18:16:02.064098 7f3b04ff9700 Delete type=3 #2
2023/07/05-18:16:10.768288 7f3867ebc700 Level-0 table #9: started
2023/07/05-18:16:10.768344 7f3867ebc700 Level-0 table #9: 0 bytes OK
2023/07/05-18:16:10.851116 7f3867ebc700 Delete type=0 #7
2023/07/05-18:16:10.851281 7f3867ebc700 Manual compaction at level-0 from '!tables!BGNM2VPUyFfA5ZMJ' @ 72057594037927935 : 1 .. '!tables.results!nrPtDYJkckptGsmr.zykUiQZzIwvwqBJl' @ 0 : 0; will stop at (end)
2023/07/05-18:16:10.851364 7f3867ebc700 Manual compaction at level-1 from '!tables!BGNM2VPUyFfA5ZMJ' @ 72057594037927935 : 1 .. '!tables.results!nrPtDYJkckptGsmr.zykUiQZzIwvwqBJl' @ 0 : 0; will stop at (end)
Binary file removed assets/adjectives/MANIFEST-000002
Binary file not shown.
Binary file added assets/adjectives/MANIFEST-000010
Binary file not shown.
5 changes: 3 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"url": "https://github.com/Moerill/token-mold",
"bugs": "https://github.com/Moerill/token-mold/issues",
"flags": {},
"version": "2.20.0",
"version": "2.20.1",
"minimumCoreVersion": "9",
"compatibleCoreVersion": "11",
"compatibility": {
Expand Down Expand Up @@ -55,6 +55,7 @@
],
"packs": [
{
"id": "adjectives",
"name": "adjectives",
"label": "Adjectives",
"module": "token-mold",
Expand All @@ -67,7 +68,7 @@
"dependencies": [],
"socket": false,
"manifest": "https://raw.githubusercontent.com/Moerill/token-mold/master/module.json",
"download": "https://github.com/Moerill/token-mold/releases/download/v2.20.0/v2.20.0.zip",
"download": "https://github.com/Moerill/token-mold/releases/download/v2.20.1/v2.20.1.zip",
"protected": false,
"coreTranslation": false
}
11 changes: 8 additions & 3 deletions scripts/token-mold.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,11 @@ export default class TokenMold {
if (this.data.name.use) {
const newName = this._modifyName(newData, data, actor, scene.id);
newData.name = newName;
setProperty(newData, "actorData.name", newName);
if (TokenMold.FOUNDRY_VERSION >= 11) {
setProperty(newData, "delta.name", newName);
} else {
setProperty(newData, "actorData.name", newName);
}
}

if (/dnd5e|dcc/.exec(TokenMold.GAME_SYSTEM) !== null) {
Expand Down Expand Up @@ -387,8 +391,9 @@ export default class TokenMold {
});
// Make sure hp is at least 1
const val = Math.max(r.total, 1);
setProperty(newData, TokenMold.FOUNDRY_VERSION >= 10 ? "actorData.system.attributes.hp.value" : "actorData.data.attributes.hp.value", val);
setProperty(newData, TokenMold.FOUNDRY_VERSION >= 10 ? "actorData.system.attributes.hp.max" : "actorData.data.attributes.hp.max", val);

setProperty(newData, TokenMold.FOUNDRY_VERSION >= 11 ? "delta.system.attributes.hp.value" : TokenMold.FOUNDRY_VERSION >= 10 ? "actorData.system.attributes.hp.value" : "actorData.data.attributes.hp.value", val);
setProperty(newData, TokenMold.FOUNDRY_VERSION >= 11 ? "delta.system.attributes.hp.max" : TokenMold.FOUNDRY_VERSION >= 10 ? "actorData.system.attributes.hp.max" : "actorData.data.attributes.hp.max", val);
} else
ui.notifications.warn("Can not randomize hp. HP formula is not set.");
return;
Expand Down

0 comments on commit b1d7f4b

Please sign in to comment.