Skip to content

Commit

Permalink
Straightening some things out
Browse files Browse the repository at this point in the history
  • Loading branch information
EnPassant4264 committed Aug 28, 2024
1 parent fc51430 commit c5aa712
Show file tree
Hide file tree
Showing 9 changed files with 716 additions and 309 deletions.
25 changes: 19 additions & 6 deletions data/mods/earthsky/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ export const Abilities: {[abilityid: string]: ModdedAbilityData} = {
delete this.effectState.magicked;
},
name: "Magician",
desc: "The user swaps its held item with the held item of a Pokemon it hits with an attack. This effect fails if neither the user or the target is holding an item, if the user is trying to give or take a Mega Stone to or from the species that can Mega Evolve with it, or if the user is trying to give or take a Blue Orb, a Red Orb, a Griseous Orb, a Plate, a Drive, a Memory, a Rusted Sword, or a Rusted Shield to or from a Kyogre, a Groudon, a Giratina, an Arceus, a Genesect, a Silvally, a Zacian, or a Zamazenta, respectively. The target is immune to this effect if it has the Sticky Hold Ability. This effect can only trigger once per switch-in. Does not affect Doom Desire and Future Sight.",
desc: "The user swaps its held item with the held item of a Pokemon it hits with an attack. This effect fails if neither the user or the target is holding an item or if the user is trying to give or take a Mega Stone or form-changing item to or from the species that can Mega Evolve or change forms with it. The target is immune to this effect if it has the Sticky Hold Ability. This effect can only trigger once per switch-in. Does not affect Doom Desire and Future Sight.",
shortDesc: "Swaps items with a Pokemon it hits with an attack. Once per switch-in.",
flags: {},
num: 170,
Expand Down Expand Up @@ -2096,8 +2096,8 @@ export const Abilities: {[abilityid: string]: ModdedAbilityData} = {
name: "Magnet Pull",
rating: 4,
num: 42,
desc: "Prevents opposing Steel-type Pokemon from choosing to switch out for three turns, unless they are holding a Shed Shell or are a Ghost type.",
shortDesc: "Prevents opposing Steel-type Pokemon from choosing to switch out for 3 turns.",
desc: "Prevents opposing Steel-types from switching out for four turns (six turns if the user is holding Grip Claw), starting from when either the user or a valid foe switches in. The target can still switch out if it is holding Shed Shell, is behind a Substitute, has Run Away, or uses Baton Pass, Escape Tunnel, Parting Shot, Psy Bubble, Slip Away, Teleport, U-turn, or Volt Switch. The effect ends if the user leaves the field.",
shortDesc: "Traps enemy Steel-types for 4 turns.",
},
megalauncher: {
inherit: true,
Expand Down Expand Up @@ -2157,7 +2157,7 @@ export const Abilities: {[abilityid: string]: ModdedAbilityData} = {
},
onSourceAfterFaint(length, target, source, effect) {
if (effect && effect.effectType === 'Move') {
this.effectState.boost = {def: length, spd: length, spe: -length};
this.effectState.boost = {def: 1, spd: 1, spe: -1};
}
},
onTryHeal(damage, target, source, effect) {
Expand Down Expand Up @@ -2687,8 +2687,8 @@ export const Abilities: {[abilityid: string]: ModdedAbilityData} = {
name: "Shadow Tag",
rating: 4.5,
num: 23,
desc: "Prevents opposing Pokemon from choosing to switch out for three turns, unless they are holding a Shed Shell, have the Run Away or Shadow Tag Abilities, or are a Ghost type.",
shortDesc: "Prevents foes from switching for 3 turns unless they also have this Ability.",
desc: "Prevents opposing Pokemon from switching out for four turns (six turns if the user is holding Grip Claw), starting from when either the user or a valid foe switches in. The target can still switch out if it is holding Shed Shell, is behind a Substitute, has Shadow Tag or Run Away, or uses Baton Pass, Escape Tunnel, Parting Shot, Psy Bubble, Slip Away, Teleport, U-turn, or Volt Switch. The effect ends if the user leaves the field.",
shortDesc: "Traps enemies without Shadow Tag for 4 turns.",
},
sharpness: {
inherit: true,
Expand Down Expand Up @@ -2914,6 +2914,19 @@ export const Abilities: {[abilityid: string]: ModdedAbilityData} = {
}
},
},
synchronize: {
inherit: true,
onAfterSetStatus(status, target, source, effect) {
if (!source || source === target) return;
if (effect && effect.id === 'toxicspikes') return;
this.add('-activate', target, 'ability: Synchronize');
// Hack to make status-prevention abilities think Synchronize is a status move
// and show messages when activating against it.
source.trySetStatus(status, target, {status: status.id, id: 'synchronize'} as Effect);
},
desc: "If another Pokemon inflicts a non-volatile status condition on this Pokemon, that Pokemon receives the same non-volatile status condition.",
shortDesc: "If status is inflicted by another Pokemon, it also gets that status.",
},
tangledfeet: {
onDamage(damage, target, source, effect) {
if (effect.id === this.toID('confused') && !pokemon.volatiles['odorsleuth']) {
Expand Down
40 changes: 32 additions & 8 deletions data/mods/earthsky/conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
trapped: {
inherit: true,
duration: 4,
durationCallback(target, source) {
if (source?.hasItem('gripclaw')) return 6;
return 4;
},
onStart(target) {
if(!this.turn) this.effectState.duration--;
this.add('-activate', target, 'trapped');
Expand All @@ -80,6 +84,11 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
},
partiallytrapped: {
inherit: true,
duration: 4,
durationCallback(target, source) {
if (source?.hasItem('gripclaw')) return 6;
return 4;
},
onStart(pokemon, source) {
if(pokemon.volatiles['strongpartialtrap']) return false;
this.add('-activate', pokemon, 'move: ' + this.effectState.sourceEffect, '[of] ' + source);
Expand Down Expand Up @@ -169,32 +178,36 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
name: 'blocked',
noCopy: true,
duration: 4,
durationCallback(target, source) {
if (source?.hasItem('gripclaw')) return 6;
return 4;
},
onStart(target, source, move) {
this.add('-activate', target, 'trapped');
},
onTrapPokemon(pokemon) {
pokemon.tryTrap();
},
onSourceHit(target, source, move) { //Damaging moves won't switch
if(move.selfSwitch && target !== source && !source.hasItem('shedshell') && !source.hasAbility('runaway')) delete move.selfSwitch;
if(move.selfSwitch && target !== source && !source.volatiles['substitute'] && !source.hasItem('shedshell') && !source.hasAbility('runaway')) delete move.selfSwitch;
},
onAfterMoveSecondaryPriority: -100,
onAfterMoveSecondary(target, source, move) { //Items and custom Abilities won't switch
if(target !== source){
if(source.switchFlag && !source.hasItem('shedshell') && !source.hasAbility('runaway')){
if(source.switchFlag && !source.volatiles['substitute'] && !source.hasItem('shedshell') && !source.hasAbility('runaway')){
this.add('-fail', target, '[from] move: Fairy Lock');
source.switchFlag = false;
return null;
}
if(target.switchFlag && !target.hasItem('shedshell') && !target.hasAbility('runaway')){
if(target.switchFlag && !target.volatiles['substitute'] && !target.hasItem('shedshell') && !target.hasAbility('runaway')){
this.add('-fail', target, '[from] move: Fairy Lock');
source.switchFlag = false;
return null;
}
}
},
onEmergencyExit(target) { //Escape Plan won't switch
if(!target.hasItem('shedshell')){
if(!target.hasItem('shedshell') && !target.volatiles['substitute']){
target.switchFlag = false;
return false;
}
Expand All @@ -204,6 +217,10 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
name: 'meanlooked',
noCopy: true,
duration: 4,
durationCallback(target, source) {
if (source?.hasItem('gripclaw')) return 6;
return 4;
},
onStart(target, source, move) {
this.add('-activate', target, 'trapped');
},
Expand Down Expand Up @@ -242,18 +259,18 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
name: 'strongpartialtrap',
duration: 3,
durationCallback(target, source) {
if (source?.hasItem('gripclaw')) return 5;
return this.random(3, 4);
if (source?.hasItem('gripclaw')) return 4;
return 3;
},
onStart(pokemon, source) {
if(pokemon.volatiles['partiallytrapped']) return false;
this.add('-activate', pokemon, 'move: ' + this.effectState.sourceEffect, '[of] ' + source);
this.effectState.boundDivisor = source.hasItem('bindingband') ? 3 : 4;
},
onResidualOrder: 11,
onResidualOrder: 13,
onResidual(pokemon) {
const source = this.effectState.source;
if (source && (!source.isActive || source.hp <= 0 || !source.activeTurns) && !gmaxEffect) {
if (source && (!source.isActive || source.hp <= 0 || !source.activeTurns)) {
delete pokemon.volatiles['strongpartialtrap'];
this.add('-end', pokemon, this.effectState.sourceEffect, '[strongpartialtrap]', '[silent]');
return;
Expand All @@ -263,6 +280,13 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
onEnd(pokemon) {
this.add('-end', pokemon, this.effectState.sourceEffect, '[strongpartialtrap]');
},
onTrapPokemon(pokemon) {
if (this.effectState.source?.isActive) pokemon.tryTrap();
},
},
sleuther: {
name: 'sleuther',
noCopy: true,
},
/* Status changes due to other elements */
par: {
Expand Down
4 changes: 2 additions & 2 deletions data/mods/earthsky/formats-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3220,8 +3220,8 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
natDexTier: 'OU'
},
cherrimsunshine: {
tier: 'OU',
natDexTier: 'OU'
tier: 'Illegal',
natDexTier: 'Illegal'
},
buneary: {
tier: 'LC',
Expand Down
7 changes: 6 additions & 1 deletion data/mods/earthsky/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,12 @@ export const Items: {[itemid: string]: ModdedItemData} = {
},
bindingband: {
inherit: true,
desc: "Holder's partial-trapping moves deal 1/6 or 1/3 max HP per turn instead of 1/8 or 1/4.",
desc: "Holder's binding moves deal 1/6 or 1/3 max HP per turn instead of 1/8 or 1/4.",
},
gripclaw: {
inherit: true,
shortDesc: "If the holder uses a move that traps or binds for more than a single turn (excluding the turn of use), its duration is extended. Trapping and binding last six turns instead of four, and strong binding lasts three turns instead of two.",
shortDesc: "Holder's trap/binding lasts 6 turns, strong bind lasts 3 turns.",
},
heavydutyboots: {
inherit: true,
Expand Down
Loading

0 comments on commit c5aa712

Please sign in to comment.