22 lines
631 B
C#
Raw Normal View History

2022-04-13 23:30:59 -07:00
using QSB.EchoesOfTheEye.DreamLantern.WorldObjects;
using QSB.Messaging;
namespace QSB.EchoesOfTheEye.DreamLantern.Messages;
2023-07-28 19:30:57 +01:00
public class SetLitMessage : QSBWorldObjectMessage<QSBDreamLanternController, bool>
{
2022-04-13 23:30:59 -07:00
public SetLitMessage(bool lit) : base(lit) { }
public override void OnReceiveRemote()
{
WorldObject.AttachedObject.SetLit(Data);
2022-10-06 11:21:22 -07:00
WorldObject.DreamLanternItem?._oneShotSource?.PlayOneShot(Data ? AudioType.Artifact_Light : AudioType.Artifact_Extinguish);
// 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);
}
}
}