mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-03 23:12:20 +02:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
2bd505a2e6
@ -1,15 +1,16 @@
|
||||
import { Arena } from "../field/arena";
|
||||
import { Type } from "./type";
|
||||
import * as Utils from "../utils";
|
||||
import { MoveCategory, allMoves } from "./move";
|
||||
import { MoveCategory, StatChangeAttr, allMoves } from "./move";
|
||||
import { getPokemonMessage } from "../messages";
|
||||
import Pokemon, { HitResult, PokemonMove } from "../field/pokemon";
|
||||
import { MoveEffectPhase } from "../phases";
|
||||
import { MoveEffectPhase, StatChangePhase } from "../phases";
|
||||
import { StatusEffect } from "./status-effect";
|
||||
import { BattlerIndex } from "../battle";
|
||||
import { Moves } from "./enums/moves";
|
||||
import { ArenaTagType } from "./enums/arena-tag-type";
|
||||
import { BlockNonDirectDamageAbAttr, applyAbAttrs } from "./ability";
|
||||
import { BlockNonDirectDamageAbAttr, ProtectStatAbAttr, applyAbAttrs } from "./ability";
|
||||
import { BattleStat } from "./battle-stat";
|
||||
|
||||
export enum ArenaTagSide {
|
||||
BOTH,
|
||||
@ -392,6 +393,34 @@ class StealthRockTag extends ArenaTrapTag {
|
||||
}
|
||||
}
|
||||
|
||||
class StickyWebTag extends ArenaTrapTag {
|
||||
constructor(sourceId: integer, side: ArenaTagSide) {
|
||||
super(ArenaTagType.STICKY_WEB, Moves.STICKY_WEB, sourceId, side, 1);
|
||||
}
|
||||
|
||||
onAdd(arena: Arena): void {
|
||||
super.onAdd(arena);
|
||||
|
||||
const source = arena.scene.getPokemonById(this.sourceId);
|
||||
arena.scene.queueMessage(`A ${this.getMoveName()} has been laid out on the ground around the opposing team!`);
|
||||
}
|
||||
|
||||
activateTrap(pokemon: Pokemon): boolean {
|
||||
if (pokemon.isGrounded()) {
|
||||
const cancelled = new Utils.BooleanHolder(false);
|
||||
applyAbAttrs(ProtectStatAbAttr, pokemon, cancelled);
|
||||
if (!cancelled.value) {
|
||||
pokemon.scene.queueMessage(`The opposing ${pokemon.name} was caught in a sticky web!`);
|
||||
const statLevels = new Utils.NumberHolder(-1);
|
||||
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, [BattleStat.SPD], statLevels.value));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class TrickRoomTag extends ArenaTag {
|
||||
constructor(turnCount: integer, sourceId: integer) {
|
||||
super(ArenaTagType.TRICK_ROOM, turnCount, Moves.TRICK_ROOM, sourceId);
|
||||
@ -443,6 +472,8 @@ export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMov
|
||||
return new DelayedAttackTag(tagType, sourceMove, sourceId, targetIndex);
|
||||
case ArenaTagType.STEALTH_ROCK:
|
||||
return new StealthRockTag(sourceId, side);
|
||||
case ArenaTagType.STICKY_WEB:
|
||||
return new StickyWebTag(sourceId, side);
|
||||
case ArenaTagType.TRICK_ROOM:
|
||||
return new TrickRoomTag(turnCount, sourceId);
|
||||
case ArenaTagType.GRAVITY:
|
||||
|
@ -9,6 +9,7 @@ export enum ArenaTagType {
|
||||
FUTURE_SIGHT = "FUTURE_SIGHT",
|
||||
DOOM_DESIRE = "DOOM_DESIRE",
|
||||
STEALTH_ROCK = "STEALTH_ROCK",
|
||||
STICKY_WEB = "STICKY_WEB",
|
||||
TRICK_ROOM = "TRICK_ROOM",
|
||||
GRAVITY = "GRAVITY",
|
||||
REFLECT = "REFLECT",
|
||||
|
@ -4176,7 +4176,8 @@ export function initMoves() {
|
||||
new AttackMove(Moves.BELCH, "Belch (P)", Type.POISON, MoveCategory.SPECIAL, 120, 90, 10, "The user lets out a damaging belch at the target. The user must eat a held Berry to use this move.", -1, 0, 6),
|
||||
new StatusMove(Moves.ROTOTILLER, "Rototiller (N)", Type.GROUND, -1, 10, "Tilling the soil, the user makes it easier for plants to grow. This raises the Attack and Sp. Atk stats of Grass-type Pokémon.", 100, 0, 6)
|
||||
.target(MoveTarget.ALL),
|
||||
new StatusMove(Moves.STICKY_WEB, "Sticky Web (N)", Type.BUG, -1, 20, "The user weaves a sticky net around the opposing team, which lowers their Speed stats upon switching into battle.", -1, 0, 6)
|
||||
new StatusMove(Moves.STICKY_WEB, "Sticky Web", Type.BUG, -1, 20, "The user weaves a sticky net around the opposing team, which lowers their Speed stats upon switching into battle.", -1, 0, 6)
|
||||
.attr(AddArenaTrapTagAttr, ArenaTagType.STICKY_WEB)
|
||||
.target(MoveTarget.ENEMY_SIDE),
|
||||
new AttackMove(Moves.FELL_STINGER, "Fell Stinger (P)", Type.BUG, MoveCategory.PHYSICAL, 50, 100, 25, "When the user knocks out a target with this move, the user's Attack stat rises drastically.", -1, 0, 6),
|
||||
new AttackMove(Moves.PHANTOM_FORCE, "Phantom Force", Type.GHOST, MoveCategory.PHYSICAL, 90, 100, 10, "The user vanishes somewhere, then strikes the target on the next turn. This move hits even if the target protects itself.", -1, 0, 6)
|
||||
|
@ -2,7 +2,7 @@ import Phaser from 'phaser';
|
||||
import BattleScene, { ABILITY_OVERRIDE, AnySound, MOVE_OVERRIDE, OPP_ABILITY_OVERRIDE, OPP_MOVE_OVERRIDE } from '../battle-scene';
|
||||
import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info';
|
||||
import { Moves } from "../data/enums/moves";
|
||||
import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr } from "../data/move";
|
||||
import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr, SacrificialAttr } from "../data/move";
|
||||
import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm } from '../data/pokemon-species';
|
||||
import * as Utils from '../utils';
|
||||
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type';
|
||||
@ -181,8 +181,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
this.calculateStats();
|
||||
this.generateFusionSpecies();
|
||||
}
|
||||
|
||||
this.generateAndPopulateMoveset();
|
||||
}
|
||||
|
||||
this.generateName();
|
||||
@ -939,7 +937,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
|
||||
generateAndPopulateMoveset(): void {
|
||||
this.moveset = [];
|
||||
const movePool = [];
|
||||
let movePool: Moves[] = [];
|
||||
const allLevelMoves = this.getLevelMoves(1, true, true);
|
||||
if (!allLevelMoves) {
|
||||
console.log(this.species.speciesId, 'ERROR');
|
||||
@ -958,6 +956,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isBoss())
|
||||
movePool = movePool.filter(m => !allMoves[m].getAttrs(SacrificialAttr).length);
|
||||
|
||||
movePool.reverse();
|
||||
|
||||
const attackMovePool = movePool.filter(m => {
|
||||
@ -2047,6 +2048,8 @@ export class PlayerPokemon extends Pokemon {
|
||||
constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex: integer, formIndex: integer, gender: Gender, shiny: boolean, ivs: integer[], nature: Nature, dataSource: Pokemon | PokemonData) {
|
||||
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, ivs, nature, dataSource);
|
||||
|
||||
if (!dataSource)
|
||||
this.generateAndPopulateMoveset();
|
||||
this.generateCompatibleTms();
|
||||
}
|
||||
|
||||
@ -2319,6 +2322,8 @@ export class EnemyPokemon extends Pokemon {
|
||||
this.setBoss();
|
||||
|
||||
if (!dataSource) {
|
||||
this.generateAndPopulateMoveset();
|
||||
|
||||
this.trySetShiny();
|
||||
|
||||
let prevolution: Species;
|
||||
|
Loading…
Reference in New Issue
Block a user