Filter out sacrificial moves from boss movesets
parent
b7913e2a82
commit
6821404023
|
@ -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 BattleScene, { ABILITY_OVERRIDE, AnySound, MOVE_OVERRIDE, OPP_ABILITY_OVERRIDE, OPP_MOVE_OVERRIDE } from '../battle-scene';
|
||||||
import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info';
|
import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info';
|
||||||
import { Moves } from "../data/enums/moves";
|
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 { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm } from '../data/pokemon-species';
|
||||||
import * as Utils from '../utils';
|
import * as Utils from '../utils';
|
||||||
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type';
|
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type';
|
||||||
|
@ -181,8 +181,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
this.calculateStats();
|
this.calculateStats();
|
||||||
this.generateFusionSpecies();
|
this.generateFusionSpecies();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.generateAndPopulateMoveset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.generateName();
|
this.generateName();
|
||||||
|
@ -939,7 +937,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
|
|
||||||
generateAndPopulateMoveset(): void {
|
generateAndPopulateMoveset(): void {
|
||||||
this.moveset = [];
|
this.moveset = [];
|
||||||
const movePool = [];
|
let movePool: Moves[] = [];
|
||||||
const allLevelMoves = this.getLevelMoves(1, true, true);
|
const allLevelMoves = this.getLevelMoves(1, true, true);
|
||||||
if (!allLevelMoves) {
|
if (!allLevelMoves) {
|
||||||
console.log(this.species.speciesId, 'ERROR');
|
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();
|
movePool.reverse();
|
||||||
|
|
||||||
const attackMovePool = movePool.filter(m => {
|
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) {
|
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);
|
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, ivs, nature, dataSource);
|
||||||
|
|
||||||
|
if (!dataSource)
|
||||||
|
this.generateAndPopulateMoveset();
|
||||||
this.generateCompatibleTms();
|
this.generateCompatibleTms();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2319,6 +2322,8 @@ export class EnemyPokemon extends Pokemon {
|
||||||
this.setBoss();
|
this.setBoss();
|
||||||
|
|
||||||
if (!dataSource) {
|
if (!dataSource) {
|
||||||
|
this.generateAndPopulateMoveset();
|
||||||
|
|
||||||
this.trySetShiny();
|
this.trySetShiny();
|
||||||
|
|
||||||
let prevolution: Species;
|
let prevolution: Species;
|
||||||
|
|
Loading…
Reference in New Issue