Add map item for selecting biome

This commit is contained in:
Flashfyre 2023-04-26 19:19:39 -04:00
parent 998972e12b
commit f790a5ff2a
6 changed files with 1458 additions and 1410 deletions

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

BIN
public/images/items/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

View File

@ -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])) {
this.scene.ui.setMode(Mode.BIOME_SELECT, currentBiome, (biomeIndex: integer) => { const biomes = biomeLinks[currentBiome] as Biome[];
this.scene.ui.setMode(Mode.MESSAGE); if (this.scene.findModifier(m => m instanceof MapModifier)) {
setNextBiome((biomeLinks[currentBiome] as Biome[])[biomeIndex]); this.scene.ui.setMode(Mode.BIOME_SELECT, currentBiome, (biomeIndex: integer) => {
}); this.scene.ui.setMode(Mode.MESSAGE);
else setNextBiome(biomes[biomeIndex]);
setNextBiome(biomeLinks[currentBiome] as Biome) });
} else
setNextBiome(biomes[Utils.randInt(biomes.length)]);
} else
setNextBiome(biomeLinks[currentBiome] as Biome);
} }
} }

View File

@ -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)

View File

@ -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;