Skip to content

Commit

Permalink
Merge branch 'scoopapa:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysio4 authored Nov 23, 2023
2 parents f31dd76 + 5d8966c commit 3c6f6da
Show file tree
Hide file tree
Showing 29 changed files with 723 additions and 101 deletions.
6 changes: 3 additions & 3 deletions config/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2688,10 +2688,10 @@ export const Formats: FormatList = [
},
onSwitchIn(pokemon) {
// @ts-ignore
const originalFormeSecies = this.dex.species.get(pokemon.species.originalSpecies);
if (originalFormeSecies.exists && pokemon.m.originalSpecies !== originalFormeSecies.baseSpecies) {
const originalFormeSpecies = this.dex.species.get(pokemon.species.originalSpecies);
if (originalFormeSpecies.exists && pokemon.m.originalSpecies !== originalFormeSpecies.baseSpecies) {
// Place volatiles on the Pokémon to show its mega-evolved condition and details
this.add('-start', pokemon, originalFormeSecies.requiredItem || originalFormeSecies.requiredMove, '[silent]');
this.add('-start', pokemon, originalFormeSpecies.requiredItem || originalFormeSpecies.requiredMove, '[silent]');
const oSpecies = this.dex.species.get(pokemon.m.originalSpecies);
if (oSpecies.types.length !== pokemon.species.types.length || oSpecies.types[1] !== pokemon.species.types[1]) {
this.add('-start', pokemon, 'typechange', pokemon.species.types.join('/'), '[silent]');
Expand Down
94 changes: 50 additions & 44 deletions data/mods/bearticphone/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
boombox: {
onSourceDamagingHit(damage, target, source, move) {
// Despite not being a secondary, Shield Dust / Covert Cloak block Boombox's effect
if (target.hasAbility('shielddust') || target.hasItem('covertcloak')) return;
if (target.hasAbility('shielddust') || target.hasItem('covertcloak')
|| this.randomChance(7, 10)) return;

if (this.randomChance(3, 10)) {
target.addVolatile('confusion', source);
}
target.addVolatile('confusion', source);

},
name: "Boombox",
shortDesc: "This Pokemon's moves have a 30% chance of confusing.",
Expand Down Expand Up @@ -90,10 +90,8 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
}
},
onAllyTryHitSide(target, source, move) {
if (source === this.effectState.target || !target.isAlly(source)) return;
if (move.type === 'Rock') {
this.boost({atk: 1}, this.effectState.target);
}
if (source === this.effectState.target || !target.isAlly(source) || move.type !== 'Rock') return;
this.boost({atk: 1}, this.effectState.target);
},
isBreakable: true,
name: "Molten Fury",
Expand All @@ -104,7 +102,7 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
phantomthief: {
onModifyMovePriority: -5,
onModifyMove(move) {
if (!move.ignoreImmunity) move.ignoreImmunity = {};
move.ignoreImmunity ||= {};
if (move.ignoreImmunity !== true) {
move.ignoreImmunity['Ghost'] = true;
}
Expand All @@ -122,9 +120,9 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
},
quackery: {
onStart(pokemon) {
for (const pokemon of this.getAllActive()) {
pokemon.clearBoosts();
this.add('-clearboost', pokemon, '[from] ability: Quackery', '[of] ' + pokemon);
for (const target of this.getAllActive()) {
target.clearBoosts();
this.add('-clearboost', target, '[from] ability: Quackery', '[of] ' + pokemon);
}
},
name: "Quackery",
Expand All @@ -136,21 +134,19 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
onTryHitPriority: 1,
onTryHit(target, source, move) {
if (target !== source && move.type === 'Fire') {
if (!this.boost({atk: 1})) {
if (!this.boost({spe: 1})) {
this.add('-immune', target, '[from] ability: Rocket Propulsion');
}
return null;
}
},
onAllyTryHitSide(target, source, move) {
if (source === this.effectState.target || !target.isAlly(source)) return;
if (move.type === 'Fire') {
this.boost({spe: 1}, this.effectState.target);
}
if (source === this.effectState.target || !target.isAlly(source) || move.type !== 'Fire') return;
this.boost({spe: 1}, this.effectState.target);
},
isBreakable: true,
name: "Rocket Propulsion",
shortDesc: "This Pokemon's Attack is raised 1 stage if hit by a Fire move; Fire immunity.",
shortDesc: "This Pokemon's Speed is raised 1 stage if hit by a Fire move; Fire immunity.",
rating: 3,
num: 157,
},
Expand All @@ -159,7 +155,7 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
onBasePower(basePower, attacker, defender, move) {
if (move.flags['bullet']) {
this.debug('Sharpshooter boost');
return this.chainModify(1.3);
return this.chainModify([5325, 4096]);
}
},
name: "Sharpshooter",
Expand All @@ -169,10 +165,9 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
},
twoleftfeet: {
onAfterMoveSecondary(target, source, move) {
if (!source || source === target || !target.hp || !move.totalDamage || move.hasBounced) return;
const moves = ['axekick', 'chatter', 'confuseray', 'confusion', 'dizzypunch', 'dynamicpunch', 'flatter', 'hurricane', 'magicaltorque', 'psybeam', 'rockclimb', 'secretpower', 'shadowpanic', 'signalbeam', 'strangesteam', 'supersonic', 'swagger', 'sweetkiss', 'teeterdance', 'waterpulse'];
if (!source || source === target || !target.hp || !move.totalDamage) return;
if ((moves.includes(move.id) || moves.includes(move.name))) {
if (move.hasBounced == true) return;
if (moves.includes(move.id) || moves.includes(move.name)) {
const newMove = this.dex.getActiveMove(move.id);
newMove.hasBounced = true;
newMove.pranksterBoosted = false;
Expand All @@ -181,7 +176,7 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
}
},
name: "Two Left Feet",
shortDesc: "After another Pokemon uses a move that can cause confusion, this Pokemon uses the same move.",
shortDesc: "After another Pokemon uses a move that can cause confusion, this Pokemon uses the same move.", //Currently like Magic Bounce, ideally should function like Dancer
rating: 4,
},
rollingboil: {
Expand Down Expand Up @@ -230,39 +225,36 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
onDamagePriority: 1,
onDamage(damage, target, source, effect) {
if (
effect && effect.effectType === 'Move' &&
['heirfriar'].includes(target.species.id) && !target.transformed
effect?.effectType === 'Move' &&
target.species.id === 'heirfriar' && !target.transformed
) {
this.add('-activate', target, 'ability: Be Not Afraid');
this.effectState.busted = true;
return 0;
}
},
onCriticalHit(target, source, move) {
if (!target) return;
if (!['heirfriar'].includes(target.species.id) || target.transformed) {
if (!target/*) return;
if (*/|| target.species.id !== 'heirfriar' || target.transformed || !target.runImmunity(move.type)) {
return;
}
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
if (hitSub) return;

if (!target.runImmunity(move.type)) return;
return false;
},
onEffectiveness(typeMod, target, type, move) {
if (!target || move.category === 'Status') return;
if (!['heirfriar'].includes(target.species.id) || target.transformed) {
if (!target || move.category === 'Status'/*) return;
if (*/|| target.species.id !== 'heirfriar' || target.transformed || !target.runImmunity(move.type)) {
return;
}

const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
if (hitSub) return;

if (!target.runImmunity(move.type)) return;
return 0;
},
onUpdate(pokemon) {
if (['heirfriar'].includes(pokemon.species.id) && this.effectState.busted) {
if (pokemon.species.id === 'heirfriar' && this.effectState.busted) {
const speciesid = pokemon.species.id === 'Heirfriar-Holy';
pokemon.formeChange(speciesid, this.effect, true);
this.damage(pokemon.baseMaxhp / 8, pokemon, pokemon, this.dex.species.get(speciesid));
Expand Down Expand Up @@ -318,13 +310,27 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
num: 273,
},
bullseye: {
onStart(pokemon) {
this.effectState.boosts = 0;
},
onSourceAfterFaint(length, target, source, effect) {
if (effect && effect.effectType === 'Move') {
this.actions.useMove("focusenergy", source, source);
this.add('-ability', source, 'Bullseye');
const newboosts = this.effectState.boosts+1;
this.add('-end', pokemon, `bullseye${newboosts-1}`, '[silent]');
this.add('-start', pokemon, `bullseye${newboosts}`, '[silent]');
this.effectState.boosts = newboosts;
}
},
onModifyCritRatio(critRatio) {
if (!this.effectState.boosts) return;
return critRatio + this.effectState.boosts;
},
onEnd(pokemon) {
this.add('-end', pokemon, `bullseye${this.effectState.boosts}`, '[silent]');
},
name: "Bullseye",
shortDesc: "Uses Focus Energy currently - KOing an opponent raises crit ratio by 1",
shortDesc: "KOing an opponent raises crit ratio by 1",
rating: 3,
num: 153,
},
Expand All @@ -342,27 +348,27 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
},
mobmentality: {
onStart(pokemon) {
const allies = pokemon.side.pokemon;
if (pokemon.side.totalFainted < allies.length - 1) {
const benched = (pokemon.side.pokemon.length - 1) - pokemon.side.totalFainted;
if (benched) {
this.add('-activate', pokemon, 'ability: Mob Mentality');
const fallen = Math.min(pokemon.side.totalFainted, 5);
this.add('-start', pokemon, `fallen${fallen}`, '[silent]');
this.effectState.fallen = (allies.length - 1) - fallen;
const unfainted = Math.min(benched, 5);
this.add('-start', pokemon, `unfainted${unfainted}`, '[silent]');
this.effectState.unfainted = unfainted;
}
},
onEnd(pokemon) {
this.add('-end', pokemon, `fallen${this.effectState.fallen}`, '[silent]');
this.add('-end', pokemon, `unfainted${this.effectState.unfainted$}`, '[silent]');
},
onBasePowerPriority: 21,
onBasePower(basePower, attacker, defender, move) {
if (this.effectState.fallen) {
const powMod = [6144, 5734, 5325, 4915, 4506, 4096];
if (this.effectState.unfainted) {
const powMod = [4096, 4506, 4915, 5325, 5734, 6144];
this.debug(`Mob Mentality boost: ${powMod[this.effectState.fallen]}/4096`);
return this.chainModify([powMod[this.effectState.fallen], 4096]);
}
},
name: "Mob Mentality",
shortDesc: "Uncoded - This Pokemon's moves have 10% more power for each unfainted ally, up to 5 allies.",
shortDesc: "This Pokemon's moves have 10% more power for each unfainted ally, up to 5 allies.",
rating: 4,
num: 293,
},
Expand Down
50 changes: 45 additions & 5 deletions data/mods/bearticphone/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,54 @@ export const Scripts: {[k: string]: ModdedBattleScriptsData} = {
this.battle.add('-hint', `Some effects can force a Pokemon to use ${move.name} again in a row.`);
}

/*
// Dancer's activation order is completely different from any other event, so it's handled separately
if (moveDidSomething && !move.isExternal) {
const dancers = [];
const confusemoves = ['axekick', 'chatter', 'confuseray', 'confusion', 'dizzypunch', 'dynamicpunch', 'flatter', 'hurricane', 'magicaltorque',
'psybeam', 'rockclimb', 'secretpower', 'shadowpanic', 'signalbeam', 'strangesteam', 'supersonic', 'swagger', 'sweetkiss', 'teeterdance', 'waterpulse'];
for (const currentPoke of this.battle.getAllActive()) {
if (pokemon === currentPoke || currentPoke.isSemiInvulnerable()) continue;
if (currentPoke.hasAbility('twoleftfeet')) {
if (!confusemoves.includes(move.id) && !confusemoves.includes(move.name)) continue;
dancers.push(currentPoke);
} else if (currentPoke.hasAbility('beantheredonethat') && move.category === 'Status') {
if (['rototiller','flowershield','magneticflux','gearup'].includes(move.id)) {
dancers.push(currentPoke);
} else if (move.boosts) {
let i: BoostID;
for (i in move.boosts) {
if (boost[i]! > 0) {
dancers.push(currentPoke);
break;
}
}
}
}
}
// Dancer activates in order of lowest speed stat to highest
// Note that the speed stat used is after any volatile replacements like Speed Swap,
// but before any multipliers like Agility or Choice Scarf
// Ties go to whichever Pokemon has had the ability for the least amount of time
dancers.sort(
(a, b) => -(b.storedStats['spe'] - a.storedStats['spe']) || b.abilityOrder - a.abilityOrder
);
const targetOf1stDance = this.battle.activeTarget!;
for (const dancer of dancers) {
if (this.battle.faintMessages()) break;
if (dancer.fainted) continue;
this.battle.add('-activate', dancer, 'ability: ' + dancer.getAbility().name);
const dancersTarget = !targetOf1stDance.isAlly(dancer) && pokemon.isAlly(dancer) ?
targetOf1stDance :
pokemon;
const dancersTargetLoc = dancer.getLocOf(dancersTarget);
this.runMove(move.id, dancer, dancersTargetLoc, this.dex.abilities.get(dancer.ability), undefined, true);
}
}*/

if (noLock && pokemon.volatiles['lockedmove']) delete pokemon.volatiles['lockedmove'];
this.battle.faintMessages();
this.battle.checkWin();

if (this.battle.gen <= 4) {
// In gen 4, the outermost move is considered the last move for Copycat
this.battle.activeMove = oldActiveMove;
}
}
},
teambuilderConfig: {
Expand Down
46 changes: 23 additions & 23 deletions data/mods/earthsky/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,27 @@ export const Moves: {[moveid: string]: ModdedMoveData} = {
this.add('-anim', source, "Brutal Swing", target);
},
},
metaledge: {
num: 1036,
basePower: 90,
accuracy: 100,
category: "Physical",
name: "Metal Edge",
pp: 15,
priority: 0,
flags: {contact: 1, protect: 1, mirror: 1, slicing: 1},
critRatio: 2,
secondary: null,
desc: "Has a higher chance for a critical hit.",
shortDesc: "High critical hit ratio.",
target: "normal",
type: "Steel",
contestType: "Cool",
onPrepareHit(target, source, move) {
this.attrLastMove('[still]');
this.add('-anim', source, "Metal Claw", target);
},
},
midnight: {
num: 1010,
basePower: 0,
Expand All @@ -516,12 +537,12 @@ export const Moves: {[moveid: string]: ModdedMoveData} = {
return 5;
},
onFieldStart(battle, source, effect) {
this.add('-fieldstart', 'move: Midnight');
//this.add('-fieldstart', 'move: Midnight');
this.add('-message', "The battlefield became very dark!");
//Suppression implemented in scripts.ts as edits to sim/field.ts
},
onFieldEnd() {
this.add('-fieldend', 'move: Midnight');
//this.add('-fieldend', 'move: Midnight');
this.add('-message', "The darkness disappeared from the field.");
},
},
Expand Down Expand Up @@ -560,27 +581,6 @@ export const Moves: {[moveid: string]: ModdedMoveData} = {
this.add('-anim', source, "Extrasensory", target);
},
},
metaledge: {
num: 1036,
basePower: 90,
accuracy: 100,
category: "Physical",
name: "Metal Edge",
pp: 15,
priority: 0,
flags: {contact: 1, protect: 1, mirror: 1, slicing: 1},
critRatio: 2,
secondary: null,
desc: "Has a higher chance for a critical hit.",
shortDesc: "High critical hit ratio.",
target: "normal",
type: "Steel",
contestType: "Cool",
onPrepareHit(target, source, move) {
this.attrLastMove('[still]');
this.add('-anim', source, "Metal Claw", target);
},
},
moltenslag: {
num: 1012,
basePower: 80,
Expand Down
Loading

0 comments on commit 3c6f6da

Please sign in to comment.