2022-04-13 23:30:59 -07:00
|
|
|
|
using QSB.EchoesOfTheEye.DreamLantern.WorldObjects;
|
2022-03-24 20:35:49 +00:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
|
|
|
|
|
namespace QSB.EchoesOfTheEye.DreamLantern.Messages;
|
|
|
|
|
|
2023-07-28 19:30:57 +01:00
|
|
|
|
public class SetLitMessage : QSBWorldObjectMessage<QSBDreamLanternController, bool>
|
2022-03-24 20:35:49 +00:00
|
|
|
|
{
|
2022-04-13 23:30:59 -07:00
|
|
|
|
public SetLitMessage(bool lit) : base(lit) { }
|
2022-03-24 20:35:49 +00:00
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote()
|
2022-10-04 22:52:29 -04:00
|
|
|
|
{
|
|
|
|
|
WorldObject.AttachedObject.SetLit(Data);
|
2022-10-06 11:21:22 -07:00
|
|
|
|
WorldObject.DreamLanternItem?._oneShotSource?.PlayOneShot(Data ? AudioType.Artifact_Light : AudioType.Artifact_Extinguish);
|
2022-10-05 19:28:10 -04:00
|
|
|
|
|
|
|
|
|
// If a lantern is already lit you shouldn't be able to pick it up
|
|
|
|
|
if (Data)
|
|
|
|
|
{
|
2022-10-06 00:32:19 -07:00
|
|
|
|
WorldObject.DreamLanternItem?.EnableInteraction(false);
|
2022-10-05 19:28:10 -04:00
|
|
|
|
}
|
2022-10-04 22:52:29 -04:00
|
|
|
|
}
|
2022-03-24 20:35:49 +00:00
|
|
|
|
}
|