示例#1
0
func ripPokemonBack(rip *sprites.Ripper, number int, form string, outname string) error {
	var m *image.Paletted
	var err error
	if number == 201 && form != "" {
		m, err = rip.UnownBack(form)
	} else {
		m, err = rip.PokemonBack(number)
	}
	if err != nil {
		return err
	}
	return write(m, outname)
}
示例#2
0
func ripAnimation(rip *sprites.Ripper, number int, form string, outname string) error {
	var g *gif.GIF
	var err error
	if number == 201 && form != "" {
		g, err = rip.UnownAnimation(form)
	} else {
		g, err = rip.PokemonAnimation(number)
	}
	if err != nil {
		return err
	}
	return write(g, outname)
}
示例#3
0
func ripShinyPokemonBack(rip *sprites.Ripper, number int, form string, outname string) error {
	var m *image.Paletted
	var err error
	if number == 201 && form != "" {
		m, err = rip.UnownBack(form)
	} else {
		m, err = rip.PokemonBack(number)
	}
	if err != nil {
		return err
	}
	m.Palette = rip.ShinyPalette(number)
	if m.Palette == nil {
		return errors.New("couldn't get palette")
	}
	return write(m, outname)
}
示例#4
0
func ripShinyAnimation(rip *sprites.Ripper, number int, form string, outname string) error {
	var g *gif.GIF
	var err error
	if number == 201 && form != "" {
		g, err = rip.UnownAnimation(form)
	} else {
		g, err = rip.PokemonAnimation(number)
	}
	if err != nil {
		return err
	}
	pal := rip.ShinyPalette(number)
	if pal == nil {
		return errors.New("couldn't get palette")
	}
	for _, m := range g.Image {
		m.Palette = pal
	}
	return write(g, outname)
}