[Feature] Implement Full Heal/Lum/Full Restore to heal Confusion #1658 (#1876)

* Added Confusion to be healed with Full Heals and Full Restores

* Semi-Colon oversight

* Changed resetStatus to have a condition whether to include confusion or not, defaults to false so you manually have to add

* Fixed spacing and semicolon

* Refactored the Lum Berry case

* Fix berry conflicts

* Update {}

* Fix PP Conflict

* Build fix?

* Fix Modifier

* Build Fix

* Fix

* Fix StatuHeal from eslint

* Fix revive (will show testing through everything again)

* Update documentation

---------

Co-authored-by: Ethan <hensley.ethan64@gmail.com>
Co-authored-by: Ethan <71776311+EvasiveAce@users.noreply.github.com>
This commit is contained in:
Dmitriy K 2024-06-06 12:04:16 -04:00 committed by GitHub
parent 8d6a0bb0a1
commit 223d8a731d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 15 deletions

View File

@ -81,12 +81,9 @@ export function getBerryEffectFunc(berryType: BerryType): BerryEffectFunc {
}
if (pokemon.status) {
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.GANLON:

View File

@ -2438,10 +2438,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
/**
* Resets the status of a pokemon
* @param revive whether revive should be cured, defaults to true
* Resets the status of a pokemon.
* @param revive Whether revive should be cured; defaults to true.
* @param confusion Whether resetStatus should include confusion or not; defaults to false.
*/
resetStatus(revive: boolean = true): void {
resetStatus(revive: boolean = true, confusion: boolean = false): void {
const lastStatus = this.status?.effect;
if (!revive && lastStatus === StatusEffect.FAINT) {
return;
@ -2453,6 +2454,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.lapseTag(BattlerTagType.NIGHTMARE);
}
}
if (confusion) {
if (this.getTag(BattlerTagType.CONFUSED)) {
this.lapseTag(BattlerTagType.CONFUSED);
}
}
}
primeSummonData(summonDataPrimer: PokemonSummonData): void {

View File

@ -23,6 +23,7 @@ import { ModifierTier } from "./modifier-tier";
import { Nature, getNatureName, getNatureStatMultiplier } from "#app/data/nature";
import i18next from "#app/plugins/i18n";
import { getModifierTierTextTint } from "#app/ui/text";
import { BattlerTagType } from "#app/data/enums/battler-tag-type.js";
import * as Overrides from "../overrides";
const outputModifierData = false;
@ -233,7 +234,7 @@ export class PokemonHpRestoreModifierType extends PokemonModifierType {
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)),
selectFilter || ((pokemon: PlayerPokemon) => {
if (!pokemon.hp || (pokemon.hp >= pokemon.getMaxHp() && (!this.healStatus || !pokemon.status))) {
if (!pokemon.hp || (pokemon.hp >= pokemon.getMaxHp() && (!this.healStatus || (!pokemon.status && !pokemon.getTag(BattlerTagType.CONFUSED))))) {
return PartyUiHandler.NoEffectMessage;
}
return null;
@ -283,7 +284,7 @@ export class PokemonStatusHealModifierType extends PokemonModifierType {
constructor(localeKey: string, iconImage: string) {
super(localeKey, iconImage, ((_type, args) => new Modifiers.PokemonStatusHealModifier(this, (args[0] as PlayerPokemon).id)),
((pokemon: PlayerPokemon) => {
if (!pokemon.hp || !pokemon.status) {
if (!pokemon.hp || (!pokemon.status && !pokemon.getTag(BattlerTagType.CONFUSED))) {
return PartyUiHandler.NoEffectMessage;
}
return null;

View File

@ -1130,13 +1130,11 @@ export class PokemonHpRestoreModifier extends ConsumablePokemonModifier {
restorePoints = Math.floor(restorePoints * (args[1] as number));
}
if (this.fainted || this.healStatus) {
pokemon.resetStatus();
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;
}
}
@ -1148,8 +1146,7 @@ export class PokemonStatusHealModifier extends ConsumablePokemonModifier {
apply(args: any[]): boolean {
const pokemon = args[0] as Pokemon;
pokemon.resetStatus();
pokemon.resetStatus(true, true);
return true;
}
}