using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BoneLib;
using BoneLib.BoneMenu;
using BoneLib.BoneMenu.Elements;
using MelonLoader;
using MelonLoader.Preferences;
using PuppetMasta;
using SLZ.Interaction;
using SLZ.Marrow.Data;
using SLZ.Props;
using SuperMan;
using UnhollowerBaseLib;
using UnhollowerRuntimeLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Superman), "Superman", "1.0.0", "RSM && Joe", null)]
[assembly: AssemblyTitle("SuperMan")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuperMan")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b4703d13-ee01-4b87-b331-39364f0aa22a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SuperMan;
public static class EmebeddedAssetBundleLakatrazz
{
private static AssetBundle assetBundle;
public static AssetBundle LoadFromAssembly(Assembly assembly, string name)
{
string[] manifestResourceNames = assembly.GetManifestResourceNames();
string[] array = manifestResourceNames;
foreach (string text in array)
{
MelonLogger.Msg(text);
}
if (!manifestResourceNames.Contains(name) || true)
{
MelonLogger.Msg("Loading embedded bundle data " + name + "...", new object[1] { ConsoleColor.DarkCyan });
byte[] array2;
using (Stream stream = assembly.GetManifestResourceStream(name))
{
using MemoryStream memoryStream = new MemoryStream();
stream.CopyTo(memoryStream);
array2 = memoryStream.ToArray();
}
MelonLogger.Msg("Loading bundle from data " + name + "...", new object[1] { ConsoleColor.DarkCyan });
AssetBundle result = AssetBundle.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit(array2));
MelonLogger.Msg("Done!", new object[1] { ConsoleColor.DarkCyan });
return result;
}
return null;
}
internal static void LoadAssetBundle(Assembly executingAssembly, HeatVisionLaserComponent yes, HeatVisionLaserComponent yes2)
{
if ((Object)(object)assetBundle == (Object)null)
{
assetBundle = LoadFromAssembly(executingAssembly, "SuperMan.Resources.supermanmod.bundle");
}
if ((Object)(object)assetBundle == (Object)null)
{
throw new NullReferenceException("ASSET BUNDLE NULL; YOU SUCK AT PROGRAMMING JOE");
}
GameObject val = ((Il2CppObjectBase)assetBundle.LoadAsset("HEAT_LASER", Il2CppType.Of<GameObject>())).Cast<GameObject>();
LineRenderer val2 = (yes.heatLaser = Object.Instantiate<GameObject>(val).GetComponent<LineRenderer>());
yes.laserObject = ((Component)val2).gameObject;
yes2.laserObject = ((Component)(yes2.heatLaser = Object.Instantiate<GameObject>(val).GetComponent<LineRenderer>())).gameObject;
((Object)val2).hideFlags = (HideFlags)32;
assetBundle.Unload(false);
}
internal static void LoadSFX(Assembly executingAssembly)
{
if ((Object)(object)assetBundle == (Object)null)
{
assetBundle = LoadFromAssembly(executingAssembly, "SuperMan.Resources.supermanmod.bundle");
}
if ((Object)(object)assetBundle == (Object)null)
{
throw new NullReferenceException("ASSET BUNDLE NULL; YOU SUCK AT PROGRAMMING JOE");
}
GameObject val = Object.Instantiate<GameObject>(((Il2CppObjectBase)assetBundle.LoadAsset("HEAT_SFX", Il2CppType.Of<GameObject>())).Cast<GameObject>());
AudioSource component = val.GetComponent<AudioSource>();
Superman.heatSfx = component;
((Object)val).hideFlags = (HideFlags)32;
assetBundle.Unload(false);
}
internal static GameObject SpawnKryptonite(Assembly executingAssembly, Vector3 Position)
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)assetBundle == (Object)null)
{
assetBundle = LoadFromAssembly(executingAssembly, "SuperMan.Resources.supermanmod.bundle");
}
if ((Object)(object)assetBundle == (Object)null)
{
throw new NullReferenceException("ASSET BUNDLE NULL; YOU SUCK AT PROGRAMMING JOE");
}
GameObject val = Object.Instantiate<GameObject>(((Il2CppObjectBase)assetBundle.LoadAsset("kryptonite", Il2CppType.Of<GameObject>())).Cast<GameObject>());
val.transform.position = Position;
((Object)val).hideFlags = (HideFlags)32;
assetBundle.Unload(false);
return val;
}
}
[RegisterTypeInIl2Cpp]
internal class HeatVisionLaserComponent : MonoBehaviour
{
public GameObject eyeObj;
public GameObject laserObject;
public LineRenderer heatLaser;
public GameObject hitObject;
public Vector3 startPos;
public Vector3 endPos;
public bool laserEnabled;
private bool alreadyFound;
public HeatVisionLaserComponent(IntPtr ptr)
: base(ptr)
{
}
private void Start()
{
}
private void Update()
{
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: 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_022d: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: 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_020f: Unknown result type (might be due to invalid IL or missing references)
if (!Superman.heatenabled.Value || !Object.op_Implicit((Object)(object)heatLaser))
{
return;
}
if (laserEnabled && heatLaser.positionCount == 0)
{
EnableLaser();
((Behaviour)Superman.heatSfx).enabled = true;
Superman.heatSfx.Play();
}
else if (!laserEnabled)
{
EndLaser();
((Behaviour)Superman.heatSfx).enabled = true;
Superman.heatSfx.Stop();
return;
}
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(startPos + eyeObj.transform.forward / 6f, ((Component)((Component)Player.controllerRig).GetComponentInChildren<Camera>()).transform.forward, ref val, 10000f))
{
endPos = ((RaycastHit)(ref val)).point;
if ((Object)(object)hitObject == (Object)(object)((Component)((RaycastHit)(ref val)).collider).gameObject)
{
alreadyFound = true;
}
else
{
alreadyFound = false;
}
hitObject = ((Component)((RaycastHit)(ref val)).collider).gameObject;
if (!alreadyFound)
{
PuppetMaster componentInChildren = ((Component)hitObject.transform.root).GetComponentInChildren<PuppetMaster>();
ObjectDestructable componentInChildren2 = ((Component)hitObject.transform.root).GetComponentInChildren<ObjectDestructable>();
Prop_Health componentInChildren3 = ((Component)hitObject.transform.root).GetComponentInChildren<Prop_Health>();
if (Object.op_Implicit((Object)(object)componentInChildren))
{
componentInChildren.Kill();
}
if (Object.op_Implicit((Object)(object)componentInChildren2))
{
componentInChildren2.TakeDamage(Vector3.zero, float.MaxValue, true, (AttackType)0);
}
if (Object.op_Implicit((Object)(object)componentInChildren3))
{
componentInChildren3.TAKEDAMAGE(float.MaxValue, true, (AttackType)8);
}
Rigidbody component = hitObject.GetComponent<Rigidbody>();
if (component != null)
{
component.AddForce(eyeObj.transform.forward * 50f);
}
}
}
else
{
endPos = ((Component)((Component)Player.controllerRig).GetComponentInChildren<Camera>()).transform.forward * 1000f;
}
}
private void LateUpdate()
{
//IL_000d: 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_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_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
startPos = eyeObj.transform.position - new Vector3(0f, 0.1f, 0f);
if (Object.op_Implicit((Object)(object)heatLaser))
{
heatLaser.SetPositions(Il2CppStructArray<Vector3>.op_Implicit((Vector3[])(object)new Vector3[2] { startPos, endPos }));
}
}
public LineRenderer GetLaserRenderer()
{
return heatLaser;
}
public void EnableLaser()
{
heatLaser.positionCount = 2;
}
public void EndLaser()
{
heatLaser.positionCount = 0;
}
public void DestroyLaser()
{
Object.Destroy((Object)(object)heatLaser);
Object.Destroy((Object)(object)this);
}
}
public class Superman : MelonMod
{
private bool floating = false;
private bool firstPress = false;
private bool firstPress2 = false;
private float previousPressedTime;
private float previousPressedTime2;
internal static Assembly assembly;
internal HeatVisionLaserComponent laserLeft;
internal HeatVisionLaserComponent laserRight;
internal static AudioSource heatSfx;
public static Transform leftEye;
public static Transform rightEye;
public MelonPreferences_Category Category;
private MelonPreferences_Entry<bool> modtoggle;
private MelonPreferences_Entry<bool> canAirMove;
private MelonPreferences_Entry<bool> canStrength;
private MelonPreferences_Entry<bool> flydamp;
private MelonPreferences_Entry<bool> floatdamp;
private MelonPreferences_Entry<bool> canFly;
private MelonPreferences_Entry<bool> canFloat;
private MelonPreferences_Entry<bool> canHeat;
private MelonPreferences_Entry<bool> canFreeze;
private MelonPreferences_Entry<float> overallMutliplier;
private MelonPreferences_Entry<float> airmulti;
private MelonPreferences_Entry<float> Exponent;
private MelonPreferences_Entry<float> Divisor;
private MelonPreferences_Entry<float> GripMinimum;
private MelonPreferences_Entry<float> GripMaximum;
private MelonPreferences_Entry<float> doublePressDelay;
private MelonPreferences_Entry<float> doublePressDelay2;
private MelonPreferences_Entry<bool> canSpeed;
private MelonPreferences_Entry<float> overallMutliplierSpeed;
private MelonPreferences_Entry<float> overallMutliplierDist;
private Vector3 PosPrevFrLf;
private Vector3 PosPrevFrRt;
private Vector3 PlrPosCurFr;
private Vector3 PlrPosPrevFr;
private Vector3 PosCurFrLf;
private Vector3 PosCurFrRt;
public static MelonPreferences_Entry<bool> heatenabled;
public static MelonPreferences_Entry<bool> weightlessGrabbing;
public static float weightlessMass = 0.1f;
private bool canFlyControl = true;
private float floatstate = 0f;
private bool isfloatingDampRequired = false;
private bool isflyDampRequired = false;
private static bool funny;
private List<GameObject> kryptonite = new List<GameObject>();
private bool kryptonited = false;
[Obsolete]
public override void OnApplicationStart()
{
assembly = Assembly.GetExecutingAssembly();
}
public override void OnInitializeMelon()
{
//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
//IL_032b: Unknown result type (might be due to invalid IL or missing references)
//IL_035b: Unknown result type (might be due to invalid IL or missing references)
//IL_0378: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
//IL_0401: Unknown result type (might be due to invalid IL or missing references)
//IL_0429: Unknown result type (might be due to invalid IL or missing references)
//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0612: Unknown result type (might be due to invalid IL or missing references)
//IL_064a: Unknown result type (might be due to invalid IL or missing references)
//IL_0681: Unknown result type (might be due to invalid IL or missing references)
//IL_0694: Unknown result type (might be due to invalid IL or missing references)
//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
//IL_06f8: Unknown result type (might be due to invalid IL or missing references)
//IL_072e: Unknown result type (might be due to invalid IL or missing references)
//IL_07f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0807: Unknown result type (might be due to invalid IL or missing references)
//IL_0830: Unknown result type (might be due to invalid IL or missing references)
//IL_0867: Unknown result type (might be due to invalid IL or missing references)
//IL_087a: Unknown result type (might be due to invalid IL or missing references)
//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
Category = MelonPreferences.CreateCategory("Superman");
modtoggle = Category.CreateEntry<bool>("TOGGLED", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
canAirMove = Category.CreateEntry<bool>("AIRMOVEMENT", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
flydamp = Category.CreateEntry<bool>("FLYVELDAMP", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
floatdamp = Category.CreateEntry<bool>("FLOATVELDAMP", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
canSpeed = Category.CreateEntry<bool>("SPEED TOGGLE", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
canStrength = Category.CreateEntry<bool>("STRENGTH TOGGLE", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
weightlessGrabbing = Category.CreateEntry<bool>("WEIGHTLESS GRABBING TOGGLE", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
canFly = Category.CreateEntry<bool>("FLIGHT TOGGLE", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
canFloat = Category.CreateEntry<bool>("FLOAT TOGGLE", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
canHeat = Category.CreateEntry<bool>("HEAT TOGGLE", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
canFreeze = Category.CreateEntry<bool>("FREEZE TOGGLE", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
heatenabled = Category.CreateEntry<bool>("HEAT VISUAL TESTING", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
overallMutliplier = Category.CreateEntry<float>("OVERALL MUTLI", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
overallMutliplierSpeed = Category.CreateEntry<float>("SPEED MUTLI", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
overallMutliplierDist = Category.CreateEntry<float>("DISTANCE MUTLI", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
airmulti = Category.CreateEntry<float>("AIR MUTLI", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
Exponent = Category.CreateEntry<float>("EXPONENT", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
Divisor = Category.CreateEntry<float>("DIVISOR", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
GripMinimum = Category.CreateEntry<float>("GripMinimum", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
GripMaximum = Category.CreateEntry<float>("GripMaximum", 1.1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
doublePressDelay = Category.CreateEntry<float>("FloatDoubleTimespan", 0.3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
doublePressDelay2 = Category.CreateEntry<float>("FlyDoubleTimespan", 0.3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
MenuCategory val = MenuManager.CreateCategory("Superman", Color.white);
val.CreateFunctionElement("INFO: [TC] = To Come.", Color.yellow, (Action)delegate
{
});
val.CreateFunctionElement("INFO: [WIP] = Work In Progress.", Color.yellow, (Action)delegate
{
});
val.CreateFunctionElement("INFO: Yellow = Info OR Unstable.", Color.yellow, (Action)delegate
{
});
val.CreateFunctionElement("[TEST] Spawn Kryptonite", Color.white, (Action)delegate
{
//IL_0011: 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_0020: Unknown result type (might be due to invalid IL or missing references)
kryptonite.Add(EmebeddedAssetBundleLakatrazz.SpawnKryptonite(assembly, Player.playerHead.position + Player.playerHead.forward));
});
SubPanelElement val2 = val.CreateSubPanel("Mod Options", Color.red);
val2.CreateBoolElement("Mod Toggled", Color.red, modtoggle.Value, (Action<bool>)delegate(bool value)
{
modtoggle.Value = value;
});
val2.CreateBoolElement("Fly Toggled", Color.red, canFly.Value, (Action<bool>)delegate(bool value)
{
canFly.Value = value;
});
val2.CreateBoolElement("Float Toggled", Color.red, canFloat.Value, (Action<bool>)delegate(bool value)
{
canFloat.Value = value;
});
val2.CreateBoolElement("[WIP] Heat Toggle", Color.red, canHeat.Value, (Action<bool>)delegate(bool value)
{
canHeat.Value = value;
});
val2.CreateBoolElement("[TC] Freeze Toggle", Color.red, canFreeze.Value, (Action<bool>)delegate(bool value)
{
canFreeze.Value = value;
});
SubPanelElement val3 = val.CreateSubPanel("Flight Options", "#0063FF");
val3.CreateFloatElement("Overall Multiplier", "#0063FF", overallMutliplier.Value, 1f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
overallMutliplier.Value = value;
});
val3.CreateFloatElement("Magnitude Exponent", "#0063FF", Exponent.Value, 0.1f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
Exponent.Value = value;
});
val3.CreateFloatElement("Magnitude Divisor", "#0063FF", Divisor.Value, 0.1f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
Divisor.Value = value;
});
val3.CreateFloatElement("Grip Minimum", "#0063FF", GripMinimum.Value, 0.1f, 0f, 1.1f, (Action<float>)delegate(float value)
{
GripMinimum.Value = value;
});
val3.CreateFloatElement("Grip Maximum", "#0063FF", GripMaximum.Value, 0.1f, 0f, 1.1f, (Action<float>)delegate(float value)
{
GripMaximum.Value = value;
});
val3.CreateBoolElement("Fly Velocity Dampening", "#0063FF", flydamp.Value, (Action<bool>)delegate(bool value)
{
flydamp.Value = value;
});
SubPanelElement val4 = val.CreateSubPanel("Float Options", "#F200FA");
val4.CreateBoolElement("Float Velocity Dampening", "#F200FA", floatdamp.Value, (Action<bool>)delegate(bool value)
{
floatdamp.Value = value;
});
SubPanelElement val5 = val.CreateSubPanel("[WIP] SuperSpeed Options", Color.cyan);
val5.CreateBoolElement("SuperSpeed", Color.cyan, canSpeed.Value, (Action<bool>)delegate(bool value)
{
canSpeed.Value = value;
});
val5.CreateFloatElement("Overall Multiplier", Color.cyan, overallMutliplierSpeed.Value, 0.5f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
overallMutliplier.Value = value;
});
val5.CreateFloatElement("Distance Mutliplier", Color.cyan, overallMutliplierDist.Value, 0.5f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
overallMutliplier.Value = value;
});
SubPanelElement val6 = val.CreateSubPanel("[WIP] SuperStrength Options", Color.gray);
val5.CreateBoolElement("SuperStrength", Color.gray, canStrength.Value, (Action<bool>)delegate(bool value)
{
canStrength.Value = value;
});
val5.CreateBoolElement("Weightless Grabbing", Color.gray, weightlessGrabbing.Value, (Action<bool>)delegate(bool value)
{
weightlessGrabbing.Value = value;
});
val5.CreateBoolElement("weightless ungripping", Color.gray, funny, (Action<bool>)delegate(bool value)
{
funny = value;
});
val5.CreateFloatElement("Weightless Mass", Color.gray, weightlessMass, 0.1f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
weightlessMass = value;
});
SubPanelElement val7 = val.CreateSubPanel("Control Options", "#C000DC");
val7.CreateFloatElement("FloatDoubleTimespan", "#C000DC", doublePressDelay.Value, 0.05f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
doublePressDelay.Value = value;
});
val7.CreateFloatElement("FlyDoubleTimespan", "#C000DC", doublePressDelay2.Value, 0.05f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
doublePressDelay2.Value = value;
});
SubPanelElement val8 = val.CreateSubPanel("Mid-Air Options", Color.white);
val8.CreateBoolElement("Mid-Air Movement Enabled", Color.white, canAirMove.Value, (Action<bool>)delegate(bool value)
{
canAirMove.Value = value;
});
val8.CreateFloatElement("Multiplier", Color.white, airmulti.Value, 0.5f, 0f, float.MaxValue, (Action<float>)delegate(float value)
{
airmulti.Value = value;
});
SubPanelElement val9 = val.CreateSubPanel("[WIP] HeatVision Options", Color.white);
val9.CreateBoolElement("HeatVision Enabled", Color.yellow, heatenabled.Value, (Action<bool>)delegate(bool value)
{
heatenabled.Value = value;
});
val.CreateFunctionElement("INFO: Heat Vision WILL become a bind. For now its a togglable option.", Color.yellow, (Action)delegate
{
});
Hooking.OnLevelInitialized += OnLevelInitialized;
Hooking.OnGripAttached += OnGripAttatched;
Hooking.OnGripDetached += OnGripDetached;
}
private static void OnGripAttatched(Grip grip, Hand hand)
{
GameObject gameObject = ((Component)((Component)grip).transform.root).gameObject;
foreach (Rigidbody componentsInChild in gameObject.GetComponentsInChildren<Rigidbody>())
{
((Component)componentsInChild).gameObject.AddComponent<GrabbedObject>().RemoveWeight();
}
}
private static void OnGripDetached(Grip grip, Hand hand)
{
GameObject gameObject = ((Component)((Component)grip).transform.root).gameObject;
if (funny)
{
return;
}
foreach (Rigidbody componentsInChild in gameObject.GetComponentsInChildren<Rigidbody>())
{
((Component)componentsInChild).gameObject.GetComponent<GrabbedObject>()?.RestoreWeight();
}
}
private static void OnLevelInitialized(LevelInfo info)
{
leftEye = ((Component)Player.rigManager.animationRig).transform.Find("Head/eyeLf");
rightEye = ((Component)Player.rigManager.animationRig).transform.Find("Head/eyeRt");
MelonLogger.Msg(((Object)((Component)Player.rigManager.animationRig).transform.Find("Head/eyeRt")).name);
((Component)leftEye).gameObject.AddComponent<HeatVisionLaserComponent>().eyeObj = ((Component)leftEye).gameObject;
((Component)rightEye).gameObject.AddComponent<HeatVisionLaserComponent>().eyeObj = ((Component)rightEye).gameObject;
EmebeddedAssetBundleLakatrazz.LoadSFX(assembly);
EmebeddedAssetBundleLakatrazz.LoadAssetBundle(assembly, ((Component)leftEye).gameObject.GetComponent<HeatVisionLaserComponent>(), ((Component)rightEye).gameObject.GetComponent<HeatVisionLaserComponent>());
}
public override void OnDeinitializeMelon()
{
MelonPreferences.Save();
}
public override void OnUpdate()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: 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_020f: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01de: Unknown result type (might be due to invalid IL or missing references)
if (!modtoggle.Value || !Player.handsExist)
{
return;
}
foreach (GameObject item in kryptonite)
{
if (Vector3.Distance(Player.playerHead.position, item.transform.position) < 10f)
{
kryptonited = true;
}
else
{
kryptonited = true;
}
}
if (canSpeed.Value)
{
string text = "Mr.Pineapple Studio || i didnt want to code movement detection stuff.";
PosCurFrLf = ((Component)Player.leftHand).transform.position;
PosCurFrRt = ((Component)Player.rightHand).transform.position;
float num = Vector3.Distance(PosPrevFrLf, PosCurFrLf);
float num2 = Vector3.Distance(PosPrevFrRt, PosCurFrRt);
float num3 = (num + num2) * overallMutliplierDist.Value * 5f;
float num4 = num3 * overallMutliplierSpeed.Value * 5f;
if (Player.leftController._thumbstickAxis.y > 0f)
{
float num5 = Player.leftController._thumbstickAxis.y * num4;
Vector3 val = Player.controllerRig.directionMasterTransform.rotation * new Vector3(Player.leftController._thumbstickAxis.x, 0f, Player.leftController._thumbstickAxis.y) * num5;
Vector3 val2 = new Vector3(val.x, 0f, val.z) * 1f;
Player.physicsRig.torso.rbPelvis.AddForce(val2, (ForceMode)5);
((MelonBase)this).LoggerInstance.Msg((object)num5);
}
PosPrevFrLf = PosCurFrLf;
PosPrevFrRt = PosCurFrRt;
}
}
public override void OnFixedUpdate()
{
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: 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_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: 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_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: 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_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0405: Unknown result type (might be due to invalid IL or missing references)
if (!modtoggle.Value || !Player.handsExist || kryptonited)
{
return;
}
if (canAirMove.Value && floating)
{
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(Player.leftController._thumbstickAxis.x, 0f, Player.leftController._thumbstickAxis.y);
Vector3 val2 = Player.controllerRig.directionMasterTransform.rotation * val;
Vector3 val3 = val2 * airmulti.Value;
Player.physicsRig.torso.rbPelvis.AddForce(val3 * airmulti.Value, (ForceMode)1);
}
if (Player.rightController.GetGripForce() >= GripMinimum.Value && Player.rightController.GetGripForce() < GripMaximum.Value && !Player.rightController._thumbstick && Player.leftController.GetGripForce() >= GripMinimum.Value && Player.leftController.GetGripForce() < GripMaximum.Value && !Player.leftController._thumbstick && canFly.Value && canFlyControl)
{
Vector3 val4 = (((Component)Player.rightHand).transform.position + ((Component)Player.leftHand).transform.position) / 2f;
Vector3 val5 = (val4 + ((Component)Player.playerHead).transform.position) / 2f;
Vector3 val6 = (((Component)Player.rightHand).transform.forward + ((Component)Player.leftHand).transform.forward) / 2f;
float num = Mathf.Pow(Vector3.Distance(val5, Player.playerHead.position), Exponent.Value) / Divisor.Value;
Player.physicsRig.torso.rbPelvis.AddForceAtPosition(val6 * num * overallMutliplier.Value * Player.GetCurrentAvatar().massTotal, Player.playerHead.position, (ForceMode)1);
isflyDampRequired = true;
}
else
{
isflyDampRequired = false;
}
if (Player.rightController.GetBButtonDown() && canFloat.Value)
{
if (firstPress)
{
if (Time.unscaledTime - previousPressedTime <= doublePressDelay.Value)
{
float num2 = floatstate;
float num3 = num2;
if (num3 != 0f)
{
if (num3 != 1f)
{
if (num3 == 2f)
{
floatstate = 0f;
Player.physicsRig.torso.rbPelvis.constraints = (RigidbodyConstraints)4;
isfloatingDampRequired = true;
}
}
else
{
floatstate = 2f;
Player.physicsRig.torso.rbPelvis.constraints = (RigidbodyConstraints)(floatdamp.Value ? 4 : 0);
isfloatingDampRequired = true;
}
}
else
{
floatstate = 1f;
Player.physicsRig.torso.rbPelvis.constraints = (RigidbodyConstraints)0;
isfloatingDampRequired = false;
}
floating = !floating;
firstPress = false;
}
}
else
{
firstPress = true;
}
previousPressedTime = Time.unscaledTime;
}
if ((isfloatingDampRequired && floatdamp.Value) || (isflyDampRequired && flydamp.Value))
{
Rigidbody rbPelvis = Player.physicsRig.torso.rbPelvis;
rbPelvis.velocity /= 1.2f;
}
if (firstPress && Time.unscaledTime - previousPressedTime > doublePressDelay.Value)
{
firstPress = false;
}
if (Player.leftController.GetBButtonDown())
{
if (firstPress2)
{
if (Time.unscaledTime - previousPressedTime2 <= doublePressDelay2.Value)
{
canFlyControl = !canFlyControl;
firstPress2 = false;
}
}
else
{
firstPress2 = true;
}
previousPressedTime2 = Time.unscaledTime;
}
if (firstPress2 && Time.unscaledTime - previousPressedTime2 > doublePressDelay2.Value)
{
firstPress2 = false;
}
if (Player.leftController.GetGripForce() >= GripMinimum.Value && Player.leftController._thumbstick && Player.rightController.GetGripForce() >= GripMinimum.Value && Player.rightController._thumbstick)
{
((Component)leftEye).gameObject.GetComponent<HeatVisionLaserComponent>().laserEnabled = true;
((Component)rightEye).gameObject.GetComponent<HeatVisionLaserComponent>().laserEnabled = true;
}
else
{
((Component)leftEye).gameObject.GetComponent<HeatVisionLaserComponent>().laserEnabled = false;
((Component)rightEye).gameObject.GetComponent<HeatVisionLaserComponent>().laserEnabled = false;
}
}
}
[RegisterTypeInIl2Cpp]
public class GrabbedObject : MonoBehaviour
{
public float originalMass;
public float originalDrag;
public float originalAngularDrag;
private Rigidbody rb;
public GrabbedObject(IntPtr ptr)
: base(ptr)
{
}
private void Start()
{
rb = ((Component)this).gameObject.GetComponent<Rigidbody>();
}
public void RemoveWeight()
{
if (Superman.weightlessGrabbing.Value)
{
rb = rb ?? ((Component)this).gameObject.GetComponent<Rigidbody>();
originalMass = rb.mass;
originalDrag = rb.drag;
originalAngularDrag = rb.angularDrag;
rb.mass = Superman.weightlessMass;
rb.drag = 0.01f;
rb.angularDrag = 0.01f;
}
}
public void RestoreWeight()
{
if (Superman.weightlessGrabbing.Value)
{
rb = rb ?? ((Component)this).gameObject.GetComponent<Rigidbody>();
rb.mass = originalMass;
rb.drag = originalDrag;
rb.angularDrag = originalAngularDrag;
}
}
}