using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using On.RoR2; using RoR2; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("KillBossChargeTeleporter")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+dfc66104f93dd00e44143982e1cbd2b23615a36d")] [assembly: AssemblyProduct("KillBossChargeTeleporter")] [assembly: AssemblyTitle("KillBossChargeTeleporter")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace KillBossChargeTeleporter { [BepInPlugin("Phreel.KillBossChargeTeleporterFork", "KillBossChargeTeleporterFork", "1.1.2")] public class KillBossChargeTeleporter : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_UpdateMonstersClear <>9__4_0; internal void b__4_0(orig_UpdateMonstersClear orig, TeleporterInteraction self) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)self) && self.monstersCleared && Object.op_Implicit((Object)(object)self.holdoutZoneController) && (int)self.activationState == 2 && !(self.chargeFraction <= 0.02f)) { HoldoutZoneController holdoutZoneController = self.holdoutZoneController; int displayChargePercent = holdoutZoneController.displayChargePercent; float runStopwatch = Run.instance.GetRunStopwatch(); GetTotalItemCountFromTeamArgs val = default(GetTotalItemCountFromTeamArgs); ((GetTotalItemCountFromTeamArgs)(ref val))..ctor(Items.FocusConvergence.itemIndex); val.requiresAlive = true; val.requiredTeam = holdoutZoneController.chargingTeam; val.requiresConnected = true; int num = Math.Min(Util.GetTotalItemCountFromTeam(val), 3); float num2 = (float)Math.Round((100.0 - (double)displayChargePercent) / 100.0 * ((double)holdoutZoneController.baseChargeDuration / (1.0 + 0.300000011920929 * (double)num)), 2); if (Object.op_Implicit((Object)(object)self.bonusDirector) && self.bonusDirector.moneyWaves != null) { GrantWouldBeRewards(num2, self.bonusDirector, self); } Run.instance.SetRunStopwatch(runStopwatch + num2); holdoutZoneController.FullyChargeHoldoutZone(); } } } public const string PluginGUID = "Phreel.KillBossChargeTeleporterFork"; public const string PluginAuthor = "Phreel"; public const string PluginName = "KillBossChargeTeleporterFork"; public const string PluginVersion = "1.1.2"; public void Awake() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); try { object obj = <>c.<>9__4_0; if (obj == null) { hook_UpdateMonstersClear val = delegate(orig_UpdateMonstersClear orig, TeleporterInteraction self) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)self) && self.monstersCleared && Object.op_Implicit((Object)(object)self.holdoutZoneController) && (int)self.activationState == 2 && !(self.chargeFraction <= 0.02f)) { HoldoutZoneController holdoutZoneController = self.holdoutZoneController; int displayChargePercent = holdoutZoneController.displayChargePercent; float runStopwatch = Run.instance.GetRunStopwatch(); GetTotalItemCountFromTeamArgs val2 = default(GetTotalItemCountFromTeamArgs); ((GetTotalItemCountFromTeamArgs)(ref val2))..ctor(Items.FocusConvergence.itemIndex); val2.requiresAlive = true; val2.requiredTeam = holdoutZoneController.chargingTeam; val2.requiresConnected = true; int num = Math.Min(Util.GetTotalItemCountFromTeam(val2), 3); float num2 = (float)Math.Round((100.0 - (double)displayChargePercent) / 100.0 * ((double)holdoutZoneController.baseChargeDuration / (1.0 + 0.300000011920929 * (double)num)), 2); if (Object.op_Implicit((Object)(object)self.bonusDirector) && self.bonusDirector.moneyWaves != null) { GrantWouldBeRewards(num2, self.bonusDirector, self); } Run.instance.SetRunStopwatch(runStopwatch + num2); holdoutZoneController.FullyChargeHoldoutZone(); } }; <>c.<>9__4_0 = val; obj = (object)val; } TeleporterInteraction.UpdateMonstersClear += (hook_UpdateMonstersClear)obj; } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void GrantWouldBeRewards(float timeRemaining, CombatDirector combatDirector, TeleporterInteraction tpInteraction) { //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Invalid comparison between Unknown and I4 //IL_01d7: Unknown result type (might be due to invalid IL or missing references) float num = combatDirector.monsterCredit; for (int i = 0; i < combatDirector.moneyWaves.Length; i++) { num += combatDirector.moneyWaves[i].Update(timeRemaining, Run.instance.compensatedDifficultyCoefficient); while (combatDirector.moneyWaves[i].timer > combatDirector.moneyWaves[i].interval) { num += combatDirector.moneyWaves[i].Update(0f, Run.instance.compensatedDifficultyCoefficient); } } float num2 = num * combatDirector.expRewardCoefficient; if (!((double)num2 > (double)Mathf.Epsilon)) { return; } uint num3 = (uint)Mathf.Max(1f, num2 * Run.instance.compensatedDifficultyCoefficient); float num4 = (float)(1.0 + ((double)Run.instance.ambientLevel - 1.0) * 0.300000011920929); CharacterBody val = null; foreach (PlayerCharacterMasterController item in PlayerCharacterMasterController._instancesReadOnly) { if ((Object)(object)item.body != (Object)null) { val = item.body; break; } } if ((Object)(object)val == (Object)null) { Log.LogError("No player bodies found!"); return; } ExperienceManager.instance.AwardExperience(tpInteraction.teleporterPositionIndicator.defaultPosition, val, (ulong)(uint)((double)num3 * (double)num4)); uint num5 = (uint)Mathf.Max(1f, (float)((double)num2 * (double)combatDirector.goldRewardCoefficient * 2.0) * Run.instance.compensatedDifficultyCoefficient); if ((int)Run.instance.selectedDifficulty >= 8) { num5 = (uint)((double)num5 * 0.800000011920929); } TeamManager.instance.GiveTeamMoney(tpInteraction.holdoutZoneController.chargingTeam, num5, false); } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void LogDebug(object data) { _logSource.LogDebug(data); } internal static void LogError(object data) { _logSource.LogError(data); } internal static void LogFatal(object data) { _logSource.LogFatal(data); } internal static void LogInfo(object data) { _logSource.LogInfo(data); } internal static void LogMessage(object data) { _logSource.LogMessage(data); } internal static void LogWarning(object data) { _logSource.LogWarning(data); } } }