using System; using System.Collections; 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 System.Text.RegularExpressions; using AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Bandit2; using EntityStates.Bandit2.Weapon; using EntityStates.Captain.Weapon; using EntityStates.CaptainDefenseMatrixItem; using EntityStates.CaptainSupplyDrop; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using EntityStates.Croco; using EntityStates.Engi.EngiBubbleShield; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Engi.EngiWeapon; using EntityStates.Engi.Mine; using EntityStates.GlobalSkills.LunarNeedle; using EntityStates.Huntress; using EntityStates.Huntress.HuntressWeapon; using EntityStates.Huntress.Weapon; using EntityStates.Loader; using EntityStates.Mage; using EntityStates.Mage.Weapon; using EntityStates.Merc; using EntityStates.Merc.Weapon; using EntityStates.Toolbot; using EntityStates.Treebot; using EntityStates.Treebot.Weapon; using EntityStates.VoidJailer.Weapon; using EntityStates.VoidSurvivor; using EntityStates.VoidSurvivor.Weapon; using IL.EntityStates.Bandit2.Weapon; using IL.EntityStates.Croco; using IL.EntityStates.Engi.EngiWeapon; using IL.EntityStates.Engi.Mine; using IL.RoR2; using MissileRework; using Mono.Cecil.Cil; using MonoMod.Cil; using MoreStats; using On.EntityStates; using On.EntityStates.Bandit2; using On.EntityStates.Bandit2.Weapon; using On.EntityStates.Captain.Weapon; using On.EntityStates.CaptainDefenseMatrixItem; using On.EntityStates.CaptainSupplyDrop; using On.EntityStates.Commando; using On.EntityStates.Commando.CommandoWeapon; using On.EntityStates.Croco; using On.EntityStates.Engi.EngiBubbleShield; using On.EntityStates.Engi.EngiWeapon; using On.EntityStates.Engi.Mine; using On.EntityStates.Huntress; using On.EntityStates.Huntress.HuntressWeapon; using On.EntityStates.Huntress.Weapon; using On.EntityStates.Mage; using On.EntityStates.Mage.Weapon; using On.EntityStates.Merc; using On.EntityStates.Merc.Weapon; using On.EntityStates.Toolbot; using On.EntityStates.Treebot; using On.EntityStates.Treebot.Weapon; using On.EntityStates.VoidSurvivor; using On.EntityStates.VoidSurvivor.Weapon; using On.RoR2; using On.RoR2.Orbs; using On.RoR2.Projectile; using On.RoR2.Skills; using R2API; using R2API.Utils; using RainrotSharedUtils; using RainrotSharedUtils.Components; using RainrotSharedUtils.Shelters; using RainrotSharedUtils.Status; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.Stats; using RoR2.UI; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.GameAssetPathsBetter; using SurvivorTweaks.Components; using SurvivorTweaks.Modules; using SurvivorTweaks.Orbs; using SurvivorTweaks.Skills; using SurvivorTweaks.States.Captain; using SurvivorTweaks.States.Commando; using SurvivorTweaks.States.Huntress; using SurvivorTweaks.States.Loader; using SurvivorTweaks.States.VoidFiend; using SurvivorTweaks.SurvivorTweaks; using SurvivorTweaks.Unlocks; using SwanSongExtended; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; [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 = "")] [assembly: AssemblyCompany("SurvivorTweaks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SurvivorTweaks")] [assembly: AssemblyTitle("SurvivorTweaks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace SurvivorTweaks { internal static class Log { public static bool enableDebugging; internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { enableDebugging = ConfigManager.DualBindToConfig("Swan Song", Config.MyConfig, "Enable Debugging", defaultValue: false, "Enable debug outputs to the log for troubleshooting purposes. Enabling this will slow down the game."); _logSource = logSource; } public static void DebugBreakpoint(string methodName, int breakpointNumber = -1) { string text = "SurvivorTweaks: " + methodName + " IL hook failed!"; if (breakpointNumber >= 0) { text += $" (breakpoint {breakpointNumber})"; } Error(text); } internal static string Combine(params string[] parameters) { string text = "SurvivorTweaks : "; foreach (string text2 in parameters) { text = text + text2 + " : "; } return text; } internal static void Debug(object data) { if (enableDebugging) { _logSource.LogDebug(data); } } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public abstract class SharedBase { public virtual string BASE_TOKEN => TOKEN_PREFIX + TOKEN_IDENTIFIER; public abstract string TOKEN_IDENTIFIER { get; } public abstract string TOKEN_PREFIX { get; } public virtual bool lockEnabled { get; } = false; public abstract string ConfigName { get; } public virtual bool isEnabled { get; } = true; public virtual ConfigFile configFile { get; } = Config.MyConfig; public static ManualLogSource Logger => Log._logSource; public abstract AssetBundle assetBundle { get; } public virtual Type RequiredUnlock { get; } public abstract void Hooks(); public abstract void Lang(); public virtual void Init() { ConfigManager.HandleConfigAttributes(GetType(), ConfigName, configFile); Hooks(); Lang(); } public T Bind(T defaultValue, string configName, string configDesc = "") { return ConfigManager.DualBindToConfig(ConfigName, configFile, configName, defaultValue, configDesc); } public static float GetHyperbolic(float firstStack, float cap, float chance) { if (firstStack >= cap) { return cap * (chance / firstStack); } float num = chance / firstStack; float num2 = 100f * firstStack / (cap - firstStack); return cap * (1f - 100f / (num * num2 + 100f)); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [R2APISubmoduleDependency(new string[] { "LanguageAPI", "PrefabAPI", "RecalculateStatsAPI", "DotAPI" })] [BepInPlugin("com.RiskOfBrainrot.SurvivorTweaks", "SurvivorTweaks", "3.2.6")] public class SurvivorTweaksPlugin : BaseUnityPlugin { public static SurvivorTweaksPlugin instance; public const string guid = "com.RiskOfBrainrot.SurvivorTweaks"; public const string teamName = "RiskOfBrainrot"; public const string modName = "SurvivorTweaks"; public const string version = "3.2.6"; public const string DEVELOPER_PREFIX = "FRUIT"; public static ExpansionDef expansionDefSS2; public const string iconsPath = ""; public static AssetBundle mainAssetBundle => CommonAssets.mainAssetBundle; public static bool iabMissilesLoaded => ModLoaded("com.RiskOfBrainrot.IAmBecomeMissiles"); public static bool isAELoaded => ModLoaded("com.Borbo.ArtificerExtended"); public static bool is2R4RLoaded => ModLoaded("com.HouseOfFruits.RiskierRain"); public static bool isHBULoaded => ModLoaded("com.Borbo.HuntressBuffULTIMATE"); public static bool isScepterLoaded => ModLoaded("com.DestroyedClone.AncientScepter"); public static bool autosprintLoaded => ModLoaded("com.johnedwa.RTAutoSprintEx"); public static bool acridLungeLoaded => ModLoaded("Withor.AcridBiteLunge"); public static bool ucrLoaded => ModLoaded("HIFU.UltimateCustomRun"); public static bool ModLoaded(string modGuid) { return modGuid != "" && Chainloader.PluginInfos.ContainsKey(modGuid); } public static bool IsMissileArtifactEnabled() { if (ModLoaded("com.RiskOfBrainrot.IAmBecomeMissiles")) { return GetMissileArtifactEnabled(); } return false; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool GetMissileArtifactEnabled() { return RunArtifactManager.instance.IsArtifactEnabled(MissileReworkPlugin.MissileArtifact); } private void Awake() { instance = this; Config.Init(); Log.Init(((BaseUnityPlugin)this).Logger); ShockUtilsModule.UseShockSparks = true; Language.Init(); Hooks.Init(); CommonAssets.Init(); InitializeContent(); Config.Save(); new ContentPacks().Initialize(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void SetExpansion() { expansionDefSS2 = SwanSongPlugin.expansionDefSS2; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool GetBodyHasWarfare(CharacterBody body) { return false; } private void InitializeContent() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); BeginInitializing(types, "SurvivorTweaks.txt"); BeginInitializing(types, "SurvivorTweaksSkills.txt"); } private void BeginInitializing(Type[] allTypes, string fileName = "") where T : SharedBase { Type baseType = typeof(T); if (!baseType.IsAbstract) { Log.Error(Log.Combine() + "Incorrect BaseType: " + baseType.Name); return; } IEnumerable enumerable = allTypes.Where((Type type) => !type.IsAbstract && type.IsSubclassOf(baseType)); if (enumerable.Count() <= 0) { return; } Log.Debug(Log.Combine(baseType.Name) + "Initializing"); foreach (Type item in enumerable) { string text = Log.Combine(baseType.Name, item.Name); Log.Debug(text); T obj = (T)Activator.CreateInstance(item); if (ValidateBaseType(obj)) { Log.Debug(text + "Validated"); InitializeBaseType(obj); Log.Debug(text + "Initialized"); } } if (!string.IsNullOrEmpty(fileName)) { Language.TryPrintOutput(fileName); } } private bool ValidateBaseType(SharedBase obj) { bool isEnabled = obj.isEnabled; if (obj.lockEnabled) { return isEnabled; } return obj.Bind(isEnabled, "Should This Content Be Enabled"); } private void InitializeBaseType(SharedBase obj) { obj.Init(); } public static bool GetConfigBool(bool defaultValue, string packetTitle, string desc = "") { return ConfigManager.DualBindToConfig(packetTitle, Config.MyConfig, "Should This Content Be Enabled", defaultValue, desc); } public static SkillDef CloneSkillDef(SkillDef oldDef) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) SkillDef val = ScriptableObject.CreateInstance(); val.skillName = oldDef.skillName; val.skillNameToken = oldDef.skillNameToken; val.skillDescriptionToken = oldDef.skillDescriptionToken; val.icon = oldDef.icon; val.activationStateMachineName = oldDef.activationStateMachineName; val.activationState = oldDef.activationState; val.interruptPriority = oldDef.interruptPriority; val.baseRechargeInterval = oldDef.baseRechargeInterval; val.baseMaxStock = oldDef.baseMaxStock; val.rechargeStock = oldDef.rechargeStock; val.requiredStock = oldDef.requiredStock; val.stockToConsume = oldDef.stockToConsume; val.beginSkillCooldownOnSkillEnd = oldDef.beginSkillCooldownOnSkillEnd; val.fullRestockOnAssign = oldDef.fullRestockOnAssign; val.dontAllowPastMaxStocks = oldDef.dontAllowPastMaxStocks; val.resetCooldownTimerOnUse = oldDef.resetCooldownTimerOnUse; val.isCombatSkill = oldDef.isCombatSkill; val.cancelSprintingOnActivation = oldDef.cancelSprintingOnActivation; val.canceledFromSprinting = oldDef.canceledFromSprinting; val.forceSprintDuringState = oldDef.forceSprintDuringState; val.mustKeyPress = oldDef.mustKeyPress; val.keywordTokens = oldDef.keywordTokens; return val; } public static AssetReferenceT LoadAsync(string guid, Action callback) where T : Object { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) AssetReferenceT val = new AssetReferenceT(guid); AsyncOperationHandle handle = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); if (callback == null) { return val; } if (handle.IsDone) { onCompleted(handle); return val; } handle.Completed += onCompleted; return val; void onCompleted(AsyncOperationHandle val2) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if (val2.Result == null || (int)val2.Status != 1) { Debug.LogError((object)$"Failed to load asset [{val2.DebugName}] : {val2.OperationException}"); } else { callback(val2.Result); } } } } public static class Extensions { public static string AsPercent(this float d) { return d * 100f + "%"; } public static void AddPersistentListener(this ProjectileImpactEvent unityEvent, UnityAction action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } public static void AddPersistentListener(this UnityEvent unityEvent, UnityAction action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } } public static class Tools { public static string modPrefix = string.Format("@{0}+{1}", "ArtificerExtended", "artiskillicons"); public static AssetBundle LoadAssetBundle(byte[] resourceBytes) { if (resourceBytes == null) { throw new ArgumentNullException("resourceBytes"); } return AssetBundle.LoadFromMemory(resourceBytes); } public static string GetModPrefix(this BaseUnityPlugin plugin, string bundleName) { return $"@{plugin.Info.Metadata.Name}+{bundleName}"; } internal static bool isLoaded(string modguid) { foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { string key = pluginInfo.Key; PluginInfo value = pluginInfo.Value; if (key == modguid) { return true; } } return false; } internal static string ConvertDecimal(float d) { return d * 100f + "%"; } internal static void GetMaterial(GameObject model, string childObject, Color color, ref Material material, float scaleMultiplier = 1f, bool replaceAll = false) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_006a: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; if (string.Equals(((Object)val).name, childObject)) { if (color == Color.clear) { Object.Destroy((Object)(object)val); break; } if ((Object)(object)material == (Object)null) { material = new Material(val.material); material.mainTexture = val.material.mainTexture; material.shader = val.material.shader; material.color = color; } val.material = material; Transform transform = ((Component)val).transform; transform.localScale *= scaleMultiplier; if (!replaceAll) { break; } } } } internal static void DebugMaterial(GameObject model) { Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; Debug.Log((object)("Material: " + ((Object)val2).name.ToString())); } } internal static void GetParticle(GameObject model, string childObject, Color color, float sizeMultiplier = 1f, bool replaceAll = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) ParticleSystem[] componentsInChildren = model.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; MainModule main = val2.main; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ColorBySpeedModule colorBySpeed = val2.colorBySpeed; if (string.Equals(((Object)val2).name, childObject)) { ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * sizeMultiplier; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(color); ((ColorBySpeedModule)(ref colorBySpeed)).color = MinMaxGradient.op_Implicit(color); if (!replaceAll) { break; } } } } internal static void DebugParticleSystem(GameObject model) { ParticleSystem[] components = model.GetComponents(); ParticleSystem[] array = components; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; Debug.Log((object)("Particle: " + ((Object)val2).name.ToString())); } } internal static void GetLight(GameObject model, string childObject, Color color, bool replaceAll = false) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) Light[] componentsInChildren = model.GetComponentsInChildren(); Light[] array = componentsInChildren; foreach (Light val in array) { Light val2 = val; if (string.Equals(((Object)val2).name, childObject)) { val2.color = color; if (!replaceAll) { break; } } } } internal static void DebugLight(GameObject model) { Light[] componentsInChildren = model.GetComponentsInChildren(); Light[] array = componentsInChildren; foreach (Light val in array) { Light val2 = val; Debug.Log((object)("Light: " + ((Object)val2).name.ToString())); } } public static void ClearDotStacksForType(this DotController dotController, DotIndex dotIndex) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) for (int num = dotController.dotStackList.Count - 1; num >= 0; num--) { if (dotController.dotStackList[num].dotIndex == dotIndex) { dotController.RemoveDotStackAtServer(num); } } } public static void ApplyCooldownScale(GenericSkill skillSlot, float cooldownScale) { if ((Object)(object)skillSlot != (Object)null) { skillSlot.cooldownScale *= cooldownScale; } } } } namespace SurvivorTweaks.Modules { public static class CommonAssets { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static CustomDotBehaviour <>9__41_0; internal void b__41_0(DotController self, DotStack dotStack) { } } private static AssetBundle _mainAssetBundle; public static string dropPrefabsPath = "Assets/Models/DropPrefabs"; public static string iconsPath = "Assets/Textures/Icons/"; public static string eliteMaterialsPath = "Assets/Textures/Materials/Elite/"; public static BuffDef commandoRollBuff; public static BuffDef jetpackSpeedBoost; public static float jetpackSpeedPercent = 0.15f; public static BuffDef captainCdrBuff; public static float captainCdrPercent = 0.25f; public static BuffDef aspdPenaltyDebuff; public static float aspdPenaltyPercent = 0.25f; public static BuffDef desperadoTokenSurplusBuff; public static BuffDef desperadoExecutionDebuff; public static BuffDef lightsoutExecutionDebuff; public static ModdedDamageType AcridFesterDamage; public static ModdedDamageType AcridCorrosiveDamage; public static BuffDef corrosionBuff; public static DotDef corrosionDotDef; public static DotIndex corrosionDotIndex; public static float contagiousTransferRate = 0.5f; public static int corrosionArmorReduction = 15; public static float corrosionDuration = 8f; public static float corrosionDamagePerSecond = 1f; public static float corrosionTickInterval = 1f; public static bool festerResetOnlyKitDots = true; public const string AcridFesterKeywordToken = "KEYWORD_FESTER"; public const string AcridCorrosionKeywordToken = "KEYWORD_CORROSION"; public const string AcridContagiousKeywordToken = "KEYWORD_CONTAGIOUS"; public static AssetBundle mainAssetBundle { get { if ((Object)(object)_mainAssetBundle == (Object)null) { _mainAssetBundle = Assets.LoadAssetBundle("survivortweaks"); } return _mainAssetBundle; } set { _mainAssetBundle = value; } } public static void Init() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown AddAcridReworkAssets(); AddAspdPenaltyDebuff(); AddCommanderRollBuff(); AddJetpackSpeedBoost(); AddBanditExecutionBuffs(); AddCaptainCooldownBuff(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CommonAssetStats); CharacterBody.RecalculateStats += new hook_RecalculateStats(RecalcStats_Stats); BaseState.AddRecoil += new hook_AddRecoil(OnAddRecoil); CharacterBody.AddSpreadBloom += new hook_AddSpreadBloom(OnAddSpreadBloom); } public static void AddBanditExecutionBuffs() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_005a: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) desperadoTokenSurplusBuff = Content.CreateAndAddBuff("bdDesperadoTokenSurplus", Addressables.LoadAssetAsync((object)RoR2_Base_Bandit2.texBuffBanditSkullIcon_tif).WaitForCompletion(), new Color(0.6f, 0.9f, 0.8f, 1f), canStack: true, isDebuff: false); desperadoExecutionDebuff = Content.CreateAndAddBuff("bdDesperadoExecute", null, Color.black, canStack: false, isDebuff: true); BuffDef obj = desperadoExecutionDebuff; obj.flags = (Flags)(obj.flags | 1); desperadoExecutionDebuff.isHidden = true; lightsoutExecutionDebuff = Content.CreateAndAddBuff("bdLightsOutExecute", null, Color.black, canStack: false, isDebuff: true); BuffDef obj2 = lightsoutExecutionDebuff; obj2.flags = (Flags)(obj2.flags | 1); lightsoutExecutionDebuff.isHidden = true; } public static void OnAddSpreadBloom(orig_AddSpreadBloom orig, CharacterBody self, float value) { if (!self.HasBuff(commandoRollBuff)) { orig.Invoke(self, value); } } public static void OnAddRecoil(orig_AddRecoil orig, BaseState self, float verticalMin, float verticalMax, float horizontalMin, float horizontalMax) { if (!self.HasBuff(commandoRollBuff)) { orig.Invoke(self, verticalMin, verticalMax, horizontalMin, horizontalMax); } } public static void AddCommanderRollBuff() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) commandoRollBuff = Content.CreateAndAddBuff("bdDualieRoll", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texMovespeedBuffIcon.tif").WaitForCompletion(), new Color(0.8f, 0.6f, 0.1f), canStack: false, isDebuff: false); } public static void AddJetpackSpeedBoost() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) jetpackSpeedBoost = Content.CreateAndAddBuff("bdJetpackSpeed", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texMovespeedBuffIcon.tif").WaitForCompletion(), new Color(0.9f, 0.2f, 0.2f), canStack: false, isDebuff: false); } private static void CommonAssetStats(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(aspdPenaltyDebuff)) { args.attackSpeedReductionMultAdd += aspdPenaltyPercent; } if (sender.HasBuff(jetpackSpeedBoost)) { args.moveSpeedMultAdd += jetpackSpeedPercent; } if (sender.HasBuff(captainCdrBuff)) { SkillLocator skillLocator = sender.skillLocator; if ((Object)(object)skillLocator != (Object)null) { float cooldownScale = 1f - captainCdrPercent; ApplyCooldownScale(skillLocator.primary, cooldownScale); ApplyCooldownScale(skillLocator.secondary, cooldownScale); ApplyCooldownScale(skillLocator.utility, cooldownScale); ApplyCooldownScale(skillLocator.special, cooldownScale); } } static void ApplyCooldownScale(GenericSkill skillSlot, float num) { if ((Object)(object)skillSlot != (Object)null) { skillSlot.cooldownScale *= num; } } } public static void RecalcStats_Stats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); } public static void AddAspdPenaltyDebuff() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) aspdPenaltyDebuff = Content.CreateAndAddBuff("bdAttackSpeedPenalty", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffSlow50Icon.tif").WaitForCompletion(), Color.red, canStack: false, isDebuff: false); } public static void AddCaptainCooldownBuff() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) aspdPenaltyDebuff = Content.CreateAndAddBuff("bdCaptainRestock", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texMovespeedBuffIcon.tif").WaitForCompletion(), Color.yellow, canStack: false, isDebuff: false); } private static void AddAcridReworkAssets() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Expected O, but got Unknown //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Expected O, but got Unknown //IL_009f: 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_00aa: Expected O, but got Unknown OrbAPI.AddOrb(); AcridFesterDamage = DamageAPI.ReserveDamageType(); AcridCorrosiveDamage = DamageAPI.ReserveDamageType(); corrosionBuff = Content.CreateAndAddBuff("AcridCorrosion", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffBleedingIcon.tif").WaitForCompletion(), Color.yellow, canStack: true, isDebuff: true); corrosionBuff.isDOT = true; corrosionDotDef = new DotDef { associatedBuff = corrosionBuff, damageCoefficient = corrosionDamagePerSecond * corrosionTickInterval, damageColorIndex = (DamageColorIndex)4, interval = corrosionTickInterval }; DotDef obj = corrosionDotDef; object obj2 = <>c.<>9__41_0; if (obj2 == null) { CustomDotBehaviour val = delegate { }; <>c.<>9__41_0 = val; obj2 = (object)val; } corrosionDotIndex = DotAPI.RegisterDotDef(obj, (CustomDotBehaviour)obj2, (CustomDotVisual)null); LanguageAPI.Add("KEYWORD_FESTER", Language.Styling.KeywordText("Festering", "Striking enemies " + Language.Styling.UtilityColor("resets") + " the duration of all " + Language.Styling.HealingColor("Poison") + ", " + Language.Styling.VoidColor("Blight") + ", and " + Language.Styling.DamageColor("Corrosion") + " stacks.")); LanguageAPI.Add("KEYWORD_CORROSION", Language.Styling.KeywordText("Caustic", "Deal " + Language.Styling.DamageColor(Tools.ConvertDecimal(corrosionDamagePerSecond) + " base damage") + " over " + Language.Styling.UtilityColor($"{corrosionDuration}s") + ". Reduce armor by " + Language.Styling.DamageColor(corrosionArmorReduction.ToString()) + ".")); LanguageAPI.Add("KEYWORD_CONTAGIOUS", Language.Styling.KeywordText("Contagious", "This skill transfers " + Language.Styling.DamageColor(Tools.ConvertDecimal(contagiousTransferRate)) + " of " + Language.Styling.UtilityColor("every damage over time stack") + " to nearby enemies.")); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CorrosionArmorReduction); OnHit.GetHitBehavior += new HitHookEventHandler(FesterOnHit); } private static void CorrosionArmorReduction(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(corrosionBuff)) { args.armorAdd -= (float)corrosionArmorReduction; } } private static void FesterOnHit(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victimBody) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01af: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Invalid comparison between Unknown and I4 //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (DamageAPI.HasModdedDamageType(damageInfo, AcridFesterDamage)) { DotController val = DotController.FindDotController(((Component)victimBody).gameObject); if (Object.op_Implicit((Object)(object)val)) { foreach (DotStack dotStack in val.dotStackList) { if (!festerResetOnlyKitDots || (int)dotStack.dotIndex == 5 || (int)dotStack.dotIndex == 4 || dotStack.dotIndex == corrosionDotIndex) { float num = dotStack.totalDuration * damageInfo.procCoefficient; if (dotStack.timer < num) { dotStack.timer = num; } } } } } if (!DamageAPI.HasModdedDamageType(damageInfo, AcridCorrosiveDamage)) { return; } uint? maxStacksFromAttacker = null; if (Object.op_Implicit((Object)(object)damageInfo?.inflictor)) { ProjectileDamage component = damageInfo.inflictor.GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.useDotMaxStacksFromAttacker) { maxStacksFromAttacker = component.dotMaxStacksFromAttacker; } } InflictDotInfo val2 = new InflictDotInfo { attackerObject = damageInfo.attacker, victimObject = ((Component)victimBody).gameObject, totalDamage = attackerBody.baseDamage * corrosionDamagePerSecond * corrosionDuration * damageInfo.procCoefficient, duration = corrosionDuration * damageInfo.procCoefficient, damageMultiplier = 1f, dotIndex = corrosionDotIndex, maxStacksFromAttacker = maxStacksFromAttacker }; DotController.InflictDot(ref val2); } } public class CustomRendererInfo { public string childName; public Material material = null; public bool dontHotpoo = false; public bool ignoreOverlays = false; } internal static class Assets { internal static Dictionary loadedBundles = new Dictionary(); internal static AssetBundle LoadAssetBundle(string bundleName) { if (loadedBundles.ContainsKey(bundleName)) { return loadedBundles[bundleName]; } AssetBundle val = null; val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)SurvivorTweaksPlugin.instance).Info.Location), bundleName)); loadedBundles[bundleName] = val; return val; } internal static GameObject CloneTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } val.GetComponent().speed = 250f; val.GetComponent().length = 50f; Content.CreateAndAddEffectDef(val); return val; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren(); foreach (MeshRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).sharedMaterial)) { ((Renderer)val).sharedMaterial.ConvertDefaultShaderToHopoo(); } } SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).sharedMaterial)) { ((Renderer)val2).sharedMaterial.ConvertDefaultShaderToHopoo(); } } } internal static GameObject LoadCrosshair(string crosshairName) { GameObject val = LegacyResourcesAPI.Load("Prefabs/Crosshair/" + crosshairName + "Crosshair"); if ((Object)(object)val == (Object)null) { Log.Error("could not load crosshair with the name " + crosshairName + ". defaulting to Standard"); return LegacyResourcesAPI.Load("Prefabs/Crosshair/StandardCrosshair"); } return val; } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, bool parentToTransform) { return assetBundle.LoadEffect(resourceName, "", parentToTransform); } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, string soundName = "", bool parentToTransform = false) { //IL_0046: 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) GameObject val = assetBundle.LoadAsset(resourceName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(resourceName, ((Object)assetBundle).name); return null; } val.AddComponent().duration = 12f; val.AddComponent(); val.AddComponent().vfxPriority = (VFXPriority)2; EffectComponent val2 = val.AddComponent(); val2.applyScale = false; val2.effectIndex = (EffectIndex)(-1); val2.parentToReferencedTransform = parentToTransform; val2.positionAtReferencedTransform = true; val2.soundName = soundName; Content.CreateAndAddEffectDef(val); return val; } internal static GameObject CreateProjectileGhostPrefab(this AssetBundle assetBundle, string ghostName) { GameObject val = assetBundle.LoadAsset(ghostName); if ((Object)(object)val == (Object)null) { Log.Error("Failed to load ghost prefab " + ghostName); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } ConvertAllRenderersToHopooShader(val); return val; } internal static GameObject CreateProjectileGhostPrefab(GameObject ghostObject, string newName) { if ((Object)(object)ghostObject == (Object)null) { Log.Error("Failed to load ghost prefab " + ((Object)ghostObject).name); } GameObject val = PrefabAPI.InstantiateClone(ghostObject, newName); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } return val; } internal static GameObject CloneProjectilePrefab(string prefabName, string newPrefabName) { return PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/" + prefabName), newPrefabName); } internal static GameObject LoadAndAddProjectilePrefab(this AssetBundle assetBundle, string newPrefabName) { GameObject val = assetBundle.LoadAsset(newPrefabName); if ((Object)(object)val == (Object)null) { Log.ErrorAssetBundle(newPrefabName, ((Object)assetBundle).name); return null; } Content.AddProjectilePrefab(val); return val; } } internal static class Materials { private static List cachedMaterials = new List(); internal static Shader hotpoo = LegacyResourcesAPI.Load("Shaders/Deferred/HGStandard"); public static List MaterialsWithSwappedShaders { get; } = new List(); internal static void GetMaterial(GameObject model, string childObject, Color color, ref Material material, float scaleMultiplier = 1f, bool replaceAll = false) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_006a: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; if (string.Equals(((Object)val).name, childObject)) { if (color == Color.clear) { Object.Destroy((Object)(object)val); break; } if ((Object)(object)material == (Object)null) { material = new Material(val.material); material.mainTexture = val.material.mainTexture; material.shader = val.material.shader; material.color = color; } val.material = material; Transform transform = ((Component)val).transform; transform.localScale *= scaleMultiplier; if (!replaceAll) { break; } } } } internal static void DebugMaterial(GameObject model) { Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; Debug.Log((object)("Material: " + ((Object)val2).name.ToString())); } } public static void SwapShadersFromMaterialsInBundle(AssetBundle bundle) { if (bundle.isStreamedSceneAssetBundle) { Debug.LogWarning((object)"Cannot swap material shaders from a streamed scene assetbundle."); return; } Material[] array = (from mat in bundle.LoadAllAssets() where ((Object)mat.shader).name.StartsWith("Stubbed") select mat).ToArray(); foreach (Material val in array) { if (!((Object)val.shader).name.StartsWith("Stubbed")) { Debug.LogWarning((object)$"The material {val} has a shader which's name doesnt start with \"Stubbed\" ({((Object)val.shader).name}), this is not allowed for stubbed shaders for MSU. not swapping shader."); continue; } try { SwapShader(val); } catch (Exception arg) { Debug.LogError((object)$"Failed to swap shader of material {val}: {arg}"); } } } private static void SwapShader(Material material) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) string text = ((Object)material.shader).name.Substring("Stubbed".Length); string text2 = text + ".shader"; Shader shader = Addressables.LoadAssetAsync((object)text2).WaitForCompletion(); material.shader = shader; MaterialsWithSwappedShaders.Add(material); } public static Material LoadMaterial(this AssetBundle assetBundle, string materialName) { return assetBundle.CreateHopooMaterialFromBundle(materialName); } public static Material CreateHopooMaterialFromBundle(this AssetBundle assetBundle, string materialName) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name.Contains(materialName); }); if (Object.op_Implicit((Object)(object)val)) { Log.Debug(((Object)val).name + " has already been loaded. returning cached"); return val; } val = assetBundle.LoadAsset(materialName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(materialName, ((Object)assetBundle).name); return new Material(hotpoo); } return val.ConvertDefaultShaderToHopoo(); } public static Material SetHopooMaterial(this Material tempMat) { return tempMat.ConvertDefaultShaderToHopoo(); } public static Material ConvertDefaultShaderToHopoo(this Material tempMat) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (cachedMaterials.Contains(tempMat)) { Log.Debug(((Object)tempMat).name + " has already been loaded. returning cached"); return tempMat; } float? num = null; Color? val = null; if (tempMat.IsKeywordEnabled("_NORMALMAP")) { num = tempMat.GetFloat("_BumpScale"); } if (tempMat.IsKeywordEnabled("_EMISSION")) { val = tempMat.GetColor("_EmissionColor"); } tempMat.shader = hotpoo; tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); tempMat.SetTexture("_NormalTex", tempMat.GetTexture("_BumpMap")); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (tempMat.IsKeywordEnabled("NOCULL")) { tempMat.SetInt("_Cull", 0); } if (tempMat.IsKeywordEnabled("LIMBREMOVAL")) { tempMat.SetInt("_LimbRemovalOn", 1); } cachedMaterials.Add(tempMat); return tempMat; } public static Material MakeUnique(this Material material) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } public static Material SetSpecular(this Material material, float strength) { material.SetFloat("_SpecularStrength", strength); return material; } public static Material SetSpecular(this Material material, float strength, float exponent) { material.SetFloat("_SpecularStrength", strength); material.SetFloat("SpecularExponent", exponent); return material; } } internal static class Particles { internal static void GetParticle(GameObject model, string childObject, Color color, float sizeMultiplier = 1f, bool replaceAll = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) ParticleSystem[] componentsInChildren = model.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; MainModule main = val2.main; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ColorBySpeedModule colorBySpeed = val2.colorBySpeed; if (string.Equals(((Object)val2).name, childObject)) { ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * sizeMultiplier; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(color); ((ColorBySpeedModule)(ref colorBySpeed)).color = MinMaxGradient.op_Implicit(color); if (!replaceAll) { break; } } } } internal static void DebugParticleSystem(GameObject model) { ParticleSystem[] componentsInChildren = model.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; Debug.Log((object)("Particle: " + ((Object)val2).name.ToString())); } } } internal class Content { internal static void AddExpansionDef(ExpansionDef expansion) { ContentPacks.expansionDefs.Add(expansion); } internal static void AddCharacterBodyPrefab(GameObject bprefab) { ContentPacks.bodyPrefabs.Add(bprefab); } internal static void AddMasterPrefab(GameObject prefab) { ContentPacks.masterPrefabs.Add(prefab); } internal static void AddProjectilePrefab(GameObject prefab) { ContentPacks.projectilePrefabs.Add(prefab); } internal static void AddSurvivorDef(SurvivorDef survivorDef) { ContentPacks.survivorDefs.Add(survivorDef); } internal static void AddItemDef(ItemDef itemDef) { ContentPacks.itemDefs.Add(itemDef); } internal static void AddEliteDef(EliteDef eliteDef) { ContentPacks.eliteDefs.Add(eliteDef); } internal static void AddArtifactDef(ArtifactDef artifactDef) { ContentPacks.artifactDefs.Add(artifactDef); } internal static void AddNetworkedObjectPrefab(GameObject prefab) { ContentPacks.networkedObjectPrefabs.Add(prefab); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) SurvivorDef val = ScriptableObject.CreateInstance(); val.bodyPrefab = bodyPrefab; val.displayPrefab = displayPrefab; val.primaryColor = charColor; val.cachedName = ((Object)bodyPrefab).name.Replace("Body", ""); val.displayNameToken = tokenPrefix + "NAME"; val.descriptionToken = tokenPrefix + "DESCRIPTION"; val.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR"; val.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE"; val.desiredSortPosition = sortPosition; val.unlockableDef = unlockableDef; AddSurvivorDef(val); } internal static void AddUnlockableDef(UnlockableDef unlockableDef) { ContentPacks.unlockableDefs.Add(unlockableDef); } internal static UnlockableDef CreateAndAddUnlockbleDef(string identifier, string nameToken, Sprite achievementIcon) { UnlockableDef val = ScriptableObject.CreateInstance(); val.cachedName = identifier; val.nameToken = nameToken; val.achievementIcon = achievementIcon; AddUnlockableDef(val); return val; } internal static void AddSkillDef(SkillDef skillDef) { ContentPacks.skillDefs.Add(skillDef); } internal static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } internal static void AddEntityState(Type entityState) { ContentPacks.entityStates.Add(entityState); } internal static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } internal static BuffDef CreateAndAddBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; AddBuffDef(val); return val; } internal static void AddEffectDef(EffectDef effectDef) { ContentPacks.effectDefs.Add(effectDef); } internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown EffectDef val = new EffectDef(effectPrefab); AddEffectDef(val); return val; } internal static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } internal static NetworkSoundEventDef CreateAndAddNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; AddNetworkSoundEventDef(val); return val; } } internal static class Skills { public static Dictionary characterSkillLocators = new Dictionary(); public static void CreateSkillFamilies(GameObject targetPrefab) { SkillSlot[] array = new SkillSlot[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); CreateSkillFamilies(targetPrefab, (SkillSlot[])(object)array); } public static void CreateSkillFamilies(GameObject targetPrefab, params SkillSlot[] slots) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); foreach (SkillSlot val in slots) { SkillSlot val2 = val; switch (val2 - -1) { case 1: component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary"); break; case 2: component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary"); break; case 3: component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility"); break; case 4: component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special"); break; } } } public static void ClearGenericSkills(GameObject targetPrefab) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren(); foreach (GenericSkill val in componentsInChildren) { Object.DestroyImmediate((Object)(object)val); } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, SkillSlot skillSlot, bool hidden = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); switch (skillSlot - -1) { case 1: return component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary", hidden); case 2: return component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary", hidden); case 3: return component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility", hidden); case 4: return component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special", hidden); case 0: Log.Error("Failed to create GenericSkill with skillslot None. If making a GenericSkill outside of the main 4, specify a familyName, and optionally a genericSkillName"); return null; default: return null; } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false) { return CreateGenericSkillWithSkillFamily(targetPrefab, familyName, familyName, hidden); } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string genericSkillName, string familyName, bool hidden = false) { GenericSkill val = targetPrefab.AddComponent(); val.skillName = genericSkillName; val.hideInCharacterSelect = hidden; SkillFamily val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = ((Object)targetPrefab).name + familyName + "Family"; val2.variants = (Variant[])(object)new Variant[0]; val._skillFamily = val2; Content.AddSkillFamily(val2); return val; } public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null) { //IL_0029: 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_0053: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef, unlockableDef = unlockableDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static void AddSkillsToFamily(SkillFamily skillFamily, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSkillToFamily(skillFamily, skillDef); } } public static void AddPrimarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().primary.skillFamily, skillDefs); } public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().secondary.skillFamily, skillDefs); } public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().utility.skillFamily, skillDefs); } public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().special.skillFamily, skillDefs); } public static void AddUnlockablesToFamily(SkillFamily skillFamily, params UnlockableDef[] unlockableDefs) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < unlockableDefs.Length; i++) { Variant val = skillFamily.variants[i]; val.unlockableDef = unlockableDefs[i]; skillFamily.variants[i] = val; } } public static Combo ComboFromType(Type t) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return new Combo { activationStateType = new SerializableEntityStateType(t) }; } } [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] public class AutoConfigAttribute : Attribute { public string name; public string desc; public object defaultValue; public AutoConfigAttribute(string name, object defaultValue) { Init(name, string.Empty, defaultValue); } public AutoConfigAttribute(string name, string desc, object defaultValue) { Init(name, desc, defaultValue); } public void Init(string name, string desc, object defaultValue) { this.name = name; this.desc = desc; this.defaultValue = defaultValue; } } public static class Config { public static ConfigFile MyConfig; public static ConfigFile BackupConfig; public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown MyConfig = new ConfigFile(Paths.ConfigPath + "\\SurvivorTweaks.cfg", true); MyConfig.SaveOnConfigSet = false; BackupConfig = new ConfigFile(Paths.ConfigPath + "\\SurvivorTweaks.Backup.cfg", true); BackupConfig.SaveOnConfigSet = false; BackupConfig.Bind(": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :"); } public static void Save() { MyConfig.SaveOnConfigSet = true; MyConfig.Save(); BackupConfig.SaveOnConfigSet = true; BackupConfig.Save(); } public static ConfigEntry CharacterEnableConfig(string section, string characterName, string description = "", bool enabledByDefault = true) { if (string.IsNullOrEmpty(description)) { description = "Set to false to disable this character and as much of its code and content as possible"; } return BindAndOptions(section, "Enable " + characterName, enabledByDefault, description, restartRequired: true); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, string description = "", bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, 0f, 20f, description, restartRequired); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, float min, float max, string description = "", bool restartRequired = false) { if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } ConfigEntry val = MyConfig.Bind(section, name, defaultValue, description); if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { TryRegisterOption(val, min, max, restartRequired); } return val; } public static ConfigEntry BindAndOptionsSlider(string section, string name, float defaultValue, string description, float min = 0f, float max = 20f, bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, min, max, description, restartRequired); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void TryRegisterOption(ConfigEntry entry, float min, float max, bool restartRequired) { } public static bool GetKeyPressed(KeyboardShortcut entry) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) foreach (KeyCode modifier in ((KeyboardShortcut)(ref entry)).Modifiers) { if (!Input.GetKey(modifier)) { return false; } } return Input.GetKeyDown(((KeyboardShortcut)(ref entry)).MainKey); } } public class ConfigManager { internal static bool ConfigChanged; internal static bool VersionChanged; public static void HandleConfigAttributes(Type type, string section, ConfigFile config) { TypeInfo typeInfo = type.GetTypeInfo(); FieldInfo[] fields = typeInfo.GetFields(); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.IsStatic) { Type fieldType = fieldInfo.FieldType; AutoConfigAttribute customAttribute = fieldInfo.GetCustomAttribute(); if (customAttribute != null) { string name = customAttribute.name; object defaultValue = customAttribute.defaultValue; string desc = customAttribute.desc; fieldInfo.SetValue(null, DualBindToConfig(fieldType, section, config, name, defaultValue, desc)); } } } } private static object DualBindToConfig(Type t, string section, ConfigFile config, string configName, object defaultValue, string configDesc) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown if (string.IsNullOrWhiteSpace(section) || string.IsNullOrWhiteSpace(configName)) { return defaultValue; } ConfigDescription val = new ConfigDescription(configDesc, (AcceptableValueBase)null, Array.Empty()); MethodInfo methodInfo = (from x in typeof(ConfigFile).GetMethods() where x.Name == "Bind" select x).First(); methodInfo = methodInfo.MakeGenericMethod(t); ConfigEntryBase val2 = (ConfigEntryBase)methodInfo.Invoke(config, new object[3] { (object)new ConfigDefinition(section, configName), defaultValue, val }); ConfigEntryBase val3 = (ConfigEntryBase)methodInfo.Invoke(Config.BackupConfig, new object[3] { (object)new ConfigDefinition(Regex.Replace(config.ConfigFilePath, "\\W", "") + " : " + section, configName), defaultValue, val }); if (!ConfigEqual(val3.DefaultValue, val3.BoxedValue)) { bool flag = true; Log.Warning("Syncing config to new version"); val2.BoxedValue = val2.DefaultValue; val3.BoxedValue = val3.DefaultValue; } if (!ConfigEqual(val2.DefaultValue, val2.BoxedValue)) { ConfigChanged = true; } return val2.BoxedValue; } public static T DualBindToConfig(string section, ConfigFile config, string configName, T defaultValue, string configDesc) { return (T)DualBindToConfig(typeof(T), section, config, configName, defaultValue, configDesc); } private static bool ConfigEqual(object a, object b) { if (a.Equals(b)) { return true; } if (float.TryParse(a.ToString(), out var result) && float.TryParse(b.ToString(), out var result2) && (double)Mathf.Abs(result - result2) < 0.0001) { return true; } return false; } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List expansionDefs = new List(); public static List bodyPrefabs = new List(); public static List masterPrefabs = new List(); public static List projectilePrefabs = new List(); public static List survivorDefs = new List(); public static List unlockableDefs = new List(); public static List skillFamilies = new List(); public static List skillDefs = new List(); public static List entityStates = new List(); public static List buffDefs = new List(); public static List effectDefs = new List(); public static List itemDefs = new List(); public static List eliteDefs = new List(); public static List artifactDefs = new List(); public static List networkSoundEventDefs = new List(); public static List networkedObjectPrefabs = new List(); public string identifier => "com.RiskOfBrainrot.SurvivorTweaks"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.expansionDefs.Add(expansionDefs.ToArray()); contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); contentPack.survivorDefs.Add(survivorDefs.ToArray()); contentPack.eliteDefs.Add(eliteDefs.ToArray()); contentPack.itemDefs.Add(itemDefs.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.artifactDefs.Add(artifactDefs.ToArray()); contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.entityStateTypes.Add(entityStates.ToArray()); contentPack.unlockableDefs.Add(unlockableDefs.ToArray()); contentPack.effectDefs.Add(effectDefs.ToArray()); contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); contentPack.networkedObjectPrefabs.Add(networkedObjectPrefabs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } public static class Hooks { public static void Init() { } } internal static class Language { public static class Styling { public static string ConvertDecimal(float value) { return value * 100f + "%"; } public static string DamageColor(string text) { return "" + text + ""; } public static string HealingColor(string text) { return "" + text + ""; } public static string DamageValueText(float value) { return DamageColor(ConvertDecimal(value) + " damage"); } public static string UtilityColor(string text) { return "" + text + ""; } public static string RedText(string text) { return HealthColor(text); } public static string HealthColor(string text) { return "" + text + ""; } public static string KeywordText(string keyword, string sub) { return "" + keyword + "" + sub + ""; } public static string ScepterDescription(string desc) { return "\nSCEPTER: " + desc + ""; } public static string VoidColor(string text) { return "" + text + ""; } public static string StackText(string text) { return StackColor("(" + text + " per stack)"); } public static string StackColor(string text) { return "" + text + ""; } public static string GetAchievementNameToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME"; } public static string GetAchievementDescriptionToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_DESCRIPTION"; } public static string NumToAdj(int num) { return num switch { 1 => num + "st", 2 => num + "nd", 3 => num + "rd", _ => num + "th", }; } } public static string TokensOutput = ""; public static bool usingLanguageFolder = false; public static bool printingEnabled = false; public static void Init() { if (usingLanguageFolder) { Language.collectLanguageRootFolders += Language_collectLanguageRootFolders; } } private static void Language_collectLanguageRootFolders(List obj) { string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)SurvivorTweaksPlugin.instance).Info.Location), "Language"); if (Directory.Exists(text)) { obj.Add(text); } } public static void Add(string token, string text) { if (!usingLanguageFolder) { LanguageAPI.Add(token, text); } if (printingEnabled) { TokensOutput = TokensOutput + "\n \"" + token + "\" : \"" + text.Replace(Environment.NewLine, "\\n").Replace("\n", "\\n") + "\","; } } public static void TryPrintOutput(string fileName = "") { if (usingLanguageFolder && printingEnabled) { PrintOutput(fileName); } } public static void PrintOutput(string fileName = "") { if (printingEnabled) { string text = "{\n strings:\n {" + TokensOutput + "\n }\n}"; Log.Message(fileName + ": \n" + text); if (!string.IsNullOrEmpty(fileName)) { string path = Path.Combine(Directory.GetParent(((BaseUnityPlugin)SurvivorTweaksPlugin.instance).Info.Location).FullName, "Language", "en", fileName); File.WriteAllText(path, text); } TokensOutput = ""; } } } } namespace SurvivorTweaks.Modules.BaseStates { public abstract class BaseMeleeAttack : BaseSkillState, IStepSetter { public int swingIndex; protected string hitboxGroupName = "SwordGroup"; protected DamageType damageType = (DamageType)0; protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartPercentTime = 0.2f; protected float attackEndPercentTime = 0.4f; protected float earlyExitPercentTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected string playbackRateParam = "Slash.playbackRate"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound = (NetworkSoundEventIndex)(-1); public float duration; private bool hasFired; private float hitPauseTimer; private OverlapAttack attack; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; public override void OnEnter() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = DamageTypeCombo.op_Implicit(damageType); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup(hitboxGroupName); attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = impactSound; } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), playbackRateParam, duration, 0.05f); } public override void OnExit() { if (inHitPause) { RemoveHitstop(); } ((EntityState)this).OnExit(); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } protected virtual void OnHitEnemyAuthority() { Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } ApplyHitstop(); } protected void ApplyHitstop() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, playbackRateParam); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (((EntityState)this).isAuthority && attack.Fire((List)null)) { OnHitEnemyAuthority(); } } private void EnterAttack() { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); PlaySwingEffect(); if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } public override void FixedUpdate() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.fixedDeltaTime; if (hitPauseTimer <= 0f && inHitPause) { RemoveHitstop(); } if (!inHitPause) { stopwatch += Time.fixedDeltaTime; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat(playbackRateParam, 0f); } } bool flag = stopwatch >= duration * attackStartPercentTime; bool flag2 = stopwatch >= duration * attackEndPercentTime; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { if (!hasFired) { EnterAttack(); } FireAttack(); } if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void RemoveHitstop() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (stopwatch >= duration * earlyExitPercentTime) { return (InterruptPriority)0; } return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } public void SetStep(int i) { swingIndex = i; } } public class BaseTimedSkillState : BaseSkillState { public float TimedBaseDuration; public float TimedBaseCastStartTime; public float TimedBaseCastEndTime; protected float duration; protected float castStartPercentTime; protected float castEndPercentTime; protected bool hasFired; protected bool isFiring; protected bool hasExited; protected virtual void InitDurationValues(float baseDuration, float castStartPercentTime, float castEndPercentTime = 1f) { TimedBaseDuration = baseDuration; TimedBaseCastStartTime = castStartPercentTime; TimedBaseCastEndTime = castEndPercentTime; duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat; this.castStartPercentTime = castStartPercentTime * duration; this.castEndPercentTime = castEndPercentTime * duration; } protected virtual void OnCastEnter() { } protected virtual void OnCastFixedUpdate() { } protected virtual void OnCastUpdate() { } protected virtual void OnCastExit() { } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired && ((EntityState)this).fixedAge > castStartPercentTime) { hasFired = true; OnCastEnter(); } bool flag = ((EntityState)this).fixedAge >= castStartPercentTime; bool flag2 = ((EntityState)this).fixedAge >= castEndPercentTime; isFiring = false; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { isFiring = true; OnCastFixedUpdate(); } if (flag2 && !hasExited) { hasExited = true; OnCastExit(); } if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { ((EntityState)this).Update(); if (isFiring) { OnCastUpdate(); } } } public class ExampleTimedSkillState : BaseTimedSkillState { public static float SkillBaseDuration = 1.5f; public static float SkillStartTime = 0.2f; public static float SkillEndTime = 0.9f; public override void OnEnter() { ((BaseState)this).OnEnter(); InitDurationValues(SkillBaseDuration, SkillStartTime, SkillEndTime); } protected override void OnCastEnter() { } protected override void OnCastFixedUpdate() { } protected override void OnCastExit() { } } public class ExampleDelayedSkillState : BaseTimedSkillState { public static float SkillBaseDuration = 1.5f; public static float SkillStartTime = 0.2f; public override void OnEnter() { ((BaseState)this).OnEnter(); InitDurationValues(SkillBaseDuration, SkillStartTime); } protected override void OnCastEnter() { } } } namespace SurvivorTweaks.Modules.Achievements { public abstract class BaseMasteryAchievement : BaseAchievement { public abstract string RequiredCharacterBody { get; } public abstract float RequiredDifficultyCoefficient { get; } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex(RequiredCharacterBody); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)runReport.gameEnding) || !runReport.gameEnding.isWin) { return; } DifficultyIndex val = runReport.ruleBook.FindDifficulty(); DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val); if (difficultyDef != null) { bool flag = difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient; bool flag2 = difficultyDef.nameToken == "INFERNO_NAME"; bool flag3 = (int)val >= 3 && (int)val <= 10; if (flag || flag2 || flag3) { ((BaseAchievement)this).Grant(); } } } } } namespace SurvivorTweaks.Unlocks { public abstract class UnlockBase : UnlockBase where T : UnlockBase { public static T instance { get; private set; } public UnlockBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting UnlockBase was instantiated twice"); } instance = this as T; } } public abstract class UnlockBase : BaseAchievement { public abstract string TOKEN_IDENTIFIER { get; } public abstract string AchievementName { get; } public abstract string AchievementDesc { get; } public static UnlockableDef CreateUnlockDef(Type RequiredUnlock, Sprite icon) { string name = RequiredUnlock.Name; string text = name.ToUpperInvariant(); UnlockableDef val = Content.CreateAndAddUnlockbleDef(name, name, icon); string nameToken = "ACHIEVEMENT_" + text + "_NAME"; string descToken = "ACHIEVEMENT_" + text + "_DESCRIPTION"; LanguageAPI.Add(nameToken, Reflection.GetPropertyValue(RequiredUnlock, "AchievementName")); LanguageAPI.Add(descToken, Reflection.GetPropertyValue(RequiredUnlock, "AchievementDesc")); val.getHowToUnlockString = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2] { Language.GetString(nameToken), Language.GetString(descToken) }); val.getUnlockedString = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2] { Language.GetString(nameToken), Language.GetString(descToken) }); return val; } public void AddLang() { LanguageAPI.Add("ACHIEVEMENT_" + TOKEN_IDENTIFIER + "_NAME", AchievementName); LanguageAPI.Add("ACHIEVEMENT_" + TOKEN_IDENTIFIER + "_DESCRIPTION", AchievementDesc); } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("MageBody"); } public static StatDef GetCareerStatTotal(string name) { StatDef val = StatDef.Find(name); if (val == null) { val = StatDef.Register(name, (StatRecordType)0, (StatDataType)0, 0.0, (DisplayValueFormatterDelegate)null); } return val; } } } namespace SurvivorTweaks.SurvivorTweaks { internal class AcridTweaks : SurvivorTweakBase { public static bool isLoaded; public static float acridBaseDamage = 9f; public static float poisonDuration = 10f; public static float blightDuration = 5f; public static float slashDuration = 1f; public static float spitCooldown = 5f; public static float spitDamageCoeff = 1.8f; public static float spitDamageCoeffAfterDistance = 5.8f; public static float spitDistanceForBoost = 21f; public static float spitDuration = 0.4f; public static float spitBlastRadius = 6f; public static int spitBaseStock = 3; public static float biteForceStrength = 8000f; public static float biteCooldown = 3f; public static float biteDamageCoeff = 4.8f; public static float causticCooldown = 7f; public static float frenziedCooldown = 9f; public static float leapMinY = -0.3f; public static float epidemicCooldown = 15f; public static float epidemicDamageCoefficient = 0.5f; public static float epidemicInitialRange = 80f; public static float epidemicSpreadRange = 35f; public static float epidemicProjectileBlastRadius = 3f; public static int epidemicMaxTargets = 20; public static ModdedDamageType AcridSkillBasedDamage; public static string AcridBlightKeywordToken = "KEYWORD_BLIGHT"; public override string survivorName => "Acrid"; public override string bodyName => "CrocoBody"; public override void Init() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Croco.CrocoBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); CharacterBody component = bodyObject.GetComponent(); component.baseMoveSpeed = 8f; component.baseDamage = acridBaseDamage; ChangePassive(); ChangeVanillaPrimary(primary); ChangeVanillaSecondaries(secondary); ChangeVanillaUtilities(utility); ChangeVanillaSpecials(special); }); GlobalEventManager.ProcessHitEnemy += new Manipulator(ChangePoisonDuration); LanguageAPI.Add("KEYWORD_POISON", "Poisonous" + $"Deal damage equal to up to {poisonDuration}% of their maximum health over {poisonDuration}s. " + "Poison cannot kill enemies."); LanguageAPI.Add(AcridBlightKeywordToken, "Blighted" + $"Deal 60% base damage over {blightDuration}s. " + "Blight can stack."); } private void ChangePassive() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown AcridSkillBasedDamage = DamageAPI.ReserveDamageType(); GenericSkill[] components = bodyObject.GetComponents(); GenericSkill val = components[0]; if (Object.op_Implicit((Object)(object)val)) { val.hideInCharacterSelect = true; Object.Destroy((Object)(object)val); } else { Debug.LogError((object)"No ACRID passive skill found"); } FireSpit.OnEnter += new Manipulator(FixSpitDamageTypes); Bite.AuthorityModifyOverlapAttack += new hook_AuthorityModifyOverlapAttack(FixBiteDamageTypes); } private void FixBiteDamageTypes(orig_AuthorityModifyOverlapAttack orig, Bite self, OverlapAttack overlapAttack) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) overlapAttack.damageType = DamageTypeCombo.op_Implicit((DamageType)1572864); overlapAttack.damageType.damageSource = (DamageSource)2; } private void FixSpitDamageTypes(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "damageTypeOverride") })) { int index = val.Index; val.Index = index - 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(DamageTypeCombo damageTypeIn, EntityState state) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (state is FireDiseaseProjectile) { damageTypeIn.damageType = (DamageType)4096; damageTypeIn.damageSource = (DamageSource)8; return damageTypeIn; } if (state is FireSpit) { damageTypeIn.damageType = (DamageType)1048576; damageTypeIn.damageSource = (DamageSource)2; return damageTypeIn; } return damageTypeIn; }); } else { Debug.LogError((object)"Acrid spit damage type hook failed!!"); } } private DamageTypeCombo CrocoDamageTypeController_GetDamageType(orig_GetDamageType orig, CrocoDamageTypeController self) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) DamageTypeCombo generic = DamageTypeCombo.Generic; DamageAPI.AddModdedDamageType(ref generic, AcridSkillBasedDamage); return generic; } private void ChangeVanillaPrimary(SkillFamily family) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.keywordTokens = new string[2] { "KEYWORD_RAPID_REGEN", "KEYWORD_FESTER" }; LanguageAPI.Add("CROCO_PRIMARY_DESCRIPTION", "Maul an enemy for 200% damage. Every 3rd hit is Regenerative and Festering for 400% damage."); Slash.OnEnter += new hook_OnEnter(ChangeCrocoSlashDuration); Slash.AuthorityModifyOverlapAttack += new hook_AuthorityModifyOverlapAttack(CrocoSlashDamageType); } private void CrocoSlashDamageType(orig_AuthorityModifyOverlapAttack orig, Slash self, OverlapAttack overlapAttack) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, overlapAttack); if (self.isComboFinisher) { DamageAPI.AddModdedDamageType(overlapAttack, CommonAssets.AcridFesterDamage); } } private void ChangeVanillaSecondaries(SkillFamily family) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = spitCooldown; skillDef.baseMaxStock = spitBaseStock; skillDef.keywordTokens = new string[1] { AcridBlightKeywordToken }; LanguageAPI.Add("CROCO_SECONDARY_DESCRIPTION", "Blighted. Spit toxic bile for " + Tools.ConvertDecimal(spitDamageCoeff) + " damage, or " + Tools.ConvertDecimal(spitDamageCoeffAfterDistance) + " damage after " + $"{spitDistanceForBoost}m. Hold up to {spitBaseStock}."); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Croco/CrocoSpit.prefab").WaitForCompletion(); ProjectileIncreaseDamageAfterDistance val2 = val.AddComponent(); val2.requiredDistance = spitDistanceForBoost; val2.damageMultiplierOnIncrease = spitDamageCoeffAfterDistance / spitDamageCoeff; val2.effectPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/FlyingVermin/VerminSpitImpactEffect.prefab").WaitForCompletion(); ProjectileImpactExplosion component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((ProjectileExplosion)component).blastRadius = spitBlastRadius; } SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.baseRechargeInterval = biteCooldown; skillDef2.keywordTokens = new string[3] { AcridBlightKeywordToken, "KEYWORD_SLAYER", "KEYWORD_RAPID_REGEN" }; Bite.OnEnter += new hook_OnEnter(BuffBite); LanguageAPI.Add("CROCO_SECONDARY_ALT_DESCRIPTION", "Blighted. Slayer. Regenerative. Bite an enemy for " + Tools.ConvertDecimal(biteDamageCoeff) + " damage."); } private void BuffBite(orig_OnEnter orig, Bite self) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) ((BasicMeleeAttack)self).damageCoefficient = biteDamageCoeff; orig.Invoke(self); if (!SurvivorTweaksPlugin.acridLungeLoaded) { ((EntityState)self).characterMotor.velocity = Vector3.zero; ((EntityState)self).characterMotor.ApplyForce(((EntityState)self).inputBank.aimDirection * biteForceStrength, true, false); } } private void ChangeCrocoSlashDuration(orig_OnEnter orig, Slash self) { ((BasicMeleeAttack)self).baseDuration = slashDuration; orig.Invoke(self); } private void ChangeVanillaUtilities(SkillFamily family) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = causticCooldown; skillDef.keywordTokens = new string[3] { "KEYWORD_CORROSION", "KEYWORD_RAPID_REGEN", "KEYWORD_FESTER" }; LanguageAPI.Add("CROCO_UTILITY_DESCRIPTION", "Caustic. Stunning. Festering. Leap in the air, dealing 320% damage. Leave acid that deals 25% damage."); SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.baseRechargeInterval = frenziedCooldown; BaseLeap.minimumY = leapMinY; BaseLeap.DoImpactAuthority += new hook_DoImpactAuthority(AddLeapBounce); Leap.GetBlastDamageType += new hook_GetBlastDamageType(LeapDamageType); } private DamageTypeCombo LeapDamageType(orig_GetBlastDamageType orig, Leap self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0024: 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) DamageTypeCombo result = orig.Invoke(self); DamageAPI.AddModdedDamageType(ref result, CommonAssets.AcridFesterDamage); DamageAPI.AddModdedDamageType(ref result, CommonAssets.AcridCorrosiveDamage); return result; } private void AddLeapBounce(orig_DoImpactAuthority orig, BaseLeap self) { orig.Invoke(self); ((BaseState)self).SmallHop(((EntityState)self).characterMotor, 3f); } private void ChangeVanillaSpecials(SkillFamily family) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = epidemicCooldown; skillDef.keywordTokens = new string[2] { "KEYWORD_POISON", "KEYWORD_CONTAGIOUS" }; LanguageAPI.Add("CROCO_SPECIAL_DESCRIPTION", "Poisonous. Contagious. Release a deadly disease that deals " + Tools.ConvertDecimal(epidemicDamageCoefficient) + " damage. " + $"The disease spreads to up to {epidemicMaxTargets} targets within {epidemicInitialRange}m."); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Croco/CrocoDiseaseProjectile.prefab").WaitForCompletion(); ProjectileProximityBeamController component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.attackRange = epidemicSpreadRange; ProjectileDiseaseOrbController projectileDiseaseOrbController = val.AddComponent(); projectileDiseaseOrbController.procCoefficient = component.procCoefficient; projectileDiseaseOrbController.damageCoefficient = component.damageCoefficient; projectileDiseaseOrbController.bounces = epidemicMaxTargets; projectileDiseaseOrbController.maxOrbRange = epidemicInitialRange; projectileDiseaseOrbController.orbSpreadRange = epidemicSpreadRange; Object.Destroy((Object)(object)component); } FireSpit.OnEnter += new hook_OnEnter(FireSpit_OnEnter); } private void FireSpit_OnEnter(orig_OnEnter orig, FireSpit self) { if (self is FireDiseaseProjectile) { self.damageCoefficient = epidemicDamageCoefficient; } else { self.damageCoefficient = spitDamageCoeff; self.baseDuration = spitDuration; } orig.Invoke(self); } private void ChangePoisonDuration(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "damageType"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4096) }); float num = default(float); val.GotoNext((MoveType)0, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "procCoefficient") }); val.Remove(); val.Emit(OpCodes.Ldc_R4, poisonDuration); } } internal class ArtiTweaks : SurvivorTweakBase { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnEnter <>9__7_1; public static hook_OnExit <>9__7_2; public static hook_OnEnter <>9__7_3; public static hook_OnEnter <>9__7_4; public static hook_OnEnter <>9__7_5; internal void b__7_1(orig_OnEnter orig, JetpackOn self) { JetpackOn.hoverVelocity = -2f; if (NetworkServer.active) { ((EntityState)self).characterBody.AddBuff(CommonAssets.jetpackSpeedBoost); } orig.Invoke(self); } internal void b__7_2(orig_OnExit orig, JetpackOn self) { if (NetworkServer.active) { ((EntityState)self).characterBody.RemoveBuff(CommonAssets.jetpackSpeedBoost); } orig.Invoke(self); } internal void b__7_3(orig_OnEnter orig, BaseThrowBombState self) { if (self is ThrowNovabomb) { self.maxDamageCoefficient = 12f; } orig.Invoke(self); } internal void b__7_4(orig_OnEnter orig, Flamethrower self) { self.maxDistance = flamethrowerRange; self.totalDamageCoefficient = flamethrowerDamage; orig.Invoke(self); } internal void b__7_5(orig_OnEnter orig, Flamethrower self) { self.baseFlamethrowerDuration = 3f; self.tickFrequency = 7f; self.totalDamageCoefficient = 16.23f; Flamethrower.procCoefficientPerTick = 0.8f; orig.Invoke(self); float attackSpeedStat = ((BaseState)self).attackSpeedStat; float num = Mathf.Sqrt(attackSpeedStat); if (attackSpeedStat != 0f) { float num2 = self.totalDamageCoefficient * num; float num3 = self.baseFlamethrowerDuration / num; float num4 = self.baseFlamethrowerDuration * self.tickFrequency * num; self.tickFrequency *= num; } } } public static float flamethrowerDamage = 28f; public static float flamethrowerRange = 26f; public static string flamethrowerDesc; public override string survivorName => "Artificer"; public override string bodyName => "MageBody"; public override void Init() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //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_0091: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Mage.MageBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); CharacterBody component3 = bodyObject.GetComponent(); component3.levelDamage = (component3.baseDamage = 12f) * 0.2f; SkillDef skillDef = utility.variants[0].skillDef; skillDef.baseRechargeInterval = 8f; }); object obj = <>c.<>9__7_1; if (obj == null) { hook_OnEnter val = delegate(orig_OnEnter orig, JetpackOn self) { JetpackOn.hoverVelocity = -2f; if (NetworkServer.active) { ((EntityState)self).characterBody.AddBuff(CommonAssets.jetpackSpeedBoost); } orig.Invoke(self); }; <>c.<>9__7_1 = val; obj = (object)val; } JetpackOn.OnEnter += (hook_OnEnter)obj; object obj2 = <>c.<>9__7_2; if (obj2 == null) { hook_OnExit val2 = delegate(orig_OnExit orig, JetpackOn self) { if (NetworkServer.active) { ((EntityState)self).characterBody.RemoveBuff(CommonAssets.jetpackSpeedBoost); } orig.Invoke(self); }; <>c.<>9__7_2 = val2; obj2 = (object)val2; } JetpackOn.OnExit += (hook_OnExit)obj2; LanguageAPI.Add("MAGE_PASSIVE_DESCRIPTION", "Holding the Jump key causes the Artificer to hover in the air. Move faster while hovering."); object obj3 = <>c.<>9__7_3; if (obj3 == null) { hook_OnEnter val3 = delegate(orig_OnEnter orig, BaseThrowBombState self) { if (self is ThrowNovabomb) { self.maxDamageCoefficient = 12f; } orig.Invoke(self); }; <>c.<>9__7_3 = val3; obj3 = (object)val3; } BaseThrowBombState.OnEnter += (hook_OnEnter)obj3; LanguageAPI.Add("MAGE_SECONDARY_LIGHTNING_DESCRIPTION", "Stunning. Charge up an exploding nano-bomb that deals 400%-1200% damage."); GameObject val4 = LegacyResourcesAPI.Load("prefabs/projectiles/MageIcewallPillarProjectile"); Collider componentInChildren = val4.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { ((Component)componentInChildren).transform.localScale = Vector3.one * 2.5f; ProjectileImpactExplosion componentInChildren2 = val4.GetComponentInChildren(); ((ProjectileExplosion)componentInChildren2).blastRadius = 4f; } GameObject val5 = LegacyResourcesAPI.Load("prefabs/projectiles/MageIcewallWalkerProjectile"); ProjectileMageFirewallWalkerController component = val5.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { } ProjectileCharacterController component2 = val5.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.velocity = 45f; } LanguageAPI.Add("MAGE_SPECIAL_FIRE_DESCRIPTION", "Burn all enemies in front of you for " + Tools.ConvertDecimal(flamethrowerDamage) + " damage. Each hit has a 50% chance to Ignite."); object obj4 = <>c.<>9__7_4; if (obj4 == null) { hook_OnEnter val6 = delegate(orig_OnEnter orig, Flamethrower self) { self.maxDistance = flamethrowerRange; self.totalDamageCoefficient = flamethrowerDamage; orig.Invoke(self); }; <>c.<>9__7_4 = val6; obj4 = (object)val6; } Flamethrower.OnEnter += (hook_OnEnter)obj4; bool flag = false; } } internal class BanditTweaks : SurvivorTweakBase { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_GetMinimumInterruptPriority <>9__45_0; public static hook_GetMinimumInterruptPriority <>9__45_1; public static hook_GetMinimumInterruptPriority <>9__45_2; public static Func <>9__46_0; public static Func <>9__46_1; public static Func <>9__63_0; public static Func <>9__63_1; internal InterruptPriority b__45_0(orig_GetMinimumInterruptPriority orig, EnterReload self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } internal InterruptPriority b__45_1(orig_GetMinimumInterruptPriority orig, Reload self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } internal InterruptPriority b__45_2(orig_GetMinimumInterruptPriority orig, Bandit2FirePrimaryBase self) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)self).fixedAge <= self.minimumDuration) { return (InterruptPriority)3; } return (InterruptPriority)2; } internal bool b__46_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_rechargeStock"); } internal int b__46_1(int _) { return 1; } internal bool b__63_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_fixedAge"); } internal float b__63_1(float fixedAge, BasePrepSidearmRevolverState self) { <>c__DisplayClass63_0 <>c__DisplayClass63_ = default(<>c__DisplayClass63_0); <>c__DisplayClass63_.self = self; if (((EntityState)<>c__DisplayClass63_.self).inputBank.skill4.down) { if (fixedAge > ((BaseSidearmState)<>c__DisplayClass63_.self).duration) { if (((BaseSidearmState)<>c__DisplayClass63_.self).duration > 0f) { ((BaseSidearmState)<>c__DisplayClass63_.self).duration = 0f; string text = "MuzzlePistol"; Util.PlaySound(AimStunDrone.exitSoundString, ((EntityState)<>c__DisplayClass63_.self).gameObject); GameObject muzzleflashEffectPrefab = ChargeArrow.muzzleflashEffectPrefab; if (Object.op_Implicit((Object)(object)muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)<>c__DisplayClass63_.self).gameObject, text, false); } } if (Object.op_Implicit((Object)(object)((EntityState)<>c__DisplayClass63_.self).inputBank) && ((EntityState)<>c__DisplayClass63_.self).inputBank.skill1.down && !((EntityState)<>c__DisplayClass63_.self).inputBank.skill1.wasDown) { ((EntityState)<>c__DisplayClass63_.self).outer.SetNextState(g__GetNextState|63_2(ref <>c__DisplayClass63_)); } } return -1f; } return fixedAge; } } [StructLayout(LayoutKind.Auto)] [CompilerGenerated] private struct <>c__DisplayClass63_0 { public BasePrepSidearmRevolverState self; } public static bool noFinishersFromSkillSourcedDamage = true; public static bool useBanditSkullSurplus = false; public static float baseMaxHealth = 90f; public static float shotgunDamageCoeff = 0.7f; public static float rifleDamageCoeff = 2.8f; public static float rifleSpreadBloom = 0.3f; public static float reloadEnterBaseDuration = 0.4f; public static float reloadBaseDuration = 0.5f; public static float primaryMinDuration = 0.1f; public static float primaryAutoDuration = 0.325f; public static float daggerDamageCoeff = 6f; public static float daggerCooldown = 6f; public static float daggerSelfForce = 1500f; public static float shivDamageCoeff = 4f; public static float shivCooldown = 7f; public static int shivStock = 2; public static float stealthHopVelocity = 13f; public static float stealthDuration = 4.5f; public static float stealthCooldown = 6f; public static float stealthAspdBonus = 0.6f; public static float lightsOutDamage = 4.5f; public static float lightsOutCooldown = 8f; public static float desperadoDamage = 3f; public static float desperadoCooldown = 3f; public static float desperadoDamagePerToken = 0.075f; public static float desperadoAttackSpeedPerToken = 0.025f; public static int desperadoTokensPerLevel = 2; public static float revolverDebuffDuration = 1.6f; public static float revolverDrawDuration = 0.8f; public static float finisherAimDuration = 5f; public static float revolverBulletRadius = 1.5f; public static float revolverHipFireBulletRadius = 3f; public static float revolverHipFireGraceDuration = 0.25f; public static float hemorrhageDamageBase = 15f; public static float hemorrhageDamageMin = 0.5f; public static float hemorrhageDamageMax = 2.5f; public override string bodyName => "Bandit2Body"; public override string survivorName => "Hopoo Bandit"; private static BuffIndex banditSkullBuff { get { //IL_000c: Unknown result type (might be due to invalid IL or missing references) BuffDef banditSkull = Buffs.BanditSkull; return (BuffIndex)((banditSkull == null) ? (-1) : ((int)banditSkull.buffIndex)); } } private static BuffIndex banditSkullSurplusBuff { get { //IL_000c: Unknown result type (might be due to invalid IL or missing references) BuffDef desperadoTokenSurplusBuff = CommonAssets.desperadoTokenSurplusBuff; return (BuffIndex)((desperadoTokenSurplusBuff == null) ? (-1) : ((int)desperadoTokenSurplusBuff.buffIndex)); } } public override void Init() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Bandit2.Bandit2Body_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); CharacterBody component = bodyObject.GetComponent(); component.baseMaxHealth = baseMaxHealth; component.levelMaxHealth = baseMaxHealth * 0.3f; GetSkillsFromBodyObject(bodyObject); ChangeVanillaPrimaries(primary); ChangeVanillaSecondaries(secondary); ChangeVanillaUtilities(utility); ChangeVanillaSpecials(special); }); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(BanditCloakBuff); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(BanditTweaksTakeDamage); GlobalEventManager.onCharacterDeathGlobal += BanditOnKill; LanguageAPI.Add("KEYWORD_SUPERBLEED", "HemorrhageBleed enemies for " + Tools.ConvertDecimal(hemorrhageDamageBase * hemorrhageDamageMin) + " base damage over 15s. " + $"Can deal up to {hemorrhageDamageMax / hemorrhageDamageMin}x as much damage against healthy enemies. " + "Hemorrhage can stack."); CharacterBody.Start += new hook_Start(BackstabPassiveCritChance); LanguageAPI.Add("BANDIT2_PASSIVE_DESCRIPTION", "All attacks from behind are Critical Strikes. All Critical Strike Chance is instead converted into Critical Strike Damage."); } private void BanditOnKill(DamageReport damageReport) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Expected O, but got Unknown if (!NetworkServer.active || ((int)damageReport.damageInfo.damageType.damageSource != 0 && noFinishersFromSkillSourcedDamage) || (Object)(object)damageReport.attackerBody == (Object)null || (Object)(object)damageReport.victimBody == (Object)null || damageReport.attackerBody.bodyIndex != BodyCatalog.FindBodyIndexCaseInsensitive("Bandit2Body")) { return; } HealthComponent healthComponent = damageReport.victimBody.healthComponent; if (healthComponent.health > 0f || healthComponent.alive) { return; } if (damageReport.victimBody.HasBuff(CommonAssets.lightsoutExecutionDebuff.buffIndex) && !((Enum)damageReport.damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)4)) { damageReport.victimBody.RemoveBuff(CommonAssets.lightsoutExecutionDebuff.buffIndex); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ImpactEffects/Bandit2ResetEffect"), new EffectData { origin = damageReport.damageInfo.position }, true); SkillLocator val = damageReport.attackerBody.skillLocator; if (Object.op_Implicit((Object)(object)val)) { val.ResetSkills(); } } if (damageReport.victimBody.HasBuff(CommonAssets.desperadoExecutionDebuff.buffIndex) && !((Enum)damageReport.damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)268435456)) { damageReport.victimBody.RemoveBuff(CommonAssets.desperadoExecutionDebuff.buffIndex); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ImpactEffects/Bandit2KillEffect"), new EffectData { origin = damageReport.damageInfo.position }, true); if (Object.op_Implicit((Object)(object)damageReport.attackerBody)) { damageReport.attackerBody.AddBuff(Buffs.BanditSkull); } } } private void BanditCloakBuff(CharacterBody sender, StatHookEventArgs args) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (sender.bodyIndex == BodyCatalog.FindBodyIndex("Bandit2Body")) { if (sender.HasBuff(Buffs.Cloak)) { args.attackSpeedMultAdd += stealthAspdBonus; } int buffCount = sender.GetBuffCount(banditSkullBuff); int buffCount2 = sender.GetBuffCount(banditSkullSurplusBuff); int num = buffCount + buffCount2; if (num > 0) { args.attackSpeedMultAdd += desperadoAttackSpeedPerToken * (float)num; } } } private void BackstabPassiveCritChance(orig_Start orig, CharacterBody self) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!self.canPerformBackstab && !((Enum)self.bodyFlags).HasFlag((Enum)(object)(BodyFlags)128)) { return; } Inventory inventory = self.inventory; if (Object.op_Implicit((Object)(object)inventory)) { int itemCountEffective = inventory.GetItemCountEffective(Items.ConvertCritChanceToCritDamage); if (itemCountEffective <= 0) { inventory.GiveItem(Items.ConvertCritChanceToCritDamage, 1); } } } private void BanditTweaksTakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 //IL_005b: Unknown result type (might be due to invalid IL or missing references) CharacterBody val = null; if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { val = damageInfo.attacker.GetComponent(); } if ((int)damageInfo.dotIndex == 6) { float damage = damageInfo.damage * Mathf.Lerp(hemorrhageDamageMin, hemorrhageDamageMax, self.combinedHealthFraction); damageInfo.damage = damage; damageInfo.damageType.damageType = (DamageType)67108865; } BanditFinisherDebuffOnHit(damageInfo, self.body); orig.Invoke(self, damageInfo); static void BanditFinisherDebuffOnHit(DamageInfo val2, CharacterBody victimBody) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0082: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (val2 != null && !((Object)(object)victimBody == (Object)null) && victimBody.healthComponent.alive) { bool flag = false; if (((Enum)val2.damageType.damageType).HasFlag((Enum)(object)(DamageType)4) || DamageTypeCombo.op_Implicit(val2.damageType & DamageTypeCombo.op_Implicit((DamageType)4)) != 0) { victimBody.AddTimedBuff(CommonAssets.lightsoutExecutionDebuff, revolverDebuffDuration); flag = true; } if (((Enum)val2.damageType.damageType).HasFlag((Enum)(object)(DamageType)268435456) || DamageTypeCombo.op_Implicit(val2.damageType & DamageTypeCombo.op_Implicit((DamageType)268435456)) != 0) { victimBody.AddTimedBuff(CommonAssets.desperadoExecutionDebuff, revolverDebuffDuration); flag = true; } if (flag) { victimBody.RecalculateStats(); } } } } private void ChangeVanillaPrimaries(SkillFamily family) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown CharacterBody.OnSkillCooldown += new Manipulator(EclipseLiteFix); GenericBulletBaseState.OnEnter += new hook_OnEnter(ModifyRifleAttacks); GenericBulletBaseState.FixedUpdate += new hook_FixedUpdate(RifleFixedUpdate); Reload.OnEnter += new hook_OnEnter(ChangeReloadDuration); Reload.GiveStock += new hook_GiveStock(AutoFireOnReload); object obj = <>c.<>9__45_0; if (obj == null) { hook_GetMinimumInterruptPriority val = (orig_GetMinimumInterruptPriority orig, EnterReload self) => (InterruptPriority)1; <>c.<>9__45_0 = val; obj = (object)val; } EnterReload.GetMinimumInterruptPriority += (hook_GetMinimumInterruptPriority)obj; object obj2 = <>c.<>9__45_1; if (obj2 == null) { hook_GetMinimumInterruptPriority val2 = (orig_GetMinimumInterruptPriority orig, Reload self) => (InterruptPriority)1; <>c.<>9__45_1 = val2; obj2 = (object)val2; } Reload.GetMinimumInterruptPriority += (hook_GetMinimumInterruptPriority)obj2; EnterReload.OnEnter += new hook_OnEnter(ChangeReloadEnterDuration); object obj3 = <>c.<>9__45_2; if (obj3 == null) { hook_GetMinimumInterruptPriority val3 = (orig_GetMinimumInterruptPriority orig, Bandit2FirePrimaryBase self) => (((EntityState)self).fixedAge <= self.minimumDuration) ? ((InterruptPriority)3) : ((InterruptPriority)2); <>c.<>9__45_2 = val3; obj3 = (object)val3; } Bandit2FirePrimaryBase.GetMinimumInterruptPriority += (hook_GetMinimumInterruptPriority)obj3; SkillDef skillDef = family.variants[0].skillDef; skillDef.interruptPriority = (InterruptPriority)2; skillDef.baseRechargeInterval = reloadBaseDuration; LanguageAPI.Add("BANDIT2_PRIMARY_DESCRIPTION", "Fire a shotgun burst for 5x" + shotgunDamageCoeff.AsPercent() + " damage. Tap to fire faster. Can hold up to 4 shells."); SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.interruptPriority = (InterruptPriority)2; skillDef2.baseRechargeInterval = reloadBaseDuration; LanguageAPI.Add("BANDIT2_PRIMARY_ALT_DESCRIPTION", "Fire a rifle blast for " + rifleDamageCoeff.AsPercent() + " damage. Tap to fire faster. Can hold up to 4 bullets."); } private void EclipseLiteFix(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_rechargeStock") })) { Log.DebugBreakpoint("EclipseLiteFix"); return; } val.EmitDelegate>((Func)((int _) => 1)); } private void AutoFireOnReload(orig_GiveStock orig, Reload self) { bool hasGivenStock = self.hasGivenStock; orig.Invoke(self); if (self.hasGivenStock != hasGivenStock && self.hasGivenStock) { ((EntityState)self).characterBody.OnSkillCooldown(((EntityState)self).skillLocator.primary, 1); if (Object.op_Implicit((Object)(object)((EntityState)self).inputBank) && ((EntityState)self).inputBank.skill1.down) { ((EntityState)self).skillLocator.primary.ExecuteIfReady(); } } } private void ModifyRifleAttacks(orig_OnEnter orig, GenericBulletBaseState self) { if (self is Bandit2FireRifle || self is FireShotgun2) { if (self is Bandit2FireRifle) { self.spreadBloomValue = rifleSpreadBloom; self.damageCoefficient = rifleDamageCoeff; } else { self.damageCoefficient = shotgunDamageCoeff; } self.baseDuration = primaryAutoDuration; ((Bandit2FirePrimaryBase)((self is Bandit2FirePrimaryBase) ? self : null)).minimumBaseDuration = primaryMinDuration; } orig.Invoke(self); } private void RifleFixedUpdate(orig_FixedUpdate orig, GenericBulletBaseState self) { Bandit2FirePrimaryBase val = (Bandit2FirePrimaryBase)(object)((self is Bandit2FirePrimaryBase) ? self : null); if (val != null && Object.op_Implicit((Object)(object)((EntityState)self).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)self).skillLocator.primary)) { if (Object.op_Implicit((Object)(object)((EntityState)self).inputBank) && ((EntityState)self).inputBank.skill1.down && ((GenericBulletBaseState)val).duration != val.minimumDuration && ((EntityState)val).skillLocator.primary.stock > 0) { ((EntityState)val).fixedAge = ((EntityState)val).fixedAge + Time.fixedDeltaTime; if (((EntityState)val).fixedAge >= ((GenericBulletBaseState)val).duration) { ((EntityState)val).skillLocator.primary.ExecuteIfReady(); } return; } ((GenericBulletBaseState)val).duration = val.minimumDuration; } orig.Invoke(self); } private void ChangeReloadEnterDuration(orig_OnEnter orig, EnterReload self) { EnterReload.baseDuration = reloadEnterBaseDuration; orig.Invoke(self); EnterReload.baseDuration = reloadEnterBaseDuration; } private void ChangeReloadDuration(orig_OnEnter orig, Reload self) { Reload.baseDuration = reloadBaseDuration; orig.Invoke(self); } private void ChangeVanillaSecondaries(SkillFamily family) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0039: 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_0073: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) SlashBlade.OnEnter += new hook_OnEnter(ModifyDaggerDamage); SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = daggerCooldown; skillDef.mustKeyPress = true; skillDef.interruptPriority = (InterruptPriority)2; LanguageAPI.Add("BANDIT2_SECONDARY_DESCRIPTION", "Lunge and slash for " + Tools.ConvertDecimal(daggerDamageCoeff) + " damage. Critical Strikes also cause hemorrhaging."); Bandit2FireShiv.OnEnter += new hook_OnEnter(ModifyShivDamage); SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.baseRechargeInterval = shivCooldown; skillDef2.baseMaxStock = shivStock; skillDef2.rechargeStock = shivStock; skillDef2.mustKeyPress = true; skillDef2.interruptPriority = (InterruptPriority)2; LanguageAPI.Add("BANDIT2_SECONDARY_ALT_DESCRIPTION", "Throw a hidden blade for " + Tools.ConvertDecimal(shivDamageCoeff) + " damage. Critical Strikes also cause hemorrhaging. " + ((shivStock > 1) ? $"Hold up to {shivStock}." : "")); } private void ModifyDaggerDamage(orig_OnEnter orig, SlashBlade self) { SlashBlade.selfForceStrength = daggerSelfForce; ((BasicMeleeAttack)self).damageCoefficient = daggerDamageCoeff; orig.Invoke(self); } private void ModifyShivDamage(orig_OnEnter orig, Bandit2FireShiv self) { self.damageCoefficient = shivDamageCoeff; orig.Invoke(self); } private void ChangeVanillaUtilities(SkillFamily family) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) StealthMode.FireSmokebomb += new hook_FireSmokebomb(ModifySmokeBomb); StealthMode.OnExit += new hook_OnExit(ReleaseSmokeBombState); SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = stealthCooldown; skillDef.interruptPriority = (InterruptPriority)2; skillDef.isCooldownBlockedUntilManuallyReset = true; LanguageAPI.Add("BANDIT2_UTILITY_DESCRIPTION", "Stunning. Deal 200% damage, then become invisible until your next attack. While invisible, gain " + Language.Styling.DamageColor("+" + stealthAspdBonus.AsPercent()) + " attack speed."); } private void ReleaseSmokeBombState(orig_OnExit orig, StealthMode self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)((EntityState)self).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)self).skillLocator.utility)) { ((EntityState)self).skillLocator.utility.SetBlockedCooldownSkillState(false); } } private void ModifySmokeBomb(orig_FireSmokebomb orig, StealthMode self) { StealthMode.duration = stealthDuration; StealthMode.shortHopVelocity = stealthHopVelocity; orig.Invoke(self); } private void ChangeVanillaSpecials(SkillFamily family) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(BanditFinisher); CharacterBody.SetBuffCount += new hook_SetBuffCount(OnDesperadoTokenAdded); BasePrepSidearmRevolverState.OnEnter += new hook_OnEnter(PrepSidearmRevolverEnter); BasePrepSidearmRevolverState.FixedUpdate += new Manipulator(PrepSidearmRevolverFixedUpdate); BaseFireSidearmRevolverState.OnEnter += new hook_OnEnter(FireSidearmRevolverEnter); BaseFireSidearmRevolverState.FixedUpdate += new hook_FixedUpdate(FireSidearmRevolverFixedUpdate); BaseSidearmState.GetMinimumInterruptPriority += new hook_GetMinimumInterruptPriority(RevolverInterruptPriority); EntityState.ModifyNextState += new hook_ModifyNextState(BanditHipFire); FireSidearmResetRevolver.ModifyBullet += new hook_ModifyBullet(ModifyLightsOutDamage); SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = lightsOutCooldown; skillDef.stockToConsume = 0; skillDef.suppressSkillActivation = true; skillDef.interruptPriority = (InterruptPriority)1; skillDef.keywordTokens = new string[3] { "2R4R_NOATTACKSPEEDMULTIPLICATIVE_KEYWORD", "KEYWORD_SLAYER", "2R4R_EXECUTION_KEYWORD" }; LanguageAPI.Add(skillDef.skillDescriptionToken, "Exacting. Slayer. Finisher. Fire a revolver shot for " + Tools.ConvertDecimal(lightsOutDamage) + " damage. Kills reset all your cooldowns."); string text = "2R4R_DESPERADOTOKEN_KEYWORD"; FireSidearmSkullRevolver.ModifyBullet += new hook_ModifyBullet(ModifyDesperadoDamage); SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.baseRechargeInterval = desperadoCooldown; skillDef2.stockToConsume = 0; skillDef2.suppressSkillActivation = true; skillDef2.interruptPriority = (InterruptPriority)1; skillDef2.keywordTokens = new string[3] { "2R4R_NOATTACKSPEEDMULTIPLICATIVE_KEYWORD", "2R4R_EXECUTION_KEYWORD", text }; LanguageAPI.Add(skillDef2.skillDescriptionToken, "Exacting. Finisher. Fire a revolver shot for " + desperadoDamage.AsPercent() + " damage. Kills grant stacking tokens for " + (desperadoDamagePerToken + desperadoAttackSpeedPerToken).AsPercent() + " more Desperado damage."); LanguageAPI.Add(text, Language.Styling.KeywordText("Desperado Tokens", "Each token held increases Bandit's attack speed by +" + desperadoAttackSpeedPerToken.AsPercent() + ", and increases the damage of Desperado by an additional +" + desperadoDamagePerToken.AsPercent() + " TOTAL damage. " + $"Retain up to {desperadoTokensPerLevel} tokens per level between stages.")); } private void BanditHipFire(orig_ModifyNextState orig, EntityState self, EntityState nextState) { orig.Invoke(self, nextState); if (self is BaseFireSidearmRevolverState) { BasePrepSidearmRevolverState val = (BasePrepSidearmRevolverState)(object)((nextState is BasePrepSidearmRevolverState) ? nextState : null); if (val != null) { ((BaseSidearmState)val).baseDuration = 0f; return; } } BasePrepSidearmRevolverState val2 = (BasePrepSidearmRevolverState)(object)((self is BasePrepSidearmRevolverState) ? self : null); if (val2 != null) { BaseFireSidearmRevolverState val3 = (BaseFireSidearmRevolverState)(object)((nextState is BaseFireSidearmRevolverState) ? nextState : null); if (val3 != null) { bool flag = ((EntityState)val2).fixedAge > ((BaseSidearmState)val2).baseDuration + revolverHipFireGraceDuration; val3.bulletRadius = (flag ? revolverHipFireBulletRadius : revolverBulletRadius); } } } private InterruptPriority RevolverInterruptPriority(orig_GetMinimumInterruptPriority orig, BaseSidearmState self) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (self is BasePrepSidearmRevolverState || self is BaseFireSidearmRevolverState) { if (self is BaseFireSidearmRevolverState && Object.op_Implicit((Object)(object)((EntityState)self).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)self).skillLocator.special) && ((EntityState)self).skillLocator.special.stock >= ((EntityState)self).skillLocator.special.skillDef.requiredStock) { return (InterruptPriority)2; } return (InterruptPriority)1; } return orig.Invoke(self); } private void FireSidearmRevolverFixedUpdate(orig_FixedUpdate orig, BaseFireSidearmRevolverState self) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if (((EntityState)self).isAuthority && ((EntityState)self).characterBody.isSprinting) { ((EntityState)self).outer.SetNextState((EntityState)new ExitSidearmRevolver()); } else { orig.Invoke(self); } } private void FireSidearmRevolverEnter(orig_OnEnter orig, BaseFireSidearmRevolverState self) { ((BaseSidearmState)self).baseDuration = finisherAimDuration; if (Object.op_Implicit((Object)(object)((EntityState)self).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)self).skillLocator.special)) { ((EntityState)self).characterBody.OnSkillActivated(((EntityState)self).skillLocator.special); ((EntityState)self).skillLocator.special.DeductStock(1); } orig.Invoke(self); ((BaseSidearmState)self).duration = finisherAimDuration; } private void PrepSidearmRevolverFixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_fixedAge") })) { Log.DebugBreakpoint("PrepSidearmRevolverFixedUpdate"); return; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float fixedAge, BasePrepSidearmRevolverState self) { if (((EntityState)self).inputBank.skill4.down) { if (fixedAge > ((BaseSidearmState)self).duration) { if (((BaseSidearmState)self).duration > 0f) { ((BaseSidearmState)self).duration = 0f; string text = "MuzzlePistol"; Util.PlaySound(AimStunDrone.exitSoundString, ((EntityState)self).gameObject); GameObject muzzleflashEffectPrefab = ChargeArrow.muzzleflashEffectPrefab; if (Object.op_Implicit((Object)(object)muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)self).gameObject, text, false); } } if (Object.op_Implicit((Object)(object)((EntityState)self).inputBank) && ((EntityState)self).inputBank.skill1.down && !((EntityState)self).inputBank.skill1.wasDown) { ((EntityState)self).outer.SetNextState(GetNextState()); } } return -1f; } return fixedAge; EntityState GetNextState() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown if (false) { return (EntityState)new PrepSidearmResetRevolver(); } if (false) { return (EntityState)new PrepSidearmSkullRevolver(); } return (EntityState)new ExitSidearmRevolver(); } }); } private void PrepSidearmRevolverEnter(orig_OnEnter orig, BasePrepSidearmRevolverState self) { bool flag = false; if (((EntityState)self).inputBank.skill4.down && ((BaseSidearmState)self).baseDuration <= 0.1f) { flag = true; } ((BaseSidearmState)self).baseDuration = revolverDrawDuration; orig.Invoke(self); ((BaseSidearmState)self).duration = (flag ? 0.1f : revolverDrawDuration); } private void OnDesperadoTokenAdded(orig_SetBuffCount orig, CharacterBody self, BuffIndex buffType, int newCount) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (buffType != banditSkullBuff) { orig.Invoke(self, buffType, newCount); return; } int num = (useBanditSkullSurplus ? self.GetBuffCount(banditSkullSurplusBuff) : 0); int num2 = newCount + num; int maxPersistentTokenCountFromLevel = MasterDesperadoTokenTracker.GetMaxPersistentTokenCountFromLevel(self.level); if (num2 > maxPersistentTokenCountFromLevel && useBanditSkullSurplus) { orig.Invoke(self, banditSkullBuff, 0); orig.Invoke(self, banditSkullSurplusBuff, num2); } else { orig.Invoke(self, banditSkullBuff, num2); orig.Invoke(self, banditSkullSurplusBuff, 0); } if (!((Object)(object)self.master == (Object)null) && NetworkServer.active) { MasterDesperadoTokenTracker masterDesperadoTokenTracker = default(MasterDesperadoTokenTracker); if (!((Component)self.master).TryGetComponent(ref masterDesperadoTokenTracker)) { masterDesperadoTokenTracker = ((Component)self.master).gameObject.AddComponent(); masterDesperadoTokenTracker.master = self.master; } masterDesperadoTokenTracker.SetTokenCount(num2); } } private void BanditFinisher(CharacterBody sender, MoreStatHookEventArgs args) { bool flag = sender.HasBuff(CommonAssets.desperadoExecutionDebuff) || sender.HasBuff(CommonAssets.lightsoutExecutionDebuff); args.ModifyBaseExecutionThreshold(SharedUtilsPlugin.GetSurvivorExecuteThreshold(sender.isBoss), flag); } private void ModifyLightsOutDamage(orig_ModifyBullet orig, FireSidearmResetRevolver self, BulletAttack bulletAttack) { orig.Invoke(self, bulletAttack); bulletAttack.damage = lightsOutDamage * ((BaseState)self).damageStat * ((BaseState)self).attackSpeedStat; } private void ModifyDesperadoDamage(orig_ModifyBullet orig, FireSidearmSkullRevolver self, BulletAttack bulletAttack) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, bulletAttack); int num = 0; if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody)) { num = ((EntityState)self).characterBody.GetBuffCount(Buffs.BanditSkull) + ((EntityState)self).characterBody.GetBuffCount(CommonAssets.desperadoTokenSurplusBuff); } bulletAttack.damage = desperadoDamage * ((BaseState)self).damageStat * (((BaseState)self).attackSpeedStat + desperadoDamagePerToken * (float)num); bulletAttack.damageType.damageType = (DamageType)(bulletAttack.damageType.damageType & -524289); } [CompilerGenerated] internal static EntityState g__GetNextState|63_2(ref <>c__DisplayClass63_0 P_0) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown if (false) { return (EntityState)new PrepSidearmResetRevolver(); } if (false) { return (EntityState)new PrepSidearmSkullRevolver(); } return (EntityState)new ExitSidearmRevolver(); } } internal class CaptainTweaks : SurvivorTweakBase { public static float microbotRechargeRate = 1.5f; public static float microbotRadius = 20f; public bool attackSpeedDamageAdditive = false; public static float shotgunCooldown = 2f; public static int shotgunStock = 2; public static float shotgunChargeDuration = 0.8f; public static float shotgunWindDownDuration = 0.2f; public static float shotgunPelletDamageCoeff = 1f; public static float shotgunPelletProcCoeff = 0.5f; public static float tazerAoeRadius = 2f; public static float tazerDamage = 2f; public static float tazerDamageBonus = 3f; public static float tazerCooldown = 5f; public static int tazerTotalTargets = 3; private float diabloMaxDuration = 10f; public static bool refreshSupplyDrops = true; public static GameObject beaconExplosion = LegacyResourcesAPI.Load("prefabs/effects/ExplosionDroneDeath"); public static float healRadius = 12f; public static float shockRadius = 12f; public static float shockDamageCoefficient = 3f; public static float shockTimeInSeconds = 6f; public static float shockProcCoefficient = 1f; public static float shockForce = 500f; public static float hackRadius = 9f; public static float hackBaseDuration = 15f; public static GameObject supplyRadiusIndicator; public static float supplyRadius = 9f; public static List activeBeacons = new List(); public override string survivorName => "Captain"; public override string bodyName => "CaptainBody"; public override void Init() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Captain.CaptainBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); ChangeVanillaPrimaries(primary); ChangeVanillaSecondaries(secondary); ChangeVanillaUtilities(utility); }); SurvivorTweaksPlugin.LoadAsync(RoR2_Base_CaptainDefenseMatrix.CaptainDefenseMatrix_asset, (Action)RetierMicrobot); DefenseMatrixOn.OnEnter += new hook_OnEnter(NerfMicrobots); LanguageAPI.Add("ITEM_CAPTAINDEFENSEMATRIX_DESC", "Shoot down 1 (+1 per stack) projectiles " + $"within {microbotRadius}m every {microbotRechargeRate} seconds. " + "Recharge rate scales with attack speed."); AimThrowableBase.ModifyProjectile += new hook_ModifyProjectile(ModifyDiabloDuration); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Captain/CaptainAirstrikeAltProjectile.prefab").WaitForCompletion(); if (Object.op_Implicit((Object)(object)val)) { ProjectileController component = val.GetComponent(); component.cannotBeDeleted = true; ProjectileImpactExplosion component2 = val.GetComponent(); ((ProjectileExplosion)component2).blastAttackerFiltering = (AttackerFiltering)1; } SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Captain.CaptainHealingWard_prefab, (Action)TweakHealZone); ShockZoneMainState.OnEnter += new hook_OnEnter(ShockZoneChanges); ShockZoneMainState.Shock += new hook_Shock(ShockAttackChanges); HackingMainState.OnEnter += new hook_OnEnter(HackZoneChanges); HackingInProgressState.OnEnter += new hook_OnEnter(HackProgressChanges); SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Captain.CaptainSupplyDrop__EquipmentRestock_prefab, (Action)TweakSupplyBeacon); BaseCaptainSupplyDropState.OnEnter += new hook_OnEnter(SupplyDropOnEnter); if (refreshSupplyDrops) { IdleToChargingState.OnEnter += new hook_OnEnter(CaptainBeaconRefresh); LanguageAPI.Add("CAPTAIN_SPECIAL_DESCRIPTION", "Request up to 2 Supply Beacons. Beacons are refreshed at the teleporter event."); } LanguageAPI.Add("CAPTAIN_SUPPLY_EQUIPMENT_RESTOCK_DESCRIPTION", "Recharge Equipment on use. Reduces the cooldowns of nearby allies by " + Tools.ConvertDecimal(CommonAssets.captainCdrPercent) + "."); LanguageAPI.Add("CAPTAIN_SUPPLY_SHOCKING_DESCRIPTION", "Periodically Shock all nearby enemies, immobilizing them. Deals " + Tools.ConvertDecimal(shockDamageCoefficient) + " damage per hit."); void RetierMicrobot(ItemDef itemDef) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) itemDef.tier = (ItemTier)1; itemDef.deprecatedTier = (ItemTier)1; if (Object.op_Implicit((Object)(object)assetBundle) && assetBundle.Contains("Assets/Icons/Defensive_Microbots.png")) { Sprite val2 = assetBundle.LoadAsset("Assets/Icons/Defensive_Microbots.png"); if (Object.op_Implicit((Object)(object)val2)) { itemDef.pickupIconSprite = val2; } } } static void TweakHealZone(GameObject healZonePrefab) { HealingWard healWard = healZonePrefab.GetComponent(); if ((Object)(object)healWard != (Object)null) { healWard.radius = healRadius; } SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Captain.CaptainSupplyDrop__Hacking_prefab, (Action)GetHackBeaconIndicator); void GetHackBeaconIndicator(GameObject hackBeaconPrefab) { Transform[] componentsInChildren = hackBeaconPrefab.GetComponentsInChildren(); if (componentsInChildren.Length != 0) { Transform[] array = componentsInChildren; foreach (Transform val2 in array) { GameObject gameObject = ((Component)val2).gameObject; if (((Object)gameObject).name == "Indicator") { supplyRadiusIndicator = PrefabAPI.InstantiateClone(gameObject, "CaptainSupplyCdrRangeIndicator", false); break; } } } if ((Object)(object)supplyRadiusIndicator == (Object)null && (Object)(object)healWard != (Object)null) { supplyRadiusIndicator = PrefabAPI.InstantiateClone(((Component)healWard).gameObject, "CaptainSupplyCdrRangeIndicator", false); HealingWard component3 = supplyRadiusIndicator.GetComponent(); Object.Destroy((Object)(object)component3); } if ((Object)(object)supplyRadiusIndicator == (Object)null) { Debug.LogError((object)"Captain Restock beacon couldn't get indicator!"); } } } static void TweakSupplyBeacon(GameObject supplyBeaconPrefab) { BuffWard val2 = supplyBeaconPrefab.AddComponent(); val2.buffDef = CommonAssets.captainCdrBuff; val2.interval = 0.25f; val2.buffDuration = 0.5f; val2.radius = supplyRadius; } } private void MicrobotGah(orig_OnServerMasterSummonGlobal orig, CaptainDefenseMatrixController self, MasterSummonReport summonReport) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)self.characterBody.master) || !((Object)(object)self.characterBody.master == (Object)(object)summonReport.leaderMasterInstance)) { return; } CharacterMaster summonMasterInstance = summonReport.summonMasterInstance; if (Object.op_Implicit((Object)(object)summonMasterInstance)) { CharacterBody body = summonMasterInstance.GetBody(); if (Object.op_Implicit((Object)(object)body) && (body.bodyFlags & 2) > 0) { summonMasterInstance.inventory.GiveItem(Items.ScrapRed, self.defenseMatrixToGrantMechanicalAllies); } } } private void MicrobotGuh(orig_TryGrantItem orig, CaptainDefenseMatrixController self) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self.characterBody.master)) { bool flag = false; if (Object.op_Implicit((Object)(object)self.characterBody.master.playerStatsComponent)) { flag = self.characterBody.master.playerStatsComponent.currentStats.GetStatValueDouble(PerBodyStatDef.totalTimeAlive, BodyCatalog.GetBodyName(self.characterBody.bodyIndex)) > 0.0; } if (!flag && self.characterBody.master.inventory.GetItemCountEffective(Items.ScrapRed) <= 0) { self.characterBody.master.inventory.GiveItem(Items.ScrapRed, self.defenseMatrixToGrantPlayer); } } } private void ChangeVanillaUtilities(SkillFamily family) { utility.variants[1].skillDef.baseRechargeInterval = diabloMaxDuration + 20f; SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Captain.CaptainAirstrikeAltGhost_prefab, (Action)FixDiabloIndicator); SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Captain.CaptainAirstrikeAltProjectile_prefab, (Action)delegate(GameObject prefab) { ProjectileImpactExplosion val = default(ProjectileImpactExplosion); if (prefab.TryGetComponent(ref val)) { val.lifetime = diabloMaxDuration; } }); void FixDiabloIndicator(GameObject prefab) { ObjectScaleCurve[] componentsInChildren = prefab.GetComponentsInChildren(); ObjectScaleCurve[] array = componentsInChildren; foreach (ObjectScaleCurve val in array) { if (((Object)val).name == "IndicatorRing") { val.timeMax = diabloMaxDuration; } if (((Object)val).name == "Sphere, Inner Expanding") { val.timeMax = diabloMaxDuration; } } ObjectTransformCurve[] componentsInChildren2 = prefab.GetComponentsInChildren(); ObjectTransformCurve[] array2 = componentsInChildren2; foreach (ObjectTransformCurve val2 in array2) { if (((Object)val2).name == "Laser") { val2.timeMax = diabloMaxDuration; } } } } private void ModifyDiabloFriendlyFire(orig_InitializeProjectile orig, ProjectileController projectileController, FireProjectileInfo fireProjectileInfo) { //IL_0003: 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_0028: Invalid comparison between Unknown and I4 orig.Invoke(projectileController, fireProjectileInfo); GameObject gameObject = ((Component)projectileController).gameObject; ProjectileImpactExplosion component = gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (int)((ProjectileExplosion)component).blastAttackerFiltering == 1) { projectileController.teamFilter.teamIndex = (TeamIndex)(-1); } } private void ModifyDiabloDuration(orig_ModifyProjectile orig, AimThrowableBase self, ref FireProjectileInfo fireProjectileInfo) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, ref fireProjectileInfo); if (self is CallAirstrikeAlt) { fireProjectileInfo.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)262144); fireProjectileInfo.useFuseOverride = true; ((FireProjectileInfo)(ref fireProjectileInfo)).fuseOverride = diabloMaxDuration; } } private void CaptainBeaconRefresh(orig_OnEnter orig, IdleToChargingState self) { //IL_00cf: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown orig.Invoke(self); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { CharacterBody body = instance.body; if ((Object)(object)body != (Object)null) { CaptainSupplyDropController component = ((Component)body).GetComponent(); if ((Object)(object)component != (Object)null) { component.supplyDrop1Skill.stock = Mathf.Max(component.supplyDrop1Skill.maxStock, 1); component.supplyDrop2Skill.stock = Mathf.Max(component.supplyDrop2Skill.maxStock, 1); } } } for (int i = 0; i < activeBeacons.Count; i++) { GameObject val = activeBeacons[i]; if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); EffectManager.SpawnEffect(beaconExplosion, new EffectData { origin = val.transform.position, scale = 10f }, false); } activeBeacons.Remove(val); } } private void SupplyDropOnEnter(orig_OnEnter orig, BaseCaptainSupplyDropState self) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (refreshSupplyDrops) { activeBeacons.Add(((EntityState)self).gameObject); } orig.Invoke(self); BuffWard component = ((EntityState)self).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { if ((Object)(object)supplyRadiusIndicator != (Object)null && (Object)(object)component.rangeIndicator == (Object)null && NetworkServer.active) { GameObject val = Object.Instantiate(supplyRadiusIndicator, ((EntityState)self).transform.position, ((EntityState)self).transform.rotation); NetworkServer.Spawn(val); component.rangeIndicator = val.transform; } component.teamFilter = self.teamFilter; } } private void NerfMicrobots(orig_OnEnter orig, DefenseMatrixOn self) { DefenseMatrixOn.baseRechargeFrequency = 1f / microbotRechargeRate; DefenseMatrixOn.projectileEraserRadius = microbotRadius; orig.Invoke(self); } private void ChangeVanillaPrimaries(SkillFamily family) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = shotgunCooldown; skillDef.beginSkillCooldownOnSkillEnd = true; skillDef.baseMaxStock = shotgunStock; skillDef.rechargeStock = shotgunStock; skillDef.stockToConsume = 1; skillDef.resetCooldownTimerOnUse = true; skillDef.mustKeyPress = false; skillDef.attackSpeedBuffsRestockSpeed = true; skillDef.keywordTokens = new string[1] { "2R4R_NOATTACKSPEEDMULTIPLICATIVE_KEYWORD" }; ChargeCaptainShotgun.OnEnter += new hook_OnEnter(CaptainShotgunCharge); FireCaptainShotgun.OnEnter += new hook_OnEnter(CaptainShotgunFixes); FireCaptainShotgun.ModifyBullet += new hook_ModifyBullet(CaptainShotgunModifyBullet); LanguageAPI.Add("CAPTAIN_PRIMARY_DESCRIPTION", "Exacting. Fire a blast of pellets that deal 8x" + Tools.ConvertDecimal(shotgunPelletDamageCoeff) + " damage. " + $"Charging the attack narrows the spread. Hold up to {shotgunStock} charges."); } private void CaptainShotgunCharge(orig_OnEnter orig, ChargeCaptainShotgun self) { orig.Invoke(self); self.chargeDuration = shotgunChargeDuration; self.minChargeDuration = 0.05f; } private void CaptainShotgunFixes(orig_OnEnter orig, FireCaptainShotgun self) { ((GenericBulletBaseState)self).damageCoefficient = shotgunPelletDamageCoeff; ((GenericBulletBaseState)self).procCoefficient = shotgunPelletProcCoeff; ((GenericBulletBaseState)self).baseDuration = shotgunWindDownDuration; orig.Invoke(self); } private void CaptainShotgunModifyBullet(orig_ModifyBullet orig, FireCaptainShotgun self, BulletAttack bulletAttack) { orig.Invoke(self, bulletAttack); if (attackSpeedDamageAdditive) { bulletAttack.damage += ((EntityState)self).characterBody.baseDamage * ((BaseState)self).attackSpeedStat; } else { bulletAttack.damage *= ((BaseState)self).attackSpeedStat; } } private void ChangeVanillaSecondaries(SkillFamily family) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = tazerCooldown; SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Captain.CaptainTazer_prefab, (Action)TweakTazer); ProjectileStickOnImpact.TrySticking += new hook_TrySticking(StickDamageBonus); LanguageAPI.Add("CAPTAIN_SECONDARY_DESCRIPTION", "Shocking. " + $"Fire a fast tazer that deals {tazerTotalTargets}x{Tools.ConvertDecimal(tazerDamage)} damage."); FireTazer.OnEnter += new hook_OnEnter(CaptainTazerBuff); static void TweakTazer(GameObject tazerPrefab) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) ProjectileStickOnImpact val = default(ProjectileStickOnImpact); if (tazerPrefab.TryGetComponent(ref val)) { Object.Destroy((Object)(object)val); } ProjectileLightningOnImpact projectileLightningOnImpact = tazerPrefab.AddComponent(); ((ProjectileProximityBeamController)projectileLightningOnImpact).attackFireCount = 1; ((ProjectileProximityBeamController)projectileLightningOnImpact).attackInterval = 99f; ((ProjectileProximityBeamController)projectileLightningOnImpact).attackRange = 21f; ((ProjectileProximityBeamController)projectileLightningOnImpact).lightningType = (LightningType)8; ((ProjectileProximityBeamController)projectileLightningOnImpact).inheritDamageType = true; ((ProjectileProximityBeamController)projectileLightningOnImpact).damageCoefficient = 1f; ((ProjectileProximityBeamController)projectileLightningOnImpact).procCoefficient = 1f; ((ProjectileProximityBeamController)projectileLightningOnImpact).bounces = tazerTotalTargets - 1; ((Behaviour)projectileLightningOnImpact).enabled = true; ProjectileImpactExplosion val2 = default(ProjectileImpactExplosion); if (tazerPrefab.TryGetComponent(ref val2)) { ((ProjectileExplosion)val2).blastRadius = 3f; ((ProjectileExplosion)val2).blastDamageCoefficient = 0.25f; ((ProjectileExplosion)val2).blastProcCoefficient = 0f; val2.timerAfterImpact = true; val2.lifetimeAfterImpact = 1f; val2.impactOnWorld = true; val2.destroyOnWorld = true; } } } private void CaptainTazerBuff(orig_OnEnter orig, FireTazer self) { FireTazer.damageCoefficient = tazerDamage; orig.Invoke(self); } private bool StickDamageBonus(orig_TrySticking orig, ProjectileStickOnImpact self, Collider hitCollider, Vector3 impactNormal) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) return orig.Invoke(self, hitCollider, impactNormal); } private void ShockZoneChanges(orig_OnEnter orig, ShockZoneMainState self) { ShockZoneMainState.shockRadius = shockRadius; ShockZoneMainState.shockFrequency = 1f / shockTimeInSeconds; ProjectileDamage component = ((EntityState)self).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { ((BaseState)self).damageStat = component.damage / 20f; } orig.Invoke(self); } private void ShockAttackChanges(orig_Shock orig, ShockZoneMainState self) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown GameObject ownerObject = ((EntityState)self).gameObject.GetComponent().ownerObject; new BlastAttack { radius = ShockZoneMainState.shockRadius, baseDamage = ((BaseState)self).damageStat * shockDamageCoefficient, damageType = DamageTypeCombo.op_Implicit((DamageType)16777216), falloffModel = (FalloffModel)0, attacker = ownerObject, teamIndex = ((BaseCaptainSupplyDropState)self).teamFilter.teamIndex, position = ((EntityState)self).transform.position, bonusForce = Vector3.up * shockForce, procCoefficient = shockProcCoefficient }.Fire(); if (Object.op_Implicit((Object)(object)ShockZoneMainState.shockEffectPrefab)) { EffectManager.SpawnEffect(ShockZoneMainState.shockEffectPrefab, new EffectData { origin = ((EntityState)self).transform.position, scale = ShockZoneMainState.shockRadius }, false); } } private void HackZoneChanges(orig_OnEnter orig, HackingMainState self) { HackingMainState.baseRadius = hackRadius; orig.Invoke(self); } private void HackProgressChanges(orig_OnEnter orig, HackingInProgressState self) { HackingInProgressState.baseDuration = hackBaseDuration; orig.Invoke(self); } } internal class ProjectileLightningOnImpact : ProjectileProximityBeamController, IProjectileImpactBehavior { public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { DoLightning(); } public void DoLightning() { Log.Warning("B"); if (NetworkServer.active) { base.attackTimer = 0f; } } } internal class ProjectileIncreaseDamageOnStick : MonoBehaviour { public float damageMultiplier = 2f; public int maxApplications = 1; public int currentApplications; private void Start() { currentApplications = 0; } public void IncreaseDamage(ProjectileStickOnImpact sticky) { if (!sticky.stuck && !((Object)(object)sticky.stuckTransform != (Object)null) && !((Object)(object)sticky.stuckBody != (Object)null) && currentApplications < maxApplications) { ProjectileDamage component = ((Component)this).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { currentApplications++; component.damage *= damageMultiplier; } } } } internal class CommandoTweaks : SurvivorTweakBase { public static float primaryDamageCoeff = 1.4f; public static float primaryDurationLeft = 0.16f; public static float primaryDurationRight = 0.24f; public static GameObject phaseRoundPrefab; public static float phaseRoundDamageCoeff = 5f; public static float phaseRoundCooldown = 4f; public static float phaseRoundDuration = 0.7f; public static float phaseRoundScale = 2f; public static float phaseBlastDamageCoeff = 3f; public static float phaseBlastCooldown = 5f; public static int rollStock = 2; public static float rollCooldown = 6f; public static float rollDuration = 0.2f; public static float rollAspdBuff = 0.6f; public static float rollAspdDuration = 1f; public static int slideStock = 1; public static float slideCooldown = 8f; public static float slideMaxDuration = 4f; public static float slideSpeedMultiplier = 0.6f; public static float slideStrafeMultiplier = 0.02f; public static float slideJumpDuration = 0.6f; public static float slideJumpMultiplier = 1.2f; public static int soupMaxTargets = 4; public static int soupBaseShots = 8; public static float soupDamageCoeff = 1.8f; public static float soupProcCoeff = 1f; public static float soupCooldown = 13f; public static float nadeRadius = 16f; public static float nadeCooldown = 8f; public static float nadeMass = 2.5f; public static float nadeDrag = 0.9f; public override string survivorName => "Commando"; public override string bodyName => "CommandoBody"; public override void Init() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Commando.CommandoBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); ChangeSecondaries(secondary); ChangeUtilities(); ChangeSpecials(); }); FirePistol2.OnEnter += new hook_OnEnter(FirePistol2_OnEnter); LanguageAPI.Add("COMMANDO_PRIMARY_DESCRIPTION", "Rapidly shoot an enemy for " + Tools.ConvertDecimal(primaryDamageCoeff) + " damage."); } private void FirePistol2_OnEnter(orig_OnEnter orig, FirePistol2 self) { FirePistol2.damageCoefficient = primaryDamageCoeff; orig.Invoke(self); self.duration = ((self.pistol % 2 == 0) ? primaryDurationLeft : primaryDurationRight) / ((BaseState)self).attackSpeedStat; } private void ChangeSpecials() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) SkillDef skillDef = special.variants[0].skillDef; Content.AddEntityState(typeof(SoupTargeting)); Content.AddEntityState(typeof(SoupFire)); SerializableEntityStateType activationState = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref activationState))..ctor(typeof(SoupTargeting)); skillDef.activationState = activationState; skillDef.baseRechargeInterval = soupCooldown; skillDef.beginSkillCooldownOnSkillEnd = true; skillDef.activationStateMachineName = "Weapon"; LanguageAPI.Add("COMMANDO_SPECIAL_NAME", "Suppressive Barrage"); LanguageAPI.Add("COMMANDO_SPECIAL_DESCRIPTION", "Stunning. " + $"Take aim at up to {soupMaxTargets} enemies, " + $"then fire at each target for {SoupFire.baseDuration} seconds, " + "dealing " + Tools.ConvertDecimal(soupDamageCoeff) + " damage per shot."); SkillDef skillDef2 = special.variants[1].skillDef; skillDef2.baseRechargeInterval = nadeCooldown; skillDef2.keywordTokens = new string[1] { "KEYWORD_IGNITE" }; GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion(); ProjectileDamage component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.damageType |= DamageTypeCombo.op_Implicit((DamageType)128); } Rigidbody component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.mass = nadeMass; component2.drag = nadeDrag; } ProjectileImpactExplosion component3 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { ((ProjectileExplosion)component3).blastRadius = nadeRadius; GameObject val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Commando/OmniExplosionVFXCommandoGrenade.prefab").WaitForCompletion(); val2.transform.localScale = Vector3.one * nadeRadius * 4f / 11f; } LanguageAPI.Add("COMMANDO_SPECIAL_ALT1_NAME", "Incendiary Grenade"); LanguageAPI.Add("COMMANDO_SPECIAL_ALT1_DESCRIPTION", "Ignite. Throw a grenade that explodes for 700% damage. Can hold up to 2."); } private void ChangeUtilities() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) SkillDef skillDef = utility.variants[0].skillDef; skillDef.baseMaxStock = rollStock; skillDef.rechargeStock = rollStock; skillDef.baseRechargeInterval = rollCooldown; skillDef.forceSprintDuringState = true; skillDef.cancelSprintingOnActivation = false; skillDef.resetCooldownTimerOnUse = false; DodgeState.OnEnter += new hook_OnEnter(DodgeBuff); DodgeState.OnExit += new hook_OnExit(DodgeBuffExit); LanguageAPI.Add("COMMANDO_UTILITY_DESCRIPTION", "Roll a short distance, then briefly increase your attack speed by " + Tools.ConvertDecimal(rollAspdBuff) + ". " + $"Has {rollStock} charges."); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RollStatBuff); SkillDef skillDef2 = utility.variants[1].skillDef; Content.AddEntityState(typeof(UltraSlide)); Content.AddEntityState(typeof(UltraDash)); SerializableEntityStateType activationState = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref activationState))..ctor(typeof(UltraSlide)); skillDef2.activationState = activationState; skillDef2.baseRechargeInterval = slideCooldown; skillDef2.baseMaxStock = slideStock; skillDef2.rechargeStock = 1; skillDef2.beginSkillCooldownOnSkillEnd = true; LanguageAPI.Add("COMMANDO_UTILITY_ALT_DESCRIPTION", "Hold to slide on the ground. While sliding, jump to dash in another direction. You can fire while sliding."); } private void ChangeSecondaries(SkillFamily secondary) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_Base_Commando.FMJRamping_prefab); val.Completed += delegate(AsyncOperationHandle ctx) { //IL_0018: 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) phaseRoundPrefab = ctx.Result; Transform transform = phaseRoundPrefab.transform; transform.localScale *= phaseRoundScale; }; GenericProjectileBaseState.OnEnter += new hook_OnEnter(PhaseRoundBuff); secondary.variants[0].skillDef.baseRechargeInterval = phaseRoundCooldown; secondary.variants[0].skillDef.fullRestockOnAssign = false; LanguageAPI.Add("COMMANDO_SECONDARY_DESCRIPTION", "Fire a piercing bullet for " + Tools.ConvertDecimal(phaseRoundDamageCoeff) + " damage. Deals 40% more damage every time it passes through an enemy."); GenericBulletBaseState.OnEnter += new hook_OnEnter(PhaseBlastBuff); secondary.variants[1].skillDef.baseRechargeInterval = phaseBlastCooldown; secondary.variants[1].skillDef.fullRestockOnAssign = false; LanguageAPI.Add("COMMANDO_SECONDARY_ALT1_DESCRIPTION", "Fire two close-range blasts that deal 8x" + Tools.ConvertDecimal(phaseBlastDamageCoeff) + " damage total."); } private void PhaseRoundBuff(orig_OnEnter orig, GenericProjectileBaseState self) { if (self is FireFMJ) { self.damageCoefficient = phaseRoundDamageCoeff; self.baseDuration = phaseRoundDuration; } orig.Invoke(self); } private void PhaseBlastBuff(orig_OnEnter orig, GenericBulletBaseState self) { if (self is FireShotgunBlast) { self.damageCoefficient = phaseBlastDamageCoeff; } orig.Invoke(self); } private void DodgeBuff(orig_OnEnter orig, DodgeState self) { self.duration = rollDuration; self.initialSpeedCoefficient = 10f; self.finalSpeedCoefficient = 2.5f; orig.Invoke(self); } private void DodgeBuffExit(orig_OnExit orig, DodgeState self) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); ((EntityState)self).characterBody.AddTimedBuffAuthority(CommonAssets.commandoRollBuff.buffIndex, rollAspdDuration); ((EntityState)self).characterBody.SetSpreadBloom(0f, false); } private void RollStatBuff(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(CommonAssets.commandoRollBuff)) { args.attackSpeedMultAdd += rollAspdBuff; } } private void SoupBuff(orig_OnEnter orig, FireBarrage self) { FireBarrage.damageCoefficient = soupDamageCoeff; orig.Invoke(self); } } internal class EngiTweaks : SurvivorTweakBase { public static float grenadeCooldown = 1.2f; public static float grenadeDamage = 1.3f; public static float grenadeStunChance = 25f; public static int grenadeCount = 3; public static int grenadeStock = 1; public static float mineArmingDuration = 2f; public static GameObject bubbleShieldPrefab; public static float bubbleShieldRadius = 15f; public override string survivorName => "Engineer"; public override string bodyName => "ENGIBODY"; public override void Init() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown ShelterUtilsModule.UseCustomShelters = true; SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Engi.EngiBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); DoPrimary(primary); DoUtility(utility); }); Detonate.Explode += new Manipulator(DetonationRadiusBoost); MineArmingWeak.FixedUpdate += new hook_FixedUpdate(ChangeMineArmTime); } private void DoPrimary(SkillFamily primary) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown SkillDef skillDef = primary.variants[0].skillDef; skillDef.cancelSprintingOnActivation = false; skillDef.keywordTokens = new string[2] { "KEYWORD_AGILE", "KEYWORD_STUNNING" }; skillDef.activationState = new SerializableEntityStateType(typeof(FireGrenades)); skillDef.stockToConsume = 1; skillDef.baseMaxStock = grenadeStock; skillDef.rechargeStock = grenadeStock; skillDef.baseRechargeInterval = grenadeCooldown; skillDef.beginSkillCooldownOnSkillEnd = true; skillDef.resetCooldownTimerOnUse = false; LanguageAPI.Add(skillDef.skillDescriptionToken, "Agile. Stunning. " + $"Fire {grenadeCount * grenadeStock} grenades that deal " + "" + Language.Styling.ConvertDecimal(grenadeDamage) + " damage each."); FireGrenades.OnEnter += new hook_OnEnter(GrenadeStats); FireGrenades.FireGrenade += new Manipulator(GrenadeStunChance); } private void GrenadeStats(orig_OnEnter orig, FireGrenades self) { FireGrenades.damageCoefficient = grenadeDamage; self.grenadeCountMax = grenadeCount; orig.Invoke(self); } private void GrenadeStunChance(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "FireProjectile") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(FireProjectileInfo projectileInfo, EntityState self) { //IL_0042: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (Util.CheckRoll(grenadeStunChance, self.characterBody.master)) { projectileInfo.damageTypeOverride = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)1); } projectileInfo.force = 100f; return projectileInfo; }); } private void DoUtility(SkillFamily slot) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown LanguageAPI.Add("ENGI_UTILITY_DESCRIPTION", "Sheltering. Place an impenetrable shield that blocks all incoming damage, and slows enemies inside."); SkillDef skillDef = slot.variants[0].skillDef; skillDef.keywordTokens = new string[1] { "2R4R_SHELTER_KEYWORD" }; bubbleShieldPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiBubbleShield.prefab").WaitForCompletion(); Transform val = bubbleShieldPrefab.transform.Find("Collision"); val.localScale = Vector3.one * bubbleShieldRadius * 2f; ShelterProviderBehavior val2 = ((Component)val).gameObject.AddComponent(); if (Object.op_Implicit((Object)(object)val2)) { val2.fallbackRadius = bubbleShieldRadius; } BuffWard val3 = ((Component)val).gameObject.AddComponent(); val3.buffDef = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/bdSlow50.asset").WaitForCompletion(); val3.buffDuration = 0.3f; val3.interval = 0.2f; val3.radius = bubbleShieldRadius; val3.invertTeamFilter = true; Deployed.FixedUpdate += new hook_FixedUpdate(BubbleBuffwardTeam); } private void BubbleBuffwardTeam(orig_FixedUpdate orig, Deployed self) { bool hasDeployed = self.hasDeployed; orig.Invoke(self); if (!hasDeployed && self.hasDeployed) { BuffWard componentInChildren = ((EntityState)self).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.teamFilter = ((Component)((EntityState)self).outer).GetComponent(); } } } private void ReplaceBubbleShieldPrefab(orig_OnEnter orig, FireMines self) { if (self is FireBubbleShield) { self.projectilePrefab = bubbleShieldPrefab; } orig.Invoke(self); } private void ChangeMineArmTime(orig_FixedUpdate orig, MineArmingWeak self) { MineArmingWeak.duration = mineArmingDuration; orig.Invoke(self); } private void DetonationRadiusBoost(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "radius") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float startRadius, EntityState state) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) ProjectileController projectileController = state.projectileController; if (projectileController != null) { TeamFilter teamFilter = projectileController.teamFilter; if (((teamFilter != null) ? new TeamIndex?(teamFilter.teamIndex) : ((TeamIndex?)null)) == (TeamIndex?)1) { return startRadius + 2f; } } return startRadius; }); } } internal class HereticTweaks : SurvivorTweakBase { public static GameObject secondaryProjectile = LegacyResourcesAPI.Load("prefabs/projectiles/LunarSecondaryProjectile"); public static float secondaryMaxCharge = 3f; public static float secondaryBladesDamage = 1f; public static float secondaryBladesFrequency = 6f; public static float secondaryBladesProc = 0.5f; public static float secondaryExplosionDamage = 9f; public static float secondaryExplosionProc = 1f; public static float shadowfadeBaseHealFraction = 0.25f; public override string bodyName => "HereticBody"; public override string survivorName => "Heretic"; public override void Init() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Engi.EngiBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); CharacterBody component3 = bodyObject.GetComponent(); component3.baseMaxHealth = 260f; component3.baseRegen = -4f; component3.baseDamage = 16f; component3.baseArmor = 30f; component3.levelMaxHealth = component3.baseMaxHealth * 0.3f; component3.levelRegen = component3.baseRegen * 0.2f; component3.levelDamage = component3.baseDamage * 0.2f; }); ProjectileDotZone component = secondaryProjectile.GetComponent(); component.damageCoefficient = secondaryBladesDamage / secondaryExplosionDamage; component.resetFrequency = secondaryBladesFrequency; component.fireFrequency = secondaryBladesFrequency * 3f; component.overlapProcCoefficient = secondaryBladesProc / secondaryExplosionProc; ProjectileExplosion component2 = secondaryProjectile.GetComponent(); component2.blastDamageCoefficient = 1f; component2.blastProcCoefficient = secondaryExplosionProc; component2.falloffModel = (FalloffModel)1; component2.blastRadius = 17f; BaseThrowBombState.OnEnter += new hook_OnEnter(HooksDamageBuff); BaseChargeBombState.OnEnter += new hook_OnEnter(HooksChargeTweak); LanguageAPI.Add("SKILL_LUNAR_SECONDARY_REPLACEMENT_DESCRIPTION", "Charge up a ball of blades that deals " + Tools.ConvertDecimal(secondaryBladesDamage * secondaryBladesFrequency) + " damage per second. After a delay, explode and root all enemies for " + Tools.ConvertDecimal(secondaryExplosionDamage) + " damage."); GhostUtilitySkillState.OnEnter += new hook_OnEnter(ShadowfadeEnter); GhostUtilitySkillState.OnEnter += new hook_OnEnter(ShadowfadeExit); LanguageAPI.Add("SKILL_LUNAR_UTILITY_REPLACEMENT_DESCRIPTION", "Fade away, becoming intangible and gaining movement speed. Heal for " + Tools.ConvertDecimal(shadowfadeBaseHealFraction) + " of your maximum health."); } private static void HooksChargeTweak(orig_OnEnter orig, BaseChargeBombState self) { if (self is ChargeLunarSecondary) { self.baseDuration = secondaryMaxCharge; } orig.Invoke(self); } private static void HooksDamageBuff(orig_OnEnter orig, BaseThrowBombState self) { if (self is ThrowLunarSecondary) { self.minDamageCoefficient = secondaryExplosionDamage; self.maxDamageCoefficient = secondaryExplosionDamage; } orig.Invoke(self); } private static void ShadowfadeEnter(orig_OnEnter orig, GhostUtilitySkillState self) { orig.Invoke(self); GhostUtilitySkillState.healFractionPerTick = shadowfadeBaseHealFraction / (GhostUtilitySkillState.baseDuration * GhostUtilitySkillState.healFrequency); } private static void ShadowfadeExit(orig_OnEnter orig, GhostUtilitySkillState self) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { ((EntityState)self).healthComponent.HealFraction(GhostUtilitySkillState.healFractionPerTick, default(ProcChainMask)); } orig.Invoke(self); } } internal class HuntressTweaks : SurvivorTweakBase { public static bool isLoaded; public static GameObject arrowRainPrefab; private static float baseDamage = 14f; private static float glaiveBaseDamage = 3.4f; private static float glaiveBounceDamage = 1.1f; private static int arrowRainCooldown = 22; private static float arrowRainRadius = 14f; private static float arrowRainProcCoeff = 0.3f; private static float arrowRainDamageCoeffPerSecond = 4f; private static float arrowRainHitFrequency = 4f; private static float arrowRainLifetime = 8f; private static int ballistaCooldown = 18; private static float ballistaDamageCoefficient = 8f; private static float ballistaProcCoefficient = 2f; public override string survivorName => "Huntress"; public override string bodyName => "HuntressBody"; public override void Init() { SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Huntress.HuntressBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); CharacterBody component = bodyObject.GetComponent(); component.baseDamage = baseDamage; component.levelDamage = component.baseDamage * 0.2f; ChangeVanillaPrimary(primary); ChangeVanillaSecondaries(secondary); ChangeVanillaUtilities(utility); ChangeVanillaSpecials(special); }); } private void ChangeVanillaPrimary(SkillFamily family) { } private void ChangeVanillaSecondaries(SkillFamily family) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown LanguageAPI.Add("HUNTRESS_SECONDARY_DESCRIPTION", "Throw a seeking glaive that bounces up to 6 times for " + Tools.ConvertDecimal(glaiveBaseDamage) + " damage. Damage increases by " + Tools.ConvertDecimal(glaiveBounceDamage - 1f) + " per bounce."); ThrowGlaive.OnEnter += new hook_OnEnter(BuffGlaive); LightningOrb.PickNextTarget += new hook_PickNextTarget(ChangeGlaiveTargeting); LightningOrb.Begin += new hook_Begin(ChangeGlaiveProperties); } private void ChangeGlaiveProperties(orig_Begin orig, LightningOrb self) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 orig.Invoke(self); if ((int)self.lightningType == 4) { self.canBounceOnSameTarget = false; } } private HurtBox ChangeGlaiveTargeting(orig_PickNextTarget orig, LightningOrb self, Vector3 position) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if ((int)self.lightningType != 4) { return orig.Invoke(self, position); } int count = self.bouncedObjects.Count; int num = count % 2; if (self.bouncedObjects.Count > num) { HealthComponent val = self.bouncedObjects[num]; if ((Object)(object)val != (Object)null && val.alive) { HurtBox mainHurtBox = val.body.mainHurtBox; if (Object.op_Implicit((Object)(object)mainHurtBox)) { return mainHurtBox; } Log.Error("glaive orb target has no hurtbox!"); } } HurtBox val2 = orig.Invoke(self, position); if ((Object)(object)val2 != (Object)null && self.bouncedObjects.Count > num) { self.bouncedObjects[num] = val2.healthComponent; } return val2; } private void BuffGlaive(orig_OnEnter orig, ThrowGlaive self) { ThrowGlaive.damageCoefficient = glaiveBaseDamage; ThrowGlaive.damageCoefficientPerBounce = glaiveBounceDamage; orig.Invoke(self); } private void ChangeVanillaUtilities(SkillFamily family) { } private void ChangeVanillaSpecials(SkillFamily family) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002a: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown BaseArrowBarrage.OnEnter += new hook_OnEnter(AddHuntressUltProtection); BaseArrowBarrage.OnExit += new hook_OnExit(RemoveHuntressUltProtection); arrowRainPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/HuntressArrowRain.prefab").WaitForCompletion(); family.variants[0].skillDef.baseRechargeInterval = arrowRainCooldown; ArrowRain.arrowRainRadius = arrowRainRadius; ArrowRain.OnEnter += new hook_OnEnter(BuffArrowRain); arrowRainPrefab.transform.localScale = Vector3.one * 2f * arrowRainRadius; GameObject obj = arrowRainPrefab; ProjectileDotZone val = ((obj != null) ? obj.GetComponent() : null); if ((Object)(object)val != (Object)null) { val.damageCoefficient = arrowRainDamageCoeffPerSecond / (2.2f * arrowRainHitFrequency); val.resetFrequency = arrowRainHitFrequency; LanguageAPI.Add("HUNTRESS_SPECIAL_DESCRIPTION", "Teleport into the sky. Target an area to rain arrows, slowing all enemies and dealing " + Tools.ConvertDecimal(arrowRainDamageCoeffPerSecond) + " damage per second."); val.overlapProcCoefficient = arrowRainProcCoeff; val.lifetime = arrowRainLifetime; } SkillDef skillDef = family.variants[1].skillDef; skillDef.baseRechargeInterval = ballistaCooldown; skillDef.keywordTokens = new string[1] { "KEYWORD_SLAYER" }; GenericBulletBaseState.OnEnter += new hook_OnEnter(BallistaBuff); FireArrowSnipe.ModifyBullet += new hook_ModifyBullet(BallistaDamageType); LanguageAPI.Add("HUNTRESS_SPECIAL_ALT1_DESCRIPTION", "Slayer. Teleport backwards into the sky. Fire up to 3 energy bolts, dealing 3x" + Tools.ConvertDecimal(ballistaDamageCoefficient) + " damage."); } private void BallistaDamageType(orig_ModifyBullet orig, FireArrowSnipe self, BulletAttack bulletAttack) { orig.Invoke(self, bulletAttack); ref DamageType damageType = ref bulletAttack.damageType.damageType; damageType = (DamageType)((uint)damageType | 0x80000u); } private void AddHuntressUltProtection(orig_OnEnter orig, BaseArrowBarrage self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)self).characterBody)) { ((EntityState)self).characterBody.AddBuff(Buffs.SmallArmorBoost); } } private void RemoveHuntressUltProtection(orig_OnExit orig, BaseArrowBarrage self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && ((EntityState)self).characterBody.HasBuff(Buffs.SmallArmorBoost)) { ((EntityState)self).characterBody.RemoveBuff(Buffs.SmallArmorBoost); } } private void BallistaBuff(orig_OnEnter orig, GenericBulletBaseState self) { if (self is FireArrowSnipe) { self.damageCoefficient = ballistaDamageCoefficient; self.procCoefficient = ballistaProcCoefficient; } orig.Invoke(self); } private void BuffArrowRain(orig_OnEnter orig, ArrowRain self) { ArrowRain.arrowRainRadius = arrowRainRadius; orig.Invoke(self); } } internal class LoaderTweaks : SurvivorTweakBase { private float chargeFistCooldown = 10f; private float chargeZapFistCooldown = 10f; private float pylonDamage = 2f; public override string survivorName => "Loader"; public override string bodyName => "LoaderBody"; public override void Init() { GetBodyObject(); GetSkillsFromBodyObject(bodyObject); ChangeVanillaUtilities(utility); ThrowPylon.damageCoefficient = pylonDamage; } private void ChangeVanillaUtilities(SkillFamily family) { family.variants[0].skillDef.baseRechargeInterval = chargeFistCooldown; family.variants[1].skillDef.baseRechargeInterval = chargeZapFistCooldown; } } internal class MercTweaks : SurvivorTweakBase { public static bool attackSpeedDamageAdditive = true; public float moveSpeed = 8f; public static float primaryDamageCoefficient = 1.3f; public static float spinCooldown = 2.5f; public static float spinDamageCoefficient = 2.5f; public static float uppercutCooldown = 3.5f; public static float uppercutDamageCoefficient = 4.5f; public static float fastDashCooldown = 8f; public static float fastDashDamageCoefficient = 3f; public static float focusDashCooldown = 11f; public static float focusDashDamageCoefficient = 6f; public static float eviscCooldown = 11f; public static float eviscProcCoefficient = 0.4f; public static float eviscDuration = 2.5f; public static float windsCooldown = 9f; public static float windsProcCoefficient = 0.7f; public override string survivorName => "Mercenary"; public override string bodyName => "MERCBODY"; private static string exactingKeyword => attackSpeedDamageAdditive ? "2R4R_NOATTACKSPEEDADDITIVE_KEYWORD" : "2R4R_NOATTACKSPEEDMULTIPLICATIVE_KEYWORD"; public override void Init() { SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Merc.MercBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); CharacterBody component = bodyObject.GetComponent(); component.baseMoveSpeed = moveSpeed; DoPrimary(primary); DoSecondary(secondary); DoUtility(utility); DoSpecial(special); }); } private void DoPrimary(SkillFamily family) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GroundLight2.OnEnter += new hook_OnEnter(RemovePrimaryAspdScaling); SkillDef skillDef = family.variants[0].skillDef; skillDef.keywordTokens = new string[3] { "KEYWORD_AGILE", exactingKeyword, "KEYWORD_EXPOSE" }; LanguageAPI.Add(skillDef.skillDescriptionToken, "Agile. Exacting. Slice in front for " + Tools.ConvertDecimal(primaryDamageCoefficient) + ". Every 3rd hit strikes in a greater area and Exposes enemies."); } private void RemovePrimaryAspdScaling(orig_OnEnter orig, GroundLight2 self) { ((BasicMeleeAttack)self).damageCoefficient = primaryDamageCoefficient; orig.Invoke(self); ((BasicMeleeAttack)self).duration = ((BasicMeleeAttack)self).baseDuration; self.durationBeforeInterruptable = (self.isComboFinisher ? GroundLight2.comboFinisherBaseDurationBeforeInterruptable : GroundLight2.baseDurationBeforeInterruptable); ((BasicMeleeAttack)self).ignoreAttackSpeed = true; ((BasicMeleeAttack)self).scaleHitPauseDurationAndVelocityWithAttackSpeed = false; if (attackSpeedDamageAdditive) { OverlapAttack overlapAttack = ((BasicMeleeAttack)self).overlapAttack; overlapAttack.damage += ((EntityState)self).characterBody.baseDamage * ((BaseState)self).attackSpeedStat; } else { OverlapAttack overlapAttack2 = ((BasicMeleeAttack)self).overlapAttack; overlapAttack2.damage *= ((BaseState)self).attackSpeedStat; } } private void DoSecondary(SkillFamily family) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = spinCooldown; skillDef.cancelSprintingOnActivation = false; WhirlwindBase.OnEnter += new hook_OnEnter(SpinChanges); LanguageAPI.Add(skillDef.skillDescriptionToken, "Quickly slice horizontally twice, dealing 2x" + Tools.ConvertDecimal(spinDamageCoefficient) + " damage. If airborne, slice vertically instead."); SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.baseRechargeInterval = uppercutCooldown; skillDef2.cancelSprintingOnActivation = false; skillDef2.keywordTokens = new string[1] { exactingKeyword }; LanguageAPI.Add(skillDef2.skillDescriptionToken, "Exacting. Unleash a slicing uppercut, dealing " + Tools.ConvertDecimal(uppercutDamageCoefficient) + " damage and sending you airborne."); Uppercut.OnEnter += new hook_OnEnter(UppercutChanges); } private void SpinChanges(orig_OnEnter orig, WhirlwindBase self) { self.baseDamageCoefficient = spinDamageCoefficient; orig.Invoke(self); } private void UppercutChanges(orig_OnEnter orig, Uppercut self) { Uppercut.baseDamageCoefficient = uppercutDamageCoefficient; orig.Invoke(self); self.duration = Uppercut.baseDuration; if (attackSpeedDamageAdditive) { OverlapAttack overlapAttack = self.overlapAttack; overlapAttack.damage += ((EntityState)self).characterBody.baseDamage * ((BaseState)self).attackSpeedStat; } else { OverlapAttack overlapAttack2 = self.overlapAttack; overlapAttack2.damage *= ((BaseState)self).attackSpeedStat; } } private void DoUtility(SkillFamily family) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = fastDashCooldown; SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.baseRechargeInterval = focusDashCooldown; skillDef2.keywordTokens = new string[3] { "KEYWORD_STUNNING", exactingKeyword, "KEYWORD_EXPOSE" }; LanguageAPI.Add(skillDef2.skillDescriptionToken, "Stunning. Exacting. Dash forward, dealing " + Tools.ConvertDecimal(focusDashDamageCoefficient) + " damage and Exposing enemies after 1 second."); FocusedAssaultDash.OnEnter += new hook_OnEnter(RemoveFocusedDashAspdScaling); } private void RemoveFocusedDashAspdScaling(orig_OnEnter orig, FocusedAssaultDash self) { ((BasicMeleeAttack)self).damageCoefficient = 0.4f; self.delayedDamageCoefficient = focusDashDamageCoefficient; if (attackSpeedDamageAdditive) { self.delayedDamageCoefficient += ((BaseState)self).attackSpeedStat - 1f; } else { self.delayedDamageCoefficient *= ((BaseState)self).attackSpeedStat; } orig.Invoke(self); ((BasicMeleeAttack)self).duration = ((BasicMeleeAttack)self).baseDuration; } private void DoSpecial(SkillFamily family) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = eviscCooldown; Evis.OnEnter += new hook_OnEnter(EvisOnEnter); Evis.OnExit += new hook_OnExit(EvisOnExit); SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.baseRechargeInterval = windsCooldown; GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Merc/EvisOverlapProjectile.prefab").WaitForCompletion(); if (Object.op_Implicit((Object)(object)val)) { ProjectileOverlapAttack component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.overlapProcCoefficient = windsProcCoefficient; } } } private void EvisOnEnter(orig_OnEnter orig, Evis self) { Evis.duration = eviscDuration; Evis.procCoefficient = eviscProcCoefficient; orig.Invoke(self); } private void EvisOnExit(orig_OnExit orig, Evis self) { orig.Invoke(self); } } internal class MulTweaks : SurvivorTweakBase { private float nailSpreadCoefficient = 1.2f; public static float baseDamage = 12f; private GameObject scrapProjectile = LegacyResourcesAPI.Load("prefabs/projectiles/ToolbotGrenadeLauncherProjectile"); public static bool useScrapGravity = true; public static float scrapSpeed = 150f; public static float scrapCooldown = 3f; public static float scrapDamage = 3.6f; public static float scrapDuration = 0.2f; public static float retoolDuration = 0.5f; public override string survivorName => "MULT"; public override string bodyName => "TOOLBOTBODY"; public override void Init() { GetBodyObject(); GetSkillsFromBodyObject(bodyObject); SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Toolbot.ToolbotBody_prefab, (Action)delegate(GameObject result) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Expected O, but got Unknown //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Expected O, but got Unknown bodyObject = result; GetSkillsFromBodyObject(bodyObject); CharacterBody component = bodyObject.GetComponent(); component.baseMoveSpeed = 8f; component.acceleration = 25f; component.baseDamage = baseDamage; component.levelDamage = baseDamage * 0.2f; BaseNailgunState.FireBullet += new hook_FireBullet(FuckTheCorkscrewPattern); FireNailgun.OnExit += new hook_OnExit(NewNailgunBurst); NailgunSpinDown.GetBaseDuration += new hook_GetBaseDuration(FixWinddownDuration); NailgunSpinDown.FixedUpdate += new hook_FixedUpdate(RemoveNailgunBurst); ToolbotWeaponSkillDef val = (ToolbotWeaponSkillDef)primary.variants[0].skillDef; AnimationCurve crosshairSpreadCurve = val.crosshairSpreadCurve; ((SkillDef)val).beginSkillCooldownOnSkillEnd = true; ToolbotWeaponSkillDef val2 = (ToolbotWeaponSkillDef)primary.variants[1].skillDef; val2.crosshairSpreadCurve = crosshairSpreadCurve; FireGrenadeLauncher.OnEnter += new hook_OnEnter(ScrapBuff); ToolbotWeaponSkillDef val3 = (ToolbotWeaponSkillDef)primary.variants[2].skillDef; ((SkillDef)val3).resetCooldownTimerOnUse = false; ((SkillDef)val3).baseRechargeInterval = scrapCooldown; ((SkillDef)val3).attackSpeedBuffsRestockSpeed = true; ToolbotWeaponSkillDef val4 = (ToolbotWeaponSkillDef)primary.variants[3].skillDef; val4.crosshairSpreadCurve = crosshairSpreadCurve; CrosshairController component2 = val4.crosshairPrefab.GetComponent(); component2.maxSpreadAngle *= 4f; ((SkillDef)val4).canceledFromSprinting = true; ((SkillDef)val4).beginSkillCooldownOnSkillEnd = true; if (useScrapGravity) { ProjectileSimple component3 = scrapProjectile.GetComponent(); component3.desiredForwardSpeed = scrapSpeed; Rigidbody component4 = scrapProjectile.GetComponent(); component4.useGravity = true; AntiGravityForce val5 = scrapProjectile.AddComponent(); val5.rb = component4; val5.antiGravityCoefficient = 0.3f; } secondary.variants[0].skillDef.canceledFromSprinting = false; ToolbotStanceSwap.OnEnter += new hook_OnEnter(RetoolBuff); SkillDef skillDef = special.variants[0].skillDef; skillDef.baseRechargeInterval = retoolDuration * 4f; ToolbotDualWieldBase.OnEnter += new hook_OnEnter(PowerModeNerf); ToolbotDualWieldBase.OnExit += new hook_OnExit(UndoPowerMode); }); } private void SawFixedUpdate(orig_FixedUpdate orig, FireBuzzsaw self) { orig.Invoke(self); if (((EntityState)self).characterBody.isSprinting && (Object)(object)((BaseToolbotPrimarySkillState)self).skillDef == (Object)(object)((BaseSkillState)self).activatorSkillSlot.skillDef) { ((BaseSkillState)self).activatorSkillSlot.rechargeStopwatch = 0.5f; ((EntityState)self).outer.SetNextStateToMain(); } } private void UndoPowerMode(orig_OnExit orig, ToolbotDualWieldBase self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && Tools.isLoaded("com.Borbo.BORBO") && Object.op_Implicit((Object)(object)ToolbotDualWieldBase.penaltyBuff) && self.applyPenaltyBuff) { ((EntityState)self).characterBody.RemoveBuff(CommonAssets.aspdPenaltyDebuff); } } private void PowerModeNerf(orig_OnEnter orig, ToolbotDualWieldBase self) { if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && Tools.isLoaded("com.Borbo.BORBO") && Object.op_Implicit((Object)(object)ToolbotDualWieldBase.penaltyBuff) && self.applyPenaltyBuff) { ((EntityState)self).characterBody.AddBuff(CommonAssets.aspdPenaltyDebuff); } orig.Invoke(self); } private float FixWinddownDuration(orig_GetBaseDuration orig, NailgunSpinDown self) { return NailgunSpinDown.baseDuration + (float)NailgunFinalBurst.finalBurstBulletCount * FireNailgun.baseRefireInterval * NailgunFinalBurst.burstTimeCostCoefficient; } private void NewNailgunBurst(orig_OnExit orig, FireNailgun self) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody)) { ((EntityState)self).characterBody.SetSpreadBloom(1f, false); } Ray aimRay = ((BaseState)self).GetAimRay(); ((BaseNailgunState)self).FireBullet(((BaseState)self).GetAimRay(), NailgunFinalBurst.finalBurstBulletCount, BaseNailgunState.spreadPitchScale, BaseNailgunState.spreadYawScale); if (!((BaseToolbotPrimarySkillState)self).isInDualWield) { ((EntityState)self).PlayAnimation("Gesture, Additive", "FireGrenadeLauncher", "FireGrenadeLauncher.playbackRate", 0.45f / ((BaseState)self).attackSpeedStat, 0f); } else { BaseToolbotPrimarySkillStateMethods.PlayGenericFireAnim(self, ((EntityState)self).gameObject, skillLocator, 0.45f / ((BaseState)self).attackSpeedStat); } Util.PlaySound(NailgunFinalBurst.burstSound, ((EntityState)self).gameObject); if (((EntityState)self).isAuthority) { float num = NailgunFinalBurst.selfForce * (((EntityState)self).characterMotor.isGrounded ? 0.5f : 1f) * ((EntityState)self).characterMotor.mass; ((EntityState)self).characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * (0f - num), false, false); } Util.PlaySound(BaseNailgunState.fireSoundString, ((EntityState)self).gameObject); Util.PlaySound(BaseNailgunState.fireSoundString, ((EntityState)self).gameObject); Util.PlaySound(BaseNailgunState.fireSoundString, ((EntityState)self).gameObject); } private void RemoveNailgunBurst(orig_FixedUpdate orig, NailgunSpinDown self) { ((EntityState)self).fixedAge = ((EntityState)self).fixedAge + Time.fixedDeltaTime; if (((EntityState)self).fixedAge >= ((BaseNailgunState)self).duration && ((EntityState)self).isAuthority) { ((EntityState)self).outer.SetNextStateToMain(); } } private void ScrapBuff(orig_OnEnter orig, FireGrenadeLauncher self) { ((GenericProjectileBaseState)self).damageCoefficient = scrapDamage; ((GenericProjectileBaseState)self).baseDuration = scrapDuration; orig.Invoke(self); } private void RetoolBuff(orig_OnEnter orig, ToolbotStanceSwap self) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) self.baseDuration = retoolDuration; ((EntityState)self).characterBody.AddTimedBuffAuthority(ToolbotDualWieldBase.bonusBuff.buffIndex, self.baseDuration / ((BaseState)self).attackSpeedStat); orig.Invoke(self); } private void FuckTheCorkscrewPattern(orig_FireBullet orig, BaseNailgunState self, Ray aimRay, int bulletCount, float spreadPitchScale, float spreadYawScale) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, ((BaseState)self).GetAimRay(), bulletCount, 1f, 1f); } } internal class RexTweaks : SurvivorTweakBase { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnEnter <>9__15_0; internal void b__15_0(orig_OnEnter orig, FireMortar2 self) { FireMortar2.damageCoefficient = mortarDamageCoeff; orig.Invoke(self); } } private GameObject syringeB = LegacyResourcesAPI.Load("prefabs/projectiles/SyringeProjectileHealing"); private float syringeDamageCoefficient = 0.8f; private float syringeHealFraction = 0.3f; public static float mortarDamageCoeff = 6f; public static float mortarCooldown = 0.75f; public static float drillCooldown = 4f; public static int drillMaxStock = 1; private float brambleHealFraction = 0.07f; public override string bodyName => "TreebotBody"; public override string survivorName => "REX"; public override void Init() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown GetBodyObject(); SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Treebot.TreebotBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); ChangeVanillaSecondaries(secondary); special.variants[0].skillDef.keywordTokens = new string[1] { "2R4R_EXECUTION_KEYWORD" }; }); syringeB.GetComponent().fractionOfDamage = syringeHealFraction; FireSyringe.OnEnter += new hook_OnEnter(NerfSyringe); LanguageAPI.Add("TREEBOT_PRIMARY_DESCRIPTION", "Fire 3 syringes for 3x" + Tools.ConvertDecimal(syringeDamageCoefficient) + " damage. The last syringe Weakens and heals for " + Tools.ConvertDecimal(syringeHealFraction) + " of damage dealt."); LanguageAPI.Add("TREEBOT_SECONDARY_DESCRIPTION", "15% HP. Launch a mortar into the sky for " + Tools.ConvertDecimal(mortarDamageCoeff) + " damage."); FirePlantSonicBoom.OnEnter += new hook_OnEnter(NerfBrambleVolley); StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(HarvestFinisher); TreebotFireFruitSeed.OnEnter += new hook_OnEnter(FireFruitEnter); LanguageAPI.Add("TREEBOT_SPECIAL_ALT1_DESCRIPTION", "Finisher. Fire a injection that deals 330% damage. When killed, injected enemies drop multiple fruits that heal for 25% HP."); } private void HarvestFinisher(CharacterBody sender, MoreStatHookEventArgs args) { bool flag = sender.HasBuff(Buffs.Fruiting); args.ModifyBaseExecutionThreshold(SharedUtilsPlugin.GetSurvivorExecuteThreshold(sender.isBoss), flag); } private void NerfSyringe(orig_OnEnter orig, FireSyringe self) { FireSyringe.damageCoefficient = syringeDamageCoefficient; orig.Invoke(self); } private void ChangeVanillaSecondaries(SkillFamily family) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown SkillDef skillDef = family.variants[0].skillDef; skillDef.baseRechargeInterval = 4f; skillDef.baseMaxStock = drillMaxStock; SkillDef skillDef2 = family.variants[1].skillDef; skillDef2.baseRechargeInterval = mortarCooldown; object obj = <>c.<>9__15_0; if (obj == null) { hook_OnEnter val = delegate(orig_OnEnter orig, FireMortar2 self) { FireMortar2.damageCoefficient = mortarDamageCoeff; orig.Invoke(self); }; <>c.<>9__15_0 = val; obj = (object)val; } FireMortar2.OnEnter += (hook_OnEnter)obj; } private void NerfBrambleVolley(orig_OnEnter orig, FirePlantSonicBoom self) { FirePlantSonicBoom.healthFractionPerHit = brambleHealFraction; FirePlantSonicBoom.healthCostFraction = 0.2f; orig.Invoke(self); } private void FireFruitEnter(orig_OnEnter orig, TreebotFireFruitSeed self) { self.baseDuration = 0.5f; orig.Invoke(self); } } public abstract class SurvivorTweakBase : SurvivorTweakBase where T : SurvivorTweakBase { public static T instance { get; private set; } public SurvivorTweakBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting SurvivorTweaks " + typeof(SurvivorTweakBase).Name + " was instantiated twice"); } instance = this as T; } } public abstract class SurvivorTweakBase : SharedBase { public GameObject bodyObject; public SkillLocator skillLocator; public SkillFamily primary; public SkillFamily secondary; public SkillFamily utility; public SkillFamily special; public override string ConfigName => "Survivor Tweaks : " + survivorName; public override AssetBundle assetBundle => SurvivorTweaksPlugin.mainAssetBundle; public override string TOKEN_PREFIX => ""; public override string TOKEN_IDENTIFIER => ""; public abstract string survivorName { get; } public abstract string bodyName { get; } public override void Init() { base.Init(); } public override void Hooks() { } public override void Lang() { } public void GetBodyObject() { Debug.LogWarning((object)("FruitySurvivorTweaks: Using GetBodyObject for " + bodyName + ".")); bodyObject = GetBodyObject(bodyName); } public static GameObject GetBodyObject(string name) { return LegacyResourcesAPI.Load("prefabs/characterbodies/" + name); } public void GetSkillsFromBodyObject(GameObject bodyObject) { if (global::SurvivorTweaks.Modules.Skills.characterSkillLocators.ContainsKey(bodyName)) { skillLocator = global::SurvivorTweaks.Modules.Skills.characterSkillLocators[bodyName]; } else { skillLocator = bodyObject.GetComponent(); if (Object.op_Implicit((Object)(object)skillLocator)) { global::SurvivorTweaks.Modules.Skills.characterSkillLocators.Add(bodyName, skillLocator); } } if ((Object)(object)bodyObject != (Object)null) { if (Object.op_Implicit((Object)(object)skillLocator)) { primary = skillLocator.primary.skillFamily; secondary = skillLocator.secondary.skillFamily; utility = skillLocator.utility.skillFamily; special = skillLocator.special.skillFamily; } else { Debug.Log((object)("Skill locator from body " + bodyName + " is null!")); } } else { Debug.Log((object)("Body object from name " + bodyName + " is null!")); } } } internal class ViendTweaks : SurvivorTweakBase { public static GameObject viendPrimaryDamagePool; public static GameObject viendDelayKnockback; private static float corruptModeArmor = 100f; public static float baseMaxHealth = 130f; public static float baseDamage = 11f; private static float corruptionPerCleanse = 3f; private static float minimumCorruptionPerVoidItem = 2f; private static float corruptionForFullDamage = 50f; private static float corruptionForFullHeal = -50f; private static float corruptionFractionPerSecondWhileCorrupted = -1f / 15f; private static float corruptionPerSecondInCombat = 2.2222223f; private static float corruptionPerSecondOutOfCombat = 2.2222223f; private static float corruptionPerCrit = 0f; private static float maxCorruption = 100f; public static float primaryUnchargedDamage = 0.9f; public static float primaryChargedDamage = 4.8f; public static int primaryStepCount = 3; private static int primaryPoolDuration = 3; public static float primaryCorruptDps = 20f; public static float primaryCorruptTickRate = 8f; public static float secondaryUncorruptCooldown = 7f; public static float secondaryCorruptCooldown = 7f; public static int secondaryCorruptStock = 1; public static int secondaryCorruptRechargeStock = 1; public static float secondaryUncorruptBlastRadius = 6f; public static float secondaryCorruptBlastRadius = 12f; public override string survivorName => "Void Fiend"; public override string bodyName => "VoidSurvivorBody"; public override void Init() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) SurvivorTweaksPlugin.LoadAsync(RoR2_DLC1_VoidSurvivor.VoidSurvivorBody_prefab, (Action)delegate(GameObject result) { bodyObject = result; GetSkillsFromBodyObject(bodyObject); CharacterBody component = bodyObject.GetComponent(); component.baseMaxHealth = baseMaxHealth; component.levelMaxHealth = baseMaxHealth * 0.3f; component.baseDamage = baseDamage; component.levelDamage = baseDamage * 0.2f; DoViendPrimary(); }); HealthComponent.Heal += new hook_Heal(ViendNoHealing); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ViendStatCoefficients); VoidSurvivorController.OnEnable += new hook_OnEnable(VoidSurvivorController_OnEnable); DoViendSecondary(); VoidBlinkBase.OnEnter += new hook_OnEnter(VoidBlinkBase_OnEnter); LanguageAPI.Add("VOIDSURVIVOR_UTILITY_DESCRIPTION", "Disappear into the Void, cleansing all debuffs while moving in an upward arc. " + $"Gain {corruptionPerCleanse}% Corruption per debuff cleansed."); ChargeCrushBase.OnEnter += new hook_OnEnter(ChargeCrushBase_OnEnter); AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.CrushCorruption_asset); val.Completed += delegate(AsyncOperationHandle ctx) { SkillDef result = ctx.Result; result.baseMaxStock = 2; result.rechargeStock = 0; result.baseRechargeInterval = 0f; }; val = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.CrushHealth_asset); val.Completed += delegate(AsyncOperationHandle ctx) { SkillDef result = ctx.Result; result.baseMaxStock = 1; result.rechargeStock = 1; result.stockToConsume = 0; result.baseRechargeInterval = 15f; }; } private static void DoViendSecondary() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorMegaBlasterBigProjectile_prefab); val.Completed += delegate(AsyncOperationHandle ctx) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_00d9: Unknown result type (might be due to invalid IL or missing references) viendDelayKnockback = PrefabAPI.InstantiateClone(ctx.Result, "ViendDelayKnockback", true); Content.AddNetworkedObjectPrefab(viendDelayKnockback); ProjectileSetForceOnStart projectileSetForceOnStart = viendDelayKnockback.AddComponent(); projectileSetForceOnStart.force = 1000f; ProjectileImpactExplosion val3 = default(ProjectileImpactExplosion); if (viendDelayKnockback.TryGetComponent(ref val3)) { ((ProjectileExplosion)val3).blastRadius = secondaryCorruptBlastRadius; ((ProjectileExplosion)val3).blastAttackerFiltering = (AttackerFiltering)3; ((ProjectileExplosion)val3).explosionEffect = null; ((ProjectileExplosion)val3).bonusBlastForce = Vector3.up * 500f; ((ProjectileExplosion)val3).canRejectForce = false; val3.lifetime = 0.01f; val3.explodeOnLifeTimeExpiration = true; ((ProjectileExplosion)val3).blastProcCoefficient = 0f; } AsyncOperationHandle val4 = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorMegaBlasterBigProjectile_prefab); val4.Completed += delegate(AsyncOperationHandle val5) { GameObject result = val5.Result; ProjectileImpactExplosion val6 = default(ProjectileImpactExplosion); if (result.TryGetComponent(ref val6)) { ((ProjectileExplosion)val6).blastRadius = secondaryUncorruptBlastRadius; ((ProjectileExplosion)val6).childrenCount = 1; ((ProjectileExplosion)val6).childrenDamageCoefficient = 0f; ((ProjectileExplosion)val6).childrenInheritDamageType = false; ((ProjectileExplosion)val6).childrenProjectilePrefab = viendDelayKnockback; ((ProjectileExplosion)val6).fireChildren = true; } }; val4 = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorMegaBlasterBigProjectileCorrupted_prefab); val4.Completed += delegate(AsyncOperationHandle val5) { GameObject result = val5.Result; ProjectileImpactExplosion val6 = default(ProjectileImpactExplosion); if (result.TryGetComponent(ref val6)) { Debug.LogError((object)"VoidSurvivorMegaBlasterBigProjectileCorrupted_prefab"); ((ProjectileExplosion)val6).blastRadius = secondaryCorruptBlastRadius; ((ProjectileExplosion)val6).childrenCount = 1; ((ProjectileExplosion)val6).childrenDamageCoefficient = 0f; ((ProjectileExplosion)val6).childrenInheritDamageType = false; ((ProjectileExplosion)val6).childrenProjectilePrefab = viendDelayKnockback; ((ProjectileExplosion)val6).fireChildren = true; } }; }; LanguageAPI.Add("VOIDSURVIVOR_SECONDARY_DESCRIPTION", "Agile. Fire a plasma bolt for 600% damage. Fully charge it for an explosive plasma ball instead, dealing 1100% damage."); AsyncOperationHandle val2 = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.ChargeMegaBlaster_asset); val2.Completed += delegate(AsyncOperationHandle ctx) { SkillDef result = ctx.Result; result.cancelSprintingOnActivation = false; result.beginSkillCooldownOnSkillEnd = true; result.baseRechargeInterval = secondaryUncorruptCooldown; result.keywordTokens = new string[2] { "VOIDSURVIVOR_SECONDARY_UPRADE_TOOLTIP", "KEYWORD_AGILE" }; }; val2 = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.FireCorruptDisk_asset); val2.Completed += delegate(AsyncOperationHandle ctx) { SkillDef result = ctx.Result; result.cancelSprintingOnActivation = false; result.beginSkillCooldownOnSkillEnd = true; result.baseRechargeInterval = secondaryCorruptCooldown; result.baseMaxStock = secondaryCorruptStock; result.rechargeStock = secondaryCorruptRechargeStock; }; } private void VoidBlinkBase_OnEnter(orig_OnEnter orig, VoidBlinkBase self) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) VoidSurvivorController val = default(VoidSurvivorController); if (NetworkServer.active && ((Component)((EntityState)self).outer).TryGetComponent(ref val)) { int num = 0; BuffIndex[] debuffBuffIndices = BuffCatalog.debuffBuffIndices; foreach (BuffIndex val2 in debuffBuffIndices) { BuffDef buffDef = BuffCatalog.GetBuffDef(val2); if (!buffDef.isCooldown && !buffDef.isHidden) { num += ((EntityState)self).characterBody.GetBuffCount(val2); } } DotController val3 = DotController.FindDotController(((Component)((EntityState)self).characterBody).gameObject); if (Object.op_Implicit((Object)(object)val3)) { for (DotIndex val4 = (DotIndex)0; (int)val4 < 12; val4 = (DotIndex)(val4 + 1)) { if (val3.HasDotActive(val4)) { BuffDef associatedBuff = DotController.GetDotDef(val4).associatedBuff; num += ((EntityState)self).characterBody.GetBuffCount(associatedBuff); } } } val.AddCorruption(corruptionPerCleanse * (float)num); } orig.Invoke(self); } private void DoViendPrimary() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown SurvivorTweaksPlugin.LoadAsync(RoR2_DLC1_VoidRaidCrab.VoidRaidCrabMultiBeamDotZone_prefab, (Action)CreateSloshProjectile); SteppedSkillDef viendComboPrimary = ScriptableObject.CreateInstance(); SurvivorTweaksPlugin.LoadAsync(RoR2_DLC1_VoidSurvivor.FireHandBeam_asset, (Action)delegate(SkillDef viendPrimary) { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) viendComboPrimary.stepCount = primaryStepCount; viendComboPrimary.stepGraceDuration = 0.15f; ((SkillDef)viendComboPrimary).keywordTokens = viendPrimary.keywordTokens; ((SkillDef)viendComboPrimary).icon = viendPrimary.icon; ((SkillDef)viendComboPrimary).skillName = "FSTViendPrimary"; ((SkillDef)viendComboPrimary).skillNameToken = viendPrimary.skillNameToken; ((SkillDef)viendComboPrimary).skillDescriptionToken = viendPrimary.skillDescriptionToken; ((SkillDef)viendComboPrimary).activationStateMachineName = viendPrimary.activationStateMachineName; ((SkillDef)viendComboPrimary).baseRechargeInterval = viendPrimary.baseRechargeInterval; ((SkillDef)viendComboPrimary).baseMaxStock = viendPrimary.baseMaxStock; ((SkillDef)viendComboPrimary).rechargeStock = viendPrimary.rechargeStock; ((SkillDef)viendComboPrimary).interruptPriority = viendPrimary.interruptPriority; ((SkillDef)viendComboPrimary).beginSkillCooldownOnSkillEnd = viendPrimary.beginSkillCooldownOnSkillEnd; ((SkillDef)viendComboPrimary).dontAllowPastMaxStocks = viendPrimary.dontAllowPastMaxStocks; ((SkillDef)viendComboPrimary).fullRestockOnAssign = viendPrimary.fullRestockOnAssign; ((SkillDef)viendComboPrimary).isCombatSkill = viendPrimary.isCombatSkill; ((SkillDef)viendComboPrimary).mustKeyPress = viendPrimary.mustKeyPress; ((SkillDef)viendComboPrimary).requiredStock = viendPrimary.requiredStock; ((SkillDef)viendComboPrimary).resetCooldownTimerOnUse = viendPrimary.resetCooldownTimerOnUse; ((SkillDef)viendComboPrimary).stockToConsume = viendPrimary.stockToConsume; ((SkillDef)viendComboPrimary).cancelSprintingOnActivation = viendPrimary.cancelSprintingOnActivation; ((SkillDef)viendComboPrimary).forceSprintDuringState = viendPrimary.forceSprintDuringState; ((SkillDef)viendComboPrimary).canceledFromSprinting = viendPrimary.canceledFromSprinting; }); Variant[] variants = primary.variants; Variant val = new Variant { skillDef = (SkillDef)(object)viendComboPrimary, unlockableDef = null }; ((Variant)(ref val)).viewableNode = new Node(((SkillDef)viendComboPrimary).skillNameToken, false, (Node)null); variants[0] = val; Content.AddSkillDef((SkillDef)(object)viendComboPrimary); Content.AddEntityState(typeof(FireHandBeamLight)); SerializableEntityStateType activationState = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref activationState))..ctor(typeof(FireHandBeamLight)); ((SkillDef)viendComboPrimary).activationState = activationState; LanguageAPI.Add("VOIDSURVIVOR_PRIMARY_DESCRIPTION", "Fire a slowing long-range beam for " + Tools.ConvertDecimal(FireHandBeamLight.damageCoefficientLight) + " damage. Every third shot leaves a lingering pool for " + Tools.ConvertDecimal(FireHandBeamLight.poolDamageCoefficientPerSecond * (float)primaryPoolDuration) + " damage over time."); FireCorruptHandBeam.OnEnter += new hook_OnEnter(FireCorruptHandBeam_OnEnter); LanguageAPI.Add("VOIDSURVIVOR_PRIMARY_UPRADE_TOOLTIP", "【Corruption Upgrade】Transform into a " + Tools.ConvertDecimal(primaryCorruptDps) + " damage short-range beam."); } private void CreateSloshProjectile(GameObject result) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) viendPrimaryDamagePool = PrefabAPI.InstantiateClone(result, "ViendDamagePoolProjectile", true); ProjectileDamage val = default(ProjectileDamage); if (viendPrimaryDamagePool.TryGetComponent(ref val)) { val.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)8), (DamageTypeExtended)0, (DamageSource)1); } ProjectileDotZone val2 = default(ProjectileDotZone); if (viendPrimaryDamagePool.TryGetComponent(ref val2)) { val2.lifetime = primaryPoolDuration; } Transform transform = viendPrimaryDamagePool.transform; transform.localScale *= 0.5f; Transform val3 = viendPrimaryDamagePool.transform.Find("Fire, Stretched"); if (Object.op_Implicit((Object)(object)val3)) { Object.Destroy((Object)(object)val3); } Content.AddProjectilePrefab(viendPrimaryDamagePool); } private void Idk(orig_OnEnter orig, FireHandBeam self) { Debug.Log((object)($"maxdistance {self.maxDistance}, force {self.force}, bulletcount {self.bulletCount}, bulletradius {self.bulletRadius}," + $"baseduration {self.baseDuration}, attacksoundstring {self.attackSoundString}, recoilamplitude {self.recoilAmplitude}," + $"spreadbloomvalue {self.spreadBloomValue}, maxspread {self.maxSpread}, muzzlename {self.muzzle}, animationlayername {self.animationLayerName}," + $"animationstatename {self.animationStateName}, animationplaybackrateparam {self.animationPlaybackRateParam}, trajectoryaimassistmultiplier {self.trajectoryAimAssistMultiplier}")); orig.Invoke(self); } private float ViendNoHealing(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (self.body.HasBuff(Buffs.VoidSurvivorCorruptMode)) { amount = 0f; } return orig.Invoke(self, amount, procChainMask, nonRegen); } private void ChargeCrushBase_OnEnter(orig_OnEnter orig, ChargeCrushBase self) { Debug.Log((object)self.baseDuration); if (self is ChargeCrushCorruption) { self.baseDuration = 1.5f; } if (self is ChargeCrushHealth) { self.baseDuration = 0.6f; } orig.Invoke(self); } private void ViendStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(Buffs.VoidSurvivorCorruptMode)) { args.armorAdd -= 100f - corruptModeArmor; } } private void FireCorruptHandBeam_OnEnter(orig_OnEnter orig, FireCorruptHandBeam self) { self.tickRate = primaryCorruptTickRate; orig.Invoke(self); } private bool VoidSurvivorSkillDef_HasRequiredCorruption(orig_HasRequiredCorruption orig, VoidSurvivorSkillDef self, GenericSkill skillSlot) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown InstanceData val = (InstanceData)skillSlot.skillInstanceData; VoidSurvivorController voidSurvivorController = val.voidSurvivorController; if (Object.op_Implicit((Object)(object)voidSurvivorController)) { float num = maxCorruption - Mathf.Min(self.maximumCorruption, maxCorruption); float num2 = voidSurvivorController.maxCorruption - voidSurvivorController.minimumCorruption; float num3 = self.minimumCorruption - num; if (num2 > num3) { return true; } return voidSurvivorController.corruption >= self.minimumCorruption && voidSurvivorController.corruption < self.maximumCorruption; } return false; } private void VoidSurvivorController_OnEnable(orig_OnEnable orig, VoidSurvivorController self) { self.minimumCorruptionPerVoidItem = minimumCorruptionPerVoidItem; self.corruptionForFullDamage = corruptionForFullDamage; self.corruptionForFullHeal = corruptionForFullHeal; self.corruptionFractionPerSecondWhileCorrupted = corruptionFractionPerSecondWhileCorrupted; self.corruptionPerSecondInCombat = corruptionPerSecondInCombat; self.corruptionPerSecondOutOfCombat = corruptionPerSecondOutOfCombat; self.corruptionPerCrit = corruptionPerCrit; self.maxCorruption = maxCorruption; orig.Invoke(self); } } } namespace SurvivorTweaks.States.VoidFiend { public class FireHandBeamLight : BaseSkillState, IStepSetter { public GameObject muzzleflashEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorBeamMuzzleflash_prefab).WaitForCompletion(); public GameObject hitEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorBeamImpact_prefab).WaitForCompletion(); public GameObject tracerEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorBeamTracer_prefab).WaitForCompletion(); public static float damageCoefficientLight = 3.8f; public static float damageCoefficientHeavy = 3.8f; public static float poolDamageCoefficientPerSecond = 2.5f; public float maxDistance = 1000f; public float force = 1000f; public int bulletCount = 1; public float bulletRadius = 2f; public float baseDurationLight = 0.8f; public float baseDurationHeavy = 1.1f; public string attackSoundString = "Play_voidman_m1_shoot"; public float recoilAmplitudeLight = 2f; public float recoilAmplitudeHeavy = 3.5f; public float spreadBloomValue = 0.2f; public float maxSpread = 3f; public static string muzzle = "MuzzleHandBeam"; public string animationLayerName = "LeftArm, Override"; public string animationStateName = "FireHandBeam"; public string animationPlaybackRateParam = "HandBeam.playbackRate"; public float trajectoryAimAssistMultiplier = 0.25f; private int step = 0; private float baseDuration; private float duration; private float damageCoefficient; public GameObject projectilePrefab => ViendTweaks.viendPrimaryDamagePool; private bool isHeavyAttack => step == ViendTweaks.primaryStepCount - 1; private Transform muzzleTransform => ((BaseState)this).FindModelChild(muzzle); public void SetStep(int i) { step = i % ViendTweaks.primaryStepCount; } public override void OnEnter() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_020d: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); damageCoefficient = (isHeavyAttack ? damageCoefficientHeavy : damageCoefficientLight); baseDuration = (isHeavyAttack ? baseDurationHeavy : baseDurationLight); duration = baseDuration / ((BaseState)this).attackSpeedStat; CalcBeamPath(out var beamRay, out var beamEndPos); ((EntityState)this).PlayAnimation(animationLayerName, animationStateName, animationPlaybackRateParam, duration, 0f); float num = (isHeavyAttack ? recoilAmplitudeHeavy : recoilAmplitudeLight); ((BaseState)this).AddRecoil(-1f * num, -2f * num, -0.5f * num, 0.5f * num); ((BaseState)this).StartAimMode(beamRay, 2f, false); Util.PlaySound(attackSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, muzzle, false); } if (((EntityState)this).isAuthority) { BulletAttack val = new BulletAttack(); val.owner = ((EntityState)this).gameObject; val.weapon = ((EntityState)this).gameObject; val.origin = ((Ray)(ref beamRay)).origin; val.aimVector = ((Ray)(ref beamRay)).direction; val.muzzleName = muzzle; val.maxDistance = maxDistance; val.minSpread = 0f; val.maxSpread = ((EntityState)this).characterBody.spreadBloomAngle; val.radius = bulletRadius; val.falloffModel = (FalloffModel)0; val.smartCollision = true; val.damage = damageCoefficient * ((BaseState)this).damageStat; val.procCoefficient = 1f / (float)bulletCount; val.force = force; val.isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master); val.damageType = DamageTypeCombo.op_Implicit((DamageType)8); val.damageType.damageSource = (DamageSource)1; val.tracerEffectPrefab = tracerEffectPrefab; val.hitEffectPrefab = hitEffectPrefab; val.trajectoryAimAssistMultiplier = trajectoryAimAssistMultiplier; val.stopperMask = CommonMasks.interactable; val.Fire(); if (isHeavyAttack) { FireProjectileInfo val2 = new FireProjectileInfo { projectilePrefab = projectilePrefab, position = beamEndPos + Vector3.up * 1f, owner = ((EntityState)this).gameObject, damage = ((BaseState)this).damageStat * poolDamageCoefficientPerSecond * 0.5f, crit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master) }; ProjectileManager.instance.FireProjectile(val2); } } ((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } protected void CalcBeamPath(out Ray beamRay, out Vector3 beamEndPos) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); float num = float.PositiveInfinity; RaycastHit[] array = Physics.RaycastAll(aimRay, maxDistance, LayerMask.op_Implicit(CommonMasks.bullet), (QueryTriggerInteraction)1); Transform root = ((EntityState)this).GetModelTransform().root; for (int i = 0; i < array.Length; i++) { ref RaycastHit reference = ref array[i]; float distance = ((RaycastHit)(ref reference)).distance; if (distance < num && (Object)(object)((Component)((RaycastHit)(ref reference)).collider).transform.root != (Object)(object)root) { num = distance; } } num = Mathf.Min(num, maxDistance); beamEndPos = ((Ray)(ref aimRay)).GetPoint(num); Vector3 position = muzzleTransform.position; beamRay = new Ray(position, beamEndPos - position); } } internal class FireHandBeamNew : ChargeHandBeam { private GameObject chargeEffectInstance; private GameObject chargeEffectPrefab = ChargeFire.chargeVfxPrefab; public static float fireBeamDuration = 0.2f; public static float maxBaseDuration = 1.2f; public static float minBaseDuration = 0.35f; private float minDuration = 0.2f; public override void OnEnter() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) base.baseDuration = maxBaseDuration - fireBeamDuration; minDuration = (minBaseDuration - fireBeamDuration) / ((EntityState)this).characterBody.attackSpeed; ((ChargeHandBeam)this).OnEnter(); Transform modelTransform = ((EntityState)this).GetModelTransform(); if (!Object.op_Implicit((Object)(object)modelTransform)) { return; } ChildLocator component = ((Component)modelTransform).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } Transform val = component.FindChild(base.muzzle); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)chargeEffectPrefab)) { chargeEffectInstance = Object.Instantiate(chargeEffectPrefab, val.position, val.rotation); chargeEffectInstance.transform.parent = val; ScaleParticleSystemDuration component2 = chargeEffectInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.newDuration = base.duration; } } } public override void FixedUpdate() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown ((EntityState)this).fixedAge = ((EntityState)this).fixedAge + Time.fixedDeltaTime; if (((EntityState)this).isAuthority) { if (((EntityState)this).fixedAge > base.duration) { FireHandBeam val = new FireHandBeam(); val.damageCoefficient = ViendTweaks.primaryChargedDamage; val.baseDuration = fireBeamDuration; ((EntityState)this).outer.SetNextState((EntityState)(object)val); } else if (((EntityState)this).fixedAge > minDuration && !((EntityState)this).inputBank.skill1.down) { FireHandBeam val2 = new FireHandBeam(); val2.damageCoefficient = ViendTweaks.primaryUnchargedDamage; val2.baseDuration = fireBeamDuration; val2.bulletRadius *= 2f; ((EntityState)this).outer.SetNextState((EntityState)(object)val2); } } } public override void OnExit() { ((EntityState)this).OnExit(); EntityState.Destroy((Object)(object)chargeEffectInstance); } } } namespace SurvivorTweaks.States.Loader { internal class ChargeDynamicPunch : BaseSkillState { public float baseChargeDuration = 0.5f; public float baseWinddownDuration = 0.2f; public static float damageCoefficient = 3f; public static float procCoefficient = 1f; public static float force = 500f; private const float baseMinChargeDuration = 0.15f; private float stopwatch; private float charge; private float chargeDuration; private float minChargeDuration; private uint soundID; private Transform chargeVfxInstanceTransform; private OverrideRequest crosshairOverrideRequest; public override void OnEnter() { ((BaseState)this).OnEnter(); chargeDuration = baseChargeDuration / ((BaseState)this).attackSpeedStat; minChargeDuration = 0.15f / ((BaseState)this).attackSpeedStat; Util.PlaySound(BaseChargeFist.enterSFXString, ((EntityState)this).gameObject); soundID = Util.PlaySound(BaseChargeFist.startChargeLoopSFXString, ((EntityState)this).gameObject); } public override void OnExit() { ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)chargeVfxInstanceTransform)) { EntityState.Destroy((Object)(object)((Component)chargeVfxInstanceTransform).gameObject); ((EntityState)this).PlayAnimation("Gesture, Additive", BaseChargeFist.EmptyStateHash); ((EntityState)this).PlayAnimation("Gesture, Override", BaseChargeFist.EmptyStateHash); OverrideRequest val = crosshairOverrideRequest; if (val != null) { val.Dispose(); } chargeVfxInstanceTransform = null; } ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f; Util.PlaySound(BaseChargeFist.endChargeLoopSFXString, ((EntityState)this).gameObject); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } public override void FixedUpdate() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); AkSoundEngine.SetRTPCValueByPlayingID("loaderShift_chargeAmount", charge * 100f, soundID); ((EntityState)this).characterBody.SetSpreadBloom(charge, true); ((EntityState)this).characterBody.SetAimTimer(3f); if (charge >= BaseChargeFist.minChargeForChargedAttack && !Object.op_Implicit((Object)(object)chargeVfxInstanceTransform) && Object.op_Implicit((Object)(object)BaseChargeFist.chargeVfxPrefab)) { if (Object.op_Implicit((Object)(object)BaseChargeFist.crosshairOverridePrefab) && crosshairOverrideRequest == null) { crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, BaseChargeFist.crosshairOverridePrefab, (OverridePriority)1); } Transform val = ((BaseState)this).FindModelChild(BaseChargeFist.chargeVfxChildLocatorName); if (Object.op_Implicit((Object)(object)val)) { chargeVfxInstanceTransform = Object.Instantiate(BaseChargeFist.chargeVfxPrefab, val).transform; ScaleParticleSystemDuration component = ((Component)chargeVfxInstanceTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.newDuration = (1f - BaseChargeFist.minChargeForChargedAttack) * chargeDuration; } } ((EntityState)this).PlayCrossfade("Gesture, Additive", BaseChargeFist.ChargePunchIntroStateHash, BaseChargeFist.ChargePunchIntroParamHash, chargeDuration, 0.1f); ((EntityState)this).PlayCrossfade("Gesture, Override", BaseChargeFist.ChargePunchIntroStateHash, BaseChargeFist.ChargePunchIntroParamHash, chargeDuration, 0.1f); } if (Object.op_Implicit((Object)(object)chargeVfxInstanceTransform)) { ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = BaseChargeFist.walkSpeedCoefficient; } if (((EntityState)this).isAuthority) { AuthorityFixedUpdate(); } stopwatch += Time.fixedDeltaTime; charge += Time.fixedDeltaTime * ((EntityState)this).characterBody.attackSpeed; } public override void Update() { ((EntityState)this).Update(); Mathf.Clamp01(((EntityState)this).age / chargeDuration); } private void AuthorityFixedUpdate() { if (!ShouldKeepChargingAuthority()) { ((EntityState)this).outer.SetNextState(GetNextStateAuthority(isKeyHeld: false)); } else if (charge >= chargeDuration) { ((EntityState)this).outer.SetNextState(GetNextStateAuthority(isKeyHeld: true)); } } protected virtual bool ShouldKeepChargingAuthority() { return ((BaseSkillState)this).IsKeyDownAuthority(); } protected virtual EntityState GetNextStateAuthority(bool isKeyHeld) { if (isKeyHeld) { DynamicPunchRush dynamicPunchRush = new DynamicPunchRush(); ((BaseSkillState)dynamicPunchRush).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; return (EntityState)(object)dynamicPunchRush; } return (EntityState)(object)new DynamicPunchJab(); } } internal class DynamicPunchJab : LoaderMeleeAttack { public static float damageCoefficient = 3f; public static float procCoefficient = 1f; public static float force = 30f; public static float selfForce = 2000f; private static int ChargePunchStateHash = Animator.StringToHash("ChargePunch"); private static int ChargePunchParamHash = Animator.StringToHash("ChargePunch.playbackRate"); public override void OnEnter() { if (((EntityState)this).isAuthority) { ((BasicMeleeAttack)this).duration = 0.5f / ((BaseState)this).attackSpeedStat; } ((BasicMeleeAttack)this).OnEnter(); } public override string GetHitBoxGroupName() { return "Punch"; } public override void AuthorityFixedUpdate() { ((BasicMeleeAttack)this).AuthorityFixedUpdate(); } public override void PlayAnimation() { ((BasicMeleeAttack)this).PlayAnimation(); ((EntityState)this).PlayAnimation("FullBody, Override", BaseSwingChargedFist.ChargePunchStateHash, BaseSwingChargedFist.ChargePunchParamHash, 0.5f); } public override void AuthorityModifyOverlapAttack(OverlapAttack overlapAttack) { //IL_0033: 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_003b: 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_004a: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ((LoaderMeleeAttack)this).AuthorityModifyOverlapAttack(overlapAttack); if (overlapAttack == null) { Debug.Log((object)"overlapattack = null owmp"); return; } overlapAttack.damage = damageCoefficient * ((BaseState)this).damageStat; Ray aimRay = ((BaseState)this).GetAimRay(); overlapAttack.forceVector = ((Ray)(ref aimRay)).direction * 1f; overlapAttack.damageType = DamageTypeCombo.op_Implicit((DamageType)32); overlapAttack.damageType.damageSource = (DamageSource)4; } public override void OnMeleeHitAuthority() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //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_008f: 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_009f: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < ((BasicMeleeAttack)this).hitResults.Count; i++) { CharacterBody body = ((BasicMeleeAttack)this).hitResults[i].healthComponent.body; body.AddTimedBuffAuthority(DynamicPunchSkill.loaderArmorBreak.buffIndex, 6f); float num = 1f; if (Object.op_Implicit((Object)(object)body.characterMotor)) { num = body.characterMotor.mass; } else if (Object.op_Implicit((Object)(object)((Component)body.healthComponent).GetComponent())) { num = ((EntityState)this).rigidbody.mass; } HealthComponent healthComponent = body.healthComponent; Ray aimRay = ((BaseState)this).GetAimRay(); healthComponent.TakeDamageForce(((Ray)(ref aimRay)).direction * force * num, false, true); } ((LoaderMeleeAttack)this).OnMeleeHitAuthority(); } public override void OnExit() { ((BasicMeleeAttack)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class DynamicPunchRush : BaseSkillState { private float stopwatch; private float entryDuration; public static float baseEntryDuration = 0.2f; private float flamethrowerDuration; public static float baseFlamethrowerDuration = 10f; private ChildLocator childLocator; private Transform leftMuzzleTransform; private Transform rightMuzzleTransform; public float tickFrequency; private float tickDamageCoefficient = 1.2f; private static int PrepFlamethrowerStateHash = Animator.StringToHash("PrepFlamethrower"); private static int ExitFlamethrowerStateHash = Animator.StringToHash("ExitFlamethrower"); private static int FlamethrowerParamHash = Animator.StringToHash("Flamethrower.playbackRate"); private Transform leftFlamethrowerTransform; private Transform rightFlamethrowerTransform; public static float radius = 6f; public static float force = 20f; public static float procCoefficientPerTick = 0.3f; [SerializeField] public float maxDistance = 8f; private bool hasBegunFlamethrower; [SerializeField] private float flamethrowerStopwatch; public static float baseTickFrequency = 5f; private static int FlamethrowerStateHash => BaseChargeFist.ChargePunchIntroStateHash; public override void OnEnter() { ((BaseState)this).OnEnter(); stopwatch = 0f; entryDuration = baseEntryDuration / ((BaseState)this).attackSpeedStat; flamethrowerDuration = baseFlamethrowerDuration; Transform modelTransform = ((EntityState)this).GetModelTransform(); tickFrequency = baseTickFrequency / ((BaseState)this).attackSpeedStat; if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.SetAimTimer(entryDuration + flamethrowerDuration + 1f); } if (Object.op_Implicit((Object)(object)modelTransform)) { childLocator = ((Component)modelTransform).GetComponent(); leftMuzzleTransform = childLocator.FindChild("MuzzleLeft"); rightMuzzleTransform = childLocator.FindChild("MuzzleRight"); } ((EntityState)this).PlayAnimation("Gesture, Additive", PrepFlamethrowerStateHash, FlamethrowerParamHash, entryDuration); } public override void OnExit() { ((EntityState)this).PlayCrossfade("Gesture, Additive", ExitFlamethrowerStateHash, 0.1f); if (Object.op_Implicit((Object)(object)leftFlamethrowerTransform)) { EntityState.Destroy((Object)(object)((Component)leftFlamethrowerTransform).gameObject); } if (Object.op_Implicit((Object)(object)rightFlamethrowerTransform)) { EntityState.Destroy((Object)(object)((Component)rightFlamethrowerTransform).gameObject); } ((EntityState)this).OnExit(); } private void FireGauntlet(string muzzleString) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); if (((EntityState)this).isAuthority) { BulletAttack val = new BulletAttack(); val.owner = ((EntityState)this).gameObject; val.weapon = ((EntityState)this).gameObject; val.origin = ((Ray)(ref aimRay)).origin; val.aimVector = ((Ray)(ref aimRay)).direction; val.minSpread = 0f; val.damage = tickDamageCoefficient * ((BaseState)this).damageStat; val.force = force; val.muzzleName = muzzleString; val.isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master); val.radius = radius; val.falloffModel = (FalloffModel)0; val.stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask; val.procCoefficient = procCoefficientPerTick; val.maxDistance = maxDistance; val.smartCollision = true; val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.allowTrajectoryAimAssist = false; val.damageType.damageSource = (DamageSource)1; val.Fire(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch += ((EntityState)this).GetDeltaTime(); if (stopwatch >= entryDuration && !hasBegunFlamethrower) { hasBegunFlamethrower = true; ((EntityState)this).PlayAnimation("Gesture, Additive", FlamethrowerStateHash, FlamethrowerParamHash, flamethrowerDuration); FireGauntlet("MuzzleCenter"); } if (hasBegunFlamethrower) { flamethrowerStopwatch += Time.deltaTime; float num = 1f / tickFrequency / ((BaseState)this).attackSpeedStat; if (flamethrowerStopwatch > num) { flamethrowerStopwatch -= num; FireGauntlet("MuzzleCenter"); } } if (!ShouldKeepPunchingAuthority()) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } protected virtual bool ShouldKeepPunchingAuthority() { return ((BaseSkillState)this).IsKeyDownAuthority(); } } } namespace SurvivorTweaks.States.Huntress { internal class ThrowLaserrang : BaseState { private float duration; public static GameObject chargePrefab; public static GameObject muzzleFlashPrefab; private GameObject chargeEffect; public static string attackSoundString; public static float smallHopStrength; private Animator animator; private Transform modelTransform; private ChildLocator childLocator; private float stopwatch; private bool hasTriedToThrowGlaive; private bool hasSuccessfullyThrownGlaive; public static float baseDuration => LaserrangSkill.baseDuration; public static float damageCoefficient => LaserrangSkill.damageCoefficient; public static float force => LaserrangSkill.force; public static float antigravityStrength => LaserrangSkill.antiGravStrength; public override void OnEnter() { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); stopwatch = 0f; duration = baseDuration / base.attackSpeedStat; modelTransform = ((EntityState)this).GetModelTransform(); animator = ((EntityState)this).GetModelAnimator(); Util.PlayAttackSpeedSound(ThrowGlaive.attackSoundString, ((EntityState)this).gameObject, base.attackSpeedStat); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ThrowGlaive.smallHopStrength != 0f) { ((EntityState)this).characterMotor.velocity.y = ThrowGlaive.smallHopStrength; } ((EntityState)this).PlayAnimation("FullBody, Override", "ThrowGlaive", "ThrowGlaive.playbackRate", duration, 0f); if (Object.op_Implicit((Object)(object)modelTransform)) { childLocator = ((Component)modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)childLocator)) { Transform val = childLocator.FindChild("HandR"); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)ThrowGlaive.chargePrefab)) { chargeEffect = Object.Instantiate(ThrowGlaive.chargePrefab, val.position, val.rotation); chargeEffect.transform.parent = val; } } } if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.SetAimTimer(duration); } } public override void OnExit() { ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)chargeEffect)) { EntityState.Destroy((Object)(object)chargeEffect); } int layerIndex = animator.GetLayerIndex("Impact"); if (layerIndex >= 0) { animator.SetLayerWeight(layerIndex, 1.5f); animator.PlayInFixedTime("LightImpact", layerIndex, 0f); } if (!hasTriedToThrowGlaive) { FireGlaive(); } if (!hasSuccessfullyThrownGlaive && NetworkServer.active) { ((EntityState)this).skillLocator.secondary.AddOneStock(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (!hasTriedToThrowGlaive && animator.GetFloat("ThrowGlaive.fire") > 0f) { if (Object.op_Implicit((Object)(object)chargeEffect)) { EntityState.Destroy((Object)(object)chargeEffect); } FireGlaive(); } CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity.y = characterMotor.velocity.y + antigravityStrength * Time.fixedDeltaTime * (1f - stopwatch / duration); if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void FireGlaive() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || hasTriedToThrowGlaive) { return; } hasTriedToThrowGlaive = true; Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).origin; Quaternion val2 = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); if (Object.op_Implicit((Object)(object)modelTransform)) { ChildLocator component = ((Component)modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Transform val3 = component.FindChild("HandR"); if (Object.op_Implicit((Object)(object)val3)) { val = val3.position; } } } EffectManager.SimpleMuzzleFlash(ThrowGlaive.muzzleFlashPrefab, ((EntityState)this).gameObject, "HandR", true); ProjectileManager.instance.FireProjectile(LaserrangSkill.boomerangPrefab, val, val2, ((EntityState)this).gameObject, base.damageStat * damageCoefficient, force, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); hasSuccessfullyThrownGlaive = true; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } } namespace SurvivorTweaks.States.Commando { public class CommandoBaseSoupState : BaseSkillState { public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)3; } } internal class SoupFire : CommandoBaseSoupState { public static float force = 600f; public static float baseDuration = 0.8f; private int shotsTotal; private float durationPerShot; public static float damageCoefficient; public static GameObject projectilePrefab; public static GameObject muzzleflashEffectPrefab; public List targetsList; private int fireIndex; private float stopwatch; private bool crit = false; public override void OnEnter() { ((BaseState)this).OnEnter(); crit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master); shotsTotal = Mathf.CeilToInt((float)CommandoTweaks.soupBaseShots * ((BaseState)this).attackSpeedStat); durationPerShot = baseDuration / (float)shotsTotal; FireAtTarget(); } public override void FixedUpdate() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); if (!((EntityState)this).isAuthority) { return; } stopwatch += Time.fixedDeltaTime; while (stopwatch >= durationPerShot) { stopwatch -= durationPerShot; FireAtTarget(); if (fireIndex >= shotsTotal) { ((EntityState)this).outer.SetNextState((EntityState)new Idle()); break; } } } private void FireAtTarget() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); if (targetsList.Count > 0) { HurtBox val = targetsList[fireIndex % targetsList.Count]; if (!Object.op_Implicit((Object)(object)val.healthComponent) || !val.healthComponent.alive) { targetsList.Remove(val); FireAtTarget(); return; } Vector3 val2 = ((Component)val).transform.position - ((Ray)(ref aimRay)).origin; ((Ray)(ref aimRay)).direction = ((Vector3)(ref val2)).normalized; } if (fireIndex % 2 == 0) { ((EntityState)this).PlayAnimation("Gesture Additive, Left", "FirePistol, Left"); FireBullet(aimRay, "MuzzleLeft"); } else { ((EntityState)this).PlayAnimation("Gesture Additive, Right", "FirePistol, Right"); FireBullet(aimRay, "MuzzleRight"); } fireIndex++; } private void FireBullet(Ray aimRay, string targetMuzzle) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)FirePistol2.muzzleEffectPrefab)) { EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, targetMuzzle, false); } ((BaseState)this).AddRecoil(-0.4f * FirePistol2.recoilAmplitude, -0.8f * FirePistol2.recoilAmplitude, -0.3f * FirePistol2.recoilAmplitude, 0.3f * FirePistol2.recoilAmplitude); ((BaseState)this).StartAimMode(aimRay, 3f, true); if (((EntityState)this).isAuthority) { new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = ((EntityState)this).characterBody.spreadBloomAngle, damage = CommandoTweaks.soupDamageCoeff * ((BaseState)this).damageStat, procCoefficient = CommandoTweaks.soupProcCoeff, force = force, tracerEffectPrefab = FireBarrage.tracerEffectPrefab, muzzleName = targetMuzzle, hitEffectPrefab = FireBarrage.hitEffectPrefab, isCrit = crit, radius = 0f, smartCollision = true, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)8) }.Fire(); } ((EntityState)this).characterBody.AddSpreadBloom(FireBarrage.spreadBloomValue); Util.PlaySound(FireSweepBarrage.fireSoundString, ((EntityState)this).gameObject); } public override void OnExit() { ((EntityState)this).OnExit(); } } public class SoupTargeting : CommandoBaseSoupState { private struct IndicatorInfo { public CommandoSoupIndicator indicator; } private class CommandoSoupIndicator : Indicator { public override void UpdateVisualizer() { ((Indicator)this).UpdateVisualizer(); } public CommandoSoupIndicator(GameObject owner, GameObject visualizerPrefab) : base(owner, visualizerPrefab) { } } public static float stackInterval = 0.125f; public static GameObject crosshairOverridePrefab = Paint.crosshairOverridePrefab; public static GameObject stickyTargetIndicatorPrefab = Paint.stickyTargetIndicatorPrefab; public static string enterSoundString = Paint.enterSoundString; public static string exitSoundString = Paint.exitSoundString; public static string loopSoundString = Paint.loopSoundString; public static string lockOnSoundString = Paint.lockOnSoundString; public static string stopLoopSoundString = Paint.stopLoopSoundString; public static float maxAngle = Paint.maxAngle; public static float maxDistance = Paint.maxDistance; private List targetsList; private Dictionary targetIndicators; private Indicator stickyTargetIndicator; private SkillDef confirmTargetDummySkillDef; private SkillDef cancelTargetingDummySkillDef; private bool releasedKeyOnce; private float stackStopwatch; private OverrideRequest crosshairOverrideRequest; private BullseyeSearch search; private bool queuedFiringState; private uint loopSoundID; private HealthComponent previousHighlightTargetHealthComponent; private HurtBox previousHighlightTargetHurtBox; public override void OnEnter() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority) { targetsList = new List(); targetIndicators = new Dictionary(); stickyTargetIndicator = new Indicator(((EntityState)this).gameObject, stickyTargetIndicatorPrefab); search = new BullseyeSearch(); } ((EntityState)this).PlayCrossfade("Gesture, Additive", "PrepHarpoons", 0.1f); Util.PlaySound(enterSoundString, ((EntityState)this).gameObject); loopSoundID = Util.PlaySound(loopSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)crosshairOverridePrefab)) { crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, crosshairOverridePrefab, (OverridePriority)1); } confirmTargetDummySkillDef = SkillCatalog.GetSkillDef(SkillCatalog.FindSkillIndexByName("EngiConfirmTargetDummy")); cancelTargetingDummySkillDef = SkillCatalog.GetSkillDef(SkillCatalog.FindSkillIndexByName("EngiCancelTargetingDummy")); ((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, confirmTargetDummySkillDef, (SkillOverridePriority)4); ((EntityState)this).skillLocator.secondary.SetSkillOverride((object)this, cancelTargetingDummySkillDef, (SkillOverridePriority)4); for (int i = 0; i < CommandoTweaks.soupMaxTargets; i++) { GetCurrentTargetInfo(out var currentTargetHurtBox, out var _, maxAngle * 2f, targetsList); if (Object.op_Implicit((Object)(object)currentTargetHurtBox)) { AddTargetAuthority(currentTargetHurtBox); } } } public override void OnExit() { if (((EntityState)this).isAuthority && !((EntityState)this).outer.destroying && !queuedFiringState) { ((BaseSkillState)this).activatorSkillSlot.AddOneStock(); for (int i = 0; i < targetsList.Count; i++) { } } ((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)this, cancelTargetingDummySkillDef, (SkillOverridePriority)4); ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, confirmTargetDummySkillDef, (SkillOverridePriority)4); if (targetIndicators != null) { foreach (KeyValuePair targetIndicator in targetIndicators) { ((Indicator)targetIndicator.Value.indicator).active = false; } } if (stickyTargetIndicator != null) { stickyTargetIndicator.active = false; } OverrideRequest val = crosshairOverrideRequest; if (val != null) { val.Dispose(); } ((EntityState)this).PlayCrossfade("Gesture, Additive", "ExitHarpoons", 0.1f); Util.PlaySound(exitSoundString, ((EntityState)this).gameObject); Util.PlaySound(stopLoopSoundString, ((EntityState)this).gameObject); ((EntityState)this).OnExit(); } private void AddTargetAuthority(HurtBox hurtBox) { if (!targetIndicators.TryGetValue(hurtBox, out var _)) { IndicatorInfo value2 = new IndicatorInfo { indicator = new CommandoSoupIndicator(((EntityState)this).gameObject, LegacyResourcesAPI.Load("Prefabs/EngiMissileTrackingIndicator")) }; ((Indicator)value2.indicator).targetTransform = ((Component)hurtBox).transform; ((Indicator)value2.indicator).active = true; Util.PlaySound(lockOnSoundString, ((EntityState)this).gameObject); targetIndicators[hurtBox] = value2; targetsList.Add(hurtBox); } } private void RemoveTargetAtAuthority(int i) { HurtBox key = targetsList[i]; targetsList.RemoveAt(i); if (targetIndicators.TryGetValue(key, out var value)) { targetIndicators[key] = value; ((Indicator)value.indicator).active = false; targetIndicators.Remove(key); } } private void CleanTargetsList() { for (int num = targetsList.Count - 1; num >= 0; num--) { HurtBox val = targetsList[num]; if (!Object.op_Implicit((Object)(object)val.healthComponent) || !val.healthComponent.alive) { RemoveTargetAtAuthority(num); } } for (int num2 = targetsList.Count - 1; num2 >= CommandoTweaks.soupMaxTargets; num2--) { RemoveTargetAtAuthority(num2); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.SetAimTimer(3f); if (((EntityState)this).isAuthority) { AuthorityFixedUpdate(); } } private void GetCurrentTargetInfo(out HurtBox currentTargetHurtBox, out HealthComponent currentTargetHealthComponent, float maxAngle = -1f, List filterTargets = null) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) if (maxAngle < 0f) { maxAngle = SoupTargeting.maxAngle; } Ray aimRay = ((BaseState)this).GetAimRay(); search.filterByDistinctEntity = true; search.filterByLoS = true; search.minDistanceFilter = 0f; search.maxDistanceFilter = maxDistance; search.minAngleFilter = 0f; search.maxAngleFilter = maxAngle; search.viewer = ((EntityState)this).characterBody; search.searchOrigin = ((Ray)(ref aimRay)).origin; search.searchDirection = ((Ray)(ref aimRay)).direction; search.sortMode = (SortMode)3; search.teamMaskFilter = TeamMask.GetUnprotectedTeams(((BaseState)this).GetTeam()); search.RefreshCandidates(); search.FilterOutGameObject(((EntityState)this).gameObject); IEnumerable enumerable = search.GetResults(); if (filterTargets != null && filterTargets.Count > 0) { enumerable = enumerable.Where((HurtBox candidate) => !filterTargets.Contains(candidate)); } foreach (HurtBox item in enumerable) { if (Object.op_Implicit((Object)(object)item.healthComponent) && item.healthComponent.alive) { currentTargetHurtBox = item; currentTargetHealthComponent = item.healthComponent; return; } } currentTargetHurtBox = null; currentTargetHealthComponent = null; } private void AuthorityFixedUpdate() { CleanTargetsList(); bool flag = false; GetCurrentTargetInfo(out var currentTargetHurtBox, out var currentTargetHealthComponent); if (Object.op_Implicit((Object)(object)currentTargetHurtBox)) { stackStopwatch += Time.fixedDeltaTime; if (((EntityState)this).inputBank.skill1.down && ((Object)(object)currentTargetHealthComponent != (Object)(object)previousHighlightTargetHealthComponent || stackStopwatch >= stackInterval / ((BaseState)this).attackSpeedStat || ((ButtonState)(ref ((EntityState)this).inputBank.skill1)).justPressed)) { stackStopwatch = 0f; AddTargetAuthority(currentTargetHurtBox); } } if (((ButtonState)(ref ((EntityState)this).inputBank.skill1)).justReleased) { flag = true; } if (((ButtonState)(ref ((EntityState)this).inputBank.skill2)).justReleased) { ((EntityState)this).outer.SetNextStateToMain(); return; } if (((ButtonState)(ref ((EntityState)this).inputBank.skill4)).justReleased) { if (releasedKeyOnce) { flag = true; } releasedKeyOnce = true; } if ((Object)(object)currentTargetHurtBox != (Object)(object)previousHighlightTargetHurtBox) { previousHighlightTargetHurtBox = currentTargetHurtBox; previousHighlightTargetHealthComponent = currentTargetHealthComponent; stickyTargetIndicator.targetTransform = ((Object.op_Implicit((Object)(object)currentTargetHurtBox) && ((BaseSkillState)this).activatorSkillSlot.stock != 0) ? ((Component)currentTargetHurtBox).transform : null); stackStopwatch = 0f; } stickyTargetIndicator.active = Object.op_Implicit((Object)(object)stickyTargetIndicator.targetTransform); if (flag) { if (targetsList.Count == 0) { ((EntityState)this).outer.SetNextStateToMain(); return; } queuedFiringState = true; EntityStateMachine outer = ((EntityState)this).outer; SoupFire obj = new SoupFire { targetsList = targetsList }; ((BaseSkillState)obj).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; outer.SetNextState((EntityState)(object)obj); } } } internal class UltraDash : BaseState { private Vector3 forwardDirection; private GameObject slideEffectInstance; private bool startedStateGrounded; public override void OnEnter() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_006e: 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) ((BaseState)this).OnEnter(); Util.PlaySound(SlideState.soundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { CharacterDirection characterDirection = ((EntityState)this).characterDirection; Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); characterDirection.forward = ((Vector3)(ref val)).normalized; } if (Object.op_Implicit((Object)(object)SlideState.jetEffectPrefab)) { Transform val2 = ((BaseState)this).FindModelChild("LeftJet"); Transform val3 = ((BaseState)this).FindModelChild("RightJet"); if (Object.op_Implicit((Object)(object)val2)) { Object.Instantiate(SlideState.jetEffectPrefab, val2); } if (Object.op_Implicit((Object)(object)val3)) { Object.Instantiate(SlideState.jetEffectPrefab, val3); } } ((EntityState)this).characterBody.SetSpreadBloom(0f, false); ((EntityState)this).PlayAnimation("Body", "Jump"); Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.y = ((EntityState)this).characterBody.jumpPower * CommandoTweaks.slideJumpMultiplier; ((EntityState)this).characterMotor.velocity = velocity; } public override void FixedUpdate() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority) { if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.moveVector; forwardDirection = ((EntityState)this).characterDirection.forward; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { float num = SlideState.jumpforwardSpeedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / CommandoTweaks.slideJumpDuration) * CommandoTweaks.slideJumpMultiplier; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += num * base.moveSpeedStat * forwardDirection * Time.fixedDeltaTime; } if (((EntityState)this).fixedAge >= CommandoTweaks.slideJumpDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { PlayImpactAnimation(); ((EntityState)this).OnExit(); } private void PlayImpactAnimation() { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); int layerIndex = modelAnimator.GetLayerIndex("Impact"); if (layerIndex >= 0) { modelAnimator.SetLayerWeight(layerIndex, 1f); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class UltraSlide : BaseSkillState { private Vector3 forwardDirection; private GameObject slideEffectInstance; private bool isGrounded; public override void OnEnter() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); forwardDirection = ((Vector3)(ref val)).normalized; ((EntityState)this).characterDirection.forward = forwardDirection; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { isGrounded = ((EntityState)this).characterMotor.isGrounded; } ((EntityState)this).characterBody.SetSpreadBloom(0f, false); if (!isGrounded) { EnterDashState(); return; } Util.PlaySound(SlideState.soundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)SlideState.jetEffectPrefab)) { Transform val2 = ((BaseState)this).FindModelChild("LeftJet"); Transform val3 = ((BaseState)this).FindModelChild("RightJet"); if (Object.op_Implicit((Object)(object)val2)) { Object.Instantiate(SlideState.jetEffectPrefab, val2); } if (Object.op_Implicit((Object)(object)val3)) { Object.Instantiate(SlideState.jetEffectPrefab, val3); } } ((EntityState)this).PlayAnimation("Body", "SlideForward", "SlideForward.playbackRate", CommandoTweaks.slideMaxDuration, 0f); if (Object.op_Implicit((Object)(object)SlideState.slideEffectPrefab)) { Transform val4 = ((BaseState)this).FindModelChild("Base"); slideEffectInstance = Object.Instantiate(SlideState.slideEffectPrefab, val4); } } public override void FixedUpdate() { //IL_00b7: 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: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (!((EntityState)this).isAuthority) { return; } if (((EntityState)this).inputBank.jump.wasDown) { EnterDashState(); return; } if (((EntityState)this).fixedAge >= CommandoTweaks.slideMaxDuration || (!((BaseSkillState)this).IsKeyDownAuthority() && ((EntityState)this).fixedAge > 1f)) { ((EntityState)this).outer.SetNextStateToMain(); return; } ((EntityState)this).PlayAnimation("Body", "SlideForward", "SlideForward.playbackRate", 0.2f, 0f); if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val = forwardDirection + ((EntityState)this).inputBank.moveVector * CommandoTweaks.slideStrafeMultiplier; forwardDirection = ((Vector3)(ref val)).normalized; ((EntityState)this).characterDirection.moveVector = forwardDirection; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { float num = SlideState.forwardSpeedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / CommandoTweaks.slideMaxDuration) * CommandoTweaks.slideSpeedMultiplier; ((EntityState)this).characterMotor.rootMotion = num * ((BaseState)this).moveSpeedStat * forwardDirection * Time.fixedDeltaTime; } } private void EnterDashState() { ((EntityState)this).outer.SetNextState((EntityState)(object)new UltraDash()); } public override void OnExit() { PlayImpactAnimation(); if (Object.op_Implicit((Object)(object)slideEffectInstance)) { EntityState.Destroy((Object)(object)slideEffectInstance); } ((EntityState)this).OnExit(); } private void PlayImpactAnimation() { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); int layerIndex = modelAnimator.GetLayerIndex("Impact"); if (layerIndex >= 0) { modelAnimator.SetLayerWeight(layerIndex, 1f); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } } namespace SurvivorTweaks.States.Captain { public class FireWormhole : BaseSkillState { public const float minDistance = 2f; public Vector3 startPos; public Vector3 endpointPos; private float duration; public float baseDuration => PocketWormholeSkill.baseExitDuration; public override void OnEnter() { duration = baseDuration / ((BaseState)this).attackSpeedStat; ((BaseState)this).OnEnter(); Fire(); } private void Fire() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((EntityState)this).rigidbody) || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master)) { ((BaseSkillState)this).activatorSkillSlot.AddOneStock(); return; } ((EntityState)this).characterBody.OnSkillActivated(((BaseSkillState)this).activatorSkillSlot); Util.PlaySound(FireTazer.attackString, ((EntityState)this).gameObject); ((BaseState)this).AddRecoil(-1f * FireTazer.recoilAmplitude, -1.5f * FireTazer.recoilAmplitude, -0.25f * FireTazer.recoilAmplitude, 0.25f * FireTazer.recoilAmplitude); ((EntityState)this).characterBody.AddSpreadBloom(FireTazer.bloom); Ray aimRay = ((BaseState)this).GetAimRay(); if (Object.op_Implicit((Object)(object)FireTazer.muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(FireTazer.muzzleflashEffectPrefab, ((EntityState)this).gameObject, FireTazer.targetMuzzle, false); } ((EntityState)this).PlayAnimation("Gesture, Additive", "FireCaptainShotgun"); ((EntityState)this).PlayAnimation("Gesture, Override", "FireCaptainShotgun"); if (NetworkServer.active) { FireZipline(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnSerialize(NetworkWriter writer) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(startPos); writer.Write(endpointPos); } public override void OnDeserialize(NetworkReader reader) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); startPos = reader.ReadVector3(); endpointPos = reader.ReadVector3(); } private void FireZipline() { //IL_0015: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(PocketWormholeSkill.ziplinePrefab); ZiplineController component = val.GetComponent(); component.SetPointAPosition(startPos); component.SetPointBPosition(endpointPos); DestroyOnTimer val2 = val.AddComponent(); val2.duration = PocketWormholeSkill.maxTunnelDuration; val.GetComponent().teamIndex = ((EntityState)this).characterBody.teamComponent.teamIndex; val.GetComponent().ownerObject = ((Component)((EntityState)this).characterBody).gameObject; Deployable component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master)) { component2.onUndeploy.AddListener(new UnityAction(component2.DestroyGameObject)); ((EntityState)this).characterBody.master.AddDeployable(component2, PocketWormholeSkill.wormholeDeployableSlot); } NetworkServer.Spawn(val); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class PocketWormhole : BaseSkillState { public static GameObject endpointIndicatorPrefab = ChargeMeteor.areaIndicatorPrefab; public static GameObject projectilePrefab; public static GameObject muzzleflashEffectPrefab; public static GameObject chargeEffectPrefab; private float exitDuration; public static float baseEnterDuration = PocketWormholeSkill.baseEnterDuration; private float enterDuration; private bool hasFired; public static string enterSoundString; public static string attackString; public static float recoilAmplitude; public static float bloom; public static string targetMuzzle = FireTazer.targetMuzzle; private float releaseTime = -1f; private Vector3 startpointPosition; private Vector3 _endpointPosition; private GameObject endpointIndicatorInstance; private bool disableIndicator = false; private OverrideRequest crosshairOverrideRequest; private bool _validPlacement; public float baseExitDuration => PocketWormholeSkill.baseExitDuration; public Vector3 endpointPosition { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return _endpointPosition; } private set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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) _endpointPosition = value; if (Object.op_Implicit((Object)(object)endpointIndicatorInstance)) { endpointIndicatorInstance.transform.position = value; } } } public bool validPlacement { get { return _validPlacement; } private set { UpdateCrosshair(value); _validPlacement = value; } } public override void OnEnter() { ((BaseState)this).OnEnter(); if ((Object)(object)endpointIndicatorPrefab != (Object)null && ((EntityState)this).isAuthority) { endpointIndicatorInstance = Object.Instantiate(endpointIndicatorPrefab); UpdateEndpointIndicator(); UpdateCrosshair(newValue: false); } exitDuration = baseExitDuration / ((BaseState)this).attackSpeedStat; enterDuration = baseEnterDuration / ((BaseState)this).attackSpeedStat; if (Object.op_Implicit((Object)(object)chargeEffectPrefab)) { EffectManager.SimpleMuzzleFlash(chargeEffectPrefab, ((EntityState)this).gameObject, targetMuzzle, false); } Util.PlayAttackSpeedSound(enterSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); ((EntityState)this).PlayCrossfade("Gesture, Override", "ChargeCaptainShotgun", "ChargeCaptainShotgun.playbackRate", enterDuration, 0.1f); ((EntityState)this).PlayCrossfade("Gesture, Additive", "ChargeCaptainShotgun", "ChargeCaptainShotgun.playbackRate", enterDuration, 0.1f); } private void UpdateEndpointIndicator() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)endpointIndicatorInstance) && !disableIndicator) { endpointIndicatorInstance.transform.localScale = Vector3.one * ((EntityState)this).characterBody.bestFitRadius; endpointIndicatorInstance.SetActive(true); } } private void UpdateCrosshair(bool newValue) { } private void UpdateAimInfo() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_0179: Unknown result type (might be due to invalid IL or missing references) Vector3 footPosition = ((EntityState)this).characterBody.footPosition; float num = 2f; float num2 = num * 2f; float num3 = PocketWormholeSkill.maxTunnelDistance; Rigidbody rigidbody = ((EntityState)this).rigidbody; if (!Object.op_Implicit((Object)(object)rigidbody)) { validPlacement = false; return; } Vector3 position = ((EntityState)this).transform.position; Ray aimRay = ((BaseState)this).GetAimRay(); RaycastHit val = default(RaycastHit); Vector3 val2; Vector3 val3; if (Physics.Raycast(aimRay, ref val, num3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val2 = ((RaycastHit)(ref val)).point + ((RaycastHit)(ref val)).normal * num; } else if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { Vector3 aimOrigin = ((EntityState)this).inputBank.aimOrigin; val3 = ((EntityState)this).inputBank.aimDirection; val2 = aimOrigin + ((Vector3)(ref val3)).normalized * num3; } else { Vector3 position2 = ((EntityState)this).transform.position; val3 = ((EntityState)this).transform.forward; val2 = position2 + ((Vector3)(ref val3)).normalized * num3; } Vector3 val4 = val2 - position; Vector3 normalized = ((Vector3)(ref val4)).normalized; Vector3 val5 = val2; RaycastHit val6 = default(RaycastHit); if (rigidbody.SweepTest(normalized, ref val6, ((Vector3)(ref val4)).magnitude)) { if (((RaycastHit)(ref val6)).distance < num2) { validPlacement = false; } else { validPlacement = true; } val5 = position + normalized * ((RaycastHit)(ref val6)).distance; } else { validPlacement = true; } startpointPosition = position + normalized * num; endpointPosition = val5; } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!((EntityState)this).isAuthority) { return; } ((BaseState)this).StartAimMode(enterDuration, false); if (!(((EntityState)this).fixedAge < enterDuration)) { UpdateAimInfo(); if (!((BaseSkillState)this).IsKeyDownAuthority()) { hasFired = true; releaseTime = ((EntityState)this).fixedAge; ((BaseState)this).StartAimMode(exitDuration + 2f, false); Fire(); } } } private void Fire() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) endpointIndicatorInstance.SetActive(false); OverrideRequest val = crosshairOverrideRequest; if (val != null) { val.Dispose(); } FireWormhole fireWormhole = new FireWormhole(); ((BaseSkillState)fireWormhole).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; fireWormhole.startPos = startpointPosition; fireWormhole.endpointPos = endpointPosition; ((EntityState)this).outer.SetNextState((EntityState)(object)fireWormhole); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } } namespace SurvivorTweaks.Skills { internal class PocketWormholeSkill : SkillBase { public GetDeployableSameSlotLimit GetWormholeSlotLimit; public static DeployableSlot wormholeDeployableSlot; public static GameObject ziplinePrefab; [AutoConfig("Max Wormhole Count Base", 1)] public static float maxWormholesBase = 1f; [AutoConfig("Max Wormhole Count Per Upgrade", 0.5f)] public static float maxWormholesUpgrade = 0.5f; [AutoConfig("Max Wormhole Distance", 60)] public static int maxTunnelDistance = 60; [AutoConfig("Max Wormhole Duration", 999)] public static float maxTunnelDuration = 999f; [AutoConfig("Base Enter Duration", 0.8f)] public static float baseEnterDuration = 0.8f; [AutoConfig("Base Exit Duration", 0.7f)] public static float baseExitDuration = 0.7f; public override float BaseCooldown => 20f; public override InterruptPriority InterruptPriority => (InterruptPriority)1; public override Type BaseSkillDef => typeof(SkillDef); public override AssetBundle assetBundle => SurvivorTweaksPlugin.mainAssetBundle; public override string ConfigName => "Skills : Captain : Pocket Wormhole"; public override string SkillName => "Pocket Wormhole"; public override string SkillDescription => "Create a " + Language.Styling.UtilityColor("quantum tunnel") + " for ALL allies to use. Lasts until replaced."; public override string TOKEN_IDENTIFIER => "CAPTAINTUNNEL"; public override Sprite Icon => assetBundle.LoadAsset("Assets/Icons/pocketwormhole.png"); public override Type ActivationState => typeof(PocketWormhole); public override string CharacterName => "CaptainBody"; public override SkillSlot SkillSlot => (SkillSlot)1; public override SimpleSkillData SkillData => new SimpleSkillData(1, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: true, cancelSprintingOnActivation: true, forceSprintingDuringState: false, dontAllowPastMaxStocks: false, fullRestockOnAssign: true, isCombatSkill: false, mustKeyPress: true, 1, 1, resetCooldownTimerOnUse: false, 1, useAttackSpeedScaling: false, suppressSkillActivation: true); public override void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) base.Init(); GetWormholeSlotLimit = (GetDeployableSameSlotLimit)Delegate.Combine((Delegate?)(object)GetWormholeSlotLimit, (Delegate?)new GetDeployableSameSlotLimit(GetMaxWormholes)); wormholeDeployableSlot = DeployableAPI.RegisterDeployableSlot(GetWormholeSlotLimit); Content.AddEntityState(typeof(FireWormhole)); SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Gateway.Gateway_asset, (Action)delegate(EquipmentDef equip) { equip.canDrop = false; equip.enigmaCompatible = false; equip.canBeRandomlyTriggered = false; }); SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Gateway.Zipline_prefab, (Action)delegate(GameObject zipline) { ziplinePrefab = PrefabAPI.InstantiateClone(zipline, "PocketWormholeZipline", true); TeamFilter val = default(TeamFilter); if (!ziplinePrefab.TryGetComponent(ref val)) { val = ziplinePrefab.AddComponent(); } GenericOwnership val2 = default(GenericOwnership); if (!ziplinePrefab.TryGetComponent(ref val2)) { val2 = ziplinePrefab.AddComponent(); } Deployable val3 = default(Deployable); if (!ziplinePrefab.TryGetComponent(ref val3)) { val3 = ziplinePrefab.AddComponent(); } }); } public override void Hooks() { } private int GetMaxWormholes(CharacterMaster self, int deployableCountMultiplier) { int num = (int)maxWormholesBase + Mathf.CeilToInt((float)self.inventory.GetItemCountPermanent(Items.SecondarySkillMagazine) * maxWormholesUpgrade); GameObject bodyObject = self.GetBodyObject(); return num * deployableCountMultiplier; } } internal class LaserrangSkill : SkillBase { public static GameObject boomerangPrefab; [AutoConfig("Max Boomerang Fly-Out Time", 0.3f)] public static float maxFlyOutTime = 0.3f; [AutoConfig("Boomerang Scale Factor", 0.4f)] public static float boomerangScale = 0.4f; [AutoConfig("Boomerang Speed", 90f)] public static float boomerangSpeed = 90f; [AutoConfig("Damage Coefficient", 4.5f)] public static float damageCoefficient = 4.5f; [AutoConfig("Proc Coefficient", 0.8f)] public static float procCoefficient = 0.8f; [AutoConfig("Base Duration", 1.35f)] public static float baseDuration = 1.35f; [AutoConfig("Force", 150f)] public static float force = 150f; [AutoConfig("AntiGravity Strength", 20f)] public static float antiGravStrength = 20f; public override float BaseCooldown => 8f; public override InterruptPriority InterruptPriority => (InterruptPriority)1; public override Type BaseSkillDef => typeof(SkillDef); public override AssetBundle assetBundle => SurvivorTweaksPlugin.mainAssetBundle; public override string ConfigName => "Skills : Huntress : LaserRang"; public override string SkillName => "Laser-Rang"; public override string SkillDescription => Language.Styling.DamageColor("Slayer") + ". Throw a " + Language.Styling.DamageColor("piercing") + " boomerang that slices through enemies for " + Language.Styling.DamageValueText(damageCoefficient) + ". Can " + Language.Styling.DamageColor("strike") + " enemies again on the way back."; public override string TOKEN_IDENTIFIER => "HUNTRESSLASERRANG"; public override Sprite Icon => assetBundle.LoadAsset("Assets/Icons/laserrangskill.png"); public override Type ActivationState => typeof(ThrowLaserrang); public override string CharacterName => "HuntressBody"; public override SkillSlot SkillSlot => (SkillSlot)1; public override SimpleSkillData SkillData => new SimpleSkillData(); public override void Init() { KeywordTokens = new string[1] { "KEYWORD_SLAYER" }; SurvivorTweaksPlugin.LoadAsync(RoR2_Base_Saw.Sawmerang_prefab, (Action)CreateProjectile); base.Init(); } public override void Hooks() { } private void CreateProjectile(GameObject projectilePrefab) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) boomerangPrefab = PrefabAPI.InstantiateClone(projectilePrefab, "HuntressLaserrang", true); boomerangPrefab.transform.localScale = Vector3.one * boomerangScale; SurvivorTweaksPlugin.LoadAsync(RoR2_Junk_Huntress.GlaiveGhost_prefab, (Action)delegate(GameObject ghost) { ProjectileController component5 = boomerangPrefab.GetComponent(); component5.ghostPrefab = ghost; }); BoomerangProjectile component = boomerangPrefab.GetComponent(); component.travelSpeed = boomerangSpeed; component.transitionDuration = 0.8f; component.distanceMultiplier = maxFlyOutTime; component.isStunAndPierce = true; ProjectileDamage component2 = ((Component)component).GetComponent(); component2.damageType |= DamageTypeCombo.op_Implicit((DamageType)524288); component2.damageType.damageSource = (DamageSource)2; ProjectileDotZone component3 = boomerangPrefab.GetComponent(); Object.Destroy((Object)(object)component3); ProjectileOverlapAttack component4 = boomerangPrefab.GetComponent(); component4.damageCoefficient = 1f; component4.overlapProcCoefficient = procCoefficient; Content.AddProjectilePrefab(boomerangPrefab); } } internal class DynamicPunchSkill : SkillBase { [AutoConfig("Damage Coefficient", 3f)] public static float damageCoefficient = 3f; [AutoConfig("Proc Coefficient", 1f)] public static float procCoefficient = 1f; [AutoConfig("Base Duration", 1.35f)] public static float baseDuration = 1.35f; [AutoConfig("Force", 500f)] public static float force = 500f; public static BuffDef loaderArmorBreak; public override bool isEnabled => false; public override string ConfigName => "Skills : Loader : Dynamic Punch"; public override string SkillName => "Dynamic Punch"; public override string SkillDescription => "Charge a flurry of punches. Releasing early will instead throw a single punch, " + Language.Styling.UtilityColor("stunning and knocking enemies back") + " for " + Language.Styling.DamageValueText(damageCoefficient); public override string TOKEN_IDENTIFIER => "LOADERDYNAMICPUNCH"; public override Sprite Icon => assetBundle.LoadAsset("Assets/Icons/dynamicpunch.png"); public override Type ActivationState => typeof(ChargeDynamicPunch); public override Type BaseSkillDef => typeof(SkillDef); public override string CharacterName => "LoaderBody"; public override SkillSlot SkillSlot => (SkillSlot)0; public override float BaseCooldown => 1f; public override InterruptPriority InterruptPriority => (InterruptPriority)1; public override SimpleSkillData SkillData => new SimpleSkillData(); public override AssetBundle assetBundle => SurvivorTweaksPlugin.mainAssetBundle; public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(LoaderArmorBreakStats); } private void LoaderArmorBreakStats(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(loaderArmorBreak)) { args.armorAdd -= 20f; } } public override void Init() { //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_003f: Unknown result type (might be due to invalid IL or missing references) base.Init(); Content.AddEntityState(typeof(DynamicPunchJab)); Content.AddEntityState(typeof(DynamicPunchRush)); loaderArmorBreak = Content.CreateAndAddBuff("LoaderArmorBreak", Addressables.LoadAssetAsync((object)"RoR2/Base/ArmorReductionOnHit/texBuffPulverizeIcon.tif").WaitForCompletion(), Color.grey, canStack: true, isDebuff: true); } } public abstract class SkillBase : SkillBase where T : SkillBase { public static T instance { get; private set; } public SkillBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting SurvivorTweaks " + typeof(SkillBase).Name + " was instantiated twice"); } instance = this as T; } } public abstract class SkillBase : SharedBase { public class SimpleSkillData { internal int baseMaxStock; internal bool beginSkillCooldownOnSkillEnd; internal bool canceledFromSprinting; internal bool cancelSprintingOnActivation; internal bool forceSprintingDuringState; internal bool dontAllowPastMaxStocks; internal bool fullRestockOnAssign; internal bool isCombatSkill; internal bool mustKeyPress; internal int rechargeStock; internal int requiredStock; internal bool resetCooldownTimerOnUse; internal int stockToConsume; internal bool useAttackSpeedScaling; internal bool suppressSkillActivation; public SimpleSkillData(int baseMaxStock = 1, bool beginSkillCooldownOnSkillEnd = false, bool canceledFromSprinting = false, bool cancelSprintingOnActivation = true, bool forceSprintingDuringState = false, bool dontAllowPastMaxStocks = false, bool fullRestockOnAssign = true, bool isCombatSkill = true, bool mustKeyPress = false, int rechargeStock = 1, int requiredStock = 1, bool resetCooldownTimerOnUse = false, int stockToConsume = 1, bool useAttackSpeedScaling = false, bool suppressSkillActivation = false) { this.baseMaxStock = baseMaxStock; this.beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd; this.canceledFromSprinting = canceledFromSprinting; this.cancelSprintingOnActivation = cancelSprintingOnActivation; this.forceSprintingDuringState = forceSprintingDuringState; this.dontAllowPastMaxStocks = dontAllowPastMaxStocks; this.fullRestockOnAssign = fullRestockOnAssign; this.isCombatSkill = isCombatSkill; this.mustKeyPress = mustKeyPress; this.rechargeStock = rechargeStock; this.requiredStock = requiredStock; this.resetCooldownTimerOnUse = resetCooldownTimerOnUse; this.stockToConsume = stockToConsume; this.useAttackSpeedScaling = useAttackSpeedScaling; this.suppressSkillActivation = suppressSkillActivation; } } public string[] KeywordTokens; private SkillDef _SkillDef; private SkillDef _ScepterSkillDef; private int variantIndex; public UnlockableDef unlockDef; public override string BASE_TOKEN => base.BASE_TOKEN + GetElementString(Element); public override string TOKEN_PREFIX { get; } = "SKILL_"; public override AssetBundle assetBundle => SurvivorTweaksPlugin.mainAssetBundle; public override string ConfigName => "Skills : " + SkillName; public abstract string SkillName { get; } public abstract string SkillDescription { get; } public abstract Sprite Icon { get; } public abstract Type ActivationState { get; } public abstract Type BaseSkillDef { get; } public abstract string CharacterName { get; } public abstract SkillSlot SkillSlot { get; } public abstract float BaseCooldown { get; } public abstract InterruptPriority InterruptPriority { get; } public abstract SimpleSkillData SkillData { get; } public virtual string ActivationStateMachineName { get; set; } = "Weapon"; public SkillDef SkillDef { get { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if ((Object)(object)_SkillDef == (Object)null) { _SkillDef = (SkillDef)ScriptableObject.CreateInstance(BaseSkillDef); } return _SkillDef; } set { _SkillDef = value; } } public SkillDef ScepterSkillDef { get { return _ScepterSkillDef; } private set { _ScepterSkillDef = value; } } public virtual string ScepterSkillName { get; } public virtual string ScepterSkillDesc { get; } public virtual Type ScepterActivationState { get; } public virtual MageElement Element { get; set; } = (MageElement)0; private string GetElementString(MageElement type) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected I4, but got Unknown string text = ""; return (type - 1) switch { 0 => "_FIRE", 2 => "_LIGHTNING", 1 => "_ICE", _ => "", }; } public override void Init() { base.Init(); CreateSkill(); if (RequiredUnlock != null) { unlockDef = UnlockBase.CreateUnlockDef(RequiredUnlock, Icon); } AddSkillToSkillFamily(); if (SurvivorTweaksPlugin.isScepterLoaded && ScepterSkillName != null) { CreateScepterSkill(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void CreateScepterSkill() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ScepterSkillDef = SurvivorTweaksPlugin.CloneSkillDef(SkillDef); ScepterSkillDef.skillNameToken = BASE_TOKEN + "_SCEPTER_NAME"; ScepterSkillDef.skillDescriptionToken = BASE_TOKEN + "_SCEPTER_DESC"; ScepterSkillDef = ModifyScepterSkill(ScepterSkillDef); LanguageAPI.Add(BASE_TOKEN + "_SCEPTER_NAME", ScepterSkillName); LanguageAPI.Add(BASE_TOKEN + "_SCEPTER_DESC", SkillDescription + "\nSCEPTER: " + ScepterSkillDesc + ""); if (ItemBase.instance.RegisterScepterSkill(ScepterSkillDef, CharacterName, SkillSlot, variantIndex)) { Content.AddSkillDef(ScepterSkillDef); } } public virtual SkillDef ModifyScepterSkill(SkillDef scepterSkillDef) { return scepterSkillDef; } public override void Lang() { LanguageAPI.Add(BASE_TOKEN + "_NAME", SkillName); LanguageAPI.Add(BASE_TOKEN + "_DESCRIPTION", SkillDescription); } public Sprite LoadSpriteFromBundle(string name) { return assetBundle.LoadAsset(name + ".png"); } public Sprite LoadSpriteFromRor(string path) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync((object)path).WaitForCompletion(); } public Sprite LoadSpriteFromRorSkill(string path) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync((object)path).WaitForCompletion().icon; } private void CreateSkill() { //IL_0040: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if ((Object)(object)SkillDef == (Object)null) { SkillDef = (SkillDef)ScriptableObject.CreateInstance(BaseSkillDef); } Content.AddEntityState(ActivationState); SkillDef.activationState = new SerializableEntityStateType(ActivationState); SkillDef.skillNameToken = BASE_TOKEN + "_NAME"; SkillDef.skillName = SkillName; SkillDef.skillDescriptionToken = BASE_TOKEN + "_DESCRIPTION"; SkillDef.activationStateMachineName = ActivationStateMachineName; SkillDef.keywordTokens = KeywordTokens; SkillDef.icon = Icon; SkillDef.baseRechargeInterval = Bind(BaseCooldown, "Base Cooldown"); SkillDef.baseMaxStock = Bind(SkillData.baseMaxStock, "Base Max Stock"); SkillDef.rechargeStock = Mathf.Min(Bind(SkillData.rechargeStock, "Recharge Stock"), SkillDef.baseMaxStock); SkillDef.interruptPriority = InterruptPriority; SkillDef.beginSkillCooldownOnSkillEnd = SkillData.beginSkillCooldownOnSkillEnd; SkillDef.dontAllowPastMaxStocks = SkillData.dontAllowPastMaxStocks; SkillDef.fullRestockOnAssign = SkillData.fullRestockOnAssign; SkillDef.isCombatSkill = Bind(SkillData.isCombatSkill, "Is Combat Skill"); SkillDef.mustKeyPress = Bind(SkillData.mustKeyPress, "Must Key Press", "Setting to FALSE will allow the skill to be recast after it ends as long as the button is held."); SkillDef.requiredStock = SkillData.requiredStock; SkillDef.resetCooldownTimerOnUse = SkillData.resetCooldownTimerOnUse; SkillDef.stockToConsume = SkillData.stockToConsume; SkillDef.suppressSkillActivation = SkillData.suppressSkillActivation; SkillDef.cancelSprintingOnActivation = Bind(SkillData.cancelSprintingOnActivation, "Cancels Sprinting", "Recommended to use HuntressBuffULTIMATE for intended behavior."); SkillDef.forceSprintDuringState = Bind(SkillData.forceSprintingDuringState, "Force Sprinting During State", "Used by mobility skills."); SkillDef.canceledFromSprinting = !SurvivorTweaksPlugin.autosprintLoaded && SkillData.cancelSprintingOnActivation && !SkillData.forceSprintingDuringState && Bind(SkillData.canceledFromSprinting, "Canceled From Sprinting", "Note: Only set to true if AUTOSPRINT isnt loaded, the skill cancels sprinting, and the skill doesn't force sprinting. This avoids situations where the skill can cancel itself without additional input."); Content.AddSkillDef(SkillDef); } protected void AddSkillToSkillFamily() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00b8: 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_00d5: Expected I4, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(CharacterName)) { return; } string text = Log.Combine("Skills", SkillName); string characterName = CharacterName; SkillLocator val; if (global::SurvivorTweaks.Modules.Skills.characterSkillLocators.ContainsKey(characterName)) { val = global::SurvivorTweaks.Modules.Skills.characterSkillLocators[characterName]; } else { GameObject val2 = LegacyResourcesAPI.Load("prefabs/characterbodies/" + characterName); val = ((val2 != null) ? val2.GetComponent() : null); if (Object.op_Implicit((Object)(object)val)) { global::SurvivorTweaks.Modules.Skills.characterSkillLocators.Add(characterName, val); } } if ((Object)(object)val != (Object)null) { SkillFamily val3 = null; SkillSlot skillSlot = SkillSlot; SkillSlot val4 = skillSlot; switch (val4 - -1) { case 1: val3 = val.primary.skillFamily; break; case 2: val3 = val.secondary.skillFamily; break; case 3: val3 = val.utility.skillFamily; break; case 4: val3 = val.special.skillFamily; break; case 0: Log.Warning(text + "Special case!"); break; } if ((Object)(object)val3 != (Object)null) { Log.Debug(text + "initializing!"); variantIndex = val3.variants.Length; Array.Resize(ref val3.variants, variantIndex + 1); Variant[] variants = val3.variants; int num = variantIndex; Variant val5 = new Variant { skillDef = SkillDef, unlockableDef = unlockDef }; ((Variant)(ref val5)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null); variants[num] = val5; Log.Debug(text + "success!"); } else { Log.Error(text + "No skill family " + ((object)SkillSlot/*cast due to .constrained prefix*/).ToString() + " found from " + CharacterName); } } else { Log.Error(text + "No skill locator found from " + CharacterName); } } internal UnlockableDef GetUnlockDef(Type type) { return null; } } public enum SkillFamilyName { Misc = -1, Passive, Primary, Secondary, Utility, Special } } namespace SurvivorTweaks.Skills.SkillDefTypes { internal class DualSkillDef : SkillDef { private class InstanceData : BaseSkillInstanceData { private CharacterBody _body; public bool isPlayerControlled { get { if ((Object)(object)body == (Object)null) { return false; } return body.isPlayerControlled; } } public CharacterBody body { get { return _body; } set { if (!((Object)(object)_body == (Object)(object)value)) { _body = value; } } } } public SerializableEntityStateType alternateActivationState; public override BaseSkillInstanceData OnAssigned(GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new InstanceData { body = skillSlot.characterBody }; } public override void OnUnassigned(GenericSkill skillSlot) { ((InstanceData)(object)skillSlot.skillInstanceData).body = null; } public override EntityState InstantiateNextState(GenericSkill skillSlot) { EntityState val = null; InstanceData instanceData = (InstanceData)(object)skillSlot.skillInstanceData; val = ((!instanceData.isPlayerControlled) ? EntityStateCatalog.InstantiateState(ref alternateActivationState) : EntityStateCatalog.InstantiateState(ref base.activationState)); ISkillState val2; if ((val2 = (ISkillState)(object)((val is ISkillState) ? val : null)) != null) { val2.activatorSkillSlot = skillSlot; } return val; } } } namespace SurvivorTweaks.Orbs { public class DiseaseOrb : Orb { public float speed = 100f; public float damageValue; public GameObject attacker; public GameObject inflictor; public int bouncesRemaining; public int maxBounces; public List debuffBlacklistedObjects; public List bouncedObjects; public TeamIndex teamIndex; public bool isCrit; public ProcChainMask procChainMask; public float procCoefficient = 1f; public DamageColorIndex damageColorIndex; public float range = 30f; public float damageCoefficientPerBounce = 1f; public int targetsToFindPerBounce = 1; public DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0); private bool failedToKill; public BullseyeSearch search; private bool redoSearch = false; public List splitDotInformation; private float orbDuration = 0.8f; public static event Action onLightningOrbKilledOnAllBounces; public static List GetSplitDotInformation(CharacterBody victimBody, CharacterBody attackerBody) { //IL_0024: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) List list = new List(); DotController val = DotController.FindDotController(((Component)victimBody).gameObject); BuffIndex[] debuffAndDotsIndicesExcludingNoxiousThorns = BuffCatalog.debuffAndDotsIndicesExcludingNoxiousThorns; foreach (BuffIndex val2 in debuffAndDotsIndicesExcludingNoxiousThorns) { BuffDef buffDef = BuffCatalog.GetBuffDef(val2); if (buffDef.isDOT && !((Object)(object)val == (Object)null)) { int buffCount = victimBody.GetBuffCount(buffDef); if (buffCount > 0) { int count = Mathf.CeilToInt((float)buffCount * CommonAssets.contagiousTransferRate); DotIndex dotDefIndex = DotController.GetDotDefIndex(buffDef); bool flag = false; float duration = 0f; flag = val.GetDotStackTotalDurationForIndex(dotDefIndex, ref duration); SplitDebuffInformation item = new SplitDebuffInformation { attacker = ((Component)attackerBody).gameObject, attackerMaster = attackerBody.master, index = val2, isTimed = flag, duration = duration, count = count }; list.Add(item); } } } return list; } public override void Begin() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown string text = "Prefabs/Effects/OrbEffects/CrocoDiseaseOrbEffect"; ((Orb)this).duration = orbDuration; targetsToFindPerBounce = 1; EffectData val = new EffectData { origin = base.origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(base.target); EffectManager.SpawnEffect(OrbStorageUtility.Get(text), val, true); } public override void OnArrival() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: 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_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)base.target)) { return; } HealthComponent healthComponent = base.target.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { DamageInfo val = new DamageInfo(); val.damage = damageValue; val.attacker = attacker; val.inflictor = inflictor; val.force = Vector3.zero; val.crit = isCrit; val.procChainMask = procChainMask; val.procCoefficient = procCoefficient; val.position = ((Component)base.target).transform.position; val.damageColorIndex = damageColorIndex; val.damageType = damageType; healthComponent.TakeDamage(val); if (splitDotInformation != null && splitDotInformation.Count > 0 && (debuffBlacklistedObjects == null || debuffBlacklistedObjects.Count == 0 || !debuffBlacklistedObjects.Contains(healthComponent))) { ApplySplitDebuffs(healthComponent); } GlobalEventManager.instance.OnHitEnemy(val, ((Component)healthComponent).gameObject); GlobalEventManager.instance.OnHitAll(val, ((Component)healthComponent).gameObject); } failedToKill |= !Object.op_Implicit((Object)(object)healthComponent) || healthComponent.alive; if (bouncesRemaining > 0) { for (int i = 0; i < targetsToFindPerBounce; i++) { if (bouncedObjects != null) { bouncedObjects.Add(base.target.healthComponent); } HurtBox val2 = PickNextTarget(((Component)base.target).transform.position); if (Object.op_Implicit((Object)(object)val2)) { bouncesRemaining--; DiseaseOrb diseaseOrb = new DiseaseOrb(); diseaseOrb.splitDotInformation = splitDotInformation; diseaseOrb.debuffBlacklistedObjects = debuffBlacklistedObjects; diseaseOrb.search = search; ((Orb)diseaseOrb).origin = ((Component)base.target).transform.position; ((Orb)diseaseOrb).target = val2; diseaseOrb.attacker = attacker; diseaseOrb.inflictor = inflictor; diseaseOrb.teamIndex = teamIndex; diseaseOrb.damageValue = damageValue * damageCoefficientPerBounce; diseaseOrb.bouncesRemaining = bouncesRemaining; diseaseOrb.maxBounces = maxBounces; diseaseOrb.isCrit = isCrit; diseaseOrb.bouncedObjects = bouncedObjects; diseaseOrb.procChainMask = procChainMask; diseaseOrb.procCoefficient = procCoefficient; diseaseOrb.damageColorIndex = damageColorIndex; diseaseOrb.damageCoefficientPerBounce = damageCoefficientPerBounce; diseaseOrb.speed = speed; diseaseOrb.range = range; diseaseOrb.damageType = damageType; diseaseOrb.failedToKill = failedToKill; diseaseOrb.orbDuration = orbDuration * 0.8f; OrbManager.instance.AddOrb((Orb)(object)diseaseOrb); } } } else if (!failedToKill) { DiseaseOrb.onLightningOrbKilledOnAllBounces?.Invoke(this); } } private void ApplySplitDebuffs(HealthComponent hc) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0047: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = hc.body; foreach (SplitDebuffInformation item in splitDotInformation) { BuffDef buffDef = BuffCatalog.GetBuffDef(item.index); if (buffDef.isDOT) { DotIndex dotDefIndex = DotController.GetDotDefIndex(buffDef); DotDef dotDef = DotController.GetDotDef(dotDefIndex); InflictDotInfo val = new InflictDotInfo { attackerObject = item.attacker, victimObject = ((Component)body).gameObject, damageMultiplier = 1f, dotIndex = dotDefIndex, duration = Mathf.Max(item.duration, dotDef.interval) }; for (int i = 0; i < item.count; i++) { DotController.InflictDot(ref val); } } GlobalEventManager.ProcDeathMark(((Component)base.target).gameObject, body, item.attackerMaster); } if (debuffBlacklistedObjects != null) { debuffBlacklistedObjects.Add(hc); } Util.PlaySound("Play_item_proc_triggerEnemyDebuffs", ((Component)body).gameObject); } public HurtBox PickNextTarget(Vector3 position) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_002e: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (search == null) { search = new BullseyeSearch(); } if (redoSearch) { search.searchOrigin = position; search.searchDirection = Vector3.zero; search.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref search.teamMaskFilter)).RemoveTeam(teamIndex); search.filterByLoS = false; search.sortMode = (SortMode)1; search.maxDistanceFilter = range; } search.RefreshCandidates(); int num = 0; IEnumerable source = from v in search.GetResults() where !bouncedObjects.Contains(v.healthComponent) select v; if (num >= source.Count()) { return null; } HurtBox val = source.FirstOrDefault(); if (Object.op_Implicit((Object)(object)val)) { bouncedObjects.Add(val.healthComponent); } return val; } } } namespace SurvivorTweaks.Components { public class MasterDesperadoTokenTracker : MonoBehaviour { public CharacterMaster master; public int desperadoTokenCount { get; private set; } public static int GetMaxPersistentTokenCountFromLevel(float level) { return BanditTweaks.desperadoTokensPerLevel * Mathf.FloorToInt(level); } public void SetTokenCount(int value) { desperadoTokenCount = value; } public void OnServerStageComplete(Stage stage) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) int maxPersistentTokenCountFromLevel = GetMaxPersistentTokenCountFromLevel(TeamManager.instance.GetTeamLevel(master.teamIndex)); if (desperadoTokenCount > maxPersistentTokenCountFromLevel) { desperadoTokenCount = maxPersistentTokenCountFromLevel; } } private void OnBodyStart(CharacterBody body) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) body.SetBuffCount(Buffs.BanditSkull.buffIndex, desperadoTokenCount); } private void OnEnable() { Stage.onServerStageComplete += OnServerStageComplete; if ((Object)(object)master == (Object)null) { master = ((Component)this).GetComponent(); } if ((Object)(object)master != (Object)null) { master.onBodyStart += OnBodyStart; } } private void OnDisable() { Stage.onServerStageComplete -= OnServerStageComplete; if ((Object)(object)master == (Object)null) { master = ((Component)this).GetComponent(); } if ((Object)(object)master != (Object)null) { master.onBodyStart -= OnBodyStart; } } } [RequireComponent(typeof(ProjectileController), typeof(ProjectileDamage))] public class ProjectileDiseaseOrbController : MonoBehaviour, IProjectileImpactBehavior { private ProjectileController projectileController; private TeamFilter teamFilter; private ProjectileDamage projectileDamage; public float maxOrbRange = 100f; public float orbSpreadRange = 20f; public float procCoefficient; public int bounces; public float damageCoefficient; private bool fired = false; private TeamIndex myTeamIndex { get { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)teamFilter)) { return (TeamIndex)0; } return teamFilter.teamIndex; } } private void Start() { if (NetworkServer.active) { projectileController = ((Component)this).GetComponent(); teamFilter = projectileController.teamFilter; projectileDamage = ((Component)this).GetComponent(); } else { ((Behaviour)this).enabled = false; } } public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_002f: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if (fired) { return; } fired = true; Vector3 estimatedPointOfImpact = impactInfo.estimatedPointOfImpact; bool flag = true; List list = new List(); BullseyeSearch val = new BullseyeSearch(); val.searchOrigin = estimatedPointOfImpact; val.maxDistanceFilter = maxOrbRange; val.teamMaskFilter = TeamMask.GetEnemyTeams(myTeamIndex); val.sortMode = (SortMode)1; val.RefreshCandidates(); List list2 = val.GetResults().ToList(); if (list2.Count <= 0) { return; } HurtBox val2 = list2.FirstOrDefault(); List splitDotInformation = null; if (Object.op_Implicit((Object)(object)val2)) { CharacterBody body = val2.healthComponent.body; CharacterBody val3 = null; if (Object.op_Implicit((Object)(object)projectileController.owner)) { val3 = projectileController.owner.GetComponent(); } if ((Object)(object)body != (Object)null && (Object)(object)val3 != (Object)null) { Vector3 val4 = body.corePosition - estimatedPointOfImpact; float sqrMagnitude = ((Vector3)(ref val4)).sqrMagnitude; bool flag2 = true; splitDotInformation = DiseaseOrb.GetSplitDotInformation(body, val3); list.Add(val2.healthComponent); } } DiseaseOrb diseaseOrb = new DiseaseOrb(); diseaseOrb.splitDotInformation = splitDotInformation; diseaseOrb.search = val; diseaseOrb.range = orbSpreadRange; diseaseOrb.bouncedObjects = new List(); diseaseOrb.debuffBlacklistedObjects = list; diseaseOrb.attacker = projectileController.owner; diseaseOrb.inflictor = ((Component)this).gameObject; diseaseOrb.teamIndex = myTeamIndex; diseaseOrb.damageValue = projectileDamage.damage * damageCoefficient; diseaseOrb.isCrit = projectileDamage.crit; ((Orb)diseaseOrb).origin = estimatedPointOfImpact; diseaseOrb.bouncesRemaining = bounces; diseaseOrb.maxBounces = bounces; diseaseOrb.procCoefficient = procCoefficient; ((Orb)diseaseOrb).target = val2; diseaseOrb.damageColorIndex = projectileDamage.damageColorIndex; diseaseOrb.damageType = projectileDamage.damageType; OrbManager.instance.AddOrb((Orb)(object)diseaseOrb); } } internal class ProjectileSetForceOnStart : MonoBehaviour { public float force = 0f; private void Start() { ProjectileDamage val = default(ProjectileDamage); if (((Component)this).TryGetComponent(ref val)) { val.force = force; } } } }