GEmeTool/create_shiny_folder.pl

32 lines
998 B
Perl

#!/usr/bin/env perl
use v5.16.3;
use strict;
use warnings;
use Path::Tiny;
my $pokemons_dir = path 'pokeemerald/graphics/pokemon/';
my $tempdir = Path::Tiny->tempdir;
my $shiny_dir = path 'resources/shiny';
$shiny_dir->mkpath;
for my $pokemon_dir ( $pokemons_dir->children ) {
my $bpp = $tempdir->child( $pokemon_dir->basename . '.4bpp' );
say $pokemon_dir->basename;
my $front = $pokemon_dir->child('front.png');
my $shiny = $pokemon_dir->child('shiny.pal');
if ($pokemon_dir->basename eq 'unown') {
$front = $pokemon_dir->child('z/front.png');
}
if ($pokemon_dir->basename eq 'castform') {
$front = $pokemon_dir->child('normal/front.png');
$shiny = $pokemon_dir->child('normal/shiny.pal');
}
system './pokeemerald/tools/gbagfx/gbagfx',
$front, $bpp;
system './pokeemerald/tools/gbagfx/gbagfx',
$bpp, $shiny_dir->child( $pokemon_dir->basename . '.png' ),
'-palette', $shiny, '-mwidth', 8, '-object';
}