Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of WILDCARD REPO v0.24.0
BepInEx/plugins/WildCardMod/REPOWildCardMod.dll
Decompiled 6 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using MonoMod.Utils; using MoreUpgrades; using MoreUpgrades.Classes; using Photon.Pun; using REPOLib.Extensions; using REPOLib.Modules; using REPOWildCardMod.Config; using REPOWildCardMod.Extensions; using REPOWildCardMod.Items; using REPOWildCardMod.NetcodePatcher; using REPOWildCardMod.Patches; using REPOWildCardMod.Utils; using REPOWildCardMod.Valuables; using TMPro; using UnityEditor; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("REPOWildCardMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Scan Computers")] [assembly: AssemblyProduct("REPOWildCardMod")] [assembly: AssemblyCopyright("Copyright © Scan Computers 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a4fd09a5-2078-4f37-ae81-44c02af535da")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: NetcodePatchedAssembly] namespace REPOWildCardMod { [BepInPlugin("deB.WildCard", "WILDCARD REPO", "0.24.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class WildCardMod : BaseUnityPlugin { internal const string modGUID = "deB.WildCard"; internal const string modName = "WILDCARD REPO"; internal const string modVersion = "0.24.0"; private readonly Harmony harmony = new Harmony("deB.WildCard"); internal ManualLogSource log = null; public WildCardUtils utils; public static WildCardMod instance; public bool moreUpgradesPresent = false; public bool oldSharedUpgradesPresent = false; public List<GameObject> valList = new List<GameObject>(); public List<GameObject> itemList = new List<GameObject>(); public List<Reskin> reskinList = new List<Reskin>(); public List<AudioReplacer> audioReplacerList = new List<AudioReplacer>(); public List<GameObject> miscPrefabsList = new List<GameObject>(); public static List<NetworkedEvent> networkedEvents = new List<NetworkedEvent>(); internal WildCardConfig ModConfig { get; private set; } = null; public void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; } log = ((BaseUnityPlugin)this).Logger; utils = new WildCardUtils(); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); for (int j = 0; j < methods.Length; j++) { object[] customAttributes; try { customAttributes = methods[j].GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); } catch { continue; } if (customAttributes.Length != 0) { methods[j].Invoke(null, null); } } } if (Chainloader.PluginInfos.ContainsKey("bulletbot.moreupgrades")) { moreUpgradesPresent = true; } if (Chainloader.PluginInfos.ContainsKey("EvilCheetah.REPO.TeamBoosters")) { oldSharedUpgradesPresent = true; } PropogateLists(); HandleContent(); DoPatches(); log.LogInfo((object)"WILDCARD REPO Successfully Loaded"); } public void PropogateLists() { AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "wildcardmod")); string[] allAssetNames = val.GetAllAssetNames(); for (int i = 0; i < allAssetNames.Length; i++) { string text = allAssetNames[i].Substring(0, allAssetNames[i].LastIndexOf("/")); switch (text) { case "assets/my creations/resources/valuables": valList.Add(val.LoadAsset<GameObject>(allAssetNames[i])); break; case "assets/my creations/resources/items": itemList.Add(val.LoadAsset<GameObject>(allAssetNames[i])); break; case "assets/my creations/resources/reskins": reskinList.Add(val.LoadAsset<Reskin>(allAssetNames[i])); break; case "assets/my creations/resources/audio replacers": audioReplacerList.Add(val.LoadAsset<AudioReplacer>(allAssetNames[i])); break; case "assets/my creations/resources/misc": { Object val2 = val.LoadAsset(allAssetNames[i]); Object val3 = val2; Object val4 = val3; GameObject val5 = (GameObject)(object)((val4 is GameObject) ? val4 : null); if (val5 != null) { miscPrefabsList.Add(val5); } else { log.LogWarning((object)("\"" + allAssetNames[i] + "\" was not a valid type, skipping.")); } break; } default: log.LogWarning((object)("\"" + text + "\" is not a known asset path, skipping.")); break; } } } public void HandleContent() { ModConfig = new WildCardConfig(valList, itemList, reskinList, audioReplacerList); HandleValuables(); HandleItems(); HandleReskins(); HandleAudioReplacers(); HandleMisc(); HandleEvents(); } public void HandleValuables() { DummyValuable dummyValuable = default(DummyValuable); ItemAttributes val = default(ItemAttributes); for (int i = 0; i < valList.Count; i++) { if (ModConfig.isValEnabled[i].Value) { bool flag = true; if (valList[i].TryGetComponent<DummyValuable>(ref dummyValuable)) { if (dummyValuable.prefab.TryGetComponent<ItemAttributes>(ref val)) { itemList.Add(((Component)val).gameObject); } else { flag = false; } } if (flag) { Valuables.RegisterValuable(valList[i]); log.LogDebug((object)(((Object)valList[i]).name + " valuable was loaded!")); } else { log.LogInfo((object)(((Object)valList[i]).name + " dummy did not have a valid setup")); } } else { log.LogInfo((object)(((Object)valList[i]).name + " valuable was disabled!")); } } } public void HandleItems() { for (int i = 0; i < itemList.Count; i++) { if (i >= ModConfig.isItemEnabled.Count || ModConfig.isItemEnabled[i].Value) { Items.RegisterItem(itemList[i].GetComponent<ItemAttributes>()); log.LogDebug((object)(((Object)itemList[i]).name + " item was loaded!")); } else { log.LogInfo((object)(((Object)itemList[i]).name + " item was disabled!")); } } } public void HandleReskins() { for (int i = 0; i < reskinList.Count; i++) { if (!ModConfig.isReskinEnabled[i].Value || ModConfig.reskinChance[i].Value <= 0f) { log.LogInfo((object)(reskinList[i].identifier + " reskin was disabled!")); } } } public void HandleAudioReplacers() { for (int i = 0; i < audioReplacerList.Count; i++) { if (!ModConfig.isAudioReplacerEnabled[i].Value || ModConfig.audioReplaceChance[i].Value <= 0f) { log.LogInfo((object)(audioReplacerList[i].identifier + " audio replacer was disabled!")); break; } if (audioReplacerList[i].animClass == null) { audioReplacerList[i].animClass = Type.GetType(audioReplacerList[i].identifier + ", Assembly-CSharp"); if (audioReplacerList[i].animClass == null) { log.LogWarning((object)(audioReplacerList[i].identifier + " audio replacer will not work!")); } } } } public void HandleMisc() { for (int i = 0; i < miscPrefabsList.Count; i++) { NetworkPrefabs.RegisterNetworkPrefab("Misc/" + ((Object)miscPrefabsList[i]).name, miscPrefabsList[i]); Utilities.FixAudioMixerGroups(miscPrefabsList[i]); log.LogDebug((object)(((Object)miscPrefabsList[i]).name + " prefab was loaded!")); } } public void HandleEvents() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown networkedEvents.Add(new NetworkedEvent("Set Enemy Skin", (Action<EventData>)WildCardUtils.SetEnemySkin)); networkedEvents.Add(new NetworkedEvent("Set Enemy Audio", (Action<EventData>)WildCardUtils.SetEnemyAudio)); } public void DoPatches() { log.LogDebug((object)"Patching Game"); harmony.PatchAll(typeof(EnemyParentPatches)); harmony.PatchAll(typeof(HurtColliderPatches)); harmony.PatchAll(typeof(PhysGrabObjectPatches)); harmony.PatchAll(typeof(PlayerAvatarPatches)); harmony.PatchAll(typeof(StatsManagerPatches)); harmony.PatchAll(typeof(WorldSpaceUIValuePatches)); harmony.PatchAll(typeof(WorldSpaceUIValueLostPatches)); harmony.PatchAll(typeof(EnemyHunterPatches)); harmony.PatchAll(typeof(SemiFuncPatches)); harmony.PatchAll(typeof(EnemyOnScreenPatches)); harmony.PatchAll(typeof(EnemyRunnerPatches)); harmony.PatchAll(typeof(EnemyStateChasePatches)); harmony.PatchAll(typeof(SoundPatches)); if (ModConfig.harmonyPatches.Value && ModConfig.isValEnabled.Find((ConfigEntry<bool> x) => ((ConfigEntryBase)x).Definition.Key.Contains("Valuable Giwi Worm")).Value) { harmony.PatchAll(typeof(PhysGrabberPatch1)); harmony.PatchAll(typeof(PhysGrabberPatch2)); } else { log.LogInfo((object)"Disabled Giwi's Harmony Patches"); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "REPOWildCardMod"; public const string PLUGIN_NAME = "REPOWildCardMod"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace REPOWildCardMod.Valuables { public class AlolanVulpixie : MonoBehaviour { private readonly ManualLogSource log = WildCardMod.instance.log; private readonly WildCardUtils utils = WildCardMod.instance.utils; public PhotonView photonView; public PhysGrabObject physGrabObject; public GameObject[] pixieMeshes; public Sound[] pixieSounds; public PhysicMaterial physMat; public Animator animator; public bool scrungle = false; public float voiceTimer; public void Start() { physGrabObject.OverrideMaterial(physMat, -123f); } public void Update() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (physGrabObject.grabbed) { if (voiceTimer > 0f) { voiceTimer -= Time.deltaTime; return; } voiceTimer = Random.Range(0.5f, 2.5f); int num = utils.BoolToInt(scrungle); pixieSounds[num].Play(((Component)pixieSounds[num].Source).transform.position, 1f, 1f, 1f, 1f); } } public void PixieImpact(bool sad) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) int num = utils.BoolToInt(sad); scrungle = !scrungle; pixieMeshes[1].SetActive(scrungle); pixieMeshes[0].SetActive(!scrungle); pixieSounds[num].Play(((Component)pixieSounds[num].Source).transform.position, 1f, 1f, 1f, 1f); log.LogDebug((object)$"Vulpixie Scrungle: {scrungle}, Vulpixie Sadge: {sad}"); } public void ImpactSquish() { if (SemiFunc.IsMasterClientOrSingleplayer()) { float impactForce = physGrabObject.impactDetector.impactForce; if (GameManager.Multiplayer()) { photonView.RPC("SquishRPC", (RpcTarget)0, new object[1] { impactForce }); } else { SquishRPC(impactForce); } } } [PunRPC] public void SquishRPC(float force) { animator.SetLayerWeight(1, Mathf.Clamp01(force / 150f)); animator.SetTrigger("Squish"); } } public class Ari : MonoBehaviour { private readonly ManualLogSource log = WildCardMod.instance.log; private readonly WildCardUtils utils = WildCardMod.instance.utils; public PhotonView photonView; public PhysGrabObject physGrabObject; public Animator animator; public PhysicMaterial physMat; public Sound ariSounds; public Sound flapLoop; public float balanceForce = 4f; public float floatPower = 5f; public bool dropped; public float chirpTimer; public void Start() { physGrabObject.OverrideMaterial(physMat, -123f); } public void FixedUpdate() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_0076: 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) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_0199: Unknown result type (might be due to invalid IL or missing references) if (!LevelGenerator.Instance.Generated || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } Quaternion val = Quaternion.FromToRotation(((Component)this).transform.up, Vector3.up); if (physGrabObject.grabbed) { if (dropped) { SetDropped(drop: false); } physGrabObject.rb.AddForce(Random.insideUnitSphere / 2f + ((Component)this).transform.up / 1.3f, (ForceMode)1); } else if (!Physics.Raycast(physGrabObject.rb.worldCenterOfMass, -((Component)this).transform.up, 0.5f, LayerMask.GetMask(new string[6] { "Default", "PhysGrabObject", "PhysGrabObjectCart", "PhysGrabObjectHinge", "Enemy", "Player" }), (QueryTriggerInteraction)1)) { if (!dropped) { SetDropped(drop: true); } physGrabObject.rb.AddForce(((Component)this).transform.up * floatPower * (1.1f - Quaternion.Angle(Quaternion.identity, val) / 360f)); physGrabObject.rb.AddTorque(new Vector3(val.x, val.y, val.z) * balanceForce); } else if (dropped) { SetDropped(drop: false); } } public void Update() { //IL_0136: 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) if (!LevelGenerator.Instance.Generated) { return; } flapLoop.PlayLoop(animator.GetBool("Grabbed"), 1f, 1f, 1f); if (physGrabObject.grabbed || dropped) { if (!animator.GetBool("Grabbed")) { animator.SetBool("Grabbed", true); } } else if (animator.GetBool("Grabbed")) { animator.SetBool("Grabbed", false); } if (!ariSounds.Source.isPlaying && chirpTimer <= 0f) { if (physGrabObject.grabbed) { EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 15f, false); log.LogDebug((object)"Ari Chirp Alert!"); } ariSounds.Play(physGrabObject.rb.worldCenterOfMass, 1f, 1f, 1f, 1f); animator.SetTrigger("Chirp"); chirpTimer = (Random.value + 1f) * 2f; } else if (chirpTimer > 0f) { chirpTimer -= Time.deltaTime * (float)(utils.BoolToInt(physGrabObject.grabbed) + 1); } } public void ImpactSquish() { if (SemiFunc.IsMasterClientOrSingleplayer()) { float impactForce = physGrabObject.impactDetector.impactForce; if (GameManager.Multiplayer()) { photonView.RPC("SquishRPC", (RpcTarget)0, new object[1] { impactForce }); } else { SquishRPC(impactForce); } } } [PunRPC] public void SquishRPC(float force) { animator.SetLayerWeight(1, Mathf.Clamp01(force / 150f)); animator.SetTrigger("Squish"); } public void SetDropped(bool drop) { if (GameManager.Multiplayer()) { photonView.RPC("SetDroppedRPC", (RpcTarget)0, new object[1] { drop }); } else { SetDroppedRPC(drop); } } [PunRPC] public void SetDroppedRPC(bool drop) { dropped = drop; } } public enum SketchiState { Idle, Happy, Sleepy, Hungry } public class CalaSketchi : MonoBehaviour { private readonly ManualLogSource log = WildCardMod.instance.log; public PhotonView photonView; public PhysGrabObject physGrabObject; public ItemToggle itemToggle; public SketchiState state = SketchiState.Idle; public Vector2 direction = Vector2.zero; public float moveSpeed = 0.25f; public float hunger = 100f; public float energy = 100f; public float happy = 0f; public float feedTimer = 0f; public float directionTimer; public float valueTimer; public Animator animator; public Transform spriteTransform; public Sound walkSounds; public Sound happySounds; public Sound sleepSounds; public Sound hungrySounds; public Sound feedSounds; public Vector3 forceRotation = new Vector3(110f, 0f, 180f); public void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) physGrabObject.SetUIValueOffset(Vector3.up * 0.25f); } public void FixedUpdate() { //IL_00c0: 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_00f4: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer() || !LevelGenerator.Instance.Generated || !physGrabObject.grabbed) { return; } int num = physGrabObject.playerGrabbing.Count; for (int i = 0; i < physGrabObject.playerGrabbing.Count; i++) { if (physGrabObject.playerGrabbing[i].isRotating) { num--; } } if (num == physGrabObject.playerGrabbing.Count) { physGrabObject.TurnXYZ(Quaternion.Euler(forceRotation.x, 0f, 0f), Quaternion.Euler(0f, forceRotation.y, 0f), Quaternion.Euler(0f, 0f, forceRotation.z)); } } public void Update() { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) if (!LevelGenerator.Instance.Generated || physGrabObject.hasNeverBeenGrabbed) { return; } float deltaTime = Time.deltaTime; if (physGrabObject.grabbedLocal) { SetInteractUI(); if (itemToggle.toggleState) { itemToggle.ToggleItem(false, -1); if (feedTimer <= 0f) { Feed(Random.Range(5f, 20f)); feedTimer = 0.5f; } } if (feedTimer > 0f) { feedTimer -= deltaTime; } } if (animator.GetBool("Moving")) { Vector3 val = spriteTransform.localPosition + new Vector3(direction.x, direction.y, 0f) * deltaTime * moveSpeed; spriteTransform.localPosition = new Vector3(Mathf.Clamp(val.x, -0.325f, 0.375f), Mathf.Clamp(val.y, -0.35f, 0.35f), 0f); } if (SemiFunc.IsMasterClientOrSingleplayer()) { physGrabObject.OverrideIndestructible(0.1f); switch (state) { case SketchiState.Idle: StateIdle(deltaTime); break; case SketchiState.Happy: StateHappy(deltaTime); break; case SketchiState.Sleepy: StateSleepy(deltaTime); break; case SketchiState.Hungry: StateHungry(deltaTime); break; } } } public void StateIdle(float delta) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (hunger > 0f) { hunger -= delta * 1.5f; } if (energy > 0f) { energy -= delta * 1.5f; } directionTimer -= delta; if (directionTimer <= 0f) { directionTimer = Random.Range(1f, 2.5f); bool isStill = Random.value > 0.75f; Vector2 insideUnitCircle = Random.insideUnitCircle; ChangeDirection(isStill, ((Vector2)(ref insideUnitCircle)).normalized, Random.Range(0.25f, 1f)); } if (hunger > 75f || (hunger > 50f && energy > 50f)) { happy += delta; } else if (happy > 0f) { happy -= delta; } if (energy <= 0f) { SetState(SketchiState.Sleepy); } else if (hunger <= 0f) { SetState(SketchiState.Hungry); } else if (happy >= 50f) { SetState(SketchiState.Happy); } } public void StateHappy(float delta) { //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) if (hunger > 0f) { hunger -= delta * 1.5f; } if (energy > 0f) { energy -= delta * 1.5f; } if (happy > 0f) { happy -= delta * 1.5f; } if (valueTimer > 0f) { valueTimer -= delta; } else { valueTimer = 1f; if (physGrabObject.impactDetector.valuableObject.dollarValueCurrent < physGrabObject.impactDetector.valuableObject.dollarValueOriginal + 2500f) { Break(-100f); } else { Break(0f); } } directionTimer -= delta; if (directionTimer <= 0f) { directionTimer = Random.Range(1f, 2.5f); bool isStill = Random.value > 0.75f; Vector2 insideUnitCircle = Random.insideUnitCircle; ChangeDirection(isStill, ((Vector2)(ref insideUnitCircle)).normalized, Random.Range(0.25f, 1f)); } if (hunger > 75f || (hunger > 50f && energy > 50f)) { happy += 3f * delta; } if (happy > 75f) { energy -= delta * 1.5f; } if (energy <= 0f) { SetState(SketchiState.Sleepy); } else if (hunger <= 0f) { SetState(SketchiState.Hungry); } else if (happy <= 25f) { SetState(SketchiState.Idle); } } public void StateSleepy(float delta) { if (hunger > 0f) { hunger -= delta * 1.5f; } if (energy > 0f) { energy += 4.5f * delta; } if (energy >= 100f || (energy >= 85f && Random.value < 0.01f)) { if (hunger <= 0f) { SetState(SketchiState.Hungry); } else if (happy >= 50f) { SetState(SketchiState.Happy); } else { SetState(SketchiState.Idle); } } } public void StateHungry(float delta) { if (energy > 0f) { energy -= delta * 1.5f; } if (valueTimer > 0f) { valueTimer -= delta; } else { valueTimer = 1f; Break(100f); } if (happy > 0f) { happy -= 4.5f * delta; } if (energy <= 0f) { SetState(SketchiState.Sleepy); } else if (hunger >= 25f) { SetState(SketchiState.Idle); } } public void Break(float value) { //IL_0085: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { physGrabObject.impactDetector.photonView.RPC("BreakRPC", (RpcTarget)0, new object[4] { value, physGrabObject.centerPoint + Vector3.up * 0.25f, 2, true }); } else { physGrabObject.impactDetector.BreakRPC(value, physGrabObject.centerPoint + Vector3.up * 0.25f, 2, true, default(PhotonMessageInfo)); } } public void ChangeDirection(bool isStill, Vector2 vector, float speed) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { photonView.RPC("ChangeDirectionRPC", (RpcTarget)0, new object[3] { isStill, vector, speed }); } else { ChangeDirectionRPC(isStill, vector, speed); } } [PunRPC] public void ChangeDirectionRPC(bool isStill, Vector2 vector, float speed) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) if (isStill) { vector = Vector2.zero; } direction = vector; moveSpeed = speed; animator.SetBool("Vertical", Mathf.Abs(vector.y) > Mathf.Abs(vector.x)); animator.SetBool("Moving", !isStill); if (!isStill) { log.LogDebug((object)$"CalaSketchi New Move Direction: \"{direction}\""); } } public void BreakEffect() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer() && state != SketchiState.Hungry && state != SketchiState.Happy) { hunger = Mathf.Clamp(hunger - Mathf.Max(0f, 10f), 0f, 100f); } if (state == SketchiState.Hungry) { hungrySounds.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } else { happySounds.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } public void SoundEffect() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_00bf: Unknown result type (might be due to invalid IL or missing references) switch (state) { case SketchiState.Idle: walkSounds.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); break; case SketchiState.Happy: happySounds.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); break; case SketchiState.Sleepy: sleepSounds.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); break; case SketchiState.Hungry: hungrySounds.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); break; } } public void Feed(float amount) { if (SemiFunc.IsMasterClientOrSingleplayer()) { FeedRPC(amount); return; } photonView.RPC("FeedRPC", (RpcTarget)0, new object[1] { amount }); } [PunRPC] public void FeedRPC(float amount) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { hunger = Mathf.Clamp(hunger + Mathf.Max(0f, amount), 0f, 100f); happy = Mathf.Clamp(happy + Mathf.Max(0f, amount / 5f), 0f, 100f); physGrabObject.rb.AddForce(Random.insideUnitSphere, (ForceMode)1); physGrabObject.rb.AddTorque(Random.insideUnitSphere * 2.5f, (ForceMode)1); } feedSounds.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); log.LogDebug((object)$"Feeding CalaSketchi: \"{amount}\""); } public void SetState(SketchiState newState) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("SetStateRPC", (RpcTarget)0, new object[1] { newState }); } else { SetStateRPC(newState); } } [PunRPC] public void SetStateRPC(SketchiState newState) { switch (newState) { case SketchiState.Idle: animator.SetBool("Moving", false); animator.SetInteger("State", 0); break; case SketchiState.Happy: animator.SetBool("Moving", false); animator.SetInteger("State", 1); break; case SketchiState.Sleepy: animator.SetBool("Moving", false); animator.SetInteger("State", 2); break; case SketchiState.Hungry: animator.SetBool("Moving", false); animator.SetInteger("State", 3); break; } state = newState; log.LogDebug((object)$"CalaSketchi State: \"{state}\""); } public void SetInteractUI() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) string text = "CalaSketchi <color=#FFFFFF>[" + InputManager.instance.InputDisplayReplaceTags("[interact]", "<u><b>", "</b></u>") + "]</color>"; if (text != ((TMP_Text)ItemInfoUI.instance.Text).text) { ItemInfoUI.instance.messageTimer = 0f; ((SemiUI)ItemInfoUI.instance).SemiUIResetAllShakeEffects(); } ((TMP_Text)ItemInfoUI.instance.Text).colorGradient = ItemInfoUI.instance.originalGradient; if (!SemiFunc.RunIsShop()) { ((TMP_Text)ItemInfoUI.instance.Text).fontSize = 15f; } ItemInfoUI.instance.messageTimer = 0.1f; if (text != ItemInfoUI.instance.messagePrev) { ((TMP_Text)ItemInfoUI.instance.Text).text = text; ((SemiUI)ItemInfoUI.instance).SemiUISpringShakeY(5f, 5f, 0.3f); ((SemiUI)ItemInfoUI.instance).SemiUISpringScale(0.1f, 2.5f, 0.2f); ItemInfoUI.instance.messagePrev = text; } } } public class ChaosEmerald : MonoBehaviour { private static readonly ManualLogSource log = WildCardMod.instance.log; public PhotonView photonView; public ValuableObject valuableObject; public PhysGrabObject physGrabObject; public Color[] colours; public Dictionary<string, Color> colourMap; public string colour; public MeshRenderer meshRenderer; public Sound sonicLoop; public GameObject hudAudio; public int extractFinishedPlayers = 0; public int playersEmeraldsSet = 0; public Coroutine extractCoroutine; public void Awake() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) hudAudio = WildCardMod.instance.miscPrefabsList.Find((GameObject x) => ((Object)x).name == "Wildcard HUD Audio"); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } string[] array = StatsManager.instance.dictionaryOfDictionaries["chaosEmeraldsUnique"].Keys.ToArray(); colourMap = new Dictionary<string, Color>(); for (int i = 0; i < StatsManager.instance.dictionaryOfDictionaries["chaosEmeraldsUnique"].Keys.Count; i++) { if (StatsManager.instance.dictionaryOfDictionaries["chaosEmeraldsUnique"][array[i]] == 0) { colourMap.Add(array[i], colours[i]); } } } public void Start() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_0057: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { string[] array = colourMap.Keys.ToArray(); string text = array[Random.Range(0, array.Length)]; if (SemiFunc.IsMultiplayer()) { photonView.RPC("PickColorRPC", (RpcTarget)0, new object[5] { text, colourMap[text].r, colourMap[text].g, colourMap[text].b, colourMap[text].a }); } else { PickColorRPC(text, colourMap[text].r, colourMap[text].g, colourMap[text].b, colourMap[text].a); } } } [PunRPC] public void PickColorRPC(string colourName, float r, float g, float b, float a) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0056: 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_00b7: Unknown result type (might be due to invalid IL or missing references) colour = colourName; Color val = default(Color); ((Color)(ref val))..ctor(r, g, b, a); ((Renderer)meshRenderer).material.SetColor("_BaseColor", val); GradientColorKey[] colorKeys = valuableObject.particleColors.colorKeys; for (int i = 0; i < colorKeys.Length; i++) { colorKeys[i] = new GradientColorKey(val, colorKeys[i].time); } valuableObject.particleColors.colorKeys = colorKeys; if (colour == "White") { ((Renderer)meshRenderer).material.SetColor("_EmissionColor", new Color(0.4f, 0.4f, 0.4f, 1f)); } else { ((Renderer)meshRenderer).material.SetColor("_EmissionColor", new Color(r / 2f, g / 2f, b / 2f, 1f)); } } public void Update() { if (!physGrabObject.grabbed) { return; } for (int i = 0; i < physGrabObject.playerGrabbing.Count; i++) { if (physGrabObject.playerGrabbing[i].isLocal) { PlayerController.instance.OverrideSpeed(2f, 0.1f); } } } [PunRPC] public void AllAddPlayerEmeraldRPC() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) log.LogDebug((object)"Adding a Chaos Emerald point"); playersEmeraldsSet = 0; StatsUI.instance.Fetch(); StatsUI.instance.ShowStats(); CameraGlitch.Instance.PlayUpgrade(); GameDirector.instance.CameraImpact.ShakeDistance(5f, 1f, 6f, ((Component)SemiFunc.PlayerAvatarLocal()).transform.position, 0.2f); } [PunRPC] public void ExtractCompleteRPC() { extractFinishedPlayers++; log.LogDebug((object)$"extractFinishedPlayers == {extractFinishedPlayers}"); if (extractCoroutine == null) { extractCoroutine = ((MonoBehaviour)this).StartCoroutine(ExtractCompleteCoroutine()); } } public IEnumerator ExtractCompleteCoroutine() { yield return (object)new WaitUntil((Func<bool>)(() => extractFinishedPlayers >= SemiFunc.PlayerGetList().Count)); log.LogDebug((object)"Calling DestroyEmerald()"); DestroyEmerald(); } public void MasterAddPlayerEmerald() { if (SemiFunc.IsMultiplayer()) { photonView.RPC("AllAddPlayerEmeraldRPC", (RpcTarget)0, Array.Empty<object>()); } else { AllAddPlayerEmeraldRPC(); } string key = SemiFunc.PlayerGetSteamID(SemiFunc.PlayerAvatarLocal()); StatsManager.instance.dictionaryOfDictionaries["playerUpgradeChaosEmeralds"][key]++; StatsManager.instance.dictionaryOfDictionaries["chaosEmeraldsUnique"][colour]++; if (StatsManager.instance.dictionaryOfDictionaries["playerUpgradeChaosEmeralds"][key] >= 7) { StatsManager.instance.dictionaryOfDictionaries["playerUpgradeChaosEmeralds"][key] = 0; StatsManager.instance.DictionaryFill("chaosEmeraldsUnique", 0); SuperSonic(); } List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < list.Count; i++) { list[i].playerHealth.MaterialEffectOverride((Effect)0); } if (SemiFunc.IsMultiplayer()) { photonView.RPC("PropogateEmeraldsRPC", (RpcTarget)1, new object[1] { StatsManager.instance.dictionaryOfDictionaries["playerUpgradeChaosEmeralds"][key] }); } ExtractCompleteRPC(); } public void SuperSonic() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SuperSonic componentInChildren = ((Component)((Component)PlayerController.instance).transform).GetComponentInChildren<SuperSonic>(); if ((Object)(object)componentInChildren != (Object)null) { if (SemiFunc.IsMultiplayer()) { componentInChildren.photonView.RPC("DoubleTimerRPC", (RpcTarget)0, Array.Empty<object>()); } else { componentInChildren.DoubleTimerRPC(); } } else if (SemiFunc.IsMultiplayer()) { GameObject val = PhotonNetwork.InstantiateRoomObject("Misc/Wildcard HUD Audio", Vector3.zero, Quaternion.identity, (byte)0, (object[])null); photonView.RPC("SuperSonicRPC", (RpcTarget)0, new object[1] { val.GetComponent<PhotonView>().ViewID }); } else { SuperSonicLogic(Object.Instantiate<GameObject>(hudAudio)); } } [PunRPC] public void SuperSonicRPC(int id = -1) { GameObject gameObject = ((Component)PhotonView.Find(id)).gameObject; if (SemiFunc.PlayerAvatarLocal().deadSet) { Object.Destroy((Object)(object)gameObject); } else { SuperSonicLogic(gameObject); } } public void SuperSonicLogic(GameObject newObject) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown sonicLoop.Source = newObject.GetComponent<AudioSource>(); newObject.transform.parent = ((Component)PlayerController.instance).transform; newObject.transform.localPosition = Vector3.zero; SuperSonic superSonic = newObject.AddComponent<SuperSonic>(); superSonic.sonicLoop = new Sound { Source = sonicLoop.Source, Sounds = sonicLoop.Sounds, Type = sonicLoop.Type, Volume = sonicLoop.Volume, VolumeRandom = sonicLoop.VolumeRandom, Pitch = sonicLoop.Pitch, PitchRandom = sonicLoop.PitchRandom, SpatialBlend = sonicLoop.SpatialBlend, ReverbMix = sonicLoop.ReverbMix, Doppler = sonicLoop.Doppler }; superSonic.photonView = newObject.GetComponent<PhotonView>(); } [PunRPC] public void PropogateEmeraldsRPC(int emeralds) { List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < list.Count; i++) { StatsManager.instance.dictionaryOfDictionaries["playerUpgradeChaosEmeralds"][SemiFunc.PlayerGetSteamID(list[i])] = emeralds; } photonView.RPC("ExtractCompleteRPC", (RpcTarget)2, Array.Empty<object>()); } public void DestroyEmerald() { if (SemiFunc.IsMultiplayer()) { physGrabObject.photonView.RPC("DestroyPhysGrabObjectRPC", (RpcTarget)0, Array.Empty<object>()); } else { physGrabObject.DestroyPhysGrabObjectRPC(); } } } public class SuperSonic : MonoBehaviour { public PhotonView photonView; public float overrideTimer; public Sound sonicLoop; public PlayerAvatar[] playersList; public void Start() { overrideTimer = 120f; playersList = SemiFunc.PlayerGetAll().ToArray(); sonicLoop.LowPassIgnoreColliders.Add(PlayerController.instance.col); } [PunRPC] public void DoubleTimerRPC() { overrideTimer *= 2f; } public void Update() { for (int i = 0; i < playersList.Length; i++) { if (!((Object)(object)playersList[i] != (Object)null)) { continue; } if (playersList[i].isLocal) { sonicLoop.PlayLoop(overrideTimer > 10f, 2f, 0.5f, 1f); if (SemiFunc.IsMultiplayer()) { PlayerAvatar.instance.voiceChat.OverridePitch(1.5f, 1f, 0.25f, 0.1f, 0f, 0f); } PlayerAvatar.instance.OverridePupilSize(0.3f, 4, 0.25f, 1f, 5f, 0.5f, 0.1f); PlayerController.instance.OverrideSpeed(3f, 0.1f); PlayerController.instance.OverrideAnimationSpeed(2.5f, 1f, 0.5f, 0.1f); if (PlayerController.instance.rb.isKinematic) { PlayerController.instance.OverrideTimeScale(1f, -1f); } else { PlayerController.instance.OverrideTimeScale(2.5f, 0.1f); } if ((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)null) { PhysGrabber.instance.grabbedPhysGrabObject.OverrideTorqueStrength(1.5f, 0.1f); } CameraZoom.Instance.OverrideZoomSet(90f, 0.1f, 1f, 0.5f, (GameObject)null, 0); PostProcessing.Instance.SaturationOverride(50f, 0.5f, 0.1f, 0.1f, (GameObject)null); } else { playersList[i].voiceChat.OverridePitch(1.5f, 1f, 0.25f, 0.1f, 0f, 0f); } } overrideTimer -= Time.deltaTime; if (!SemiFunc.RunIsLevel() && overrideTimer > 5f) { overrideTimer = 5f; } if (overrideTimer <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class ChiikawaValuable : MonoBehaviour { private readonly ManualLogSource log = WildCardMod.instance.log; public PhotonView photonView; public ValuableObject valuableObject; public PhysGrabObject physGrabObject; public ChiikawaType[] types; public ChiikawaType chiikawa; public bool chiikawaChosen; public MeshRenderer faceRenderer; public Material faceMaterial; public Sound chiikawaSounds; public Animator animator; public float faceTimer; public void Awake() { for (int i = 0; i < types.Length; i++) { types[i].chosenTransforms = (Transform[])(object)new Transform[9] { types[i].chosenBody, types[i].chosenHead, types[i].chosenLeftEar, types[i].chosenRightEar, types[i].chosenLeftArm, types[i].chosenRightArm, types[i].chosenLeftLeg, types[i].chosenRightLeg, types[i].chosenTail }; } } public void Start() { if (SemiFunc.IsMasterClientOrSingleplayer()) { int num = Random.Range(0, types.Length); while (types[num].audioClips.Length == 0) { log.LogDebug((object)(types[num].name + " has not been set up, selecting a new chiikawa")); num = Random.Range(0, types.Length); } if (SemiFunc.IsMultiplayer()) { photonView.RPC("SelectTypeRPC", (RpcTarget)0, new object[1] { num }); } else { SelectTypeRPC(num); } } ((MonoBehaviour)this).StartCoroutine(ChiikawaSetup()); } public IEnumerator ChiikawaSetup() { yield return (object)new WaitUntil((Func<bool>)(() => chiikawaChosen)); log.LogDebug((object)("Chiikawa character selected: \"" + chiikawa.name + "\"")); for (int i = 0; i < chiikawa.chosenTransforms.Length; i++) { ((Component)chiikawa.chosenTransforms[i]).gameObject.SetActive(true); } PhysAudio newAudio = ScriptableObject.CreateInstance<PhysAudio>(); newAudio.impactLight = valuableObject.audioPreset.impactLight; newAudio.impactMedium = valuableObject.audioPreset.impactMedium; newAudio.impactHeavy = valuableObject.audioPreset.impactHeavy; newAudio.breakLight = valuableObject.audioPreset.breakLight; newAudio.breakMedium = valuableObject.audioPreset.breakMedium; newAudio.breakHeavy = valuableObject.audioPreset.breakHeavy; newAudio.destroy = valuableObject.audioPreset.destroy; newAudio.breakLight.Sounds = chiikawa.audioClips; newAudio.breakMedium.Sounds = chiikawa.audioClips; newAudio.breakHeavy.Sounds = chiikawa.audioClips; valuableObject.audioPreset = newAudio; chiikawaSounds.Sounds = chiikawa.audioClips; ((Object)((Component)this).gameObject).name = "Valuable " + chiikawa.name; physGrabObject.OverrideMaterial(new PhysicMaterial { dynamicFriction = 0.25f, staticFriction = 0.05f, bounciness = chiikawa.bounciness, frictionCombine = (PhysicMaterialCombine)0, bounceCombine = (PhysicMaterialCombine)3 }, -123f); animator.SetLayerWeight(1, chiikawa.wiggle * 0.5f + 0.5f); faceRenderer = ((Component)chiikawa.chosenHead).GetComponent<MeshRenderer>(); if (!((Object)(object)chiikawa.newMainMaterial != (Object)null)) { yield break; } GradientColorKey[] colorKeys = valuableObject.particleColors.colorKeys; for (int k = 0; k < colorKeys.Length; k++) { colorKeys[k] = new GradientColorKey(chiikawa.newMainMaterial.color, colorKeys[k].time); } valuableObject.particleColors.colorKeys = colorKeys; MeshRenderer renderer = default(MeshRenderer); for (int j = 0; j < chiikawa.chosenTransforms.Length; j++) { Transform[] children = ((Component)chiikawa.chosenTransforms[j]).GetComponentsInChildren<Transform>(); for (int l = 0; l < children.Length; l++) { if (((Component)children[l]).TryGetComponent<MeshRenderer>(ref renderer)) { if (((Renderer)renderer).materials.Length == 0) { ((Renderer)renderer).materials = (Material[])(object)new Material[1] { chiikawa.newMainMaterial }; } else if (((Renderer)renderer).materials.Length == 2) { Material newMaterial = chiikawa.newMainMaterial; if ((Object)(object)chiikawa.overrideHeadMaterial != (Object)null) { newMaterial = chiikawa.overrideHeadMaterial; } ((Renderer)renderer).materials = (Material[])(object)new Material[2] { newMaterial, faceMaterial }; } } renderer = null; } } } [PunRPC] public void SelectTypeRPC(int i) { chiikawa = types[i]; chiikawaChosen = true; } public void Update() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (chiikawaSounds.Sounds.Length == 0) { return; } if (physGrabObject.grabbed) { if (!chiikawaSounds.Source.isPlaying) { chiikawaSounds.Play(chiikawa.chosenHead.position, 1f, 1f, 1f, 1f); } if (!animator.GetBool("Grabbed")) { animator.SetBool("Grabbed", true); } if ((Object)(object)((Renderer)faceRenderer).materials[1].mainTexture != (Object)(object)chiikawa.upsetFace) { ((Renderer)faceRenderer).materials[1].mainTexture = (Texture)(object)chiikawa.upsetFace; } if (faceTimer != 2f) { faceTimer = 2f; } } else { if (animator.GetBool("Grabbed")) { animator.SetBool("Grabbed", false); } if (faceTimer <= 0f && (Object)(object)((Renderer)faceRenderer).materials[1].mainTexture != (Object)(object)chiikawa.neutralFace) { ((Renderer)faceRenderer).materials[1].mainTexture = (Texture)(object)chiikawa.neutralFace; } if (faceTimer > 0f) { faceTimer -= Time.deltaTime; } } } public void FixedUpdate() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer() && physGrabObject.grabbed && chiikawaChosen) { physGrabObject.rb.AddForce(Random.insideUnitSphere * chiikawa.wiggle / 4f, (ForceMode)1); physGrabObject.rb.AddTorque(Random.insideUnitSphere * chiikawa.wiggle, (ForceMode)1); } } } [Serializable] public class ChiikawaType { public string name; [Space(20f)] [Header("Body Parts")] public Transform[] chosenTransforms; public Transform chosenBody; public Transform chosenHead; public Transform chosenLeftEar; public Transform chosenRightEar; public Transform chosenLeftArm; public Transform chosenRightArm; public Transform chosenLeftLeg; public Transform chosenRightLeg; public Transform chosenTail; public Material newMainMaterial; public Material overrideHeadMaterial; [Space(10f)] [Header("Face Textures")] public Texture2D neutralFace; public Texture2D upsetFace; [Space(10f)] [Header("Attributes")] public AudioClip[] audioClips; [Range(0.01f, 1f)] public float wiggle; [Range(0.01f, 0.8f)] public float bounciness; } public class CloverBee : MonoBehaviour { private readonly ManualLogSource log = WildCardMod.instance.log; public PhotonView photonView; public PhysGrabObject physGrabObject; public Texture2D[] eyeTextures; public MeshRenderer meshRenderer; public Sound angryBees; public Sound happyBees; public Animator animator; public Color originalEmission; public Color originalFresnelEmission; public float blinkTimer; public float unblinkTimer; public float balanceForce = 4f; public float angerTimer; public float playerDamageTimer; public float floatHeight = 0.75f; public float floatPower = 5f; public float glidePower = 0.5f; public void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) originalEmission = ((Renderer)meshRenderer).materials[0].GetColor("_EmissionColor"); originalFresnelEmission = ((Renderer)meshRenderer).materials[0].GetColor("_FresnelEmissionColor"); } public void FixedUpdate() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_01b4: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_0189: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } Quaternion val = Quaternion.FromToRotation(((Component)this).transform.up, Vector3.up); physGrabObject.rb.AddTorque(new Vector3(val.x, val.y, val.z) * balanceForce); RaycastHit val2 = default(RaycastHit); if (physGrabObject.grabbed) { if (angerTimer > 0f) { physGrabObject.rb.AddForce(Random.insideUnitSphere / 2f + ((Component)this).transform.up / 1.3f, (ForceMode)1); } } else if (Physics.Raycast(physGrabObject.rb.worldCenterOfMass, -Vector3.up, ref val2, floatHeight, LayerMask.GetMask(new string[6] { "Default", "PhysGrabObject", "PhysGrabObjectCart", "PhysGrabObjectHinge", "Enemy", "Player" }), (QueryTriggerInteraction)1) && !physGrabObject.colliders.Contains(((Component)((RaycastHit)(ref val2)).collider).transform)) { physGrabObject.rb.AddForce(((Component)this).transform.up * (floatPower / ((RaycastHit)(ref val2)).distance) * (1.1f - Quaternion.Angle(Quaternion.identity, val) / 360f)); } else { physGrabObject.rb.AddForce(((Component)this).transform.up * floatPower * glidePower * (1.1f - Quaternion.Angle(Quaternion.identity, val) / 360f)); } } public void Update() { //IL_01e1: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) if (!LevelGenerator.Instance.Generated) { return; } bool flag = angerTimer > 0f; angryBees.PlayLoop(flag, 2f, 1f, 1f); happyBees.PlayLoop(!flag, 2f, 1f, 1f); if (physGrabObject.impactHappenedTimer > 0f) { if (animator.GetFloat("Wing Speed") != 0f) { animator.SetFloat("Wing Speed", 0f); } } else if (animator.GetFloat("Wing Speed") != 1f) { animator.SetFloat("Wing Speed", 1f); } if (angerTimer > 0f) { if (physGrabObject.grabbedLocal && playerDamageTimer <= 0f) { PlayerAvatar.instance.playerHealth.Hurt(1, true, -1); playerDamageTimer = 0.5f; } else if (playerDamageTimer > 0f) { playerDamageTimer -= Time.deltaTime; } angerTimer -= Time.deltaTime; return; } if ((Object)(object)((Renderer)meshRenderer).materials[0].GetTexture("_BaseTexture") == (Object)(object)eyeTextures[2]) { SetFresnelTexture(((Renderer)meshRenderer).materials[0], (Texture)(object)eyeTextures[0]); SetEmission(((Renderer)meshRenderer).materials[0], original: true); SetEmission(((Renderer)meshRenderer).materials[1], original: true); log.LogDebug((object)"Clover Bee Calm"); return; } if (blinkTimer > 0f) { blinkTimer -= Time.deltaTime; } else if ((Object)(object)((Renderer)meshRenderer).materials[0].GetTexture("_BaseTexture") == (Object)(object)eyeTextures[0]) { SetFresnelTexture(((Renderer)meshRenderer).materials[0], (Texture)(object)eyeTextures[1]); unblinkTimer = 0.25f; } if (unblinkTimer > 0f) { unblinkTimer -= Time.deltaTime; } else if ((Object)(object)((Renderer)meshRenderer).materials[0].GetTexture("_BaseTexture") == (Object)(object)eyeTextures[1]) { SetFresnelTexture(((Renderer)meshRenderer).materials[0], (Texture)(object)eyeTextures[0]); blinkTimer = Random.Range(0.75f, 2f); } } public void OnBreak() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) SetFresnelTexture(((Renderer)meshRenderer).materials[0], (Texture)(object)eyeTextures[2]); SetEmission(((Renderer)meshRenderer).materials[0], original: false, Color.red / 2f); SetEmission(((Renderer)meshRenderer).materials[1], original: false, Color.red / 2f); log.LogDebug((object)"Clover Bee Angry"); angerTimer = Random.Range(0.5f, 1.5f); } public void SetFresnelTexture(Material mat, Texture texture) { mat.SetTexture("_BaseTexture", texture); mat.SetTexture("_EmissionTexture", texture); } public void SetEmission(Material mat, bool original, Color colour = default(Color)) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (original) { mat.SetColor("_EmissionColor", originalEmission); mat.SetColor("_FresnelEmissionColor", originalFresnelEmission); } else { mat.SetColor("_EmissionColor", colour); mat.SetColor("_FresnelEmissionColor", colour); } } } public class DragonBall : MonoBehaviour { private static readonly ManualLogSource log = WildCardMod.instance.log; public static List<DragonBall> levelDragonBalls; public PhotonView photonView; public PhysGrabObject physGrabObject; public Mesh[] starMeshes; public MeshFilter meshFilter; public Sound shenronApproach; public Sound shenronVoice; public Sound shenronWish; public GameObject hudAudio; public AudioClip spawnValuableClip; public int starNumber; public List<int> availableStars = new List<int>(); public List<string> wishableUpgrades; public PlayerAvatar masterPlayer; public int extractFinishedPlayers = 0; public int playersBallsSet = 0; public Coroutine extractCoroutine; public void Awake() { hudAudio = WildCardMod.instance.miscPrefabsList.Find((GameObject x) => ((Object)x).name == "Wildcard HUD Audio"); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (levelDragonBalls == null) { levelDragonBalls = new List<DragonBall> { this }; } else { levelDragonBalls.Add(this); } for (int i = 0; i < StatsManager.instance.dictionaryOfDictionaries["dragonBallsUnique"].Keys.Count; i++) { if (StatsManager.instance.dictionaryOfDictionaries["dragonBallsUnique"][(i + 1).ToString()] == 0) { availableStars.Add(i + 1); } } } public void Start() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (SemiFunc.IsMultiplayer()) { photonView.RPC("MasterIDRPC", (RpcTarget)0, new object[1] { SemiFunc.PlayerAvatarLocal().photonView.ViewID }); } else { masterPlayer = SemiFunc.PlayerAvatarLocal(); } for (int i = 0; i < levelDragonBalls.Count; i++) { if (!((Object)(object)levelDragonBalls[i] == (Object)(object)this) && availableStars.Contains(levelDragonBalls[i].starNumber)) { availableStars.Remove(levelDragonBalls[i].starNumber); } } if (availableStars.Count == 0) { physGrabObject.DestroyPhysGrabObject(); return; } int num = availableStars[Random.Range(0, availableStars.Count)]; if (SemiFunc.IsMultiplayer()) { ChooseStarsRPC(num); photonView.RPC("ChooseStarsRPC", (RpcTarget)1, new object[1] { num }); } else { ChooseStarsRPC(num); } } [PunRPC] public void MasterIDRPC(int id) { masterPlayer = SemiFunc.PlayerAvatarGetFromPhotonID(id); } [PunRPC] public void ChooseStarsRPC(int index) { starNumber = index; meshFilter.mesh = starMeshes[index - 1]; } public void Update() { if (LevelGenerator.Instance.Generated && (Object)(object)masterPlayer != (Object)null) { shenronApproach.PlayLoop(StatsManager.instance.dictionaryOfDictionaries["playerUpgradeDragonBalls"][SemiFunc.PlayerGetSteamID(masterPlayer)] >= 6 && physGrabObject.grabbed, 2f, 0.5f, 1f); } } [PunRPC] public void AllAddPlayerBallRPC() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) log.LogDebug((object)"Adding a Dragon Ball point"); playersBallsSet = 0; StatsUI.instance.Fetch(); StatsUI.instance.ShowStats(); CameraGlitch.Instance.PlayUpgrade(); GameDirector.instance.CameraImpact.ShakeDistance(5f, 1f, 6f, ((Component)SemiFunc.PlayerAvatarLocal()).transform.position, 0.2f); } [PunRPC] public void ExtractCompleteRPC() { extractFinishedPlayers++; log.LogDebug((object)$"extractFinishedPlayers == {extractFinishedPlayers}"); if (extractCoroutine == null) { extractCoroutine = ((MonoBehaviour)this).StartCoroutine(ExtractCompleteCoroutine()); } } public IEnumerator ExtractCompleteCoroutine() { yield return (object)new WaitUntil((Func<bool>)(() => extractFinishedPlayers >= SemiFunc.PlayerGetList().Count)); log.LogDebug((object)"Calling DestroyBall()"); DestroyBall(); } public void MasterAddPlayerBall() { if (SemiFunc.IsMultiplayer()) { photonView.RPC("AllAddPlayerBallRPC", (RpcTarget)0, Array.Empty<object>()); } else { AllAddPlayerBallRPC(); } string key = SemiFunc.PlayerGetSteamID(SemiFunc.PlayerAvatarLocal()); StatsManager.instance.dictionaryOfDictionaries["playerUpgradeDragonBalls"][key]++; StatsManager.instance.dictionaryOfDictionaries["dragonBallsUnique"][starNumber.ToString()]++; if (StatsManager.instance.dictionaryOfDictionaries["playerUpgradeDragonBalls"][key] >= 7) { StatsManager.instance.dictionaryOfDictionaries["playerUpgradeDragonBalls"][key] = 0; StatsManager.instance.DictionaryFill("dragonBallsUnique", 0); DragonBallWish(); } List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < list.Count; i++) { list[i].playerHealth.MaterialEffectOverride((Effect)0); } if (SemiFunc.IsMultiplayer()) { photonView.RPC("PropogateBallsRPC", (RpcTarget)0, new object[1] { StatsManager.instance.dictionaryOfDictionaries["playerUpgradeDragonBalls"][key] }); } ExtractCompleteRPC(); } public void DragonBallWish() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { GameObject val = PhotonNetwork.InstantiateRoomObject("Misc/Wildcard HUD Audio", Vector3.zero, Quaternion.identity, (byte)0, (object[])null); GameObject val2 = PhotonNetwork.InstantiateRoomObject("Misc/Wildcard HUD Audio", Vector3.zero, Quaternion.identity, (byte)0, (object[])null); photonView.RPC("GenerateHUDElementsRPC", (RpcTarget)0, new object[2] { val.GetComponent<PhotonView>().ViewID, val2.GetComponent<PhotonView>().ViewID }); } else { GenerateHUDElementsRPC(); } } } [PunRPC] public void GenerateHUDElementsRPC(int firstID = 0, int secondID = 0) { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: 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_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021a: 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_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Expected O, but got Unknown GameObject val; GameObject val2; if (SemiFunc.IsMultiplayer()) { val = ((Component)PhotonView.Find(firstID)).gameObject; val2 = ((Component)PhotonView.Find(secondID)).gameObject; } else { val = Object.Instantiate<GameObject>(hudAudio); val2 = Object.Instantiate<GameObject>(hudAudio); } shenronWish.Source = val.GetComponent<AudioSource>(); shenronVoice.Source = val2.GetComponent<AudioSource>(); if (SemiFunc.PlayerAvatarLocal().spectating) { val.transform.parent = ((Component)SpectateCamera.instance).transform; val2.transform.parent = ((Component)SpectateCamera.instance).transform; } else { val.transform.parent = ((Component)PlayerController.instance).transform; val2.transform.parent = ((Component)PlayerController.instance).transform; } val.transform.localPosition = Vector3.zero; val2.transform.localPosition = Vector3.zero; ShenronHUD shenronHUD = val.AddComponent<ShenronHUD>(); shenronHUD.shenronWish = new Sound { Source = shenronWish.Source, Sounds = shenronWish.Sounds, Type = shenronWish.Type, Volume = shenronWish.Volume, VolumeRandom = shenronWish.VolumeRandom, Pitch = shenronWish.Pitch, PitchRandom = shenronWish.PitchRandom, SpatialBlend = shenronWish.SpatialBlend, ReverbMix = shenronWish.ReverbMix, Doppler = shenronWish.Doppler }; shenronHUD.shenronVoice = new Sound { Source = shenronVoice.Source, Sounds = shenronVoice.Sounds, Type = shenronVoice.Type, Volume = shenronVoice.Volume, VolumeRandom = shenronVoice.VolumeRandom, Pitch = shenronVoice.Pitch, PitchRandom = shenronVoice.PitchRandom, SpatialBlend = shenronVoice.SpatialBlend, ReverbMix = shenronVoice.ReverbMix, Doppler = shenronVoice.Doppler }; shenronHUD.spawnValuableClip = spawnValuableClip; shenronHUD.photonView = val.GetComponent<PhotonView>(); } [PunRPC] public void PropogateBallsRPC(int balls) { List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < list.Count; i++) { StatsManager.instance.dictionaryOfDictionaries["playerUpgradeDragonBalls"][SemiFunc.PlayerGetSteamID(list[i])] = balls; } photonView.RPC("ExtractCompleteRPC", (RpcTarget)2, Array.Empty<object>()); } public void DestroyBall() { if (SemiFunc.IsMultiplayer()) { physGrabObject.photonView.RPC("DestroyPhysGrabObjectRPC", (RpcTarget)0, Array.Empty<object>()); } else { physGrabObject.DestroyPhysGrabObjectRPC(); } } public void OnDestroy() { if (levelDragonBalls.Contains(this)) { levelDragonBalls.Remove(this); } } } public class ShenronHUD : MonoBehaviour { public class WishUpgrade { public int cap; public int per; public Dictionary<string, bool> playersAtCap = new Dictionary<string, bool>(); public WishUpgrade(int cap = 0, int per = 5) { this.cap = cap; this.per = per; } } private static readonly ManualLogSource log = WildCardMod.instance.log; public static List<string> wishBlacklist = new List<string> { "Dragon Balls", "Chaos Emeralds", "Map Player Count", "Throw", "Head Charge", "Head Power" }; public static string[] vanillaUpgrades = new string[9] { "Health", "Stamina", "Launch", "Speed", "Strength", "Range", "Extra Jump", "Crouch Rest", "Tumble Wings" }; public int[] randomAmounts = new int[4] { Random.Range(Mathf.Max(0, WildCardMod.instance.ModConfig.wishValuableAmounts[0].Value), Mathf.Max(new int[3] { 1, WildCardMod.instance.ModConfig.wishValuableAmounts[0].Value + 1, WildCardMod.instance.ModConfig.wishValuableAmounts[1].Value + 1 })), Random.Range(Mathf.Max(0, WildCardMod.instance.ModConfig.wishValuableAmounts[2].Value), Mathf.Max(new int[3] { 1, WildCardMod.instance.ModConfig.wishValuableAmounts[2].Value + 1, WildCardMod.instance.ModConfig.wishValuableAmounts[3].Value + 1 })), Random.Range(Mathf.Max(0, WildCardMod.instance.ModConfig.wishValuableAmounts[4].Value), Mathf.Max(new int[3] { 1, WildCardMod.instance.ModConfig.wishValuableAmounts[4].Value + 1, WildCardMod.instance.ModConfig.wishValuableAmounts[5].Value + 1 })), Random.Range(Mathf.Max(0, WildCardMod.instance.ModConfig.wishValuableAmounts[6].Value), Mathf.Max(new int[3] { 1, WildCardMod.instance.ModConfig.wishValuableAmounts[6].Value + 1, WildCardMod.instance.ModConfig.wishValuableAmounts[7].Value + 1 })) }; public PhotonView photonView; public float timer; public Sound shenronWish; public Sound shenronVoice; public bool voiceImpulse = true; public bool upgradesGiven = false; public List<string> wishableUpgrades; public Dictionary<string, WishUpgrade> upgradesInfo = new Dictionary<string, WishUpgrade>(); public AudioClip spawnValuableClip; public int valuableType; public GameObject chosenValuable; public float valuableTimerInterval = -1f; public float valuableTimer = 0f; public Vector3 valuableSpawnPosition; public int spawnTimes = 0; public Color emissionColor = new Color(0.65f, 0.65f, 0f); public void Start() { timer = 15f; shenronWish.LowPassIgnoreColliders.Add(PlayerController.instance.col); shenronVoice.LowPassIgnoreColliders.Add(PlayerController.instance.col); wishableUpgrades = StatsManager.instance.FetchPlayerUpgrades(SemiFunc.PlayerGetSteamID(SemiFunc.PlayerAvatarLocal())).Keys.ToList(); wishBlacklist.AddRange(WildCardMod.instance.ModConfig.wishBlacklist.Value.Replace(" ", "").Split(",")); if (WildCardMod.instance.ModConfig.vanillaOnlyUpgrades.Value) { wishBlacklist.AddRange(wishableUpgrades.Where((string x) => !vanillaUpgrades.Contains(x))); } wishableUpgrades.RemoveAll(wishBlacklist.Contains); List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < wishableUpgrades.Count; i++) { log.LogDebug((object)$"Dragon Ball Wishable Upgrade {i}: \"{wishableUpgrades[i]}\""); string[] array = WildCardMod.instance.ModConfig.wishMaxPerDict[wishableUpgrades[i]].Value.Replace(" ", "").Split(","); if (array.Length == 2 && int.TryParse(array[0], out var result) && int.TryParse(array[1], out var result2)) { WishUpgrade wishUpgrade = new WishUpgrade(result, result2); for (int j = 0; j < list.Count; j++) { wishUpgrade.playersAtCap.Add(list[j].steamID, value: false); } upgradesInfo.Add(wishableUpgrades[i], wishUpgrade); } else { log.LogWarning((object)(wishableUpgrades[i] + " Upgrade Wish config was set up wrong!")); } } } public void Update() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) timer -= Time.deltaTime; shenronWish.PlayLoop(timer > 5f, 2f, 0.5f, 1f); if (!SemiFunc.RunIsLevel() && timer > 5f) { timer = 5f; } if (SemiFunc.IsMultiplayer()) { List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < list.Count; i++) { float num = Mathf.Clamp01(Mathf.Pow(0.5f - (timer - 2.5f) / 12.5f, 2f) * -4f + 1f); list[i].playerHealth.bodyMaterial.SetColor("_EmissionColor", Color.Lerp(Color.black, emissionColor, num)); for (int j = 0; j < list[i].playerDeathHead.colorMeshRenderers.Length; j++) { ((Renderer)list[i].playerDeathHead.colorMeshRenderers[j]).material.SetColor("_EmissionColor", Color.Lerp(Color.black, emissionColor, num)); } } } if (valuableTimer > 0f && spawnTimes < randomAmounts[valuableType]) { valuableTimer -= Time.deltaTime; if (valuableTimer <= 0f) { SpawnValuable(); spawnTimes++; valuableTimer = valuableTimerInterval; } } if (!(timer <= 14f)) { return; } if (voiceImpulse) { voiceImpulse = false; shenronVoice.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } if (timer <= 10f) { if (SemiFunc.IsMultiplayer()) { PlayerAvatar.instance.voiceChat.OverridePitch(0.8f, 1f, 0.25f, 0.1f, 0f, 0f); } if (!upgradesGiven) { upgradesGiven = true; StatsUI.instance.Fetch(); StatsUI.instance.ShowStats(); CameraGlitch.Instance.PlayUpgrade(); GameDirector.instance.CameraImpact.ShakeDistance(5f, 1f, 6f, ((Component)SemiFunc.PlayerAvatarLocal()).transform.position, 0.2f); TryUpgrade(); TryValuableReward(); } ((SemiUI)CurrencyUI.instance).Show(); if (timer <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public void SpawnValuable() { //IL_0064: 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_0076: 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_0048: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)chosenValuable).name, valuableSpawnPosition, Random.rotationUniform, (byte)0, (object[])null); photonView.RPC("SpawnValuableRPC", (RpcTarget)0, new object[1] { valuableSpawnPosition }); } else { Object.Instantiate<GameObject>(chosenValuable, valuableSpawnPosition, Random.rotationUniform); SpawnValuableRPC(valuableSpawnPosition); } } [PunRPC] public void SpawnValuableRPC(Vector3 spawnPos) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate<GameObject>(AssetManager.instance.prefabTeleportEffect, spawnPos, Quaternion.identity).transform.localScale = Vector3.one * 2f; shenronVoice.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void TryValuableReward() { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0116: 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) if (RoundDirector.instance.allExtractionPointsCompleted) { int num = Mathf.Max(0, WildCardMod.instance.ModConfig.wishCurrencyAmount.Value); SemiFunc.StatSetRunCurrency(SemiFunc.StatGetRunCurrency() + num); SemiFunc.StatSetRunTotalHaul(SemiFunc.StatGetRunTotalHaul() + num); CurrencyUI.instance.FetchCurrency(); if (SemiFunc.IsMasterClientOrSingleplayer()) { RoundDirector instance = RoundDirector.instance; instance.totalHaul += num * 1000; } } else { if (randomAmounts.All((int x) => x == 0)) { return; } shenronVoice.Sounds = (AudioClip[])(object)new AudioClip[1] { spawnValuableClip }; shenronVoice.VolumeRandom = 0.1f; shenronVoice.PitchRandom = 0.15f; if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } valuableSpawnPosition = ((Component)SemiFunc.LevelPointsGetClosestToPlayer()).transform.position + Vector3.up * 1.5f; LevelValuables val = LevelGenerator.Instance.Level.ValuablePresets[Random.Range(0, LevelGenerator.Instance.Level.ValuablePresets.Count)]; List<PrefabRef> list = null; while (list == null) { valuableType = Random.Range(0, 4); if (randomAmounts[valuableType] != 0) { switch (valuableType) { case 0: list = val.tiny; break; case 1: list = val.small; break; case 2: list = val.medium; break; case 3: list = val.big; break; } } } valuableTimerInterval = 5f / (float)randomAmounts[valuableType]; list.RemoveAll((PrefabRef x) => x.PrefabName == "Valuable Dragon Ball" || x.PrefabName == "Valuable Dummy Item Smith Note"); chosenValuable = list[Random.Range(0, list.Count)].Prefab; valuableTimer = valuableTimerInterval; log.LogDebug((object)$"Dragon Ball Wish spawning {randomAmounts[valuableType]} {((Object)chosenValuable).name}s!"); } } public void TryUpgrade() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (SemiFunc.IsMultiplayer()) { List<string> list = wishableUpgrades; List<PlayerAvatar> list2 = SemiFunc.PlayerGetAll(); for (int i = 0; i < list2.Count; i++) { list2[i].playerHealth.MaterialEffectOverride((Effect)0); if (list.Count == 0) { list = wishableUpgrades; } if (list.Count == 0) { log.LogWarning((object)"Something went wrong with the Dragon Balls upgrades system, no upgrades were available!"); break; } int index = Random.Range(0, list.Count); MegaUpgrade(SemiFunc.PlayerGetSteamID(list2[i]), list[index]); list.RemoveAt(index); } } else { MegaUpgrade(SemiFunc.PlayerGetSteamID(SemiFunc.PlayerAvatarLocal()), wishableUpgrades[Random.Range(0, wishableUpgrades.Count)]); } } public void MegaUpgrade(string steamID, string upgrade) { log.LogDebug((object)("Dragon Ball Mega Upgrading: \"" + upgrade + "\"")); int cap = upgradesInfo[upgrade].cap; int per = upgradesInfo[upgrade].per; int num = per; if (cap > 0) { int num2 = StatsManager.instance.FetchPlayerUpgrades(steamID)[upgrade]; int num3 = cap - num2; num = Mathf.Min(per, num3); upgradesInfo[upgrade].playersAtCap[steamID] = num3 <= 0; } if (num <= 0) { wishableUpgrades.Remove(upgrade); if (WishableCapped(steamID, out wishableUpgrades)) { MegaUpgrade(steamID, wishableUpgrades[Random.Range(0, wishableUpgrades.Count)]); } } else if (vanillaUpgrades.Contains(upgrade)) { if (WildCardMod.instance.oldSharedUpgradesPresent) { List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < list.Count; i++) { string text = SemiFunc.PlayerGetSteamID(list[i]); num = Mathf.Min(per, cap - StatsManager.instance.FetchPlayerUpgrades(text)[upgrade]); if (num > 0) { DoUpgrade(text, num, upgrade); } } } else { DoUpgrade(steamID, num, upgrade); } } else if (WildCardMod.instance.moreUpgradesPresent) { MoreUpgradesUpgrade(steamID, upgrade); } else { log.LogWarning((object)("Dragon Ball wish for upgrade: " + upgrade + " failed, retrying...")); wishBlacklist.Add(upgrade); if (WishableCapped(steamID, out wishableUpgrades)) { MegaUpgrade(steamID, wishableUpgrades[Random.Range(0, wishableUpgrades.Count)]); } } } public bool WishableCapped(string steamID, out List<string> cappedWishables) { if (wishableUpgrades.Count == 0) { wishableUpgrades = StatsManager.instance.FetchPlayerUpgrades(steamID).Keys.ToList(); wishableUpgrades.RemoveAll(wishBlacklist.Contains); } cappedWishables = new List<string>(wishableUpgrades); for (int i = 0; i < wishableUpgrades.Count; i++) { if (upgradesInfo[wishableUpgrades[i]].playersAtCap[steamID]) { cappedWishables.Remove(wishableUpgrades[i]); } } return cappedWishables.Count > 0; } [MethodImpl(MethodImplOptions.NoInlining)] public void MoreUpgradesUpgrade(string steamID, string upgrade) { if (Plugin.instance.upgradeItems.Find((UpgradeItem x) => x.name == upgrade) == null) { wishBlacklist.Add(upgrade); log.LogWarning((object)("Dragon Ball wish upgrade tried to use MoreUpgrades' \"" + upgrade + "\" but something went wrong")); return; } log.LogDebug((object)("Using MoreUpgrades to upgrade \"" + upgrade + "\"!")); int cap = upgradesInfo[upgrade].cap; int per = upgradesInfo[upgrade].per; int num = Mathf.Min(per, cap - StatsManager.instance.FetchPlayerUpgrades(steamID)[upgrade]); if (num <= 0) { wishableUpgrades.Remove(upgrade); if (wishableUpgrades.Count == 0) { wishableUpgrades = StatsManager.instance.FetchPlayerUpgrades(steamID).Keys.ToList(); wishableUpgrades.RemoveAll(wishBlacklist.Contains); } MegaUpgrade(steamID, wishableUpgrades[Random.Range(0, wishableUpgrades.Count)]); } else if (WildCardMod.instance.oldSharedUpgradesPresent) { List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < list.Count; i++) { MoreUpgradesManager.instance.Upgrade(upgrade, SemiFunc.PlayerGetSteamID(list[i]), num); } } else { MoreUpgradesManager.instance.Upgrade(upgrade, steamID, num); } } public void DoUpgrade(string id, int amount, string upgrade) { string text = ("Upgrade" + upgrade + "RPC").Replace(" ", string.Empty); MethodInfo method = typeof(ShenronHUD).GetMethod(text); if (method == null) { log.LogWarning((object)("Upgrade method for \"" + upgrade + "\" could not be found!")); return; } if (SemiFunc.IsMultiplayer()) { photonView.RPC(text, (RpcTarget)1, new object[2] { id, amount }); } method.Invoke(this, new object[2] { id, amount }); } [PunRPC] public void UpgradeHealthRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerHealth(id, 1); } } [PunRPC] public void UpgradeStaminaRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerEnergy(id, 1); } } [PunRPC] public void UpgradeLaunchRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerTumbleLaunch(id, 1); } } [PunRPC] public void UpgradeSpeedRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerSprintSpeed(id, 1); } } [PunRPC] public void UpgradeStrengthRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerGrabStrength(id, 1); } } [PunRPC] public void UpgradeRangeRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerGrabRange(id, 1); } } [PunRPC] public void UpgradeExtraJumpRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerExtraJump(id, 1); } } [PunRPC] public void UpgradeCrouchRestRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerCrouchRest(id, 1); } } [PunRPC] public void UpgradeTumbleWingsRPC(string id, int amount) { for (int i = 0; i < amount; i++) { PunManager.instance.UpgradePlayerTumbleWings(id, 1); } } public void OnDestroy() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); for (int i = 0; i < list.Count; i++) { if (list[i].playerHealth.bodyMaterial.GetColor("_EmissionColor") != Color.black) { list[i].playerHealth.bodyMaterial.SetColor("_EmissionColor", Color.black); for (int j = 0; j < list[i].playerDeathHead.colorMeshRenderers.Length; j++) { ((Renderer)list[i].playerDeathHead.colorMeshRenderers[j]).material.SetColor("_EmissionColor", Color.black); } } } } } public class DummyValuable : MonoBehaviour { private readonly ManualLogSource log = WildCardMod.instance.log; public GameObject prefab; public void Awake() { //IL_0052: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { ItemAttributes val = default(ItemAttributes); if (prefab.TryGetComponent<ItemAttributes>(ref val)) { log.LogDebug((object)("Spawning " + val.item.itemName + " from dummy!")); GameObject val2 = Items.SpawnItem(val.item, ((Component)this).transform.position, ((Component)this).transform.rotation); val2.SetActive(true); log.LogDebug((object)("Spawned " + ((Object)prefab).name + "!")); } ValuableDirector instance = ValuableDirector.instance; instance.totalMaxAmount++; ValuableDirector instance2 = ValuableDirector.instance; instance2.valuableTargetAmount--; } } public void Start() { if (SemiFunc.IsMasterClientOrSingleplayer()) { ((Component)((Component)this).transform).GetComponent<PhysGrabObject>().DestroyPhysGrabObject(); } } } public class FixatedNoseTrap : Trap { private readonly ManualLogSource log = WildCardMod.instance.log; public ParticleScriptExplosion explodeScript; public PhysicMaterial physMat; public Animator animator; public override void Start() { ((Trap)this).Start(); base.physGrabObject.OverrideMaterial(physMat, -123f); } public override void Update() { ((Trap)this).Update(); if (base.trapStart && SemiFunc.IsMasterClientOrSingleplayer()) { base.physGrabObject.impactDetector.DestroyObject(true); } } public void ImpactSquish() { if (SemiFunc.IsMasterClientOrSingleplayer()) { float impactForce = base.physGrabObject.impactDetector.impactForce; if (GameManager.Multiplayer()) { base.photonView.RPC("SquishRPC", (RpcTarget)0, new object[1] { impactForce }); } else { SquishRPC(impactForce); } if (!base.physGrabObject.impactDetector.inCart && !base.physGrabObject.roomVolumeCheck.inExtractionPoint) { ((Trap)this).TrapStart(); } } } [PunRPC] public void SquishRPC(float force) { animator.SetLayerWeight(1, Mathf.Clamp01(force / 150f)); animator.SetTrigger("Squish"); } public void NoseExplode() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Distance(((Component)this).transform.position, ((Component)PlayerAvatar.instance).transform.position) < 10f) { CameraGlitch.Instance.PlayShort(); } log.LogDebug((object)(((Object)((Component)this).gameObject).name + " is exploding!")); if (SemiFunc.IsMasterClientOrSingleplayer()) { base.enemyInvestigate = true; base.enemyInvestigateRange = 10f; float value = Random.value; if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("ExplosionRPC", (RpcTarget)0, new object[1] { value }); } else { ExplosionRPC(value); } } } [PunRPC] public void ExplosionRPC(float random) { //IL_0048: 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 (random < 0.9f) { explodeScript.Spawn(((Component)this).transform.position, 0.245f, 5, 5, 2.5f, false, false, 1f); } else { explodeScript.Spawn(((Component)this).transform.position, 2f, 20, 20, 5f, false, false, 1f); } } } public class GiwiWormValuable : MonoBehaviour { private readonly ManualLogSource log = WildCardMod.instance.log; public GiwiRigidbody[] giwiRigidbodies; public Sound giwiSounds; public PhysGrabObject physGrabObject; public PhotonView photonView; public Animator animator; public float animTimer = 0f; public float animLerp; public float startTime = 0.5f; public float targetTime = 0.5f; public float animSpeed; public float dropTimer; public float overrideStrength = 15f; public void Start() { if (SemiFunc.IsMultiplayer()) { if (!SemiFunc.IsMasterClient()) { for (int i = 0; i < giwiRigidbodies.Length; i++) { giwiRigidbodies[i].rb.collisionDetectionMode = (CollisionDetectionMode)0; } } } else { PhotonTransformView[] componentsInChildren = ((Component)((Component)this).transform).GetComponentsInChildren<PhotonTransformView>(); for (int j = 0; j < componentsInChildren.Length; j++) { ((Behaviour)componentsInChildren[j]).enabled = false; } } } public void Update() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if (!LevelGenerator.Instance.Generated) { return; } if (physGrabObject.grabbed) { if (SemiFunc.IsMasterClientOrSingleplayer()) { physGrabObject.OverrideGrabStrength(overrideStrength, 0.1f); } if (!giwiSounds.Source.isPlaying) { EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 10f, false); giwiSounds.Play(((Component)giwiRigidbodies[10].rb).transform.position, 1f, 1f, 1f, 1f); log.LogDebug((object)(((Object)giwiSounds.Source.clip).name ?? "")); } } else if (giwiSounds.Source.isPlaying) { giwiSounds.Stop(); } if (animTimer <= 0f) { animLerp = 0f; if (SemiFunc.IsMasterClientOrSingleplayer()) { animTimer = Random.Range(0.5f, 2f); float num = Mathf.Max(Random.value, 0.125f) * 2f; float value = Random.value; if (GameManager.Multiplayer()) { photonView.RPC("TargetTimeRPC", (RpcTarget)0, new object[4] { value, targetTime, num, animTimer }); } else { TargetTimeRPC(value, targetTime, num, animTimer); } } } else if (animLerp < 1f) { animator.SetFloat("Motion Time", Mathf.Lerp(startTime, targetTime, Mathf.Clamp01(animLerp))); animLerp += Time.deltaTime * animSpeed; } else { animTimer -= Time.deltaTime; } } public void FixedUpdate() { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if (!LevelGenerator.Instance.Generated || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (physGrabObject.grabbed || dropTimer > 0f) { Vector3 val = default(Vector3); for (int i = 1; i < giwiRigidbodies.Length; i++) { giwiRigidbodies[i].newDirTimer -= Time.fixedDeltaTime; if (giwiRigidbodies[i].newDirTimer <= 0f) { if (physGrabObject.grabbed) { ((Vector3)(ref val))..ctor(1f, 3f, 1f); } else { ((Vector3)(ref val))..ctor(1f, 0.1f, 1f); } giwiRigidbodies[i].direction = Vector3.Scale(Random.onUnitSphere, val); giwiRigidbodies[i].newDirTimer = Random.Range(0.05f, 0.25f); } giwiRigidbodies[i].Wiggle(Random.Range(4f, 10f) * ((float)Mathf.Max(i, 3) / 1.5f), Random.Range(3f, 8f) * -1f); } if (physGrabObject.grabbed && dropTimer != 5f) { dropTimer = 5f; } } if (!physGrabObject.grabbed) { dropTimer -= Time.fixedDeltaTime; } } [PunRPC] public void TargetTimeRPC(float tTime, float sTime, float speed, float animTime) { targetTime = tTime; startTime = sTime; animSpeed = speed; animTimer = animTime; } } [Serializable] public class GiwiRigidbody { public Rigidbody rb; public Vector3 direction; public float newDirTimer; public void Wiggle(float forceIntensity, float torqueIntensity) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) rb.AddForce(direction * forceIntensity); rb.AddTorque(Random.onUnitSphere * torqueIntensity); } } public class Hellgato : MonoBehaviour { private readonly ManualLogSource log = WildCardMod.instance.log; public PhotonView photonView; public PhysGrabObject physGrabObject; public ValuableObject valuableObject; public PhysGrabObjectImpactDetector impactDetector; public ParticleScriptExplosion explodeScript; public ParticleSystem particleSystem; public PropLight propLight; public Sound crackleLoop; public float loopTimer; public bool playLoop; public Transform floatPoint; public Animator animator; public float blinkTimer; public float earTimer; public float pawTimer; public bool lightTrigger; public AnimationCurve lightPulseCurve; public float lightPulseTimer; public bool wasGrabbed; public float alterTimer; public float balanceForce = 4f; public float floatHeight = 0.75f; public float floatPower = 5f; public float glidePower = 0.5f; public void Awake() { valuableObject.dollarValueOverride = Mathf.Max(1000, Mathf.RoundToInt(Random.Range(valuableObject.valuePreset.valueMin, valuableObject.valuePreset.valueMax) / 1000f) * 1000); } public void FixedUpdate() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_0125: 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_0137: Unknown result type (might be due to invalid IL or missing references) if (LevelGenerator.Instance.Generated && SemiFunc.IsMasterClientOrSingleplayer()) { Quaternion val = Quaternion.FromToRotation(((Component)this).transform.up, Vector3.up); physGrabObject.rb.AddTorque(new Vector3(val.x, val.y, val.z) * balanceForce); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(floatPoint.position, -Vector3.up, ref val2, floatHeight, LayerMask.GetMask(new string[6] { "Default", "PhysGrabObject", "PhysGrabObjectCart", "PhysGrabObjectHinge", "Enemy", "Player" }), (QueryTriggerInteraction)1) && !physGrabObject.colliders.Contains(((Component)((RaycastHit)(ref val2)).collider).transform)) { physGrabObject.rb.AddForce(((Component)this).transform.up * (floatPower / ((RaycastHit)(ref val2)).distance) * (1.1f - Quaternion.Angle(Quaternion.identity, val) / 360f)); } else { physGrabObject.rb.AddForce(((Component)this).transform.up * floatPower * glidePower * (1.1f - Quaternion.Angle(Quaternion.identity, val) / 360f)); } } } public void Update() { if (!LevelGenerator.Instance.Generated) { return; } if (SemiFunc.IsMasterClientOrSingleplayer()) { physGrabObject.OverrideIndestructi