mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-10 20:05:20 -05:00
Set all purchased on MoveShop all
This commit is contained in:
@@ -136,4 +136,20 @@ public static void SetEncounterMasteryFlags(this IMoveShop8Mastery shop, ReadOnl
|
||||
shop.SetMasteredRecordFlag(index, true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the "purchased" move shop flag for all possible moves.
|
||||
/// </summary>
|
||||
public static void SetPurchasedFlagsAll(this IMoveShop8Mastery shop)
|
||||
{
|
||||
var permit = shop.Permit;
|
||||
var possible = permit.RecordPermitIndexes;
|
||||
for (int index = 0; index < permit.RecordCountUsed; index++)
|
||||
{
|
||||
var allowed = permit.IsRecordPermitted(index);
|
||||
if (!allowed)
|
||||
continue;
|
||||
shop.SetPurchasedRecordFlag(index, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,9 +58,14 @@ public static ModifyResult SetSuggestedMasteryData(BatchInfo info, ReadOnlySpan<
|
||||
if (e is IMasteryInitialMoveShop8 enc)
|
||||
enc.SetInitialMastery(pk);
|
||||
if (IsAll(propValue))
|
||||
{
|
||||
t.SetPurchasedFlagsAll();
|
||||
t.SetMoveShopFlagsAll(pk);
|
||||
}
|
||||
else
|
||||
{
|
||||
t.SetMoveShopFlags(pk);
|
||||
}
|
||||
return ModifyResult.Modified;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user