Compare commits

..

1 commit

Author SHA1 Message Date
7cb827de70 chore(deps): update dependency prettier to v3 2023-07-09 23:02:07 +00:00
5 changed files with 103 additions and 104 deletions

View file

@ -11,11 +11,11 @@
} }
], ],
"url": "https://git.f3l.de/dungeonslayers/tickwerk", "url": "https://git.f3l.de/dungeonslayers/tickwerk",
"license": "https://git.f3l.de/dungeonslayers/tickwerk/raw/tag/1.3.3/LICENSE.md", "license": "https://git.f3l.de/dungeonslayers/tickwerk/raw/tag/1.3.2/LICENSE.md",
"readme": "https://git.f3l.de/dungeonslayers/tickwerk/raw/tag/1.3.3/README.md", "readme": "https://git.f3l.de/dungeonslayers/tickwerk/raw/tag/1.3.2/README.md",
"bugs": "https://git.f3l.de/dungeonslayers/tickwerk/issues", "bugs": "https://git.f3l.de/dungeonslayers/tickwerk/issues",
"changelog": "https://git.f3l.de/dungeonslayers/tickwerk/releases/tag/1.3.3", "changelog": "https://git.f3l.de/dungeonslayers/tickwerk/releases/tag/1.3.2",
"version": "1.3.3", "version": "1.3.2",
"compatibility": { "compatibility": {
"minimum": "10.290", "minimum": "10.290",
"verified": "10" "verified": "10"
@ -39,6 +39,6 @@
} }
], ],
"manifest": "https://git.f3l.de/api/packages/dungeonslayers/generic/tickwerk/latest/module.json", "manifest": "https://git.f3l.de/api/packages/dungeonslayers/generic/tickwerk/latest/module.json",
"download": "https://git.f3l.de/dungeonslayers/tickwerk/releases/download/1.3.3/tickwerk.zip", "download": "https://git.f3l.de/dungeonslayers/tickwerk/releases/download/1.3.2/tickwerk.zip",
"manifestPlusVersion": "1.2.0" "manifestPlusVersion": "1.2.0"
} }

View file

@ -2,7 +2,7 @@
"private": true, "private": true,
"name": "tickwerk", "name": "tickwerk",
"description": "A tick based combat system for Foundry Virtual Tabletop", "description": "A tick based combat system for Foundry Virtual Tabletop",
"version": "1.3.3", "version": "1.3.2",
"license": "https://git.f3l.de/dungeonslayers/tickwerk#licensing", "license": "https://git.f3l.de/dungeonslayers/tickwerk#licensing",
"homepage": "https://git.f3l.de/dungeonslayers/tickwerk", "homepage": "https://git.f3l.de/dungeonslayers/tickwerk",
"repository": { "repository": {

View file

@ -42,7 +42,7 @@ const CombatantMixin = (BaseCombatant) => {
*/ */
toggleWaiting() { toggleWaiting() {
const update = { [`flags.${packageId}.waiting`]: !this.waiting }; const update = { [`flags.${packageId}.waiting`]: !this.waiting };
if (this.parent?.started && this.waiting) update.initiative = this.parent?.tickValue; if (this.parent?.started && this.waiting) update.initiative = this.parent?.round;
return this.update(update); return this.update(update);
} }
@ -66,8 +66,7 @@ const CombatantMixin = (BaseCombatant) => {
} }
await this.update({ initiative: this.initiative + ticks }); await this.update({ initiative: this.initiative + ticks });
const tickTime = CONFIG.tickwerk?.tickTime; const advanceTime = ticks * CONFIG.time.roundTime;
const advanceTime = tickTime !== undefined ? ticks * tickTime : undefined;
if (advanceTime !== 0) { if (advanceTime !== 0) {
await this.combat?.update(undefined, { diff: false, advanceTime }); await this.combat?.update(undefined, { diff: false, advanceTime });
} }

View file

@ -7,7 +7,7 @@ import { getGame } from '../helpers';
export const registerDS4SpecificFunctionality = () => { export const registerDS4SpecificFunctionality = () => {
if (CONFIG.tickwerk === undefined) CONFIG.tickwerk = {}; if (CONFIG.tickwerk === undefined) CONFIG.tickwerk = {};
foundry.utils.mergeObject(CONFIG.tickwerk, { getTiebreaker, getInitiativeFormula, tickTime: 0.5 }); foundry.utils.mergeObject(CONFIG.tickwerk, { getTiebreaker, getInitiativeFormula });
registerRollItemSetting(); registerRollItemSetting();
Hooks.on('ds4.rollItem', onRollItem); Hooks.on('ds4.rollItem', onRollItem);
@ -71,7 +71,7 @@ const getTiebreaker = async (combatant, combatants) => {
const getInitiativeFormula = (combatant) => { const getInitiativeFormula = (combatant) => {
const started = combatant.combat?.started ?? false; const started = combatant.combat?.started ?? false;
if (!started) return '-@combatValues.initiative.total'; if (!started) return '-@combatValues.initiative.total';
const tickValue = combatant.combat?.tickValue ?? 0; const tickValue = combatant.combat?.round ?? 0;
return `max(${tickValue} + 10 - @combatValues.initiative.total, ${tickValue})`; return `max(${tickValue} + 10 - @combatValues.initiative.total, ${tickValue})`;
}; };

View file

@ -81,7 +81,7 @@ function bumpVersion(release) {
console.log(`Bumping version number to '${targetVersion}'`); console.log(`Bumping version number to '${targetVersion}'`);
packageJson.version = targetVersion; packageJson.version = targetVersion;
fs.writeJSONSync('package.json', packageJson, { spaces: 2 }); fs.writeJSONSync('package.json', packageJson, { spaces: 4 });
manifest.version = targetVersion; manifest.version = targetVersion;
manifest.url = repositoryURL; manifest.url = repositoryURL;
manifest.manifest = getManifestUrl(getChannel(targetVersion)); manifest.manifest = getManifestUrl(getChannel(targetVersion));
@ -90,7 +90,7 @@ function bumpVersion(release) {
manifest.changelog = getChangelogURL(targetVersion); manifest.changelog = getChangelogURL(targetVersion);
manifest.readme = getReadmeURL(targetVersion); manifest.readme = getReadmeURL(targetVersion);
manifest.license = getLicenseURL(targetVersion); manifest.license = getLicenseURL(targetVersion);
fs.writeJSONSync(manifestPath, manifest, { spaces: 2 }); fs.writeJSONSync(manifestPath, manifest, { spaces: 4 });
} }
const argv = yargs(hideBin(process.argv)).usage('Usage: $0').option('release', { const argv = yargs(hideBin(process.argv)).usage('Usage: $0').option('release', {