Set all purchased on MoveShop all

This commit is contained in:
Kurt
2025-01-17 22:08:38 -06:00
parent 2976480792
commit c1d2babc5c
2 changed files with 21 additions and 0 deletions

View File

@@ -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);
}
}
}

View File

@@ -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;
}