Compare commits

..

4 Commits

Author SHA1 Message Date
Benjamin Odom
79a87e1c65 Update pokemon.ts 2024-05-12 10:27:54 -04:00
LaukkaE
ced74efc52
fix isGrounded check (#774) 2024-05-12 06:30:18 -05:00
Madi Simpson
e1ef3c03de
ability: make technician respect variable power moves (#529) 2024-05-12 04:06:09 -05:00
Landon Lee
a27822b624
Fix cry when pokemon is fused with its own species (#615)
If the pokemon species and form is the same as the second fusion component, then skip the logic to make a fused cry and just use the cry of the primary component.
2024-05-12 03:01:59 -05:00
2 changed files with 9 additions and 5 deletions

View File

@ -9,7 +9,7 @@ import { BattlerTag } from "./battler-tags";
import { BattlerTagType } from "./enums/battler-tag-type";
import { StatusEffect, getStatusEffectDescriptor, getStatusEffectHealText } from "./status-effect";
import { Gender } from "./gender";
import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, RecoilAttr, StatusMoveTypeImmunityAttr, FlinchAttr, OneHitKOAttr, HitHealAttr, StrengthSapHealAttr, allMoves, StatusMove } from "./move";
import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, RecoilAttr, StatusMoveTypeImmunityAttr, FlinchAttr, OneHitKOAttr, HitHealAttr, StrengthSapHealAttr, allMoves, StatusMove, VariablePowerAttr, applyMoveAttrs } from "./move";
import { ArenaTagSide, ArenaTrapTag } from "./arena-tag";
import { ArenaTagType } from "./enums/arena-tag-type";
import { Stat } from "./pokemon-stat";
@ -3042,7 +3042,11 @@ export function initAbilities() {
new Ability(Abilities.STALL, 4)
.unimplemented(),
new Ability(Abilities.TECHNICIAN, 4)
.attr(MovePowerBoostAbAttr, (user, target, move) => move.power <= 60, 1.5),
.attr(MovePowerBoostAbAttr, (user, target, move) => {
const power = new Utils.NumberHolder(move.power);
applyMoveAttrs(VariablePowerAttr, user, target, move, power);
return power.value <= 60
}, 1.5),
new Ability(Abilities.LEAF_GUARD, 4)
.attr(StatusEffectImmunityAbAttr)
.condition(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN))

View File

@ -940,7 +940,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
isGrounded(): boolean {
return !this.isOfType(Type.FLYING, true) && this.getAbility().id !== Abilities.LEVITATE && !!this.getTag(BattlerTagType.GROUNDED);
return !this.isOfType(Type.FLYING, true) && !this.hasAbility(Abilities.LEVITATE);
}
getAttackMoveEffectiveness(source: Pokemon, move: PokemonMove): TypeDamageMultiplier {
@ -1865,7 +1865,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const scene = sceneOverride || this.scene;
const cry = this.getSpeciesForm().cry(scene, soundConfig);
let duration = cry.totalDuration * 1000;
if (this.fusionSpecies) {
if (this.fusionSpecies && this.getSpeciesForm() != this.getFusionSpeciesForm()) {
let fusionCry = this.getFusionSpeciesForm().cry(scene, soundConfig, true);
duration = Math.min(duration, fusionCry.totalDuration * 1000);
fusionCry.destroy();
@ -1884,7 +1884,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
faintCry(callback: Function): void {
if (this.fusionSpecies)
if (this.fusionSpecies && this.getSpeciesForm() != this.getFusionSpeciesForm())
return this.fusionFaintCry(callback);
const key = this.getSpeciesForm().getCryKey(this.formIndex);