Showing with 15 additions and 48 deletions.
  1. +8 −28 data/items.js
  2. +0 −1 data/mods/ssb/scripts.js
  3. +0 −1 dev-tools/globals.ts
  4. +0 −1 sim/battle.js
  5. +7 −17 test/simulator/items/seeds.js
@@ -1504,13 +1504,8 @@ let BattleItems = {
fling: {
basePower: 10,
},
onStart(pokemon) {
if (!pokemon.ignoringItem() && this.isTerrain('electricterrain') && pokemon.useItem()) {
this.boost({def: 1});
}
},
onAnyTerrainStart() {
if (this.isTerrain('electricterrain') && this.effectData.target.useItem()) {
onUpdate(pokemon) {
if (this.isTerrain('electricterrain') && pokemon.useItem()) {
this.boost({def: 1});
}
},
@@ -2170,13 +2165,8 @@ let BattleItems = {
fling: {
basePower: 10,
},
onStart(pokemon) {
if (!pokemon.ignoringItem() && this.isTerrain('grassyterrain') && pokemon.useItem()) {
this.boost({def: 1});
}
},
onAnyTerrainStart() {
if (this.isTerrain('grassyterrain') && this.effectData.target.useItem()) {
onUpdate(pokemon) {
if (this.isTerrain('grassyterrain') && pokemon.useItem()) {
this.boost({def: 1});
}
},
@@ -3619,13 +3609,8 @@ let BattleItems = {
fling: {
basePower: 10,
},
onStart(pokemon) {
if (!pokemon.ignoringItem() && this.isTerrain('mistyterrain') && pokemon.useItem()) {
this.boost({spd: 1});
}
},
onAnyTerrainStart() {
if (this.isTerrain('mistyterrain') && this.effectData.target.useItem()) {
onUpdate(pokemon) {
if (this.isTerrain('mistyterrain') && pokemon.useItem()) {
this.boost({spd: 1});
}
},
@@ -4426,13 +4411,8 @@ let BattleItems = {
fling: {
basePower: 10,
},
onStart(pokemon) {
if (!pokemon.ignoringItem() && this.isTerrain('psychicterrain') && pokemon.useItem()) {
this.boost({spd: 1});
}
},
onAnyTerrainStart() {
if (this.isTerrain('psychicterrain') && this.effectData.target.useItem()) {
onUpdate(pokemon) {
if (this.isTerrain('psychicterrain') && pokemon.useItem()) {
this.boost({spd: 1});
}
},
@@ -287,7 +287,6 @@ let BattleScripts = {
}
// Always run a terrain end event to prevent a visual glitch with custom terrains
if (prevTerrain) this.singleEvent('End', this.getEffect(prevTerrain), prevTerrainData, this);
this.runEvent('TerrainStart', source, source, status);
return true;
},
pokemon: {
@@ -186,7 +186,6 @@ interface EventMethods {
onAnyDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => void
onAnyBasePower?: (this: Battle, basePower: number, source: Pokemon, target: Pokemon, move: ActiveMove) => void
onAnySetWeather?: (this: Battle, target: Pokemon, source: Pokemon, weather: PureEffect) => void
onAnyTerrainStart?: (this: Battle) => void
onAnyModifyDamage?: (this: Battle, damage: number, source: Pokemon, target: Pokemon, move: ActiveMove) => void
onAnyRedirectTarget?: (this: Battle, target: Pokemon, source: Pokemon, source2: Pokemon, move: ActiveMove) => void
onAnyAccuracy?: (this: Battle, accuracy: number, target: Pokemon, source: Pokemon, move: ActiveMove) => void
@@ -321,7 +321,6 @@ class Battle extends Dex.ModdedDex {
this.terrainData = prevTerrainData;
return false;
}
this.runEvent('TerrainStart', source, source, status);
return true;
}

@@ -11,24 +11,14 @@ describe('Seeds', function () {
});

it('should activate even in a double-switch-in', function () {
battle = common.createBattle([
[{species: 'Tapu Koko', ability: 'electricsurge', item: 'grassyseed', moves: ['protect']}],
[{species: 'Tapu Bulu', ability: 'grassysurge', item: 'electricseed', moves: ['protect']}],
battle = common.createBattle();
const p1 = battle.join('p1', 'Guest 1', 1, [
{species: 'tapukoko', ability: 'electricsurge', item: 'grassyseed', moves: ['protect']},
]);
assert.false(battle.p1.active[0].item);
assert.false(battle.p2.active[0].item);
});

it('should not activate when Magic Room ends', function () {
battle = common.createBattle([
[
{species: 'Tapu Koko', ability: 'electricsurge', item: 'terrainextender', moves: ['protect']},
{species: 'Hawlucha', ability: 'unburden', item: 'electricseed', moves: ['protect']},
],
[{species: 'Alakazam', ability: 'magicguard', moves: ['magicroom']}],
const p2 = battle.join('p2', 'Guest 2', 1, [
{species: 'tapubulu', ability: 'grassysurge', item: 'electricseed', moves: ['protect']},
]);
battle.makeChoices('move protect', 'move magicroom');
battle.makeChoices('switch 2', 'move magicroom');
assert.strictEqual(battle.p1.active[0].item, 'electricseed');
assert.false(p1.active[0].item);
assert.false(p2.active[0].item);
});
});