Add DNA splicers and Pokemon fusing

This commit is contained in:
Flashfyre committed 2023-11-04 00:32:12 -04:00
1 parent 0ad1a9d25a
commit e07339e3eb
22 files changed
+879 -485

No files matched your search

+1 -1
View File
@@ -242,7 +242,7 @@ class AnimTimedSoundEvent extends AnimTimedEvent {
}
return Math.ceil((scene.sound.get(this.resourceName).totalDuration * 1000) / 33.33);
} else
return Math.ceil(battleAnim.user.cry(soundConfig) / 33.33);
return Math.ceil((battleAnim.user.cry(soundConfig).totalDuration * 1000) / 33.33);
}
getEventType(): string {
+1
View File
@@ -2023,6 +2023,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
} else {
switchOutTarget.hideInfo().then(() => switchOutTarget.destroy());
switchOutTarget.hp = 0;
switchOutTarget.trySetStatus(StatusEffect.FAINT);
user.scene.queueMessage(getPokemonMessage(switchOutTarget, ' fled!'), null, true, 500);
+53 -4
View File
@@ -1,11 +1,21 @@
import { Moves } from "./move";
import { Species } from "./species";
interface PokemonLevelMoves {
[key: string]: Array<Array<integer | Moves>>
export type LevelMoves = (integer | Moves)[][];
interface PokemonSpeciesLevelMoves {
[key: string]: LevelMoves
}
export const pokemonLevelMoves: PokemonLevelMoves = {
interface PokemonFormLevelMoves {
[key: integer]: LevelMoves
}
interface PokemonSpeciesFormLevelMoves {
[key: string]: PokemonFormLevelMoves
}
export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[Species.BULBASAUR]: [
[ 1, Moves.TACKLE ],
[ 3, Moves.GROWL ],
@@ -10965,4 +10975,43 @@ export const pokemonLevelMoves: PokemonLevelMoves = {
[ 80, Moves.HYPER_BEAM ],
[ 88, Moves.OUTRAGE ]
]
};
};
export const pokemonFormLevelMoves: PokemonSpeciesFormLevelMoves = {
[Species.KYUREM]: {
1: [
[ 1, Moves.DRAGON_RAGE ],
[ 1, Moves.ICY_WIND ],
[ 8, Moves.IMPRISON ],
[ 15, Moves.ANCIENT_POWER ],
[ 22, Moves.ICE_BEAM ],
[ 29, Moves.DRAGON_BREATH ],
[ 36, Moves.SLASH ],
[ 43, Moves.SCARY_FACE ],
[ 50, Moves.ICE_BURN ],
[ 57, Moves.DRAGON_PULSE ],
[ 64, Moves.IMPRISON ],
[ 71, Moves.ENDEAVOR ],
[ 78, Moves.BLIZZARD ],
[ 85, Moves.OUTRAGE ],
[ 92, Moves.HYPER_VOICE ]
],
2: [
[ 1, Moves.DRAGON_RAGE ],
[ 1, Moves.ICY_WIND ],
[ 8, Moves.IMPRISON ],
[ 15, Moves.ANCIENT_POWER ],
[ 22, Moves.ICE_BEAM ],
[ 29, Moves.DRAGON_BREATH ],
[ 36, Moves.SLASH ],
[ 43, Moves.SCARY_FACE ],
[ 50, Moves.FREEZE_SHOCK ],
[ 57, Moves.DRAGON_PULSE ],
[ 64, Moves.IMPRISON ],
[ 71, Moves.ENDEAVOR ],
[ 78, Moves.BLIZZARD ],
[ 85, Moves.OUTRAGE ],
[ 92, Moves.HYPER_VOICE ]
]
}
}
+26 -9
View File
@@ -1,11 +1,12 @@
import { Abilities } from './ability';
import BattleScene from '../battle-scene';
import BattleScene, { AnySound } from '../battle-scene';
import { GrowthRate } from './exp';
import { SpeciesWildEvolutionDelay, pokemonEvolutions, pokemonPrevolutions } from './pokemon-evolutions';
import { Species } from './species';
import { Type } from './type';
import * as Utils from '../utils';
import { TrainerType, trainerConfigs } from './trainer-type';
import { LevelMoves, pokemonFormLevelMoves as pokemonSpeciesFormLevelMoves, pokemonSpeciesLevelMoves } from './pokemon-level-moves';
export function getPokemonSpecies(species: Species): PokemonSpecies {
if (species >= Species.XERNEAS)
@@ -74,6 +75,12 @@ export abstract class PokemonSpeciesForm {
return !abilityIndex ? this.ability1 : abilityIndex === 1 && this.ability2 ? this.ability2 : this.abilityHidden
}
getLevelMoves(): LevelMoves {
if (pokemonSpeciesFormLevelMoves.hasOwnProperty(this.speciesId) && pokemonSpeciesFormLevelMoves[this.speciesId].hasOwnProperty(this.formIndex))
return pokemonSpeciesFormLevelMoves[this.speciesId][this.formIndex];
return pokemonSpeciesLevelMoves[this.speciesId];
}
isObtainable() {
return this.generation <= 5 && this.getFormSpriteKey(this.formIndex) !== 'mega';
}
@@ -147,15 +154,21 @@ export abstract class PokemonSpeciesForm {
const forms = getPokemonSpecies(this.speciesId).forms;
if (forms.length) {
const formKey = forms[formIndex || 0].formKey;
if (formKey === 'mega' || formKey === 'eternamax')
ret += `-${formKey}`;
switch (formKey) {
case 'mega':
case 'white':
case 'black':
case 'eternamax':
ret += `-${formKey}`;
break;
}
}
return ret;
}
loadAssets(scene: BattleScene, female: boolean, formIndex?: integer, shiny?: boolean, startLoad?: boolean): Promise<void> {
return new Promise(resolve => {
scene.load.audio(this.speciesId.toString(), `audio/cry/${this.getCryKey(formIndex)}.mp3`);
scene.load.audio(this.getCryKey(formIndex), `audio/cry/${this.getCryKey(formIndex)}.mp3`);
scene.loadAtlas(this.getSpriteKey(female, formIndex, shiny), 'pokemon', this.getSpriteAtlasPath(female, formIndex, shiny));
scene.load.once(Phaser.Loader.Events.COMPLETE, () => {
const originalWarn = console.warn;
@@ -192,9 +205,13 @@ export abstract class PokemonSpeciesForm {
});
}
cry(scene: BattleScene, soundConfig?: Phaser.Types.Sound.SoundConfig): integer {
scene.playSound(this.speciesId.toString(), soundConfig);
return scene.sound.get(this.speciesId.toString()).totalDuration * 1000;
cry(scene: BattleScene, soundConfig?: Phaser.Types.Sound.SoundConfig, ignorePlay?: boolean): AnySound {
const cryKey = this.getCryKey(this.formIndex);
let cry = scene.sound.get(cryKey) as AnySound;
cry = scene.playSound(cry || cryKey, soundConfig);
if (ignorePlay)
cry.stop();
return cry;
}
}
@@ -1132,8 +1149,8 @@ export function initSpecies() {
),
new PokemonSpecies(Species.KYUREM, "Kyurem", 5, false, true, false, "Boundary Pokémon", Type.DRAGON, Type.ICE, 3, 325, Abilities.PRESSURE, Abilities.NONE, Abilities.NONE, 660, 125, 130, 90, 130, 90, 95, 3, 0, 297, GrowthRate.SLOW, "Undiscovered", null, null, 120, false, true,
new PokemonForm("Normal", "", Type.DRAGON, Type.ICE, 3, 325, Abilities.PRESSURE, Abilities.NONE, Abilities.NONE, 660, 125, 130, 90, 130, 90, 95, 3, 0, 297, GrowthRate.SLOW, "Undiscovered", null, null, 120, false),
new PokemonForm("Black", "black", Type.DRAGON, Type.ICE, 3.3, 325, Abilities.TERAVOLT, Abilities.NONE, Abilities.NONE, 700, 125, 170, 100, 120, 90, 95, 3, 0, 315, GrowthRate.SLOW, "Undiscovered", null, null, 120, false),
new PokemonForm("White", "white", Type.DRAGON, Type.ICE, 3.6, 325, Abilities.TURBOBLAZE, Abilities.NONE, Abilities.NONE, 700, 125, 120, 90, 170, 100, 95, 3, 0, 315, GrowthRate.SLOW, "Undiscovered", null, null, 120, false)
new PokemonForm("White", "white", Type.DRAGON, Type.ICE, 3.6, 325, Abilities.TURBOBLAZE, Abilities.NONE, Abilities.NONE, 700, 125, 120, 90, 170, 100, 95, 3, 0, 315, GrowthRate.SLOW, "Undiscovered", null, null, 120, false),
new PokemonForm("Black", "black", Type.DRAGON, Type.ICE, 3.3, 325, Abilities.TERAVOLT, Abilities.NONE, Abilities.NONE, 700, 125, 170, 100, 120, 90, 95, 3, 0, 315, GrowthRate.SLOW, "Undiscovered", null, null, 120, false)
),
new PokemonSpecies(Species.KELDEO, "Keldeo", 5, false, false, true, "Colt Pokémon", Type.WATER, Type.FIGHTING, 1.4, 48.5, Abilities.JUSTIFIED, Abilities.NONE, Abilities.NONE, 580, 91, 72, 90, 129, 90, 108, 3, 35, 261, GrowthRate.SLOW, "Undiscovered", null, null, 80, false, true,
new PokemonForm("Ordinary Forme", "ordinary", Type.WATER, Type.FIGHTING, 1.4, 48.5, Abilities.JUSTIFIED, Abilities.NONE, Abilities.NONE, 580, 91, 72, 90, 129, 90, 108, 3, 35, 261, GrowthRate.SLOW, "Undiscovered", null, null, 80, false),
+3 -4
View File
@@ -4,7 +4,6 @@ import { EnemyPokemon } from "../pokemon";
import * as Utils from "../utils";
import { Moves } from "./move";
import { pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions";
import { pokemonLevelMoves } from "./pokemon-level-moves";
import PokemonSpecies, { PokemonSpeciesFilter, getPokemonSpecies } from "./pokemon-species";
import { Species } from "./species";
import { tmSpecies } from "./tms";
@@ -552,7 +551,7 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.BREEDER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.POKEFAN).setHasGenders().setDouble()
.setPartyTemplateFunc(scene => getWavePartyTemplate(scene, trainerPartyTemplates.FOUR_WEAKER, trainerPartyTemplates.FIVE_WEAKER, trainerPartyTemplates.SIX_WEAKER)),
[TrainerType.CLERK]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CLERK),
[TrainerType.CYCLIST]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CYCLIST).setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.QUICK_ATTACK)),
[TrainerType.CYCLIST]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CYCLIST).setSpeciesFilter(s => !!s.getLevelMoves().find(plm => plm[1] === Moves.QUICK_ATTACK)),
[TrainerType.DANCER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
[TrainerType.DEPOT_AGENT]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK),
[TrainerType.DOCTOR]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK),
@@ -575,8 +574,8 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.JANITOR]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK),
[TrainerType.LINEBACKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
[TrainerType.MAID]: new TrainerConfig(++t).setEncounterBgm(TrainerType.RICH).setSpeciesFilter(s => s.eggType1 === 'Field' || s.eggType2 === 'Field'),
[TrainerType.MUSICIAN]: new TrainerConfig(++t).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.SING)),
[TrainerType.NURSE]: new TrainerConfig(++t).setEncounterBgm('lass').setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.CHARM) || !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.HEAL_PULSE)),
[TrainerType.MUSICIAN]: new TrainerConfig(++t).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => !!s.getLevelMoves().find(plm => plm[1] === Moves.SING)),
[TrainerType.NURSE]: new TrainerConfig(++t).setEncounterBgm('lass').setSpeciesFilter(s => !!s.getLevelMoves().find(plm => plm[1] === Moves.CHARM) || !!s.getLevelMoves().find(plm => plm[1] === Moves.HEAL_PULSE)),
[TrainerType.NURSERY_AIDE]: new TrainerConfig(++t).setEncounterBgm('lass'),
[TrainerType.OFFICER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesPools([ Species.VULPIX, Species.GROWLITHE, Species.SNUBBULL, Species.HOUNDOUR, Species.POOCHYENA, Species.ELECTRIKE, Species.LILLIPUP ]),
[TrainerType.PARASOL_LADY]: new TrainerConfig(++t).setEncounterBgm(TrainerType.PARASOL_LADY).setSpeciesFilter(s => s.isOfType(Type.WATER)),