Laxley Grandfather Clock puzzle artwork done.
This commit is contained in:
@@ -1,7 +1,60 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Data.IO.Saves;
|
||||
using BriarQueen.Framework.Events.Gameplay;
|
||||
using BriarQueen.Framework.Events.UI;
|
||||
using BriarQueen.Framework.Managers.Levels.Data;
|
||||
using BriarQueen.Framework.Managers.Player.Data;
|
||||
using BriarQueen.Framework.Managers.UI;
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace BriarQueen.Game.Items.Pickups.ChapterOne.LaxleyHouse
|
||||
{
|
||||
public class MantleClock
|
||||
public class MantleClock : BaseItem
|
||||
{
|
||||
|
||||
public override UICursorService.CursorStyle ApplicableCursorStyle =>
|
||||
HasRetrievedHourHand
|
||||
? UICursorService.CursorStyle.Inspect
|
||||
: UICursorService.CursorStyle.Pickup;
|
||||
|
||||
public override string InteractableName => "Broken Mantle Clock";
|
||||
|
||||
private bool HasRetrievedHourHand =>
|
||||
SaveManager.GetLevelFlag(LevelFlag.LaxleyHourHandRetrieved);
|
||||
|
||||
public override async UniTask OnInteract(ItemDataSo item = null)
|
||||
{
|
||||
if (!CheckEmptyHands())
|
||||
return;
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
EventCoordinator.Publish(
|
||||
new DisplayInteractEvent(InteractEventIDs.Get(ItemInteractKey.CantUseItem)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasRetrievedHourHand)
|
||||
{
|
||||
EventCoordinator.Publish(
|
||||
new DisplayInteractEvent(InteractEventIDs.Get(EnvironmentInteractKey.LaxleyHouseBrokenClock)));
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerManager.CollectItem(ItemIDs.Get(ItemKey.LaxleyClockHourHand));
|
||||
EventCoordinator.Publish(new DisplayInteractEvent(InteractEventIDs.Get(ItemInteractKey.LooksImportant)));
|
||||
EventCoordinator.Publish(new SelectedItemChangedEvent(null));
|
||||
|
||||
await OnInteracted();
|
||||
}
|
||||
|
||||
protected override UniTask OnInteracted()
|
||||
{
|
||||
if (!HasRetrievedHourHand)
|
||||
SaveManager.SetLevelFlag(LevelFlag.LaxleyHourHandRetrieved, true);
|
||||
|
||||
|
||||
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user