Revert "Implemented Power Split and Guard Split (#699)"

This reverts commit 0b75a5210a.
This commit is contained in:
Flashfyre 2024-05-15 10:13:29 -04:00
parent 3aeef50507
commit 3c8d919ef8
3 changed files with 3 additions and 104 deletions

View File

@ -2005,86 +2005,6 @@ export class HpSplitAttr extends MoveEffectAttr {
} }
} }
/**
* Attribute used for moves which split the user and the target's offensive raw stats.
* @extends MoveEffectAttr
* @see {@link apply}
*/
export class PowerSplitAttr extends MoveEffectAttr {
/**
* Applying Power Split to the user and the target.
* @param user The pokemon using the move. {@link Pokemon}
* @param target The targeted pokemon of the move. {@link Pokemon}
* @param move The move used. {@link Move}
* @param args N/A
* @returns True if power split is applied successfully.
*/
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]) : Promise<boolean> {
return new Promise(resolve => {
if (!super.apply(user, target, move, args))
return resolve(false);
const infoUpdates = [];
const attackValue = Math.floor((target.getStat(Stat.ATK) + user.getStat(Stat.ATK)) / 2);
user.changeSummonStat(Stat.ATK, attackValue);
infoUpdates.push(user.updateInfo());
target.changeSummonStat(Stat.ATK, attackValue);
infoUpdates.push(target.updateInfo());
const specialAttackValue = Math.floor((target.getStat(Stat.SPATK) + user.getStat(Stat.SPATK)) / 2);
user.changeSummonStat(Stat.SPATK, specialAttackValue);
infoUpdates.push(user.updateInfo());
target.changeSummonStat(Stat.SPATK, specialAttackValue);
infoUpdates.push(target.updateInfo());
return Promise.all(infoUpdates).then(() => resolve(true));
});
}
}
/**
* Attribute used for moves which split the user and the target's defensive raw stats.
* @extends MoveEffectAttr
* @see {@link apply}
*/
export class GuardSplitAttr extends MoveEffectAttr {
/**
* Applying Guard Split to the user and the target.
* @param user The pokemon using the move. {@link Pokemon}
* @param target The targeted pokemon of the move. {@link Pokemon}
* @param move The move used. {@link Move}
* @param args N/A
* @returns True if power split is applied successfully.
*/
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise<boolean> {
return new Promise(resolve => {
if (!super.apply(user, target, move, args))
return resolve(false);
const infoUpdates = [];
const defenseValue = Math.floor((target.getStat(Stat.DEF) + user.getStat(Stat.DEF)) / 2);
user.changeSummonStat(Stat.DEF, defenseValue);
infoUpdates.push(user.updateInfo());
target.changeSummonStat(Stat.DEF, defenseValue);
infoUpdates.push(target.updateInfo());
const specialDefenseValue = Math.floor((target.getStat(Stat.SPDEF) + user.getStat(Stat.SPDEF)) / 2);
user.changeSummonStat(Stat.SPDEF, specialDefenseValue);
infoUpdates.push(user.updateInfo());
target.changeSummonStat(Stat.SPDEF, specialDefenseValue);
infoUpdates.push(target.updateInfo());
return Promise.all(infoUpdates).then(() => resolve(true));
});
}
}
export class VariablePowerAttr extends MoveAttr { export class VariablePowerAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
//const power = args[0] as Utils.NumberHolder; //const power = args[0] as Utils.NumberHolder;
@ -5744,9 +5664,9 @@ export function initMoves() {
.target(MoveTarget.USER_SIDE) .target(MoveTarget.USER_SIDE)
.unimplemented(), .unimplemented(),
new StatusMove(Moves.GUARD_SPLIT, Type.PSYCHIC, -1, 10, -1, 0, 5) new StatusMove(Moves.GUARD_SPLIT, Type.PSYCHIC, -1, 10, -1, 0, 5)
.attr(GuardSplitAttr), .unimplemented(),
new StatusMove(Moves.POWER_SPLIT, Type.PSYCHIC, -1, 10, -1, 0, 5) new StatusMove(Moves.POWER_SPLIT, Type.PSYCHIC, -1, 10, -1, 0, 5)
.attr(PowerSplitAttr), .unimplemented(),
new StatusMove(Moves.WONDER_ROOM, Type.PSYCHIC, -1, 10, -1, 0, 5) new StatusMove(Moves.WONDER_ROOM, Type.PSYCHIC, -1, 10, -1, 0, 5)
.ignoresProtect() .ignoresProtect()
.target(MoveTarget.BOTH_SIDES) .target(MoveTarget.BOTH_SIDES)

View File

@ -544,19 +544,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}); });
} }
/**
* Returns the value of the specified stat.
* @param stat Stat to get the value of. {@link Stat}
* @returns The value of the stat. If the pokemon is already summoned, it uses those values, otherwise uses the base stats.
*/
getStat(stat: Stat): integer { getStat(stat: Stat): integer {
if (!this.summonData) {
return this.stats[stat]; return this.stats[stat];
} }
return this.summonData.stats[stat];
}
getBattleStat(stat: Stat, opponent?: Pokemon, move?: Move, isCritical: boolean = false): integer { getBattleStat(stat: Stat, opponent?: Pokemon, move?: Move, isCritical: boolean = false): integer {
if (stat === Stat.HP) if (stat === Stat.HP)
return this.getStat(Stat.HP); return this.getStat(Stat.HP);
@ -1717,16 +1708,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return healAmount; return healAmount;
} }
/**
* Sets a specific stat to a specific value.
* Used for summon data, while the pokemon is out until the next time it is retrieved.
* @param stat Stat to change. {@link Stat}
* @param value Amount to set the stat to.
*/
changeSummonStat(stat: Stat, value: integer) : void {
this.summonData.stats[stat] = value;
}
isBossImmune(): boolean { isBossImmune(): boolean {
return this.isBoss(); return this.isBoss();
} }
@ -2185,7 +2166,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (!this.battleData) if (!this.battleData)
this.resetBattleData(); this.resetBattleData();
this.resetBattleSummonData(); this.resetBattleSummonData();
this.summonData.stats = this.stats;
if (this.summonDataPrimer) { if (this.summonDataPrimer) {
for (let k of Object.keys(this.summonData)) { for (let k of Object.keys(this.summonData)) {
if (this.summonDataPrimer[k]) if (this.summonDataPrimer[k])

View File

@ -112,7 +112,6 @@ export default class PokemonData {
this.summonData = new PokemonSummonData(); this.summonData = new PokemonSummonData();
if (!forHistory && source.summonData) { if (!forHistory && source.summonData) {
this.summonData.battleStats = source.summonData.battleStats; this.summonData.battleStats = source.summonData.battleStats;
this.summonData.stats = source.summonData.stats;
this.summonData.moveQueue = source.summonData.moveQueue; this.summonData.moveQueue = source.summonData.moveQueue;
this.summonData.disabledMove = source.summonData.disabledMove; this.summonData.disabledMove = source.summonData.disabledMove;
this.summonData.disabledTurns = source.summonData.disabledTurns; this.summonData.disabledTurns = source.summonData.disabledTurns;