mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 08:46:40 -05:00
FormRandom SV Vivillon
This commit is contained in:
@@ -60,7 +60,7 @@ public override IEnumerable<EncounterSlot9> GetMatchingSlots(PKM pk, EvoCriteria
|
||||
{
|
||||
if (slot.Species != evo.Species)
|
||||
continue;
|
||||
if (slot.Form != evo.Form && !IsFormOkayWild(slot.Species, evo.Form))
|
||||
if (slot.Form != evo.Form && !slot.IsRandomUnspecificForm && !IsFormOkayWild(slot.Species, evo.Form))
|
||||
break;
|
||||
if (slot.Gender != -1 && pk.Gender != slot.Gender)
|
||||
break;
|
||||
@@ -83,10 +83,9 @@ public override IEnumerable<EncounterSlot9> GetMatchingSlots(PKM pk, EvoCriteria
|
||||
|
||||
private static bool IsFormOkayWild(ushort species, byte form) => species switch
|
||||
{
|
||||
(int)Species.Rotom => true,
|
||||
(int)Species.Deerling or (int)Species.Sawsbuck => true,
|
||||
(int)Species.Scatterbug or (int)Species.Spewpa or (int)Species.Vivillon => form < Vivillon3DS.FancyFormID, // GO Postcard
|
||||
(int)Species.Oricorio => true,
|
||||
(int)Species.Rotom => form <= 5,
|
||||
(int)Species.Deerling or (int)Species.Sawsbuck => form < 4,
|
||||
(int)Species.Oricorio => form < 4,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
@@ -53,6 +54,18 @@ public void SimulatorGetEncounters()
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SimGetVivillonPostcardSV()
|
||||
{
|
||||
var pk9 = new PK9 { Species = (int)Species.Vivillon, Form = 1 };
|
||||
var encounters = EncounterMovesetGenerator.GenerateEncounters(pk9, Array.Empty<ushort>(), GameVersion.SL);
|
||||
encounters.OfType<EncounterSlot9>().Should().NotBeEmpty();
|
||||
|
||||
pk9 = new PK9 { Species = (int)Species.Vivillon, Form = Vivillon3DS.FancyFormID };
|
||||
encounters = EncounterMovesetGenerator.GenerateEncounters(pk9, Array.Empty<ushort>(), GameVersion.SL);
|
||||
encounters.OfType<EncounterSlot9>().Should().NotBeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SimulatorGetWC3()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user