using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using MenuLib; using MenuLib.MonoBehaviors; using Microsoft.CodeAnalysis; using NuageRoles.Roles; using NuageRoles.Roles.Patches; using Photon.Pun; using Photon.Realtime; using REPOLib; using REPOLib.Modules; using TMPro; using Unity.VisualScripting; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("NuageRoles")] [assembly: AssemblyDescription("Role mod for R.E.P.O., maintained as NuageRoles.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("TheoHay, GangDesNuages")] [assembly: AssemblyProduct("NuageRoles")] [assembly: AssemblyCopyright("")] [assembly: ComVisible(false)] [assembly: Guid("b55829e7-8346-4258-b5db-23566f7af06b")] [assembly: AssemblyFileVersion("4.0.0")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.0.0.0")] [module: UnverifiableCode] 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; } } } namespace NuageRoles { public sealed class NuageRolesConfig { private const string RandomRoleName = "Random"; private const string DefaultRoleName = "Strongman"; private static readonly string[] AllRoleChoices = new string[12] { "Random", "Runner", "Tank", "Gambler", "Strongman", "Ranged Looter", "Athletic", "Mage", "Reaper", "Scout", "Regular", "Engineer" }; private readonly ConfigFile configFile; private REPOSlider? roleSlider; private REPOPopupPage? configPage; private REPOButton? buttonOpen; private REPOButton? buttonOpenLobby; private REPOButton? buttonClose; private REPOToggle? afterDeathRoleToggle; private REPOToggle? mageTopMana; private Action? updateManaDisplay; public ConfigEntry ToggleKey { get; private set; } public ConfigEntry ShowSpellsKey { get; private set; } public ConfigEntry HealKey { get; private set; } public ConfigEntry SpeedKey { get; private set; } public ConfigEntry OverchargeKey { get; private set; } public ConfigEntry JumpKey { get; private set; } public ConfigEntry StaminaKey { get; private set; } public ConfigEntry ScoutKey { get; private set; } public ConfigEntry ChargeItemKey { get; private set; } public ConfigEntry RunnerSpeedMultiplier { get; private set; } public ConfigEntry RunnerStaminaMultiplier { get; private set; } public ConfigEntry TankHealthMultiplier { get; private set; } public ConfigEntry TankSpeedMultiplier { get; private set; } public ConfigEntry TankPassiveRegenAmount { get; private set; } public ConfigEntry TankPassiveRegenIntervalSeconds { get; private set; } public ConfigEntry GamblerPositiveSpeedMultiplier { get; private set; } public ConfigEntry GamblerPositiveStaminaMultiplier { get; private set; } public ConfigEntry GamblerPositiveHealthMultiplier { get; private set; } public ConfigEntry GamblerPositiveStrengthMultiplier { get; private set; } public ConfigEntry GamblerPositiveJumpMultiplier { get; private set; } public ConfigEntry GamblerNegativeSpeedMultiplier { get; private set; } public ConfigEntry GamblerNegativeStaminaMultiplier { get; private set; } public ConfigEntry GamblerNegativeHealthMultiplier { get; private set; } public ConfigEntry GamblerNegativeStrengthMultiplier { get; private set; } public ConfigEntry GamblerNegativeJumpMultiplier { get; private set; } public ConfigEntry StrongmanStrengthMultiplier { get; private set; } public ConfigEntry StrongmanStrengthBonus { get; private set; } public ConfigEntry RangedLooterGrabRangeMultiplier { get; private set; } public ConfigEntry RangedLooterStrengthMultiplier { get; private set; } public ConfigEntry AthleticStrengthMultiplier { get; private set; } public ConfigEntry AthleticStaminaBonus { get; private set; } public ConfigEntry AthleticJumpForceBonus { get; private set; } public ConfigEntry ReaperHealthMultiplier { get; private set; } public ConfigEntry ReaperMaxHealthBonusPerKill { get; private set; } public ConfigEntry ReaperHealAmountPerKill { get; private set; } public ConfigEntry ReaperBuffCooldownFrames { get; private set; } public ConfigEntry ScoutStaminaMultiplier { get; private set; } public ConfigEntry ScoutSprintRechargeMultiplier { get; private set; } public ConfigEntry ScoutAbilityDurationSeconds { get; private set; } public ConfigEntry ScoutAbilityCooldownSeconds { get; private set; } public ConfigEntry MageMaxMana { get; private set; } public ConfigEntry MageHealAmount { get; private set; } public ConfigEntry MageSpeedMultiplier { get; private set; } public ConfigEntry MageJumpForceBonus { get; private set; } public ConfigEntry MageOverchargeMultiplier { get; private set; } public ConfigEntry MageSpeedBoostDurationSeconds { get; private set; } public ConfigEntry MageJumpBoostDurationSeconds { get; private set; } public ConfigEntry MageOverchargeDurationSeconds { get; private set; } public ConfigEntry EngineerChargeStaminaCost { get; private set; } public ConfigEntry EngineerStaminaRestoreAmount { get; private set; } public ConfigEntry EngineerStaminaRestoreIntervalSeconds { get; private set; } public ConfigEntry CustomRoleNameRunner { get; private set; } public ConfigEntry CustomRoleNameTank { get; private set; } public ConfigEntry CustomRoleNameGambler { get; private set; } public ConfigEntry CustomRoleNameStrongman { get; private set; } public ConfigEntry CustomRoleNameRL { get; private set; } public ConfigEntry CustomRoleNameAthletic { get; private set; } public ConfigEntry CustomRoleNameMage { get; private set; } public ConfigEntry CustomRoleNameReaper { get; private set; } public ConfigEntry CustomRoleNameScout { get; private set; } public ConfigEntry CustomRoleNameRegular { get; private set; } public ConfigEntry CustomRoleNameEngineer { get; private set; } public ConfigEntry CustomRoleDecRunner { get; private set; } public ConfigEntry CustomRoleDecTank { get; private set; } public ConfigEntry CustomRoleDecGambler { get; private set; } public ConfigEntry CustomRoleDecStrongman { get; private set; } public ConfigEntry CustomRoleDecRL { get; private set; } public ConfigEntry CustomRoleDecAthletic { get; private set; } public ConfigEntry CustomRoleDecMage { get; private set; } public ConfigEntry CustomRoleDecReaper { get; private set; } public ConfigEntry CustomRoleDecScout { get; private set; } public ConfigEntry CustomRoleDecRegular { get; private set; } public ConfigEntry CustomRoleDecEngineer { get; private set; } public ConfigEntry SavedRole { get; private set; } public ConfigEntry EnableRoleUpgrades { get; private set; } public ConfigEntry AssignRoleAfterRevive { get; private set; } public ConfigEntry MageTopManaConf { get; private set; } public ConfigEntry ShowGUIAtStart { get; private set; } public ConfigEntry EnableRunner { get; private set; } public ConfigEntry EnableTank { get; private set; } public ConfigEntry EnableGambler { get; private set; } public ConfigEntry EnableStrongman { get; private set; } public ConfigEntry EnableRL { get; private set; } public ConfigEntry EnableAthletic { get; private set; } public ConfigEntry EnableMage { get; private set; } public ConfigEntry EnableReaper { get; private set; } public ConfigEntry EnableScout { get; private set; } public ConfigEntry EnableRegular { get; private set; } public ConfigEntry EnableEngineer { get; private set; } public bool AfterDeathNewRole => AssignRoleAfterRevive.Value; public bool MageTopManaTop => MageTopManaConf.Value; public string ChosenRoleName => GetSelectableRoleName(SavedRole.Value); public NuageRolesConfig(ConfigFile configFile) { this.configFile = configFile; } public void Bind() { //IL_0011: 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_0039: Expected O, but got Unknown //IL_0039: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_006a: Expected O, but got Unknown //IL_0080: 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_009b: Expected O, but got Unknown //IL_009b: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00cc: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_00fd: Expected O, but got Unknown //IL_0113: 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_012e: Expected O, but got Unknown //IL_012e: Expected O, but got Unknown //IL_0144: 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) //IL_015f: Expected O, but got Unknown //IL_015f: Expected O, but got Unknown //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown //IL_0190: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_01c1: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_01f2: Expected O, but got Unknown //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_0223: Expected O, but got Unknown //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Expected O, but got Unknown //IL_0254: Expected O, but got Unknown //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Expected O, but got Unknown //IL_0285: Expected O, but got Unknown //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Expected O, but got Unknown //IL_02b6: Expected O, but got Unknown //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Expected O, but got Unknown //IL_02e7: Expected O, but got Unknown //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Expected O, but got Unknown //IL_0318: Expected O, but got Unknown //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Expected O, but got Unknown //IL_034a: Expected O, but got Unknown //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Expected O, but got Unknown //IL_037c: Expected O, but got Unknown //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Expected O, but got Unknown //IL_03ae: Expected O, but got Unknown //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Expected O, but got Unknown //IL_03e0: Expected O, but got Unknown //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Expected O, but got Unknown //IL_0412: Expected O, but got Unknown //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Expected O, but got Unknown //IL_0444: Expected O, but got Unknown //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Expected O, but got Unknown //IL_0476: Expected O, but got Unknown //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Expected O, but got Unknown //IL_04a8: Expected O, but got Unknown //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Expected O, but got Unknown //IL_04da: Expected O, but got Unknown //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Expected O, but got Unknown //IL_051d: Expected O, but got Unknown //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Expected O, but got Unknown //IL_0560: Expected O, but got Unknown //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Expected O, but got Unknown //IL_05a3: Expected O, but got Unknown //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Expected O, but got Unknown //IL_05e6: Expected O, but got Unknown //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Expected O, but got Unknown //IL_061e: Expected O, but got Unknown //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Expected O, but got Unknown //IL_0659: Expected O, but got Unknown //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_069c: Expected O, but got Unknown //IL_069c: Expected O, but got Unknown //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Expected O, but got Unknown //IL_06df: Expected O, but got Unknown //IL_06f5: Unknown result type (might be due to invalid IL or missing references) //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Expected O, but got Unknown //IL_0722: Expected O, but got Unknown //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Expected O, but got Unknown //IL_0765: Expected O, but got Unknown //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Expected O, but got Unknown //IL_07a8: Expected O, but got Unknown //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Expected O, but got Unknown //IL_07eb: Expected O, but got Unknown //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0824: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Expected O, but got Unknown //IL_082e: Expected O, but got Unknown //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_0867: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Expected O, but got Unknown //IL_0871: Expected O, but got Unknown //IL_0887: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08b4: Expected O, but got Unknown //IL_08b4: Expected O, but got Unknown //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_08ed: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Expected O, but got Unknown //IL_08f7: Expected O, but got Unknown //IL_090d: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_093a: Expected O, but got Unknown //IL_093a: Expected O, but got Unknown //IL_0950: Unknown result type (might be due to invalid IL or missing references) //IL_0973: Unknown result type (might be due to invalid IL or missing references) //IL_097d: Expected O, but got Unknown //IL_097d: Expected O, but got Unknown //IL_0993: Unknown result type (might be due to invalid IL or missing references) //IL_09b6: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Expected O, but got Unknown //IL_09c0: Expected O, but got Unknown //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Unknown result type (might be due to invalid IL or missing references) //IL_0a03: Expected O, but got Unknown //IL_0a03: Expected O, but got Unknown //IL_0a19: Unknown result type (might be due to invalid IL or missing references) //IL_0a3c: Unknown result type (might be due to invalid IL or missing references) //IL_0a46: Expected O, but got Unknown //IL_0a46: Expected O, but got Unknown //IL_0a5c: Unknown result type (might be due to invalid IL or missing references) //IL_0a78: Unknown result type (might be due to invalid IL or missing references) //IL_0a82: Expected O, but got Unknown //IL_0a82: Expected O, but got Unknown //IL_0a98: Unknown result type (might be due to invalid IL or missing references) //IL_0abb: Unknown result type (might be due to invalid IL or missing references) //IL_0ac5: Expected O, but got Unknown //IL_0ac5: Expected O, but got Unknown //IL_0adb: Unknown result type (might be due to invalid IL or missing references) //IL_0afe: Unknown result type (might be due to invalid IL or missing references) //IL_0b08: Expected O, but got Unknown //IL_0b08: Expected O, but got Unknown //IL_0b1e: Unknown result type (might be due to invalid IL or missing references) //IL_0b39: Unknown result type (might be due to invalid IL or missing references) //IL_0b43: Expected O, but got Unknown //IL_0b43: Expected O, but got Unknown //IL_0b59: Unknown result type (might be due to invalid IL or missing references) //IL_0b75: Unknown result type (might be due to invalid IL or missing references) //IL_0b7f: Expected O, but got Unknown //IL_0b7f: Expected O, but got Unknown //IL_0b95: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Unknown result type (might be due to invalid IL or missing references) //IL_0bbb: Expected O, but got Unknown //IL_0bbb: Expected O, but got Unknown //IL_0bd1: Unknown result type (might be due to invalid IL or missing references) //IL_0bf4: Unknown result type (might be due to invalid IL or missing references) //IL_0bfe: Expected O, but got Unknown //IL_0bfe: Expected O, but got Unknown //IL_0c14: Unknown result type (might be due to invalid IL or missing references) //IL_0c37: Unknown result type (might be due to invalid IL or missing references) //IL_0c41: Expected O, but got Unknown //IL_0c41: Expected O, but got Unknown //IL_0c57: Unknown result type (might be due to invalid IL or missing references) //IL_0c72: Unknown result type (might be due to invalid IL or missing references) //IL_0c7c: Expected O, but got Unknown //IL_0c7c: Expected O, but got Unknown //IL_0c92: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Unknown result type (might be due to invalid IL or missing references) //IL_0cb8: Expected O, but got Unknown //IL_0cb8: Expected O, but got Unknown //IL_0cce: Unknown result type (might be due to invalid IL or missing references) //IL_0ce6: Unknown result type (might be due to invalid IL or missing references) //IL_0cf0: Expected O, but got Unknown //IL_0cf0: Expected O, but got Unknown //IL_0d06: Unknown result type (might be due to invalid IL or missing references) //IL_0d1e: Unknown result type (might be due to invalid IL or missing references) //IL_0d28: Expected O, but got Unknown //IL_0d28: Expected O, but got Unknown //IL_0d3e: Unknown result type (might be due to invalid IL or missing references) //IL_0d61: Unknown result type (might be due to invalid IL or missing references) //IL_0d6b: Expected O, but got Unknown //IL_0d6b: Expected O, but got Unknown //IL_0d81: Unknown result type (might be due to invalid IL or missing references) //IL_0da4: Unknown result type (might be due to invalid IL or missing references) //IL_0dae: Expected O, but got Unknown //IL_0dae: Expected O, but got Unknown //IL_0dc4: Unknown result type (might be due to invalid IL or missing references) //IL_0de7: Unknown result type (might be due to invalid IL or missing references) //IL_0df1: Expected O, but got Unknown //IL_0df1: Expected O, but got Unknown //IL_0e07: Unknown result type (might be due to invalid IL or missing references) //IL_0e23: Unknown result type (might be due to invalid IL or missing references) //IL_0e2d: Expected O, but got Unknown //IL_0e2d: Expected O, but got Unknown //IL_0e43: Unknown result type (might be due to invalid IL or missing references) //IL_0e5f: Unknown result type (might be due to invalid IL or missing references) //IL_0e69: Expected O, but got Unknown //IL_0e69: Expected O, but got Unknown //IL_0e7f: Unknown result type (might be due to invalid IL or missing references) //IL_0e9b: Unknown result type (might be due to invalid IL or missing references) //IL_0ea5: Expected O, but got Unknown //IL_0ea5: Expected O, but got Unknown //IL_0ebb: Unknown result type (might be due to invalid IL or missing references) //IL_0ed4: Unknown result type (might be due to invalid IL or missing references) //IL_0ede: Expected O, but got Unknown //IL_0ede: Expected O, but got Unknown //IL_0ef4: Unknown result type (might be due to invalid IL or missing references) //IL_0f0c: Unknown result type (might be due to invalid IL or missing references) //IL_0f16: Expected O, but got Unknown //IL_0f16: Expected O, but got Unknown //IL_0f2c: Unknown result type (might be due to invalid IL or missing references) //IL_0f48: Unknown result type (might be due to invalid IL or missing references) //IL_0f52: Expected O, but got Unknown //IL_0f52: Expected O, but got Unknown //IL_0f68: Unknown result type (might be due to invalid IL or missing references) //IL_0f7d: Unknown result type (might be due to invalid IL or missing references) //IL_0f87: Expected O, but got Unknown //IL_0f87: Expected O, but got Unknown //IL_0f9d: Unknown result type (might be due to invalid IL or missing references) //IL_0fb2: Unknown result type (might be due to invalid IL or missing references) //IL_0fbc: Expected O, but got Unknown //IL_0fbc: Expected O, but got Unknown //IL_0fd2: Unknown result type (might be due to invalid IL or missing references) //IL_0fe7: Unknown result type (might be due to invalid IL or missing references) //IL_0ff1: Expected O, but got Unknown //IL_0ff1: Expected O, but got Unknown //IL_1007: Unknown result type (might be due to invalid IL or missing references) //IL_101c: Unknown result type (might be due to invalid IL or missing references) //IL_1026: Expected O, but got Unknown //IL_1026: Expected O, but got Unknown //IL_103c: Unknown result type (might be due to invalid IL or missing references) //IL_1051: Unknown result type (might be due to invalid IL or missing references) //IL_105b: Expected O, but got Unknown //IL_105b: Expected O, but got Unknown //IL_1071: Unknown result type (might be due to invalid IL or missing references) //IL_1086: Unknown result type (might be due to invalid IL or missing references) //IL_1090: Expected O, but got Unknown //IL_1090: Expected O, but got Unknown //IL_10a6: Unknown result type (might be due to invalid IL or missing references) //IL_10bb: Unknown result type (might be due to invalid IL or missing references) //IL_10c5: Expected O, but got Unknown //IL_10c5: Expected O, but got Unknown //IL_10db: Unknown result type (might be due to invalid IL or missing references) //IL_10f0: Unknown result type (might be due to invalid IL or missing references) //IL_10fa: Expected O, but got Unknown //IL_10fa: Expected O, but got Unknown //IL_1110: Unknown result type (might be due to invalid IL or missing references) //IL_1125: Unknown result type (might be due to invalid IL or missing references) //IL_112f: Expected O, but got Unknown //IL_112f: Expected O, but got Unknown //IL_1145: Unknown result type (might be due to invalid IL or missing references) //IL_115a: Unknown result type (might be due to invalid IL or missing references) //IL_1164: Expected O, but got Unknown //IL_1164: Expected O, but got Unknown //IL_117a: Unknown result type (might be due to invalid IL or missing references) //IL_118f: Unknown result type (might be due to invalid IL or missing references) //IL_1199: Expected O, but got Unknown //IL_1199: Expected O, but got Unknown //IL_11af: Unknown result type (might be due to invalid IL or missing references) //IL_11c4: Unknown result type (might be due to invalid IL or missing references) //IL_11ce: Expected O, but got Unknown //IL_11ce: Expected O, but got Unknown //IL_11e4: Unknown result type (might be due to invalid IL or missing references) //IL_11f9: Unknown result type (might be due to invalid IL or missing references) //IL_1203: Expected O, but got Unknown //IL_1203: Expected O, but got Unknown //IL_1219: Unknown result type (might be due to invalid IL or missing references) //IL_122e: Unknown result type (might be due to invalid IL or missing references) //IL_1238: Expected O, but got Unknown //IL_1238: Expected O, but got Unknown //IL_124e: Unknown result type (might be due to invalid IL or missing references) //IL_1263: Unknown result type (might be due to invalid IL or missing references) //IL_126d: Expected O, but got Unknown //IL_126d: Expected O, but got Unknown //IL_1283: Unknown result type (might be due to invalid IL or missing references) //IL_1298: Unknown result type (might be due to invalid IL or missing references) //IL_12a2: Expected O, but got Unknown //IL_12a2: Expected O, but got Unknown //IL_12b8: Unknown result type (might be due to invalid IL or missing references) //IL_12cd: Unknown result type (might be due to invalid IL or missing references) //IL_12d7: Expected O, but got Unknown //IL_12d7: Expected O, but got Unknown //IL_12ed: Unknown result type (might be due to invalid IL or missing references) //IL_1302: Unknown result type (might be due to invalid IL or missing references) //IL_130c: Expected O, but got Unknown //IL_130c: Expected O, but got Unknown //IL_1322: Unknown result type (might be due to invalid IL or missing references) //IL_1337: Unknown result type (might be due to invalid IL or missing references) //IL_1341: Expected O, but got Unknown //IL_1341: Expected O, but got Unknown //IL_1357: Unknown result type (might be due to invalid IL or missing references) //IL_136c: Unknown result type (might be due to invalid IL or missing references) //IL_1376: Expected O, but got Unknown //IL_1376: Expected O, but got Unknown //IL_138c: Unknown result type (might be due to invalid IL or missing references) //IL_13a1: Unknown result type (might be due to invalid IL or missing references) //IL_13ab: Expected O, but got Unknown //IL_13ab: Expected O, but got Unknown //IL_13c1: Unknown result type (might be due to invalid IL or missing references) //IL_13d6: Unknown result type (might be due to invalid IL or missing references) //IL_13e0: Expected O, but got Unknown //IL_13e0: Expected O, but got Unknown SavedRole = configFile.Bind(new ConfigDefinition("Role", "Your selected role"), "Strongman", new ConfigDescription("Preferred role for this player. Disabled preferred roles temporarily act as Random until enabled again.", (AcceptableValueBase)(object)new AcceptableValueList(AllRoleChoices), Array.Empty())); AssignRoleAfterRevive = configFile.Bind(new ConfigDefinition("Role", "Reaasign roles after being revived"), false, new ConfigDescription("When enabled, a player receives a new role after dying and being revived.", (AcceptableValueBase)null, Array.Empty())); MageTopManaConf = configFile.Bind(new ConfigDefinition("Role", "Place where mana is shown"), true, new ConfigDescription("Controls Mage mana display placement. True shows mana at the top; false shows it beside the stamina UI.", (AcceptableValueBase)null, Array.Empty())); ShowGUIAtStart = configFile.Bind(new ConfigDefinition("GUI", "Show GUI when being assigned a role"), true, new ConfigDescription("Shows the role information overlay when a role is assigned.", (AcceptableValueBase)null, Array.Empty())); EnableRoleUpgrades = configFile.Bind(new ConfigDefinition("Upgrades", "Enable Role Upgrades in Shop"), true, new ConfigDescription("Enables NuageRoles upgrade items in the shop.", (AcceptableValueBase)null, Array.Empty())); EnableRunner = configFile.Bind(new ConfigDefinition("Role", "Enable Runner"), true, new ConfigDescription("Allows Runner to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableTank = configFile.Bind(new ConfigDefinition("Role", "Enable Tank"), true, new ConfigDescription("Allows Tank to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableGambler = configFile.Bind(new ConfigDefinition("Role", "Enable Gambler"), true, new ConfigDescription("Allows Gambler to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableStrongman = configFile.Bind(new ConfigDefinition("Role", "Enable Strongman"), true, new ConfigDescription("Allows Strongman to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableRL = configFile.Bind(new ConfigDefinition("Role", "Enable Ranged Looter"), true, new ConfigDescription("Allows Ranged Looter to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableAthletic = configFile.Bind(new ConfigDefinition("Role", "Enable Athletic"), true, new ConfigDescription("Allows Athletic to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableMage = configFile.Bind(new ConfigDefinition("Role", "Enable Mage"), true, new ConfigDescription("Allows Mage to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableReaper = configFile.Bind(new ConfigDefinition("Role", "Enable Reaper"), true, new ConfigDescription("Allows Reaper to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableScout = configFile.Bind(new ConfigDefinition("Role", "Enable Scout"), true, new ConfigDescription("Allows Scout to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableRegular = configFile.Bind(new ConfigDefinition("Role", "Enable Regular"), true, new ConfigDescription("Allows Regular to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); EnableEngineer = configFile.Bind(new ConfigDefinition("Role", "Enable Engineer"), true, new ConfigDescription("Allows Engineer to be selected or randomly assigned.", (AcceptableValueBase)null, Array.Empty())); ToggleKey = configFile.Bind(new ConfigDefinition("GUI", "GUI Toggle Key"), (KeyCode)114, new ConfigDescription("Key used to toggle the role information overlay.", (AcceptableValueBase)null, Array.Empty())); ScoutKey = configFile.Bind(new ConfigDefinition("GUI", "Activate Scout Ability"), (KeyCode)103, new ConfigDescription("Key used to activate the Scout enemy marker ability.", (AcceptableValueBase)null, Array.Empty())); ShowSpellsKey = configFile.Bind(new ConfigDefinition("Mage", "Show Spells"), (KeyCode)109, new ConfigDescription("Key used to show or hide the Mage spell list.", (AcceptableValueBase)null, Array.Empty())); HealKey = configFile.Bind(new ConfigDefinition("Mage", "Healing Spell"), (KeyCode)104, new ConfigDescription("Key used to cast Mage heal.", (AcceptableValueBase)null, Array.Empty())); SpeedKey = configFile.Bind(new ConfigDefinition("Mage", "Speed Spell"), (KeyCode)106, new ConfigDescription("Key used to cast Mage speed boost.", (AcceptableValueBase)null, Array.Empty())); OverchargeKey = configFile.Bind(new ConfigDefinition("Mage", "Overcharge Spell"), (KeyCode)111, new ConfigDescription("Key used to cast Mage overcharge.", (AcceptableValueBase)null, Array.Empty())); JumpKey = configFile.Bind(new ConfigDefinition("Mage", "Jump Boost Spell"), (KeyCode)107, new ConfigDescription("Key used to cast Mage jump boost.", (AcceptableValueBase)null, Array.Empty())); StaminaKey = configFile.Bind(new ConfigDefinition("Mage", "Stamina Refill Spell"), (KeyCode)110, new ConfigDescription("Key used to cast Mage stamina refill.", (AcceptableValueBase)null, Array.Empty())); ChargeItemKey = configFile.Bind(new ConfigDefinition("Engineer", "Charge Held Item"), (KeyCode)99, new ConfigDescription("Key used by Engineer to charge the held item.", (AcceptableValueBase)null, Array.Empty())); RunnerSpeedMultiplier = configFile.Bind(new ConfigDefinition("Runner", "Speed Multiplier"), 1.5f, new ConfigDescription("Multiplier applied to Runner crouch, walk, and sprint speed.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 5f), Array.Empty())); RunnerStaminaMultiplier = configFile.Bind(new ConfigDefinition("Runner", "Stamina Multiplier"), 1.5f, new ConfigDescription("Multiplier applied to Runner max and current stamina.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 5f), Array.Empty())); TankHealthMultiplier = configFile.Bind(new ConfigDefinition("Tank", "Health Multiplier"), 2f, new ConfigDescription("Multiplier applied to Tank max and current health.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); TankSpeedMultiplier = configFile.Bind(new ConfigDefinition("Tank", "Speed Multiplier"), 0.9f, new ConfigDescription("Multiplier applied to Tank crouch, walk, and sprint speed.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 5f), Array.Empty())); TankPassiveRegenAmount = configFile.Bind(new ConfigDefinition("Tank", "Passive Regen Amount"), 1, new ConfigDescription("Health restored each Tank passive regeneration tick.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); TankPassiveRegenIntervalSeconds = configFile.Bind(new ConfigDefinition("Tank", "Passive Regen Interval Seconds"), 5, new ConfigDescription("Seconds between Tank passive regeneration ticks.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 300), Array.Empty())); GamblerPositiveSpeedMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Positive Speed Multiplier"), 1.3f, new ConfigDescription("Positive Gambler speed effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 5f), Array.Empty())); GamblerPositiveStaminaMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Positive Stamina Multiplier"), 1.8f, new ConfigDescription("Positive Gambler stamina effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); GamblerPositiveHealthMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Positive Health Multiplier"), 1.8f, new ConfigDescription("Positive Gambler health effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); GamblerPositiveStrengthMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Positive Strength Multiplier"), 1.3f, new ConfigDescription("Positive Gambler grab strength effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); GamblerPositiveJumpMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Positive Jump Multiplier"), 1.5f, new ConfigDescription("Positive Gambler jump force effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); GamblerNegativeSpeedMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Negative Speed Multiplier"), 0.8f, new ConfigDescription("Negative Gambler speed effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 5f), Array.Empty())); GamblerNegativeStaminaMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Negative Stamina Multiplier"), 0.8f, new ConfigDescription("Negative Gambler stamina effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); GamblerNegativeHealthMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Negative Health Multiplier"), 0.8f, new ConfigDescription("Negative Gambler health effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); GamblerNegativeStrengthMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Negative Strength Multiplier"), 0.8f, new ConfigDescription("Negative Gambler grab strength effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); GamblerNegativeJumpMultiplier = configFile.Bind(new ConfigDefinition("Gambler", "Negative Jump Multiplier"), 0.7f, new ConfigDescription("Negative Gambler jump force effect multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); StrongmanStrengthMultiplier = configFile.Bind(new ConfigDefinition("Strongman", "Strength Multiplier"), 1.5f, new ConfigDescription("Multiplier applied to Strongman grab strength before the flat bonus.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); StrongmanStrengthBonus = configFile.Bind(new ConfigDefinition("Strongman", "Strength Bonus"), 0.5f, new ConfigDescription("Flat grab strength bonus added after the Strongman multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 10f), Array.Empty())); RangedLooterGrabRangeMultiplier = configFile.Bind(new ConfigDefinition("Ranged Looter", "Grab Range Multiplier"), 2.5f, new ConfigDescription("Multiplier applied to Ranged Looter grab range.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); RangedLooterStrengthMultiplier = configFile.Bind(new ConfigDefinition("Ranged Looter", "Strength Multiplier"), 1.2f, new ConfigDescription("Multiplier applied to Ranged Looter grab strength.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); AthleticStrengthMultiplier = configFile.Bind(new ConfigDefinition("Athletic", "Strength Multiplier"), 1.4f, new ConfigDescription("Multiplier applied to Athletic grab strength.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); AthleticStaminaBonus = configFile.Bind(new ConfigDefinition("Athletic", "Stamina Bonus"), 20, new ConfigDescription("Flat max and current stamina bonus applied to Athletic.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 300), Array.Empty())); AthleticJumpForceBonus = configFile.Bind(new ConfigDefinition("Athletic", "Jump Force Bonus"), 3f, new ConfigDescription("Flat jump force bonus applied to Athletic.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 50f), Array.Empty())); ReaperHealthMultiplier = configFile.Bind(new ConfigDefinition("Reaper", "Health Multiplier"), 1.5f, new ConfigDescription("Multiplier applied to Reaper max and current health when the role is assigned.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); ReaperMaxHealthBonusPerKill = configFile.Bind(new ConfigDefinition("Reaper", "Max Health Bonus Per Enemy"), 5, new ConfigDescription("Max health gained by each living Reaper when an enemy dies.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 1000), Array.Empty())); ReaperHealAmountPerKill = configFile.Bind(new ConfigDefinition("Reaper", "Heal Amount Per Enemy"), 30, new ConfigDescription("Health restored by each living Reaper when an enemy dies.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 1000), Array.Empty())); ReaperBuffCooldownFrames = configFile.Bind(new ConfigDefinition("Reaper", "Buff Cooldown Frames"), 50, new ConfigDescription("Update frames a Reaper must wait before receiving another enemy-death buff.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 10000), Array.Empty())); ScoutStaminaMultiplier = configFile.Bind(new ConfigDefinition("Scout", "Stamina Multiplier"), 2f, new ConfigDescription("Multiplier applied to Scout max and current stamina.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); ScoutSprintRechargeMultiplier = configFile.Bind(new ConfigDefinition("Scout", "Sprint Recharge Multiplier"), 2f, new ConfigDescription("Multiplier applied to Scout stamina recharge amount.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); ScoutAbilityDurationSeconds = configFile.Bind(new ConfigDefinition("Scout", "Ability Duration Seconds"), 5, new ConfigDescription("Duration of the Scout enemy marker ability.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 300), Array.Empty())); ScoutAbilityCooldownSeconds = configFile.Bind(new ConfigDefinition("Scout", "Ability Cooldown Seconds"), 40, new ConfigDescription("Base cooldown of the Scout enemy marker ability before upgrade reductions.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 600), Array.Empty())); MageMaxMana = configFile.Bind(new ConfigDefinition("Mage", "Max Mana"), 8, new ConfigDescription("Maximum mana available to the Mage.", (AcceptableValueBase)(object)new AcceptableValueRange(3, 12), Array.Empty())); MageHealAmount = configFile.Bind(new ConfigDefinition("Mage", "Heal Amount"), 5, new ConfigDescription("Health restored by the Mage heal spell before overcharge is applied.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); MageSpeedMultiplier = configFile.Bind(new ConfigDefinition("Mage", "Speed Multiplier"), 1.4f, new ConfigDescription("Movement speed multiplier applied by the Mage speed spell.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 5f), Array.Empty())); MageJumpForceBonus = configFile.Bind(new ConfigDefinition("Mage", "Jump Force Bonus"), 3f, new ConfigDescription("Flat JumpForce bonus applied by the Mage jump spell.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 50f), Array.Empty())); MageOverchargeMultiplier = configFile.Bind(new ConfigDefinition("Mage", "Overcharge Multiplier"), 2f, new ConfigDescription("Multiplier applied by overcharge to heal amount and boost durations.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 10f), Array.Empty())); MageSpeedBoostDurationSeconds = configFile.Bind(new ConfigDefinition("Mage", "Speed Boost Duration Seconds"), 30, new ConfigDescription("Base duration of the Mage speed spell in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 300), Array.Empty())); MageJumpBoostDurationSeconds = configFile.Bind(new ConfigDefinition("Mage", "Jump Boost Duration Seconds"), 30, new ConfigDescription("Base duration of the Mage jump spell in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 300), Array.Empty())); MageOverchargeDurationSeconds = configFile.Bind(new ConfigDefinition("Mage", "Overcharge Duration Seconds"), 20, new ConfigDescription("Duration of the Mage overcharge spell in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 300), Array.Empty())); EngineerChargeStaminaCost = configFile.Bind(new ConfigDefinition("Engineer", "Charge Stamina Cost"), 10, new ConfigDescription("Max stamina sacrificed when charging an item. The sacrificed stamina is restored over time.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); EngineerStaminaRestoreAmount = configFile.Bind(new ConfigDefinition("Engineer", "Stamina Restore Amount"), 5, new ConfigDescription("Amount of sacrificed max stamina restored each restore tick.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); EngineerStaminaRestoreIntervalSeconds = configFile.Bind(new ConfigDefinition("Engineer", "Stamina Restore Interval Seconds"), 15, new ConfigDescription("Seconds between Engineer stamina restore ticks.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 300), Array.Empty())); CustomRoleNameRunner = configFile.Bind(new ConfigDefinition("Role Names", "Runner Name"), "Runner", new ConfigDescription("Display name for the Runner role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameTank = configFile.Bind(new ConfigDefinition("Role Names", "Tank Name"), "Tank", new ConfigDescription("Display name for the Tank role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameGambler = configFile.Bind(new ConfigDefinition("Role Names", "Gambler Name"), "Gambler", new ConfigDescription("Display name for the Gambler role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameStrongman = configFile.Bind(new ConfigDefinition("Role Names", "Strongman Name"), "Strongman", new ConfigDescription("Display name for the Strongman role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameRL = configFile.Bind(new ConfigDefinition("Role Names", "Ranged Looter Name"), "Ranged Looter", new ConfigDescription("Display name for the Ranged Looter role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameAthletic = configFile.Bind(new ConfigDefinition("Role Names", "Athletic Name"), "Athletic", new ConfigDescription("Display name for the Athletic role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameMage = configFile.Bind(new ConfigDefinition("Role Names", "Mage Name"), "Mage", new ConfigDescription("Display name for the Mage role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameReaper = configFile.Bind(new ConfigDefinition("Role Names", "Reaper Name"), "Reaper", new ConfigDescription("Display name for the Reaper role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameScout = configFile.Bind(new ConfigDefinition("Role Names", "Scout Name"), "Scout", new ConfigDescription("Display name for the Scout role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameRegular = configFile.Bind(new ConfigDefinition("Role Names", "Regular Name"), "Regular", new ConfigDescription("Display name for the Regular role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleNameEngineer = configFile.Bind(new ConfigDefinition("Role Names", "Engineer Name"), "Engineer", new ConfigDescription("Display name for the Engineer role.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecRunner = configFile.Bind(new ConfigDefinition("Role Descriptions", "Runner Description"), "You have more stamina and run much faster than everyone else!", new ConfigDescription("Role assignment text shown for Runner.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecTank = configFile.Bind(new ConfigDefinition("Role Descriptions", "Tank Description"), "You walk slower but your hp is doubled!", new ConfigDescription("Role assignment text shown for Tank.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecGambler = configFile.Bind(new ConfigDefinition("Role Descriptions", "Gambler Description"), "You rolled random effects:", new ConfigDescription("Role assignment text shown for Gambler before the rolled effects.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecStrongman = configFile.Bind(new ConfigDefinition("Role Descriptions", "Strongman Description"), "You're incredibly strong!", new ConfigDescription("Role assignment text shown for Strongman.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecRL = configFile.Bind(new ConfigDefinition("Role Descriptions", "Ranged Looter Description"), "You can reach objects from far away!", new ConfigDescription("Role assignment text shown for Ranged Looter.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecAthletic = configFile.Bind(new ConfigDefinition("Role Descriptions", "Athletic Description"), "You have more stamina, strength and can jump higher", new ConfigDescription("Role assignment text shown for Athletic.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecMage = configFile.Bind(new ConfigDefinition("Role Descriptions", "Mage Description"), "You are able to use your mana to become incredibly strong!", new ConfigDescription("Role assignment text shown for Mage.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecReaper = configFile.Bind(new ConfigDefinition("Role Descriptions", "Reaper Description"), "For each enemy you and your friends kill, you become stronger!", new ConfigDescription("Role assignment text shown for Reaper.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecScout = configFile.Bind(new ConfigDefinition("Role Descriptions", "Scout Description"), "Your stamina is more efficient and by pressing [G] you can see all enemies around you.", new ConfigDescription("Role assignment text shown for Scout. [G] is replaced with the configured Scout key.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecRegular = configFile.Bind(new ConfigDefinition("Role Descriptions", "Regular Description"), "You are just a regular Semibot. Nothing special.", new ConfigDescription("Role assignment text shown for Regular.", (AcceptableValueBase)null, Array.Empty())); CustomRoleDecEngineer = configFile.Bind(new ConfigDefinition("Role Descriptions", "Engineer Description"), "You can recharge Items with on charge but you lose Stamina", new ConfigDescription("Role assignment text shown for Engineer.", (AcceptableValueBase)null, Array.Empty())); ValidateSavedRole(); } public void RegisterMenu(Action updateManaDisplay) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown this.updateManaDisplay = updateManaDisplay; MenuAPI.AddElementToSettingsMenu((BuilderDelegate)delegate(Transform parent) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) EnsureConfigPage(); buttonOpen = MenuAPI.CreateREPOButton("NuageRoles Config", (Action)delegate { RefreshRoleSlider(); EnsureConfigPage().OpenPage(false); }, parent, new Vector2(500f, 10f)); }); MenuAPI.AddElementToLobbyMenu((BuilderDelegate)delegate(Transform parent) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) buttonOpenLobby = MenuAPI.CreateREPOButton("NuageRoles Config", (Action)delegate { RefreshRoleSlider(); EnsureConfigPage().OpenPage(false); }, parent, new Vector2(500f, 500f)); }); } public int GetSelectedRoleId(Random random) { string selectableRoleName = GetSelectableRoleName(SavedRole.Value); if (selectableRoleName == "Random") { return GetRandomEnabledRoleId(random); } return GetRoleId(selectableRoleName); } public int ResolveEnabledRoleIdOrRandom(int roleId, Random random) { if (IsRoleEnabled(roleId)) { return roleId; } return GetRandomEnabledRoleId(random); } private REPOPopupPage EnsureConfigPage() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown if ((Object)(object)configPage != (Object)null) { return configPage; } configPage = MenuAPI.CreateREPOPopupPage("NuageRoles", (PresetSide)0, true, true, 1.5f); configPage.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform scrollView) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)roleSlider == (Object)null) { roleSlider = MenuAPI.CreateREPOSlider("Role", "Choose your role", (Action)SetSelectedRole, scrollView, GetAvailableRoleChoices(), GetSelectableRoleName(SavedRole.Value), new Vector2(0f, 0f), "", "", (BarBehavior)0); } return ((REPOElement)roleSlider).rectTransform; }, 0f, 0f); configPage.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform scrollView) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)afterDeathRoleToggle == (Object)null) { afterDeathRoleToggle = MenuAPI.CreateREPOToggle("Reassign role on respawn", (Action)SetReassignRoleAfterRevive, scrollView, new Vector2(0f, 0f), "ON", "OFF", AssignRoleAfterRevive.Value); } return ((REPOElement)afterDeathRoleToggle).rectTransform; }, 0f, 0f); configPage.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform scrollView) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)mageTopMana == (Object)null) { mageTopMana = MenuAPI.CreateREPOToggle("Mage Mana Position", (Action)SetMageManaTop, scrollView, new Vector2(0f, 0f), "TOP", "LEFT", MageTopManaConf.Value); } return ((REPOElement)mageTopMana).rectTransform; }, 0f, 0f); configPage.AddElement((BuilderDelegate)delegate(Transform parent) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)buttonClose == (Object)null) { buttonClose = MenuAPI.CreateREPOButton("Back", (Action)delegate { configPage.ClosePage(false); }, parent, Vector2.zero); } }); return configPage; } private void SetSelectedRole(string roleName) { string value = NormalizeRoleName(roleName); SavedRole.Value = value; configFile.Save(); RefreshRoleSlider(); } private void SetReassignRoleAfterRevive(bool enabled) { AssignRoleAfterRevive.Value = enabled; configFile.Save(); } private void SetMageManaTop(bool enabled) { MageTopManaConf.Value = enabled; configFile.Save(); if (guiManager.isMage) { updateManaDisplay?.Invoke(); } } private void RefreshRoleSlider() { if (!((Object)(object)roleSlider == (Object)null)) { string[] availableRoleChoices = GetAvailableRoleChoices(); string selectableRoleName = GetSelectableRoleName(SavedRole.Value); int num = Array.IndexOf(availableRoleChoices, selectableRoleName); if (num < 0) { num = 0; } roleSlider.stringOptions = availableRoleChoices; roleSlider.SetValue((float)num, false); } } private void ValidateSavedRole() { string value = SavedRole.Value; string text = NormalizeRoleName(value); if (!string.Equals(value, text, StringComparison.Ordinal)) { NuageRolesPlugin.Logger.LogWarning((object)("Saved NuageRoles role '" + value + "' is invalid. Falling back to " + text + ".")); SavedRole.Value = text; configFile.Save(); } } private string[] GetAvailableRoleChoices() { List list = new List { "Random" }; for (int i = 1; i < AllRoleChoices.Length; i++) { if (IsRoleEnabled(i)) { list.Add(AllRoleChoices[i]); } } return list.ToArray(); } private string GetSelectableRoleName(string? roleName) { string text = NormalizeRoleName(roleName); if (text == "Random" || IsRoleEnabled(text)) { return text; } return "Random"; } private string NormalizeRoleName(string? roleName) { if (string.IsNullOrWhiteSpace(roleName)) { return "Strongman"; } string[] allRoleChoices = AllRoleChoices; foreach (string text in allRoleChoices) { if (string.Equals(text, roleName.Trim(), StringComparison.OrdinalIgnoreCase)) { return text; } } return "Strongman"; } private int GetRandomEnabledRoleId(Random random) { List enabledRoleIds = GetEnabledRoleIds(); if (enabledRoleIds.Count == 0) { return -1; } return enabledRoleIds[random.Next(enabledRoleIds.Count)]; } private List GetEnabledRoleIds() { List list = new List(); for (int i = 1; i < AllRoleChoices.Length; i++) { if (IsRoleEnabled(i)) { list.Add(i); } } return list; } private int GetRoleId(string roleName) { for (int i = 0; i < AllRoleChoices.Length; i++) { if (AllRoleChoices[i] == roleName) { return i; } } return -1; } private bool IsRoleEnabled(string roleName) { return IsRoleEnabled(GetRoleId(roleName)); } private bool IsRoleEnabled(int roleId) { return roleId switch { 1 => EnableRunner.Value, 2 => EnableTank.Value, 3 => EnableGambler.Value, 4 => EnableStrongman.Value, 5 => EnableRL.Value, 6 => EnableAthletic.Value, 7 => EnableMage.Value, 8 => EnableReaper.Value, 9 => EnableScout.Value, 10 => EnableRegular.Value, 11 => EnableEngineer.Value, _ => false, }; } } [BepInPlugin("com.theohay.nuageroles", "NuageRoles", "4.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class NuageRolesPlugin : BaseUnityPlugin { private sealed class RoleUpgradeDefinition { public string AssetName { get; } public string UpgradeId { get; } public string StatKey { get; } public RoleUpgradeDefinition(string assetName, string upgradeId, string statKey) { AssetName = assetName; UpgradeId = upgradeId; StatKey = statKey; } } private sealed class NuageRolesUpgradeRuntimeBinder : MonoBehaviour { public string upgradeName = string.Empty; private ItemToggle? itemToggle; private ItemUpgrade? itemUpgrade; private REPOLibItemUpgrade? repoLibUpgrade; private ItemAttributes? itemAttributes; private bool eventsBound; private void Awake() { RefreshComponents(); BindRuntimeEvents(); } private void Start() { RefreshComponents(); BindRuntimeEvents(); EnableToggleWhenUsable(); } private void Update() { if ((Object)(object)itemToggle == (Object)null || (Object)(object)itemUpgrade == (Object)null || (Object)(object)repoLibUpgrade == (Object)null || (Object)(object)itemAttributes == (Object)null) { RefreshComponents(); } if (!eventsBound) { BindRuntimeEvents(); } EnableToggleWhenUsable(); } private void RefreshComponents() { itemToggle = ((Component)this).GetComponent(); itemUpgrade = ((Component)this).GetComponent(); repoLibUpgrade = ((Component)this).GetComponent(); itemAttributes = ((Component)this).GetComponent(); } private void BindRuntimeEvents() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown if (!((Object)(object)itemToggle == (Object)null) && !((Object)(object)itemUpgrade == (Object)null) && !((Object)(object)repoLibUpgrade == (Object)null)) { itemToggle.playSound = false; itemToggle.autoTurnOffWhenEquipped = true; ItemToggle val = itemToggle; if (val.onToggle == null) { val.onToggle = new UnityEvent(); } ((UnityEventBase)itemToggle.onToggle).RemoveAllListeners(); itemToggle.onToggle.AddListener(new UnityAction(itemUpgrade.PlayerUpgrade)); itemUpgrade.isPlayerUpgrade = true; ItemUpgrade val2 = itemUpgrade; if (val2.upgradeEvent == null) { val2.upgradeEvent = new UnityEvent(); } ((UnityEventBase)itemUpgrade.upgradeEvent).RemoveAllListeners(); itemUpgrade.upgradeEvent.AddListener(new UnityAction(repoLibUpgrade.Upgrade)); SetFieldIfAvailable(typeof(REPOLibItemUpgrade), repoLibUpgrade, "_itemToggle", itemToggle); eventsBound = true; } } private void EnableToggleWhenUsable() { if ((Object)(object)itemToggle != (Object)null && !((Behaviour)itemToggle).enabled && IsUsable()) { ((Behaviour)itemToggle).enabled = true; } } private bool IsUsable() { if (SemiFunc.RunIsShop()) { return IsPurchased(); } return true; } private bool IsPurchased() { if ((Object)(object)StatsManager.instance == (Object)null || (Object)(object)itemAttributes?.item == (Object)null) { return false; } if (StatsManager.instance.itemsPurchased.TryGetValue(((Object)itemAttributes.item).name, out var value)) { return value > 0; } return false; } } public const string PluginGuid = "com.theohay.nuageroles"; public const string PluginName = "NuageRoles"; public const string PluginVersion = "4.0.0"; public const string AssetBundleName = "NuageRoles_assets"; private const string ManaUpgradeStatKey = "playerUpgradeManaRegeneration"; private const string ScoutUpgradeStatKey = "playerUpgradeScoutCooldownReduction"; private static readonly Vector3 UpgradeColliderSize = new Vector3(0.17882313f, 0.26898482f, 0.07221024f); private static readonly RoleUpgradeDefinition[] RoleUpgradeDefinitions = new RoleUpgradeDefinition[2] { new RoleUpgradeDefinition("Mana Regeneration Upgrade", "ManaRegeneration", "playerUpgradeManaRegeneration"), new RoleUpgradeDefinition("Scout Cooldown Upgrade", "ScoutCooldownReduction", "playerUpgradeScoutCooldownReduction") }; private static PhysAttribute? upgradePhysAttributePreset; public readonly Harmony harmony = new Harmony("com.theohay.nuageroles"); public static Font newFont = null; public static guiManager GUIinstance = null; public static NuageRolesPlugin Instance { get; private set; } = null; internal static ManualLogSource Logger { get; private set; } = null; public static NuageRolesConfig Settings { get; private set; } = null; public static string getPath() { return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "NuageRoles_assets"); } private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown Instance = this; Logger = ((BaseUnityPlugin)this).Logger; Settings = new NuageRolesConfig(((BaseUnityPlugin)this).Config); Settings.Bind(); Settings.RegisterMenu(delegate { if ((Object)(object)GUIinstance != (Object)null) { GUIinstance.UpdateManaDisplay(); } }); if ((Object)Instance == (Object)null) { Instance = this; } harmony.PatchAll(typeof(NuageRolesPlugin)); harmony.PatchAll(typeof(Sender)); Logger.LogInfo((object)"Plugin NuageRoles v4.0.0 loaded successfully."); SceneManager.sceneLoaded += delegate { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown if ((Object)(object)GUIinstance == (Object)null) { GameObject val7 = new GameObject(); GUIinstance = val7.AddComponent(); GUIinstance.text = ""; GUIinstance.color = Color.cyan; Object.DontDestroyOnLoad((Object)val7); } }; harmony.PatchAll(typeof(PunManagerPatch)); harmony.PatchAll(typeof(PlayerAvatarPatch)); harmony.PatchAll(typeof(StatsManagerPatch)); harmony.PatchAll(typeof(ShopManagerPatch)); harmony.PatchAll(typeof(EnemyHealthPatch)); BundleLoader.LoadBundle(getPath(), (Action)delegate(AssetBundle assetBundle) { RoleUpgradeDefinition[] roleUpgradeDefinitions = RoleUpgradeDefinitions; PlayerUpgrade val6 = default(PlayerUpgrade); foreach (RoleUpgradeDefinition upgrade in roleUpgradeDefinitions) { try { string assetName = upgrade.AssetName; Item val = assetBundle.LoadAsset(assetName); if ((Object)(object)val == (Object)null) { Logger.LogError((object)("Failed loading Item asset '" + assetName + "' from bundle.")); } else { GameObject val2 = assetBundle.LoadAsset(assetName); if ((Object)(object)val2 == (Object)null) { Logger.LogError((object)("Failed loading prefab for upgrade '" + assetName + "'. Make sure the prefab is included in the bundle.")); } else { string name = (((Object)val2).name = "REPORoles_upgrade " + assetName); ((Object)val).name = name; val.itemName = assetName ?? ""; val.physicalItem = true; if (ValidateUpgradeItem(val, assetName)) { ItemAttributes val3 = PrepareUpgradePrefab(val2, val, upgrade); if (!((Object)(object)val3 == (Object)null)) { PrefabRef val4 = Items.RegisterItem(val3); if (val4 == null) { Logger.LogWarning((object)("Items.RegisterItem returned null for '" + assetName + "'. It may already be registered or there was an error.")); } else { Logger.LogInfo((object)("Registered upgrade item '" + assetName + "'.")); } PlayerUpgrade val5 = Upgrades.RegisterUpgrade(upgrade.UpgradeId, val, (Action)delegate(PlayerAvatar player, int level) { ApplyRoleUpgradeLevel(upgrade, player, level); }, (Action)delegate(PlayerAvatar player, int level) { ApplyRoleUpgradeLevel(upgrade, player, level); }); if (val5 == null) { if (Upgrades.TryGetUpgrade(upgrade.UpgradeId, ref val6) && val6 != null) { AttachUpgradeDictionary(upgrade, val6); Logger.LogWarning((object)("Role upgrade '" + assetName + "' was already registered; attached existing REPOLib id '" + upgrade.UpgradeId + "'.")); } else { Logger.LogWarning((object)("Failed to register role upgrade '" + assetName + "' with REPOLib id '" + upgrade.UpgradeId + "'.")); } } else { AttachUpgradeDictionary(upgrade, val5); Logger.LogInfo((object)("Registered role upgrade '" + assetName + "' with REPOLib id '" + upgrade.UpgradeId + "' and stat key '" + upgrade.StatKey + "'.")); } } } } } } catch (Exception arg) { Logger.LogError((object)$"Exception while registering upgrade '{upgrade.AssetName}': {arg}"); } } }, false); } private static bool ValidateUpgradeItem(Item item, string upgradeName) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Invalid comparison between Unknown and I4 //IL_003f: 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 ((Object)(object)item.value == (Object)null) { Logger.LogError((object)("Upgrade Item asset '" + upgradeName + "' has no Value asset. Fix the bundle and rebuild it.")); return false; } if ((int)item.itemType != 3) { Logger.LogError((object)$"Upgrade Item asset '{upgradeName}' has itemType '{item.itemType}', expected '{(object)(itemType)3}'. Fix the bundle and rebuild it."); return false; } if ((int)item.itemVolume != 6) { Logger.LogError((object)$"Upgrade Item asset '{upgradeName}' has itemVolume '{item.itemVolume}', expected '{(object)(itemVolume)6}'. Fix the bundle and rebuild it."); return false; } if (!item.maxPurchase || item.maxPurchaseAmount <= 0) { Logger.LogError((object)("Upgrade Item asset '" + upgradeName + "' must enable maxPurchase and set maxPurchaseAmount above zero. Fix the bundle and rebuild it.")); return false; } if (item.maxAmount <= 0 || item.maxAmountInShop <= 0 || item.minPlayerCount <= 0) { Logger.LogError((object)("Upgrade Item asset '" + upgradeName + "' has invalid shop counts. Fix the bundle and rebuild it.")); return false; } Logger.LogInfo((object)$"Loaded upgrade Item asset '{upgradeName}' with value seed {item.value.valueMin}-{item.value.valueMax}."); return true; } private static ItemAttributes? PrepareUpgradePrefab(GameObject prefab, Item item, RoleUpgradeDefinition upgrade) { //IL_0086: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) string assetName = upgrade.AssetName; Rigidbody component = prefab.GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogError((object)("Upgrade prefab '" + assetName + "' has no Rigidbody. Fix the bundle prefab and rebuild it.")); return null; } PhotonView value = prefab.GetComponent() ?? prefab.AddComponent(); PhotonTransformView value2 = prefab.GetComponent() ?? prefab.AddComponent(); RoomVolumeCheck val = prefab.GetComponent() ?? prefab.AddComponent(); if (val.CurrentRooms == null) { val.CurrentRooms = new List(); } val.Continuous = true; val.currentSize = UpgradeColliderSize; val.CheckPosition = Vector3.zero; PhysGrabObject val2 = prefab.GetComponent() ?? prefab.AddComponent(); val2.rb = component; val2.clientNonKinematic = true; val2.overrideTagsAndLayers = true; val2.ignoreGrabPointCentering = false; if (val2.playerGrabbing == null) { val2.playerGrabbing = new List(); } ConfigureUpgradeTemplateChildren(prefab.transform, assetName); BoxCollider val3 = ConfigureGrabCollider(prefab.transform, val2, assetName); if ((Object)(object)val3 == (Object)null) { return null; } PhysGrabObjectImpactDetector val4 = prefab.GetComponent() ?? prefab.AddComponent(); ConfigureUpgradeImpactDetector(val4); NotValuableObject val5 = prefab.GetComponent() ?? prefab.AddComponent(); val5.physAttributePreset = GetUpgradePhysAttributePreset(); val5.hasHealth = false; val5.healthDestroy = false; val5.healthMax = 0; ItemAttributes val6 = prefab.GetComponent() ?? prefab.AddComponent(); val6.item = item; val6.costOffset = new Vector3(0f, 0.18f, 0f); SetFieldIfAvailable(typeof(ItemAttributes), val6, "roomVolumeCheck", val); SetFieldIfAvailable(typeof(ItemAttributes), val6, "physGrabObject", val2); SetFieldIfAvailable(typeof(ItemAttributes), val6, "photonView", value); SetFieldIfAvailable(typeof(PhysGrabObject), val2, "roomVolumeCheck", val); SetFieldIfAvailable(typeof(PhysGrabObject), val2, "photonView", value); SetFieldIfAvailable(typeof(PhysGrabObject), val2, "photonTransformView", value2); SetFieldIfAvailable(typeof(PhysGrabObject), val2, "impactDetector", val4); REPOLibItemUpgrade obj = prefab.GetComponent() ?? prefab.AddComponent(); AccessTools.Field(typeof(REPOLibItemUpgrade), "_upgradeId").SetValue(obj, upgrade.UpgradeId); if (!ConfigureUpgradeConsumption(prefab, upgrade)) { return null; } NuageRolesUpgradeRuntimeBinder nuageRolesUpgradeRuntimeBinder = prefab.GetComponent() ?? prefab.AddComponent(); nuageRolesUpgradeRuntimeBinder.upgradeName = assetName; Logger.LogInfo((object)("Prepared upgrade prefab '" + assetName + "' with runtime shop item components, REPOLib upgrade id '" + upgrade.UpgradeId + "', and collider '" + ((Object)val3).name + "'.")); return val6; } private static bool ConfigureUpgradeConsumption(GameObject prefab, RoleUpgradeDefinition upgrade) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown string assetName = upgrade.AssetName; EnsureParticleEffects(prefab.transform, assetName); ItemToggle val = prefab.GetComponent() ?? prefab.AddComponent(); val.playSound = false; val.autoTurnOffWhenEquipped = true; val.onToggle = new UnityEvent(); ItemUpgrade val2 = prefab.GetComponent() ?? prefab.AddComponent(); val2.isPlayerUpgrade = true; val2.upgradeEvent = new UnityEvent(); return true; } internal static void AttachRegisteredUpgradeDictionaries() { RoleUpgradeDefinition[] roleUpgradeDefinitions = RoleUpgradeDefinitions; PlayerUpgrade val = default(PlayerUpgrade); foreach (RoleUpgradeDefinition roleUpgradeDefinition in roleUpgradeDefinitions) { if (Upgrades.TryGetUpgrade(roleUpgradeDefinition.UpgradeId, ref val) && val != null) { AttachUpgradeDictionary(roleUpgradeDefinition, val); } } } private static void AttachUpgradeDictionary(RoleUpgradeDefinition upgrade, PlayerUpgrade playerUpgrade) { Dictionary dictionary = EnsureUpgradeDictionary(upgrade.StatKey); if (dictionary != null) { playerUpgrade.PlayerDictionary = dictionary; } } private static void ApplyRoleUpgradeLevel(RoleUpgradeDefinition upgrade, PlayerAvatar player, int level) { if ((Object)(object)player == (Object)null) { return; } string text = SemiFunc.PlayerGetSteamID(player); if (string.IsNullOrEmpty(text)) { Logger.LogWarning((object)("Could not apply role upgrade '" + upgrade.AssetName + "': player steam ID was empty.")); return; } Upgrader.SetStat(level, text, upgrade.StatKey); if (player.isLocal) { ApplyLocalRoleUpgradeEffects(upgrade.StatKey); } Logger.LogInfo((object)$"Applied role upgrade '{upgrade.AssetName}' at level {level} for {text}."); } private static Dictionary? EnsureUpgradeDictionary(string statKey) { if ((Object)(object)StatsManager.instance == (Object)null) { return null; } if (!StatsManager.instance.dictionaryOfDictionaries.TryGetValue(statKey, out var value)) { value = new Dictionary(); StatsManager.instance.dictionaryOfDictionaries.Add(statKey, value); } return value; } private static void ApplyLocalRoleUpgradeEffects(string statKey) { if (statKey == "playerUpgradeManaRegeneration") { Update_ManaRegeneration(); } else if (statKey == "playerUpgradeScoutCooldownReduction") { Update_ScoutCooldown(); } } private static void ConfigureUpgradeImpactDetector(PhysGrabObjectImpactDetector impactDetector) { impactDetector.particleDisable = true; impactDetector.particleBreakSmokeDisable = true; impactDetector.hasFreezeFrameOnBreakParticles = false; impactDetector.particleMultiplier = 0f; impactDetector.playerHurtDisable = true; impactDetector.slidingDisable = true; impactDetector.indestructibleBreakEffects = false; impactDetector.canHurtLogic = false; impactDetector.destroyDisable = false; impactDetector.isCart = false; impactDetector.fragility = 0f; impactDetector.durability = 100f; SetFieldIfAvailable(typeof(PhysGrabObjectImpactDetector), impactDetector, "impactDisable", true); SetFieldIfAvailable(typeof(PhysGrabObjectImpactDetector), impactDetector, "breakLogic", false); SetFieldIfAvailable(typeof(PhysGrabObjectImpactDetector), impactDetector, "audioActive", false); SetFieldIfAvailable(typeof(PhysGrabObjectImpactDetector), impactDetector, "breakLevelHeavy", 0); SetFieldIfAvailable(typeof(PhysGrabObjectImpactDetector), impactDetector, "breakLevelMedium", 0); SetFieldIfAvailable(typeof(PhysGrabObjectImpactDetector), impactDetector, "breakLevelLight", 0); } private static PhysAttribute GetUpgradePhysAttributePreset() { if ((Object)(object)upgradePhysAttributePreset == (Object)null) { upgradePhysAttributePreset = ScriptableObject.CreateInstance(); ((Object)upgradePhysAttributePreset).name = "Repo Roles Upgrade PhysAttribute"; upgradePhysAttributePreset.mass = 0.25f; } return upgradePhysAttributePreset; } private static void ConfigureUpgradeTemplateChildren(Transform root, string upgradeName) { Transform val = root.Find("Force Grab Point"); if ((Object)(object)val != (Object)null) { SetLayerIfAvailable(((Component)val).gameObject, "PhysGrabObject"); TrySetTag(((Component)val).gameObject, "Untagged"); } else { Logger.LogWarning((object)("Upgrade prefab '" + upgradeName + "' is missing child 'Force Grab Point'. Fix the bundle prefab and rebuild it.")); } if ((Object)(object)root.Find("ItemEquipCube") == (Object)null) { Logger.LogWarning((object)("Upgrade prefab '" + upgradeName + "' is missing child 'ItemEquipCube'. Fix the bundle prefab and rebuild it.")); } } private static void EnsureParticleEffects(Transform root, string upgradeName) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown Transform val = root.Find("Particle Effects"); if ((Object)(object)val == (Object)null) { GameObject val2 = new GameObject("Particle Effects"); val = val2.transform; val.SetParent(root, false); Logger.LogWarning((object)("Upgrade prefab '" + upgradeName + "' is missing child 'Particle Effects'. Created an empty runtime placeholder.")); } ((Component)val).gameObject.SetActive(false); } private static BoxCollider? ConfigureGrabCollider(Transform root, PhysGrabObject physGrabObject, string upgradeName) { Transform val = root.Find("Semi Box Collider"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)("Upgrade prefab '" + upgradeName + "' is missing child 'Semi Box Collider'. Fix the bundle prefab and rebuild it.")); return null; } SetLayerIfAvailable(((Component)val).gameObject, "PhysGrabObject"); TrySetTag(((Component)val).gameObject, "Phys Grab Object"); BoxCollider component = ((Component)val).GetComponent(); if ((Object)(object)component == (Object)null) { Logger.LogError((object)("Upgrade prefab '" + upgradeName + "' child 'Semi Box Collider' has no BoxCollider. Fix the bundle prefab and rebuild it.")); return null; } if ((Object)(object)((Component)val).GetComponent() == (Object)null) { ((Component)val).gameObject.AddComponent(); } PhysGrabObjectCollider instance = ((Component)val).GetComponent() ?? ((Component)val).gameObject.AddComponent(); SetFieldIfAvailable(typeof(PhysGrabObjectCollider), instance, "physGrabObject", physGrabObject); return component; } private static void SetLayerIfAvailable(GameObject gameObject, string layerName) { int num = LayerMask.NameToLayer(layerName); if (num >= 0) { gameObject.layer = num; } } private static void TrySetTag(GameObject gameObject, string tag) { try { gameObject.tag = tag; } catch (UnityException) { Logger.LogWarning((object)("Could not set upgrade prefab tag '" + tag + "'.")); } } private static void SetFieldIfAvailable(Type type, object instance, string fieldName, object value) { FieldInfo fieldInfo = AccessTools.Field(type, fieldName); if (fieldInfo != null) { fieldInfo.SetValue(instance, value); } } public static void Update_ManaRegeneration() { if (LevelGenerator.Instance.Generated && !SemiFunc.MenuLevel()) { int stat = Upgrader.GetStat(PlayerAvatar.instance.steamID, "playerUpgradeManaRegeneration"); guiManager.manaRegenRate = Upgrader.GetStat(PlayerAvatar.instance.steamID, "playerUpgradeManaRegeneration"); } } public static void Update_ScoutCooldown() { if (LevelGenerator.Instance.Generated && !SemiFunc.MenuLevel()) { int stat = Upgrader.GetStat(PlayerAvatar.instance.steamID, "playerUpgradeScoutCooldownReduction"); ScoutMarker.reductionUpgrades = Upgrader.GetStat(PlayerAvatar.instance.steamID, "playerUpgradeScoutCooldownReduction"); } } } [HarmonyPatch(typeof(PunManager))] internal static class PunManagerPatch { [HarmonyPostfix] [HarmonyPatch("Start")] private static void Start_Postfix(PunManager __instance) { if ((Object)(object)ComponentHolderProtocol.GetComponent((Object)(object)__instance) == (Object)null) { ComponentHolderProtocol.AddComponent((Object)(object)__instance); } if ((Object)(object)ComponentHolderProtocol.GetComponent((Object)(object)__instance) == (Object)null) { ComponentHolderProtocol.AddComponent((Object)(object)__instance); } if ((Object)(object)ComponentHolderProtocol.GetComponent((Object)(object)__instance) == (Object)null) { ComponentHolderProtocol.AddComponent((Object)(object)__instance); } } } public class ScoutMarker : MonoBehaviour { private int cooldownTicker; private int activeTicker; private bool isActive; private bool onCooldown = true; public static int reductionUpgrades; private static int SecondsToFixedTicks(float seconds) { return Mathf.Max(1, Mathf.RoundToInt(Mathf.Max(0f, seconds) / Time.fixedDeltaTime)); } private static int GetActiveTicks() { return SecondsToFixedTicks(NuageRolesPlugin.Settings.ScoutAbilityDurationSeconds.Value); } private static int GetCooldownTicks() { int num = Mathf.Max(0, Mathf.RoundToInt(Mathf.Max(0f, (float)NuageRolesPlugin.Settings.ScoutAbilityCooldownSeconds.Value) / Time.fixedDeltaTime)); int num2 = num - reductionUpgrades * 250; if (reductionUpgrades > 5) { num2 = Mathf.Min(num, 750); } return Mathf.Max(0, num2); } private void ResetState() { cooldownTicker = 0; activeTicker = 0; isActive = false; onCooldown = true; } private void OnGUI() { //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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: 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_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.RunIsLevel() || SemiFunc.RunIsShop() || PlayerAvatar.instance.playerHealth.health <= 0) { return; } GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 22 }; val.normal.textColor = new Color(0.902f, 0.733f, 0.11f); if ((Object)guiManager.customFont != (Object)null) { val.font = guiManager.customFont; } if (EnemyDirector.instance.enemiesSpawned != null && ClassManager.isScout && isActive) { GUIStyle val2 = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 22 }; val2.normal.textColor = Color.red; if ((Object)guiManager.customFont != (Object)null) { val2.font = guiManager.customFont; } foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if ((Object)item == (Object)null || !item.EnableObject.activeInHierarchy) { continue; } object? value = AccessTools.Field(typeof(EnemyParent), "Enemy").GetValue(item); Enemy val3 = (Enemy)((value is Enemy) ? value : null); Camera main = Camera.main; if ((Object)val3 != (Object)null && (Object)main != (Object)null) { Vector3 val4 = main.WorldToViewportPoint(val3.CenterTransform.position); if (!(val4.z < 0f)) { string enemyName = item.enemyName; string text = $"{enemyName} [{val4.z:F0}m]"; Vector2 val5 = val2.CalcSize(new GUIContent(text)); float num = val4.x * (float)Screen.width - val5.x / 2f; float num2 = (float)Screen.height - val4.y * (float)Screen.height - val5.y / 2f; GUI.Label(new Rect(num, num2, val5.x, val5.y), text, val2); } } } if (isActive && !onCooldown) { int num3 = Screen.width / 2 - 100; int num4 = Screen.height - 125; string text2 = Mathf.CeilToInt((float)activeTicker * Time.fixedDeltaTime).ToString(); string text3 = "Ability runs out in: " + text2 + "s"; GUI.Label(new Rect((float)num3, (float)num4, 200f, 50f), text3, val); } } if (!isActive && ClassManager.isScout && onCooldown) { int num5 = Screen.width / 2 - 100; int num6 = Screen.height - 125; string text4 = Mathf.CeilToInt((float)cooldownTicker * Time.fixedDeltaTime).ToString(); val.normal.textColor = new Color(0.851f, 0.667f, 0.098f); string text5 = "Ability is ready in: " + text4 + "s"; GUI.Label(new Rect((float)num5, (float)num6, 200f, 60f), text5, val); } else if (!isActive && ClassManager.isScout && cooldownTicker <= 0) { int num7 = Screen.width / 2 - 100; int num8 = Screen.height - 125; val.normal.textColor = Color.green; string text6 = "Ability is ready!\nPress [" + ((object)NuageRolesPlugin.Settings.ScoutKey.Value).ToString() + "] to activate"; GUI.Label(new Rect((float)num7, (float)num8, 200f, 60f), text6, val); } } private void FixedUpdate() { if (!ClassManager.isScout) { ResetState(); return; } if (isActive) { activeTicker--; } if (isActive && activeTicker <= 0) { isActive = false; onCooldown = true; cooldownTicker = GetCooldownTicks(); } if (cooldownTicker <= 0) { onCooldown = false; } if (cooldownTicker >= 0 && onCooldown) { cooldownTicker--; } } private void Update() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (ClassManager.isScout && SemiFunc.RunIsLevel() && !SemiFunc.RunIsShop() && !ChatManager.instance.chatActive && !onCooldown && Input.GetKeyDown(NuageRolesPlugin.Settings.ScoutKey.Value)) { activeTicker = GetActiveTicks(); isActive = true; } } } } namespace NuageRoles.Roles { public class ClassManager { private Random rnd = new Random(); public int chosenRoleId; public ReaperManager rMan; public readonly Harmony harmonyPatcher = new Harmony("patches.NuageRolesPlugin.mod"); public static int stackKills; public static bool isTank; public static bool isScout; public static bool isEngineer; private static float MinMultiplier(float value) { return Mathf.Max(0.1f, value); } private static float NonNegative(float value) { return Mathf.Max(0f, value); } private static int NonNegative(int value) { return Mathf.Max(0, value); } private static int ScaleHealthValue(int value, float multiplier) { if (value <= 0) { return value; } return Mathf.Max(1, Mathf.RoundToInt((float)value * MinMultiplier(multiplier))); } private void assignRandomEnabledRole() { int num = NuageRolesPlugin.Settings.ResolveEnabledRoleIdOrRandom(-1, rnd); if (num <= 0) { NuageRolesPlugin.Logger.LogWarning((object)"Unable to roll a fallback role because all roles are disabled."); return; } assignRole(num, PlayerController.instance); NuageRolesPlugin.Logger.LogInfo((object)"You got assigned a new random enabled role because this one was disabled."); } public int genGamblerEffectNr() { return rnd.Next(0, 5); } public object[] genGamblerEffects() { string[] array = new string[5] { "You walk faster", "You have more stamina", "You have more health", "You\u00b4re stronger", "You jump higher" }; string[] array2 = new string[5] { "you walk slower", "you have less stamina", "you have less health", "you\u00b4re weaker", "you don\u00b4t jump as high" }; int num = genGamblerEffectNr(); int num2 = genGamblerEffectNr(); while (num == num2) { num = genGamblerEffectNr(); num2 = genGamblerEffectNr(); } string text = array[num]; string text2 = array2[num2]; string text3 = NuageRolesPlugin.Settings.CustomRoleDecGambler.Value + " " + text + " but " + text2 + "!"; return new object[3] { text3, num, num2 }; } public void assignRoleFromConfig(PlayerController __instance) { chosenRoleId = NuageRolesPlugin.Settings.GetSelectedRoleId(rnd); assignRole(chosenRoleId, __instance); } private void modifyStrength(string steamID, float newStrength) { if (!SemiFunc.IsMultiplayer()) { PlayerAvatar.instance.physGrabber.grabStrength = newStrength; return; } PunManager.instance.photonView.RPC("setStrengthRPC", (RpcTarget)0, new object[2] { steamID, newStrength }); } private void setHealth(string steamID, int maxHealth, int health) { if (!SemiFunc.IsMultiplayer()) { PlayerAvatar.instance.playerHealth.health = health; PlayerAvatar.instance.playerHealth.maxHealth = maxHealth; return; } PunManager.instance.photonView.RPC("setHealthRPC", (RpcTarget)0, new object[3] { steamID, maxHealth, health }); } public void setReaperStatus(string steamID, bool isReaper) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if (!SemiFunc.IsMultiplayer()) { ((Component)PlayerAvatar.instance).GetComponent().isReaper = isReaper; } else if ((Object)PlayerAvatar.instance.photonView != (Object)null && !((Object)(object)RunManager.instance == (Object)null) && !((Object)(object)RunManager.instance.levelCurrent == (Object)null) && RunManager.instance.levels.Contains(RunManager.instance.levelCurrent) && (Object)(object)PlayerAvatar.instance != (Object)null && (Object)(object)PlayerAvatar.instance.photonView != (Object)null) { PlayerAvatar.instance.photonView.RPC("setReaperStatusRPC", (RpcTarget)0, new object[2] { steamID, isReaper }); } } public void assignRole(int roleId, PlayerController __instance) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_09c8: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09f5: Unknown result type (might be due to invalid IL or missing references) //IL_0a27: Unknown result type (might be due to invalid IL or missing references) //IL_0a2c: Unknown result type (might be due to invalid IL or missing references) //IL_0b00: Unknown result type (might be due to invalid IL or missing references) //IL_0b05: Unknown result type (might be due to invalid IL or missing references) //IL_0b2d: Unknown result type (might be due to invalid IL or missing references) //IL_0b5f: Unknown result type (might be due to invalid IL or missing references) //IL_0b64: Unknown result type (might be due to invalid IL or missing references) //IL_0c4d: Unknown result type (might be due to invalid IL or missing references) //IL_0c52: Unknown result type (might be due to invalid IL or missing references) //IL_0c7a: Unknown result type (might be due to invalid IL or missing references) //IL_0c9d: Unknown result type (might be due to invalid IL or missing references) //IL_0ca2: Unknown result type (might be due to invalid IL or missing references) //IL_0f2c: Unknown result type (might be due to invalid IL or missing references) //IL_0f31: Unknown result type (might be due to invalid IL or missing references) //IL_0f59: Unknown result type (might be due to invalid IL or missing references) //IL_0f8b: Unknown result type (might be due to invalid IL or missing references) //IL_0f90: Unknown result type (might be due to invalid IL or missing references) //IL_106a: Unknown result type (might be due to invalid IL or missing references) //IL_106f: Unknown result type (might be due to invalid IL or missing references) //IL_109c: Unknown result type (might be due to invalid IL or missing references) //IL_10c9: Unknown result type (might be due to invalid IL or missing references) //IL_10fb: Unknown result type (might be due to invalid IL or missing references) //IL_1100: Unknown result type (might be due to invalid IL or missing references) //IL_11a5: Unknown result type (might be due to invalid IL or missing references) //IL_11aa: Unknown result type (might be due to invalid IL or missing references) //IL_11d2: Unknown result type (might be due to invalid IL or missing references) //IL_11f5: Unknown result type (might be due to invalid IL or missing references) //IL_11fa: Unknown result type (might be due to invalid IL or missing references) //IL_1287: Unknown result type (might be due to invalid IL or missing references) //IL_128c: Unknown result type (might be due to invalid IL or missing references) //IL_12c2: Unknown result type (might be due to invalid IL or missing references) //IL_12e6: Unknown result type (might be due to invalid IL or missing references) //IL_131c: Unknown result type (might be due to invalid IL or missing references) //IL_1321: Unknown result type (might be due to invalid IL or missing references) //IL_0dad: Unknown result type (might be due to invalid IL or missing references) //IL_0db2: Unknown result type (might be due to invalid IL or missing references) //IL_0de8: Unknown result type (might be due to invalid IL or missing references) //IL_0e0c: Unknown result type (might be due to invalid IL or missing references) //IL_0e42: Unknown result type (might be due to invalid IL or missing references) //IL_0e47: Unknown result type (might be due to invalid IL or missing references) //IL_0862: Unknown result type (might be due to invalid IL or missing references) //IL_0867: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) NuageRolesPlugin.Update_ManaRegeneration(); NuageRolesPlugin.Update_ScoutCooldown(); guiManager gUIinstance = NuageRolesPlugin.GUIinstance; if ((Object)gUIinstance != (Object)null) { gUIinstance.ClearMageTemporaryEffects(); } float moveSpeed = __instance.MoveSpeed; float sprintSpeed = __instance.SprintSpeed; float crouchSpeed = __instance.CrouchSpeed; float jumpForce = __instance.JumpForce; float energyStart = __instance.EnergyStart; float energyCurrent = __instance.EnergyCurrent; float grabStrength = PlayerAvatar.instance.physGrabber.grabStrength; float grabRange = PlayerAvatar.instance.physGrabber.grabRange; int num = (int)AccessTools.Field(typeof(PlayerHealth), "maxHealth").GetValue(PlayerAvatar.instance.playerHealth); int num2 = (int)AccessTools.Field(typeof(PlayerHealth), "health").GetValue(PlayerAvatar.instance.playerHealth); if ((Object)((Component)PlayerAvatar.instance).GetComponent() != (Object)null) { rMan = ((Component)PlayerAvatar.instance).GetComponent(); } else { NuageRolesPlugin.Logger.LogError((object)"Failed to get Reaper Manager! Please contact the mod developer about this."); } string text = SemiFunc.PlayerGetName(PlayerAvatar.instance); string text2 = SemiFunc.PlayerGetSteamID(PlayerAvatar.instance); stackKills = 0; guiManager.isMage = false; isTank = false; setReaperStatus(PlayerController.instance.playerSteamID, isReaper: false); isScout = false; isEngineer = false; if (!SemiFunc.RunIsLevel() || SemiFunc.RunIsShop()) { return; } bool[] source = new bool[11] { NuageRolesPlugin.Settings.EnableRunner.Value, NuageRolesPlugin.Settings.EnableTank.Value, NuageRolesPlugin.Settings.EnableGambler.Value, NuageRolesPlugin.Settings.EnableStrongman.Value, NuageRolesPlugin.Settings.EnableRL.Value, NuageRolesPlugin.Settings.EnableAthletic.Value, NuageRolesPlugin.Settings.EnableMage.Value, NuageRolesPlugin.Settings.EnableReaper.Value, NuageRolesPlugin.Settings.EnableScout.Value, NuageRolesPlugin.Settings.EnableRegular.Value, NuageRolesPlugin.Settings.EnableEngineer.Value }; if (!source.Any((bool isEnabled) => isEnabled)) { NuageRolesPlugin.Logger.LogError((object)"WARNING! You disabled all roles in the config file. You will not get any roles until you change it back."); return; } if (NuageRolesPlugin.Settings.ShowGUIAtStart.Value) { guiManager.showGUI = true; } else { guiManager.showGUI = false; } harmonyPatcher.PatchAll(typeof(PunManagerPatch)); int num3 = roleId; roleId = NuageRolesPlugin.Settings.ResolveEnabledRoleIdOrRandom(roleId, rnd); if (roleId <= 0) { NuageRolesPlugin.Logger.LogWarning((object)"Unable to find an enabled role. Check the NuageRoles role config."); return; } if (num3 != roleId) { NuageRolesPlugin.Logger.LogInfo((object)"Selected role was unavailable, rolling an enabled role instead."); } switch (roleId) { case 1: { if (!NuageRolesPlugin.Settings.EnableRunner.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogInfo((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameRunner.Value + ".")); float num11 = MinMultiplier(NuageRolesPlugin.Settings.RunnerSpeedMultiplier.Value); float num12 = MinMultiplier(NuageRolesPlugin.Settings.RunnerStaminaMultiplier.Value); __instance.CrouchSpeed = crouchSpeed * num11; __instance.MoveSpeed = moveSpeed * num11; __instance.SprintSpeed = sprintSpeed * num11; __instance.EnergyStart = energyStart * num12; __instance.EnergyCurrent = energyCurrent * num12; NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameRunner.Value; NuageRolesPlugin.GUIinstance.color = new Color(0.973f, 1f, 0.196f); NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecRunner.Value + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = new Color(0.973f, 1f, 0.196f); break; } case 2: { if (!NuageRolesPlugin.Settings.EnableTank.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogInfo((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameTank.Value + ".")); float multiplier3 = MinMultiplier(NuageRolesPlugin.Settings.TankHealthMultiplier.Value); float num10 = MinMultiplier(NuageRolesPlugin.Settings.TankSpeedMultiplier.Value); setHealth(PlayerController.instance.playerSteamID, ScaleHealthValue(num, multiplier3), ScaleHealthValue(num2, multiplier3)); __instance.CrouchSpeed = crouchSpeed * num10; __instance.MoveSpeed = moveSpeed * num10; __instance.SprintSpeed = sprintSpeed * num10; isTank = true; NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameTank.Value; NuageRolesPlugin.GUIinstance.color = Color.gray; NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecTank.Value + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = Color.gray; break; } case 3: { if (!NuageRolesPlugin.Settings.EnableGambler.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogInfo((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameGambler.Value + ".")); object[] array = genGamblerEffects(); if ((int)array[1] == 0) { float num4 = MinMultiplier(NuageRolesPlugin.Settings.GamblerPositiveSpeedMultiplier.Value); __instance.CrouchSpeed = crouchSpeed * num4; __instance.MoveSpeed = moveSpeed * num4; __instance.SprintSpeed = sprintSpeed * num4; } else if ((int)array[1] == 1) { float num5 = MinMultiplier(NuageRolesPlugin.Settings.GamblerPositiveStaminaMultiplier.Value); __instance.EnergyStart = energyStart * num5; __instance.EnergyCurrent = energyCurrent * num5; } else if ((int)array[1] == 2) { float multiplier = MinMultiplier(NuageRolesPlugin.Settings.GamblerPositiveHealthMultiplier.Value); setHealth(PlayerController.instance.playerSteamID, ScaleHealthValue(num, multiplier), ScaleHealthValue(num2, multiplier)); } else if ((int)array[1] == 3) { modifyStrength(PlayerController.instance.playerSteamID, grabStrength * MinMultiplier(NuageRolesPlugin.Settings.GamblerPositiveStrengthMultiplier.Value)); } else if ((int)array[1] == 4) { __instance.JumpForce = jumpForce * MinMultiplier(NuageRolesPlugin.Settings.GamblerPositiveJumpMultiplier.Value); } if ((int)array[2] == 0) { float num6 = MinMultiplier(NuageRolesPlugin.Settings.GamblerNegativeSpeedMultiplier.Value); __instance.CrouchSpeed = crouchSpeed * num6; __instance.MoveSpeed = moveSpeed * num6; __instance.SprintSpeed = sprintSpeed * num6; } else if ((int)array[2] == 1) { float num7 = MinMultiplier(NuageRolesPlugin.Settings.GamblerNegativeStaminaMultiplier.Value); __instance.EnergyStart = energyStart * num7; __instance.EnergyCurrent = energyCurrent * num7; } else if ((int)array[2] == 2) { float multiplier2 = MinMultiplier(NuageRolesPlugin.Settings.GamblerNegativeHealthMultiplier.Value); setHealth(PlayerController.instance.playerSteamID, ScaleHealthValue(num, multiplier2), ScaleHealthValue(num2, multiplier2)); } else if ((int)array[2] == 3) { modifyStrength(PlayerController.instance.playerSteamID, grabStrength * MinMultiplier(NuageRolesPlugin.Settings.GamblerNegativeStrengthMultiplier.Value)); } else if ((int)array[2] == 4) { __instance.JumpForce = jumpForce * MinMultiplier(NuageRolesPlugin.Settings.GamblerNegativeJumpMultiplier.Value); } NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameGambler.Value; NuageRolesPlugin.GUIinstance.color = new Color(0.576f, 0f, 0.831f); NuageRolesPlugin.GUIinstance.descColor = new Color(0.576f, 0f, 0.831f); NuageRolesPlugin.GUIinstance.descText = array[0]?.ToString() + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; break; } case 4: if (!NuageRolesPlugin.Settings.EnableStrongman.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogMessage((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameStrongman.Value + ".")); NuageRolesPlugin.Logger.LogInfo((object)("Strength before: " + grabStrength)); modifyStrength(PlayerController.instance.playerSteamID, grabStrength * MinMultiplier(NuageRolesPlugin.Settings.StrongmanStrengthMultiplier.Value) + NonNegative(NuageRolesPlugin.Settings.StrongmanStrengthBonus.Value)); NuageRolesPlugin.Logger.LogInfo((object)("Strength after: " + PhysGrabber.instance.grabStrength)); NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameStrongman.Value; NuageRolesPlugin.GUIinstance.color = new Color(0.761f, 0.055f, 0.055f); NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecStrongman.Value + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = new Color(0.761f, 0.055f, 0.055f); break; case 5: if (!NuageRolesPlugin.Settings.EnableRL.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogMessage((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameRL.Value + ".")); PlayerAvatar.instance.physGrabber.grabRange = grabRange * MinMultiplier(NuageRolesPlugin.Settings.RangedLooterGrabRangeMultiplier.Value); modifyStrength(PlayerController.instance.playerSteamID, grabStrength * MinMultiplier(NuageRolesPlugin.Settings.RangedLooterStrengthMultiplier.Value)); NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameRL.Value; NuageRolesPlugin.GUIinstance.color = new Color(0.592f, 0.969f, 0.663f); NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecRL.Value + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = new Color(0.592f, 0.969f, 0.663f); break; case 6: { if (!NuageRolesPlugin.Settings.EnableAthletic.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogMessage((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameAthletic.Value + ".")); float num8 = NonNegative(NuageRolesPlugin.Settings.AthleticStaminaBonus.Value); modifyStrength(PlayerController.instance.playerSteamID, grabStrength * MinMultiplier(NuageRolesPlugin.Settings.AthleticStrengthMultiplier.Value)); __instance.EnergyStart = energyStart + num8; __instance.EnergyCurrent = energyCurrent + num8; __instance.JumpForce = jumpForce + NonNegative(NuageRolesPlugin.Settings.AthleticJumpForceBonus.Value); NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameAthletic.Value; NuageRolesPlugin.GUIinstance.color = Color.white; NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecAthletic.Value + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = Color.white; break; } case 7: if (!NuageRolesPlugin.Settings.EnableMage.Value) { assignRandomEnabledRole(); break; } NuageRolesPlugin.Logger.LogMessage((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameMage.Value + ".")); guiManager.isMage = true; guiManager.aviableMana = guiManager.GetMageMaxMana(); guiManager.manaTicks = 0; ManaHelper.CreateUI(); if ((Object)(object)NuageRolesPlugin.GUIinstance != (Object)null) { NuageRolesPlugin.GUIinstance.UpdateManaDisplay(); } if ((double)num2 * 0.5 > 0.0) { setHealth(PlayerController.instance.playerSteamID, (int)((double)num * 0.5), (int)((double)num2 * 0.5)); } else { setHealth(PlayerController.instance.playerSteamID, (int)((double)num * 0.5), num2); } NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameMage.Value; NuageRolesPlugin.GUIinstance.color = new Color(0f, 0.384f, 1f); NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecMage.Value + "\nPress " + ((object)NuageRolesPlugin.Settings.ShowSpellsKey.Value).ToString() + " to see all your spells and press " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = new Color(0f, 0.384f, 1f); break; case 8: { if (!NuageRolesPlugin.Settings.EnableReaper.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogMessage((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameReaper.Value + ".")); harmonyPatcher.PatchAll(typeof(ReaperPatch)); setReaperStatus(PlayerController.instance.playerSteamID, isReaper: true); float multiplier4 = MinMultiplier(NuageRolesPlugin.Settings.ReaperHealthMultiplier.Value); setHealth(PlayerController.instance.playerSteamID, ScaleHealthValue(num, multiplier4), ScaleHealthValue(num2, multiplier4)); NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameReaper.Value; NuageRolesPlugin.GUIinstance.color = new Color(0.141f, 0.6f, 0.502f); NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecReaper.Value + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = new Color(0.141f, 0.6f, 0.502f); break; } case 9: { if (!NuageRolesPlugin.Settings.EnableScout.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogMessage((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameScout.Value + ".")); isScout = true; float num9 = MinMultiplier(NuageRolesPlugin.Settings.ScoutStaminaMultiplier.Value); __instance.EnergyStart = energyStart * num9; __instance.EnergyCurrent = energyCurrent * num9; __instance.sprintRechargeAmount *= MinMultiplier(NuageRolesPlugin.Settings.ScoutSprintRechargeMultiplier.Value); NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameScout.Value; NuageRolesPlugin.GUIinstance.color = new Color(0.902f, 0.733f, 0.11f); NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecScout.Value.Replace("[G]", "[" + ((object)NuageRolesPlugin.Settings.ScoutKey.Value).ToString() + "]") + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = new Color(0.902f, 0.733f, 0.11f); break; } case 10: if (!NuageRolesPlugin.Settings.EnableRegular.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogMessage((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameRegular.Value + ".")); __instance.CrouchSpeed = crouchSpeed; __instance.MoveSpeed = moveSpeed; __instance.SprintSpeed = sprintSpeed; __instance.JumpForce = jumpForce; __instance.EnergyStart = energyStart; __instance.EnergyCurrent = energyCurrent; NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameRegular.Value; NuageRolesPlugin.GUIinstance.color = Color.white; NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecRegular.Value + "\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = Color.white; break; case 11: if (!NuageRolesPlugin.Settings.EnableEngineer.Value) { assignRandomEnabledRole(); break; } guiManager.ResetManaUI(); NuageRolesPlugin.Logger.LogInfo((object)"Resetting Mana UI."); NuageRolesPlugin.Logger.LogMessage((object)("Assigning role " + NuageRolesPlugin.Settings.CustomRoleNameEngineer.Value + ".")); isEngineer = true; NuageRolesPlugin.GUIinstance.text = NuageRolesPlugin.Settings.CustomRoleNameEngineer.Value; NuageRolesPlugin.GUIinstance.color = new Color(0.8f, 0.5f, 0.2f); NuageRolesPlugin.GUIinstance.descText = NuageRolesPlugin.Settings.CustomRoleDecEngineer.Value + "\nPress [" + ((object)NuageRolesPlugin.Settings.ChargeItemKey.Value).ToString() + "] While holding an item to Charge it\nPress " + ((object)NuageRolesPlugin.Settings.ToggleKey.Value).ToString() + " to continue"; NuageRolesPlugin.GUIinstance.descColor = new Color(0.8f, 0.5f, 0.2f); break; } } } [HarmonyPatch(typeof(EnemyHealth))] internal static class EnemyHealthPatch { private static readonly Dictionary processed = new Dictionary(); private const float processedExpiry = 3f; [HarmonyPrefix] [HarmonyPatch("Hurt")] public static void Hurt_Prefix(EnemyHealth __instance, int _damage, Vector3 _hurtDirection) { if (!SemiFunc.IsMultiplayer()) { return; } if (processed.Count > 0) { float time = Time.time; List list = new List(processed.Keys); foreach (int item in list) { if (time - processed[item] > 3f) { processed.Remove(item); } } } if ((Object)(object)__instance == (Object)null || __instance.dead) { return; } int healthCurrent = __instance.healthCurrent; int num = healthCurrent - _damage; if (num > 0) { return; } PhotonView component = ((Component)__instance).GetComponent(); int num2 = (((Object)(object)component != (Object)null) ? component.ViewID : 0); if (num2 != 0 && processed.ContainsKey(num2)) { return; } if (num2 != 0) { processed[num2] = Time.time; } string killerSteamID = (((Object)(object)PlayerController.instance != (Object)null) ? PlayerController.instance.playerSteamID : string.Empty); if (PhotonNetwork.IsMasterClient) { string[] masterReapers = ReaperEventListener.GetMasterReapers(); if (masterReapers != null && masterReapers.Length != 0) { ReaperEvents.RaiseApplyBuffs(killerSteamID, masterReapers); } } else { ReaperEvents.RaiseRequestApplyBuffs(killerSteamID); } } [HarmonyPostfix] [HarmonyPatch("DeathImpulseRPC")] public static void DeathImpulseRPC_Postfix(EnemyHealth __instance) { if (SemiFunc.IsMultiplayer() || (Object)(object)__instance == (Object)null || !__instance.dead) { return; } string text = (((Object)(object)PlayerController.instance != (Object)null) ? PlayerController.instance.playerSteamID : string.Empty); NuageRolesPlugin.Logger.LogInfo((object)("[EnHlPch] Singleplayer enemy death detected by " + text)); foreach (PlayerAvatar item in SemiFunc.PlayerGetAll()) { if (!((Object)(object)item == (Object)null)) { ReaperManager component = ((Component)item).GetComponent(); if ((Object)(object)component != (Object)null && component.isReaper) { component.ApplyReaperStats(item); component.kills = 0; component.enemyDeathTimer = Mathf.Max(0, NuageRolesPlugin.Settings.ReaperBuffCooldownFrames.Value); NuageRolesPlugin.Logger.LogInfo((object)("[EnHlPch] Applied singleplayer buff to " + item.steamID)); } } } } } [HarmonyPatch(typeof(PlayerAvatar))] internal static class PlayerAvatarPatch { [HarmonyPostfix] [HarmonyPatch("Awake")] private static void Awake_Postfix(PlayerAvatar __instance) { if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent())) { ((Component)__instance).gameObject.AddComponent(); NuageRolesPlugin.Logger.LogInfo((object)("[PrArPch]: Added ReaperManager to avatar steamID=" + __instance.steamID + " pv=" + (((Object)(object)__instance.photonView != (Object)null) ? __instance.photonView.ViewID.ToString() : "null"))); } else { NuageRolesPlugin.Logger.LogInfo((object)("[PrArPch]: avatar already has ReaperManager steamID=" + __instance.steamID + " pv=" + (((Object)(object)__instance.photonView != (Object)null) ? __instance.photonView.ViewID.ToString() : "null"))); } if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent())) { ((Component)__instance).gameObject.AddComponent(); } ReaperEventListener.Ensure(); } } internal class ReaperEventListener : MonoBehaviourPunCallbacks, IOnEventCallback { private static bool _created; private static readonly HashSet masterReapers = new HashSet(); public static void Ensure() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown if (!_created) { _created = true; GameObject val = new GameObject("NuageRoles_ReaperEventListener"); Object.DontDestroyOnLoad((Object)(object)val); val.AddComponent(); NuageRolesPlugin.Logger.LogInfo((object)"ReaperEventListener created!"); } } public static string[] GetMasterReapers() { lock (masterReapers) { string[] array = new string[masterReapers.Count]; masterReapers.CopyTo(array); return array; } } public override void OnEnable() { PhotonNetwork.AddCallbackTarget((object)this); } public override void OnDisable() { PhotonNetwork.RemoveCallbackTarget((object)this); } private static int GetNonNegativeInt(object[] data, int index, int fallback) { if (index >= data.Length || data[index] == null) { return Mathf.Max(0, fallback); } if (data[index] is int num) { return Mathf.Max(0, num); } if (data[index] is short num2) { return Mathf.Max(0, (int)num2); } object obj = data[index]; if (obj is byte) { return (byte)obj; } return Mathf.Max(0, fallback); } public override void OnJoinedRoom() { lock (masterReapers) { masterReapers.Clear(); } } public override void OnLeftRoom() { lock (masterReapers) { masterReapers.Clear(); } } public override void OnMasterClientSwitched(Player newMasterClient) { lock (masterReapers) { masterReapers.Clear(); } } public void OnEvent(EventData photonEvent) { if (photonEvent.Code == 151) { if (!(photonEvent.CustomData is object[] array) || array.Length < 2) { return; } string text = array[0] as string; if (string.IsNullOrEmpty(text)) { return; } bool flag = false; if (array[1] is bool flag2) { flag = flag2; } else if (array[1] is byte b) { flag = b != 0; } else { object obj = array[1]; if (!(obj is int)) { return; } int num = (int)obj; flag = num != 0; } if (!PhotonNetwork.IsMasterClient) { return; } lock (masterReapers) { if (flag) { if (masterReapers.Add(text)) { NuageRolesPlugin.Logger.LogInfo((object)("[RpEsLr] Master: Registered reaper " + text)); } } else if (masterReapers.Remove(text)) { NuageRolesPlugin.Logger.LogInfo((object)("[RpEsLr] Master: Unregistered reaper " + text)); } return; } } if (photonEvent.Code == 152) { if (PhotonNetwork.IsMasterClient) { string text2 = string.Empty; if (photonEvent.CustomData is object[] array2 && array2.Length != 0) { text2 = (array2[0] as string) ?? string.Empty; } string[] array3; lock (masterReapers) { array3 = new string[masterReapers.Count]; masterReapers.CopyTo(array3); } NuageRolesPlugin.Logger.LogInfo((object)$"[RpEsLr] Master: received EV_REQUEST_REAPER_BUFFS for killer={text2} reapersCount={array3.Length}"); if (array3.Length != 0) { ReaperEvents.RaiseApplyBuffs(text2, array3); } else { NuageRolesPlugin.Logger.LogInfo((object)"[RpEsLr] Master: no reapers registered - nothing to broadcast"); } } } else { if (photonEvent.Code != 150) { return; } try { if (!(photonEvent.CustomData is object[] array4) || array4.Length < 2) { return; } string text3 = (array4[0] as string) ?? string.Empty; if (!(array4[1] is string[] array5)) { return; } string[] array6 = array5; int nonNegativeInt = GetNonNegativeInt(array4, 2, NuageRolesPlugin.Settings.ReaperMaxHealthBonusPerKill.Value); int nonNegativeInt2 = GetNonNegativeInt(array4, 3, NuageRolesPlugin.Settings.ReaperHealAmountPerKill.Value); int nonNegativeInt3 = GetNonNegativeInt(array4, 4, NuageRolesPlugin.Settings.ReaperBuffCooldownFrames.Value); string[] array7 = array6; foreach (string text4 in array7) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(text4); if ((Object)(object)val == (Object)null) { NuageRolesPlugin.Logger.LogWarning((object)("[RpEsLr] giveReaperStatsRPC: cannot find avatar for steamID=" + text4 + " on this client")); continue; } ReaperManager component = ((Component)val).GetComponent(); if ((Object)(object)component == (Object)null) { NuageRolesPlugin.Logger.LogWarning((object)("[RpEsLr] giveReaperStatsRPC: avatar " + text4 + " has no ReaperManager on this client")); continue; } int num2 = (int)AccessTools.Field(typeof(PlayerHealth), "health").GetValue(val.playerHealth); if (num2 <= 0) { NuageRolesPlugin.Logger.LogInfo((object)$"[RpEsLr] giveReaperStatsRPC: avatar {text4} is dead (health={num2}) - skipping"); continue; } if (component.enemyDeathTimer > 0) { NuageRolesPlugin.Logger.LogInfo((object)$"[RpEsLr] giveReaperStatsRPC: avatar {text4} in cooldown (enemyDeathTimer={component.enemyDeathTimer}) - skipping"); continue; } int num3 = (int)AccessTools.Field(typeof(PlayerHealth), "maxHealth").GetValue(val.playerHealth); int num4 = num2; int num5 = num3 + nonNegativeInt; AccessTools.Field(typeof(PlayerHealth), "maxHealth").SetValue(val.playerHealth, num5); int num6 = Mathf.Min(nonNegativeInt2, Mathf.Max(0, num5 - num4)); if (num6 > 0) { val.playerHealth.Heal(num6, true); } component.kills = 0; component.enemyDeathTimer = nonNegativeInt3; } } catch (Exception arg) { NuageRolesPlugin.Logger.LogError((object)$"[RpEsLr]: Event handler exception: {arg}"); } } } } internal static class ReaperEvents { public const byte EV_APPLY_REAPER_BUFFS = 150; public const byte EV_REAPER_STATUS_CHANGE = 151; public const byte EV_REQUEST_REAPER_BUFFS = 152; public static void RaiseApplyBuffs(string killerSteamID, string[] reaperSteamIDs) { RaiseApplyBuffs(killerSteamID, reaperSteamIDs, NonNegative(NuageRolesPlugin.Settings.ReaperMaxHealthBonusPerKill.Value), NonNegative(NuageRolesPlugin.Settings.ReaperHealAmountPerKill.Value), NonNegative(NuageRolesPlugin.Settings.ReaperBuffCooldownFrames.Value)); } private static void RaiseApplyBuffs(string killerSteamID, string[] reaperSteamIDs, int maxHealthBonus, int healAmount, int cooldownFrames) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_005a: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (reaperSteamIDs != null && reaperSteamIDs.Length != 0 && PhotonNetwork.IsConnected && PhotonNetwork.InRoom) { object[] array = new object[5] { killerSteamID ?? string.Empty, reaperSteamIDs, maxHealthBonus, healAmount, cooldownFrames }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)1 }; SendOptions val2 = default(SendOptions); ((SendOptions)(ref val2)).Reliability = true; SendOptions val3 = val2; PhotonNetwork.RaiseEvent((byte)150, (object)array, val, val3); } } private static int NonNegative(int value) { if (value >= 0) { return value; } return 0; } public static void RaiseReaperStatusChange(string steamID, bool isReaper) { //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) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrEmpty(steamID)) { if (!PhotonNetwork.IsConnected || !PhotonNetwork.InRoom) { NuageRolesPlugin.Logger.LogWarning((object)$"[RpEs] RaiseReaperStatusChange: Not in room - skipping for {steamID} -> {isReaper}"); return; } object[] array = new object[2] { steamID, isReaper }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)2 }; SendOptions val2 = default(SendOptions); ((SendOptions)(ref val2)).Reliability = true; SendOptions val3 = val2; PhotonNetwork.RaiseEvent((byte)151, (object)array, val, val3); } } public static void RaiseRequestApplyBuffs(string killerSteamID) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(killerSteamID)) { killerSteamID = string.Empty; } if (!PhotonNetwork.IsConnected || !PhotonNetwork.InRoom) { NuageRolesPlugin.Logger.LogWarning((object)("[RpEs] RaiseRequestApplyBuffs: Not in room - skipping request for killer=" + killerSteamID)); return; } object[] array = new object[1] { killerSteamID }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)2 }; SendOptions val2 = default(SendOptions); ((SendOptions)(ref val2)).Reliability = true; SendOptions val3 = val2; PhotonNetwork.RaiseEvent((byte)152, (object)array, val, val3); } } public class ReaperManager : MonoBehaviourPun { public bool isReaper; public int kills; public int enemyDeathTimer; private void Start() { ReaperEventListener.Ensure(); } private void OnDestroy() { try { if ((Object)(object)((MonoBehaviourPun)this).photonView != (Object)null && ((MonoBehaviourPun)this).photonView.IsMine && ((MonoBehaviourPun)this).photonView.ViewID != 0) { PhotonNetwork.RemoveRPCs(((MonoBehaviourPun)this).photonView); } } catch (Exception arg) { NuageRolesPlugin.Logger.LogWarning((object)$"[RpMr] OnDestroy: RemoveRPCs exception: {arg}"); } } [PunRPC] public void setReaperStatusRPC(string steamID, bool isReaper) { if ((Object)(object)RunManager.instance == (Object)null || (Object)(object)RunManager.instance.levelCurrent == (Object)null) { NuageRolesPlugin.Logger.LogWarning((object)("[RpMr] setReaperStatusRPC: RunManager/level null - ignoring for " + steamID)); return; } if (!RunManager.instance.levels.Contains(RunManager.instance.levelCurrent)) { NuageRolesPlugin.Logger.LogInfo((object)("[RpMr] setReaperStatusRPC: not a runlevel - ignoring for " + steamID)); return; } PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(steamID); if ((Object)(object)val != (Object)null) { ReaperManager component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && component.isReaper != isReaper) { NuageRolesPlugin.Logger.LogInfo((object)$"[RpMr] setReaperStatusRPC: received for {steamID}, setTo={isReaper}"); component.isReaper = isReaper; } } if (PhotonNetwork.IsConnected && PhotonNetwork.InRoom) { ReaperEvents.RaiseReaperStatusChange(steamID, isReaper); } else { NuageRolesPlugin.Logger.LogWarning((object)("[RpMr] setReaperStatusRPC: Not in room/connected - not notifying master for " + steamID)); } } public void OnEnemyKilled(PlayerAvatar killerAvatar) { if ((Object)(object)killerAvatar == (Object)null) { return; } string steamID = killerAvatar.steamID; if (PhotonNetwork.IsMasterClient) { string[] masterReapers = ReaperEventListener.GetMasterReapers(); NuageRolesPlugin.Logger.LogInfo((object)$"[RpMr] Master local kill: broadcasting buffs for {masterReapers.Length} reapers (killer={steamID})"); if (masterReapers.Length != 0) { ReaperEvents.RaiseApplyBuffs(steamID, masterReapers); } } else { ReaperEvents.RaiseRequestApplyBuffs(steamID); } } internal void ApplyReaperStats(PlayerAvatar avatar) { if (!((Object)(object)avatar == (Object)null)) { int num = (int)AccessTools.Field(typeof(PlayerHealth), "health").GetValue(avatar.playerHealth); int num2 = (int)AccessTools.Field(typeof(PlayerHealth), "maxHealth").GetValue(avatar.playerHealth); int num3 = num2 + Mathf.Max(0, NuageRolesPlugin.Settings.ReaperMaxHealthBonusPerKill.Value); AccessTools.Field(typeof(PlayerHealth), "maxHealth").SetValue(avatar.playerHealth, num3); int num4 = Mathf.Min(Mathf.Max(0, NuageRolesPlugin.Settings.ReaperHealAmountPerKill.Value), Mathf.Max(0, num3 - num)); if (num4 > 0) { avatar.playerHealth.Heal(num4, true); } } } private void Update() { if (enemyDeathTimer > 0) { enemyDeathTimer--; } } } [HarmonyPatch(typeof(EnemyHealth))] internal static class ReaperPatch { [HarmonyPatch("Death")] [HarmonyPrefix] public static void PrefixMethod() { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(PlayerController.instance.playerSteamID); if (!((Object)(object)val == (Object)null)) { ReaperManager component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.kills++; } if ((Object)(object)component != (Object)null) { component.OnEnemyKilled(val); } else { ReaperEvents.RaiseRequestApplyBuffs(val.steamID); } } } } public class ReaperSyncManager : MonoBehaviourPunCallbacks { public override void OnPlayerEnteredRoom(Player newPlayer) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(PlayerController.instance.playerSteamID); ReaperManager component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && component.isReaper && SemiFunc.IsMasterClientOrSingleplayer()) { NuageRolesPlugin.Logger.LogWarning((object)("Sending late-joiner Reaper status RPC to " + newPlayer.NickName)); ((MonoBehaviourPun)component).photonView.RPC("setReaperStatusRPC", newPlayer, new object[2] { PlayerController.instance.playerSteamID, true }); } } } [HarmonyPatch(typeof(TruckScreenText))] internal static class Sender { private static bool hasRanOnce; public static ClassManager manager = new ClassManager(); [HarmonyPatch("ArrowPointAtGoalLogic")] [HarmonyPrefix] private static void PrefixMethod() { if (!hasRanOnce && !SemiFunc.RunIsShop()) { manager.assignRoleFromConfig(PlayerController.instance); NuageRolesPlugin.Logger.LogInfo((object)"Successfully rolled role!"); hasRanOnce = true; } } [HarmonyPatch("Start")] [HarmonyPrefix] private static void StartPrefix() { hasRanOnce = false; } } } namespace NuageRoles.Roles.Patches { public class EngineerManager : MonoBehaviourPun { private PlayerAvatar? playerAvatar; private float sacrificedEnergy; private float regenTimer; private void Awake() { playerAvatar = ((Component)this).GetComponent(); } private void Update() { //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (!ClassManager.isEngineer || (Object)(object)playerAvatar == (Object)null || (Object)(object)PlayerAvatar.instance == (Object)null || (Object)(object)playerAvatar != (Object)(object)PlayerAvatar.instance || !SemiFunc.RunIsLevel() || SemiFunc.RunIsShop()) { return; } float num = Mathf.Max(0f, (float)NuageRolesPlugin.Settings.EngineerChargeStaminaCost.Value); float num2 = Mathf.Max(0f, (float)NuageRolesPlugin.Settings.EngineerStaminaRestoreAmount.Value); float num3 = Mathf.Max(1f, (float)NuageRolesPlugin.Settings.EngineerStaminaRestoreIntervalSeconds.Value); if (PlayerAvatar.instance.playerHealth.health <= 0) { if (sacrificedEnergy > 0f) { PlayerController instance = PlayerController.instance; instance.EnergyStart += sacrificedEnergy; sacrificedEnergy = 0f; regenTimer = 0f; } return; } if (sacrificedEnergy > 0f) { regenTimer += Time.deltaTime; while (regenTimer >= num3 && sacrificedEnergy > 0f) { regenTimer -= num3; float num4 = Mathf.Min(num2, sacrificedEnergy); PlayerController instance2 = PlayerController.instance; instance2.EnergyStart += num4; PlayerController instance3 = PlayerController.instance; instance3.EnergyCurrent += num4; sacrificedEnergy -= num4; } if (sacrificedEnergy <= 0f) { regenTimer = 0f; } } else { regenTimer = 0f; } if (Input.GetKeyDown(NuageRolesPlugin.Settings.ChargeItemKey.Value) && !(PlayerController.instance.EnergyStart < num) && (Object)(object)PhysGrabber.instance != (Object)null && PhysGrabber.instance.grabbed && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)null) { ItemBattery componentInChildren = ((Component)PhysGrabber.instance.grabbedPhysGrabObject).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.batteryLife < 100f) { PlayerController instance4 = PlayerController.instance; instance4.EnergyStart -= num; sacrificedEnergy += num; PlayerController.instance.EnergyCurrent = Mathf.Max(0f, PlayerController.instance.EnergyCurrent - num); int num5 = Mathf.Max(1, componentInChildren.batteryBars); float num6 = 100f / (float)num5; componentInChildren.batteryLife = Mathf.Min(componentInChildren.batteryLife + num6, 100f); } } } } public class guiManager : MonoBehaviour { private bool lastManaPosition = true; public static bool showGUI = true; public static bool isMage = false; private static bool showSpells = false; private bool isDead; public string text = string.Empty; public Color color = Color.white; public string descText = string.Empty; public Color descColor = Color.white; private Texture2D? _backgroundTexture; public static Texture2D? manaTexture; public static Font? customFont; private static AssetBundle? fontBundle; private static AssetBundle? assetBundle; private static bool missingAssetBundleLogged; public static int aviableMana = 0; public static int manaRegenRate = 0; public static int manaTicks = 0; public bool speedActive; private float crouchSpeedBefore; private float moveSpeedBefore; private float sprintSpeedBefore; private float speedRemainingSeconds; private bool isOvercharged; private float overchargeRemainingSeconds; private bool jumpActive; private float jumpOriginal; private float jumpRemainingSeconds; private int manaUsageTicker; private bool showManaUsage; private string manaUsageText = "Used x (- y Mana)"; private bool fontLoaded; private int passiveTankRegenTicker; public static int GetMageMaxMana() { return Mathf.Clamp(NuageRolesPlugin.Settings.MageMaxMana.Value, 3, 12); } private static int GetMageHealAmount() { return Mathf.Max(1, NuageRolesPlugin.Settings.MageHealAmount.Value); } private static float GetMageSpeedMultiplier() { return Mathf.Max(0.1f, NuageRolesPlugin.Settings.MageSpeedMultiplier.Value); } private static float GetMageJumpForceBonus() { return Mathf.Max(0f, NuageRolesPlugin.Settings.MageJumpForceBonus.Value); } private static float GetMageOverchargeMultiplier() { return Mathf.Max(1f, NuageRolesPlugin.Settings.MageOverchargeMultiplier.Value); } private static float GetMageSpeedBoostDurationSeconds() { return Mathf.Max(1f, (float)NuageRolesPlugin.Settings.MageSpeedBoostDurationSeconds.Value); } private static float GetMageJumpBoostDurationSeconds() { return Mathf.Max(1f, (float)NuageRolesPlugin.Settings.MageJumpBoostDurationSeconds.Value); } private static float GetMageOverchargeDurationSeconds() { return Mathf.Max(1f, (float)NuageRolesPlugin.Settings.MageOverchargeDurationSeconds.Value); } private static int SecondsToFixedTicks(float seconds) { return Mathf.Max(1, Mathf.RoundToInt(Mathf.Max(0.1f, seconds) / Time.fixedDeltaTime)); } public static AssetBundle? LoadAssetBundle(string name) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown if ((Object)assetBundle != (Object)null) { return assetBundle; } string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty; string text = Path.Combine(path, name); string fileName = Path.GetFileName(name); foreach (AssetBundle allLoadedAssetBundle in AssetBundle.GetAllLoadedAssetBundles()) { if (!((Object)allLoadedAssetBundle == (Object)null) && (string.Equals(((Object)allLoadedAssetBundle).name, name, StringComparison.OrdinalIgnoreCase) || string.Equals(((Object)allLoadedAssetBundle).name, fileName, StringComparison.OrdinalIgnoreCase) || allLoadedAssetBundle.Contains("emptyBottle.png") || allLoadedAssetBundle.Contains("filledBottle.png") || allLoadedAssetBundle.Contains("font.ttf"))) { assetBundle = allLoadedAssetBundle; return assetBundle; } } if (!File.Exists(text)) { if (!missingAssetBundleLogged) { NuageRolesPlugin.Logger.LogError((object)("Missing asset bundle: expected '" + text + "'. Put NuageRoles_assets next to NuageRoles.Plugin.dll.")); missingAssetBundleLogged = true; } return null; } assetBundle = AssetBundle.LoadFromFile(text); if ((Object)assetBundle == (Object)null && !missingAssetBundleLogged) { NuageRolesPlugin.Logger.LogError((object)("Failed to load asset bundle '" + text + "'.")); missingAssetBundleLogged = true; } return assetBundle; } public static Texture2D? LoadBottleTextureFromFile() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown AssetBundle val = LoadAssetBundle("NuageRoles_assets"); if ((Object)val == (Object)null) { return null; } Texture2D val2 = val.LoadAsset("emptyBottle.png"); if ((Object)val2 == (Object)null) { NuageRolesPlugin.Logger.LogError((object)"Missing texture asset 'emptyBottle.png' in NuageRoles_assets."); } return val2; } public static Texture2D? LoadFullBottleTextureFromFile() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown AssetBundle val = LoadAssetBundle("NuageRoles_assets"); if ((Object)val == (Object)null) { return null; } Texture2D val2 = val.LoadAsset("filledBottle.png"); if ((Object)val2 == (Object)null) { NuageRolesPlugin.Logger.LogError((object)"Missing texture asset 'filledBottle.png' in NuageRoles_assets."); } return val2; } public static Texture2D? LoadTextureByName(string bundleName, string assetName) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown AssetBundle val = LoadAssetBundle(bundleName); if ((Object)val == (Object)null) { return null; } Texture2D val2 = val.LoadAsset(assetName); if ((Object)val2 == (Object)null) { NuageRolesPlugin.Logger.LogError((object)("Missing texture asset '" + assetName + "' in " + bundleName + ".")); } return val2; } public static void loadFont() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown if ((Object)fontBundle == (Object)null) { fontBundle = LoadAssetBundle("NuageRoles_assets"); if ((Object)fontBundle == (Object)null) { return; } customFont = fontBundle.LoadAsset("font.ttf"); if ((Object)customFont == (Object)null) { NuageRolesPlugin.Logger.LogError((object)"Missing font asset 'font.ttf' in NuageRoles_assets."); } } if ((Object)fontBundle == (Object)null) { NuageRolesPlugin.Logger.LogError((object)"Missing Assets: Put the assets file next to the dll in your plugins folder. If this does not fix it contact us on our discord (see thunderstore description or README)"); } } private void Start() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown _backgroundTexture = LoadBottleTextureFromFile(); if ((Object)_backgroundTexture != (Object)null) { _backgroundTexture.Apply(); } manaTexture = LoadFullBottleTextureFromFile(); if ((Object)manaTexture != (Object)null) { manaTexture.Apply(); } } private void OnGUI() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Expected O, but got Unknown //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Expected O, but got Unknown //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Expected O, but got Unknown //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Expected O, but got Unknown //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Expected O, but got Unknown //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_07e7: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_0897: Unknown result type (might be due to invalid IL or missing references) //IL_089c: Unknown result type (might be due to invalid IL or missing references) //IL_0915: Unknown result type (might be due to invalid IL or missing references) //IL_091c: Expected O, but got Unknown //IL_094a: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Expected O, but got Unknown //IL_095b: Unknown result type (might be due to invalid IL or missing references) //IL_0962: Expected O, but got Unknown //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_0975: Unknown result type (might be due to invalid IL or missing references) //IL_097c: Expected O, but got Unknown //IL_0983: Unknown result type (might be due to invalid IL or missing references) //IL_0a11: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Expected O, but got Unknown //IL_0a70: Unknown result type (might be due to invalid IL or missing references) //IL_0a7c: Expected O, but got Unknown //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b6d: Unknown result type (might be due to invalid IL or missing references) //IL_0b9a: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Unknown result type (might be due to invalid IL or missing references) //IL_0bf4: Unknown result type (might be due to invalid IL or missing references) //IL_0c21: Unknown result type (might be due to invalid IL or missing references) //IL_0c4e: Unknown result type (might be due to invalid IL or missing references) //IL_0c7b: Unknown result type (might be due to invalid IL or missing references) //IL_0c8b: Unknown result type (might be due to invalid IL or missing references) //IL_0c92: Expected O, but got Unknown //IL_0ca8: Unknown result type (might be due to invalid IL or missing references) //IL_0cb4: Unknown result type (might be due to invalid IL or missing references) //IL_0cbb: Expected O, but got Unknown //IL_0cd1: Unknown result type (might be due to invalid IL or missing references) //IL_0cdb: Unknown result type (might be due to invalid IL or missing references) //IL_0ce6: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Expected O, but got Unknown //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Unknown result type (might be due to invalid IL or missing references) float num = Screen.width / 2 - 100; float num2 = Screen.height / 2 - 60; if (!fontLoaded) { loadFont(); fontLoaded = true; } if (SemiFunc.RunIsLevel() && !SemiFunc.RunIsShop() && showGUI) { GUIStyle val = new GUIStyle(); val.fontSize = 60; val.fontStyle = (FontStyle)1; val.richText = true; val.normal.textColor = color; val.alignment = (TextAnchor)4; val.font = customFont; GUIStyle val2 = new GUIStyle(val); val2.normal.textColor = Color.black; val2.alignment = (TextAnchor)4; val2.font = customFont; float num3 = 2f; GUI.Label(new Rect(num - num3, num2, 200f, 50f), this.text, val2); GUI.Label(new Rect(num + num3, num2, 200f, 50f), this.text, val2); GUI.Label(new Rect(num, num2 - num3, 200f, 50f), this.text, val2); GUI.Label(new Rect(num, num2 + num3, 200f, 50f), this.text, val2); GUI.Label(new Rect(num - num3, num2 - num3, 200f, 50f), this.text, val2); GUI.Label(new Rect(num - num3, num2 + num3, 200f, 50f), this.text, val2); GUI.Label(new Rect(num + num3, num2 - num3, 200f, 50f), this.text, val2); GUI.Label(new Rect(num + num3, num2 + num3, 200f, 50f), this.text, val2); GUI.Label(new Rect(num, num2, 200f, 50f), this.text, val); float num4 = Screen.width / 2 - 100; float num5 = Screen.height / 2 + 40; GUIStyle val3 = new GUIStyle(); val3.fontSize = 40; val3.fontStyle = (FontStyle)1; val3.richText = true; val3.normal.textColor = color; val3.alignment = (TextAnchor)4; val3.font = customFont; GUIStyle val4 = new GUIStyle(val3); val4.normal.textColor = Color.black; val4.alignment = (TextAnchor)4; val4.font = customFont; float num6 = 2f; GUI.Label(new Rect(num4 - num6, num5, 200f, 50f), descText, val4); GUI.Label(new Rect(num4 + num6, num5, 200f, 50f), descText, val4); GUI.Label(new Rect(num4, num5 - num6, 200f, 50f), descText, val4); GUI.Label(new Rect(num4, num5 + num6, 200f, 50f), descText, val4); GUI.Label(new Rect(num4 - num6, num5 - num6, 200f, 50f), descText, val4); GUI.Label(new Rect(num4 - num6, num5 + num6, 200f, 50f), descText, val4); GUI.Label(new Rect(num4 + num6, num5 - num6, 200f, 50f), descText, val4); GUI.Label(new Rect(num4 + num6, num5 + num6, 200f, 50f), descText, val4); GUI.Label(new Rect(num4, num5, 200f, 50f), descText, val3); } PlayerHealth localPlayerHealth = GetLocalPlayerHealth(); if (!isMage || !SemiFunc.RunIsLevel() || SemiFunc.RunIsShop() || IsUnityNull((Object?)(object)localPlayerHealth) || localPlayerHealth.health <= 0) { return; } GUIStyle val5 = new GUIStyle(); val5.alignment = (TextAnchor)1; val5.normal.background = manaTexture; val5.font = customFont; GUIStyle val6 = new GUIStyle(); val6.alignment = (TextAnchor)1; val6.normal.background = _backgroundTexture; val6.font = customFont; if (showManaUsage && SemiFunc.RunIsLevel() && !SemiFunc.RunIsShop() && isMage) { int num7 = Screen.width / 2 - 100; int num8 = Screen.height - 125; GUIStyle val7 = new GUIStyle(); val7.fontSize = 20; val7.fontStyle = (FontStyle)1; val7.richText = true; val7.normal.textColor = new Color(0f, 0.384f, 1f); val7.alignment = (TextAnchor)4; val7.font = customFont; GUIStyle val8 = new GUIStyle(val7); val8.normal.textColor = Color.black; val8.alignment = (TextAnchor)4; val8.font = customFont; float num9 = 1.5f; GUI.Label(new Rect((float)num7 - num9, (float)num8, 200f, 50f), manaUsageText, val8); GUI.Label(new Rect((float)num7 + num9, (float)num8, 200f, 50f), manaUsageText, val8); GUI.Label(new Rect((float)num7, (float)num8 - num9, 200f, 50f), manaUsageText, val8); GUI.Label(new Rect((float)num7, (float)num8 + num9, 200f, 50f), manaUsageText, val8); GUI.Label(new Rect((float)num7 - num9, (float)num8 - num9, 200f, 50f), manaUsageText, val8); GUI.Label(new Rect((float)num7 - num9, (float)num8 + num9, 200f, 50f), manaUsageText, val8); GUI.Label(new Rect((float)num7 + num9, (float)num8 - num9, 200f, 50f), manaUsageText, val8); GUI.Label(new Rect((float)num7 + num9, (float)num8 + num9, 200f, 50f), manaUsageText, val8); GUI.Label(new Rect((float)num7, (float)num8, 200f, 50f), manaUsageText, val7); } if (SemiFunc.RunIsLevel() && !SemiFunc.RunIsShop() && isMage && NuageRolesPlugin.Settings.MageTopManaTop) { if ((Object)ManaHelper.val == (Object)null) { ManaHelper.val = GameObject.Find("Energy"); } int mageMaxMana = GetMageMaxMana(); float num10 = 50f; float num11 = (float)Screen.width * 0.5f - (float)mageMaxMana * num10 * 0.5f; Rect val9 = default(Rect); for (int i = 0; i < mageMaxMana; i++) { ((Rect)(ref val9))..ctor(num11 + (float)i * num10, 50f, num10, num10); GUI.Box(val9, GUIContent.none, val6); if (aviableMana >= i + 1) { GUI.Box(val9, GUIContent.none, val5); } } } if (showSpells && SemiFunc.RunIsLevel() && !SemiFunc.RunIsShop()) { string text = "SPELLS"; string[] array = new string[21]; array[0] = "["; KeyCode value = NuageRolesPlugin.Settings.HealKey.Value; array[1] = ((object)(KeyCode)(ref value)).ToString(); array[2] = "] Heal yourself for "; array[3] = GetMageHealAmount().ToString(); array[4] = " health (1 Mana)\n["; value = NuageRolesPlugin.Settings.StaminaKey.Value; array[5] = ((object)(KeyCode)(ref value)).ToString(); array[6] = "] Regenerate your stamina to full (3 Mana)\n["; value = NuageRolesPlugin.Settings.SpeedKey.Value; array[7] = ((object)(KeyCode)(ref value)).ToString(); array[8] = "] Become faster for "; array[9] = GetMageSpeedBoostDurationSeconds().ToString("0.#"); array[10] = " seconds (2 Mana)\n["; value = NuageRolesPlugin.Settings.OverchargeKey.Value; array[11] = ((object)(KeyCode)(ref value)).ToString(); array[12] = "] Boost spells by x"; array[13] = GetMageOverchargeMultiplier().ToString("0.#"); array[14] = " for "; array[15] = GetMageOverchargeDurationSeconds().ToString("0.#"); array[16] = " seconds (3 Mana)\n["; value = NuageRolesPlugin.Settings.JumpKey.Value; array[17] = ((object)(KeyCode)(ref value)).ToString(); array[18] = "] Jump higher for "; array[19] = GetMageJumpBoostDurationSeconds().ToString("0.#"); array[20] = " seconds (2 Mana)"; string text2 = string.Concat(array); float num12 = (float)Screen.width * 0.5f; float num13 = (float)Screen.height * 0.5f; float num14 = Mathf.Clamp((float)Screen.width * 0.6f, 260f, 1200f); GUIStyle val10 = new GUIStyle(); val10.richText = true; val10.wordWrap = true; val10.alignment = (TextAnchor)4; val10.font = customFont; val10.fontStyle = (FontStyle)1; GUIStyle val11 = new GUIStyle(val10); val11.wordWrap = true; GUIStyle val12 = new GUIStyle(val10); val12.normal.textColor = Color.black; GUIStyle val13 = new GUIStyle(val11); val13.normal.textColor = Color.black; int maxSize2 = Mathf.Clamp(Mathf.RoundToInt((float)Screen.height * 0.09f), 24, 120); int maxSize3 = Mathf.Clamp(Mathf.RoundToInt((float)Screen.height * 0.045f), 14, 72); int num15 = 16; int num16 = 12; float maxAllowedHeight2 = (float)Screen.height - 60f; int num17 = GetFittingFontSize(text, val10, num14, maxSize2, num15, maxAllowedHeight2); num17 = (val12.fontSize = (val10.fontSize = Mathf.Max(num15, num17 + 4))); float num20 = val10.CalcHeight(new GUIContent(text), num14); float maxAllowedHeight3 = Mathf.Max(60f, (float)Screen.height - num20 - 80f); int num21 = GetFittingFontSize(text2, val11, num14, maxSize3, num16, maxAllowedHeight3); num21 = (val11.fontSize = Mathf.Max(num16, num21 + 4)); val13.fontSize = num21; float num23 = val11.CalcHeight(new GUIContent(text2), num14); float num24 = Mathf.Clamp(Mathf.RoundToInt((float)num17 * 0.25f), 4, 14); float num25 = num20 + num24 + num23; Rect val14 = default(Rect); ((Rect)(ref val14))..ctor(num12 - num14 * 0.5f, num13 - num25 * 0.5f, num14, num25); Rect val15 = default(Rect); ((Rect)(ref val15))..ctor(((Rect)(ref val14)).x, ((Rect)(ref val14)).y, ((Rect)(ref val14)).width, num20); Rect val16 = default(Rect); ((Rect)(ref val16))..ctor(((Rect)(ref val14)).x, ((Rect)(ref val14)).y + num20 + num24, ((Rect)(ref val14)).width, num23); float num26 = Mathf.Clamp((float)Screen.height * 0.0025f, 1f, 3f); GUI.Label(new Rect(((Rect)(ref val15)).x - num26, ((Rect)(ref val15)).y, ((Rect)(ref val15)).width, ((Rect)(ref val15)).height), text, val12); GUI.Label(new Rect(((Rect)(ref val15)).x + num26, ((Rect)(ref val15)).y, ((Rect)(ref val15)).width, ((Rect)(ref val15)).height), text, val12); GUI.Label(new Rect(((Rect)(ref val15)).x, ((Rect)(ref val15)).y - num26, ((Rect)(ref val15)).width, ((Rect)(ref val15)).height), text, val12); GUI.Label(new Rect(((Rect)(ref val15)).x, ((Rect)(ref val15)).y + num26, ((Rect)(ref val15)).width, ((Rect)(ref val15)).height), text, val12); GUI.Label(new Rect(((Rect)(ref val16)).x - num26, ((Rect)(ref val16)).y, ((Rect)(ref val16)).width, ((Rect)(ref val16)).height), text2, val13); GUI.Label(new Rect(((Rect)(ref val16)).x + num26, ((Rect)(ref val16)).y, ((Rect)(ref val16)).width, ((Rect)(ref val16)).height), text2, val13); GUI.Label(new Rect(((Rect)(ref val16)).x, ((Rect)(ref val16)).y - num26, ((Rect)(ref val16)).width, ((Rect)(ref val16)).height), text2, val13); GUI.Label(new Rect(((Rect)(ref val16)).x, ((Rect)(ref val16)).y + num26, ((Rect)(ref val16)).width, ((Rect)(ref val16)).height), text2, val13); GUIStyle val17 = new GUIStyle(val10); val17.normal.textColor = new Color(0f, 0.384f, 1f); GUIStyle val18 = new GUIStyle(val11); val18.normal.textColor = new Color(0f, 0.384f, 1f); GUI.Label(val15, text, val17); GUI.Label(val16, text2, val18); } static int GetFittingFontSize(string s, GUIStyle style, float width, int maxSize, int minSize, float maxAllowedHeight) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown for (int num27 = maxSize; num27 >= minSize; num27--) { style.fontSize = num27; float num28 = style.CalcHeight(new GUIContent(s), width); if (num28 <= maxAllowedHeight) { return num27; } } return minSize; } } public void InitializeMageDisplay() { if (isMage) { if ((Object)(object)ManaHelper.val2 != (Object)null) { Object.Destroy((Object)(object)ManaHelper.val2); ManaHelper.val2 = null; ManaHelper.manaUI = null; } lastManaPosition = !NuageRolesPlugin.Settings.MageTopManaTop; UpdateManaDisplay(); if (!NuageRolesPlugin.Settings.MageTopManaTop && (Object)(object)ManaHelper.manaUI != (Object)null) { ManaHelper.manaUI.SetMana(aviableMana, GetMageMaxMana()); } } } public static void ResetManaUI() { if ((Object)(object)ManaHelper.val2 != (Object)null) { Object.Destroy((Object)(object)ManaHelper.val2); ManaHelper.val2 = null; } ManaHelper.manaUI = null; } public void UpdateManaDisplay() { if (isMage) { if ((Object)(object)ManaHelper.val2 == (Object)null) { ManaHelper.CreateUI(); } if (NuageRolesPlugin.Settings.MageTopManaTop) { ManaHelper.ShowUI(show: false); return; } ManaHelper.ShowUI(show: true); ManaHelper.UpdateManaValue(); } } private void updateMana() { if (isMage && !NuageRolesPlugin.Settings.MageTopManaTop) { ManaHelper.UpdateManaValue(); } } private float CurrentOverchargeMultiplier() { if (!isOvercharged) { return 1f; } return GetMageOverchargeMultiplier(); } private static bool IsUnityNull(Object? value) { return value == (Object)null; } private static PlayerHealth? GetLocalPlayerHealth() { PlayerAvatar instance = PlayerAvatar.instance; if (IsUnityNull((Object?)(object)instance)) { return null; } return instance.playerHealth; } private PlayerAvatar? GetGrabbedMageHealTarget() { PlayerAvatar instance = PlayerAvatar.instance; if (IsUnityNull((Object?)(object)instance)) { return null; } PhysGrabber val = instance?.physGrabber; if (IsUnityNull((Object?)(object)val) || !val.grabbed) { return null; } StaticGrabObject grabbedStaticGrabObject = val.grabbedStaticGrabObject; if (IsUnityNull((Object?)(object)grabbedStaticGrabObject)) { return null; } foreach (PlayerAvatar item in SemiFunc.PlayerGetAll()) { if (IsUnityNull((Object?)(object)item) || (Object)(object)item == (Object)(object)instance) { continue; } PlayerHealthGrab healthGrab = item.healthGrab; if (!IsUnityNull((Object?)(object)healthGrab)) { StaticGrabObject staticGrabObject = healthGrab.staticGrabObject; if (!IsUnityNull((Object?)(object)staticGrabObject) && (Object)(object)staticGrabObject == (Object)(object)grabbedStaticGrabObject) { return item; } } } return null; } private bool CanReceiveMageHeal(PlayerHealth? playerHealth) { if (!IsUnityNull((Object?)(object)playerHealth) && playerHealth.health > 0) { return playerHealth.health < playerHealth.maxHealth; } return false; } private bool TryCastMageHeal(PlayerHealth? playerHealth, bool healingAlly) { if (aviableMana < 1 || !CanReceiveMageHeal(playerHealth)) { return false; } int num = Mathf.Max(0, playerHealth.maxHealth - playerHealth.health); int num2 = Mathf.Min(num, Mathf.CeilToInt((float)GetMageHealAmount() * CurrentOverchargeMultiplier())); if (num2 <= 0) { return false; } if (healingAlly) { playerHealth.HealOther(num2, true); PlayerAvatar instance = PlayerAvatar.instance; if (!IsUnityNull((Object?)(object)instance)) { instance.HealedOther(); } SpendMageMana(1, "Healed Ally (-1 Mana)"); return true; } playerHealth.Heal(num2, true); SpendMageMana(1, "Used Heal (-1 Mana)"); return true; } private void SpendMageMana(int amount, string usageText) { aviableMana = Mathf.Max(0, aviableMana - amount); showManaUsage = true; manaUsageTicker = 0; manaUsageText = usageText; UpdateManaDisplay(); } private void RestoreMageSpeedBoost() { if (speedActive) { if ((Object)(object)PlayerController.instance != (Object)null) { PlayerController.instance.CrouchSpeed = crouchSpeedBefore; PlayerController.instance.MoveSpeed = moveSpeedBefore; PlayerController.instance.SprintSpeed = sprintSpeedBefore; } speedActive = false; speedRemainingSeconds = 0f; } } private void RestoreMageJumpBoost() { if (jumpActive) { if ((Object)(object)PlayerController.instance != (Object)null) { PlayerController.instance.JumpForce = jumpOriginal; } jumpActive = false; jumpRemainingSeconds = 0f; } } public void ClearMageTemporaryEffects() { RestoreMageSpeedBoost(); RestoreMageJumpBoost(); isOvercharged = false; overchargeRemainingSeconds = 0f; showSpells = false; } private void Update() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) PlayerHealth localPlayerHealth = GetLocalPlayerHealth(); int num = ((!IsUnityNull((Object?)(object)localPlayerHealth)) ? localPlayerHealth.health : 0); if (isMage && lastManaPosition != NuageRolesPlugin.Settings.MageTopManaTop) { UpdateManaDisplay(); lastManaPosition = NuageRolesPlugin.Settings.MageTopManaTop; } if (SemiFunc.RunIsLevel() && num <= 0) { isDead = true; } if (!SemiFunc.RunIsLevel()) { isMage = false; if (Sender.manager != null && (Object)PlayerAvatar.instance != (Object)null) { Sender.manager.setReaperStatus(PlayerController.instance.playerSteamID, isReaper: false); } ClassManager.isTank = false; isDead = false; } if (!NuageRolesPlugin.Settings.AfterDeathNewRole) { isDead = false; } if (isDead && num > 0 && NuageRolesPlugin.Settings.AfterDeathNewRole) { if (Sender.manager != null) { Sender.manager.assignRoleFromConfig(PlayerController.instance); NuageRolesPlugin.Logger.LogInfo((object)"Assigning new role on respawn!"); } isDead = false; } if (Input.GetKeyDown(NuageRolesPlugin.Settings.ToggleKey.Value) && !ChatManager.instance.chatActive) { showGUI = !showGUI; } if (num > 0 && isMage && !ChatManager.instance.chatActive) { if (Input.GetKeyDown(NuageRolesPlugin.Settings.ShowSpellsKey.Value)) { showSpells = !showSpells; } if (Input.GetKeyDown(NuageRolesPlugin.Settings.HealKey.Value)) { PlayerAvatar grabbedMageHealTarget = GetGrabbedMageHealTarget(); if (IsUnityNull((Object?)(object)grabbedMageHealTarget) || !TryCastMageHeal(grabbedMageHealTarget.playerHealth, healingAlly: true)) { TryCastMageHeal(localPlayerHealth, healingAlly: false); } } if (Input.GetKeyDown(NuageRolesPlugin.Settings.SpeedKey.Value) && !speedActive) { crouchSpeedBefore = PlayerController.instance.CrouchSpeed; moveSpeedBefore = PlayerController.instance.MoveSpeed; sprintSpeedBefore = PlayerController.instance.SprintSpeed; if (aviableMana >= 2) { speedActive = true; float mageSpeedMultiplier = GetMageSpeedMultiplier(); PlayerController.instance.CrouchSpeed = crouchSpeedBefore * mageSpeedMultiplier; PlayerController.instance.MoveSpeed = moveSpeedBefore * mageSpeedMultiplier; PlayerController.instance.SprintSpeed = sprintSpeedBefore * mageSpeedMultiplier; speedRemainingSeconds = GetMageSpeedBoostDurationSeconds() * CurrentOverchargeMultiplier(); SpendMageMana(2, "Used Speed (-2 Mana)"); } } if (Input.GetKeyDown(NuageRolesPlugin.Settings.OverchargeKey.Value) && !isOvercharged && aviableMana >= 3) { isOvercharged = true; overchargeRemainingSeconds = GetMageOverchargeDurationSeconds(); SpendMageMana(3, "Used Overcharge (-3 Mana)"); } if (Input.GetKeyDown(NuageRolesPlugin.Settings.JumpKey.Value) && !jumpActive) { jumpOriginal = PlayerController.instance.JumpForce; if (aviableMana >= 2) { jumpActive = true; PlayerController.instance.JumpForce = jumpOriginal + GetMageJumpForceBonus(); jumpRemainingSeconds = GetMageJumpBoostDurationSeconds() * CurrentOverchargeMultiplier(); SpendMageMana(2, "Used Jump Boost (-2 Mana)"); } } if (Input.GetKeyDown(NuageRolesPlugin.Settings.StaminaKey.Value) && PlayerController.instance.EnergyCurrent < PlayerController.instance.EnergyStart && aviableMana >= 3) { PlayerController.instance.EnergyCurrent = PlayerController.instance.EnergyStart; SpendMageMana(3, "Used Stamina Refill (-3 Mana)"); } } if (speedActive) { speedRemainingSeconds -= Time.deltaTime; if (speedRemainingSeconds <= 0f) { RestoreMageSpeedBoost(); } } if (jumpActive) { jumpRemainingSeconds -= Time.deltaTime; if (jumpRemainingSeconds <= 0f) { RestoreMageJumpBoost(); } } if (isOvercharged) { overchargeRemainingSeconds -= Time.deltaTime; if (overchargeRemainingSeconds <= 0f) { isOvercharged = false; } } if (!isMage && (Object)(object)ManaHelper.val2 != (Object)null) { Object.Destroy((Object)(object)ManaHelper.val2); ManaHelper.val2 = null; ManaHelper.manaUI = null; } } private void setHealth(string steamID, int maxHealth, int health) { if (!SemiFunc.IsMultiplayer()) { PlayerAvatar.instance.playerHealth.health = health; PlayerAvatar.instance.playerHealth.maxHealth = maxHealth; return; } PunManager.instance.photonView.RPC("setHealthRPC", (RpcTarget)0, new object[3] { steamID, maxHealth, health }); } private void FixedUpdate() { int num = SecondsToFixedTicks(NuageRolesPlugin.Settings.TankPassiveRegenIntervalSeconds.Value); if (passiveTankRegenTicker < num && ClassManager.isTank && SemiFunc.RunIsLevel() && !SemiFunc.RunIsShop() && !isDead) { passiveTankRegenTicker++; } if (passiveTankRegenTicker >= num && SemiFunc.RunIsLevel() && !SemiFunc.RunIsShop() && ClassManager.isTank) { passiveTankRegenTicker = 0; int num2 = (int)AccessTools.Field(typeof(PlayerHealth), "maxHealth").GetValue(PlayerAvatar.instance.playerHealth); int num3 = (int)AccessTools.Field(typeof(PlayerHealth), "health").GetValue(PlayerAvatar.instance.playerHealth); int num4 = Mathf.Max(0, NuageRolesPlugin.Settings.TankPassiveRegenAmount.Value); if (num3 < num2 && num4 > 0) { setHealth(PlayerController.instance.playerSteamID, num2, Mathf.Min(num2, num3 + num4)); } } manaUsageTicker++; if (manaUsageTicker >= 420) { showManaUsage = false; } int mageMaxMana = GetMageMaxMana(); if (isMage && aviableMana > mageMaxMana) { aviableMana = mageMaxMana; UpdateManaDisplay(); } if (aviableMana < mageMaxMana) { manaTicks++; } if (manaTicks >= 1300 - manaRegenRate * 120 && isMage && aviableMana < mageMaxMana) { aviableMana++; manaTicks = 0; UpdateManaDisplay(); } } } public class HealthManager : MonoBehaviour { internal PhotonView photonView; private void Start() { photonView = ((Component)this).GetComponent(); } [PunRPC] internal void setHealthRPC(string steamID, int maxHealth, int health) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(steamID); if ((Object)(object)val != (Object)null) { val.playerHealth.maxHealth = maxHealth; val.playerHealth.health = health; } } } public class ManaHelper : MonoBehaviour { public static GameObject? val; public static GameObject? val2; public static ManaUI? manaUI; public static void CreateUI() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ManaHelper.val2 != (Object)null) { return; } GameObject val = GameObject.Find("Energy"); if ((Object)(object)val == (Object)null) { NuageRolesPlugin.Logger.LogError((object)"Could not find base 'Energy' UI. Mana UI cannot be created."); return; } ManaHelper.val = val; ManaHelper.val2 = Object.Instantiate(val, val.transform.parent); if ((Object)(object)ManaHelper.val2 == (Object)null) { NuageRolesPlugin.Logger.LogError((object)"Failed to instantiate Mana UI."); return; } ((Object)ManaHelper.val2).name = "Mana"; Transform transform = ManaHelper.val2.transform; transform.localPosition -= new Vector3(0f, 33f, 0f); RemoveProblematicComponents(ManaHelper.val2); TextMeshProUGUI[] componentsInChildren = ManaHelper.val2.GetComponentsInChildren(true); foreach (TextMeshProUGUI val2 in componentsInChildren) { if ((Object)(object)val2 != (Object)null) { ((Graphic)val2).color = new Color(0f, 0.384f, 1f); } } SetManaIcon(ManaHelper.val2); manaUI = ManaHelper.val2.AddComponent(); ManaHelper.val2.SetActive(false); NuageRolesPlugin.Logger.LogInfo((object)"Mana UI created successfully"); } private static void RemoveProblematicComponents(GameObject uiObject) { EnergyUI component = uiObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } SemiUI component2 = uiObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component2); } } private static void SetManaIcon(GameObject uiObject) { //IL_0029: 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_005c: Unknown result type (might be due to invalid IL or missing references) Texture2D manaTexture = guiManager.manaTexture; if (!((Object)(object)manaTexture == (Object)null)) { Sprite sprite = Sprite.Create(manaTexture, new Rect(0f, 0f, (float)((Texture)manaTexture).width, (float)((Texture)manaTexture).height), new Vector2(0.5f, 0.5f)); Image componentInChildren = uiObject.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.sprite = sprite; ((Graphic)componentInChildren).color = Color.white; } } } public static void ShowUI(bool show) { if ((Object)(object)val2 != (Object)null) { val2.SetActive(show); } } public static void UpdateManaValue() { if ((Object)(object)manaUI != (Object)null && guiManager.isMage) { manaUI.SetMana(guiManager.aviableMana, guiManager.GetMageMaxMana()); } } } public class ManaUI : MonoBehaviour { public TextMeshProUGUI? textMana; public TextMeshProUGUI? textManaMax; public static ManaUI? instance; private RectTransform? rectTransform; private Image? manaImage; private void Start() { instance = this; rectTransform = ((Component)this).GetComponent(); textMana = ((Component)this).GetComponentInChildren(); Transform val = ((Component)this).transform.Find("EnergyMax"); if ((Object)(object)val != (Object)null) { textManaMax = ((Component)val).GetComponent(); } else { TextMeshProUGUI[] componentsInChildren = ((Component)this).GetComponentsInChildren(); if (componentsInChildren.Length > 1) { textManaMax = componentsInChildren[1]; } } manaImage = ((Component)this).GetComponentInChildren(); if (guiManager.isMage) { SetMana(guiManager.aviableMana, guiManager.GetMageMaxMana()); } NuageRolesPlugin.Logger.LogInfo((object)"ManaUI initialized successfully"); } private void Update() { if (guiManager.isMage && (Object)(object)textMana != (Object)null) { SetMana(guiManager.aviableMana, guiManager.GetMageMaxMana()); } } public void SetMana(float mana, float maxMana) { if ((Object)(object)textMana == (Object)null || (Object)(object)textManaMax == (Object)null) { textMana = ((Component)this).GetComponentInChildren(); Transform val = ((Component)this).transform.Find("EnergyMax"); if ((Object)(object)val != (Object)null) { textManaMax = ((Component)val).GetComponent(); } } if ((Object)(object)textMana != (Object)null) { ((TMP_Text)textMana).text = Mathf.Ceil(mana).ToString(); } if ((Object)(object)textManaMax != (Object)null) { ((TMP_Text)textManaMax).text = $"/{Mathf.Ceil(maxMana)}"; } } } [HarmonyPatch(typeof(ShopManager))] public static class ShopManagerPatch { [HarmonyPatch("GetAllItemsFromStatsManager")] [HarmonyPostfix] private static void GetAllItemsFromStatsManagerPostfix(ShopManager __instance) { try { if (!SemiFunc.IsMultiplayer() || SemiFunc.IsMasterClientOrSingleplayer()) { List allValidUpgrades = GetAllValidUpgrades(__instance); FilterAndMaintainUpgradeCount(__instance.potentialItemUpgrades, allValidUpgrades); __instance.potentialItems.RemoveAll((Item item) => (Object)(object)item != (Object)null && item.itemName != null && IsDisabledUpgrade(item)); } } catch (Exception arg) { NuageRolesPlugin.Logger.LogError((object)$"Error in ShopManager patch: {arg}"); } } private static List GetAllValidUpgrades(ShopManager shopManager) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 List list = new List(); foreach (Item item in shopManager.potentialItems.Concat(shopManager.potentialItemUpgrades)) { if (!((Object)(object)item == (Object)null) && item.itemName != null && (int)item.itemType == 3 && !IsDisabledUpgrade(item)) { list.Add(item); } } return list.Distinct().ToList(); } private static void FilterAndMaintainUpgradeCount(List upgradeList, List validUpgradesPool) { if (upgradeList == null) { return; } List list = new List(); foreach (Item upgrade in upgradeList) { if ((Object)(object)upgrade == (Object)null || upgrade.itemName == null) { list.Add(upgrade); } else if (IsDisabledUpgrade(upgrade)) { if (validUpgradesPool.Count > 0) { int index = Random.Range(0, validUpgradesPool.Count); list.Add(validUpgradesPool[index]); NuageRolesPlugin.Logger.LogInfo((object)("Replaced " + upgrade.itemName + " with " + validUpgradesPool[index].itemName)); } } else { list.Add(upgrade); } } upgradeList.Clear(); upgradeList.AddRange(list); } private static bool IsDisabledUpgrade(Item item) { if ((Object)(object)item == (Object)null || item.itemName == null) { return false; } bool flag = item.itemName.Contains("Mana Regeneration Upgrade"); bool flag2 = item.itemName.Contains("Scout Cooldown Upgrade"); if (!flag && !flag2) { return false; } if (!NuageRolesPlugin.Settings.EnableRoleUpgrades.Value) { return true; } if (flag && !NuageRolesPlugin.Settings.EnableMage.Value) { return true; } if (flag2 && !NuageRolesPlugin.Settings.EnableScout.Value) { return true; } return false; } } [HarmonyPatch(typeof(StatsManager))] [HarmonyAfter(new string[] { "REPOLib" })] internal static class StatsManagerPatch { [HarmonyPrefix] [HarmonyPatch("Start")] private static void StatsPrefix(StatsManager __instance) { if (!__instance.dictionaryOfDictionaries.ContainsKey("playerUpgradeManaRegeneration")) { __instance.dictionaryOfDictionaries.Add("playerUpgradeManaRegeneration", new Dictionary()); } if (!__instance.dictionaryOfDictionaries.ContainsKey("playerUpgradeScoutCooldownReduction")) { __instance.dictionaryOfDictionaries.Add("playerUpgradeScoutCooldownReduction", new Dictionary()); } } [HarmonyPostfix] [HarmonyPatch("RunStartStats")] private static void RunStartStatsPostfix() { NuageRolesPlugin.AttachRegisteredUpgradeDictionaries(); } } public class StrengthManager : MonoBehaviour { internal PhotonView photonView; private void Start() { photonView = ((Component)this).GetComponent(); } [PunRPC] internal void setStrengthRPC(string steamID, float newStrength) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(steamID); if ((Object)(object)val != (Object)null) { val.physGrabber.grabStrength = newStrength; } } } public static class Upgrader { public static void UpdateStat(int amount, string steamId, string stat) { SetStat(GetStat(steamId, stat) + amount, steamId, stat); } public static void SetStat(int level, string steamId, string stat) { if (!string.IsNullOrEmpty(steamId)) { Dictionary orCreateDictionary = GetOrCreateDictionary(stat); if (orCreateDictionary != null) { orCreateDictionary[steamId] = Math.Max(0, level); } } } public static int GetStat(string steamId, string upgradeName) { if (string.IsNullOrEmpty(steamId)) { return 0; } Dictionary orCreateDictionary = GetOrCreateDictionary(upgradeName); if (orCreateDictionary == null || !orCreateDictionary.TryGetValue(steamId, out var value)) { return 0; } return value; } private static Dictionary? GetOrCreateDictionary(string stat) { if ((Object)(object)StatsManager.instance == (Object)null) { return null; } if (!StatsManager.instance.dictionaryOfDictionaries.TryGetValue(stat, out var value)) { value = new Dictionary(); StatsManager.instance.dictionaryOfDictionaries.Add(stat, value); } return value; } } }