mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Fix some item unlock mechanism.
This commit is contained in:
parent
a666832419
commit
282f7791bf
2 changed files with 17 additions and 7 deletions
|
|
@ -104,7 +104,7 @@ public class ItemUnlockManager : ISavable, IDisposable
|
|||
InventoryType.RetainerMarket,
|
||||
};
|
||||
|
||||
bool AddItem(uint itemId, long time)
|
||||
private bool AddItem(uint itemId, long time)
|
||||
{
|
||||
itemId = HandleHq(itemId);
|
||||
if (!_items.ItemService.AwaitedService.TryGetValue(itemId, out var equip) || !_unlocked.TryAdd(equip.ItemId, time))
|
||||
|
|
@ -295,8 +295,9 @@ public class ItemUnlockManager : ISavable, IDisposable
|
|||
ret.TryAdd(item.ItemId, new UnlockRequirements(row.RowId, 0, 0, 0, UnlockType.Cabinet));
|
||||
}
|
||||
|
||||
var gilShop = gameData.GetExcelSheet<GilShopItem>()!;
|
||||
foreach (var row in gilShop)
|
||||
var gilShopItem = gameData.GetExcelSheet<GilShopItem>()!;
|
||||
var gilShop = gameData.GetExcelSheet<GilShop>()!;
|
||||
foreach (var row in gilShopItem)
|
||||
{
|
||||
if (!items.ItemService.AwaitedService.TryGetValue(row.Item.Row, out var item))
|
||||
continue;
|
||||
|
|
@ -305,6 +306,16 @@ public class ItemUnlockManager : ISavable, IDisposable
|
|||
var quest2 = row.QuestRequired[1].Row;
|
||||
var achievement = row.AchievementRequired.Row;
|
||||
var state = row.StateRequired;
|
||||
|
||||
var shop = gilShop.GetRow(row.RowId);
|
||||
if (shop != null && shop.Quest.Row != 0)
|
||||
{
|
||||
if (quest1 == 0)
|
||||
quest1 = shop.Quest.Row;
|
||||
else if (quest2 == 0)
|
||||
quest2 = shop.Quest.Row;
|
||||
}
|
||||
|
||||
var type = (quest1 != 0 ? UnlockType.Quest1 : 0)
|
||||
| (quest2 != 0 ? UnlockType.Quest2 : 0)
|
||||
| (achievement != 0 ? UnlockType.Achievement : 0);
|
||||
|
|
|
|||
|
|
@ -30,9 +30,8 @@ public readonly record struct UnlockRequirements(uint Quest1, uint Quest2, uint
|
|||
bool CheckQuest(uint quest)
|
||||
=> uiState->IsUnlockLinkUnlockedOrQuestCompleted(quest);
|
||||
|
||||
// TODO ClientStructs
|
||||
bool CheckAchievement(uint achievement)
|
||||
=> false;
|
||||
=> uiState->Achievement.IsLoaded() && uiState->Achievement.IsComplete((int) achievement);
|
||||
|
||||
return Type switch
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue