Implement generation 6 Pokemon and some moves

pull/12/head
Flashfyre 2023-12-08 16:29:03 -05:00
parent b29ee1be5e
commit e7ec5b4f88
10 changed files with 2304 additions and 628 deletions

View File

@ -131,6 +131,10 @@ export class Arena {
return 2; return 2;
} }
break; break;
case Species.SCATTERBUG:
case Species.SPEWPA:
case Species.VIVILLON:
return 0;
} }
return 0; return 0;

View File

@ -853,13 +853,13 @@ export default class BattleScene extends Phaser.Scene {
randomSpecies(waveIndex: integer, level: integer, fromArenaPool?: boolean, speciesFilter?: PokemonSpeciesFilter, filterAllEvolutions?: boolean): PokemonSpecies { randomSpecies(waveIndex: integer, level: integer, fromArenaPool?: boolean, speciesFilter?: PokemonSpeciesFilter, filterAllEvolutions?: boolean): PokemonSpecies {
if (fromArenaPool) if (fromArenaPool)
return this.arena.randomSpecies(waveIndex, level); return this.arena.randomSpecies(waveIndex, level);
const filteredSpecies = speciesFilter ? [...new Set(allSpecies.slice(0, -1).filter(speciesFilter).map(s => { const filteredSpecies = speciesFilter ? [...new Set(allSpecies.filter(s => s.generation <= 6).filter(speciesFilter).map(s => {
if (!filterAllEvolutions) { if (!filterAllEvolutions) {
while (pokemonPrevolutions.hasOwnProperty(s.speciesId)) while (pokemonPrevolutions.hasOwnProperty(s.speciesId))
s = getPokemonSpecies(pokemonPrevolutions[s.speciesId]); s = getPokemonSpecies(pokemonPrevolutions[s.speciesId]);
} }
return s; return s;
}))] : allSpecies.slice(0, -1); }))] : allSpecies.filter(s => s.generation <= 6);
let ret = filteredSpecies[Utils.randSeedInt(filteredSpecies.length)]; let ret = filteredSpecies[Utils.randSeedInt(filteredSpecies.length)];
if (!filterAllEvolutions) if (!filterAllEvolutions)
ret = getPokemonSpecies(ret.getSpeciesForLevel(level, true)); ret = getPokemonSpecies(ret.getSpeciesForLevel(level, true));

View File

@ -1683,7 +1683,7 @@ export function initAbilities() {
new Ability(Abilities.FOREWARN, "Forewarn (N)", "When it enters a battle, the Pokémon can tell one of\nthe moves an opposing Pokémon has.", 4), new Ability(Abilities.FOREWARN, "Forewarn (N)", "When it enters a battle, the Pokémon can tell one of\nthe moves an opposing Pokémon has.", 4),
new Ability(Abilities.UNAWARE, "Unaware", "When attacking, the Pokémon ignores the target\nPokémon's stat changes.", 4) new Ability(Abilities.UNAWARE, "Unaware", "When attacking, the Pokémon ignores the target\nPokémon's stat changes.", 4)
.attr(IgnoreOpponentStatChangesAbAttr), .attr(IgnoreOpponentStatChangesAbAttr),
new Ability(Abilities.TINTED_LENS, "Tinted Lens (N)", "The Pokémon can use “not very effective” moves\nto deal regular damage.", 4), new Ability(Abilities.TINTED_LENS, "Tinted Lens (N)", "The Pokémon can use \"not very effective\" moves\nto deal regular damage.", 4),
new Ability(Abilities.FILTER, "Filter (N)", "Reduces the power of supereffective attacks taken.", 4), new Ability(Abilities.FILTER, "Filter (N)", "Reduces the power of supereffective attacks taken.", 4),
new Ability(Abilities.SLOW_START, "Slow Start (N)", "For five turns, the Pokémon's Attack and Speed\nstats are halved.", 4), new Ability(Abilities.SLOW_START, "Slow Start (N)", "For five turns, the Pokémon's Attack and Speed\nstats are halved.", 4),
new Ability(Abilities.SCRAPPY, "Scrappy (N)", "The Pokémon can hit Ghost-type Pokémon with\nNormal- and Fighting-type moves.", 4), new Ability(Abilities.SCRAPPY, "Scrappy (N)", "The Pokémon can hit Ghost-type Pokémon with\nNormal- and Fighting-type moves.", 4),
@ -1774,9 +1774,11 @@ export function initAbilities() {
new Ability(Abilities.PARENTAL_BOND, "Parental Bond (N)", "Parent and child each attacks.", 6), new Ability(Abilities.PARENTAL_BOND, "Parental Bond (N)", "Parent and child each attacks.", 6),
new Ability(Abilities.DARK_AURA, "Dark Aura (N)", "Powers up each Pokémon's Dark-type moves.", 6), new Ability(Abilities.DARK_AURA, "Dark Aura (N)", "Powers up each Pokémon's Dark-type moves.", 6),
new Ability(Abilities.FAIRY_AURA, "Fairy Aura (N)", "Powers up each Pokémon's Fairy-type moves.", 6), new Ability(Abilities.FAIRY_AURA, "Fairy Aura (N)", "Powers up each Pokémon's Fairy-type moves.", 6),
new Ability(Abilities.AURA_BREAK, "Aura Break (N)", "The effects of “Aura” Abilities are reversed\nto lower the power of affected moves.", 6), new Ability(Abilities.AURA_BREAK, "Aura Break (N)", "The effects of \"Aura\" Abilities are reversed\nto lower the power of affected moves.", 6),
new Ability(Abilities.PRIMORDIAL_SEA, "Primordial Sea (N)", "The Pokémon changes the weather to nullify\nFire-type attacks.", 6), new Ability(Abilities.PRIMORDIAL_SEA, "Primordial Sea", "The Pokémon changes the weather to nullify\nFire-type attacks.", 6)
new Ability(Abilities.DESOLATE_LAND, "Desolate Land (N)", "The Pokémon changes the weather to nullify\nWater-type attacks.", 6), .attr(PostSummonWeatherChangeAbAttr, WeatherType.HEAVY_RAIN),
new Ability(Abilities.DESOLATE_LAND, "Desolate Land", "The Pokémon changes the weather to nullify\nWater-type attacks.", 6)
.attr(PostSummonWeatherChangeAbAttr, WeatherType.HARSH_SUN),
new Ability(Abilities.DELTA_STREAM, "Delta Stream", "The Pokémon changes the weather to eliminate all\nof the Flying type's weaknesses.", 6) new Ability(Abilities.DELTA_STREAM, "Delta Stream", "The Pokémon changes the weather to eliminate all\nof the Flying type's weaknesses.", 6)
.attr(PostSummonWeatherChangeAbAttr, WeatherType.STRONG_WINDS), .attr(PostSummonWeatherChangeAbAttr, WeatherType.STRONG_WINDS),
new Ability(Abilities.STAMINA, "Stamina (N)", "Boosts the Defense stat when hit by an attack.", 7), new Ability(Abilities.STAMINA, "Stamina (N)", "Boosts the Defense stat when hit by an attack.", 7),

File diff suppressed because it is too large Load Diff

View File

@ -1342,11 +1342,13 @@ export class RandomLevelDamageAttr extends FixedDamageAttr {
export class RecoilAttr extends MoveEffectAttr { export class RecoilAttr extends MoveEffectAttr {
private useHp: boolean; private useHp: boolean;
private damageRatio: number;
constructor(useHp?: boolean) { constructor(useHp?: boolean, damageRatio?: number) {
super(true); super(true);
this.useHp = useHp; this.useHp = useHp;
this.damageRatio = (damageRatio !== undefined ? damageRatio : 0.25) || 0.25;
} }
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
@ -1359,7 +1361,7 @@ export class RecoilAttr extends MoveEffectAttr {
if (cancelled.value) if (cancelled.value)
return false; return false;
const recoilDamage = Math.max(Math.floor((!this.useHp ? user.turnData.damageDealt : user.getMaxHp()) / 4), 1); const recoilDamage = Math.max(Math.floor((!this.useHp ? user.turnData.damageDealt : user.getMaxHp()) * this.damageRatio), 1);
if (!recoilDamage) if (!recoilDamage)
return false; return false;
@ -1427,7 +1429,7 @@ export class HealAttr extends MoveEffectAttr {
} }
} }
export class WeatherHealAttr extends HealAttr { export abstract class WeatherHealAttr extends HealAttr {
constructor() { constructor() {
super(0.5); super(0.5);
} }
@ -1436,22 +1438,41 @@ export class WeatherHealAttr extends HealAttr {
let healRatio = 0.5; let healRatio = 0.5;
if (!user.scene.arena.weather?.isEffectSuppressed(user.scene)) { if (!user.scene.arena.weather?.isEffectSuppressed(user.scene)) {
const weatherType = user.scene.arena.weather?.weatherType || WeatherType.NONE; const weatherType = user.scene.arena.weather?.weatherType || WeatherType.NONE;
switch (weatherType) { healRatio = this.getWeatherHealRatio(weatherType);
case WeatherType.SUNNY:
case WeatherType.HARSH_SUN:
healRatio = 2 / 3;
break;
case WeatherType.RAIN:
case WeatherType.SANDSTORM:
case WeatherType.HAIL:
case WeatherType.HEAVY_RAIN:
healRatio = 0.25;
break;
}
} }
this.addHealPhase(user, healRatio); this.addHealPhase(user, healRatio);
return true; return true;
} }
abstract getWeatherHealRatio(weatherType: WeatherType): number;
}
export class PlantHealAttr extends WeatherHealAttr {
getWeatherHealRatio(weatherType: WeatherType): number {
switch (weatherType) {
case WeatherType.SUNNY:
case WeatherType.HARSH_SUN:
return 2 / 3;
case WeatherType.RAIN:
case WeatherType.SANDSTORM:
case WeatherType.HAIL:
case WeatherType.HEAVY_RAIN:
return 0.25;
default:
return 0.5;
}
}
}
export class SandHealAttr extends WeatherHealAttr {
getWeatherHealRatio(weatherType: WeatherType): number {
switch (weatherType) {
case WeatherType.SANDSTORM:
return 2 / 3;
default:
return 0.5;
}
}
} }
export class HitHealAttr extends MoveEffectAttr { export class HitHealAttr extends MoveEffectAttr {
@ -3333,11 +3354,11 @@ export function initMoves() {
.attr(StatChangeAttr, BattleStat.ATK, 1, true), .attr(StatChangeAttr, BattleStat.ATK, 1, true),
new AttackMove(Moves.VITAL_THROW, "Vital Throw", Type.FIGHTING, MoveCategory.PHYSICAL, 70, -1, 10, -1, "The user attacks last. In return, this throw move never misses.", -1, -1, 2), new AttackMove(Moves.VITAL_THROW, "Vital Throw", Type.FIGHTING, MoveCategory.PHYSICAL, 70, -1, 10, -1, "The user attacks last. In return, this throw move never misses.", -1, -1, 2),
new SelfStatusMove(Moves.MORNING_SUN, "Morning Sun", Type.NORMAL, -1, 5, -1, "The user restores its own HP. The amount of HP regained varies with the weather.", -1, 0, 2) new SelfStatusMove(Moves.MORNING_SUN, "Morning Sun", Type.NORMAL, -1, 5, -1, "The user restores its own HP. The amount of HP regained varies with the weather.", -1, 0, 2)
.attr(WeatherHealAttr), .attr(PlantHealAttr),
new SelfStatusMove(Moves.SYNTHESIS, "Synthesis", Type.GRASS, -1, 5, -1, "The user restores its own HP. The amount of HP regained varies with the weather.", -1, 0, 2) new SelfStatusMove(Moves.SYNTHESIS, "Synthesis", Type.GRASS, -1, 5, -1, "The user restores its own HP. The amount of HP regained varies with the weather.", -1, 0, 2)
.attr(WeatherHealAttr), .attr(PlantHealAttr),
new SelfStatusMove(Moves.MOONLIGHT, "Moonlight", Type.FAIRY, -1, 5, -1, "The user restores its own HP. The amount of HP regained varies with the weather.", -1, 0, 2) new SelfStatusMove(Moves.MOONLIGHT, "Moonlight", Type.FAIRY, -1, 5, -1, "The user restores its own HP. The amount of HP regained varies with the weather.", -1, 0, 2)
.attr(WeatherHealAttr), .attr(PlantHealAttr),
new AttackMove(Moves.HIDDEN_POWER, "Hidden Power (N)", Type.NORMAL, MoveCategory.SPECIAL, 60, 100, 15, -1, "A unique attack that varies in type depending on the Pokémon using it.", -1, 0, 2), new AttackMove(Moves.HIDDEN_POWER, "Hidden Power (N)", Type.NORMAL, MoveCategory.SPECIAL, 60, 100, 15, -1, "A unique attack that varies in type depending on the Pokémon using it.", -1, 0, 2),
new AttackMove(Moves.CROSS_CHOP, "Cross Chop", Type.FIGHTING, MoveCategory.PHYSICAL, 100, 80, 5, -1, "The user delivers a double chop with its forearms crossed. Critical hits land more easily.", -1, 0, 2) new AttackMove(Moves.CROSS_CHOP, "Cross Chop", Type.FIGHTING, MoveCategory.PHYSICAL, 100, 80, 5, -1, "The user delivers a double chop with its forearms crossed. Critical hits land more easily.", -1, 0, 2)
.attr(HighCritAttr), .attr(HighCritAttr),
@ -4022,20 +4043,26 @@ export function initMoves() {
.ignoresProtect() .ignoresProtect()
.ignoresVirtual(), .ignoresVirtual(),
new StatusMove(Moves.TRICK_OR_TREAT, "Trick-or-Treat (N)", Type.GHOST, 100, 20, -1, "The user takes the target trick-or-treating. This adds Ghost type to the target's type.", -1, 0, 6), new StatusMove(Moves.TRICK_OR_TREAT, "Trick-or-Treat (N)", Type.GHOST, 100, 20, -1, "The user takes the target trick-or-treating. This adds Ghost type to the target's type.", -1, 0, 6),
new StatusMove(Moves.NOBLE_ROAR, "Noble Roar (N)", Type.NORMAL, 100, 30, -1, "Letting out a noble roar, the user intimidates the target and lowers its Attack and Sp. Atk stats.", 100, 0, 6), new StatusMove(Moves.NOBLE_ROAR, "Noble Roar", Type.NORMAL, 100, 30, -1, "Letting out a noble roar, the user intimidates the target and lowers its Attack and Sp. Atk stats.", 100, 0, 6)
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -1),
new StatusMove(Moves.ION_DELUGE, "Ion Deluge (N)", Type.ELECTRIC, -1, 25, -1, "The user disperses electrically charged particles, which changes Normal-type moves to Electric-type moves.", -1, 1, 6) new StatusMove(Moves.ION_DELUGE, "Ion Deluge (N)", Type.ELECTRIC, -1, 25, -1, "The user disperses electrically charged particles, which changes Normal-type moves to Electric-type moves.", -1, 1, 6)
.target(MoveTarget.BOTH_SIDES), .target(MoveTarget.BOTH_SIDES),
new AttackMove(Moves.PARABOLIC_CHARGE, "Parabolic Charge (N)", Type.ELECTRIC, MoveCategory.SPECIAL, 65, 100, 20, -1, "The user attacks everything around it. The user's HP is restored by half the damage taken by those hit.", -1, 0, 6) new AttackMove(Moves.PARABOLIC_CHARGE, "Parabolic Charge", Type.ELECTRIC, MoveCategory.SPECIAL, 65, 100, 20, -1, "The user attacks everything around it. The user's HP is restored by half the damage taken by those hit.", -1, 0, 6)
.attr(HitHealAttr)
.target(MoveTarget.ALL_NEAR_OTHERS), .target(MoveTarget.ALL_NEAR_OTHERS),
new StatusMove(Moves.FORESTS_CURSE, "Forest's Curse (N)", Type.GRASS, 100, 20, -1, "The user puts a forest curse on the target. The target is now Grass type as well.", -1, 0, 6), new StatusMove(Moves.FORESTS_CURSE, "Forest's Curse (N)", Type.GRASS, 100, 20, -1, "The user puts a forest curse on the target. The target is now Grass type as well.", -1, 0, 6),
new AttackMove(Moves.PETAL_BLIZZARD, "Petal Blizzard (N)", Type.GRASS, MoveCategory.PHYSICAL, 90, 100, 15, -1, "The user stirs up a violent petal blizzard and attacks everything around it.", -1, 0, 6) new AttackMove(Moves.PETAL_BLIZZARD, "Petal Blizzard", Type.GRASS, MoveCategory.PHYSICAL, 90, 100, 15, -1, "The user stirs up a violent petal blizzard and attacks everything around it.", -1, 0, 6)
.target(MoveTarget.ALL_NEAR_OTHERS), .target(MoveTarget.ALL_NEAR_OTHERS),
new AttackMove(Moves.FREEZE_DRY, "Freeze-Dry (N)", Type.ICE, MoveCategory.SPECIAL, 70, 100, 20, -1, "The user rapidly cools the target. This may also leave the target frozen. This move is super effective on Water types.", 10, 0, 6), new AttackMove(Moves.FREEZE_DRY, "Freeze-Dry (P)", Type.ICE, MoveCategory.SPECIAL, 70, 100, 20, -1, "The user rapidly cools the target. This may also leave the target frozen. This move is super effective on Water types.", 10, 0, 6)
new AttackMove(Moves.DISARMING_VOICE, "Disarming Voice (N)", Type.FAIRY, MoveCategory.SPECIAL, 40, -1, 15, -1, "Letting out a charming cry, the user does emotional damage to opposing Pokémon. This attack never misses.", -1, 0, 6) .attr(StatusEffectAttr, StatusEffect.FREEZE),
new AttackMove(Moves.DISARMING_VOICE, "Disarming Voice", Type.FAIRY, MoveCategory.SPECIAL, 40, -1, 15, -1, "Letting out a charming cry, the user does emotional damage to opposing Pokémon. This attack never misses.", -1, 0, 6)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new StatusMove(Moves.PARTING_SHOT, "Parting Shot (N)", Type.DARK, 100, 20, -1, "With a parting threat, the user lowers the target's Attack and Sp. Atk stats. Then it switches with a party Pokémon.", 100, 0, 6), new StatusMove(Moves.PARTING_SHOT, "Parting Shot", Type.DARK, 100, 20, -1, "With a parting threat, the user lowers the target's Attack and Sp. Atk stats. Then it switches with a party Pokémon.", 100, 0, 6)
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -1)
.attr(ForceSwitchOutAttr, true),
new StatusMove(Moves.TOPSY_TURVY, "Topsy-Turvy (N)", Type.DARK, -1, 20, -1, "All stat changes affecting the target turn topsy-turvy and become the opposite of what they were.", -1, 0, 6), new StatusMove(Moves.TOPSY_TURVY, "Topsy-Turvy (N)", Type.DARK, -1, 20, -1, "All stat changes affecting the target turn topsy-turvy and become the opposite of what they were.", -1, 0, 6),
new AttackMove(Moves.DRAINING_KISS, "Draining Kiss (N)", Type.FAIRY, MoveCategory.SPECIAL, 50, 100, 10, -1, "The user steals the target's HP with a kiss. The user's HP is restored by over half of the damage taken by the target.", -1, 0, 6), new AttackMove(Moves.DRAINING_KISS, "Draining Kiss", Type.FAIRY, MoveCategory.SPECIAL, 50, 100, 10, -1, "The user steals the target's HP with a kiss. The user's HP is restored by over half of the damage taken by the target.", -1, 0, 6)
.attr(HitHealAttr),
new StatusMove(Moves.CRAFTY_SHIELD, "Crafty Shield (N)", Type.FAIRY, -1, 10, -1, "The user protects itself and its allies from status moves with a mysterious power. This does not stop moves that do damage.", -1, 3, 6) new StatusMove(Moves.CRAFTY_SHIELD, "Crafty Shield (N)", Type.FAIRY, -1, 10, -1, "The user protects itself and its allies from status moves with a mysterious power. This does not stop moves that do damage.", -1, 3, 6)
.target(MoveTarget.USER_SIDE), .target(MoveTarget.USER_SIDE),
new StatusMove(Moves.FLOWER_SHIELD, "Flower Shield (N)", Type.FAIRY, -1, 10, -1, "The user raises the Defense stats of all Grass-type Pokémon in battle with a mysterious power.", 100, 0, 6) new StatusMove(Moves.FLOWER_SHIELD, "Flower Shield (N)", Type.FAIRY, -1, 10, -1, "The user raises the Defense stats of all Grass-type Pokémon in battle with a mysterious power.", 100, 0, 6)
@ -4045,27 +4072,37 @@ export function initMoves() {
new StatusMove(Moves.MISTY_TERRAIN, "Misty Terrain (N)", Type.FAIRY, -1, 10, -1, "This protects Pokémon on the ground from status conditions and halves damage from Dragon-type moves for five turns.", -1, 0, 6) new StatusMove(Moves.MISTY_TERRAIN, "Misty Terrain (N)", Type.FAIRY, -1, 10, -1, "This protects Pokémon on the ground from status conditions and halves damage from Dragon-type moves for five turns.", -1, 0, 6)
.target(MoveTarget.BOTH_SIDES), .target(MoveTarget.BOTH_SIDES),
new StatusMove(Moves.ELECTRIFY, "Electrify (N)", Type.ELECTRIC, -1, 20, -1, "If the target is electrified before it uses a move during that turn, the target's move becomes Electric type.", -1, 0, 6), new StatusMove(Moves.ELECTRIFY, "Electrify (N)", Type.ELECTRIC, -1, 20, -1, "If the target is electrified before it uses a move during that turn, the target's move becomes Electric type.", -1, 0, 6),
new AttackMove(Moves.PLAY_ROUGH, "Play Rough (N)", Type.FAIRY, MoveCategory.PHYSICAL, 90, 90, 10, -1, "The user plays rough with the target and attacks it. This may also lower the target's Attack stat.", 10, 0, 6), new AttackMove(Moves.PLAY_ROUGH, "Play Rough", Type.FAIRY, MoveCategory.PHYSICAL, 90, 90, 10, -1, "The user plays rough with the target and attacks it. This may also lower the target's Attack stat.", 10, 0, 6)
new AttackMove(Moves.FAIRY_WIND, "Fairy Wind (N)", Type.FAIRY, MoveCategory.SPECIAL, 40, 100, 30, -1, "The user stirs up a fairy wind and strikes the target with it.", -1, 0, 6), .attr(StatChangeAttr, BattleStat.ATK, -1),
new AttackMove(Moves.FAIRY_WIND, "Fairy Wind", Type.FAIRY, MoveCategory.SPECIAL, 40, 100, 30, -1, "The user stirs up a fairy wind and strikes the target with it.", -1, 0, 6),
new AttackMove(Moves.MOONBLAST, "Moonblast", Type.FAIRY, MoveCategory.SPECIAL, 95, 100, 15, -1, "Borrowing the power of the moon, the user attacks the target. This may also lower the target's Sp. Atk stat.", 30, 0, 6) new AttackMove(Moves.MOONBLAST, "Moonblast", Type.FAIRY, MoveCategory.SPECIAL, 95, 100, 15, -1, "Borrowing the power of the moon, the user attacks the target. This may also lower the target's Sp. Atk stat.", 30, 0, 6)
.attr(StatChangeAttr, BattleStat.SPATK, -1), .attr(StatChangeAttr, BattleStat.SPATK, -1),
new AttackMove(Moves.BOOMBURST, "Boomburst (N)", Type.NORMAL, MoveCategory.SPECIAL, 140, 100, 10, -1, "The user attacks everything around it with the destructive power of a terrible, explosive sound.", -1, 0, 6) new AttackMove(Moves.BOOMBURST, "Boomburst", Type.NORMAL, MoveCategory.SPECIAL, 140, 100, 10, -1, "The user attacks everything around it with the destructive power of a terrible, explosive sound.", -1, 0, 6)
.target(MoveTarget.ALL_NEAR_OTHERS), .target(MoveTarget.ALL_NEAR_OTHERS),
new StatusMove(Moves.FAIRY_LOCK, "Fairy Lock (N)", Type.FAIRY, -1, 10, -1, "By locking down the battlefield, the user keeps all Pokémon from fleeing during the next turn.", -1, 0, 6) new StatusMove(Moves.FAIRY_LOCK, "Fairy Lock (N)", Type.FAIRY, -1, 10, -1, "By locking down the battlefield, the user keeps all Pokémon from fleeing during the next turn.", -1, 0, 6)
.target(MoveTarget.BOTH_SIDES), .target(MoveTarget.BOTH_SIDES),
new SelfStatusMove(Moves.KINGS_SHIELD, "King's Shield (N)", Type.STEEL, -1, 10, -1, "The user takes a defensive stance while it protects itself from damage. It also lowers the Attack stat of any attacker that makes direct contact.", -1, 4, 6), new SelfStatusMove(Moves.KINGS_SHIELD, "King's Shield (P)", Type.STEEL, -1, 10, -1, "The user takes a defensive stance while it protects itself from damage. It also lowers the Attack stat of any attacker that makes direct contact.", -1, 4, 6)
new StatusMove(Moves.PLAY_NICE, "Play Nice (N)", Type.NORMAL, -1, 20, -1, "The user and the target become friends, and the target loses its will to fight. This lowers the target's Attack stat.", 100, 0, 6), .attr(ProtectAttr),
new StatusMove(Moves.CONFIDE, "Confide (N)", Type.NORMAL, -1, 20, -1, "The user tells the target a secret, and the target loses its ability to concentrate. This lowers the target's Sp. Atk stat.", 100, 0, 6), new StatusMove(Moves.PLAY_NICE, "Play Nice", Type.NORMAL, -1, 20, -1, "The user and the target become friends, and the target loses its will to fight. This lowers the target's Attack stat.", 100, 0, 6)
new AttackMove(Moves.DIAMOND_STORM, "Diamond Storm (N)", Type.ROCK, MoveCategory.PHYSICAL, 100, 95, 5, -1, "The user whips up a storm of diamonds to damage opposing Pokémon. This may also sharply raise the user's Defense stat.", 50, 0, 6) .attr(StatChangeAttr, BattleStat.ATK, -1),
new StatusMove(Moves.CONFIDE, "Confide", Type.NORMAL, -1, 20, -1, "The user tells the target a secret, and the target loses its ability to concentrate. This lowers the target's Sp. Atk stat.", 100, 0, 6)
.attr(StatChangeAttr, BattleStat.SPATK, -1),
new AttackMove(Moves.DIAMOND_STORM, "Diamond Storm", Type.ROCK, MoveCategory.PHYSICAL, 100, 95, 5, -1, "The user whips up a storm of diamonds to damage opposing Pokémon. This may also sharply raise the user's Defense stat.", 50, 0, 6)
.attr(StatChangeAttr, BattleStat.DEF, 2, true)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.STEAM_ERUPTION, "Steam Eruption (N)", Type.WATER, MoveCategory.SPECIAL, 110, 95, 5, -1, "The user immerses the target in superheated steam. This may also leave the target with a burn.", 30, 0, 6), new AttackMove(Moves.STEAM_ERUPTION, "Steam Eruption", Type.WATER, MoveCategory.SPECIAL, 110, 95, 5, -1, "The user immerses the target in superheated steam. This may also leave the target with a burn.", 30, 0, 6)
new AttackMove(Moves.HYPERSPACE_HOLE, "Hyperspace Hole (N)", Type.PSYCHIC, MoveCategory.SPECIAL, 80, -1, 5, -1, "Using a hyperspace hole, the user appears right next to the target and strikes. This also hits a target using a move such as Protect or Detect.", -1, 0, 6), .attr(StatusEffectAttr, StatusEffect.BURN),
new AttackMove(Moves.WATER_SHURIKEN, "Water Shuriken (N)", Type.WATER, MoveCategory.SPECIAL, 15, 100, 20, -1, "The user hits the target with throwing stars two to five times in a row. This move always goes first.", -1, 1, 6), new AttackMove(Moves.HYPERSPACE_HOLE, "Hyperspace Hole", Type.PSYCHIC, MoveCategory.SPECIAL, 80, -1, 5, -1, "Using a hyperspace hole, the user appears right next to the target and strikes. This also hits a target using a move such as Protect or Detect.", -1, 0, 6)
new AttackMove(Moves.MYSTICAL_FIRE, "Mystical Fire (N)", Type.FIRE, MoveCategory.SPECIAL, 75, 100, 10, -1, "The user attacks by breathing a special, hot fire. This also lowers the target's Sp. Atk stat.", 100, 0, 6), .ignoresProtect(),
new AttackMove(Moves.WATER_SHURIKEN, "Water Shuriken", Type.WATER, MoveCategory.SPECIAL, 15, 100, 20, -1, "The user hits the target with throwing stars two to five times in a row. This move always goes first.", -1, 1, 6),
new AttackMove(Moves.MYSTICAL_FIRE, "Mystical Fire", Type.FIRE, MoveCategory.SPECIAL, 75, 100, 10, -1, "The user attacks by breathing a special, hot fire. This also lowers the target's Sp. Atk stat.", 100, 0, 6)
.attr(StatChangeAttr, BattleStat.SPATK, -1),
new SelfStatusMove(Moves.SPIKY_SHIELD, "Spiky Shield (N)", Type.GRASS, -1, 10, -1, "In addition to protecting the user from attacks, this move also damages any attacker that makes direct contact.", -1, 4, 6), new SelfStatusMove(Moves.SPIKY_SHIELD, "Spiky Shield (N)", Type.GRASS, -1, 10, -1, "In addition to protecting the user from attacks, this move also damages any attacker that makes direct contact.", -1, 4, 6),
new StatusMove(Moves.AROMATIC_MIST, "Aromatic Mist (N)", Type.FAIRY, -1, 20, -1, "The user raises the Sp. Def stat of an ally Pokémon by using a mysterious aroma.", -1, 0, 6) new StatusMove(Moves.AROMATIC_MIST, "Aromatic Mist", Type.FAIRY, -1, 20, -1, "The user raises the Sp. Def stat of an ally Pokémon by using a mysterious aroma.", -1, 0, 6)
.attr(StatChangeAttr, BattleStat.SPDEF, 1)
.target(MoveTarget.NEAR_ALLY), .target(MoveTarget.NEAR_ALLY),
new StatusMove(Moves.EERIE_IMPULSE, "Eerie Impulse (N)", Type.ELECTRIC, 100, 15, -1, "The user's body generates an eerie impulse. Exposing the target to it harshly lowers the target's Sp. Atk stat.", -1, 0, 6), new StatusMove(Moves.EERIE_IMPULSE, "Eerie Impulse", Type.ELECTRIC, 100, 15, -1, "The user's body generates an eerie impulse. Exposing the target to it harshly lowers the target's Sp. Atk stat.", -1, 0, 6)
.attr(StatChangeAttr, BattleStat.SPATK, -2),
new StatusMove(Moves.VENOM_DRENCH, "Venom Drench (N)", Type.POISON, 100, 20, -1, "Opposing Pokémon are drenched in an odd poisonous liquid. This lowers the Attack, Sp. Atk, and Speed stats of a poisoned target.", 100, 0, 6) new StatusMove(Moves.VENOM_DRENCH, "Venom Drench (N)", Type.POISON, 100, 20, -1, "Opposing Pokémon are drenched in an odd poisonous liquid. This lowers the Attack, Sp. Atk, and Speed stats of a poisoned target.", 100, 0, 6)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new StatusMove(Moves.POWDER, "Powder (N)", Type.BUG, 100, 20, -1, "The user covers the target in a combustible powder. If the target uses a Fire-type move, the powder explodes and damages the target.", -1, 1, 6), new StatusMove(Moves.POWDER, "Powder (N)", Type.BUG, 100, 20, -1, "The user covers the target in a combustible powder. If the target uses a Fire-type move, the powder explodes and damages the target.", -1, 1, 6),
@ -4079,18 +4116,19 @@ export function initMoves() {
.target(MoveTarget.USER_SIDE), .target(MoveTarget.USER_SIDE),
new StatusMove(Moves.ELECTRIC_TERRAIN, "Electric Terrain (N)", Type.ELECTRIC, -1, 10, -1, "The user electrifies the ground for five turns, powering up Electric-type moves. Pokémon on the ground no longer fall asleep.", -1, 0, 6) new StatusMove(Moves.ELECTRIC_TERRAIN, "Electric Terrain (N)", Type.ELECTRIC, -1, 10, -1, "The user electrifies the ground for five turns, powering up Electric-type moves. Pokémon on the ground no longer fall asleep.", -1, 0, 6)
.target(MoveTarget.BOTH_SIDES), .target(MoveTarget.BOTH_SIDES),
new AttackMove(Moves.DAZZLING_GLEAM, "Dazzling Gleam (N)", Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, "The user damages opposing Pokémon by emitting a powerful flash.", -1, 0, 6) new AttackMove(Moves.DAZZLING_GLEAM, "Dazzling Gleam", Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, "The user damages opposing Pokémon by emitting a powerful flash.", -1, 0, 6)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new SelfStatusMove(Moves.CELEBRATE, "Celebrate (N)", Type.NORMAL, -1, 40, -1, "The Pokémon congratulates you on your special day!", -1, 0, 6), new SelfStatusMove(Moves.CELEBRATE, "Celebrate", Type.NORMAL, -1, 40, -1, "The Pokémon congratulates you on your special day!", -1, 0, 6),
new StatusMove(Moves.HOLD_HANDS, "Hold Hands (N)", Type.NORMAL, -1, 40, -1, "The user and an ally hold hands. This makes them very happy.", -1, 0, 6) new StatusMove(Moves.HOLD_HANDS, "Hold Hands", Type.NORMAL, -1, 40, -1, "The user and an ally hold hands. This makes them very happy.", -1, 0, 6)
.target(MoveTarget.NEAR_ALLY), .target(MoveTarget.NEAR_ALLY),
new StatusMove(Moves.BABY_DOLL_EYES, "Baby-Doll Eyes", Type.FAIRY, 100, 30, -1, "The user stares at the target with its baby-doll eyes, which lowers the target's Attack stat. This move always goes first.", -1, 1, 6) new StatusMove(Moves.BABY_DOLL_EYES, "Baby-Doll Eyes", Type.FAIRY, 100, 30, -1, "The user stares at the target with its baby-doll eyes, which lowers the target's Attack stat. This move always goes first.", -1, 1, 6)
.attr(StatChangeAttr, BattleStat.ATK, -1), .attr(StatChangeAttr, BattleStat.ATK, -1),
new AttackMove(Moves.NUZZLE, "Nuzzle (N)", Type.ELECTRIC, MoveCategory.PHYSICAL, 20, 100, 20, -1, "The user attacks by nuzzling its electrified cheeks against the target. This also leaves the target with paralysis.", 100, 0, 6) new AttackMove(Moves.NUZZLE, "Nuzzle", Type.ELECTRIC, MoveCategory.PHYSICAL, 20, 100, 20, -1, "The user attacks by nuzzling its electrified cheeks against the target. This also leaves the target with paralysis.", 100, 0, 6)
.attr(StatusEffectAttr, StatusEffect.PARALYSIS), .attr(StatusEffectAttr, StatusEffect.PARALYSIS),
new AttackMove(Moves.HOLD_BACK, "Hold Back (N)", Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 40, -1, "The user holds back when it attacks, and the target is left with at least 1 HP.", -1, 0, 6), new AttackMove(Moves.HOLD_BACK, "Hold Back (N)", Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 40, -1, "The user holds back when it attacks, and the target is left with at least 1 HP.", -1, 0, 6),
new AttackMove(Moves.INFESTATION, "Infestation (N)", Type.BUG, MoveCategory.SPECIAL, 20, 100, 20, -1, "The target is infested and attacked for four to five turns. The target can't flee during this time.", 100, 0, 6), new AttackMove(Moves.INFESTATION, "Infestation (N)", Type.BUG, MoveCategory.SPECIAL, 20, 100, 20, -1, "The target is infested and attacked for four to five turns. The target can't flee during this time.", 100, 0, 6),
new AttackMove(Moves.POWER_UP_PUNCH, "Power-Up Punch (N)", Type.FIGHTING, MoveCategory.PHYSICAL, 40, 100, 20, -1, "Striking opponents over and over makes the user's fists harder. Hitting a target raises the Attack stat.", 100, 0, 6), new AttackMove(Moves.POWER_UP_PUNCH, "Power-Up Punch", Type.FIGHTING, MoveCategory.PHYSICAL, 40, 100, 20, -1, "Striking opponents over and over makes the user's fists harder. Hitting a target raises the Attack stat.", 100, 0, 6)
.attr(StatChangeAttr, BattleStat.ATK, 1, true),
new AttackMove(Moves.OBLIVION_WING, "Oblivion Wing", Type.FLYING, MoveCategory.SPECIAL, 80, 100, 10, -1, "The user absorbs its target's HP. The user's HP is restored by over half of the damage taken by the target.", -1, 0, 6) new AttackMove(Moves.OBLIVION_WING, "Oblivion Wing", Type.FLYING, MoveCategory.SPECIAL, 80, 100, 10, -1, "The user absorbs its target's HP. The user's HP is restored by over half of the damage taken by the target.", -1, 0, 6)
.attr(HitHealAttr, 0.75), .attr(HitHealAttr, 0.75),
new AttackMove(Moves.THOUSAND_ARROWS, "Thousand Arrows", Type.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, -1, "This move also hits opposing Pokémon that are in the air. Those Pokémon are knocked down to the ground.", 100, 0, 6) new AttackMove(Moves.THOUSAND_ARROWS, "Thousand Arrows", Type.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, -1, "This move also hits opposing Pokémon that are in the air. Those Pokémon are knocked down to the ground.", 100, 0, 6)
@ -4099,16 +4137,19 @@ export function initMoves() {
new AttackMove(Moves.THOUSAND_WAVES, "Thousand Waves", Type.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, -1, "The user attacks with a wave that crawls along the ground. Those it hits can't flee from battle.", -1, 0, 6) new AttackMove(Moves.THOUSAND_WAVES, "Thousand Waves", Type.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, -1, "The user attacks with a wave that crawls along the ground. Those it hits can't flee from battle.", -1, 0, 6)
.attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, false, 1, true) .attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, false, 1, true)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.LANDS_WRATH, "Land's Wrath (N)", Type.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, -1, "The user gathers the energy of the land and focuses that power on opposing Pokémon to damage them.", -1, 0, 6) new AttackMove(Moves.LANDS_WRATH, "Land's Wrath", Type.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, -1, "The user gathers the energy of the land and focuses that power on opposing Pokémon to damage them.", -1, 0, 6)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.LIGHT_OF_RUIN, "Light of Ruin (N)", Type.FAIRY, MoveCategory.SPECIAL, 140, 90, 5, -1, "Drawing power from the Eternal Flower, the user fires a powerful beam of light. This also damages the user quite a lot.", -1, 0, 6), new AttackMove(Moves.LIGHT_OF_RUIN, "Light of Ruin", Type.FAIRY, MoveCategory.SPECIAL, 140, 90, 5, -1, "Drawing power from the Eternal Flower, the user fires a powerful beam of light. This also damages the user quite a lot.", -1, 0, 6)
new AttackMove(Moves.ORIGIN_PULSE, "Origin Pulse (N)", Type.WATER, MoveCategory.SPECIAL, 110, 85, 10, -1, "The user attacks opposing Pokémon with countless beams of light that glow a deep and brilliant blue.", -1, 0, 6) .attr(RecoilAttr, false, 0.5),
new AttackMove(Moves.ORIGIN_PULSE, "Origin Pulse", Type.WATER, MoveCategory.SPECIAL, 110, 85, 10, -1, "The user attacks opposing Pokémon with countless beams of light that glow a deep and brilliant blue.", -1, 0, 6)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.PRECIPICE_BLADES, "Precipice Blades (N)", Type.GROUND, MoveCategory.PHYSICAL, 120, 85, 10, -1, "The user attacks opposing Pokémon by manifesting the power of the land in fearsome blades of stone.", -1, 0, 6) new AttackMove(Moves.PRECIPICE_BLADES, "Precipice Blades", Type.GROUND, MoveCategory.PHYSICAL, 120, 85, 10, -1, "The user attacks opposing Pokémon by manifesting the power of the land in fearsome blades of stone.", -1, 0, 6)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.DRAGON_ASCENT, "Dragon Ascent", Type.FLYING, MoveCategory.PHYSICAL, 120, 100, 5, -1, "After soaring upward, the user attacks its target by dropping out of the sky at high speeds. But it lowers its own Defense and Sp. Def stats in the process.", 100, 0, 6) new AttackMove(Moves.DRAGON_ASCENT, "Dragon Ascent", Type.FLYING, MoveCategory.PHYSICAL, 120, 100, 5, -1, "After soaring upward, the user attacks its target by dropping out of the sky at high speeds. But it lowers its own Defense and Sp. Def stats in the process.", 100, 0, 6)
.attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1), .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1),
new AttackMove(Moves.HYPERSPACE_FURY, "Hyperspace Fury (N)", Type.DARK, MoveCategory.PHYSICAL, 100, -1, 5, -1, "Using its many arms, the user unleashes a barrage of attacks that ignore the effects of moves like Protect and Detect. But the user's Defense stat falls.", 100, 0, 6), new AttackMove(Moves.HYPERSPACE_FURY, "Hyperspace Fury", Type.DARK, MoveCategory.PHYSICAL, 100, -1, 5, -1, "Using its many arms, the user unleashes a barrage of attacks that ignore the effects of moves like Protect and Detect. But the user's Defense stat falls.", 100, 0, 6)
.attr(StatChangeAttr, BattleStat.DEF, -1, true)
.ignoresProtect(),
/* Unused */ /* Unused */
new AttackMove(Moves.BREAKNECK_BLITZ__PHYSICAL, "Breakneck Blitz (N)", Type.NORMAL, MoveCategory.PHYSICAL, -1, -1, 1, -1, "The user builds up its momentum using its Z-Power and crashes into the target at full speed. The power varies, depending on the original move.", -1, 0, 7), new AttackMove(Moves.BREAKNECK_BLITZ__PHYSICAL, "Breakneck Blitz (N)", Type.NORMAL, MoveCategory.PHYSICAL, -1, -1, 1, -1, "The user builds up its momentum using its Z-Power and crashes into the target at full speed. The power varies, depending on the original move.", -1, 0, 7),
new AttackMove(Moves.BREAKNECK_BLITZ__SPECIAL, "Breakneck Blitz (N)", Type.NORMAL, MoveCategory.SPECIAL, -1, -1, 1, -1, "Dummy Data", -1, 0, 7), new AttackMove(Moves.BREAKNECK_BLITZ__SPECIAL, "Breakneck Blitz (N)", Type.NORMAL, MoveCategory.SPECIAL, -1, -1, 1, -1, "Dummy Data", -1, 0, 7),
@ -4148,8 +4189,10 @@ export function initMoves() {
new AttackMove(Moves.TWINKLE_TACKLE__SPECIAL, "Twinkle Tackle (N)", Type.FAIRY, MoveCategory.SPECIAL, -1, -1, 1, -1, "Dummy Data", -1, 0, 7), new AttackMove(Moves.TWINKLE_TACKLE__SPECIAL, "Twinkle Tackle (N)", Type.FAIRY, MoveCategory.SPECIAL, -1, -1, 1, -1, "Dummy Data", -1, 0, 7),
/* End Unused */ /* End Unused */
new AttackMove(Moves.CATASTROPIKA, "Catastropika (N)", Type.ELECTRIC, MoveCategory.PHYSICAL, 210, -1, 1, -1, "The user, Pikachu, surrounds itself with the maximum amount of electricity using its Z-Power and pounces on its target with full force.", -1, 0, 7), new AttackMove(Moves.CATASTROPIKA, "Catastropika (N)", Type.ELECTRIC, MoveCategory.PHYSICAL, 210, -1, 1, -1, "The user, Pikachu, surrounds itself with the maximum amount of electricity using its Z-Power and pounces on its target with full force.", -1, 0, 7),
new SelfStatusMove(Moves.SHORE_UP, "Shore Up (N)", Type.GROUND, -1, 10, -1, "The user regains up to half of its max HP. It restores more HP in a sandstorm.", -1, 0, 7), new SelfStatusMove(Moves.SHORE_UP, "Shore Up", Type.GROUND, -1, 10, -1, "The user regains up to half of its max HP. It restores more HP in a sandstorm.", -1, 0, 7)
new AttackMove(Moves.FIRST_IMPRESSION, "First Impression (N)", Type.BUG, MoveCategory.PHYSICAL, 90, 100, 10, -1, "Although this move has great power, it only works the first turn each time the user enters battle.", -1, 2, 7), .attr(SandHealAttr),
new AttackMove(Moves.FIRST_IMPRESSION, "First Impression", Type.BUG, MoveCategory.PHYSICAL, 90, 100, 10, -1, "Although this move has great power, it only works the first turn each time the user enters battle.", -1, 2, 7)
.condition((user: Pokemon, target: Pokemon, move: Move) => !user.getMoveHistory().length),
new SelfStatusMove(Moves.BANEFUL_BUNKER, "Baneful Bunker (N)", Type.POISON, -1, 10, -1, "In addition to protecting the user from attacks, this move also poisons any attacker that makes direct contact.", -1, 4, 7), new SelfStatusMove(Moves.BANEFUL_BUNKER, "Baneful Bunker (N)", Type.POISON, -1, 10, -1, "In addition to protecting the user from attacks, this move also poisons any attacker that makes direct contact.", -1, 4, 7),
new AttackMove(Moves.SPIRIT_SHACKLE, "Spirit Shackle (N)", Type.GHOST, MoveCategory.PHYSICAL, 80, 100, 10, -1, "The user attacks while simultaneously stitching the target's shadow to the ground to prevent the target from escaping.", -1, 0, 7), new AttackMove(Moves.SPIRIT_SHACKLE, "Spirit Shackle (N)", Type.GHOST, MoveCategory.PHYSICAL, 80, 100, 10, -1, "The user attacks while simultaneously stitching the target's shadow to the ground to prevent the target from escaping.", -1, 0, 7),
new AttackMove(Moves.DARKEST_LARIAT, "Darkest Lariat (N)", Type.DARK, MoveCategory.PHYSICAL, 85, 100, 10, -1, "The user swings both arms and hits the target. The target's stat changes don't affect this attack's damage.", -1, 0, 7), new AttackMove(Moves.DARKEST_LARIAT, "Darkest Lariat (N)", Type.DARK, MoveCategory.PHYSICAL, 85, 100, 10, -1, "The user swings both arms and hits the target. The target's stat changes don't affect this attack's damage.", -1, 0, 7),

View File

@ -9,6 +9,7 @@ import { Species } from "./species";
import { Type } from "./type"; import { Type } from "./type";
import * as Utils from "../utils"; import * as Utils from "../utils";
import { SpeciesFormKey } from "./pokemon-species"; import { SpeciesFormKey } from "./pokemon-species";
import { WeatherType } from "./weather";
export enum SpeciesWildEvolutionDelay { export enum SpeciesWildEvolutionDelay {
NONE, NONE,
@ -813,6 +814,88 @@ export const pokemonEvolutions: PokemonEvolutions = {
[Species.LARVESTA]: [ [Species.LARVESTA]: [
new SpeciesEvolution(Species.VOLCARONA, 59, null, null) new SpeciesEvolution(Species.VOLCARONA, 59, null, null)
], ],
[Species.CHESPIN]: [
new SpeciesEvolution(Species.QUILLADIN, 16, null, null)
],
[Species.QUILLADIN]: [
new SpeciesEvolution(Species.CHESNAUGHT, 36, null, null)
],
[Species.FENNEKIN]: [
new SpeciesEvolution(Species.BRAIXEN, 16, null, null)
],
[Species.BRAIXEN]: [
new SpeciesEvolution(Species.DELPHOX, 36, null, null)
],
[Species.FROAKIE]: [
new SpeciesEvolution(Species.FROGADIER, 16, null, null)
],
[Species.FROGADIER]: [
new SpeciesEvolution(Species.GRENINJA, 36, null, null)
],
[Species.BUNNELBY]: [
new SpeciesEvolution(Species.DIGGERSBY, 20, null, null)
],
[Species.FLETCHLING]: [
new SpeciesEvolution(Species.FLETCHINDER, 17, null, null)
],
[Species.FLETCHINDER]: [
new SpeciesEvolution(Species.TALONFLAME, 35, null, null)
],
[Species.SCATTERBUG]: [
new SpeciesEvolution(Species.SPEWPA, 9, null, null)
],
[Species.SPEWPA]: [
new SpeciesEvolution(Species.VIVILLON, 12, null, null)
],
[Species.LITLEO]: [
new SpeciesEvolution(Species.PYROAR, 35, null, null)
],
[Species.FLABEBE]: [
new SpeciesEvolution(Species.FLOETTE, 19, null, null)
],
[Species.SKIDDO]: [
new SpeciesEvolution(Species.GOGOAT, 32, null, null)
],
[Species.PANCHAM]: [
new SpeciesEvolution(Species.PANGORO, 32, null, new SpeciesEvolutionCondition((p: Pokemon) => !!p.scene.getParty().find(p => p.getTypes(true).indexOf(Type.DARK) > -1)), SpeciesWildEvolutionDelay.MEDIUM)
],
[Species.ESPURR]: [
new SpeciesFormEvolution(Species.MEOWSTIC, '', '', 25, null, new SpeciesEvolutionCondition((p: Pokemon) => p.gender === Gender.MALE, (p: Pokemon) => p.gender = Gender.MALE)),
new SpeciesFormEvolution(Species.MEOWSTIC, '', 'female', 25, null, new SpeciesEvolutionCondition((p: Pokemon) => p.gender === Gender.FEMALE, (p: Pokemon) => p.gender = Gender.FEMALE))
],
[Species.HONEDGE]: [
new SpeciesEvolution(Species.DOUBLADE, 35, null, null)
],
[Species.INKAY]: [
new SpeciesEvolution(Species.MALAMAR, 30, null, null)
],
[Species.BINACLE]: [
new SpeciesEvolution(Species.MALAMAR, 39, null, null)
],
[Species.SKRELP]: [
new SpeciesEvolution(Species.DRAGALGE, 48, null, null)
],
[Species.CLAUNCHER]: [
new SpeciesEvolution(Species.CLAWITZER, 37, null, null)
],
[Species.TYRUNT]: [
new SpeciesEvolution(Species.TYRANTRUM, 39, null, new SpeciesEvolutionCondition((p: Pokemon) => !p.scene.arena.isDaytime()), SpeciesWildEvolutionDelay.MEDIUM)
],
[Species.AMAURA]: [
new SpeciesEvolution(Species.AURORUS, 39, null, new SpeciesEvolutionCondition((p: Pokemon) => !p.scene.arena.isDaytime()), SpeciesWildEvolutionDelay.MEDIUM)
],
[Species.GOOMY]: [
new SpeciesEvolution(Species.SLIGGOO, 40, null, null)
],
[Species.SLIGGOO]: [
new SpeciesEvolution(Species.GOODRA, 50, null, new SpeciesEvolutionCondition((p: Pokemon) => [ WeatherType.RAIN, WeatherType.HEAVY_RAIN ].indexOf(p.scene.arena.weather?.weatherType || WeatherType.NONE) > -1), SpeciesWildEvolutionDelay.LONG)
],
[Species.BERGMITE]: [
new SpeciesEvolution(Species.AVALUGG, 37, null, null)
],
[Species.NOIBAT]: [
new SpeciesEvolution(Species.NOIVERN, 48, null, null)
],
[Species.PIKACHU]: [ [Species.PIKACHU]: [
new SpeciesEvolution(Species.RAICHU, 1, EvolutionItem.THUNDER_STONE, null, SpeciesWildEvolutionDelay.LONG) new SpeciesEvolution(Species.RAICHU, 1, EvolutionItem.THUNDER_STONE, null, SpeciesWildEvolutionDelay.LONG)
], ],
@ -864,13 +947,14 @@ export const pokemonEvolutions: PokemonEvolutions = {
new SpeciesEvolution(Species.STARMIE, 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.MEDIUM) new SpeciesEvolution(Species.STARMIE, 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.MEDIUM)
], ],
[Species.EEVEE]: [ [Species.EEVEE]: [
new SpeciesEvolution(Species.SYLVEON, 1, null, new SpeciesEvolutionCondition((p: Pokemon) => p.winCount >= 10 && !!p.getMoveset().find(m => m.getMove().type === Type.FAIRY)), SpeciesWildEvolutionDelay.MEDIUM),
new SpeciesEvolution(Species.ESPEON, 1, null, new SpeciesEvolutionCondition((p: Pokemon) => p.winCount >= 10 && p.scene.arena.isDaytime()), SpeciesWildEvolutionDelay.MEDIUM), new SpeciesEvolution(Species.ESPEON, 1, null, new SpeciesEvolutionCondition((p: Pokemon) => p.winCount >= 10 && p.scene.arena.isDaytime()), SpeciesWildEvolutionDelay.MEDIUM),
new SpeciesEvolution(Species.UMBREON, 1, null, new SpeciesEvolutionCondition((p: Pokemon) => p.winCount >= 10 && !p.scene.arena.isDaytime()), SpeciesWildEvolutionDelay.MEDIUM), new SpeciesEvolution(Species.UMBREON, 1, null, new SpeciesEvolutionCondition((p: Pokemon) => p.winCount >= 10 && !p.scene.arena.isDaytime()), SpeciesWildEvolutionDelay.MEDIUM),
new SpeciesEvolution(Species.VAPOREON, 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.MEDIUM), new SpeciesEvolution(Species.VAPOREON, 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.MEDIUM),
new SpeciesEvolution(Species.JOLTEON, 1, EvolutionItem.THUNDER_STONE, null, SpeciesWildEvolutionDelay.MEDIUM), new SpeciesEvolution(Species.JOLTEON, 1, EvolutionItem.THUNDER_STONE, null, SpeciesWildEvolutionDelay.MEDIUM),
new SpeciesEvolution(Species.FLAREON, 1, EvolutionItem.FIRE_STONE, null, SpeciesWildEvolutionDelay.MEDIUM), new SpeciesEvolution(Species.FLAREON, 1, EvolutionItem.FIRE_STONE, null, SpeciesWildEvolutionDelay.MEDIUM),
new SpeciesEvolution(Species.LEAFEON, 1, EvolutionItem.LEAF_STONE, null, SpeciesWildEvolutionDelay.MEDIUM), new SpeciesEvolution(Species.LEAFEON, 1, EvolutionItem.LEAF_STONE, null, SpeciesWildEvolutionDelay.MEDIUM),
new SpeciesEvolution(Species.GLACEON, 1, EvolutionItem.ICE_STONE, null, SpeciesWildEvolutionDelay.MEDIUM) new SpeciesEvolution(Species.GLACEON, 1, EvolutionItem.ICE_STONE, null, SpeciesWildEvolutionDelay.MEDIUM),
], ],
[Species.TOGETIC]: [ [Species.TOGETIC]: [
new SpeciesEvolution(Species.TOGEKISS, 1, EvolutionItem.SHINY_STONE, null, SpeciesWildEvolutionDelay.VERY_LONG) new SpeciesEvolution(Species.TOGEKISS, 1, EvolutionItem.SHINY_STONE, null, SpeciesWildEvolutionDelay.VERY_LONG)
@ -950,6 +1034,15 @@ export const pokemonEvolutions: PokemonEvolutions = {
[Species.LAMPENT]: [ [Species.LAMPENT]: [
new SpeciesEvolution(Species.CHANDELURE, 1, EvolutionItem.DUSK_STONE, null, SpeciesWildEvolutionDelay.VERY_LONG) new SpeciesEvolution(Species.CHANDELURE, 1, EvolutionItem.DUSK_STONE, null, SpeciesWildEvolutionDelay.VERY_LONG)
], ],
[Species.FLOETTE]: [
new SpeciesEvolution(Species.FLORGES, 1, EvolutionItem.SHINY_STONE, null, SpeciesWildEvolutionDelay.LONG)
],
[Species.DOUBLADE]: [
new SpeciesEvolution(Species.AEGISLASH, 1, EvolutionItem.DUSK_STONE, null, SpeciesWildEvolutionDelay.LONG)
],
[Species.HELIOPTILE]: [
new SpeciesEvolution(Species.HELIOLISK, 1, EvolutionItem.SUN_STONE, null, SpeciesWildEvolutionDelay.LONG)
],
[Species.KADABRA]: [ [Species.KADABRA]: [
new SpeciesEvolution(Species.ALAKAZAM, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG) new SpeciesEvolution(Species.ALAKAZAM, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG)
], ],
@ -1012,6 +1105,18 @@ export const pokemonEvolutions: PokemonEvolutions = {
[Species.SHELMET]: [ [Species.SHELMET]: [
new SpeciesEvolution(Species.ACCELGOR, 1, EvolutionItem.LINKING_CORD, new SpeciesEvolutionCondition((p: Pokemon) => !!p.scene.getParty().find(p => p.species.speciesId === Species.KARRABLAST)), SpeciesWildEvolutionDelay.LONG) new SpeciesEvolution(Species.ACCELGOR, 1, EvolutionItem.LINKING_CORD, new SpeciesEvolutionCondition((p: Pokemon) => !!p.scene.getParty().find(p => p.species.speciesId === Species.KARRABLAST)), SpeciesWildEvolutionDelay.LONG)
], ],
[Species.SPRITZEE]: [
new SpeciesEvolution(Species.AROMATISSE, 1, EvolutionItem.LINKING_CORD, new SpeciesEvolutionCondition((p: Pokemon) => true /*Sachet*/), SpeciesWildEvolutionDelay.MEDIUM)
],
[Species.SWIRLIX]: [
new SpeciesEvolution(Species.SLURPUFF, 1, EvolutionItem.LINKING_CORD, new SpeciesEvolutionCondition((p: Pokemon) => true /*Whipped Dream*/), SpeciesWildEvolutionDelay.MEDIUM)
],
[Species.PHANTUMP]: [
new SpeciesEvolution(Species.TREVENANT, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.MEDIUM)
],
[Species.PUMPKABOO]: [
new SpeciesEvolution(Species.GOURGEIST, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.MEDIUM)
],
[Species.PRIMEAPE]: [ [Species.PRIMEAPE]: [
new SpeciesEvolution(Species.ANNIHILAPE, 1, null, new SpeciesEvolutionCondition((p: Pokemon) => p.moveset.filter(m => m.moveId === Moves.RAGE_FIST).length > 0), SpeciesWildEvolutionDelay.VERY_LONG) new SpeciesEvolution(Species.ANNIHILAPE, 1, null, new SpeciesEvolutionCondition((p: Pokemon) => p.moveset.filter(m => m.moveId === Moves.RAGE_FIST).length > 0), SpeciesWildEvolutionDelay.VERY_LONG)
], ],

File diff suppressed because it is too large Load Diff

View File

@ -1704,7 +1704,8 @@ export class PlayerPokemon extends Pokemon {
return new Promise(resolve => { return new Promise(resolve => {
this.handleSpecialEvolutions(evolution); this.handleSpecialEvolutions(evolution);
this.species = getPokemonSpecies(evolution.speciesId); this.species = getPokemonSpecies(evolution.speciesId);
this.formIndex = Math.max(this.species.forms.findIndex(f => f.formKey === evolution.evoFormKey), 0); if (evolution.preFormKey !== null)
this.formIndex = Math.max(this.species.forms.findIndex(f => f.formKey === evolution.evoFormKey), 0);
this.generateName(); this.generateName();
const abilityCount = this.getSpeciesForm().getAbilityCount(); const abilityCount = this.getSpeciesForm().getAbilityCount();
if (this.abilityIndex >= abilityCount) // Shouldn't happen if (this.abilityIndex >= abilityCount) // Shouldn't happen

View File

@ -338,7 +338,11 @@ export class GameData {
Species.CHIKORITA, Species.CYNDAQUIL, Species.TOTODILE, Species.CHIKORITA, Species.CYNDAQUIL, Species.TOTODILE,
Species.TREECKO, Species.TORCHIC, Species.MUDKIP, Species.TREECKO, Species.TORCHIC, Species.MUDKIP,
Species.TURTWIG, Species.CHIMCHAR, Species.PIPLUP, Species.TURTWIG, Species.CHIMCHAR, Species.PIPLUP,
Species.SNIVY, Species.TEPIG, Species.OSHAWOTT Species.SNIVY, Species.TEPIG, Species.OSHAWOTT,
Species.CHESPIN, Species.FENNEKIN, Species.FROAKIE,
Species.ROWLET, Species.LITTEN, Species.POPPLIO,
Species.GROOKEY, Species.SCORBUNNY, Species.SOBBLE,
Species.SPRIGATITO, Species.FUECOCO, Species.QUAXLY
]; ];
const defaultStarterAttr = DexAttr.NON_SHINY | DexAttr.MALE | DexAttr.ABILITY_1 | DexAttr.DEFAULT_FORM; const defaultStarterAttr = DexAttr.NON_SHINY | DexAttr.MALE | DexAttr.ABILITY_1 | DexAttr.DEFAULT_FORM;

View File

@ -22,6 +22,7 @@ export interface Starter {
pokerus: boolean; pokerus: boolean;
} }
const gens = [ 'I', 'II', 'III', 'IV', 'V', 'VI' ];
const ivChartSize = 24; const ivChartSize = 24;
const ivChartStatCoordMultipliers = [ [ 0, 1 ], [ 0.825, 0.5 ], [ 0.825, -0.5 ], [ 0, -1 ], [ -0.825, -0.5 ], [ -0.825, 0.5 ] ]; const ivChartStatCoordMultipliers = [ [ 0, 1 ], [ 0.825, 0.5 ], [ 0.825, -0.5 ], [ 0, -1 ], [ -0.825, -0.5 ], [ -0.825, 0.5 ] ];
const defaultIvChartData = new Array(12).fill(null).map(() => 0); const defaultIvChartData = new Array(12).fill(null).map(() => 0);
@ -37,6 +38,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
private pokemonGenderText: Phaser.GameObjects.Text; private pokemonGenderText: Phaser.GameObjects.Text;
private pokemonAbilityLabelText: Phaser.GameObjects.Text; private pokemonAbilityLabelText: Phaser.GameObjects.Text;
private pokemonAbilityText: Phaser.GameObjects.Text; private pokemonAbilityText: Phaser.GameObjects.Text;
private genOptionsText: Phaser.GameObjects.Text;
private instructionsText: Phaser.GameObjects.Text; private instructionsText: Phaser.GameObjects.Text;
private starterSelectMessageBoxContainer: Phaser.GameObjects.Container; private starterSelectMessageBoxContainer: Phaser.GameObjects.Container;
private statsContainer: Phaser.GameObjects.Container; private statsContainer: Phaser.GameObjects.Container;
@ -48,6 +50,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
private statsIvsCache: integer[]; private statsIvsCache: integer[];
private dexAttrCursor: bigint = 0n; private dexAttrCursor: bigint = 0n;
private genCursor: integer = 0; private genCursor: integer = 0;
private genScrollCursor: integer = 0;
private genSpecies: PokemonSpecies[][] = []; private genSpecies: PokemonSpecies[][] = [];
private lastSpecies: PokemonSpecies; private lastSpecies: PokemonSpecies;
@ -132,11 +135,13 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.pokemonAbilityText.setOrigin(0, 0); this.pokemonAbilityText.setOrigin(0, 0);
this.starterSelectContainer.add(this.pokemonAbilityText); this.starterSelectContainer.add(this.pokemonAbilityText);
const genText = addTextObject(this.scene, 115, 6, 'I\nII\nIII\nIV\nV', TextStyle.WINDOW); this.genOptionsText = addTextObject(this.scene, 115, 6, '', TextStyle.WINDOW);
genText.setLineSpacing(16); this.genOptionsText.setLineSpacing(16);
this.starterSelectContainer.add(genText); this.starterSelectContainer.add(this.genOptionsText);
this.starterSelectGenIconContainers = new Array(5).fill(null).map((_, i) => { this.updateGenOptions();
this.starterSelectGenIconContainers = new Array(gens.length).fill(null).map((_, i) => {
const container = this.scene.add.container(149, 9); const container = this.scene.add.container(149, 9);
if (i) if (i)
container.setVisible(false); container.setVisible(false);
@ -193,7 +198,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.genSpecies.push([]); this.genSpecies.push([]);
for (let species of allSpecies) { for (let species of allSpecies) {
if (species.generation > 5) if (species.generation > gens.length)
break; break;
if (!speciesStarterValues.hasOwnProperty(species.speciesId) || species.generation !== g + 1) if (!speciesStarterValues.hasOwnProperty(species.speciesId) || species.generation !== g + 1)
continue; continue;
@ -428,12 +433,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
ui.setMode(Mode.STARTER_SELECT); ui.setMode(Mode.STARTER_SELECT);
let isDupe = false; let isDupe = false;
for (let s = 0; s < this.starterCursors.length; s++) { for (let s = 0; s < this.starterCursors.length; s++) {
if (this.starterGens[s] === this.genCursor && this.starterCursors[s] === this.cursor) { if (this.starterGens[s] === this.getGenCursorWithScroll() && this.starterCursors[s] === this.cursor) {
isDupe = true; isDupe = true;
break; break;
} }
} }
const species = this.genSpecies[this.genCursor][this.cursor]; const species = this.genSpecies[this.getGenCursorWithScroll()][this.cursor];
if (!isDupe && this.tryUpdateValue(speciesStarterValues[species.speciesId])) { if (!isDupe && this.tryUpdateValue(speciesStarterValues[species.speciesId])) {
const cursorObj = this.starterCursorObjs[this.starterCursors.length]; const cursorObj = this.starterCursorObjs[this.starterCursors.length];
cursorObj.setVisible(true); cursorObj.setVisible(true);
@ -441,7 +446,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
const props = this.scene.gameData.getSpeciesDexAttrProps(species, this.dexAttrCursor); const props = this.scene.gameData.getSpeciesDexAttrProps(species, this.dexAttrCursor);
this.starterIcons[this.starterCursors.length].setTexture(species.getIconAtlasKey(props.formIndex)); this.starterIcons[this.starterCursors.length].setTexture(species.getIconAtlasKey(props.formIndex));
this.starterIcons[this.starterCursors.length].setFrame(species.getIconId(props.female, props.formIndex, props.shiny)); this.starterIcons[this.starterCursors.length].setFrame(species.getIconId(props.female, props.formIndex, props.shiny));
this.starterGens.push(this.genCursor); this.starterGens.push(this.getGenCursorWithScroll());
this.starterCursors.push(this.cursor); this.starterCursors.push(this.cursor);
this.starterAttr.push(this.dexAttrCursor); this.starterAttr.push(this.dexAttrCursor);
if (this.speciesLoaded.get(species.speciesId)) if (this.speciesLoaded.get(species.speciesId))
@ -468,7 +473,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.updateInstructions(); this.updateInstructions();
} }
} else { } else {
const genStarters = this.starterSelectGenIconContainers[this.genCursor].getAll().length; const genStarters = this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAll().length;
const rows = Math.ceil(genStarters / 9); const rows = Math.ceil(genStarters / 9);
const row = Math.floor(this.cursor / 9); const row = Math.floor(this.cursor / 9);
const props = this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, this.dexAttrCursor); const props = this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, this.dexAttrCursor);
@ -593,32 +598,45 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
if (this.genMode) { if (this.genMode) {
changed = this.genCursor !== cursor; changed = this.genCursor !== cursor;
if (this.genCursor !== undefined) let genCursorWithScroll = this.getGenCursorWithScroll();
this.starterSelectGenIconContainers[this.genCursor].setVisible(false);
if (!cursor && this.genScrollCursor) {
this.genScrollCursor--;
cursor++;
this.updateGenOptions();
} else if (cursor === 4 && this.genScrollCursor < gens.length - 5) {
this.genScrollCursor++;
cursor--;
this.updateGenOptions();
}
if (genCursorWithScroll !== undefined)
this.starterSelectGenIconContainers[genCursorWithScroll].setVisible(false);
this.cursor = 0; this.cursor = 0;
this.genCursor = cursor; this.genCursor = cursor;
genCursorWithScroll = this.getGenCursorWithScroll();
this.genCursorObj.setY(5 + 17 * this.genCursor); this.genCursorObj.setY(5 + 17 * this.genCursor);
this.genCursorHighlightObj.setY(this.genCursorObj.y); this.genCursorHighlightObj.setY(this.genCursorObj.y);
this.starterSelectGenIconContainers[this.genCursor].setVisible(true); this.starterSelectGenIconContainers[genCursorWithScroll].setVisible(true);
for (let s = 0; s < this.starterCursorObjs.length; s++) for (let s = 0; s < this.starterCursorObjs.length; s++)
this.starterCursorObjs[s].setVisible(this.starterGens[s] === cursor); this.starterCursorObjs[s].setVisible(this.starterGens[s] === genCursorWithScroll);
for (let s = 0; s < this.pokerusCursorObjs.length; s++) for (let s = 0; s < this.pokerusCursorObjs.length; s++)
this.pokerusCursorObjs[s].setVisible(this.pokerusGens[s] === cursor); this.pokerusCursorObjs[s].setVisible(this.pokerusGens[s] === genCursorWithScroll);
const genLimit = this.genSpecies[this.genCursor].length; const genLimit = this.genSpecies[genCursorWithScroll].length;
for (let s = 0; s < 81; s++) { for (let s = 0; s < 81; s++) {
const slotVisible = s < genLimit && !!(this.scene.gameData.dexData[this.genSpecies[this.genCursor][s].speciesId].caughtAttr); const slotVisible = s < genLimit && !!(this.scene.gameData.dexData[this.genSpecies[genCursorWithScroll][s].speciesId].caughtAttr);
this.starterValueLabels[s].setText(slotVisible ? speciesStarterValues[this.genSpecies[this.genCursor][s].speciesId] : 0); this.starterValueLabels[s].setText(slotVisible ? speciesStarterValues[this.genSpecies[genCursorWithScroll][s].speciesId] : 0);
this.starterValueLabels[s].setVisible(slotVisible); this.starterValueLabels[s].setVisible(slotVisible);
this.shinyIcons[s].setVisible(slotVisible && !!(this.scene.gameData.dexData[this.genSpecies[this.genCursor][s].speciesId].caughtAttr & DexAttr.SHINY)); this.shinyIcons[s].setVisible(slotVisible && !!(this.scene.gameData.dexData[this.genSpecies[genCursorWithScroll][s].speciesId].caughtAttr & DexAttr.SHINY));
} }
} else { } else {
changed = super.setCursor(cursor); changed = super.setCursor(cursor);
this.cursorObj.setPosition(148 + 18 * (cursor % 9), 10 + 18 * Math.floor(cursor / 9)); this.cursorObj.setPosition(148 + 18 * (cursor % 9), 10 + 18 * Math.floor(cursor / 9));
this.setSpecies(this.genSpecies[this.genCursor][cursor]); this.setSpecies(this.genSpecies[this.getGenCursorWithScroll()][cursor]);
this.updateInstructions(); this.updateInstructions();
} }
@ -626,6 +644,25 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
return changed; return changed;
} }
getGenCursorWithScroll(): integer {
return this.genCursor !== undefined
? this.genCursor + this.genScrollCursor
: undefined;
}
updateGenOptions(): void {
let text = '';
for (let g = this.genScrollCursor; g <= this.genScrollCursor + 4; g++) {
let optionText = gens[g];
if (g === this.genScrollCursor && this.genScrollCursor)
optionText = '↑';
else if (g === this.genScrollCursor + 4 && this.genScrollCursor < gens.length - 5)
optionText = '↓'
text += `${text ? '\n' : ''}${optionText}`;
}
this.genOptionsText.setText(text);
}
setGenMode(genMode: boolean): boolean { setGenMode(genMode: boolean): boolean {
this.genCursorObj.setVisible(genMode && !this.startCursorObj.visible); this.genCursorObj.setVisible(genMode && !this.startCursorObj.visible);
this.cursorObj.setVisible(!genMode && !this.startCursorObj.visible); this.cursorObj.setVisible(!genMode && !this.startCursorObj.visible);
@ -737,7 +774,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.pokemonSprite.setVisible(!this.statsMode); this.pokemonSprite.setVisible(!this.statsMode);
}); });
(this.starterSelectGenIconContainers[this.genCursor].getAt(this.cursor) as Phaser.GameObjects.Sprite).setFrame(species.getIconId(female, formIndex, shiny)); (this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setFrame(species.getIconId(female, formIndex, shiny));
this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY); this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY);
this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE); this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE);