using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Peak.Afflictions; using Photon.Pun; using UnityEngine; using Zorro.Core; using Zorro.Core.Serizalization; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("hurryup")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("hurryup")] [assembly: AssemblyTitle("hurryup")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace hurryup { [HarmonyPatch(typeof(CharacterAfflictions), "Awake")] internal static class fogMechanics { public static fogMechanicHandler fMechHandler; public static playersAtCampfireCheck currentCampfireChecker; internal static void Postfix(CharacterAfflictions __instance) { if (PhotonNetwork.IsMasterClient && __instance.character.IsLocal) { fMechHandler = ((Component)__instance.character).gameObject.AddComponent(); ((Component)Singleton.Instance).gameObject.AddComponent(); } } } [HarmonyPatch(typeof(LavaRising), "Awake")] internal static class setWaitTime { internal static void Prefix(LavaRising __instance) { __instance.initialWaitTime -= Plugin.lavaAdditionalWaitTime.Value; } } [HarmonyPatch(typeof(LavaRising), "Update")] internal static class LavaSpeedPatch { internal static void Postfix(LavaRising __instance) { if (__instance.started && !__instance.ended) { __instance.timeTraveled += (__instance.travelTime / Plugin.lavaRiseTime.Value - 1f) * Time.deltaTime; } } } [HarmonyPatch(typeof(Campfire), "Light_Rpc")] internal static class resetLastShot { internal static void Postfix() { if ((Object)(object)fogMechanics.fMechHandler != (Object)null) { fogMechanics.fMechHandler.playersGivenChance.Clear(); } } } [HarmonyPatch(typeof(Campfire), "Awake")] internal static class addChecksForCampfire { internal static void Postfix(Campfire __instance) { ((Component)__instance).gameObject.AddComponent().campfire = __instance; } } internal class playersAtCampfireCheck : MonoBehaviour { public List charactersNear = new List(); public Campfire campfire; internal void Update() { //IL_006a: 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 (campfire.Lit) { return; } charactersNear.Clear(); fogMechanics.currentCampfireChecker = this; foreach (Character allCharacter in Character.AllCharacters) { if (!((Object)(object)allCharacter == (Object)null) && !((MonoBehaviourPun)allCharacter).photonView.Owner.IsInactive) { float num = Vector3.Distance(((Component)this).transform.position, allCharacter.Center); if (num < 15f && !allCharacter.data.dead) { charactersNear.Add(allCharacter); } } } } } internal class customFogHandler : MonoBehaviour { public float procXtraCold = 0f; internal void Start() { FogSphereOrigin[] origins = Singleton.Instance.origins; foreach (FogSphereOrigin val in origins) { val.size -= Plugin.additionalFogSize.Value; OrbFogHandler instance = Singleton.Instance; instance.maxWaitTime -= Plugin.additionalWaitTime.Value; } } internal void Update() { //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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected I4, but got Unknown if (!Singleton.Instance.isMoving) { return; } procXtraCold += Time.deltaTime; OrbFogHandler instance = Singleton.Instance; instance.currentSize -= Plugin.additionalFogSpeed.Value * Time.deltaTime; if ((Object)(object)fogMechanics.currentCampfireChecker != (Object)null) { OrbFogHandler instance2 = Singleton.Instance; instance2.currentSize -= Plugin.additionalFogSpeedPerPlayer.Value * (float)fogMechanics.currentCampfireChecker.charactersNear.Count * Time.deltaTime; } float num = (Plugin.additionalFogSpeedPerPlayer.Value * (float)fogMechanics.currentCampfireChecker.charactersNear.Count + Plugin.additionalFogSpeed.Value + Singleton.Instance.speed) * Time.deltaTime; Segment currentSegment = Singleton.Instance.GetCurrentSegment(); Segment val = currentSegment; Segment val2 = val; switch ((int)val2) { case 0: { OrbFogHandler instance5 = Singleton.Instance; instance5.currentSize -= num * (Plugin.fogSpeedMultiplierBeach.Value - 1f); break; } case 1: { OrbFogHandler instance4 = Singleton.Instance; instance4.currentSize -= num * (Plugin.fogSpeedMultiplierTropics.Value - 1f); break; } case 2: { OrbFogHandler instance3 = Singleton.Instance; instance3.currentSize -= num * (Plugin.fogSpeedMultiplierAlpine.Value - 1f); break; } } if (!(procXtraCold > 1f) || (Plugin.fogDamageMultiplier.Value == 1f && !Plugin.instantFogGiveUp.Value)) { return; } foreach (Character allCharacter in Character.AllCharacters) { if (allCharacter.data.isInFog) { float[] array = new float[CharacterAfflictions.NumStatusTypes]; array[2] = 0.0105f * Plugin.fogDamageMultiplier.Value; ((MonoBehaviourPun)allCharacter.refs.afflictions).photonView.RPC("RPC_ApplyStatusesFromFloatArray", (RpcTarget)0, new object[1] { array }); if (allCharacter.data.passedOut && Plugin.instantFogGiveUp.Value && !allCharacter.data.dead) { allCharacter.DieInstantly(); break; } } } procXtraCold = 0f; } } internal class fogMechanicHandler : MonoBehaviour { public List playersGivenChance = new List(); public float timer = 0f; public void Update() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Expected O, but got Unknown if (Plugin.fogMechanicMotivation.Value) { float num = 0.04f; timer += Time.deltaTime; foreach (Character allCharacter in Character.AllCharacters) { if (allCharacter.data.isInFog && timer > Plugin.motivationInterval.Value && allCharacter.refs.afflictions.statusSum < 0.9f - Plugin.motivationPenalty.Value * num) { Affliction_FasterBoi val = (Affliction_FasterBoi)Affliction.CreateBlankAffliction((AfflictionType)2); ((Affliction)val).totalTime = Plugin.motivationLength.Value; val.cachedDrowsy = 0f; val.climbSpeedMod = Plugin.motivationSpeedMult.Value - 1f; val.moveSpeedMod = Plugin.motivationSpeedMult.Value - 1f; allCharacter.refs.afflictions.AddAffliction((Affliction)(object)val, false); allCharacter.refs.afflictions.AddStatus(Plugin.motivationPenaltyType.Value, Plugin.motivationPenalty.Value * num, false, true, true); PushAllTheStuff(pushAfflictions: true, Plugin.motivationPenalty.Value != 0f, allCharacter); } } if (timer > Plugin.motivationInterval.Value) { timer = 0f; } } if (!Plugin.fogMechanicFinalShot.Value) { return; } float num2 = 0.04f; foreach (Character allCharacter2 in Character.AllCharacters) { if (allCharacter2.data.isInFog && allCharacter2.refs.afflictions.statusSum > 0.9f - Plugin.finalShotPenalty.Value * num2 && !playersGivenChance.Contains(allCharacter2.player) && allCharacter2.refs.afflictions.statusSum + Plugin.finalShotPenalty.Value * num2 < 1f) { allCharacter2.refs.afflictions.AddStatus(Plugin.finalShotPenaltyType.Value, Plugin.finalShotPenalty.Value * num2, false, true, true); Affliction_FasterBoi val2 = (Affliction_FasterBoi)Affliction.CreateBlankAffliction((AfflictionType)2); ((Affliction)val2).totalTime = Plugin.finalShotLength.Value; val2.cachedDrowsy = 0f; val2.climbSpeedMod = Plugin.finalEnergyDrinkPower.Value - 1f; val2.moveSpeedMod = Plugin.finalEnergyDrinkPower.Value - 1f; allCharacter2.refs.afflictions.AddAffliction((Affliction)(object)val2, false); Affliction val3 = Affliction.CreateBlankAffliction((AfflictionType)1); val3.totalTime = Plugin.finalShotLength.Value; allCharacter2.refs.afflictions.AddAffliction(val3, false); Affliction val4 = Affliction.CreateBlankAffliction((AfflictionType)16); val4.totalTime = Plugin.finalShotLength.Value; allCharacter2.refs.afflictions.AddAffliction(val4, false); PushAllTheStuff(pushAfflictions: true, Plugin.finalShotPenalty.Value != 0f, allCharacter2); playersGivenChance.Add(allCharacter2.player); } } } public void PushAllTheStuff(bool pushAfflictions, bool pushStatuses, Character c) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) if (pushAfflictions) { AfflictionSyncData val = default(AfflictionSyncData); val.afflictions = new List(c.refs.afflictions.afflictionList); byte[] array = IBinarySerializable.ToManagedArray(val); ((MonoBehaviourPun)c).photonView.RPC("SyncAfflictionsRPC", (RpcTarget)5, new object[1] { array }); } if (pushStatuses) { StatusSyncData val2 = default(StatusSyncData); val2.statusList = new List(c.refs.afflictions.currentStatuses); byte[] array2 = IBinarySerializable.ToManagedArray(val2); ((MonoBehaviourPun)c.refs.afflictions).photonView.RPC("SyncStatusesRPC", (RpcTarget)5, new object[1] { array2 }); } } } [BepInPlugin("hurryupmod", "hurry up", "1.0.0")] public class Plugin : BaseUnityPlugin { public static ConfigEntry additionalFogSpeed; public static ConfigEntry additionalWaitTime; public static ConfigEntry additionalFogSize; public static ConfigEntry fogDamageMultiplier; public static ConfigEntry additionalFogSpeedPerPlayer; public static ConfigEntry instantFogGiveUp; public static ConfigEntry calderaFog; public static ConfigEntry fogMechanicMotivation; public static ConfigEntry motivationInterval; public static ConfigEntry motivationSpeedMult; public static ConfigEntry finalShotPenalty; public static ConfigEntry finalShotLength; public static ConfigEntry finalEnergyDrinkPower; public static ConfigEntry finalShotPenaltyType; public static ConfigEntry motivationPenaltyType; public static ConfigEntry motivationPenalty; public static ConfigEntry motivationLength; public static ConfigEntry fogMechanicFinalShot; public static ConfigEntry fogSpeedMultiplierBeach; public static ConfigEntry fogSpeedMultiplierTropics; public static ConfigEntry fogSpeedMultiplierAlpine; public static ConfigEntry lavaRiseTime; public static ConfigEntry lavaAdditionalWaitTime; internal static ManualLogSource Log { get; private set; } private void Awake() { //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown additionalFogSpeed = ((BaseUnityPlugin)this).Config.Bind("Fog Options", "Additional Fog Speed (base fog speed is 0.4f)", 0f, "How much additional speed the fog has"); additionalWaitTime = ((BaseUnityPlugin)this).Config.Bind("Fog Options", "Reduce Wait Time (base is 1000)", 0f, "How much less time the fog waits before moving, if players havent moved on"); additionalFogSize = ((BaseUnityPlugin)this).Config.Bind("Fog Options", "Reduce Fog Size (base is 650)", 0f, "How much less starting size the fog has"); fogDamageMultiplier = ((BaseUnityPlugin)this).Config.Bind("Fog Options", "Fog Damage Multiplier (Can be laggy in big lobbies, set value to 1 to disable)", 1f, "How much fog damage is multiplied by"); additionalFogSpeedPerPlayer = ((BaseUnityPlugin)this).Config.Bind("Fog Options", "Additional Fog Speed Per Player At Campfire", 0f, "How much speed is added for each player at the campfire"); instantFogGiveUp = ((BaseUnityPlugin)this).Config.Bind("Fog Options", "Instant Fog Give Up", false, "If this is true any passed out players will instanly die in the fog"); fogMechanicMotivation = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Motivating Fog (btw most of this stuff doesnt work but if we get a way to give afflictions networked ill fix it)", false, "If set to true, fog will periodically give the energy drink effect"); motivationInterval = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Motivation Interval", 3f, "The interval at which the energy drink effect is applied"); motivationLength = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Motivation Length", 3f, "How long the effect lasts"); motivationSpeedMult = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Motivation Speed Multiplier", 2f, "How much the players speed is multiplied by when motivated"); motivationPenaltyType = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Motivation Penalty Type", (STATUSTYPE)0, "The type of status a player gets from motivation activating"); motivationPenalty = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Motivation Penalty Amount", 1f, "How much status a player gains from motivation activating"); fogMechanicFinalShot = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Final Shot", false, "Once a player is about to die in the fog they are given the effect of a lollipop, energy drink, and fortified milk, once per segment"); finalShotLength = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Final Shot Length", 15f, "How long the effects last"); finalEnergyDrinkPower = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Final Shot Speed Multiplier", 2f, "How much speed multiplier the player gets from the energy drink effect"); finalShotPenalty = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Final Shot Penalty Amount", 1f, "How much status a player gains from activating a final shot"); finalShotPenaltyType = ((BaseUnityPlugin)this).Config.Bind("Fog Mechanic", "Final Shot Penalty Type", (STATUSTYPE)5, "The type of status a player gets from final shot activating"); fogSpeedMultiplierAlpine = ((BaseUnityPlugin)this).Config.Bind("Biome Fog", "Alpine Fog Speed Multiplier", 1f, "How much the fog speed is multiplied by at the alpine"); fogSpeedMultiplierBeach = ((BaseUnityPlugin)this).Config.Bind("Biome Fog", "Beach Fog Speed Multiplier", 1f, "How much the fog speed is multiplied by at the beach"); fogSpeedMultiplierTropics = ((BaseUnityPlugin)this).Config.Bind("Biome Fog", "Tropics Fog Speed Multiplier", 1f, "How much the fog speed is multiplied by at the tropics"); lavaRiseTime = ((BaseUnityPlugin)this).Config.Bind("Rising Lava", "Lava Rise Time", 1200f, "How many seconds it takes for the lava to reach the top"); lavaAdditionalWaitTime = ((BaseUnityPlugin)this).Config.Bind("Rising Lava", "Lava Reduce Wait Time (base is 180)", 0f, "How much less time the lava waits before rising"); Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"Plugin hurry up is loaded!"); Harmony val = new Harmony("hurryup"); val.PatchAll(); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }