Add map item for selecting biome
parent
998972e12b
commit
f790a5ff2a
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Binary file not shown.
After Width: | Height: | Size: 746 B |
|
@ -5,7 +5,7 @@ import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, HitsTagAttr, Mis
|
||||||
import { Mode } from './ui/ui';
|
import { Mode } from './ui/ui';
|
||||||
import { Command } from "./ui/command-ui-handler";
|
import { Command } from "./ui/command-ui-handler";
|
||||||
import { Stat } from "./data/pokemon-stat";
|
import { Stat } from "./data/pokemon-stat";
|
||||||
import { BerryModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, HealingBoosterModifier, HeldItemTransferModifier, HitHealModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, TempBattleStatBoosterModifier, TurnHealModifier } from "./modifier/modifier";
|
import { BerryModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, HealingBoosterModifier, HeldItemTransferModifier, HitHealModifier, MapModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, TempBattleStatBoosterModifier, TurnHealModifier } from "./modifier/modifier";
|
||||||
import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler";
|
import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler";
|
||||||
import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, PokeballType } from "./data/pokeball";
|
import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, PokeballType } from "./data/pokeball";
|
||||||
import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims";
|
import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims";
|
||||||
|
@ -202,13 +202,17 @@ export class SelectBiomePhase extends BattlePhase {
|
||||||
|
|
||||||
if (this.scene.currentBattle.waveIndex === this.scene.finalWave - 9)
|
if (this.scene.currentBattle.waveIndex === this.scene.finalWave - 9)
|
||||||
setNextBiome(Biome.END);
|
setNextBiome(Biome.END);
|
||||||
else if (Array.isArray(biomeLinks[currentBiome]))
|
else if (Array.isArray(biomeLinks[currentBiome])) {
|
||||||
|
const biomes = biomeLinks[currentBiome] as Biome[];
|
||||||
|
if (this.scene.findModifier(m => m instanceof MapModifier)) {
|
||||||
this.scene.ui.setMode(Mode.BIOME_SELECT, currentBiome, (biomeIndex: integer) => {
|
this.scene.ui.setMode(Mode.BIOME_SELECT, currentBiome, (biomeIndex: integer) => {
|
||||||
this.scene.ui.setMode(Mode.MESSAGE);
|
this.scene.ui.setMode(Mode.MESSAGE);
|
||||||
setNextBiome((biomeLinks[currentBiome] as Biome[])[biomeIndex]);
|
setNextBiome(biomes[biomeIndex]);
|
||||||
});
|
});
|
||||||
else
|
} else
|
||||||
setNextBiome(biomeLinks[currentBiome] as Biome)
|
setNextBiome(biomes[Utils.randInt(biomes.length)]);
|
||||||
|
} else
|
||||||
|
setNextBiome(biomeLinks[currentBiome] as Biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -465,6 +465,8 @@ const modifierTypes = {
|
||||||
|
|
||||||
EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(),
|
EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(),
|
||||||
|
|
||||||
|
MAP: () => new ModifierType('MAP', 'Allows you to choose your destination at a crossroads', (type, _args) => new Modifiers.MapModifier(type)),
|
||||||
|
|
||||||
POTION: () => new PokemonHpRestoreModifierType('POTION', 20),
|
POTION: () => new PokemonHpRestoreModifierType('POTION', 20),
|
||||||
SUPER_POTION: () => new PokemonHpRestoreModifierType('SUPER POTION', 50),
|
SUPER_POTION: () => new PokemonHpRestoreModifierType('SUPER POTION', 50),
|
||||||
HYPER_POTION: () => new PokemonHpRestoreModifierType('HYPER POTION', 200),
|
HYPER_POTION: () => new PokemonHpRestoreModifierType('HYPER POTION', 200),
|
||||||
|
@ -581,7 +583,7 @@ const modifierPool = {
|
||||||
return thresholdPartyMemberCount;
|
return thresholdPartyMemberCount;
|
||||||
}),
|
}),
|
||||||
new WeightedModifierType(modifierTypes.TEMP_STAT_BOOSTER, 4),
|
new WeightedModifierType(modifierTypes.TEMP_STAT_BOOSTER, 4),
|
||||||
new WeightedModifierType(modifierTypes.BERRY, 20)
|
new WeightedModifierType(modifierTypes.BERRY, 2)
|
||||||
].map(m => { m.setTier(ModifierTier.COMMON); return m; }),
|
].map(m => { m.setTier(ModifierTier.COMMON); return m; }),
|
||||||
[ModifierTier.GREAT]: [
|
[ModifierTier.GREAT]: [
|
||||||
new WeightedModifierType(modifierTypes.GREAT_BALL, 6),
|
new WeightedModifierType(modifierTypes.GREAT_BALL, 6),
|
||||||
|
@ -616,6 +618,9 @@ const modifierPool = {
|
||||||
const thresholdPartyMemberCount = Math.min(party.filter(p => p.hp && p.moveset.filter(m => (m.getMove().pp - m.ppUsed) <= 5).length).length, 3);
|
const thresholdPartyMemberCount = Math.min(party.filter(p => p.hp && p.moveset.filter(m => (m.getMove().pp - m.ppUsed) <= 5).length).length, 3);
|
||||||
return thresholdPartyMemberCount;
|
return thresholdPartyMemberCount;
|
||||||
}),
|
}),
|
||||||
|
new WeightedModifierType(modifierTypes.MAP, (party: Pokemon[]) => {
|
||||||
|
return !party[0].scene.findModifier(m => m instanceof Modifiers.MapModifier) ? 1 : 0;
|
||||||
|
}),
|
||||||
new WeightedModifierType(modifierTypes.TM, 2),
|
new WeightedModifierType(modifierTypes.TM, 2),
|
||||||
new WeightedModifierType(modifierTypes.EXP_SHARE, (party: Pokemon[]) => party.filter(p => p.level < 100).length ? 1 : 0),
|
new WeightedModifierType(modifierTypes.EXP_SHARE, (party: Pokemon[]) => party.filter(p => p.level < 100).length ? 1 : 0),
|
||||||
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3)
|
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3)
|
||||||
|
|
|
@ -234,6 +234,24 @@ export class TempBattleStatBoosterModifier extends PersistentModifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class MapModifier extends PersistentModifier {
|
||||||
|
constructor(type: ModifierType, stackCount?: integer) {
|
||||||
|
super(type, stackCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
clone(): MapModifier {
|
||||||
|
return new MapModifier(this.type, this.stackCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
apply(args: any[]): boolean {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
getMaxStackCount(): number {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export abstract class PokemonHeldItemModifier extends PersistentModifier {
|
export abstract class PokemonHeldItemModifier extends PersistentModifier {
|
||||||
public pokemonId: integer;
|
public pokemonId: integer;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue