Compare commits
102 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fca0231729 | ||
6f9b98ffc2 | |||
978301eab1 | |||
f4585f4254 | |||
4d67dfec31 | |||
06b8d9073e | |||
11bd84b0a1 | |||
cd57b158fb | |||
cdb4bad665 | |||
80cf0949e5 | |||
edf04be4a4 | |||
ed8caf0b33 | |||
3acbc37436 | |||
42b9a10c54 | |||
71fdcd6e5b | |||
e021ceaca6 | |||
ff81653043 | |||
0f37ad31e5 | |||
fedaf800b4 | |||
44c0efb5f0 | |||
9a7801f0a6 | |||
403ba3811d | |||
8f0e02f3c3 | |||
88cab45702 | |||
7e4bff0127 | |||
aaa4bd42a4 | |||
cc65079f30 | |||
76f4cd2862 | |||
6b0cf2f3fa | |||
df8049f5d4 | |||
91ec7ef7b4 | |||
88d879b6d4 | |||
fb639af41c | |||
339cba776d | |||
9bb1c6e76b | |||
4885653dc8 | |||
85ffdf814d | |||
01f4d8116e | |||
733d8f2bb8 | |||
492dbe96cb | |||
10e706c03c | |||
c68d973cd0 | |||
c2231d1a69 | |||
d303957624 | |||
c29b62c6c5 | |||
9ba7c8aeea | |||
6d3d2b0c5d | |||
fe884ef6f4 | |||
962e82c407 | |||
b8fb2ee223 | |||
68fd47ed8b | |||
88724ed50e | |||
92b6a83de7 | |||
7859b512f7 | |||
fc9a3a1b4b | |||
8bd13d592b | |||
42867e42cd | |||
ca2e8f03ca | |||
8c0e49bc90 | |||
3b519d3f92 | |||
c2e1070906 | |||
e00be5c3fb | |||
6648e3f6c8 | |||
e7ad161846 | |||
a96f9118de | |||
904502b8bb | |||
c707159a40 | |||
ea26d5b583 | |||
e499689a8d | |||
9a9c1eaef3 | |||
be7a091a52 | |||
3a0c197116 | |||
cef0d8e945 | |||
656beeda4f | |||
13d2662e6f | |||
f1b6168b48 | |||
2b496ea51c | |||
5be8163ef8 | |||
5312a1f491 | |||
b78837b4ab | |||
2ee39d87f9 | |||
cbc425987f | |||
b3aefad5bb | |||
6b5e86e435 | |||
0ca0f6316a | |||
7bc966b96b | |||
d3eff79fdb | |||
bfd188219f | |||
0963970e35 | |||
2d8466855f | |||
77107f821f | |||
d7da777f70 | |||
eb312797da | |||
4944362a16 | |||
71da509c88 | |||
e8fa60cfd6 | |||
eda2f1f86d | |||
81a64cbdbf | |||
aaab3dc237 | |||
29b6feffce | |||
7fe2ec7812 | |||
b7b0379183 |
6 changed files with 613 additions and 641 deletions
6
.vscode/launch.json
vendored
6
.vscode/launch.json
vendored
|
@ -5,12 +5,14 @@
|
|||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "pwa-chrome",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "/usr/bin/chromium",
|
||||
"name": "Launch Chrome against localhost",
|
||||
"url": "http://localhost:30000/game",
|
||||
"webRoot": "${workspaceFolder}/dist"
|
||||
"pathMapping": {
|
||||
"/systems/ds4": "${workspaceFolder}/dist"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
48
package.json
48
package.json
|
@ -2,7 +2,7 @@
|
|||
"private": true,
|
||||
"name": "dungeonslayers4",
|
||||
"description": "An implementation of the Dungeonslayers 4 game system for Foundry Virtual Tabletop.",
|
||||
"version": "1.20.0",
|
||||
"version": "1.21.0",
|
||||
"license": "https://git.f3l.de/dungeonslayers/ds4#licensing",
|
||||
"homepage": "https://git.f3l.de/dungeonslayers/ds4",
|
||||
"repository": {
|
||||
|
@ -63,35 +63,35 @@
|
|||
"changelog": "conventional-changelog -p conventionalcommits -o CHANGELOG.md -r 2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "17.6.7",
|
||||
"@commitlint/config-conventional": "17.6.7",
|
||||
"@commitlint/cli": "17.7.1",
|
||||
"@commitlint/config-conventional": "17.7.0",
|
||||
"@foundryvtt/foundryvtt-cli": "0.0.9",
|
||||
"@guanghechen/rollup-plugin-copy": "5.0.2",
|
||||
"@guanghechen/rollup-plugin-copy": "5.0.7",
|
||||
"@ironkinoko/rollup-plugin-styles": "4.0.3",
|
||||
"@swc/core": "1.3.70",
|
||||
"@types/fs-extra": "11.0.1",
|
||||
"@types/jquery": "3.5.16",
|
||||
"@types/node": "18.17.0",
|
||||
"@typescript-eslint/eslint-plugin": "6.1.0",
|
||||
"@typescript-eslint/parser": "6.1.0",
|
||||
"conventional-changelog-cli": "3.0.0",
|
||||
"conventional-changelog-conventionalcommits": "6.1.0",
|
||||
"eslint": "8.45.0",
|
||||
"eslint-config-prettier": "8.8.0",
|
||||
"@swc/core": "1.3.85",
|
||||
"@types/fs-extra": "11.0.2",
|
||||
"@types/jquery": "3.5.19",
|
||||
"@types/node": "18.17.17",
|
||||
"@typescript-eslint/eslint-plugin": "6.7.0",
|
||||
"@typescript-eslint/parser": "6.7.0",
|
||||
"conventional-changelog-cli": "4.1.0",
|
||||
"conventional-changelog-conventionalcommits": "7.0.2",
|
||||
"eslint": "8.49.0",
|
||||
"eslint-config-prettier": "9.0.0",
|
||||
"fs-extra": "11.1.1",
|
||||
"handlebars": "4.7.7",
|
||||
"handlebars": "4.7.8",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "3.0.0",
|
||||
"prettier": "3.0.3",
|
||||
"rimraf": "5.0.1",
|
||||
"rollup": "3.26.3",
|
||||
"rollup-plugin-swc3": "0.9.1",
|
||||
"sass": "1.64.1",
|
||||
"rollup": "3.29.2",
|
||||
"rollup-plugin-swc3": "0.10.1",
|
||||
"sass": "1.67.0",
|
||||
"semver": "7.5.4",
|
||||
"tslib": "2.6.0",
|
||||
"typescript": "5.1.6",
|
||||
"vite": "4.4.6",
|
||||
"vitest": "0.33.0",
|
||||
"tslib": "2.6.2",
|
||||
"typescript": "5.2.2",
|
||||
"vite": "4.4.9",
|
||||
"vitest": "0.34.4",
|
||||
"yargs": "17.7.2"
|
||||
},
|
||||
"packageManager": "pnpm@8.6.9"
|
||||
"packageManager": "pnpm@8.7.5"
|
||||
}
|
||||
|
|
1172
pnpm-lock.yaml
1172
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,8 @@
|
|||
|
||||
import { DS4 } from "../../config";
|
||||
import { createCheckRoll } from "../../dice/check-factory";
|
||||
import { mathEvaluator } from "../../expression-evaluation/evaluator";
|
||||
import { Evaluator } from "../../expression-evaluation/evaluator";
|
||||
import { Validator } from "../../expression-evaluation/validator";
|
||||
import { logger } from "../../utils/logger";
|
||||
import { getGame } from "../../utils/utils";
|
||||
import { DS4ActiveEffect } from "../active-effect";
|
||||
|
@ -59,7 +60,7 @@ export class DS4Actor extends Actor {
|
|||
}
|
||||
|
||||
/**
|
||||
* The effects that should be applioed to this actor.
|
||||
* The effects that should be applied to this actor.
|
||||
* @type {import("../active-effect").DS4ActiveEffect[]}
|
||||
* @protected
|
||||
*/
|
||||
|
@ -90,7 +91,7 @@ export class DS4Actor extends Actor {
|
|||
if (condition !== undefined && condition !== "") {
|
||||
try {
|
||||
const replacedCondition = DS4Actor.replaceFormulaData(condition, { item, actor: this, effect });
|
||||
return replacedCondition !== undefined ? Boolean(mathEvaluator.evaluate(replacedCondition)) : false;
|
||||
return replacedCondition !== undefined ? Boolean(DS4Actor.evaluator.evaluate(replacedCondition)) : false;
|
||||
} catch (error) {
|
||||
logger.warn(error);
|
||||
return false;
|
||||
|
@ -520,6 +521,12 @@ export class DS4Actor extends Actor {
|
|||
rejectClose: false,
|
||||
});
|
||||
}
|
||||
|
||||
static evaluator = new Evaluator({
|
||||
context: Math,
|
||||
predicate: (identifier) =>
|
||||
Validator.defaultPredicate(identifier) || ["includes", "toLowerCase", "toUpperCase"].includes(identifier),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,7 @@ export class Evaluator<Context extends object> {
|
|||
get: (t, k) => (k === Symbol.unscopables ? undefined : t[k as keyof typeof t]),
|
||||
});
|
||||
actualPredicate = (identifier: string) =>
|
||||
predicate(identifier) || Object.getOwnPropertyNames(Math).includes(identifier);
|
||||
predicate(identifier) || Object.getOwnPropertyNames(context).includes(identifier);
|
||||
}
|
||||
this.validator = new Validator(actualPredicate);
|
||||
}
|
||||
|
|
13
system.json
13
system.json
|
@ -28,12 +28,11 @@
|
|||
"name": "Sascha Martens"
|
||||
}
|
||||
],
|
||||
"url": "https://git.f3l.de/dungeonslayers/ds4",
|
||||
"license": "https://git.f3l.de/dungeonslayers/ds4/raw/tag/1.20.0/LICENSE.md",
|
||||
"readme": "https://git.f3l.de/dungeonslayers/ds4/raw/tag/1.20.0/README.md",
|
||||
"bugs": "https://git.f3l.de/dungeonslayers/ds4/issues",
|
||||
"changelog": "https://git.f3l.de/dungeonslayers/ds4/releases/tag/1.20.0",
|
||||
"version": "1.20.0",
|
||||
"license": "undefined/raw/tag/1.21.0/LICENSE.md",
|
||||
"readme": "undefined/raw/tag/1.21.0/README.md",
|
||||
"bugs": "undefined/issues",
|
||||
"changelog": "undefined/releases/tag/1.21.0",
|
||||
"version": "1.21.0",
|
||||
"flags": {
|
||||
"hotReload": {
|
||||
"extensions": ["css", "hbs", "json"],
|
||||
|
@ -117,7 +116,7 @@
|
|||
}
|
||||
],
|
||||
"manifest": "https://git.f3l.de/api/packages/dungeonslayers/generic/ds4/latest/system.json",
|
||||
"download": "https://git.f3l.de/dungeonslayers/ds4/releases/download/1.20.0/ds4.zip",
|
||||
"download": "undefined/releases/download/1.21.0/ds4.zip",
|
||||
"initiative": "@combatValues.initiative.total",
|
||||
"gridDistance": 1,
|
||||
"gridUnits": "m",
|
||||
|
|
Loading…
Reference in a new issue