Compare commits

..

1 commit

Author SHA1 Message Date
4f6b3f5f1d chore(deps): update dependency semver to v7.5.4 2023-07-09 23:01:47 +00:00
5 changed files with 103 additions and 104 deletions

View file

@ -11,11 +11,11 @@
}
],
"url": "https://git.f3l.de/dungeonslayers/tickwerk",
"license": "https://git.f3l.de/dungeonslayers/tickwerk/raw/tag/1.3.3/LICENSE.md",
"readme": "https://git.f3l.de/dungeonslayers/tickwerk/raw/tag/1.3.3/README.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.2/README.md",
"bugs": "https://git.f3l.de/dungeonslayers/tickwerk/issues",
"changelog": "https://git.f3l.de/dungeonslayers/tickwerk/releases/tag/1.3.3",
"version": "1.3.3",
"changelog": "https://git.f3l.de/dungeonslayers/tickwerk/releases/tag/1.3.2",
"version": "1.3.2",
"compatibility": {
"minimum": "10.290",
"verified": "10"
@ -39,6 +39,6 @@
}
],
"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"
}

View file

@ -2,7 +2,7 @@
"private": true,
"name": "tickwerk",
"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",
"homepage": "https://git.f3l.de/dungeonslayers/tickwerk",
"repository": {

View file

@ -42,7 +42,7 @@ const CombatantMixin = (BaseCombatant) => {
*/
toggleWaiting() {
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);
}
@ -66,8 +66,7 @@ const CombatantMixin = (BaseCombatant) => {
}
await this.update({ initiative: this.initiative + ticks });
const tickTime = CONFIG.tickwerk?.tickTime;
const advanceTime = tickTime !== undefined ? ticks * tickTime : undefined;
const advanceTime = ticks * CONFIG.time.roundTime;
if (advanceTime !== 0) {
await this.combat?.update(undefined, { diff: false, advanceTime });
}

View file

@ -7,7 +7,7 @@ import { getGame } from '../helpers';
export const registerDS4SpecificFunctionality = () => {
if (CONFIG.tickwerk === undefined) CONFIG.tickwerk = {};
foundry.utils.mergeObject(CONFIG.tickwerk, { getTiebreaker, getInitiativeFormula, tickTime: 0.5 });
foundry.utils.mergeObject(CONFIG.tickwerk, { getTiebreaker, getInitiativeFormula });
registerRollItemSetting();
Hooks.on('ds4.rollItem', onRollItem);
@ -71,7 +71,7 @@ const getTiebreaker = async (combatant, combatants) => {
const getInitiativeFormula = (combatant) => {
const started = combatant.combat?.started ?? false;
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})`;
};

View file

@ -81,7 +81,7 @@ function bumpVersion(release) {
console.log(`Bumping version number to '${targetVersion}'`);
packageJson.version = targetVersion;
fs.writeJSONSync('package.json', packageJson, { spaces: 2 });
fs.writeJSONSync('package.json', packageJson, { spaces: 4 });
manifest.version = targetVersion;
manifest.url = repositoryURL;
manifest.manifest = getManifestUrl(getChannel(targetVersion));
@ -90,7 +90,7 @@ function bumpVersion(release) {
manifest.changelog = getChangelogURL(targetVersion);
manifest.readme = getReadmeURL(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', {