Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of Raising The Bar v1.1.0
RaisingTheBar.dll
Decompiled 10 months agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using HG.Reflection; using KinematicCharacterController; using On.EntityStates; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Projectile; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RaisingTheBar")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RaisingTheBar")] [assembly: AssemblyTitle("RaisingTheBar")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace RaissingTheBar; [Serializable] [BepInPlugin("com.brynzananas.raisingthebar", "Raising The Bar", "1.1.0")] [BepInDependency("com.bepis.r2api", "5.0.10")] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { public class RocketTestJumpComponent : MonoBehaviour { public float rocketJumpPower = 1f; public bool applyVelocity = true; public Vector3 addVelocity = Vector3.zero; private void FixedUpdate() { //IL_0066: 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_0071: 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_0059: Unknown result type (might be due to invalid IL or missing references) if (!applyVelocity) { return; } if (RocketJumpInheritVelocity.Value) { GameObject owner = ((Component)this).GetComponent<ProjectileController>().owner; CharacterBody val = ((owner != null) ? owner.GetComponent<CharacterBody>() : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.characterMotor)) { addVelocity = val.characterMotor.velocity; } } Rigidbody component = ((Component)this).GetComponent<Rigidbody>(); component.velocity += addVelocity; applyVelocity = false; } private void OnDisable() { //IL_002c: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_0117: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)this).GetComponent<ProjectileController>().owner.GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)component)) { return; } Vector3 position = ((Component)this).transform.position; Vector3 corePosition = component.corePosition; float num = Vector3.Distance(((Component)this).transform.position, component.footPosition); Vector3 zero = Vector3.zero; bool flag = true; Vector3 val = corePosition - position; zero = ((Vector3)(ref val)).normalized * rocketJumpPower; if (component.characterMotor.isGrounded && Object.op_Implicit((Object)(object)((Component)component).GetComponent<KinematicCharacterMotor>())) { ((Component)component).GetComponent<KinematicCharacterMotor>().ForceUnground(0.2f); } if (num < ((ProjectileExplosion)((Component)this).GetComponent<ProjectileImpactExplosion>()).blastRadius) { if (component.characterMotor.velocity.y < 0f) { component.characterMotor.velocity.y = 0f; } CharacterMotor characterMotor = component.characterMotor; characterMotor.velocity += zero * component.moveSpeed; } } } public struct LineDrawer { private LineRenderer lineRenderer; private float lineSize; public LineDrawer(Material material, float lineSize = 0.2f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("LineObj"); lineRenderer = val.AddComponent<LineRenderer>(); ((Renderer)lineRenderer).material = material; this.lineSize = lineSize; } private void init(Material material, float lineSize = 0.2f) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if ((Object)(object)lineRenderer == (Object)null) { GameObject val = new GameObject("LineObj"); lineRenderer = val.AddComponent<LineRenderer>(); ((Renderer)lineRenderer).material = material; this.lineSize = lineSize; } } public void DrawLineInGameView(Vector3 start, Vector3 end, Color color, Material material) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)lineRenderer == (Object)null) { init(material); } lineRenderer.startColor = color; lineRenderer.endColor = color; lineRenderer.startWidth = lineSize; lineRenderer.endWidth = lineSize; lineRenderer.positionCount = 2; lineRenderer.SetPosition(0, start); lineRenderer.SetPosition(1, end); } public void Destroy() { if ((Object)(object)lineRenderer != (Object)null) { Object.Destroy((Object)(object)((Component)lineRenderer).gameObject); } } } public const string ModGuid = "com.brynzananas.raisingthebar"; public const string ModName = "Raising The Bar"; public const string ModVer = "1.1.0"; public LineDrawer lineDrawer; public LineDrawer lineDrawer2; public static Shader bearMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Bear/matBear.mat").WaitForCompletion().shader; public Material lineDrawerMaterial = new Material(bearMaterial); public Material lineDrawer2Material = new Material(bearMaterial); public static GameObject rocketJumpTestRocket; public static ConfigEntry<bool> EnableBunnyHop; public static ConfigEntry<bool> EnableAutoJump; public static ConfigEntry<bool> EnableStrafe; public static ConfigEntry<bool> EnableStrafeDebug; public static ConfigEntry<bool> EnableDirectLook; public static ConfigEntry<bool> EnableRocketJump; public static ConfigEntry<KeyboardShortcut> RocketJumpKey; public static ConfigEntry<float> RocketJumpPower; public static ConfigEntry<float> RocketJumpRadius; public static ConfigEntry<float> RocketJumpSpeed; public static ConfigEntry<int> RocketJumpAmount; public static ConfigEntry<float> RocketJumpInterval; public static ConfigEntry<float> RocketJumpReload; public static ConfigEntry<bool> RocketJumpGravity; public static ConfigEntry<bool> RocketJumpInheritVelocity; public static ConfigEntry<bool> EnableVelocityText; public static ConfigEntry<bool> EnableRocketText; public static ConfigEntry<float> OutlineThickness; public static ConfigEntry<Color> VelocityTextColor; public static ConfigEntry<Color> VelocityOutlineColor; public static ConfigEntry<bool> EnableRainbowVelocityText; public static ConfigEntry<int> VelocityTextZeros; public static ConfigEntry<float> VelocityTextXPosition; public static ConfigEntry<float> VelocityTextYPosition; public static ConfigEntry<float> VelocityTextScale; public static ConfigEntry<Color> RocketAmountTextColor; public static ConfigEntry<Color> RocketReloadTextColor; public static ConfigEntry<Color> RocketAmountOutlineColor; public static ConfigEntry<Color> RocketReloadOutlineColor; public static ConfigEntry<bool> EnableRainbowRocketText; public static ConfigEntry<float> RocketTextXPosition; public static ConfigEntry<float> RocketTextYPosition; public static ConfigEntry<float> RocketTextScale; public static ConfigEntry<float> RocketTextSpace; public float intervalMaxTime; public float intervalTime; public float reloadMaxTime; public float reloadTime; public int rocketMaxAmount; public int rocketAmount; public Sprite modIcon; public bool jump = false; public int red = 255; public int green = 0; public int blue = 0; private HUD hud = null; public GameObject hudVelocityMeterObject; public GameObject hudRocketAmountObject; public GameObject hudRocketReloadObject; public RectTransform VelocityMeterRectTransform; public RectTransform RocketRectTransform; public RectTransform ReloadRectTransform; public bool enabledDebug = false; public CameraParamsOverrideHandle overrideHandle; private void Awake() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Expected O, but got Unknown //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Expected O, but got Unknown //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Expected O, but got Unknown //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Expected O, but got Unknown //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Expected O, but got Unknown //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Expected O, but got Unknown //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Expected O, but got Unknown //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Expected O, but got Unknown //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Expected O, but got Unknown //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Expected O, but got Unknown //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Expected O, but got Unknown //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Expected O, but got Unknown //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Expected O, but got Unknown //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Expected O, but got Unknown //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Expected O, but got Unknown //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Expected O, but got Unknown //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Expected O, but got Unknown //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Expected O, but got Unknown //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Expected O, but got Unknown //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Expected O, but got Unknown //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Expected O, but got Unknown //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Expected O, but got Unknown //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Expected O, but got Unknown //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Expected O, but got Unknown //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Expected O, but got Unknown //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Expected O, but got Unknown //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Expected O, but got Unknown //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Expected O, but got Unknown //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Expected O, but got Unknown //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Expected O, but got Unknown //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Expected O, but got Unknown //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Expected O, but got Unknown //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Expected O, but got Unknown //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Expected O, but got Unknown //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Expected O, but got Unknown //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Expected O, but got Unknown //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Expected O, but got Unknown //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Expected O, but got Unknown //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Expected O, but got Unknown //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Expected O, but got Unknown //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Expected O, but got Unknown //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Unknown result type (might be due to invalid IL or missing references) EnableBunnyHop = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable bunny hop", true, "Enable bunny hop function?"); EnableAutoJump = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable auto jump", false, "Enable auto jump function?"); EnableStrafe = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable strafing", true, "Enable strafing function?"); EnableStrafeDebug = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable debug mode", false, "Enable debug mode?\nBlue bar: current velocity\nRed bar: wish direction"); EnableDirectLook = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable direct look", true, "Enable direct look?"); EnableRocketJump = ((BaseUnityPlugin)this).Config.Bind<bool>("Rocket jump", "Enable rocket jump", true, "Enable rocket jump?"); RocketJumpKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Rocket jump", "Rocket jump key", new KeyboardShortcut((KeyCode)325, Array.Empty<KeyCode>()), "Key to fire a rocket jump rocket"); RocketJumpPower = ((BaseUnityPlugin)this).Config.Bind<float>("Rocket jump", "Rocket jump power", 3f, "Control rocket jump power value"); RocketJumpRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Rocket jump", "Rocket jump radius", 4.2f, "Control rocket jump explosion radius value"); RocketJumpSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Rocket jump", "Rocket jump speed", 42.2f, "Control rocket jump rocket speed"); RocketJumpGravity = ((BaseUnityPlugin)this).Config.Bind<bool>("Rocket jump", "Rocket jump gravity", true, "Enable gravity to rocket jump rocket?"); RocketJumpInheritVelocity = ((BaseUnityPlugin)this).Config.Bind<bool>("Rocket jump", "Rocket jump inherit velocity", true, "Enable velocity inheritance for rocket jump rocket?"); RocketJumpAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Rocket jump", "Rocket jump amount", 1, "Control the maximum amount of stored rocket jump rockets"); RocketJumpInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Rocket jump", "Rocket jump interval", 0.8f, "Control rocket jump firing interval time"); RocketJumpReload = ((BaseUnityPlugin)this).Config.Bind<float>("Rocket jump", "Rocket jump reload", 2f, "Control rocket jump reload time"); OutlineThickness = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Outline thickness", 1.2f, "Control thickness of outlines"); EnableVelocityText = ((BaseUnityPlugin)this).Config.Bind<bool>("HUD", "Enable velocity meter", true, "Enable velocity meter?"); VelocityTextZeros = ((BaseUnityPlugin)this).Config.Bind<int>("HUD", "Digits amount", 3, "Control ampount of digits"); VelocityTextColor = ((BaseUnityPlugin)this).Config.Bind<Color>("HUD", "Velocity meter color", Color.white, "Choose color of velocity meter"); VelocityOutlineColor = ((BaseUnityPlugin)this).Config.Bind<Color>("HUD", "Velocity meter outline color", Color.black, "Choose color of velocity meter outline"); EnableRainbowVelocityText = ((BaseUnityPlugin)this).Config.Bind<bool>("HUD", "Enable rainbow velocity meter", false, "or make it rainbow"); VelocityTextXPosition = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Velocity meter X position", 0f, "Control velocity meter X position"); VelocityTextYPosition = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Velocity meter Y position", -500f, "Control velocity meter Y position"); VelocityTextScale = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Velocity meter scale", 0.8f, "Control velocity meter scale"); EnableRocketText = ((BaseUnityPlugin)this).Config.Bind<bool>("HUD", "Enable rocket HUD", true, "Enable rocket HUD?"); RocketAmountTextColor = ((BaseUnityPlugin)this).Config.Bind<Color>("HUD", "Rocket amount color", Color.white, "Choose color of rocket amount"); RocketAmountOutlineColor = ((BaseUnityPlugin)this).Config.Bind<Color>("HUD", "Rocket amount outline color", Color.black, "Choose color of rocket amount outline"); RocketReloadTextColor = ((BaseUnityPlugin)this).Config.Bind<Color>("HUD", "Rocket reload timer color", Color.white, "Choose color of rocket reload timer"); RocketReloadOutlineColor = ((BaseUnityPlugin)this).Config.Bind<Color>("HUD", "Rocket reload timer outline color", Color.black, "Choose color of rocket reload timer outline"); EnableRainbowRocketText = ((BaseUnityPlugin)this).Config.Bind<bool>("HUD", "Enable rainbow rocket HUD", false, "or make it all rainbow"); RocketTextXPosition = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Rocket HUD X position", 0f, "Control rocket HUD X position"); RocketTextYPosition = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Rocket HUD Y position", -500f, "Control rocket HUD Y position"); RocketTextScale = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Rocket HUD scale", 0.8f, "Control rocket HUD scale"); RocketTextSpace = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Rocket HUD space", 100f, "Control the space between rocket amount and reload timer"); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableBunnyHop)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableAutoJump)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableStrafe)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableStrafeDebug)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableDirectLook)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableRocketJump)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(RocketJumpKey)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketJumpPower)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketJumpRadius)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketJumpSpeed)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(RocketJumpGravity)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(RocketJumpInheritVelocity)); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(RocketJumpAmount)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketJumpInterval)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketJumpReload)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(OutlineThickness)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableVelocityText)); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(VelocityTextZeros, new IntSliderConfig { min = 1, max = 10, restartRequired = false })); ModSettingsManager.AddOption((BaseOption)new ColorOption(VelocityTextColor)); ModSettingsManager.AddOption((BaseOption)new ColorOption(VelocityOutlineColor)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableRainbowVelocityText)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(VelocityTextXPosition)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(VelocityTextYPosition)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(VelocityTextScale)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableRocketText)); ModSettingsManager.AddOption((BaseOption)new ColorOption(RocketAmountTextColor)); ModSettingsManager.AddOption((BaseOption)new ColorOption(RocketAmountOutlineColor)); ModSettingsManager.AddOption((BaseOption)new ColorOption(RocketReloadTextColor)); ModSettingsManager.AddOption((BaseOption)new ColorOption(RocketReloadOutlineColor)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableRainbowRocketText)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketTextXPosition)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketTextYPosition)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketTextScale)); ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(RocketTextSpace)); GenericCharacterMain.ApplyJumpVelocity += new hook_ApplyJumpVelocity(BunnyHop); PlayerCharacterMasterController.Update += new hook_Update(Look); CharacterDirection.Simulate += new hook_Simulate(Look2); PlayerCharacterMasterController.FixedUpdate += new hook_FixedUpdate(Strafe); HUD.Awake += new hook_Awake(AwakeHud); HUD.Update += new hook_Update(UpdateNumbers); RocketJumpSpeed.SettingChanged += UpdateRocket; RocketJumpPower.SettingChanged += UpdateRocket; RocketJumpRadius.SettingChanged += UpdateRocket; RocketJumpGravity.SettingChanged += UpdateRocket; RocketJumpAmount.SettingChanged += UpdateRocket; RocketJumpInterval.SettingChanged += UpdateRocket; RocketJumpReload.SettingChanged += UpdateRocket; VelocityTextXPosition.SettingChanged += UpdateHUD; VelocityTextYPosition.SettingChanged += UpdateHUD; VelocityTextScale.SettingChanged += UpdateHUD; RocketTextXPosition.SettingChanged += UpdateHUD; RocketTextYPosition.SettingChanged += UpdateHUD; RocketTextScale.SettingChanged += UpdateHUD; RocketTextSpace.SettingChanged += UpdateHUD; OutlineThickness.SettingChanged += UpdateHUD; lineDrawer = default(LineDrawer); lineDrawer2 = default(LineDrawer); CreateProjectile(); intervalMaxTime = RocketJumpInterval.Value; reloadMaxTime = RocketJumpReload.Value; rocketMaxAmount = RocketJumpAmount.Value; intervalTime = intervalMaxTime; reloadTime = reloadMaxTime; rocketAmount = rocketMaxAmount; modIcon = LoadSpriteFromDisk(); lineDrawerMaterial.color = Color.blue; lineDrawer2Material.color = Color.red; if (Object.op_Implicit((Object)(object)modIcon)) { ModSettingsManager.SetModIcon(modIcon); } } private void UpdateHUD(object sender, EventArgs e) { //IL_0020: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_0213: Unknown result type (might be due to invalid IL or missing references) ((Transform)VelocityMeterRectTransform).localScale = new Vector3(VelocityTextScale.Value, VelocityTextScale.Value, 0f); ((Transform)VelocityMeterRectTransform).localPosition = new Vector3(0.5f, 0.5f, 0f); RectTransform velocityMeterRectTransform = VelocityMeterRectTransform; ((Transform)velocityMeterRectTransform).localPosition = ((Transform)velocityMeterRectTransform).localPosition + new Vector3(VelocityTextXPosition.Value, VelocityTextYPosition.Value, 0f); ((Transform)RocketRectTransform).localScale = new Vector3(RocketTextScale.Value, RocketTextScale.Value, 0f); ((Transform)ReloadRectTransform).localScale = new Vector3(RocketTextScale.Value, RocketTextScale.Value, 0f); ((Transform)RocketRectTransform).localPosition = new Vector3(0.5f, 0.5f, 0f); RectTransform rocketRectTransform = RocketRectTransform; ((Transform)rocketRectTransform).localPosition = ((Transform)rocketRectTransform).localPosition + new Vector3(RocketTextXPosition.Value - RocketTextSpace.Value / 2f, RocketTextYPosition.Value, 0f); ((Transform)ReloadRectTransform).localPosition = new Vector3(0.5f, 0.5f, 0f); RectTransform reloadRectTransform = ReloadRectTransform; ((Transform)reloadRectTransform).localPosition = ((Transform)reloadRectTransform).localPosition + new Vector3(RocketTextXPosition.Value + RocketTextSpace.Value / 2f, RocketTextYPosition.Value, 0f); ((Shadow)hudVelocityMeterObject.GetComponent<Outline>()).effectDistance = new Vector2(OutlineThickness.Value, OutlineThickness.Value); ((Shadow)hudRocketAmountObject.GetComponent<Outline>()).effectDistance = new Vector2(OutlineThickness.Value, OutlineThickness.Value); ((Shadow)hudRocketReloadObject.GetComponent<Outline>()).effectDistance = new Vector2(OutlineThickness.Value, OutlineThickness.Value); } private void UpdateRocket(object sender, EventArgs e) { //IL_0015: 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 ((Object)(object)rocketJumpTestRocket == (Object)null) { rocketJumpTestRocket = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ToolbotGrenadeLauncherProjectile.prefab").WaitForCompletion(), "rocketTestRocketJump", true); } rocketJumpTestRocket.GetComponent<ProjectileSimple>().desiredForwardSpeed = RocketJumpSpeed.Value; rocketJumpTestRocket.GetComponent<Rigidbody>().useGravity = true; ((ProjectileExplosion)rocketJumpTestRocket.GetComponent<ProjectileImpactExplosion>()).blastRadius = RocketJumpRadius.Value; if (!Object.op_Implicit((Object)(object)rocketJumpTestRocket.GetComponent<RocketTestJumpComponent>())) { RocketTestJumpComponent rocketTestJumpComponent = rocketJumpTestRocket.AddComponent<RocketTestJumpComponent>(); rocketTestJumpComponent.rocketJumpPower = RocketJumpPower.Value; } else { rocketJumpTestRocket.GetComponent<RocketTestJumpComponent>().rocketJumpPower = RocketJumpPower.Value; } intervalMaxTime = RocketJumpInterval.Value; reloadMaxTime = RocketJumpReload.Value; rocketMaxAmount = RocketJumpAmount.Value; } private void CreateProjectile() { //IL_0015: 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 ((Object)(object)rocketJumpTestRocket == (Object)null) { rocketJumpTestRocket = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ToolbotGrenadeLauncherProjectile.prefab").WaitForCompletion(), "rocketTestRocketJump", true); } NetworkIdentity component = rocketJumpTestRocket.GetComponent<NetworkIdentity>(); if (!Object.op_Implicit((Object)(object)component)) { rocketJumpTestRocket.AddComponent<NetworkIdentity>(); } rocketJumpTestRocket.GetComponent<ProjectileSimple>().desiredForwardSpeed = RocketJumpSpeed.Value; rocketJumpTestRocket.GetComponent<Rigidbody>().useGravity = true; ((ProjectileExplosion)rocketJumpTestRocket.GetComponent<ProjectileImpactExplosion>()).blastRadius = RocketJumpRadius.Value; if (!Object.op_Implicit((Object)(object)rocketJumpTestRocket.GetComponent<RocketTestJumpComponent>())) { RocketTestJumpComponent rocketTestJumpComponent = rocketJumpTestRocket.AddComponent<RocketTestJumpComponent>(); rocketTestJumpComponent.rocketJumpPower = RocketJumpPower.Value; } else { rocketJumpTestRocket.GetComponent<RocketTestJumpComponent>().rocketJumpPower = RocketJumpPower.Value; } PrefabAPI.RegisterNetworkPrefab(rocketJumpTestRocket); ContentAddition.AddProjectile(rocketJumpTestRocket); } private void Look2(orig_Simulate orig, CharacterDirection self, float deltaTime) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (!EnableDirectLook.Value || !((Component)self).GetComponent<CharacterBody>().isPlayerControlled) { orig.Invoke(self, deltaTime); return; } Vector3 moveVector = self.moveVector; float turnSpeed = self.turnSpeed; self.turnSpeed = 2880f; self.moveVector = ((Component)self).GetComponent<InputBankTest>().aimDirection; orig.Invoke(self, deltaTime); self.turnSpeed = turnSpeed; self.moveVector = moveVector; } private Sprite LoadSpriteFromDisk() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) string path = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "icon.png"); if (!File.Exists(path)) { return null; } byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2); if (ImageConversion.LoadImage(val, array)) { return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } return null; } private void Strafe(orig_FixedUpdate orig, PlayerCharacterMasterController self) { //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)self.body)) { return; } if (EnableStrafe.Value && Object.op_Implicit((Object)(object)self.body) && self.body.isPlayerControlled && Object.op_Implicit((Object)(object)self.body.characterMotor) && !self.body.characterMotor.isGrounded) { if (!self.body.characterMotor.disableAirControlUntilCollision) { self.body.characterMotor.disableAirControlUntilCollision = true; } self.body.characterMotor.airControl = 0.001f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(self.body.characterMotor.velocity.x, 0f, self.body.characterMotor.velocity.z); Vector3 val2 = new Vector3(self.body.inputBank.moveVector.x, 0f, self.body.inputBank.moveVector.z); Vector3 normalized = ((Vector3)(ref val2)).normalized; float num = Vector3.Dot(((Vector3)(ref val)).normalized, normalized); if ((double)num < 0.1 && (double)num > -0.1) { CharacterMotor characterMotor = self.body.characterMotor; characterMotor.velocity += new Vector3(normalized.x, 0f, normalized.z); } } orig.Invoke(self); if (intervalTime > 0f) { intervalTime -= Time.fixedDeltaTime; } if (rocketAmount < rocketMaxAmount + self.body.skillLocator.secondaryBonusStockSkill.bonusStockFromBody) { if (reloadTime > 0f) { reloadTime -= Time.fixedDeltaTime; } if (reloadTime <= 0f) { Util.PlaySound("Play_bandit2_m1_reload_bullet", ((Component)self.body).gameObject); rocketAmount++; reloadTime = reloadMaxTime * self.body.skillLocator.utility.cooldownScale; } } } private void UpdateNumbers(orig_Update orig, HUD self) { //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0291: 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_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (red >= 255 && blue <= 0) { green++; } if (green >= 255 && red > 0) { red--; } if (green >= 255 && red <= 0) { blue++; } if (blue >= 255 && green > 0) { green--; } if (blue >= 255 && green <= 0) { red++; } if (red >= 255 && blue > 0) { blue--; } if (Object.op_Implicit((Object)(object)hudVelocityMeterObject) && Object.op_Implicit((Object)(object)self.targetMaster) && Object.op_Implicit((Object)(object)self.targetMaster.GetBody()) && Object.op_Implicit((Object)(object)self.targetMaster.GetBody().characterMotor)) { float num = 0f; float num2 = 0f; if (EnableVelocityText.Value) { Text component = hudVelocityMeterObject.GetComponent<Text>(); Vector2 val = new Vector2(self.targetMaster.GetBody().characterMotor.velocity.x, self.targetMaster.GetBody().characterMotor.velocity.z); component.text = ((int)(((Vector2)(ref val)).magnitude * (float)(int)Math.Pow(10.0, VelocityTextZeros.Value) / 100f)).ToString(); num = VelocityTextColor.Value.a; num2 = VelocityOutlineColor.Value.b; } Color color = default(Color); ((Color)(ref color))..ctor(VelocityTextColor.Value.r, VelocityTextColor.Value.g, VelocityTextColor.Value.b, num); Color effectColor = default(Color); ((Color)(ref effectColor))..ctor(VelocityOutlineColor.Value.r, VelocityOutlineColor.Value.g, VelocityOutlineColor.Value.b, num); if (EnableRainbowVelocityText.Value) { ((Color)(ref color))..ctor((float)red / 255f, (float)green / 255f, (float)blue / 255f, num); } ((Graphic)hudVelocityMeterObject.GetComponent<Text>()).color = color; ((Shadow)hudVelocityMeterObject.GetComponent<Outline>()).effectColor = effectColor; } if (Object.op_Implicit((Object)(object)hudRocketAmountObject) && Object.op_Implicit((Object)(object)hudRocketReloadObject)) { string text = hudRocketReloadObject.GetComponent<Text>().text; hudRocketAmountObject.GetComponent<Text>().text = rocketAmount.ToString(); text = ((float)(int)(reloadTime * 10f) / 10f).ToString().Replace(",", "."); if (!text.Contains(".")) { text += ".0"; } hudRocketReloadObject.GetComponent<Text>().text = text; float num3 = 0f; float num4 = 0f; if (EnableRocketJump.Value && EnableRocketText.Value) { num3 = RocketAmountTextColor.Value.a; num4 = RocketAmountOutlineColor.Value.b; } Color color2 = default(Color); ((Color)(ref color2))..ctor(RocketAmountTextColor.Value.r, RocketAmountTextColor.Value.g, RocketAmountTextColor.Value.b, num3); Color effectColor2 = default(Color); ((Color)(ref effectColor2))..ctor(RocketAmountOutlineColor.Value.r, RocketAmountOutlineColor.Value.g, RocketAmountOutlineColor.Value.b, num3); if (EnableRainbowRocketText.Value) { ((Color)(ref color2))..ctor((float)red / 255f, (float)green / 255f, (float)blue / 255f, num3); } ((Graphic)hudRocketAmountObject.GetComponent<Text>()).color = color2; ((Shadow)hudRocketAmountObject.GetComponent<Outline>()).effectColor = effectColor2; if (EnableRocketJump.Value && EnableRocketText.Value) { num3 = RocketReloadTextColor.Value.a; num4 = RocketReloadOutlineColor.Value.a; } else { num3 = 0f; num4 = 0f; } if (EnableRainbowRocketText.Value) { ((Color)(ref color2))..ctor((float)red / 255f, (float)green / 255f, (float)blue / 255f, num3); ((Color)(ref effectColor2))..ctor(RocketReloadOutlineColor.Value.r, RocketReloadOutlineColor.Value.g, RocketReloadOutlineColor.Value.b, num3); } else { ((Color)(ref color2))..ctor(RocketReloadTextColor.Value.r, RocketReloadTextColor.Value.g, RocketReloadTextColor.Value.b, num3); ((Color)(ref effectColor2))..ctor(RocketReloadOutlineColor.Value.r, RocketReloadOutlineColor.Value.g, RocketReloadOutlineColor.Value.b, num3); } ((Graphic)hudRocketReloadObject.GetComponent<Text>()).color = color2; ((Shadow)hudRocketReloadObject.GetComponent<Outline>()).effectColor = effectColor2; } } private void OnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HUD.Awake -= new hook_Awake(AwakeHud); } private void AwakeHud(orig_Awake orig, HUD self) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0058: 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_007a: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Expected O, but got Unknown //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Expected O, but got Unknown //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); hud = self; hudVelocityMeterObject = new GameObject("velocityMeter"); hudVelocityMeterObject.transform.SetParent(hud.mainContainer.transform); VelocityMeterRectTransform = hudVelocityMeterObject.AddComponent<RectTransform>(); VelocityMeterRectTransform.anchorMin = Vector2.zero; VelocityMeterRectTransform.anchorMax = Vector2.one; VelocityMeterRectTransform.sizeDelta = Vector2.zero; VelocityMeterRectTransform.pivot = new Vector2(0.5f, 0.5f); VelocityMeterRectTransform.anchoredPosition = new Vector2(0.5f, 0.5f); ((Transform)VelocityMeterRectTransform).localScale = Vector2.op_Implicit(new Vector2(VelocityTextScale.Value, VelocityTextScale.Value)); RectTransform velocityMeterRectTransform = VelocityMeterRectTransform; ((Transform)velocityMeterRectTransform).localPosition = ((Transform)velocityMeterRectTransform).localPosition + new Vector3(VelocityTextXPosition.Value, VelocityTextYPosition.Value, 0f); hudVelocityMeterObject.AddComponent<Text>(); hudVelocityMeterObject.GetComponent<Text>().font = Addressables.LoadAssetAsync<Font>((object)"RoR2/Base/Common/Fonts/Bombardier/BOMBARD_.ttf").WaitForCompletion(); hudVelocityMeterObject.GetComponent<Text>().fontStyle = (FontStyle)0; hudVelocityMeterObject.GetComponent<Text>().fontSize = 32; hudVelocityMeterObject.GetComponent<Text>().lineSpacing = 1f; hudVelocityMeterObject.GetComponent<Text>().supportRichText = true; hudVelocityMeterObject.GetComponent<Text>().alignment = (TextAnchor)4; hudVelocityMeterObject.GetComponent<Text>().alignByGeometry = true; hudVelocityMeterObject.GetComponent<Text>().horizontalOverflow = (HorizontalWrapMode)0; hudVelocityMeterObject.GetComponent<Text>().verticalOverflow = (VerticalWrapMode)1; hudVelocityMeterObject.GetComponent<Text>().resizeTextForBestFit = true; hudVelocityMeterObject.GetComponent<Text>().text = "Your current velocity"; ((Object)hudVelocityMeterObject.GetComponent<Text>()).name = "currentVelocity"; ((Graphic)hudVelocityMeterObject.GetComponent<Text>()).color = Color.white; ((Graphic)hudVelocityMeterObject.GetComponent<Text>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Fonts/Bombardier/BOMBARD_.ttf").WaitForCompletion(); Outline val = hudVelocityMeterObject.AddComponent<Outline>(); ((Shadow)val).effectColor = Color.black; ((Shadow)val).effectDistance = new Vector2(OutlineThickness.Value, OutlineThickness.Value); hudRocketAmountObject = new GameObject("rocketMeter"); hudRocketAmountObject.transform.SetParent(hud.mainContainer.transform); RocketRectTransform = hudRocketAmountObject.AddComponent<RectTransform>(); RocketRectTransform.anchorMin = Vector2.zero; RocketRectTransform.anchorMax = Vector2.one; RocketRectTransform.sizeDelta = Vector2.zero; RocketRectTransform.pivot = new Vector2(0.5f, 0.5f); RocketRectTransform.anchoredPosition = new Vector2(0.5f, 0.5f); ((Transform)RocketRectTransform).localScale = Vector2.op_Implicit(new Vector2(RocketTextScale.Value, RocketTextScale.Value)); RectTransform rocketRectTransform = RocketRectTransform; ((Transform)rocketRectTransform).localPosition = ((Transform)rocketRectTransform).localPosition + new Vector3(RocketTextXPosition.Value - RocketTextSpace.Value / 2f, RocketTextYPosition.Value, 0f); Text val2 = hudRocketAmountObject.AddComponent<Text>(); val2.font = Addressables.LoadAssetAsync<Font>((object)"RoR2/Base/Common/Fonts/Bombardier/BOMBARD_.ttf").WaitForCompletion(); val2.fontStyle = (FontStyle)0; val2.fontSize = 32; val2.lineSpacing = 1f; val2.supportRichText = true; val2.alignment = (TextAnchor)4; val2.alignByGeometry = true; val2.horizontalOverflow = (HorizontalWrapMode)0; val2.verticalOverflow = (VerticalWrapMode)1; val2.resizeTextForBestFit = true; val2.text = "Rocket amount"; ((Object)val2).name = "rocketAmountText"; ((Graphic)val2).color = Color.white; ((Graphic)val2).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Fonts/Bombardier/BOMBARD_.ttf").WaitForCompletion(); Outline val3 = hudRocketAmountObject.AddComponent<Outline>(); ((Shadow)val3).effectColor = Color.black; ((Shadow)val3).effectDistance = new Vector2(OutlineThickness.Value, OutlineThickness.Value); hudRocketReloadObject = new GameObject("reloadMeter"); hudRocketReloadObject.transform.SetParent(hud.mainContainer.transform); ReloadRectTransform = hudRocketReloadObject.AddComponent<RectTransform>(); ReloadRectTransform.anchorMin = Vector2.zero; ReloadRectTransform.anchorMax = Vector2.one; ReloadRectTransform.sizeDelta = Vector2.zero; ReloadRectTransform.pivot = new Vector2(0.5f, 0.5f); ReloadRectTransform.anchoredPosition = new Vector2(0.5f, 0.5f); ((Transform)ReloadRectTransform).localScale = Vector2.op_Implicit(new Vector2(RocketTextScale.Value, RocketTextScale.Value)); RectTransform reloadRectTransform = ReloadRectTransform; ((Transform)reloadRectTransform).localPosition = ((Transform)reloadRectTransform).localPosition + new Vector3(RocketTextXPosition.Value + RocketTextSpace.Value / 2f, RocketTextYPosition.Value, 0f); Text val4 = hudRocketReloadObject.AddComponent<Text>(); val4.font = Addressables.LoadAssetAsync<Font>((object)"RoR2/Base/Common/Fonts/Bombardier/BOMBARD_.ttf").WaitForCompletion(); val4.fontStyle = (FontStyle)0; val4.fontSize = 32; val4.lineSpacing = 1f; val4.supportRichText = true; val4.alignment = (TextAnchor)4; val4.alignByGeometry = true; val4.horizontalOverflow = (HorizontalWrapMode)0; val4.verticalOverflow = (VerticalWrapMode)1; val4.resizeTextForBestFit = true; val4.text = "Rocket reload"; ((Object)val4).name = "rocketReloadText"; ((Graphic)val4).color = Color.white; ((Graphic)val4).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Fonts/Bombardier/BOMBARD_.ttf").WaitForCompletion(); Outline val5 = hudRocketReloadObject.AddComponent<Outline>(); ((Shadow)val5).effectColor = Color.black; ((Shadow)val5).effectDistance = new Vector2(OutlineThickness.Value, OutlineThickness.Value); } private void Look(orig_Update orig, PlayerCharacterMasterController self) { //IL_00ff: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_015c: 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_01e5: 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_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021d: 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) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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) orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self.body)) { return; } if (jump && EnableAutoJump.Value && Object.op_Implicit((Object)(object)self.bodyInputs) && self.bodyInputs.jump.down && Object.op_Implicit((Object)(object)self.bodyMotor) && self.bodyMotor.isGrounded) { self.bodyInputs.jump.down = false; jump = false; } if (!jump && EnableAutoJump.Value && !self.bodyMotor.isGrounded) { jump = true; } if (EnableStrafeDebug.Value && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.characterMotor)) { lineDrawer.DrawLineInGameView(self.body.corePosition, self.body.corePosition + self.bodyMotor.velocity, Color.red, lineDrawerMaterial); lineDrawer2.DrawLineInGameView(self.body.corePosition, self.body.corePosition + self.bodyInputs.moveVector, Color.blue, lineDrawer2Material); if (!enabledDebug) { enabledDebug = true; } } if (enabledDebug && !EnableStrafeDebug.Value) { lineDrawer.Destroy(); lineDrawer2.Destroy(); enabledDebug = false; } if (rocketAmount > 0 && intervalTime <= 0f) { KeyboardShortcut value = RocketJumpKey.Value; if (Input.GetKey(((KeyboardShortcut)(ref value)).MainKey) && Object.op_Implicit((Object)(object)self.body)) { Ray val = default(Ray); ((Ray)(ref val)).direction = self.bodyInputs.aimDirection; ((Ray)(ref val)).origin = self.bodyInputs.aimOrigin; Ray val2 = val; ProjectileManager.instance.FireProjectile(rocketJumpTestRocket, ((Ray)(ref val2)).origin, Quaternion.LookRotation(((Ray)(ref val2)).direction), ((Component)self.body).gameObject, 0f, 0f, Util.CheckRoll(self.body.crit, self.master), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); reloadTime = reloadMaxTime * self.body.skillLocator.utility.cooldownScale + 0.12f; intervalTime = intervalMaxTime / self.body.attackSpeed; rocketAmount--; Util.PlaySound("Play_MULT_m1_grenade_launcher_shoot", ((Component)self.body).gameObject); } } } private void BunnyHop(orig_ApplyJumpVelocity orig, CharacterMotor characterMotor, CharacterBody characterBody, float horizontalBonus, float verticalBonus, bool vault) { //IL_001c: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0121: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (EnableBunnyHop.Value) { if (vault) { characterMotor.velocity = characterMotor.moveDirection; } else { float num = characterBody.jumpPower * verticalBonus; characterMotor.velocity.y = 0f; if (characterMotor.velocity.x * characterMotor.velocity.x + characterMotor.velocity.z * characterMotor.velocity.z < characterBody.baseMoveSpeed * characterBody.baseMoveSpeed) { characterMotor.velocity += new Vector3(characterMotor.moveDirection.x * characterBody.baseMoveSpeed, 0f, characterMotor.moveDirection.z * characterBody.baseMoveSpeed); } Vector3 val = (((Vector3)(ref characterMotor.velocity)).magnitude + (horizontalBonus - 1f) * 20f - ((Vector3)(ref characterMotor.velocity)).magnitude) * ((Vector3)(ref characterMotor.velocity)).normalized; characterMotor.velocity += new Vector3(val.x, num, val.z); } ((BaseCharacterController)characterMotor).Motor.ForceUnground(0.1f); } else { orig.Invoke(characterMotor, characterBody, horizontalBonus, verticalBonus, vault); } } }