Example #1
0
 public static string[] GetDirectSoundStrings(Frame.Pokemon pokemon)
 {
     string[] directSoundStrings = new string[3];
     directSoundStrings[0] = "\t.align 2";
     directSoundStrings[1] = String.Format("Cry_{0}::", pokemon.Nombre.Text);
     directSoundStrings[2] = String.Format("\t.incbin \"{0}{1}cry_{2}.bin\"", PathDirectSoundData, Path.DirectorySeparatorChar, pokemon.Nombre.Text.ToLower());
     return(directSoundStrings);
 }
        static string GetName(Frame.Pokemon pokemon)
        {
            StringBuilder str = new StringBuilder();

            //lo pongo como quieren ponerlo
            str.Append("[");
            str.Append(pokemon.Nombre.VarProject);
            str.Append("] = _(\"");
            str.Append(pokemon.Nombre.Text.ToUpper());
            str.Append("\"),");
            return(str.ToString());
        }
Example #3
0
        public static void Load(DirectoryInfo dirProject, Frame.Pokemon pokemon)
        {
            string ruta = Path.Combine(dirProject.FullName, Ruta, pokemon.Nombre.Text.ToLower());

            if (IsSingelPic(dirProject, pokemon))
            {
                pokemon.Imagenes.ImgBack.Path      = new FileInfo(Path.Combine(ruta, "back.png"));
                pokemon.Imagenes.ImgFront.Path     = new FileInfo(Path.Combine(ruta, "front.png"));
                pokemon.Imagenes.ImgIcon.Path      = new FileInfo(Path.Combine(ruta, "icon.png"));
                pokemon.Imagenes.ImgFootPrint.Path = new FileInfo(Path.Combine(ruta, "footprint.png"));

                pokemon.Imagenes.PaletaNormal = Basic.Paleta.Load(dirProject, ruta, "normal");
                pokemon.Imagenes.PaletaShiny  = Basic.Paleta.Load(dirProject, ruta, "shiny");
            }
            else
            {
                //leer archivo mk
            }
        }
Example #4
0
        public static void Save(DirectoryInfo dirProject, Frame.Pokemon pokemon)
        {        //por mirar...
            bool   encontrado = false;
            string cryLine;

            SetPath(dirProject, pokemon);
            TextFile.GetStringLine(dirProject, PathDirectSoundData, (linea) => {
                encontrado = linea.Contains(pokemon.Nombre.Text);
                return(encontrado);
            }, 0);
            if (!encontrado)
            {            //parece que no hay orden... por eso lo pongo depués del primero
                TextFile.SetStringLines(dirProject, PathDirectSoundData, (linea) => linea.Contains("cry_"), 0, (linea) => true, GetDirectSoundStrings(pokemon), false);
            }
            //mirar como va la parte de VoiceGroups que parece que falten...
            encontrado = false;
            cryLine    = GetCryVoiceGroup(pokemon);
            TextFile.GetStringLine(dirProject, PathVoiceGroups, (linea) => {
                encontrado = linea.Contains(cryLine);
                return(encontrado);
            }, 0);
            if (!encontrado)
            {
                //falta saber donde pongo la string cambiar 0
                TextFile.SetStringLine(dirProject, PathDirectSoundData, (linea) => linea.Contains("gCryTable"), 0, cryLine, false);
            }
            encontrado = false;
            cryLine    = GetCryVoiceGroup(pokemon, false);
            TextFile.GetStringLine(dirProject, PathVoiceGroups, (linea) => {
                encontrado = linea.Contains(cryLine);
                return(encontrado);
            }, 0);
            if (!encontrado)
            {
                //de momento no se como va porque parece que el orden no está correcto...la parte de src/data/pokemon/cry_ids.h no la entiendo...faltan pokemon...
                //falta saber donde pongo la string cambiar 0
                TextFile.SetStringLine(dirProject, PathDirectSoundData, (linea) => linea.Contains("gCryTable2"), 0, cryLine, false);         //por hacer
            }
        }
 public static void Save(DirectoryInfo dirProject, Frame.Pokemon pokemon, bool sustituir = true)
 {
     TextFile.SetStringLine(dirProject, Path, (line) => true, pokemon.Orden.Nacional, GetName(pokemon), sustituir);
 }
Example #6
0
        public static void CopyToDir(DirectoryInfo dirProject, Frame.Pokemon pokemon)
        {
            string pathDirDestino = Path.Combine(dirProject.FullName, Ruta, pokemon.Nombre.Text);

            if (!Directory.Exists(pathDirDestino))
            {
                Directory.CreateDirectory(pathDirDestino);
            }

            pokemon.Imagenes.UpdateFiles();

            if (IsSingelPic(dirProject, pokemon))
            {
                if (File.Exists(pokemon.Imagenes.ImgBack.Path.FullName))
                {
                    File.Copy(pokemon.Imagenes.ImgBack.Path.FullName, Path.Combine(pathDirDestino, "back.png"));
                }
                else
                {
                    pokemon.Imagenes.ImgBack.Path = new FileInfo(Path.Combine(pathDirDestino, "back.png"));
                    pokemon.Imagenes.ImgBack.Save();
                }

                if (File.Exists(pokemon.Imagenes.ImgFront.Path.FullName))
                {
                    File.Copy(pokemon.Imagenes.ImgFront.Path.FullName, Path.Combine(pathDirDestino, "front.png"));
                }
                else
                {
                    pokemon.Imagenes.ImgFront.Path = new FileInfo(Path.Combine(pathDirDestino, "front.png"));
                    pokemon.Imagenes.ImgFront.Save();
                }


                Basic.Paleta.Save(dirProject, Ruta, "normal", pokemon.Imagenes.PaletaNormal);
                Basic.Paleta.Save(dirProject, Ruta, "shiny", pokemon.Imagenes.PaletaShiny);
            }
            else
            {
                //se ponen con un nombre diferente
                //podria poner front_{0},numeroImg y lo mismo con back y las paletas :)
                for (int i = 0; i < pokemon.Imagenes.ImgsFront.Count; i++)
                {
                    if (File.Exists(pokemon.Imagenes.ImgsFront[i].Path.FullName))
                    {
                        File.Copy(pokemon.Imagenes.ImgsFront[i].Path.FullName, Path.Combine(pathDirDestino, string.Format("front_{0}.png", i)));
                    }
                    else
                    {
                        pokemon.Imagenes.ImgsFront[i].Path = new FileInfo(Path.Combine(pathDirDestino, string.Format("front_{0}.png", i)));
                        pokemon.Imagenes.ImgsFront[i].Save();
                    }
                }
                for (int i = 0; i < pokemon.Imagenes.ImgsBack.Count; i++)
                {
                    if (File.Exists(pokemon.Imagenes.ImgsBack[i].Path.FullName))
                    {
                        File.Copy(pokemon.Imagenes.ImgsBack[i].Path.FullName, Path.Combine(pathDirDestino, string.Format("back_{0}.png", i)));
                    }
                    else
                    {
                        pokemon.Imagenes.ImgsBack[i].Path = new FileInfo(Path.Combine(pathDirDestino, string.Format("back_{0}.png", i)));
                        pokemon.Imagenes.ImgsBack[i].Save();
                    }
                }
                for (int i = 0; i < pokemon.Imagenes.PaletasNormal.Count; i++)
                {
                    Basic.Paleta.Save(dirProject, Ruta, string.Format("normal_{0}", i), pokemon.Imagenes.PaletasNormal[i]);
                }
                for (int i = 0; i < pokemon.Imagenes.PaletasShiny.Count; i++)
                {
                    Basic.Paleta.Save(dirProject, Ruta, string.Format("shiny_{0}", i), pokemon.Imagenes.PaletasShiny[i]);
                }
            }
            //parte común
            if (File.Exists(pokemon.Imagenes.ImgIcon.Path.FullName))
            {
                File.Copy(pokemon.Imagenes.ImgIcon.Path.FullName, Path.Combine(pathDirDestino, "icon.png"));
            }
            else
            {
                pokemon.Imagenes.ImgIcon.Path = new FileInfo(Path.Combine(pathDirDestino, "icon.png"));
                pokemon.Imagenes.ImgIcon.Save();
            }
            if (File.Exists(pokemon.Imagenes.ImgFootPrint.Path.FullName))
            {
                File.Copy(pokemon.Imagenes.ImgFootPrint.Path.FullName, Path.Combine(pathDirDestino, "footprint.png"));
            }
            else
            {
                pokemon.Imagenes.ImgFootPrint.Path = new FileInfo(Path.Combine(pathDirDestino, "footprint.png"));
                pokemon.Imagenes.ImgFootPrint.Save();
            }
        }
Example #7
0
        public static void Save(DirectoryInfo dirProject, Frame.Pokemon pokemon)
        {
            const int SINGLEFORM     = 1;
            const int PARTES         = 4;
            string    pathDirDestino = Path.Combine(dirProject.FullName, Ruta, pokemon.Nombre.Text);
            string    pathMultiForma;
            string    varDirPokemonMultiforma;

            string[]      campos = { ".4bpp", "4bpp", ".gbapal", ".gbapal", "back", "front", "normal", "shiny" };
            StringBuilder sbMultiForma;

            if (!Directory.Exists(pathDirDestino))
            {
                Directory.CreateDirectory(pathDirDestino);
            }

            //guardo los archivos
            CopyToDir(dirProject, pokemon);



            if (pokemon.Imagenes.ImgsBack.Count != SINGLEFORM)
            {
                //es como castform tiene más de una imagen castform.mk hacer archivo como el de castform y añadirlo despues en el MakeFile

                pathMultiForma          = Path.Combine(dirProject.FullName, string.Format("{0}.{1}", pokemon.Nombre.Text, ExtensionMultiforma));
                varDirPokemonMultiforma = pokemon.Nombre.ToString().ToUpper() + "GFXDIR";

                if (File.Exists(pathMultiForma))
                {
                    File.Delete(pathMultiForma);
                }
                sbMultiForma = new StringBuilder();
                //hago el archivo

                //solo falta mirar como programar la forma genérica de momento solo hacer como castform...luego ya se hará el resto :)
                //hace archivo para la compilación
                sbMultiForma.AppendLine(string.Format("{0} := {1}/{2}", varDirPokemonMultiforma, Ruta, pokemon.Nombre.ToString().ToLower()));
                for (int j = 0; j < PARTES; j++)
                {
                    sbMultiForma.AppendLine();
                    sbMultiForma.AppendLine(string.Format("$({0})/{1}.{2}: $({0})/{1}_0.{2}\\", varDirPokemonMultiforma, campos[j + PARTES], campos[j]));
                    for (int i = 1; i < pokemon.Imagenes.ImgsBack.Count; i++)
                    {
                        sbMultiForma.AppendLine(string.Format("                             $({0})/{1}.{2} \\", varDirPokemonMultiforma, string.Format("{1}_{0}", i, campos[j + PARTES]), campos[j]));
                    }
                    sbMultiForma.Append("	@cat");
                    for (int i = 0; i < pokemon.Imagenes.ImgsBack.Count; i++)
                    {
                        sbMultiForma.AppendLine(string.Format(" $({0})/{1}.{2} \\", varDirPokemonMultiforma, string.Format("{1}_{0}", i, campos[j + PARTES]), campos[j]));
                    }
                    sbMultiForma.AppendLine(" >$@");
                    sbMultiForma.AppendLine();
                }
                sbMultiForma.Replace('/', Path.AltDirectorySeparatorChar);//en linux los directorios van diferentes de alli esto :)
                File.WriteAllText(pathMultiForma, sbMultiForma.ToString());
                //añadir en el makefile
                //añado el include
                TextFile.SetStringLine(dirProject, "Makefile", (line) => line.Contains("GFX_OPTS :="), 1, string.Format("include {0}.{1}", pokemon.Nombre.Text.ToLower(), ExtensionMultiforma), false);
            }
        }
Example #8
0
 static bool IsSingelPic(DirectoryInfo dirProject, Frame.Pokemon pokemon)
 {
     return(File.Exists(Path.Combine(dirProject.FullName, Ruta, pokemon.Nombre.Text, "back.png")));
 }
Example #9
0
 public static string GetCryVoiceGroup(Frame.Pokemon pokemon, bool isTable1 = true)
 {
     return(string.Format("{0} Cry_{1}", isTable1?"cry":"cry2", pokemon.Nombre.Text));
 }
Example #10
0
 public static void SetPath(DirectoryInfo dirProject, Frame.Pokemon pokemon)
 {
     pokemon.Cry.Sonido.Path = new FileInfo(Path.Combine(dirProject.FullName, PathDirCries, string.Format("cry_{0}.aif", pokemon.Nombre.Text.ToLower())));
 }
        public static void Load(Proyecto proyecto, PokemonGBAFrameWork.RomGba rom)
        {
            PokemonGBAFrameWork.PokemonCompleto[] pokedex = PokemonGBAFrameWork.PokemonCompleto.GetPokedex(rom);
            Frame.Pokemon pokemon;
            for (int i = 0; i < pokedex.Length; i++)
            {
                pokemon             = new Frame.Pokemon();
                pokemon.Nombre.Text = pokedex[i].Nombre.Texto;

                pokemon.Orden.Local    = pokedex[i].OrdenLocal.Orden;
                pokemon.Orden.Nacional = pokedex[i].OrdenNacional.Orden;

                pokemon.Stats.Amistad             = (StatsBase.Felicidad)pokedex[i].Stats.BaseAmistad;
                pokemon.Stats.Ataque              = pokedex[i].Stats.Ataque;
                pokemon.Stats.CiclosEclosionHuevo = pokedex[i].Stats.PasosParaEclosionarHuevo;
                pokemon.Stats.Color             = (StatsBase.ColorStat)pokedex[i].Stats.ColorBaseStat;
                pokemon.Stats.Defensa           = pokedex[i].Stats.Defensa;
                pokemon.Stats.EvAtaque          = (StatsBase.NivelEvs)pokedex[i].Stats.AtaqueEvs;
                pokemon.Stats.EvAtaqueEspecial  = (StatsBase.NivelEvs)pokedex[i].Stats.AtaqueEspecialEvs;
                pokemon.Stats.EvDefensa         = (StatsBase.NivelEvs)pokedex[i].Stats.DefensaEvs;
                pokemon.Stats.EvDefensaEspecial = (StatsBase.NivelEvs)pokedex[i].Stats.DefensaEspecialEvs;
                pokemon.Stats.EvHp               = (StatsBase.NivelEvs)pokedex[i].Stats.HpEvs;
                pokemon.Stats.EvVelocidad        = (StatsBase.NivelEvs)pokedex[i].Stats.VelocidadEvs;
                pokemon.Stats.ExpDejada          = pokedex[i].Stats.ExperienciaBase;
                pokemon.Stats.GrupoHuevo1        = proyecto.GrupoHuevos[(int)pokedex[i].Stats.GrupoHuevo1];
                pokemon.Stats.GrupoHuevo2        = proyecto.GrupoHuevos[(int)pokedex[i].Stats.GrupoHuevo2];
                pokemon.Stats.Habilidad1         = proyecto.Habilidades[pokedex[i].Stats.Habilidad1];
                pokemon.Stats.Habilidad2         = proyecto.Habilidades[pokedex[i].Stats.Habilidad2];
                pokemon.Stats.Hp                 = pokedex[i].Stats.Hp;
                pokemon.Stats.Item1              = proyecto.Items[pokedex[i].Stats.Objeto1];
                pokemon.Stats.Item2              = proyecto.Items[pokedex[i].Stats.Objeto2];
                pokemon.Stats.IsFaceRight        = pokedex[i].Stats.IsFaceRight;
                pokemon.Stats.RatioCaptura       = pokedex[i].Stats.RatioCaptura;
                pokemon.Stats.Crecimiento        = (StatsBase.RatioCrecimiento)pokedex[i].Stats.Crecimiento;
                pokemon.Stats.Genero             = (StatsBase.RatioGenero)pokedex[i].Stats.RatioSexo;
                pokemon.Stats.SafariRatioEscapar = pokedex[i].Stats.RatioDeEscaparZonaSafari;
                pokemon.Stats.Tipo1              = proyecto.Tipos[pokedex[i].Stats.Tipo1];
                pokemon.Stats.Tipo2              = proyecto.Tipos[pokedex[i].Stats.Tipo2];
                pokemon.Stats.Velocidad          = pokedex[i].Stats.Velocidad;

                for (int j = 0; j < pokedex[j].AtaquesAprendidos.Ataques.Count; j++)
                {
                    pokemon.AtaquesAprendidos.Ataques.Add(new AtaqueAprendido(pokedex[i].AtaquesAprendidos.Ataques[j].Nivel, proyecto.Ataques[pokedex[i].AtaquesAprendidos.Ataques[i].Ataque]));
                }

                pokemon.PokedexData.Altura           = pokedex[i].Descripcion.Altura;
                pokemon.PokedexData.Descripcion1     = pokedex[i].Descripcion.Texto;
                pokemon.PokedexData.EscalaEntrenador = pokedex[i].Descripcion.EscalaEntrenador;
                pokemon.PokedexData.EscalaPokemon    = pokedex[i].Descripcion.EscalaPokemon;
                pokemon.PokedexData.Especie          = pokedex[i].Descripcion.Especie;
                pokemon.PokedexData.OffsetEntrenador = pokedex[i].Descripcion.Numero2;
                pokemon.PokedexData.OffsetPokemon    = pokedex[i].Descripcion.Numero;
                pokemon.PokedexData.Peso             = pokedex[i].Descripcion.Peso;

                PonImagenes(pokemon.Imagenes.ImgsFront, pokedex[i].Sprites.SpritesFrontales.Sprites, "front");
                PonImagenes(pokemon.Imagenes.ImgsBack, pokedex[i].Sprites.SpritesTraseros.Sprites, "back");
                pokemon.Imagenes.ImgFootPrint = new ImgWithPath("foot_print" + ImgWithPath.EXTENSION, pokedex[i].Huella.GetImagen());
                pokemon.Imagenes.PaletaNormal = new Paleta(pokedex[i].Sprites.PaletaNormal.Paleta.Colores);
                pokemon.Imagenes.PaletaShiny  = new Paleta(pokedex[i].Sprites.PaletaShiny.Paleta.Colores);

                proyecto.Pokedex.Add(pokemon);
            }
        }
Example #12
0
 static string LocalDexString(Frame.Pokemon pokemon)
 {
     return("#define HOENN_DEX_" + pokemon.Nombre.Text.ToUpper() + " " + pokemon.Orden.Local);
 }
Example #13
0
 static string NationalDexString(Frame.Pokemon pokemon)
 {
     return("#define NATIONAL_DEX_" + pokemon.Nombre.Text.ToUpper() + " " + pokemon.Orden.Nacional);
 }
Example #14
0
 static string SpeciesString(Frame.Pokemon pokemon)
 {
     return("#define " + pokemon.Nombre.VarProject + " " + pokemon.Orden.Nacional);
 }
Example #15
0
 public static void Load(DirectoryInfo dirProject, Frame.Pokemon pokemon)
 {
     pokemon.Nombre.Text = GetName(TextFile.GetStringLine(dirProject, Path, START, pokemon.Orden.Nacional));
 }