Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Megas Revisited: Post-PMPL Balance Patch #10571

Merged
merged 7 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions data/mods/gen6megasrevisited/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,6 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa
move.multihitType = 'parentalbond';
}
},
onBasePowerPriority: 7,
onBasePower(basePower, pokemon, target, move) {
if (move.multihitType === 'parentalbond' && move.hit > 1) return this.chainModify(0.5);
},
onSourceModifySecondaries(secondaries, target, source, move) {
if (move.multihitType === 'parentalbond' && move.id === 'secretpower' && move.hit < 2) {
// hack to prevent accidentally suppressing King's Rock/Razor Fang
Expand All @@ -284,6 +280,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa
},
name: "Parental Bond",
rating: 4.5,
shortDesc: "This Pokemon's damaging moves hit twice. The second hit has its damage quartered.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't actually edit the base power modification?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I initially went to do that but then someone reported that Parental Bond's second hit damage was already quartered, which confused me since I hadn't edited that part of its code since I fixed a bug with it awhile ago, but then I found that Parental Bond's second hit damage reduction is now coded in scripts and in combination with my unchanged code it gave the desired effect already, so I just left it alone and added the updated description.

num: 184,
},

Expand Down
4 changes: 2 additions & 2 deletions data/mods/gen6megasrevisited/pokedex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable
altariamega: {
inherit: true,
types: ["Dragon", "Fairy"],
baseStats: {hp: 75, atk: 70, def: 95, spa: 140, spd: 115, spe: 95},
baseStats: {hp: 75, atk: 90, def: 90, spa: 140, spd: 115, spe: 80},
abilities: {0: "Weather Report"},
},
sceptilemega: {
Expand Down Expand Up @@ -191,7 +191,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable
kangaskhanmega: {
inherit: true,
types: ["Normal", "Ground"],
baseStats: {hp: 105, atk: 135, def: 105, spa: 40, spd: 105, spe: 100},
baseStats: {hp: 105, atk: 125, def: 105, spa: 50, spd: 105, spe: 100},
},
salamencemega: {
inherit: true,
Expand Down
80 changes: 79 additions & 1 deletion data/mods/gen6megasrevisited/scripts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,85 @@
export const Scripts: ModdedBattleScriptsData = {
gen: 6,
inherit: 'gen6',
actions: {
// for parental bond
modifyDamage(
baseDamage: number, pokemon: Pokemon, target: Pokemon, move: ActiveMove, suppressMessages = false
) {
const tr = this.battle.trunc;
if (!move.type) move.type = '???';
const type = move.type;
baseDamage += 2;
if (move.spreadHit) {
// multi-target modifier (doubles only)
const spreadModifier = move.spreadModifier || (this.battle.gameType === 'freeforall' ? 0.5 : 0.75);
this.battle.debug('Spread modifier: ' + spreadModifier);
baseDamage = this.battle.modify(baseDamage, spreadModifier);
} else if (move.multihitType === 'parentalbond' && move.hit > 1) {
// Parental Bond modifier
const bondModifier = this.battle.gen > 6 ? 0.25 : 0.25;
this.battle.debug(`Parental Bond modifier: ${bondModifier}`);
baseDamage = this.battle.modify(baseDamage, bondModifier);
}
baseDamage = this.battle.runEvent('WeatherModifyDamage', pokemon, target, move, baseDamage);
const isCrit = target.getMoveHitData(move).crit;
if (isCrit) {
baseDamage = tr(baseDamage * (move.critModifier || (this.battle.gen >= 6 ? 1.5 : 2)));
}
baseDamage = this.battle.randomizer(baseDamage);
if (type !== '???') {
let stab: number | [number, number] = 1;
const isSTAB = move.forceSTAB || pokemon.hasType(type) || pokemon.getTypes(false, true).includes(type);
if (isSTAB) {
stab = 1.5;
}
if (pokemon.terastallized === 'Stellar') {
if (!pokemon.stellarBoostedTypes.includes(type) || move.stellarBoosted) {
stab = isSTAB ? 2 : [4915, 4096];
move.stellarBoosted = true;
if (pokemon.species.name !== 'Terapagos-Stellar') {
pokemon.stellarBoostedTypes.push(type);
}
}
} else {
if (pokemon.terastallized === type && pokemon.getTypes(false, true).includes(type)) {
stab = 2;
}
stab = this.battle.runEvent('ModifySTAB', pokemon, target, move, stab);
}
baseDamage = this.battle.modify(baseDamage, stab);
}
let typeMod = target.runEffectiveness(move);
typeMod = this.battle.clampIntRange(typeMod, -6, 6);
target.getMoveHitData(move).typeMod = typeMod;
if (typeMod > 0) {
if (!suppressMessages) this.battle.add('-supereffective', target);
for (let i = 0; i < typeMod; i++) {
baseDamage *= 2;
}
}
if (typeMod < 0) {
if (!suppressMessages) this.battle.add('-resisted', target);
for (let i = 0; i > typeMod; i--) {
baseDamage = tr(baseDamage / 2);
}
}
if (isCrit && !suppressMessages) this.battle.add('-crit', target);
if (pokemon.status === 'brn' && move.category === 'Physical' && !pokemon.hasAbility('guts')) {
if (this.battle.gen < 6 || move.id !== 'facade') {
baseDamage = this.battle.modify(baseDamage, 0.5);
}
}
if (this.battle.gen === 5 && !baseDamage) baseDamage = 1;
baseDamage = this.battle.runEvent('ModifyDamage', pokemon, target, move, baseDamage);
if (move.isZOrMaxPowered && target.getMoveHitData(move).zBrokeProtect) {
baseDamage = this.battle.modify(baseDamage, 0.25);
this.battle.add('-zbroken', target);
}
if (this.battle.gen !== 5 && !baseDamage) return 1;
return tr(baseDamage, 16);
},
},
pokemon: {
// for neutralizing gas
ignoringAbility() {
Expand Down Expand Up @@ -120,7 +199,6 @@ export const Scripts: ModdedBattleScriptsData = {
this.modData("Learnsets", "salamence").learnset.airslash = ["6L1"];
this.modData("Learnsets", "salamence").learnset.ironhead = ["6L1"];
this.modData("Learnsets", "tyranitar").learnset.wildcharge = ["6L1"];
this.modData("Learnsets", "tyranitar").learnset.iciclecrash = ["6L1"];
this.modData("Learnsets", "tyranitar").learnset.waterfall = ["6L1"];
this.modData("Learnsets", "diancie").learnset.spikyshield = ["6L1"];
this.modData("Learnsets", "blaziken").learnset.uturn = ["6L1"];
Expand Down
Loading