mirror of
https://github.com/kwsch/pkNX.git
synced 2026-04-24 23:06:56 -05:00
Allow LA species for randomization, handle bad forms
This commit is contained in:
parent
22ede7da03
commit
a2f0a58f7a
|
|
@ -213,6 +213,12 @@ private void AddGen8Species(List<int> list, int maxSpecies)
|
|||
list.AddRange(Enumerable.Range(894, 5)); // Regieleki, Regidrago, Glastrier, Spectrier, Calyrex
|
||||
}
|
||||
if (Events) list.Add(893); // Zarude
|
||||
|
||||
if (maxSpecies >= Legal.MaxSpeciesID_8a)
|
||||
{
|
||||
list.AddRange(Enumerable.Range(899, 6)); // Wyrdeer - Overqwil
|
||||
if (Legends) list.Add(905); // Enamorus
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddGGEvents(List<int> list)
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ public static partial class Legal
|
|||
public const int MaxBallID_8 = (int)Ball.Beast;
|
||||
public const int MaxGameID_8 = (int)GameVersion.SH;
|
||||
|
||||
internal const int MaxSpeciesID_8a = (int)Species.Enamorus;
|
||||
internal const int MaxMoveID_8a = 850; // Take Heart
|
||||
internal const int MaxItemID_8a = 1828; // Legend Plate
|
||||
internal const int MaxBallID_8a = (int)Ball.LAOrigin;
|
||||
internal const int MaxGameID_8a = (int)GameVersion.SP;
|
||||
internal const int MaxAbilityID_8a = 267; // As One (Glastrier)
|
||||
public const int MaxSpeciesID_8a = (int)Species.Enamorus;
|
||||
public const int MaxMoveID_8a = 850; // Take Heart
|
||||
public const int MaxItemID_8a = 1828; // Legend Plate
|
||||
public const int MaxBallID_8a = (int)Ball.LAOrigin;
|
||||
public const int MaxGameID_8a = (int)GameVersion.SP;
|
||||
public const int MaxAbilityID_8a = 267; // As One (Glastrier)
|
||||
|
||||
#region Met Locations
|
||||
internal static readonly int[] Met_SWSH_0 =
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
using pkNX.Randomization;
|
||||
using pkNX.Structures;
|
||||
using pkNX.Structures.FlatBuffers;
|
||||
using static pkNX.Structures.Species;
|
||||
using Util = pkNX.Randomization.Util;
|
||||
|
||||
namespace pkNX.WinForms.Subforms;
|
||||
|
|
@ -109,9 +110,6 @@ private void RandomizeArea(ResidentArea8a area, SpeciesSettings settings)
|
|||
if (enc.ShinyLock is not ShinyType8a.Random)
|
||||
continue;
|
||||
|
||||
if (enc.Eligibility.ConditionID is not Condition8a.None)
|
||||
continue;
|
||||
|
||||
var spec = rand.GetRandomSpecies(enc.Species);
|
||||
enc.Species = spec;
|
||||
enc.Form = GetRandomForm(spec);
|
||||
|
|
@ -123,7 +121,14 @@ int GetRandomForm(int spec)
|
|||
if (!formRand.TryGetValue(spec, out var entries))
|
||||
return 0;
|
||||
var count = entries.Count;
|
||||
return Util.Random.Next(0, count);
|
||||
|
||||
return (Species)spec switch
|
||||
{
|
||||
Growlithe or Arcanine or Voltorb or Electrode or Typhlosion or Qwilfish or Samurott or Lilligant or Zorua or Zoroark or Braviary or Sliggoo or Goodra or Avalugg or Decidueye => 1,
|
||||
Basculin => 2,
|
||||
Kleavor => 0,
|
||||
_ => Util.Random.Next(0, count),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user