Skip to content

Commit

Permalink
address #609, fix random item editions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lurkars committed Sep 17, 2024
1 parent 91387f0 commit aa0a0c6
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 32 deletions.
68 changes: 40 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gloomhavensecretariat",
"version": "0.100.1",
"version": "0.100.2",
"license": "AGPL3",
"description": "Gloomhaven Secretariat is a Gloomhaven/Frosthaven Companion app.",
"homepage": "https://gloomhaven-secretariat.de",
Expand Down Expand Up @@ -114,7 +114,7 @@
"karma-coverage": "~2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"nodemon": "^3.1.4",
"nodemon": "^3.1.5",
"typescript": "~5.5.4"
}
}
4 changes: 4 additions & 0 deletions src/app/game/businesslogic/CharacterManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ export class CharacterManager {
if (figure.progress.equippedItems.find((identifier) => identifier.edition == 'cs' && identifier.name == '57') && gameManager.entityManager.hasCondition(figure, new Condition(ConditionName.wound)) && !gameManager.entityManager.hasCondition(figure, new Condition(ConditionName.regenerate))) {
gameManager.entityManager.addCondition(figure, new Condition(ConditionName.regenerate), figure.active, figure.off);
}

if (figure.tags) {
figure.tags = figure.tags.filter((tag) => !tag.startsWith('roundAction-'));
}
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/game/businesslogic/ItemManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export class ItemManager {
(from == -1 || itemData.id >= from) &&
(to == -1 || itemData.id <= to) &&
!gameManager.game.party.unlockedItems.find((identifier) => identifier.name == '' + itemData.id && identifier.edition == itemData.edition) &&
this.itemEditions(edition).indexOf(itemData.edition) != -1);
(itemData.edition == edition || gameManager.editionExtensions(edition).indexOf(itemData.edition) != -1));
let item: ItemData | undefined = undefined;
if (availableItems.length > 0) {
item = availableItems[Math.floor(Math.random() * availableItems.length)];
Expand Down
3 changes: 2 additions & 1 deletion src/app/game/businesslogic/RoundManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,11 @@ export class RoundManager {
figure.experience += 1;
}

if (figure.tags.indexOf('repair_mode') != -1) {
if (figure.tags.indexOf('repair_mode') != -1 && figure.tags.indexOf('roundAction-repair_mode') == -1) {
figure.health += 2;
gameManager.entityManager.addCondition(figure, new Condition(ConditionName.heal, 2), figure.active || false, figure.off || false);
gameManager.entityManager.applyCondition(figure, figure, ConditionName.heal, true);
figure.tags.push('roundAction-repair_mode');
}
}

Expand Down

0 comments on commit aa0a0c6

Please sign in to comment.