Remove Cosmoem time conditions, add Gimmighoul tracker

This commit is contained in:
AJ Fontaine 2024-09-04 21:37:01 -04:00
parent 3e2150d6d1
commit 1325ea3132
4 changed files with 44 additions and 2 deletions

View File

@ -992,8 +992,8 @@ export const pokemonEvolutions: PokemonEvolutions = {
new SpeciesEvolution(Species.COSMOEM, 23, null, null)
],
[Species.COSMOEM]: [
new SpeciesEvolution(Species.SOLGALEO, 53, EvolutionItem.SUN_FLUTE, new SpeciesEvolutionCondition(p => p.scene.arena.getTimeOfDay() === TimeOfDay.DAWN || p.scene.arena.getTimeOfDay() === TimeOfDay.DAY), SpeciesWildEvolutionDelay.VERY_LONG),
new SpeciesEvolution(Species.LUNALA, 53, EvolutionItem.MOON_FLUTE, new SpeciesEvolutionCondition(p => p.scene.arena.getTimeOfDay() === TimeOfDay.DUSK || p.scene.arena.getTimeOfDay() === TimeOfDay.NIGHT), SpeciesWildEvolutionDelay.VERY_LONG)
new SpeciesEvolution(Species.SOLGALEO, 53, EvolutionItem.SUN_FLUTE, null, SpeciesWildEvolutionDelay.VERY_LONG),
new SpeciesEvolution(Species.LUNALA, 53, EvolutionItem.MOON_FLUTE, null, SpeciesWildEvolutionDelay.VERY_LONG)
],
[Species.MELTAN]: [
new SpeciesEvolution(Species.MELMETAL, 48, null, null)

View File

@ -222,6 +222,8 @@
"TOXIC_ORB": { "name": "Toxic Orb", "description": "It's a bizarre orb that exudes toxins when touched and will badly poison the holder during battle." },
"FLAME_ORB": { "name": "Flame Orb", "description": "It's a bizarre orb that gives off heat when touched and will affect the holder with a burn during battle." },
"EVOLUTION_TRACKER_GIMMIGHOUL": { "name": "Treasures", "description": "This Pokémon loves treasure! Keep collecting treasure and something might happen!"},
"BATON": { "name": "Baton", "description": "Allows passing along effects when switching Pokémon, which also bypasses traps." },
"SHINY_CHARM": { "name": "Shiny Charm", "description": "Dramatically increases the chance of a wild Pokémon being Shiny." },

View File

@ -1313,6 +1313,8 @@ export const modifierTypes = {
FORM_CHANGE_ITEM: () => new FormChangeItemModifierTypeGenerator(false),
RARE_FORM_CHANGE_ITEM: () => new FormChangeItemModifierTypeGenerator(true),
EVOLUTION_TRACKER_GIMMIGHOUL: () => new PokemonHeldItemModifierType("modifierType:ModifierType.EVOLUTION_TRACKER_GIMMIGHOUL", "nugget", (type, _args) => new Modifiers.EvoTrackerModifier(type, (_args[0] as Pokemon).id, Species.GIMMIGHOUL, 10)),
MEGA_BRACELET: () => new ModifierType("modifierType:ModifierType.MEGA_BRACELET", "mega_bracelet", (type, _args) => new Modifiers.MegaEvolutionAccessModifier(type)),
DYNAMAX_BAND: () => new ModifierType("modifierType:ModifierType.DYNAMAX_BAND", "dynamax_band", (type, _args) => new Modifiers.GigantamaxAccessModifier(type)),
TERA_ORB: () => new ModifierType("modifierType:ModifierType.TERA_ORB", "tera_orb", (type, _args) => new Modifiers.TerastallizeAccessModifier(type)),

View File

@ -830,6 +830,41 @@ export class BaseStatModifier extends PokemonHeldItemModifier {
}
}
export class EvoTrackerModifier extends PokemonHeldItemModifier {
protected species: Species;
protected required: integer;
readonly isTransferrable: boolean = false;
constructor(type: ModifierType, pokemonId: integer, species: Species, required: integer, stackCount?: integer) {
super(type, pokemonId, stackCount);
this.species = species;
this.required = required;
}
matchType(modifier: Modifier): boolean {
if (modifier instanceof EvoTrackerModifier) {
return (modifier as EvoTrackerModifier).species === this.species;
}
return false;
}
clone(): PersistentModifier {
return new EvoTrackerModifier(this.type, this.pokemonId, this.species, this.stackCount);
}
getArgs(): any[] {
return super.getArgs().concat(this.species);
}
apply(args: any[]): boolean {
return true;
}
getMaxHeldItemCount(_pokemon: Pokemon): integer {
return this.required;
}
}
/**
* Modifier used for held items that apply {@linkcode Stat} boost(s)
* using a multiplier.
@ -2202,6 +2237,9 @@ export class MoneyRewardModifier extends ConsumableModifier {
scene.getParty().map(p => {
if (p.species?.speciesId === Species.GIMMIGHOUL || p.fusionSpecies?.speciesId === Species.GIMMIGHOUL) {
p.evoCounter++;
const modifierType: ModifierType = modifierTypes.EVOLUTION_TRACKER_GIMMIGHOUL();
const modifier = modifierType!.newModifier(p);
scene.addModifier(modifier);
}
});