mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-26 02:39:38 -05:00
Make Opportunist/Mirror Herb copy Anger Point (#9341)
This commit is contained in:
parent
f48c56e424
commit
2340b66d29
|
|
@ -122,8 +122,7 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
|
|||
onHit(target, source, move) {
|
||||
if (!target.hp) return;
|
||||
if (move?.effectType === 'Move' && target.getMoveHitData(move).crit) {
|
||||
target.setBoost({atk: 6});
|
||||
this.add('-setboost', target, 'atk', 12, '[from] ability: Anger Point');
|
||||
this.boost({atk: 12}, target, target);
|
||||
}
|
||||
},
|
||||
name: "Anger Point",
|
||||
|
|
|
|||
|
|
@ -1816,8 +1816,8 @@ export class Battle {
|
|||
if (boostBy) {
|
||||
success = true;
|
||||
switch (effect?.id) {
|
||||
case 'bellydrum':
|
||||
this.add('-setboost', target, 'atk', target.boosts['atk'], '[from] move: Belly Drum');
|
||||
case 'bellydrum': case 'angerpoint':
|
||||
this.add('-setboost', target, 'atk', target.boosts['atk'], '[from] ' + effect.fullname);
|
||||
break;
|
||||
case 'bellydrum2':
|
||||
this.add(msg, target, boostName, boostBy, '[silent]');
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ const common = require('./../../common');
|
|||
let battle;
|
||||
|
||||
describe("Opportunist", () => {
|
||||
afterEach(() => battle.destroy());
|
||||
|
||||
it("should not cause an infinite loop with itself", () => {
|
||||
battle = common.createBattle([[
|
||||
{species: 'Espathra', ability: 'Opportunist', moves: ['calmmind']},
|
||||
|
|
@ -13,7 +15,29 @@ describe("Opportunist", () => {
|
|||
{species: 'Espathra', ability: 'Opportunist', moves: ['sleeptalk']},
|
||||
]]);
|
||||
battle.makeChoices();
|
||||
assert.equal(battle.p1.active[0].boosts.spa, 1);
|
||||
assert.equal(battle.p2.active[0].boosts.spa, 1);
|
||||
assert.statStage(battle.p1.active[0], 'spa', 1);
|
||||
assert.statStage(battle.p2.active[0], 'spa', 1);
|
||||
});
|
||||
|
||||
it("should copy Anger Point", () => {
|
||||
battle = common.createBattle([[
|
||||
{species: 'Espathra', ability: 'Opportunist', moves: ['stormthrow']},
|
||||
], [
|
||||
{species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk']},
|
||||
]]);
|
||||
battle.makeChoices();
|
||||
assert.statStage(battle.p1.active[0], 'atk', 6);
|
||||
});
|
||||
|
||||
it("should only copy the effective boost after the +6 cap", () => {
|
||||
battle = common.createBattle({gameType: 'doubles'}, [[
|
||||
{species: 'Espathra', ability: 'Opportunist', moves: ['sleeptalk']},
|
||||
{species: 'Froslass', ability: 'Snow Cloak', moves: ['frostbreath']},
|
||||
], [
|
||||
{species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk']},
|
||||
{species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk']},
|
||||
]]);
|
||||
battle.makeChoices();
|
||||
assert.statStage(battle.p1.active[0], 'atk', -1 + 6);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user