Skip to content

Commit

Permalink
Update Effect type signatures
Browse files Browse the repository at this point in the history
- `affectsFainted` is a `PureEffect` property

- `infiltrates` shouldn't exist on moves outside of OMs
  • Loading branch information
Zarel committed May 1, 2020
1 parent cbbd145 commit c4dd88a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sim/global-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@ interface EventMethods {

interface EffectData {
name?: string;
affectsFainted?: boolean;
desc?: string;
duration?: number;
durationCallback?: (this: Battle, target: Pokemon, source: Pokemon, effect: Effect | null) => number;
Expand Down Expand Up @@ -793,6 +792,7 @@ interface BasicEffect extends EffectData {

interface PureEffectData extends EffectData, PureEffectEventMethods, EventMethods {
noCopy?: boolean;
affectsFainted?: boolean;
counterMax?: number;
}

Expand Down
1 change: 1 addition & 0 deletions test/sim/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ describe('Dex data', function () {
const entry = Movedex[moveid];
assert.equal(toID(entry.name), moveid, `Mismatched Move key "${moveid}" of "${entry.name}"`);
assert.equal(typeof entry.num, 'number', `Move ${entry.name} should have a number`);
assert.false(typeof entry.infiltrates, `Move ${entry.name} should not have an 'infiltrates' property (no real move has it)`);
}
});

Expand Down

0 comments on commit c4dd88a

Please sign in to comment.