mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-15 22:50:56 +00:00
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using QSB.CampfireSync.WorldObjects;
|
|
using QSB.ItemSync.WorldObjects.Items;
|
|
using QSB.Messaging;
|
|
using QSB.Player;
|
|
using QSB.WorldSync;
|
|
|
|
namespace QSB.CampfireSync.Messages;
|
|
|
|
/// <summary>
|
|
/// TODO: initial state on campfire and item
|
|
/// </summary>
|
|
public class BurnSlideReelMessage : QSBWorldObjectMessage<QSBSlideReelItem, int>
|
|
{
|
|
public BurnSlideReelMessage(QSBCampfire campfire) : base(campfire.ObjectId) { }
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
var campfire = Data.GetWorldObject<QSBCampfire>().AttachedObject;
|
|
var fromPlayer = QSBPlayerManager.GetPlayer(From);
|
|
WorldObject.DropItem(
|
|
campfire._burnedSlideReelSocket.position,
|
|
campfire._burnedSlideReelSocket.up,
|
|
campfire._burnedSlideReelSocket,
|
|
campfire._sector, null);
|
|
fromPlayer.HeldItem = null;
|
|
fromPlayer.AnimationSync.VisibleAnimator.SetTrigger("DropHeldItem");
|
|
WorldObject.AttachedObject.Burn();
|
|
campfire.SetDropSlideReelMode(false);
|
|
campfire._hasBurnedSlideReel = true;
|
|
campfire._oneShotAudio.PlayOneShot(AudioType.TH_Campfire_Ignite, 1f);
|
|
}
|
|
}
|