mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 08:22:16 +02:00
now properly reverts to zero form
This commit is contained in:
parent
ca6c3448eb
commit
00a2d5bbe4
@ -1950,19 +1950,20 @@ export class PostTurnFormChangeAbAttr extends PostTurnAbAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ZeroToHeroAbAttr extends PreSwitchOutAbAttr {
|
export class PreSwitchOutFormChangeAbAttr extends PreSwitchOutAbAttr {
|
||||||
// .attr(PostBattleInitFormChangeAbAttr, p => p.getHpRatio() <= 0.9 ? 1 : 0)
|
private formFunc: (p: Pokemon) => integer;
|
||||||
//.attr(PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.9 ? 1 : 0)
|
|
||||||
//.attr(PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.9 ? 1 : 0)
|
|
||||||
constructor(formFunc: ((p: Pokemon) => integer)) {
|
constructor(formFunc: ((p: Pokemon) => integer)) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
//this.formFunc = formFunc;
|
this.formFunc = formFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyPreSwitchOut(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
|
applyPreSwitchOut(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
|
||||||
|
console.log(pokemon.getFormKey())
|
||||||
|
|
||||||
if (1 !== pokemon.formIndex && pokemon.species.name == "Palafin") {
|
const formIndex = this.formFunc(pokemon);
|
||||||
|
if (formIndex !== pokemon.formIndex) {
|
||||||
pokemon.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeManualTrigger, false);
|
pokemon.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeManualTrigger, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -3354,7 +3355,9 @@ export function initAbilities() {
|
|||||||
.attr(UnsuppressableAbilityAbAttr)
|
.attr(UnsuppressableAbilityAbAttr)
|
||||||
.attr(NoTransformAbilityAbAttr)
|
.attr(NoTransformAbilityAbAttr)
|
||||||
.attr(NoFusionAbilityAbAttr)
|
.attr(NoFusionAbilityAbAttr)
|
||||||
.attr(ZeroToHeroAbAttr, p => true ? 1 : 0),
|
.attr(PreSwitchOutFormChangeAbAttr, p => p.getFormKey() ? 1 : 0)
|
||||||
|
.attr(PostBattleInitFormChangeAbAttr, p => p.battleData.switchesMade === 0 ? 0 : 1)
|
||||||
|
.attr(PostSummonFormChangeAbAttr,p => p.battleData.switchesMade === 0 ? 0 : 1),
|
||||||
new Ability(Abilities.COMMANDER, 9)
|
new Ability(Abilities.COMMANDER, 9)
|
||||||
.attr(UncopiableAbilityAbAttr)
|
.attr(UncopiableAbilityAbAttr)
|
||||||
.attr(UnswappableAbilityAbAttr)
|
.attr(UnswappableAbilityAbAttr)
|
||||||
|
@ -683,6 +683,7 @@ export const pokemonFormChanges: PokemonFormChanges = {
|
|||||||
],
|
],
|
||||||
[Species.PALAFIN]: [
|
[Species.PALAFIN]: [
|
||||||
new SpeciesFormChange(Species.PALAFIN, 'zero', 'hero', new SpeciesFormChangeManualTrigger(), true),
|
new SpeciesFormChange(Species.PALAFIN, 'zero', 'hero', new SpeciesFormChangeManualTrigger(), true),
|
||||||
|
new SpeciesFormChange(Species.PALAFIN, 'hero', 'zero', new SpeciesFormChangeManualTrigger(), true),
|
||||||
],
|
],
|
||||||
[Species.OGERPON]: [
|
[Species.OGERPON]: [
|
||||||
new SpeciesFormChange(Species.OGERPON, 'teal-mask', 'wellspring-mask', new SpeciesFormChangeItemTrigger(FormChangeItem.WELLSPRING_MASK)),
|
new SpeciesFormChange(Species.OGERPON, 'teal-mask', 'wellspring-mask', new SpeciesFormChangeItemTrigger(FormChangeItem.WELLSPRING_MASK)),
|
||||||
|
@ -3036,6 +3036,7 @@ export class PokemonBattleData {
|
|||||||
public hitCount: integer = 0;
|
public hitCount: integer = 0;
|
||||||
public endured: boolean = false;
|
public endured: boolean = false;
|
||||||
public berriesEaten: BerryType[] = [];
|
public berriesEaten: BerryType[] = [];
|
||||||
|
public switchesMade: integer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PokemonBattleSummonData {
|
export class PokemonBattleSummonData {
|
||||||
|
@ -1433,6 +1433,7 @@ export class SwitchSummonPhase extends SummonPhase {
|
|||||||
if (this.batonPass && pokemon)
|
if (this.batonPass && pokemon)
|
||||||
pokemon.transferSummon(this.lastPokemon);
|
pokemon.transferSummon(this.lastPokemon);
|
||||||
|
|
||||||
|
this.lastPokemon.battleData.switchesMade++;
|
||||||
this.lastPokemon?.resetSummonData();
|
this.lastPokemon?.resetSummonData();
|
||||||
|
|
||||||
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);
|
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user