36 lines
787 B
C#
Raw Normal View History

2022-01-21 15:13:16 -08:00
using QSB.Messaging;
using QSB.TornadoSync.Messages;
using QSB.WorldSync;
2021-12-04 06:21:11 -08:00
namespace QSB.TornadoSync.WorldObjects
2021-12-04 06:21:11 -08:00
{
public class QSBTornado : WorldObject<TornadoController>
{
public override void SendInitialState(uint to) =>
this.SendMessage(new TornadoFormStateMessage(FormState) { To = to });
public bool FormState
2021-12-05 03:41:07 -08:00
{
get => AttachedObject._tornadoRoot.activeSelf // forming or formed or collapsing
&& !AttachedObject._tornadoCollapsing; // and not collapsing
set
2021-12-05 03:41:07 -08:00
{
if (FormState == value)
{
return;
}
2021-12-05 20:09:54 -08:00
if (value)
{
AttachedObject._tornadoCollapsing = false;
AttachedObject.StartFormation();
}
else
{
AttachedObject._secondsUntilFormation = 0;
AttachedObject.StartCollapse();
}
2021-12-05 03:41:07 -08:00
}
}
2021-12-04 06:21:11 -08:00
}
}