Minor clean

This commit is contained in:
Kurt
2019-11-18 22:48:03 -08:00
parent 0ef6f024d6
commit a368b81519
7 changed files with 24 additions and 17 deletions

View File

@@ -58,13 +58,12 @@ static Encounters8()
new EncounterStatic { Species = 889, Level = 70, Location = 66, Moves = new[] {163,242,442,334}, Shiny = Never, Ability = 1, FlawlessIVCount = 3, Version = SH }, // Zamazenta
new EncounterStatic { Species = 890, Level = 60, Location = 66, Moves = new[] {440,406,053,744}, Shiny = Never, Ability = 1, FlawlessIVCount = 3 }, // Eternatus-1 (reverts to form 0)
// Motostoke Stadium Static Encounters
new EncounterStatic { Species = 037, Level = 24, Location = 24, Version = SW }, // Vulpix at Motostoke Stadium
new EncounterStatic { Species = 058, Level = 24, Location = 24, Version = SH }, // Growlithe at Motostoke Stadium
new EncounterStatic { Species = 607, Level = 25, Location = 24, }, // Litwick at Motostoke Stadium
new EncounterStatic { Species = 850, Level = 25, Location = 24, FlawlessIVCount = 3 }, // Sizzlipede at Motostoke Stadium
new EncounterStatic { Species = 618, Level = 25, Location = 054, Moves = new[] {389,319,279,341}, Form = 01, Ability = 1 }, // Stunfisk in Galar Mine No. 2
new EncounterStatic8 { Species = 618, Level = 48, Location = -1, Moves = new[] {779,330,340,334}, Form = 01 }, // Stunfisk
new EncounterStatic8 { Species = 527, Level = 16, Location = -1, Moves = new[] {000,000,000,000} }, // Woobat

View File

@@ -168,7 +168,7 @@ public static partial class Legal
808, // Meltan
809, // Melmetal
(int)Species.Dracozolt,
(int)Species.Arctozolt,
(int)Species.Dracovish,

View File

@@ -335,7 +335,7 @@ private CheckResult VerifyBallEggGen8(LegalityAnalysis data)
return NONE;
}
public bool IsGalarCapture(int species)
public static bool IsGalarCapture(int species)
{
if (810 <= species && species <= 818) // starter
return false;

View File

@@ -176,8 +176,14 @@ bool IsValidPikachuCap()
if (pkm.AltForm != 0 && BattleOnly.Contains(pkm.Species))
{
if (pkm.Species == (int)Species.Darmanitan && pkm.AltForm == 2) { } // this one is OK, Galarian non-Zen
else return GetInvalid(LFormBattle);
if (pkm.Species == (int) Species.Darmanitan && pkm.AltForm == 2 && pkm.Format >= 8)
{
// this one is OK, Galarian non-Zen
}
else
{
return GetInvalid(LFormBattle);
}
}
return VALID;
@@ -210,17 +216,19 @@ private static int GetGenesectFormFromHeldItem(int item)
return 0;
}
private static readonly HashSet<int> BattleOnly;
private static readonly HashSet<int> SafariFloette = new HashSet<int> { 0, 1, 3 }; // 0/1/3 - RBY
private static readonly HashSet<int> BattleOnly = GetBattleFormSet();
static FormVerifier()
private static HashSet<int> GetBattleFormSet()
{
BattleOnly = new HashSet<int>();
BattleOnly.UnionWith(Legal.BattleForms);
BattleOnly.UnionWith(Legal.BattleMegas);
BattleOnly.UnionWith(Legal.BattlePrimals);
var hs = new HashSet<int>();
hs.UnionWith(Legal.BattleForms);
hs.UnionWith(Legal.BattleMegas);
hs.UnionWith(Legal.BattlePrimals);
return hs;
}
private static readonly HashSet<int> SafariFloette = new HashSet<int> { 0, 1, 3 }; // 0/1/3 - RBY
private void VerifyFormFriendSafari(LegalityAnalysis data)
{
var pkm = data.pkm;

View File

@@ -255,7 +255,7 @@ public override int[] IVs
public bool GetIsNicknamed(int language) => Data[GetNicknameOffset(language)] != 0;
private int GetLanguageIndex(int language)
private static int GetLanguageIndex(int language)
{
var lang = (LanguageID) language;
if (lang < LanguageID.Japanese || lang == LanguageID.UNUSED_6)

View File

@@ -77,7 +77,7 @@ public override PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria)
Met_Level = Met_Level,
Met_Location = Location,
Ball = 4,
// Ribbons
RibbonCountry = RibbonCountry,
RibbonNational = RibbonNational,

View File

@@ -286,13 +286,13 @@ public override int[] RelearnMoves
public string GetOT(int language) => Util.TrimFromZero(Encoding.Unicode.GetString(Data, GetOTOffset(language), 0x1A));
public void SetOT(int language, string value) => Encoding.Unicode.GetBytes(value.PadRight(0x1A / 2, '\0')).CopyTo(Data, GetOTOffset(language));
private int GetNicknameOffset(int language)
private static int GetNicknameOffset(int language)
{
int index = GetLanguageIndex(language);
return 0x30 + (index * 0x1C);
}
private int GetOTOffset(int language)
private static int GetOTOffset(int language)
{
int index = GetLanguageIndex(language);
return 0x12C + (index * 0x1C);