2022-02-14 23:25:42 +00:00
|
|
|
|
using QSB.WorldSync;
|
2021-11-14 00:57:06 +00:00
|
|
|
|
using UnityEngine;
|
2021-11-11 02:40:02 +00:00
|
|
|
|
|
2022-02-27 12:40:44 +00:00
|
|
|
|
namespace QSB.MeteorSync.WorldObjects
|
2021-11-11 02:40:02 +00:00
|
|
|
|
{
|
2022-02-27 12:40:44 +00:00
|
|
|
|
public class QSBMeteor : WorldObject<MeteorController>
|
2022-02-25 06:04:54 +00:00
|
|
|
|
{
|
2022-02-27 12:40:44 +00:00
|
|
|
|
public override void SendInitialState(uint to)
|
2021-11-14 07:29:06 +00:00
|
|
|
|
{
|
2022-02-27 12:40:44 +00:00
|
|
|
|
// todo SendInitialState
|
2022-02-25 06:04:54 +00:00
|
|
|
|
}
|
2021-11-25 15:38:05 +00:00
|
|
|
|
|
2022-02-27 12:40:44 +00:00
|
|
|
|
public static bool IsSpecialImpact(GameObject go) =>
|
|
|
|
|
go == Locator.GetPlayerCollider().gameObject || (Locator.GetProbe() != null && go == Locator.GetProbe()._anchor._collider.gameObject);
|
|
|
|
|
|
|
|
|
|
public void SpecialImpact()
|
2022-02-25 06:04:54 +00:00
|
|
|
|
{
|
2022-02-27 12:40:44 +00:00
|
|
|
|
AttachedObject._intactRenderer.enabled = false;
|
|
|
|
|
AttachedObject._impactLight.enabled = true;
|
|
|
|
|
AttachedObject._impactLight.intensity = AttachedObject._impactLightCurve.Evaluate(0f);
|
|
|
|
|
foreach (var particleSystem in AttachedObject._impactParticles)
|
|
|
|
|
{
|
|
|
|
|
particleSystem.Play();
|
|
|
|
|
}
|
2022-02-25 06:04:54 +00:00
|
|
|
|
|
2022-02-27 12:40:44 +00:00
|
|
|
|
AttachedObject._impactSource.PlayOneShot(AudioType.BH_MeteorImpact);
|
|
|
|
|
foreach (var owCollider in AttachedObject._owColliders)
|
|
|
|
|
{
|
|
|
|
|
owCollider.SetActivation(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AttachedObject._owRigidbody.MakeKinematic();
|
|
|
|
|
FragmentSurfaceProxy.UntrackMeteor(AttachedObject);
|
|
|
|
|
FragmentCollisionProxy.UntrackMeteor(AttachedObject);
|
|
|
|
|
AttachedObject._ignoringCollisions = false;
|
|
|
|
|
AttachedObject._hasImpacted = true;
|
|
|
|
|
AttachedObject._impactTime = Time.time;
|
|
|
|
|
}
|
2021-11-11 02:40:02 +00:00
|
|
|
|
}
|
2022-02-25 06:04:54 +00:00
|
|
|
|
}
|