Skip to content

Commit

Permalink
add resonance token handling
Browse files Browse the repository at this point in the history
  • Loading branch information
keinkurt committed Dec 13, 2024
1 parent 7adfb52 commit bd73de4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions data/fh/character/shards.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
],
"color": "#c0d7e9",
"spoiler": true,
"specialActions": [
{
"name": "resonance_tokens"
}
],
"stats": [
{
"level": 1,
Expand Down
5 changes: 4 additions & 1 deletion data/fh/label-spoiler/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"repair_mode": "%data.characterToken.prism.mode% Repair Drone Mode: %game.action.heal% 2"
},
"shackles": "Pain Conduit",
"shards": "Shattersong",
"shards": {
".": "Shattersong",
"resonance_tokens": "%data.characterToken.shards.resonance% Resonance Tokens"
},
"snowflake": {
".": "Snowdancer",
"muddle-monster": "%game.condition.muddle% all newly revealed enemies"
Expand Down
8 changes: 8 additions & 0 deletions src/app/game/businesslogic/RoundManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ export class RoundManager {
gameManager.entityManager.applyCondition(figure, figure, ConditionName.heal, true);
}

if (figure instanceof Character && figure.name == 'shards' && figure.tags.indexOf('resonance_tokens') != -1 && figure.tokenValues[0] < 5) {
figure.tokenValues[0] += 1;
}

if (figure instanceof Character) {
if (settingsManager.settings.expireConditions) {
gameManager.entityManager.expireConditions(figure, figure);
Expand Down Expand Up @@ -587,6 +591,10 @@ export class RoundManager {
figure.tokenValues[0] = 2;
}

if (figure.tags.find((tag) => tag === 'resonance_tokens') && figure.primaryToken == 0) {
figure.tokenValues[0] = figure.progress.perks[10] == 1 ? 3 : 1;
}

figure.availableSummons.filter((summonData) => summonData.special).forEach((summonData) => gameManager.characterManager.createSpecialSummon(figure, summonData));

figure.attackModifierDeck = gameManager.attackModifierManager.buildCharacterAttackModifierDeck(figure);
Expand Down
6 changes: 3 additions & 3 deletions src/app/ui/figures/character/character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class CharacterComponent implements OnInit, OnDestroy {
this.token = - this.character.token;
} else if (this.character.primaryToken >= 0 && this.character.tokenValues[this.character.primaryToken] + this.token < 0) {
this.token = - this.character.tokenValues[this.character.primaryToken];
} else if (this.character.tags.find((tag) => tag === 'time_tokens') && this.character.primaryToken == 0 && this.character.tokenValues[0] + this.token > 5) {
} else if (this.character.tags.find((tag) => ['time_tokens', 'resonance_token'].indexOf(tag) >= 0) && this.character.primaryToken == 0 && this.character.tokenValues[0] + this.token > 5) {
this.token = 5 - this.character.tokenValues[this.character.primaryToken];
}
}
Expand All @@ -297,7 +297,7 @@ export class CharacterComponent implements OnInit, OnDestroy {
gameManager.stateManager.before("setCharacterTokenValue", gameManager.characterManager.characterName(this.character), '%data.characterToken.' + this.character.name + '.' + this.character.tokens[this.character.primaryToken] + '%', (this.character.token + this.token));
this.character.tokenValues[this.character.primaryToken] += this.token;

if (this.character.tags.find((tag) => tag === 'time_tokens') && this.character.primaryToken == 0 && this.character.tokenValues[0] > 5) {
if (this.character.tags.find((tag) => ['time_tokens', 'resonance_token'].indexOf(tag) >= 0) && this.character.primaryToken == 0 && this.character.tokenValues[0] > 5) {
this.character.tokenValues[0] = 5;
}

Expand Down Expand Up @@ -574,4 +574,4 @@ export class CharacterComponent implements OnInit, OnDestroy {

gameManager.stateManager.after();
}
}
}

0 comments on commit bd73de4

Please sign in to comment.