Inventory: don't GiveAll unreleased items

Wasn't implemented for Gen3-5 storages
This commit is contained in:
Kurt 2026-02-27 22:46:31 -06:00
parent bde5729883
commit 9420dcf44d
10 changed files with 10 additions and 11 deletions

View File

@ -28,7 +28,7 @@ public sealed class ItemStorage3Colo : IItemStorage
540, 541, 542, 546, 547,
];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -22,8 +22,7 @@ public sealed class ItemStorage3E : IItemStorage
private static readonly ushort[] PCItems = [.. General, .. Berry, .. Balls, .. Machine];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -18,7 +18,7 @@ public sealed class ItemStorage3FRLG : IItemStorage
349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -60,7 +60,7 @@ public sealed class ItemStorage3RS : IItemStorage
private static readonly ushort[] PCItems = [..General, ..Key, .. Berry, ..Balls, ..Machine];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -59,7 +59,7 @@ public sealed class ItemStorage3XD : IItemStorage
590, 591, 592, 593,
];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -11,7 +11,7 @@ public sealed class ItemStorage4DP : ItemStorage4, IItemStorage
public static ushort[] GetAllHeld() => [..GeneralDP, ..Mail, ..Medicine, ..Berry, ..BallsDPPt, ..Battle, ..Machine[..^8]];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -27,7 +27,7 @@ public sealed class ItemStorage4HGSS : ItemStorage4, IItemStorage
492, 493, 494, 495, 496, 497, 498, 499, 500, // Apricorn Balls
];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -20,7 +20,7 @@ public sealed class ItemStorage4Pt : ItemStorage4, IItemStorage
public static ushort[] GetAllHeld() => [..GeneralPt, ..Mail, ..Medicine, ..Berry, ..BallsDPPt, ..Battle, ..Machine[..^8]];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -16,7 +16,7 @@ public sealed class ItemStorage5B2W2 : ItemStorage5, IItemStorage
616, 617, 621, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638,
];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{

View File

@ -16,7 +16,7 @@ public sealed class ItemStorage5BW : ItemStorage5, IItemStorage
616, 617, 621, 623, 624, 625, 626,
];
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true;
public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex);
public ReadOnlySpan<ushort> GetItems(InventoryType type) => type switch
{