Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaD173 committed Oct 22, 2024
2 parents 55ecb7b + f848a9f commit e39be20
Show file tree
Hide file tree
Showing 11 changed files with 760 additions and 13 deletions.
15 changes: 14 additions & 1 deletion config/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1879,6 +1879,19 @@ export const Formats: import('../sim/dex-formats').FormatList = [
'Heat Rock', 'King\'s Rock', 'Razor Fang', 'Baton Pass', 'Shed Tail', 'Tailwind',
],
},
{
name: "[Gen 9] Passive Aggressive",
desc: `All forms of passive damage deal type-based damage based on the primary type of the Pokémon that inflicted the passive damage against the target Pokémon.`,
mod: 'passiveaggressive',
searchShow: false,
ruleset: ['Standard OMs', 'Sleep Moves Clause', 'Evasion Items Clause'],
banlist: [
'Arceus', 'Calyrex-Ice', 'Calyrex-Shadow', 'Deoxys-Attack', 'Deoxys-Normal', 'Dialga', 'Dialga-Origin', 'Eternatus', 'Flutter Mane', 'Giratina', 'Giratina-Origin',
'Groudon', 'Ho-Oh', 'Iron Bundle', 'Koraidon', 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Mewtwo', 'Miraidon', 'Necrozma-Dawn-Wings',
'Necrozma-Dusk-Mane', 'Palafin', 'Palkia', 'Palkia-Origin', 'Rayquaza', 'Reshiram', 'Shaymin-Sky', 'Solgaleo', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Crowned',
'Zekrom', 'Arena Trap', 'Moody', 'Shadow Tag', 'King\'s Rock', 'Razor Fang', 'Quick Claw', 'Baton Pass', 'Last Respects',
],
},
{
name: "[Gen 9] Pokebilities",
desc: `Pokémon have all of their released abilities simultaneously.`,
Expand Down Expand Up @@ -4555,7 +4568,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
{
name: "[Gen 3] ZU",
mod: 'gen3',
// searchShow: false,
searchShow: false,
ruleset: ['Standard', 'Sleep Moves Clause', 'Baton Pass Stat Trap Clause', 'Swagger Clause'],
banlist: ['Uber', 'OU', 'UUBL', 'UU', 'NUBL', 'NU', 'PUBL', 'PU', 'ZUBL', 'Baton Pass + Substitute'],
},
Expand Down
4 changes: 2 additions & 2 deletions data/formats-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3632,7 +3632,7 @@ export const FormatsData: import('../sim/dex-species').SpeciesFormatsDataTable =
natDexTier: "UUBL",
},
thundurus: {
tier: "RU",
tier: "RUBL",
doublesTier: "DUU",
natDexTier: "RU",
},
Expand Down Expand Up @@ -5539,7 +5539,7 @@ export const FormatsData: import('../sim/dex-species').SpeciesFormatsDataTable =
natDexTier: "AG",
},
miraidon: {
tier: "Uber",
tier: "AG",
doublesTier: "DUber",
natDexTier: "AG",
},
Expand Down
65 changes: 65 additions & 0 deletions data/mods/passiveaggressive/abilities.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTable = {
aftermath: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (!target.hp && this.checkMoveMakesContact(move, source, target, true)) {
const calc = calculate(this, target, source);
this.damage(calc * source.baseMaxhp / 4, source, target);
}
},
},
baddreams: {
inherit: true,
onResidual(pokemon) {
if (!pokemon.hp) return;
for (const target of pokemon.foes()) {
if (target.status === 'slp' || target.hasAbility('comatose')) {
const calc = calculate(this, pokemon, target);
this.damage(calc * target.baseMaxhp / 8, target, pokemon);
}
}
},
},
gulpmissile: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (!source.hp || !source.isActive || target.isSemiInvulnerable()) return;
if (['cramorantgulping', 'cramorantgorging'].includes(target.species.id)) {
const calc = calculate(this, target, source);
if (calc) this.damage(calc * source.baseMaxhp / 4, source, target);
if (target.species.id === 'cramorantgulping') {
this.boost({def: -1}, source, target, null, true);
} else {
source.trySetStatus('par', target, move);
}
target.formeChange('cramorant', move);
}
},
},
ironbarbs: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (this.checkMoveMakesContact(move, source, target, true)) {
const calc = calculate(this, target, source);
this.damage(calc * source.baseMaxhp / 8, source, target);
}
},
},
roughskin: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (this.checkMoveMakesContact(move, source, target, true)) {
const calc = calculate(this, target, source);
this.damage(calc * source.baseMaxhp / 8, source, target);
}
},
},
};

function calculate(battle: Battle, source: Pokemon, pokemon: Pokemon) {
const move = battle.dex.getActiveMove('tackle');
move.type = source.getTypes()[0];
const typeMod = Math.pow(2, battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6));
if (!pokemon.runImmunity(move.type)) return 0;
return typeMod;
}
56 changes: 56 additions & 0 deletions data/mods/passiveaggressive/conditions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDataTable = {
tox: {
inherit: true,
onResidual(pokemon) {
if (this.effectState.stage < 15) {
this.effectState.stage++;
}
const calc = calculate(this, this.effectState.source, pokemon);
this.damage(calc * this.clampIntRange(pokemon.baseMaxhp / 16, 1) * this.effectState.stage);
},
},
brn: {
inherit: true,
onResidual(pokemon) {
const calc = calculate(this, this.effectState.source, pokemon);
this.damage(calc * pokemon.baseMaxhp / 16);
},
},
psn: {
inherit: true,
onResidual(pokemon) {
const calc = calculate(this, this.effectState.source, pokemon);
this.damage(calc * pokemon.baseMaxhp / 8);
},
},
partiallytrapped: {
inherit: true,
onResidual(pokemon) {
const source = this.effectState.source;
// G-Max Centiferno and G-Max Sandblast continue even after the user leaves the field
const gmaxEffect = ['gmaxcentiferno', 'gmaxsandblast'].includes(this.effectState.sourceEffect.id);
if (source && (!source.isActive || source.hp <= 0 || !source.activeTurns) && !gmaxEffect) {
delete pokemon.volatiles['partiallytrapped'];
this.add('-end', pokemon, this.effectState.sourceEffect, '[partiallytrapped]', '[silent]');
return;
}
const calc = calculate(this, source, pokemon);
this.damage(calc * pokemon.baseMaxhp / this.effectState.boundDivisor);
},
},
sandstorm: {
inherit: true,
onWeather(target) {
const calc = calculate(this, this.effectState.source, target);
this.damage(calc * target.baseMaxhp / 16);
},
},
};

function calculate(battle: Battle, source: Pokemon, pokemon: Pokemon) {
const move = battle.dex.getActiveMove('tackle');
move.type = source.getTypes()[0];
const typeMod = Math.pow(2, battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6));
if (!pokemon.runImmunity(move.type)) return 0;
return typeMod;
}
68 changes: 68 additions & 0 deletions data/mods/passiveaggressive/items.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
blacksludge: {
inherit: true,
onResidual(pokemon) {
if (pokemon.hasType('Poison')) {
this.heal(pokemon.baseMaxhp / 16);
} else {
const calc = calculate(this, pokemon, pokemon);
if (calc) this.damage(calc * pokemon.baseMaxhp / 8);
}
},
},
jabocaberry: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (move.category === 'Physical' && source.hp && source.isActive && !source.hasAbility('magicguard')) {
if (target.eatItem()) {
const calc = calculate(this, target, source);
if (calc) this.damage(calc * source.baseMaxhp / (target.hasAbility('ripen') ? 4 : 8), source, target);
}
}
},
},
lifeorb: {
inherit: true,
onAfterMoveSecondarySelf(source, target, move) {
if (source && source !== target && move && move.category !== 'Status' && !source.forceSwitchFlag) {
const calc = calculate(this, source, source);
if (calc) this.damage(calc * source.baseMaxhp / 10, source, source, this.dex.items.get('lifeorb'));
}
},
},
rockyhelmet: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (this.checkMoveMakesContact(move, source, target)) {
const calc = calculate(this, target, source);
if (calc) this.damage(calc * source.baseMaxhp / 6, source, target);
}
},
},
rowapberry: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (move.category === 'Special' && source.hp && source.isActive && !source.hasAbility('magicguard')) {
if (target.eatItem()) {
const calc = calculate(this, target, source);
if (calc) this.damage(calc * source.baseMaxhp / (target.hasAbility('ripen') ? 4 : 8), source, target);
}
}
},
},
stickybarb: {
inherit: true,
onResidual(pokemon) {
const calc = calculate(this, pokemon, pokemon);
if (calc) this.damage(calc * pokemon.baseMaxhp / 8);
},
},
};

function calculate(battle: Battle, source: Pokemon, pokemon: Pokemon) {
const move = battle.dex.getActiveMove('tackle');
move.type = source.getTypes()[0];
const typeMod = Math.pow(2, battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6));
if (!pokemon.runImmunity(move.type)) return 0;
return typeMod;
}
Loading

0 comments on commit e39be20

Please sign in to comment.