Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of DiyEngi v2.2.0
DiyEngi.dll
Decompiled 3 weeks agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Engi.EngiWeapon; using ExamplePlugin.libs; using HG; using HarmonyLib; using IL.EntityStates.Engi.EngiWeapon; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates; using On.EntityStates.Engi.EngiMissilePainter; using On.EntityStates.Engi.EngiWeapon; using On.RoR2; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DiyEngi")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c8450fbdd123f61753e8561b5b10a0529d807d21")] [assembly: AssemblyProduct("DiyEngi")] [assembly: AssemblyTitle("DiyEngi")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ExamplePlugin.libs { public enum TurretEnum { 工程师普通机枪塔_EngiTurretMaster, 工程师移动机枪塔_EngiWalkerTurretMaster, 工程师机枪塔2_EngiBeamTurretMaster, 孔雀石刺塔_UrchinTurretMaster, 克西结构体_MegaConstructMaster, 固定克西结构体_MajorConstructMaster, 装备无人机_EquipmentDroneMaster, 无人轰炸机_BombardmentDroneMaster, 清理无人机_CleanupDroneMaster, 冰冻无人机_CopycatDroneMaster, 超载蠕虫_ElectricWormMaster, 岩浆蠕虫_MagmaWormMaster, 纽特_ShopkeeperMaster, 操作员_DroneTechMonsterMaster, 漂泊者_DrifterMonsterMaster, 指挥官_CommandoMonsterMaster, 船长_CaptainMonsterMaster, 大厨_ChefMonsterMaster, 磁轨炮手_RailgunnerMonsterMaster, 盗贼_Bandit2MonsterMaster, 呛鼻毒师_CrocoMonsterMaster, 工匠_MageMonsterMaster, 工程师_EngiMonsterMaster, 女猎人_HuntressMonsterMaster, 雇佣兵_MercMonsterMaster, 装卸工_LoaderMonsterMaster, 多功能枪兵_ToolbotMonsterMaster, 雷克斯_TreebotMonsterMaster, 探寻者_SeekerMonsterMaster, 虚空恶鬼_VoidSurvivorMonsterMaster, 异教徒_HereticMonsterMaster, 虚假子嗣_FalseSonMonsterMaster, 阿尔法结构体_MinorConstructAttachableMaster, 阿尔法结构体黄金_MinorConstructOnKillMaster, 代号280原型机_MegaDroneMaster, 十字准星_DTGunnerDroneMaster, 啁啾_DTHaulerDroneMaster, 医疗兵_DTHeallingDroneMaster, 屏障无人机_RechargeDroneMaster, 狱警无人机_JailerDroneMaster, 垃圾无人机_JunkDroneMaster, 无人机小子中尉_DroneBomberMaster, 枪手机枪塔_Turret1Master, 枪手无人机_Drone1Master, 导弹无人机_DroneMissileMaster, 焚烧无人机_FlameDroneMaster, 治疗无人机_Drone2Master, 应急无人机_EmergencyDroneMaster, 攻击无人机_DroneBackupMaster, 内存模组_ExhaustPortWeakpointMaster, 最好的伙伴_FriendUnitMaster, 独一之翼_SolusWingMaster, 独一灼热者_TankerMaster, 独一失效者_DefectiveUnitMaster, 独一萃取者_ExtractorUnitMaster, 独一传送者_IronHaulerMaster, 独一经销商_MinePodMaster, 独一地雷_SolusMineMaster, 独一融合者_SolusAmalgamatorMaster, 独一之心_SolusHeartMaster, 独一之心_SolusHeartMaster_Offering, 被斩断的灼热者_SolusAmalgamatorFlamethrowerCannonMaster, 被斩断的破坏者_SolusAmalgamatorMissilePodMaster, 被斩断的探测器_SolusAmalgamatorThrusterMaster, SPEX_SolusVendorMaster, 多功能枪兵_ToolbotMonsterMasterVariant, 合金猎人_VultureHunterMaster, 独一勘探者_WorkerUnitMaster, 乌贼机枪塔_SquidTurretMaster, 先祖孵化舱_ParentPodMaster, 祖人_ParentMaster, 元祖_GrandparentMaster, 不知道_BrotherHauntMaster, 米斯历克斯一阶段_BrotherMaster, 米斯历克斯复制体_BrotherGlassMaster, 米斯历克斯三阶段_BrotherHurtMaster, 米斯历克斯_ITBrotherMaster, 刺客_Assassin2Master, 合金崇拜单体_SuperRoboBallBossMaster, 单独控制单元_RoboBallBossMaster, 独一探针_RoboBallMiniMaster, 安静的探测器_RoboBallRedBuddyMaster, 兴奋的探测器_RoboBallGreenBuddyMaster, 德鲁曼上校_DroneCommanderMaster, 合金秃鹫_VultureMaster, 黄铜装置_BellMaster, 盲虫_FlyingVerminMaster, 月球喀迈拉小球_LunarExploderMaster, 月球喀迈拉坦克_LunarGolemMaster, 月球喀迈拉大幽魂_LunarWispMaster, 加普_GupMaster, 基普_GeepMaster, 格普_GipMaster, 寄居蟹_HermitCrabMaster, 甲壳虫_BeetleMaster, 甲壳虫守卫_BeetleGuardAllyMaster, 甲壳虫守卫_BeetleGuardMaster, 甲壳虫守卫_BeetleGuardMasterCrystal, 巨角野牛_BisonMaster, 巨型幽魂_GreaterWispMaster, 利莫里亚_LemurianMaster, 利莫里亚长者_LemurianBruiserMaster, 灵魂小型幽魂_WispSoulMaster, 漫游者_VagrantMaster, 盲眼害虫_VerminMaster, 迷你菇_MiniMushroomMaster, 黏土沙丘行者_ClayBossMaster, 黏土圣堂武士_ClayBruiserMaster, 黏土药剂师_ClayGrenadierMaster, 森林守护者_GravekeeperMaster, 奥利雷奥尼特_TitanGoldAllyMaster, 奥利雷奥尼特_TitanGoldMaster, 石巨人_TitanMaster, 石傀儡_GolemMaster, 水母_JellyfishMaster, 小恶魔_ImpMaster, 小恶魔霸主_ImpBossMaster, 小型幽魂_WispMaster, 清道夫_ScavMaster, 温柔的基基普_ScavLunar1Master, 狂野的威威普_ScavLunar2Master, 信徒推推普_ScavLunar3Master, 幸运儿摇摇晃_ScavLunar4Master, 虚空感染者_VoidInfestorMaster, 虚空毁灭者_VoidMegaCrabMaster, 虚空掠夺者_NullifierAllyMaster, 虚空掠夺者_NullifierMaster, 虚空藤壶_VoidBarnacleMaster, 虚空藤壶_VoidBarnacleNoCastMaster, 虚空狱卒_VoidJailerAllyMaster, 虚空狱卒_VoidJailerMaster, 幼体_AcidLarvaMaster, 治疗核心_AffixEarthHealerMaster, 神器圣匣_ArtifactShellMaster, AncientWispMaster_AncientWispMaster, ArchWispMaster_ArchWispMaster, BeetleCrystalMaster_BeetleCrystalMaster, 甲壳虫女王_BeetleQueenMaster, 魔童_ChildMaster, 黏土人_ClaymanMaster, 月霖_CorruptionSpikeMaster, 利莫里亚_DevotedLemurianMaster, 虚假子嗣_FalseSonBossLunarShardBrokenMaster, 虚假子嗣_FalseSonBossLunarShardMaster, 虚假子嗣_FalseSonBossMaster, 哈雷肯尼特_HalcyoniteMaster, 利莫里亚长者_LemurianBruiserMasterFire, 利莫里亚长者_LemurianBruiserMasterHaunted, 利莫里亚长者_LemurianBruiserMasterIce, 利莫里亚长者_LemurianBruiserMasterPoison, 虚灵_MiniVoidRaidCrabMasterBase, 虚灵_MiniVoidRaidCrabMasterPhase1, 虚灵_MiniVoidRaidCrabMasterPhase2, 虚灵_MiniVoidRaidCrabMasterPhase3, 阿尔法结构体_MinorConstructMaster, 烧灼地龙_ScorchlingMaster, 虚空藤壶_VoidBarnacleAllyMaster, 虚空毁灭者_VoidMegaCrabAllyMaster, 虚灵_VoidRaidCrabJointMaster, 虚灵_VoidRaidCrabMaster } } namespace DiyEngi { public enum AutoFirEngiMissileTypeEnum { single_单发, all_并发 } [BepInPlugin("top.sshh.DiyEngi", "DiyEngi", "2.1.0")] public class DiyEngi : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_HandleBulletDamage <>9__39_0; public static Func<Instruction, bool> <>9__41_0; public static Func<Instruction, bool> <>9__42_0; public static Func<Instruction, bool> <>9__42_1; public static Func<Instruction, bool> <>9__42_2; public static Func<Instruction, bool> <>9__42_3; public static Func<Instruction, bool> <>9__42_4; public static Func<Instruction, bool> <>9__42_5; public static Func<Instruction, bool> <>9__42_6; public static Func<Instruction, bool> <>9__42_8; public static Func<Instruction, bool> <>9__42_9; public static Func<Instruction, bool> <>9__42_10; internal void <Awake>b__39_0(orig_HandleBulletDamage orig, NetworkMessage netMsg) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown NetworkReader reader = netMsg.reader; GameObject val = reader.ReadGameObject(); DamageInfo val2 = NetworkExtensions.ReadDamageInfo(reader); if (reader.ReadBoolean() && Object.op_Implicit((Object)(object)val)) { HealthComponent component = val.GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component)) { if (val2 != null) { CharacterBody component2 = val2.attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component2) && component2.isPlayerControlled && component2.damage * 401f < val2.damage && val2.procChainMask.mask == 0 && (int)val2.damageColorIndex != 3 && component2.inventory.GetItemCount(Items.BleedOnHitAndExplode) > 0) { SimpleChatMessage val3 = new SimpleChatMessage(); val3.baseToken = "检测到[" + component2.GetUserName() + "]基础攻击力为(" + component2.damage + ")客户端上报伤害为(" + val2.damage + ")理论上不应该超过基础400倍(大恶魔)"; Chat.SendBroadcastChat((ChatMessageBase)(object)val3); val2.damage = component2.damage; } } component.TakeDamage(val2); } GlobalEventManager.instance.OnHitEnemy(val2, val); } GlobalEventManager.instance.OnHitAll(val2, val); } internal bool <HookMinePosition>b__41_0(Instruction c) { return ILPatternMatchingExt.MatchCall<Ray>(c, "get_origin"); } internal bool <DiyPlacementInfo>b__42_0(Instruction x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ILPatternMatchingExt.Match(x, OpCodes.Ldloca_S); } internal bool <DiyPlacementInfo>b__42_1(Instruction x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ILPatternMatchingExt.Match<float>(x, OpCodes.Ldc_R4, 0f); } internal bool <DiyPlacementInfo>b__42_2(Instruction x) { return ILPatternMatchingExt.MatchStfld<Vector3>(x, "y"); } internal bool <DiyPlacementInfo>b__42_3(Instruction c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ILPatternMatchingExt.Match(c, OpCodes.Ldloca_S); } internal bool <DiyPlacementInfo>b__42_4(Instruction c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ILPatternMatchingExt.Match(c, OpCodes.Ldc_I4_0); } internal bool <DiyPlacementInfo>b__42_5(Instruction c) { return ILPatternMatchingExt.MatchStfld<PlacementInfo>(c, "ok"); } internal bool <DiyPlacementInfo>b__42_6(Instruction c) { return ILPatternMatchingExt.MatchStfld<PlacementInfo>(c, "position"); } internal bool <DiyPlacementInfo>b__42_8(Instruction c) { return ILPatternMatchingExt.MatchLdloc(c, 2); } internal bool <DiyPlacementInfo>b__42_9(Instruction c) { return ILPatternMatchingExt.MatchLdfld<PlacementInfo>(c, "ok"); } internal bool <DiyPlacementInfo>b__42_10(Instruction c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ILPatternMatchingExt.Match(c, OpCodes.Brfalse_S); } } public static Stopwatch stopwatch = Stopwatch.StartNew(); public static long time = stopwatch.ElapsedMilliseconds; public ChoiceOption turretConfig; public ConfigEntry<TurretEnum> engiTurretConfig; public ConfigEntry<bool> autoFireEngiMissileConfig; public ConfigEntry<bool> autoFireEngiMinesConfig; public ConfigEntry<bool> fireOnMasterConfig; public ConfigEntry<AutoFirEngiMissileTypeEnum> autoFirEngiMissileTypeConfig; public IntSliderOption primarySkillSetting; public IntSliderOption secondarySkillSetting; public IntSliderOption utilitySkillSetting; public IntSliderOption specialSkillSetting; public ConfigEntry<SkillOverridePriority> skillOverridePrioritySetting; public StepSliderOption skill2; public StepSliderOption skill3; public StepSliderOption skill4; public StepSliderOption skill5; public StepSliderOption skill6; public StepSliderOption skill7; public IntSliderOption turretPositionFix; public SkillOverridePriority skillOverridePriority; public int[] lastSkillIndex = new int[4] { -1, -1, -1, -1 }; public static string[] skillTextList; private GameObject engiBody = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/EngiBody.prefab").WaitForCompletion(); public static ConfigFile RoRConfig { get; set; } public static GameObject currentTurret { get; set; } public static DiyEngi Instance { get; set; } internal static ManualLogSource Logger { get; set; } public void Awake() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_010a: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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 //IL_0189: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Expected O, but got Unknown //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Expected O, but got Unknown //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Expected O, but got Unknown //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: 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_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Expected O, but got Unknown //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Expected O, but got Unknown //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Expected O, but got Unknown //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Expected O, but got Unknown //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Expected O, but got Unknown //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Expected O, but got Unknown //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Expected O, but got Unknown //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Expected O, but got Unknown //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Expected O, but got Unknown //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Expected O, but got Unknown //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Expected O, but got Unknown //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Expected O, but got Unknown //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Expected O, but got Unknown //IL_0014: 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_001f: Expected O, but got Unknown object obj = <>c.<>9__39_0; if (obj == null) { hook_HandleBulletDamage val = delegate(orig_HandleBulletDamage orig, NetworkMessage netMsg) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown NetworkReader reader = netMsg.reader; GameObject val3 = reader.ReadGameObject(); DamageInfo val4 = NetworkExtensions.ReadDamageInfo(reader); if (reader.ReadBoolean() && Object.op_Implicit((Object)(object)val3)) { HealthComponent component3 = val3.GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component3)) { if (val4 != null) { CharacterBody component4 = val4.attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component4) && component4.isPlayerControlled && component4.damage * 401f < val4.damage && val4.procChainMask.mask == 0 && (int)val4.damageColorIndex != 3 && component4.inventory.GetItemCount(Items.BleedOnHitAndExplode) > 0) { SimpleChatMessage val5 = new SimpleChatMessage(); val5.baseToken = "检测到[" + component4.GetUserName() + "]基础攻击力为(" + component4.damage + ")客户端上报伤害为(" + val4.damage + ")理论上不应该超过基础400倍(大恶魔)"; Chat.SendBroadcastChat((ChatMessageBase)(object)val5); val4.damage = component4.damage; } } component3.TakeDamage(val4); } GlobalEventManager.instance.OnHitEnemy(val4, val3); } GlobalEventManager.instance.OnHitAll(val4, val3); }; <>c.<>9__39_0 = val; obj = (object)val; } BulletAttack.HandleBulletDamage += (hook_HandleBulletDamage)obj; RoRConfig = ((BaseUnityPlugin)this).Config; Logger = ((BaseUnityPlugin)this).Logger; time = stopwatch.ElapsedMilliseconds; turretConfig = new ChoiceOption((ConfigEntryBase)(object)RoRConfig.Bind<TurretEnum>("setting", "TurretType", TurretEnum.工程师普通机枪塔_EngiTurretMaster, "怪物名称")); engiTurretConfig = RoRConfig.Bind<TurretEnum>("setting", "AllyTurretType", TurretEnum.工程师普通机枪塔_EngiTurretMaster, "友军工程师炮塔"); autoFireEngiMissileConfig = RoRConfig.Bind<bool>("setting", "MissileSkillAutoUse", true, "是否自动使用导弹"); autoFireEngiMinesConfig = RoRConfig.Bind<bool>("setting", "MinesAutoUse", true, "是否自动使用地雷"); fireOnMasterConfig = RoRConfig.Bind<bool>("setting", "FireOnMonsterPosition", true, "地雷和鱼叉是否生成在怪物身上"); turretPositionFix = new IntSliderOption(((BaseUnityPlugin)this).Config.Bind<int>("setting", "TurretPositionFix", 0, "炮塔摆放位置视线方向前后调整距离,-20,20"), new IntSliderConfig { min = -20, max = 20 }); autoFireEngiMissileConfig = RoRConfig.Bind<bool>("setting", "MissileSkillAutoUse", true, "是否自动使用导弹"); autoFirEngiMissileTypeConfig = RoRConfig.Bind<AutoFirEngiMissileTypeEnum>("setting", "MissileSkillUseType", AutoFirEngiMissileTypeEnum.single_单发, "自动使用导弹发射类型"); skill2 = new StepSliderOption(((BaseUnityPlugin)this).Config.Bind<float>("skillRechargeInterval", "PressureMines_压力地雷", 8f, "PressureMinesCooldown_压力地雷基础冷却时间_needRestartGame需要重启游戏"), new StepSliderConfig { min = 0f, max = 50f, increment = 0.1f }); skill3 = new StepSliderOption(((BaseUnityPlugin)this).Config.Bind<float>("skillRechargeInterval", "SpiderMines_蜘蛛地雷", 8f, "SpiderMinesCooldown_蜘蛛地雷基础冷却时间_needRestartGame需要重启游戏"), new StepSliderConfig { min = 0f, max = 50f, increment = 0.1f }); skill4 = new StepSliderOption(((BaseUnityPlugin)this).Config.Bind<float>("skillRechargeInterval", "BubbleShield_泡泡护盾", 25f, "BubbleShieldCooldown_泡泡护盾基础冷却时间_needRestartGame需要重启游戏"), new StepSliderConfig { min = 0f, max = 50f, increment = 0.1f }); skill5 = new StepSliderOption(((BaseUnityPlugin)this).Config.Bind<float>("skillRechargeInterval", "ThermalHarpoons_热力鱼叉", 2.5f, "ThermalHarpoonsCooldown_热力鱼叉基础冷却时间_needRestartGame需要重启游戏"), new StepSliderConfig { min = 0f, max = 50f, increment = 0.1f }); skill6 = new StepSliderOption(((BaseUnityPlugin)this).Config.Bind<float>("skillRechargeInterval", "TR12GaussAutoTurret_TR12高斯自动炮塔", 30f, "TR12GaussAutoTurretCooldown_TR12高斯自动炮塔基础冷却时间_needRestartGame需要重启游戏"), new StepSliderConfig { min = 0f, max = 50f, increment = 0.1f }); skill7 = new StepSliderOption(((BaseUnityPlugin)this).Config.Bind<float>("skillRechargeInterval", "TR58CarbonizerTurret_TR58碳化器炮塔", 30f, "TR58CarbonizerTurretCooldown_TR58碳化器炮塔基础冷却时间_needRestartGame需要重启游戏"), new StepSliderConfig { min = 0f, max = 50f, increment = 0.1f }); Harmony.CreateAndPatchAll(((object)this).GetType(), (string)null); ModSettingsManager.AddOption((BaseOption)(object)turretConfig); ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)engiTurretConfig)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(autoFireEngiMissileConfig)); ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)autoFirEngiMissileTypeConfig)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(autoFireEngiMinesConfig)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(fireOnMasterConfig)); ModSettingsManager.AddOption((BaseOption)(object)turretPositionFix); ModSettingsManager.AddOption((BaseOption)(object)skill2); ModSettingsManager.AddOption((BaseOption)(object)skill3); ModSettingsManager.AddOption((BaseOption)(object)skill4); ModSettingsManager.AddOption((BaseOption)(object)skill5); ModSettingsManager.AddOption((BaseOption)(object)skill6); ModSettingsManager.AddOption((BaseOption)(object)skill7); engiBody.GetComponent<SkillLocator>().secondary.skillFamily.variants[0].skillDef.baseRechargeInterval = skill2.Value; engiBody.GetComponent<SkillLocator>().secondary.skillFamily.variants[1].skillDef.baseRechargeInterval = skill3.Value; engiBody.GetComponent<SkillLocator>().utility.skillFamily.variants[0].skillDef.baseRechargeInterval = skill4.Value; engiBody.GetComponent<SkillLocator>().utility.skillFamily.variants[1].skillDef.baseRechargeInterval = skill5.Value; engiBody.GetComponent<SkillLocator>().special.skillFamily.variants[0].skillDef.baseRechargeInterval = skill6.Value; engiBody.GetComponent<SkillLocator>().special.skillFamily.variants[1].skillDef.baseRechargeInterval = skill7.Value; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Expected O, but got Unknown //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Expected O, but got Unknown //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Expected O, but got Unknown //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Expected O, but got Unknown //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Expected O, but got Unknown //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Expected O, but got Unknown //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Expected O, but got Unknown //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Expected O, but got Unknown //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Expected O, but got Unknown //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Expected O, but got Unknown skillTextList = new string[SkillCatalog._allSkillDefs.Length]; foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs) { SkillLocator component = allBodyPrefab.GetComponent<SkillLocator>(); CharacterBody component2 = allBodyPrefab.GetComponent<CharacterBody>(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component2 == (Object)null)) { if ((Object)(object)component.primary != (Object)null && (Object)(object)component.primary.skillFamily != (Object)null) { Variant[] variants = component.primary.skillFamily.variants; if (variants != null) { for (int i = 0; i < variants.Length; i++) { SkillDef skillDef = variants[i].skillDef; if ((Object)(object)skillDef != (Object)null && skillTextList[skillDef.skillIndex] == null) { skillTextList[skillDef.skillIndex] = skillDef.skillIndex + "_" + component2.GetDisplayName() + "_primary_" + skillDef.skillName + "_" + Language.GetString(skillDef.skillNameToken) + "\n"; } } } } if ((Object)(object)component.secondary != (Object)null && (Object)(object)component.secondary.skillFamily != (Object)null) { Variant[] variants2 = component.secondary.skillFamily.variants; if (variants2 != null) { for (int j = 0; j < variants2.Length; j++) { SkillDef skillDef2 = variants2[j].skillDef; if ((Object)(object)skillDef2 != (Object)null && skillTextList[skillDef2.skillIndex] == null) { skillTextList[skillDef2.skillIndex] = skillDef2.skillIndex + "_" + component2.GetDisplayName() + "_secondary_" + skillDef2.skillName + "_" + Language.GetString(skillDef2.skillNameToken) + "\n"; } } } } if ((Object)(object)component.utility != (Object)null && (Object)(object)component.utility.skillFamily != (Object)null) { Variant[] variants3 = component.utility.skillFamily.variants; if (variants3 != null) { for (int k = 0; k < variants3.Length; k++) { SkillDef skillDef3 = variants3[k].skillDef; if ((Object)(object)skillDef3 != (Object)null && skillTextList[skillDef3.skillIndex] == null) { skillTextList[skillDef3.skillIndex] = skillDef3.skillIndex + "_" + component2.GetDisplayName() + "_utility_" + skillDef3.skillName + "_" + Language.GetString(skillDef3.skillNameToken) + "\n"; } } } } if ((Object)(object)component.special != (Object)null && (Object)(object)component.special.skillFamily != (Object)null) { Variant[] variants4 = component.special.skillFamily.variants; if (variants4 != null) { for (int l = 0; l < variants4.Length; l++) { SkillDef skillDef4 = variants4[l].skillDef; if ((Object)(object)skillDef4 != (Object)null && skillTextList[skillDef4.skillIndex] == null) { skillTextList[skillDef4.skillIndex] = skillDef4.skillIndex + "_" + component2.GetDisplayName() + "_special_" + skillDef4.skillName + "_" + Language.GetString(skillDef4.skillNameToken) + "\n"; } } } } } } foreach (SkillDef allSkillDef in SkillCatalog.allSkillDefs) { if (skillTextList[allSkillDef.skillIndex] == null) { skillTextList[allSkillDef.skillIndex] = allSkillDef.skillIndex + "_" + allSkillDef.skillName + "_" + Language.GetString(allSkillDef.skillNameToken) + "\n"; } } string text = ""; foreach (CharacterMaster allMaster in MasterCatalog.allMasters) { text = text + Util.GetBestMasterName(allMaster) + "_" + ((Object)allMaster).name + ",\n"; } ((BaseOption)turretConfig).SetDescription(text, (BaseOptionConfig)new ChoiceConfig()); Logger.LogDebug((object)text); string text2 = "-1_defaultSkill_角色默认技能\n"; for (int m = 0; m < skillTextList.Length; m++) { text2 += skillTextList[m]; } Logger.LogDebug((object)text2); primarySkillSetting = new IntSliderOption(((BaseUnityPlugin)this).Config.Bind<int>("setting", "primary", -1, text2), new IntSliderConfig { min = -1, max = SkillCatalog._allSkillDefs.Length }); secondarySkillSetting = new IntSliderOption(((BaseUnityPlugin)this).Config.Bind<int>("setting", "secondary", -1, text2), new IntSliderConfig { min = -1, max = SkillCatalog._allSkillDefs.Length }); utilitySkillSetting = new IntSliderOption(((BaseUnityPlugin)this).Config.Bind<int>("setting", "utility", -1, text2), new IntSliderConfig { min = -1, max = SkillCatalog._allSkillDefs.Length }); specialSkillSetting = new IntSliderOption(((BaseUnityPlugin)this).Config.Bind<int>("setting", "special", -1, text2), new IntSliderConfig { min = -1, max = SkillCatalog._allSkillDefs.Length }); skillOverridePrioritySetting = RoRConfig.Bind<SkillOverridePriority>("setting", "skillOverridePriority", (SkillOverridePriority)0, "技能覆盖优先级"); ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)skillOverridePrioritySetting)); ModSettingsManager.AddOption((BaseOption)(object)primarySkillSetting); ModSettingsManager.AddOption((BaseOption)(object)secondarySkillSetting); ModSettingsManager.AddOption((BaseOption)(object)utilitySkillSetting); ModSettingsManager.AddOption((BaseOption)(object)specialSkillSetting); lastSkillIndex[0] = Convert.ToInt32(primarySkillSetting.Value); lastSkillIndex[1] = Convert.ToInt32(secondarySkillSetting.Value); lastSkillIndex[2] = Convert.ToInt32(utilitySkillSetting.Value); lastSkillIndex[3] = Convert.ToInt32(specialSkillSetting.Value); }); PlaceTurret.OnEnter += new hook_OnEnter(HookPlaceTurret); FireMines.OnEnter += new Manipulator(HookMinePosition); EntityState.FixedUpdate += new hook_FixedUpdate(AutoFireEngiMissile); PlaceTurret.GetPlacementInfo += new Manipulator(DiyPlacementInfo); Paint.OnEnter += (hook_OnEnter)delegate(orig_OnEnter orig, Paint self) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //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_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_00c2: 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_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_00e6: 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_0117: 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) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_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_01de: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)self).isAuthority) { if (!((EntityState)self).characterBody.isPlayerControlled) { orig.Invoke(self); } self.targetsList = new List<HurtBox>(); self.targetIndicators = new Dictionary<HurtBox, IndicatorInfo>(); self.stickyTargetIndicator = new Indicator(((EntityState)self).gameObject, Paint.stickyTargetIndicatorPrefab); self.search = new BullseyeSearch(); int stock = ((BaseSkillState)self).activatorSkillSlot.stock; ((BaseSkillState)self).activatorSkillSlot.DeductStock(stock); HurtBox val2 = null; if (fireOnMasterConfig.Value) { Ray aimRay = ((BaseState)self).GetAimRay(); self.search.teamMaskFilter = TeamMask.GetUnprotectedTeams(((EntityState)self).teamComponent.teamIndex); self.search.filterByLoS = false; self.search.viewer = null; self.search.searchOrigin = ((Ray)(ref aimRay)).origin; self.search.searchDirection = ((Ray)(ref aimRay)).direction; self.search.searchDirection = ((Ray)(ref aimRay)).direction; self.search.minDistanceFilter = 0f; self.search.maxDistanceFilter = 2000f; self.search.sortMode = (SortMode)1; self.search.minAngleFilter = 0f; self.search.maxAngleFilter = 180f; self.search.RefreshCandidates(); self.search.FilterOutGameObject(((EntityState)self).gameObject); val2 = self.search.GetResults().FirstOrDefault(); } while (stock-- > 0) { Vector3 aimOrigin = ((EntityState)self).inputBank.aimOrigin; if ((Object)(object)val2 != (Object)null) { aimOrigin = val2.healthComponent.body.inputBank.aimOrigin; } MissileUtils.FireMissile(aimOrigin, ((EntityState)self).characterBody, default(ProcChainMask), ((Object)(object)val2 != (Object)null) ? ((Component)val2).gameObject : null, ((EntityState)self).characterBody.damage * Fire.damageCoefficient, ((EntityState)self).characterBody.RollCrit(), Fire.projectilePrefab, (DamageColorIndex)0, Vector3.up, 0f, false); } ((EntityState)self).outer.SetNextStateToMain(); } else { orig.Invoke(self); } }; } private void AutoFireEngiMissile(orig_FixedUpdate orig, EntityState self) { //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) //IL_01a3: 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_0214: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); SkillLocator skillLocator = self.skillLocator; if ((Object)(object)skillLocator == (Object)null) { return; } GenericSkill skill = skillLocator.GetSkill((SkillSlot)0); GenericSkill skill2 = skillLocator.GetSkill((SkillSlot)1); GenericSkill skill3 = skillLocator.GetSkill((SkillSlot)2); GenericSkill skill4 = skillLocator.GetSkill((SkillSlot)3); if ((Object)(object)skill3 == (Object)null || (Object)(object)skill2 == (Object)null) { return; } SkillDef skillDef = skill3.skillDef; SkillDef skillDef2 = skill2.skillDef; if ((Object)(object)skillDef == (Object)null || (Object)(object)skillDef2 == (Object)null || (Object)(object)self.characterBody == (Object)null || !self.characterBody.isPlayerControlled || !self.isAuthority) { return; } long elapsedMilliseconds = stopwatch.ElapsedMilliseconds; if (time + 100 > elapsedMilliseconds) { return; } time = elapsedMilliseconds; if (Convert.ToInt32(primarySkillSetting.Value) == -1 && lastSkillIndex[0] != -1) { ArrayUtils.ArrayRemoveAtAndResize<SkillOverride>(ref self.skillLocator.primary.skillOverrides, 0, self.skillLocator.primary.skillOverrides.Length); self.skillLocator.primary.PickCurrentOverride(); } else if ((skillOverridePrioritySetting.Value != skillOverridePriority || skill.skillDef.skillIndex != Convert.ToInt32(primarySkillSetting.Value)) && Convert.ToInt32(primarySkillSetting.Value) > -1) { ArrayUtils.ArrayRemoveAtAndResize<SkillOverride>(ref self.skillLocator.primary.skillOverrides, 0, self.skillLocator.primary.skillOverrides.Length); self.skillLocator.primary.SetSkillOverride((object)self, SkillCatalog.GetSkillDef(Convert.ToInt32(primarySkillSetting.Value)), skillOverridePrioritySetting.Value); } if (Convert.ToInt32(secondarySkillSetting.Value) == -1 && lastSkillIndex[1] != -1) { ArrayUtils.ArrayRemoveAtAndResize<SkillOverride>(ref self.skillLocator.secondary.skillOverrides, 0, self.skillLocator.secondary.skillOverrides.Length); self.skillLocator.secondary.PickCurrentOverride(); } else if ((skillOverridePrioritySetting.Value != skillOverridePriority || skill2.skillDef.skillIndex != Convert.ToInt32(secondarySkillSetting.Value)) && Convert.ToInt32(secondarySkillSetting.Value) > -1) { ArrayUtils.ArrayRemoveAtAndResize<SkillOverride>(ref self.skillLocator.secondary.skillOverrides, 0, self.skillLocator.secondary.skillOverrides.Length); self.skillLocator.secondary.SetSkillOverride((object)self, SkillCatalog.GetSkillDef(Convert.ToInt32(secondarySkillSetting.Value)), skillOverridePrioritySetting.Value); } if (Convert.ToInt32(utilitySkillSetting.Value) == -1 && lastSkillIndex[2] != -1) { ArrayUtils.ArrayRemoveAtAndResize<SkillOverride>(ref self.skillLocator.utility.skillOverrides, 0, self.skillLocator.utility.skillOverrides.Length); self.skillLocator.utility.PickCurrentOverride(); } else if ((skillOverridePrioritySetting.Value != skillOverridePriority || skill3.skillDef.skillIndex != Convert.ToInt32(utilitySkillSetting.Value)) && Convert.ToInt32(utilitySkillSetting.Value) > -1) { ArrayUtils.ArrayRemoveAtAndResize<SkillOverride>(ref self.skillLocator.utility.skillOverrides, 0, self.skillLocator.utility.skillOverrides.Length); self.skillLocator.utility.SetSkillOverride((object)self, SkillCatalog.GetSkillDef(Convert.ToInt32(utilitySkillSetting.Value)), skillOverridePrioritySetting.Value); } if (Convert.ToInt32(specialSkillSetting.Value) == -1 && lastSkillIndex[3] != -1) { ArrayUtils.ArrayRemoveAtAndResize<SkillOverride>(ref self.skillLocator.special.skillOverrides, 0, self.skillLocator.special.skillOverrides.Length); self.skillLocator.special.PickCurrentOverride(); } else if ((skillOverridePrioritySetting.Value != skillOverridePriority || skill4.skillDef.skillIndex != Convert.ToInt32(specialSkillSetting.Value)) && Convert.ToInt32(specialSkillSetting.Value) > -1) { ArrayUtils.ArrayRemoveAtAndResize<SkillOverride>(ref self.skillLocator.special.skillOverrides, 0, self.skillLocator.special.skillOverrides.Length); self.skillLocator.special.SetSkillOverride((object)self, SkillCatalog.GetSkillDef(Convert.ToInt32(specialSkillSetting.Value)), skillOverridePrioritySetting.Value); } lastSkillIndex[0] = Convert.ToInt32(primarySkillSetting.Value); lastSkillIndex[1] = Convert.ToInt32(secondarySkillSetting.Value); lastSkillIndex[2] = Convert.ToInt32(utilitySkillSetting.Value); lastSkillIndex[3] = Convert.ToInt32(specialSkillSetting.Value); skillOverridePriority = skillOverridePrioritySetting.Value; HurtBox val = null; if ((Object)(object)skillDef != (Object)null && "EngiHarpoons".Equals(skillDef.skillName)) { try { if (self.isAuthority) { if (fireOnMasterConfig.Value) { BullseyeSearch val2 = new BullseyeSearch { teamMaskFilter = TeamMask.allButNeutral }; ((TeamMask)(ref val2.teamMaskFilter)).RemoveTeam((TeamIndex)1); val2.filterByLoS = false; val2.viewer = null; val2.searchOrigin = self.inputBank.aimOrigin; val2.searchDirection = self.inputBank.aimDirection; val2.minDistanceFilter = 0f; val2.maxDistanceFilter = 2000f; val2.sortMode = (SortMode)1; val2.minAngleFilter = 0f; val2.maxAngleFilter = 180f; val2.RefreshCandidates(); val2.FilterOutGameObject(self.gameObject); val = val2.GetResults().FirstOrDefault(); if ((Object)(object)val == (Object)null) { return; } } if (autoFireEngiMissileConfig.Value && (!fireOnMasterConfig.Value || ((Object)(object)val != (Object)null && val.healthComponent.alive))) { switch (autoFirEngiMissileTypeConfig.Value) { case AutoFirEngiMissileTypeEnum.single_单发: if (skill3.stock >= 0) { skill3.skillDef.cancelSprintingOnActivation = false; skill3.ExecuteIfReady(); } break; case AutoFirEngiMissileTypeEnum.all_并发: if (skill3.stock >= skill3.maxStock) { skill3.skillDef.cancelSprintingOnActivation = false; skill3.ExecuteIfReady(); } break; } } } } catch (Exception ex) { Debug.LogError((object)ex); throw; } } if (!((Object)(object)skillDef2 != (Object)null) || (!"PlaceSpiderMine".Equals(skillDef2.skillName) && !"PlaceMine".Equals(skillDef2.skillName)) || !self.isAuthority || !autoFireEngiMinesConfig.Value || (fireOnMasterConfig.Value && !((Object)(object)val != (Object)null))) { return; } try { if (skill2.stock >= skill2.maxStock) { skill2.skillDef.cancelSprintingOnActivation = false; skill2.ExecuteIfReady(); } } catch (Exception value) { Console.WriteLine(value); throw; } } private void HookMinePosition(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0038: 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_0050: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction c) => ILPatternMatchingExt.MatchCall<Ray>(c, "get_origin") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_0); val.EmitDelegate<Func<FireMines, Ray, Vector3>>((Func<FireMines, Ray, Vector3>)delegate(FireMines mines, Ray aimRay) { //IL_000f: 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_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) //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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_0166: 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_008c: 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_00a3: 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_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) //IL_00be: 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) //IL_00cb: 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_00e1: 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_00f3: 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_0104: 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_0051: 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_0062: 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_0194: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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) if (!((EntityState)mines).characterBody.isPlayerControlled) { return ((Ray)(ref aimRay)).origin; } if (mines is FireBubbleShield) { RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(new Ray(((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 2f, ((Ray)(ref aimRay)).direction), ref val2)) { return ((RaycastHit)(ref val2)).point - ((Ray)(ref aimRay)).direction * 2f; } return ((Ray)(ref aimRay)).origin; } if (fireOnMasterConfig.Value) { HurtBox val3 = null; BullseyeSearch val4 = new BullseyeSearch { teamMaskFilter = TeamMask.allButNeutral }; ((TeamMask)(ref val4.teamMaskFilter)).RemoveTeam((TeamIndex)1); val4.filterByLoS = false; val4.viewer = null; val4.searchOrigin = ((Ray)(ref aimRay)).origin; val4.searchDirection = ((Ray)(ref aimRay)).direction; val4.minDistanceFilter = 0f; val4.maxDistanceFilter = 2000f; val4.sortMode = (SortMode)1; val4.minAngleFilter = 0f; val4.maxAngleFilter = 180f; val4.RefreshCandidates(); val4.FilterOutGameObject(((EntityState)mines).gameObject); val3 = val4.GetResults().FirstOrDefault(); if ((Object)(object)val3 != (Object)null) { return val3.healthComponent.body.inputBank.aimOrigin; } return ((Ray)(ref aimRay)).origin; } RaycastHit val5 = default(RaycastHit); return Physics.Raycast(new Ray(((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 5f, ((Ray)(ref aimRay)).direction), ref val5) ? (((RaycastHit)(ref val5)).point - ((Ray)(ref aimRay)).direction * 2f) : ((Ray)(ref aimRay)).origin; }); } private void DiyPlacementInfo(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_010d: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.Match(x, OpCodes.Ldloca_S), (Instruction x) => ILPatternMatchingExt.Match<float>(x, OpCodes.Ldc_R4, 0f), (Instruction x) => ILPatternMatchingExt.MatchStfld<Vector3>(x, "y") }); val.RemoveRange(3); val.GotoNext((MoveType)0, new Func<Instruction, bool>[3] { (Instruction c) => ILPatternMatchingExt.Match(c, OpCodes.Ldloca_S), (Instruction c) => ILPatternMatchingExt.Match(c, OpCodes.Ldc_I4_0), (Instruction c) => ILPatternMatchingExt.MatchStfld<PlacementInfo>(c, "ok") }); val.Index += 1; val.Remove(); val.Emit(OpCodes.Ldc_I4_1); val.GotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction c) => ILPatternMatchingExt.MatchStfld<PlacementInfo>(c, "position") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldloc_0); val.EmitDelegate<Func<Ray, Vector3>>((Func<Ray, Vector3>)delegate(Ray aimRay) { //IL_0002: 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_0013: 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) //IL_0024: 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_003a: 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_0050: Unknown result type (might be due to invalid IL or missing references) RaycastHit val2 = default(RaycastHit); Physics.Raycast(new Ray(((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 5f, ((Ray)(ref aimRay)).direction), ref val2); return ((RaycastHit)(ref val2)).point + ((Ray)(ref aimRay)).direction * (float)turretPositionFix.Value; }); val.GotoNext(new Func<Instruction, bool>[3] { (Instruction c) => ILPatternMatchingExt.MatchLdloc(c, 2), (Instruction c) => ILPatternMatchingExt.MatchLdfld<PlacementInfo>(c, "ok"), (Instruction c) => ILPatternMatchingExt.Match(c, OpCodes.Brfalse_S) }); val.Index += 2; val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4_0); } private void HookPlaceTurret(orig_OnEnter orig, PlaceTurret self) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 try { string[] array = turretConfig.Value.ToString().Split('_'); _ = array[0]; string text = array[1]; currentTurret = MasterCatalog.FindMasterPrefab(text); if ((int)((EntityState)self).characterBody.teamComponent._teamIndex == 1) { if (((EntityState)self).characterBody.isPlayerControlled) { self.turretMasterPrefab = currentTurret; } else { string[] array2 = engiTurretConfig.Value.ToString().Split('_'); _ = array2[0]; text = array2[1]; if (!text.Equals("EngiMonsterMaster")) { currentTurret = MasterCatalog.FindMasterPrefab(text); self.turretMasterPrefab = currentTurret; } } } orig.Invoke(self); } catch (Exception value) { Console.WriteLine(value); } } } }