using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BoneLib;
using BoneLib.Nullables;
using FieldInjector;
using HarmonyLib;
using Il2CppSystem;
using LabFusion.SDK.Points;
using MelonLoader;
using MelonLoader.Preferences;
using SLZ;
using SLZ.Bonelab;
using SLZ.Interaction;
using SLZ.Marrow.Data;
using SLZ.Marrow.Pool;
using SLZ.Marrow.Warehouse;
using SLZ.Rig;
using SLZ.SFX;
using SLZ.VFX;
using SLZ.Vehicle;
using TMPro;
using TheLibraryElectric;
using TheLibraryElectric.Environment;
using TheLibraryElectric.Groups;
using TheLibraryElectric.InternalHelpers;
using TheLibraryElectric.LabFusion;
using TheLibraryElectric.Markers;
using TheLibraryElectric.Marrow;
using TheLibraryElectric.Melon;
using TheLibraryElectric.Misc;
using TheLibraryElectric.PlayerUtil;
using TheLibraryElectric.Rigidbodies;
using TheLibraryElectric.Signals;
using TheLibraryElectric.Temp;
using TheLibraryElectric.VariableHolders;
using TheLibraryElectric.Vehicles;
using TheLibraryElectric.Water;
using UltEvents;
using UnhollowerBaseLib;
using UnhollowerBaseLib.Attributes;
using UnhollowerRuntimeLib;
using UnityEngine;
using UnityEngine.Audio;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("See how IL2CPP breaks the mod.")]
[assembly: AssemblyDescription("See how IL2CPP breaks the mod.")]
[assembly: AssemblyCompany("Weather Electric")]
[assembly: AssemblyProduct("The Library Electric")]
[assembly: AssemblyCopyright("Developed by SoulWithMae + BugoBug + EverythingOnArm")]
[assembly: AssemblyTrademark("Weather Electric")]
[assembly: AssemblyFileVersion("2.4.0")]
[assembly: MelonInfo(typeof(Main), "The Library Electric", "2.4.0", "SoulWithMae + BugoBug + EverythingOnArm", "https://bonelab.thunderstore.io/package/SoulWithMae/TheLibraryElectric/")]
[assembly: MelonColor(ConsoleColor.Cyan)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: MelonOptionalDependencies(new string[] { "JeviLib" })]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("2.4.0.0")]
public enum MixerType
{
Sfx,
Music,
Gunshot,
Master
}
namespace TheLibraryElectric
{
internal static class FieldInjection
{
public static void Inject()
{
ModConsole.Msg("Injecting the fields with the fieldinjector which injects fields, crazy isnt it", 1);
SerialisationHandler.Inject<DoNotFreeze>(0);
ModConsole.Msg("Hopefully injected DoNotFreeze", 1);
SerialisationHandler.Inject<DoNotDestroy>(0);
ModConsole.Msg("Hopefully injected DoNotDestroy", 1);
SerialisationHandler.Inject<RecieveSignal>(0);
ModConsole.Msg("Hopefully injected RecieveSignal", 1);
SerialisationHandler.Inject<SendSignal>(0);
ModConsole.Msg("Hopefully injected SendSignal", 1);
SerialisationHandler.Inject<RigManagerControl>(0);
ModConsole.Msg("Hopefully injected RigManagerControl", 1);
SerialisationHandler.Inject<FreezeRigidbodies>(0);
ModConsole.Msg("Hopefully injected FreezeRigidbodies", 1);
SerialisationHandler.Inject<DestroyOnCollision>(0);
ModConsole.Msg("Hopefully injected DestroyOnCollision", 1);
SerialisationHandler.Inject<TimescaleController>(0);
ModConsole.Msg("Hopefully injected TimescaleController", 1);
SerialisationHandler.Inject<UpdateTMP>(0);
ModConsole.Msg("Hopefully injected UpdateTMP", 1);
SerialisationHandler.Inject<VoidCounterObject>(0);
ModConsole.Msg("Hopefully injected VoidCounterObject", 1);
SerialisationHandler.Inject<RBGravityManager>(0);
ModConsole.Msg("Hopefully injected RBGravityManager", 1);
SerialisationHandler.Inject<GravityChamber>(0);
ModConsole.Msg("Hopefully injected GravityChamber", 1);
SerialisationHandler.Inject<RagdollZone>(0);
ModConsole.Msg("Hopefully injected RagdollZone", 1);
SerialisationHandler.Inject<ForceZone>(0);
ModConsole.Msg("Hopefully injected ForceZone", 1);
SerialisationHandler.Inject<SpawnOnTriggerEnter>(0);
ModConsole.Msg("Hopefully injected SpawnOnTriggerEnter", 1);
SerialisationHandler.Inject<DespawnPooledObject>(0);
ModConsole.Msg("Hopefully injected DespawnPooledObject", 1);
SerialisationHandler.Inject<RandomAudioPlayer>(0);
ModConsole.Msg("Hopefully injected RandomAudioPlayer", 1);
SerialisationHandler.Inject<IgnoreRigidbody>(0);
ModConsole.Msg("Hopefully injected IgnoreRigidbody", 1);
SerialisationHandler.Inject<RbBuoyancyManager>(0);
ModConsole.Msg("Hopefully injected RbBuoyancyManager", 1);
SerialisationHandler.Inject<WaterZone>(0);
ModConsole.Msg("Hopefully injected WaterZone", 1);
SerialisationHandler.Inject<SignalTrigger>(0);
ModConsole.Msg("Hopefully injected SignalTrigger", 1);
SerialisationHandler.Inject<SignalTriggerer>(0);
ModConsole.Msg("Hopefully injected SignalTriggerer", 1);
SerialisationHandler.Inject<HandMonitor>(0);
ModConsole.Msg("Hopefully injected HandMonitor", 1);
SerialisationHandler.Inject<SwimmingController>(0);
ModConsole.Msg("Hopefully injected SwimmingController", 1);
SerialisationHandler.Inject<InvokeIfLibInstalled>(0);
ModConsole.Msg("Hopefully injected InvokeIfLibInstalled", 1);
SerialisationHandler.Inject<DrowningManager>(0);
ModConsole.Msg("Hopefully injected DrowningManager", 1);
SerialisationHandler.Inject<BitShop>(0);
ModConsole.Msg("Hopefully injected BitShop", 1);
SerialisationHandler.Inject<RagdollOnCollide>(0);
ModConsole.Msg("Hopefully injected RagdollOnCollide", 1);
SerialisationHandler.Inject<InvokeWhenCounter>(0);
ModConsole.Msg("Hopefully injected InvokeWhenCounter", 1);
SerialisationHandler.Inject<PhotonThruster>(0);
ModConsole.Msg("Hopefully injected PhotonThruster", 1);
SerialisationHandler.Inject<GroupProxy>(0);
ModConsole.Msg("Hopefully injected GroupProxy", 1);
SerialisationHandler.Inject<GroupIdentifier>(0);
ModConsole.Msg("Hopefully injected GroupIdenifier", 1);
SerialisationHandler.Inject<TLE_SimpleRaycast>(0);
ModConsole.Msg("Hopefully injected TLE_SimpleRaycast", 1);
SerialisationHandler.Inject<RbSpeedMeter>(0);
ModConsole.Msg("Hopefully injected RbSpeedMeter", 1);
SerialisationHandler.Inject<ScoreKeeper>(0);
ModConsole.Msg("Hopefully injected ScoreKeeper", 1);
SerialisationHandler.Inject<RealtimeAnalogClock>(0);
ModConsole.Msg("Hopefully injected RealtimeAnalogClock", 1);
SerialisationHandler.Inject<CoolerSpawnablePlacer>(0);
ModConsole.Msg("Hopefully injected CoolerSpawnablePlacer", 1);
SerialisationHandler.Inject<PlungerButBetter>(0);
ModConsole.Msg("Hopefully injected PlungerButBetter", 1);
SerialisationHandler.Inject<PlungerListener>(0);
ModConsole.Msg("Hopefully injected PlungerListener", 1);
SerialisationHandler.Inject<HandHolder>(0);
ModConsole.Msg("Hopefully injected HandHolder", 1);
SerialisationHandler.Inject<Vector3Holder>(0);
ModConsole.Msg("Hopefully injected Vector3Holder", 1);
SerialisationHandler.Inject<QuaternionHolder>(0);
ModConsole.Msg("Hopefully injected QuaternionHolder", 1);
SerialisationHandler.Inject<FloatHolder>(0);
ModConsole.Msg("Hopefully injected FloatHolder", 1);
SerialisationHandler.Inject<IntHolder>(0);
ModConsole.Msg("Hopefully injected IntHolder", 1);
SerialisationHandler.Inject<RigManagerHolder>(0);
ModConsole.Msg("Hopefully injected RigManagerHolder", 1);
SerialisationHandler.Inject<ApplyRigManager>(0);
ModConsole.Msg("Hopefully injected ApplyRigManager", 1);
SerialisationHandler.Inject<FindClosestRigManager>(0);
ModConsole.Msg("Hopefully injected FindClosestRigManager", 1);
SerialisationHandler.Inject<TransformHolder>(0);
ModConsole.Msg("Hopefully injected TransformHolder", 1);
SerialisationHandler.Inject<Boat>(0);
ModConsole.Msg("Hopefully injected Boat", 1);
SerialisationHandler.Inject<TimeCycleHandler>(0);
ModConsole.Msg("Hopefully injected TimeCycleHandler", 1);
SerialisationHandler.Inject<SetAudioMixer>(0);
ModConsole.Msg("Hopefully injected SetAudioMixer", 1);
ModConsole.Msg("All fields are probably injected. I can't tell since this isn't async so I can't slap a bool on it.", 1);
}
}
public class ElectricBehaviour : MonoBehaviour
{
private Transform _transform;
private bool _hasTransform;
public Transform Transform
{
get
{
if (!_hasTransform)
{
_transform = ((Component)this).transform;
_hasTransform = true;
}
return _transform;
}
}
public ElectricBehaviour(IntPtr intPtr)
: base(intPtr)
{
}
}
public class Main : MelonMod
{
internal const string Name = "The Library Electric";
internal const string Description = "See how IL2CPP breaks the mod.";
internal const string Author = "SoulWithMae + BugoBug + EverythingOnArm";
internal const string Company = "Weather Electric";
internal const string Version = "2.4.0";
internal const string DownloadLink = "https://bonelab.thunderstore.io/package/SoulWithMae/TheLibraryElectric/";
public override void OnInitializeMelon()
{
ModConsole.Setup(((MelonBase)this).LoggerInstance);
Preferences.Setup();
FieldInjection.Inject();
}
}
}
namespace TheLibraryElectric.Temp
{
public static class Utilities
{
private static bool temp;
public static bool IsObsRecording => temp;
}
}
namespace TheLibraryElectric.Patching
{
public static class VoidCounterPatch
{
[HarmonyPatch(typeof(RigidbodyProjectile), "OnCollisionEnter")]
public class VoidCounterPatch_Patch
{
[HarmonyPrefix]
public static bool Prefix(AssetPoolee __instance, Collision c)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
if ((Object)(object)c.gameObject.GetComponentInParent<VoidCounterObject>() != (Object)null)
{
PhysicMaterial material = new PhysicMaterial
{
bounciness = 1f,
dynamicFriction = 0.2f,
staticFriction = 0.5f
};
Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(((Component)__instance).GetComponentsInChildren<Collider>());
for (int i = 0; i < array.Length; i++)
{
array[i].material = material;
}
if ((Object)(object)((Component)__instance).gameObject.GetComponent<Rigidbody>() != (Object)null)
{
((Component)__instance).gameObject.GetComponent<Rigidbody>().mass = 0.1f;
}
if (c.gameObject.GetComponentInParent<VoidCounterObject>().disableDespsawnDelay && (Object)(object)((Component)__instance).gameObject.GetComponent<DisableDelay>() != (Object)null)
{
DisableDelay[] array2 = Il2CppArrayBase<DisableDelay>.op_Implicit(((Component)__instance).gameObject.GetComponentsInChildren<DisableDelay>());
for (int i = 0; i < array2.Length; i++)
{
Object.Destroy((Object)(object)array2[i]);
}
}
return false;
}
return true;
}
}
}
}
namespace TheLibraryElectric.Water
{
public class DrowningManager : MonoBehaviour
{
public float timeUntilDrowning = 20f;
public float damageInterval = 1f;
public float damagePercentage = 0.1f;
private RigManager _rigManager;
private bool _isDrowning;
private float _timeInsideWater;
private float _methodCallTimer;
private void OnTriggerEnter(Collider other)
{
_rigManager = ((Component)other).GetComponentInParent<RigManager>();
if ((Object)(object)_rigManager != (Object)null)
{
_isDrowning = true;
}
}
private void OnTriggerExit(Collider other)
{
_isDrowning = false;
_timeInsideWater = 0f;
}
private void FixedUpdate()
{
if (_isDrowning)
{
CheckTimeInWater();
}
}
private void CheckTimeInWater()
{
_timeInsideWater += Time.deltaTime;
if (_timeInsideWater >= timeUntilDrowning)
{
RepeatDrownMethod();
}
}
private void RepeatDrownMethod()
{
_methodCallTimer += Time.deltaTime;
if (_methodCallTimer >= damageInterval)
{
Drown();
_methodCallTimer = 0f;
}
}
private void Drown()
{
float num = _rigManager.health.max_Health * damagePercentage;
_rigManager.health.TAKEDAMAGE(num);
}
public DrowningManager(IntPtr ptr)
: base(ptr)
{
}
}
public class HandMonitor : MonoBehaviour
{
public Vector3 handVelocity;
public RigManager rigManager;
public float minimumVelocity;
public float velocityMultiplier;
private Rigidbody handRb;
private void Start()
{
handRb = ((Component)this).GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
handVelocity = handRb.velocity - ((Component)((Rig)rigManager.physicsRig).m_chest).GetComponent<Rigidbody>().velocity;
if (((Vector3)(ref handVelocity)).sqrMagnitude > minimumVelocity)
{
((Component)((Rig)rigManager.physicsRig).m_head).GetComponent<Rigidbody>().AddRelativeForce(new Vector3(0f, 0f, ((Vector3)(ref handVelocity)).sqrMagnitude * velocityMultiplier));
Vector3 velocity = ((Component)((Rig)rigManager.physicsRig).m_chest).GetComponent<Rigidbody>().velocity;
ModConsole.Msg("Chest velocity: " + ((object)(Vector3)(ref velocity)).ToString() + "e: " + ((Vector3)(ref handVelocity)).sqrMagnitude * 1000f, 1);
}
}
public HandMonitor(IntPtr ptr)
: base(ptr)
{
}
}
public class IgnoreRigidbody : MonoBehaviour
{
public IgnoreRigidbody(IntPtr ptr)
: base(ptr)
{
}
}
public class RbBuoyancyManager : MonoBehaviour
{
public Rigidbody thisRb;
public float buoyancyMultiplier;
public float midpoint;
public bool midpointSink;
public bool dampening;
public float dampeningAmount;
public bool isAnOverride;
[NonSerialized]
internal Action<RbBuoyancyManager> onDestroyed;
private void Start()
{
thisRb = ((Component)this).GetComponent<Rigidbody>();
if ((Object)(object)thisRb != (Object)null)
{
thisRb.useGravity = false;
}
}
private void OnDisable()
{
if ((Object)(object)thisRb != (Object)null)
{
thisRb.useGravity = true;
}
if (!isAnOverride)
{
Object.Destroy((Object)(object)this);
}
else
{
((Behaviour)this).enabled = false;
}
}
private void OnDestroy()
{
onDestroyed?.Invoke(this);
}
private void FixedUpdate()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)thisRb != (Object)null && thisRb.useGravity)
{
thisRb.useGravity = false;
}
Vector3 gravity;
if ((Object)(object)thisRb != (Object)null && thisRb.mass < midpoint)
{
float mass = thisRb.mass;
gravity = Physics.gravity;
float num = mass + ((Vector3)(ref gravity)).magnitude * buoyancyMultiplier;
thisRb.AddForce(Vector3.up * num);
if (dampening)
{
Rigidbody obj = thisRb;
obj.velocity *= dampeningAmount;
}
}
if ((Object)(object)thisRb != (Object)null && thisRb.mass > midpoint)
{
float mass2 = thisRb.mass;
gravity = Physics.gravity;
float num2 = mass2 + ((Vector3)(ref gravity)).magnitude * buoyancyMultiplier;
thisRb.AddForce(Vector3.down * num2);
if (dampening)
{
Rigidbody obj2 = thisRb;
obj2.velocity *= dampeningAmount;
}
}
if (!((Object)(object)thisRb != (Object)null) || thisRb.mass != midpoint)
{
return;
}
if (midpointSink)
{
float mass3 = thisRb.mass;
gravity = Physics.gravity;
float num3 = mass3 + ((Vector3)(ref gravity)).magnitude * buoyancyMultiplier;
thisRb.AddForce(Vector3.down * num3);
if (dampening)
{
Rigidbody obj3 = thisRb;
obj3.velocity *= dampeningAmount;
}
}
if (!midpointSink)
{
float mass4 = thisRb.mass;
gravity = Physics.gravity;
float num4 = mass4 + ((Vector3)(ref gravity)).magnitude * buoyancyMultiplier;
thisRb.AddForce(Vector3.up * num4);
if (dampening)
{
Rigidbody obj4 = thisRb;
obj4.velocity *= dampeningAmount;
}
}
}
public RbBuoyancyManager(IntPtr ptr)
: base(ptr)
{
}
}
public class SwimmingController : MonoBehaviour
{
public RigManager rigManager;
public float minimumVelocity = 10f;
public float velocityMultiplier = 100f;
private void OnTriggerEnter(Collider other)
{
rigManager = ((Component)other).GetComponentInParent<RigManager>();
if ((Object)(object)rigManager != (Object)null)
{
ModConsole.Msg("SwimmingController: RigManager found!", 1);
if ((Object)(object)((Component)rigManager.physicsRig.leftHand).GetComponent<HandMonitor>() == (Object)null)
{
HandMonitor handMonitor = ((Component)rigManager.physicsRig.leftHand).gameObject.AddComponent<HandMonitor>();
handMonitor.rigManager = rigManager;
handMonitor.minimumVelocity = minimumVelocity;
}
if ((Object)(object)((Component)rigManager.physicsRig.rightHand).GetComponent<HandMonitor>() == (Object)null)
{
HandMonitor handMonitor2 = ((Component)rigManager.physicsRig.rightHand).gameObject.AddComponent<HandMonitor>();
handMonitor2.rigManager = rigManager;
handMonitor2.minimumVelocity = minimumVelocity;
handMonitor2.velocityMultiplier = velocityMultiplier;
}
}
}
private void OnTriggerExit(Collider other)
{
rigManager = ((Component)other).GetComponentInParent<RigManager>();
if ((Object)(object)rigManager != (Object)null && (Object)(object)((Component)rigManager.physicsRig.leftHand).GetComponent<HandMonitor>() != (Object)null)
{
Object.Destroy((Object)(object)((Component)rigManager.physicsRig.leftHand).GetComponent<HandMonitor>());
}
if ((Object)(object)rigManager != (Object)null && (Object)(object)((Component)rigManager.physicsRig.rightHand).GetComponent<HandMonitor>() != (Object)null)
{
Object.Destroy((Object)(object)((Component)rigManager.physicsRig.rightHand).GetComponent<HandMonitor>());
}
}
public SwimmingController(IntPtr ptr)
: base(ptr)
{
}
}
public class WaterZone : MonoBehaviour
{
public List<RbBuoyancyManager> inTriggerCol = new List<RbBuoyancyManager>();
public float buoyancyMultiplier = 1f;
public float midpoint = 50f;
public bool midpointSink = true;
public bool dampening = true;
public float dampeningAmount = 0.98f;
public bool ignoreRigManager;
private void OnTriggerEnter(Collider other)
{
if (other.isTrigger)
{
return;
}
Rigidbody attachedRigidbody = other.attachedRigidbody;
RbBuoyancyManager rbBuoyancyManager = null;
if ((Object)(object)attachedRigidbody != (Object)null)
{
rbBuoyancyManager = ((Component)attachedRigidbody).GetComponent<RbBuoyancyManager>();
}
if ((Object)(object)rbBuoyancyManager != (Object)null && rbBuoyancyManager.isAnOverride)
{
((Behaviour)rbBuoyancyManager).enabled = true;
inTriggerCol.Add(rbBuoyancyManager);
}
else
{
if (!((Object)(object)attachedRigidbody != (Object)null) || !((Object)(object)((Component)attachedRigidbody).GetComponent<RbBuoyancyManager>() == (Object)null) || ((Object)(object)((Component)other).GetComponentInParent<RigManager>() != (Object)null && ignoreRigManager))
{
return;
}
RbBuoyancyManager rbBuoyancyManager2 = ((Component)attachedRigidbody).gameObject.AddComponent<RbBuoyancyManager>();
if ((Object)(object)((Component)other).GetComponentInParent<IgnoreRigidbody>() != (Object)null)
{
return;
}
rbBuoyancyManager2.dampening = dampening;
rbBuoyancyManager2.buoyancyMultiplier = buoyancyMultiplier;
rbBuoyancyManager2.midpoint = midpoint;
rbBuoyancyManager2.dampeningAmount = dampeningAmount;
rbBuoyancyManager2.midpointSink = midpointSink;
rbBuoyancyManager2.onDestroyed = OnBuoyancyManagerDestroyed;
Rigidbody[] array = Il2CppArrayBase<Rigidbody>.op_Implicit(((Component)attachedRigidbody).GetComponentsInChildren<Rigidbody>(true));
foreach (Rigidbody val in array)
{
if (val.isKinematic && (Object)(object)((Component)val).GetComponent<RbBuoyancyManager>() == (Object)null)
{
RbBuoyancyManager rbBuoyancyManager3 = ((Component)val).gameObject.AddComponent<RbBuoyancyManager>();
rbBuoyancyManager3.buoyancyMultiplier = buoyancyMultiplier;
rbBuoyancyManager3.dampening = dampening;
rbBuoyancyManager3.midpoint = midpoint;
rbBuoyancyManager3.dampeningAmount = dampeningAmount;
rbBuoyancyManager3.midpointSink = midpointSink;
}
}
inTriggerCol.Add(rbBuoyancyManager2);
}
}
private void OnTriggerExit(Collider other)
{
if (other.isTrigger)
{
return;
}
Rigidbody attachedRigidbody = other.attachedRigidbody;
RbBuoyancyManager rbBuoyancyManager = null;
if ((Object)(object)attachedRigidbody != (Object)null)
{
rbBuoyancyManager = ((Component)attachedRigidbody).GetComponent<RbBuoyancyManager>();
}
if (!inTriggerCol.Contains(rbBuoyancyManager))
{
return;
}
if (rbBuoyancyManager.isAnOverride)
{
((Behaviour)rbBuoyancyManager).enabled = false;
rbBuoyancyManager.onDestroyed(rbBuoyancyManager);
return;
}
attachedRigidbody.useGravity = true;
Object.Destroy((Object)(object)rbBuoyancyManager);
Rigidbody[] array = Il2CppArrayBase<Rigidbody>.op_Implicit(((Component)attachedRigidbody).GetComponentsInChildren<Rigidbody>(true));
foreach (Rigidbody val in array)
{
if (val.isKinematic && (Object)(object)((Component)val).GetComponent<RbBuoyancyManager>() != (Object)null)
{
Object.Destroy((Object)(object)((Component)val).GetComponent<RbBuoyancyManager>());
}
}
}
[HideFromIl2Cpp]
private void OnBuoyancyManagerDestroyed(RbBuoyancyManager manager)
{
inTriggerCol.Remove(manager);
}
private void Update()
{
foreach (RbBuoyancyManager item in inTriggerCol)
{
if ((Object)(object)item != (Object)null && !item.isAnOverride)
{
item.buoyancyMultiplier = buoyancyMultiplier;
item.dampening = dampening;
item.midpoint = midpoint;
item.dampeningAmount = dampeningAmount;
item.midpointSink = midpointSink;
}
}
}
public WaterZone(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.Vehicles
{
public class Boat : MonoBehaviour
{
public MotorSFX motorSFX;
public ParticleSystem[] Particles;
public int ParticleCount = 5;
public float DelayBetweenParticles = 0.1f;
public float RandomVariance = 0.05f;
public float WaterCheckDelay = 1f;
public Rigidbody[] Bodiestocheck;
public Seat DriverSeat;
public Transform SteeringWheel;
public Vector2 WheelMinMaxAngle;
public bool CanReverse;
public Transform[] Rudders;
public Vector2 RudderMinMaxAngle;
public Rigidbody BodyToAccelerate;
public Rigidbody[] Propellers;
public float PropellerForce;
public Transform Speedometer;
public float MaxSpeedometerRotation;
public float Speed = 100f;
public float MaxSpeed = 15f;
public float MaxTurn = 100f;
public float MotorAccel = 15f;
public float DecelMultiplier = 2f;
public float ReverseMultiplier = 0.5f;
private BaseController _Controller;
private bool _IsPlayerIn;
private float _JoystickY;
private float _SteeringY;
private float _SteeringRudderRatio = 1f;
private float _MotorStrength;
private float _TimeCounter;
private bool _IsInWater;
private float _TimerChecks;
private float _CurrentDelay;
private float _LastSpeed;
private void Start()
{
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
Seat driverSeat = DriverSeat;
driverSeat.RegisteredEvent += DelegateSupport.ConvertDelegate<Action>((Delegate)new Action(SeatEnter));
Seat driverSeat2 = DriverSeat;
driverSeat2.DeRegisteredEvent += DelegateSupport.ConvertDelegate<Action>((Delegate)new Action(SeatExit));
_CurrentDelay = DelayBetweenParticles + Random.Range(0f - RandomVariance, RandomVariance);
ModConsole.Msg("Getting absolute of should-be-positive-values", 1);
ReverseMultiplier = Math.Abs(ReverseMultiplier);
DecelMultiplier = Math.Abs(DecelMultiplier);
MotorAccel = Math.Abs(MotorAccel);
MaxSpeed = Math.Abs(MaxSpeed);
WaterCheckDelay = Math.Abs(WaterCheckDelay);
ParticleCount = Math.Abs(ParticleCount);
if ((Object)(object)DriverSeat == (Object)null)
{
ModConsole.Error("Driver seat is null. Can't fix!");
}
if ((Object)(object)motorSFX == (Object)null)
{
ModConsole.Error("Motor SFX is null! Fixing...", 1);
motorSFX = ((Component)this).gameObject.AddComponent<MotorSFX>();
}
if ((Object)(object)Speedometer == (Object)null)
{
ModConsole.Error("Speedometer is null! Disabling...", 1);
MaxSpeedometerRotation = 0f;
}
if ((Object)(object)SteeringWheel == (Object)null)
{
ModConsole.Error("Steering wheel is null! Expect errors, fixing anyway...");
SteeringWheel = new GameObject().transform;
SteeringWheel.parent = ((Component)this).transform;
}
if ((Object)(object)BodyToAccelerate == (Object)null)
{
ModConsole.Msg("Body to accelerate is null! Trying to grab from this object...");
Rigidbody component = ((Component)this).gameObject.GetComponent<Rigidbody>();
if ((Object)(object)component == (Object)null)
{
ModConsole.Msg("Couldn't find Rigidbody, adding one with some basic values...");
BodyToAccelerate = ((Component)this).gameObject.AddComponent<Rigidbody>();
BodyToAccelerate.mass = Speed;
}
else
{
ModConsole.Msg("Found a Rigidbody", 1);
BodyToAccelerate = component;
}
}
}
private void Update()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
if (_IsPlayerIn)
{
_JoystickY = _Controller.GetThumbStickAxis().y;
}
else
{
_JoystickY = 0f;
}
if (_JoystickY * 100f < _MotorStrength)
{
_MotorStrength -= MotorAccel * DecelMultiplier * Time.deltaTime;
}
if (_JoystickY * 100f > _MotorStrength)
{
_MotorStrength += MotorAccel * Time.deltaTime;
}
if (CanReverse)
{
Mathf.Clamp(_MotorStrength, -100f, 100f);
}
Mathf.Clamp(_MotorStrength, 0f, 100f);
_SteeringY = SteeringWheel.rotation.y;
_SteeringRudderRatio = (RudderMinMaxAngle.y - RudderMinMaxAngle.x) / (WheelMinMaxAngle.y - WheelMinMaxAngle.x);
Quaternion rotation;
if (Rudders.Length != 0)
{
Transform[] rudders = Rudders;
foreach (Transform val in rudders)
{
rotation = val.rotation;
val.Rotate(0f, 0f - ((Quaternion)(ref rotation)).eulerAngles.y, 0f);
val.Rotate(0f, _SteeringY * _SteeringRudderRatio, 0f);
}
}
if (MaxSpeedometerRotation != 0f)
{
Transform speedometer = Speedometer;
rotation = Speedometer.rotation;
speedometer.Rotate(0f, 0f - ((Quaternion)(ref rotation)).eulerAngles.y, 0f);
Speedometer.Rotate(0f, MaxSpeedometerRotation / 100f * (MaxSpeed / Vector3.Dot(((Component)BodyToAccelerate).transform.forward, BodyToAccelerate.velocity) * 100f), 0f);
}
if (_TimeCounter > _CurrentDelay)
{
_TimeCounter = 0f;
_CurrentDelay = DelayBetweenParticles + Random.Range(0f - RandomVariance, RandomVariance);
if (_IsInWater && Particles.Length != 0)
{
ParticleSystem[] particles = Particles;
for (int i = 0; i < particles.Length; i++)
{
particles[i].Emit(ParticleCount);
}
}
}
else
{
_TimeCounter += Time.deltaTime;
}
}
private void FixedUpdate()
{
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0226: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
if (Math.Sign(_MotorStrength) == -1)
{
BodyToAccelerate.AddRelativeForce(new Vector3(0f, 0f, _MotorStrength * Speed * DecelMultiplier));
}
BodyToAccelerate.AddRelativeForce(new Vector3(0f, 0f, _MotorStrength * Speed));
BodyToAccelerate.velocity = new Vector3(Mathf.Clamp(BodyToAccelerate.velocity.x, float.MinValue, MaxSpeed), BodyToAccelerate.velocity.y, Mathf.Clamp(BodyToAccelerate.velocity.z, float.MinValue, MaxSpeed));
if (!(-10f < _SteeringY) || !(_SteeringY < 10f))
{
BodyToAccelerate.AddRelativeTorque(new Vector3(0f, MaxTurn / 100f * _SteeringY / (WheelMinMaxAngle.y - WheelMinMaxAngle.x) / 100f, 0f));
}
if (Propellers.Length != 0)
{
Rigidbody[] propellers = Propellers;
for (int i = 0; i < propellers.Length; i++)
{
propellers[i].AddRelativeForce(new Vector3(0f, PropellerForce * _MotorStrength, 0f));
}
}
if (_TimerChecks > WaterCheckDelay)
{
_TimerChecks = 0f;
if (Bodiestocheck.Length != 0)
{
int num = 0;
Rigidbody[] propellers = Bodiestocheck;
for (int i = 0; i < propellers.Length; i++)
{
if (Object.op_Implicit((Object)(object)((Component)propellers[i]).gameObject.GetComponent<RbBuoyancyManager>()))
{
num++;
}
}
if (num > 0)
{
_IsInWater = true;
}
else
{
_IsInWater = false;
}
}
else if ((Object)(object)((Component)BodyToAccelerate).gameObject.GetComponent<RbBuoyancyManager>() != (Object)null)
{
_IsInWater = true;
}
else
{
_IsInWater = false;
}
}
else
{
_TimerChecks += Time.fixedDeltaTime;
}
float num2 = Vector3.Dot(((Component)BodyToAccelerate).transform.forward, BodyToAccelerate.velocity);
motorSFX.UpdateMotor(num2, (num2 - _LastSpeed) / Time.fixedDeltaTime, Math.Abs(_MotorStrength));
_LastSpeed = num2;
}
private void OnDisable()
{
_IsPlayerIn = false;
}
private void SeatEnter()
{
motorSFX.StartMotor();
_IsPlayerIn = true;
if (DriverSeat.rigManager.ControllerRig.isRightHanded)
{
_Controller = DriverSeat.rigManager.ControllerRig.rightController;
}
else
{
_Controller = DriverSeat.rigManager.ControllerRig.leftController;
}
}
private void SeatExit()
{
motorSFX.StopMotor();
_Controller = null;
_IsPlayerIn = false;
_JoystickY = 0f;
}
public Boat(IntPtr ptr)
: base(ptr)
{
}
}
public class RbSpeedMeter : MonoBehaviour
{
public Rigidbody targetRigidbody;
public TextMeshPro speedText;
public string speedFormat = "Speed: {0:0.00} m/s";
private void FixedUpdate()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)targetRigidbody != (Object)null)
{
Vector3 velocity = targetRigidbody.velocity;
float magnitude = ((Vector3)(ref velocity)).magnitude;
((TMP_Text)speedText).text = string.Format(speedFormat, magnitude);
}
}
public RbSpeedMeter(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.VariableHolders
{
public class FloatHolder : MonoBehaviour
{
public float variable;
public float Variable
{
get
{
return variable;
}
set
{
variable = value;
}
}
public FloatHolder(IntPtr ptr)
: base(ptr)
{
}
}
public class HandHolder : MonoBehaviour
{
public Hand variable;
public Hand Variable
{
get
{
return variable;
}
set
{
variable = value;
}
}
public HandHolder(IntPtr ptr)
: base(ptr)
{
}
}
public class IntHolder : MonoBehaviour
{
public int variable;
public int Variable
{
get
{
return variable;
}
set
{
variable = value;
}
}
public IntHolder(IntPtr ptr)
: base(ptr)
{
}
}
public class QuaternionHolder : MonoBehaviour
{
public Quaternion variable;
public Quaternion Variable
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return variable;
}
set
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
variable = value;
}
}
public QuaternionHolder(IntPtr ptr)
: base(ptr)
{
}
}
public class RigManagerHolder : MonoBehaviour
{
public RigManager variable;
public RigManager Variable
{
get
{
return variable;
}
set
{
variable = value;
}
}
public RigManagerHolder(IntPtr ptr)
: base(ptr)
{
}
}
public class TransformHolder : MonoBehaviour
{
public Transform variable;
public Transform Variable
{
get
{
return variable;
}
set
{
variable = value;
}
}
public TransformHolder(IntPtr ptr)
: base(ptr)
{
}
}
public class Vector3Holder : MonoBehaviour
{
public Vector3 variable;
public Vector3 Variable
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return variable;
}
set
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
variable = value;
}
}
public Vector3Holder(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.Signals
{
public class RecieveSignal : MonoBehaviour
{
public string activationKey;
private void Start()
{
ModConsole.Msg("Reciever spawned, key is " + activationKey, 1);
}
public void InvokeEvent()
{
((Component)this).GetComponent<UltEventHolder>().Invoke();
}
public RecieveSignal(IntPtr ptr)
: base(ptr)
{
}
}
public class SendSignal : MonoBehaviour
{
public string activationKey;
public void Broadcast()
{
ModConsole.Msg("Fun fact! Reciever is spelled wrong in every log bit, and in the component. I'm not fixing it.", 1);
ModConsole.Msg("Broadcasting", 1);
ModConsole.Msg("Finding recievers", 1);
RecieveSignal[] array = Il2CppArrayBase<RecieveSignal>.op_Implicit(Object.FindObjectsOfType<RecieveSignal>());
ModConsole.Msg("Got recievers", 1);
RecieveSignal[] array2 = array;
foreach (RecieveSignal recieveSignal in array2)
{
ModConsole.Msg("Finding recievers again", 1);
RecieveSignal component = ((Component)recieveSignal).gameObject.GetComponent<RecieveSignal>();
ModConsole.Msg("Reciever gameobject is " + ((Object)((Component)component).gameObject).name, 1);
ModConsole.Msg("Sender key is " + activationKey + ", reciever key is " + component.activationKey, 1);
if (activationKey == component.activationKey)
{
ModConsole.Msg("Calling reciever's invoke method", 1);
recieveSignal.InvokeEvent();
}
else
{
ModConsole.Msg("Could not find reciever's key, or key was not the same as sender's", 1);
}
}
}
public SendSignal(IntPtr ptr)
: base(ptr)
{
}
}
public class SignalTrigger : MonoBehaviour
{
public UltEvent triggerEnterEvent;
public UltEvent triggerExitEvent;
public string activationKey;
private void Start()
{
ModConsole.Msg("SignalTrigger spawned, key is " + activationKey, 1);
}
private void OnTriggerEnter(Collider other)
{
SignalTriggerer component = ((Component)other).GetComponent<SignalTriggerer>();
if ((Object)(object)component != (Object)null)
{
if (component.activationKey == activationKey)
{
ModConsole.Msg("Trigger's key is " + activationKey + ", triggerer's key is " + component.activationKey, 1);
triggerEnterEvent.Invoke();
ModConsole.Msg("Invoked event", 1);
}
else
{
ModConsole.Msg("Object is not a triggerer, or is not the right key.", 1);
}
}
}
private void OnTriggerExit(Collider other)
{
SignalTriggerer component = ((Component)other).GetComponent<SignalTriggerer>();
if ((Object)(object)component != (Object)null)
{
if (component.activationKey == activationKey)
{
ModConsole.Msg("Trigger's key is " + activationKey + ", triggerer's key is " + component.activationKey, 1);
triggerExitEvent.Invoke();
ModConsole.Msg("Invoked event", 1);
}
else
{
ModConsole.Msg("Object is not a triggerer, or is not the right key.", 1);
}
}
}
public SignalTrigger(IntPtr ptr)
: base(ptr)
{
}
}
public class SignalTriggerer : MonoBehaviour
{
public string activationKey;
public void Start()
{
ModConsole.Msg("SignalTriggerer spawned, key is " + activationKey, 1);
}
public SignalTriggerer(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.Rigidbodies
{
public class ForceZone : MonoBehaviour
{
public List<Rigidbody> inTriggerRbs = new List<Rigidbody>();
public Vector3 forceAmount;
public Vector3 ForceAmount
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return forceAmount;
}
set
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
forceAmount = value;
}
}
private void OnTriggerEnter(Collider other)
{
if ((Object)(object)other.attachedRigidbody != (Object)null)
{
inTriggerRbs.Add(other.attachedRigidbody);
}
}
private void OnTriggerExit(Collider other)
{
if ((Object)(object)other.attachedRigidbody != (Object)null && inTriggerRbs.Contains(other.attachedRigidbody))
{
inTriggerRbs.Remove(other.attachedRigidbody);
}
}
private void Update()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
foreach (Rigidbody inTriggerRb in inTriggerRbs)
{
inTriggerRb.AddForce(forceAmount, (ForceMode)0);
}
}
public ForceZone(IntPtr ptr)
: base(ptr)
{
}
}
public class FreezeRigidbodies : MonoBehaviour
{
private GameObject rigManager;
private void Start()
{
GameObject val = GameObject.Find("[RigManager (Blank)]");
ModConsole.Msg("Got rigmanager", 1);
rigManager = val;
Rigidbody[] array = Il2CppArrayBase<Rigidbody>.op_Implicit(Object.FindObjectsOfType<Rigidbody>());
ModConsole.Msg("Got rigidbodies", 1);
Rigidbody[] array2 = array;
foreach (Rigidbody val2 in array2)
{
ModConsole.Msg("Giving existing kinematic RBs DoNotFreeze", 1);
if (!((Object)(object)((Component)val2).gameObject.GetComponent<DoNotFreeze>() != (Object)null) && !((Component)val2).transform.IsChildOf(rigManager.transform) && val2.isKinematic)
{
((Component)val2).gameObject.AddComponent<DoNotFreeze>();
}
}
}
public void Freeze()
{
if ((Object)(object)rigManager != (Object)null)
{
ModConsole.Msg("Getting rigidbodies", 1);
Rigidbody[] array = Il2CppArrayBase<Rigidbody>.op_Implicit(Object.FindObjectsOfType<Rigidbody>());
foreach (Rigidbody val in array)
{
if ((Object)(object)((Component)val).gameObject.GetComponent<DoNotFreeze>() != (Object)null)
{
ModConsole.Msg(((Object)((Component)val).gameObject).name + " has DoNotFreeze, skipping", 1);
}
else if (!((Component)val).transform.IsChildOf(rigManager.transform))
{
ModConsole.Msg("Froze all RBs", 1);
val.isKinematic = true;
}
}
}
else
{
ModConsole.Msg("Somehow, the rigmanager is null!");
}
}
public void Unfreeze()
{
if ((Object)(object)rigManager != (Object)null)
{
ModConsole.Msg("Getting all RBs", 1);
Rigidbody[] array = Il2CppArrayBase<Rigidbody>.op_Implicit(Object.FindObjectsOfType<Rigidbody>());
foreach (Rigidbody val in array)
{
if (!((Object)(object)((Component)val).gameObject.GetComponent<DoNotFreeze>() != (Object)null) && !((Component)val).transform.IsChildOf(rigManager.transform))
{
val.isKinematic = false;
}
}
}
else
{
ModConsole.Msg("Somehow, the rigmanager is null!", 1);
}
}
private void OnDestroy()
{
Unfreeze();
}
public FreezeRigidbodies(IntPtr ptr)
: base(ptr)
{
}
}
public class GravityChamber : MonoBehaviour
{
public List<RBGravityManager> inTriggerCol = new List<RBGravityManager>();
public Vector3 gravityAmount;
public bool ignoreRigManager;
public Vector3 GravityAmount
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return gravityAmount;
}
set
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
gravityAmount = value;
}
}
private void OnTriggerEnter(Collider other)
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)((Component)other).GetComponentInParent<Rigidbody>() != (Object)null) || !((Object)(object)((Component)((Component)other).GetComponentInParent<Rigidbody>()).GetComponent<RBGravityManager>() == (Object)null) || ((Object)(object)((Component)other).GetComponentInParent<RigManager>() != (Object)null && ignoreRigManager))
{
return;
}
((Component)((Component)other).GetComponentInParent<Rigidbody>()).gameObject.AddComponent<RBGravityManager>().gravityAmount = gravityAmount;
Rigidbody[] array = Il2CppArrayBase<Rigidbody>.op_Implicit(((Component)((Component)other).GetComponentInParent<Rigidbody>()).GetComponentsInChildren<Rigidbody>());
foreach (Rigidbody val in array)
{
if (val.isKinematic && (Object)(object)((Component)val).GetComponent<RBGravityManager>() == (Object)null)
{
((Component)val).gameObject.AddComponent<RBGravityManager>().gravityAmount = gravityAmount;
}
}
inTriggerCol.Add(((Component)((Component)other).GetComponentInParent<Rigidbody>()).GetComponent<RBGravityManager>());
}
private void OnTriggerExit(Collider other)
{
if (!inTriggerCol.Contains(((Component)((Component)other).GetComponentInParent<Rigidbody>()).GetComponent<RBGravityManager>()))
{
return;
}
((Component)other).GetComponentInParent<Rigidbody>().useGravity = true;
Object.Destroy((Object)(object)((Component)((Component)other).GetComponentInParent<Rigidbody>()).GetComponent<RBGravityManager>());
Rigidbody[] array = Il2CppArrayBase<Rigidbody>.op_Implicit(((Component)((Component)other).GetComponentInParent<Rigidbody>()).GetComponentsInChildren<Rigidbody>());
foreach (Rigidbody val in array)
{
if (val.isKinematic && (Object)(object)((Component)val).GetComponent<RBGravityManager>() != (Object)null)
{
Object.Destroy((Object)(object)((Component)val).GetComponent<RBGravityManager>());
}
}
inTriggerCol.Remove(((Component)((Component)other).GetComponentInParent<Rigidbody>()).GetComponent<RBGravityManager>());
}
[HideFromIl2Cpp]
private void OnGravityManagerDestroyed(RBGravityManager manager)
{
inTriggerCol.Remove(manager);
}
private void Update()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
foreach (RBGravityManager item in inTriggerCol)
{
if ((Object)(object)item != (Object)null)
{
item.gravityAmount = gravityAmount;
}
}
}
public GravityChamber(IntPtr ptr)
: base(ptr)
{
}
}
public class RBGravityManager : MonoBehaviour
{
public Rigidbody thisRb;
public Vector3 gravityAmount;
[NonSerialized]
private Action<RBGravityManager> onDestroyed;
public Vector3 GravityAmount
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return gravityAmount;
}
set
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
gravityAmount = value;
}
}
private void Start()
{
thisRb = ((Component)this).GetComponent<Rigidbody>();
if ((Object)(object)thisRb != (Object)null)
{
thisRb.useGravity = false;
}
}
private void FixedUpdate()
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)thisRb != (Object)null)
{
thisRb.AddForce(gravityAmount * thisRb.mass, (ForceMode)0);
}
}
private void OnDestroy()
{
onDestroyed?.Invoke(this);
}
public RBGravityManager(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.PlayerUtil
{
public class ApplyRigManager : MonoBehaviour
{
public bool playerLeash;
public Simple_PlayerLeasher playerLeasher;
public bool playerLaunchPad;
public PlayerLaunchPad[] playerLaunchPads;
public bool forceAvatar;
public ForceAvatar[] forceAvatars;
public bool randomAvatar;
public RandomAvatar[] randomAvatars;
public RigManager _rigManager;
public void Apply()
{
_rigManager = Player.rigManager;
ModConsole.Msg($"Playerleash is {playerLeash}", 1);
ModConsole.Msg($"PlayerLaunchPad is {playerLaunchPad}", 1);
ModConsole.Msg($"ForceAvatar is {forceAvatar}", 1);
ModConsole.Msg($"RandomAvatar is {randomAvatar}", 1);
if (playerLeash)
{
ModConsole.Msg("Executing PlayerLeash", 1);
PlayerLeash();
}
if (playerLaunchPad)
{
ModConsole.Msg("Executing PlayerLaunchPad", 1);
PlayerLaunchPad();
}
if (forceAvatar)
{
ModConsole.Msg("Executing ForceAvatar", 1);
ForceAvatar();
}
if (randomAvatar)
{
ModConsole.Msg("Executing RandomAvatar", 1);
RandomAvatar();
}
}
public void PlayerLeash()
{
playerLeasher.rM = _rigManager;
ModConsole.Msg($"PlayerLeasher RM is {playerLeasher.rM}", 1);
((Component)playerLeasher).gameObject.SetActive(true);
}
public void PlayerLaunchPad()
{
PlayerLaunchPad[] array = playerLaunchPads;
foreach (PlayerLaunchPad val in array)
{
val.rigManager = _rigManager;
ModConsole.Msg($"PlayerLaunchPad RM is {val.rigManager}", 1);
((Component)val).gameObject.SetActive(true);
}
}
public void ForceAvatar()
{
ForceAvatar[] array = forceAvatars;
foreach (ForceAvatar val in array)
{
ModConsole.Msg($"ForceAvatar RM is {val.rm}", 1);
val.rm = _rigManager;
((Component)val).gameObject.SetActive(true);
}
}
public void RandomAvatar()
{
RandomAvatar[] array = randomAvatars;
foreach (RandomAvatar val in array)
{
ModConsole.Msg($"RandomAvatar RM is {val.rm}", 1);
val.rm = _rigManager;
((Component)val).gameObject.SetActive(true);
}
}
public ApplyRigManager(IntPtr ptr)
: base(ptr)
{
}
}
public class RagdollOnCollide : MonoBehaviour
{
public float delayBeforeUnragdoll = 2f;
private RigManager _rigManager;
private void OnCollisionEnter()
{
Collider component = ((Component)this).GetComponent<Collider>();
_rigManager = ((Component)component).GetComponentInParent<RigManager>();
if ((Object)(object)_rigManager != (Object)null)
{
_rigManager.physicsRig.RagdollRig();
((MonoBehaviour)this).Invoke("Unragdoll", delayBeforeUnragdoll);
}
}
private void Unragdoll()
{
_rigManager.physicsRig.UnRagdollRig();
}
public RagdollOnCollide(IntPtr ptr)
: base(ptr)
{
}
}
public class RagdollZone : MonoBehaviour
{
public float delayBeforeUnragdoll = 2f;
private RigManager _rigManager;
private void OnTriggerEnter(Collider other)
{
_rigManager = ((Component)other).GetComponentInParent<RigManager>();
if ((Object)(object)_rigManager != (Object)null)
{
_rigManager.physicsRig.RagdollRig();
((MonoBehaviour)this).Invoke("Unragdoll", delayBeforeUnragdoll);
}
}
private void Unragdoll()
{
_rigManager.physicsRig.UnRagdollRig();
}
public RagdollZone(IntPtr ptr)
: base(ptr)
{
}
}
public class RigManagerControl : MonoBehaviour
{
public void RagDoll()
{
Player.physicsRig.RagdollRig();
}
public void UnRagDoll()
{
Player.physicsRig.UnRagdollRig();
}
public void Teleport(Vector3 feetPos)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
Player.rigManager.Teleport(feetPos, true);
}
public void Teleport(Vector3 feetPos, bool zerovelocity)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
Player.rigManager.Teleport(feetPos, zerovelocity);
}
public void Invincible()
{
Player.rigManager.health.healthMode = (HealthMode)0;
}
public void Mortal()
{
Player.rigManager.health.healthMode = (HealthMode)1;
}
public void InstantDeath()
{
Player.rigManager.health.healthMode = (HealthMode)2;
}
public void EnableDoubleJump()
{
Player.remapRig.doubleJump = true;
}
public void DisableDoubleJump()
{
Player.remapRig.doubleJump = false;
}
public RigManagerControl(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.Markers
{
public class DoNotDestroy : MonoBehaviour
{
public DoNotDestroy(IntPtr ptr)
: base(ptr)
{
}
}
public class DoNotFreeze : MonoBehaviour
{
public DoNotFreeze(IntPtr ptr)
: base(ptr)
{
}
}
public class VoidCounterObject : MonoBehaviour
{
public bool disableDespsawnDelay;
public VoidCounterObject(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.LabFusion
{
public class BitShop : MonoBehaviour
{
public int bitsRequired;
public UltEvent purchaseEvent;
public UltEvent noBitsEvent;
public void Purchase()
{
if (PointItemManager.GetBitCount() >= bitsRequired)
{
purchaseEvent.Invoke();
PointItemManager.DecrementBits(bitsRequired, true);
}
else
{
noBitsEvent.Invoke();
}
}
public BitShop(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.Groups
{
public class GroupIdentifier : MonoBehaviour
{
public UltEvent onGroupJoin;
public UltEvent onGroupTrigger;
public string currectGroupID { get; set; }
private void Update()
{
if (currectGroupID == "null")
{
currectGroupID = null;
}
}
public GroupIdentifier(IntPtr ptr)
: base(ptr)
{
}
}
public class GroupProxy : MonoBehaviour
{
public void TriggerGroupByID(string id)
{
if (id == "null")
{
return;
}
foreach (GroupIdentifier item in Object.FindObjectsOfType<GroupIdentifier>())
{
if (item.currectGroupID == id)
{
item.onGroupTrigger.Invoke();
}
}
}
public void AddObjectToGroup(GameObject obj, string id)
{
if (!(id == "null"))
{
GroupIdentifier component = obj.GetComponent<GroupIdentifier>();
if ((Object)(object)component != (Object)null)
{
component.currectGroupID = id;
component.onGroupJoin.Invoke();
}
}
}
public string GetGroupFromObject(GameObject obj)
{
GroupIdentifier component = obj.GetComponent<GroupIdentifier>();
if ((Object)(object)component != (Object)null)
{
return component.currectGroupID;
}
return "null";
}
public bool DoesGroupExist(string id)
{
foreach (GroupIdentifier item in Object.FindObjectsOfType<GroupIdentifier>())
{
if (item.currectGroupID == id)
{
return true;
}
}
return false;
}
public GroupProxy(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.Misc
{
public class PlungerButBetter : MonoBehaviour
{
public enum DetectionType
{
Trigger,
Collision
}
public Rigidbody baseRB;
public DetectionType detectionType;
public float minimumForce;
public float breakForce;
public UltEvent onAttach;
public UltEvent onDetach;
private bool _isAttached;
public Rigidbody connectedRigidbody { get; set; }
public FixedJoint joint { get; set; }
public void OnTriggerEnter(Collision collision)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
if (detectionType != 0)
{
return;
}
connectedRigidbody = collision.rigidbody;
Vector3 relativeVelocity = collision.relativeVelocity;
if (((Vector3)(ref relativeVelocity)).sqrMagnitude >= minimumForce)
{
joint = ((Component)baseRB).gameObject.AddComponent<FixedJoint>();
((Joint)joint).breakForce = breakForce;
if ((Object)(object)connectedRigidbody != (Object)null)
{
((Joint)joint).connectedBody = connectedRigidbody;
}
PlungerListener component = ((Component)baseRB).GetComponent<PlungerListener>();
if ((Object)(object)component == (Object)null)
{
((Component)baseRB).gameObject.AddComponent<PlungerListener>();
}
else
{
component.plunger = this;
component.joint = joint;
}
onAttach.Invoke();
}
}
public void OnCollisionEnter(Collider collider)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
if (detectionType != DetectionType.Collision)
{
return;
}
connectedRigidbody = collider.attachedRigidbody;
Vector3 velocity = connectedRigidbody.velocity;
float sqrMagnitude = ((Vector3)(ref velocity)).sqrMagnitude;
velocity = baseRB.velocity;
if (((Vector3)(ref velocity)).sqrMagnitude >= minimumForce)
{
joint = ((Component)baseRB).gameObject.AddComponent<FixedJoint>();
((Joint)joint).breakForce = breakForce;
if ((Object)(object)connectedRigidbody != (Object)null)
{
((Joint)joint).connectedBody = connectedRigidbody;
}
PlungerListener component = ((Component)baseRB).GetComponent<PlungerListener>();
if ((Object)(object)component == (Object)null)
{
((Component)baseRB).gameObject.AddComponent<PlungerListener>();
}
else
{
component.plunger = this;
component.joint = joint;
}
onAttach.Invoke();
}
else if ((Object)(object)connectedRigidbody != (Object)null && sqrMagnitude >= minimumForce)
{
joint = ((Component)baseRB).gameObject.AddComponent<FixedJoint>();
((Joint)joint).breakForce = breakForce;
((Joint)joint).connectedBody = connectedRigidbody;
PlungerListener component2 = ((Component)baseRB).GetComponent<PlungerListener>();
if ((Object)(object)component2 == (Object)null)
{
((Component)baseRB).gameObject.AddComponent<PlungerListener>();
}
else
{
component2.plunger = this;
component2.joint = joint;
}
onAttach.Invoke();
}
}
public void Break()
{
_isAttached = false;
connectedRigidbody = null;
onDetach.Invoke();
}
public PlungerButBetter(IntPtr ptr)
: base(ptr)
{
}
}
public class PlungerListener : MonoBehaviour
{
public PlungerButBetter plunger { get; set; }
public FixedJoint joint { get; set; }
public void OnJointBreak(float breakForce)
{
if ((Object)(object)joint == (Object)null)
{
plunger.Break();
}
}
public PlungerListener(IntPtr ptr)
: base(ptr)
{
}
}
public class RealtimeAnalogClock : MonoBehaviour
{
public enum RotationEnum
{
XAxis,
YAxis,
ZAxis
}
public bool flip;
public RotationEnum rotationAxis;
public Transform hoursHand;
public Transform minutesHand;
public Transform secondsHand;
private const float HoursToDegrees = 30f;
private const float MinutesToDegrees = 6f;
private const float SecondsToDegrees = 6f;
private int _hours;
private int _minutes;
private int _seconds;
private void Update()
{
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_027b: Unknown result type (might be due to invalid IL or missing references)
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0318: Unknown result type (might be due to invalid IL or missing references)
//IL_033f: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
_hours = DateTime.Now.Hour;
_minutes = DateTime.Now.Minute;
_seconds = DateTime.Now.Second;
if (!flip)
{
switch (rotationAxis)
{
case RotationEnum.XAxis:
hoursHand.localRotation = Quaternion.Euler(-30f * (float)_hours, 0f, 0f);
minutesHand.localRotation = Quaternion.Euler(-6f * (float)_minutes, 0f, 0f);
secondsHand.localRotation = Quaternion.Euler(-6f * (float)_seconds, 0f, 0f);
break;
case RotationEnum.YAxis:
hoursHand.localRotation = Quaternion.Euler(0f, -30f * (float)_hours, 0f);
minutesHand.localRotation = Quaternion.Euler(0f, -6f * (float)_minutes, 0f);
secondsHand.localRotation = Quaternion.Euler(0f, -6f * (float)_seconds, 0f);
break;
case RotationEnum.ZAxis:
hoursHand.localRotation = Quaternion.Euler(0f, 0f, -30f * (float)_hours);
minutesHand.localRotation = Quaternion.Euler(0f, 0f, -6f * (float)_minutes);
secondsHand.localRotation = Quaternion.Euler(0f, 0f, -6f * (float)_seconds);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
else
{
switch (rotationAxis)
{
case RotationEnum.XAxis:
hoursHand.localRotation = Quaternion.Euler(30f * (float)_hours, 0f, 0f);
minutesHand.localRotation = Quaternion.Euler(6f * (float)_minutes, 0f, 0f);
secondsHand.localRotation = Quaternion.Euler(6f * (float)_seconds, 0f, 0f);
break;
case RotationEnum.YAxis:
hoursHand.localRotation = Quaternion.Euler(0f, 30f * (float)_hours, 0f);
minutesHand.localRotation = Quaternion.Euler(0f, 6f * (float)_minutes, 0f);
secondsHand.localRotation = Quaternion.Euler(0f, 6f * (float)_seconds, 0f);
break;
case RotationEnum.ZAxis:
hoursHand.localRotation = Quaternion.Euler(0f, 0f, 30f * (float)_hours);
minutesHand.localRotation = Quaternion.Euler(0f, 0f, 6f * (float)_minutes);
secondsHand.localRotation = Quaternion.Euler(0f, 0f, 6f * (float)_seconds);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
public RealtimeAnalogClock(IntPtr ptr)
: base(ptr)
{
}
}
public class RecordingEvents : MonoBehaviour
{
public bool invokeOnStart;
public UltEvent ifObsRecording;
public UltEvent ifNotRecording;
private void Start()
{
if (invokeOnStart)
{
if (Utilities.IsObsRecording)
{
ifObsRecording.Invoke();
}
else
{
ifNotRecording.Invoke();
}
}
}
public void Invoke()
{
if (Utilities.IsObsRecording)
{
ifObsRecording.Invoke();
}
else
{
ifNotRecording.Invoke();
}
}
}
public class ScoreKeeper : MonoBehaviour
{
public TextMeshPro player1Score;
public TextMeshPro player2Score;
public bool scoreLimit;
public int scoreLimitValue = 5;
private int player1ScoreValue;
private int player2ScoreValue;
public UltEvent onPlayer1Score;
public UltEvent onPlayer2Score;
public UltEvent onScoreLimitReached;
public UltEvent onPlayer1Win;
public UltEvent onPlayer2Win;
public void Player1Scored()
{
player1ScoreValue++;
((TMP_Text)player1Score).text = player1ScoreValue.ToString();
onPlayer1Score.Invoke();
if (scoreLimit && player1ScoreValue == scoreLimitValue)
{
onScoreLimitReached.Invoke();
onPlayer1Win.Invoke();
Reset();
}
}
public void Player2Scored()
{
player2ScoreValue++;
((TMP_Text)player2Score).text = player2ScoreValue.ToString();
onPlayer2Score.Invoke();
if (scoreLimit && player2ScoreValue == scoreLimitValue)
{
onScoreLimitReached.Invoke();
onPlayer2Win.Invoke();
Reset();
}
}
public void Reset()
{
player1ScoreValue = 0;
player2ScoreValue = 0;
((TMP_Text)player1Score).text = player1ScoreValue.ToString();
((TMP_Text)player2Score).text = player2ScoreValue.ToString();
}
public ScoreKeeper(IntPtr ptr)
: base(ptr)
{
}
}
public class SetAudioMixer : MonoBehaviour
{
public bool applyToAudioSource;
public MixerType audioSourceMixerType;
public AudioSource[] audioSources;
public bool applyToImpactSfx;
public MixerType impactSfxMixerType;
public ImpactSFX[] impactSfxs;
public bool applyToGunSfx;
public MixerType gunSfxGunshotMixerType = MixerType.Gunshot;
public MixerType gunSfxInteractionMixerType;
public GunSFX[] gunSfxs;
private void Start()
{
if (applyToAudioSource && audioSources.Length != 0)
{
AudioSource[] array = audioSources;
for (int i = 0; i < array.Length; i++)
{
array[i].outputAudioMixerGroup = GetMixerGroup(audioSourceMixerType);
}
}
if (applyToImpactSfx && impactSfxs.Length != 0)
{
ImpactSFX[] array2 = impactSfxs;
for (int i = 0; i < array2.Length; i++)
{
array2[i].outputMixer = GetMixerGroup(impactSfxMixerType);
}
}
if (applyToGunSfx && gunSfxs.Length != 0)
{
GunSFX[] array3 = gunSfxs;
foreach (GunSFX obj in array3)
{
obj.gunshotOutputMixer = GetMixerGroup(gunSfxGunshotMixerType);
obj.interactionOutputMixer = GetMixerGroup(gunSfxInteractionMixerType);
}
}
}
private static AudioMixerGroup GetMixerGroup(MixerType type)
{
AudioMixerGroup result = null;
switch (type)
{
case MixerType.Sfx:
result = Audio.SFXMixer;
break;
case MixerType.Music:
result = Audio.MusicMixer;
break;
case MixerType.Gunshot:
result = Audio.GunshotMixer;
break;
case MixerType.Master:
result = Audio.MasterMixer;
break;
default:
ModConsole.Error("MixerType not set properly!");
break;
}
return result;
}
public SetAudioMixer(IntPtr ptr)
: base(ptr)
{
}
}
public class DestroyOnCollision : MonoBehaviour
{
private bool activeState;
public AudioSource audioSource;
public GameObject[] excludedObjects;
private Transform rigManager;
private Blip blip;
public void Disable()
{
activeState = false;
}
public void Enable()
{
activeState = true;
}
private void Start()
{
GameObject obj = GameObject.Find("[RigManager (Blank)]");
rigManager = ((obj != null) ? obj.transform : null);
ModConsole.Msg("Rigmanager is " + ((Object)((Component)rigManager).gameObject).name, 1);
}
private void OnCollisionEnter(Collision collision)
{
if (activeState && !collision.transform.IsChildOf(rigManager) && collision.gameObject.layer != 13 && !IsObjectExcluded(collision.gameObject) && !Object.op_Implicit((Object)(object)collision.gameObject.GetComponent<DoNotDestroy>()))
{
Rigidbody componentInParent = ((Component)collision.transform).GetComponentInParent<Rigidbody>();
if ((Object)(object)componentInParent != (Object)null)
{
blip = ((Component)((Component)componentInParent).transform).GetComponent<Blip>();
}
if ((Object)(object)blip != (Object)null)
{
blip.CallSpawnEffect();
}
audioSource.Play();
ModConsole.Msg("Destroying " + ((Object)collision.gameObject).name, 1);
Object.Destroy((Object)(object)collision.gameObject);
}
}
public DestroyOnCollision(IntPtr ptr)
: base(ptr)
{
}
private bool IsObjectExcluded(GameObject obj)
{
GameObject[] array = excludedObjects;
foreach (GameObject val in array)
{
if ((Object)(object)obj == (Object)(object)val)
{
ModConsole.Msg($"Ignoring {val}", 1);
return true;
}
}
return false;
}
}
public class InvokeIfLibInstalled : MonoBehaviour
{
public UltEvent ifInstalled;
public void Awake()
{
ifInstalled.Invoke();
}
public InvokeIfLibInstalled(IntPtr ptr)
: base(ptr)
{
}
}
public class InvokeWhenCounter : MonoBehaviour
{
public float counter;
public float countersNeeded = 5f;
public UltEvent onCounterHit;
public void Add(float value)
{
counter += value;
if (counter == countersNeeded)
{
onCounterHit.Invoke();
counter = 0f;
}
}
public void Subtract(float value)
{
counter -= value;
}
public float GetCounter()
{
return counter;
}
public InvokeWhenCounter(IntPtr ptr)
: base(ptr)
{
}
}
public class PhotonThruster : MonoBehaviour
{
public float thrustForce = 100f;
public GameObject particles;
public bool useText;
public TextMeshPro textMeshPro;
public float incrementAmount = 50f;
public float decrementAmount = 50f;
public float maximumForce = 500f;
public float minimumForce = 50f;
private bool _thrustEnabled;
private Rigidbody _thisrb;
private Vector3 _vectorizedForce;
public float ThrustForce
{
get
{
return thrustForce;
}
set
{
thrustForce = value;
}
}
private void Awake()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
_thisrb = ((Component)this).GetComponent<Rigidbody>();
((TMP_Text)textMeshPro).text = thrustForce.ToString("F1");
_vectorizedForce = new Vector3(0f, 0f, thrustForce);
}
public void Toggle()
{
if (_thrustEnabled)
{
_thrustEnabled = false;
particles.SetActive(false);
}
else
{
_thrustEnabled = true;
particles.SetActive(true);
}
}
public void IncreaseForce()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
if (thrustForce > maximumForce)
{
thrustForce += incrementAmount;
_vectorizedForce = new Vector3(0f, 0f, thrustForce);
}
else
{
thrustForce = maximumForce;
_vectorizedForce = new Vector3(0f, 0f, thrustForce);
}
if (useText)
{
UpdateTextValue(incrementAmount, subtract: false);
}
}
public void DecreaseForce()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
if (thrustForce < minimumForce)
{
thrustForce -= decrementAmount;
_vectorizedForce = new Vector3(0f, 0f, thrustForce);
}
else
{
thrustForce = minimumForce;
_vectorizedForce = new Vector3(0f, 0f, thrustForce);
}
if (useText)
{
UpdateTextValue(decrementAmount, subtract: true);
}
}
public void UpdateTextValue(float value, bool subtract)
{
if (subtract)
{
float num = float.Parse(((TMP_Text)textMeshPro).text);
num -= value;
if (num < minimumForce)
{
num = minimumForce;
}
((TMP_Text)textMeshPro).text = num.ToString("F1");
}
else
{
float num2 = float.Parse(((TMP_Text)textMeshPro).text);
num2 += value;
if (num2 > maximumForce)
{
num2 = maximumForce;
}
((TMP_Text)textMeshPro).text = num2.ToString("F1");
}
}
private void FixedUpdate()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
if (_thrustEnabled)
{
_thisrb.AddRelativeForce(_vectorizedForce);
}
}
public PhotonThruster(IntPtr ptr)
: base(ptr)
{
}
}
public class RandomAudioPlayer : MonoBehaviour
{
public AudioSource[] audioSources;
private void Start()
{
if (audioSources.Length == 0)
{
ModConsole.Msg("No audiosources assigned!", 1);
}
}
public void PlayRandomSound()
{
if (audioSources.Length != 0)
{
int num = Random.Range(0, audioSources.Length);
audioSources[num].Play();
}
else
{
ModConsole.Msg("No audiosources assigned!", 1);
}
}
public RandomAudioPlayer(IntPtr ptr)
: base(ptr)
{
}
}
public class SimpleCounter : MonoBehaviour
{
public UltEvent onCounterHit;
public float counter { get; set; }
public void Add(float value)
{
counter += value;
}
public void Subtract(float value)
{
counter -= value;
}
public float GetCounter()
{
return counter;
}
public SimpleCounter(IntPtr ptr)
: base(ptr)
{
}
}
public class SpawnOnTriggerEnter : MonoBehaviour
{
public GameObject objectToSpawn;
public bool divideVelocity;
public float divideByX = 10f;
public float divideByY = 10f;
public float divideByZ = 10f;
public Vector3 minimumScale = new Vector3(1f, 1f, 1f);
public Vector3 maximumScale = new Vector3(200f, 200f, 200f);
public bool uniformScale = true;
public float uniformScaleMinimum = 1f;
public float uniformScaleMaximum = 200f;
public float uniformScaleDivision = 10f;
public bool ignoreSpawnedObjects;
public bool fixedRotation = true;
public Quaternion rotation = new Quaternion(0f, 0f, 1f, 0f);
public float minimumVelocity = 0.5f;
public bool fixedY = true;
public float YValue;
private Vector3 rbVelocity;
private List<GameObject> spawnedObjects = new List<GameObject>();
private GameObject spawnedObject;
private void OnTriggerEnter(Collider other)
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_0242: Unknown result type (might be due to invalid IL or missing references)
//IL_0257: Unknown result type (might be due to invalid IL or missing references)
//IL_026c: Unknown result type (might be due to invalid IL or missing references)
//IL_027b: Unknown result type (might be due to invalid IL or missing references)
//IL_0280: Unknown result type (might be due to invalid IL or missing references)
//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)objectToSpawn == (Object)null || (spawnedObjects.Contains(((Component)((Component)other).transform.root).gameObject) && ignoreSpawnedObjects))
{
return;
}
Vector3 velocity = other.attachedRigidbody.velocity;
if (((Vector3)(ref velocity)).sqrMagnitude < minimumVelocity)
{
return;
}
if (fixedRotation)
{
if (fixedY)
{
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(((Component)other).transform.position.x, YValue, ((Component)other).transform.position.z);
spawnedObject = Object.Instantiate<GameObject>(objectToSpawn, val, rotation);
}
else
{
spawnedObject = Object.Instantiate<GameObject>(objectToSpawn, ((Component)other).transform.position, rotation);
}
}
else if (fixedY)
{
Vector3 val2 = default(Vector3);
((Vector3)(ref val2))..ctor(((Component)other).transform.position.x, YValue, ((Component)other).transform.position.z);
spawnedObject = Object.Instantiate<GameObject>(objectToSpawn, val2, ((Component)other).transform.rotation);
}
else
{
spawnedObject = Object.Instantiate<GameObject>(objectToSpawn, ((Component)other).transform.position, ((Component)other).transform.rotation);
}
if (!uniformScale)
{
float num = Mathf.Clamp(Mathf.Abs(other.attachedRigidbody.velocity.x) / divideByX, minimumScale.x, maximumScale.x);
float num2 = Mathf.Clamp(Mathf.Abs(other.attachedRigidbody.velocity.y) / divideByY, minimumScale.y, maximumScale.y);
float num3 = Mathf.Clamp(Mathf.Abs(other.attachedRigidbody.velocity.z) / divideByZ, minimumScale.z, maximumScale.z);
rbVelocity = new Vector3(num, num2, num3);
spawnedObject.transform.localScale = Vector3.Scale(rbVelocity, spawnedObject.transform.lossyScale);
}
else
{
rbVelocity = new Vector3(Mathf.Abs(other.attachedRigidbody.velocity.x), Mathf.Abs(other.attachedRigidbody.velocity.y), Mathf.Abs(other.attachedRigidbody.velocity.z));
float num4 = Mathf.Clamp(((Vector3)(ref rbVelocity)).sqrMagnitude / uniformScaleDivision, uniformScaleMinimum, uniformScaleMaximum);
Vector3 localScale = default(Vector3);
((Vector3)(ref localScale))..ctor(num4, num4, num4);
spawnedObject.transform.localScale = localScale;
}
}
public SpawnOnTriggerEnter(IntPtr ptr)
: base(ptr)
{
}//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
}
public class TimescaleController : MonoBehaviour
{
public float incrementValue = 0.5f;
private float timeScale = 1f;
public void ScaleTime()
{
if (timeScale >= 0.1f)
{
Time.timeScale = timeScale;
}
else
{
ModConsole.Msg("Scale cannot be negative!", 1);
}
}
private void FixedUpdate()
{
ScaleTime();
}
public void IncreaseTimeScale()
{
float num = timeScale;
timeScale = num + incrementValue;
ModConsole.Msg($"Increasing timeScale by {incrementValue}, now {timeScale}", 1);
}
public void DecreaseTimeScale()
{
float num = timeScale;
float num2 = num - incrementValue;
if (num >= 0.1f)
{
timeScale = num2;
ModConsole.Msg($"Decreasing timeScale by {incrementValue}, now {num2}", 1);
}
else
{
ModConsole.Msg("Scale cannot be negative!", 1);
}
}
private void OnDestroy()
{
Time.timeScale = 1f;
}
public TimescaleController(IntPtr ptr)
: base(ptr)
{
}
}
public class TLE_SimpleRaycast : MonoBehaviour
{
public Vector3 SimpleSendRay(float maxDistance, Transform firePoint)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(firePoint.position, firePoint.forward, ref val, maxDistance))
{
return ((RaycastHit)(ref val)).transform.position;
}
return firePoint.position + firePoint.forward * maxDistance;
}
public GameObject SendRay(float maxDistance, Transform firePoint)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
RaycastHit val = default(RaycastHit);
Physics.Raycast(firePoint.position, firePoint.forward, ref val, maxDistance);
return ((Component)((RaycastHit)(ref val)).collider).gameObject;
}
public TLE_SimpleRaycast(IntPtr ptr)
: base(ptr)
{
}
}
public class UpdateTMP : MonoBehaviour
{
public TextMeshPro textMeshPro;
public float startingValue = 1f;
public float incrementAmount = 0.5f;
public float minValue = 0.1f;
private float currentValue;
private void Start()
{
ModConsole.Msg($"Starting value is {startingValue}", 1);
currentValue = startingValue;
UpdateTextValue();
}
private void UpdateTextValue()
{
((TMP_Text)textMeshPro).text = currentValue.ToString("F1");
}
public void IncreaseValue()
{
currentValue += incrementAmount;
ModConsole.Msg($"Increasing value by {incrementAmount}, now {currentValue}", 1);
UpdateTextValue();
}
public void DecreaseValue()
{
currentValue -= incrementAmount;
ModConsole.Msg($"Decreasing value by {incrementAmount}, now {currentValue}", 1);
if (currentValue < 0.1f)
{
ModConsole.Msg("Value should not be lower than 0.1!", 1);
currentValue = minValue;
}
UpdateTextValue();
}
public UpdateTMP(IntPtr ptr)
: base(ptr)
{
}
}
public class FindClosestRigManager : MonoBehaviour
{
public List<RigManager> rigsToIgnore = new List<RigManager>();
private RigManager _closestRig;
public void SetIgnoredRig(RigManager rm)
{
rigsToIgnore.Clear();
rigsToIgnore.Add(rm);
}
public void AddIgnoredRig(RigManager rm)
{
rigsToIgnore.Add(rm);
}
public void RemoveIgnoredRig(RigManager rm)
{
rigsToIgnore.Remove(rm);
}
public Transform FindClosestRig()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
RigManager[] array = Il2CppArrayBase<RigManager>.op_Implicit(Object.FindObjectsOfType<RigManager>());
foreach (RigManager val in array)
{
if ((Object)(object)_closestRig == (Object)null)
{
_closestRig = val;
}
else if (Vector3.Distance(((Component)this).transform.position, ((Component)((Rig)_closestRig.physicsRig).m_chest).transform.position) > Vector3.Distance(((Component)this).transform.position, ((Component)((Rig)val.physicsRig).m_chest).transform.position))
{
_closestRig = val;
}
}
return ((Component)_closestRig).transform;
}
public FindClosestRigManager(IntPtr ptr)
: base(ptr)
{
}
}
public class GetRigFromGrip : MonoBehaviour
{
public RigManager GetRig(Grip grip)
{
return ((Component)grip.GetHand()).GetComponentInParent<RigManager>();
}
public GetRigFromGrip(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.Marrow
{
public class CoolerSpawnablePlacer : MonoBehaviour
{
public SpawnableCrateReference spawnableCrateReference;
public SpawnPolicyData spawnPolicy;
public bool manualMode;
public bool ignorePolicy;
public UltEvent onPlaceEvent;
public bool IgnorePolicy
{
get
{
return ignorePolicy;
}
set
{
ignorePolicy = value;
}
}
private void Start()
{
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected O, but got Unknown
//IL_0064: Expected O, but got Unknown
if (!manualMode)
{
if ((Object)(object)spawnPolicy == (Object)null)
{
SpawnCrate.Spawn(new Spawnable
{
crateRef = spawnableCrateReference
}, ((Component)this).transform.position, Quaternion.identity, ignorePolicy, delegate
{
});
}
else
{
SpawnCrate.Spawn(new Spawnable
{
crateRef = spawnableCrateReference,
policyData = spawnPolicy
}, ((Component)this).transform.position, Quaternion.identity, ignorePolicy, delegate
{
});
}
onPlaceEvent.Invoke();
}
}
public void Spawn()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Expected O, but got Unknown
//IL_0059: Expected O, but got Unknown
if ((Object)(object)spawnPolicy == (Object)null)
{
SpawnCrate.Spawn(new Spawnable
{
crateRef = spawnableCrateReference
}, ((Component)this).transform.position, Quaternion.identity, ignorePolicy, delegate
{
});
}
else
{
SpawnCrate.Spawn(new Spawnable
{
crateRef = spawnableCrateReference,
policyData = spawnPolicy
}, ((Component)this).transform.position, Quaternion.identity, ignorePolicy, delegate
{
});
}
onPlaceEvent.Invoke();
}
public void SpawnWithForce(Vector3 force)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Expected O, but got Unknown
if ((Object)(object)spawnPolicy == (Object)null)
{
SpawnCrate.Spawn(new Spawnable
{
crateRef = spawnableCrateReference
}, ((Component)this).transform.position, Quaternion.identity, ignorePolicy, delegate(GameObject go)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
go.GetComponent<Rigidbody>().AddRelativeForce(force);
});
}
else
{
SpawnCrate.Spawn(new Spawnable
{
crateRef = spawnableCrateReference,
policyData = spawnPolicy
}, ((Component)this).transform.position, Quaternion.identity, ignorePolicy, delegate(GameObject go)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
go.GetComponent<Rigidbody>().AddRelativeForce(force);
});
}
onPlaceEvent.Invoke();
}
public CoolerSpawnablePlacer(IntPtr ptr)
: base(ptr)
{
}
}
public class DespawnPooledObject : MonoBehaviour
{
private GameObject _self;
private AssetPoolee _assetPoolee;
private void Start()
{
_self = ((Component)this).gameObject;
_assetPoolee = ((Component)this).gameObject.GetComponent<AssetPoolee>();
}
public void Despawn()
{
if ((Object)(object)_assetPoolee != (Object)null)
{
_self.SetActive(false);
_assetPoolee.Despawn();
}
}
public DespawnPooledObject(IntPtr ptr)
: base(ptr)
{
}
}
}
namespace TheLibraryElectric.Environment
{
public class TimeCycleHandler : MonoBehaviour
{
public Light sun;
public float yAxis;
public float zAxis;
public float nightLightIntensity = 0.001f;
public float dayLightIntensity = 1f;
public Color dayColor = Color.white;
public Color nightColor = Color.black;
public ReflectionProbe[] reflectionProbes;
public float nightIntensity = 0.4f;
public float dayIntensity = 1f;
public float nightStartHour = 19f;
public float nightEndHour = 6f;
private void Update()
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
DateTime now = DateTime.Now;
float num = now.Hour;
float num2 = now.Minute;
float num3 = now.Second;
float num4 = num * 3600f + num2 * 60f + num3;
float num5 = 90f - num4 / 86400f * 360f;
((Component)sun).transform.rotation = Quaternion.Euler(0f - num5, yAxis, zAxis);
ReflectionProbe[] array = reflectionProbes;
for (int i = 0; i < array.Length; i++)
{
array[i].intensity = CalculateIntensity(num, light: false);
}
sun.intensity = CalculateIntensity(num, light: true);
sun.color = CalculateColor(num);
}
private float CalculateIntensity(float hours, bool light)
{
if (light)
{
if (hours >= nightStartHour || hours < nightEndHour)
{
return nightLightIntensity;
}
return dayLightIntensity;
}
if (hours >= nightStartHour || hours < nightEndHour)
{
return nightIntensity;
}
return dayIntensity;
}
private Color CalculateColor(float hours)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
if (hours >= nightStartHour || hours < nightEndHour)
{
return nightColor;
}
return dayColor;
}
public TimeCycleHandler(IntPtr ptr)
: base(ptr)
{
}//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
}
}
namespace TheLibraryElectric.Melon
{
internal static class ModConsole
{
private static Instance _logger;
public static void Setup(Instance loggerInstance)
{
_logger = loggerInstance;
}
public static void Msg(object obj, int loggingMode = 0)
{
string text = ((loggingMode == 1) ? $"[DEBUG] {obj}" : obj.ToString());
ConsoleColor consoleColor = ((loggingMode == 1) ? ConsoleColor.Yellow : ConsoleColor.Gray);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Msg(consoleColor, text);
}
}
public static void Msg(string txt, int loggingMode = 0)
{
string text = ((loggingMode == 1) ? ("[DEBUG] " + txt) : txt);
ConsoleColor consoleColor = ((loggingMode == 1) ? ConsoleColor.Yellow : ConsoleColor.Gray);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Msg(consoleColor, text);
}
}
public static void Msg(ConsoleColor txtcolor, object obj, int loggingMode = 0)
{
string text = ((loggingMode == 1) ? $"[DEBUG] {obj}" : obj.ToString());
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Msg(txtcolor, text);
}
}
public static void Msg(ConsoleColor txtcolor, string txt, int loggingMode = 0)
{
string text = ((loggingMode == 1) ? ("[DEBUG] " + txt) : txt);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Msg(txtcolor, text);
}
}
public static void Msg(string txt, int loggingMode = 0, params object[] args)
{
string text = ((loggingMode == 1) ? ("[DEBUG] " + txt) : txt);
ConsoleColor consoleColor = ((loggingMode == 1) ? ConsoleColor.Yellow : ConsoleColor.Gray);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Msg(consoleColor, text, args);
}
}
public static void Msg(ConsoleColor txtcolor, string txt, int loggingMode = 0, params object[] args)
{
string text = ((loggingMode == 1) ? ("[DEBUG] " + txt) : txt);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Msg(txtcolor, text, args);
}
}
public static void Error(object obj, int loggingMode = 0)
{
string text = ((loggingMode == 1) ? $"[DEBUG] {obj}" : obj.ToString());
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Error(text);
}
}
public static void Error(string txt, int loggingMode = 0)
{
string text = ((loggingMode == 1) ? ("[DEBUG] " + txt) : txt);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Error(text);
}
}
public static void Error(string txt, int loggingMode = 0, params object[] args)
{
string text = ((loggingMode == 1) ? ("[DEBUG] " + txt) : txt);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Error(text, args);
}
}
public static void Warning(object obj, int loggingMode = 0)
{
string text = ((loggingMode == 1) ? $"[DEBUG] {obj}" : obj.ToString());
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Warning(text);
}
}
public static void Warning(string txt, int loggingMode = 0)
{
string text = ((loggingMode == 1) ? ("[DEBUG] " + txt) : txt);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Warning(text);
}
}
public static void Warning(string txt, int loggingMode = 0, params object[] args)
{
string text = ((loggingMode == 1) ? ("[DEBUG] " + txt) : txt);
if (Preferences.loggingMode.Value >= loggingMode)
{
_logger.Warning(text, args);
}
}
}
internal static class Preferences
{
public static readonly MelonPreferences_Category GlobalCategory = MelonPreferences.CreateCategory("Global");
public static MelonPreferences_Entry<int> loggingMode;
public static void Setup()
{
loggingMode = GlobalCategory.GetEntry<int>("LoggingMode") ?? GlobalCategory.CreateEntry<int>("LoggingMode", 0, "Logging Mode", "The level of logging to use. 0 = Important Only, 1 = All", false, false, (ValueValidator)null, (string)null);
GlobalCategory.SetFilePath(MelonUtils.UserDataDirectory + "/WeatherElectric.cfg");
GlobalCategory.SaveToFile(false);
ModConsole.Msg("Finished preferences setup for The Library Electric", 1);
}
}
}
namespace TheLibraryElectric.InternalHelpers
{
public static class SpawnCrate
{
public static void Spawn(Spawnable spawnable, Vector3 position, Quaternion rotation, bool ignorePolicy, Action<GameObject> callback)
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
AssetSpawner.Register(spawnable);
Action<GameObject> action = delegate(GameObject go)
{
callback(go);
};
AssetSpawner.Spawn(spawnable, position, rotation, BoxedNullable<Vector3>.op_Implicit(new BoxedNullable<Vector3>((Vector3?)null)), ignorePolicy, BoxedNullable<int>.op_Implicit(new BoxedNullable<int>((int?)null)), Action<GameObject>.op_Implicit(action), (Action<GameObject>)null);
}
}
}
namespace TheLibraryElectric.Helpers
{
public static class ColliderHelper
{
public static void SetTrigger(Collider collider, bool b)
{
collider.isTrigger = b;
}
public static bool GetTrigger(Collider collider)
{
return collider.isTrigger;
}
public static Rigidbody GetRigidbody(Collider collider)
{
return collider.attachedRigidbody;
}
public static GameObject GetGameObject(Collider collider)
{
return ((Component)collider).gameObject;
}
}
public static class RigidBodyHelper
{
public static void SetKinematic(Rigidbody body, bool b)
{
body.isKinematic = b;
}
public static bool GetKinematic(Rigidbody body)
{
return body.isKinematic;
}
public static void SetUseGravity(Rigidbody body, bool b)
{
body.useGravity = b;
}
public static bool GetUseGravity(Rigidbody body)
{
return body.useGravity;
}
public static void SetMass(Rigidbody body, float mass)
{
body.mass = mass;
}
public static float GetMass(Rigidbody body)
{
return body.mass;
}
public static void AddForce(Rigidbody body, Vector3 force)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
body.AddForce(force);
}
public static void AddTorque(Rigidbody body, Vector3 torque)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
body.AddTorque(torque);
}
public static void SetFreezeRotation(Rigidbody body, bool freezeRotation)
{
body.freezeRotation = freezeRotation;
}
public static bool GetFreezeRotation(Rigidbody body)
{
return body.freezeRotation;
}
}
public static class RigManagerHelper
{
public static RigManager GetFromCollider(Collider collider)
{
return ((Component)collider).GetComponentInParent<RigManager>();
}
public static void RagDoll(RigManager rig)
{
rig.physicsRig.RagdollRig();
}
public static void UnRagDoll(RigManager rig)
{
rig.physicsRig.UnRagdollRig();
}
public static void Teleport(RigManager rig, Vector3 feetPos)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
rig.Teleport(feetPos, true);
}
public static void Teleport(RigManager rig, Vector3 feetPos, bool zerovelocity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
rig.Teleport(feetPos, zerovelocity);
}
public static void SetDoubleJump(RigManager rig, bool canDoubleJump)
{
rig.remapHeptaRig.doubleJump = canDoubleJump;
}
public static RigManager GetFromBonelib()
{
return Player.rigManager;
}
}
public static class TimeProxy
{
public static int GetMinute()
{
return DateTime.Now.Minute;
}
public static int GetHour()
{
return DateTime.Now.Hour;
}
public static bool IfAfterOrNow(float hour, float minute)
{
if (hour * 60f + minute <= (float)(GetHour() * 60 + GetMinute()))
{
return true;
}
return false;
}
public static bool IfBeforeOrNow(float hour, float minute)
{
if (hour * 60f + minute >= (float)(GetHour() * 60 + GetMinute()))
{
return true;
}
return false;
}
}
}