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.Bootstrap; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using On.RoR2; using RoR2; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ComboSystem")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ComboSystem")] [assembly: AssemblyTitle("ComboSystem")] [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 ComboSystem { [BepInPlugin("dileppy.combosystem", "ComboSystem", "1.0.0")] public class ComboSystemPlugin : BaseUnityPlugin { public const string PluginGUID = "dileppy.combosystem"; public const string PluginName = "ComboSystem"; public const string PluginVersion = "1.0.0"; public static ConfigEntry EnableKaijuRun; public static ConfigEntry EnableDavidVsGoliath; public static ConfigEntry AnnounceCombos; public static ConfigEntry DebugLogging; private static bool kaijuActive; private static bool dvgActive; private void Awake() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown EnableKaijuRun = ((BaseUnityPlugin)this).Config.Bind("Combos", "EnableKaijuRun", true, "EnlargedSurvivor + ShrunkenEnemies: KAIJU RUN. Your giant gains +20 armor - the swarm can barely stagger you."); EnableDavidVsGoliath = ((BaseUnityPlugin)this).Config.Bind("Combos", "EnableDavidVsGoliath", true, "ShrunkenSurvivor + EnlargedEnemies: DAVID VS GOLIATH. Felled giants drop +25% extra gold."); AnnounceCombos = ((BaseUnityPlugin)this).Config.Bind("Combos", "AnnounceCombos", true, "Announce active combos in chat at run start."); DebugLogging = ((BaseUnityPlugin)this).Config.Bind("Advanced", "DebugLogging", false, "Log combo detection."); CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); DeathRewards.OnKilledServer += new hook_OnKilledServer(DeathRewards_OnKilledServer); Run.onRunStartGlobal += OnRunStart; ((BaseUnityPlugin)this).Logger.LogInfo((object)"ComboSystem v1.0.0 loaded. Part of The Petrichor Protocol."); } private void Start() { kaijuActive = EnableKaijuRun.Value && Has("dileppy.enlargedsurvivor") && Has("dileppy.shrunkenenemies"); dvgActive = EnableDavidVsGoliath.Value && Has("dileppy.shrunkensurvivor") && Has("dileppy.enlargedenemies"); if (DebugLogging.Value) { ((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("{0}: KaijuRun={1} DavidVsGoliath={2}", "ComboSystem", kaijuActive, dvgActive)); } static bool Has(string guid) { return Chainloader.PluginInfos.ContainsKey(guid); } } private void OnDestroy() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown CharacterBody.RecalculateStats -= new hook_RecalculateStats(CharacterBody_RecalculateStats); DeathRewards.OnKilledServer -= new hook_OnKilledServer(DeathRewards_OnKilledServer); Run.onRunStartGlobal -= OnRunStart; } private void OnRunStart(Run run) { if (AnnounceCombos.Value) { if (kaijuActive) { Chat.AddMessage("COMBO ACTIVATED: Kaiju Run - your giant gains +20 armor."); } if (dvgActive) { Chat.AddMessage("COMBO ACTIVATED: David vs Goliath - felled giants drop +25% gold."); } } } private static bool IsPlayer(CharacterBody body) { if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.master)) { return Object.op_Implicit((Object)(object)body.master.playerCharacterMasterController); } return false; } private static bool IsHostileEnemy(CharacterBody body) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.teamComponent)) { return false; } TeamIndex teamIndex = body.teamComponent.teamIndex; if ((int)teamIndex != 2 && (int)teamIndex != 3) { return (int)teamIndex == 4; } return true; } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (kaijuActive && IsPlayer(self)) { self.armor += 20f; } } private void DeathRewards_OnKilledServer(orig_OnKilledServer orig, DeathRewards self, DamageReport damageReport) { if (dvgActive && (Object)(object)damageReport?.victimBody != (Object)null && IsHostileEnemy(damageReport.victimBody)) { self.goldReward = (uint)((float)self.goldReward * 1.25f); } orig.Invoke(self, damageReport); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ComboSystem"; public const string PLUGIN_NAME = "ComboSystem"; public const string PLUGIN_VERSION = "1.0.0"; } }