From f48464d48dc9b8a825f5bd1a9061f0181d2b7277 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 29 Feb 2024 20:08:50 -0500 Subject: [PATCH] Minor refactoring --- public/images/items/max_repel.png | Bin 0 -> 277 bytes public/images/items/repel.png | Bin 0 -> 277 bytes public/images/items/super_repel.png | Bin 0 -> 276 bytes src/battle-scene.ts | 12 +-- src/battle.ts | 4 +- src/data/ability.ts | 2 +- src/data/arena-tag.ts | 4 +- src/data/battle-anims.ts | 2 +- src/data/battler-tags.ts | 2 +- src/data/berry.ts | 2 +- src/data/move.ts | 2 +- src/data/pokemon-evolutions.ts | 2 +- src/data/pokemon-forms.ts | 2 +- src/data/trainer-config.ts | 2 +- src/data/weather.ts | 2 +- src/egg-hatch-phase.ts | 2 +- src/evolution-phase.ts | 4 +- src/{ => field}/anims.ts | 6 +- src/{ => field}/arena.ts | 36 ++++----- .../pokemon-sprite-sparkle-handler.ts | 2 +- src/{ => field}/pokemon.ts | 76 +++++++++--------- src/{ => field}/trainer.ts | 14 ++-- src/form-change-phase.ts | 2 +- src/messages.ts | 2 +- src/modifier/modifier-type.ts | 6 +- src/modifier/modifier.ts | 2 +- src/phases.ts | 6 +- src/pipelines/sprite.ts | 4 +- src/system/arena-data.ts | 2 +- src/system/game-data.ts | 2 +- src/system/pokemon-data.ts | 2 +- src/system/trainer-data.ts | 2 +- src/ui/ability-bar.ts | 2 +- src/ui/battle-info.ts | 2 +- src/ui/egg-list-ui-handler.ts | 2 +- src/ui/party-exp-bar.ts | 2 +- src/ui/party-ui-handler.ts | 4 +- src/ui/pokeball-tray.ts | 2 +- .../pokemon-icon-anim-handler.ts | 0 src/ui/starter-select-ui-handler.ts | 2 +- src/ui/summary-ui-handler.ts | 2 +- 41 files changed, 115 insertions(+), 111 deletions(-) create mode 100644 public/images/items/max_repel.png create mode 100644 public/images/items/repel.png create mode 100644 public/images/items/super_repel.png rename src/{ => field}/anims.ts (97%) rename src/{ => field}/arena.ts (95%) rename src/{sprite => field}/pokemon-sprite-sparkle-handler.ts (98%) rename src/{ => field}/pokemon.ts (97%) rename src/{ => field}/trainer.ts (96%) rename src/{sprite => ui}/pokemon-icon-anim-handler.ts (100%) diff --git a/public/images/items/max_repel.png b/public/images/items/max_repel.png new file mode 100644 index 0000000000000000000000000000000000000000..d8bef707913bc73314c1911af060c0e1ea018c57 GIT binary patch literal 277 zcmV+w0qXvVP)Dy-sE1IqWK(8j=SAk4t}oD1`9EDSXOL2p1! z&<&_q%K#W_K%|O=7^s@jrvknS(f5G;7g+JoQ{X!w^%S&BeCq?$I|1lLm0@?opI%Bk bI?l!m?TziG@Ww+B00000NkvXXu0mjf4o-82 literal 0 HcmV?d00001 diff --git a/public/images/items/repel.png b/public/images/items/repel.png new file mode 100644 index 0000000000000000000000000000000000000000..3d1359e688e2c447000cacf940ba62694e33b356 GIT binary patch literal 277 zcmV+w0qXvVP) z!3l&g6htjyOGpbj+J?t%#S+qvSC5vkEu;;X35?8s!k+wpS;)YE3F5q;=r_|eH1v;3 zDV;rsg+s4eKMaLHAY?m^(+YF$09 zF%H8Z5Cr`c{^&AKp!G9SrgiDkrN6)v+!8IyS;q;b@?I3_R$9p*H1s%y2I!*1NIQ2?*aWU(BZCMfjt4KU%?3C+c`kJ6Tmi9>~=T&>7_Ij ax?6Ak8tki_p%6j<0000 new PokemonPpUpModifierType('PP Up', 1), PP_MAX: () => new PokemonPpUpModifierType('PP Max', 3), + /*REPEL: () => new DoubleBattleChanceBoosterModifierType('Repel', 5), + SUPER_REPEL: () => new DoubleBattleChanceBoosterModifierType('Super Repel', 10), + MAX_REPEL: () => new DoubleBattleChanceBoosterModifierType('Max Repel', 25),*/ + LURE: () => new DoubleBattleChanceBoosterModifierType('Lure', 5), SUPER_LURE: () => new DoubleBattleChanceBoosterModifierType('Super Lure', 10), MAX_LURE: () => new DoubleBattleChanceBoosterModifierType('Max Lure', 25), diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index ae62e989a..a14df4879 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -3,7 +3,7 @@ import { LearnMovePhase, LevelUpPhase, ObtainStatusEffectPhase, PokemonHealPhase import BattleScene from "../battle-scene"; import { getLevelTotalExp } from "../data/exp"; import { PokeballType } from "../data/pokeball"; -import Pokemon, { PlayerPokemon } from "../pokemon"; +import Pokemon, { PlayerPokemon } from "../field/pokemon"; import { Stat } from "../data/pokemon-stat"; import { addTextObject, TextStyle } from "../ui/text"; import { Type } from '../data/type'; diff --git a/src/phases.ts b/src/phases.ts index 91a548b0a..36a8345e1 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -1,5 +1,5 @@ import BattleScene, { bypassLogin, startingLevel, startingWave } from "./battle-scene"; -import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./pokemon"; +import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon"; import * as Utils from './utils'; import { Moves } from "./data/enums/moves"; import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveCategory, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr } from "./data/move"; @@ -32,7 +32,7 @@ import { ArenaTagSide, ArenaTrapTag, MistTag, TrickRoomTag } from "./data/arena- import { ArenaTagType } from "./data/enums/arena-tag-type"; import { Abilities, CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, PostAttackAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreSwitchOutAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, RunSuccessAbAttr, StatChangeMultiplierAbAttr, SuppressWeatherEffectAbAttr, SyncEncounterNatureAbAttr, applyAbAttrs, applyCheckTrappedAbAttrs, applyPostAttackAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreSwitchOutAbAttrs, applyPreWeatherEffectAbAttrs } from "./data/ability"; import { Unlockables, getUnlockableName } from "./system/unlockables"; -import { getBiomeKey } from "./arena"; +import { getBiomeKey } from "./field/arena"; import { BattleType, BattlerIndex, TurnCommand } from "./battle"; import { BattleSpec } from "./enums/battle-spec"; import { GameMode } from "./game-mode"; @@ -45,7 +45,7 @@ import { Egg } from "./data/egg"; import { vouchers } from "./system/voucher"; import { loggedInUser, updateUserInfo } from "./account"; import { GameDataType, PlayerGender } from "./system/game-data"; -import { addPokeballCaptureStars, addPokeballOpenParticles } from "./anims"; +import { addPokeballCaptureStars, addPokeballOpenParticles } from "./field/anims"; import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeManualTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangeMoveUsedTrigger } from "./data/pokemon-forms"; import { battleSpecDialogue, getCharVariantFromDialogue } from "./data/dialogue"; import ModifierSelectUiHandler, { SHOP_OPTIONS_ROW_LIMIT } from "./ui/modifier-select-ui-handler"; diff --git a/src/pipelines/sprite.ts b/src/pipelines/sprite.ts index 4cba0bcb9..434672156 100644 --- a/src/pipelines/sprite.ts +++ b/src/pipelines/sprite.ts @@ -1,5 +1,5 @@ -import Pokemon from "../pokemon"; -import Trainer from "../trainer"; +import Pokemon from "../field/pokemon"; +import Trainer from "../field/trainer"; import FieldSpritePipeline from "./field-sprite"; const spriteFragShader = ` diff --git a/src/system/arena-data.ts b/src/system/arena-data.ts index e7f859688..4d5fb10e8 100644 --- a/src/system/arena-data.ts +++ b/src/system/arena-data.ts @@ -1,4 +1,4 @@ -import { Arena } from "../arena"; +import { Arena } from "../field/arena"; import { ArenaTag } from "../data/arena-tag"; import { Biome } from "../data/enums/biome"; import { Weather } from "../data/weather"; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index a06ebe127..3a571ef0c 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1,5 +1,5 @@ import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene"; -import Pokemon, { EnemyPokemon, PlayerPokemon } from "../pokemon"; +import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon"; import { pokemonPrevolutions } from "../data/pokemon-evolutions"; import PokemonSpecies, { allSpecies, getPokemonSpecies, speciesStarters } from "../data/pokemon-species"; import { Species } from "../data/enums/species"; diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index 46cd439b0..ff63237e8 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -7,7 +7,7 @@ import { PokeballType } from "../data/pokeball"; import { getPokemonSpecies } from "../data/pokemon-species"; import { Species } from "../data/enums/species"; import { Status } from "../data/status-effect"; -import Pokemon, { EnemyPokemon, PokemonMove, PokemonSummonData } from "../pokemon"; +import Pokemon, { EnemyPokemon, PokemonMove, PokemonSummonData } from "../field/pokemon"; export default class PokemonData { public id: integer; diff --git a/src/system/trainer-data.ts b/src/system/trainer-data.ts index c4b4b8d0c..07e9c846a 100644 --- a/src/system/trainer-data.ts +++ b/src/system/trainer-data.ts @@ -1,6 +1,6 @@ import BattleScene from "../battle-scene"; import { TrainerType } from "../data/enums/trainer-type"; -import Trainer from "../trainer"; +import Trainer from "../field/trainer"; export default class TrainerData { public trainerType: TrainerType; diff --git a/src/ui/ability-bar.ts b/src/ui/ability-bar.ts index 85f1a1f19..c7e771af9 100644 --- a/src/ui/ability-bar.ts +++ b/src/ui/ability-bar.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import Pokemon from "../pokemon"; +import Pokemon from "../field/pokemon"; import { TextStyle, addTextObject } from "./text"; const hiddenX = -91; diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 2d46edad6..62bee2e5b 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -1,4 +1,4 @@ -import { EnemyPokemon, default as Pokemon } from '../pokemon'; +import { EnemyPokemon, default as Pokemon } from '../field/pokemon'; import { getLevelTotalExp, getLevelRelExp } from '../data/exp'; import * as Utils from '../utils'; import { addTextObject, TextStyle } from './text'; diff --git a/src/ui/egg-list-ui-handler.ts b/src/ui/egg-list-ui-handler.ts index eebabf2f0..489566651 100644 --- a/src/ui/egg-list-ui-handler.ts +++ b/src/ui/egg-list-ui-handler.ts @@ -1,6 +1,6 @@ import BattleScene, { Button } from "../battle-scene"; import { Mode } from "./ui"; -import PokemonIconAnimHandler, { PokemonIconAnimMode } from "../sprite/pokemon-icon-anim-handler"; +import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; import { TextStyle, addTextObject } from "./text"; import MessageUiHandler from "./message-ui-handler"; import { EGG_SEED, Egg, GachaType, getEggGachaTypeDescriptor, getEggHatchWavesMessage, getEggDescriptor } from "../data/egg"; diff --git a/src/ui/party-exp-bar.ts b/src/ui/party-exp-bar.ts index ad5663e27..1d4734c3b 100644 --- a/src/ui/party-exp-bar.ts +++ b/src/ui/party-exp-bar.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import Pokemon from "../pokemon"; +import Pokemon from "../field/pokemon"; import { TextStyle, addTextObject } from "./text"; export default class PartyExpBar extends Phaser.GameObjects.Container { diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 8598d1dd7..a8be33b87 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -1,6 +1,6 @@ import { CommandPhase } from "../phases"; import BattleScene, { Button } from "../battle-scene"; -import { PlayerPokemon, PokemonMove } from "../pokemon"; +import { PlayerPokemon, PokemonMove } from "../field/pokemon"; import { addTextObject, TextStyle } from "./text"; import { Command } from "./command-ui-handler"; import MessageUiHandler from "./message-ui-handler"; @@ -11,7 +11,7 @@ import { allMoves } from "../data/move"; import { Moves } from "../data/enums/moves"; import { getGenderColor, getGenderSymbol } from "../data/gender"; import { StatusEffect } from "../data/status-effect"; -import PokemonIconAnimHandler, { PokemonIconAnimMode } from "../sprite/pokemon-icon-anim-handler"; +import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; import { pokemonEvolutions } from "../data/pokemon-evolutions"; import { addWindow } from "./window"; import { SpeciesFormChangeItemTrigger } from "../data/pokemon-forms"; diff --git a/src/ui/pokeball-tray.ts b/src/ui/pokeball-tray.ts index 0acfcff6a..cc2bd21cb 100644 --- a/src/ui/pokeball-tray.ts +++ b/src/ui/pokeball-tray.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import Pokemon from "../pokemon"; +import Pokemon from "../field/pokemon"; export default class PokeballTray extends Phaser.GameObjects.Container { private player: boolean; diff --git a/src/sprite/pokemon-icon-anim-handler.ts b/src/ui/pokemon-icon-anim-handler.ts similarity index 100% rename from src/sprite/pokemon-icon-anim-handler.ts rename to src/ui/pokemon-icon-anim-handler.ts diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index aace255ee..5f4d5fde1 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -11,7 +11,7 @@ import { Unlockables } from "../system/unlockables"; import { GrowthRate, getGrowthRateColor } from "../data/exp"; import { DexAttr, DexEntry, StarterFormMoveData, StarterMoveset } from "../system/game-data"; import * as Utils from "../utils"; -import PokemonIconAnimHandler, { PokemonIconAnimMode } from "../sprite/pokemon-icon-anim-handler"; +import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; import { StatsContainer } from "./stats-container"; import { addWindow } from "./window"; import { Nature, getNatureName } from "../data/nature"; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index e8923d93c..8cdbdc3d6 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -2,7 +2,7 @@ import BattleScene, { Button } from "../battle-scene"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import * as Utils from "../utils"; -import { PlayerPokemon } from "../pokemon"; +import { PlayerPokemon } from "../field/pokemon"; import { Type, getTypeRgb } from "../data/type"; import { TextStyle, addBBCodeTextObject, addTextObject, getBBCodeFrag, getTextColor } from "./text"; import Move, { MoveCategory } from "../data/move";