Skip to content

Commit

Permalink
Change Revelation Dance's type when attacker has Terastallized (#568)
Browse files Browse the repository at this point in the history
* Change Revelation Dance's type when attacker has Terastallized

* Test interaction between Revelation Dance and Terastallization
  • Loading branch information
shrianshChari committed Jul 28, 2023
1 parent 5f9239f commit ba62349
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion calc/src/mechanics/gen789.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ export function calculateSMSSSV(
desc.terrain = field.terrain;
desc.moveType = type;
} else if (move.named('Revelation Dance')) {
type = attacker.types[0];
if (attacker.teraType) {
type = attacker.teraType;
} else {
type = attacker.types[0];
}
} else if (move.named('Aura Wheel')) {
if (attacker.named('Morpeko')) {
type = 'Electric';
Expand Down
10 changes: 10 additions & 0 deletions calc/src/test/calc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,16 @@ describe('calc', () => {
testQP('Protosynthesis', {weather: 'Sun'});
testQPOverride('Quark Drive', {terrain: 'Electric'});
testQPOverride('Protosynthesis', {weather: 'Sun'});
test('Revelation Dance should change type if Pokemon Terastallized', () => {
const attacker = Pokemon('Oricorio-Pom-Pom');
const defender = Pokemon('Sandaconda');
let result = calculate(attacker, defender, Move('Revelation Dance'));
expect(result.move.type).toBe('Electric');

attacker.teraType = 'Water';
result = calculate(attacker, defender, Move('Revelation Dance'));
expect(result.move.type).toBe('Water');
});
});
});
});
Expand Down

0 comments on commit ba62349

Please sign in to comment.