mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-31 05:07:11 +00:00
This reverts commit 6c4b60a2faca4f52fd83808e1bd6c331aa98a2c3.
This commit is contained in:
parent
5eab016903
commit
0c862839d3
@ -94,9 +94,12 @@ export function getBerryEffectFunc(berryType: BerryType): BerryEffectFunc {
|
|||||||
}
|
}
|
||||||
if (pokemon.status) {
|
if (pokemon.status) {
|
||||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect)));
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect)));
|
||||||
|
pokemon.resetStatus();
|
||||||
|
pokemon.updateInfo();
|
||||||
|
}
|
||||||
|
if (pokemon.getTag(BattlerTagType.CONFUSED)) {
|
||||||
|
pokemon.lapseTag(BattlerTagType.CONFUSED);
|
||||||
}
|
}
|
||||||
pokemon.resetStatus(true, true);
|
|
||||||
pokemon.updateInfo();
|
|
||||||
};
|
};
|
||||||
case BerryType.LIECHI:
|
case BerryType.LIECHI:
|
||||||
case BerryType.GANLON:
|
case BerryType.GANLON:
|
||||||
|
@ -2426,10 +2426,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the status of a pokemon
|
* Resets the status of a pokemon
|
||||||
* @param {boolean} revive Whether revive should be cured; defaults to true.
|
* @param revive whether revive should be cured, defaults to true
|
||||||
* @param {boolean} confusion Whether resetStatus should include confusion or not; defaults to false.
|
|
||||||
*/
|
*/
|
||||||
resetStatus(revive: boolean = true, confusion: boolean = false): void {
|
resetStatus(revive: boolean = true): void {
|
||||||
const lastStatus = this.status?.effect;
|
const lastStatus = this.status?.effect;
|
||||||
if (!revive && lastStatus === StatusEffect.FAINT) {
|
if (!revive && lastStatus === StatusEffect.FAINT) {
|
||||||
return;
|
return;
|
||||||
@ -2441,11 +2440,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
this.lapseTag(BattlerTagType.NIGHTMARE);
|
this.lapseTag(BattlerTagType.NIGHTMARE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (confusion) {
|
|
||||||
if (this.getTag(BattlerTagType.CONFUSED)) {
|
|
||||||
this.lapseTag(BattlerTagType.CONFUSED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
primeSummonData(summonDataPrimer: PokemonSummonData): void {
|
primeSummonData(summonDataPrimer: PokemonSummonData): void {
|
||||||
|
@ -21,7 +21,6 @@ import { ModifierTier } from "./modifier-tier";
|
|||||||
import { Nature, getNatureName, getNatureStatMultiplier } from "#app/data/nature";
|
import { Nature, getNatureName, getNatureStatMultiplier } from "#app/data/nature";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import { getModifierTierTextTint } from "#app/ui/text";
|
import { getModifierTierTextTint } from "#app/ui/text";
|
||||||
import { BattlerTagType } from "#app/data/enums/battler-tag-type.js";
|
|
||||||
|
|
||||||
const outputModifierData = false;
|
const outputModifierData = false;
|
||||||
const useMaxWeightForOutput = false;
|
const useMaxWeightForOutput = false;
|
||||||
@ -231,7 +230,7 @@ export class PokemonHpRestoreModifierType extends PokemonModifierType {
|
|||||||
constructor(localeKey: string, iconImage: string, restorePoints: integer, restorePercent: integer, healStatus: boolean = false, newModifierFunc?: NewModifierFunc, selectFilter?: PokemonSelectFilter, group?: string) {
|
constructor(localeKey: string, iconImage: string, restorePoints: integer, restorePercent: integer, healStatus: boolean = false, newModifierFunc?: NewModifierFunc, selectFilter?: PokemonSelectFilter, group?: string) {
|
||||||
super(localeKey, iconImage, newModifierFunc || ((_type, args) => new Modifiers.PokemonHpRestoreModifier(this, (args[0] as PlayerPokemon).id, this.restorePoints, this.restorePercent, this.healStatus, false)),
|
super(localeKey, iconImage, newModifierFunc || ((_type, args) => new Modifiers.PokemonHpRestoreModifier(this, (args[0] as PlayerPokemon).id, this.restorePoints, this.restorePercent, this.healStatus, false)),
|
||||||
selectFilter || ((pokemon: PlayerPokemon) => {
|
selectFilter || ((pokemon: PlayerPokemon) => {
|
||||||
if (!pokemon.hp || (pokemon.hp >= pokemon.getMaxHp() && (!this.healStatus || (!pokemon.status && !pokemon.getTag(BattlerTagType.CONFUSED))))) {
|
if (!pokemon.hp || (pokemon.hp >= pokemon.getMaxHp() && (!this.healStatus || !pokemon.status))) {
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -281,7 +280,7 @@ export class PokemonStatusHealModifierType extends PokemonModifierType {
|
|||||||
constructor(localeKey: string, iconImage: string) {
|
constructor(localeKey: string, iconImage: string) {
|
||||||
super(localeKey, iconImage, ((_type, args) => new Modifiers.PokemonStatusHealModifier(this, (args[0] as PlayerPokemon).id)),
|
super(localeKey, iconImage, ((_type, args) => new Modifiers.PokemonStatusHealModifier(this, (args[0] as PlayerPokemon).id)),
|
||||||
((pokemon: PlayerPokemon) => {
|
((pokemon: PlayerPokemon) => {
|
||||||
if (!pokemon.hp || (!pokemon.status && !pokemon.getTag(BattlerTagType.CONFUSED))) {
|
if (!pokemon.hp || !pokemon.status) {
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -1057,14 +1057,16 @@ export class PokemonHpRestoreModifier extends ConsumablePokemonModifier {
|
|||||||
let restorePoints = this.restorePoints;
|
let restorePoints = this.restorePoints;
|
||||||
if (!this.fainted) {
|
if (!this.fainted) {
|
||||||
restorePoints = Math.floor(restorePoints * (args[1] as number));
|
restorePoints = Math.floor(restorePoints * (args[1] as number));
|
||||||
if (this.fainted || this.healStatus) {
|
|
||||||
pokemon.resetStatus(true, true);
|
|
||||||
}
|
|
||||||
pokemon.hp = Math.min(pokemon.hp + Math.max(Math.ceil(Math.max(Math.floor((this.restorePercent * 0.01) * pokemon.getMaxHp()), restorePoints)), 1), pokemon.getMaxHp());
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
if (this.fainted || this.healStatus) {
|
||||||
|
pokemon.resetStatus();
|
||||||
|
}
|
||||||
|
pokemon.hp = Math.min(pokemon.hp + Math.max(Math.ceil(Math.max(Math.floor((this.restorePercent * 0.01) * pokemon.getMaxHp()), restorePoints)), 1), pokemon.getMaxHp());
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1075,7 +1077,8 @@ export class PokemonStatusHealModifier extends ConsumablePokemonModifier {
|
|||||||
|
|
||||||
apply(args: any[]): boolean {
|
apply(args: any[]): boolean {
|
||||||
const pokemon = args[0] as Pokemon;
|
const pokemon = args[0] as Pokemon;
|
||||||
pokemon.resetStatus(true, true);
|
pokemon.resetStatus();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user