Fix crash with TRs (#6330)

This commit is contained in:
Kris Johnson
2020-02-03 01:25:49 -07:00
committed by GitHub
parent 05efe2e011
commit d3e266cddd
3 changed files with 300 additions and 108 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -411,8 +411,6 @@ export class Item extends BasicEffect implements Readonly<BasicEffect & ItemData
readonly isGem: boolean;
/** Is this item a Pokeball? */
readonly isPokeball: boolean;
/** Is this item a Technical Record? */
readonly isTR: string;
constructor(data: AnyObject, ...moreData: (AnyObject | null)[]) {
super(data, ...moreData);
@@ -434,7 +432,6 @@ export class Item extends BasicEffect implements Readonly<BasicEffect & ItemData
this.onPlate = data.onPlate || undefined;
this.isGem = !!data.isGem;
this.isPokeball = !!data.isPokeball;
this.isTR = data.isTR || undefined;
if (!this.gen) {
if (this.num >= 689) {
@@ -457,10 +454,6 @@ export class Item extends BasicEffect implements Readonly<BasicEffect & ItemData
if (this.onDrive) this.fling = {basePower: 70};
if (this.megaStone) this.fling = {basePower: 80};
if (this.onMemory) this.fling = {basePower: 50};
if (this.isTR) {
let move = Dex.getMove(this.isTR);
this.fling = {basePower: move.basePower === 0 ? 10 : move.basePower};
}
}
}

View File

@@ -778,7 +778,6 @@ interface ItemData extends EffectData, ItemEventMethods, EventMethods {
onDrive?: string
onMemory?: string
onPlate?: string
isTR?: string
spritenum?: number
zMove?: string | true
zMoveFrom?: string