2022-04-01 20:51:03 +00:00
|
|
|
|
using QSB.CampfireSync.WorldObjects;
|
|
|
|
|
using QSB.ItemSync.WorldObjects.Items;
|
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Player;
|
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
|
|
|
|
|
namespace QSB.CampfireSync.Messages;
|
|
|
|
|
|
2022-08-06 23:32:22 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// TODO: initial state on campfire and item
|
|
|
|
|
/// </summary>
|
2023-07-28 18:30:57 +00:00
|
|
|
|
public class BurnSlideReelMessage : QSBWorldObjectMessage<QSBSlideReelItem, int>
|
2022-04-01 20:51:03 +00:00
|
|
|
|
{
|
|
|
|
|
public BurnSlideReelMessage(QSBCampfire campfire) : base(campfire.ObjectId) { }
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
2022-08-03 03:55:50 +00:00
|
|
|
|
var campfire = Data.GetWorldObject<QSBCampfire>().AttachedObject;
|
2022-04-01 20:51:03 +00:00
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|