internal static Image getSprite(int species, int form, int gender, int item, bool isegg, bool shiny)
{
string file;
if (species == 0)
{ return (Image)Properties.Resources.ResourceManager.GetObject("_0"); }
{
file = "_" + species;
if (form > 0) // Alt Form Handling
file = file + "_" + form;
else if (gender == 1 && (species == 592 || species == 593)) // Frillish & Jellicent
file = file + "_" + gender;
else if (gender == 1 && (species == 521 || species == 668)) // Unfezant & Pyroar
file = "_" + species + "f";
}
// Redrawing logic
Image baseImage = (Image)Properties.Resources.ResourceManager.GetObject(file);
if (baseImage == null)
{
if (species < 722)
{
baseImage = Util.LayerImage(
(Image)Properties.Resources.ResourceManager.GetObject("_" + species),
Properties.Resources.unknown,
0, 0, .5);
}
else
baseImage = Properties.Resources.unknown;
}
if (isegg)
{
// Start with a partially transparent species by layering the species with partial opacity onto a blank image.
baseImage = Util.LayerImage((Image)Properties.Resources.ResourceManager.GetObject("_0"), baseImage, 0, 0, 0.33);
// Add the egg layer over-top with full opacity.
baseImage = Util.LayerImage(baseImage, (Image)Properties.Resources.ResourceManager.GetObject("egg"), 0, 0, 1);
}
if (shiny)
{
// Add shiny star to top left of image.
baseImage = Util.LayerImage(baseImage, Properties.Resources.rare_icon, 0, 0, 0.7);
}
if (item > 0)
{
Image itemimg = (Image)Properties.Resources.ResourceManager.GetObject("item_" + item) ?? Properties.Resources.helditem;
// Redraw
baseImage = Util.LayerImage(baseImage, itemimg, 22 + (15 - itemimg.Width) / 2, 15 + (15 - itemimg.Height), 1);
}
return baseImage;
}