mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
fix: fusions with gender evo condition can now evolve
This commit is contained in:
parent
b7cee4b313
commit
4718a59f0e
@ -166,7 +166,7 @@ export class SpeciesEvolutionCondition {
|
|||||||
return this.desc;
|
return this.desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public conditionsFulfilled(pokemon: Pokemon): boolean {
|
public conditionsFulfilled(pokemon: Pokemon, forFusion = false): boolean {
|
||||||
console.log(this.data);
|
console.log(this.data);
|
||||||
return this.data.every(cond => {
|
return this.data.every(cond => {
|
||||||
switch (cond.key) {
|
switch (cond.key) {
|
||||||
@ -186,7 +186,7 @@ export class SpeciesEvolutionCondition {
|
|||||||
m.getStackCount() + pokemon.getPersistentTreasureCount() >= cond.value
|
m.getStackCount() + pokemon.getPersistentTreasureCount() >= cond.value
|
||||||
);
|
);
|
||||||
case EvoCondKey.GENDER:
|
case EvoCondKey.GENDER:
|
||||||
return pokemon.gender === cond.gender;
|
return cond.gender === (forFusion ? pokemon.fusionGender : pokemon.gender);
|
||||||
case EvoCondKey.SHEDINJA: // Shedinja cannot be evolved into directly
|
case EvoCondKey.SHEDINJA: // Shedinja cannot be evolved into directly
|
||||||
return false;
|
return false;
|
||||||
case EvoCondKey.BIOME:
|
case EvoCondKey.BIOME:
|
||||||
@ -293,7 +293,7 @@ export class SpeciesFormEvolution {
|
|||||||
pokemon.level >= this.level &&
|
pokemon.level >= this.level &&
|
||||||
// Check form key, using the fusion's form key if we're checking the fusion
|
// Check form key, using the fusion's form key if we're checking the fusion
|
||||||
(this.preFormKey == null || (forFusion ? pokemon.getFusionFormKey() : pokemon.getFormKey()) === this.preFormKey) &&
|
(this.preFormKey == null || (forFusion ? pokemon.getFusionFormKey() : pokemon.getFormKey()) === this.preFormKey) &&
|
||||||
(this.condition == null || this.condition.conditionsFulfilled(pokemon)) &&
|
(this.condition == null || this.condition.conditionsFulfilled(pokemon, forFusion)) &&
|
||||||
((item ?? EvolutionItem.NONE) === (this.item ?? EvolutionItem.NONE))
|
((item ?? EvolutionItem.NONE) === (this.item ?? EvolutionItem.NONE))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -2635,7 +2635,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
e => new FusionSpeciesFormEvolution(this.species.speciesId, e),
|
e => new FusionSpeciesFormEvolution(this.species.speciesId, e),
|
||||||
);
|
);
|
||||||
for (const fe of fusionEvolutions) {
|
for (const fe of fusionEvolutions) {
|
||||||
if (fe.validate(this)) {
|
if (fe.validate(this, true)) {
|
||||||
return fe;
|
return fe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user