Split Dream World special move entries

The structure of the downloaded dw pkm only allocates one move; thus,
only 1 special move can be obtained (not 2+). Ends up creating extra
entries.

Eg: Wobbuffet can't have Charm and Encore at the same time in gen6 if
originated from Entree/Black.
This commit is contained in:
Kurt 2017-05-10 19:00:56 -07:00
parent 6d9cbaaec0
commit 71b9141962
2 changed files with 24 additions and 4 deletions

View file

@ -489,8 +489,28 @@ namespace PKHeX.Core
foreach (EncounterStatic s in t)
{
s.Location = 75; //Entree Forest
s.Ability = (PersonalTable.B2W2.getAbilities(s.Species, s.Form)[2] == 0) ? 1 : 4; // Check if has HA
s.Ability = PersonalTable.B2W2.getAbilities(s.Species, s.Form)[2] == 0 ? 1 : 4; // Check if has HA
}
// Split encounters with multiple permitted special moves -- a pkm can only be obtained with 1 of the special moves!
var list = new List<EncounterStatic>();
foreach (EncounterStatic s in t)
{
if (s.Moves == null || s.Moves.Length <= 1) // no special moves
{
list.Add(s);
continue;
}
var loc = s.Location;
for (int i = 0; i < s.Moves.Length; i++)
{
var clone = s.Clone(loc);
clone.Moves = new[] {s.Moves[i]};
list.Add(clone);
}
}
t = list.ToArray();
}
private static void MarkG5Slots(ref EncounterArea[] Areas)
{

View file

@ -41,7 +41,7 @@
return Encounters;
}
protected virtual EncounterStatic Clone(int location)
public virtual EncounterStatic Clone(int location)
{
return new EncounterStatic
{
@ -127,7 +127,7 @@
{
public EncounterType TypeEncounter = EncounterType.None;
protected override EncounterStatic Clone(int location)
public override EncounterStatic Clone(int location)
{
return new EncounterStaticTyped
{
@ -166,7 +166,7 @@
public int Gauge;
public bool EReader = false;
protected override EncounterStatic Clone(int location)
public override EncounterStatic Clone(int location)
{
throw new System.Exception();
}