diff --git a/package-lock.json b/package-lock.json index ea63026e4..2b39871bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gloomhavensecretariat", - "version": "0.99.5", + "version": "0.99.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gloomhavensecretariat", - "version": "0.99.5", + "version": "0.99.6", "license": "AGPL3", "dependencies": { "@angular/animations": "^18.0.2", @@ -25,8 +25,8 @@ "ng-in-viewport": "^16.1.0", "rxjs": "~7.8.1", "tslib": "^2.6.3", - "uuid": "^9.0.1", - "zone.js": "~0.14.6" + "uuid": "^10.0.0", + "zone.js": "~0.14.7" }, "devDependencies": { "@angular-devkit/build-angular": "^18.0.3", @@ -3623,9 +3623,9 @@ } }, "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.2.tgz", - "integrity": "sha512-9bfjwDxIDWmmOKusUcqdS4Rw+SETlp9Dy39Xui9BEGEk19dDwH0jhipwFzEff/pFg95NKymc6TOTbRKcWeRqyQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz", + "integrity": "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==", "cpu": [ "arm64" ], @@ -3636,9 +3636,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.2.tgz", - "integrity": "sha512-lwriRAHm1Yg4iDf23Oxm9n/t5Zpw1lVnxYU3HnJPTi2lJRkKTrps1KVgvL6m7WvmhYVt/FIsssWay+k45QHeuw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz", + "integrity": "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==", "cpu": [ "x64" ], @@ -3649,9 +3649,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.2.tgz", - "integrity": "sha512-MOI9Dlfrpi2Cuc7i5dXdxPbFIgbDBGgKR5F2yWEa6FVEtSWncfVNKW5AKjImAQ6CZlBK9tympdsZJ2xThBiWWA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz", + "integrity": "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==", "cpu": [ "arm" ], @@ -3662,9 +3662,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.2.tgz", - "integrity": "sha512-FU20Bo66/f7He9Fp9sP2zaJ1Q8L9uLPZQDub/WlUip78JlPeMbVL8546HbZfcW9LNciEXc8d+tThSJjSC+tmsg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz", + "integrity": "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==", "cpu": [ "arm64" ], @@ -3675,9 +3675,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.2.tgz", - "integrity": "sha512-gsWNDCklNy7Ajk0vBBf9jEx04RUxuDQfBse918Ww+Qb9HCPoGzS+XJTLe96iN3BVK7grnLiYghP/M4L8VsaHeA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz", + "integrity": "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==", "cpu": [ "x64" ], @@ -3688,9 +3688,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.2.tgz", - "integrity": "sha512-O+6Gs8UeDbyFpbSh2CPEz/UOrrdWPTBYNblZK5CxxLisYt4kGX3Sc+czffFonyjiGSq3jWLwJS/CCJc7tBr4sQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz", + "integrity": "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==", "cpu": [ "x64" ], @@ -6012,9 +6012,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.23.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", + "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", "dev": true, "funding": [ { @@ -6031,10 +6031,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", + "caniuse-lite": "^1.0.30001629", + "electron-to-chromium": "^1.4.796", "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "update-browserslist-db": "^1.0.16" }, "bin": { "browserslist": "cli.js" @@ -8632,9 +8632,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.792", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.792.tgz", - "integrity": "sha512-rkg5/N3L+Y844JyfgPUyuKK0Hk0efo3JNxUDKvz3HgP6EmN4rNGhr2D8boLsfTV/hGo7ZGAL8djw+jlg99zQyA==", + "version": "1.4.796", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.796.tgz", + "integrity": "sha512-NglN/xprcM+SHD2XCli4oC6bWe6kHoytcyLKCWXmRL854F0qhPhaYgUswUsglnPxYaNQIg2uMY4BvaomIf3kLA==", "dev": true }, "node_modules/elkjs": { @@ -12049,6 +12049,18 @@ "web-worker": "^1.2.0" } }, + "node_modules/mermaid/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -12833,33 +12845,36 @@ } }, "node_modules/msgpackr-extract": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.2.tgz", - "integrity": "sha512-SdzXp4kD/Qf8agZ9+iTu6eql0m3kWm1A2y1hkpTeVNENutaB0BwHlSvAIaMxwntmRUAUjon2V4L8Z/njd0Ct8A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz", + "integrity": "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==", "dev": true, "hasInstallScript": true, "optional": true, "dependencies": { - "node-gyp-build-optional-packages": "5.0.7" + "node-gyp-build-optional-packages": "5.2.2" }, "bin": { "download-msgpackr-prebuilds": "bin/download-prebuilds.js" }, "optionalDependencies": { - "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.2", - "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.2", - "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.2", - "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.2", - "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.2", - "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.2" + "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3" } }, "node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.7.tgz", - "integrity": "sha512-YlCCc6Wffkx0kHkmam79GKvDQ6x+QZkMjFGrIMxgFNILFvGSbCp2fCBC55pGTT9gVaz8Na5CLmxt/urtzRv36w==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz", + "integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==", "dev": true, "optional": true, + "dependencies": { + "detect-libc": "^2.0.1" + }, "bin": { "node-gyp-build-optional-packages": "bin.js", "node-gyp-build-optional-packages-optional": "optional.js", @@ -16524,9 +16539,9 @@ } }, "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -17778,9 +17793,9 @@ } }, "node_modules/zone.js": { - "version": "0.14.6", - "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.14.6.tgz", - "integrity": "sha512-vyRNFqofdaHVdWAy7v3Bzmn84a1JHWSjpuTZROT/uYn8I3p2cmo7Ro9twFmYRQDPhiYOV7QLk0hhY4JJQVqS6Q==" + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.14.7.tgz", + "integrity": "sha512-0w6DGkX2BPuiK/NLf+4A8FLE43QwBfuqz2dVgi/40Rj1WmqUskCqj329O/pwrqFJLG5X8wkeG2RhIAro441xtg==" } } } diff --git a/package.json b/package.json index 5f2d86362..22f6b8c0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gloomhavensecretariat", - "version": "0.99.5", + "version": "0.99.6", "license": "AGPL3", "description": "Gloomhaven Secretariat is a Gloomhaven/Frosthaven Companion app.", "homepage": "https://gloomhaven-secretariat.de", @@ -91,8 +91,8 @@ "ng-in-viewport": "^16.1.0", "rxjs": "~7.8.1", "tslib": "^2.6.3", - "uuid": "^9.0.1", - "zone.js": "~0.14.6" + "uuid": "^10.0.0", + "zone.js": "~0.14.7" }, "devDependencies": { "@angular-devkit/build-angular": "^18.0.3", diff --git a/src/app/game/businesslogic/GameManager.ts b/src/app/game/businesslogic/GameManager.ts index 3ef54fa8a..64abcc4ff 100644 --- a/src/app/game/businesslogic/GameManager.ts +++ b/src/app/game/businesslogic/GameManager.ts @@ -99,6 +99,11 @@ export class GameManager { this.scenarioRulesManager.addScenarioRulesAlways(); this.scenarioRulesManager.applyScenarioRulesAlways(); } + if (settingsManager.settings.removeUnusedMonster) { + this.game.figures.filter((figure) => figure instanceof Monster && figure.off && figure.entities.length == 0).forEach((figure) => { + this.monsterManager.removeMonster(figure as Monster); + }) + } this.roundManager.firstRound = this.game.round == 0 && this.game.roundResets.length == 0 && this.game.roundResetsHidden.length == 0; } }) diff --git a/src/app/game/businesslogic/MonsterManager.ts b/src/app/game/businesslogic/MonsterManager.ts index e97ffd136..6a957dc59 100644 --- a/src/app/game/businesslogic/MonsterManager.ts +++ b/src/app/game/businesslogic/MonsterManager.ts @@ -618,7 +618,6 @@ export class MonsterManager { } next() { - let removeMonster: Monster[] = []; this.game.figures.forEach((figure) => { if (figure instanceof Monster) { const ability = this.getAbility(figure); @@ -654,16 +653,8 @@ export class MonsterManager { }) figure.off = figure.entities.length == 0; - - if (figure.off && settingsManager.settings.removeUnusedMonster) { - removeMonster.push(figure); - } } }) - - removeMonster.forEach((monster) => { - this.removeMonster(monster); - }) } draw() { diff --git a/src/app/ui/figures/conditions/conditions.ts b/src/app/ui/figures/conditions/conditions.ts index cc2d7749e..1a6cb6d76 100644 --- a/src/app/ui/figures/conditions/conditions.ts +++ b/src/app/ui/figures/conditions/conditions.ts @@ -1,10 +1,8 @@ import { Component, EventEmitter, HostListener, Input, OnInit, Output } from "@angular/core"; import { GameManager, gameManager } from "src/app/game/businesslogic/GameManager"; import { SettingsManager, settingsManager } from "src/app/game/businesslogic/SettingsManager"; -import { Character } from "src/app/game/model/Character"; import { Entity } from "src/app/game/model/Entity"; import { Figure } from "src/app/game/model/Figure"; -import { Monster } from "src/app/game/model/Monster"; import { MonsterEntity } from "src/app/game/model/MonsterEntity"; import { ObjectiveContainer } from "src/app/game/model/ObjectiveContainer"; import { Condition, ConditionName, ConditionType, EntityCondition, EntityConditionState } from "src/app/game/model/data/Condition"; @@ -146,18 +144,14 @@ export class ConditionsComponent implements OnInit { immune = this.immunities.indexOf(conditionName) != -1; } - if (!immune && this.figure instanceof Monster) { - if (!(this.entity instanceof MonsterEntity)) { - immune = this.entities.every((entity) => this.figure instanceof Monster && entity instanceof MonsterEntity && gameManager.entityManager.isImmune(entity, this.figure, conditionName, true)); - } else { + if (!immune) { + if (this.entity) { immune = gameManager.entityManager.isImmune(this.entity, this.figure, conditionName, true); + } else if (this.entities) { + immune = this.entities.every((entity) => gameManager.entityManager.isImmune(entity, this.figure, conditionName, true)); } } - if (!immune && this.figure instanceof Character) { - immune = gameManager.entityManager.isImmune(this.entity, this.figure, conditionName, true); - } - return immune; } diff --git a/src/app/ui/figures/entities-menu/entities-menu-dialog.ts b/src/app/ui/figures/entities-menu/entities-menu-dialog.ts index f0cdd5463..d1801ea9f 100644 --- a/src/app/ui/figures/entities-menu/entities-menu-dialog.ts +++ b/src/app/ui/figures/entities-menu/entities-menu-dialog.ts @@ -1,5 +1,5 @@ import { DialogRef, DIALOG_DATA } from "@angular/cdk/dialog"; -import { Component, Inject } from "@angular/core"; +import { Component, HostListener, Inject } from "@angular/core"; import { GameManager, gameManager } from "src/app/game/businesslogic/GameManager"; import { SettingsManager, settingsManager } from "src/app/game/businesslogic/SettingsManager"; import { ConditionName, ConditionType, EntityCondition, EntityConditionState } from "src/app/game/model/data/Condition"; @@ -66,6 +66,33 @@ export class EntitiesMenuDialogComponent { this.update(); } + @HostListener('document:keydown', ['$event']) + keyboardShortcuts(event: KeyboardEvent) { + if (!event.altKey && !event.metaKey && (!window.document.activeElement || window.document.activeElement.tagName != 'INPUT' && window.document.activeElement.tagName != 'SELECT' && window.document.activeElement.tagName != 'TEXTAREA')) { + if (!event.ctrlKey && !event.shiftKey && event.key === 'ArrowRight') { + this.changeHealth(1); + event.preventDefault(); + event.stopPropagation(); + } else if (!event.ctrlKey && !event.shiftKey && event.key === 'ArrowLeft') { + this.changeHealth(-1); + event.preventDefault(); + event.stopPropagation(); + } else if (!event.ctrlKey && !event.shiftKey && event.key === 'ArrowUp') { + this.changeMaxHealth(1); + event.preventDefault(); + event.stopPropagation(); + } else if (!event.ctrlKey && !event.shiftKey && event.key === 'ArrowDown') { + this.changeMaxHealth(-1); + event.preventDefault(); + event.stopPropagation(); + } else if (!event.ctrlKey && !event.shiftKey && (event.key.toLowerCase() === 'k' || event.key.toLowerCase() === 'd')) { + this.toggleDead(); + event.preventDefault(); + event.stopPropagation(); + } + } + } + update() { this.entityConditions = []; diff --git a/src/assets/locales/de.json b/src/assets/locales/de.json index c81bb3c0a..3bfc0ee88 100644 --- a/src/assets/locales/de.json +++ b/src/assets/locales/de.json @@ -2017,7 +2017,7 @@ }, "removeUnusedMonster": { ".": "Nicht genutze Monster entfernen", - "hint": "Entferne automatische alle nicht genutzen Monster am Ende der Runde" + "hint": "Entferne automatische alle nicht genutzen Monster" }, "scenarioNumberInput": { ".": "Numerische Szenario Eingabe", diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index a80830634..dd7395515 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -2177,7 +2177,7 @@ }, "removeUnusedMonster": { ".": "Remove unused", - "hint": "Automatically remove all unused monsters at end of round." + "hint": "Automatically remove all unused monsters." }, "scenarioNumberInput": { ".": "Scenario Number Input", diff --git a/src/assets/locales/fr.json b/src/assets/locales/fr.json index 37fbbe01e..edc481c92 100644 --- a/src/assets/locales/fr.json +++ b/src/assets/locales/fr.json @@ -1929,7 +1929,7 @@ }, "removeUnusedMonster": { ".": "Retirer les monstres inutilisés", - "hint": "Supprime automatiquement tous les monstres inutilisés à la fin du tour." + "hint": "Supprime automatiquement tous les monstres inutilisés." }, "scenarioNumberInput": { ".": "Numéro de scénario Entrée"