mirror of
https://github.com/kwsch/pkNX.git
synced 2026-04-25 07:16:51 -05:00
Prevent max moves / behemoth
This commit is contained in:
parent
9a276bc94e
commit
bc51de97ec
|
|
@ -31,16 +31,18 @@ public void Initialize(MovesetRandSettings settings, int[] bannedMoves)
|
|||
{
|
||||
Settings = settings;
|
||||
|
||||
var nanned = new List<int>();
|
||||
nanned.AddRange(new[] { 165, 621, 464 }.Concat(Legal.Z_Moves)); // Struggle, Hyperspace Fury, Dark Void
|
||||
var banned = new List<int>();
|
||||
banned.AddRange(Legal.Taboo_Moves.Concat(Legal.Z_Moves).Concat(Legal.Max_Moves));
|
||||
if (Settings.BanFixedDamageMoves)
|
||||
nanned.AddRange(FixedDamageMoves);
|
||||
nanned.AddRange(bannedMoves);
|
||||
banned.AddRange(FixedDamageMoves);
|
||||
banned.AddRange(bannedMoves);
|
||||
|
||||
Settings.BannedMoves = nanned.ToArray();
|
||||
Settings.BannedMoves = banned.ToArray();
|
||||
|
||||
var all = Enumerable.Range(1, Config.MaxMoveID - 1);
|
||||
var moves = all.Except(nanned);
|
||||
var moves = all.Except(banned);
|
||||
if (MoveData[0] is Move8Fake)
|
||||
moves = moves.Where(z => ((Move8Fake) MoveData[z]).CanUseMove);
|
||||
RandMove = new GenericRandomizer<int>(moves.ToArray());
|
||||
}
|
||||
|
||||
|
|
@ -97,8 +99,12 @@ private bool IsMovesetMeetingRequirements(int[] moves, int[] types, int count)
|
|||
if (Settings.DMG && Settings.DMGCount > moves.Count(move => MoveData[move].Category != 0))
|
||||
return false;
|
||||
|
||||
if (Settings.STAB && Settings.STABCount > moves.Count(move => types.Contains(MoveData[move].Type)))
|
||||
return false;
|
||||
if (Settings.STAB)
|
||||
{
|
||||
var stabCt = moves.Count(move => types.Contains(MoveData[move].Type));
|
||||
if (stabCt < Settings.STABCount)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (moves.Any(Settings.BannedMoves.Contains))
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -21,12 +21,6 @@ public class LearnSettings
|
|||
[Category(General), Description("Level to end learning level up moves.")]
|
||||
public int SpreadTo { get; set; } = 75;
|
||||
|
||||
[Category(General), Description("Requires a certain percent of moves to have STAB.")]
|
||||
public bool STAB { get; set; }
|
||||
|
||||
[Category(General), Description("Required percent of moves having STAB.")]
|
||||
public float STABPercent { get; set; }
|
||||
|
||||
[Category(Misc), Description("Reorders moves so that moves are learned with increasing power.")]
|
||||
public bool OrderByPower { get; set; } = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class MovesetRandSettings
|
|||
public int STABCount { get; set; } = 2;
|
||||
|
||||
[Category(SameType), Description("Minimum percent of STAB moves in generated learnsets.")]
|
||||
public float STABPercent { get; set; } = 100;
|
||||
public float STABPercent { get; set; } = 25;
|
||||
|
||||
[Category(Misc), Description("Banned move IDs.")]
|
||||
internal IList<int> BannedMoves { get; set; } = Array.Empty<int>();
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ public static partial class Legal
|
|||
// Assigning these Trainer Classes to a Trainer crashes the game.
|
||||
// A majority of these are Master Trainer related, and only used for multiplayer. They are not to be assigned to NPCs.
|
||||
// </summary>
|
||||
public static readonly int[] BlacklistedClasses_GG = Enumerable.Range(072, 311).Concat(new int[]
|
||||
public static readonly int[] BlacklistedClasses_GG = Enumerable.Range(072, 311).Concat(new[]
|
||||
{
|
||||
#region CrashClasses
|
||||
032, // Pokémon Trainer
|
||||
|
|
@ -593,6 +593,37 @@ public static partial class Legal
|
|||
695, 696, 697, 698, 699, 700, 701, 702, 703, 719, 723, 724, 725, 726, 727, 728
|
||||
};
|
||||
|
||||
public static readonly int[] Max_Moves =
|
||||
{
|
||||
757, // Max Flare
|
||||
758, // Max Flutterby
|
||||
759, // Max Lightning
|
||||
760, // Max Strike
|
||||
761, // Max Knuckle
|
||||
762, // Max Phantasm
|
||||
763, // Max Hailstorm
|
||||
764, // Max Ooze
|
||||
765, // Max Geyser
|
||||
766, // Max Airstream
|
||||
767, // Max Starfall
|
||||
768, // Max Wyrmwind
|
||||
769, // Max Mindstorm
|
||||
770, // Max Rockfall
|
||||
771, // Max Quake
|
||||
772, // Max Darkness
|
||||
773, // Max Overgrowth
|
||||
774, // Max Steelspike
|
||||
};
|
||||
|
||||
public static readonly int[] Taboo_Moves =
|
||||
{
|
||||
165, // Struggle
|
||||
464, // Dark Void
|
||||
621, // Hyperspace Fury
|
||||
781, // Behemoth Blade
|
||||
782, // Behemoth Bash
|
||||
};
|
||||
|
||||
public static readonly int[] ImportantTrainers_XY =
|
||||
{
|
||||
006, 021, 022, 023, 024, 025, 026, 076, 130, 131, 132, 175, 184, 185, 186, 187, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user