Divide evolution items into common and rare
This commit is contained in:
parent
fa7c1684f7
commit
2b2b02ff2c
|
@ -24,6 +24,7 @@ export enum SpeciesWildEvolutionDelay {
|
||||||
|
|
||||||
export enum EvolutionItem {
|
export enum EvolutionItem {
|
||||||
NONE,
|
NONE,
|
||||||
|
|
||||||
LINKING_CORD,
|
LINKING_CORD,
|
||||||
SUN_STONE,
|
SUN_STONE,
|
||||||
MOON_STONE,
|
MOON_STONE,
|
||||||
|
@ -35,15 +36,16 @@ export enum EvolutionItem {
|
||||||
DUSK_STONE,
|
DUSK_STONE,
|
||||||
DAWN_STONE,
|
DAWN_STONE,
|
||||||
SHINY_STONE,
|
SHINY_STONE,
|
||||||
BLACK_AUGURITE,
|
|
||||||
CHIPPED_POT,
|
CHIPPED_POT,
|
||||||
CRACKED_POT,
|
CRACKED_POT,
|
||||||
GALARICA_CUFF,
|
|
||||||
GALARICA_WREATH,
|
|
||||||
PEAT_BLOCK,
|
|
||||||
SWEET_APPLE,
|
SWEET_APPLE,
|
||||||
TART_APPLE,
|
TART_APPLE,
|
||||||
STRAWBERRY_SWEET,
|
STRAWBERRY_SWEET,
|
||||||
|
|
||||||
|
BLACK_AUGURITE = 51,
|
||||||
|
GALARICA_CUFF,
|
||||||
|
GALARICA_WREATH,
|
||||||
|
PEAT_BLOCK,
|
||||||
AUSPICIOUS_ARMOR,
|
AUSPICIOUS_ARMOR,
|
||||||
MALICIOUS_ARMOR,
|
MALICIOUS_ARMOR,
|
||||||
MASTERPIECE_TEACUP,
|
MASTERPIECE_TEACUP,
|
||||||
|
|
|
@ -601,7 +601,7 @@ class TmModifierTypeGenerator extends ModifierTypeGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator {
|
class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator {
|
||||||
constructor() {
|
constructor(rare: boolean) {
|
||||||
super((party: Pokemon[], pregenArgs?: any[]) => {
|
super((party: Pokemon[], pregenArgs?: any[]) => {
|
||||||
if (pregenArgs)
|
if (pregenArgs)
|
||||||
return new EvolutionItemModifierType(pregenArgs[0] as EvolutionItem);
|
return new EvolutionItemModifierType(pregenArgs[0] as EvolutionItem);
|
||||||
|
@ -609,7 +609,7 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator {
|
||||||
const evolutionItemPool = party.filter(p => pokemonEvolutions.hasOwnProperty(p.species.speciesId)).map(p => {
|
const evolutionItemPool = party.filter(p => pokemonEvolutions.hasOwnProperty(p.species.speciesId)).map(p => {
|
||||||
const evolutions = pokemonEvolutions[p.species.speciesId];
|
const evolutions = pokemonEvolutions[p.species.speciesId];
|
||||||
return evolutions.filter(e => e.item !== EvolutionItem.NONE && (e.evoFormKey === null || (e.preFormKey || '') === p.getFormKey()) && (!e.condition || e.condition.predicate(p)));
|
return evolutions.filter(e => e.item !== EvolutionItem.NONE && (e.evoFormKey === null || (e.preFormKey || '') === p.getFormKey()) && (!e.condition || e.condition.predicate(p)));
|
||||||
}).flat().flatMap(e => e.item);
|
}).flat().flatMap(e => e.item).filter(i => (i <= 50) === rare);
|
||||||
|
|
||||||
if (!evolutionItemPool.length)
|
if (!evolutionItemPool.length)
|
||||||
return null;
|
return null;
|
||||||
|
@ -709,7 +709,8 @@ export const modifierTypes = {
|
||||||
RARE_CANDY: () => new PokemonLevelIncrementModifierType('Rare Candy'),
|
RARE_CANDY: () => new PokemonLevelIncrementModifierType('Rare Candy'),
|
||||||
RARER_CANDY: () => new AllPokemonLevelIncrementModifierType('Rarer Candy'),
|
RARER_CANDY: () => new AllPokemonLevelIncrementModifierType('Rarer Candy'),
|
||||||
|
|
||||||
EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(),
|
EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(false),
|
||||||
|
RARE_EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(true),
|
||||||
FORM_CHANGE_ITEM: () => new FormChangeItemModifierTypeGenerator(),
|
FORM_CHANGE_ITEM: () => new FormChangeItemModifierTypeGenerator(),
|
||||||
|
|
||||||
MEGA_BRACELET: () => new ModifierType('Mega Bracelet', 'Mega stones become available', (type, _args) => new Modifiers.MegaEvolutionAccessModifier(type)),
|
MEGA_BRACELET: () => new ModifierType('Mega Bracelet', 'Mega stones become available', (type, _args) => new Modifiers.MegaEvolutionAccessModifier(type)),
|
||||||
|
@ -957,6 +958,7 @@ const modifierPool: ModifierPool = {
|
||||||
}, 3),
|
}, 3),
|
||||||
new WeightedModifierType(modifierTypes.SUPER_LURE, 4),
|
new WeightedModifierType(modifierTypes.SUPER_LURE, 4),
|
||||||
new WeightedModifierType(modifierTypes.NUGGET, 5),
|
new WeightedModifierType(modifierTypes.NUGGET, 5),
|
||||||
|
new WeightedModifierType(modifierTypes.EVOLUTION_ITEM, 2),
|
||||||
new WeightedModifierType(modifierTypes.MAP, (party: Pokemon[]) => party[0].scene.gameMode.isClassic ? 1 : 0, 1),
|
new WeightedModifierType(modifierTypes.MAP, (party: Pokemon[]) => party[0].scene.gameMode.isClassic ? 1 : 0, 1),
|
||||||
new WeightedModifierType(modifierTypes.TM_GREAT, 2),
|
new WeightedModifierType(modifierTypes.TM_GREAT, 2),
|
||||||
new WeightedModifierType(modifierTypes.MEMORY_MUSHROOM, (party: Pokemon[]) => {
|
new WeightedModifierType(modifierTypes.MEMORY_MUSHROOM, (party: Pokemon[]) => {
|
||||||
|
@ -976,7 +978,7 @@ const modifierPool: ModifierPool = {
|
||||||
new WeightedModifierType(modifierTypes.BIG_NUGGET, 12),
|
new WeightedModifierType(modifierTypes.BIG_NUGGET, 12),
|
||||||
new WeightedModifierType(modifierTypes.PP_UP, 9),
|
new WeightedModifierType(modifierTypes.PP_UP, 9),
|
||||||
new WeightedModifierType(modifierTypes.PP_MAX, 3),
|
new WeightedModifierType(modifierTypes.PP_MAX, 3),
|
||||||
new WeightedModifierType(modifierTypes.EVOLUTION_ITEM, 16),
|
new WeightedModifierType(modifierTypes.RARE_EVOLUTION_ITEM, 8),
|
||||||
new WeightedModifierType(modifierTypes.AMULET_COIN, 3),
|
new WeightedModifierType(modifierTypes.AMULET_COIN, 3),
|
||||||
new WeightedModifierType(modifierTypes.REVIVER_SEED, 4),
|
new WeightedModifierType(modifierTypes.REVIVER_SEED, 4),
|
||||||
new WeightedModifierType(modifierTypes.CANDY_JAR, 5),
|
new WeightedModifierType(modifierTypes.CANDY_JAR, 5),
|
||||||
|
|
Loading…
Reference in New Issue