diff --git a/data/fh/challenges.json b/data/fh/challenges.json index 5b5640c21..665cb49b1 100644 --- a/data/fh/challenges.json +++ b/data/fh/challenges.json @@ -19,7 +19,8 @@ }, { "cardId": 1487, - "automation": "fully" + "automation": "fully", + "implemented": true }, { "cardId": 1488, diff --git a/package-lock.json b/package-lock.json index 615bc90ff..e02fe7ce2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gloomhavensecretariat", - "version": "0.101.0", + "version": "0.101.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gloomhavensecretariat", - "version": "0.101.0", + "version": "0.101.1", "license": "AGPL3", "dependencies": { "@angular/animations": "^18.2.8", diff --git a/package.json b/package.json index 946c57254..40a556a37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gloomhavensecretariat", - "version": "0.101.0", + "version": "0.101.1", "license": "AGPL3", "description": "Gloomhaven Secretariat is a Gloomhaven/Frosthaven Companion app.", "homepage": "https://gloomhaven-secretariat.de", diff --git a/src/app/game/businesslogic/ChallengesManager.ts b/src/app/game/businesslogic/ChallengesManager.ts index 497ff87c5..b6d9d6eab 100644 --- a/src/app/game/businesslogic/ChallengesManager.ts +++ b/src/app/game/businesslogic/ChallengesManager.ts @@ -10,6 +10,7 @@ export class ChallengesManager { game: Game; available: boolean = false; + enabled: boolean = false; constructor(game: Game) { this.game = game; @@ -78,7 +79,8 @@ export class ChallengesManager { } update() { - this.available = settingsManager.settings.fhChallenges && gameManager.fhRules() && this.game.party.buildings.find((buildingModel) => buildingModel.name == 'town-hall' && buildingModel.level && buildingModel.state != 'wrecked') != undefined + this.available = gameManager.fhRules() && this.game.party.buildings.find((buildingModel) => buildingModel.name == 'town-hall' && buildingModel.level && buildingModel.state != 'wrecked') != undefined; + this.enabled = settingsManager.settings.fhChallenges && this.available; if (this.available && this.game.edition) { // build challenge deck if not present diff --git a/src/app/game/businesslogic/EntityManager.ts b/src/app/game/businesslogic/EntityManager.ts index f51d06edb..aacc18a54 100644 --- a/src/app/game/businesslogic/EntityManager.ts +++ b/src/app/game/businesslogic/EntityManager.ts @@ -381,7 +381,7 @@ export class EntityManager { entityCondition.highlight = false; // apply Challenge #1487 - if (gameManager.challengesManager.available && gameManager.challengesManager.isActive(1487, 'fh') && entityCondition.types.indexOf(ConditionType.negative) && entityCondition.name != ConditionName.wound && entity instanceof Character && !this.isImmune(entity, entity, ConditionName.wound)) { + if (gameManager.challengesManager.enabled && gameManager.challengesManager.isActive(1487, 'fh') && entityCondition.types.indexOf(ConditionType.negative) && entityCondition.name != ConditionName.wound && entity instanceof Character && !this.isImmune(entity, entity, ConditionName.wound)) { this.addCondition(entity, new Condition(ConditionName.wound), active, off); } diff --git a/src/app/game/model/data/Challenges.ts b/src/app/game/model/data/Challenges.ts index e6895e546..7a7d51be9 100644 --- a/src/app/game/model/data/Challenges.ts +++ b/src/app/game/model/data/Challenges.ts @@ -7,6 +7,7 @@ export class ChallengeCard implements Editional { cardId: number = 0; edition: string = ""; automation: "fully" | "partial" | undefined; + implemented: boolean = false; } diff --git a/src/app/ui/figures/challenges/challenge-card.html b/src/app/ui/figures/challenges/challenge-card.html index 9933f0d1d..d9760bf0a 100644 --- a/src/app/ui/figures/challenges/challenge-card.html +++ b/src/app/ui/figures/challenges/challenge-card.html @@ -18,6 +18,9 @@
0{{challenge.cardId}}
+
+ +
diff --git a/src/app/ui/figures/challenges/challenge-card.scss b/src/app/ui/figures/challenges/challenge-card.scss index f88333ac3..f62221e44 100644 --- a/src/app/ui/figures/challenges/challenge-card.scss +++ b/src/app/ui/figures/challenges/challenge-card.scss @@ -67,6 +67,22 @@ filter: var(--ghs-filter-outline); } + .automation { + position: absolute; + bottom: 11%; + left: 14%; + display: flex; + justify-content: center; + align-items: center; + + .ghs-svg { + width: 1.5em; + height: auto; + filter: var(--ghs-filter-darkgray); + } + + } + } .card-back { diff --git a/src/app/ui/figures/party/party-sheet-dialog.ts b/src/app/ui/figures/party/party-sheet-dialog.ts index 9759b6ab1..1e93d25a3 100644 --- a/src/app/ui/figures/party/party-sheet-dialog.ts +++ b/src/app/ui/figures/party/party-sheet-dialog.ts @@ -848,7 +848,7 @@ export class PartySheetDialogComponent implements OnInit, OnDestroy { indexElement.classList.add('error'); const editionData = gameManager.editionData.find((editionData) => editionData.edition == edition); if (editionData && editionData.treasures) { - const treasureIndex = +treasure - (editionData.treasureOffset || 0); + const treasureIndex = +treasure - (editionData.treasureOffset || 0) - 1; if (treasureIndex >= 0 && treasureIndex < editionData.treasures.length) { gameManager.stateManager.before("addTreasure", edition, treasure); this.party.treasures = this.party.treasures || []; diff --git a/src/app/ui/footer/footer.html b/src/app/ui/footer/footer.html index 9fe97539d..0d27a22d8 100644 --- a/src/app/ui/footer/footer.html +++ b/src/app/ui/footer/footer.html @@ -60,7 +60,7 @@
+ *ngIf="settingsManager.settings.fhChallenges && gameManager.challengesManager.enabled"> diff --git a/src/assets/images/automation.svg b/src/assets/images/automation.svg new file mode 100644 index 000000000..0c6f5c992 --- /dev/null +++ b/src/assets/images/automation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index 128ddf132..3dd3a113d 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -42,6 +42,9 @@ "cancel": "Cancel", "challenges": { ".": "Challenges", + "automation": { + "hint": "Effect of this card is automatically applied!" + }, "deck": { "clear": { ".": "Disgard drawn Challenge",