Skip to content

Commit

Permalink
fix: effect types
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacbatst committed Aug 31, 2023
1 parent 3a01843 commit f9d8d72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "t20-sheet-builder",
"version": "1.25.6",
"version": "1.25.7",
"main": "build/index.js",
"types": "build/index.d.ts",
"exports": "./build/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {type SheetInterface} from '../Sheet/SheetInterface';
import {type CharacterModifierName} from './CharacterModifiers';
import {type CharacterAttackModifiers} from './CharactterAttackModifiers';

export type EnabledEffectModifiersIndexes = Partial<Record<TriggerEvent, number>>;
export type EnabledEffectModifiersIndexes = Partial<Record<CharacterModifierName, number>>;

export type SerializedCharacterAttackTriggeredEffect = {
effect: SerializedTriggeredEffect;
Expand Down
8 changes: 4 additions & 4 deletions src/domain/entities/Role/Knight/Bulwark/BulwarkEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ export class BulwarkEffect extends TriggeredEffect {
modifiers: TriggeredEffectModifiers;
modifiersIndexes: EnabledEffectModifiersIndexes;
}, activation: TriggeredEffectActivation): {manaCost?: ManaCost | undefined} {
modifiersIndexes.defend = modifiers.defense?.fixed.add(new FixedModifier(this.source, 2));
modifiersIndexes.defense = modifiers.defense?.fixed.add(new FixedModifier(this.source, 2));

return {
manaCost: new ManaCost(1),
};
}

override disable({modifiersIndexes, modifiers}: {modifiers: TriggeredEffectModifiers; modifiersIndexes: EnabledEffectModifiersIndexes}): void {
if (typeof modifiersIndexes.defend !== 'undefined') {
modifiers.defense?.fixed.remove(modifiersIndexes.defend);
modifiersIndexes.defend = undefined;
if (typeof modifiersIndexes.defense !== 'undefined') {
modifiers.defense?.fixed.remove(modifiersIndexes.defense);
modifiersIndexes.defense = undefined;
}
}
}

0 comments on commit f9d8d72

Please sign in to comment.