Skip to content

Commit 164e331

Browse files
authoredMar 22, 2025
Merge pull request #971 from solrock-da-coder/main
Glacemons' PMO bugfix
2 parents d474164 + 6062839 commit 164e331

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed
 

‎data/mods/glacemons/items.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1118,11 +1118,15 @@ export const Items: { [k: string]: ModdedItemData; } = {
11181118
parallelmegaorb: {
11191119
name: "Parallel Mega Orb",
11201120
onTakeItem: false,
1121+
onBeforeMega(pokemon) {
1122+
pokemon.addVolatile('gastroacid');
1123+
},
11211124
onAfterMega(pokemon) {
11221125
let newAbility = pokemon.set.ability
11231126
const oldAbility = pokemon.setAbility(newAbility, pokemon, newAbility, true);
1127+
pokemon.removeVolatile('gastroacid');
11241128
},
1125-
onStart(pokemon) {
1129+
onPreStart(pokemon) {
11261130
let newAbility = pokemon.set.ability
11271131
const oldAbility = pokemon.setAbility(newAbility, pokemon, newAbility, true);
11281132
},

‎sim/battle-actions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,8 @@ export class BattleActions {
18841884
const speciesid = pokemon.canMegaEvo || pokemon.canUltraBurst;
18851885
if (!speciesid) return false;
18861886

1887+
this.battle.runEvent('BeforeMega', pokemon);
1888+
18871889
pokemon.formeChange(speciesid, pokemon.getItem(), true);
18881890

18891891
// Limit one mega evolution

‎sim/dex-conditions.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface EventMethods {
77
onAfterEachBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
88
onAfterHit?: MoveEventMethods['onAfterHit'];
99
onAfterMega?: (this: Battle, pokemon: Pokemon) => void;
10+
onBeforeMega?: (this: Battle, pokemon: Pokemon) => void;
1011
onAfterSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => void;
1112
onAfterSubDamage?: MoveEventMethods['onAfterSubDamage'];
1213
onAfterSwitchInSelf?: (this: Battle, pokemon: Pokemon) => void;

0 commit comments

Comments
 (0)