Browse Source

Added scripts to download Pokemon sprites, Dream World artwork, Global Link artwork, and Sugimori's artwork

old
Jean 11 months ago
parent
commit
a87b9c568c
Signed by: easthighNerd <jean@easthighnerd.net> GPG Key ID: F4B3EACD21AEFFF4
4 changed files with 672 additions and 0 deletions
  1. +47
    -0
      pokemon-dream_world.sh
  2. +65
    -0
      pokemon-global_link.sh
  3. +495
    -0
      pokemon-sprites.sh
  4. +65
    -0
      pokemon-sugimori.sh

+ 47
- 0
pokemon-dream_world.sh View File

@@ -0,0 +1,47 @@
#!/bin/bash
set -euo pipefail


DOWNLOAD_DIR="${HOME}/Downloads"
DREAM_WORLD_DIR="${HOME}/Projects/Website/res/img"

if [[ ! -d "${DOWNLOAD_DIR}" ]]; then
echo -e "\nCreating ${DOWNLOAD_DIR}..."
mkdir -p "${DOWNLOAD_DIR}"
echo -e "\n${DOWNLOAD_DIR} created"
fi

if [[ ! -d "${DREAM_WORLD_DIR}" ]]; then
echo -e "\nCreating ${DREAM_WORLD_DIR}..."
mkdir -p "${DREAM_WORLD_DIR}"
echo -e "\n${DREAM_WORLD_DIR} created"
fi


if [[ ! -f "${DOWNLOAD_DIR}/pokemon-dream-world.tar.gz" ]]; then
echo -e "\nDownloading pokemon-dream-world.tar.gz...\n"
wget --continue --no-verbose --show-progress -P "${DOWNLOAD_DIR}/" https://veekun.com/static/pokedex/downloads/pokemon-dream-world.tar.gz
echo -e "\npokemon-dream-world.tar.gz downloaded"
fi

echo -e "\nUnpacking ${DOWNLOAD_DIR}/pokemon-dream-world.tar.gz into ${DREAM_WORLD_DIR}..."
tar -xf "${DOWNLOAD_DIR}/pokemon-dream-world.tar.gz" -C "${DREAM_WORLD_DIR}"
echo -e "\n${DOWNLOAD_DIR}/pokemon-dream-world.tar.gz unpacked"

DEX_NUMBER="1"

echo -e "\nRenaming Dream World files..."

while [[ "${DEX_NUMBER}" -le "9" ]]; do
mv "${DREAM_WORLD_DIR}"/pokemon/dream-world/{,00}${DEX_NUMBER}.svg

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

while [[ "${DEX_NUMBER}" -le "99" ]]; do
mv "${DREAM_WORLD_DIR}"/pokemon/dream-world/{,0}${DEX_NUMBER}.svg

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

echo -e "\nDream World files renamed"

+ 65
- 0
pokemon-global_link.sh View File

@@ -0,0 +1,65 @@
#!/bin/bash
set -euo pipefail


DOWNLOAD_DIR="${HOME}/Downloads"
GLOBAL_LINK_DIR="${HOME}/Projects/Website/res/img"

if [[ ! -d "${DOWNLOAD_DIR}" ]]; then
echo -e "\nCreating ${DOWNLOAD_DIR}..."
mkdir -p "${DOWNLOAD_DIR}"
echo -e "\n${DOWNLOAD_DIR} created"
fi

if [[ ! -d "${GLOBAL_LINK_DIR}" ]]; then
echo -e "\nCreating ${GLOBAL_LINK_DIR}..."
mkdir -p "${GLOBAL_LINK_DIR}"
echo -e "\n${GLOBAL_LINK_DIR} created"
fi


if [[ ! -f "${DOWNLOAD_DIR}/pokemon-global-link.tar.gz" ]]; then
echo -e "\nDownloading pokemon-global-link.tar.gz...\n"
wget --continue --no-verbose --show-progress -P "${DOWNLOAD_DIR}/" https://veekun.com/static/pokedex/downloads/pokemon-global-link.tar.gz
echo -e "\npokemon-global-link.tar.gz downloaded"
fi

echo -e "\nUnpacking ${DOWNLOAD_DIR}/pokemon-global-link.tar.gz into ${GLOBAL_LINK_DIR}..."
tar -xf "${DOWNLOAD_DIR}/pokemon-global-link.tar.gz" -C "${GLOBAL_LINK_DIR}"
echo -e "\n${DOWNLOAD_DIR}/pokemon-global-link.tar.gz unpacked"

DEX_NUMBER="1"

echo -e "\nRenaming Global Link files..."

while [[ "${DEX_NUMBER}" -le "9" ]]; do
mv "${GLOBAL_LINK_DIR}"/pokemon/global-link/{,00}${DEX_NUMBER}.png
if [[ -f "${GLOBAL_LINK_DIR}/pokemon/global-link/${DEX_NUMBER}-mega.png" ]]; then
mv "${GLOBAL_LINK_DIR}"/pokemon/global-link/{,00}${DEX_NUMBER}-mega.png
fi
if [[ -f "${GLOBAL_LINK_DIR}/pokemon/global-link/${DEX_NUMBER}-mega-x.png" ]]; then
mv "${GLOBAL_LINK_DIR}"/pokemon/global-link/{,00}${DEX_NUMBER}-mega-x.png
fi
if [[ -f "${GLOBAL_LINK_DIR}/pokemon/global-link/${DEX_NUMBER}-mega-y.png" ]]; then
mv "${GLOBAL_LINK_DIR}"/pokemon/global-link/{,00}${DEX_NUMBER}-mega-y.png
fi

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

while [[ "${DEX_NUMBER}" -le "99" ]]; do
mv "${GLOBAL_LINK_DIR}"/pokemon/global-link/{,0}${DEX_NUMBER}.png
if [[ -f "${GLOBAL_LINK_DIR}/pokemon/global-link/${DEX_NUMBER}-mega.png" ]]; then
mv "${GLOBAL_LINK_DIR}"/pokemon/global-link/{,0}${DEX_NUMBER}-mega.png
fi
if [[ -f "${GLOBAL_LINK_DIR}/pokemon/global-link/${DEX_NUMBER}-mega-x.png" ]]; then
mv "${GLOBAL_LINK_DIR}"/pokemon/global-link/{,0}${DEX_NUMBER}-mega-x.png
fi
if [[ -f "${GLOBAL_LINK_DIR}/pokemon/global-link/${DEX_NUMBER}-mega-y.png" ]]; then
mv "${GLOBAL_LINK_DIR}"/pokemon/global-link/{,0}${DEX_NUMBER}-mega-y.png
fi

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

echo -e "\nGlobal Link files renamed"

+ 495
- 0
pokemon-sprites.sh View File

@@ -0,0 +1,495 @@
#!/bin/bash
set -euo pipefail


DOWNLOAD_DIR="${HOME}/Downloads"
POKEMON_SPRITES_DIR="${HOME}/Projects/Website/res/img"

if [[ ! -d "${DOWNLOAD_DIR}" ]]; then
echo -e "\nCreating ${DOWNLOAD_DIR}..."
mkdir -p "${DOWNLOAD_DIR}"
echo -e "\n${DOWNLOAD_DIR} created"
fi

if [[ ! -d "${POKEMON_SPRITES_DIR}" ]]; then
echo -e "\nCreating ${POKEMON_SPRITES_DIR}..."
mkdir -p "${POKEMON_SPRITES_DIR}"
echo -e "\n${POKEMON_SPRITES_DIR} created"
fi


# Generation I
if [[ ! -f "${DOWNLOAD_DIR}/pokemon-sprites-generation-1.tar.gz" ]]; then
echo -e "\nDownloading generation-1.tar.gz...\n"
wget --continue --no-verbose --show-progress -O "${DOWNLOAD_DIR}"/pokemon-sprites-generation-1.tar.gz https://veekun.com/static/pokedex/downloads/generation-1.tar.gz
echo -e "\ngeneration-1.tar.gz downloaded"
fi

echo -e "\nUnpacking ${DOWNLOAD_DIR}/pokemon-sprites-generation-1.tar.gz into ${POKEMON_SPRITES_DIR}..."
tar -xf "${DOWNLOAD_DIR}/pokemon-sprites-generation-1.tar.gz" -C "${POKEMON_SPRITES_DIR}"
echo -e "\n${DOWNLOAD_DIR}/pokemon-sprites-generation-1.tar.gz unpacked"

DEX_NUMBER="1"

echo -e "\nRenaming Generation I files..."

while [[ "${DEX_NUMBER}" -le "9" ]]; do
# Red/Green
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-green/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-green/back/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-green/back/gray/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-green/gray/{,00}${DEX_NUMBER}.png

# Red/Blue
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-blue/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-blue/back/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-blue/back/gray/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-blue/gray/{,00}${DEX_NUMBER}.png

# Yellow
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/back/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/back/gbc/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/back/gray/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/gbc/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/gray/{,00}${DEX_NUMBER}.png

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

while [[ "${DEX_NUMBER}" -le "99" ]]; do
# Red/Green
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-green/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-green/back/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-green/back/gray/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-green/gray/{,0}${DEX_NUMBER}.png

# Red/Blue
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-blue/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-blue/back/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-blue/back/gray/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/red-blue/gray/{,0}${DEX_NUMBER}.png

# Yellow
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/back/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/back/gbc/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/back/gray/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/gbc/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/yellow/gray/{,0}${DEX_NUMBER}.png

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

echo -e "\nGeneration I files renamed"


# Generation II
if [[ ! -f "${DOWNLOAD_DIR}/pokemon-sprites-generation-2.tar.gz" ]]; then
echo -e "\nDownloading generation-2.tar.gz...\n"
wget --continue --no-verbose --show-progress -O "${DOWNLOAD_DIR}"/pokemon-sprites-generation-2.tar.gz https://veekun.com/static/pokedex/downloads/generation-2.tar.gz
echo -e "\ngeneration-2.tar.gz downloaded"
fi

echo -e "\nUnpacking ${DOWNLOAD_DIR}/pokemon-sprites-generation-2.tar.gz into ${POKEMON_SPRITES_DIR}..."
tar -xf "${DOWNLOAD_DIR}/pokemon-sprites-generation-2.tar.gz" -C "${POKEMON_SPRITES_DIR}"
echo -e "\n${DOWNLOAD_DIR}/pokemon-sprites-generation-2.tar.gz unpacked"

DEX_NUMBER="1"

echo -e "\nRenaming Generation II files..."

while [[ "${DEX_NUMBER}" -le "9" ]]; do
# Gold
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/gold/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/gold/back/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/gold/back/shiny/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/gold/shiny/{,00}${DEX_NUMBER}.png

# Silver
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/silver/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/silver/back/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/silver/back/shiny/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/silver/shiny/{,00}${DEX_NUMBER}.png

# Crystal
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/back/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/back/shiny/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/shiny/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/animated/{,00}${DEX_NUMBER}.gif
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/animated/shiny/{,00}${DEX_NUMBER}.gif

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

while [[ "${DEX_NUMBER}" -le "99" ]]; do
# Gold
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/gold/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/gold/back/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/gold/back/shiny/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/gold/shiny/{,0}${DEX_NUMBER}.png

# Silver
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/silver/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/silver/back/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/silver/back/shiny/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/silver/shiny/{,0}${DEX_NUMBER}.png

# Crystal
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/back/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/back/shiny/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/shiny/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/animated/{,0}${DEX_NUMBER}.gif
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/crystal/animated/shiny/{,0}${DEX_NUMBER}.gif

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

echo -e "\nGeneration II files renamed"


# Generation III
if [[ ! -f "${DOWNLOAD_DIR}/pokemon-sprites-generation-3.tar.gz" ]]; then
echo -e "\nDownloading generation-3.tar.gz...\n"
wget --continue --no-verbose --show-progress -O "${DOWNLOAD_DIR}"/pokemon-sprites-generation-3.tar.gz https://veekun.com/static/pokedex/downloads/generation-3.tar.gz
echo -e "\ngeneration-3.tar.gz downloaded"
fi

echo -e "\nUnpacking ${DOWNLOAD_DIR}/pokemon-sprites-generation-3.tar.gz into ${POKEMON_SPRITES_DIR}..."
tar -xf "${DOWNLOAD_DIR}/pokemon-sprites-generation-3.tar.gz" -C "${POKEMON_SPRITES_DIR}"
echo -e "\n${DOWNLOAD_DIR}/pokemon-sprites-generation-3.tar.gz unpacked"

DEX_NUMBER="0"

echo -e "\nRenaming Generation III files..."

while [[ "${DEX_NUMBER}" -le "9" ]]; do
# Ruby/Sapphire
if [[ "${DEX_NUMBER}" -gt "0" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/ruby-sapphire/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/ruby-sapphire/back/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/ruby-sapphire/back/shiny/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/ruby-sapphire/shiny/{,00}${DEX_NUMBER}.png

if [[ "${DEX_NUMBER}" -gt "0" ]]; then
# Fire Red/Leaf Green
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/firered-leafgreen/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/firered-leafgreen/back/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/firered-leafgreen/back/shiny/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/firered-leafgreen/shiny/{,00}${DEX_NUMBER}.png

# Emerald
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/frame2/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/shiny/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/shiny/frame2/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/animated/{,00}${DEX_NUMBER}.gif
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/animated/shiny/{,00}${DEX_NUMBER}.gif
fi

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

while [[ "${DEX_NUMBER}" -le "99" ]]; do
# Ruby/Sapphire
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/ruby-sapphire/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/ruby-sapphire/back/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/ruby-sapphire/back/shiny/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/ruby-sapphire/shiny/{,0}${DEX_NUMBER}.png

# Fire Red/Leaf Green
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/firered-leafgreen/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/firered-leafgreen/back/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/firered-leafgreen/back/shiny/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/firered-leafgreen/shiny/{,0}${DEX_NUMBER}.png

# Emerald
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/frame2/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/shiny/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/shiny/frame2/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/animated/{,0}${DEX_NUMBER}.gif
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/emerald/animated/shiny/{,0}${DEX_NUMBER}.gif

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

echo -e "\nGeneration III files renamed"


# Generation IV
if [[ ! -f "${DOWNLOAD_DIR}/pokemon-sprites-generation-4.tar.gz" ]]; then
echo -e "\nDownloading generation-4.tar.gz...\n"
wget --continue --no-verbose --show-progress -O "${DOWNLOAD_DIR}"/pokemon-sprites-generation-4.tar.gz https://veekun.com/static/pokedex/downloads/generation-4.tar.gz
echo -e "\ngeneration-4.tar.gz downloaded"
fi


echo -e "\nUnpacking ${DOWNLOAD_DIR}/pokemon-sprites-generation-4.tar.gz into ${POKEMON_SPRITES_DIR}..."
tar -xf "${DOWNLOAD_DIR}/pokemon-sprites-generation-4.tar.gz" -C "${POKEMON_SPRITES_DIR}"
echo -e "\n${DOWNLOAD_DIR}/pokemon-sprites-generation-4.tar.gz unpacked"

DEX_NUMBER="1"

echo -e "\nRenaming Generation IV files..."

while [[ "${DEX_NUMBER}" -le "9" ]]; do
# Diamond/Pearl
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/back/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/frame2/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/back/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/back/female/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/back/shiny/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/back/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/back/shiny/female/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/shiny/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/shiny/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/shiny/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/shiny/frame2/{,00}${DEX_NUMBER}.png

# Platinum
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/frame2/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/back/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/back/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/frame2/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/shiny/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/back/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/shiny/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/back/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/shiny/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/shiny/frame2/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/shiny/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/shiny/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/shiny/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/shiny/frame2/{,00}${DEX_NUMBER}.png

# Heart Gold/Soul Silver
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/frame2/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/back/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/back/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/frame2/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/shiny/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/back/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/shiny/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/back/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/shiny/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/shiny/frame2/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/shiny/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/shiny/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/shiny/female/frame2/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/shiny/frame2/{,00}${DEX_NUMBER}.png

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

while [[ "${DEX_NUMBER}" -le "99" ]]; do
# Diamond/Pearl
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/back/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/frame2/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/back/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/back/female/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/back/shiny/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/back/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/back/shiny/female/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/shiny/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/shiny/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/diamond-pearl/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/shiny/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/diamond-pearl/shiny/frame2/{,0}${DEX_NUMBER}.png

# Platinum
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/frame2/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/back/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/back/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/frame2/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/shiny/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/back/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/shiny/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/back/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/shiny/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/back/shiny/frame2/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/shiny/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/shiny/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/platinum/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/shiny/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/platinum/shiny/frame2/{,0}${DEX_NUMBER}.png

# Heart Gold/Soul Silver
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/frame2/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/back/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/back/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/frame2/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/shiny/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/back/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/shiny/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/back/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/shiny/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/back/shiny/frame2/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/shiny/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/shiny/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/heartgold-soulsilver/shiny/female/frame2/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/shiny/female/frame2/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/heartgold-soulsilver/shiny/frame2/{,0}${DEX_NUMBER}.png

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

echo -e "\nGeneration IV files renamed"


# Generation V
if [[ ! -f "${DOWNLOAD_DIR}/pokemon-sprites-generation-5.tar.gz" ]]; then
echo -e "\nDownloading generation-5.tar.gz...\n"
wget --continue --no-verbose --show-progress -O "${DOWNLOAD_DIR}"/pokemon-sprites-generation-5.tar.gz https://veekun.com/static/pokedex/downloads/generation-5.tar.gz
echo -e "\ngeneration-5.tar.gz downloaded"
fi

echo -e "\nUnpacking ${DOWNLOAD_DIR}/pokemon-sprites-generation-5.tar.gz into ${POKEMON_SPRITES_DIR}..."
tar -xf "${DOWNLOAD_DIR}/pokemon-sprites-generation-5.tar.gz" -C "${POKEMON_SPRITES_DIR}"
echo -e "\n${DOWNLOAD_DIR}/pokemon-sprites-generation-5.tar.gz unpacked"

DEX_NUMBER="0"

echo -e "\nRenaming Generation V files..."

while [[ "${DEX_NUMBER}" -le "9" ]]; do
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/{,00}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/back/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/black-white/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/female/{,00}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/black-white/back/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/back/female/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/back/shiny/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/black-white/back/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/back/shiny/female/{,00}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/shiny/{,00}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/black-white/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/shiny/female/{,00}${DEX_NUMBER}.png
fi

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

while [[ "${DEX_NUMBER}" -le "99" ]]; do
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/{,0}${DEX_NUMBER}.png
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/back/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/black-white/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/female/{,0}${DEX_NUMBER}.png
fi
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/black-white/back/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/back/female/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/back/shiny/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/black-white/back/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/back/shiny/female/{,0}${DEX_NUMBER}.png
fi
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/shiny/{,0}${DEX_NUMBER}.png
if [[ -f "${POKEMON_SPRITES_DIR}/pokemon/main-sprites/black-white/shiny/female/${DEX_NUMBER}.png" ]]; then
mv "${POKEMON_SPRITES_DIR}"/pokemon/main-sprites/black-white/shiny/female/{,0}${DEX_NUMBER}.png
fi

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

echo -e "\nGeneration V files renamed"

+ 65
- 0
pokemon-sugimori.sh View File

@@ -0,0 +1,65 @@
#!/bin/bash
set -euo pipefail


DOWNLOAD_DIR="${HOME}/Downloads"
SUGIMORI_ART_DIR="${HOME}/Projects/Website/res/img"

if [[ ! -d "${DOWNLOAD_DIR}" ]]; then
echo -e "\nCreating ${DOWNLOAD_DIR}..."
mkdir -p "${DOWNLOAD_DIR}"
echo -e "\n${DOWNLOAD_DIR} created"
fi

if [[ ! -d "${SUGIMORI_ART_DIR}" ]]; then
echo -e "\nCreating ${SUGIMORI_ART_DIR}..."
mkdir -p "${SUGIMORI_ART_DIR}"
echo -e "\n${SUGIMORI_ART_DIR} created"
fi


if [[ ! -f "${DOWNLOAD_DIR}/pokemon-sugimori.tar.gz" ]]; then
echo -e "\nDownloading pokemon-sugimori.tar.gz...\n"
wget --continue --no-verbose --show-progress -P "${DOWNLOAD_DIR}/" https://veekun.com/static/pokedex/downloads/pokemon-sugimori.tar.gz
echo -e "\npokemon-sugimori.tar.gz downloaded"
fi

echo -e "\nUnpacking ${DOWNLOAD_DIR}/pokemon-sugimori.tar.gz into ${SUGIMORI_ART_DIR}..."
tar -xf "${DOWNLOAD_DIR}/pokemon-sugimori.tar.gz" -C "${SUGIMORI_ART_DIR}"
echo -e "\n${DOWNLOAD_DIR}/pokemon-sugimori.tar.gz unpacked"

DEX_NUMBER="1"

echo -e "\nRenaming Sugimori Artwork files..."

while [[ "${DEX_NUMBER}" -le "9" ]]; do
mv "${SUGIMORI_ART_DIR}"/pokemon/sugimori/{,00}${DEX_NUMBER}.png
if [[ -f "${SUGIMORI_ART_DIR}/pokemon/sugimori/${DEX_NUMBER}-mega.png" ]]; then
mv "${SUGIMORI_ART_DIR}"/pokemon/sugimori/{,00}${DEX_NUMBER}-mega.png
fi
if [[ -f "${SUGIMORI_ART_DIR}/pokemon/sugimori/${DEX_NUMBER}-mega-x.png" ]]; then
mv "${SUGIMORI_ART_DIR}"/pokemon/sugimori/{,00}${DEX_NUMBER}-mega-x.png
fi
if [[ -f "${SUGIMORI_ART_DIR}/pokemon/sugimori/${DEX_NUMBER}-mega-y.png" ]]; then
mv "${SUGIMORI_ART_DIR}"/pokemon/sugimori/{,00}${DEX_NUMBER}-mega-y.png
fi

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

while [[ "${DEX_NUMBER}" -le "99" ]]; do
mv "${SUGIMORI_ART_DIR}"/pokemon/sugimori/{,0}${DEX_NUMBER}.png
if [[ -f "${SUGIMORI_ART_DIR}/pokemon/sugimori/${DEX_NUMBER}-mega.png" ]]; then
mv "${SUGIMORI_ART_DIR}"/pokemon/sugimori/{,0}${DEX_NUMBER}-mega.png
fi
if [[ -f "${SUGIMORI_ART_DIR}/pokemon/sugimori/${DEX_NUMBER}-mega-x.png" ]]; then
mv "${SUGIMORI_ART_DIR}"/pokemon/sugimori/{,0}${DEX_NUMBER}-mega-x.png
fi
if [[ -f "${SUGIMORI_ART_DIR}/pokemon/sugimori/${DEX_NUMBER}-mega-y.png" ]]; then
mv "${SUGIMORI_ART_DIR}"/pokemon/sugimori/{,0}${DEX_NUMBER}-mega-y.png
fi

DEX_NUMBER="$(bc<<<${DEX_NUMBER}+1)"
done

echo -e "\nSugimori Artwork files renamed"

Loading…
Cancel
Save