PKHeX/PKHeX.Core/Saves/Substructures/BoxWallpaper.cs

91 lines
2.9 KiB
C#
Raw Normal View History

namespace PKHeX.Core
{
public static class BoxWallpaper
{
public static string GetWallpaper(SaveFile SAV, int index)
{
index++;
string s = $"box_wp{index:00}";
switch (SAV.Generation)
{
case 7: s += "xy";
break;
case 6: s += SAV.ORAS && index > 16 ? "ao" : "xy";
break;
2016-07-26 06:11:17 +00:00
case 5: s += SAV.B2W2 && index > 16 ? "b2w2" : "bw";
break;
case 4:
2016-07-26 06:11:17 +00:00
if (SAV.Pt && index > 16)
s += "pt";
2016-07-26 06:11:17 +00:00
else if (SAV.HGSS && index > 16)
s += "hgss";
else
s += "dp";
break;
case 3:
2016-07-26 06:11:17 +00:00
if (SAV.E)
s += "e";
2016-07-26 06:11:17 +00:00
else if (SAV.FRLG && index > 12)
s += "frlg";
else
s += "rs";
break;
}
return s;
}
2018-07-29 20:27:48 +00:00
public static bool IsWallpaperRed(SaveFile SAV, int box)
{
switch (SAV.Generation)
{
case 3:
if (SAV.GameCube)
return box == 7 && SAV is SAV3XD; // flame pattern in XD
switch (SAV.GetBoxWallpaper(box))
{
case 5: // Volcano
return true;
case 13: // PokéCenter
return SAV.E;
}
break;
case 4:
switch (SAV.GetBoxWallpaper(box))
{
case 5: // Volcano
case 12: // Checks
case 13: // PokéCenter
case 22: // Special
return true;
}
break;
case 5:
switch (SAV.GetBoxWallpaper(box))
{
case 5: // Volcano
case 12: // Checks
return true;
case 19: // PWT
case 22: // Reshiram
return SAV.B2W2;
case 21: // Zoroark
case 23: // Musical
return SAV.BW;
}
break;
case 6:
case 7:
switch (SAV.GetBoxWallpaper(box))
{
case 5: // Volcano
case 12: // PokéCenter
case 20: // Special5 Flare/Magma
return true;
}
break;
}
return false;
}
}
}