using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; 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.Captain.Weapon; using EntityStates.CaptainSupplyDrop; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using EntityStates.Croco; using EntityStates.Drone; using EntityStates.Engi.EngiBubbleShield; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Engi.EngiWeapon; using EntityStates.GlobalSkills.LunarNeedle; using EntityStates.GolemMonster; using EntityStates.Headstompers; using EntityStates.Huntress; using EntityStates.Huntress.HuntressWeapon; using EntityStates.LaserTurbine; using EntityStates.Loader; using EntityStates.Mage.Weapon; using EntityStates.Merc; using EntityStates.SiphonItem; using EntityStates.Toolbot; using EntityStates.Treebot; using EntityStates.Treebot.Weapon; using EntityStates.VoidSurvivor.Vent; using EntityStates.VoidSurvivor.Weapon; using HG; using IL.EntityStates.Drone; using IL.RoR2; using KinematicCharacterController; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates; using On.EntityStates.Bandit2; using On.EntityStates.Captain.Weapon; using On.EntityStates.Commando; using On.EntityStates.Croco; using On.EntityStates.Drone; using On.EntityStates.Engi.EngiBubbleShield; using On.EntityStates.Engi.EngiMissilePainter; using On.EntityStates.Engi.EngiWeapon; using On.EntityStates.Headstompers; using On.EntityStates.Huntress; using On.EntityStates.Huntress.HuntressWeapon; using On.EntityStates.LaserTurbine; using On.EntityStates.Loader; using On.EntityStates.Mage.Weapon; using On.EntityStates.Merc; using On.EntityStates.SiphonItem; using On.EntityStates.Toolbot; using On.EntityStates.Treebot; using On.EntityStates.Treebot.Weapon; using On.EntityStates.VoidSurvivor.Vent; using On.EntityStates.VoidSurvivor.Weapon; using On.RoR2; using On.RoR2.CharacterAI; using On.RoR2.Networking; using On.RoR2.Orbs; using On.RoR2.Projectile; using On.RoR2.UI; using On.RoR2.UI.LogBook; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.Artifacts; using RoR2.CharacterAI; using RoR2.EntitlementManagement; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Networking; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.Stats; using RoR2.UI; using RoR2.UI.LogBook; using ThinkInvisible.Dronemeld; using ThinkInvisible.NavYoink; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [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("TinkersSatchel")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f53f09264f0e5b1860730f4727e227160c7ac889")] [assembly: AssemblyProduct("TinkersSatchel")] [assembly: AssemblyTitle("TinkersSatchel")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ThinkInvisible.TinkersSatchel { public class AntiAir : Artifact { [AutoConfig("Incoming damage multiplier applied to airborne characters while Artifact of Suppression is active.", AutoConfigFlags.None, new object[] { 1f, float.MaxValue })] public float hurtMod { get; private set; } = 5f; public AntiAir() { base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/antiair_on.png"); base.iconResourceDisabled = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/antiair_off.png"); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); HealthComponent.TakeDamage += new hook_TakeDamage(On_HCTakeDamage); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); HealthComponent.TakeDamage -= new hook_TakeDamage(On_HCTakeDamage); } private void On_HCTakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Invalid comparison between Unknown and I4 if (IsActiveAndEnabled() && (Object)(object)self.body != (Object)null && (Object)(object)self.body.teamComponent != (Object)null && (int)self.body.teamComponent.teamIndex == 1 && (Object)(object)self.body.characterMotor != (Object)null && !self.body.characterMotor.isGrounded) { damageInfo.damage *= hurtMod; } orig.Invoke(self, damageInfo); } } public class Butterknife : Artifact { private readonly MethodInfo cbDamageSetter; private readonly MethodInfo cbAttackSetter; public Butterknife() { base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/butterknife_on.png"); base.iconResourceDisabled = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/butterknife_off.png"); cbDamageSetter = Reflection.GetPropertyCached(typeof(CharacterBody), "damage").GetSetMethod(nonPublic: true); cbAttackSetter = Reflection.GetPropertyCached(typeof(CharacterBody), "attackSpeed").GetSetMethod(nonPublic: true); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); CharacterBody.RecalculateStats += new hook_RecalculateStats(On_CBRecalcStats); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); CharacterBody.RecalculateStats -= new hook_RecalculateStats(On_CBRecalcStats); } private void On_CBRecalcStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (IsActiveAndEnabled()) { cbDamageSetter.Invoke(self, new object[1] { self.damage / 20f }); cbAttackSetter.Invoke(self, new object[1] { self.attackSpeed * 10f }); } } } public class Danger : Artifact { public Danger() { base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/danger_on.png"); base.iconResourceDisabled = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/danger_off.png"); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); CharacterBody.RecalculateStats += new Manipulator(IL_CBRecalcStats); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); CharacterBody.RecalculateStats -= new Manipulator(IL_CBRecalcStats); } private void IL_CBRecalcStats(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) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "set_hasOneShotProtection") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool origSet, CharacterBody body) => body.isPlayerControlled && !IsActiveAndEnabled())); } else { TinkersSatchelPlugin._logger.LogError((object)"failed to apply IL patch (Artifact of Danger, set OHP flag)! Artifact will not prevent OHP while enabled."); } } } public class DelayLoot : Artifact { public enum AnnounceItemsMode { Nothing, Vague, ItemTier, ItemName } public enum AnnounceDropMode { Nothing, TotalItemCount } private bool shouldDeferDrops = true; private Vector3 lootShowerLoc = Vector3.zero; private float lootShowerTimer; private readonly List deferredDrops = new List(); private List launchVelocities = new List(); [AutoConfig("What to display in chat when an item is taken for safekeeping.", AutoConfigFlags.None, new object[] { })] public AnnounceItemsMode announceItems { get; private set; } = AnnounceItemsMode.ItemName; [AutoConfig("What to display in chat when the teleporter boss is killed.", AutoConfigFlags.None, new object[] { })] public AnnounceDropMode announceDrop { get; private set; } = AnnounceDropMode.TotalItemCount; public DelayLoot() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/delayitems_on.png"); base.iconResourceDisabled = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/delayitems_off.png"); } public override void Install() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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 base.Install(); Stage.onServerStageBegin += Stage_onServerStageBegin; PickupDropletController.CreatePickupDroplet_CreatePickupInfo_Vector3_Vector3 += new Manipulator(PickupDropletController_CreatePickupDroplet_CreatePickupInfo_Vector3_Vector3); GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; Run.FixedUpdate += new hook_FixedUpdate(Run_FixedUpdate); } public override void Uninstall() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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 base.Uninstall(); Stage.onServerStageBegin -= Stage_onServerStageBegin; PickupDropletController.CreatePickupDroplet_CreatePickupInfo_Vector3_Vector3 -= new Manipulator(PickupDropletController_CreatePickupDroplet_CreatePickupInfo_Vector3_Vector3); GlobalEventManager.onCharacterDeathGlobal -= GlobalEventManager_onCharacterDeathGlobal; Run.FixedUpdate -= new hook_FixedUpdate(Run_FixedUpdate); } private void Run_FixedUpdate(orig_FixedUpdate orig, Run self) { //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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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) orig.Invoke(self); if (!NetworkServer.active || !IsActiveAndEnabled() || shouldDeferDrops || deferredDrops.Count <= 0) { return; } lootShowerTimer -= Time.fixedDeltaTime; if (!(lootShowerTimer <= 0f)) { return; } if (!Object.op_Implicit((Object)(object)deferredDrops[0])) { deferredDrops.RemoveAt(0); return; } Vector3 val = launchVelocities[0]; launchVelocities.RemoveAt(0); launchVelocities.Add(val); Rigidbody component = deferredDrops[0].GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.velocity = val; component.drag = 0f; } ((Behaviour)deferredDrops[0].GetComponent()).enabled = false; deferredDrops[0].transform.position = lootShowerLoc; deferredDrops[0].SetActive(true); deferredDrops.RemoveAt(0); lootShowerTimer = 0.125f; } private void Stage_onServerStageBegin(Stage obj) { shouldDeferDrops = true; } private void GlobalEventManager_onCharacterDeathGlobal(DamageReport report) { //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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0094: 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_00be: 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_00ff: 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_010e: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Expected O, but got Unknown //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0220: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) if (!IsActiveAndEnabled() || !report.victimIsBoss || !Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || TeleporterInteraction.instance.bossGroup.combatSquad.memberCount > 1) { return; } shouldDeferDrops = false; lootShowerLoc = ((Component)report.victim).transform.position + Vector3.up * 3f; NodeGraph nodeGraph = SceneInfo.instance.GetNodeGraph((GraphType)0); launchVelocities = MathUtil.CollectNearestNodeLaunchVelocities(nodeGraph, deferredDrops.Count, 10f, 1000f, lootShowerLoc, 5f, 0.625f, 3f, 10, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1, (HullMask)1); if (launchVelocities.Count < deferredDrops.Count) { Vector3 source = ((Component)TeleporterInteraction.instance).transform.position + Vector3.up * 3f; List list = MathUtil.CollectNearestNodeLaunchVelocities(nodeGraph, deferredDrops.Count, 10f, 1000f, source, 5f, 0.625f, 3f, 10, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1, (HullMask)1); if (launchVelocities.Count == 0 && list.Count == 0) { TinkersSatchelPlugin._logger.LogWarning((object)"DelayLoot: found no free navnodes to drop items at, using fallback circle"); lootShowerLoc = source; for (int i = 0; i < deferredDrops.Count; i++) { float num = (float)i / (float)deferredDrops.Count * MathF.PI * 2f; launchVelocities.Add(new Vector3(Mathf.Cos(num) * 10f, 20f, Mathf.Sin(num) * 10f)); } } else if (list.Count > launchVelocities.Count) { TinkersSatchelPlugin._logger.LogWarning((object)"DelayLoot: couldn't find enough free navnodes to drop items at from boss, falling back to TP"); launchVelocities = list; lootShowerLoc = source; } if (launchVelocities.Count < deferredDrops.Count) { TinkersSatchelPlugin._logger.LogWarning((object)"DelayLoot: couldn't find enough free navnodes to drop items at from any source, some items will stack"); } } if (announceDrop == AnnounceDropMode.TotalItemCount && deferredDrops.Count > 0) { SimpleChatMessage val = new SimpleChatMessage(); val.paramTokens = new string[1] { deferredDrops.Count.ToString() }; val.baseToken = "TKSAT_DELAYLOOT_MSG_KILL"; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } } private void PickupDropletController_CreatePickupDroplet_CreatePickupInfo_Vector3_Vector3(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0039: 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.MatchCallOrCallvirt(x, "Spawn") })) { val.Emit(OpCodes.Dup); val.EmitDelegate>((Action)delegate(GameObject obj) { if (IsActiveAndEnabled() && shouldDeferDrops && Object.op_Implicit((Object)(object)TeleporterInteraction.instance)) { DeferDroplet(obj); } }); } else { TinkersSatchelPlugin._logger.LogError((object)"DelayLoot failed to apply IL hook (PickupDropletController_CreatePickupDroplet): couldn't find target instructions"); } } private void DeferDroplet(GameObject droplet) { //IL_0032: 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_00b4: Expected O, but got Unknown //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) if (!Object.op_Implicit((Object)(object)droplet)) { return; } deferredDrops.Add(droplet); droplet.SetActive(false); PickupDropletController component = droplet.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } PickupDef val = PickupCatalog.GetPickupDef(component.pickupState.pickupIndex); if (val != null && announceItems != 0) { string text = Language.GetString((announceItems == AnnounceItemsMode.ItemName) ? val.nameToken : "TKSAT_DELAYLOOT_MSG_DELAY_VAGUE"); if (announceItems != AnnounceItemsMode.Vague) { text = "" + text + ""; } SimpleChatMessage val2 = new SimpleChatMessage(); val2.paramTokens = new string[1] { text }; val2.baseToken = "TKSAT_DELAYLOOT_MSG_DELAY"; Chat.SendBroadcastChat((ChatMessageBase)(object)val2); } } } public class PackTactics : Artifact { [AutoConfig("Combatants within this distance (in meters) of teammates will buff them if Artifact of Tactics is enabled.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float baseRadius { get; private set; } = 25f; [AutoConfig("Extra move speed multiplier added per stack of the Tactics buff.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float speedMod { get; private set; } = 0.05f; [AutoConfig("Extra damage multiplier added per stack of the Tactics buff.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageMod { get; private set; } = 0.1f; [AutoConfig("Extra armor added per stack of the Tactics buff.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float armorMod { get; private set; } = 15f; public BuffDef tacticsBuff { get; private set; } public GameObject tacticsWardPrefab { get; private set; } public PackTactics() { base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/tactics_on.png"); base.iconResourceDisabled = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ArtifactIcons/tactics_off.png"); } public override void SetupConfig() { base.SetupConfig(); base.ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "baseRadius" && NetworkServer.active) { foreach (TacticsWard instance in TacticsWard.instances) { ((Component)instance).GetComponent().Networkradius = (float)args.newValue; } } }; } public override void SetupAttributes() { //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) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown base.SetupAttributes(); tacticsBuff = ScriptableObject.CreateInstance(); tacticsBuff.buffColor = Color.white; tacticsBuff.canStack = true; tacticsBuff.isDebuff = false; ((Object)tacticsBuff).name = base.modInfo.shortIdentifier + "TacticsBuff"; tacticsBuff.iconSprite = base.iconResource; ContentAddition.AddBuffDef(tacticsBuff); GameObject val = new GameObject("TacticsAuraPrefabPrefab"); val.AddComponent(); val.AddComponent(); val.AddComponent().forceHostAuthority = true; val.AddComponent(); BuffWard obj = val.AddComponent(); obj.invertTeamFilter = false; obj.expires = false; obj.animateRadius = false; obj.radius = baseRadius; obj.rangeIndicator = null; obj.Networkradius = baseRadius; obj.buffDuration = 1f; obj.interval = 1f; obj.buffDef = tacticsBuff; tacticsWardPrefab = PrefabAPI.InstantiateClone(val, "TacticsAuraPrefab", true); Object.Destroy((Object)(object)val); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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 base.Install(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(Evt_GetStatCoefficients); if (IsActiveAndEnabled()) { foreach (CharacterMaster item in CharacterMaster.readOnlyInstancesList.Where((CharacterMaster x) => x.hasBody && x.GetBody().healthComponent.alive).ToList()) { if (item.hasBody) { AddWard(item.GetBody()); } } } CharacterMaster.OnBodyStart += new hook_OnBodyStart(On_CMOnBodyStart); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown base.Uninstall(); CharacterMaster.OnBodyStart -= new hook_OnBodyStart(On_CMOnBodyStart); foreach (TacticsWard instance in TacticsWard.instances) { Object.Destroy((Object)(object)((Component)instance).gameObject); } RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(Evt_GetStatCoefficients); } private void Evt_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { int num = Mathf.Max(sender.GetBuffCount(tacticsBuff) - 1, 0); args.moveSpeedMultAdd += (float)num * speedMod; args.baseDamageAdd += (float)num * damageMod; args.armorAdd += (float)num * armorMod; } } private void On_CMOnBodyStart(orig_OnBodyStart orig, CharacterMaster self, CharacterBody body) { orig.Invoke(self, body); if (NetworkServer.active && IsActiveAndEnabled()) { AddWard(body); } } private void AddWard(CharacterBody body) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { TacticsWard componentInChildren = ((Component)body).GetComponentInChildren(); if (!Object.op_Implicit((Object)(object)componentInChildren) || !Object.op_Implicit((Object)(object)((Component)componentInChildren).gameObject)) { GameObject obj = Object.Instantiate(tacticsWardPrefab); obj.GetComponent().teamIndex = body.teamComponent.teamIndex; obj.GetComponent().AttachToGameObjectAndSpawn(((Component)body).gameObject, (string)null); } } } } internal class TacticsWard : MonoBehaviour { internal static List instances = new List(); private void Awake() { instances.Add(this); } private void OnDestroy() { instances.Remove(this); } } public class BulwarkDrone : Module { public GameObject bulwarkDroneInteractablePrefab { get; private set; } public GameObject bulwarkDroneBodyPrefab { get; private set; } public GameObject bulwarkDroneMasterPrefab { get; private set; } public InteractableSpawnCard bulwarkDroneSpawnCard { get; private set; } public DirectorCard bulwarkDroneDirectorCard { get; private set; } public DirectorCardHolder bulwarkDroneDCH { get; private set; } internal CommonCode.ConditionalDirectorCardHolder bulwarkDroneCDCH { get; private set; } public override void SetupAttributes() { base.SetupAttributes(); bulwarkDroneBodyPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Characters/BulwarkDrone/BulwarkDroneBody.prefab"); ModifyBodyPrefabWithVanillaAssets(); bulwarkDroneMasterPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Characters/BulwarkDrone/BulwarkDroneMaster.prefab"); bulwarkDroneInteractablePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Characters/BulwarkDrone/BulwarkDroneBroken.prefab"); ModifyInteractablePrefabWithVanillaAssets(); SetupSpawnCard(); ContentAddition.AddBody(bulwarkDroneBodyPrefab); ContentAddition.AddMaster(bulwarkDroneMasterPrefab); ContentAddition.AddNetworkedObject(bulwarkDroneInteractablePrefab); } public override void SetupBehavior() { base.SetupBehavior(); } public override void SetupConfig() { base.SetupConfig(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); DeathState.OnImpactServer += new hook_OnImpactServer(DeathState_OnImpactServer); CommonCode.dchList.Add(bulwarkDroneCDCH); if (Object.op_Implicit((Object)(object)ClassicStageInfo.instance)) { Helpers.TryApplyChangesNow(); } } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); DeathState.OnImpactServer -= new hook_OnImpactServer(DeathState_OnImpactServer); CommonCode.dchList.Remove(bulwarkDroneCDCH); if (Object.op_Implicit((Object)(object)ClassicStageInfo.instance)) { Helpers.TryApplyChangesNow(); } } private void ModifyBodyPrefabWithVanillaAssets() { //IL_0026: 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_0049: 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_00a5: 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_00b2: 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) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_017a: 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_0195: 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_01ab: Expected O, but got Unknown //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: 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) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Expected O, but got Unknown //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Expected O, but got Unknown //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterBodies/EquipmentDroneBody"), "TkSatTempSetupPrefab2", false); bulwarkDroneBodyPrefab.GetComponent().cameraParams = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/ccpStandard.asset").WaitForCompletion(); ((Collider)bulwarkDroneBodyPrefab.GetComponent()).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/physmatItems.physicMaterial").WaitForCompletion(); AkEvent[] components = val.GetComponents(); foreach (AkEvent val2 in components) { AkEvent obj = bulwarkDroneBodyPrefab.AddComponent(); ((AkTriggerHandler)obj).triggerList = ((AkTriggerHandler)val2).triggerList.ToArray().ToList(); ((AkTriggerHandler)obj).useOtherObject = ((AkTriggerHandler)val2).useOtherObject; obj.actionOnEventType = val2.actionOnEventType; obj.curveInterpolation = val2.curveInterpolation; obj.enableActionOnEvent = val2.enableActionOnEvent; obj.data = val2.data; obj.useCallbacks = val2.useCallbacks; obj.Callbacks = val2.Callbacks.ToArray().ToList(); obj.playingId = val2.playingId; obj.soundEmitterObject = bulwarkDroneBodyPrefab; obj.transitionDuration = val2.transitionDuration; } Material val3 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/TrimSheets/matTrimSheetConstructionBlue.mat").WaitForCompletion(); CharacterModel component = ((Component)bulwarkDroneBodyPrefab.transform.Find("Model Base/BulwarkDrone")).GetComponent(); component.itemDisplayRuleSet.SetDisplayRuleGroup((Object)(object)Addressables.LoadAssetAsync((object)"RoR2/DLC1/DroneWeapons/DroneWeaponsDisplay1.asset").WaitForCompletion(), new DisplayRuleGroup { rules = (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/DroneWeapons/DisplayDroneWeaponLauncher.prefab").WaitForCompletion(), childName = "BulwarkDroneModel", localPos = new Vector3(0f, 0.78087f, 0.72665f), localAngles = new Vector3(356.5202f, 0f, 0f), localScale = new Vector3(1f, 1f, 1f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/DroneWeapons/DisplayDroneWeaponRobotArm.prefab").WaitForCompletion(), childName = "BulwarkDroneModel", localPos = new Vector3(0.48613f, 0f, 0.41692f), localAngles = new Vector3(82.44529f, 86.80688f, 0.00014f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } } }); component.itemDisplayRuleSet.SetDisplayRuleGroup((Object)(object)Addressables.LoadAssetAsync((object)"RoR2/DLC1/DroneWeapons/DroneWeaponsDisplay2.asset").WaitForCompletion(), new DisplayRuleGroup { rules = (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/DroneWeapons/DisplayDroneWeaponMinigun.prefab").WaitForCompletion(), childName = "BulwarkDroneModel", localPos = new Vector3(0f, 0.37601f, 0f), localAngles = new Vector3(-1E-05f, 180f, 180f), localScale = new Vector3(1f, 1f, 1f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/DroneWeapons/DisplayDroneWeaponLauncher.prefab").WaitForCompletion(), childName = "BulwarkDroneModel", localPos = new Vector3(0f, 0.78087f, 0.72665f), localAngles = new Vector3(356.5202f, 0f, 0f), localScale = new Vector3(1f, 1f, 1f) } } }); component.baseRendererInfos[0].defaultMaterial = val3; component.baseRendererInfos[0].renderer.material = val3; Material material = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/matOpaqueDustLargeDirectional.mat").WaitForCompletion(); ((Renderer)((Component)bulwarkDroneBodyPrefab.transform.Find("Model Base/BulwarkDrone/ThrusterExhaust")).GetComponent()).material = material; Object.Destroy((Object)(object)val); } private void ModifyInteractablePrefabWithVanillaAssets() { //IL_0005: 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_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) Material material = Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/matDroneBrokenGeneric.mat").WaitForCompletion(); ((Renderer)((Component)bulwarkDroneInteractablePrefab.transform.Find("Model Base/BulwarkDrone")).GetComponent()).material = material; Sprite visual = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/MiscIcons/texDroneIconOutlined.png").WaitForCompletion(); bulwarkDroneInteractablePrefab.GetComponent().InspectInfo.Info.Visual = visual; } private void SetupSpawnCard() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_002e: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0049: 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_005a: 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_0061: 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_006d: Expected O, but got Unknown bulwarkDroneSpawnCard = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Characters/BulwarkDrone/iscTkSatBulwarkDrone.asset"); bulwarkDroneDirectorCard = new DirectorCard { spawnCard = (SpawnCard)(object)bulwarkDroneSpawnCard, minimumStageCompletions = 0, preventOverhead = false, selectionWeight = 2, spawnDistance = (MonsterSpawnDistance)0 }; bulwarkDroneDCH = new DirectorCardHolder { Card = bulwarkDroneDirectorCard, InteractableCategory = (InteractableCategory)5, MonsterCategory = (MonsterCategory)0 }; bulwarkDroneCDCH = new CommonCode.ConditionalDirectorCardHolder(bulwarkDroneDCH, CommonCode.expansionDef); } private void DeathState_OnImpactServer(orig_OnImpactServer orig, DeathState self, Vector3 contactPoint) { //IL_0002: 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_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_004c: 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_005e: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Invalid comparison between Unknown and I4 orig.Invoke(self, contactPoint); if (!Object.op_Implicit((Object)(object)((EntityState)self).characterBody) || !((Object)(object)BodyCatalog.GetBodyPrefab(((EntityState)self).characterBody.bodyIndex) == (Object)(object)bulwarkDroneBodyPrefab)) { return; } GameObject val = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)bulwarkDroneSpawnCard, new DirectorPlacementRule { placementMode = (PlacementMode)0, position = contactPoint }, base.rng)); if (Object.op_Implicit((Object)(object)val)) { PurchaseInteraction component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1) { component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost); } } } } [RequireComponent(typeof(TeamComponent), typeof(CharacterBody))] public class TauntNearbyBehaviour : MonoBehaviour { public float range = 100f; public float tauntChancePerTargetPerInterval = 0.25f; public float scanInterval = 5f; public HurtBox hurtbox; private TeamComponent teamcpt; private CharacterBody body; private float stopwatch; private void Awake() { teamcpt = ((Component)this).GetComponent(); body = ((Component)this).GetComponent(); } private void FixedUpdate() { if (!NetworkServer.active) { return; } stopwatch -= Time.fixedDeltaTime; if (!(stopwatch <= 0f)) { return; } float rangeSq = range * range; stopwatch = scanInterval; IEnumerable source = from x in CharacterBody.readOnlyInstancesList.Where(delegate(CharacterBody x) { //IL_0006: 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_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_0043: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Invalid comparison between Unknown and I4 Vector3 val = x.transform.position - ((Component)this).transform.position; return ((Vector3)(ref val)).sqrMagnitude < rangeSq && Object.op_Implicit((Object)(object)x.master) && x.teamComponent.teamIndex != teamcpt.teamIndex && (int)x.teamComponent.teamIndex > 0; }) select ((Component)x.master).GetComponent() into x where Object.op_Implicit((Object)(object)x) select x; int num = (Object.op_Implicit((Object)(object)body.master) ? Compat_Dronemeld.SafeGetStackCount(body.master.inventory) : 0); float num2 = 1f - Mathf.Pow(1f - tauntChancePerTargetPerInterval, (float)(num + 1)); source = source.OrderBy((BaseAI t) => Module.instance.rng.nextNormalizedFloat).Take(Mathf.RoundToInt((float)source.Count() * num2)); foreach (BaseAI item in source) { TauntDebuffController.ApplyTaunt(item, body, scanInterval); } } } public static class CatalogUtil { public static bool TryGetItemDef(PickupIndex pickupIndex, out ItemDef itemDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_0029: Unknown result type (might be due to invalid IL or missing references) itemDef = null; if (pickupIndex == PickupIndex.none) { return false; } PickupDef pickupDef = PickupCatalog.GetPickupDef(pickupIndex); if (pickupDef == null || (int)pickupDef.itemIndex == -1) { return false; } itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); return (Object)(object)itemDef != (Object)null; } public static bool TryGetItemDef(PickupDef pickupDef, out ItemDef itemDef) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0013: Unknown result type (might be due to invalid IL or missing references) itemDef = null; if (pickupDef == null || (int)pickupDef.itemIndex == -1) { return false; } itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); return (Object)(object)itemDef != (Object)null; } public static bool TryGetItemDef(ItemIndex itemIndex, out ItemDef itemDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Invalid comparison between Unknown and I4 //IL_000a: Unknown result type (might be due to invalid IL or missing references) itemDef = null; if ((int)itemIndex == -1) { return false; } itemDef = ItemCatalog.GetItemDef(itemIndex); return (Object)(object)itemDef != (Object)null; } public static bool TryGetEquipmentDef(PickupIndex pickupIndex, out EquipmentDef equipmentDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_0029: Unknown result type (might be due to invalid IL or missing references) equipmentDef = null; if (pickupIndex == PickupIndex.none) { return false; } PickupDef pickupDef = PickupCatalog.GetPickupDef(pickupIndex); if (pickupDef == null || (int)pickupDef.equipmentIndex == -1) { return false; } equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex); return (Object)(object)equipmentDef != (Object)null; } public static bool TryGetEquipmentDef(PickupDef pickupDef, out EquipmentDef equipmentDef) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0013: Unknown result type (might be due to invalid IL or missing references) equipmentDef = null; if (pickupDef == null || (int)pickupDef.equipmentIndex == -1) { return false; } equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex); return (Object)(object)equipmentDef != (Object)null; } public static bool TryGetEquipmentDef(EquipmentIndex equipmentIndex, out EquipmentDef equipmentDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Invalid comparison between Unknown and I4 //IL_000a: Unknown result type (might be due to invalid IL or missing references) equipmentDef = null; if ((int)equipmentIndex == -1) { return false; } equipmentDef = EquipmentCatalog.GetEquipmentDef(equipmentIndex); return (Object)(object)equipmentDef != (Object)null; } } public class CommonCode : Module { internal class ConditionalDirectorCardHolder { public DirectorCardHolder directorCardHolder; public ExpansionDef[] requiredExpansions; public ConditionalDirectorCardHolder(DirectorCardHolder dch, params ExpansionDef[] exps) { directorCardHolder = dch; requiredExpansions = exps; } } public static ExpansionDef expansionDef; public static ExpansionDef voidExpansionDef; public static DirectorCardCategorySelection globalInteractablesDccs; private static GameObject _worldSpaceWeaponDummy = null; internal static HashSet dchList = new HashSet(); public override bool managedEnable => false; [Obsolete("Replaced by TimedSkillDisableModule.disabledSkillDef.")] public static SkillDef disabledSkillDef => TimedSkillDisableModule.disabledSkillDef; [Obsolete("Replaced by TauntDebuffModule.tauntDebuff.")] public static BuffDef tauntDebuff => TauntDebuffModule.tauntDebuff; public static GameObject worldSpaceWeaponDummy { get { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)_worldSpaceWeaponDummy)) { _worldSpaceWeaponDummy = new GameObject("Workaround for an Inconvenient Quirk of BulletAttack"); } return _worldSpaceWeaponDummy; } } private void _SetupExpansions() { //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_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) expansionDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/TinkersSatchelExpansion.asset"); voidExpansionDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/TinkersSatchelVoidExpansion.asset"); Sprite disabledIconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/MiscIcons/texUnlockIcon.png").WaitForCompletion(); expansionDef.disabledIconSprite = disabledIconSprite; voidExpansionDef.disabledIconSprite = disabledIconSprite; voidExpansionDef.requiredEntitlement = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Common/entitlementDLC1.asset").WaitForCompletion(); ContentAddition.AddExpansionDef(expansionDef); ContentAddition.AddExpansionDef(voidExpansionDef); } private void _SetupInteractablesCategory() { globalInteractablesDccs = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/dccsTkSatGlobalInteractables.asset"); DirectorAPI.InteractableActions += DirectorAPI_InteractableActions; } private void DirectorAPI_InteractableActions(DccsPool arg1, StageInfo arg2) { IEnumerable enumerable = dchList.Where((ConditionalDirectorCardHolder dch) => dch.requiredExpansions.All((ExpansionDef ed) => Run.instance.IsExpansionEnabled(ed))); Category[] poolCategories = arg1.poolCategories; foreach (Category val in poolCategories) { PoolEntry[] alwaysIncluded = val.alwaysIncluded; foreach (PoolEntry val2 in alwaysIncluded) { foreach (ConditionalDirectorCardHolder item in enumerable) { DirectorAPI.AddCard(val2.dccs, item.directorCardHolder); } } ConditionalPoolEntry[] includedIfConditionsMet = val.includedIfConditionsMet; foreach (ConditionalPoolEntry val3 in includedIfConditionsMet) { foreach (ConditionalDirectorCardHolder item2 in enumerable) { DirectorAPI.AddCard(((PoolEntry)val3).dccs, item2.directorCardHolder); } } alwaysIncluded = val.includedIfNoConditionsMet; foreach (PoolEntry val4 in alwaysIncluded) { foreach (ConditionalDirectorCardHolder item3 in enumerable) { DirectorAPI.AddCard(val4.dccs, item3.directorCardHolder); } } } } public override void SetupAttributes() { base.SetupAttributes(); _SetupExpansions(); _SetupInteractablesCategory(); } public override void SetupBehavior() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.SetupBehavior(); BulletAttack.FireSingle += new hook_FireSingle(BulletAttack_FireSingle); } private void BulletAttack_FireSingle(orig_FireSingle orig, BulletAttack self, FireSingleArgs args) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)self.weapon == (Object)(object)worldSpaceWeaponDummy) { self.weapon = null; } orig.Invoke(self, args); } internal static void RetrieveDefaultMaterials(ItemDisplay disp) { //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_0013: 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_002b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < disp.rendererInfos.Length; i++) { RendererInfo val = disp.rendererInfos[i]; val.defaultMaterial = val.renderer.material; disp.rendererInfos[i] = val; } } public static GameObject GetRootWithLocators(GameObject target, int maxSearch = 5) { if (!Object.op_Implicit((Object)(object)target)) { return null; } GameObject val = target; EntityLocator val2 = default(EntityLocator); for (int i = 0; i < maxSearch; i++) { if (val.TryGetComponent(ref val2) && Object.op_Implicit((Object)(object)val2.entity)) { val = val2.entity; continue; } Transform root = val.transform.root; if (Object.op_Implicit((Object)(object)root) && (Object)(object)((Component)root).gameObject != (Object)(object)val) { val = ((Component)root).gameObject; continue; } return val; } return val; } internal static GameObject FindNearestInteractable(GameObject senderObj, HashSet validObjectNames, Ray aim, float maxAngle, float maxDistance, bool requireLoS) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_000d: 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_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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_0116: 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_00f5: Unknown result type (might be due to invalid IL or missing references) float num = default(float); aim = CameraRigController.ModifyAimRayIfApplicable(aim, senderObj, ref num); Collider[] array = Physics.OverlapSphere(((Ray)(ref aim)).origin, maxDistance + num, -1, (QueryTriggerInteraction)2); float num2 = Mathf.Cos(Mathf.Clamp(maxAngle, 0f, 180f) * MathF.PI / 180f); GameObject result = null; float num3 = float.MaxValue; Collider[] array2 = array; foreach (Collider val in array2) { if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)((Component)val).gameObject)) { continue; } GameObject rootWithLocators = GetRootWithLocators(((Component)val).gameObject); if (!validObjectNames.Contains(((Object)rootWithLocators).name.Replace("(Clone)", ""))) { continue; } Vector3 direction = ((Ray)(ref aim)).direction; Vector3 val2 = rootWithLocators.transform.position - ((Ray)(ref aim)).origin; float num4 = Vector3.Dot(direction, ((Vector3)(ref val2)).normalized); if (!(num4 < num2) && (!requireLoS || Physics.Linecast(((Ray)(ref aim)).origin, rootWithLocators.transform.position, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))) { float num5 = num4 * Vector3.Distance(rootWithLocators.transform.position, ((Ray)(ref aim)).origin); if (num5 < num3) { num3 = num5; result = rootWithLocators; } } } return result; } public static bool PickupIndexIsAISafe(PickupIndex pind) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (CatalogUtil.TryGetItemDef(pind, out var itemDef)) { return !itemDef.ContainsTag((ItemTag)4); } return false; } public static PickupIndex GenerateAISafePickup(Xoroshiro128Plus rng, List selection) { //IL_004f: 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) IEnumerable source = selection.Where((PickupIndex pind) => PickupIndexIsAISafe(pind)); if (source.Count() == 0) { TinkersSatchelPlugin._logger.LogError((object)"GenerateAISafePickup (single uniform list): selection contained 0 valid items"); return PickupIndex.none; } return rng.NextElementUniform(source.ToArray()); } public static PickupIndex GenerateAISafePickup(Xoroshiro128Plus rng, WeightedSelection> selection) { //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_001a: 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_0084: 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_0032: 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_003e: Unknown result type (might be due to invalid IL or missing references) WeightedSelection val = new WeightedSelection(8); ChoiceInfo>[] choices = selection.choices; for (int i = 0; i < choices.Length; i++) { ChoiceInfo> val2 = choices[i]; foreach (PickupIndex item in val2.value) { if (PickupIndexIsAISafe(item)) { val.AddChoice(item, val2.weight); } } } if (val.choices.Length == 0) { TinkersSatchelPlugin._logger.LogError((object)"GenerateAISafePickup (single selection): selection contained 0 valid items"); return PickupIndex.none; } return val.Evaluate(rng.nextNormalizedFloat); } public static PickupIndex GenerateAISafePickup(Xoroshiro128Plus rng, PickupDropTable dropTable, WeightedSelection> fallback) { //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0049: 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_0050: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_0118: 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) WeightedSelection val = new WeightedSelection(8); BasicPickupDropTable val2 = (BasicPickupDropTable)(object)((dropTable is BasicPickupDropTable) ? dropTable : null); if (val2 != null) { foreach (ChoiceInfo item in val2.selector.choices.Where((ChoiceInfo c) => PickupIndexIsAISafe(c.value.pickupIndex))) { val.AddChoice(item); } } else { ExplicitPickupDropTable val3 = (ExplicitPickupDropTable)(object)((dropTable is ExplicitPickupDropTable) ? dropTable : null); if (val3 != null) { foreach (ChoiceInfo item2 in val3.weightedSelection.choices.Where((ChoiceInfo c) => PickupIndexIsAISafe(c.value.pickupIndex))) { val.AddChoice(item2); } } } if (val.choices.Length == 0) { ChoiceInfo>[] choices = fallback.choices; for (int i = 0; i < choices.Length; i++) { ChoiceInfo> val4 = choices[i]; foreach (PickupIndex item3 in val4.value) { if (PickupIndexIsAISafe(item3)) { val.AddChoice(new UniquePickup(item3), val4.weight); } } } } if (val.choices.Length == 0) { TinkersSatchelPlugin._logger.LogError((object)"GenerateAISafePickup (droptable and weighted fallback): both normal and fallback selections contained 0 valid items"); return PickupIndex.none; } return val.Evaluate(rng.nextNormalizedFloat).pickupIndex; } public static PickupIndex GenerateAISafePickup(Xoroshiro128Plus rng, PickupDropTable dropTable, List fallback) { //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_004e: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) WeightedSelection val = new WeightedSelection(8); BasicPickupDropTable val2 = (BasicPickupDropTable)(object)((dropTable is BasicPickupDropTable) ? dropTable : null); if (val2 != null) { foreach (ChoiceInfo item in val2.selector.choices.Where((ChoiceInfo c) => PickupIndexIsAISafe(c.value.pickupIndex))) { val.AddChoice(item); } } else { ExplicitPickupDropTable val3 = (ExplicitPickupDropTable)(object)((dropTable is ExplicitPickupDropTable) ? dropTable : null); if (val3 != null) { foreach (ChoiceInfo item2 in val3.weightedSelection.choices.Where((ChoiceInfo c) => PickupIndexIsAISafe(c.value.pickupIndex))) { val.AddChoice(item2); } } } if (val.choices.Length == 0) { foreach (PickupIndex item3 in fallback) { if (PickupIndexIsAISafe(item3)) { val.AddChoice(new UniquePickup(item3), 1f); } } } if (val.choices.Length == 0) { TinkersSatchelPlugin._logger.LogError((object)"GenerateAISafePickup (droptable and uniform fallback): both normal and fallback selections contained 0 valid items"); return PickupIndex.none; } return val.Evaluate(rng.nextNormalizedFloat).pickupIndex; } public static List GatherEnemies(TeamIndex allyIndex, params TeamIndex[] ignore) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //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_0040: 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_003c: Unknown result type (might be due to invalid IL or missing references) List list = new List(); bool flag = (int)FriendlyFireManager.friendlyFireMode > 0; foreach (TeamIndex item in ((TeamIndex[])Enum.GetValues(typeof(TeamIndex))).Except(ignore)) { if (flag || allyIndex != item) { list.AddRange(TeamComponent.GetTeamMembers(item)); } } return list; } public static Language GetBestLanguage(string langID) { return ((langID == null) ? null : Language.FindLanguageByName(langID)) ?? Language.currentLanguage ?? Language.english; } } public static class CommonCodeExtensions { internal static Quaternion ApplyRandomSpread(this Xoroshiro128Plus rng, Quaternion targetRotation, float coneHalfAngleDegr) { //IL_005d: 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_005f: 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) float num = rng.nextNormalizedFloat * MathF.PI * 2f; float num2 = Mathf.Lerp(Mathf.Cos(coneHalfAngleDegr * MathF.PI / 180f), 1f, rng.nextNormalizedFloat); float num3 = Mathf.Sqrt(1f - num2 * num2); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num3 * Mathf.Cos(num), num3 * Mathf.Sin(num), num2); return targetRotation * Quaternion.LookRotation(val); } public static void ReflAddEventHandler(this EventInfo evt, object o, Action lam) { ParameterExpression[] array = (from p in evt.EventHandlerType.GetMethod("Invoke").GetParameters() select Expression.Parameter(p.ParameterType)).ToArray(); Delegate handler = Expression.Lambda(evt.EventHandlerType, Expression.Call(Expression.Constant(lam), lam.GetType().GetMethod("Invoke"), array[0], array[1]), array).Compile(); evt.AddEventHandler(o, handler); } } public class FilingDictionary : IEnumerable, IEnumerable { private readonly Dictionary _dict = new Dictionary(); public int Count => _dict.Count; public void Add(T inst) { _dict.Add(inst.GetType(), inst); } public void Add(subT inst) where subT : T { _dict.Add(typeof(subT), (T)(object)inst); } public void Set(subT inst) where subT : T { _dict[typeof(subT)] = (T)(object)inst; } public subT Get() where subT : T { return (subT)(object)_dict[typeof(subT)]; } public void Remove(T inst) { _dict.Remove(inst.GetType()); } public void RemoveWhere(Func predicate) { foreach (T item in _dict.Values.Where(predicate).ToList()) { _dict.Remove(item.GetType()); } } public IEnumerator GetEnumerator() { return _dict.Values.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } public ReadOnlyFilingDictionary AsReadOnly() { return new ReadOnlyFilingDictionary(this); } } public class ReadOnlyFilingDictionary : IReadOnlyCollection, IEnumerable, IEnumerable { private readonly FilingDictionary baseCollection; public int Count => baseCollection.Count; public ReadOnlyFilingDictionary(FilingDictionary baseCollection) { this.baseCollection = baseCollection; } public IEnumerator GetEnumerator() { return baseCollection.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return baseCollection.GetEnumerator(); } } public class FloatDebuffModule : Module { public static BuffDef floatDebuff; public override bool managedEnable => false; public override void SetupAttributes() { //IL_0015: 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) base.SetupAttributes(); floatDebuff = ScriptableObject.CreateInstance(); floatDebuff.buffColor = Color.white; floatDebuff.canStack = false; floatDebuff.isDebuff = true; ((Object)floatDebuff).name = "TKSATFloat"; floatDebuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/floatDebuffIcon.png"); floatDebuff.ignoreGrowthNectar = true; ContentAddition.AddBuffDef(floatDebuff); } public override void SetupBehavior() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.SetupBehavior(); Util.CleanseBody += new hook_CleanseBody(Util_CleanseBody); } private void Util_CleanseBody(orig_CleanseBody orig, CharacterBody characterBody, bool removeDebuffs, bool removeBuffs, bool removeCooldownBuffs, bool removeDots, bool removeStun, bool removeNearbyProjectiles) { orig.Invoke(characterBody, removeDebuffs, removeBuffs, removeCooldownBuffs, removeDots, removeStun, removeNearbyProjectiles); FloatDebuffController floatDebuffController = default(FloatDebuffController); if (removeDebuffs && Object.op_Implicit((Object)(object)characterBody) && ((Component)characterBody).TryGetComponent(ref floatDebuffController)) { Object.Destroy((Object)(object)floatDebuffController); } } public static void Inflict(HealthComponent target, DamageInfo damageInfo, FloatDebuffController.FloatDebuffParams debuffParams) { FloatDebuffController floatDebuffController = ((Component)target).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)floatDebuffController)) { floatDebuffController = ((Component)target).gameObject.AddComponent(); } floatDebuffController.Inflict(damageInfo, debuffParams); } } [RequireComponent(typeof(HealthComponent))] public class FloatDebuffController : MonoBehaviour { public struct FloatDebuffParams { public float duration; public float height; public float wobbleRadius; public float wobbleSpeed; public float wobbleForce; public float slamForce; } private HealthComponent healthComponent; private IPhysMotor motor; private bool started; public Vector3 targetHoldPos; public float holdStopwatch; public float wobbleSeed; public DamageInfo deferredDamageInfo; public FloatDebuffParams debuffParams; private void Awake() { healthComponent = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_003c: 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_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_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) //IL_0093: 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_00ca: 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_00e8: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) if (started) { holdStopwatch -= Time.fixedDeltaTime; float num = (holdStopwatch + wobbleSeed) * MathF.PI * debuffParams.wobbleSpeed; Vector3 val = targetHoldPos + new Vector3(Mathf.Cos(num), Mathf.Cos(num * 2f), Mathf.Cos(num * 3f)) * debuffParams.wobbleRadius - healthComponent.body.transform.position; float num2 = Mathf.Min(debuffParams.wobbleForce, ((Vector3)(ref val)).magnitude); val = ((Vector3)(ref val)).normalized * Mathf.Pow(num2 / debuffParams.wobbleForce, 0.5f) * debuffParams.wobbleForce; IPhysMotor obj = motor; PhysForceInfo val2 = new PhysForceInfo { force = (val - motor.velocity) * motor.mass }; ((PhysForceInfo)(ref val2)).ignoreGroundStick = true; ((PhysForceInfo)(ref val2)).disableAirControlUntilCollision = false; obj.ApplyForceImpulse(ref val2); if (holdStopwatch <= 0f) { IPhysMotor obj2 = motor; val2 = new PhysForceInfo { force = new Vector3(0f, 0f - debuffParams.slamForce, 0f) * motor.mass }; ((PhysForceInfo)(ref val2)).ignoreGroundStick = true; ((PhysForceInfo)(ref val2)).disableAirControlUntilCollision = false; obj2.ApplyForceImpulse(ref val2); healthComponent.TakeDamage(deferredDamageInfo); Object.Destroy((Object)(object)this); } } } public void Inflict(DamageInfo damageInfo, FloatDebuffParams debuffParams) { //IL_008b: 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_00aa: Unknown result type (might be due to invalid IL or missing references) if (!healthComponent.alive) { return; } if (deferredDamageInfo != null) { healthComponent.TakeDamage(deferredDamageInfo); } deferredDamageInfo = damageInfo; this.debuffParams = debuffParams; SetStateOnHurt val = default(SetStateOnHurt); if (!((Component)healthComponent).TryGetComponent(ref val) || !((Component)healthComponent).TryGetComponent(ref motor) || !val.canBeStunned) { healthComponent.TakeDamage(deferredDamageInfo); Object.Destroy((Object)(object)this); return; } if (!started) { targetHoldPos = ((Component)healthComponent).transform.position + new Vector3(0f, debuffParams.height, 0f); } wobbleSeed = Time.fixedTime % 1f; if (holdStopwatch < debuffParams.duration) { holdStopwatch = debuffParams.duration; } started = true; } } public static class MathUtil { public static float Wrap(float x, float min, float max) { if (x < min) { return max - (min - x) % (max - min); } return min + (x - min) % (max - min); } public static float SteepSigmoid01(float x, float b) { return 0.5f - (float)Math.Tanh(2f * b * (x - 0.5f)) / (2f * (float)Math.Tanh(0f - b)); } internal static Quaternion ApplyRandomSpread(Quaternion targetRotation, float coneHalfAngleDegr) { //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) //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) float num = Random.Range(0f, MathF.PI * 2f); float num2 = Random.Range(Mathf.Cos(coneHalfAngleDegr * MathF.PI / 180f), 1f); float num3 = Mathf.Sqrt(1f - num2 * num2); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num3 * Mathf.Cos(num), num3 * Mathf.Sin(num), num2); return targetRotation * Quaternion.LookRotation(val); } public static (Vector3 vInitial, float tFinal) CalculateVelocityForFinalPosition(Vector3 source, Vector3 target, float extraPeakHeight) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) Vector3 val = target - source; float y = val.y; float num = Mathf.Max(new float[3] { Mathf.Max(y, 0f) + extraPeakHeight, y, 0f }); float num2 = 0f - Physics.gravity.y; float num3 = Mathf.Sqrt(2f * num2 * num); float num4 = Mathf.Sqrt(2f) / num2 * (Mathf.Sqrt(num2 * (num - y)) + Mathf.Sqrt(num2 * num)); float num5 = val.x / num4; float num6 = val.z / num4; return (new Vector3(num5, num3, num6), num4); } public static bool TrajectorySphereCast(out RaycastHit hit, Vector3 source, Vector3 vInitial, float tFinal, float radius, int resolution, int layerMask = -5, QueryTriggerInteraction qTI = 0) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_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_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_001e: 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_0020: 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_0026: Unknown result type (might be due to invalid IL or missing references) //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) //IL_003f: 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) Vector3 val = source; for (int i = 0; i < resolution; i++) { Vector3 val2 = val; val = Trajectory.CalculatePositionAtTime(source, vInitial, ((float)i / (float)resolution + 1f) * tFinal); Vector3 val3 = val - val2; if (Physics.SphereCast(new Ray(val2, ((Vector3)(ref val3)).normalized), radius, ref hit, ((Vector3)(ref val3)).magnitude, layerMask, qTI)) { return true; } } hit = default(RaycastHit); return false; } public static List CollectNearestNodeLaunchVelocities(NodeGraph graph, int desiredCount, float minRange, float maxRange, Vector3 source, float extraPeakHeight, float radius, float maxDeviation, int trajectoryResolution, int layerMask = -5, QueryTriggerInteraction qTI = 0, HullMask hullMask = 1) { //IL_000e: 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_001c: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_006e: 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_007d: 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) //IL_0098: 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_00a8: 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_00bc: Unknown result type (might be due to invalid IL or missing references) IOrderedEnumerable orderedEnumerable = graph.FindNodesInRange(source, minRange, maxRange, hullMask).Select(delegate(NodeIndex x) { //IL_0006: 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) Vector3 result = default(Vector3); graph.GetNodePosition(x, ref result); return result; }).OrderBy(delegate(Vector3 x) { //IL_0000: 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_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) Vector3 val3 = x - source; return ((Vector3)(ref val3)).sqrMagnitude; }); List list = new List(); float num = maxDeviation * maxDeviation; foreach (Vector3 item in orderedEnumerable) { var (val, tFinal) = CalculateVelocityForFinalPosition(source, item, extraPeakHeight); if (TrajectorySphereCast(out var hit, source, val, tFinal, radius, trajectoryResolution, layerMask, qTI)) { Vector3 val2 = ((RaycastHit)(ref hit)).point - item; if (((Vector3)(ref val2)).sqrMagnitude <= num) { list.Add(val); } } if (list.Count >= desiredCount) { break; } } return list; } } public class MiscObjectTrackerModule : Module { private static readonly List warbanners = new List(); public static readonly ReadOnlyCollection readOnlyWarbanners = new ReadOnlyCollection(warbanners); private static readonly List randomDamageZones = new List(); public static readonly ReadOnlyCollection readOnlyRandomDamageZones = new ReadOnlyCollection(randomDamageZones); private static readonly List crippleWards = new List(); public static readonly ReadOnlyCollection readOnlyCrippleWards = new ReadOnlyCollection(crippleWards); internal static readonly List deskplants = new List(); public static readonly ReadOnlyCollection readOnlyDeskplants = new ReadOnlyCollection(deskplants); public override bool managedEnable => false; public override void SetupAttributes() { base.SetupAttributes(); } public override void SetupBehavior() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.SetupBehavior(); BuffWard.OnEnable += new hook_OnEnable(BuffWard_OnEnable); BuffWard.OnDisable += new hook_OnDisable(BuffWard_OnDisable); HealingWard.Awake += new hook_Awake(HealingWard_Awake); } private void HealingWard_Awake(orig_Awake orig, HealingWard self) { orig.Invoke(self); ((Component)self).gameObject.AddComponent(); } private void BuffWard_OnEnable(orig_OnEnable orig, BuffWard self) { orig.Invoke(self); switch (((Object)((Component)self).gameObject).name) { case "WarbannerWard(Clone)": warbanners.Add(((Component)self).gameObject); break; case "DamageZoneWard(Clone)": randomDamageZones.Add(((Component)self).gameObject); break; case "CrippleWard(Clone)": crippleWards.Add(((Component)self).gameObject); break; } } private void BuffWard_OnDisable(orig_OnDisable orig, BuffWard self) { orig.Invoke(self); switch (((Object)((Component)self).gameObject).name) { case "WarbannerWard(Clone)": warbanners.Remove(((Component)self).gameObject); break; case "DamageZoneWard(Clone)": randomDamageZones.Remove(((Component)self).gameObject); break; case "CrippleWard(Clone)": crippleWards.Remove(((Component)self).gameObject); break; } } } public class HealingWardInstanceTracker : MonoBehaviour { private void OnEnable() { if (((Object)((Component)this).gameObject).name == "DeskplantWard(Clone)") { MiscObjectTrackerModule.deskplants.Add(((Component)this).gameObject); } } private void OnDisable() { if (((Object)((Component)this).gameObject).name == "DeskplantWard(Clone)") { MiscObjectTrackerModule.deskplants.Remove(((Component)this).gameObject); } } } public class AutoConfigBinding { public enum DeferType { UpdateImmediately, WaitForNextStage, WaitForRunEnd, NeverAutoUpdate } internal static readonly List instances = new List(); internal static readonly Dictionary stageDirtyInstances = new Dictionary(); internal static readonly Dictionary runDirtyInstances = new Dictionary(); internal bool isOverridden; public AutoConfigContainer owner { get; internal set; } public object target { get; internal set; } public ConfigEntryBase configEntry { get; internal set; } public PropertyInfo boundProperty { get; internal set; } public string modName { get; internal set; } public AutoConfigUpdateActionsAttribute updateEventAttribute { get; internal set; } public MethodInfo propGetter { get; internal set; } public MethodInfo propSetter { get; internal set; } public Type propType { get; internal set; } public object boundKey { get; internal set; } public bool onDict { get; internal set; } public bool allowConCmd { get; internal set; } public object cachedValue { get; internal set; } public DeferType deferType { get; internal set; } public string readablePath => modName + "/" + configEntry.Definition.Section + "/" + configEntry.Definition.Key; internal static void CleanupDirty(bool isRunEnd) { TinkersSatchelPlugin._logger.LogDebug((object)$"Stage ended; applying {stageDirtyInstances.Count} deferred config changes..."); foreach (AutoConfigBinding key in stageDirtyInstances.Keys) { key.DeferredUpdateProperty(stageDirtyInstances[key].Item1, stageDirtyInstances[key].Item2); } stageDirtyInstances.Clear(); if (!isRunEnd) { return; } TinkersSatchelPlugin._logger.LogDebug((object)$"Run ended; applying {runDirtyInstances.Count} deferred config changes..."); foreach (AutoConfigBinding key2 in runDirtyInstances.Keys) { key2.DeferredUpdateProperty(runDirtyInstances[key2], silent: true); } runDirtyInstances.Clear(); } internal AutoConfigBinding() { instances.Add(this); } ~AutoConfigBinding() { if (instances.Contains(this)) { instances.Remove(this); } } internal void OverrideProperty(object newValue, bool silent = false) { if (!isOverridden) { runDirtyInstances[this] = cachedValue; } isOverridden = true; UpdateProperty(newValue, silent); } private void DeferredUpdateProperty(object newValue, bool silent = false) { object oldValue = propGetter.Invoke(target, (!onDict) ? new object[0] : new object[1] { boundKey }); propSetter.Invoke(target, (!onDict) ? new object[1] { newValue } : new object[2] { boundKey, newValue }); AutoConfigUpdateActionTypes autoConfigUpdateActionTypes = updateEventAttribute?.flags ?? AutoConfigUpdateActionTypes.None; AutoConfigUpdateActionsAttribute autoConfigUpdateActionsAttribute = updateEventAttribute; if (autoConfigUpdateActionsAttribute != null && !autoConfigUpdateActionsAttribute.ignoreDefault) { autoConfigUpdateActionTypes |= owner.defaultEnabledUpdateFlags; } cachedValue = newValue; owner.OnConfigChanged(new AutoConfigUpdateActionEventArgs { flags = autoConfigUpdateActionTypes, oldValue = oldValue, newValue = newValue, target = this, silent = silent }); } internal void UpdateProperty(object newValue, bool silent = false) { if (deferType == DeferType.UpdateImmediately || (Object)(object)Run.instance == (Object)null || !((Behaviour)Run.instance).enabled) { DeferredUpdateProperty(newValue, silent); } else if (deferType == DeferType.WaitForNextStage) { stageDirtyInstances[this] = (newValue, silent); } else if (deferType == DeferType.WaitForRunEnd) { runDirtyInstances[this] = newValue; } else { TinkersSatchelPlugin._logger.LogWarning((object)("Something attempted to set the value of an AutoConfigBinding with the DeferForever flag: \"" + readablePath + "\"")); } } public static (List results, string errorMsg) FindFromPath(string path1, string path2, string path3) { string p1u = path1.ToUpper(); string p2u = path2?.ToUpper(); string p3u = path3?.ToUpper(); List matchesLevel1 = new List(); List matchesLevel2 = new List(); List matchesLevel3 = new List(); List matchesLevel4 = new List(); instances.ForEach(delegate(AutoConfigBinding x) { if (x.allowConCmd) { string key = x.configEntry.Definition.Key; string text = key.ToUpper(); string section = x.configEntry.Definition.Section; string text2 = section.ToUpper(); string text3 = x.modName; string text4 = text3.ToUpper(); if (path2 == null) { if (text.Contains(p1u) || text2.Contains(p1u) || text4.Contains(p1u)) { matchesLevel1.Add(x); matchesLevel2.Add(x); if (text == p1u) { matchesLevel3.Add(x); if (key == path1) { matchesLevel4.Add(x); } } } } else if (path3 == null) { bool flag = text4.Contains(p1u); bool flag2 = text2.Contains(p1u); bool flag3 = text2.Contains(p2u); bool flag4 = text.Contains(p2u); if ((flag && flag3) || (flag2 && flag4) || (flag && flag4)) { matchesLevel1.Add(x); if (!(flag && flag4)) { matchesLevel2.Add(x); bool num = text3.Contains(path1); bool flag5 = section.Contains(path1); bool flag6 = section.Contains(path2); bool flag7 = key.Contains(path2); if ((num && flag6) || (flag5 && flag7)) { matchesLevel3.Add(x); bool num2 = text3 == path1; bool flag8 = section == path1; bool flag9 = section == path2; bool flag10 = key == path2; if ((num2 && flag9) || (flag8 && flag10)) { matchesLevel4.Add(x); } } } } } else if (text.Contains(p3u) && text2.Contains(p2u) && text4.Contains(p1u)) { matchesLevel1.Add(x); matchesLevel2.Add(x); if (text4 == p3u && text2 == p2u && text == p1u) { matchesLevel3.Add(x); if (text3 == path3 && section == path2 && key == path1) { matchesLevel4.Add(x); } } } } }); if (matchesLevel1.Count == 0) { return (null, "no level 1 matches"); } if (matchesLevel1.Count == 1) { return (matchesLevel1, null); } if (matchesLevel2.Count == 0) { return (matchesLevel1, "multiple level 1 matches, no level 2 matches"); } if (matchesLevel2.Count == 1) { return (matchesLevel2, null); } if (matchesLevel3.Count == 0) { return (matchesLevel2, "multiple level 2 matches, no level 3 matches"); } if (matchesLevel3.Count == 1) { return (matchesLevel3, null); } if (matchesLevel4.Count == 0) { return (matchesLevel3, "multiple level 3 matches, no level 4 matches"); } if (matchesLevel4.Count == 1) { return (matchesLevel4, null); } Debug.LogError((object)("AutoConfig: There are multiple config entries with the path \"" + matchesLevel4[0].readablePath + "\"; this should never happen! Please report this as a bug.")); return (matchesLevel4, "multiple level 4 matches"); } } public class AutoConfigContainer { public struct BindSubDictInfo { public object key; public object val; public Type keyType; public int index; } protected internal readonly List bindings = new List(); protected internal virtual AutoConfigUpdateActionTypes defaultEnabledUpdateFlags => AutoConfigUpdateActionTypes.None; public event EventHandler ConfigEntryChanged; public AutoConfigBinding FindConfig(string propName) { return bindings.Find((AutoConfigBinding x) => x.boundProperty.Name == propName && !x.onDict); } public AutoConfigBinding FindConfig(string propName, object dictKey) { return bindings.Find((AutoConfigBinding x) => x.boundProperty.Name == propName && x.onDict && x.boundKey == dictKey); } internal void OnConfigChanged(AutoConfigUpdateActionEventArgs e) { this.ConfigEntryChanged?.Invoke(this, e); Debug.Log((object)$"{e.target.readablePath}: {e.oldValue} > {e.newValue}"); if ((Object)(object)Run.instance != (Object)null && ((Behaviour)Run.instance).isActiveAndEnabled) { if ((e.flags & AutoConfigUpdateActionTypes.InvalidateStats) == AutoConfigUpdateActionTypes.InvalidateStats) { AutoConfigModule.globalStatsDirty = true; } if ((e.flags & AutoConfigUpdateActionTypes.InvalidateDropTable) == AutoConfigUpdateActionTypes.InvalidateDropTable) { AutoConfigModule.globalDropsDirty = true; } } } private string ReplaceTags(string orig, PropertyInfo prop, string categoryName, BindSubDictInfo? subDict = null) { return Regex.Replace(orig, "", delegate(Match m) { string value = m.Groups[0].Value; string[] array = Regex.Split(value.Substring(1, value.Length - 1 - 1), "(? x.boundProperty == prop)) { TinkersSatchelPlugin._logger.LogError((object)(text + "this property has already been bound.")); return; } if ((attrib.flags & AutoConfigFlags.BindDict) == AutoConfigFlags.BindDict) { if (!prop.PropertyType.GetInterfaces().Any((Type i) => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IDictionary<, >))) { TinkersSatchelPlugin._logger.LogError((object)(text + "BindDict flag cannot be used on property types which don't implement IDictionary.")); return; } Type type = prop.PropertyType.GetGenericArguments()[1]; if (attrib.avb != null && attrib.avbType != type) { TinkersSatchelPlugin._logger.LogError((object)(text + "dict value and AcceptableValue types must match (received " + type.Name + " and " + attrib.avbType.Name + ").")); return; } if (!TomlTypeConverter.CanConvert(type)) { TinkersSatchelPlugin._logger.LogError((object)(text + "dict value type cannot be converted by BepInEx.Configuration.TomlTypeConverter (received " + type.Name + ").")); return; } IDictionary dictionary = (IDictionary)prop.GetValue(this, null); int num = 0; List list = (from object k in dictionary.Keys select (k)).ToList(); if (list.Count == 0) { TinkersSatchelPlugin._logger.LogError((object)(text + "BindDict was used on an empty dictionary. All intended keys must be present at time of binding and cannot be added afterwards.")); } { foreach (object item in list) { Bind(prop, cfl, modName, categoryName, attrib, eiattr, new BindSubDictInfo { key = item, val = dictionary[item], keyType = type, index = num }); num++; } return; } } } if (!subDict.HasValue) { if (attrib.avb != null && attrib.avbType != prop.PropertyType) { TinkersSatchelPlugin._logger.LogError((object)(text + "property and AcceptableValue types must match (received " + prop.PropertyType.Name + " and " + attrib.avbType.Name + ").")); return; } if (!TomlTypeConverter.CanConvert(prop.PropertyType)) { TinkersSatchelPlugin._logger.LogError((object)(text + "property type cannot be converted by BepInEx.Configuration.TomlTypeConverter (received " + prop.PropertyType.Name + ").")); return; } } object obj2 = (subDict.HasValue ? prop.GetValue(this) : this); IDictionary dictionary2 = (subDict.HasValue ? ((IDictionary)obj2) : null); MethodInfo methodInfo = (subDict.HasValue ? dictionary2.GetType().GetProperty("Item").GetGetMethod(nonPublic: true) : (prop.GetGetMethod(nonPublic: true) ?? prop.DeclaringType.GetProperty(prop.Name)?.GetGetMethod(nonPublic: true))); MethodInfo methodInfo2 = (subDict.HasValue ? dictionary2.GetType().GetProperty("Item").GetSetMethod(nonPublic: true) : (prop.GetSetMethod(nonPublic: true) ?? prop.DeclaringType.GetProperty(prop.Name)?.GetSetMethod(nonPublic: true))); Type type2 = (subDict.HasValue ? subDict.Value.keyType : prop.PropertyType); if (methodInfo == null || methodInfo2 == null) { TinkersSatchelPlugin._logger.LogError((object)(text + "property (or IDictionary Item property, if using BindDict flag) must have both a getter and a setter.")); return; } string name = attrib.name; if (name != null) { name = ReplaceTags(name, prop, categoryName, subDict); } else { object arg = char.ToUpperInvariant(prop.Name[0]); string name2 = prop.Name; name = string.Format("{0}{1}{2}", arg, name2.Substring(1, name2.Length - 1), subDict.HasValue ? (":" + subDict.Value.index) : ""); } string desc = attrib.desc; desc = ((desc == null) ? ("Automatically generated from a C# " + (subDict.HasValue ? "dictionary " : "") + "property.") : ReplaceTags(desc, prop, categoryName, subDict)); MethodInfo methodInfo3 = typeof(ConfigFile).GetMethods().First((MethodInfo x) => x.Name == "Bind" && x.GetParameters().Length == 3 && x.GetParameters()[0].ParameterType == typeof(ConfigDefinition) && x.GetParameters()[2].ParameterType == typeof(ConfigDescription)).MakeGenericMethod(type2); object obj3 = (subDict.HasValue ? subDict.Value.val : prop.GetValue(this)); bool flag = (attrib.flags & AutoConfigFlags.DeferForever) == AutoConfigFlags.DeferForever; bool flag2 = (attrib.flags & AutoConfigFlags.DeferUntilEndGame) == AutoConfigFlags.DeferUntilEndGame; bool flag3 = (attrib.flags & AutoConfigFlags.DeferUntilNextStage) == AutoConfigFlags.DeferUntilNextStage; bool flag4 = (attrib.flags & AutoConfigFlags.PreventConCmd) != AutoConfigFlags.PreventConCmd; if (flag) { desc += "\nThis setting cannot be changed while the game is running."; } ConfigEntryBase cfe = (ConfigEntryBase)methodInfo3.Invoke(cfl, new object[3] { (object)new ConfigDefinition(categoryName, name), obj3, (object)new ConfigDescription(desc, attrib.avb, Array.Empty()) }); AutoConfigBinding newBinding = new AutoConfigBinding { boundProperty = prop, allowConCmd = (flag4 && !flag && !flag2), deferType = (flag ? AutoConfigBinding.DeferType.NeverAutoUpdate : (flag2 ? AutoConfigBinding.DeferType.WaitForRunEnd : (flag3 ? AutoConfigBinding.DeferType.WaitForNextStage : AutoConfigBinding.DeferType.UpdateImmediately))), configEntry = cfe, modName = modName, owner = this, propGetter = methodInfo, propSetter = methodInfo2, propType = type2, onDict = subDict.HasValue, boundKey = (subDict.HasValue ? subDict.Value.key : null), updateEventAttribute = eiattr, cachedValue = obj3, target = obj2 }; bindings.Add(newBinding); if (!flag) { typeof(ConfigEntry<>).MakeGenericType(type2).GetEvent("SettingChanged").ReflAddEventHandler(cfe, delegate { newBinding.UpdateProperty(cfe.BoxedValue); }); } if ((attrib.flags & AutoConfigFlags.NoInitialRead) != AutoConfigFlags.NoInitialRead) { methodInfo2.Invoke(obj2, (!subDict.HasValue) ? new object[1] { cfe.BoxedValue } : new object[2] { subDict.Value.key, cfe.BoxedValue }); newBinding.cachedValue = cfe.BoxedValue; } BindRoO(cfe, prop, type2, categoryName, name, desc, flag, flag2 || flag); } public void BindRoO(AutoConfigBinding bind, params BaseAutoConfigRoOAttribute[] entryRoOAttributes) { BindRoO(bind.configEntry, bind.boundProperty, bind.propType, bind.configEntry.Definition.Section, bind.configEntry.Definition.Key, bind.configEntry.Description.Description, bind.deferType >= AutoConfigBinding.DeferType.NeverAutoUpdate, bind.deferType >= AutoConfigBinding.DeferType.WaitForRunEnd, entryRoOAttributes); } public void BindRoO(ConfigEntryBase cfe, PropertyInfo prop, Type propType, string categoryName, string cfgName, string cfgDesc, bool deferForever, bool deferRun, params BaseAutoConfigRoOAttribute[] entryRoOAttributes) { if (!Compat_RiskOfOptions.enabled) { return; } string text = "AutoConfigContainer.Bind on property " + prop.Name + " in category " + categoryName + " could not apply Risk of Options compat: "; AutoConfigRoOInfoOverridesAttribute customAttribute = GetType().GetCustomAttribute(); AutoConfigRoOInfoOverridesAttribute customAttribute2 = prop.GetCustomAttribute(); if (entryRoOAttributes.Length == 0) { return; } if ((from x in entryRoOAttributes group x by x.GetType()).Any((IGrouping x) => x.Count() > 1)) { TinkersSatchelPlugin._logger.LogWarning((object)("AutoConfigContainer.BindRoO on property " + prop.Name + " in category " + categoryName + " has multiple RoO options of the same type")); } string text2 = null; string text3 = null; bool flag = false; if (customAttribute != null) { text2 = customAttribute.modGuid; text3 = customAttribute.modName; flag = true; } else { Assembly assembly = Assembly.GetAssembly(GetType()); Type[] types; try { types = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { types = ex.Types; } Type[] array = types; for (int i = 0; i < array.Length; i++) { BepInPlugin customAttribute3 = ((MemberInfo)array[i]).GetCustomAttribute(); if (customAttribute3 != null) { text2 = customAttribute3.GUID; text3 = customAttribute3.Name; flag = true; break; } } } if (!flag) { TinkersSatchelPlugin._logger.LogError((object)(text + "could not find mod info. Declaring type must be in an assembly with a BepInPlugin, or have an AutoConfigContainerRoOInfoAttribute on it.")); return; } Compat_RiskOfOptions.OptionIdentityStrings optionIdentityStrings = default(Compat_RiskOfOptions.OptionIdentityStrings); optionIdentityStrings.category = customAttribute2?.categoryName ?? customAttribute?.categoryName ?? categoryName; optionIdentityStrings.name = customAttribute2?.entryName ?? customAttribute?.entryName ?? cfgName; optionIdentityStrings.description = cfgDesc; optionIdentityStrings.modGuid = customAttribute2?.modGuid ?? text2; optionIdentityStrings.modName = customAttribute2?.modName ?? text3; Compat_RiskOfOptions.OptionIdentityStrings identStrings = optionIdentityStrings; foreach (BaseAutoConfigRoOAttribute baseAutoConfigRoOAttribute in entryRoOAttributes) { if ((baseAutoConfigRoOAttribute.requiredType == typeof(Enum)) ? (!propType.IsEnum) : (propType != baseAutoConfigRoOAttribute.requiredType)) { TinkersSatchelPlugin._logger.LogError((object)(text + baseAutoConfigRoOAttribute.GetType().Name + " may only be applied to " + baseAutoConfigRoOAttribute.requiredType.Name + " properties (got " + propType.Name + ").")); } else { baseAutoConfigRoOAttribute.Apply(cfe, identStrings, deferForever, () => (deferRun && Object.op_Implicit((Object)(object)Run.instance)) ? true : false); } } } internal void BindRoO(ConfigEntryBase cfe, PropertyInfo prop, Type propType, string categoryName, string cfgName, string cfgDesc, bool deferForever, bool deferRun) { if (Compat_RiskOfOptions.enabled) { BindRoO(cfe, prop, propType, categoryName, cfgName, cfgDesc, deferForever, deferRun, prop.GetCustomAttributes().ToArray()); } } public void BindAll(ConfigFile cfl, string modName, string categoryName) { PropertyInfo[] properties = GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (PropertyInfo propertyInfo in properties) { AutoConfigAttribute customAttribute = propertyInfo.GetCustomAttribute(inherit: true); if (customAttribute != null) { Bind(propertyInfo, cfl, modName, categoryName, customAttribute, propertyInfo.GetCustomAttribute(inherit: true)); } } } } internal class AutoConfigModule : Module { internal static bool globalStatsDirty; internal static bool globalDropsDirty; internal static bool globalLanguageDirty; public override bool managedEnable => false; public override void SetupConfig() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.SetupConfig(); NetworkManagerSystem.Disconnect += new hook_Disconnect(On_GNMDisconnect); SceneManager.sceneLoaded += Evt_USMSceneLoaded; } internal static void Update() { if (!((Object)(object)Run.instance != (Object)null) || !((Behaviour)Run.instance).isActiveAndEnabled) { globalStatsDirty = false; globalDropsDirty = false; } else { if (globalStatsDirty) { globalStatsDirty = false; CharacterMaster.readOnlyInstancesList.Where((CharacterMaster x) => x.hasBody && x.GetBody().healthComponent.alive).ToList().ForEach(delegate(CharacterMaster cm) { if (cm.hasBody) { cm.GetBody().RecalculateStats(); } }); } if (globalDropsDirty) { globalDropsDirty = false; Run.instance.OnRuleBookUpdated(Run.instance.networkRuleBookComponent); Run.instance.BuildDropTable(); } } if (globalLanguageDirty) { globalLanguageDirty = false; Language.SetCurrentLanguage(Language.currentLanguageName); } } internal static void On_GNMDisconnect(orig_Disconnect orig, NetworkManagerSystem self) { orig.Invoke(self); AutoConfigBinding.CleanupDirty(isRunEnd: true); } internal static void Evt_USMSceneLoaded(Scene scene, LoadSceneMode mode) { AutoConfigBinding.CleanupDirty(isRunEnd: false); } } [Flags] public enum AutoConfigFlags { None = 0, AVIsList = 1, DeferUntilNextStage = 2, DeferUntilEndGame = 4, DeferForever = 8, PreventConCmd = 0x10, NoInitialRead = 0x20, BindDict = 0x40 } [Flags] public enum AutoConfigUpdateActionTypes { None = 0, InvalidateLanguage = 1, InvalidateModel = 2, InvalidateStats = 4, InvalidateDropTable = 8 } public class AutoConfigUpdateActionEventArgs : EventArgs { public AutoConfigUpdateActionTypes flags; public object oldValue; public object newValue; public AutoConfigBinding target; public bool silent; } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigUpdateActionsAttribute : Attribute { public readonly AutoConfigUpdateActionTypes flags; public readonly bool ignoreDefault; public AutoConfigUpdateActionsAttribute(AutoConfigUpdateActionTypes flags, bool ignoreDefault = false) { this.flags = flags; this.ignoreDefault = ignoreDefault; } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigAttribute : Attribute { public readonly string name; public readonly string desc; public readonly AcceptableValueBase avb; public readonly Type avbType; public readonly AutoConfigFlags flags; public AutoConfigAttribute(string name, string desc, AutoConfigFlags flags = AutoConfigFlags.None, params object[] acceptableValues) : this(desc, flags, acceptableValues) { this.name = name; } public AutoConfigAttribute(string desc, AutoConfigFlags flags = AutoConfigFlags.None, params object[] acceptableValues) : this(flags, acceptableValues) { this.desc = desc; } public AutoConfigAttribute(AutoConfigFlags flags = AutoConfigFlags.None, params object[] acceptableValues) { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown if (acceptableValues.Length != 0) { bool flag = (flags & AutoConfigFlags.AVIsList) == AutoConfigFlags.AVIsList; if (!flag && acceptableValues.Length != 2) { throw new ArgumentException("Range mode for acceptableValues (flag AVIsList not set) requires either 0 or 2 params; received " + acceptableValues.Length + ".\nThe description provided was: \"" + desc + "\"."); } Type type = acceptableValues[0].GetType(); for (int i = 1; i < acceptableValues.Length; i++) { if (type != acceptableValues[i].GetType()) { throw new ArgumentException("Types of all acceptableValues must match"); } } avb = (AcceptableValueBase)Activator.CreateInstance(flag ? typeof(AcceptableValueList<>).MakeGenericType(type) : typeof(AcceptableValueRange<>).MakeGenericType(type), acceptableValues); avbType = type; } this.flags = flags; } } public abstract class BaseAutoConfigRoOAttribute : Attribute { public string nameOverride; public string catOverride; public abstract Type requiredType { get; } public BaseAutoConfigRoOAttribute(string nameOverride = null, string catOverride = null) { this.nameOverride = nameOverride; this.catOverride = catOverride; } public abstract void Apply(ConfigEntryBase cfe, Compat_RiskOfOptions.OptionIdentityStrings identStrings, bool deferForever, Func isDisabledDelegate); } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigRoOSliderAttribute : BaseAutoConfigRoOAttribute { public string format; public float min; public float max; public override Type requiredType => typeof(float); public AutoConfigRoOSliderAttribute(string format, float min, float max, string nameOverride = null, string catOverride = null) : base(nameOverride, catOverride) { this.format = format; this.min = min; this.max = max; } public override void Apply(ConfigEntryBase cfe, Compat_RiskOfOptions.OptionIdentityStrings identStrings, bool deferForever, Func isDisabledDelegate) { Compat_RiskOfOptions.AddOption_Slider((ConfigEntry)(object)cfe, identStrings, min, max, format, deferForever, isDisabledDelegate); } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigRoOStepSliderAttribute : BaseAutoConfigRoOAttribute { public string format; public float min; public float max; public float step; public override Type requiredType => typeof(float); public AutoConfigRoOStepSliderAttribute(string format, float min, float max, float step, string nameOverride = null, string catOverride = null) : base(nameOverride, catOverride) { this.format = format; this.min = min; this.max = max; this.step = step; } public override void Apply(ConfigEntryBase cfe, Compat_RiskOfOptions.OptionIdentityStrings identStrings, bool deferForever, Func isDisabledDelegate) { Compat_RiskOfOptions.AddOption_StepSlider((ConfigEntry)(object)cfe, identStrings, min, max, step, format, deferForever, isDisabledDelegate); } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigRoOIntSliderAttribute : BaseAutoConfigRoOAttribute { public string format; public int min; public int max; public override Type requiredType => typeof(int); public AutoConfigRoOIntSliderAttribute(string format, int min, int max, string nameOverride = null, string catOverride = null) : base(nameOverride, catOverride) { this.format = format; this.min = min; this.max = max; } public override void Apply(ConfigEntryBase cfe, Compat_RiskOfOptions.OptionIdentityStrings identStrings, bool deferForever, Func isDisabledDelegate) { Compat_RiskOfOptions.AddOption_IntSlider((ConfigEntry)(object)cfe, identStrings, min, max, format, deferForever, isDisabledDelegate); } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigRoOChoiceAttribute : BaseAutoConfigRoOAttribute { public override Type requiredType => typeof(Enum); public AutoConfigRoOChoiceAttribute(string nameOverride = null, string catOverride = null) : base(nameOverride, catOverride) { } public override void Apply(ConfigEntryBase cfe, Compat_RiskOfOptions.OptionIdentityStrings identStrings, bool deferForever, Func isDisabledDelegate) { Compat_RiskOfOptions.AddOption_Choice(cfe, identStrings, deferForever, isDisabledDelegate); } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigRoOKeybindAttribute : BaseAutoConfigRoOAttribute { public override Type requiredType => typeof(KeyboardShortcut); public AutoConfigRoOKeybindAttribute(string nameOverride = null, string catOverride = null) : base(nameOverride, catOverride) { } public override void Apply(ConfigEntryBase cfe, Compat_RiskOfOptions.OptionIdentityStrings identStrings, bool deferForever, Func isDisabledDelegate) { Compat_RiskOfOptions.AddOption_Keybind((ConfigEntry)(object)cfe, identStrings, deferForever, isDisabledDelegate); } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigRoOCheckboxAttribute : BaseAutoConfigRoOAttribute { public override Type requiredType => typeof(bool); public AutoConfigRoOCheckboxAttribute(string nameOverride = null, string catOverride = null) : base(nameOverride, catOverride) { } public override void Apply(ConfigEntryBase cfe, Compat_RiskOfOptions.OptionIdentityStrings identStrings, bool deferForever, Func isDisabledDelegate) { Compat_RiskOfOptions.AddOption_CheckBox((ConfigEntry)(object)cfe, identStrings, deferForever, isDisabledDelegate); } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigRoOStringAttribute : BaseAutoConfigRoOAttribute { public override Type requiredType => typeof(string); public AutoConfigRoOStringAttribute(string nameOverride = null, string catOverride = null) : base(nameOverride, catOverride) { } public override void Apply(ConfigEntryBase cfe, Compat_RiskOfOptions.OptionIdentityStrings identStrings, bool deferForever, Func isDisabledDelegate) { Compat_RiskOfOptions.AddOption_String((ConfigEntry)(object)cfe, identStrings, deferForever, isDisabledDelegate); } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class AutoConfigRoOInfoOverridesAttribute : Attribute { public string modGuid; public string modName; public string categoryName; public string entryName; public AutoConfigRoOInfoOverridesAttribute(string guid, string name, string cat = null, string ent = null) { modGuid = guid; modName = name; categoryName = cat; entryName = ent; } public AutoConfigRoOInfoOverridesAttribute(Type ownerPluginType, string cat = null, string ent = null) { BepInPlugin customAttribute = ((MemberInfo)ownerPluginType).GetCustomAttribute(); if (customAttribute == null) { TinkersSatchelPlugin._logger.LogError((object)("AutoConfigContainerRoOInfoAttribute received an invalid type " + ownerPluginType.Name + " with no BepInPluginAttribute")); return; } modGuid = customAttribute.GUID; modName = customAttribute.Name; categoryName = cat; entryName = ent; } } public static class AutoConfigPresetExtensions { public static void ApplyPreset(this AutoConfigContainer container, string name) { HashSet hashSet = new HashSet(); foreach (AutoConfigBinding binding in container.bindings) { AutoConfigPresetAttribute autoConfigPresetAttribute = binding.boundProperty.GetCustomAttributes(typeof(AutoConfigPresetAttribute), inherit: true).Cast().FirstOrDefault((AutoConfigPresetAttribute p) => p.presetName == name); if (autoConfigPresetAttribute != null) { binding.configEntry.BoxedValue = autoConfigPresetAttribute.boxedValue; if (!binding.configEntry.ConfigFile.SaveOnConfigSet) { hashSet.Add(binding.configEntry.ConfigFile); } } } foreach (ConfigFile item in hashSet) { item.Save(); } } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)] public class AutoConfigPresetAttribute : Attribute { public readonly string presetName; public readonly object boxedValue; public AutoConfigPresetAttribute(string name, object value) { presetName = name; boxedValue = value; } } public abstract class CatalogBoilerplate : Module { public struct ConsoleStrings { public string className; public string objectName; public string formattedIndex; } public string nameToken { get; private protected set; } public string pickupToken { get; private protected set; } public string descToken { get; private protected set; } public string loreToken { get; private protected set; } public PickupDef pickupDef { get; internal set; } public PickupIndex pickupIndex { get; internal set; } public Entry logbookEntry { get; internal set; } public RuleDef ruleDef { get; internal set; } protected internal override AutoConfigUpdateActionTypes defaultEnabledUpdateFlags => AutoConfigUpdateActionTypes.None; public override bool managedEnable => true; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilNextStage; public override AutoConfigUpdateActionTypes enabledConfigUpdateActionTypes => AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats | AutoConfigUpdateActionTypes.InvalidateDropTable; public GameObject modelResource { get; protected set; } public Sprite iconResource { get; protected set; } [Obsolete("No longer in use. Replaced by LanguageAPI systems: use a language file or similar to define token ModIdent_ClassName_NAME, e.g. MYMOD_MYITEM_NAME.")] public virtual string displayName { get; } protected virtual string[] GetNameStringArgs(string langID = null) { return new string[0]; } protected virtual string[] GetPickupStringArgs(string langID = null) { return new string[0]; } protected virtual string[] GetDescStringArgs(string langID = null) { return new string[0]; } protected virtual string[] GetLoreStringArgs(string langID = null) { return new string[0]; } protected virtual string GetNameString(string langID = null) { try { Language bestLanguage = CommonCode.GetBestLanguage(langID); object obj; if (bestLanguage == null) { obj = null; } else { string obj2 = nameToken ?? "Language load error! (null token)"; object[] nameStringArgs = GetNameStringArgs(langID); obj = bestLanguage.GetLocalizedFormattedStringByToken(obj2, nameStringArgs); } if (obj == null) { obj = "Language load error!"; } return string.Format((string)obj); } catch (FormatException) { TinkersSatchelPlugin._logger.LogError((object)("Argument count mismatch while retrieving string " + nameToken)); return $"Language load error! (argument count mismatch; expected {GetNameStringArgs(langID).Length} total)"; } } protected virtual string GetPickupString(string langID = null) { try { Language bestLanguage = CommonCode.GetBestLanguage(langID); object obj; if (bestLanguage == null) { obj = null; } else { string obj2 = pickupToken ?? "Language load error! (null token)"; object[] pickupStringArgs = GetPickupStringArgs(langID); obj = bestLanguage.GetLocalizedFormattedStringByToken(obj2, pickupStringArgs); } if (obj == null) { obj = "Language load error!"; } return string.Format((string)obj); } catch (FormatException) { TinkersSatchelPlugin._logger.LogError((object)("Argument count mismatch while retrieving string " + pickupToken)); return $"Language load error! (argument count mismatch; expected {GetPickupStringArgs(langID).Length} total)"; } } protected virtual string GetDescString(string langID = null) { try { Language bestLanguage = CommonCode.GetBestLanguage(langID); object obj; if (bestLanguage == null) { obj = null; } else { string obj2 = descToken ?? "Language load error! (null token)"; object[] descStringArgs = GetDescStringArgs(langID); obj = bestLanguage.GetLocalizedFormattedStringByToken(obj2, descStringArgs); } if (obj == null) { obj = "Language load error!"; } return string.Format((string)obj); } catch (FormatException) { TinkersSatchelPlugin._logger.LogError((object)("Argument count mismatch while retrieving string " + descToken)); return $"Language load error! (argument count mismatch; expected {GetDescStringArgs(langID).Length} total)"; } } protected virtual string GetLoreString(string langID = null) { try { Language bestLanguage = CommonCode.GetBestLanguage(langID); object obj; if (bestLanguage == null) { obj = null; } else { string obj2 = loreToken ?? "Language load error! (null token)"; object[] loreStringArgs = GetLoreStringArgs(langID); obj = bestLanguage.GetLocalizedFormattedStringByToken(obj2, loreStringArgs); } if (obj == null) { obj = "Language load error!"; } return string.Format((string)obj); } catch (FormatException) { TinkersSatchelPlugin._logger.LogError((object)("Argument count mismatch while retrieving string " + loreToken)); return $"Language load error! (argument count mismatch; expected {GetLoreStringArgs(langID).Length} total)"; } } protected virtual GameObject GetPickupModel() { return null; } public CatalogBoilerplate() { CatalogBoilerplateModule.allInstances.Add(this); } public override void SetupConfig() { base.SetupConfig(); base.ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if ((args.flags & AutoConfigUpdateActionTypes.InvalidateModel) == AutoConfigUpdateActionTypes.InvalidateModel) { GameObject pickupModel = GetPickupModel(); if ((Object)(object)pickupModel != (Object)null) { if (pickupDef != null) { pickupDef.displayPrefab = pickupModel; } if (logbookEntry != null) { logbookEntry.modelPrefab = pickupModel; } } } }; } public override void RefreshPermanentLanguage() { string @string = Language.GetString("TKSAT_CONFIG_DISABLED"); permanentGenericLanguageTokens[nameToken + "_RENDERED"] = (base.enabled ? "" : @string) + GetNameString(); permanentGenericLanguageTokens[pickupToken + "_RENDERED"] = (base.enabled ? "" : @string) + GetPickupString(); permanentGenericLanguageTokens[descToken + "_RENDERED"] = (base.enabled ? "" : (@string + "\n")) + GetDescString(); permanentGenericLanguageTokens[loreToken + "_RENDERED"] = GetLoreString() ?? ""; foreach (string key in Language.languagesByName.Keys) { if (!permanentSpecificLanguageTokens.ContainsKey(key)) { permanentSpecificLanguageTokens.Add(key, new Dictionary()); } Dictionary dictionary = permanentSpecificLanguageTokens[key]; string string2 = Language.GetString("TKSAT_CONFIG_DISABLED", key); dictionary[nameToken + "_RENDERED"] = (base.enabled ? "" : string2) + GetNameString(key); dictionary[pickupToken + "_RENDERED"] = (base.enabled ? "" : string2) + GetPickupString(key); dictionary[descToken + "_RENDERED"] = (base.enabled ? "" : (string2 + "\n")) + GetDescString(key); dictionary[loreToken + "_RENDERED"] = GetLoreString(key) ?? ""; } base.RefreshPermanentLanguage(); } public override void SetupAttributes() { base.SetupAttributes(); nameToken = base.modInfo.longIdentifier.ToUpper() + "_" + name.ToUpper() + "_NAME"; descToken = base.modInfo.longIdentifier.ToUpper() + "_" + name.ToUpper() + "_DESC"; pickupToken = base.modInfo.longIdentifier.ToUpper() + "_" + name.ToUpper() + "_PICKUP"; loreToken = base.modInfo.longIdentifier.ToUpper() + "_" + name.ToUpper() + "_LORE"; } public virtual void SetupCatalogReady() { } public override void Install() { base.Install(); if (Object.op_Implicit((Object)(object)PreGameController.instance)) { PreGameController.instance.RecalculateModifierAvailability(); } } public override void Uninstall() { base.Uninstall(); if (Object.op_Implicit((Object)(object)PreGameController.instance)) { PreGameController.instance.RecalculateModifierAvailability(); } } public static void ConsoleDump(ManualLogSource logger, FilingDictionary instances) { int num = 0; int num2 = 0; List list = new List(); foreach (CatalogBoilerplate instance in instances) { ConsoleStrings consoleStrings = instance.GetConsoleStrings(); list.Add(consoleStrings); num = Mathf.Max(consoleStrings.className.Length, num); num2 = Mathf.Max(consoleStrings.objectName.Length, num2); } logger.LogMessage((object)"Index dump follows (pairs of name / index):"); foreach (ConsoleStrings item in list) { logger.LogMessage((object)(item.className.PadLeft(num) + " " + item.objectName.PadRight(num2) + " / " + item.formattedIndex)); } } public virtual ConsoleStrings GetConsoleStrings() { ConsoleStrings result = default(ConsoleStrings); result.className = "Other"; result.objectName = name; result.formattedIndex = "N/A"; return result; } } internal class CatalogBoilerplateModule : Module { internal static readonly FilingDictionary allInstances = new FilingDictionary(); internal static readonly Dictionary itemInstances = new Dictionary(); internal static readonly Dictionary equipmentInstances = new Dictionary(); internal static readonly Dictionary artifactInstances = new Dictionary(); public override bool managedEnable => false; public static Sprite lockIcon { get; private set; } public override void SetupConfig() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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 //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown base.SetupConfig(); lockIcon = LegacyResourcesAPI.Load("Textures/MiscIcons/texUnlockIcon"); LogBookController.BuildPickupEntries += new hook_BuildPickupEntries(On_LogbookBuildPickupEntries); Run.BuildDropTable += new hook_BuildDropTable(On_RunBuildDropTable); PickupPickerController.GetOptionsFromPickupState += new hook_GetOptionsFromPickupState(PickupPickerController_GetOptionsFromPickupState); LogBookController.CanSelectItemEntry += new hook_CanSelectItemEntry(LogBookController_CanSelectItemEntry); LogBookController.CanSelectEquipmentEntry += new hook_CanSelectEquipmentEntry(LogBookController_CanSelectEquipmentEntry); RuleDef.FromItem += new hook_FromItem(RuleDef_FromItem); RuleDef.FromEquipment += new hook_FromEquipment(RuleDef_FromEquipment); RuleDef.FromArtifact += new hook_FromArtifact(RuleDef_FromArtifact); PreGameController.ResolveChoiceMask += new Manipulator(PreGameController_ResolveChoiceMask); Run.onRunStartGlobal += Run_onRunStartGlobal; } private void Run_onRunStartGlobal(Run obj) { UpdateEnigmaEquipmentTable(); UpdateRandomTriggerEquipmentTable(); } internal void UpdateEnigmaEquipmentTable() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00e0: 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_00eb: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) IEnumerable enumerable = from x in equipmentInstances where !x.Value.enabled select x.Key; IEnumerable enumerable2 = from x in equipmentInstances where x.Value.enabled && x.Value.isEnigmaCompatible select x.Key; foreach (EquipmentIndex item in enumerable) { EquipmentCatalog.enigmaEquipmentList.Remove(item); EnigmaArtifactManager.validEquipment.Remove(item); } foreach (EquipmentIndex item2 in enumerable2) { if (!EquipmentCatalog.enigmaEquipmentList.Contains(item2)) { EquipmentCatalog.enigmaEquipmentList.Add(item2); } if (!EnigmaArtifactManager.validEquipment.Contains(item2)) { EnigmaArtifactManager.validEquipment.Add(item2); } } } internal void UpdateRandomTriggerEquipmentTable() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) IEnumerable enumerable = from x in equipmentInstances where !x.Value.enabled select x.Key; IEnumerable enumerable2 = from x in equipmentInstances where x.Value.enabled && x.Value.canBeRandomlyTriggered select x.Key; foreach (EquipmentIndex item in enumerable) { EquipmentCatalog.randomTriggerEquipmentList.Remove(item); } foreach (EquipmentIndex item2 in enumerable2) { if (!EquipmentCatalog.randomTriggerEquipmentList.Contains(item2)) { EquipmentCatalog.randomTriggerEquipmentList.Add(item2); } } } private void PreGameController_ResolveChoiceMask(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "choiceMaskBuffer"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "SetRuleChoiceMask") })) { int index = val.Index; val.Index = index + 1; val.EmitDelegate>((Func)delegate(RuleChoiceMask origMask) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Invalid comparison between Unknown and I4 //IL_0057: 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_0091: 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_00a3: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < ((SerializableBitArray)origMask).length; i++) { RuleChoiceDef choiceDef = RuleCatalog.GetChoiceDef(i); if ((int)choiceDef.artifactIndex != -1 && artifactInstances.ContainsKey(choiceDef.artifactIndex) && !artifactInstances[choiceDef.artifactIndex].enabled) { ((SerializableBitArray)origMask)[i] = false; } if ((int)choiceDef.equipmentIndex != -1 && equipmentInstances.ContainsKey(choiceDef.equipmentIndex) && !equipmentInstances[choiceDef.equipmentIndex].enabled) { ((SerializableBitArray)origMask)[i] = false; } if ((int)choiceDef.itemIndex != -1 && itemInstances.ContainsKey(choiceDef.itemIndex) && !itemInstances[choiceDef.itemIndex].enabled) { ((SerializableBitArray)origMask)[i] = false; } } return origMask; }); } else { TinkersSatchelPlugin._logger.LogError((object)"CatalogBoilerplateModule: Failed to apply IL hook (PreGameController.ResolveChoiceMask), target instructions not found. Disabled items will be erroneously selectable if using a pregame item rulebook unhider mod."); } } private RuleDef RuleDef_FromArtifact(orig_FromArtifact orig, ArtifactIndex artifactIndex) { //IL_0001: 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) RuleDef val = orig.Invoke(artifactIndex); foreach (CatalogBoilerplate allInstance in allInstances) { if (allInstance is Artifact artifact && artifact.catalogIndex == artifactIndex) { artifactInstances[artifactIndex] = artifact; artifact.ruleDef = val; break; } } return val; } private RuleDef RuleDef_FromEquipment(orig_FromEquipment orig, EquipmentIndex equipmentIndex) { //IL_0001: 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) RuleDef val = orig.Invoke(equipmentIndex); foreach (CatalogBoilerplate allInstance in allInstances) { if (allInstance is Equipment equipment && equipment.catalogIndex == equipmentIndex) { equipmentInstances[equipmentIndex] = equipment; equipment.ruleDef = val; break; } } return val; } private RuleDef RuleDef_FromItem(orig_FromItem orig, ItemIndex itemIndex) { //IL_0001: 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) RuleDef val = orig.Invoke(itemIndex); foreach (CatalogBoilerplate allInstance in allInstances) { if (allInstance is Item item && item.catalogIndex == itemIndex) { itemInstances[itemIndex] = item; item.ruleDef = val; break; } } return val; } private bool LogBookController_CanSelectEquipmentEntry(orig_CanSelectEquipmentEntry orig, EquipmentDef equipmentDef, Dictionary expansionAvailability) { bool result = orig.Invoke(equipmentDef, expansionAvailability); if ((Object)(object)equipmentDef != (Object)null && allInstances.Any((CatalogBoilerplate x) => !x.enabled && x is Equipment equipment && (Object)(object)equipment.equipmentDef == (Object)(object)equipmentDef)) { return false; } return result; } private bool LogBookController_CanSelectItemEntry(orig_CanSelectItemEntry orig, ItemDef itemDef, Dictionary expansionAvailability) { bool result = orig.Invoke(itemDef, expansionAvailability); if ((Object)(object)itemDef != (Object)null && allInstances.Any((CatalogBoilerplate x) => !x.enabled && x is Item item && (Object)(object)item.itemDef == (Object)(object)itemDef)) { return false; } return result; } private Option[] PickupPickerController_GetOptionsFromPickupState(orig_GetOptionsFromPickupState orig, UniquePickup pickupState) { //IL_0007: 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_005e: Unknown result type (might be due to invalid IL or missing references) Option[] source = orig.Invoke(pickupState); HashSet remv = new HashSet(); foreach (CatalogBoilerplate allInstance in allInstances) { if ((allInstance is Item || allInstance is Equipment) && !allInstance.enabled && allInstance.pickupIndex != PickupIndex.none) { remv.Add(allInstance.pickupIndex); } } return source.Where((Option x) => !remv.Contains(x.pickup.pickupIndex)).ToArray(); } private void On_RunBuildDropTable(orig_BuildDropTable orig, Run self) { //IL_003a: 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) ItemMask availableItems = self.availableItems; EquipmentMask availableEquipment = self.availableEquipment; foreach (CatalogBoilerplate allInstance in allInstances) { if (allInstance is Item item && !item.enabled) { availableItems.Remove(item.catalogIndex); } else if (allInstance is Equipment equipment && !equipment.enabled) { availableEquipment.Remove(equipment.catalogIndex); } } self.availableItems = availableItems; self.availableEquipment = availableEquipment; orig.Invoke(self); PickupDropTable.RegenerateAll(Run.instance); UpdateEnigmaEquipmentTable(); UpdateRandomTriggerEquipmentTable(); } [SystemInitializer(new Type[] { typeof(PickupCatalog) })] private static void PostCachePickups() { //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_0029: 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_0045: 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) foreach (CatalogBoilerplate allInstance in allInstances) { PickupIndex val; if (allInstance is Equipment equipment) { val = PickupCatalog.FindPickupIndex(equipment.catalogIndex); } else { if (!(allInstance is Item item)) { continue; } val = PickupCatalog.FindPickupIndex(item.catalogIndex); } PickupDef pickupDef = PickupCatalog.GetPickupDef(val); allInstance.pickupDef = pickupDef; allInstance.pickupIndex = val; } } private Entry[] On_LogbookBuildPickupEntries(orig_BuildPickupEntries orig, Dictionary expansionAvailability) { //IL_0049: 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) Entry[] array = orig.Invoke(expansionAvailability); List list = allInstances.ToList(); Entry[] array2 = array; foreach (Entry val in array2) { if (!(val.extraData is PickupIndex)) { continue; } CatalogBoilerplate catalogBoilerplate = null; foreach (CatalogBoilerplate item in list) { if ((PickupIndex)val.extraData == item.pickupIndex) { catalogBoilerplate = item; break; } } if (catalogBoilerplate != null) { catalogBoilerplate.logbookEntry = val; list.Remove(catalogBoilerplate); } } return array; } } public abstract class Artifact : Artifact where T : Artifact { public static T instance { get; private set; } public Artifact() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting CatalogBoilerplate/Artifact was instantiated twice"); } instance = this as T; } } public abstract class Artifact : CatalogBoilerplate { public override string configCategoryPrefix => "Artifacts."; public Sprite iconResourceDisabled { get; protected set; } public ArtifactIndex catalogIndex => artifactDef.artifactIndex; public ArtifactDef artifactDef { get; private set; } [AutoConfigRoOString(null, null)] [AutoConfig("The internal name of this artifact for use in other config entries. No effect if changed; will be reset on game launch.", AutoConfigFlags.None, new object[] { })] public virtual string configNameInternal { get; protected set; } [AutoConfigRoOString(null, null)] [AutoConfig("The name token of this artifact for use in other config entries. No effect if changed; will be reset on game launch.", AutoConfigFlags.None, new object[] { })] public virtual string configNameToken { get; protected set; } protected override string GetLoreString(string langID = null) { return null; } protected override string GetPickupString(string langID = null) { return null; } public override void SetupConfig() { base.SetupConfig(); base.ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "enabled" && args.oldValue != args.newValue) { if ((bool)args.newValue) { artifactDef.descriptionToken = base.descToken; artifactDef.smallIconDeselectedSprite = iconResourceDisabled; artifactDef.smallIconSelectedSprite = base.iconResource; } else { artifactDef.descriptionToken = "TKSAT_DISABLED_ARTIFACT_DESCRIPTION"; artifactDef.smallIconDeselectedSprite = LegacyResourcesAPI.Load("textures/miscicons/texUnlockIcon"); artifactDef.smallIconSelectedSprite = LegacyResourcesAPI.Load("textures/miscicons/texUnlockIcon"); } } }; } public override void SetupAttributes() { base.SetupAttributes(); artifactDef = ScriptableObject.CreateInstance(); artifactDef.nameToken = base.nameToken + "_RENDERED"; artifactDef.descriptionToken = base.descToken + "_RENDERED"; artifactDef.smallIconDeselectedSprite = iconResourceDisabled; artifactDef.smallIconSelectedSprite = base.iconResource; SetupModifyArtifactDef(); ContentAddition.AddArtifactDef(artifactDef); ((ResourceAvailability)(ref ArtifactCatalog.availability)).CallWhenAvailable((Action)SetupCatalogReady); } public override void SetupCatalogReady() { base.SetupCatalogReady(); ConfigEntryBase configEntry = bindings.Find((AutoConfigBinding x) => x.boundProperty.Name == "configNameInternal").configEntry; configEntry.BoxedValue = artifactDef.cachedName; if (!configEntry.ConfigFile.SaveOnConfigSet) { configEntry.ConfigFile.Save(); } ConfigEntryBase configEntry2 = bindings.Find((AutoConfigBinding x) => x.boundProperty.Name == "configNameToken").configEntry; configEntry2.BoxedValue = artifactDef.nameToken; if (!configEntry2.ConfigFile.SaveOnConfigSet) { configEntry2.ConfigFile.Save(); } } public virtual void SetupModifyArtifactDef() { } public override void Install() { base.Install(); artifactDef.smallIconDeselectedSprite = iconResourceDisabled; artifactDef.smallIconSelectedSprite = base.iconResource; } public override void Uninstall() { base.Uninstall(); artifactDef.smallIconDeselectedSprite = CatalogBoilerplateModule.lockIcon; artifactDef.smallIconSelectedSprite = CatalogBoilerplateModule.lockIcon; } public bool IsActiveAndEnabled() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (base.enabled && Object.op_Implicit((Object)(object)RunArtifactManager.instance)) { return RunArtifactManager.instance.IsArtifactEnabled(catalogIndex); } return false; } public override ConsoleStrings GetConsoleStrings() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown ConsoleStrings result = default(ConsoleStrings); result.className = "Artifact"; result.objectName = name; result.formattedIndex = ((int)catalogIndex).ToString(); return result; } } public abstract class Equipment : Equipment where T : Equipment { public static T instance { get; private set; } public Equipment() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBoilerplate/Equipment was instantiated twice"); } instance = this as T; } } public abstract class Equipment : CatalogBoilerplate { protected ItemDisplayRuleDict displayRules = new ItemDisplayRuleDict(Array.Empty()); public override string configCategoryPrefix => "Equipments."; public EquipmentIndex catalogIndex { get { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)equipmentDef == (Object)null) { TinkersSatchelPlugin._logger.LogError((object)("Module Equipment " + name + " has null EquipmentDef! Cannot retrieve EquipmentIndex")); return (EquipmentIndex)(-1); } return equipmentDef.equipmentIndex; } } public EquipmentDef equipmentDef { get; private set; } public CustomEquipment customEquipment { get; private set; } [AutoConfigRoOString(null, null)] [AutoConfig("The internal name of this equipment for use in other config entries. No effect if changed; will be reset on game launch.", AutoConfigFlags.None, new object[] { })] public virtual string configNameInternal { get; protected set; } [AutoConfigRoOString(null, null)] [AutoConfig("The name token of this equipment for use in other config entries. No effect if changed; will be reset on game launch.", AutoConfigFlags.None, new object[] { })] public virtual string configNameToken { get; protected set; } [AutoConfigRoOSlider("{0:N0} s", 0f, 300f, null, null)] [AutoConfig("The base cooldown of the equipment, in seconds.", AutoConfigFlags.DeferUntilNextStage, new object[] { 0f, float.MaxValue })] public virtual float cooldown { get; protected set; } = 45f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("Whether the equipment can be granted by Artifact of Enigma.", AutoConfigFlags.DeferForever, new object[] { })] public virtual bool isEnigmaCompatible { get; protected set; } = true; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("Whether the equipment can be triggered by Bottled Chaos.", AutoConfigFlags.DeferForever, new object[] { })] public virtual bool canBeRandomlyTriggered { get; protected set; } = true; public virtual bool isLunar => false; public override void SetupConfig() { base.SetupConfig(); } public override void SetupAttributes() { //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); equipmentDef = ScriptableObject.CreateInstance(); ((Object)equipmentDef).name = base.modInfo.shortIdentifier + name; equipmentDef.pickupModelPrefab = base.modelResource; equipmentDef.pickupIconSprite = base.iconResource; equipmentDef.nameToken = base.nameToken + "_RENDERED"; equipmentDef.pickupToken = base.pickupToken + "_RENDERED"; equipmentDef.descriptionToken = base.descToken + "_RENDERED"; equipmentDef.loreToken = base.loreToken + "_RENDERED"; equipmentDef.cooldown = cooldown; equipmentDef.enigmaCompatible = isEnigmaCompatible; equipmentDef.canBeRandomlyTriggered = canBeRandomlyTriggered; equipmentDef.isLunar = isLunar; equipmentDef.canDrop = true; if (isLunar) { equipmentDef.colorIndex = (ColorIndex)4; } SetupModifyEquipmentDef(); customEquipment = new CustomEquipment(equipmentDef, displayRules); ItemAPI.Add(customEquipment); ((ResourceAvailability)(ref EquipmentCatalog.availability)).CallWhenAvailable((Action)SetupCatalogReady); } public override void SetupCatalogReady() { base.SetupCatalogReady(); ConfigEntryBase configEntry = bindings.Find((AutoConfigBinding x) => x.boundProperty.Name == "configNameInternal").configEntry; configEntry.BoxedValue = ((Object)equipmentDef).name; if (!configEntry.ConfigFile.SaveOnConfigSet) { configEntry.ConfigFile.Save(); } ConfigEntryBase configEntry2 = bindings.Find((AutoConfigBinding x) => x.boundProperty.Name == "configNameToken").configEntry; configEntry2.BoxedValue = equipmentDef.nameToken; if (!configEntry2.ConfigFile.SaveOnConfigSet) { configEntry2.ConfigFile.Save(); } } public virtual void SetupModifyEquipmentDef() { } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(Evt_ESPerformEquipmentAction); equipmentDef.pickupIconSprite = base.iconResource; } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); EquipmentSlot.PerformEquipmentAction -= new hook_PerformEquipmentAction(Evt_ESPerformEquipmentAction); equipmentDef.pickupIconSprite = CatalogBoilerplateModule.lockIcon; } private bool Evt_ESPerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef def) { //IL_0009: 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) if (base.enabled && def.equipmentIndex == catalogIndex) { return PerformEquipmentAction(self); } return orig.Invoke(self, def); } protected abstract bool PerformEquipmentAction(EquipmentSlot slot); public bool HasEquipment(Inventory inv, bool inMain = true, bool inAlt = false) { //IL_0010: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between I4 and Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Invalid comparison between I4 and Unknown if (!inMain || ((!((Object)(object)inv != (Object)null)) ? (-1) : ((int)inv.currentEquipmentIndex)) != (int)catalogIndex) { if (inAlt) { return ((!((Object)(object)inv != (Object)null)) ? (-1) : ((int)inv.alternateEquipmentIndex)) == (int)catalogIndex; } return false; } return true; } public bool HasEquipment(CharacterBody body) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0022: Unknown result type (might be due to invalid IL or missing references) EquipmentIndex val = (EquipmentIndex)(-1); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.equipmentSlot)) { val = body.equipmentSlot.equipmentIndex; } return val == catalogIndex; } public override ConsoleStrings GetConsoleStrings() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown ConsoleStrings result = default(ConsoleStrings); result.className = "Equipment"; result.objectName = name; result.formattedIndex = ((int)catalogIndex).ToString(); return result; } } public abstract class Item : Item where T : Item { public static T instance { get; private set; } public Item() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBoilerplate/Item was instantiated twice"); } instance = this as T; } } public abstract class Item : CatalogBoilerplate { protected ItemDisplayRuleDict displayRules = new ItemDisplayRuleDict(Array.Empty()); public override string configCategoryPrefix => "Items."; public ItemIndex catalogIndex { get { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)itemDef == (Object)null) { TinkersSatchelPlugin._logger.LogError((object)("Module Item " + name + " has null ItemDef! Cannot retrieve ItemIndex")); return (ItemIndex)(-1); } return itemDef.itemIndex; } } public ItemDef itemDef { get; private set; } public CustomItem customItem { get; private set; } public abstract ItemTier itemTier { get; } [AutoConfigRoOString(null, null)] [AutoConfig("The internal name of this item for use in other config entries. No effect if changed; will be reset on game launch.", AutoConfigFlags.None, new object[] { })] public virtual string configNameInternal { get; protected set; } [AutoConfigRoOString(null, null)] [AutoConfig("The name token of this item for use in other config entries. No effect if changed; will be reset on game launch.", AutoConfigFlags.None, new object[] { })] public virtual string configNameToken { get; protected set; } [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, the item will not be given to enemies by Evolution nor in the arena map, and it will not be found by Scavengers.", AutoConfigFlags.None, new object[] { })] public virtual bool itemIsAIBlacklisted { get; protected set; } public virtual ReadOnlyCollection itemTags { get; private set; } public override void SetupConfig() { base.SetupConfig(); base.ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "enabled") { if ((Object)(object)Run.instance != (Object)null && ((Behaviour)Run.instance).enabled) { Run.instance.BuildDropTable(); } } else if (args.target.boundProperty.Name == "itemIsAIBlacklisted") { bool flag = itemDef.tags.Contains((ItemTag)4); if (flag && !itemIsAIBlacklisted) { itemDef.tags = itemDef.tags.Where((ItemTag tag) => (int)tag != 4).ToArray(); } else if (!flag && itemIsAIBlacklisted) { List list = itemDef.tags.ToList(); list.Add((ItemTag)4); itemDef.tags = list.ToArray(); } } }; } public override void SetupAttributes() { //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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown base.SetupAttributes(); List list = new List(itemTags); if (itemIsAIBlacklisted) { list.Add((ItemTag)4); } ItemTag[] array = list.ToArray(); itemDef = ScriptableObject.CreateInstance(); ((Object)itemDef).name = base.modInfo.shortIdentifier + name; itemDef.deprecatedTier = itemTier; itemDef.pickupModelPrefab = base.modelResource; itemDef.pickupIconSprite = base.iconResource; itemDef.nameToken = base.nameToken + "_RENDERED"; itemDef.pickupToken = base.pickupToken + "_RENDERED"; itemDef.descriptionToken = base.descToken + "_RENDERED"; itemDef.loreToken = base.loreToken + "_RENDERED"; itemDef.tags = array; SetupModifyItemDef(); itemTags = Array.AsReadOnly(array); customItem = new CustomItem(itemDef, displayRules); ItemAPI.Add(customItem); ((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)SetupCatalogReady); } public override void SetupCatalogReady() { base.SetupCatalogReady(); ConfigEntryBase configEntry = bindings.Find((AutoConfigBinding x) => x.boundProperty.Name == "configNameInternal").configEntry; configEntry.BoxedValue = ((Object)itemDef).name; if (!configEntry.ConfigFile.SaveOnConfigSet) { configEntry.ConfigFile.Save(); } ConfigEntryBase configEntry2 = bindings.Find((AutoConfigBinding x) => x.boundProperty.Name == "configNameToken").configEntry; configEntry2.BoxedValue = itemDef.nameToken; if (!configEntry2.ConfigFile.SaveOnConfigSet) { configEntry2.ConfigFile.Save(); } } public virtual void SetupModifyItemDef() { } public override void Install() { base.Install(); itemDef.pickupIconSprite = base.iconResource; } public override void Uninstall() { base.Uninstall(); itemDef.pickupIconSprite = CatalogBoilerplateModule.lockIcon; } [Obsolete("Use .GetCountEffective or .GetCountPermanent instead.")] public int GetCount(Inventory inv) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)inv == (Object)null)) { return inv.GetItemCount(catalogIndex); } return 0; } [Obsolete("Use .GetCountEffective or .GetCountPermanent instead.")] public int GetCount(CharacterMaster chrm) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)chrm) || !Object.op_Implicit((Object)(object)chrm.inventory)) { return 0; } return chrm.inventory.GetItemCount(catalogIndex); } [Obsolete("Use .GetCountEffective or .GetCountPermanent instead.")] public int GetCount(CharacterBody body) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCount(catalogIndex); } public int GetCountEffective(Inventory inv) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)inv == (Object)null)) { return inv.GetItemCountEffective(catalogIndex); } return 0; } public int GetCountEffective(CharacterMaster chrm) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)chrm) || !Object.op_Implicit((Object)(object)chrm.inventory)) { return 0; } return chrm.inventory.GetItemCountEffective(catalogIndex); } public int GetCountEffective(CharacterBody body) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCountEffective(catalogIndex); } public int GetCountPermanent(Inventory inv) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)inv == (Object)null)) { return inv.GetItemCountPermanent(catalogIndex); } return 0; } public int GetCountPermanent(CharacterMaster chrm) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)chrm) || !Object.op_Implicit((Object)(object)chrm.inventory)) { return 0; } return chrm.inventory.GetItemCountPermanent(catalogIndex); } public int GetCountPermanent(CharacterBody body) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCountPermanent(catalogIndex); } [Obsolete("Use .GetCountOnDeployablesEffective or .GetCountOnDeployablesPermanent instead.")] public int GetCountOnDeployables(CharacterMaster master) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) if ((Object)(object)master == (Object)null) { return 0; } List deployablesList = master.deployablesList; if (deployablesList == null) { return 0; } int num = 0; foreach (DeployableInfo item in deployablesList) { num += GetCount(((Component)item.deployable).gameObject.GetComponent()); } return num; } public int GetCountOnDeployablesEffective(CharacterMaster master) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) if ((Object)(object)master == (Object)null) { return 0; } List deployablesList = master.deployablesList; if (deployablesList == null) { return 0; } int num = 0; foreach (DeployableInfo item in deployablesList) { num += GetCountEffective(((Component)item.deployable).gameObject.GetComponent()); } return num; } public int GetCountOnDeployablesPermanent(CharacterMaster master) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) if ((Object)(object)master == (Object)null) { return 0; } List deployablesList = master.deployablesList; if (deployablesList == null) { return 0; } int num = 0; foreach (DeployableInfo item in deployablesList) { num += GetCountPermanent(((Component)item.deployable).gameObject.GetComponent()); } return num; } public override ConsoleStrings GetConsoleStrings() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown ConsoleStrings result = default(ConsoleStrings); result.className = "Item"; result.objectName = name; result.formattedIndex = ((int)catalogIndex).ToString(); return result; } } public abstract class Module : Module where T : Module { public static T instance { get; private set; } protected Module() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting Module was instantiated twice"); } instance = this as T; } } public abstract class Module : AutoConfigContainer { public struct ModInfo { public string displayName; public string longIdentifier; public string shortIdentifier; public ConfigFile mainConfigFile; } private static readonly FilingDictionary _allModules = new FilingDictionary(); public static readonly ReadOnlyFilingDictionary allModules = _allModules.AsReadOnly(); public readonly string name; protected readonly List languageOverlays = new List(); protected readonly List permanentLanguageOverlays = new List(); protected readonly Dictionary genericLanguageTokens = new Dictionary(); protected readonly Dictionary> specificLanguageTokens = new Dictionary>(); protected readonly Dictionary permanentGenericLanguageTokens = new Dictionary(); protected readonly Dictionary> permanentSpecificLanguageTokens = new Dictionary>(); public bool enabled { get; protected internal set; } = true; public virtual bool managedEnable => true; public virtual bool managedEnableRoO => true; public virtual string enabledConfigDescription => null; public virtual AutoConfigFlags enabledConfigFlags => AutoConfigFlags.None; public virtual AutoConfigUpdateActionTypes enabledConfigUpdateActionTypes => AutoConfigUpdateActionTypes.InvalidateLanguage; public bool languageInstalled { get; private set; } public bool permanentLanguageInstalled { get; private set; } public Xoroshiro128Plus rng { get; internal set; } public ModInfo modInfo { get; private set; } public virtual string configCategoryPrefix => "Modules."; internal static void SetupModuleClass() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown Run.Start += new hook_Start(On_RunStart); Language.SetCurrentLanguage += new hook_SetCurrentLanguage(Language_SetCurrentLanguage); } private static void On_RunStart(orig_Start orig, Run self) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown orig.Invoke(self); if (!NetworkServer.active) { return; } Xoroshiro128Plus val = new Xoroshiro128Plus(self.seed); foreach (Module allModule in _allModules) { allModule.rng = new Xoroshiro128Plus(val.nextUlong); } } private static void Language_SetCurrentLanguage(orig_SetCurrentLanguage orig, string newCurrentLanguageName) { orig.Invoke(newCurrentLanguageName); foreach (Module allModule in allModules) { allModule.RefreshPermanentLanguage(); if (allModule.enabled) { if (allModule.languageInstalled) { allModule.UninstallLanguage(); } allModule.InstallLanguage(); } } AutoConfigModule.globalLanguageDirty = false; } public virtual void SetupConfig() { string categoryName = configCategoryPrefix + name; if (managedEnable) { Bind(typeof(Module).GetProperty("enabled"), modInfo.mainConfigFile, modInfo.displayName, categoryName, new AutoConfigAttribute(((enabledConfigDescription != null) ? (enabledConfigDescription + "\n") : "") + "Set to False to disable this module, and as much of its content as can be disabled after initial load. Doing so may cause changes in other modules as well.", enabledConfigFlags), (enabledConfigUpdateActionTypes != 0) ? new AutoConfigUpdateActionsAttribute(enabledConfigUpdateActionTypes) : null); if (managedEnableRoO && Compat_RiskOfOptions.enabled) { AutoConfigBinding bind = bindings.First((AutoConfigBinding x) => x.boundProperty == typeof(Module).GetProperty("enabled")); BindRoO(bind, new AutoConfigRoOCheckboxAttribute()); } } BindAll(modInfo.mainConfigFile, modInfo.displayName, categoryName); base.ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "enabled") { if ((bool)args.newValue) { Install(); } else { Uninstall(); if (languageInstalled) { UninstallLanguage(); } } RefreshPermanentLanguage(); } if (args.flags.HasFlag(AutoConfigUpdateActionTypes.InvalidateLanguage)) { if (enabled) { if (languageInstalled) { UninstallLanguage(); } InstallLanguage(); } RefreshPermanentLanguage(); } }; } public virtual void SetupAttributes() { } public virtual void SetupBehavior() { } public virtual void SetupLate() { } public virtual void Install() { } public virtual void Uninstall() { } public virtual void InstallLanguage() { languageOverlays.Add(LanguageAPI.AddOverlay(genericLanguageTokens)); languageOverlays.Add(LanguageAPI.AddOverlay(specificLanguageTokens)); languageInstalled = true; AutoConfigModule.globalLanguageDirty = true; } public virtual void UninstallLanguage() { foreach (LanguageOverlay languageOverlay in languageOverlays) { languageOverlay.Remove(); } languageOverlays.Clear(); languageInstalled = false; AutoConfigModule.globalLanguageDirty = true; } public virtual void RefreshPermanentLanguage() { if (permanentLanguageInstalled) { foreach (LanguageOverlay permanentLanguageOverlay in permanentLanguageOverlays) { permanentLanguageOverlay.Remove(); } } permanentLanguageOverlays.Clear(); permanentLanguageOverlays.Add(LanguageAPI.AddOverlay(permanentGenericLanguageTokens)); permanentLanguageOverlays.Add(LanguageAPI.AddOverlay(permanentSpecificLanguageTokens)); AutoConfigModule.globalLanguageDirty = true; } public static FilingDictionary InitDirect(ModInfo modInfo) where T : Module { return InitAll(modInfo, Assembly.GetCallingAssembly(), delegate(Type t) { if (!t.BaseType.IsGenericType) { return t.BaseType == typeof(T); } return t.BaseType.GenericTypeArguments[0] == t && t.BaseType.BaseType == typeof(T); }); } public static FilingDictionary InitAll(ModInfo modInfo, Func extraTypeChecks = null) where T : Module { return InitAll(modInfo, Assembly.GetCallingAssembly(), extraTypeChecks); } private static FilingDictionary InitAll(ModInfo modInfo, Assembly callingAssembly, Func extraTypeChecks) where T : Module { FilingDictionary filingDictionary = new FilingDictionary(); foreach (Type item in from t in callingAssembly.GetTypes() where t.IsClass && !t.IsAbstract && t.IsSubclassOf(typeof(T)) && (extraTypeChecks?.Invoke(t) ?? true) select t) { T val = (T)Activator.CreateInstance(item, nonPublic: true); val.modInfo = modInfo; filingDictionary.Add(val); } return filingDictionary; } public static FilingDictionary InitModules(ModInfo modInfo) { return InitAll(modInfo, Assembly.GetCallingAssembly(), delegate(Type t) { if (!t.BaseType.IsGenericType) { return t.BaseType == typeof(Module); } return t.BaseType.GenericTypeArguments[0] == t && t.BaseType.BaseType == typeof(Module); }); } public static void SetupAll_PluginAwake(IEnumerable modulesToSetup) { foreach (Module item in modulesToSetup) { item.SetupConfig(); } foreach (Module item2 in modulesToSetup) { item2.SetupAttributes(); } foreach (Module item3 in modulesToSetup) { item3.SetupBehavior(); } } public static void SetupAll_PluginStart(IEnumerable modulesToSetup, bool installUnmanaged = false) { foreach (Module item in modulesToSetup) { item.SetupLate(); } foreach (Module item2 in modulesToSetup) { if ((installUnmanaged || item2.managedEnable) && item2.enabled) { item2.Install(); } } } protected Module() { name = GetType().Name; _allModules.Add(this); } } public static class SkillUtil { public static void GlobalUpdateSkillDef(SkillDef targetDef) { CharacterMaster.readOnlyInstancesList.Where((CharacterMaster x) => x.hasBody && x.GetBody().healthComponent.alive).ToList().ForEach(delegate(CharacterMaster cb) { if (cb.hasBody) { SkillLocator skillLocator = cb.GetBody().skillLocator; if (Object.op_Implicit((Object)(object)skillLocator)) { for (int i = 0; i < skillLocator.skillSlotCount; i++) { GenericSkill skillAtIndex = skillLocator.GetSkillAtIndex(i); if ((Object)(object)skillAtIndex.skillDef == (Object)(object)targetDef) { skillAtIndex.RecalculateValues(); } } } } }); } public static SkillFamily FindSkillFamilyFromBody(string bodyName, int slotIndex) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 //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) BodyIndex val = BodyCatalog.FindBodyIndex(bodyName); if ((int)val == -1) { TinkersSatchelPlugin._logger.LogError((object)("FindSkillFamilyFromBody: Couldn't find body with name " + bodyName)); return null; } GenericSkill[] bodyPrefabSkillSlots = BodyCatalog.GetBodyPrefabSkillSlots(val); if (slotIndex < 0 || slotIndex > bodyPrefabSkillSlots.Length) { TinkersSatchelPlugin._logger.LogError((object)$"FindSkillFamilyFromBody: Skill slot index {slotIndex} is invalid for body with name {bodyName}"); return null; } return BodyCatalog.GetBodyPrefabSkillSlots(val)[slotIndex].skillFamily; } public static SkillFamily FindSkillFamilyFromBody(string bodyName, SkillSlot slot) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_006e: 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) BodyIndex val = BodyCatalog.FindBodyIndex(bodyName); if ((int)val == -1) { TinkersSatchelPlugin._logger.LogError((object)("FindSkillFamilyFromBody: Couldn't find body with name " + bodyName)); return null; } GenericSkill[] bodyPrefabSkillSlots = BodyCatalog.GetBodyPrefabSkillSlots(val); SkillLocator componentInChildren = BodyCatalog.GetBodyPrefab(val).GetComponentInChildren(); if (!Object.op_Implicit((Object)(object)componentInChildren)) { TinkersSatchelPlugin._logger.LogError((object)("FindSkillFamilyFromBody: Body with name " + bodyName + " has no SkillLocator")); return null; } GenericSkill[] array = bodyPrefabSkillSlots; foreach (GenericSkill val2 in array) { if (componentInChildren.FindSkillSlot(val2) == slot) { return val2.skillFamily; } } TinkersSatchelPlugin._logger.LogError((object)$"FindSkillFamilyFromBody: Body with name {bodyName} has no skill in slot {slot}"); return null; } public static void ReplaceVariant(this SkillFamily targetFamily, SkillDef origDef, SkillDef newDef) { int num = Array.FindIndex(targetFamily.variants, (Variant x) => (Object)(object)x.skillDef == (Object)(object)origDef); if (num < 0) { TinkersSatchelPlugin._logger.LogError((object)$"SkillFamily.OverrideVariant: couldn't find target skilldef {origDef} in family {targetFamily}"); } else { targetFamily.variants[num].skillDef = newDef; } } public static void ReplaceVariant(string targetBodyName, int targetSlot, SkillDef origDef, SkillDef newDef) { SkillFamily val = FindSkillFamilyFromBody(targetBodyName, targetSlot); if ((Object)(object)val != (Object)null) { val.ReplaceVariant(origDef, newDef); } else { TinkersSatchelPlugin._logger.LogError((object)"Failed to OverrideVariant for bodyname+slot (target not found)"); } } public static void ReplaceVariant(string targetBodyName, SkillSlot targetSlot, SkillDef origDef, SkillDef newDef) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) SkillFamily val = FindSkillFamilyFromBody(targetBodyName, targetSlot); if ((Object)(object)val != (Object)null) { val.ReplaceVariant(origDef, newDef); } else { TinkersSatchelPlugin._logger.LogError((object)"Failed to OverrideVariant for bodyname+slotname (target not found)"); } } public static void AddVariant(this SkillFamily targetFamily, SkillDef newDef, UnlockableDef unlockableDef = null) { //IL_0022: 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_004c: 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) Array.Resize(ref targetFamily.variants, targetFamily.variants.Length + 1); Variant[] variants = targetFamily.variants; int num = variants.Length - 1; Variant val = new Variant { skillDef = newDef }; ((Variant)(ref val)).viewableNode = new Node(newDef.skillNameToken, false, (Node)null); val.unlockableDef = unlockableDef; variants[num] = val; } public static void AddVariant(string targetBodyName, int targetSlot, SkillDef newDef, UnlockableDef unlockableDef = null) { SkillFamily val = FindSkillFamilyFromBody(targetBodyName, targetSlot); if ((Object)(object)val != (Object)null) { val.AddVariant(newDef, unlockableDef); } else { TinkersSatchelPlugin._logger.LogError((object)"Failed to AddVariant for bodyname+slot (target not found)"); } } public static void AddVariant(string targetBodyName, SkillSlot targetSlot, SkillDef newDef, UnlockableDef unlockableDef = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) SkillFamily val = FindSkillFamilyFromBody(targetBodyName, targetSlot); if ((Object)(object)val != (Object)null) { val.AddVariant(newDef, unlockableDef); } else { TinkersSatchelPlugin._logger.LogError((object)"Failed to AddVariant for bodyname+slotname (target not found)"); } } public static void RemoveVariant(this SkillFamily targetFamily, SkillDef targetDef) { List list = new List(targetFamily.variants); int count = list.Count; list.RemoveAll((Variant x) => (Object)(object)x.skillDef == (Object)(object)targetDef); if (list.Count - count == 0) { TinkersSatchelPlugin._logger.LogError((object)$"SkillFamily.RemoveVariant: Couldn't find SkillDef {targetDef} for removal from SkillFamily {targetFamily}"); } targetFamily.variants = list.ToArray(); } public static void RemoveVariant(string targetBodyName, int targetSlot, SkillDef targetDef) { SkillFamily val = FindSkillFamilyFromBody(targetBodyName, targetSlot); if ((Object)(object)val != (Object)null) { val.RemoveVariant(targetDef); } else { TinkersSatchelPlugin._logger.LogError((object)"Failed to RemoveVariant for bodyname+slot (target not found)"); } } public static void RemoveVariant(string targetBodyName, SkillSlot targetSlot, SkillDef targetDef) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) SkillFamily val = FindSkillFamilyFromBody(targetBodyName, targetSlot); if ((Object)(object)val != (Object)null) { val.RemoveVariant(targetDef); } else { TinkersSatchelPlugin._logger.LogError((object)"Failed to RemoveVariant for bodyname+slotname (target not found)"); } } public static SkillDef CloneSkillDef(SkillDef oldDef) { //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_004f: 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) SkillDef obj = ScriptableObject.CreateInstance(); obj.skillName = oldDef.skillName; obj.skillNameToken = oldDef.skillNameToken; obj.skillDescriptionToken = oldDef.skillDescriptionToken; obj.icon = oldDef.icon; obj.activationStateMachineName = oldDef.activationStateMachineName; obj.activationState = oldDef.activationState; obj.interruptPriority = oldDef.interruptPriority; obj.baseRechargeInterval = oldDef.baseRechargeInterval; obj.baseMaxStock = oldDef.baseMaxStock; obj.rechargeStock = oldDef.rechargeStock; obj.requiredStock = oldDef.requiredStock; obj.stockToConsume = oldDef.stockToConsume; obj.beginSkillCooldownOnSkillEnd = oldDef.beginSkillCooldownOnSkillEnd; obj.fullRestockOnAssign = oldDef.fullRestockOnAssign; obj.dontAllowPastMaxStocks = oldDef.dontAllowPastMaxStocks; obj.canceledFromSprinting = oldDef.canceledFromSprinting; obj.isCombatSkill = oldDef.isCombatSkill; obj.resetCooldownTimerOnUse = oldDef.resetCooldownTimerOnUse; obj.cancelSprintingOnActivation = oldDef.cancelSprintingOnActivation; obj.canceledFromSprinting = oldDef.canceledFromSprinting; obj.forceSprintDuringState = oldDef.forceSprintDuringState; obj.mustKeyPress = oldDef.mustKeyPress; obj.keywordTokens = oldDef.keywordTokens; return obj; } } public class TauntDebuffModule : Module { public static BuffDef tauntDebuff; public override bool managedEnable => false; public override void SetupAttributes() { //IL_0015: 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_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_0071: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); tauntDebuff = ScriptableObject.CreateInstance(); tauntDebuff.buffColor = Color.white; tauntDebuff.canStack = false; tauntDebuff.isDebuff = true; ((Object)tauntDebuff).name = "TKSATTaunt"; tauntDebuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/MiscIcons/texAttackIcon.png").WaitForCompletion(); tauntDebuff.ignoreGrowthNectar = true; tauntDebuff.flags = (Flags)1; ContentAddition.AddBuffDef(tauntDebuff); } public override void SetupBehavior() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.SetupBehavior(); Util.CleanseBody += new hook_CleanseBody(Util_CleanseBody); BaseAI.FindEnemyHurtBox += new hook_FindEnemyHurtBox(BaseAI_FindEnemyHurtBox); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } private void Util_CleanseBody(orig_CleanseBody orig, CharacterBody characterBody, bool removeDebuffs, bool removeBuffs, bool removeCooldownBuffs, bool removeDots, bool removeStun, bool removeNearbyProjectiles) { orig.Invoke(characterBody, removeDebuffs, removeBuffs, removeCooldownBuffs, removeDots, removeStun, removeNearbyProjectiles); if (!removeDebuffs || !Object.op_Implicit((Object)(object)characterBody)) { return; } ServerTimedSkillDisable serverTimedSkillDisable = default(ServerTimedSkillDisable); if (((Component)characterBody).TryGetComponent(ref serverTimedSkillDisable)) { serverTimedSkillDisable.ServerCleanse(); } if (!Object.op_Implicit((Object)(object)characterBody.master)) { return; } BaseAI[] aiComponents = characterBody.master.aiComponents; TauntDebuffController tauntDebuffController = default(TauntDebuffController); foreach (BaseAI val in aiComponents) { if (Object.op_Implicit((Object)(object)val) && ((Behaviour)val).isActiveAndEnabled && ((Component)val).TryGetComponent(ref tauntDebuffController)) { tauntDebuffController.Cleanse(); } } } private HurtBox BaseAI_FindEnemyHurtBox(orig_FindEnemyHurtBox orig, BaseAI self, float maxDistance, bool full360Vision, bool filterByLoS) { HurtBox result = orig.Invoke(self, maxDistance, full360Vision, filterByLoS); TauntDebuffController tauntDebuffController = default(TauntDebuffController); if (Object.op_Implicit((Object)(object)self) && ((Component)self).TryGetComponent(ref tauntDebuffController) && tauntDebuffController.isTaunted) { HashSet taunters = tauntDebuffController.GetTaunters(); HurtBox val = (from x in self.enemySearch.GetResults() where Object.op_Implicit((Object)(object)x) && Object.op_Implicit((Object)(object)x.healthComponent) && taunters.Contains(x.healthComponent.body) select x).FirstOrDefault(); if ((Object)(object)val == (Object)null) { return result; } return val; } return result; } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { CharacterBody val = default(CharacterBody); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && damageInfo != null && Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.master)) { bool flag = true; bool flag2 = false; BaseAI[] aiComponents = val.master.aiComponents; TauntDebuffController tauntDebuffController = default(TauntDebuffController); foreach (BaseAI val2 in aiComponents) { if (Object.op_Implicit((Object)(object)val2) && ((Behaviour)val2).isActiveAndEnabled && ((Component)val2).TryGetComponent(ref tauntDebuffController) && tauntDebuffController.isTaunted) { flag2 = true; flag &= tauntDebuffController.ShouldApplyTauntPenalty(self.body); } } if (flag && flag2) { damageInfo.damage *= 0.5f; } } orig.Invoke(self, damageInfo); } } [RequireComponent(typeof(BaseAI))] public class TauntDebuffController : MonoBehaviour { private BaseAI ai; private readonly Dictionary tauntTimers = new Dictionary(); public bool isTaunted => tauntTimers.Count > 0; public HashSet GetTaunters() { return new HashSet(tauntTimers.Keys); } private void Awake() { ai = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_012c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)ai)) { return; } List list = tauntTimers.Keys.ToList(); bool flag = isTaunted; foreach (CharacterBody item in list) { if (!Object.op_Implicit((Object)(object)item)) { tauntTimers.Remove(item); continue; } tauntTimers[item] -= Time.fixedDeltaTime; if (tauntTimers[item] <= 0f) { tauntTimers.Remove(item); } } if (isTaunted) { if (Object.op_Implicit((Object)(object)ai.currentEnemy.gameObject) && !tauntTimers.ContainsKey(ai.currentEnemy.gameObject.GetComponent())) { ai.currentEnemy.Reset(); } } else if (flag) { ai.currentEnemy.Reset(); if (Object.op_Implicit((Object)(object)ai.body)) { ai.body.SetBuffCount(TauntDebuffModule.tauntDebuff.buffIndex, 0); } } } public static void ApplyTaunt(BaseAI to, CharacterBody from, float duration) { if (Object.op_Implicit((Object)(object)to)) { TauntDebuffController tauntDebuffController = default(TauntDebuffController); if (!((Component)to).TryGetComponent(ref tauntDebuffController)) { tauntDebuffController = ((Component)to).gameObject.AddComponent(); } tauntDebuffController.ApplyTaunt(from, duration); } } public void ApplyTaunt(CharacterBody from, float duration) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!tauntTimers.ContainsKey(from) || tauntTimers[from] < duration) { tauntTimers[from] = duration; } if (Object.op_Implicit((Object)(object)ai.body) && isTaunted) { ai.body.SetBuffCount(TauntDebuffModule.tauntDebuff.buffIndex, 1); } } public void Cleanse() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) bool num = isTaunted; tauntTimers.Clear(); if (num) { ai.currentEnemy.Reset(); if (Object.op_Implicit((Object)(object)ai.body)) { ai.body.SetBuffCount(TauntDebuffModule.tauntDebuff.buffIndex, 0); } } } public bool ShouldApplyTauntPenalty(CharacterBody target) { if (tauntTimers.Count > 0) { return !tauntTimers.ContainsKey(target); } return false; } } public class TimedSkillDisableModule : Module { public static SkillDef disabledSkillDef; public override bool managedEnable => false; public override void SetupAttributes() { base.SetupAttributes(); disabledSkillDef = SkillUtil.CloneSkillDef(LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CaptainSkillUsedUp")); disabledSkillDef.skillNameToken = "TKSAT_DISABLED_SKILL_NAME"; disabledSkillDef.skillDescriptionToken = "TKSAT_DISABLED_SKILL_DESCRIPTION"; disabledSkillDef.dontAllowPastMaxStocks = false; disabledSkillDef.beginSkillCooldownOnSkillEnd = true; ContentAddition.AddSkillDef(disabledSkillDef); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); } } [RequireComponent(typeof(CharacterBody))] public class ServerTimedSkillDisable : MonoBehaviour { public struct MsgApply : INetMessage, ISerializableObject { private SkillSlot _slot; private CharacterBody _target; public MsgApply(SkillSlot slot, CharacterBody target) { //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) _slot = slot; _target = target; } public void Deserialize(NetworkReader reader) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _slot = (SkillSlot)reader.ReadSByte(); GameObject val = reader.ReadGameObject(); if (Object.op_Implicit((Object)(object)val)) { _target = val.GetComponent(); } } public readonly void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected I4, but got Unknown writer.Write((sbyte)(int)_slot); writer.Write(((Component)_target).gameObject); } public readonly void OnReceived() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)_target)) { TinkersSatchelPlugin._logger.LogWarning((object)"Received ServerTimedSkillDisable.MsgApply for nonexistent game object on client"); return; } GenericSkill skill = _target.skillLocator.GetSkill(_slot); if (Object.op_Implicit((Object)(object)skill)) { skill.SetSkillOverride((object)((Component)_target).gameObject, TimedSkillDisableModule.disabledSkillDef, (SkillOverridePriority)5); if (Object.op_Implicit((Object)(object)skill.stateMachine)) { skill.stateMachine.SetInterruptState((EntityState)new Idle(), (InterruptPriority)0); skill.stateMachine.SetNextStateToMain(); } } } } public struct MsgRemove : INetMessage, ISerializableObject { private SkillSlot _slot; private CharacterBody _target; private float _cooldown; private int _stock; public MsgRemove(SkillSlot slot, CharacterBody target, float cooldown, int stock) { //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) _slot = slot; _target = target; _cooldown = cooldown; _stock = stock; } public void Deserialize(NetworkReader reader) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _slot = (SkillSlot)reader.ReadSByte(); GameObject val = reader.ReadGameObject(); if (Object.op_Implicit((Object)(object)val)) { _target = val.GetComponent(); } _cooldown = reader.ReadSingle(); _stock = reader.ReadInt32(); } public readonly void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected I4, but got Unknown writer.Write((sbyte)(int)_slot); writer.Write(((Component)_target).gameObject); writer.Write(_cooldown); writer.Write(_stock); } public readonly void OnReceived() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_target)) { TinkersSatchelPlugin._logger.LogWarning((object)"Received ServerTimedSkillDisable.MsgRemove for nonexistent game object on client"); return; } GenericSkill skill = _target.skillLocator.GetSkill(_slot); if (Object.op_Implicit((Object)(object)skill)) { skill.UnsetSkillOverride((object)((Component)_target).gameObject, TimedSkillDisableModule.disabledSkillDef, (SkillOverridePriority)5); skill.rechargeStopwatch = _cooldown; skill.stock = _stock; } } } private readonly List primaryDisablers = new List(); private readonly List secondaryDisablers = new List(); private readonly List utilityDisablers = new List(); private readonly List specialDisablers = new List(); private float cachedPrimaryCooldown; private float cachedSecondaryCooldown; private float cachedUtilityCooldown; private float cachedSpecialCooldown; private int cachedPrimaryStock; private int cachedSecondaryStock; private int cachedUtilityStock; private int cachedSpecialStock; private CharacterBody body; private void Awake() { body = ((Component)this).GetComponent(); } private void OnDestroy() { ServerCleanse(); } public void ServerApply(float time, SkillSlot slot) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected I4, but got Unknown //IL_020b: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } switch ((int)slot) { default: return; case 0: if (primaryDisablers.Count == 0 && Object.op_Implicit((Object)(object)body.skillLocator) && Object.op_Implicit((Object)(object)body.skillLocator.primary)) { cachedPrimaryCooldown = body.skillLocator.primary.rechargeStopwatch; cachedPrimaryStock = body.skillLocator.primary.stock; } primaryDisablers.Add(time); break; case 1: if (secondaryDisablers.Count == 0 && Object.op_Implicit((Object)(object)body.skillLocator) && Object.op_Implicit((Object)(object)body.skillLocator.secondary)) { cachedSecondaryCooldown = body.skillLocator.secondary.rechargeStopwatch; cachedSecondaryStock = body.skillLocator.secondary.stock; } secondaryDisablers.Add(time); break; case 2: if (utilityDisablers.Count == 0 && Object.op_Implicit((Object)(object)body.skillLocator) && Object.op_Implicit((Object)(object)body.skillLocator.utility)) { cachedUtilityCooldown = body.skillLocator.utility.rechargeStopwatch; cachedUtilityStock = body.skillLocator.utility.stock; } utilityDisablers.Add(time); break; case 3: if (specialDisablers.Count == 0 && Object.op_Implicit((Object)(object)body.skillLocator) && Object.op_Implicit((Object)(object)body.skillLocator.special)) { cachedSpecialCooldown = body.skillLocator.special.rechargeStopwatch; cachedSpecialStock = body.skillLocator.special.stock; } specialDisablers.Add(time); break; } NetMessageExtensions.Send((INetMessage)(object)new MsgApply(slot, body), (NetworkDestination)1); } public void ServerCleanse() { if (primaryDisablers.Count > 0) { NetMessageExtensions.Send((INetMessage)(object)new MsgRemove((SkillSlot)0, body, cachedPrimaryCooldown, cachedPrimaryStock), (NetworkDestination)1); } if (secondaryDisablers.Count > 0) { NetMessageExtensions.Send((INetMessage)(object)new MsgRemove((SkillSlot)1, body, cachedSecondaryCooldown, cachedSecondaryStock), (NetworkDestination)1); } if (utilityDisablers.Count > 0) { NetMessageExtensions.Send((INetMessage)(object)new MsgRemove((SkillSlot)2, body, cachedUtilityCooldown, cachedUtilityStock), (NetworkDestination)1); } if (specialDisablers.Count > 0) { NetMessageExtensions.Send((INetMessage)(object)new MsgRemove((SkillSlot)3, body, cachedSpecialCooldown, cachedSpecialStock), (NetworkDestination)1); } primaryDisablers.Clear(); secondaryDisablers.Clear(); utilityDisablers.Clear(); specialDisablers.Clear(); } private void FixedUpdate() { if (NetworkServer.active) { bool flag = primaryDisablers.Count > 0; bool flag2 = secondaryDisablers.Count > 0; bool flag3 = utilityDisablers.Count > 0; bool flag4 = specialDisablers.Count > 0; for (int i = 0; i < primaryDisablers.Count; i++) { primaryDisablers[i] -= Time.fixedDeltaTime; } for (int j = 0; j < secondaryDisablers.Count; j++) { secondaryDisablers[j] -= Time.fixedDeltaTime; } for (int k = 0; k < utilityDisablers.Count; k++) { utilityDisablers[k] -= Time.fixedDeltaTime; } for (int l = 0; l < specialDisablers.Count; l++) { specialDisablers[l] -= Time.fixedDeltaTime; } primaryDisablers.RemoveAll((float x) => x <= 0f); secondaryDisablers.RemoveAll((float x) => x <= 0f); utilityDisablers.RemoveAll((float x) => x <= 0f); specialDisablers.RemoveAll((float x) => x <= 0f); bool flag5 = primaryDisablers.Count > 0; bool flag6 = secondaryDisablers.Count > 0; bool flag7 = utilityDisablers.Count > 0; bool flag8 = specialDisablers.Count > 0; if (flag && !flag5) { NetMessageExtensions.Send((INetMessage)(object)new MsgRemove((SkillSlot)0, body, cachedPrimaryCooldown, cachedPrimaryStock), (NetworkDestination)1); } if (flag2 && !flag6) { NetMessageExtensions.Send((INetMessage)(object)new MsgRemove((SkillSlot)1, body, cachedSecondaryCooldown, cachedSecondaryStock), (NetworkDestination)1); } if (flag3 && !flag7) { NetMessageExtensions.Send((INetMessage)(object)new MsgRemove((SkillSlot)2, body, cachedUtilityCooldown, cachedUtilityStock), (NetworkDestination)1); } if (flag4 && !flag8) { NetMessageExtensions.Send((INetMessage)(object)new MsgRemove((SkillSlot)3, body, cachedSpecialCooldown, cachedSpecialStock), (NetworkDestination)1); } } } } public class WobbleSpinnerAnim : MonoBehaviour { public float rotateSpeed = 0.5f; public float wobbleBaseMin = -0.2f; public float wobbleBaseMax = 0.2f; public float wobbleEccentricity = 0.15f; public float wobbleStability = 2f; public Vector3 rotateAxis; private void Update() { //IL_000c: 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) //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_00a4: 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_00a6: 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) //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) ((Component)this).gameObject.transform.Rotate(rotateAxis, rotateSpeed); Vector3 val = Vector3.one * Random.Range(wobbleBaseMin, wobbleBaseMax); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(Random.Range((0f - wobbleEccentricity) / 2f, wobbleEccentricity / 2f), Random.Range((0f - wobbleEccentricity) / 2f, wobbleEccentricity / 2f), Random.Range((0f - wobbleEccentricity) / 2f, wobbleEccentricity / 2f)); ((Component)this).gameObject.transform.localScale = (val + val2) * (1f / wobbleStability) + Vector3.one; } } internal static class Compat_AncientScepter { private static bool? _enabled; internal static bool enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static bool RegisterScepterSkill(SkillDef replacingDef, string targetBodyName, SkillDef targetVariantDef) { return ItemBase.instance.RegisterScepterSkill(replacingDef, targetBodyName, targetVariantDef); } } internal static class Compat_Dronemeld { private static bool? _enabled; internal static bool enabled { get { if (!_enabled.HasValue) { if (Chainloader.PluginInfos.TryGetValue("com.ThinkInvisible.Dronemeld", out var value)) { bool flag = value.Metadata.Version >= new Version(1, 3, 0); _enabled = flag; if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"Dronemeld is installed, but has an older version than supported. Install Dronemeld 1.3.0 or later to enable compatibility for Item Drone/Bulwark Drone."); } } else { _enabled = false; } } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static int SafeGetStackCount(Inventory inv) { if (!enabled) { return 0; } return GetStackCount(inv); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static int GetStackCount(Inventory inv) { return inv.GetItemCountEffective(DronemeldPlugin.stackItem); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static CharacterMaster TryApply(CharacterMaster ownerMaster, string targetPrefabName) { return DronemeldPlugin.TryApply(ownerMaster, targetPrefabName); } } public static class Compat_RiskOfOptions { public struct OptionIdentityStrings { public string category; public string name; public string description; public string modName; public string modGuid; } private static bool? _enabled; public static bool enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void SetupMod(string modGuid, string modName, string description, Sprite icon = null) { ModSettingsManager.SetModDescription(description, modGuid, modName); if ((Object)(object)icon != (Object)null) { ModSettingsManager.SetModIcon(icon, modGuid, modName); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddOption_CheckBox(ConfigEntry configEntry, OptionIdentityStrings ident, bool restartRequired, Func isDisabledDelegate) { //IL_000e: 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_001f: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0050: Expected O, but got Unknown //IL_0055: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(configEntry, new CheckBoxConfig { category = ident.category, name = ident.name, restartRequired = restartRequired, description = ident.description, checkIfDisabled = (IsDisabledDelegate)(() => isDisabledDelegate()) }), ident.modGuid, ident.modName); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddOption_Slider(ConfigEntry configEntry, OptionIdentityStrings ident, float min, float max, string formatString, bool restartRequired, Func isDisabledDelegate) { //IL_000f: 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_0020: 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_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_0042: 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_0056: 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_0068: Expected O, but got Unknown //IL_006d: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new SliderOption(configEntry, new SliderConfig { category = ident.category, name = ident.name, max = max, min = min, formatString = formatString, restartRequired = restartRequired, description = ident.description, checkIfDisabled = (IsDisabledDelegate)(() => isDisabledDelegate()) }), ident.modGuid, ident.modName); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddOption_IntSlider(ConfigEntry configEntry, OptionIdentityStrings ident, int min, int max, string formatString, bool restartRequired, Func isDisabledDelegate) { //IL_000f: 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_0020: 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_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_0042: 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_0056: 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_0068: Expected O, but got Unknown //IL_006d: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new IntSliderOption(configEntry, new IntSliderConfig { category = ident.category, name = ident.name, max = max, min = min, formatString = formatString, restartRequired = restartRequired, description = ident.description, checkIfDisabled = (IsDisabledDelegate)(() => isDisabledDelegate()) }), ident.modGuid, ident.modName); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddOption_Choice(ConfigEntryBase configEntry, OptionIdentityStrings ident, bool restartRequired, Func isDisabledDelegate) { //IL_000e: 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_001f: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0050: Expected O, but got Unknown //IL_0055: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new ChoiceOption(configEntry, new ChoiceConfig { category = ident.category, name = ident.name, restartRequired = restartRequired, description = ident.description, checkIfDisabled = (IsDisabledDelegate)(() => isDisabledDelegate()) }), ident.modGuid, ident.modName); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddOption_Keybind(ConfigEntry configEntry, OptionIdentityStrings ident, bool restartRequired, Func isDisabledDelegate) { //IL_000e: 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_001f: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0050: Expected O, but got Unknown //IL_0055: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new KeyBindOption(configEntry, new KeyBindConfig { category = ident.category, name = ident.name, restartRequired = restartRequired, description = ident.description, checkIfDisabled = (IsDisabledDelegate)(() => isDisabledDelegate()) }), ident.modGuid, ident.modName); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddOption_String(ConfigEntry configEntry, OptionIdentityStrings ident, bool restartRequired, Func isDisabledDelegate) { //IL_000e: 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_001f: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0050: Expected O, but got Unknown //IL_0055: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(configEntry, new InputFieldConfig { category = ident.category, name = ident.name, restartRequired = restartRequired, description = ident.description, checkIfDisabled = (IsDisabledDelegate)(() => isDisabledDelegate()) }), ident.modGuid, ident.modName); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddOption_StepSlider(ConfigEntry configEntry, OptionIdentityStrings ident, float min, float max, float step, string formatString, bool restartRequired, Func isDisabledDelegate) { //IL_000f: 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_0020: 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_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_0042: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0075: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new StepSliderOption(configEntry, new StepSliderConfig { category = ident.category, name = ident.name, min = min, max = max, formatString = formatString, increment = step, restartRequired = restartRequired, description = ident.description, checkIfDisabled = (IsDisabledDelegate)(() => isDisabledDelegate()) }), ident.modGuid, ident.modName); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddOption_Button(OptionIdentityStrings ident, string text, UnityAction del) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new GenericButtonOption(ident.name, ident.category, ident.description, text, del), ident.modGuid, ident.modName); } } public class ConfigPresets : Module { public override bool managedEnable => false; private void SetEnabled(IEnumerable modules, bool enab) { HashSet hashSet = new HashSet(); foreach (Module module in modules) { AutoConfigBinding autoConfigBinding = module.FindConfig("enabled"); autoConfigBinding.configEntry.BoxedValue = enab; if (!autoConfigBinding.configEntry.ConfigFile.SaveOnConfigSet) { hashSet.Add(autoConfigBinding.configEntry.ConfigFile); } } foreach (ConfigFile item in hashSet) { item.Save(); } } public override void SetupConfig() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Expected O, but got Unknown //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Expected O, but got Unknown //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Expected O, but got Unknown //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Expected O, but got Unknown //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Expected O, but got Unknown //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Expected O, but got Unknown base.SetupConfig(); if (!Compat_RiskOfOptions.enabled) { return; } Compat_RiskOfOptions.OptionIdentityStrings ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Enable..."; ident.name = "Items"; ident.description = "Enable All Items"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(Module.allModules.Where((Module m) => m is Item), enab: true); }); ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Disable..."; ident.name = "Items"; ident.description = "Disable All Items"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(Module.allModules.Where((Module m) => m is Item), enab: false); }); ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Enable..."; ident.name = "Equipment"; ident.description = "Enable All Equipment"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(Module.allModules.Where((Module m) => m is Equipment), enab: true); }); ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Disable..."; ident.name = "Equipment"; ident.description = "Disable All Equipment"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(Module.allModules.Where((Module m) => m is Equipment), enab: false); }); ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Enable..."; ident.name = "Artifacts"; ident.description = "Enable All Artifacts"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(Module.allModules.Where((Module m) => m is Artifact), enab: true); }); ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Disable..."; ident.name = "Artifacts"; ident.description = "Disable All Artifacts"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(Module.allModules.Where((Module m) => m is Artifact), enab: false); }); HashSet allSkills = new HashSet { Module.instance, Module.instance, Module.instance, Module.instance, Module.instance, Module.instance }; ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Enable..."; ident.name = "Skills"; ident.description = "Enable All Skills"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(allSkills, enab: true); }); ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Disable..."; ident.name = "Skills"; ident.description = "Disable All Skills"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(allSkills, enab: false); }); HashSet allDrones = new HashSet { Module.instance }; ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Enable..."; ident.name = "Drones"; ident.description = "Enable All Drones"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(allDrones, enab: true); }); ident = default(Compat_RiskOfOptions.OptionIdentityStrings); ident.category = "Disable..."; ident.name = "Drones"; ident.description = "Disable All Drones"; ident.modGuid = "com.ThinkInvisible.TinkersSatchelPresets"; ident.modName = "TinkersSatchelPresets"; Compat_RiskOfOptions.AddOption_Button(ident, "Set", (UnityAction)delegate { SetEnabled(allDrones, enab: false); }); } } public class Dodge : Equipment { public override bool isLunar => false; public override bool canBeRandomlyTriggered { get; protected set; } = true; public override float cooldown { get; protected set; } = 10f; [AutoConfigRoOSlider("{0:N1} m/s", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Instant speed to add on equipment activation.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float evadeBurstSpeed { get; private set; } = 55f; [AutoConfigRoOSlider("{0:N1} m/s", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Instant speed to add on equipment activation.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float evadeBurstSpeedGrounded { get; private set; } = 80f; [AutoConfigRoOSlider("{0:N1} s", 0f, 10f, null, null)] [AutoConfig("Duration of the invulnerability effect.", AutoConfigFlags.DeferForever, new object[] { 0f, float.MaxValue })] public float invulnTime { get; private set; } = 1f; [AutoConfigRoOSlider("{0:N1} s", 0f, 10f, null, null)] [AutoConfig("Minimum cooldown between equipment activations.", AutoConfigFlags.DeferForever, new object[] { 0f, float.MaxValue })] public float icd { get; private set; } = 1.5f; protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { evadeBurstSpeed.ToString("N0"), evadeBurstSpeedGrounded.ToString("N0"), invulnTime.ToString("N1") }; } public Dodge() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Dodge.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/dodgeIcon.png"); } public override void SetupModifyEquipmentDef() { base.SetupModifyEquipmentDef(); } public override void SetupAttributes() { base.SetupAttributes(); } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //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_0088: 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_0099: 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_0062: 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_0079: 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_00bf: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)slot.characterBody)) { return false; } if (Object.op_Implicit((Object)(object)slot.characterBody.characterMotor) && Object.op_Implicit((Object)(object)slot.characterBody.characterDirection)) { Vector3 val = slot.characterBody.characterDirection.forward; if (Object.op_Implicit((Object)(object)slot.inputBank) && slot.inputBank.moveVector != Vector3.zero) { val = slot.inputBank.moveVector; } val.y = 0f; val = ((Vector3)(ref val)).normalized; slot.characterBody.characterMotor.velocity = val * (slot.characterBody.characterMotor.isGrounded ? evadeBurstSpeedGrounded : evadeBurstSpeed); } slot.characterBody.RemoveBuff(Buffs.HiddenInvincibility); slot.characterBody.AddTimedBuff(Buffs.HiddenInvincibility, invulnTime); return true; } } public class Lodestone : Equipment { private GameObject blackHolePrefab; private const float PULL_FORCE = 60f; internal static UnlockableDef unlockable; public override bool isLunar => false; public override bool canBeRandomlyTriggered { get; protected set; } = true; public override float cooldown { get; protected set; } = 20f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Fraction of base damage to inflict.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float baseDamageFrac { get; private set; } = 2f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of the equipment attack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 1f; [AutoConfigRoOSlider("{0:N0} m", 0f, 1000f, null, null)] [AutoConfig("Range for pulling enemies.", AutoConfigFlags.DeferForever, new object[] { 0f, float.MaxValue })] public float enemyRange { get; private set; } = 40f; [AutoConfigRoOSlider("{0:N0} m", 0f, 1000f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Range for pulling other objects.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float objectRange { get; private set; } = 150f; public HashSet validObjectNamesRB { get; private set; } = new HashSet(); public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { enemyRange.ToString("N0"), baseDamageFrac.ToString("0%"), objectRange.ToString("N0") }; } public Lodestone() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Lodestone.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/lodestoneIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Lodestone.prefab"); } public override void SetupModifyEquipmentDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Expected O, but got Unknown //IL_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyEquipmentDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.22045f, -0.06626f, 0.11193f), localAngles = new Vector3(359.0299f, 357.3219f, 25.2928f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.38728f, 0.00965f, -0.06446f), localAngles = new Vector3(31.87035f, 332.9695f, 3.18838f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.23353f, -0.00868f, -0.08696f), localAngles = new Vector3(27.00084f, 326.5775f, 4.93487f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.6739f, -1.47899f, 1.63122f), localAngles = new Vector3(354.4511f, 7.12517f, 355.0916f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.24835f, 0.13692f, 0.12219f), localAngles = new Vector3(19.74273f, 338.7649f, 343.2596f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { childName = "Stomach", localPos = new Vector3(0.17437f, -0.01902f, 0.11239f), localAngles = new Vector3(14.62809f, 338.0782f, 18.2589f), localScale = new Vector3(0.3f, 0.3f, 0.3f), ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.28481f, -0.22564f, -0.12889f), localAngles = new Vector3(0.98176f, 51.91312f, 23.00177f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.16876f, -0.10376f, 0.02998f), localAngles = new Vector3(357.5521f, 355.006f, 105.9485f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ThighR", localPos = new Vector3(-0.08794f, 0.03176f, -0.06409f), localAngles = new Vector3(350.6662f, 317.2625f, 21.97947f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(2.33895f, -0.34548f, 0.80107f), localAngles = new Vector3(311.4177f, 7.89006f, 354.1869f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.75783f, -0.10773f, 0.00385f), localAngles = new Vector3(308.2326f, 10.8672f, 329.0782f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.28636f, -0.3815f, -0.06912f), localAngles = new Vector3(352.4358f, 63.85439f, 6.83272f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.17554f, -0.13447f, -0.0436f), localAngles = new Vector3(15.08189f, 9.51543f, 15.89409f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { //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) base.SetupAttributes(); GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/GravSphere"), "temporary setup prefab", false); ProjectileSimple component = val.GetComponent(); component.desiredForwardSpeed = 0f; component.lifetime = 0.5f; val.GetComponent().procCoefficient = 0f; ProjectileDamage component2 = ((Component)component).GetComponent(); component2.damage = 0f; ((Behaviour)component2).enabled = false; ((Behaviour)val.GetComponent()).enabled = false; ((Component)val.transform.Find("Sphere")).gameObject.SetActive(false); ShapeModule shape = ((Component)val.transform.Find("Sparks")).GetComponent().shape; ((ShapeModule)(ref shape)).radius = 30f; blackHolePrefab = PrefabAPI.InstantiateClone(val, "LodestoneProcPrefab", true); Object.Destroy((Object)(object)val); ContentAddition.AddProjectile(blackHolePrefab); validObjectNamesRB.UnionWith(new string[15] { "HealPack(Clone)", "StickyBomb(Clone)", "TkSatPixieMovePack(Clone)", "TkSatPixieAttackPack(Clone)", "TkSatPixieDamagePack(Clone)", "TkDatPixieArmorPack(Clone)", "AmmoPack(Clone)", "BonusMoneyPack(Clone)", "ShurikenProjectile(Clone)", "FireMeatBall(Clone)", "DeathProjectile(Clone)", "BeamSphere(Clone)", "GravSphere(Clone)", "Sawmerang(Clone)", "LunarSunProjectile(Clone)" }); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/lodestoneIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.equipmentDef.unlockableDef = unlockable; } public override void Install() { base.Install(); } public override void Uninstall() { base.Uninstall(); } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //IL_0020: 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) if (!Object.op_Implicit((Object)(object)slot.characterBody)) { return false; } ProjectileManager.instance.FireProjectile(blackHolePrefab, slot.characterBody.corePosition, Quaternion.identity, ((Component)slot.characterBody).gameObject, 0f, 0f, false, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); PullEnemies(slot); PullObjects(slot); return true; } private void PullObjects(EquipmentSlot slot) { //IL_002b: 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_0141: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01bb: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_0197: 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_019f: 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_0206: Unknown result type (might be due to invalid IL or missing references) float range = objectRange; IEnumerable enumerable = from x in Physics.OverlapSphere(slot.characterBody.corePosition, range, -1, (QueryTriggerInteraction)2) select ((Component)x).gameObject into x where validObjectNamesRB.Contains(((Object)x).name) select x.GetComponent() into x where Object.op_Implicit((Object)(object)x) select x; IEnumerable enumerable2 = from x in MiscObjectTrackerModule.readOnlyWarbanners.Union(MiscObjectTrackerModule.readOnlyCrippleWards).Union(MiscObjectTrackerModule.readOnlyDeskplants).Union(MiscObjectTrackerModule.readOnlyRandomDamageZones) where Vector3.Distance(x.transform.position, slot.characterBody.corePosition) < range select x; foreach (Rigidbody item2 in enumerable) { ProjectileStickOnImpact component = ((Component)item2).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.Detach(); ((Behaviour)component).enabled = false; } Vector3 val = slot.characterBody.transform.position - ((Component)item2).transform.position; if (item2.useGravity && !((Object)((Component)item2).gameObject).name.Contains("TkSatPixie")) { Vector3 item = MathUtil.CalculateVelocityForFinalPosition(((Component)item2).transform.position, slot.characterBody.transform.position, 1f).vInitial; val = item; } else { ((Vector3)(ref val)).Normalize(); val *= 60f; } item2.AddForce(val - item2.velocity, (ForceMode)2); } foreach (GameObject item3 in enumerable2) { item3.transform.position = slot.characterBody.corePosition; } } private void PullEnemies(EquipmentSlot slot) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //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_005b: 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_0060: 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_00b9: 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_00ca: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020c: 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_0223: Expected O, but got Unknown float num = enemyRange; float damage = slot.characterBody.damage * baseDamageFrac; List list = new List(); bool flag = (int)FriendlyFireManager.friendlyFireMode > 0; TeamIndex[] obj = (TeamIndex[])Enum.GetValues(typeof(TeamIndex)); TeamIndex objectTeam = TeamComponent.GetObjectTeam(((Component)slot.characterBody).gameObject); TeamIndex[] array = obj; foreach (TeamIndex val in array) { if (flag || objectTeam != val) { list.AddRange(TeamComponent.GetTeamMembers(val)); } } list.Remove(slot.characterBody.teamComponent); float num2 = num * num; foreach (TeamComponent item2 in list) { Vector3 val2 = slot.characterBody.transform.position - ((Component)item2).transform.position; if (((Vector3)(ref val2)).sqrMagnitude <= num2 && Object.op_Implicit((Object)(object)item2.body) && !item2.body.isBoss && !item2.body.isChampion && ((Behaviour)item2.body).isActiveAndEnabled) { Vector3 item = MathUtil.CalculateVelocityForFinalPosition(((Component)item2).transform.position, slot.characterBody.transform.position, 1f).vInitial; IPhysMotor component = ((Component)item2.body).GetComponent(); item2.body.healthComponent.TakeDamage(new DamageInfo { attacker = ((Component)slot.characterBody).gameObject, crit = slot.characterBody.RollCrit(), damage = damage, damageColorIndex = (DamageColorIndex)0, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)131072), (DamageTypeExtended)0, (DamageSource)64), canRejectForce = false, force = (item - ((component != null) ? component.velocity : Vector3.zero)) * ((component != null) ? component.mass : 1f), position = item2.body.corePosition, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient }); } } } } [RegisterAchievement("TkSat_Lodestone", "TkSat_LodestoneUnlockable", "", 2u, null)] public class TkSatLodestoneAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); CharacterMaster.OnInventoryChanged -= new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } private void CharacterMaster_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self) { //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: 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: 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_0186: 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_019d: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!((Object)(object)((BaseAchievement)this).localUser.cachedMaster != (Object)(object)self)) { int num = 0; if (self.inventory.GetItemCountEffective(Items.Mushroom) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.NearbyDamageBonus) > 0) { num++; } if (Item.instance.GetCountEffective(self.inventory) > 0 || Item.instance.GetCountEffective(self.inventory) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.Thorns) > 0) { num++; } if (Item.instance.GetCountEffective(self.inventory) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.Icicle) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.ShockNearby) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.NovaOnHeal) > 0) { num++; } if (Item.instance.GetCountEffective(self.inventory) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.SiphonOnLowHealth) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.SprintWisp) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.LunarSun) > 0) { num++; } if (self.inventory.currentEquipmentIndex == Equipment.Cleanse.equipmentIndex || self.inventory.alternateEquipmentIndex == Equipment.Cleanse.equipmentIndex) { num++; } if (self.inventory.currentEquipmentIndex == Equipment.BurnNearby.equipmentIndex || self.inventory.alternateEquipmentIndex == Equipment.BurnNearby.equipmentIndex) { num++; } if (num >= 6) { ((BaseAchievement)this).Grant(); } } } } public class PackBox : Equipment { public struct MsgPackboxPack : INetMessage, ISerializableObject { private GameObject _target; private GameObject[] _aux; private GameObject _owner; public void Deserialize(NetworkReader reader) { _target = reader.ReadGameObject(); _owner = reader.ReadGameObject(); _aux = (GameObject[])(object)new GameObject[reader.ReadInt32()]; for (int i = 0; i < _aux.Length; i++) { _aux[i] = reader.ReadGameObject(); } } public readonly void Serialize(NetworkWriter writer) { writer.Write(_target); writer.Write(_owner); writer.Write(_aux.Length); for (int i = 0; i < _aux.Length; i++) { writer.Write(_aux[i]); } } public readonly void OnReceived() { if (!Object.op_Implicit((Object)(object)_target)) { TinkersSatchelPlugin._logger.LogError((object)"Received MsgPackboxPack for null GameObject"); return; } if (!Object.op_Implicit((Object)(object)_owner)) { TinkersSatchelPlugin._logger.LogError((object)"Received MsgPackboxPack for null GameObject"); return; } PackBoxHandler packBoxHandler = _target.GetComponent(); if (!Object.op_Implicit((Object)(object)packBoxHandler)) { packBoxHandler = _target.AddComponent(); } PackBoxTracker packBoxTracker = _owner.GetComponent(); if (!Object.op_Implicit((Object)(object)packBoxTracker)) { packBoxTracker = _owner.AddComponent(); } packBoxHandler.PackGlobal(packBoxTracker, _aux); } public MsgPackboxPack(GameObject target, PackBoxTracker owner, GameObject[] aux) { _target = target; _owner = ((Component)owner).gameObject; _aux = aux; } } public struct MsgPackboxPlace : INetMessage, ISerializableObject { private GameObject _target; private GameObject _owner; private Vector3 _pos; public void Deserialize(NetworkReader reader) { //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) _target = reader.ReadGameObject(); _owner = reader.ReadGameObject(); _pos = reader.ReadVector3(); } public readonly void Serialize(NetworkWriter writer) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) writer.Write(_target); writer.Write(_owner); writer.Write(_pos); } public readonly void OnReceived() { //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_target)) { TinkersSatchelPlugin._logger.LogError((object)"Received MsgPackboxPlace for null GameObject"); return; } if (!Object.op_Implicit((Object)(object)_owner)) { TinkersSatchelPlugin._logger.LogError((object)"Received MsgPackboxPlace for null GameObject"); return; } PackBoxHandler component = _target.GetComponent(); PackBoxTracker component2 = _owner.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2)) { TinkersSatchelPlugin._logger.LogError((object)("MsgPackboxPlace has an invalid GameObject (names: " + ((Object)_target).name + " " + ((Object)_owner).name + ")")); } else { component.PlaceGlobal(component2, _pos); } } public MsgPackboxPlace(GameObject target, PackBoxTracker owner, Vector3 pos) { //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) _target = target; _owner = ((Component)owner).gameObject; _pos = pos; } } private readonly Sprite secondaryIconResource; private GameObject packIndicatorPrefab; private GameObject placeIndicatorPrefab; private GameObject placeIndicatorBadPrefab; public override bool isLunar => false; public override bool canBeRandomlyTriggered { get; protected set; } public override float cooldown { get; protected set; } = 60f; [AutoConfigRoOString(null, null)] [AutoConfig("Which object names are allowed for packing (comma-delimited, leading/trailing whitespace will be ignored). WARNING: May have unintended results on some untested objects!", AutoConfigFlags.DeferForever, new object[] { })] public string objectNamesConfig { get; private set; } = string.Join(", ", "Turret1Body", "Turret1Broken", "SquidTurretBody", "Drone1Broken", "Drone2Broken", "GoldChest", "CasinoChest", "MissileDroneBroken", "FlameDroneBroken", "MegaDroneBroken", "EquipmentDroneBroken", "Chest1", "Chest2", "KeyLockbox", "ShrineHealing", "EquipmentBarrel", "ShrineBlood", "ShrineChance", "ShrineCombat", "ShrineBoss", "ShrineCleanse", "ShrineRestack", "ShrineGoldshoresAccess", "CategoryChestDamage", "CategoryChestHealing", "CategoryChestUtility", "CategoryChest2Damage Variant", "CategoryChest2Healing Variant", "CategoryChest2Utility Variant", "Barrel1", "Duplicator", "DuplicatorLarge", "DuplicatorWild", "Scrapper", "MultiShopTerminal", "MultiShopLargeTerminal", "MultiShopEquipmentTerminal", "FusionCellDestructibleBody", "ExplosivePotDestructibleBody", "WarbannerWard", "LunarChest", "LunarShopTerminal", "ItemDroneBroken", "BulwarkDroneBroken"); public static HashSet validObjectNames { get; private set; } = new HashSet(); public GameObject idrPrefab { get; private set; } public PackBox() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/PackBox.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/packBoxIconOpen.png"); secondaryIconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/packBoxIconClosed.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/PackBox.prefab"); } public override void SetupModifyEquipmentDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyEquipmentDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.01173f, 0.24063f, -0.23785f), localAngles = new Vector3(348.217f, 174.1781f, 6.23518f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.0031f, 0.17327f, -0.32618f), localAngles = new Vector3(356.7084f, 180.0849f, 3.30317f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00163f, 0.46855f, -0.24893f), localAngles = new Vector3(329.3575f, 179.1878f, 180.2223f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "SpineStomach1", localPos = new Vector3(0.01083f, 2.70808f, 0.04819f), localAngles = new Vector3(273.0301f, 79.39784f, 11.40969f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00255f, 0.20853f, -0.38892f), localAngles = new Vector3(358.1821f, 180.0955f, 0.83747f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.23517f, 0.11433f, -0.12078f), localAngles = new Vector3(0.69698f, 129.7389f, 0.83228f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.00871f, 0.21141f, -0.19674f), localAngles = new Vector3(0.17244f, 181.0088f, 0.16927f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.03863f, 0.17957f, -0.39445f), localAngles = new Vector3(348.7206f, 184.4746f, 269.3459f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.01334f, 0.34869f, -0.33658f), localAngles = new Vector3(341.0104f, 181.0101f, 355.4333f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.07441f, 0.89015f, -2.46648f), localAngles = new Vector3(1.49764f, 182.5504f, 178.3599f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(-0.37323f, 0.55907f, -1.13146f), localAngles = new Vector3(336.5591f, 192.258f, 175.5002f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.08664f, -0.19885f, -0.23894f), localAngles = new Vector3(354.6045f, 182.65f, 353.025f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00391f, 0.01788f, -0.33649f), localAngles = new Vector3(9.35437f, 175.9276f, 348.3685f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); } public override void SetupAttributes() { base.SetupAttributes(); Sprite sprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/packBoxArrowDown.png"); Sprite sprite2 = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/packBoxArrowUp.png"); GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/RecyclerIndicator"), "temporary setup prefab", false); SpriteRenderer[] componentsInChildren = val.GetComponentsInChildren(); foreach (SpriteRenderer val2 in componentsInChildren) { if (!(((Object)val2.sprite).name != "texRecyclerArrow")) { val2.sprite = sprite; } } placeIndicatorPrefab = PrefabAPI.InstantiateClone(val, "TkSatPackBoxPlaceIndicator", false); Object.Destroy((Object)(object)val); val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/RecyclerIndicator"), "temporary setup prefab", false); componentsInChildren = val.GetComponentsInChildren(); foreach (SpriteRenderer val3 in componentsInChildren) { if (!(((Object)val3.sprite).name != "texRecyclerArrow")) { val3.sprite = sprite2; } } packIndicatorPrefab = PrefabAPI.InstantiateClone(val, "TkSatPackBoxPackIndicator", false); Object.Destroy((Object)(object)val); val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/RecyclerBadIndicator"), "temporary setup prefab", false); componentsInChildren = val.GetComponentsInChildren(); foreach (SpriteRenderer val4 in componentsInChildren) { if (!(((Object)val4.sprite).name != "texRecyclerArrow")) { val4.sprite = sprite; } } placeIndicatorBadPrefab = PrefabAPI.InstantiateClone(val, "TkSatPackBoxPlaceBadIndicator", false); Object.Destroy((Object)(object)val); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); } public override void SetupConfig() { base.SetupConfig(); validObjectNames.UnionWith(from x in objectNamesConfig.Split(',') select x.Trim() + "(Clone)"); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Install(); EquipmentSlot.UpdateTargets += new hook_UpdateTargets(EquipmentSlot_UpdateTargets); EquipmentIcon.Update += new hook_Update(EquipmentIcon_Update); AllyCardController.UpdateInfo += new hook_UpdateInfo(AllyCardController_UpdateInfo); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Uninstall(); EquipmentSlot.UpdateTargets -= new hook_UpdateTargets(EquipmentSlot_UpdateTargets); EquipmentIcon.Update -= new hook_Update(EquipmentIcon_Update); AllyCardController.UpdateInfo -= new hook_UpdateInfo(AllyCardController_UpdateInfo); CharacterBody.onBodyInventoryChangedGlobal -= CharacterBody_onBodyInventoryChangedGlobal; } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { //IL_002b: 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) if (!Object.op_Implicit((Object)(object)body)) { return; } PackBoxTracker component = ((Component)body).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.packedObject) && (Object)(object)EquipmentCatalog.GetEquipmentDef(body.inventory.currentEquipmentIndex) != (Object)(object)base.equipmentDef) { PackBoxHandler component2 = component.packedObject.GetComponent(); if (!Object.op_Implicit((Object)(object)component2)) { TinkersSatchelPlugin._logger.LogError((object)"PackBoxTracker contained a packed object with no PackBoxHandler (during equipment change autodrop)"); } else { component2.TryPlaceServer(component, ((Component)component2).transform.position); } } } private void AllyCardController_UpdateInfo(orig_UpdateInfo orig, AllyCardController self) { orig.Invoke(self); if (!((Object)(object)self != (Object)null) || !Object.op_Implicit((Object)(object)self.sourceMaster)) { return; } GameObject bodyObject = self.sourceMaster.GetBodyObject(); if (Object.op_Implicit((Object)(object)bodyObject)) { PackBoxHandler component = bodyObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.isBoxed) { self.portraitIconImage.texture = (Texture)(object)secondaryIconResource.texture; ((Behaviour)self.portraitIconImage).enabled = true; } } } private void EquipmentSlot_UpdateTargets(orig_UpdateTargets orig, EquipmentSlot self, EquipmentIndex targetingEquipmentIndex, bool userShouldAnticipateTarget) { //IL_0000: 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_0020: 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_002a: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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) if (targetingEquipmentIndex != base.catalogIndex || self.subcooldownTimer > 0f || self.stock == 0) { orig.Invoke(self, targetingEquipmentIndex, userShouldAnticipateTarget); if (targetingEquipmentIndex == base.catalogIndex) { self.targetIndicator.active = false; } return; } self.currentTarget = default(UserTargetInfo); self.targetIndicator.targetTransform = null; PackBoxTracker packBoxTracker = ((Component)self.characterBody).GetComponent(); if (!Object.op_Implicit((Object)(object)packBoxTracker)) { packBoxTracker = ((Component)self.characterBody).gameObject.AddComponent(); } if (Object.op_Implicit((Object)(object)packBoxTracker.packedObject)) { Vector3 loc; bool didHitGround; bool flag = TryGetBoxablePlacePos(self.GetAimRay(), out loc, out didHitGround); if (flag || didHitGround) { if (!flag) { self.targetIndicator.visualizerPrefab = placeIndicatorBadPrefab; } else { self.targetIndicator.visualizerPrefab = placeIndicatorPrefab; } ((Component)packBoxTracker.groundTarget).transform.position = loc; self.targetIndicator.targetTransform = packBoxTracker.groundTarget; } } else { self.targetIndicator.visualizerPrefab = packIndicatorPrefab; GameObject val = FindNearestBoxable(((Component)self).gameObject, self.GetAimRay(), 10f, 20f, requireLoS: false); self.targetIndicator.targetTransform = (Object.op_Implicit((Object)(object)val) ? val.transform : null); packBoxTracker.targetObject = val; } self.targetIndicator.active = (Object)(object)self.targetIndicator.targetTransform != (Object)null; } private void EquipmentIcon_Update(orig_Update orig, EquipmentIcon self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.iconImage) && (Object)(object)self.currentDisplayData.equipmentDef == (Object)(object)Equipment.instance.equipmentDef && Object.op_Implicit((Object)(object)self.targetEquipmentSlot) && Object.op_Implicit((Object)(object)self.targetEquipmentSlot.characterBody)) { PackBoxTracker component = ((Component)self.targetEquipmentSlot.characterBody).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.packedObject)) { self.iconImage.texture = (Texture)(object)Equipment.instance.secondaryIconResource.texture; } } } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //IL_00ec: 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) PackBoxTracker packBoxTracker = ((Component)slot.characterBody).GetComponent(); if (!Object.op_Implicit((Object)(object)packBoxTracker)) { packBoxTracker = ((Component)slot.characterBody).gameObject.AddComponent(); } if (!Object.op_Implicit((Object)(object)packBoxTracker.packedObject)) { if (Object.op_Implicit((Object)(object)packBoxTracker.targetObject) && validObjectNames.Contains(((Object)packBoxTracker.targetObject).name)) { ShopTerminalBehavior component = packBoxTracker.targetObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.serverMultiShopController)) { packBoxTracker.targetObject = ((Component)((Component)component.serverMultiShopController).transform.root).gameObject; } PackBoxHandler packBoxHandler = packBoxTracker.targetObject.GetComponent(); if (!Object.op_Implicit((Object)(object)packBoxHandler)) { packBoxHandler = packBoxTracker.targetObject.AddComponent(); } packBoxHandler.TryPackServer(packBoxTracker); return false; } return false; } PackBoxHandler component2 = packBoxTracker.packedObject.GetComponent(); if (!Object.op_Implicit((Object)(object)component2)) { TinkersSatchelPlugin._logger.LogError((object)"PackBoxTracker contains GameObject with no PackBoxHandler"); return false; } if (TryGetBoxablePlacePos(slot.GetAimRay(), out var loc, out var _)) { return component2.TryPlaceServer(packBoxTracker, loc); } return false; } private bool TryGetBoxablePlacePos(Ray aim, out Vector3 loc, out bool didHitGround) { //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_001d: 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_0032: 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_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_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_006c: 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_0096: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00be: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00f0: Unknown result type (might be due to invalid IL or missing references) Vector3 direction = ((Ray)(ref aim)).direction; direction.y = 0f; ((Vector3)(ref direction)).Normalize(); ((Ray)(ref aim)).direction = direction; didHitGround = false; Ray val = new Ray(((Ray)(ref aim)).GetPoint(6f) + Vector3.up * 3f, Vector3.down); loc = Vector3.zero; RaycastHit val2 = default(RaycastHit); if (Physics.SphereCast(val, 0.5f, ref val2, 8f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)) && ((RaycastHit)(ref val2)).normal.y > 0.5f) { loc = ((RaycastHit)(ref val2)).point; didHitGround = true; if (!Physics.CheckCapsule(loc + Vector3.up * 1.32f, loc + Vector3.up * 0.5f, 0.45f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask))) { return true; } } return false; } private GameObject FindNearestBoxable(GameObject senderObj, Ray aim, float maxAngle, float maxDistance, bool requireLoS) { //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_001f: 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_003b: Unknown result type (might be due to invalid IL or missing references) float camAdjust = default(float); aim = CameraRigController.ModifyAimRayIfApplicable(aim, senderObj, ref camAdjust); Collider[] source = Physics.OverlapSphere(((Ray)(ref aim)).origin, maxDistance + camAdjust, -1, (QueryTriggerInteraction)2); float minDot = Mathf.Cos(Mathf.Clamp(maxAngle, 0f, 180f) * MathF.PI / 180f); return (from x in (from x in (from x in source where Object.op_Implicit((Object)(object)x) && Object.op_Implicit((Object)(object)((Component)x).gameObject) select CommonCode.GetRootWithLocators(((Component)x).gameObject)).Concat(MiscObjectTrackerModule.readOnlyWarbanners.Where((GameObject x) => Vector3.Distance(x.transform.position, ((Ray)(ref aim)).origin) < maxDistance + camAdjust)) where validObjectNames.Contains(((Object)x).name) select x).Select(delegate(GameObject x) { //IL_0007: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) Vector3 direction = ((Ray)(ref aim)).direction; Vector3 val = x.transform.position - ((Ray)(ref aim)).origin; return (x, Vector3.Dot(direction, ((Vector3)(ref val)).normalized)); }) where x.vdot > minDot && (!requireLoS || !Physics.Linecast(((Ray)(ref aim)).origin, x.target.transform.position, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) orderby x.vdot * Vector3.Distance(x.target.transform.position, ((Ray)(ref aim)).origin) select x.target.gameObject).FirstOrDefault(); } } public class PackBoxTracker : MonoBehaviour { public GameObject packedObject; public GameObject targetObject; public Transform groundTarget; private void Awake() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) groundTarget = new GameObject().transform; } } public class PackBoxHandler : MonoBehaviour { public bool isBoxed; public bool queuedDeactivate; public Dictionary auxiliaryPackedObjects = new Dictionary(); public void CollectAuxiliary(GameObject[] auxOverride) { //IL_00fc: 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) //IL_010c: 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_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_009a: 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_00aa: Unknown result type (might be due to invalid IL or missing references) auxiliaryPackedObjects.Clear(); if (auxOverride != null && auxOverride.Length != 0) { GameObject[] array = auxOverride; foreach (GameObject val in array) { if (Object.op_Implicit((Object)(object)val)) { auxiliaryPackedObjects.Add(val, val.transform.position - ((Component)this).transform.position); } } return; } MultiShopController component = ((Component)this).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.terminalGameObjects != null) { GameObject[] array = component.terminalGameObjects; foreach (GameObject val2 in array) { if (Object.op_Implicit((Object)(object)val2)) { auxiliaryPackedObjects.Add(val2, val2.transform.position - ((Component)this).transform.position); } } } ShrineHealingBehavior component2 = ((Component)this).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && (Object)(object)component2.wardInstance != (Object)null) { auxiliaryPackedObjects.Add(component2.wardInstance, component2.wardInstance.transform.position - ((Component)this).transform.position); } } private void LateUpdate() { if (!queuedDeactivate) { return; } queuedDeactivate = false; isBoxed = true; ModelLocator componentInChildren = ((Component)this).gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { ((Component)componentInChildren.modelTransform).gameObject.SetActive(false); } foreach (KeyValuePair auxiliaryPackedObject in auxiliaryPackedObjects) { auxiliaryPackedObject.Key.SetActive(false); componentInChildren = auxiliaryPackedObject.Key.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { ((Component)componentInChildren.modelTransform).gameObject.SetActive(false); } } ((Component)this).gameObject.SetActive(false); } public bool TryPlaceServer(PackBoxTracker from, Vector3 pos) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { TinkersSatchelPlugin._logger.LogError((object)"PackBoxHandler.TryPlaceServer called on client"); return false; } if (!Object.op_Implicit((Object)(object)from) || (Object)(object)from.packedObject != (Object)(object)((Component)this).gameObject) { TinkersSatchelPlugin._logger.LogError((object)"PackBoxHandler.TryPlaceServer called on null PackBoxTracker, or this PackBoxHandler was not contained in it"); return false; } NetMessageExtensions.Send((INetMessage)(object)new PackBox.MsgPackboxPlace(((Component)this).gameObject, from, pos), (NetworkDestination)1); return true; } public void PlaceClient(Vector3 pos) { //IL_000a: 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) //IL_0010: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/TeleportOutBoom"), new EffectData { origin = pos, rotation = ((Component)this).transform.rotation }, true); } public void PlaceGlobal(PackBoxTracker from, Vector3 pos) { //IL_0052: 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_002a: 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_0036: 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_0040: 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_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_0134: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.master)) { ((Component)this).transform.position = component.master.CalculateSafeGroundPosition(pos, component) + (component.corePosition - component.footPosition); } else { ((Component)this).transform.position = pos; } ((Component)this).gameObject.SetActive(true); ModelLocator componentInChildren = ((Component)this).gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { ((Component)componentInChildren.modelTransform).gameObject.SetActive(true); } foreach (KeyValuePair auxiliaryPackedObject in auxiliaryPackedObjects) { auxiliaryPackedObject.Key.transform.position = pos + auxiliaryPackedObject.Value; auxiliaryPackedObject.Key.SetActive(true); ModelLocator[] componentsInChildren = auxiliaryPackedObject.Key.gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i].modelTransform).gameObject.SetActive(true); } } from.packedObject = null; isBoxed = false; if (NetworkClient.active) { PlaceClient(pos); } } public bool TryPackServer(PackBoxTracker into) { if (!NetworkServer.active) { TinkersSatchelPlugin._logger.LogError((object)"PackBoxHandler.TryPackServer called on client"); return false; } if (!Object.op_Implicit((Object)(object)into)) { TinkersSatchelPlugin._logger.LogError((object)"PackBoxHandler.TryPackServer called on null PackBoxTracker"); return false; } NetMessageExtensions.Send((INetMessage)(object)new PackBox.MsgPackboxPack(((Component)this).gameObject, into, auxiliaryPackedObjects.Select((KeyValuePair x) => x.Key).ToArray()), (NetworkDestination)1); return true; } public void PackClient() { //IL_000a: 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) //IL_0016: 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_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_0037: Expected O, but got Unknown EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/TeleportOutBoom"), new EffectData { origin = ((Component)this).transform.position, rotation = ((Component)this).transform.rotation }, true); } public void PackGlobal(PackBoxTracker into, GameObject[] auxOverride) { Extensions.RemoveAllOccupiedNodes(DirectorCore.instance, ((Component)this).gameObject); into.packedObject = ((Component)this).gameObject; queuedDeactivate = true; CollectAuxiliary(auxOverride); if (NetworkClient.active) { PackClient(); } } } public class Recombobulator : Equipment { private WeightedSelection mostRecentDeck; private Dictionary mostRecentDeckCategories; internal static UnlockableDef unlockable; public override bool isLunar => false; public override bool canBeRandomlyTriggered { get; protected set; } public override float cooldown { get; protected set; } = 60f; [AutoConfigRoOString(null, null)] [AutoConfig("Which object names are allowed for recombobulation (comma-delimited, leading/trailing whitespace will be ignored). Items not in this list will also not be selected as the new object. WARNING: May have unintended results on some untested objects!", AutoConfigFlags.DeferForever, new object[] { })] public string objectNamesConfig { get; private set; } = string.Join(", ", "Turret1Broken", "Drone1Broken", "Drone2Broken", "EquipmentDroneBroken", "MissileDroneBroken", "FlameDroneBroken", "MegaDroneBroken", "Chest1", "Chest2", "GoldChest", "CasinoChest", "ShrineHealing", "EquipmentBarrel", "ShrineBlood", "ShrineChance", "ShrineCombat", "ShrineBoss", "ShrineCleanse", "ShrineRestack", "ShrineGoldshoresAccess", "CategoryChestDamage", "CategoryChestHealing", "CategoryChestUtility", "CategoryChest2Damage Variant", "CategoryChest2Healing Variant", "CategoryChest2Utility Variant", "Duplicator", "DuplicatorLarge", "DuplicatorWild", "Scrapper", "MultiShopTerminal", "MultiShopLargeTerminal", "MultiShopEquipmentTerminal", "LunarChest", "ItemDroneBroken", "BulwarkDroneBroken"); [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, interactables will only reroll into other interactables of the same category (chest, shrine, drone, etc.).", AutoConfigFlags.None, new object[] { })] public bool respectCategory { get; private set; } = true; public static HashSet validObjectNames { get; private set; } = new HashSet(); public GameObject idrPrefab { get; private set; } public Recombobulator() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Recombobulator.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/recombobulatorIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Recombobulator.prefab"); } public override void SetupModifyEquipmentDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyEquipmentDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.17631f, -0.11266f, -0.21485f), localAngles = new Vector3(358.1313f, 146.0584f, 33.64409f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.21018f, 0.43699f, 0.06895f), localAngles = new Vector3(292.0317f, 223.4014f, 326.501f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.17793f, 0.00849f, 0.08177f), localAngles = new Vector3(8.15742f, 17.04626f, 351.2686f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-2.14128f, -0.0825f, 0.46526f), localAngles = new Vector3(66.5906f, 251.9885f, 40.36312f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.28101f, 0.07052f, 0.05267f), localAngles = new Vector3(21.36774f, 202.8975f, 193.7145f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.21023f, -0.02377f, -0.06349f), localAngles = new Vector3(339.7073f, 185.8784f, 134.9163f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(-0.23316f, -0.1015f, 0.17438f), localAngles = new Vector3(282.004f, 302.0504f, 52.99162f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.1797f, -0.11002f, -0.03818f), localAngles = new Vector3(26.87735f, 153.2775f, 164.7757f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ThighL", localPos = new Vector3(0.1265f, -0.00041f, 0.06297f), localAngles = new Vector3(357.7091f, 7.96577f, 174.9853f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-1.55959f, -0.34538f, 0.03459f), localAngles = new Vector3(282.6143f, 69.58185f, 288.1964f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "AimOriginSyringe", localPos = new Vector3(0.30983f, -0.13462f, -0.38493f), localAngles = new Vector3(281.1873f, 61.77537f, 301.2128f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "BottomRail", localPos = new Vector3(0.04313f, 0.3421f, -0.05488f), localAngles = new Vector3(356.7396f, 298.4983f, 183.1082f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Center", localPos = new Vector3(-0.19607f, -0.04863f, -0.01808f), localAngles = new Vector3(37.17696f, 17.81638f, 29.12482f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/recombobulatorIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.equipmentDef.unlockableDef = unlockable; } public override void SetupConfig() { base.SetupConfig(); validObjectNames.UnionWith(from x in objectNamesConfig.Split(',') select x.Trim()); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown base.Install(); SceneDirector.GenerateInteractableCardSelection += new Manipulator(SceneDirector_GenerateInteractableCardSelection); EquipmentSlot.UpdateTargets += new hook_UpdateTargets(EquipmentSlot_UpdateTargets); PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin); ScrapperController.BeginScrapping_UniquePickup += new hook_BeginScrapping_UniquePickup(ScrapperController_BeginScrapping); DeathState.OnImpactServer += new Manipulator(DeathState_OnImpactServer); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown base.Uninstall(); SceneDirector.GenerateInteractableCardSelection -= new Manipulator(SceneDirector_GenerateInteractableCardSelection); EquipmentSlot.UpdateTargets -= new hook_UpdateTargets(EquipmentSlot_UpdateTargets); PurchaseInteraction.OnInteractionBegin -= new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin); ScrapperController.BeginScrapping_UniquePickup -= new hook_BeginScrapping_UniquePickup(ScrapperController_BeginScrapping); DeathState.OnImpactServer -= new Manipulator(DeathState_OnImpactServer); } private Dictionary RetrieveDirectorCardCategories(DirectorCardCategorySelection dccs) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); for (int i = 0; i < dccs.categories.Length; i++) { ref Category reference = ref dccs.categories[i]; if (dccs.SumAllWeightsInCategory(reference) <= 0f) { continue; } DirectorCard[] cards = reference.cards; foreach (DirectorCard val in cards) { if (val.IsAvailable()) { dictionary[val] = reference.name; } } } return dictionary; } private void DeathState_OnImpactServer(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0039: 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.MatchCallOrCallvirt(x, (MethodBase)typeof(GameObject).GetMethod("GetComponent", new Type[0]).MakeGenericMethod(typeof(PurchaseInteraction))) })) { val.Emit(OpCodes.Dup); val.EmitDelegate>((Action)delegate(GameObject obj) { obj.AddComponent(); }); } } private void ScrapperController_BeginScrapping(orig_BeginScrapping_UniquePickup orig, ScrapperController self, UniquePickup pickup) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, pickup); if (Object.op_Implicit((Object)(object)self) && !Object.op_Implicit((Object)(object)((Component)self).GetComponent())) { ((Component)self).gameObject.AddComponent(); } } private void PurchaseInteraction_OnInteractionBegin(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { orig.Invoke(self, activator); if (Object.op_Implicit((Object)(object)self) && self.CanBeAffordedByInteractor(activator) && !Object.op_Implicit((Object)(object)((Component)self).GetComponent())) { ((Component)self).gameObject.AddComponent(); } } private void SceneDirector_GenerateInteractableCardSelection(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[1] { (Instruction i) => ILPatternMatchingExt.MatchCallOrCallvirt(i, "GenerateDirectorCardWeightedSelection") }); val.EmitDelegate>((Func)delegate(DirectorCardCategorySelection dccs) { mostRecentDeckCategories = RetrieveDirectorCardCategories(dccs); return dccs; }); val.GotoNext((MoveType)2, new Func[1] { (Instruction i) => ILPatternMatchingExt.MatchCallOrCallvirt(i, "GenerateDirectorCardWeightedSelection") }); val.EmitDelegate, WeightedSelection>>((Func, WeightedSelection>)delegate(WeightedSelection wsdc) { mostRecentDeck = wsdc; return wsdc; }); } private void EquipmentSlot_UpdateTargets(orig_UpdateTargets orig, EquipmentSlot self, EquipmentIndex targetingEquipmentIndex, bool userShouldAnticipateTarget) { //IL_0000: 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_001a: 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_000b: Unknown result type (might be due to invalid IL or missing references) if (targetingEquipmentIndex != base.catalogIndex) { orig.Invoke(self, targetingEquipmentIndex, userShouldAnticipateTarget); return; } self.currentTarget = default(UserTargetInfo); self.targetIndicator.targetTransform = null; GameObject val = CommonCode.FindNearestInteractable(((Component)self).gameObject, validObjectNames, self.GetAimRay(), 10f, 20f, requireLoS: false); if (Object.op_Implicit((Object)(object)val)) { self.targetIndicator.targetTransform = val.transform; PurchaseInteraction component = val.GetComponent(); if (!Object.op_Implicit((Object)(object)val.GetComponent()) && (!Object.op_Implicit((Object)(object)component) || component.available)) { self.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load("Prefabs/RecyclerIndicator"); } else { self.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load("Prefabs/RecyclerBadIndicator"); } self.targetIndicator.active = true; } else { self.targetIndicator.active = false; } } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //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_00d9: 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_0181: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0236: 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_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Invalid comparison between Unknown and I4 //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) if (mostRecentDeck == null || !Object.op_Implicit((Object)(object)Run.instance)) { return false; } Transform targetTransform = slot.targetIndicator.targetTransform; if (!Object.op_Implicit((Object)(object)targetTransform)) { return false; } GameObject gameObject = ((Component)targetTransform).gameObject; string targetName = ((Object)gameObject).name.Replace("(Clone)", ""); if (!validObjectNames.Contains(targetName) || Object.op_Implicit((Object)(object)((Component)targetTransform).gameObject.GetComponent())) { return false; } PurchaseInteraction component = gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && !component.available) { return false; } Vector3 position = targetTransform.position; ShopTerminalBehavior component2 = gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.serverMultiShopController)) { gameObject = ((Component)((Component)component2.serverMultiShopController).transform.root).gameObject; targetTransform = gameObject.transform; position = targetTransform.position; targetName = ((Object)gameObject).name.Replace("(Clone)", ""); GameObject[] terminalGameObjects = component2.serverMultiShopController.terminalGameObjects; for (int i = 0; i < terminalGameObjects.Length; i++) { Object.Destroy((Object)(object)terminalGameObjects[i]); } } Object.Destroy((Object)(object)gameObject); WeightedSelection val = new WeightedSelection(8); IEnumerable source = from kvp in mostRecentDeckCategories where ((Object)kvp.Key.spawnCard.prefab).name == targetName select kvp.Value; for (int j = 0; j < mostRecentDeck.Count; j++) { ChoiceInfo choice = mostRecentDeck.GetChoice(j); if (choice.value != null && choice.value.IsAvailable() && validObjectNames.Contains(((Object)choice.value.spawnCard.prefab).name) && (!respectCategory || (mostRecentDeckCategories.TryGetValue(choice.value, out var value) && source.Contains(value)))) { val.AddChoice(choice); } } if (val.Count == 0) { return false; } DirectorCard val2 = val.Evaluate(base.rng.nextNormalizedFloat); GameObject val3 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val2.spawnCard, new DirectorPlacementRule { placementMode = (PlacementMode)0, position = position, preventOverhead = false }, base.rng)); if (!Object.op_Implicit((Object)(object)val3)) { TinkersSatchelPlugin._logger.LogError((object)"Recombobulator failed to replace interactable!"); return false; } PurchaseInteraction component3 = val3.GetComponent(); if (Object.op_Implicit((Object)(object)component3) && (int)component3.costType == 1) { component3.Networkcost = Run.instance.GetDifficultyScaledCost(component3.cost); } val3.AddComponent(); MultiShopController component4 = val3.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { GameObject[] terminalGameObjects = component4.terminalGameObjects; for (int i = 0; i < terminalGameObjects.Length; i++) { terminalGameObjects[i].AddComponent(); } } return true; } } public class RecombobulatorFlag : MonoBehaviour { } [RegisterAchievement("TkSat_Recombobulator", "TkSat_RecombobulatorUnlockable", "", 2u, null)] public class TkSatRecombobulatorAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); EquipmentSlot.FireRecycle += new Manipulator(EquipmentSlot_FireRecycle); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); EquipmentSlot.FireRecycle -= new Manipulator(EquipmentSlot_FireRecycle); } private void EquipmentSlot_FireRecycle(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0039: 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.MatchCallOrCallvirt(x, "set_NetworkpickupIndex") })) { val.Emit(OpCodes.Dup); val.EmitDelegate>((Action)delegate(PickupIndex pind) { //IL_0000: 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_0011: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 PickupDef pickupDef = PickupCatalog.GetPickupDef(pind); if (pickupDef != null && ((int)pickupDef.itemTier == 2 || (int)pickupDef.itemTier == 8 || (int)pickupDef.itemTier == 4 || (int)pickupDef.itemTier == 9)) { ((BaseAchievement)this).Grant(); } }); } else { TinkersSatchelPlugin._logger.LogError((object)"TkSatRecombobulatorAchievement: failed to apply IL hook (EquipmentSlot_FireRecycle); could not find target instructions. Achievement will not trigger."); } } } public class ReviveOnce : Equipment { internal static UnlockableDef unlockable; public readonly HashSet droneMasterPrefabNames = new HashSet(); public override bool isLunar => false; public override bool canBeRandomlyTriggered { get; protected set; } public override float cooldown { get; protected set; } = 10f; [AutoConfigRoOString(null, null)] [AutoConfig("Which master prefab names to spawn if there are no allies to be revived. WARNING: May have unintended results on some untested objects!", AutoConfigFlags.None, new object[] { })] public string masterNamesConfig { get; private set; } = string.Join(", ", "EquipmentDroneMaster", "Drone1Master", "Drone2Master", "FlameDroneMaster", "DroneMissileMaster", "ItemDroneMaster", "BulwarkDroneMaster"); public GameObject idrPrefab { get; private set; } public ReviveOnce() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/ReviveOnce.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/reviveOnceIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/ReviveOnce.prefab"); } public override void SetupModifyEquipmentDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyEquipmentDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.04417f, 0.19067f, -0.24033f), localAngles = new Vector3(337.4471f, 55.56866f, 354.1383f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00054f, 0.27487f, -0.29389f), localAngles = new Vector3(320.018f, 64.74491f, 342.704f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.01826f, 0.41296f, -0.21866f), localAngles = new Vector3(6.28242f, 43.10916f, 36.10896f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "SpineChest3", localPos = new Vector3(-0.08684f, 0.67153f, -1.08192f), localAngles = new Vector3(44.63957f, 264.7216f, 107.5511f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.01093f, 0.05395f, -0.36182f), localAngles = new Vector3(314.4274f, 93.80039f, 295.7014f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.15785f, 0.13082f, -0.11723f), localAngles = new Vector3(322.6137f, 19.11888f, 332.5494f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.0131f, -0.01474f, -0.22271f), localAngles = new Vector3(328.3462f, 59.25051f, 349.7125f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.00568f, 0.22235f, -0.35905f), localAngles = new Vector3(334.1837f, 59.43953f, 3.43586f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00072f, 0.34057f, -0.30971f), localAngles = new Vector3(345.0132f, 50.15996f, 12.58943f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.1298f, 1.52182f, -2.26367f), localAngles = new Vector3(320.2272f, 71.04354f, 329.5704f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(1.01798f, 0.30345f, -0.23827f), localAngles = new Vector3(320.4994f, 321.4309f, 4.27371f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.12059f, 0.06472f, -0.16892f), localAngles = new Vector3(321.9678f, 54.92611f, 353.519f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00089f, 0.05696f, -0.30533f), localAngles = new Vector3(318.8723f, 56.99937f, 349.1709f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); } public override void SetupConfig() { base.SetupConfig(); base.ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "masterNamesConfig") { UpdateDroneMasterPrefabNames(); } }; } public override void SetupAttributes() { base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/reviveOnceIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.equipmentDef.unlockableDef = unlockable; UpdateDroneMasterPrefabNames(); } private void UpdateDroneMasterPrefabNames() { droneMasterPrefabNames.Clear(); droneMasterPrefabNames.UnionWith(from x in masterNamesConfig.Split(',') select x.Trim()); } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //IL_0047: 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_0055: 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_0061: 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_0068: 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_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) //IL_0083: 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_0091: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_021a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: 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_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) IEnumerable source = CharacterMaster.readOnlyInstancesList.Where((CharacterMaster x) => x.IsDeadAndOutOfLivesServer() && Object.op_Implicit((Object)(object)x.playerCharacterMasterController) && (int)x.teamIndex == 1); GameObject val = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/RoboCratePod"); NodeGraph nodeGraph = SceneInfo.instance.GetNodeGraph((GraphType)0); NodeIndex val2 = nodeGraph.FindClosestNodeWithFlagConditions(((Component)slot).transform.position, (HullClassification)0, (NodeFlags)0, (NodeFlags)0, false); Vector3 position = ((Component)slot).transform.position; Quaternion val3 = Quaternion.identity; if (nodeGraph.GetNodePosition(val2, ref position)) { Vector3 position2 = ((Component)slot).transform.position; position2.y = position.y; val3 = Util.QuaternionSafeLookRotation(position - position2); } GameObject val5; if (source.Count() > 0) { CharacterBody val4 = base.rng.NextElementUniform(source.ToArray()).Respawn(position, val3, false); if (!Object.op_Implicit((Object)(object)val4)) { return false; } val5 = ((Component)val4).gameObject; string text = Language.GetString(val4.baseNameToken); NetworkUser val6 = Util.LookUpBodyNetworkUser(val4); if (Object.op_Implicit((Object)(object)val6)) { text = val6.userName; } string text2 = (Object.op_Implicit((Object)(object)slot.characterBody) ? Language.GetString(slot.characterBody.baseNameToken) : Language.GetString("TINKERSSATCHEL_REVIVEONCE_MSG_REVIVE_VAGUE")); NetworkUser val7 = Util.LookUpBodyNetworkUser(slot.characterBody); if (Object.op_Implicit((Object)(object)val7)) { text2 = val7.userName; } SimpleChatMessage val8 = new SimpleChatMessage(); val8.paramTokens = new string[2] { text2, text }; val8.baseToken = "TINKERSSATCHEL_REVIVEONCE_MSG_REVIVE"; Chat.SendBroadcastChat((ChatMessageBase)(object)val8); } else { HashSet hashSet = new HashSet(droneMasterPrefabNames); if (!Module.instance.enabled) { hashSet.Remove("BulwarkDroneMaster"); } GameObject masterPrefab = MasterCatalog.GetMasterPrefab(MasterCatalog.FindMasterIndex(base.rng.NextElementUniform(hashSet.ToArray()))); if (!Object.op_Implicit((Object)(object)masterPrefab)) { return false; } CharacterMaster val9 = new MasterSummon { masterPrefab = masterPrefab, position = position, rotation = val3, summonerBodyObject = (Object.op_Implicit((Object)(object)slot.characterBody) ? ((Component)slot.characterBody).gameObject : null), ignoreTeamMemberLimit = true, useAmbientLevel = true }.Perform(); if (!Object.op_Implicit((Object)(object)val9)) { return false; } val5 = val9.GetBodyObject(); if (!Object.op_Implicit((Object)(object)val5)) { return false; } CharacterBody val10 = default(CharacterBody); if (((Object)val5).name == "EquipmentDroneBody(Clone)" && val5.TryGetComponent(ref val10) && Object.op_Implicit((Object)(object)val10.master)) { EquipmentDef val12; PickupIndex[] array = Run.instance.availableEquipmentDropList.Where((PickupIndex pind) => CatalogUtil.TryGetEquipmentDef(pind, out val12) && val12.canBeRandomlyTriggered).ToArray(); EquipmentIndex equipmentIndex = PickupCatalog.GetPickupDef(base.rng.NextElementUniform(array)).equipmentIndex; val10.master.inventory.SetEquipment(new EquipmentState(equipmentIndex, FixedTimeStamp.negativeInfinity, (byte)1, false), 0u, 0u); } } if (!Object.op_Implicit((Object)(object)val5)) { return false; } CharacterBody component = val5.GetComponent(); GameObject val11 = Object.Instantiate(val, position, val3); VehicleSeat component2 = val11.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.AssignPassenger(val5); } else { TinkersSatchelPlugin._logger.LogError((object)$"Pod {val11} spawned for revived prefab {val5} has no seat!"); } NetworkServer.Spawn(val11); component.SetBodyStateToPreferredInitialState(); if (slot.equipmentIndex == base.equipmentDef.equipmentIndex) { slot.inventory.SetEquipment(new EquipmentState((EquipmentIndex)(-1), FixedTimeStamp.now + cooldown * slot.inventory.CalculateEquipmentCooldownScale(), (byte)0, false), (uint)slot.inventory.activeEquipmentSlot, (uint)slot.inventory.activeEquipmentSet[slot.inventory.activeEquipmentSlot]); } return true; } } [RegisterAchievement("TkSat_ReviveOnce", "TkSat_ReviveOnceUnlockable", "", 1u, null)] public class TkSatReviveOnceAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); GlobalEventManager.OnCharacterDeath -= new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath); } private void GlobalEventManager_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0039: 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) orig.Invoke(self, damageReport); if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && !((Object)(object)damageReport.attackerBody != (Object)(object)((BaseAchievement)this).localUser.cachedBody) && (damageReport.damageInfo.damageType.damageSource & 1) != 0) { TkSatReviveOnceAchievementStreakTracker tkSatReviveOnceAchievementStreakTracker = default(TkSatReviveOnceAchievementStreakTracker); if (!((Component)damageReport.attackerBody).TryGetComponent(ref tkSatReviveOnceAchievementStreakTracker)) { tkSatReviveOnceAchievementStreakTracker = ((Component)damageReport.attackerBody).gameObject.AddComponent(); } tkSatReviveOnceAchievementStreakTracker.kills++; if (tkSatReviveOnceAchievementStreakTracker.kills > 20) { ((BaseAchievement)this).Grant(); } } } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, skill); TkSatReviveOnceAchievementStreakTracker tkSatReviveOnceAchievementStreakTracker = default(TkSatReviveOnceAchievementStreakTracker); if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.skillLocator) && (int)self.skillLocator.FindSkillSlot(skill) != 0 && ((Component)self).TryGetComponent(ref tkSatReviveOnceAchievementStreakTracker)) { tkSatReviveOnceAchievementStreakTracker.kills = 0; } } } public class TkSatReviveOnceAchievementStreakTracker : MonoBehaviour { public int kills; } public class Rewind : Equipment { public struct MsgRewind : INetMessage, ISerializableObject { private CharacterBody _target; public MsgRewind(CharacterBody target) { _target = target; } public void Deserialize(NetworkReader reader) { GameObject val = reader.ReadGameObject(); if (Object.op_Implicit((Object)(object)val)) { _target = val.GetComponent(); } else { TinkersSatchelPlugin._logger.LogError((object)"Received MsgRewind for nonexistent or non-networked GameObject"); } } public readonly void Serialize(NetworkWriter writer) { writer.Write(((Component)_target).gameObject); } public readonly void OnReceived() { if (!Object.op_Implicit((Object)(object)_target)) { return; } RewindComponent component = ((Component)_target).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.frames.Count != 0) { EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)_target).gameObject, "Body"); if (!((Object)(object)val == (Object)null) && !(val.state is RewindState)) { val.SetState(EntityStateCatalog.InstantiateState(ref Equipment.instance.rewindStateType)); } } } } private SerializableEntityStateType rewindStateType; internal SkillDef[] blacklistedSkills; public override bool isLunar => false; public override bool canBeRandomlyTriggered { get; protected set; } = true; public override float cooldown { get; protected set; } = 90f; [AutoConfigRoOSlider("{0:N1} s", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Duration of the phasing effect, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float phaseDuration { get; private set; } = 2f; [AutoConfigRoOSlider("{0:N1} s", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Maximum rewind time, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float rewindDuration { get; private set; } = 10f; [AutoConfigRoOSlider("{0:N1} s", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Minimum rewind time, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float minDuration { get; private set; } = 2f; [AutoConfigRoOSlider("{0:N1} s", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Time after use before beginning to record again, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float icd { get; private set; } = 2f; [AutoConfigRoOSlider("{0:N2} s", 0.05f, 10f, null, null)] [AutoConfig("Time between saved player states, in seconds.", AutoConfigFlags.None, new object[] { 0.05f, float.MaxValue })] public float frameInterval { get; private set; } = 0.5f; public BuffDef rewindBuff { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { phaseDuration.ToString("N1"), rewindDuration.ToString("N1"), minDuration.ToString("N0") }; } protected override string[] GetLoreStringArgs(string langID = null) { return new string[1] { rewindDuration.ToString("N0") }; } public Rewind() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Rewind.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/rewindIcon.png"); } public override void SetupAttributes() { //IL_0009: 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_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) base.SetupAttributes(); bool flag = default(bool); rewindStateType = ContentAddition.AddEntityState(ref flag); NetworkingAPI.RegisterMessageType(); blacklistedSkills = (SkillDef[])(object)new SkillDef[6] { LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CallSupplyDropHealing"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CallSupplyDropHacking"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CallSupplyDropShocking"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CallSupplyDropEquipmentRestock"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CaptainSkillUsedUp"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CaptainCancelDummy") }; rewindBuff = ScriptableObject.CreateInstance(); rewindBuff.buffColor = Color.white; rewindBuff.canStack = true; rewindBuff.isDebuff = false; rewindBuff.isCooldown = true; ((Object)rewindBuff).name = "TKSATRewind"; rewindBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/rewindBuffIcon.png"); rewindBuff.ignoreGrowthNectar = true; ContentAddition.AddBuffDef(rewindBuff); } public override void Install() { base.Install(); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; } public override void Uninstall() { base.Uninstall(); CharacterBody.onBodyInventoryChangedGlobal -= CharacterBody_onBodyInventoryChangedGlobal; } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && (Object)(object)EquipmentCatalog.GetEquipmentDef(body.inventory.currentEquipmentIndex) == (Object)(object)base.equipmentDef && !Object.op_Implicit((Object)(object)((Component)body).gameObject.GetComponent())) { ((Component)body).gameObject.AddComponent(); } } protected override bool PerformEquipmentAction(EquipmentSlot slot) { if (!Object.op_Implicit((Object)(object)slot) || !Object.op_Implicit((Object)(object)slot.characterBody)) { return false; } RewindComponent component = ((Component)slot.characterBody).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || component.frames.Count < Mathf.CeilToInt(minDuration / frameInterval)) { return false; } EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)slot.characterBody).gameObject, "Body"); if ((Object)(object)val == (Object)null || val.state is RewindState) { return false; } NetMessageExtensions.Send((INetMessage)(object)new MsgRewind(slot.characterBody), (NetworkDestination)1); return true; } } public class RewindState : BlinkState { private RewindComponent cpt; private int currFrame; public override void OnEnter() { base.speedCoefficient = 0f; base.duration = Equipment.instance.phaseDuration; base.beginSoundString = "Play_huntress_shift_start"; base.endSoundString = "Play_huntress_shift_end"; ((BlinkState)this).OnEnter(); cpt = ((Component)((EntityState)this).outer.commonComponents.characterBody).GetComponent(); currFrame = cpt.frames.Count; if (Object.op_Implicit((Object)(object)base.characterModel)) { CharacterModel characterModel = base.characterModel; int invisibilityCount = characterModel.invisibilityCount; characterModel.invisibilityCount = invisibilityCount - 1; } cpt.isRewinding = true; base.modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)base.modelTransform)) { TemporaryOverlayInstance obj = TemporaryOverlayManager.AddOverlay(((Component)base.modelTransform).gameObject); obj.duration = base.duration; obj.animateShaderAlpha = true; obj.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); obj.destroyComponentOnEnd = true; obj.originalMaterial = LegacyResourcesAPI.Load("Materials/matHuntressFlashExpanded"); obj.AddToCharacterModel(((Component)base.modelTransform).GetComponent()); } } public override void FixedUpdate() { //IL_00ac: 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_00b6: 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) ((BlinkState)this).FixedUpdate(); int num = Mathf.Clamp(Mathf.FloorToInt(MathUtil.SteepSigmoid01(1f - base.stopwatch / base.duration, 1.5f) * (float)cpt.frames.Count), 0, cpt.frames.Count - 1); if (num != currFrame) { currFrame = num; cpt.frames[num].ApplyTo(((EntityState)this).outer.commonComponents.characterBody); ((EntityState)this).outer.commonComponents.characterMotor.velocity = -((EntityState)this).outer.commonComponents.characterMotor.velocity; Util.PlaySound(base.beginSoundString, ((EntityState)this).gameObject); ((EntityState)this).outer.commonComponents.characterBody.SetBuffCount(Equipment.instance.rewindBuff.buffIndex, num); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)base.characterModel)) { CharacterModel characterModel = base.characterModel; int invisibilityCount = characterModel.invisibilityCount; characterModel.invisibilityCount = invisibilityCount + 1; } ((BlinkState)this).OnExit(); cpt.frames.Clear(); cpt.isRewinding = false; cpt.icd = Equipment.instance.icd; } } [RequireComponent(typeof(CharacterBody))] public class RewindComponent : MonoBehaviour { public class RewindFrame { public float health; public float shield; public float barrier; public Vector3 position; public Vector3 velocity; public Vector3 moveVec; public Vector3 targVec; public (int slot, float cd, int stock)[] skillStates; internal RewindFrame() { } public RewindFrame(CharacterBody body) { //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_005f: 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_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) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_009d: 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) if (Object.op_Implicit((Object)(object)body.characterDirection)) { moveVec = body.characterDirection.moveVector; targVec = body.characterDirection.targetVector; } else { moveVec = Vector3.zero; targVec = Vector3.zero; } if (Object.op_Implicit((Object)(object)body.characterMotor)) { position = body.characterMotor.previousPosition; velocity = body.characterMotor.velocity; } else { position = Vector3.zero; velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)body.skillLocator)) { skillStates = body.skillLocator.allSkills.Select((GenericSkill x) => (body.skillLocator.GetSkillSlotIndex(x), x.rechargeStopwatch, x.stock)).ToArray(); } else { skillStates = new(int, float, int)[0]; } if (NetworkServer.active) { if (Object.op_Implicit((Object)(object)body.healthComponent)) { health = body.healthComponent.health; shield = body.healthComponent.shield; barrier = body.healthComponent.barrier; } else { health = 0f; shield = 0f; barrier = 0f; } } } public void ApplyTo(CharacterBody body) { //IL_0014: 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_0029: 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_003a: 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_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 (Object.op_Implicit((Object)(object)body.characterMotor)) { body.characterMotor.rootMotion = position - body.characterMotor.previousPosition; body.characterMotor.velocity = velocity; } if (Object.op_Implicit((Object)(object)body.characterDirection)) { body.characterDirection.moveVector = moveVec; body.characterDirection.targetVector = targVec; } if (Util.HasEffectiveAuthority(body.networkIdentity)) { GenericSkill[] allSkills = body.skillLocator.allSkills; foreach (GenericSkill val in allSkills) { if (!Equipment.instance.blacklistedSkills.Contains(val.skillDef)) { int thisSlot = body.skillLocator.GetSkillSlotIndex(val); IEnumerable<(int, float, int)> source = skillStates.Where(((int slot, float cd, int stock) x) => x.slot == thisSlot); if (source.Count() != 1) { TinkersSatchelPlugin._logger.LogError((object)$"RewindState.ApplyTo: skillslot {thisSlot} went missing or had duplicates!"); continue; } (int, float, int) tuple = source.First(); float item = tuple.Item2; int item2 = tuple.Item3; val.rechargeStopwatch = item; val.stock = item2; } } } if (NetworkServer.active && Object.op_Implicit((Object)(object)body.healthComponent)) { body.healthComponent.Networkhealth = health; body.healthComponent.Networkshield = shield; body.healthComponent.Networkbarrier = barrier; } } } public List frames = new List(); private float stopwatch; public float icd; private CharacterBody body; public bool isRewinding; private void Awake() { body = ((Component)this).GetComponent(); } private void OnDisable() { frames.Clear(); } private void FixedUpdate() { //IL_0021: 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_0115: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || isRewinding) { return; } if ((Object)(object)EquipmentCatalog.GetEquipmentDef(body.inventory.currentEquipmentIndex) != (Object)(object)Equipment.instance.equipmentDef) { if (frames.Count > 0) { frames.Clear(); body.SetBuffCount(Equipment.instance.rewindBuff.buffIndex, 0); } return; } if (icd > 0f) { icd -= Time.fixedDeltaTime; return; } stopwatch -= Time.fixedDeltaTime; if (stopwatch <= 0f) { stopwatch = Equipment.instance.frameInterval; frames.Add(new RewindFrame(body)); if ((float)frames.Count > Equipment.instance.rewindDuration / Equipment.instance.frameInterval) { frames.RemoveAt(0); } body.SetBuffCount(Equipment.instance.rewindBuff.buffIndex, frames.Count); } } } public class Compass : Equipment { public enum UseLimitType { Unlimited, NTimesPerCharacter, NTimesPerStage } public override bool isLunar => true; public override bool canBeRandomlyTriggered { get; protected set; } public override bool isEnigmaCompatible { get; protected set; } public override float cooldown { get; protected set; } = 180f; [AutoConfigRoOChoice(null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("How to limit uses of Silver Compass.", AutoConfigFlags.None, new object[] { })] public UseLimitType useLimitType { get; private set; } = UseLimitType.NTimesPerCharacter; [AutoConfigRoOIntSlider("{0:N0}", 0, 10, null, null)] [AutoConfig("Number of limited uses if UseLimitType is not Unlimited.", AutoConfigFlags.None, new object[] { 0, int.MaxValue })] public int useLimitCount { get; private set; } = 1; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, an extra stack of Shrine of the Mountain which has no reward will be applied.", AutoConfigFlags.None, new object[] { })] public bool applyPunishStack { get; private set; } = true; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[2] { applyPunishStack ? CommonCode.GetBestLanguage(langID).GetLocalizedStringByToken("TINKERSSATCHEL_COMPASS_DESC_PUNISH") : "", (useLimitType == UseLimitType.NTimesPerStage) ? CommonCode.GetBestLanguage(langID).GetLocalizedFormattedStringByToken("TINKERSSATCHEL_COMPASS_DESC_PERSTAGE", new object[1] { useLimitCount.ToString("N0") }) : ((useLimitType == UseLimitType.NTimesPerCharacter) ? CommonCode.GetBestLanguage(langID).GetLocalizedFormattedStringByToken("TINKERSSATCHEL_COMPASS_DESC_PERPLAYER", new object[1] { useLimitCount.ToString("N0") }) : "") }; } public Compass() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/SilverCompass.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/compassIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/SilverCompass.prefab"); } public override void SetupModifyEquipmentDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyEquipmentDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.15335f, -0.05014f, 0.17195f), localAngles = new Vector3(346.3313f, 36.07016f, 351.1957f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.38892f, 0.01025f, -0.06457f), localAngles = new Vector3(339.381f, 93.94829f, 25.04659f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.20335f, 0.01981f, -0.07599f), localAngles = new Vector3(327.5557f, 138.6586f, 0.88774f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "SpineStomach2", localPos = new Vector3(-0.92336f, 0.70959f, 0.72718f), localAngles = new Vector3(302.9044f, 267.5414f, 83.33694f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.27383f, 0.13691f, 0.12219f), localAngles = new Vector3(21.35251f, 37.17607f, 173.8083f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.2156f, -0.0444f, -0.01822f), localAngles = new Vector3(39.06491f, 76.18316f, 175.7196f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.22401f, -0.27785f, -0.1303f), localAngles = new Vector3(0.07325f, 101.4427f, 23.21065f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.18725f, -0.07315f, 0.00197f), localAngles = new Vector3(14.68723f, 92.61344f, 204.8852f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.23272f, 0.09982f, 0.00448f), localAngles = new Vector3(28.25812f, 66.48277f, 174.458f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(2.03917f, -0.68604f, -0.45417f), localAngles = new Vector3(356.4003f, 85.95611f, 10.24933f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.92678f, 0.14718f, -0.33047f), localAngles = new Vector3(353.9659f, 91.51791f, 330.8354f), localScale = new Vector3(0.7f, 0.7f, 0.7f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.24315f, -0.56634f, 0.06337f), localAngles = new Vector3(17.53913f, 95.07683f, 3.09531f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Center", localPos = new Vector3(0.17438f, -0.04065f, 0.00101f), localAngles = new Vector3(349.123f, 100.1741f, 339.1085f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown //IL_0175: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01b2: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance) && TeleporterInteraction.instance.currentState is IdleState && Object.op_Implicit((Object)(object)slot.characterBody) && Object.op_Implicit((Object)(object)slot.characterBody.master) && Object.op_Implicit((Object)(object)slot.characterBody.master.playerCharacterMasterController)) { if (useLimitType == UseLimitType.NTimesPerStage) { SilverCompassFlag silverCompassFlag = default(SilverCompassFlag); if (!((Component)TeleporterInteraction.instance).gameObject.TryGetComponent(ref silverCompassFlag)) { silverCompassFlag = ((Component)TeleporterInteraction.instance).gameObject.AddComponent(); } if (silverCompassFlag.timesUsed >= useLimitCount) { return false; } silverCompassFlag.timesUsed++; } else if (useLimitType == UseLimitType.NTimesPerCharacter) { SilverCompassFlag silverCompassFlag2 = default(SilverCompassFlag); if (!((Component)slot).gameObject.TryGetComponent(ref silverCompassFlag2)) { silverCompassFlag2 = ((Component)slot).gameObject.AddComponent(); } if (silverCompassFlag2.timesUsed >= useLimitCount) { return false; } silverCompassFlag2.timesUsed++; } TeleporterInteraction.instance.AddShrineStack(); if (applyPunishStack) { TeleporterInteraction obj = TeleporterInteraction.instance; int shrineBonusStacks = obj.shrineBonusStacks; obj.shrineBonusStacks = shrineBonusStacks + 1; } Chat.SendBroadcastChat((ChatMessageBase)new SubjectFormatChatMessage { subjectAsCharacterBody = slot.characterBody, baseToken = "TKSAT_COMPASS_USE_MESSAGE" }); PingerController fieldValue = Reflection.GetFieldValue((object)slot.characterBody.master.playerCharacterMasterController, "pingerController"); Reflection.GetMethodCached(typeof(PingerController), "SetCurrentPing").Invoke(fieldValue, new object[1] { (object)new PingInfo { active = true, origin = slot.characterBody.corePosition, normal = Vector3.zero, targetNetworkIdentity = ((Component)TeleporterInteraction.instance).GetComponent() } }); return true; } return false; } } public class SilverCompassFlag : MonoBehaviour { public int timesUsed; } public class TargetSpinnerAnim : MonoBehaviour { public float rotateTime = 0.5f; public float delayTime = 1f; public Vector3 rotateAxis; private float targPos = -1f; private float currVel; private float currPos; private float stopwatch; private void Update() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) stopwatch -= Time.deltaTime; if (stopwatch < 0f) { targPos = Random.value * MathF.PI * 2f; stopwatch = rotateTime + delayTime; } currPos = Mathf.SmoothDampAngle(currPos, targPos, ref currVel, rotateTime); ((Component)this).gameObject.transform.Rotate(rotateAxis, currVel); } } public class EMP : Equipment { public override bool isLunar => true; public override bool canBeRandomlyTriggered { get; protected set; } public override bool isEnigmaCompatible { get; protected set; } public override float cooldown { get; protected set; } = 60f; [AutoConfigRoOSlider("{0:N0} m", 0f, 1000f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Range of all equipment effects.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float range { get; private set; } = 100f; [AutoConfigRoOSlider("{0:N1} s", 0f, 60f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Duration of skill disable.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float duration { get; private set; } = 10f; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[2] { duration.ToString("N0"), range.ToString("N0") }; } public EMP() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/EMP.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/EMPIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/EMP.prefab"); } public override void SetupModifyEquipmentDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyEquipmentDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.1694f, 0.00347f, 0.13829f), localAngles = new Vector3(6.65467f, 133.3017f, 75.57108f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.38728f, 0.00965f, -0.06446f), localAngles = new Vector3(333.5912f, 202.3656f, 70.59932f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.20068f, 0.08115f, -0.06248f), localAngles = new Vector3(344.8479f, 220.4551f, 79.18226f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-1.51252f, -0.99778f, 1.23513f), localAngles = new Vector3(32.2198f, 58.24542f, 114.4344f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.24835f, 0.13692f, 0.12219f), localAngles = new Vector3(341.0877f, 311.8262f, 263.4802f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.16964f, 0.13347f, 0.09027f), localAngles = new Vector3(351.428f, 162.9317f, 78.83822f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.2218f, -0.18057f, -0.12922f), localAngles = new Vector3(356.4394f, 210.3498f, 85.3334f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.17444f, -0.09371f, -0.00565f), localAngles = new Vector3(7.12427f, 353.5861f, 242.4066f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.19328f, 0.01618f, -0.01016f), localAngles = new Vector3(22.64412f, 356.1034f, 258.6612f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(2.02937f, 0.31588f, 0.7402f), localAngles = new Vector3(314.2263f, 190.9837f, 83.7415f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.75783f, 0.18496f, -0.42217f), localAngles = new Vector3(351.9894f, 202.5631f, 104.2369f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.16242f, 0.09494f, 0.06865f), localAngles = new Vector3(341.4641f, 166.4982f, 79.28785f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Center", localPos = new Vector3(0.13884f, -0.01109f, 0.05046f), localAngles = new Vector3(328.3857f, 173.8581f, 67.26126f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); } public override void SetupAttributes() { base.SetupAttributes(); } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //IL_002d: 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_0042: 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_005e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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) //IL_0144: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_0182: 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_01b1: 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_01b6: 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) float num = range * range; foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { Vector3 val = readOnlyInstances.transform.position - ((Component)slot).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude <= num)) { continue; } bool flag = (int)readOnlyInstances.teamComponent.teamIndex == 1; if (Object.op_Implicit((Object)(object)readOnlyInstances.skillLocator)) { ServerTimedSkillDisable serverTimedSkillDisable = ((Component)readOnlyInstances).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)serverTimedSkillDisable)) { serverTimedSkillDisable = ((Component)readOnlyInstances).gameObject.AddComponent(); } if (!flag) { serverTimedSkillDisable.ServerApply(duration, (SkillSlot)0); } serverTimedSkillDisable.ServerApply(duration, (SkillSlot)1); serverTimedSkillDisable.ServerApply(duration, (SkillSlot)2); serverTimedSkillDisable.ServerApply(duration, (SkillSlot)3); } } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ImpactEffects/FusionCellExplosion"), new EffectData { origin = (Object.op_Implicit((Object)(object)slot.characterBody) ? slot.characterBody.corePosition : ((Component)slot).transform.position), scale = range, color = Color32.op_Implicit(Color.cyan) }, true); TeamIndex teamIndex = slot.teamComponent.teamIndex; List list = new List(); foreach (ProjectileController instances in InstanceTracker.GetInstancesList()) { if (!instances.cannotBeDeleted && instances.teamFilter.teamIndex != teamIndex) { Vector3 val2 = ((Component)instances).transform.position - (Object.op_Implicit((Object)(object)slot.characterBody) ? slot.characterBody.corePosition : ((Component)slot).transform.position); if (((Vector3)(ref val2)).sqrMagnitude < num) { list.Add(instances); } } } for (int num2 = list.Count - 1; num2 >= 0; num2--) { Object.Destroy((Object)(object)((Component)list[num2]).gameObject); } return true; } } public class MonkeysPaw : Equipment { public override bool isLunar => true; public override bool canBeRandomlyTriggered { get; protected set; } public override bool isEnigmaCompatible { get; protected set; } public override float cooldown { get; protected set; } = 120f; [AutoConfigRoOString(null, null)] [AutoConfig("Which object names are allowed for activation (comma-delimited, leading/trailing whitespace will be ignored). Target objects must also incorporate a ChestBehavior component. WARNING: May have unintended results on some untested objects!", AutoConfigFlags.DeferForever, new object[] { })] public string objectNamesConfig { get; private set; } = string.Join(", ", "Chest1", "Chest2", "GoldChest", "CategoryChestDamage", "CategoryChestHealing", "CategoryChestUtility", "CategoryChest2Damage Variant", "CategoryChest2Healing Variant", "CategoryChest2Utility Variant"); [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Cost reduction (0 = no reduction).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float refundFrac { get; private set; } = 0.5f; public GameObject idrPrefab { get; private set; } public static HashSet validObjectNames { get; private set; } = new HashSet(); protected override string[] GetDescStringArgs(string langID = null) { return new string[1] { refundFrac.ToString("0%") }; } public MonkeysPaw() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/MonkeysPaw.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/monkeysPawIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/MonkeysPaw.prefab"); } public override void SetupModifyEquipmentDef() { //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_0060: 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_0097: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00e0: 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_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) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0140: 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_015f: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Expected O, but got Unknown //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Expected O, but got Unknown //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Expected O, but got Unknown //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Expected O, but got Unknown //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053f: 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_0555: Expected O, but got Unknown //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Expected O, but got Unknown //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0663: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Expected O, but got Unknown //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Expected O, but got Unknown //IL_077a: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_07b0: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07ef: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Expected O, but got Unknown //IL_0823: Unknown result type (might be due to invalid IL or missing references) //IL_0828: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0843: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_0863: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) //IL_0883: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_08a2: Expected O, but got Unknown //IL_08cc: Unknown result type (might be due to invalid IL or missing references) //IL_08d1: Unknown result type (might be due to invalid IL or missing references) //IL_08e7: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_090c: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyEquipmentDef(); ((Renderer)((Component)base.modelResource.transform.Find("MonkeysPaw")).gameObject.GetComponent()).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Lemurian/matLemurian.mat").WaitForCompletion(); ((Renderer)((Component)idrPrefab.transform.Find("MonkeysPaw")).gameObject.GetComponent()).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Lemurian/matLemurian.mat").WaitForCompletion(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.22045f, -0.06626f, 0.11193f), localAngles = new Vector3(359.0299f, 357.3219f, 25.2928f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.38728f, 0.00965f, -0.06446f), localAngles = new Vector3(31.87035f, 332.9695f, 3.18838f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.23353f, -0.00868f, -0.08696f), localAngles = new Vector3(27.00084f, 326.5775f, 4.93487f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.6739f, -1.47899f, 1.63122f), localAngles = new Vector3(354.4511f, 7.12517f, 355.0916f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.24835f, 0.13692f, 0.12219f), localAngles = new Vector3(19.74273f, 338.7649f, 343.2596f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { childName = "Stomach", localPos = new Vector3(0.17437f, -0.01902f, 0.11239f), localAngles = new Vector3(14.62809f, 338.0782f, 18.2589f), localScale = new Vector3(0.3f, 0.3f, 0.3f), ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.28481f, -0.22564f, -0.12889f), localAngles = new Vector3(0.98176f, 51.91312f, 23.00177f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.16876f, -0.10376f, 0.02998f), localAngles = new Vector3(357.5521f, 355.006f, 105.9485f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ThighR", localPos = new Vector3(-0.08794f, 0.03176f, -0.06409f), localAngles = new Vector3(350.6662f, 317.2625f, 21.97947f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(2.33895f, -0.34548f, 0.80107f), localAngles = new Vector3(311.4177f, 7.89006f, 354.1869f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.75783f, -0.10773f, 0.00385f), localAngles = new Vector3(308.2326f, 10.8672f, 329.0782f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.28636f, -0.3815f, -0.06912f), localAngles = new Vector3(352.4358f, 63.85439f, 6.83272f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.17554f, -0.13447f, -0.0436f), localAngles = new Vector3(15.08189f, 9.51543f, 15.89409f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupConfig() { base.SetupConfig(); validObjectNames.UnionWith(from x in objectNamesConfig.Split(',') select x.Trim()); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); EquipmentSlot.UpdateTargets += new hook_UpdateTargets(EquipmentSlot_UpdateTargets); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); EquipmentSlot.UpdateTargets -= new hook_UpdateTargets(EquipmentSlot_UpdateTargets); } private bool IsInteractableValid(GameObject obj, out ChestBehavior cb, out PurchaseInteraction purch) { //IL_0036: 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_003d: 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_0042: Invalid comparison between Unknown and I4 cb = null; purch = null; if (!Object.op_Implicit((Object)(object)obj)) { return false; } bool flag = obj.TryGetComponent(ref cb); if (flag) { bool flag2 = !obj.TryGetComponent(ref purch); if (!flag2) { bool flag3 = purch.available; if (flag3) { CostTypeIndex costType = purch.costType; bool flag4 = costType - 1 <= 2; flag3 = flag4; } flag2 = flag3; } flag = flag2; } if (flag) { PickupDropTable dropTable = cb.dropTable; BasicPickupDropTable val = (BasicPickupDropTable)(object)((dropTable is BasicPickupDropTable) ? dropTable : null); if (val != null && val.equipmentWeight == 0f) { return val.lunarEquipmentWeight == 0f; } } return false; } private void EquipmentSlot_UpdateTargets(orig_UpdateTargets orig, EquipmentSlot self, EquipmentIndex targetingEquipmentIndex, bool userShouldAnticipateTarget) { //IL_0000: 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_001a: 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_000b: Unknown result type (might be due to invalid IL or missing references) if (targetingEquipmentIndex != base.catalogIndex) { orig.Invoke(self, targetingEquipmentIndex, userShouldAnticipateTarget); return; } self.currentTarget = default(UserTargetInfo); self.targetIndicator.targetTransform = null; GameObject val = CommonCode.FindNearestInteractable(((Component)self).gameObject, validObjectNames, self.GetAimRay(), 10f, 20f, requireLoS: false); if (Object.op_Implicit((Object)(object)val)) { self.targetIndicator.targetTransform = val.transform; if (IsInteractableValid(val, out var _, out var _)) { self.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load("Prefabs/LightningIndicator"); } else { self.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load("Prefabs/RecyclerBadIndicator"); } self.targetIndicator.active = true; } else { self.targetIndicator.active = false; } } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0234: 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_023b: 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_0268: Expected I4, but got Unknown //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Expected O, but got Unknown //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: 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_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0368: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) slot.UpdateTargets(base.catalogIndex, false); GameObject gameObject = ((Component)slot.targetIndicator.targetTransform).gameObject; if (!IsInteractableValid(gameObject, out var cb, out var purch)) { return false; } if (Object.op_Implicit((Object)(object)purch) && refundFrac != 1f) { int cost = purch.cost; purch.cost = Mathf.CeilToInt((float)purch.cost * (1f - refundFrac)); Interactor val = default(Interactor); if (!((Component)slot.characterBody).TryGetComponent(ref val) || !purch.CanBeAffordedByInteractor(val)) { purch.cost = cost; return false; } PayCostContext val2 = default(PayCostContext); DisposableRental val3 = ((BasePool)(object)PayCostContext.pool).Request(ref val2); try { PayCostResults val4 = default(PayCostResults); DisposableRental val5 = ((BasePool)(object)PayCostResults.pool).Request(ref val4); try { val2.cost = purch.cost; val2.activator = val; val2.activatorBody = ((Component)val).GetComponent(); val2.activatorMaster = (Object.op_Implicit((Object)(object)val2.activatorBody) ? val2.activatorBody.master : null); val2.activatorInventory = (Object.op_Implicit((Object)(object)val2.activatorBody) ? val2.activatorBody.inventory : null); val2.purchasedObject = gameObject; val2.purchaseInteraction = purch; val2.costTypeDef = CostTypeCatalog.GetCostTypeDef(purch.costType); val2.rng = base.rng; val2.avoidedItemIndex = (ItemIndex)(-1); val2.costTypeDef.PayCost(val2, val4); StatManager.OnPurchase>(slot.characterBody, purch.costType, ((IEnumerable)purch.purchaseStatNames).Select((Func)StatDef.Find)); ((UnityEvent)(object)purch.onPurchase).Invoke(val); ((UnityEvent)(object)purch.onDetailedPurchaseServer).Invoke(val2, val4); purch.lastActivator = val; } finally { val5.Dispose(); } } finally { val3.Dispose(); } } ChestBehavior obj = cb; obj.dropCount++; cb.Open(); Chat.SendBroadcastChat((ChatMessageBase)new SubjectChatMessage { baseToken = "TKSAT_MONKEYSPAW_ACTIVATED", subjectAsCharacterBody = slot.characterBody }); if (Object.op_Implicit((Object)(object)purch)) { purch.SetAvailable(false); } CatalogUtil.TryGetItemDef(CommonCode.GenerateAISafePickup(base.rng, cb.dropTable, Run.instance.smallChestDropTierSelector), out var itemDef); ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef(itemDef.tier); ItemTier tier = itemDef.tier; int num; switch (tier - 1) { case 0: case 6: num = 3; break; case 1: case 3: case 7: case 8: num = 1; break; default: num = 5; break; } int num2 = num; ColoredTokenChatMessage val6 = new ColoredTokenChatMessage(); ((SubjectChatMessage)val6).baseToken = "TKSAT_MONKEYSPAW_ITEMGRANT"; val6.paramTokens = new string[2] { Language.GetString(itemDef.nameToken), num2.ToString() }; val6.paramColors = (Color32[])(object)new Color32[2] { ColorCatalog.GetColor(itemTierDef.colorIndex), new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue) }; Chat.SendBroadcastChat((ChatMessageBase)(object)val6); foreach (TeamComponent item in from e in CommonCode.GatherEnemies((TeamIndex)1, default(TeamIndex), (TeamIndex)(-1)) where Object.op_Implicit((Object)(object)e.body) && Object.op_Implicit((Object)(object)e.body.inventory) select e) { ItemTransferOrb.DispatchItemTransferOrb(gameObject.transform.position, item.body.inventory, itemDef.itemIndex, num2, (Action)null, default(Either)); } slot.InvalidateCurrentTarget(); return true; } } public class UnstableBomb : Equipment { public GameObject projectilePrefab; public override bool isLunar => true; public override bool canBeRandomlyTriggered { get; protected set; } public override bool isEnigmaCompatible { get; protected set; } public override float cooldown { get; protected set; } = 40f; [AutoConfigRoOSlider("{0:P0}", 0f, 500f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Percentage of base damage to deal.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageFrac { get; private set; } = 80f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of the equipment attack.", AutoConfigFlags.DeferForever, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 1f; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[1] { damageFrac.ToString("0%") }; } public UnstableBomb() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/UnstableBomb.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/unstableBombIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/UnstableBomb.prefab"); } public override void SetupModifyEquipmentDef() { base.SetupModifyEquipmentDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); } public override void SetupAttributes() { //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_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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00b6: 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_00e1: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/UnstableBombShell.prefab"); ProjectileExplosion component = projectilePrefab.GetComponent(); component.explosionEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/FusionCellDestructible/FusionCellExplosion.prefab").WaitForCompletion(); ((Collider)projectilePrefab.GetComponent()).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/physmatBouncy.physicMaterial").WaitForCompletion(); component.blastProcCoefficient = procCoefficient; ParticleSystemRenderer component2 = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/Ghosts/UnstableBombShellGhost.prefab").GetComponent(); ((Renderer)component2).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/matOpaqueDustLargeDirectional.mat").WaitForCompletion(); ((Renderer)((Component)((Component)component2).transform.Find("IndicatorFixed")).GetComponent()).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Captain/matCaptainAirstrikeAltAreaIndicatorOuter.mat").WaitForCompletion(); ((Renderer)((Component)((Component)component2).transform.Find("IndicatorPulse")).GetComponent()).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Captain/matCaptainAirstrikeAltAreaIndicatorInner.mat").WaitForCompletion(); ContentAddition.AddProjectile(projectilePrefab); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); MapZone.TryZoneStart += new hook_TryZoneStart(MapZone_TryZoneStart); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); MapZone.TryZoneStart -= new hook_TryZoneStart(MapZone_TryZoneStart); } private void MapZone_TryZoneStart(orig_TryZoneStart orig, MapZone self, Collider other) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)self) || (int)self.zoneType != 0 || !Object.op_Implicit((Object)(object)other) || !Object.op_Implicit((Object)(object)((Component)other).GetComponent())) { orig.Invoke(self, other); } } protected override bool PerformEquipmentAction(EquipmentSlot slot) { //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_000e: 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_001b: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0090: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = slot.GetAimRay(); Quaternion rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction); ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = projectilePrefab, crit = slot.characterBody.RollCrit(), damage = slot.characterBody.damage * damageFrac, damageColorIndex = (DamageColorIndex)3, force = 100f, owner = ((Component)slot).gameObject, position = ((Ray)(ref aimRay)).origin, rotation = rotation }); return true; } } [RequireComponent(typeof(CharacterBody), typeof(ProjectileExplosion))] public class ProjectileExplodeOnDeath : MonoBehaviour, IOnKilledServerReceiver { public void OnKilledServer(DamageReport damageReport) { TinkersSatchelPlugin._logger.LogInfo((object)"Projectile killed"); CharacterBody component = ((Component)this).GetComponent(); ProjectileExplosion component2 = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2)) { component2.Detonate(); } } } public class BismuthFlask : Item { public override ItemTier itemTier => (ItemTier)3; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)2 }); [AutoConfigRoOSlider("{0:P1}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Reduction to duration of debuffs/DoTs per stack (hyperbolic).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float debuffReduction { get; private set; } = 0.125f; [AutoConfigRoOSlider("{0:P1}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Reduction to duration of buffs per stack (hyperbolic).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float buffReduction { get; private set; } = 0.1f; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[2] { (1f - debuffReduction).ToString("P1"), (1f - buffReduction).ToString("P1") }; } public BismuthFlask() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/BismuthFlask.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/bismuthFlaskIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/BismuthFlask.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.13229f, -0.06816f, 0.11903f), localAngles = new Vector3(302.8133f, 27.57598f, 47.27724f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.21951f, 0.2191f, -0.10604f), localAngles = new Vector3(22.69201f, 69.13578f, 164.9348f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.10944f, 0.13985f, 0.21713f), localAngles = new Vector3(319.5523f, 246.8393f, 99.51362f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(2.28292f, 1.43586f, -0.91167f), localAngles = new Vector3(299.1197f, 57.21257f, 51.63428f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-0.1162f, -0.05832f, 0.18106f), localAngles = new Vector3(294.9001f, 247.6723f, 103.4995f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.12451f, 0.13473f, 0.10913f), localAngles = new Vector3(294.6539f, 315.7283f, 135.0021f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.10361f, 0.03687f, 0.15813f), localAngles = new Vector3(300.456f, 307.2197f, 122.3479f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.12205f, -0.0469f, 0.09215f), localAngles = new Vector3(318.3096f, 336.7556f, 109.7998f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.13921f, -0.07294f, 0.10236f), localAngles = new Vector3(3.3846f, 343.6192f, 120.1624f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(1.2443f, 3.29632f, -1.388f), localAngles = new Vector3(355.6995f, 147.9706f, 208.2942f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FlowerBase", localPos = new Vector3(-0.43748f, 0.77839f, 0.59737f), localAngles = new Vector3(318.3699f, 161.7631f, 192.5741f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.37926f, 0.04539f, 0.04029f), localAngles = new Vector3(19.18333f, 170.5805f, 275.3323f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.16383f, 0.21559f, -0.00468f), localAngles = new Vector3(16.63539f, 61.77726f, 186.1561f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { base.SetupAttributes(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Install(); CharacterBody.AddTimedBuff_BuffDef_float += new hook_AddTimedBuff_BuffDef_float(CharacterBody_AddTimedBuff_BuffDef_float); CharacterBody.AddTimedBuff_BuffDef_float_int += new hook_AddTimedBuff_BuffDef_float_int(CharacterBody_AddTimedBuff_BuffDef_float_int); DotController.InflictDot_refInflictDotInfo += new hook_InflictDot_refInflictDotInfo(DotController_InflictDot_refInflictDotInfo); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Uninstall(); CharacterBody.AddTimedBuff_BuffDef_float -= new hook_AddTimedBuff_BuffDef_float(CharacterBody_AddTimedBuff_BuffDef_float); CharacterBody.AddTimedBuff_BuffDef_float_int -= new hook_AddTimedBuff_BuffDef_float_int(CharacterBody_AddTimedBuff_BuffDef_float_int); DotController.InflictDot_refInflictDotInfo -= new hook_InflictDot_refInflictDotInfo(DotController_InflictDot_refInflictDotInfo); } private void DotController_InflictDot_refInflictDotInfo(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo) { CharacterBody body = default(CharacterBody); if (Object.op_Implicit((Object)(object)inflictDotInfo.victimObject) && inflictDotInfo.victimObject.TryGetComponent(ref body)) { int countEffective = GetCountEffective(body); if (countEffective > 0) { inflictDotInfo.duration *= Mathf.Pow(1f - debuffReduction, (float)countEffective); } } orig.Invoke(ref inflictDotInfo); } private void CharacterBody_AddTimedBuff_BuffDef_float_int(orig_AddTimedBuff_BuffDef_float_int orig, CharacterBody self, BuffDef buffDef, float duration, int maxStacks) { if (Object.op_Implicit((Object)(object)self)) { int countEffective = GetCountEffective(self); if (countEffective > 0) { duration *= Mathf.Pow(1f - (buffDef.isDebuff ? debuffReduction : buffReduction), (float)countEffective); } } orig.Invoke(self, buffDef, duration, maxStacks); } private void CharacterBody_AddTimedBuff_BuffDef_float(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration) { if (Object.op_Implicit((Object)(object)self)) { int countEffective = GetCountEffective(self); if (countEffective > 0) { duration *= Mathf.Pow(1f - (buffDef.isDebuff ? debuffReduction : buffReduction), (float)countEffective); } } orig.Invoke(self, buffDef, duration); } } public class ConcentratingAlembic : Item { public override ItemTier itemTier => (ItemTier)3; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Reduction to melee/blast range/radius per stack (linear divisor).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float rangeReduc { get; private set; } = 0.1f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Reduction to projectile speed per stack (linear divisor).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float speedReduc { get; private set; } = 0.1f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Reduction to hitscan range per stack (linear divisor).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float hitscanReduc { get; private set; } = 0.1f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("DoT damage multiplier per stack (linear).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageBuff { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Debuff duration multiplier per stack (linear).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float durationBuff { get; private set; } = 0.25f; protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { damageBuff.ToString("0%"), durationBuff.ToString("0%"), rangeReduc.ToString("0%"), speedReduc.ToString("0%"), hitscanReduc.ToString("0%") }; } public ConcentratingAlembic() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/ConcentratingAlembic.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/concentratingAlembicIcon.png"); } public override void SetupModifyItemDef() { base.SetupModifyItemDef(); } public override void SetupAttributes() { base.SetupAttributes(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown base.Install(); OverlapAttack.Fire += new Manipulator(OverlapAttack_Fire); BlastAttack.Fire += new hook_Fire(BlastAttack_Fire); BulletAttack.Fire += new hook_Fire(BulletAttack_Fire); CharacterBody.AddTimedBuff_BuffDef_float += new hook_AddTimedBuff_BuffDef_float(CharacterBody_AddTimedBuff_BuffDef_float); CharacterBody.AddTimedBuff_BuffDef_float_int += new hook_AddTimedBuff_BuffDef_float_int(CharacterBody_AddTimedBuff_BuffDef_float_int); DotController.InflictDot_refInflictDotInfo += new hook_InflictDot_refInflictDotInfo(DotController_InflictDot_refInflictDotInfo); ProjectileManager.InitializeProjectile += new hook_InitializeProjectile(ProjectileManager_InitializeProjectile); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown base.Uninstall(); OverlapAttack.Fire -= new Manipulator(OverlapAttack_Fire); BlastAttack.Fire -= new hook_Fire(BlastAttack_Fire); BulletAttack.Fire -= new hook_Fire(BulletAttack_Fire); CharacterBody.AddTimedBuff_BuffDef_float -= new hook_AddTimedBuff_BuffDef_float(CharacterBody_AddTimedBuff_BuffDef_float); CharacterBody.AddTimedBuff_BuffDef_float_int -= new hook_AddTimedBuff_BuffDef_float_int(CharacterBody_AddTimedBuff_BuffDef_float_int); DotController.InflictDot_refInflictDotInfo -= new hook_InflictDot_refInflictDotInfo(DotController_InflictDot_refInflictDotInfo); ProjectileManager.InitializeProjectile -= new hook_InitializeProjectile(ProjectileManager_InitializeProjectile); } private void ProjectileManager_InitializeProjectile(orig_InitializeProjectile orig, ProjectileController projectileController, FireProjectileInfo fireProjectileInfo) { //IL_0002: 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_0018: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(projectileController, fireProjectileInfo); CharacterBody body = default(CharacterBody); if (!Object.op_Implicit((Object)(object)fireProjectileInfo.owner) || !fireProjectileInfo.owner.TryGetComponent(ref body) || GetCountEffective(body) <= 0) { return; } float num = 1f + (float)GetCountEffective(body) * speedReduc; ProjectileSimple val = default(ProjectileSimple); if (((Component)projectileController).TryGetComponent(ref val)) { ProjectileSimple obj = val; obj.desiredForwardSpeed /= num; ProjectileSimple obj2 = val; obj2.oscillateSpeed /= num; ProjectileSimple obj3 = val; obj3.oscillateMagnitude /= num; AnimationCurve velocityOverLifetime = val.velocityOverLifetime; if (velocityOverLifetime != null) { for (int i = 0; i < velocityOverLifetime.length; i++) { ref Keyframe reference = ref velocityOverLifetime.keys[i]; ((Keyframe)(ref reference)).value = ((Keyframe)(ref reference)).value / num; } } } BoomerangProjectile val2 = default(BoomerangProjectile); if (((Component)projectileController).TryGetComponent(ref val2)) { BoomerangProjectile obj4 = val2; obj4.travelSpeed /= num; } MissileController val3 = default(MissileController); if (((Component)projectileController).TryGetComponent(ref val3)) { MissileController obj5 = val3; obj5.maxVelocity /= num; MissileController obj6 = val3; obj6.acceleration /= num; } } private void DotController_InflictDot_refInflictDotInfo(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo) { CharacterBody body = default(CharacterBody); if (Object.op_Implicit((Object)(object)inflictDotInfo.attackerObject) && inflictDotInfo.attackerObject.TryGetComponent(ref body)) { inflictDotInfo.damageMultiplier *= 1f + damageBuff * (float)GetCountEffective(body); } orig.Invoke(ref inflictDotInfo); } private void CharacterBody_AddTimedBuff_BuffDef_float_int(orig_AddTimedBuff_BuffDef_float_int orig, CharacterBody self, BuffDef buffDef, float duration, int maxStacks) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self) && buffDef.isDebuff) { int num = CommonCode.GatherEnemies(TeamComponent.GetObjectTeam(((Component)self).gameObject)).Sum((TeamComponent x) => Object.op_Implicit((Object)(object)x.body) ? GetCountEffective(x.body) : 0); duration *= 1f + (float)num * durationBuff; } orig.Invoke(self, buffDef, duration, maxStacks); } private void CharacterBody_AddTimedBuff_BuffDef_float(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self) && buffDef.isDebuff) { int num = CommonCode.GatherEnemies(TeamComponent.GetObjectTeam(((Component)self).gameObject)).Sum((TeamComponent x) => Object.op_Implicit((Object)(object)x.body) ? GetCountEffective(x.body) : 0); duration *= 1f + (float)num * durationBuff; } orig.Invoke(self, buffDef, duration); } private Result BlastAttack_Fire(orig_Fire orig, BlastAttack self) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) float radius = self.radius; CharacterBody body = default(CharacterBody); if (Object.op_Implicit((Object)(object)self.attacker) && self.attacker.TryGetComponent(ref body)) { int countEffective = GetCountEffective(body); self.radius /= 1f + (float)countEffective * rangeReduc; } Result result = orig.Invoke(self); self.radius = radius; return result; } private void OverlapAttack_Fire(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0039: 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_lossyScale") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(Vector3 origFullExtents, OverlapAttack self) { //IL_0021: 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_000d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)self.attacker)) { return origFullExtents; } int countEffective = GetCountEffective(self.attacker.GetComponent()); return origFullExtents / (1f + rangeReduc * (float)countEffective); }); } else { TinkersSatchelPlugin._logger.LogError((object)"ConcentratingAlembic: failed to apply IL hook (OverlapAttack_Fire), target instructions not found. Item will not apply a hitbox scale malus."); } } private void BulletAttack_Fire(orig_Fire orig, BulletAttack self) { float num = 1f; CharacterBody body = default(CharacterBody); if (Object.op_Implicit((Object)(object)self.owner) && self.owner.TryGetComponent(ref body)) { num += (float)GetCountEffective(body) * hitscanReduc; } self.maxDistance /= num; orig.Invoke(self); self.maxDistance *= num; } } public class HealsToDamage : Item { public override ItemTier itemTier => (ItemTier)3; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); public override bool itemIsAIBlacklisted { get; protected set; } [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Fraction of healing to absorb, stacks hyperbolically.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float healingRatio { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Additional multiplier to HealingRatio for overheal.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float overhealMalus { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:P0}", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Absorbed healing required to activate the buff, relative to max health.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float activationRatio { get; private set; } = 1f; [AutoConfigRoOSlider("{0:N0} s", 0f, 60f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Duration of the buff, once triggered.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffDuration { get; private set; } = 10f; [AutoConfigRoOSlider("{0:N1}", 0f, 30f, null, null)] [AutoConfig("Attack speed multiplier to add per buff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffMagnitudeAttackSpeed { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:N1}", 0f, 30f, null, null)] [AutoConfig("Damage multiplier to add per buff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffMagnitudeDamage { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:N1}", 0f, 30f, null, null)] [AutoConfig("Move speed multiplier to add per buff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffMagnitudeMoveSpeed { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:N1}", 0f, 30f, null, null)] [AutoConfig("Jump power multiplier to add per buff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffMagnitudeJumpPower { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:N1}", 0f, 30f, null, null)] [AutoConfig("Health regen multiplier to add per buff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffMagnitudeRegen { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:N1}", 0f, 30f, null, null)] [AutoConfig("Base crit chance to add per buff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffMagnitudeCrit { get; private set; } = 20f; [AutoConfigRoOSlider("{0:N1}", 0f, 30f, null, null)] [AutoConfig("Base armor to add per buff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffMagnitudeArmor { get; private set; } = 20f; public BuffDef damageBonusDisplayBuff { get; private set; } public BuffDef statBuff { get; private set; } public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[4] { healingRatio.ToString("0%"), activationRatio.ToString("0%"), buffDuration.ToString("N0"), (1f - overhealMalus).ToString("0%") }; } public HealsToDamage() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/HealsToDamage.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/healsToDamageIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/HealsToDamage.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.08787f, -0.04989f, -0.03935f), localAngles = new Vector3(30.13251f, 293.0449f, 327.4671f), localScale = new Vector3(0.15f, 0.15f, 0.15f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ClavicleR", localPos = new Vector3(-0.00645f, 0.03074f, -0.1937f), localAngles = new Vector3(20.21178f, 14.35402f, 86.373f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.22486f, 0.10162f, 0.07297f), localAngles = new Vector3(32.10413f, 257.2959f, 308.3725f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-2.54985f, -1.75031f, -0.71476f), localAngles = new Vector3(358.8855f, 96.69154f, 7.19764f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.20697f, -0.07894f, 0.1159f), localAngles = new Vector3(33.8656f, 224.6563f, 247.6386f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.16213f, 0.05587f, -0.00046f), localAngles = new Vector3(23.45041f, 267.2077f, 272.5279f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Neck", localPos = new Vector3(-0.13388f, 0.07636f, 0.00536f), localAngles = new Vector3(28.35369f, 79.95956f, 216.4976f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.07164f, 0.3223f, 0.04066f), localAngles = new Vector3(10.5521f, 257.2036f, 293.1262f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Neck", localPos = new Vector3(-0.13381f, 0.12336f, -0.04349f), localAngles = new Vector3(4.97062f, 83.73137f, 278.397f), localScale = new Vector3(0.15f, 0.15f, 0.15f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.10636f, 3.7239f, -1.98175f), localAngles = new Vector3(82.16266f, 358.3847f, 196.6429f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FlowerBase", localPos = new Vector3(0.78308f, 1.38417f, 0.17772f), localAngles = new Vector3(14.83111f, 255.5348f, 316.8267f), localScale = new Vector3(0.6f, 0.6f, 0.6f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Neck", localPos = new Vector3(0.02508f, 0.05103f, -0.06036f), localAngles = new Vector3(30.09493f, 9.06698f, 266.63f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Neck", localPos = new Vector3(0.2047f, 0.08958f, 0.1356f), localAngles = new Vector3(38.56324f, 226.4295f, 325.2418f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); } public override void SetupAttributes() { //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) //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) base.SetupAttributes(); damageBonusDisplayBuff = ScriptableObject.CreateInstance(); damageBonusDisplayBuff.buffColor = Color.red; damageBonusDisplayBuff.canStack = true; damageBonusDisplayBuff.isDebuff = false; damageBonusDisplayBuff.isCooldown = true; ((Object)damageBonusDisplayBuff).name = base.modInfo.shortIdentifier + "HealsToDamageCharging"; damageBonusDisplayBuff.iconSprite = base.iconResource; damageBonusDisplayBuff.ignoreGrowthNectar = true; ContentAddition.AddBuffDef(damageBonusDisplayBuff); statBuff = ScriptableObject.CreateInstance(); statBuff.buffColor = Color.green; statBuff.canStack = true; statBuff.isDebuff = false; ((Object)statBuff).name = base.modInfo.shortIdentifier + "HealsToDamageActive"; statBuff.iconSprite = base.iconResource; ContentAddition.AddBuffDef(statBuff); } public override void Install() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Install(); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; HealthComponent.Heal += new Manipulator(HealthComponent_Heal); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } public override void Uninstall() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Uninstall(); CharacterBody.onBodyInventoryChangedGlobal -= CharacterBody_onBodyInventoryChangedGlobal; HealthComponent.Heal -= new Manipulator(HealthComponent_Heal); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { int buffCount = sender.GetBuffCount(statBuff); args.baseAttackSpeedAdd += (float)buffCount * buffMagnitudeAttackSpeed * (sender.baseAttackSpeed + sender.levelAttackSpeed * sender.level); args.baseDamageAdd += (float)buffCount * buffMagnitudeDamage * (sender.baseDamage + sender.levelDamage * sender.level); args.baseMoveSpeedAdd += (float)buffCount * buffMagnitudeMoveSpeed * (sender.baseMoveSpeed + sender.levelMoveSpeed * sender.level); args.baseJumpPowerAdd += (float)buffCount * buffMagnitudeJumpPower * (sender.baseJumpPower + sender.levelJumpPower * sender.level); args.baseRegenAdd += (float)buffCount * buffMagnitudeRegen * (sender.baseRegen + sender.levelRegen * sender.level); args.critAdd += (float)buffCount * buffMagnitudeCrit; args.armorAdd += (float)buffCount * buffMagnitudeArmor; } } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { if (GetCountEffective(body) > 0 && !Object.op_Implicit((Object)(object)((Component)body).GetComponent())) { ((Component)body).gameObject.AddComponent(); } } private void HealthComponent_Heal(ILContext il) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int amtArgIndex = -1; int num2LocIndex = -1; if (val.TryGotoNext((MoveType)0, new Func[6] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref amtArgIndex), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2LocIndex), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "health"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_fullHealth") })) { val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg, amtArgIndex); val.Emit(OpCodes.Ldarg_3); val.EmitDelegate>((Func)delegate(HealthComponent self, float origAmount, bool nonRegen) { HealDamageConversionTracker healDamageConversionTracker = default(HealDamageConversionTracker); if (nonRegen && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && ((Component)self.body).TryGetComponent(ref healDamageConversionTracker)) { int countEffective = GetCountEffective(self.body); if (countEffective > 0) { float num = self.fullHealth - self.health; float num2 = origAmount; float num3 = 0f; if (origAmount > num) { num2 = num; num3 = origAmount - num; } float num4 = 1f - Mathf.Pow(1f - healingRatio, (float)countEffective); float num5 = num2 * num4; float num6 = num3 * num4 * overhealMalus; healDamageConversionTracker.ReceiveHealing((num5 + num6) / self.fullHealth); return origAmount - num5; } } return origAmount; }); val.Emit(OpCodes.Dup); val.Emit(OpCodes.Starg, amtArgIndex); val.Emit(OpCodes.Stloc, num2LocIndex); } else { TinkersSatchelPlugin._logger.LogError((object)"HealsToDamage: failed to apply IL hook (HealthComponent_Heal), target instructions not found. Item will not work."); } } } [RequireComponent(typeof(CharacterBody))] public class HealDamageConversionTracker : MonoBehaviour { private float storedHealingRatio; private CharacterBody body; private void Awake() { body = ((Component)this).GetComponent(); } public void ReceiveHealing(float healingRatio) { //IL_008e: 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) storedHealingRatio += healingRatio; if (storedHealingRatio >= Item.instance.activationRatio) { int num = Mathf.FloorToInt(storedHealingRatio / Item.instance.activationRatio); storedHealingRatio %= Item.instance.activationRatio; for (int i = 0; i < num; i++) { body.AddTimedBuff(Item.instance.statBuff.buffIndex, Item.instance.buffDuration); } } body.SetBuffCount(Item.instance.damageBonusDisplayBuff.buffIndex, Mathf.FloorToInt(storedHealingRatio / Item.instance.activationRatio * 100f)); } } public class MountainToken : Item { public override ItemTier itemTier => (ItemTier)3; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)17 }); [AutoConfigRoOSlider("{0:N1} s", 0f, 60f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Time spent in midair after which all bonus item stacks will have been removed and granted to enemies. Bonus items decay linearly over this timespan.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float maxUngroundedTime { get; private set; } = 20f; [AutoConfigRoOSlider("{0:N0}", 0f, 600f, null, null)] [AutoConfig("Amount of extra monster credits to assign to the teleporter event per stack (scales with time).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float difficultyBonus { get; private set; } = 100f; public BuffDef eligibilityBuff { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[1] { maxUngroundedTime.ToString("N1") }; } public MountainToken() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/MountainToken.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/mountainTokenIcon.png"); } public override void SetupAttributes() { //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) base.SetupAttributes(); eligibilityBuff = ScriptableObject.CreateInstance(); eligibilityBuff.buffColor = Color.blue; eligibilityBuff.canStack = true; eligibilityBuff.isDebuff = false; ((Object)eligibilityBuff).name = "TKSATMountainTokenEligibility"; eligibilityBuff.iconSprite = base.itemDef.pickupIconSprite; eligibilityBuff.ignoreGrowthNectar = true; ContentAddition.AddBuffDef(eligibilityBuff); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Install(); BossGroup.DropRewards += new Manipulator(BossGroup_DropRewards); ChargingState.OnEnter += new hook_OnEnter(ChargingState_OnEnter); ChargingState.OnEnter += new Manipulator(ChargingState_OnEnter_IL); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Uninstall(); BossGroup.DropRewards -= new Manipulator(BossGroup_DropRewards); ChargingState.OnEnter -= new hook_OnEnter(ChargingState_OnEnter); ChargingState.OnEnter -= new Manipulator(ChargingState_OnEnter_IL); } private void BossGroup_DropRewards(ILContext il) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_00b9: 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_00f7: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int locRewardCount = -1; if (val.TryGotoNext(new Func[3] { (Instruction i) => ILPatternMatchingExt.MatchCall(i, "get_bonusRewardCount"), (Instruction i) => ILPatternMatchingExt.MatchAdd(i), (Instruction i) => ILPatternMatchingExt.MatchStloc(i, ref locRewardCount) }) && val.TryGotoNext((MoveType)2, new Func[2] { (Instruction i) => ILPatternMatchingExt.MatchLdcR4(i, 360f), (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, locRewardCount) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(int origRewards, BossGroup bg) { int num = 0; MountainTokenTracker mountainTokenTracker = default(MountainTokenTracker); foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { if (readOnlyInstances.isParticipating) { CharacterBody currentBody = readOnlyInstances.GetCurrentBody(); if (Object.op_Implicit((Object)(object)currentBody) && ((Component)currentBody).TryGetComponent(ref mountainTokenTracker)) { num += mountainTokenTracker.Stacks; mountainTokenTracker.Unset(); } } } return origRewards + num; }); val.Emit(OpCodes.Dup); val.Emit(OpCodes.Stloc, locRewardCount); } else { TinkersSatchelPlugin._logger.LogError((object)"MountainToken: Failed to apply IL hook (BossGroup_DropRewards), item will not provide extra teleporter rewards"); } } private void ChargingState_OnEnter_IL(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[1] { (Instruction i) => ILPatternMatchingExt.MatchStfld(i, "monsterCredit") }); val.EmitDelegate>((Func)delegate(float origCredits) { int num = 0; foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && readOnlyInstances.isParticipating) { CharacterBody currentBody = readOnlyInstances.GetCurrentBody(); if (Object.op_Implicit((Object)(object)currentBody)) { num += GetCountEffective(currentBody); } } } return origCredits + (float)num * difficultyBonus * Mathf.Pow(Run.instance.compensatedDifficultyCoefficient, 0.5f); }); } private void ChargingState_OnEnter(orig_OnEnter orig, ChargingState self) { orig.Invoke(self); MountainTokenTracker mountainTokenTracker = default(MountainTokenTracker); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (GetCountEffective(readOnlyInstances) > 0 && !((Component)readOnlyInstances).TryGetComponent(ref mountainTokenTracker)) { ((Component)readOnlyInstances).gameObject.AddComponent(); } } foreach (MountainTokenTracker readOnlyInstances2 in MountainTokenTracker.readOnlyInstancesList) { readOnlyInstances2.Reset(); } } public static void GrantToEnemiesInTeleporter() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_00aa: 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_00ab: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || !Object.op_Implicit((Object)(object)TeleporterInteraction.instance.bossGroup) || !Object.op_Implicit((Object)(object)TeleporterInteraction.instance.bossGroup.dropTable)) { return; } PickupIndex none = PickupIndex.none; List list = (TeleporterInteraction.instance.bossGroup.forceTier3Reward ? Run.instance.availableTier3DropList : Run.instance.availableTier2DropList); none = ((!Object.op_Implicit((Object)(object)TeleporterInteraction.instance.bossGroup.dropTable)) ? CommonCode.GenerateAISafePickup(Item.instance.rng, list) : CommonCode.GenerateAISafePickup(Item.instance.rng, TeleporterInteraction.instance.bossGroup.dropTable, list)); if (!CatalogUtil.TryGetItemDef(none, out var val)) { return; } foreach (TeamComponent item in from e in CommonCode.GatherEnemies((TeamIndex)1, default(TeamIndex), (TeamIndex)(-1)) where Object.op_Implicit((Object)(object)e.body) && Object.op_Implicit((Object)(object)e.body.inventory) && TeleporterInteraction.instance.holdoutZoneController.IsBodyInChargingRadius(e.body) select e) { ItemTransferOrb.DispatchItemTransferOrb(((Component)TeleporterInteraction.instance.holdoutZoneController).transform.position, item.body.inventory, val.itemIndex, 1, (Action)null, default(Either)); } } } [RequireComponent(typeof(CharacterBody))] public class MountainTokenTracker : MonoBehaviour { private static readonly List instancesList = new List(); public static readonly ReadOnlyCollection readOnlyInstancesList = new ReadOnlyCollection(instancesList); private CharacterBody body; private float ungroundedTime; private int _stacks; private int maxStacks; public int Stacks { get { return _stacks; } private set { //IL_0024: Unknown result type (might be due to invalid IL or missing references) _stacks = value; if (Object.op_Implicit((Object)(object)body)) { body.SetBuffCount(Item.instance.eligibilityBuff.buffIndex, _stacks); } } } private void Awake() { body = ((Component)this).GetComponent(); } private void OnEnable() { instancesList.Add(this); } private void OnDisable() { instancesList.Remove(this); } private void FixedUpdate() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)body.characterMotor) || body.characterMotor.isGrounded || !Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || (int)TeleporterInteraction.instance.activationState != 2 || Stacks <= 0) { return; } ungroundedTime += Time.fixedDeltaTime; if (ungroundedTime > Item.instance.maxUngroundedTime / (float)maxStacks) { ungroundedTime = 0f; Stacks--; if (NetworkServer.active) { MountainToken.GrantToEnemiesInTeleporter(); } } } public void Reset() { ungroundedTime = 0f; maxStacks = Item.instance.GetCountEffective(body); Stacks = maxStacks; } public void Unset() { Stacks = 0; } } public class WaxFeather : Item { public override ItemTier itemTier => (ItemTier)3; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:N1} s", 0f, 15f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Airtime required to accumulate a buff/debuff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float chargeFreq { get; private set; } = 0.4f; [AutoConfigRoOIntSlider("{0:N0}", 1, 100, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Maximum buff/debuff stacks per item stack.", AutoConfigFlags.None, new object[] { 1, int.MaxValue })] public int maxStacks { get; private set; } = 10; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("How fast to decay charge while grounded, relative to chargeFreq.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float decayFreqMult { get; private set; } = 3f; [AutoConfigRoOSlider("{0:N0}%", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Ignite chance at full strength (does not stack).", AutoConfigFlags.None, new object[] { 0f, 100f })] public float igniteChance { get; private set; } = 15f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Relative ignite damage per stack at full strength (linear).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float igniteDamage { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:N0}", 0f, 1000f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Armor penalty per stack at full strength (linear).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float armorDebuff { get; private set; } = 5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Gravity reduction per stack at full strength (hyperbolic).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float gravityBuff { get; private set; } = 0.015f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Speed penalty per stack at full strength (linear divisor).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float speedDebuff { get; private set; } = 0.01f; public BuffDef statusBuff { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[8] { chargeFreq.ToString("N1"), maxStacks.ToString("N0"), (igniteChance / 100f).ToString("0%"), igniteDamage.ToString("P0"), gravityBuff.ToString("P0"), armorDebuff.ToString("N0"), speedDebuff.ToString("0%"), (1f / decayFreqMult).ToString("P0") }; } public WaxFeather() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/WaxFeather.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/waxFeatherIcon.png"); } public override void SetupAttributes() { //IL_0026: 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) base.SetupAttributes(); statusBuff = ScriptableObject.CreateInstance(); statusBuff.buffColor = new Color(1f, 0.6f, 0.2f); statusBuff.canStack = true; statusBuff.isDebuff = false; ((Object)statusBuff).name = "TKSATIcarusDisplay"; statusBuff.iconSprite = base.itemDef.pickupIconSprite; ContentAddition.AddBuffDef(statusBuff); } public override void Install() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } public override void Uninstall() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); CharacterBody.onBodyInventoryChangedGlobal -= CharacterBody_onBodyInventoryChangedGlobal; RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody obj) { IcarusTracker icarusTracker = default(IcarusTracker); if (GetCountEffective(obj) > 0 && !((Component)obj).TryGetComponent(ref icarusTracker)) { ((Component)obj).gameObject.AddComponent(); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { args.moveSpeedReductionMultAdd += (float)sender.GetBuffCount(statusBuff) * speedDebuff; args.armorAdd -= (float)sender.GetBuffCount(statusBuff) * armorDebuff; } } [RequireComponent(typeof(CharacterBody))] public class IcarusTracker : MonoBehaviour { private CharacterBody body; private float charge; private int stacks; private void Awake() { body = ((Component)this).GetComponent(); body.onInventoryChanged += Body_onInventoryChanged; GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; } private void OnDestroy() { body.onInventoryChanged -= Body_onInventoryChanged; GlobalEventManager.onServerDamageDealt -= GlobalEventManager_onServerDamageDealt; } private void FixedUpdate() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_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_0140: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.FloorToInt(charge); int num2; if (Object.op_Implicit((Object)(object)body.characterMotor)) { num2 = ((!body.characterMotor.isGrounded) ? 1 : 0); if (num2 != 0) { charge += Time.fixedDeltaTime / Item.instance.chargeFreq; if (charge > (float)stacks) { charge = stacks; } goto IL_00b2; } } else { num2 = 0; } charge -= Time.fixedDeltaTime / Item.instance.chargeFreq * Item.instance.decayFreqMult; if (charge < 0f) { charge = 0f; } goto IL_00b2; IL_00b2: int num3 = Mathf.FloorToInt(charge); if (num3 != num) { body.SetBuffCount(Item.instance.statusBuff.buffIndex, num3); body.statsDirty = true; } if (num2 != 0) { CharacterMotor characterMotor = body.characterMotor; characterMotor.velocity -= Physics.gravity * Mathf.Min(1f - Mathf.Pow(1f - Item.instance.gravityBuff, charge), 0.95f) * Time.fixedDeltaTime; } } private void Body_onInventoryChanged() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) stacks = Item.instance.GetCountEffective(body) * Item.instance.maxStacks; if (stacks == 0) { body.SetBuffCount(Item.instance.statusBuff.buffIndex, 0); body.statsDirty = true; Object.Destroy((Object)(object)this); } } private void GlobalEventManager_onServerDamageDealt(DamageReport report) { //IL_0067: 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_00c4: 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) if (report != null && Object.op_Implicit((Object)(object)report.victimBody) && Object.op_Implicit((Object)(object)report.attackerBody) && !((Object)(object)report.attackerBody != (Object)(object)body) && Util.CheckRoll(Item.instance.igniteChance * Mathf.Min(charge, 1f), report.attackerMaster.luck, report.attackerMaster)) { InflictDotInfo val = default(InflictDotInfo); val.victimObject = ((Component)report.victim).gameObject; val.attackerObject = report.attacker; val.totalDamage = report.damageDealt * Item.instance.igniteDamage * charge; val.dotIndex = (DotIndex)1; val.damageMultiplier = 1f; InflictDotInfo val2 = val; if (Object.op_Implicit((Object)(object)report.attackerMaster)) { StrengthenBurnUtils.CheckDotForUpgrade(report.attackerMaster.inventory, ref val2); } DotController.InflictDot(ref val2); } } } public class ExtendoArms : Item { public override ItemTier itemTier => (ItemTier)0; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:P1}", 0f, 3f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Hitbox scale increase per stack, linear.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float resizeAmount { get; private set; } = 0.125f; [AutoConfigRoOSlider("{0:P1}", 0f, 3f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Projectile velocity increase per stack, linear.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float speedAmount { get; private set; } = 0.075f; [AutoConfigRoOSlider("{0:P1}", 0f, 3f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Hitscan range increase per stack, linear.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float rangeAmount { get; private set; } = 0.075f; [AutoConfigRoOSlider("{0:P1}", 0f, 3f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Global attack damage increase per stack, linear.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageAmount { get; private set; } = 0.05f; [AutoConfigRoOSlider("{0:N1}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Maximum distance between character and center of an AoE to count as a PBAoE.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float pbaoeRange { get; private set; } = 5f; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { pbaoeRange.ToString("N1"), resizeAmount.ToString("0.0%"), damageAmount.ToString("0.0%"), speedAmount.ToString("0.0%"), rangeAmount.ToString("0.0%") }; } public ExtendoArms() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/ExtendoArms.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/extendoArmsIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/ExtendoArms.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: 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_02d8: Expected O, but got Unknown //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Expected O, but got Unknown //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Expected O, but got Unknown //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Expected O, but got Unknown //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0547: 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_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0566: 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_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //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_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Expected O, but got Unknown //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Expected O, but got Unknown //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Expected O, but got Unknown //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_0790: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07ab: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_080a: Expected O, but got Unknown //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_086f: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_0894: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Unknown result type (might be due to invalid IL or missing references) //IL_08a9: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Expected O, but got Unknown //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_091e: Unknown result type (might be due to invalid IL or missing references) //IL_093d: Unknown result type (might be due to invalid IL or missing references) //IL_0946: Unknown result type (might be due to invalid IL or missing references) //IL_0952: Unknown result type (might be due to invalid IL or missing references) //IL_095c: Expected O, but got Unknown //IL_0986: Unknown result type (might be due to invalid IL or missing references) //IL_098b: Unknown result type (might be due to invalid IL or missing references) //IL_09a1: Unknown result type (might be due to invalid IL or missing references) //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09bc: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_09c7: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "SideWeapon", localPos = new Vector3(0.04871f, -0.0517f, -0.05809f), localAngles = new Vector3(339.1259f, 332.7074f, 338.0398f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.1149f, -0.0598f, -0.09023f), localAngles = new Vector3(359.4513f, 311.727f, 0.74839f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "GunL", localPos = new Vector3(0.07202f, 0.30722f, 0.05609f), localAngles = new Vector3(28.85717f, 119.0983f, 356.3144f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(-1.90314f, 3.86177f, -0.64298f), localAngles = new Vector3(323.6013f, 260.4215f, 8.38977f), localScale = new Vector3(6f, 6f, 6f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(2.05511f, 3.51125f, -0.54888f), localAngles = new Vector3(334.2471f, 99.08073f, 173.5355f), localScale = new Vector3(6f, 6f, 6f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.0634f, 0.39865f, -0.0453f), localAngles = new Vector3(293.338f, 94.84317f, 271.7993f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(0.01928f, 0.36876f, -0.00257f), localAngles = new Vector3(275.5237f, 76.88559f, 122.6735f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechHandR", localPos = new Vector3(0.04269f, 0.51183f, -0.91419f), localAngles = new Vector3(288.8077f, 265.6227f, 70.82057f), localScale = new Vector3(0.6f, 0.6f, 0.6f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechHandL", localPos = new Vector3(0.02639f, 0.61712f, -0.89687f), localAngles = new Vector3(286.3646f, 79.14763f, 309.79f), localScale = new Vector3(0.6f, 0.6f, 0.6f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzleLeft", localPos = new Vector3(-0.03328f, -0.14288f, 0.09997f), localAngles = new Vector3(38.08634f, 339.2956f, 199.7518f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.05242f, 0.36935f, -0.05418f), localAngles = new Vector3(301.2559f, 228.3403f, 300.5837f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.45932f, 3.44736f, 0.37264f), localAngles = new Vector3(286.5494f, 304.4642f, 137.6044f), localScale = new Vector3(6f, 6f, 6f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "WeaponPlatformEnd", localPos = new Vector3(-0.00078f, -0.09947f, 0.1032f), localAngles = new Vector3(277.5991f, 92.14574f, 260.9365f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "GunRoot", localPos = new Vector3(0.04973f, 0.00476f, -0.19888f), localAngles = new Vector3(62.8163f, 278.6512f, 278.3401f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Hand", localPos = new Vector3(-0.20936f, 0.36034f, -0.01036f), localAngles = new Vector3(308.7173f, 263.5378f, 190.6475f), localScale = new Vector3(0.6f, 0.6f, 0.6f) } }); } public override void SetupAttributes() { base.SetupAttributes(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown base.Install(); OverlapAttack.Fire += new Manipulator(OverlapAttack_Fire); BlastAttack.Fire += new hook_Fire(BlastAttack_Fire); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); BulletAttack.Fire += new hook_Fire(BulletAttack_Fire); ProjectileManager.InitializeProjectile += new hook_InitializeProjectile(ProjectileManager_InitializeProjectile); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown base.Uninstall(); OverlapAttack.Fire -= new Manipulator(OverlapAttack_Fire); BlastAttack.Fire -= new hook_Fire(BlastAttack_Fire); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); BulletAttack.Fire -= new hook_Fire(BulletAttack_Fire); ProjectileManager.InitializeProjectile -= new hook_InitializeProjectile(ProjectileManager_InitializeProjectile); } public static float GetRangeMultiplier(CharacterBody body) { if (!Item.instance.enabled || !Object.op_Implicit((Object)(object)body)) { return 1f; } int countEffective = Item.instance.GetCountEffective(body.inventory); return 1f + (float)countEffective * Item.instance.resizeAmount; } [Obsolete("Damage bonus provided by this item is now global, and applied to the character's damage stat.")] public static float GetDamageMultiplier(CharacterBody body) { if (!Item.instance.enabled || !Object.op_Implicit((Object)(object)body)) { return 1f; } int countEffective = Item.instance.GetCountEffective(body.inventory); return 1f + (float)countEffective * Item.instance.damageAmount; } private void ProjectileManager_InitializeProjectile(orig_InitializeProjectile orig, ProjectileController projectileController, FireProjectileInfo fireProjectileInfo) { //IL_0002: 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_0018: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(projectileController, fireProjectileInfo); CharacterBody body = default(CharacterBody); if (!Object.op_Implicit((Object)(object)fireProjectileInfo.owner) || !fireProjectileInfo.owner.TryGetComponent(ref body) || GetCountEffective(body) <= 0) { return; } float num = 1f + (float)GetCountEffective(body) * speedAmount; ProjectileSimple val = default(ProjectileSimple); if (((Component)projectileController).TryGetComponent(ref val)) { ProjectileSimple obj = val; obj.desiredForwardSpeed *= num; ProjectileSimple obj2 = val; obj2.oscillateSpeed *= num; ProjectileSimple obj3 = val; obj3.oscillateMagnitude *= num; AnimationCurve velocityOverLifetime = val.velocityOverLifetime; if (velocityOverLifetime != null) { for (int i = 0; i < velocityOverLifetime.length; i++) { ref Keyframe reference = ref velocityOverLifetime.keys[i]; ((Keyframe)(ref reference)).value = ((Keyframe)(ref reference)).value * num; } } } BoomerangProjectile val2 = default(BoomerangProjectile); if (((Component)projectileController).TryGetComponent(ref val2)) { BoomerangProjectile obj4 = val2; obj4.travelSpeed *= num; } MissileController val3 = default(MissileController); if (((Component)projectileController).TryGetComponent(ref val3)) { MissileController obj5 = val3; obj5.maxVelocity *= num; MissileController obj6 = val3; obj6.acceleration *= num; } } private Result BlastAttack_Fire(orig_Fire orig, BlastAttack self) { //IL_0062: 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_002a: Unknown result type (might be due to invalid IL or missing references) float radius = self.radius; CharacterBody val = default(CharacterBody); if (Object.op_Implicit((Object)(object)self.attacker) && self.attacker.TryGetComponent(ref val) && Vector3.Distance(val.corePosition, self.position) < pbaoeRange) { int countEffective = GetCountEffective(val); self.radius *= 1f + (float)countEffective * resizeAmount; } Result result = orig.Invoke(self); self.radius = radius; return result; } private void OverlapAttack_Fire(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0039: 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_lossyScale") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(Vector3 origFullExtents, OverlapAttack self) { //IL_0021: 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_000d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)self.attacker)) { return origFullExtents; } int countEffective = GetCountEffective(self.attacker.GetComponent()); return origFullExtents * (1f + resizeAmount * (float)countEffective); }); } else { TinkersSatchelPlugin._logger.LogError((object)"ExtendoArms: failed to apply IL hook (OverlapAttack_Fire), target instructions not found. Item will not apply a hitbox scale bonus."); } } private void BulletAttack_Fire(orig_Fire orig, BulletAttack self) { float num = 1f; CharacterBody body = default(CharacterBody); if (Object.op_Implicit((Object)(object)self.owner) && self.owner.TryGetComponent(ref body)) { num += (float)GetCountEffective(body) * rangeAmount; } self.maxDistance *= num; orig.Invoke(self); self.maxDistance /= num; } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { args.damageMultAdd += (float)GetCountEffective(sender) * damageAmount; } } } public class Magnetism : Item { public override ItemTier itemTier => (ItemTier)0; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)3 }); [AutoConfigRoOSlider("{0:N0}", 0f, 5f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Projectile magnetism angle (deg) at first stack.", AutoConfigFlags.None, new object[] { 0f, 180f })] public float rangedAmountBase { get; private set; } = 1f; [AutoConfigRoOSlider("{0:N0}", 0f, 180f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Projectile magnetism angle (deg) cap.", AutoConfigFlags.None, new object[] { 0f, 180f })] public float rangedAmountMax { get; private set; } = 30f; [AutoConfigRoOIntSlider("{0:N0}", 1, 200, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Number of item stacks over which projectile magnetism angle approaches its cap by half.", AutoConfigFlags.None, new object[] { 1, int.MaxValue })] public int rangedAmountLambda { get; private set; } = 50; [AutoConfigRoOSlider("{0:N1}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Melee draw-in range (m) per stack, linear.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float meleeAmount { get; private set; } = 2f; [AutoConfigRoOSlider("{0:N0}", 0f, 100f, null, null)] [AutoConfig("Maximum melee draw-in pull speed (m/s).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float meleeForce { get; private set; } = 30f; [AutoConfigRoOSlider("{0:N0}", 0f, 10f, null, null)] [AutoConfig("Maximum melee draw-in pull angular speed (rotations/sec).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float meleeTurnForce { get; private set; } = 4f; [AutoConfigRoOSlider("{0:N0}%", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Global critical chance increase (percentage 0-100) per stack, linear.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float critAmount { get; private set; } = 2.5f; protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { rangedAmountBase.ToString("N2"), rangedAmountMax.ToString("N2"), rangedAmountLambda.ToString("N0"), meleeAmount.ToString("N1"), critAmount.ToString("N1") }; } public Magnetism() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Magnetism.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/magnetismIcon.png"); } public override void SetupModifyItemDef() { base.SetupModifyItemDef(); } public override void SetupAttributes() { base.SetupAttributes(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 base.Install(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); OverlapAttack.Fire += new hook_Fire(OverlapAttack_Fire); BulletAttack.Fire += new hook_Fire(BulletAttack_Fire); ProjectileManager.InitializeProjectile += new hook_InitializeProjectile(ProjectileManager_InitializeProjectile); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 base.Uninstall(); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); OverlapAttack.Fire -= new hook_Fire(OverlapAttack_Fire); BulletAttack.Fire -= new hook_Fire(BulletAttack_Fire); ProjectileManager.InitializeProjectile -= new hook_InitializeProjectile(ProjectileManager_InitializeProjectile); } private bool OverlapAttack_Fire(orig_Fire orig, OverlapAttack self, List hitResults) { //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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_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_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_00f4: 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_00a9: 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_0199: 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_01a6: 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_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0299: 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_0286: Unknown result type (might be due to invalid IL or missing references) bool result = orig.Invoke(self, hitResults); CharacterBody val = default(CharacterBody); if (!Object.op_Implicit((Object)(object)self.hitBoxGroup) || !Object.op_Implicit((Object)(object)self.attacker) || !self.attacker.TryGetComponent(ref val) || !Object.op_Implicit((Object)(object)val.characterMotor) || !Object.op_Implicit((Object)(object)val.characterDirection)) { return result; } Vector3 val2 = Vector3.zero; int num = 0; HitBox[] hitBoxes = self.hitBoxGroup.hitBoxes; foreach (HitBox val3 in hitBoxes) { if (Object.op_Implicit((Object)(object)val3) && ((Behaviour)val3).enabled && Object.op_Implicit((Object)(object)((Component)val3).gameObject) && ((Component)val3).gameObject.activeInHierarchy) { num++; val2 += ((Component)val3).transform.position; } } if (num == 0) { return result; } val2 /= (float)num; Vector3 val4 = val.corePosition - val2; if (((Vector3)(ref val4)).sqrMagnitude >= 25f) { return result; } List list = CommonCode.GatherEnemies(val.teamComponent.teamIndex, default(TeamIndex)); float num2 = meleeAmount * (float)GetCountEffective(val); foreach (TeamComponent item in list) { if (!Object.op_Implicit((Object)(object)item) || !Object.op_Implicit((Object)(object)item.body) || (!Object.op_Implicit((Object)(object)item.body.characterMotor) && !Object.op_Implicit((Object)(object)item.body.rigidbody)) || (Object.op_Implicit((Object)(object)item.body.healthComponent) && !item.body.healthComponent.alive)) { continue; } Vector3 val5 = val2 - item.body.corePosition; if (((Vector3)(ref val5)).magnitude < num2) { float num3 = ((Vector3)(ref val5)).magnitude / num2; float num4 = num3 * meleeForce; Vector3 val6 = ((!Object.op_Implicit((Object)(object)item.body.characterMotor)) ? item.body.rigidbody.velocity : item.body.characterMotor.velocity); float magnitude = ((Vector3)(ref val6)).magnitude; float num5 = meleeTurnForce * MathF.PI * 2f * num3; if (magnitude < num4) { val6 *= num4 / magnitude; } Vector3 velocity = Vector3.RotateTowards(val6, ((Vector3)(ref val5)).normalized * num4, num5 * Time.fixedDeltaTime, 0f); if (Object.op_Implicit((Object)(object)item.body.characterMotor)) { item.body.characterMotor.velocity = velocity; } else { item.body.rigidbody.velocity = velocity; } } } return result; } private void BulletAttack_Fire(orig_Fire orig, BulletAttack self) { //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) //IL_0043: 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_0050: 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) //IL_005a: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_008c: 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_00b8: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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) CharacterBody val = default(CharacterBody); if (Object.op_Implicit((Object)(object)self.owner) && self.owner.TryGetComponent(ref val)) { int countEffective = GetCountEffective(val); if (countEffective > 0) { BullseyeSearch val2 = new BullseyeSearch { maxAngleFilter = CalculateMagnetismAngle(countEffective), maxDistanceFilter = self.maxDistance, teamMaskFilter = TeamMask.allButNeutral, filterByLoS = true, searchOrigin = self.origin, searchDirection = self.aimVector, sortMode = (SortMode)2 }; ((TeamMask)(ref val2.teamMaskFilter)).RemoveTeam(val.teamComponent.teamIndex); val2.RefreshCandidates(); IEnumerable results = val2.GetResults(); if (results.Any()) { HurtBox val3 = results.First(); Vector3 val4 = ((Component)val3).transform.position - self.origin; self.aimVector = ((Vector3)(ref val4)).normalized; } } } orig.Invoke(self); } private void ProjectileManager_InitializeProjectile(orig_InitializeProjectile orig, ProjectileController projectileController, FireProjectileInfo fireProjectileInfo) { //IL_0002: 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_0015: 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_0031: 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_005f: 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) //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) //IL_007d: 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_008a: 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_0090: 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) //IL_0096: 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_009c: 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_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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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) orig.Invoke(projectileController, fireProjectileInfo); CharacterBody val = default(CharacterBody); MissileController val2 = default(MissileController); if (!Object.op_Implicit((Object)(object)fireProjectileInfo.owner) || !fireProjectileInfo.owner.TryGetComponent(ref val) || !Object.op_Implicit((Object)(object)fireProjectileInfo.projectilePrefab) || Object.op_Implicit((Object)(object)fireProjectileInfo.projectilePrefab.GetComponent()) || ((Component)projectileController).TryGetComponent(ref val2)) { return; } int countEffective = GetCountEffective(val); if (countEffective == 0) { return; } BullseyeSearch val3 = new BullseyeSearch { maxAngleFilter = CalculateMagnetismAngle(countEffective), maxDistanceFilter = 500f, teamMaskFilter = TeamMask.allButNeutral, filterByLoS = true, searchOrigin = fireProjectileInfo.position, searchDirection = fireProjectileInfo.rotation * Vector3.forward, sortMode = (SortMode)2 }; ((TeamMask)(ref val3.teamMaskFilter)).RemoveTeam(val.teamComponent.teamIndex); val3.RefreshCandidates(); IEnumerable results = val3.GetResults(); if (results.Any()) { HurtBox val4 = results.First(); TeamFilter val5 = default(TeamFilter); if (!((Component)projectileController).TryGetComponent(ref val5)) { ((Component)projectileController).gameObject.AddComponent().teamIndex = val.teamComponent.teamIndex; } ProjectileTargetComponent val6 = default(ProjectileTargetComponent); if (!((Component)projectileController).TryGetComponent(ref val6)) { val6 = ((Component)projectileController).gameObject.AddComponent(); } val6.target = ((Component)val4).transform; ((Component)projectileController).gameObject.AddComponent(); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { args.critAdd += (float)GetCountEffective(sender) * critAmount; } } private float CalculateMagnetismAngle(int stacks) { return Mathf.Lerp(rangedAmountBase, rangedAmountMax, 1f - Mathf.Pow(2f, (0f - ((float)stacks - 1f)) / (float)rangedAmountLambda)); } } [RequireComponent(typeof(ProjectileController))] [RequireComponent(typeof(ProjectileTargetComponent))] public class ProjectileForceTowardsTarget : MonoBehaviour { private ProjectileController controller; private ProjectileTargetComponent target; public float minSpeed = 30f; public float angularAccel = 360f; private void Awake() { controller = ((Component)this).GetComponent(); target = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_0020: 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_0070: 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_0090: 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) //IL_009a: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_0050: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)target.target)) { Vector3 val = controller.rigidbody.velocity; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < minSpeed) { Rigidbody rigidbody = controller.rigidbody; rigidbody.velocity *= minSpeed / magnitude; } Rigidbody rigidbody2 = controller.rigidbody; Vector3 velocity = controller.rigidbody.velocity; val = target.target.position - controller.rigidbody.position; rigidbody2.velocity = Vector3.RotateTowards(velocity, ((Vector3)(ref val)).normalized * minSpeed, angularAccel * MathF.PI / 180f, 0f); } } } public class MotionTracker : Item { internal static UnlockableDef unlockable; internal static GameObject vfxPrefab; internal static GameObject tracerEffectPrefab; internal static GameObject hitEffectPrefab; public override ItemTier itemTier => (ItemTier)0; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Damage coefficient of this item's attack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageFracBase { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of this item's attack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procFrac { get; private set; } = 0.35f; [AutoConfigRoOSlider("{0:N0} s", 0f, 60f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Time in combat required to recharge projectile attack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageTime { get; private set; } = 4f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Damage coefficient per additional item stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageFracStack { get; private set; } = 0.2f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, indicator VFX will be disabled.", AutoConfigFlags.None, new object[] { })] public bool disableVFX { get; private set; } [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { damageFracBase.ToString("0%"), damageTime.ToString("N0"), damageFracStack.ToString("0%") }; } public MotionTracker() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/MotionTracker.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/motionTrackerIcon.png"); vfxPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Misc/MotionTrackerIndicator.prefab"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/MotionTracker.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MainWeapon", localPos = new Vector3(-0.03808f, 0.34257f, 0.06901f), localAngles = new Vector3(359.0724f, 179.6853f, 269.6975f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzleGun", localPos = new Vector3(0.02929f, 0.06318f, -0.23436f), localAngles = new Vector3(84.86104f, 180.0003f, 85.8542f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "GunL", localPos = new Vector3(0.13281f, 0.12421f, 0.0553f), localAngles = new Vector3(7.62563f, 181.4729f, 2.13429f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmL", localPos = new Vector3(1.27773f, 3.88492f, -0.9831f), localAngles = new Vector3(9.66044f, 307.2604f, 269.1215f), localScale = new Vector3(4f, 4f, 4f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonHeadL", localPos = new Vector3(-0.21459f, 0.27626f, 0.1353f), localAngles = new Vector3(359.9774f, 94.53657f, 265.8145f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "BowBase", localPos = new Vector3(-0.09708f, -0.03416f, -0.05435f), localAngles = new Vector3(358.2427f, 0.36579f, 72.98668f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechHandR", localPos = new Vector3(0.10542f, 0.14123f, 0.11133f), localAngles = new Vector3(351.9657f, 231.0573f, 261.3159f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.14348f, -0.01409f, 0.02138f), localAngles = new Vector3(9.93206f, 97.79813f, 278.8011f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(-0.03423f, -0.11768f, -0.03466f), localAngles = new Vector3(4.52847f, 47.9074f, 279.7864f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmL", localPos = new Vector3(0.09233f, 2.16268f, -1.18963f), localAngles = new Vector3(1.85317f, 3.14276f, 277.0497f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "WeaponPlatformEnd", localPos = new Vector3(0.22507f, -0.21132f, 0.14108f), localAngles = new Vector3(357.0192f, 270.0101f, 268.9311f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "GunScope", localPos = new Vector3(0.06161f, -0.1885f, 0.19716f), localAngles = new Vector3(270.691f, 215.5541f, 234.1518f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonEnd", localPos = new Vector3(0.13595f, -0.01651f, -0.24505f), localAngles = new Vector3(355.1688f, 345.0563f, 260.352f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); hitEffectPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/SniperTargetHitEffect.prefab").WaitForCompletion(); tracerEffectPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Railgunner/TracerRailgunLight.prefab").WaitForCompletion(); Material material = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/matCritImpactHeavy.mat").WaitForCompletion(); ((Renderer)((Component)vfxPrefab.transform.Find("Background/IndParticleR")).GetComponent()).material = material; ((Renderer)((Component)vfxPrefab.transform.Find("Background/IndParticleL")).GetComponent()).material = material; unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/motionTrackerIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void Install() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void Uninstall() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); CharacterBody.onBodyInventoryChangedGlobal -= CharacterBody_onBodyInventoryChangedGlobal; HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { MotionTrackerTracker component = ((Component)body).GetComponent(); if (GetCountEffective(body) > 0 && !Object.op_Implicit((Object)(object)component)) { ((Component)body).gameObject.AddComponent(); } else if (GetCountEffective(body) == 0 && Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)damageInfo.attacker) || (disableSelfDamage && !((Object)(object)((Component)self).gameObject != (Object)(object)damageInfo.attacker))) { return; } MotionTrackerTracker component = damageInfo.attacker.GetComponent(); int countEffective = GetCountEffective(damageInfo.attacker.GetComponent()); if (Object.op_Implicit((Object)(object)component) && countEffective > 0) { component.SetInCombat(((Component)self).gameObject); } if (Object.op_Implicit((Object)(object)self.body)) { MotionTrackerTracker component2 = ((Component)self.body).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.SetInCombat(damageInfo.attacker); } } } } [RequireComponent(typeof(CharacterBody))] public class MotionTrackerTracker : MonoBehaviour { private const float COMBAT_TIMER = 6.05f; private CharacterBody ownerBody; private readonly Dictionary activeCombatants = new Dictionary(); private void Awake() { ownerBody = ((Component)this).GetComponent(); } private void OnDestroy() { KeyValuePair[] array = activeCombatants.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; if (keyValuePair.Value.Item3 != null) { keyValuePair.Value.Item3.active = false; } } } public void SetInCombat(GameObject with) { //IL_000a: 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) if (Object.op_Implicit((Object)(object)with) && TeamComponent.GetObjectTeam(with) != ownerBody.teamComponent.teamIndex) { if (activeCombatants.ContainsKey(with)) { activeCombatants[with] = (6.05f, activeCombatants[with].duration, activeCombatants[with].indicator); } else { activeCombatants[with] = (6.05f, 0f, TryAddIndicator(with)); } } } public Indicator TryAddIndicator(GameObject with) { //IL_0021: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown Indicator val = null; if (Object.op_Implicit((Object)(object)with) && !Item.instance.disableVFX) { val = new Indicator(((Component)this).gameObject, MotionTracker.vfxPrefab) { targetTransform = with.transform, active = true }; ResetIndicator(val, with); } return val; } private void ResetIndicator(Indicator ind, GameObject with) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)ind.visualizerInstance)) { CharacterBody val = default(CharacterBody); if (with.TryGetComponent(ref val)) { ind.visualizerInstance.transform.position = val.corePosition; } Animator component = ((Component)ind.visualizerInstance.transform.Find("Background")).GetComponent(); component.SetFloat("Speed", 1f / Item.instance.damageTime); component.PlayInFixedTime("ZeroIn", -1, 0f); } } private void FixedUpdate() { if (!Object.op_Implicit((Object)(object)ownerBody) || (Object.op_Implicit((Object)(object)ownerBody.healthComponent) && !ownerBody.healthComponent.alive)) { return; } KeyValuePair[] array = activeCombatants.ToArray(); HealthComponent val = default(HealthComponent); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; float num = keyValuePair.Value.Item1 - Time.fixedDeltaTime; if (num <= 0f || !Object.op_Implicit((Object)(object)keyValuePair.Key) || !keyValuePair.Key.TryGetComponent(ref val) || !val.alive) { activeCombatants.Remove(keyValuePair.Key); if (keyValuePair.Value.Item3 != null) { keyValuePair.Value.Item3.active = false; } continue; } float num2 = keyValuePair.Value.Item2 + Time.fixedDeltaTime; if (num2 >= Item.instance.damageTime) { num2 = 0f; Fire(val); ResetIndicator(keyValuePair.Value.Item3, keyValuePair.Key); } activeCombatants[keyValuePair.Key] = (num, num2, keyValuePair.Value.Item3); } } public void Fire(HealthComponent targetHC) { //IL_0000: 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) //IL_0011: 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) //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_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_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_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_0051: 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_0067: 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_00a9: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) new BulletAttack { owner = ((Component)this).gameObject, weapon = CommonCode.worldSpaceWeaponDummy, origin = ((Component)targetHC).transform.position + Vector3.up * 10f, aimVector = -Vector3.up, minSpread = 0f, maxSpread = 0f, bulletCount = 1u, damage = ownerBody.damage * (Item.instance.damageFracBase + (float)(Item.instance.GetCountEffective(ownerBody) - 1) * Item.instance.damageFracStack), force = 0f, tracerEffectPrefab = MotionTracker.tracerEffectPrefab, hitEffectPrefab = MotionTracker.hitEffectPrefab, muzzleName = null, isCrit = ownerBody.RollCrit(), radius = 1f, smartCollision = true, damageType = DamageTypeCombo.op_Implicit((DamageType)0) }.Fire(); } } [RegisterAchievement("TkSat_MotionTracker", "TkSat_MotionTrackerUnlockable", "", 1u, null)] public class TkSatMotionTrackerAchievement : BaseAchievement { private static bool qualifies; public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); ChargingState.OnEnter += new hook_OnEnter(ChargingState_OnEnter); TeleporterInteraction.UpdateMonstersClear += new hook_UpdateMonstersClear(TeleporterInteraction_UpdateMonstersClear); CharacterMaster.OnBodyDeath += new hook_OnBodyDeath(CharacterMaster_OnBodyDeath); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); ChargingState.OnEnter -= new hook_OnEnter(ChargingState_OnEnter); TeleporterInteraction.UpdateMonstersClear -= new hook_UpdateMonstersClear(TeleporterInteraction_UpdateMonstersClear); CharacterMaster.OnBodyDeath -= new hook_OnBodyDeath(CharacterMaster_OnBodyDeath); } private void CharacterMaster_OnBodyDeath(orig_OnBodyDeath orig, CharacterMaster self, CharacterBody body) { orig.Invoke(self, body); if ((Object)(object)((BaseAchievement)this).localUser.cachedMaster == (Object)(object)self) { qualifies = false; } } private void ChargingState_OnEnter(orig_OnEnter orig, ChargingState self) { orig.Invoke(self); qualifies = true; } private void TeleporterInteraction_UpdateMonstersClear(orig_UpdateMonstersClear orig, TeleporterInteraction self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)((BaseAchievement)this).localUser.cachedMaster) && !((BaseAchievement)this).localUser.cachedMaster.IsDeadAndOutOfLivesServer() && Object.op_Implicit((Object)(object)self) && !self.monstersCleared && Object.op_Implicit((Object)(object)self.holdoutZoneController) && self.holdoutZoneController.charge >= 1f && qualifies) { ((BaseAchievement)this).Grant(); } } } public class Moustache : Item { internal static UnlockableDef unlockable; public override ItemTier itemTier => (ItemTier)0; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:N0}%", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Percent chance to trigger this item's effect on hit, per stack (hyperbolic).", AutoConfigFlags.None, new object[] { 0f, 100f })] public float procChance { get; private set; } = 4f; [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Fixed taunt duration.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float procDuration { get; private set; } = 5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Fixed damage resistance vs. taunted enemies.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float damageResist { get; private set; } = 0.15f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Fixed knockback resistance vs. taunted enemies.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float knockResist { get; private set; } = 0.5f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[4] { (procChance / 100f).ToString("0%"), procDuration.ToString("N1"), damageResist.ToString("0%"), knockResist.ToString("0%") }; } public Moustache() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Moustache.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/moustacheIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Moustache.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Expected O, but got Unknown //IL_07a1: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_080a: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Expected O, but got Unknown //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08c9: Expected O, but got Unknown //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_0934: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.00302f, -0.0027f, 0.13631f), localAngles = new Vector3(36.27278f, 247.2008f, 328.2445f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.00546f, -0.01886f, 0.16446f), localAngles = new Vector3(24.81351f, 237.1489f, 301.2852f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.00014f, 0.15422f, 0.19054f), localAngles = new Vector3(24.10973f, 239.8015f, 308.2874f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-0.00896f, 4.0349f, 0.16361f), localAngles = new Vector3(28.74446f, 117.1109f, 49.42778f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-0.00119f, -0.062f, 0.16026f), localAngles = new Vector3(24.0072f, 238.9276f, 305.8187f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.00084f, 0.09298f, 0.14167f), localAngles = new Vector3(37.04324f, 259.6818f, 345.4377f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.00069f, 0.01292f, 0.15108f), localAngles = new Vector3(16.0607f, 234.2282f, 295.3604f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.00163f, -0.05424f, 0.12578f), localAngles = new Vector3(22.03966f, 237.6127f, 305.6128f), localScale = new Vector3(0.15f, 0.15f, 0.15f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.00282f, -0.0651f, 0.1334f), localAngles = new Vector3(29.90835f, 241.8379f, 315.8166f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.10163f, 2.8788f, -1.49165f), localAngles = new Vector3(59.11346f, 61.52309f, 306.2351f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.0046f, -0.6473f, 0.45684f), localAngles = new Vector3(14.55587f, 232.0287f, 292.289f), localScale = new Vector3(1f, 1f, 1f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FlowerBase", localPos = new Vector3(0.27899f, 0.55739f, 0.97507f), localAngles = new Vector3(14.55587f, 251.2795f, 292.289f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.00138f, 0.01733f, 0.13007f), localAngles = new Vector3(25.15422f, 247.6927f, 314.3745f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.07618f, 0.04021f, 0.17666f), localAngles = new Vector3(28.40403f, 204.2041f, 312.3828f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/moustacheIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); SetStateOnHurt.OnTakeDamageServer += new hook_OnTakeDamageServer(SetStateOnHurt_OnTakeDamageServer); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); SetStateOnHurt.OnTakeDamageServer -= new hook_OnTakeDamageServer(SetStateOnHurt_OnTakeDamageServer); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0086: 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_009c: Unknown result type (might be due to invalid IL or missing references) CharacterBody val = default(CharacterBody); if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)self.body) && GetCountEffective(self.body) > 0 && (!disableSelfDamage || (Object)(object)((Component)self).gameObject != (Object)(object)damageInfo.attacker.gameObject) && damageInfo.attacker.TryGetComponent(ref val) && val.HasBuff(TauntDebuffModule.tauntDebuff)) { damageInfo.damage *= 1f - damageResist; damageInfo.force *= 1f - knockResist; } orig.Invoke(self, damageInfo); } private void SetStateOnHurt_OnTakeDamageServer(orig_OnTakeDamageServer orig, SetStateOnHurt self, DamageReport damageReport) { orig.Invoke(self, damageReport); if (Object.op_Implicit((Object)(object)self.targetStateMachine) && self.spawnedOverNetwork && Object.op_Implicit((Object)(object)damageReport.attackerMaster) && Object.op_Implicit((Object)(object)damageReport.victimBody) && (!disableSelfDamage || !((Object)(object)damageReport.attacker == (Object)(object)damageReport.victim))) { int countEffective = GetCountEffective(damageReport.attackerMaster); if (countEffective > 0 && Util.CheckRoll(Util.ConvertAmplificationPercentageIntoReductionPercentage((float)countEffective * damageReport.damageInfo.procCoefficient * procChance), damageReport.attackerMaster.luck, damageReport.attackerMaster)) { damageReport.victimBody.AddTimedBuff(TauntDebuffModule.tauntDebuff, procDuration); } } } } [RegisterAchievement("TkSat_Moustache", "TkSat_MoustacheUnlockable", "", 1u, null)] public class TkSatMoustacheAchievement : BaseAchievement { private const float UPDATE_INTERVAL = 2f; private const float MAX_RANGE = 100f; private const int TARGET_COUNT = 30; private float _stopwatch; public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); CharacterBody.FixedUpdate += new hook_FixedUpdate(CharacterBody_FixedUpdate); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); CharacterBody.FixedUpdate -= new hook_FixedUpdate(CharacterBody_FixedUpdate); } private void CharacterBody_FixedUpdate(orig_FixedUpdate orig, CharacterBody self) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self) || (Object)(object)self != (Object)(object)((BaseAchievement)this).localUser.cachedBody) { return; } _stopwatch -= Time.fixedDeltaTime; if (_stopwatch < 0f) { _stopwatch = 2f; if (CommonCode.GatherEnemies(self.teamComponent.teamIndex).Count((TeamComponent e) => Object.op_Implicit((Object)(object)e.body) && (!e.body.outOfCombat || !e.body.outOfDanger) && Vector3.Distance(((Component)e).transform.position, self.transform.position) < 100f) > 30) { ((BaseAchievement)this).Grant(); } } } } public class Mug : Item { public int ignoreStack; internal UnlockableDef unlockable; internal StatDef whiffsStatDef; private readonly HashSet> firedAttacks = new HashSet>(); private const float GC_INTERVAL = 2f; private float _gcStopwatch; public override ItemTier itemTier => (ItemTier)0; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:N2}°", 0f, 180f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Maximum degrees of spread to add to extra projectiles.", AutoConfigFlags.None, new object[] { 0f, 180f })] public float spreadConeHalfAngleDegr { get; private set; } = 17.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Extra projectile chance per item.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float procChance { get; private set; } = 0.1f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient on melee projectiles.", AutoConfigFlags.DeferForever, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:P0}", 0f, 2f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proportion of melee attack damage on fired projectiles.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float meleeProjectileDamage { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:P0}", 0f, 2f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proportion of missile/orb attack damage on fired projectiles.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float missileProjectileDamage { get; private set; } = 0.25f; public GameObject idrPrefab { get; private set; } public GameObject projectilePrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[4] { procChance.ToString("0%"), spreadConeHalfAngleDegr.ToString("N1"), meleeProjectileDamage.ToString("0%"), missileProjectileDamage.ToString("0%") }; } public Mug() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Mug.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/mugIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Mug.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.06835f, 0.16783f, 0.09433f), localAngles = new Vector3(25.97133f, 305.0472f, 11.71204f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(0.05086f, 0.2088f, -0.06317f), localAngles = new Vector3(62.28717f, 25.6124f, 348.0484f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.12966f, 0.15299f, -0.0402f), localAngles = new Vector3(0.87372f, 2.25879f, 165.0614f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Finger21R", localPos = new Vector3(0.43142f, 1.38371f, 0.20466f), localAngles = new Vector3(45.73375f, 69.30614f, 58.74778f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.04411f, 0.16008f, 0.06094f), localAngles = new Vector3(79.03846f, 351.9577f, 103.1133f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.11064f, 0.20138f, -0.08752f), localAngles = new Vector3(26.35323f, 342.7217f, 140.326f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(0.03298f, 0.20086f, -0.07431f), localAngles = new Vector3(46.46626f, 70.60059f, 13.98411f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(0.02393f, 0.23256f, -0.02758f), localAngles = new Vector3(313.8161f, 7.28315f, 85.73673f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.05918f, 0.21561f, 0.12523f), localAngles = new Vector3(298.1304f, 163.4056f, 93.55658f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-1.23454f, 0.95378f, 0.02811f), localAngles = new Vector3(292.6725f, 349.3662f, 181.1039f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FootFrontR", localPos = new Vector3(0.12889f, 0.73694f, -0.22601f), localAngles = new Vector3(306.1341f, 230.459f, 186.0314f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.06001f, 0.08116f, 0.04366f), localAngles = new Vector3(29.0242f, 323.4066f, 316.9256f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Neck", localPos = new Vector3(-0.05641f, 0.09276f, -0.2513f), localAngles = new Vector3(68.92164f, 301.1333f, 308.5242f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { base.SetupAttributes(); _ = "ACHIEVEMENT_TKSAT_" + name.ToUpper(CultureInfo.InvariantCulture) + "_NAME"; _ = "ACHIEVEMENT_TKSAT_" + name.ToUpper(CultureInfo.InvariantCulture) + "_DESCRIPTION"; unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/mugIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; whiffsStatDef = StatDef.Register("tksatMugAchievementProgress", (StatRecordType)0, (StatDataType)0, 0.0, (DisplayValueFormatterDelegate)null); projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/MugProjectile.prefab"); ((ProjectileExplosion)projectilePrefab.GetComponent()).blastProcCoefficient = procCoefficient; ContentAddition.AddProjectile(projectilePrefab); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown base.Install(); Run.FixedUpdate += new hook_FixedUpdate(Run_FixedUpdate); ProjectileManager.FireProjectile_FireProjectileInfo += new hook_FireProjectile_FireProjectileInfo(ProjectileManager_FireProjectile_FireProjectileInfo); BulletAttack.Fire += new hook_Fire(BulletAttack_Fire); OverlapAttack.Fire += new hook_Fire(OverlapAttack_Fire); ArrowRain.DoFireArrowRain += new hook_DoFireArrowRain(ArrowRain_DoFireArrowRain); AimThrowableBase.FireProjectile += new hook_FireProjectile(AimThrowableBase_FireProjectile); FireMortar2.Fire += new hook_Fire(FireMortar2_Fire); MissileUtils.FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool += new hook_FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool(MissileUtils_FireMissile_MyKingdomForAStruct); TreebotFireFruitSeed.OnEnter += new hook_OnEnter(TreebotFireFruitSeed_OnEnter); PrepWall.OnExit += new hook_OnExit(PrepWall_OnExit); CreatePounder.OnExit += new hook_OnExit(CreatePounder_OnExit); AimFlower.FireProjectile += new hook_FireProjectile(AimFlower_FireProjectile); FireFlower2.OnEnter += new hook_OnEnter(FireFlower2_OnEnter); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath); FireMainBeamState.OnExit += new hook_OnExit(FireMainBeamState_OnExit); BaseThrowBombState.Fire += new hook_Fire(BaseThrowBombState_Fire); GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy); EquipmentSlot.FireGummyClone += new hook_FireGummyClone(EquipmentSlot_FireGummyClone); FireSeekingArrow.FireOrbArrow += new hook_FireOrbArrow(FireSeekingArrow_FireOrbArrow); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown base.Uninstall(); Run.FixedUpdate -= new hook_FixedUpdate(Run_FixedUpdate); ProjectileManager.FireProjectile_FireProjectileInfo -= new hook_FireProjectile_FireProjectileInfo(ProjectileManager_FireProjectile_FireProjectileInfo); BulletAttack.Fire -= new hook_Fire(BulletAttack_Fire); OverlapAttack.Fire -= new hook_Fire(OverlapAttack_Fire); ArrowRain.DoFireArrowRain -= new hook_DoFireArrowRain(ArrowRain_DoFireArrowRain); AimThrowableBase.FireProjectile -= new hook_FireProjectile(AimThrowableBase_FireProjectile); FireMortar2.Fire -= new hook_Fire(FireMortar2_Fire); MissileUtils.FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool -= new hook_FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool(MissileUtils_FireMissile_MyKingdomForAStruct); TreebotFireFruitSeed.OnEnter -= new hook_OnEnter(TreebotFireFruitSeed_OnEnter); PrepWall.OnExit -= new hook_OnExit(PrepWall_OnExit); CreatePounder.OnExit -= new hook_OnExit(CreatePounder_OnExit); AimFlower.FireProjectile -= new hook_FireProjectile(AimFlower_FireProjectile); FireFlower2.OnEnter -= new hook_OnEnter(FireFlower2_OnEnter); GlobalEventManager.OnCharacterDeath -= new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath); FireMainBeamState.OnExit -= new hook_OnExit(FireMainBeamState_OnExit); BaseThrowBombState.Fire -= new hook_Fire(BaseThrowBombState_Fire); GlobalEventManager.OnHitEnemy -= new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy); EquipmentSlot.FireGummyClone -= new hook_FireGummyClone(EquipmentSlot_FireGummyClone); FireSeekingArrow.FireOrbArrow -= new hook_FireOrbArrow(FireSeekingArrow_FireOrbArrow); } private void Run_FixedUpdate(orig_FixedUpdate orig, Run self) { orig.Invoke(self); if (ignoreStack > 0) { TinkersSatchelPlugin._logger.LogError((object)"Mug: ignoreStack was not empty on new frame, clearing. May be a cascading effect of another error, or a mod may be misusing ignoreStack."); ignoreStack = 0; } _gcStopwatch -= Time.fixedDeltaTime; if (_gcStopwatch <= 0f) { firedAttacks.RemoveWhere((WeakReference r) => !r.TryGetTarget(out var _)); _gcStopwatch = 2f; } } private bool OverlapAttack_Fire(orig_Fire orig, OverlapAttack self, List hitResults) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) bool result = orig.Invoke(self, hitResults); CharacterBody val = default(CharacterBody); if (NetworkServer.active && Object.op_Implicit((Object)(object)self.attacker) && self.attacker.TryGetComponent(ref val) && !firedAttacks.Any((WeakReference x) => x.TryGetTarget(out var target) && target == self) && GetCountEffective(val) > 0) { ignoreStack++; FireCustomProjectiles(val, self.damage * meleeProjectileDamage, self.procChainMask); firedAttacks.Add(new WeakReference(self)); ignoreStack--; } return result; } private void BulletAttack_Fire(orig_Fire orig, BulletAttack self) { orig.Invoke(self); if (ignoreStack > 0 || !Object.op_Implicit((Object)(object)self.owner)) { return; } CharacterBody component = self.owner.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } int countEffective = GetCountEffective(component); if (countEffective > 0) { float num = (float)countEffective * procChance; int num2 = (Util.CheckRoll(MathUtil.Wrap(num * 100f, 0f, 100f), component.master) ? 1 : 0) + (int)Mathf.Floor(num); if (num2 > 0) { self.bulletCount = (uint)num2; self.maxSpread += spreadConeHalfAngleDegr; self.spreadPitchScale = 1f; self.spreadYawScale = 1f; orig.Invoke(self); } } } private void ProjectileManager_FireProjectile_FireProjectileInfo(orig_FireProjectile_FireProjectileInfo orig, ProjectileManager self, FireProjectileInfo fireProjectileInfo) { //IL_0002: 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_0026: 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_0046: 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_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_00ae: 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_00bb: 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) orig.Invoke(self, fireProjectileInfo); if (ignoreStack > 0 || !Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)fireProjectileInfo.owner) || !Object.op_Implicit((Object)(object)fireProjectileInfo.projectilePrefab) || Object.op_Implicit((Object)(object)fireProjectileInfo.projectilePrefab.GetComponent())) { return; } CharacterBody component = fireProjectileInfo.owner.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } int countEffective = GetCountEffective(component); if (countEffective > 0) { float num = (float)countEffective * procChance; int num2 = (Util.CheckRoll(MathUtil.Wrap(num * 100f, 0f, 100f), component.master) ? 1 : 0) + (int)Mathf.Floor(num); Quaternion rotation = fireProjectileInfo.rotation; for (int i = 0; i < num2; i++) { fireProjectileInfo.rotation = MathUtil.ApplyRandomSpread(rotation, spreadConeHalfAngleDegr); orig.Invoke(self, fireProjectileInfo); } } } private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { ignoreStack++; orig.Invoke(self, damageInfo, victim); ignoreStack--; } private void FireSeekingArrow_FireOrbArrow(orig_FireOrbArrow orig, FireSeekingArrow self) { //IL_0057: 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) if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && self.firedArrowCount < self.maxArrowCount && self.arrowReloadTimer <= 0f && Object.op_Implicit((Object)(object)self.initialOrbTarget)) { FireCustomProjectiles(((EntityState)self).characterBody, ((EntityState)self).characterBody.damage * self.orbDamageCoefficient, default(ProcChainMask)); } orig.Invoke(self); } private void BaseThrowBombState_Fire(orig_Fire orig, BaseThrowBombState self) { //IL_003d: 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) int num; if (!(self is ThrowLunarSecondary)) { num = ((self is ThrowIcebomb) ? 1 : 0); if (num == 0) { goto IL_0025; } } else { num = 1; } ignoreStack++; goto IL_0025; IL_0025: orig.Invoke(self); if (num != 0) { FireCustomProjectiles(((EntityState)self).characterBody, ((BaseState)self).damageStat, default(ProcChainMask)); ignoreStack--; } } private void FireMainBeamState_OnExit(orig_OnExit orig, FireMainBeamState self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void GlobalEventManager_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { ignoreStack++; orig.Invoke(self, damageReport); ignoreStack--; } private void FireFlower2_OnEnter(orig_OnEnter orig, FireFlower2 self) { //IL_0024: 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) ignoreStack++; orig.Invoke(self); FireCustomProjectiles(((EntityState)self).characterBody, ((BaseState)self).damageStat, default(ProcChainMask)); ignoreStack--; } private void AimFlower_FireProjectile(orig_FireProjectile orig, AimFlower self) { //IL_0024: 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) ignoreStack++; orig.Invoke(self); FireCustomProjectiles(((EntityState)self).characterBody, ((BaseState)self).damageStat, default(ProcChainMask)); ignoreStack--; } private void TreebotFireFruitSeed_OnEnter(orig_OnEnter orig, TreebotFireFruitSeed self) { //IL_0024: 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) ignoreStack++; orig.Invoke(self); FireCustomProjectiles(((EntityState)self).characterBody, ((BaseState)self).damageStat, default(ProcChainMask)); ignoreStack--; } private void PrepWall_OnExit(orig_OnExit orig, PrepWall self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void CreatePounder_OnExit(orig_OnExit orig, CreatePounder self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void ArrowRain_DoFireArrowRain(orig_DoFireArrowRain orig, ArrowRain self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void MissileUtils_FireMissile_MyKingdomForAStruct(orig_FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool orig, Vector3 position, CharacterBody attackerBody, ProcChainMask procChainMask, GameObject victim, float missileDamage, bool isCrit, GameObject projectilePrefab, DamageColorIndex damageColorIndex, Vector3 initialDirection, float force, bool addMissileProc) { //IL_000f: 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_001b: 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_0033: Unknown result type (might be due to invalid IL or missing references) ignoreStack++; orig.Invoke(position, attackerBody, procChainMask, victim, missileDamage, isCrit, projectilePrefab, damageColorIndex, initialDirection, force, addMissileProc); FireCustomProjectiles(attackerBody, missileDamage * missileProjectileDamage, procChainMask); ignoreStack--; } private void AimThrowableBase_FireProjectile(orig_FireProjectile orig, AimThrowableBase self) { //IL_003d: 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) int num; if (!(self is AimMortar2)) { num = ((self is CallAirstrikeBase) ? 1 : 0); if (num == 0) { goto IL_0025; } } else { num = 1; } ignoreStack++; goto IL_0025; IL_0025: orig.Invoke(self); if (num != 0) { FireCustomProjectiles(((EntityState)self).characterBody, ((BaseState)self).damageStat, default(ProcChainMask)); ignoreStack--; } } private void FireMortar2_Fire(orig_Fire orig, FireMortar2 self) { //IL_0024: 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) ignoreStack++; orig.Invoke(self); FireCustomProjectiles(((EntityState)self).characterBody, ((BaseState)self).damageStat, default(ProcChainMask)); ignoreStack--; } private bool EquipmentSlot_FireGummyClone(orig_FireGummyClone orig, EquipmentSlot self) { ignoreStack++; bool result = orig.Invoke(self); ignoreStack--; return result; } private void FireCustomProjectiles(CharacterBody attackerBody, float damage, ProcChainMask procChainMask) { //IL_004c: 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_0065: 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_0086: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00c5: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_010b: 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_011e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)attackerBody)) { float num = (float)GetCountEffective(attackerBody) * procChance; int num2 = (Util.CheckRoll(MathUtil.Wrap(num * 100f, 0f, 100f), attackerBody.master) ? 1 : 0) + (int)Mathf.Floor(num); Vector3 val = attackerBody.transform.forward; if (Object.op_Implicit((Object)(object)attackerBody.inputBank)) { val = attackerBody.inputBank.aimDirection; } else if (Object.op_Implicit((Object)(object)attackerBody.characterDirection)) { val = attackerBody.characterDirection.forward; } Quaternion targetRotation = Quaternion.LookRotation(val, attackerBody.transform.up); for (int i = 0; i < num2; i++) { ProjectileManager.instance.FireProjectile(new FireProjectileInfo { crit = attackerBody.RollCrit(), damage = damage, damageColorIndex = (DamageColorIndex)3, force = 0f, owner = ((Component)attackerBody).gameObject, rotation = base.rng.ApplyRandomSpread(targetRotation, spreadConeHalfAngleDegr), position = attackerBody.corePosition, procChainMask = procChainMask, projectilePrefab = projectilePrefab }); } } } } [RegisterAchievement("TkSat_Mug", "TkSat_MugUnlockable", "", 1u, null)] public class TkSatMugAchievement : BaseAchievement { private bool bulletAttackDidHit; public override float ProgressForAchievement() { return (float)((BaseAchievement)this).userProfile.statSheet.GetStatValueULong(Item.instance.whiffsStatDef) / 1000f; } public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); ProjectileController.OnCollisionEnter += new hook_OnCollisionEnter(ProjectileController_OnCollisionEnter); ProjectileControllerTrigger.OnTriggerEnter += new hook_OnTriggerEnter(ProjectileControllerTrigger_OnTriggerEnter); ProjectileController.OnDestroy += new hook_OnDestroy(ProjectileController_OnDestroy); BulletAttack.Fire += new hook_Fire(BulletAttack_Fire); BulletAttack.ProcessHit += new hook_ProcessHit(BulletAttack_ProcessHit); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); ProjectileController.OnCollisionEnter -= new hook_OnCollisionEnter(ProjectileController_OnCollisionEnter); ProjectileControllerTrigger.OnTriggerEnter -= new hook_OnTriggerEnter(ProjectileControllerTrigger_OnTriggerEnter); ProjectileController.OnDestroy -= new hook_OnDestroy(ProjectileController_OnDestroy); BulletAttack.Fire -= new hook_Fire(BulletAttack_Fire); BulletAttack.ProcessHit -= new hook_ProcessHit(BulletAttack_ProcessHit); } private void BulletAttack_Fire(orig_Fire orig, BulletAttack self) { bulletAttackDidHit = false; orig.Invoke(self); if (!bulletAttackDidHit && (Object)(object)self.owner == (Object)(object)((BaseAchievement)this).localUser.cachedBodyObject) { ((BaseAchievement)this).userProfile.statSheet.PushStatValue(Item.instance.whiffsStatDef, 1uL); if (((BaseAchievement)this).ProgressForAchievement() >= 1f) { ((BaseAchievement)this).Grant(); } } } private bool BulletAttack_ProcessHit(orig_ProcessHit orig, BulletAttack self, ref BulletHit hitInfo) { bool result = orig.Invoke(self, ref hitInfo); if (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) && ((Object)hitInfo.hitHurtBox).name != "TempHurtbox") { bulletAttackDidHit = true; } return result; } private void ProjectileController_OnCollisionEnter(orig_OnCollisionEnter orig, ProjectileController self, Collision collision) { orig.Invoke(self, collision); if (Object.op_Implicit((Object)(object)collision.gameObject)) { HurtBox component = collision.gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent)) { ((Component)self).gameObject.AddComponent(); } } } private void ProjectileControllerTrigger_OnTriggerEnter(orig_OnTriggerEnter orig, ProjectileControllerTrigger self, Collider collider) { orig.Invoke(self, collider); if (Object.op_Implicit((Object)(object)((Component)collider).gameObject) && ((ProjectileController)self).canImpactOnTrigger) { HurtBox component = ((Component)collider).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent)) { ((Component)self).gameObject.AddComponent(); } } } private void ProjectileController_OnDestroy(orig_OnDestroy orig, ProjectileController self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent()) && (Object)(object)self.owner == (Object)(object)((BaseAchievement)this).localUser.cachedBodyObject) { ((BaseAchievement)this).userProfile.statSheet.PushStatValue(Item.instance.whiffsStatDef, 1uL); if (((BaseAchievement)this).ProgressForAchievement() >= 1f) { ((BaseAchievement)this).Grant(); } } } } public class ProjectileHasValidHitFlag : MonoBehaviour { } public class ShootToHeal : Item { public struct MsgHealTargetAndSelf : INetMessage, ISerializableObject { private HealthComponent _target; private HealthComponent _self; private float _adjustedCoeffs; private ProcChainMask _pcm; public MsgHealTargetAndSelf(HealthComponent target, HealthComponent self, float amount, ProcChainMask pcm) { //IL_0016: 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) _target = target; _self = self; _adjustedCoeffs = amount; _pcm = pcm; } public readonly void OnReceived() { //IL_005f: 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) float num = _adjustedCoeffs * Item.instance.baseHealMod; if (Object.op_Implicit((Object)(object)_self) && Object.op_Implicit((Object)(object)_self.body)) { Item.instance.healingSourceStack.Push(_self.body); } _target.Heal(num * _target.fullHealth, _pcm, true); if (Object.op_Implicit((Object)(object)_self)) { _self.Heal(num * _self.fullHealth * Item.instance.returnHealMod, _pcm, true); } if (Object.op_Implicit((Object)(object)_self) && Object.op_Implicit((Object)(object)_self.body)) { Item.instance.healingSourceStack.Pop(); } } public void Deserialize(NetworkReader reader) { //IL_0096: 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) GameObject val = reader.ReadGameObject(); if (!Object.op_Implicit((Object)(object)val)) { TinkersSatchelPlugin._logger.LogError((object)"Received MsgHealTargetAndSelf for nonexistent target object"); return; } if (!val.TryGetComponent(ref _target)) { TinkersSatchelPlugin._logger.LogError((object)"Received MsgHealTargetAndSelf for target object with no HealthComponent"); return; } GameObject val2 = reader.ReadGameObject(); if (!Object.op_Implicit((Object)(object)val2)) { TinkersSatchelPlugin._logger.LogWarning((object)"Received MsgHealTargetAndSelf for nonexistent self object"); _self = null; } else if (!val2.TryGetComponent(ref _self)) { TinkersSatchelPlugin._logger.LogWarning((object)"Received MsgHealTargetAndSelf for self object with no HealthComponent"); _self = null; } _adjustedCoeffs = reader.ReadSingle(); _pcm = NetworkExtensions.ReadProcChainMask(reader); } public readonly void Serialize(NetworkWriter writer) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) writer.Write(((Component)_target).gameObject); writer.Write(((Component)_self).gameObject); writer.Write(_adjustedCoeffs); NetworkExtensions.Write(writer, _pcm); } } internal static UnlockableDef unlockable; public override ItemTier itemTier => (ItemTier)0; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)2 }); [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, AI with nothing better to do will attempt to shoot teammates if they have this item, either of them are injured, and Artifact of Chaos is not enabled.", AutoConfigFlags.None, new object[] { })] public bool aiOverride { get; private set; } = true; [AutoConfigRoOSlider("{0:N1}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Healing amount multiplier, relative to attack power+proc and target health, per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float baseHealMod { get; private set; } = 0.01f; [AutoConfigRoOSlider("{0:N1}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Self-healing amount on healing an ally, relative to the healing the ally received, per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float returnHealMod { get; private set; } = 0.5f; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[2] { baseHealMod.ToString("0%"), returnHealMod.ToString("0%") }; } public ShootToHeal() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/ShootToHeal.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/shootToHealIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/ShootToHeal.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MainWeapon", localPos = new Vector3(-0.01191f, 0.94731f, 0.01098f), localAngles = new Vector3(316.5172f, 180.416f, 17.75818f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.03464f, 0.10259f, -0.06757f), localAngles = new Vector3(319.4068f, 347.8731f, 46.87115f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(-0.0897f, 0.14081f, 0.03271f), localAngles = new Vector3(300.2318f, 295.2138f, 197.7983f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmR", localPos = new Vector3(0.66226f, 5.14175f, -0.22211f), localAngles = new Vector3(331.4982f, 326.7393f, 8.18496f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmR", localPos = new Vector3(0.02233f, 0.14033f, -0.0751f), localAngles = new Vector3(336.5551f, 330.0712f, 39.69568f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmR", localPos = new Vector3(0.04393f, -0.04636f, 0.01517f), localAngles = new Vector3(39.93605f, 179.8943f, 198.899f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.16672f, -0.03254f, 0.373f), localAngles = new Vector3(316.9363f, 2.65794f, 139.6746f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(0.0239f, 0.07276f, 0.07745f), localAngles = new Vector3(343.6281f, 49.36037f, 17.41755f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmR", localPos = new Vector3(-0.04336f, 0.31317f, -0.0799f), localAngles = new Vector3(318.2455f, 308.9852f, 36.96745f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "UpperArmR", localPos = new Vector3(-0.24752f, 3.97012f, -0.48912f), localAngles = new Vector3(319.2452f, 10.75099f, 353.5247f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FlowerBase", localPos = new Vector3(0.42347f, -0.11766f, 0.57757f), localAngles = new Vector3(323.8121f, 171.688f, 162.5838f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmR", localPos = new Vector3(-0.01167f, 0.24784f, -0.08091f), localAngles = new Vector3(302.9008f, 102.0814f, 317.6239f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ForeArmL", localPos = new Vector3(0.13678f, -0.03975f, 0.03643f), localAngles = new Vector3(56.25161f, 198.1408f, 178.4731f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/shootToHealIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; NetworkingAPI.RegisterMessageType(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown base.Install(); BulletAttack.ProcessHit += new hook_ProcessHit(BulletAttack_ProcessHit); ProjectileController.OnCollisionEnter += new hook_OnCollisionEnter(ProjectileController_OnCollisionEnter); ProjectileControllerTrigger.OnTriggerEnter += new hook_OnTriggerEnter(ProjectileControllerTrigger_OnTriggerEnter); OverlapAttack.Fire += new Manipulator(OverlapAttack_Fire); BaseAI.UpdateBodyInputs += new hook_UpdateBodyInputs(BaseAI_UpdateBodyInputs); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown base.Uninstall(); BulletAttack.ProcessHit -= new hook_ProcessHit(BulletAttack_ProcessHit); ProjectileController.OnCollisionEnter -= new hook_OnCollisionEnter(ProjectileController_OnCollisionEnter); ProjectileControllerTrigger.OnTriggerEnter -= new hook_OnTriggerEnter(ProjectileControllerTrigger_OnTriggerEnter); OverlapAttack.Fire -= new Manipulator(OverlapAttack_Fire); BaseAI.UpdateBodyInputs -= new hook_UpdateBodyInputs(BaseAI_UpdateBodyInputs); } private void BaseAI_UpdateBodyInputs(orig_UpdateBodyInputs orig, BaseAI self) { //IL_006b: 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) orig.Invoke(self); HealthComponent val = default(HealthComponent); if (aiOverride && GetCountEffective(self.master) > 0 && Object.op_Implicit((Object)(object)RunArtifactManager.instance) && !RunArtifactManager.instance.IsArtifactEnabled(Artifacts.friendlyFireArtifactDef) && self.hasAimTarget && self.hasAimConfirmation && TeamComponent.GetObjectTeam(self.skillDriverEvaluation.aimTarget.gameObject) == self.master.teamIndex && Object.op_Implicit((Object)(object)self.bodyInputBank) && ((self.skillDriverEvaluation.aimTarget.gameObject.TryGetComponent(ref val) && val.health < val.fullHealth) || (Object.op_Implicit((Object)(object)self.bodyHealthComponent) && self.bodyHealthComponent.health < self.bodyHealthComponent.fullHealth))) { ((ButtonState)(ref self.bodyInputBank.skill1)).PushState(true); ((ButtonState)(ref self.bodyInputBank.skill2)).PushState(true); ((ButtonState)(ref self.bodyInputBank.skill3)).PushState(true); ((ButtonState)(ref self.bodyInputBank.skill4)).PushState(true); } } private void OverlapAttack_Fire(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0039: 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.MatchCall(x, "HurtBoxPassesFilter") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(HurtBox cpt, OverlapAttack self) { //IL_0063: 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_00da: Unknown result type (might be due to invalid IL or missing references) if (self != null && Object.op_Implicit((Object)(object)self.attacker) && Object.op_Implicit((Object)(object)cpt) && Object.op_Implicit((Object)(object)cpt.healthComponent) && !self.ignoredHealthComponentList.Contains(cpt.healthComponent) && (Object)(object)((Component)cpt.healthComponent).gameObject != (Object)(object)self.attacker && cpt.teamIndex == TeamComponent.GetObjectTeam(self.attacker)) { self.ignoredHealthComponentList.Add(cpt.healthComponent); CharacterBody component = self.attacker.GetComponent(); int countEffective = GetCountEffective(component); if (countEffective > 0) { CharacterBody val2 = default(CharacterBody); float num = (self.attacker.TryGetComponent(ref val2) ? (self.damage / val2.damage) : 1f); NetMessageExtensions.Send((INetMessage)(object)new MsgHealTargetAndSelf(cpt.healthComponent, component.healthComponent, (float)countEffective * self.procCoefficient * num, self.procChainMask), (NetworkDestination)2); } } return cpt; }); } else { TinkersSatchelPlugin._logger.LogError((object)"ShootToHeal: Failed to apply OverlapAttack.Fire IL patch (target instructions not found)"); } } private bool BulletAttack_ProcessHit(orig_ProcessHit orig, BulletAttack self, ref BulletHit hitInfo) { //IL_007c: 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_00c9: Unknown result type (might be due to invalid IL or missing references) bool result = orig.Invoke(self, ref hitInfo); if (!Object.op_Implicit((Object)(object)self.owner) || !Object.op_Implicit((Object)(object)hitInfo.hitHurtBox)) { return result; } CharacterBody component = self.owner.GetComponent(); int countEffective = GetCountEffective(component); if (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox.healthComponent) && countEffective > 0 && (Object)(object)hitInfo.hitHurtBox.healthComponent != (Object)(object)self.owner.GetComponent() && hitInfo.hitHurtBox.teamIndex == TeamComponent.GetObjectTeam(self.owner)) { float num = (Object.op_Implicit((Object)(object)component) ? (self.damage / component.damage) : 1f); NetMessageExtensions.Send((INetMessage)(object)new MsgHealTargetAndSelf(hitInfo.hitHurtBox.healthComponent, component.healthComponent, (float)countEffective * self.procCoefficient * num, self.procChainMask), (NetworkDestination)2); } return result; } private void ProjectileController_OnCollisionEnter(orig_OnCollisionEnter orig, ProjectileController self, Collision collision) { //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_00db: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, collision); if (collision != null && Object.op_Implicit((Object)(object)collision.gameObject) && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.owner)) { HurtBox component = collision.gameObject.GetComponent(); CharacterBody component2 = self.owner.GetComponent(); int countEffective = GetCountEffective(component2); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && countEffective > 0 && (Object)(object)component.healthComponent != (Object)(object)self.owner.GetComponent() && component.teamIndex == TeamComponent.GetObjectTeam(self.owner)) { ProjectileDamage val = default(ProjectileDamage); float num = ((Object.op_Implicit((Object)(object)component2) && ((Component)self).TryGetComponent(ref val)) ? (val.damage / component2.damage) : 1f); NetMessageExtensions.Send((INetMessage)(object)new MsgHealTargetAndSelf(component.healthComponent, component2.healthComponent, (float)countEffective * self.procCoefficient * num, self.procChainMask), (NetworkDestination)2); } } } private void ProjectileControllerTrigger_OnTriggerEnter(orig_OnTriggerEnter orig, ProjectileControllerTrigger self, Collider collider) { //IL_0097: 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_00e9: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, collider); if (!((Object)(object)collider == (Object)null) && Object.op_Implicit((Object)(object)((Component)collider).gameObject) && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)((ProjectileController)self).owner) && ((ProjectileController)self).canImpactOnTrigger) { HurtBox component = ((Component)collider).gameObject.GetComponent(); CharacterBody component2 = ((ProjectileController)self).owner.GetComponent(); int countEffective = GetCountEffective(component2); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && countEffective > 0 && (Object)(object)component.healthComponent != (Object)(object)((ProjectileController)self).owner.GetComponent() && component.teamIndex == TeamComponent.GetObjectTeam(((ProjectileController)self).owner)) { ProjectileDamage val = default(ProjectileDamage); float num = ((Object.op_Implicit((Object)(object)component2) && ((Component)self).TryGetComponent(ref val)) ? (val.damage / component2.damage) : 1f); NetMessageExtensions.Send((INetMessage)(object)new MsgHealTargetAndSelf(component.healthComponent, component2.healthComponent, (float)countEffective * ((ProjectileController)self).procCoefficient * num, ((ProjectileController)self).procChainMask), (NetworkDestination)2); } } } } [RegisterAchievement("TkSat_ShootToHeal", "TkSat_ShootToHealUnlockable", "", 1u, null)] public class TkSatShootToHealAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); CharacterMaster.OnInventoryChanged -= new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } private void CharacterMaster_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_009c: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!((Object)(object)((BaseAchievement)this).localUser.cachedMaster != (Object)(object)self)) { int num = 0; if (self.inventory.GetItemCountEffective(Items.ChainLightning) > 0 || self.inventory.GetItemCountEffective(Items.ChainLightningVoid) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.EnergizedOnEquipmentUse) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.ShockNearby) > 0) { num++; } if (self.inventory.currentEquipmentIndex == Equipment.TeamWarCry.equipmentIndex || self.inventory.alternateEquipmentIndex == Equipment.TeamWarCry.equipmentIndex) { num++; } if (self.inventory.GetItemCountEffective(Items.Behemoth) > 0) { num++; } if (self.inventory.GetItemCountEffective(Item.instance.itemDef) > 0) { num++; } if (num >= 3) { ((BaseAchievement)this).Grant(); } } } } public class TriBrooch : Item { private bool isInternalIgnite; public override ItemTier itemTier => (ItemTier)0; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:N0}%", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Chance for the effect to trigger (percentage).", AutoConfigFlags.None, new object[] { 0f, 100f })] public float procChance { get; private set; } = 9f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc damage, as base damage fraction, at first stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float procBaseDamage { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc damage, as base damage fraction, per additional stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float procStackDamage { get; private set; } = 0.5f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, will never proc from self damage.", AutoConfigFlags.None, new object[] { })] public bool preventSelfProc { get; private set; } public static UnlockableDef unlockable { get; private set; } public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { (procChance / 100f).ToString("0%"), procBaseDamage.ToString("0%"), procStackDamage.ToString("0%") }; } public TriBrooch() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/TriBrooch.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/triBroochIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/TriBrooch.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ClavicleL", localPos = new Vector3(0.01587f, 0.03075f, -0.0454f), localAngles = new Vector3(12.95898f, 265.3185f, 111.5319f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ClavicleL", localPos = new Vector3(0.18501f, 0.0208f, -0.04388f), localAngles = new Vector3(336.0666f, 351.0449f, 287.884f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.10938f, 0.3308f, 0.16379f), localAngles = new Vector3(77.74458f, 9.37155f, 56.06641f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.85748f, 2.27521f, -2.00212f), localAngles = new Vector3(74.22634f, 295.739f, 150.861f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.14128f, 0.28981f, 0.22255f), localAngles = new Vector3(30.07084f, 237.6799f, 307.643f), localScale = new Vector3(0.15f, 0.15f, 0.15f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.0258f, 0.2852f, 0.1511f), localAngles = new Vector3(72.71474f, 228.6517f, 288.4894f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(-0.00898f, 0.34109f, 0.45765f), localAngles = new Vector3(30.64921f, 124.9147f, 150.8836f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ClavicleR", localPos = new Vector3(-0.08299f, -0.02196f, 0.11205f), localAngles = new Vector3(328.7179f, 352.2592f, 110.2025f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.00012f, 0.26978f, 0.16404f), localAngles = new Vector3(75.41711f, 88.73151f, 126.3319f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.05477f, 0.9587f, 3.27361f), localAngles = new Vector3(29.15617f, 134.4333f, 169.5063f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.0312f, 0.31848f, 0.94812f), localAngles = new Vector3(323.8579f, 146.4679f, 83.51678f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(-0.08226f, 0.27109f, 0.2853f), localAngles = new Vector3(56.90765f, 35.79788f, 94.39868f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.00823f, 0.11072f, 0.21924f), localAngles = new Vector3(41.15704f, 115.7881f, 117.0112f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); } public override void SetupAttributes() { base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/triBroochIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); SetStateOnHurt.OnTakeDamageServer += new Manipulator(SetStateOnHurt_OnTakeDamageServer); DotController.InflictDot_refInflictDotInfo += new hook_InflictDot_refInflictDotInfo(DotController_InflictDot_refInflictDotInfo); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); SetStateOnHurt.OnTakeDamageServer -= new Manipulator(SetStateOnHurt_OnTakeDamageServer); DotController.InflictDot_refInflictDotInfo -= new hook_InflictDot_refInflictDotInfo(DotController_InflictDot_refInflictDotInfo); } private void InflictFreezeOrStun(int count, SetStateOnHurt ssoh, DamageReport report, bool isStun) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00b2: 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) //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_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_00d8: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown if (!report.victim.isInFrozenState) { if (isStun) { if (ssoh.canBeStunned) { ssoh.SetStun(1f * report.damageInfo.procCoefficient); } } else { CharacterBody component = ((Component)ssoh).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.AddTimedBuff(Buffs.Slow80, 2f * report.damageInfo.procCoefficient); } } } report.victim.TakeDamage(new DamageInfo { attacker = report.attacker, crit = report.damageInfo.crit, damage = ((float)(count - 1) * procStackDamage + procBaseDamage) * report.attackerBody.damage, damageColorIndex = (DamageColorIndex)3, damageType = DamageTypeCombo.op_Implicit((DamageType)0), force = Vector3.zero, inflictor = report.damageInfo.inflictor, position = report.damageInfo.position, procChainMask = report.damageInfo.procChainMask, procCoefficient = 0f }); } private void InflictBurn(int count, DamageReport report) { //IL_0002: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) InflictDotInfo val = default(InflictDotInfo); val.victimObject = ((Component)report.victim).gameObject; val.attackerObject = report.attacker; val.totalDamage = ((float)(count - 1) * procStackDamage + procBaseDamage) * report.attackerBody.damage; val.dotIndex = (DotIndex)1; val.damageMultiplier = 1f; InflictDotInfo val2 = val; if (Object.op_Implicit((Object)(object)report.attackerMaster)) { StrengthenBurnUtils.CheckDotForUpgrade(report.attackerMaster.inventory, ref val2); } isInternalIgnite = true; DotController.InflictDot(ref val2); isInternalIgnite = false; } private void SetStateOnHurt_OnTakeDamageServer(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0008: 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_0064: 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) ILCursor val = new ILCursor(il); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)delegate(SetStateOnHurt self, DamageReport report) { //IL_0074: 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_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_008e: Invalid comparison between Unknown and I4 //IL_0096: 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_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_00b4: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)self.targetStateMachine) && self.spawnedOverNetwork && Object.op_Implicit((Object)(object)report.attackerBody)) { int countEffective2 = GetCountEffective(report.attackerBody); if (countEffective2 > 0 && (!preventSelfProc || !((Object)(object)report.attacker == (Object)(object)report.victim)) && Util.CheckRoll(procChance, report.attackerMaster.luck, report.attackerMaster)) { bool num = (int)DamageTypeCombo.op_Implicit(report.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)256)) > 0; bool flag = (int)DamageTypeCombo.op_Implicit(report.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)32)) != 0 || (int)DamageTypeCombo.op_Implicit(report.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)16777216)) > 0; if (num) { if (base.rng.nextBool) { InflictFreezeOrStun(countEffective2, self, report, isStun: true); } else { InflictBurn(countEffective2, report); } } if (flag) { if (base.rng.nextBool) { InflictFreezeOrStun(countEffective2, self, report, isStun: false); } else { InflictBurn(countEffective2, report); } } } } }); if (val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Prefabs/Effects/ImpactEffects/ImpactStunGrenade") })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)delegate(SetStateOnHurt self, DamageReport report) { if (report != null && Object.op_Implicit((Object)(object)report.attackerBody) && Object.op_Implicit((Object)(object)report.victimBody)) { int countEffective = GetCountEffective(report.attackerBody); if (countEffective > 0 && (!preventSelfProc || !((Object)(object)report.attacker == (Object)(object)report.victim)) && Util.CheckRoll(procChance, report.attackerMaster.luck, report.attackerMaster)) { if (base.rng.nextBool) { InflictFreezeOrStun(countEffective, self, report, isStun: false); } else { InflictBurn(countEffective, report); } } } }); } else { TinkersSatchelPlugin._logger.LogError((object)"TriBrooch failed to apply IL hook (SSOH OnTakeDamageServer): target instructions not found (ldstr)."); } } private void DotController_InflictDot_refInflictDotInfo(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo) { //IL_0133: 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_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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_01ac: Expected O, but got Unknown orig.Invoke(ref inflictDotInfo); if (isInternalIgnite || !Object.op_Implicit((Object)(object)inflictDotInfo.attackerObject) || !Object.op_Implicit((Object)(object)inflictDotInfo.victimObject)) { return; } CharacterBody component = inflictDotInfo.victimObject.GetComponent(); SetStateOnHurt component2 = inflictDotInfo.victimObject.GetComponent(); CharacterBody component3 = inflictDotInfo.attackerObject.GetComponent(); int countEffective = GetCountEffective(component3); if (countEffective <= 0 || !Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2) || (preventSelfProc && (Object)(object)component == (Object)(object)component3) || !Util.CheckRoll(procChance, component3.master.luck, component3.master)) { return; } bool nextBool = base.rng.nextBool; if (!component.healthComponent.isInFrozenState) { if (nextBool) { if (component2.canBeStunned) { component2.SetStun(1f); } } else { component.AddTimedBuff(Buffs.Slow80, 2f); } } float num = 1f; if (Object.op_Implicit((Object)(object)inflictDotInfo.attackerObject)) { CharacterBody component4 = inflictDotInfo.attackerObject.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { num = component4.damage; } } else if (inflictDotInfo.totalDamage.HasValue) { num = inflictDotInfo.totalDamage.Value; } component.healthComponent.TakeDamage(new DamageInfo { attacker = inflictDotInfo.attackerObject, crit = false, damage = ((float)(countEffective - 1) * procStackDamage + procBaseDamage) * num, damageColorIndex = (DamageColorIndex)3, damageType = DamageTypeCombo.op_Implicit((DamageType)0), force = Vector3.zero, position = component.corePosition, procChainMask = default(ProcChainMask), procCoefficient = 0f }); } } [RegisterAchievement("TkSat_TriBrooch", "TkSat_TriBroochUnlockable", "", 1u, null)] public class TkSatTriBroochAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); SetStateOnHurt.SetStunInternal += new hook_SetStunInternal(SetStateOnHurt_SetStunInternal); SetStateOnHurt.SetFrozenInternal += new hook_SetFrozenInternal(SetStateOnHurt_SetFrozenInternal); CharacterBody.OnClientBuffsChanged += new hook_OnClientBuffsChanged(CharacterBody_OnClientBuffsChanged); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); SetStateOnHurt.SetStunInternal -= new hook_SetStunInternal(SetStateOnHurt_SetStunInternal); SetStateOnHurt.SetFrozenInternal -= new hook_SetFrozenInternal(SetStateOnHurt_SetFrozenInternal); CharacterBody.OnClientBuffsChanged -= new hook_OnClientBuffsChanged(CharacterBody_OnClientBuffsChanged); } private void SetStateOnHurt_SetStunInternal(orig_SetStunInternal orig, SetStateOnHurt self, float duration) { orig.Invoke(self, duration); TriBroochAchievementTracker triBroochAchievementTracker = ((Component)self).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)triBroochAchievementTracker)) { triBroochAchievementTracker = ((Component)self).gameObject.AddComponent(); } triBroochAchievementTracker.stunStopwatch = 3f; } private void SetStateOnHurt_SetFrozenInternal(orig_SetFrozenInternal orig, SetStateOnHurt self, float duration) { orig.Invoke(self, duration); TriBroochAchievementTracker triBroochAchievementTracker = ((Component)self).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)triBroochAchievementTracker)) { triBroochAchievementTracker = ((Component)self).gameObject.AddComponent(); } if (triBroochAchievementTracker.stunStopwatch <= 0f) { triBroochAchievementTracker.freezeStopwatch = 0f; } else { triBroochAchievementTracker.freezeStopwatch = 3f; } } private void CharacterBody_OnClientBuffsChanged(orig_OnClientBuffsChanged orig, CharacterBody self) { orig.Invoke(self); if (!self.HasBuff(Buffs.OnFire)) { return; } TriBroochAchievementTracker component = ((Component)self).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (component.stunStopwatch > 0f && component.freezeStopwatch > 0f) { ((BaseAchievement)this).Grant(); return; } component.stunStopwatch = 0f; component.freezeStopwatch = 0f; } } } public class TriBroochAchievementTracker : MonoBehaviour { public float stunStopwatch; public float freezeStopwatch; private void FixedUpdate() { if (stunStopwatch > 0f) { stunStopwatch -= Time.fixedDeltaTime; } if (freezeStopwatch > 0f) { freezeStopwatch -= Time.fixedDeltaTime; } } } public class DamageBuffer : Item { internal static UnlockableDef unlockable; public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)2 }); [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Amount of damage to convert per stack (hyperbolic).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float bufferFrac { get; private set; } = 0.08f; [AutoConfigRoOSlider("{0:P0}", 0.1f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Hyperbolic cap for bufferFrac.", AutoConfigFlags.None, new object[] { 0.1f, 10f })] public float bufferFracCap { get; private set; } = 2f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Amount of regen multiplier to add per stack (linear) at full barrier.", AutoConfigFlags.None, new object[] { 0f, 10f })] public float regenFrac { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:N1}", 0f, 60f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Time over which each barrier instance is delayed, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float bufferDuration { get; private set; } = 3f; [AutoConfigRoOSlider("{0:N1}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Tick interval of the granted barrier, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float bufferRate { get; private set; } [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { bufferFrac.ToString("0%"), bufferDuration.ToString("N0"), CommonCode.GetBestLanguage(langID).GetLocalizedFormattedStringByToken((bufferRate <= 0f) ? "TINKERSSATCHEL_DAMAGEBUFFER_DESC_CTICK" : "TINKERSSATCHEL_DAMAGEBUFFER_DESC_DTICK", new object[1] { bufferRate.ToString("N2") }), regenFrac.ToString("P0"), bufferFracCap.ToString("P0") }; } public DamageBuffer() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/DamageBuffer.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/damageBufferIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/DamageBuffer.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.04446f, 0.12915f, -0.01916f), localAngles = new Vector3(277.754f, 43.95369f, 323.1906f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.03663f, 0.19062f, -0.00511f), localAngles = new Vector3(3.42107f, 256.1434f, 351.7726f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.01744f, 0.16387f, 0.01867f), localAngles = new Vector3(323.7762f, 23.74602f, 343.3208f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Finger21L", localPos = new Vector3(-0.06918f, 0.36992f, 0.01639f), localAngles = new Vector3(4.23909f, 273.218f, 357.2444f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.01514f, 0.17934f, -0.01492f), localAngles = new Vector3(329.151f, 354.4431f, 1.15425f), localScale = new Vector3(0.08f, 0.08f, 0.08f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.02365f, 0.13215f, -0.05885f), localAngles = new Vector3(272.0608f, 159.5406f, 196.2444f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechHandL", localPos = new Vector3(-0.0212f, 0.31621f, 0.06463f), localAngles = new Vector3(343.0469f, 323.0367f, 1.51606f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.01718f, 0.16946f, -0.02332f), localAngles = new Vector3(330.8368f, 17.82179f, 168.1396f), localScale = new Vector3(0.04f, 0.04f, 0.04f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(-0.03175f, 0.16708f, 0.0162f), localAngles = new Vector3(286.9122f, 184.1758f, 153.3215f), localScale = new Vector3(0.05f, 0.05f, 0.05f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Finger21R", localPos = new Vector3(0.05146f, 0.64353f, 0.04065f), localAngles = new Vector3(342.0906f, 230.3716f, 14.18674f), localScale = new Vector3(1.2f, 1.2f, 1.2f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FootFrontL", localPos = new Vector3(-0.00757f, 0.29597f, 0.01972f), localAngles = new Vector3(355.2064f, 177.3112f, 193.8584f), localScale = new Vector3(0.7f, 0.7f, 0.7f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.01945f, 0.12268f, -0.00211f), localAngles = new Vector3(275.5996f, 215.576f, 249.6473f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "RingFinger", localPos = new Vector3(0.00282f, 0.04216f, 0.00255f), localAngles = new Vector3(345.4385f, 92.49622f, 0.94164f), localScale = new Vector3(0.08f, 0.08f, 0.08f) } }); } public override void SetupAttributes() { base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/damageBufferIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); HealthComponent.ServerFixedUpdate += new hook_ServerFixedUpdate(HealthComponent_ServerFixedUpdate); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0021: 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) orig.Invoke(self, damageInfo); if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.body) || damageInfo == null || DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2097152)) != 0L || (disableSelfDamage && Object.op_Implicit((Object)(object)damageInfo.attacker) && (Object)(object)damageInfo.attacker == (Object)(object)((Component)self).gameObject)) { return; } int countEffective = GetCountEffective(self.body); if (countEffective > 0) { DelayedBarrierComponent delayedBarrierComponent = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)delayedBarrierComponent)) { delayedBarrierComponent = ((Component)self).gameObject.AddComponent(); } float num = Util.Hyperbolic(bufferFrac / bufferFracCap * (float)countEffective) * bufferFracCap; float amount = damageInfo.damage * num; delayedBarrierComponent.ApplyDamage(amount); } } private void HealthComponent_ServerFixedUpdate(orig_ServerFixedUpdate orig, HealthComponent self, float deltaTime) { if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body)) { self.regenAccumulator += self.body.regen * (self.barrier / self.fullBarrier) * (float)GetCountEffective(self.body) * regenFrac; } orig.Invoke(self, deltaTime); } } [RequireComponent(typeof(HealthComponent))] public class DelayedBarrierComponent : MonoBehaviour { private HealthComponent hc; public List<(float curr, float max)> bufferDamage = new List<(float, float)>(); private float stopwatch; private void Awake() { hc = ((Component)this).GetComponent(); } private void FixedUpdate() { if (bufferDamage.Count <= 0) { return; } stopwatch -= Time.fixedDeltaTime; if (stopwatch <= 0f) { stopwatch = Item.instance.bufferRate; float num = 0f; float num2 = Mathf.Max(Item.instance.bufferRate, Time.fixedDeltaTime) / Item.instance.bufferDuration; for (int i = 0; i < bufferDamage.Count; i++) { float num3 = Mathf.Min(bufferDamage[i].max * num2, bufferDamage[i].curr); num += num3; bufferDamage[i] = (bufferDamage[i].curr - num3, bufferDamage[i].max); } bufferDamage.RemoveAll(((float curr, float max) x) => x.curr <= 0f); hc.AddBarrier(num); } } public void ApplyDamage(float amount) { if (amount > 0f) { bufferDamage.Add((amount, amount)); } } } [RegisterAchievement("TkSat_DamageBuffer", "TkSat_DamageBufferUnlockable", "", 1u, null)] public class TkSatDamageBufferAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); HealthComponent.SetBarrier += new hook_SetBarrier(HealthComponent_SetBarrier); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); HealthComponent.SetBarrier -= new hook_SetBarrier(HealthComponent_SetBarrier); } private void HealthComponent_SetBarrier(orig_SetBarrier orig, HealthComponent self, float newBarrier) { orig.Invoke(self, newBarrier); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && !((Object)(object)self.body != (Object)(object)((BaseAchievement)this).localUser.cachedBody) && newBarrier >= self.fullBarrier && newBarrier > 0f) { ((BaseAchievement)this).Grant(); } } } public class DeadManSwitch : Item { private UnlockableDef unlockable; public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return new ReadOnlyCollection((IList)(object)array); } } public override bool itemIsAIBlacklisted { get; protected set; } = true; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Multiplicative internal cooldown reduction per stack past the first.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float cdrStack { get; private set; } = 0.15f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, also applies equipment cooldown reduction from other sources to the ICD. If false, only cdrStack is applied.", AutoConfigFlags.None, new object[] { })] public bool externalCdr { get; private set; } [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("The percentage of maximum health below which to trigger this item's effect.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float healthThreshold { get; private set; } = 0.5f; public BuffDef deadManSwitchBuff { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[2] { cdrStack.ToString("0%"), healthThreshold.ToString("0%") }; } public DeadManSwitch() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/DeadManSwitch.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/deadManSwitchIcon.png"); } public override void SetupAttributes() { //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) base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/deadManSwitchIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; deadManSwitchBuff = ScriptableObject.CreateInstance(); deadManSwitchBuff.buffColor = Color.red; deadManSwitchBuff.canStack = false; deadManSwitchBuff.isDebuff = false; deadManSwitchBuff.isCooldown = true; ((Object)deadManSwitchBuff).name = "TKSATDeadManSwitch"; deadManSwitchBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/deadManSwitchBuff.png"); deadManSwitchBuff.ignoreGrowthNectar = true; ContentAddition.AddBuffDef(deadManSwitchBuff); } public override void Install() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; Inventory.DeductEquipmentCharges_byte_byte_int += new hook_DeductEquipmentCharges_byte_byte_int(Inventory_DeductEquipmentCharges_byte_byte_int); } public override void Uninstall() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); CharacterBody.onBodyInventoryChangedGlobal -= CharacterBody_onBodyInventoryChangedGlobal; Inventory.DeductEquipmentCharges_byte_byte_int -= new hook_DeductEquipmentCharges_byte_byte_int(Inventory_DeductEquipmentCharges_byte_byte_int); } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { if (GetCountEffective(body) > 0 && Object.op_Implicit((Object)(object)body.healthComponent) && Object.op_Implicit((Object)(object)body.equipmentSlot) && !Object.op_Implicit((Object)(object)((Component)body).GetComponent())) { ((Component)body).gameObject.AddComponent(); } } private void Inventory_DeductEquipmentCharges_byte_byte_int(orig_DeductEquipmentCharges_byte_byte_int orig, Inventory self, byte slot, byte set, int deduction) { DeadManSwitchTracker deadManSwitchTracker = default(DeadManSwitchTracker); if (!((Component)self).TryGetComponent(ref deadManSwitchTracker) || !deadManSwitchTracker.doNotDeduct) { orig.Invoke(self, slot, set, deduction); } } } [RequireComponent(typeof(CharacterBody))] public class DeadManSwitchTracker : MonoBehaviour { private float icd; private CharacterBody body; internal bool doNotDeduct; private void Awake() { body = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !body.healthComponent.alive) { return; } if (icd > 0f) { icd -= Time.fixedDeltaTime; } int countEffective = Item.instance.GetCountEffective(body); if (countEffective <= 0) { return; } EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(body.equipmentSlot.equipmentIndex); if (icd <= 0f && (Object)(object)equipmentDef != (Object)null && (body.healthComponent.health + body.healthComponent.shield) / body.healthComponent.fullCombinedHealth <= Item.instance.healthThreshold) { icd = Mathf.Pow(1f - Item.instance.cdrStack, (float)(countEffective - 1)) * equipmentDef.cooldown * (Item.instance.externalCdr ? body.inventory.CalculateEquipmentCooldownScale() : 1f); body.AddTimedBuff(Item.instance.deadManSwitchBuff, icd); if (body.equipmentSlot.PerformEquipmentAction(equipmentDef)) { doNotDeduct = true; body.equipmentSlot.OnEquipmentExecuted(); doNotDeduct = false; } } } } [RegisterAchievement("TkSat_DeadManSwitch", "TkSat_DeadManSwitchUnlockable", "", 2u, null)] public class TkSatDeadManSwitchAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); HealthComponent.ManagedFixedUpdate += new hook_ManagedFixedUpdate(HealthComponent_ManagedFixedUpdate); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); HealthComponent.ManagedFixedUpdate -= new hook_ManagedFixedUpdate(HealthComponent_ManagedFixedUpdate); } private void HealthComponent_ManagedFixedUpdate(orig_ManagedFixedUpdate orig, HealthComponent self, float deltaTime) { orig.Invoke(self, deltaTime); if (!Object.op_Implicit((Object)(object)self) || !self.alive || !Object.op_Implicit((Object)(object)self.body) || ((BaseAchievement)this).localUser == null || !Object.op_Implicit((Object)(object)self.body.masterObject) || !Object.op_Implicit((Object)(object)((BaseAchievement)this).localUser.cachedMasterObject) || (Object)(object)self.body.masterObject != (Object)(object)((BaseAchievement)this).localUser.cachedMasterObject) { return; } DeadManSwitchAchievementTracker deadManSwitchAchievementTracker = self.body.masterObject.GetComponent(); if (!Object.op_Implicit((Object)(object)deadManSwitchAchievementTracker)) { deadManSwitchAchievementTracker = self.body.masterObject.AddComponent(); } if (self.isHealthLow) { if (!deadManSwitchAchievementTracker.lowHealthHysteresis) { deadManSwitchAchievementTracker.lowHealthHysteresis = true; deadManSwitchAchievementTracker.totalLowHealthThisRun++; } } else if ((self.health + self.shield) / self.fullCombinedHealth > 0.5f) { deadManSwitchAchievementTracker.lowHealthHysteresis = false; if (deadManSwitchAchievementTracker.totalLowHealthThisRun >= 9) { ((BaseAchievement)this).Grant(); } } } } public class DeadManSwitchAchievementTracker : MonoBehaviour { public int totalLowHealthThisRun; public bool lowHealthHysteresis; } public class Defib : Item { public Stack healingSourceStack = new Stack(); private Color origColorValue; internal static UnlockableDef unlockable; public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)2 }); [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Multiplier for extra healing per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float critFracStack { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:P0}", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Crit chance added by the first stack of this item.", AutoConfigFlags.None, new object[] { 0f, 100f })] public float critBonus { get; private set; } = 5f; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[1] { critFracStack.ToString("0%") }; } public Defib() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Defib.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/defibIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Defib.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.26373f, -0.03688f, 0.13472f), localAngles = new Vector3(3.97229f, 24.18915f, 320.0512f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.25741f, 0.02941f, 0.16336f), localAngles = new Vector3(11.31925f, 62.99261f, 343.2393f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.21939f, -0.00497f, 0.08003f), localAngles = new Vector3(6.89935f, 26.88605f, 345.3645f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(2.51945f, -0.62436f, -0.32475f), localAngles = new Vector3(321.5959f, 185.307f, 336.2671f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.24955f, 0.05472f, -0.05827f), localAngles = new Vector3(6.89445f, 156.1519f, 170.9947f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.21614f, 0.03119f, -0.01787f), localAngles = new Vector3(9.49167f, 342.7821f, 313.0768f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(-0.25004f, -0.23434f, -0.00175f), localAngles = new Vector3(1.28158f, 359.1089f, 358.4737f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.19571f, 0.00296f, -0.04417f), localAngles = new Vector3(343.5008f, 180.7469f, 174.5094f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.2287f, -0.00565f, 0.02655f), localAngles = new Vector3(358.725f, 7.15952f, 340.7802f), localScale = new Vector3(0.25f, 0.25f, 0.252f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-2.23162f, -0.64699f, 0.27961f), localAngles = new Vector3(356.1298f, 352.0192f, 349.9326f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(-0.82104f, -0.02098f, 0.25977f), localAngles = new Vector3(1.06362f, 6.70138f, 337.7787f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(-0.34318f, -0.15978f, 0.16502f), localAngles = new Vector3(354.301f, 16.48271f, 322.3456f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Center", localPos = new Vector3(-0.2109f, -0.0401f, -0.01089f), localAngles = new Vector3(359.2206f, 350.4163f, 348.9474f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/defibIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_01eb: Unknown result type (might be due to invalid IL or missing references) base.Install(); HealthComponent.Heal += new Manipulator(HealthComponent_Heal); DetonateState.FixedUpdate += new hook_FixedUpdate(DetonateState_FixedUpdate); DroneProjectileHoverHeal.HealOccupants += new hook_HealOccupants(DroneProjectileHoverHeal_HealOccupants); VentCorruption.FixedUpdate += new hook_FixedUpdate(VentCorruption_FixedUpdate); CharacterBody.RemoveBuff_BuffIndex += new hook_RemoveBuff_BuffIndex(CharacterBody_RemoveBuff_BuffIndex); GlobalEventManager.OnCrit += new hook_OnCrit(GlobalEventManager_OnCrit); GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy); HealBeamController.OnTickServer += new hook_OnTickServer(HealBeamController_OnTickServer); HealNearbyController.Tick += new hook_Tick(HealNearbyController_Tick); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); HealthComponent.UsePotion += new hook_UsePotion(HealthComponent_UsePotion); DamageOrb.OnArrival += new hook_OnArrival(DamageOrb_OnArrival); SiphonNearbyController.Tick += new hook_Tick(SiphonNearbyController_Tick); TarTetherController.DoDamageTick += new hook_DoDamageTick(TarTetherController_DoDamageTick); GhostUtilitySkillState.FixedUpdate += new hook_FixedUpdate(GhostUtilitySkillState_FixedUpdate); BurrowDash.FixedUpdate += new hook_FixedUpdate(BurrowDash_FixedUpdate); FlowerProjectileHover.HealPulse += new hook_HealPulse(FlowerProjectileHover_HealPulse); CrushBase.OnEnter += new hook_OnEnter(CrushBase_OnEnter); EquipmentSlot.FireFruit += new hook_FireFruit(EquipmentSlot_FireFruit); EquipmentSlot.FirePassiveHealing += new hook_FirePassiveHealing(EquipmentSlot_FirePassiveHealing); HealingFollowerController.DoHeal += new hook_DoHeal(HealingFollowerController_DoHeal); HealthComponent.UpdateLastHitTime += new hook_UpdateLastHitTime(HealthComponent_UpdateLastHitTime); MushroomVoidBehavior.FixedUpdate += new hook_FixedUpdate(MushroomVoidBehavior_FixedUpdate); Run.FixedUpdate += new hook_FixedUpdate(Run_FixedUpdate); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); HealthComponent.HandleHeal += new Manipulator(HealthComponent_HandleHeal); origColorValue = DamageColor.colors[6]; DamageColor.colors[6] = new Color(0.45f, 1f, 0.7f); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_01b6: 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) base.Uninstall(); HealthComponent.Heal -= new Manipulator(HealthComponent_Heal); DetonateState.FixedUpdate -= new hook_FixedUpdate(DetonateState_FixedUpdate); DroneProjectileHoverHeal.HealOccupants -= new hook_HealOccupants(DroneProjectileHoverHeal_HealOccupants); VentCorruption.FixedUpdate -= new hook_FixedUpdate(VentCorruption_FixedUpdate); CharacterBody.RemoveBuff_BuffIndex -= new hook_RemoveBuff_BuffIndex(CharacterBody_RemoveBuff_BuffIndex); GlobalEventManager.OnCrit -= new hook_OnCrit(GlobalEventManager_OnCrit); GlobalEventManager.OnHitEnemy -= new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy); HealBeamController.OnTickServer -= new hook_OnTickServer(HealBeamController_OnTickServer); HealNearbyController.Tick -= new hook_Tick(HealNearbyController_Tick); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); HealthComponent.UsePotion -= new hook_UsePotion(HealthComponent_UsePotion); DamageOrb.OnArrival -= new hook_OnArrival(DamageOrb_OnArrival); SiphonNearbyController.Tick -= new hook_Tick(SiphonNearbyController_Tick); TarTetherController.DoDamageTick -= new hook_DoDamageTick(TarTetherController_DoDamageTick); GhostUtilitySkillState.FixedUpdate -= new hook_FixedUpdate(GhostUtilitySkillState_FixedUpdate); BurrowDash.FixedUpdate -= new hook_FixedUpdate(BurrowDash_FixedUpdate); FlowerProjectileHover.HealPulse -= new hook_HealPulse(FlowerProjectileHover_HealPulse); CrushBase.OnEnter -= new hook_OnEnter(CrushBase_OnEnter); EquipmentSlot.FireFruit -= new hook_FireFruit(EquipmentSlot_FireFruit); EquipmentSlot.FirePassiveHealing -= new hook_FirePassiveHealing(EquipmentSlot_FirePassiveHealing); HealingFollowerController.DoHeal -= new hook_DoHeal(HealingFollowerController_DoHeal); HealthComponent.UpdateLastHitTime -= new hook_UpdateLastHitTime(HealthComponent_UpdateLastHitTime); MushroomVoidBehavior.FixedUpdate -= new hook_FixedUpdate(MushroomVoidBehavior_FixedUpdate); Run.FixedUpdate -= new hook_FixedUpdate(Run_FixedUpdate); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); DamageColor.colors[6] = origColorValue; } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { args.critAdd += ((GetCountEffective(sender) > 0) ? critBonus : 0f); } private void HealthComponent_HandleHeal(ILContext il) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown ILCursor val = new ILCursor(il); bool wasCrit = false; if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "amount") })) { val.EmitDelegate>((Func)delegate(float hv) { wasCrit = hv < 0f; return Mathf.Abs(hv); }); } else { TinkersSatchelPlugin._logger.LogError((object)"Defib: failed to apply IL hook (HealthComponent_HandleHeal), target instructions not found (amount). Heal numbers may appear as 1s."); } if (val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "SpawnDamageNumber") })) { val.EmitDelegate>((Func)((DamageColorIndex dci) => wasCrit ? ((DamageColorIndex)6) : dci)); } else { TinkersSatchelPlugin._logger.LogError((object)"Defib: failed to apply IL hook (HealthComponent_HandleHeal), target instructions not found (damage number). Crit heals will have the same color as normal heals."); } } private void Run_FixedUpdate(orig_FixedUpdate orig, Run self) { orig.Invoke(self); if (healingSourceStack.Count != 0) { TinkersSatchelPlugin._logger.LogError((object)"Defib: HealingSourceStack was not empty on new frame, clearing. May be a cascading effect of another error, or a mod may be misusing HealingSourceStack."); healingSourceStack.Clear(); } } private void HealthComponent_Heal(ILContext il) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001c: 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) ILCursor val = new ILCursor(il); bool wasCrit = false; val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float origAmount) { wasCrit = false; if (NetworkServer.active && healingSourceStack.Count > 0) { CharacterBody val2 = healingSourceStack.Peek(); int countEffective = GetCountEffective(val2); if (countEffective > 0 && val2.RollCrit()) { wasCrit = true; return origAmount * (1f + critFracStack * (float)countEffective); } } return origAmount; }); val.Emit(OpCodes.Starg, 1); if (val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "SendHeal") })) { val.EmitDelegate>((Func)((bool oldIsCritPCM) => wasCrit)); } else { TinkersSatchelPlugin._logger.LogError((object)"Defib: failed to apply IL hook (HealthComponent_Heal), target instructions not found. Heal numbers will not have a crit effect."); } } private void DetonateState_FixedUpdate(orig_FixedUpdate orig, DetonateState self) { bool num = Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)self).attachedBody); if (num) { healingSourceStack.Push(((BaseBodyAttachmentState)self).attachedBody); } orig.Invoke(self); if (num) { healingSourceStack.Pop(); } } private void DroneProjectileHoverHeal_HealOccupants(orig_HealOccupants orig, DroneProjectileHoverHeal self, float radius, float healPoints, float healFraction) { bool num = Object.op_Implicit((Object)(object)((EntityState)self).outer.commonComponents.characterBody); if (num) { healingSourceStack.Push(((EntityState)self).outer.commonComponents.characterBody); } orig.Invoke(self, radius, healPoints, healFraction); if (num) { healingSourceStack.Pop(); } } private void VentCorruption_FixedUpdate(orig_FixedUpdate orig, VentCorruption self) { bool num = Object.op_Implicit((Object)(object)((EntityState)self).outer.commonComponents.characterBody); if (num) { healingSourceStack.Push(((EntityState)self).outer.commonComponents.characterBody); } orig.Invoke(self); if (num) { healingSourceStack.Pop(); } } private void CharacterBody_RemoveBuff_BuffIndex(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) bool num = Object.op_Implicit((Object)(object)self); if (num) { healingSourceStack.Push(self); } orig.Invoke(self, buffType); if (num) { healingSourceStack.Pop(); } } private void GlobalEventManager_OnCrit(orig_OnCrit orig, GlobalEventManager self, CharacterBody body, DamageInfo damageInfo, CharacterMaster master, float procCoefficient, ProcChainMask procChainMask) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) bool num = Object.op_Implicit((Object)(object)body); if (num) { healingSourceStack.Push(body); } orig.Invoke(self, body, damageInfo, master, procCoefficient, procChainMask); if (num) { healingSourceStack.Pop(); } } private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { bool flag = damageInfo != null && Object.op_Implicit((Object)(object)damageInfo.attacker); CharacterBody val = null; if (flag) { val = damageInfo.attacker.GetComponent(); flag = Object.op_Implicit((Object)(object)val); } if (flag) { healingSourceStack.Push(val); } orig.Invoke(self, damageInfo, victim); if (flag) { healingSourceStack.Pop(); } } private void HealBeamController_OnTickServer(orig_OnTickServer orig, HealBeamController self) { bool flag = Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.ownership) && Object.op_Implicit((Object)(object)self.ownership.ownerObject); CharacterBody val = null; if (flag) { val = self.ownership.ownerObject.GetComponent(); flag = Object.op_Implicit((Object)(object)val); } if (flag) { healingSourceStack.Push(val); } orig.Invoke(self); if (flag) { healingSourceStack.Pop(); } } private void HealNearbyController_Tick(orig_Tick orig, HealNearbyController self) { int num; if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.networkedBodyAttachment)) { num = (Object.op_Implicit((Object)(object)self.networkedBodyAttachment.attachedBody) ? 1 : 0); if (num != 0) { healingSourceStack.Push(self.networkedBodyAttachment.attachedBody); } } else { num = 0; } orig.Invoke(self); if (num != 0) { healingSourceStack.Pop(); } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { bool num = Object.op_Implicit((Object)(object)self.body); if (num) { healingSourceStack.Push(self.body); } orig.Invoke(self, damageInfo); if (num) { healingSourceStack.Pop(); } } private void HealthComponent_UsePotion(orig_UsePotion orig, HealthComponent self) { bool num = Object.op_Implicit((Object)(object)self.body); if (num) { healingSourceStack.Push(self.body); } orig.Invoke(self); if (num) { healingSourceStack.Pop(); } } private void DamageOrb_OnArrival(orig_OnArrival orig, DamageOrb self) { bool flag = self != null && Object.op_Implicit((Object)(object)self.attacker); CharacterBody val = null; if (flag) { val = self.attacker.GetComponent(); flag = Object.op_Implicit((Object)(object)val); } if (flag) { healingSourceStack.Push(val); } orig.Invoke(self); if (flag) { healingSourceStack.Pop(); } } private void SiphonNearbyController_Tick(orig_Tick orig, SiphonNearbyController self) { int num; if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.networkedBodyAttachment)) { num = (Object.op_Implicit((Object)(object)self.networkedBodyAttachment.attachedBody) ? 1 : 0); if (num != 0) { healingSourceStack.Push(self.networkedBodyAttachment.attachedBody); } } else { num = 0; } orig.Invoke(self); if (num != 0) { healingSourceStack.Pop(); } } private void TarTetherController_DoDamageTick(orig_DoDamageTick orig, TarTetherController self, bool mulch) { int num; if (Object.op_Implicit((Object)(object)self)) { num = (Object.op_Implicit((Object)(object)self.ownerBody) ? 1 : 0); if (num != 0) { healingSourceStack.Push(self.ownerBody); } } else { num = 0; } orig.Invoke(self, mulch); if (num != 0) { healingSourceStack.Pop(); } } private void GhostUtilitySkillState_FixedUpdate(orig_FixedUpdate orig, GhostUtilitySkillState self) { bool num = Object.op_Implicit((Object)(object)((EntityState)self).outer.commonComponents.characterBody); if (num) { healingSourceStack.Push(((EntityState)self).outer.commonComponents.characterBody); } orig.Invoke(self); if (num) { healingSourceStack.Pop(); } } private void BurrowDash_FixedUpdate(orig_FixedUpdate orig, BurrowDash self) { bool num = Object.op_Implicit((Object)(object)((EntityState)self).outer.commonComponents.characterBody); if (num) { healingSourceStack.Push(((EntityState)self).outer.commonComponents.characterBody); } orig.Invoke(self); if (num) { healingSourceStack.Pop(); } } private void FlowerProjectileHover_HealPulse(orig_HealPulse orig, FlowerProjectileHover self) { bool flag = Object.op_Implicit((Object)(object)self.owner); CharacterBody val = null; if (flag) { val = self.owner.GetComponent(); flag = Object.op_Implicit((Object)(object)val); } if (flag) { healingSourceStack.Push(val); } orig.Invoke(self); if (flag) { healingSourceStack.Pop(); } } private void CrushBase_OnEnter(orig_OnEnter orig, CrushBase self) { bool num = Object.op_Implicit((Object)(object)((EntityState)self).outer.commonComponents.characterBody); if (num) { healingSourceStack.Push(((EntityState)self).outer.commonComponents.characterBody); } orig.Invoke(self); if (num) { healingSourceStack.Pop(); } } private bool EquipmentSlot_FireFruit(orig_FireFruit orig, EquipmentSlot self) { bool flag = Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.characterBody); if (flag) { healingSourceStack.Push(self.characterBody); } bool result = orig.Invoke(self); if (flag) { healingSourceStack.Pop(); } return result; } private bool EquipmentSlot_FirePassiveHealing(orig_FirePassiveHealing orig, EquipmentSlot self) { bool flag = Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.characterBody); if (flag) { healingSourceStack.Push(self.characterBody); } bool result = orig.Invoke(self); if (flag) { healingSourceStack.Pop(); } return result; } private void HealingFollowerController_DoHeal(orig_DoHeal orig, HealingFollowerController self, float healFraction) { bool flag = Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.ownerBodyObject); CharacterBody val = null; if (flag) { val = self.ownerBodyObject.GetComponent(); flag = Object.op_Implicit((Object)(object)val); } if (flag) { healingSourceStack.Push(val); } orig.Invoke(self, healFraction); if (flag) { healingSourceStack.Pop(); } } private void HealthComponent_UpdateLastHitTime(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker, bool delayedDamage, bool firstHitOfDelayedDamage) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) int num; if (Object.op_Implicit((Object)(object)self)) { num = (Object.op_Implicit((Object)(object)self.body) ? 1 : 0); if (num != 0) { healingSourceStack.Push(self.body); } } else { num = 0; } orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker, delayedDamage, firstHitOfDelayedDamage); if (num != 0) { healingSourceStack.Pop(); } } private void MushroomVoidBehavior_FixedUpdate(orig_FixedUpdate orig, MushroomVoidBehavior self) { int num; if (Object.op_Implicit((Object)(object)self)) { num = (Object.op_Implicit((Object)(object)((ItemBehavior)self).body) ? 1 : 0); if (num != 0) { healingSourceStack.Push(((ItemBehavior)self).body); } } else { num = 0; } orig.Invoke(self); if (num != 0) { healingSourceStack.Pop(); } } } [RegisterAchievement("TkSat_Defib", "TkSat_DefibUnlockable", "", 2u, null)] public class TkSatDefibAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); CharacterMaster.OnInventoryChanged -= new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } private void CharacterMaster_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self) { //IL_0096: 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_00ad: 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) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00e9: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!((Object)(object)((BaseAchievement)this).localUser.cachedMaster != (Object)(object)self)) { int num = 0; if (self.inventory.GetItemCountEffective(Items.Mushroom) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.Tooth) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.TPHealingNova) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.Plant) > 0) { num++; } if (Item.instance.GetCountEffective(self.inventory) > 0) { num++; } if (self.inventory.currentEquipmentIndex == Equipment.PassiveHealing.equipmentIndex || self.inventory.alternateEquipmentIndex == Equipment.PassiveHealing.equipmentIndex) { num++; } if (self.inventory.currentEquipmentIndex == Equipment.VendingMachine.equipmentIndex || self.inventory.alternateEquipmentIndex == Equipment.VendingMachine.equipmentIndex) { num++; } if (num >= 4) { ((BaseAchievement)this).Grant(); } } } } public class EnPassant : Item { public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Base damage of the attack, per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float attackDamage { get; private set; } = 0.7f; [AutoConfigRoOSlider("{0:N0} s", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Duration of the attack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float attackTime { get; private set; } = 1.5f; [AutoConfigRoOSlider("{0:N2} s", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Fixed cooldown reduction per attack hit, per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float cdrPerHit { get; private set; } = 0.15f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of the item attack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 1f; [AutoConfigRoOIntSlider("{0:N0}", 0, 50, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Maximum number of hits to apply CDR from per attack, per stack.", AutoConfigFlags.None, new object[] { 0, int.MaxValue })] public int maxCdrHits { get; private set; } = 5; public GameObject attackPrefab { get; private set; } public GameObject hitEffectPrefab { get; private set; } public GameObject swingEffectPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[4] { attackDamage.ToString("P0"), attackTime.ToString("N0"), cdrPerHit.ToString("N3"), maxCdrHits.ToString("N0") }; } public EnPassant() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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) //IL_009a: 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_00f8: Unknown result type (might be due to invalid IL or missing references) base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/EnPassant.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/enPassantIcon.png"); attackPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Misc/EnPassantAttack.prefab"); hitEffectPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/OmniImpactVFXSlash.prefab").WaitForCompletion(); GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Merc/MercSwordSlashWhirlwind.prefab").WaitForCompletion(), "TkSatTempSetupPrefab", false); Transform obj = val.transform.Find("SwingTrail"); Transform val2 = val.transform.Find("Distortion"); obj.rotation = Quaternion.Euler(90f, 0f, 0f); val2.rotation = Quaternion.Euler(90f, 0f, 0f); swingEffectPrefab = PrefabAPI.InstantiateClone(val, "TkSatEnPassantSwingEffect", false); ContentAddition.AddEffect(swingEffectPrefab); } public override void SetupAttributes() { base.SetupAttributes(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Invalid comparison between Unknown and I4 orig.Invoke(self, skill); if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.skillLocator) && (int)self.skillLocator.FindSkillSlot(skill) == 2 && GetCountEffective(self) > 0) { GameObject obj = Object.Instantiate(attackPrefab); obj.GetComponent().duration = attackTime; obj.GetComponent().Begin(self); } } } [RequireComponent(typeof(HitBoxGroup))] public class EnPassantAttack : MonoBehaviour { private OverlapAttack attack; private CharacterBody attackerBody; private float stopwatch; private float visualStopwatch; private const float TICK_RATE = 0.1f; private const float VISUAL_TICK_RATE = 0.2f; private List results; private int totalHits; public void Begin(CharacterBody attackerBody) { //IL_0008: 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_0019: 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_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_0036: 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_006a: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown this.attackerBody = attackerBody; attack = new OverlapAttack { attacker = ((Component)attackerBody).gameObject, inflictor = ((Component)attackerBody).gameObject, teamIndex = TeamComponent.GetObjectTeam(((Component)attackerBody).gameObject), damage = attackerBody.damage * Item.instance.attackDamage * (float)Item.instance.GetCountEffective(attackerBody), hitEffectPrefab = Item.instance.hitEffectPrefab, isCrit = attackerBody.RollCrit(), hitBoxGroup = ((Component)this).GetComponent(), procCoefficient = Item.instance.procCoefficient }; } private void Awake() { results = new List(); } private void FixedUpdate() { //IL_0042: 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) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Expected O, but got Unknown if (attack == null || !NetworkServer.active) { return; } if (!Object.op_Implicit((Object)(object)attackerBody) || !attackerBody.healthComponent.alive) { Object.Destroy((Object)(object)this); return; } ((Component)this).transform.position = attackerBody.corePosition; stopwatch += Time.fixedDeltaTime; visualStopwatch += Time.fixedDeltaTime; if (stopwatch > 0.1f) { stopwatch %= 0.1f; results.Clear(); attack.Fire(results); int countEffective = Item.instance.GetCountEffective(attackerBody); int num = Mathf.Min(totalHits + results.Count, Item.instance.maxCdrHits); int num2 = num - totalHits; totalHits = num; if (num2 > 0) { attackerBody.skillLocator.GetSkill((SkillSlot)2).RunRecharge(Item.instance.cdrPerHit * (float)num2 * (float)countEffective); } } if (visualStopwatch >= 0.2f) { visualStopwatch %= 0.2f; EffectManager.SpawnEffect(Item.instance.swingEffectPrefab, new EffectData { origin = attackerBody.corePosition, start = attackerBody.corePosition }, true); } } } public class FudgeDice : Item { internal BuffDef readyBuff; internal BuffDef consumedBuff; internal GameObject cloverEffect; public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)3 }); public override bool itemIsAIBlacklisted { get; protected set; } = true; [AutoConfigRoOSlider("{0:P0}", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Base cooldown at first stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float icd { get; private set; } = 20f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Multiplicative internal cooldown reduction per stack past the first.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float cdrStack { get; private set; } = 0.1f; [AutoConfigRoOIntSlider("{0:N0}", 1, 100, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Amount of luck to provide per proc. Should be treated as value+1 due to the effect including a non-luck reroll.", AutoConfigFlags.None, new object[] { 1, 100 })] public int boostAmount { get; private set; } = 2; protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { icd.ToString("N0"), cdrStack.ToString("0%"), boostAmount.ToString() }; } public FudgeDice() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/FudgeDice.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/fudgeDiceIcon.png"); } public override void SetupAttributes() { //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) //IL_009c: 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_0122: 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) base.SetupAttributes(); readyBuff = ScriptableObject.CreateInstance(); readyBuff.buffColor = Color.white; readyBuff.canStack = false; readyBuff.isDebuff = false; readyBuff.isCooldown = true; ((Object)readyBuff).name = base.modInfo.shortIdentifier + "FudgeDiceReady"; readyBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/fudgeDiceBuffIcon.png"); ContentAddition.AddBuffDef(readyBuff); consumedBuff = ScriptableObject.CreateInstance(); consumedBuff.buffColor = Color.gray; consumedBuff.canStack = false; consumedBuff.isDebuff = false; consumedBuff.isCooldown = true; ((Object)consumedBuff).name = base.modInfo.shortIdentifier + "FudgeDiceConsumed"; consumedBuff.ignoreGrowthNectar = true; consumedBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/fudgeDiceBuffConsumedIcon.png"); ContentAddition.AddBuffDef(consumedBuff); cloverEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/Clover/CloverEffect.prefab").WaitForCompletion(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); Util.CheckRoll_float_float_CharacterMaster += new hook_CheckRoll_float_float_CharacterMaster(Util_CheckRoll_float_float_CharacterMaster); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); Util.CheckRoll_float_float_CharacterMaster -= new hook_CheckRoll_float_float_CharacterMaster(Util_CheckRoll_float_float_CharacterMaster); CharacterBody.onBodyInventoryChangedGlobal -= CharacterBody_onBodyInventoryChangedGlobal; } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.master) && GetCountEffective(body) > 0 && !Object.op_Implicit((Object)(object)((Component)body.master).gameObject.GetComponent())) { ((Component)body.master).gameObject.AddComponent(); } } private bool Util_CheckRoll_float_float_CharacterMaster(orig_CheckRoll_float_float_CharacterMaster orig, float percentChance, float luck, CharacterMaster effectOriginMaster) { int countEffective = GetCountEffective(effectOriginMaster); if (countEffective > 0 && percentChance > 0f) { FudgeDiceICD fudgeDiceICD = ((Component)effectOriginMaster).GetComponent(); if (!Object.op_Implicit((Object)(object)fudgeDiceICD)) { fudgeDiceICD = ((Component)effectOriginMaster).gameObject.AddComponent(); } if (fudgeDiceICD.stopwatch <= 0f) { bool flag = orig.Invoke(percentChance, luck, effectOriginMaster); if (flag) { return flag; } bool num = orig.Invoke(percentChance, luck + (float)boostAmount, effectOriginMaster); if (num) { fudgeDiceICD.stopwatch = icd * Mathf.Pow(1f - cdrStack, (float)(countEffective - 1)); fudgeDiceICD.wasLucky = true; } return num; } } return orig.Invoke(percentChance, luck, effectOriginMaster); } } public class FudgeDiceICD : MonoBehaviour { public float stopwatch; private CharacterMaster master; private CharacterBody body; internal bool wasLucky; private void Awake() { master = ((Component)this).GetComponent(); } private void OnDisable() { if (Object.op_Implicit((Object)(object)body) && NetworkServer.active) { body.RemoveBuff(Item.instance.consumedBuff); body.RemoveBuff(Item.instance.readyBuff); } } private void FixedUpdate() { //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown int countEffective = Item.instance.GetCountEffective(master); if (stopwatch > 0f && countEffective > 0) { stopwatch -= Time.fixedDeltaTime; } if (!Object.op_Implicit((Object)(object)body)) { body = master.GetBody(); } if (!Object.op_Implicit((Object)(object)body) || !NetworkServer.active) { return; } if (countEffective == 0) { body.RemoveBuff(Item.instance.readyBuff); body.RemoveBuff(Item.instance.consumedBuff); } else if (stopwatch > 0f) { if (!body.HasBuff(Item.instance.consumedBuff)) { body.AddBuff(Item.instance.consumedBuff); } body.RemoveBuff(Item.instance.readyBuff); } else { if (!body.HasBuff(Item.instance.readyBuff)) { body.AddBuff(Item.instance.readyBuff); } body.RemoveBuff(Item.instance.consumedBuff); } if (wasLucky) { wasLucky = false; Transform coreTransform = body.coreTransform; EffectManager.SpawnEffect(Item.instance.cloverEffect, new EffectData { origin = coreTransform.position, rotation = coreTransform.rotation }, true); } } } public class GoldenGear : Item { internal static UnlockableDef unlockable; public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)2 }); [AutoConfigRoOIntSlider("${0:N0}", 1, 1000, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Gold required for the first point of armor. Scales with difficulty level.", AutoConfigFlags.None, new object[] { 1, int.MaxValue })] public int goldAmt { get; private set; } = 2; [AutoConfigRoOSlider("{0:P1}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Exponential reduction to points of armor past the first.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float goldExp { get; private set; } = 0.01f; [AutoConfigRoOSlider("{0:N1} s", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Duration of each point of armor.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float duration { get; private set; } = 5f; public BuffDef goldenGearBuff { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { goldAmt.ToString("N0"), goldExp.ToString("0%"), duration.ToString("N1") }; } public GoldenGear() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/GoldenGear.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/goldenGearIcon.png"); } public override void SetupAttributes() { //IL_0026: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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) base.SetupAttributes(); goldenGearBuff = ScriptableObject.CreateInstance(); goldenGearBuff.buffColor = new Color(0.85f, 0.8f, 0.3f); goldenGearBuff.canStack = true; goldenGearBuff.isDebuff = false; ((Object)goldenGearBuff).name = "TKSATGoldenGear"; goldenGearBuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion(); ContentAddition.AddBuffDef(goldenGearBuff); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/goldenGearIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; ((Renderer)((Component)base.modelResource.transform.Find("GoldenGear2")).GetComponent()).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Chest1/matChest1.mat").WaitForCompletion(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); CharacterMaster.GiveMoney += new hook_GiveMoney(CharacterMaster_GiveMoney); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(Evt_GetStatCoefficients); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); CharacterMaster.GiveMoney -= new hook_GiveMoney(CharacterMaster_GiveMoney); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(Evt_GetStatCoefficients); } private void Evt_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)sender)) { GoldenGearComponent component = ((Component)sender).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { float num = Mathf.Log((float)component.totalBuff * goldExp + 1f) / Mathf.Log(goldExp + 1f) * (float)GetCountEffective(sender); sender.SetBuffCount(Item.instance.goldenGearBuff.buffIndex, Mathf.FloorToInt(num)); args.armorAdd += num; } } } private void CharacterMaster_GiveMoney(orig_GiveMoney orig, CharacterMaster self, uint amount) { orig.Invoke(self, amount); if (self.hasBody && GetCountEffective(self) != 0) { CharacterBody body = self.GetBody(); GoldenGearComponent goldenGearComponent = ((Component)body).GetComponent(); if (!Object.op_Implicit((Object)(object)goldenGearComponent)) { goldenGearComponent = ((Component)body).gameObject.AddComponent(); } goldenGearComponent.cachedMoney += amount; } } } public class GoldenGearComponent : MonoBehaviour { public uint cachedMoney; private readonly List<(int count, float timestamp)> stacks = new List<(int, float)>(); public int totalBuff { get; private set; } private void FixedUpdate() { int difficultyScaledCost = Run.instance.GetDifficultyScaledCost(Item.instance.goldAmt); int num = Mathf.FloorToInt((float)(cachedMoney / difficultyScaledCost)); if (num > 0) { cachedMoney -= (uint)(num * difficultyScaledCost); stacks.Add((num, Time.fixedTime)); } stacks.RemoveAll(((int count, float timestamp) stack) => Time.fixedTime - stack.timestamp > Item.instance.duration); int num2 = stacks.Sum(((int count, float timestamp) stack) => stack.count); CharacterBody val = default(CharacterBody); if (((Component)this).TryGetComponent(ref val) && num2 != totalBuff) { val.statsDirty = true; } totalBuff = num2; } } public class ShrineFailTracker : MonoBehaviour { public int failCount; } [RegisterAchievement("TkSat_GoldenGear", "TkSat_GoldenGearUnlockable", null, 2u, typeof(TkSatGoldenGearServerAchievement))] public class TkSatGoldenGearAchievement : BaseAchievement { private class TkSatGoldenGearServerAchievement : BaseServerAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseServerAchievement)this).OnInstall(); ShrineChanceBehavior.AddShrineStack += new hook_AddShrineStack(ShrineChanceBehavior_AddShrineStack); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseServerAchievement)this).OnUninstall(); ShrineChanceBehavior.AddShrineStack -= new hook_AddShrineStack(ShrineChanceBehavior_AddShrineStack); } private void ShrineChanceBehavior_AddShrineStack(orig_AddShrineStack orig, ShrineChanceBehavior self, Interactor activator) { int successfulPurchaseCount = self.successfulPurchaseCount; orig.Invoke(self, activator); int successfulPurchaseCount2 = self.successfulPurchaseCount; ShrineFailTracker shrineFailTracker = ((Component)self).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)shrineFailTracker)) { shrineFailTracker = ((Component)self).gameObject.AddComponent(); } if (successfulPurchaseCount == successfulPurchaseCount2) { shrineFailTracker.failCount++; } else if (shrineFailTracker.failCount >= 4) { CharacterBody currentBody = base.serverAchievementTracker.networkUser.GetCurrentBody(); if (Object.op_Implicit((Object)(object)currentBody) && (Object)(object)((Component)currentBody).GetComponent() == (Object)(object)activator) { ((BaseServerAchievement)this).Grant(); } } } } public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } } public class HurdyGurdy : Item { private readonly HashSet skillOverrides = new HashSet(); public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Base damage of this item's projectiles.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float projDamage { get; private set; } = 2f; [AutoConfigRoOSlider("{0:P0}", 0f, 180f, null, null)] [AutoConfig("Forward cone angle for acquiring projectile targets.", AutoConfigFlags.None, new object[] { 0f, 180f })] public float projAngle { get; private set; } = 30f; [AutoConfigRoOIntSlider("{0:N0}", 1, 100, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Uninterrupted secondary skill activations required to start firing.", AutoConfigFlags.None, new object[] { 1, int.MaxValue })] public int windupTime { get; private set; } = 3; [AutoConfigRoOIntSlider("{0:N0}", 0, 10, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Secondary skill charges provided by the first stack of this item.", AutoConfigFlags.None, new object[] { 0, int.MaxValue })] public int baseCharges { get; private set; } = 2; [AutoConfigRoOIntSlider("{0:N0}", 0, 10, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Secondary skill charges provided per additional first stack of this item.", AutoConfigFlags.None, new object[] { 0, int.MaxValue })] public int stackCharges { get; private set; } = 1; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfig("Proc coefficient of the item attack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 0.5f; [AutoConfigRoOString(null, null)] [AutoConfig("Skill names which will always count for consecutive Hurdy-Gurdy activations.", AutoConfigFlags.None, new object[] { })] public string skillOverridesConfig { get; private set; } = "RailgunnerBodyFireSnipeHeavy"; public GameObject orbEffectPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[4] { projDamage.ToString("P0"), windupTime.ToString("N0"), baseCharges.ToString("N0"), stackCharges.ToString("N0") }; } public HurdyGurdy() { //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_00a5: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/HurdyGurdy.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/hurdyGurdyIcon.png"); GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/DLC1/ChainLightningVoid/VoidLightningOrbEffect.prefab").WaitForCompletion(), "temporary setup prefab", false); val.GetComponent().endEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/MagmaWorm/MagmaWormImpactExplosion.prefab").WaitForCompletion(); val.GetComponent().soundName = "Play_fireballsOnHit_impact"; LineRenderer component = ((Component)val.transform.Find("Bezier")).GetComponent(); ((Renderer)component).materials[0] = Object.Instantiate(Addressables.LoadAssetAsync((object)"RoR2/DLC1/ChainLightningVoid/matLightingLongVoid.mat").WaitForCompletion()); ((Renderer)component).materials[0].SetTexture("_RemapTex", (Texture)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Common/ColorRamps/texRampWilloWispExplosion.png").WaitForCompletion()); ((Renderer)((Component)val.transform.Find("Bezier").Find("HarshGlow, Billboard")).GetComponent()).material = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/matFirePillarParticle.mat").WaitForCompletion(); orbEffectPrefab = PrefabAPI.InstantiateClone(val, "HurdyGurdyOrbPrefab", false); Object.Destroy((Object)(object)val); ContentAddition.AddEffect(orbEffectPrefab); } public override void SetupConfig() { base.SetupConfig(); base.ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "skillOverridesConfig") { UpdateSkillOverrides(); } }; } public override void SetupAttributes() { base.SetupAttributes(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); CharacterBody.RecalculateStats -= new hook_RecalculateStats(CharacterBody_RecalculateStats); } private void UpdateSkillOverrides() { skillOverrides.Clear(); skillOverrides.UnionWith(skillOverridesConfig.Split(',')); } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); int countEffective = GetCountEffective(self); if (countEffective > 0 && Object.op_Implicit((Object)(object)self.skillLocator) && Object.op_Implicit((Object)(object)self.skillLocator.secondaryBonusStockSkill)) { self.skillLocator.secondaryBonusStockSkill.SetBonusStockFromBody(self.skillLocator.secondaryBonusStockSkill.bonusStockFromBody + baseCharges + (countEffective - 1) * stackCharges); } } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00f4: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0132: 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) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, skill); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.skillLocator) || !Object.op_Implicit((Object)(object)skill.skillDef)) { return; } int countEffective = GetCountEffective(self); if (countEffective == 0) { return; } HurdyGurdyTracker hurdyGurdyTracker = default(HurdyGurdyTracker); if (!((Component)self).TryGetComponent(ref hurdyGurdyTracker)) { hurdyGurdyTracker = ((Component)self).gameObject.AddComponent(); } if (((int)self.skillLocator.FindSkillSlot(skill) != 1 || skill.skillDef.baseRechargeInterval < 1f || skill.skillDef.stockToConsume <= 0) && !skillOverrides.Contains(((Object)skill).name.Replace("(Clone)", ""))) { hurdyGurdyTracker.consecutiveCasts = 0; } else { hurdyGurdyTracker.consecutiveCasts++; } if (hurdyGurdyTracker.consecutiveCasts < windupTime) { return; } BullseyeSearch val = new BullseyeSearch { maxAngleFilter = projAngle, maxDistanceFilter = 1000f, teamMaskFilter = TeamMask.allButNeutral, filterByLoS = true, searchOrigin = self.corePosition, searchDirection = (Object.op_Implicit((Object)(object)self.inputBank) ? self.inputBank.aimDirection : self.characterDirection.forward), sortMode = (SortMode)0 }; ((TeamMask)(ref val.teamMaskFilter)).RemoveTeam(self.teamComponent.teamIndex); val.RefreshCandidates(); HurtBox[] array = val.GetResults().ToArray(); if (array.Any()) { for (int i = 0; i < countEffective; i++) { HurtBox target = base.rng.NextElementUniform(array); OrbManager.instance.AddOrb((Orb)(object)new HurdyGurdyOrb { origin = (Object.op_Implicit((Object)(object)self.aimOriginTransform) ? self.aimOriginTransform.position : self.corePosition), damageValue = self.damage * projDamage, damageType = DamageTypeCombo.op_Implicit((DamageType)128), isCrit = self.RollCrit(), bouncesRemaining = 0, teamIndex = self.teamComponent.teamIndex, attacker = ((Component)self).gameObject, target = target, procCoefficient = procCoefficient, procChainMask = default(ProcChainMask), range = 1000f, damageColorIndex = (DamageColorIndex)3 }); } } } } public class HurdyGurdyOrb : LightningOrb { public override void Begin() { //IL_0003: 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_001a: 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_0031: Expected O, but got Unknown base.lightningType = (LightningType)10; ((Orb)this).duration = 0.5f; EffectData val = new EffectData { origin = ((Orb)this).origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(((Orb)this).target); EffectManager.SpawnEffect(Item.instance.orbEffectPrefab, val, true); } } [RequireComponent(typeof(CharacterBody))] public class HurdyGurdyTracker : MonoBehaviour { public int consecutiveCasts; } public class KleinBottle : Item { private const float PULL_VFX_DURATION = 0.2f; private GameObject blackHolePrefab; internal static UnlockableDef unlockable; public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)3 }); [AutoConfigRoOSlider("{0:N0}%", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Percent chance for Unstable Klein Bottle to proc; stacks multiplicatively.", AutoConfigFlags.None, new object[] { 0f, 100f })] public float procChance { get; private set; } = 8f; [AutoConfigRoOSlider("{0:N0} m", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Range of the Unstable Klein Bottle effect.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float pullRadius { get; private set; } = 20f; [AutoConfigRoOSlider("{0:N0} m", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Vertical hold distance of the Unstable Klein Bottle's float effect.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float pullHeight { get; private set; } = 2f; [AutoConfigRoOSlider("{0:N0} m", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Radius of random motion of the Unstable Klein Bottle's float effect.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float pullWobble { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:N0} m", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Duration of the Unstable Klein Bottle's float effect and stun.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float pullTime { get; private set; } = 1f; [AutoConfigRoOSlider("{0:N1} s", 0f, 5f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Internal cooldown of the Unstable Klein Bottle effect.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float procIcd { get; private set; } = 1.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Damage multiplier stat of the attack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of the item attack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 1f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public HashSet meleeSurvivorBodyNames { get; private set; } = new HashSet(); public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { (procChance / 100f).ToString("0.0%"), pullRadius.ToString("N0"), pullTime.ToString("N1"), damageFrac.ToString("0%"), procIcd.ToString("N1") }; } public KleinBottle() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/KleinBottle.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/kleinBottleIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/KleinBottle.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.18385f, -0.05021f, 0.21923f), localAngles = new Vector3(2.6735f, 135.1785f, 13.09227f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.13168f, 0.02659f, 0.19437f), localAngles = new Vector3(299.1736f, 346.5668f, 36.47252f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.12711f, 0.00711f, 0.21108f), localAngles = new Vector3(8.32233f, 215.3281f, 68.41956f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(1.8815f, 0.55862f, -1.43218f), localAngles = new Vector3(31.47537f, 44.48933f, 67.88132f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.17431f, 0.06083f, -0.16633f), localAngles = new Vector3(357.3008f, 336.6205f, 214.8969f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.16192f, 0.04258f, 0.14787f), localAngles = new Vector3(0.29875f, 190.6623f, 78.13039f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(-0.29402f, -0.14115f, 0.14596f), localAngles = new Vector3(359.3754f, 127.6388f, 22.99833f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.16458f, 0.02023f, -0.16988f), localAngles = new Vector3(10.37267f, 353.8983f, 232.3469f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.22396f, 0.03669f, 0.10444f), localAngles = new Vector3(10.59909f, 116.392f, 7.43709f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-1.99444f, -0.82445f, 1.32131f), localAngles = new Vector3(322.5328f, 44.39863f, 31.38298f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(-0.801f, 0.21188f, 0.38861f), localAngles = new Vector3(308.2326f, 10.8672f, 329.0782f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(-0.24509f, -0.04663f, 0.20478f), localAngles = new Vector3(340.0907f, 84.28757f, 340.4817f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.07793f, 0.15426f, 0.20927f), localAngles = new Vector3(71.3228f, 4.0839f, 204.0715f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { //IL_009b: 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_00ad: 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) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/GravSphere"), "temporary setup prefab", false); ProjectileSimple component = val.GetComponent(); component.desiredForwardSpeed = 0f; component.lifetime = 0.2f; val.GetComponent().procCoefficient = 0f; ProjectileDamage component2 = ((Component)component).GetComponent(); component2.damage = 0f; ((Behaviour)component2).enabled = false; ((Behaviour)val.GetComponent()).enabled = false; ((Component)val.transform.Find("Sphere")).gameObject.SetActive(false); ParticleSystem component3 = ((Component)val.transform.Find("Sparks")).GetComponent(); MainModule main = component3.main; ((MainModule)(ref main)).startSpeed = new MinMaxCurve(10f, 30f); ShapeModule shape = component3.shape; ((ShapeModule)(ref shape)).radius = 4f; blackHolePrefab = PrefabAPI.InstantiateClone(val, "KleinBottleProcPrefab", true); Object.Destroy((Object)(object)val); ContentAddition.AddProjectile(blackHolePrefab); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/kleinBottleIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void SetupConfig() { base.SetupConfig(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); HealthComponent.UpdateLastHitTime += new hook_UpdateLastHitTime(HealthComponent_UpdateLastHitTime); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); HealthComponent.UpdateLastHitTime += new hook_UpdateLastHitTime(HealthComponent_UpdateLastHitTime); } private void HealthComponent_UpdateLastHitTime(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker, bool delayedDamage, bool firstHitOfDelayedDamage) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_017a: Invalid comparison between Unknown and I4 //IL_019d: 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_01b0: 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_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) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_028e: 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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Expected O, but got Unknown orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker, delayedDamage, firstHitOfDelayedDamage); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self.body) || !Object.op_Implicit((Object)(object)self.body.teamComponent) || !(damageValue > 0f) || (disableSelfDamage && Object.op_Implicit((Object)(object)attacker) && !((Object)(object)attacker != (Object)(object)((Component)self).gameObject))) { return; } KleinBottleTimeTracker kleinBottleTimeTracker = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)kleinBottleTimeTracker)) { kleinBottleTimeTracker = ((Component)self).gameObject.AddComponent(); } if (Time.fixedTime - kleinBottleTimeTracker.LastTimestamp < procIcd) { return; } kleinBottleTimeTracker.LastTimestamp = Time.fixedTime; int countEffective = GetCountEffective(self.body); float num = (1f - Mathf.Pow(1f - procChance / 100f, (float)countEffective)) * 100f; if (!((!Object.op_Implicit((Object)(object)self.body.master)) ? Util.CheckRoll(num, 0f, (CharacterMaster)null) : Util.CheckRoll(num, self.body.master.luck, self.body.master))) { return; } ProjectileManager.instance.FireProjectile(blackHolePrefab, self.body.corePosition, Quaternion.identity, ((Component)self.body).gameObject, 0f, 0f, false, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); List list = new List(); bool flag = (int)FriendlyFireManager.friendlyFireMode > 0; TeamIndex[] obj = (TeamIndex[])Enum.GetValues(typeof(TeamIndex)); TeamIndex objectTeam = TeamComponent.GetObjectTeam(((Component)self.body).gameObject); TeamIndex[] array = obj; foreach (TeamIndex val in array) { if (flag || objectTeam != val) { list.AddRange(TeamComponent.GetTeamMembers(val)); } } list.Remove(self.body.teamComponent); float num2 = pullRadius * pullRadius; bool crit = self.body.RollCrit(); SetStateOnHurt val3 = default(SetStateOnHurt); foreach (TeamComponent item in list) { Vector3 val2 = ((Component)item).transform.position - ((Component)self).transform.position; if (((Vector3)(ref val2)).sqrMagnitude <= num2 && Object.op_Implicit((Object)(object)item.body) && ((Behaviour)item.body).isActiveAndEnabled && Object.op_Implicit((Object)(object)item.body.healthComponent)) { FloatDebuffModule.Inflict(item.body.healthComponent, new DamageInfo { attacker = ((Component)self).gameObject, canRejectForce = true, crit = crit, damage = self.body.damage * damageFrac, damageColorIndex = (DamageColorIndex)3, damageType = DamageTypeCombo.op_Implicit((DamageType)131072), force = Vector3.zero, inflictor = null, position = item.body.corePosition, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient }, new FloatDebuffController.FloatDebuffParams { duration = pullTime, height = pullHeight, slamForce = 25f, wobbleForce = 8f, wobbleRadius = pullWobble, wobbleSpeed = 0.5f }); if (((Component)item.body).gameObject.TryGetComponent(ref val3) && val3.canBeStunned) { val3.SetStun(pullTime); } } } } } public class KleinBottleTimeTracker : MonoBehaviour { public float LastTimestamp; } [Obsolete("Replaced by FloatDebuffController.")] [RequireComponent(typeof(HealthComponent))] public class KleinBottleDebuff : MonoBehaviour { private HealthComponent healthComponent; private IPhysMotor motor; private bool started; public Vector3 targetHoldPos; public float holdStopwatch; public float wobbleSeed; public DamageInfo deferredDamageInfo; private void Awake() { healthComponent = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_0036: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_0095: 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_00a9: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_0116: 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_012b: Unknown result type (might be due to invalid IL or missing references) if (started) { holdStopwatch -= Time.fixedDeltaTime; float num = (holdStopwatch + wobbleSeed) * MathF.PI * 0.5f; Vector3 val = targetHoldPos + new Vector3(Mathf.Cos(num), Mathf.Cos(num * 2f), Mathf.Cos(num * 3f)) * Item.instance.pullWobble - healthComponent.body.transform.position; IPhysMotor obj = motor; PhysForceInfo val2 = new PhysForceInfo { force = (((Vector3)(ref val)).normalized * 8f - motor.velocity) * motor.mass }; ((PhysForceInfo)(ref val2)).ignoreGroundStick = true; ((PhysForceInfo)(ref val2)).disableAirControlUntilCollision = false; obj.ApplyForceImpulse(ref val2); if (holdStopwatch <= 0f) { IPhysMotor obj2 = motor; val2 = new PhysForceInfo { force = new Vector3(0f, -25f, 0f) * motor.mass }; ((PhysForceInfo)(ref val2)).ignoreGroundStick = true; ((PhysForceInfo)(ref val2)).disableAirControlUntilCollision = false; obj2.ApplyForceImpulse(ref val2); InflictDamage(); } } } public void RenewFloat() { healthComponent.TakeDamage(deferredDamageInfo); holdStopwatch = Item.instance.pullTime; ((Component)healthComponent).GetComponent().SetStun(Item.instance.pullTime); } public void InflictFloat() { //IL_003e: 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_005c: 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) SetStateOnHurt val = default(SetStateOnHurt); if (!((Component)healthComponent).TryGetComponent(ref val) || !((Component)healthComponent).TryGetComponent(ref motor) || !val.canBeStunned) { InflictDamage(); } else { targetHoldPos = ((Component)healthComponent).transform.position + new Vector3(0f, Item.instance.pullHeight, 0f); wobbleSeed = Time.fixedTime % 1f; holdStopwatch = Item.instance.pullTime; val.SetStun(Item.instance.pullTime); } started = true; } public void InflictDamage() { healthComponent.TakeDamage(deferredDamageInfo); Object.Destroy((Object)(object)this); } } [RegisterAchievement("TkSat_KleinBottle", "TkSat_KleinBottleUnlockable", "", 2u, null)] public class TkSatKleinBottleAchievement : BaseAchievement { private int consecutiveBlocks; private float lastHit; public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { float combinedHealth = self.combinedHealth; orig.Invoke(self, damageInfo); if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.body) || (Object)(object)self.body != (Object)(object)((BaseAchievement)this).localUser.cachedBody) { return; } float combinedHealth2 = self.combinedHealth; if (!(Time.fixedTime - lastHit < 0.1f)) { lastHit = Time.fixedTime; if (damageInfo.rejected || combinedHealth - combinedHealth2 <= 1f) { consecutiveBlocks++; } else { consecutiveBlocks = 0; } if (consecutiveBlocks >= 3) { ((BaseAchievement)this).Grant(); } } } } public class PixieTube : Item { private GameObject[] prefabs; private BuffDef moveBuff; private BuffDef attackBuff; private BuffDef damageBuff; private BuffDef armorBuff; private SkillDef[] blacklistedSkills; private const float PICKUP_ARMING_DELAY = 1.5f; public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[2] { (ItemTag)1, (ItemTag)3 }); [AutoConfigRoOSlider("{0:N0} s", 0f, 60f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Duration of all Pixie Tube buffs.", AutoConfigFlags.DeferForever, new object[] { 0f, float.MaxValue })] public float buffDuration { get; private set; } = 10f; [AutoConfigRoOSlider("{0:P1}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Fractional move speed bonus from the Water buff.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffMoveAmt { get; private set; } = 0.05f; [AutoConfigRoOSlider("{0:P1}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Fractional attack speed bonus from the Air buff.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffAttackAmt { get; private set; } = 0.05f; [AutoConfigRoOSlider("{0:P1}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Fractional damage bonus from the Fire buff.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffDamageAmt { get; private set; } = 0.03f; [AutoConfigRoOSlider("{0:N0}", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Flat armor bonus from the Earth buff.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffArmorAmt { get; private set; } = 10f; [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Internal cooldown on each non-primary skill, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float perSkillCooldown { get; private set; } = 3f; [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Internal cooldown on primary skill, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float primaryCooldown { get; private set; } = 6f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, stacking spawns stronger wisps instead of more.", AutoConfigFlags.None, new object[] { })] public bool performanceMerge { get; private set; } = true; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[7] { perSkillCooldown.ToString("N0"), primaryCooldown.ToString("N0"), buffDuration.ToString("N0"), buffDamageAmt.ToString("0%"), buffMoveAmt.ToString("0%"), buffAttackAmt.ToString("0%"), buffArmorAmt.ToString("N0") }; } public PixieTube() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/PixieTube.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/pixieTubeIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/PixieTube.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MainWeapon", localPos = new Vector3(-0.06131f, 0.23459f, -0.10051f), localAngles = new Vector3(64.21507f, 224.2983f, 93.09216f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzleGun", localPos = new Vector3(0.00103f, -0.07124f, -0.31367f), localAngles = new Vector3(16.75661f, 12.69404f, 225.5789f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "GunL", localPos = new Vector3(0.18255f, 0.13195f, -0.09012f), localAngles = new Vector3(348.5039f, 239.2215f, 139.2646f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmR", localPos = new Vector3(1.40126f, 4.0343f, -1.41909f), localAngles = new Vector3(293.1907f, 91.10483f, 276.6844f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonHeadL", localPos = new Vector3(0.21842f, 0.23697f, 0.22945f), localAngles = new Vector3(298.1622f, 14.17452f, 257.4075f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "BowHinge1L", localPos = new Vector3(-0.1164f, 0.28435f, 0.00236f), localAngles = new Vector3(20.09913f, 328.6948f, 121.9962f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechUpperArmL", localPos = new Vector3(0.19321f, 0.07457f, 0.00612f), localAngles = new Vector3(24.69925f, 22.04997f, 326.4116f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(-0.17263f, -0.06813f, -0.06435f), localAngles = new Vector3(291.7245f, 249.2733f, 226.4265f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "UpperArmL", localPos = new Vector3(0.22202f, -0.0177f, 0.0294f), localAngles = new Vector3(359.0609f, 138.6153f, 156.2666f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "UpperArmL", localPos = new Vector3(0.03897f, 1.91933f, -1.69502f), localAngles = new Vector3(300.506f, 179.1773f, 221.359f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "WeaponPlatform", localPos = new Vector3(0.09565f, -0.95396f, 0.22819f), localAngles = new Vector3(299.7137f, 50.52557f, 274.8567f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.071f, 0.49013f, -0.01937f), localAngles = new Vector3(343.5707f, 7.39626f, 43.74519f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonEnd", localPos = new Vector3(0.35103f, -0.3362f, 0.02411f), localAngles = new Vector3(32.0267f, 14.99465f, 307.135f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { //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_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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); blacklistedSkills = (SkillDef[])(object)new SkillDef[7] { LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiCancelTargetingDummy"), LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiConfirmTargetDummy"), LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiBodyPlaceTurret"), LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiBodyPlaceWalkerTurret"), LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiHarpoons"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CaptainCancelDummy"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/PrepSupplyDrop") }; Color[] array = (Color[])(object)new Color[4] { new Color(0.15f, 0.25f, 1f), new Color(1f, 1f, 0.4f), new Color(1f, 0.25f, 0.1f), new Color(0.5f, 0.35f, 0.2f) }; Sprite iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/MiscIcons/texBarrelIcon.png").WaitForCompletion(); Texture2D val = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/ColorRamps/texRampDefault.png").WaitForCompletion(); moveBuff = ScriptableObject.CreateInstance(); moveBuff.buffColor = array[0]; moveBuff.canStack = true; moveBuff.isDebuff = false; ((Object)moveBuff).name = base.modInfo.shortIdentifier + "PixieMoveSpeed"; moveBuff.iconSprite = iconSprite; ContentAddition.AddBuffDef(moveBuff); attackBuff = ScriptableObject.CreateInstance(); attackBuff.buffColor = array[1]; attackBuff.canStack = true; attackBuff.isDebuff = false; ((Object)attackBuff).name = base.modInfo.shortIdentifier + "PixieAttackSpeed"; attackBuff.iconSprite = iconSprite; ContentAddition.AddBuffDef(attackBuff); damageBuff = ScriptableObject.CreateInstance(); damageBuff.buffColor = array[2]; damageBuff.canStack = true; damageBuff.isDebuff = false; ((Object)damageBuff).name = base.modInfo.shortIdentifier + "PixieDamage"; damageBuff.iconSprite = iconSprite; ContentAddition.AddBuffDef(damageBuff); armorBuff = ScriptableObject.CreateInstance(); armorBuff.buffColor = array[3]; armorBuff.canStack = true; armorBuff.isDebuff = false; ((Object)armorBuff).name = base.modInfo.shortIdentifier + "PixieArmor"; armorBuff.iconSprite = iconSprite; ContentAddition.AddBuffDef(armorBuff); GameObject val2 = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/HealPack"); prefabs = (GameObject[])(object)new GameObject[4] { PrefabAPI.InstantiateClone(val2, "TkSatTempSetupPrefab1", false), PrefabAPI.InstantiateClone(val2, "TkSatTempSetupPrefab2", false), PrefabAPI.InstantiateClone(val2, "TkSatTempSetupPrefab3", false), PrefabAPI.InstantiateClone(val2, "TkSatTempSetupPrefab4", false) }; BuffDef[] array2 = (BuffDef[])(object)new BuffDef[4] { moveBuff, attackBuff, damageBuff, armorBuff }; string[] array3 = new string[4] { "TkSatPixieMovePack", "TkSatPixieAttackPack", "TkSatPixieDamagePack", "TkSatPixieArmorPack" }; for (int i = 0; i < prefabs.Length; i++) { GameObject val3 = prefabs[i]; ((Behaviour)val3.GetComponent()).enabled = false; DestroyOnTimer component = val3.GetComponent(); component.duration += 1.5f; val3.GetComponent().delayBeforeBeginningBlinking = component.duration - 1f; TrailRenderer component2 = ((Component)val3.transform.Find("HealthOrbEffect/TrailParent/Trail")).gameObject.GetComponent(); ((Renderer)component2).material.SetTexture("_RemapTex", (Texture)(object)val); ((Renderer)component2).material.SetColor("_TintColor", array[i]); GameObject gameObject = ((Component)val3.transform.Find("HealthOrbEffect/VFX/Core")).gameObject; ColorOverLifetimeModule colorOverLifetime = gameObject.GetComponent().colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(array[i], ((Color)(ref array[i])).AlphaMultiplied(0f)); Transform transform = gameObject.transform; transform.localScale *= 0.5f; GameObject gameObject2 = ((Component)val3.transform.Find("HealthOrbEffect/VFX/PulseGlow")).gameObject; ColorOverLifetimeModule colorOverLifetime2 = gameObject2.GetComponent().colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime2)).color = new MinMaxGradient(array[i], ((Color)(ref array[i])).AlphaMultiplied(0f)); Transform transform2 = gameObject2.transform; transform2.localScale *= 0.5f; GameObject gameObject3 = ((Component)val3.transform.Find("PickupTrigger")).gameObject; ((Behaviour)gameObject3.GetComponent()).enabled = false; EffectlessBuffPickup effectlessBuffPickup = gameObject3.AddComponent(); effectlessBuffPickup.buffDef = array2[i]; effectlessBuffPickup.teamFilter = val3.GetComponent(); effectlessBuffPickup.buffDuration = buffDuration; effectlessBuffPickup.baseObject = prefabs[i]; GameObject gameObject4 = ((Component)val3.transform.Find("GravitationController")).gameObject; ActivateAfterDelay activateAfterDelay = val3.AddComponent(); gameObject3.SetActive(false); gameObject.SetActive(false); activateAfterDelay.targets.Add(gameObject3); activateAfterDelay.targets.Add(gameObject); activateAfterDelay.delay = 1.5f; ((Behaviour)gameObject4.GetComponent()).enabled = false; WispAnimAndGravitate wispAnimAndGravitate = gameObject4.AddComponent(); wispAnimAndGravitate.armingDelay = 1.5f; wispAnimAndGravitate.duration = component.duration - 1.5f; wispAnimAndGravitate.parentRigidbody = val3.GetComponent(); wispAnimAndGravitate.teamFilter = val3.GetComponent(); wispAnimAndGravitate.playerOnlyDuration = wispAnimAndGravitate.duration - 2f; prefabs[i] = PrefabAPI.InstantiateClone(prefabs[i], array3[i], true); } } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown base.Install(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); Fire.FireMissile += new hook_FireMissile(Fire_FireMissile); PlaceTurret.FixedUpdate += new hook_FixedUpdate(PlaceTurret_FixedUpdate); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(EquipmentSlot_PerformEquipmentAction); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown base.Uninstall(); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); Fire.FireMissile -= new hook_FireMissile(Fire_FireMissile); PlaceTurret.FixedUpdate -= new hook_FixedUpdate(PlaceTurret_FixedUpdate); EquipmentSlot.PerformEquipmentAction -= new hook_PerformEquipmentAction(EquipmentSlot_PerformEquipmentAction); } private void SpawnWisp(Vector3 pos, TeamIndex team, int stacks = 1) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_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_0043: 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_0057: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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) if (!NetworkServer.active) { TinkersSatchelPlugin._logger.LogWarning((object)"Server-only function TinkersSatchel.PixieTube.SpawnWisp called on client"); return; } Quaternion val = Quaternion.AngleAxis(Random.value * 360f, Vector3.up); Vector3 val2 = new Vector3(1f, 1f, 0f); Vector3 velocity = val * (((Vector3)(ref val2)).normalized * 15f); GameObject obj = Object.Instantiate(base.rng.NextElementUniform(prefabs), pos, Random.rotation); obj.GetComponent().teamIndex = team; obj.GetComponent().velocity = velocity; ((Component)obj.transform.Find("PickupTrigger")).gameObject.GetComponent().stacks = stacks; NetworkServer.Spawn(obj); } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_0076: 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_00a8: 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_00b3: Expected O, but got I4 //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got I4 //IL_00ad->IL00ad: Incompatible stack types: O vs I4 //IL_00a2->IL00ad: Incompatible stack types: I4 vs O //IL_00a2->IL00ad: Incompatible stack types: O vs I4 //IL_00da->IL00da: Incompatible stack types: O vs I4 //IL_00cf->IL00da: Incompatible stack types: I4 vs O //IL_00cf->IL00da: Incompatible stack types: O vs I4 orig.Invoke(self, skill); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.skillLocator) || blacklistedSkills.Contains(skill.skillDef)) { return; } int countEffective = GetCountEffective(self); if (countEffective <= 0) { return; } PixieTubeStopwatch pixieTubeStopwatch = ((Component)self).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)pixieTubeStopwatch)) { pixieTubeStopwatch = ((Component)self).gameObject.AddComponent(); } if (!pixieTubeStopwatch.CheckProc(self.skillLocator.FindSkillSlot(skill))) { return; } if (performanceMerge) { object obj = this; Vector3 corePosition = self.corePosition; int num; if (Object.op_Implicit((Object)(object)self.teamComponent)) { obj = self.teamComponent.teamIndex; num = (int)obj; } else { num = -1; obj = num; num = (int)obj; } ((PixieTube)num).SpawnWisp(corePosition, (TeamIndex)obj, countEffective); return; } for (int i = 0; i < countEffective; i++) { object obj2 = this; Vector3 corePosition2 = self.corePosition; int num2; if (!Object.op_Implicit((Object)(object)self.teamComponent)) { num2 = -1; obj2 = num2; num2 = (int)obj2; } else { obj2 = self.teamComponent.teamIndex; num2 = (int)obj2; } ((PixieTube)num2).SpawnWisp(corePosition2, (TeamIndex)obj2); } } private bool EquipmentSlot_PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { //IL_007e: 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_00ae: Expected O, but got I4 //IL_00a8->IL00a8: Incompatible stack types: O vs I4 //IL_0098->IL00a8: Incompatible stack types: I4 vs O //IL_0098->IL00a8: Incompatible stack types: O vs I4 bool result = orig.Invoke(self, equipmentDef); if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.characterBody)) { int countEffective = GetCountEffective(self.characterBody); if (countEffective <= 0) { return result; } PixieTubeStopwatch pixieTubeStopwatch = ((Component)self.characterBody).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)pixieTubeStopwatch)) { pixieTubeStopwatch = ((Component)self.characterBody).gameObject.AddComponent(); } if (pixieTubeStopwatch.CheckProcEquipment()) { for (int i = 0; i < countEffective; i++) { object obj = this; Vector3 corePosition = self.characterBody.corePosition; int num; if (!Object.op_Implicit((Object)(object)self.characterBody.teamComponent)) { num = -1; obj = num; num = (int)obj; } else { obj = self.characterBody.teamComponent.teamIndex; num = (int)obj; } ((PixieTube)num).SpawnWisp(corePosition, (TeamIndex)obj); } } } return result; } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { args.armorAdd += (float)sender.GetBuffCount(armorBuff) * buffArmorAmt; args.attackSpeedMultAdd += (float)sender.GetBuffCount(attackBuff) * buffAttackAmt; args.damageMultAdd += (float)sender.GetBuffCount(damageBuff) * buffDamageAmt; args.moveSpeedMultAdd += (float)sender.GetBuffCount(moveBuff) * buffMoveAmt; } } private void Fire_FireMissile(orig_FireMissile orig, Fire self, HurtBox target, Vector3 position) { //IL_0003: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got I4 //IL_007b->IL007b: Incompatible stack types: O vs I4 //IL_0070->IL007b: Incompatible stack types: I4 vs O //IL_0070->IL007b: Incompatible stack types: O vs I4 orig.Invoke(self, target, position); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective <= 0) { return; } PixieTubeStopwatch pixieTubeStopwatch = ((Component)((EntityState)self).characterBody).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)pixieTubeStopwatch)) { pixieTubeStopwatch = ((Component)((EntityState)self).characterBody).gameObject.AddComponent(); } if (!pixieTubeStopwatch.CheckProc((SkillSlot)2)) { return; } for (int i = 0; i < countEffective; i++) { object obj = this; Vector3 corePosition = ((EntityState)self).characterBody.corePosition; int num; if (!Object.op_Implicit((Object)(object)((EntityState)self).teamComponent)) { num = -1; obj = num; num = (int)obj; } else { obj = ((EntityState)self).teamComponent.teamIndex; num = (int)obj; } ((PixieTube)num).SpawnWisp(corePosition, (TeamIndex)obj); } } private void PlaceTurret_FixedUpdate(orig_FixedUpdate orig, PlaceTurret self) { //IL_00a7: 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_00cd: Expected O, but got I4 //IL_00c7->IL00c7: Incompatible stack types: O vs I4 //IL_00bc->IL00c7: Incompatible stack types: I4 vs O //IL_00bc->IL00c7: Incompatible stack types: O vs I4 orig.Invoke(self); if ((!((EntityState)self).inputBank.skill1.down && !((ButtonState)(ref ((EntityState)self).inputBank.skill4)).justPressed) || !self.currentPlacementInfo.ok || self.exitCountdown != 0.25f || !self.exitPending) { return; } int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective <= 0) { return; } PixieTubeStopwatch pixieTubeStopwatch = ((Component)((EntityState)self).characterBody).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)pixieTubeStopwatch)) { pixieTubeStopwatch = ((Component)((EntityState)self).characterBody).gameObject.AddComponent(); } if (!pixieTubeStopwatch.CheckProc((SkillSlot)3)) { return; } for (int i = 0; i < countEffective; i++) { object obj = this; Vector3 corePosition = ((EntityState)self).characterBody.corePosition; int num; if (!Object.op_Implicit((Object)(object)((EntityState)self).teamComponent)) { num = -1; obj = num; num = (int)obj; } else { obj = ((EntityState)self).teamComponent.teamIndex; num = (int)obj; } ((PixieTube)num).SpawnWisp(corePosition, (TeamIndex)obj); } } } public class ActivateAfterDelay : MonoBehaviour { public float delay; public List targets = new List(); private float stopwatch; private void FixedUpdate() { if (!((Behaviour)this).isActiveAndEnabled || !(stopwatch < delay)) { return; } stopwatch += Time.fixedDeltaTime; if (!(stopwatch >= delay)) { return; } foreach (GameObject target in targets) { target.SetActive(true); } } public void Reset() { foreach (GameObject target in targets) { target.SetActive(false); } stopwatch = 0f; } } public class PixieTubeStopwatch : MonoBehaviour { private readonly float[] stopwatches = new float[5]; public bool CheckProc(SkillSlot slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0010: 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_0020: Unknown result type (might be due to invalid IL or missing references) if ((int)slot == -1 || (int)slot > 3) { return false; } if (stopwatches[slot] <= 0f) { stopwatches[slot] = (((int)slot == 0) ? Item.instance.primaryCooldown : Item.instance.perSkillCooldown); return true; } return false; } public bool CheckProcEquipment() { if (stopwatches[4] <= 0f) { stopwatches[4] = Item.instance.perSkillCooldown; return true; } return false; } private void FixedUpdate() { for (int i = 0; i < stopwatches.Length; i++) { if (stopwatches[i] > 0f) { stopwatches[i] -= Time.fixedDeltaTime; } } } } [RequireComponent(typeof(SphereCollider))] public class WispAnimAndGravitate : MonoBehaviour { public float rangeStart = 6f; public float rangeEnd = 36f; public float duration = 10f; public float playerOnlyDuration = 8f; public float dragDelay = 0.5f; public float dragStrength = 0.01f; public float maxSpeed = 60f; public float acceleration = 5f; public float armingDelay; public float zipDelayMin = 0.2f; public float zipDelayMax = 1f; public float zipStrengthMin = 5f; public float zipStrengthMax = 15f; public TeamFilter teamFilter; public Rigidbody parentRigidbody; private float stopwatch; private float zipStopwatch; private Transform target; private SphereCollider coll; private bool GetCanPerformTargetingOps() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 if (NetworkServer.active && !Object.op_Implicit((Object)(object)target) && stopwatch > armingDelay && Object.op_Implicit((Object)(object)teamFilter)) { return (int)teamFilter.teamIndex != -1; } return false; } private void Awake() { coll = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_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_009b: 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_00a9: 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_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_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) if (stopwatch < duration) { stopwatch += Time.fixedDeltaTime; } ((Collider)coll).enabled = stopwatch > armingDelay; coll.radius = Mathf.Lerp(rangeStart, rangeEnd, stopwatch / duration); if (Object.op_Implicit((Object)(object)target)) { Rigidbody obj = parentRigidbody; Vector3 velocity = parentRigidbody.velocity; Vector3 val = target.position - ((Component)this).transform.position; obj.velocity = Vector3.MoveTowards(velocity, ((Vector3)(ref val)).normalized * maxSpeed, acceleration); } else { Rigidbody obj2 = parentRigidbody; obj2.velocity *= 1f - Mathf.Clamp01(stopwatch / dragDelay) * dragStrength; if (stopwatch > armingDelay) { zipStopwatch -= Time.fixedDeltaTime; if (zipStopwatch <= 0f) { zipStopwatch = Random.Range(zipDelayMin, zipDelayMax); Rigidbody obj3 = parentRigidbody; obj3.velocity += Random.onUnitSphere * Random.Range(zipStrengthMin, zipStrengthMax); } } } Rigidbody obj4 = parentRigidbody; obj4.velocity -= Physics.gravity * Time.fixedDeltaTime; } private void OnTriggerStay(Collider other) { //IL_000e: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_003e: Invalid comparison between Unknown and I4 if (!GetCanPerformTargetingOps()) { return; } TeamIndex objectTeam = TeamComponent.GetObjectTeam(((Component)other).gameObject); if (objectTeam == teamFilter.teamIndex) { CharacterBody component = ((Component)other).gameObject.GetComponent(); if (stopwatch > playerOnlyDuration || (int)objectTeam != 1 || (Object.op_Implicit((Object)(object)component) && component.isPlayerControlled)) { target = ((Component)other).gameObject.transform; } } } } public class PixieFuseFlicker : MonoBehaviour { [SerializeField] public GameObject[] targets; public float switchIntervalMin; public float switchIntervalMax; public float flickerInterval; public int flickersMin; public int flickersMax; private float stopwatch; private int flickerCount; private int currIndex; private void Update() { stopwatch -= Time.deltaTime; if (!(stopwatch < 0f)) { return; } if (flickerCount <= 0) { currIndex = Random.Range(0, targets.Length); flickerCount = Random.Range(flickersMin, flickersMax + 1) * 2; for (int i = 0; i < targets.Length; i++) { targets[i].SetActive(currIndex == i); } } stopwatch = ((flickerCount > 1) ? Random.Range(0.02f, 0.1f) : Random.Range(switchIntervalMin, switchIntervalMax)); flickerCount--; targets[currIndex].SetActive(!targets[currIndex].activeSelf); } } public class EffectlessBuffPickup : MonoBehaviour { public GameObject baseObject; public TeamFilter teamFilter; public BuffDef buffDef; public float buffDuration; public int stacks = 1; private void OnTriggerStay(Collider other) { //IL_000e: 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_003b: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || TeamComponent.GetObjectTeam(((Component)other).gameObject) != teamFilter.teamIndex) { return; } CharacterBody component = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { for (int i = 0; i < stacks; i++) { component.AddTimedBuff(buffDef.buffIndex, buffDuration); } Object.Destroy((Object)(object)baseObject); } } } public class Swordbreaker : Item { public override ItemTier itemTier => (ItemTier)1; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[2] { (ItemTag)2, (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Base damage of this item's projectiles.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float rawDamage { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:N0}", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Amount of flat shield given by this item per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float shieldAmt { get; private set; } = 50f; [AutoConfigRoOIntSlider("{0:N0}", 1, 10, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Number of projectiles fired by this item.", AutoConfigFlags.None, new object[] { 1, int.MaxValue })] public int sparkCount { get; private set; } = 3; [AutoConfigRoOSlider("{0:N2}°", 0f, 180f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Maximum degrees of spread to add to projectiles.", AutoConfigFlags.None, new object[] { 0f, 180f })] public float spreadConeHalfAngleDegr { get; private set; } = 5f; [AutoConfigRoOSlider("{0:N0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Internal cooldown for firing projectiles.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float icd { get; private set; } = 0.5f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public GameObject projectilePrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { shieldAmt.ToString("N0"), sparkCount.ToString("N0"), spreadConeHalfAngleDegr.ToString("N1"), rawDamage.ToString("P0"), icd.ToString("N1") }; } public Swordbreaker() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Swordbreaker.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/swordbreakerIcon.png"); } public override void SetupAttributes() { //IL_0020: 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) base.SetupAttributes(); projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/SwordbreakerProjectile.prefab"); GameObject explosionEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/EliteLightning/LightningStakeNova.prefab").WaitForCompletion(); ((ProjectileExplosion)projectilePrefab.GetComponent()).explosionEffect = explosionEffect; ContentAddition.AddProjectile(projectilePrefab); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(Swordbreaker_GetStatCoefficients); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(Swordbreaker_GetStatCoefficients); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void Swordbreaker_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { args.baseShieldAdd += (float)GetCountEffective(sender) * shieldAmt; } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0103: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_014c: 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_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: 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_01f6: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: 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_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self)) { orig.Invoke(self, damageInfo); return; } float shield = self.shield; orig.Invoke(self, damageInfo); if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.body) || !self.alive || !Object.op_Implicit((Object)(object)damageInfo.attacker) || !Object.op_Implicit((Object)(object)damageInfo.attacker.transform) || ((Object)(object)damageInfo.attacker == (Object)(object)((Component)self).gameObject && disableSelfDamage) || ((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)15)) { return; } int countEffective = GetCountEffective(self.body); if (countEffective == 0 || self.shield - shield >= 0f) { return; } SwordbreakerICD swordbreakerICD = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)swordbreakerICD)) { swordbreakerICD = ((Component)self).gameObject.AddComponent(); } if (!(swordbreakerICD.stopwatch > 0f)) { swordbreakerICD.stopwatch = icd; int num = sparkCount; float damage = self.body.damage * rawDamage * (float)countEffective; Vector3 val = damageInfo.position; Bounds bounds; if (Object.op_Implicit((Object)(object)self.body.mainHurtBox) && Object.op_Implicit((Object)(object)self.body.mainHurtBox.collider)) { bounds = self.body.mainHurtBox.collider.bounds; val = ((Bounds)(ref bounds)).center; } CharacterBody component = damageInfo.attacker.GetComponent(); Vector3 val2 = damageInfo.attacker.transform.position; if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.mainHurtBox) && Object.op_Implicit((Object)(object)component.mainHurtBox.collider)) { bounds = component.mainHurtBox.collider.bounds; val2 = ((Bounds)(ref bounds)).center; } Vector3 val3 = val2 - val; Vector3 normalized = ((Vector3)(ref val3)).normalized; if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.rigidbody)) { val2 += component.rigidbody.velocity * 0.5f; } Quaternion targetRotation = Quaternion.LookRotation(normalized); for (int i = 0; i < num; i++) { ProcChainMask procChainMask = default(ProcChainMask); ((ProcChainMask)(ref procChainMask)).AddProc((ProcType)15); float num2 = 0.3f + (base.rng.nextNormalizedFloat * 2f - 1f) * 0.1f; FireProjectileInfo val4 = default(FireProjectileInfo); val4.crit = self.body.RollCrit(); val4.damage = damage; val4.damageColorIndex = (DamageColorIndex)3; val4.force = 0f; val4.owner = ((Component)self).gameObject; val4.position = val + normalized * (self.body.radius + 1.5f); val4.procChainMask = procChainMask; val4.projectilePrefab = projectilePrefab; val4.rotation = base.rng.ApplyRandomSpread(targetRotation, spreadConeHalfAngleDegr); val4.useFuseOverride = true; ((FireProjectileInfo)(ref val4)).fuseOverride = num2; val4.useSpeedOverride = true; val3 = val2 - val; ((FireProjectileInfo)(ref val4)).speedOverride = ((Vector3)(ref val3)).magnitude * 2f / num2 * (1f + (base.rng.nextNormalizedFloat * 2f - 1f) * Mathf.Sin(spreadConeHalfAngleDegr * MathF.PI / 180f)); FireProjectileInfo val5 = val4; ProjectileManager.instance.FireProjectile(val5); } } } } public class SwordbreakerICD : MonoBehaviour { public float stopwatch; private void FixedUpdate() { if (stopwatch > 0f) { stopwatch -= Time.fixedDeltaTime; } } } public class GoFaster : Item { private BuffDef engiSpeedBoostBuff; private BuffDef genericSpeedBoostBuff; private GameObject captainStrikeJumperAltProjectile; private UnlockableDef unlockable; private Sprite skillIconOverlay; public List handledSkillDefs = new List(); public override ItemTier itemTier => (ItemTier)2; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)3 }); [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Controls general power of this item (multiplies all other Frac configs). newSpeed ~ baseSpeed * (1 + buffFrac * specificFrac * stack count).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffFrac { get; private set; } = 1f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Commando dodge: multiplies movement speed during dodge.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float commandoDodgeFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Commando slide: multiplies movement speed during slide.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float commandoSlideFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for both Huntress blink variants: divides time spent in blink animation.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float huntressBlinkTimeFac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Huntress blink: multiplies distance travelled.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float huntressBlinkRangeFac { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Huntress mini-blink: multiplies distance travelled.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float huntressBlink2RangeFac { get; private set; } = 0.35f; [AutoConfigRoOSlider("{0:N0} N s", 0f, 300f, null, null)] [AutoConfig("Multiplier to BuffFrac for Bandit smokebomb: controls launch force.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float banditCloakSpeedFrac { get; private set; } = 40f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for MUL-T dash: multiplies move speed during reactivation boosts.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float toolbotReacBoostFrac { get; private set; } = 0.5f; [AutoConfigRoOIntSlider("{0:N0}", 0, 30, null, null)] [AutoConfig("MUL-T dash: directly specify number of reactivations per cast. Stacks.", AutoConfigFlags.None, new object[] { 0, int.MaxValue })] public int toolbotReacBoostCount { get; private set; } = 3; [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfig("MUL-T dash: directly specify duration of each boost. Does not stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float toolbotReacTime { get; private set; } = 1f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Engineer shield: shield provides a stacking, 5-second speed buff at a rate increased by item stacks.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float engiSharedBuffFrac { get; private set; } = 0.35f; [AutoConfigRoOSlider("{0:N0} N s", 0f, 300f, null, null)] [AutoConfig("Multiplier to BuffFrac for Engineer missiles: controls launch force per consumed missile.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float engiBoostFrac { get; private set; } = 50f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Mercenary Blinding Assault: multiplies movement speed during dash.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float mercDashFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Mercenary Focused Assault: multiplies movement speed during dash.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float mercDash2Frac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for REX DIRECTIVE: Disperse: multiplies launch force.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float treebotSonicBoomFrac { get; private set; } = 1f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for REX Bramble Volley: multiplies launch force.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float treebotSonicBoom2Frac { get; private set; } = 1f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Loader Charged Gauntlet: multiplies lunge velocity.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float loaderChargeFistFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Loader Thunder Gauntlet: multiplies lunge velocity.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float loaderChargeFist2Frac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Acrid Caustic Leap: multiplies jump velocity.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float crocoLeapFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for Acrid Frenzied Leap: multiplies jump velocity.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float crocoLeap2Frac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:N0} N s", 0f, 30000f, null, null)] [AutoConfig("Multiplier to BuffFrac for Captain Airstrike: controls launch force of projectile (NOT adjusted for mass!).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float captainAirstrikeFrac { get; private set; } = 6000f; [AutoConfigRoOSlider("{0:N0} N s", 0f, 300f, null, null)] [AutoConfig("Multiplier to BuffFrac for Captain Nuke: controls launch velocity of projectile at 1 stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float captainAirstrikeAltFracBase { get; private set; } = 80f; [AutoConfigRoOSlider("{0:N0} N s", 0f, 300f, null, null)] [AutoConfig("Multiplier to BuffFrac for Captain Nuke: controls launch velocity of projectile per additional stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float captainAirstrikeAltFracStack { get; private set; } = 20f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to BuffFrac for all unhandled characters: controls magnitude of speed buff.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float unhandledFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfig("Static value for all unhandled characters: duration of speed buff, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float unhandledDuration { get; private set; } = 5f; public GoFaster() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/GoFaster.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/goFasterIcon.png"); } public override void SetupAttributes() { //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) //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) //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_00e0: 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_0103: 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) base.SetupAttributes(); genericSpeedBoostBuff = ScriptableObject.CreateInstance(); genericSpeedBoostBuff.buffColor = Color.red; genericSpeedBoostBuff.canStack = true; genericSpeedBoostBuff.isDebuff = false; ((Object)genericSpeedBoostBuff).name = base.modInfo.shortIdentifier + "GoFasterUnhandled"; genericSpeedBoostBuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texMovespeedBuffIcon.tif").WaitForCompletion(); ContentAddition.AddBuffDef(genericSpeedBoostBuff); engiSpeedBoostBuff = ScriptableObject.CreateInstance(); engiSpeedBoostBuff.buffColor = Color.red; engiSpeedBoostBuff.canStack = true; engiSpeedBoostBuff.isDebuff = false; ((Object)engiSpeedBoostBuff).name = base.modInfo.shortIdentifier + "GoFasterEngi"; engiSpeedBoostBuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texMovespeedBuffIcon.tif").WaitForCompletion(); ContentAddition.AddBuffDef(engiSpeedBoostBuff); GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Captain/CaptainAirstrikeAltProjectile.prefab").WaitForCompletion(), "TkSatTempSetupPrefab", false); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/CommandoBody/CommandoBodyRoll")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/CommandoBody/CommandoSlide")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/HuntressBody/HuntressBlink")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/HuntressBody/HuntressMiniBlink")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/Bandit2Body/ThrowSmokeBomb")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/ToolbotBody/ToolbotBodyToolbotDash")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiBodyPlaceBubbleShield")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiHarpoons")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/MageBody/MageBodyWall")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/MercBody/MercBodyFocusedAssault")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/MercBody/MercBodyAssaulter")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/TreebotBody/TreebotBodySonicBoom")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/TreebotBody/TreebotBodyPlantSonicBoom")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/LoaderBody/ChargeFist")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/LoaderBody/ChargeZapFist")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/CrocoBody/CrocoLeap")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/CrocoBody/CrocoChainableLeap")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/CaptainBody/PrepAirstrike")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/CaptainBody/PrepAirstrikeAlt")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CallAirstrike")); handledSkillDefs.Add(LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CallAirstrikeAlt")); skillIconOverlay = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/SkillIcons/GoFasterStripesOverlay.png"); val.AddComponent(); captainStrikeJumperAltProjectile = PrefabAPI.InstantiateClone(val, "TkSatCaptainStrikeJumperAltProjectile", true); Object.Destroy((Object)(object)val); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/goFasterIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown base.Install(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); DodgeState.RecalculateRollSpeed += new hook_RecalculateRollSpeed(DodgeState_RecalculateRollSpeed); SlideState.FixedUpdate += new hook_FixedUpdate(SlideState_FixedUpdate); BlinkState.OnEnter += new hook_OnEnter(BlinkState_OnEnter); StealthMode.OnEnter += new hook_OnEnter(StealthMode_OnEnter); ToolbotDash.OnEnter += new hook_OnEnter(ToolbotDash_OnEnter); ToolbotDash.FixedUpdate += new hook_FixedUpdate(ToolbotDash_FixedUpdate); ToolbotDash.GetIdealVelocity += new hook_GetIdealVelocity(ToolbotDash_GetIdealVelocity); Fire.OnEnter += new hook_OnEnter(Fire_OnEnter); Deployed.OnEnter += new hook_OnEnter(Deployed_OnEnter); PrepWall.OnExit += new hook_OnExit(PrepWall_OnExit); Assaulter2.OnEnter += new hook_OnEnter(Assaulter2_OnEnter); FocusedAssaultDash.OnEnter += new hook_OnEnter(FocusedAssaultDash_OnEnter); FireSonicBoom.OnEnter += new hook_OnEnter(FireSonicBoom_OnEnter); BaseSwingChargedFist.OnEnter += new hook_OnEnter(BaseSwingChargedFist_OnEnter); BaseLeap.OnEnter += new hook_OnEnter(BaseLeap_OnEnter); ProjectileExplosion.DetonateServer += new hook_DetonateServer(ProjectileExplosion_DetonateServer); CallAirstrikeAlt.ModifyProjectile += new hook_ModifyProjectile(CallAirstrikeAlt_ModifyProjectile); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); SkillIcon.Update += new hook_Update(SkillIcon_Update); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown base.Uninstall(); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); DodgeState.RecalculateRollSpeed -= new hook_RecalculateRollSpeed(DodgeState_RecalculateRollSpeed); SlideState.FixedUpdate -= new hook_FixedUpdate(SlideState_FixedUpdate); BlinkState.OnEnter -= new hook_OnEnter(BlinkState_OnEnter); StealthMode.OnEnter -= new hook_OnEnter(StealthMode_OnEnter); ToolbotDash.OnEnter -= new hook_OnEnter(ToolbotDash_OnEnter); ToolbotDash.FixedUpdate -= new hook_FixedUpdate(ToolbotDash_FixedUpdate); ToolbotDash.GetIdealVelocity -= new hook_GetIdealVelocity(ToolbotDash_GetIdealVelocity); Fire.OnEnter -= new hook_OnEnter(Fire_OnEnter); Deployed.OnEnter -= new hook_OnEnter(Deployed_OnEnter); PrepWall.OnExit -= new hook_OnExit(PrepWall_OnExit); Assaulter2.OnEnter -= new hook_OnEnter(Assaulter2_OnEnter); FocusedAssaultDash.OnEnter -= new hook_OnEnter(FocusedAssaultDash_OnEnter); FireSonicBoom.OnEnter -= new hook_OnEnter(FireSonicBoom_OnEnter); BaseSwingChargedFist.OnEnter -= new hook_OnEnter(BaseSwingChargedFist_OnEnter); BaseLeap.OnEnter -= new hook_OnEnter(BaseLeap_OnEnter); ProjectileExplosion.DetonateServer -= new hook_DetonateServer(ProjectileExplosion_DetonateServer); CallAirstrikeAlt.ModifyProjectile -= new hook_ModifyProjectile(CallAirstrikeAlt_ModifyProjectile); CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); SkillIcon.Update -= new hook_Update(SkillIcon_Update); } private void SkillIcon_Update(orig_Update orig, SkillIcon self) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0066: 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_007b: 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_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_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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((int)self.targetSkillSlot == 2 && Object.op_Implicit((Object)(object)self.playerCharacterMasterController)) { Transform val = ((Component)self).transform.Find("GoFasterStripesPanel"); GameObject val2; if ((Object)(object)val == (Object)null) { val2 = new GameObject("GoFasterStripesPanel"); RectTransform obj = val2.AddComponent(); ((Transform)obj).SetParent(((Component)self).transform, false); ((Transform)obj).SetSiblingIndex(2); obj.anchorMin = Vector2.zero; obj.pivot = Vector2.one / 2f; obj.anchorMax = Vector2.one; ((Transform)obj).localPosition = new Vector3(-18f, 18f, 0f); ((Transform)obj).localScale = Vector3.one * 1.1f; obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; val2.layer = 5; val2.AddComponent(); Image obj2 = val2.AddComponent(); obj2.sprite = skillIconOverlay; ((MaskableGraphic)obj2).maskable = true; ((Graphic)obj2).raycastTarget = false; ((Graphic)obj2).color = Color.white; } else { val2 = ((Component)val).gameObject; } bool flag = GetCountEffective(self.playerCharacterMasterController.body) > 0; if (val2.activeSelf != flag) { val2.SetActive(flag); } } } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 orig.Invoke(self, skill); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.skillLocator) || (int)self.skillLocator.FindSkillSlot(skill) != 2 || handledSkillDefs.Contains(skill.skillDef)) { return; } int countEffective = GetCountEffective(self); if (countEffective > 0) { for (int i = 0; i < countEffective; i++) { self.AddTimedBuff(genericSpeedBoostBuff, unhandledDuration, countEffective); } } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { args.moveSpeedMultAdd += (float)sender.GetBuffCount(engiSpeedBoostBuff) * engiSharedBuffFrac * buffFrac; args.moveSpeedMultAdd += (float)sender.GetBuffCount(genericSpeedBoostBuff) * unhandledFrac * buffFrac; } } private void DodgeState_RecalculateRollSpeed(orig_RecalculateRollSpeed orig, DodgeState self) { orig.Invoke(self); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0) { self.rollSpeed *= 1f + buffFrac * commandoDodgeFrac * (float)countEffective; } } private void SlideState_FixedUpdate(orig_FixedUpdate orig, SlideState self) { int countEffective = GetCountEffective(((EntityState)self).characterBody); float moveSpeedStat = ((BaseState)self).moveSpeedStat; if (countEffective > 0) { ((BaseState)self).moveSpeedStat = ((BaseState)self).moveSpeedStat * (1f + buffFrac * commandoSlideFrac * (float)countEffective); } orig.Invoke(self); ((BaseState)self).moveSpeedStat = moveSpeedStat; } private void BlinkState_OnEnter(orig_OnEnter orig, BlinkState self) { orig.Invoke(self); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0) { self.duration /= 1f + buffFrac * huntressBlinkTimeFac * (float)countEffective; self.speedCoefficient *= (1f + buffFrac * ((self is MiniBlinkState) ? huntressBlink2RangeFac : huntressBlinkRangeFac) * (float)countEffective) * (1f + buffFrac * huntressBlinkTimeFac * (float)countEffective); } } private void StealthMode_OnEnter(orig_OnEnter orig, StealthMode self) { //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_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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00d4: 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) //IL_0110: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0 && ((EntityState)self).isAuthority && Object.op_Implicit((Object)(object)((EntityState)self).characterBody.characterMotor)) { float num = (float)countEffective * buffFrac * banditCloakSpeedFrac; float num2 = (Object.op_Implicit((Object)(object)((EntityState)self).characterBody.characterMotor) ? ((EntityState)self).characterBody.characterMotor.mass : 1f); Vector3 val = ((EntityState)self).characterBody.transform.forward; if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody.characterDirection)) { val = ((EntityState)self).characterBody.characterDirection.forward; } val.y += 0.75f; val = ((Vector3)(ref val)).normalized; Vector3 val2 = (Vector3)(Object.op_Implicit((Object)(object)((EntityState)self).characterBody.characterMotor) ? new Vector3(0f, 0f - ((EntityState)self).characterBody.characterMotor.velocity.y, 0f) : Vector3.zero); ((EntityState)self).characterBody.characterMotor.ApplyForce(num * num2 * val + val2 * num2, false, false); } } private void ToolbotDash_OnEnter(orig_OnEnter orig, ToolbotDash self) { orig.Invoke(self); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0) { ToolbotDashBoostTracker toolbotDashBoostTracker = ((EntityState)self).GetComponent(); if (!Object.op_Implicit((Object)(object)toolbotDashBoostTracker)) { toolbotDashBoostTracker = ((EntityState)self).gameObject.AddComponent(); } toolbotDashBoostTracker.maxBoosts = countEffective * toolbotReacBoostCount; toolbotDashBoostTracker.boostsUsed = 0; } } private void ToolbotDash_FixedUpdate(orig_FixedUpdate orig, ToolbotDash self) { orig.Invoke(self); if (GetCountEffective(((EntityState)self).characterBody) <= 0) { return; } ToolbotDashBoostTracker component = ((EntityState)self).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { bool flag = ((BaseCharacterMain)self).hasInputBank && ((EntityState)self).inputBank.skill3.down; if (!flag) { component.retrigProtection = false; } if (!component.boosting && flag && component.TryBoost()) { self.duration += toolbotReacTime; Util.PlaySound(ToolbotDash.endSoundString, ((EntityState)self).gameObject); } } } private Vector3 ToolbotDash_GetIdealVelocity(orig_GetIdealVelocity orig, ToolbotDash self) { //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_0041: 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_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) Vector3 val = orig.Invoke(self); ToolbotDashBoostTracker component = ((EntityState)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.boosting) { val *= 1f + buffFrac * toolbotReacBoostFrac * (float)component.maxBoosts; } return val; } private void Deployed_OnEnter(orig_OnEnter orig, Deployed self) { orig.Invoke(self); Deployable component = ((EntityState)self).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { int countEffective = GetCountEffective(component.ownerMaster); if (countEffective > 0) { BuffWard obj = ((EntityState)self).gameObject.AddComponent(); obj.radius = 10f; obj.buffDuration = 5f; obj.buffDef = engiSpeedBoostBuff; obj.interval = 5f / (float)countEffective; } } } private void Fire_OnEnter(orig_OnEnter orig, Fire self) { //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_00ac: 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_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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_0100: 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_0106: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_01a6: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0 && self.targetsList.Count == 0) { float num = (float)countEffective * buffFrac * engiBoostFrac; float num2 = (Object.op_Implicit((Object)(object)((EntityState)self).characterBody.characterMotor) ? ((EntityState)self).characterBody.characterMotor.mass : 1f); Vector3 val = ((EntityState)self).characterBody.transform.forward; if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody.characterDirection)) { val = ((EntityState)self).characterBody.characterDirection.forward; } val.y += 0.75f; val = ((Vector3)(ref val)).normalized; Vector3 val2 = (Vector3)(Object.op_Implicit((Object)(object)((EntityState)self).characterBody.characterMotor) ? new Vector3(0f, 0f - ((EntityState)self).characterBody.characterMotor.velocity.y, 0f) : Vector3.zero); ((EntityState)self).characterBody.characterMotor.ApplyForce(num * num2 * val + val2 * num2, false, false); self.fireIndex++; string text = ((self.fireIndex % 2 == 0) ? "MuzzleLeft" : "MuzzleRight"); EffectManager.SimpleMuzzleFlash(Fire.muzzleflashEffectPrefab, ((EntityState)self).gameObject, text, true); ((EntityState)self).PlayAnimation((self.fireIndex % 2 == 0) ? "Gesture Left Cannon, Additive" : "Gesture Right Cannon, Additive", "FireHarpoon"); ProjectileManager obj = ProjectileManager.instance; FireProjectileInfo val3 = new FireProjectileInfo { projectilePrefab = FireGrenades.projectilePrefab, position = ((EntityState)self).characterBody.footPosition, rotation = Util.QuaternionSafeLookRotation(Vector3.up), procChainMask = default(ProcChainMask), target = ((EntityState)self).gameObject, owner = ((Component)((EntityState)self).characterBody).gameObject }; ((FireProjectileInfo)(ref val3)).fuseOverride = 0f; val3.useFuseOverride = true; val3._fuseOverride = 0f; obj.FireProjectile(val3); ((BaseSkillState)self).activatorSkillSlot.DeductStock(1); } } private void PrepWall_OnExit(orig_OnExit orig, PrepWall self) { //IL_0000: 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) //IL_0019: 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_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) //IL_0032: 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) //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) //IL_0082: 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_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) //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_00a4: 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_00ac: 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_00b6: 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_00c8: Expected O, but got Unknown //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_00dc: 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_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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown Vector3 val = Vector3.zero; if (self.goodPlacement) { val = self.areaIndicatorInstance.transform.position + Vector3.up * 3f; } orig.Invoke(self); if (GetCountEffective(((EntityState)self).characterBody) > 0 && self.goodPlacement && Object.op_Implicit((Object)(object)((EntityState)self).characterBody.characterMotor)) { Vector3 val2 = val - ((EntityState)self).characterBody.characterMotor.previousPosition; CharacterMotor characterMotor = ((EntityState)self).characterBody.characterMotor; characterMotor.rootMotion += val2; EffectData val3 = new EffectData { rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref val2)).normalized), origin = Util.GetCorePosition(((EntityState)self).gameObject) }; EffectManager.SpawnEffect(BlinkState.blinkPrefab, val3, false); EffectData val4 = new EffectData { rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref val2)).normalized), origin = Util.GetCorePosition(((EntityState)self).gameObject) + val2 }; EffectManager.SpawnEffect(BlinkState.blinkPrefab, val4, false); Util.PlaySound("Play_huntress_shift_start", ((EntityState)self).gameObject); Util.PlaySound("Play_huntress_shift_end", ((EntityState)self).gameObject); } } private void Assaulter2_OnEnter(orig_OnEnter orig, Assaulter2 self) { orig.Invoke(self); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0) { ((BaseState)self).moveSpeedStat = ((BaseState)self).moveSpeedStat * (1f + buffFrac * mercDashFrac * (float)countEffective); } } private void FocusedAssaultDash_OnEnter(orig_OnEnter orig, FocusedAssaultDash self) { orig.Invoke(self); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0) { self.speedCoefficient *= 1f + buffFrac * mercDash2Frac * (float)countEffective; } } private void FireSonicBoom_OnEnter(orig_OnEnter orig, FireSonicBoom self) { int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0) { float num = 1f + buffFrac * ((self is FirePlantSonicBoom) ? treebotSonicBoom2Frac : treebotSonicBoomFrac) * (float)countEffective; self.airKnockbackDistance *= num; self.groundKnockbackDistance *= num; } orig.Invoke(self); } private void BaseSwingChargedFist_OnEnter(orig_OnEnter orig, BaseSwingChargedFist self) { int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0) { float num = ((self is SwingChargedFist) ? loaderChargeFistFrac : loaderChargeFist2Frac); self.minLungeSpeed *= 1f + buffFrac * num * (float)countEffective; self.maxLungeSpeed *= 1f + buffFrac * num * (float)countEffective; } orig.Invoke(self); } private void BaseLeap_OnEnter(orig_OnEnter orig, BaseLeap self) { int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective <= 0) { orig.Invoke(self); return; } float moveSpeed = ((EntityState)self).characterBody.moveSpeed; CharacterBody characterBody = ((EntityState)self).characterBody; characterBody.moveSpeed *= 1f + buffFrac * ((self is Leap) ? crocoLeapFrac : crocoLeap2Frac) * (float)countEffective; orig.Invoke(self); ((EntityState)self).characterBody.moveSpeed = moveSpeed; } private void CallAirstrikeAlt_ModifyProjectile(orig_ModifyProjectile orig, CallAirstrikeAlt self, ref FireProjectileInfo fireProjectileInfo) { orig.Invoke(self, ref fireProjectileInfo); int countEffective = GetCountEffective(((EntityState)self).characterBody); if (countEffective > 0) { fireProjectileInfo.projectilePrefab = captainStrikeJumperAltProjectile; fireProjectileInfo.force = buffFrac * (captainAirstrikeAltFracBase + (float)(countEffective - 1) * captainAirstrikeAltFracStack); } } private void ProjectileExplosion_DetonateServer(orig_DetonateServer orig, ProjectileExplosion self) { //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_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_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_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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: 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_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: 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_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_036f: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0387: 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) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) bool flag = ((Object)((Component)self).gameObject).name == "TkSatCaptainStrikeJumperAltProjectile(Clone)"; if (flag && Object.op_Implicit((Object)(object)self.projectileController.owner)) { self.bonusBlastForce = Vector3.zero; self.projectileDamage.force = 0f; } orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self.projectileController.owner)) { return; } int countEffective = GetCountEffective(self.projectileController.owner.gameObject.GetComponent()); if (countEffective <= 0) { return; } if (flag) { HitPoint[] hitPoints = new BlastAttack { position = ((Component)self).transform.position, baseDamage = 0f, baseForce = 0f, radius = self.blastRadius, attacker = self.projectileController.owner.gameObject, inflictor = ((Component)self).gameObject, teamIndex = self.projectileController.teamFilter.teamIndex, crit = false, procChainMask = default(ProcChainMask), procCoefficient = 0f, bonusForce = Vector3.zero, falloffModel = (FalloffModel)0, damageColorIndex = (DamageColorIndex)3, damageType = DamageTypeCombo.op_Implicit((DamageType)2113), attackerFiltering = (AttackerFiltering)1, canRejectForce = true }.Fire().hitPoints; foreach (HitPoint val in hitPoints) { if (Object.op_Implicit((Object)(object)val.hurtBox) && Object.op_Implicit((Object)(object)((Component)val.hurtBox.healthComponent).gameObject)) { GameObject gameObject = ((Component)val.hurtBox.healthComponent).gameObject; Vector3 val2 = SwooceTrajectoryPredictor.CalculateLaunch(((Component)self).transform.position, self.blastRadius, buffFrac * (captainAirstrikeAltFracBase + (float)(countEffective - 1) * captainAirstrikeAltFracStack), gameObject.transform.position, 15f, 90f); CharacterMotor component = gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyForce(val2 * component.mass, true, true); } Rigidbody component2 = gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.AddForce(val2, (ForceMode)2); } TemporaryFallDamageProtection temporaryFallDamageProtection = gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)temporaryFallDamageProtection)) { temporaryFallDamageProtection = gameObject.AddComponent(); } temporaryFallDamageProtection.Apply(); } } } else { if (!(((Object)((Component)self).gameObject).name == "CaptainAirstrikeProjectile1(Clone)")) { return; } HitPoint[] hitPoints = new BlastAttack { position = ((Component)self).transform.position, baseDamage = 0f, baseForce = (float)countEffective * buffFrac * captainAirstrikeFrac, radius = self.blastRadius, attacker = self.projectileController.owner.gameObject, inflictor = ((Component)self).gameObject, teamIndex = self.projectileController.teamFilter.teamIndex, crit = false, procChainMask = default(ProcChainMask), procCoefficient = 0f, bonusForce = Vector3.zero, falloffModel = (FalloffModel)2, damageColorIndex = (DamageColorIndex)3, damageType = DamageTypeCombo.op_Implicit((DamageType)64), attackerFiltering = (AttackerFiltering)1, canRejectForce = false }.Fire().hitPoints; foreach (HitPoint val3 in hitPoints) { if (Object.op_Implicit((Object)(object)val3.hurtBox) && Object.op_Implicit((Object)(object)((Component)val3.hurtBox.healthComponent).gameObject)) { GameObject gameObject2 = ((Component)val3.hurtBox.healthComponent).gameObject; TemporaryFallDamageProtection temporaryFallDamageProtection2 = gameObject2.GetComponent(); if (!Object.op_Implicit((Object)(object)temporaryFallDamageProtection2)) { temporaryFallDamageProtection2 = gameObject2.AddComponent(); } temporaryFallDamageProtection2.Apply(); } } } } } [RegisterAchievement("TkSat_GoFaster", "TkSat_GoFasterUnlockable", "", 3u, null)] public class TkSatGoFasterAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); CharacterMotor.OnLanded += new hook_OnLanded(CharacterMotor_OnLanded); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); CharacterMotor.OnLanded -= new hook_OnLanded(CharacterMotor_OnLanded); } private void CharacterMotor_OnLanded(orig_OnLanded orig, CharacterMotor self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)((BaseAchievement)this).localUser.cachedBody) && (Object)(object)((BaseAchievement)this).localUser.cachedBody == (Object)(object)self.body && ((Vector3)(ref self.lastVelocity)).magnitude > 30f && ((Vector3)(ref self.velocity)).magnitude > 30f && self.lastVelocity.y < 5f && self.velocity.y / ((Vector3)(ref self.velocity)).magnitude > 0.25f) { ((BaseAchievement)this).Grant(); } } } public class ToolbotDashBoostTracker : MonoBehaviour { public int maxBoosts; public int boostsUsed; private float boostStopwatch; public bool retrigProtection = true; public bool boosting => boostStopwatch > 0f; private void FixedUpdate() { if (boosting) { boostStopwatch -= Time.fixedDeltaTime; } } public bool TryBoost() { if (retrigProtection || boostsUsed >= maxBoosts) { return false; } boostsUsed++; boostStopwatch = Item.instance.toolbotReacTime; return true; } } [RequireComponent(typeof(ProjectileDamage), typeof(ProjectileImpactExplosion))] public class SwooceTrajectoryPredictor : MonoBehaviour { private float force; private float radius; public float minPitch = 15f; public float maxPitch = 90f; private LineRenderer line; private void Awake() { //IL_004f: 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) //IL_00be: 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_00d4: Expected O, but got Unknown line = ((Component)this).gameObject.AddComponent(); ((Renderer)line).material = Object.Instantiate(LegacyResourcesAPI.Load("materials/matBlueprintsOk")); ((Renderer)line).material.SetColor("_TintColor", new Color(16f, 0.02f, 0.02f, 9f)); line.positionCount = 100; List list = new List(); for (int i = 0; i < line.positionCount; i++) { list.Add(new Keyframe((float)i / 100f, (1f - MathUtil.Wrap((float)i / 5f, 0f, 1f)) * 0.875f)); } line.widthCurve = new AnimationCurve { keys = list.ToArray() }; } private void Start() { force = ((Component)this).GetComponent().force; radius = ((ProjectileExplosion)((Component)this).GetComponent()).blastRadius; } private void Update() { //IL_0019: 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_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) //IL_0063: 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_0085: 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) GameObject cachedBodyObject = LocalUserManager.GetFirstLocalUser().cachedBodyObject; if (Object.op_Implicit((Object)(object)cachedBodyObject)) { Vector3 val = cachedBodyObject.transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val)).magnitude > radius)) { ((Renderer)line).enabled = true; line.SetPositions(CalculatePoints(cachedBodyObject.transform.position, CalculateLaunch(((Component)this).transform.position, radius, force, cachedBodyObject.transform.position, minPitch, maxPitch), 100, 8f)); return; } } ((Renderer)line).enabled = false; } public static Vector3 CalculateLaunch(Vector3 blastOrigin, float blastRadius, float force, Vector3 bodyOrigin, float minPitch, float maxPitch) { //IL_0002: 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_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_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) //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_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_0066: 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) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(blastOrigin.x, 0f, blastOrigin.z); Vector3 val2 = new Vector3(bodyOrigin.x, 0f, bodyOrigin.z) - val; float num = Mathf.Lerp(maxPitch, minPitch, ((Vector3)(ref val2)).magnitude / blastRadius); return Vector3.RotateTowards(((Vector3)(ref val2)).normalized, Vector3.up, num * MathF.PI / 180f, 100f) * force; } public static Vector3[] CalculatePoints(Vector3 origin, Vector3 velocity, int displayPointsToGenerate, float duration) { //IL_0018: 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_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) Vector3[] array = (Vector3[])(object)new Vector3[displayPointsToGenerate]; float num = duration / ((float)displayPointsToGenerate - 1f); for (int i = 0; i < displayPointsToGenerate; i++) { array[i] = Trajectory.CalculatePositionAtTime(origin, velocity, num * (float)i); } return array; } } [RequireComponent(typeof(CharacterBody))] public class TemporaryFallDamageProtection : NetworkBehaviour { private CharacterBody attachedBody; private bool hasProtection; private bool disableNextFrame; private bool disableN2f; private void FixedUpdate() { //IL_0034: 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_003c: Unknown result type (might be due to invalid IL or missing references) if (disableN2f) { disableN2f = false; disableNextFrame = true; } else if (disableNextFrame) { disableNextFrame = false; hasProtection = false; CharacterBody obj = attachedBody; obj.bodyFlags = (BodyFlags)(obj.bodyFlags & -2); } else if (hasProtection && ((BaseCharacterController)attachedBody.characterMotor).Motor.GroundingStatus.IsStableOnGround && !((BaseCharacterController)attachedBody.characterMotor).Motor.LastGroundingStatus.IsStableOnGround) { disableN2f = true; } } private void Awake() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown attachedBody = ((Component)this).GetComponent(); attachedBody.characterMotor.onMovementHit += new MovementHitDelegate(CharacterMotor_onMovementHit); } public void Apply() { //IL_000e: 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) hasProtection = true; CharacterBody obj = attachedBody; obj.bodyFlags = (BodyFlags)(obj.bodyFlags | 1); } private void CharacterMotor_onMovementHit(ref MovementHitInfo movementHitInfo) { if (hasProtection && !disableN2f && !disableNextFrame) { disableN2f = true; } } } public class Headset : Item { internal UnlockableDef unlockable; private const float HITBOX_RADIUS = 3f; private const float HIT_INTERVAL = 0.5f; public override ItemTier itemTier => (ItemTier)2; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Fraction of base damage dealt by H3AD-53T procs with a single item copy.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float baseDamagePct { get; private set; } = 4f; [AutoConfigRoOSlider("{0:P0}", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Fraction of base damage dealt by H3AD-53T procs per additional item copy.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float stackDamagePct { get; private set; } = 1.5f; [AutoConfigRoOSlider("{0:N0} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Stun time (in seconds) dealt by H3AD-53T procs.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float stunDuration { get; private set; } = 5f; [AutoConfigRoOIntSlider("{0:N0}", 0, 20, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Procs added on Utility skill cast with a single item copy.", AutoConfigFlags.None, new object[] { 1, int.MaxValue })] public int procCount { get; private set; } = 5; [AutoConfigRoOIntSlider("{0:N0}", 0, 20, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Procs added on Utility skill cast per additional item copy.", AutoConfigFlags.None, new object[] { 1, int.MaxValue })] public int stackProcCount { get; private set; } = 3; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of the item attack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 1f; public BuffDef headsetBuff { get; private set; } public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { procCount.ToString("N0"), stackProcCount.ToString("N0"), baseDamagePct.ToString("0%"), stackDamagePct.ToString("0%"), stunDuration.ToString("N1") }; } public Headset() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Headset.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/headsetIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Headset.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Hat", localPos = new Vector3(0.00014f, 0.02091f, -0.01037f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.01348f, 0.20851f, 0.01613f), localAngles = new Vector3(338.5889f, 344.4471f, 18.27958f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.00504f, 0.24495f, 0.01284f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.28014f, 1.14252f, 1.01174f), localAngles = new Vector3(7.38828f, 76.73765f, 113.5267f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.00426f, 0.03067f, 0.00167f), localAngles = new Vector3(20.40316f, 317.4127f, 347.4659f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.00449f, 0.01231f, -0.04551f), localAngles = new Vector3(340.5608f, 314.136f, 15.74504f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.00138f, 0.13256f, 0.00663f), localAngles = new Vector3(356.0245f, 32.47648f, 347.6966f), localScale = new Vector3(0.35f, 0.35f, 0.35f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-0.01204f, 0.05384f, -0.08743f), localAngles = new Vector3(18.0701f, 269.2518f, 73.73166f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.0015f, 0.009f, -0.00323f), localAngles = new Vector3(357.8618f, 317.1738f, 359.0508f), localScale = new Vector3(0.325f, 0.325f, 0.325f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.05776f, 2.43676f, 0.83379f), localAngles = new Vector3(75.36604f, 69.47244f, 84.15331f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FlowerBase", localPos = new Vector3(0.15641f, 1.50413f, 0.01745f), localAngles = new Vector3(16.90676f, 25.22818f, 351.2803f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Hood1", localPos = new Vector3(-0.01385f, -0.02739f, -0.09348f), localAngles = new Vector3(352.0245f, 119.2666f, 137.1029f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.02405f, 0.01485f, 0.00749f), localAngles = new Vector3(334.2645f, 28.96341f, 328.2314f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); } public override void SetupAttributes() { //IL_0026: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); headsetBuff = ScriptableObject.CreateInstance(); headsetBuff.buffColor = new Color(0.5f, 0.575f, 0.95f); headsetBuff.canStack = true; headsetBuff.isDebuff = false; ((Object)headsetBuff).name = "TKSATHeadset"; headsetBuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/ShockNearby/texBuffTeslaIcon.tif").WaitForCompletion(); ContentAddition.AddBuffDef(headsetBuff); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/headsetIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); CharacterBody.FixedUpdate += new hook_FixedUpdate(CharacterBody_FixedUpdate); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); CharacterBody.FixedUpdate -= new hook_FixedUpdate(CharacterBody_FixedUpdate); CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Invalid comparison between Unknown and I4 orig.Invoke(self, skill); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.skillLocator) || (int)self.skillLocator.FindSkillSlot(skill) != 2) { return; } int countEffective = GetCountEffective(self); if (countEffective > 0) { HeadsetComponent headsetComponent = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)headsetComponent)) { headsetComponent = ((Component)self).gameObject.AddComponent(); } headsetComponent.hitsRemaining = procCount + stackProcCount * (countEffective - 1); } } private void CharacterBody_FixedUpdate(orig_FixedUpdate orig, CharacterBody self) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0296: 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_00bd: 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) //IL_009e: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0112: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0272: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self)) { return; } HeadsetComponent headsetComponent = ((Component)self).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)headsetComponent)) { headsetComponent = ((Component)self).gameObject.AddComponent(); } int countEffective = GetCountEffective(self); if (countEffective <= 0) { headsetComponent.hitsRemaining = 0; } else if (headsetComponent.hitsRemaining > 0) { TeamIndex objectTeam = TeamComponent.GetObjectTeam(((Component)self).gameObject); Vector3 previousPos = headsetComponent.previousPos; Vector3 position = self.transform.position; float num = 3f * ExtendoArms.GetRangeMultiplier(self); Collider[] array = ((!(previousPos == position)) ? Physics.OverlapCapsule(previousPos, position, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1) : Physics.OverlapSphere(previousPos, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1)); DamageInfo val = new DamageInfo { attacker = ((Component)self).gameObject, inflictor = ((Component)self).gameObject, crit = false, damage = self.damage * (baseDamagePct + stackDamagePct * (float)(countEffective - 1)), damageColorIndex = (DamageColorIndex)3, damageType = DamageTypeCombo.op_Implicit((DamageType)0), force = Vector3.zero, procCoefficient = procCoefficient }; Collider[] array2 = array; foreach (Collider val2 in array2) { if (!Object.op_Implicit((Object)(object)val2)) { continue; } HurtBox component = ((Component)val2).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.healthComponent) || (Object)(object)component.healthComponent == (Object)(object)self.healthComponent || !FriendlyFireManager.ShouldSplashHitProceed(component.healthComponent, objectTeam)) { continue; } HeadsetICDComponent headsetICDComponent = ((Component)component.healthComponent).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)headsetICDComponent)) { headsetICDComponent = ((Component)component.healthComponent).gameObject.AddComponent(); } if (!(Time.fixedTime - headsetICDComponent.lastHit < 0.5f)) { headsetICDComponent.lastHit = Time.fixedTime; val.position = ((Component)val2).transform.position; component.healthComponent.TakeDamage(val); SetStateOnHurt component2 = ((Component)component.healthComponent).GetComponent(); if (Object.op_Implicit((Object)(object)component2) && component2.canBeStunned) { component2.SetStun(stunDuration); } headsetComponent.hitsRemaining--; if (headsetComponent.hitsRemaining <= 0) { break; } } } headsetComponent.previousPos = position; } int buffCount = self.GetBuffCount(headsetBuff); if (headsetComponent.hitsRemaining != buffCount) { self.SetBuffCount(headsetBuff.buffIndex, headsetComponent.hitsRemaining); } } } public class HeadsetComponent : MonoBehaviour { public Vector3 previousPos; public int hitsRemaining; } public class HeadsetICDComponent : MonoBehaviour { public float lastHit; } [RegisterAchievement("TkSat_Headset", "TkSat_HeadsetUnlockable", "", 3u, null)] public class TkSatHeadsetAchievement : BaseAchievement { private bool currentDamageIsHeadstompers; public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); HeadstompersFall.DoStompExplosionAuthority += new hook_DoStompExplosionAuthority(HeadstompersFall_DoStompExplosionAuthority); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); HeadstompersFall.DoStompExplosionAuthority -= new hook_DoStompExplosionAuthority(HeadstompersFall_DoStompExplosionAuthority); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void HeadstompersFall_DoStompExplosionAuthority(orig_DoStompExplosionAuthority orig, HeadstompersFall self) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((BaseHeadstompersState)self).body) && Object.op_Implicit((Object)(object)((BaseHeadstompersState)self).body.inventory) && ((BaseHeadstompersState)self).body.inventory.GetItemCountEffective(Items.FallBoots) > 0 && Mathf.Max(0f, self.initialY - ((BaseHeadstompersState)self).body.footPosition.y) >= HeadstompersFall.maxDistance) { currentDamageIsHeadstompers = true; } orig.Invoke(self); currentDamageIsHeadstompers = false; } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); if (currentDamageIsHeadstompers && Object.op_Implicit((Object)(object)self) && !self.alive && Object.op_Implicit((Object)(object)self.body) && self.body.isChampion) { ((BaseAchievement)this).Grant(); } } } public class Kintsugi : Item { internal static UnlockableDef unlockable; private readonly HashSet validItems = new HashSet(); public override ItemTier itemTier => (ItemTier)2; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[2] { (ItemTag)3, (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Stat bonus per T1 item per stack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float tier1Bonus { get; private set; } = 0.01f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Stat bonus per T2 item per stack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float tier2Bonus { get; private set; } = 0.03f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Stat bonus per any other item (e.g. T3, Boss) per stack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float tier3Bonus { get; private set; } = 0.05f; [AutoConfigRoOString(null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Items to count towards Kintsugi, as a comma-delimited list of name tokens or internal names (will be automatically trimmed, prefix name tokens with @).", AutoConfigFlags.None, new object[] { })] public string validItemNameTokens { get; private set; } = "ScrapWhite, ScrapGreen, ScrapRed, ScrapYellow, RegeneratingScrap, RegeneratingScrapConsumed, HealingPotionConsumed, FragileDamageBonusConsumed, ExtraLifeVoidConsumed, ExtraLifeConsumed, TKSATKintsugi"; [AutoConfigRoOIntSlider("{0:B7}", 0, 127, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Binary flag determining which stats to effect. 1: Attack Speed, 2: Damage, 4: Move Speed, 8: Jump Power, 16: Regen Mult., 32: Crit Chance, 64: Armor", AutoConfigFlags.None, new object[] { 0, 127 })] public int buffEffectFlags { get; private set; } = 127; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { tier1Bonus.ToString("0%"), tier2Bonus.ToString("0%"), tier3Bonus.ToString("0%") }; } public Kintsugi() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Kintsugi.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/kintsugiIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Kintsugi.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.12567f, -0.08697f, 0.20119f), localAngles = new Vector3(312.9724f, 73.70127f, 16.40451f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.31281f, -0.00462f, 0.14926f), localAngles = new Vector3(351.1349f, 236.5051f, 26.06075f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.23084f, -0.01033f, 0.08094f), localAngles = new Vector3(4.32157f, 286.1034f, 52.17296f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "SpineStomach1", localPos = new Vector3(1.18663f, 3.31978f, 0.68969f), localAngles = new Vector3(343.7948f, 26.87664f, 353.0051f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.28395f, 0.07248f, -0.08704f), localAngles = new Vector3(354.6513f, 302.0988f, 211.8762f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.20056f, -0.05875f, -0.07142f), localAngles = new Vector3(40.30397f, 17.12854f, 159.5616f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.19923f, -0.14524f, 0.25555f), localAngles = new Vector3(308.887f, 74.29995f, 36.2258f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(0.14796f, 0.01064f, -0.16038f), localAngles = new Vector3(4.44165f, 294.8552f, 208.2559f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.2219f, 0.00249f, 0.09567f), localAngles = new Vector3(8.58844f, 225.0816f, 24.13489f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(2.1294f, -0.79742f, 1.86715f), localAngles = new Vector3(342.3761f, 258.168f, 58.53947f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.72213f, 0.23556f, 0.26992f), localAngles = new Vector3(339.7497f, 310.3758f, 56.41169f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.03362f, -0.03905f, 0.18169f), localAngles = new Vector3(352.4358f, 63.85438f, 6.83272f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Center", localPos = new Vector3(0.20091f, -0.0092f, 0.16045f), localAngles = new Vector3(309.0165f, 121.6112f, 332.4587f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { base.SetupAttributes(); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/kintsugiIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void SetupConfig() { base.SetupConfig(); base.ConfigEntryChanged += delegate(object nv, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "validItemNameTokens") { UpdateValidItems(); } }; } public override void SetupCatalogReady() { base.SetupCatalogReady(); UpdateValidItems(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); CharacterMaster.OnInventoryChanged -= new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } public static bool GetIsItemValid(ItemDef item) { return Item.instance.validItems.Contains(item); } public static int GetConsumedItemCount(Inventory inventory) { if (!Object.op_Implicit((Object)(object)inventory)) { return 0; } int num = 0; foreach (ItemDef validItem in Item.instance.validItems) { num += inventory.GetItemCountEffective(validItem); } return num; } public static Dictionary GetConsumedItemCountByTier(Inventory inventory) { //IL_0034: 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_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_004d: 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) Dictionary dictionary = new Dictionary(); if (!Object.op_Implicit((Object)(object)inventory)) { return dictionary; } foreach (ItemDef validItem in Item.instance.validItems) { int itemCountEffective = inventory.GetItemCountEffective(validItem); if (dictionary.ContainsKey(validItem.tier)) { dictionary[validItem.tier] += itemCountEffective; } else { dictionary.Add(validItem.tier, itemCountEffective); } } return dictionary; } private void UpdateValidItems() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!((ResourceAvailability)(ref ItemCatalog.availability)).available) { return; } IEnumerable<(string content, bool isInternalName)> nameTokens = validItemNameTokens.Split(',').Select(delegate(string x) { bool flag = x.Length > 0 && x[0] == '@'; string text; if (!flag) { text = x; } else { text = x.Substring(1, x.Length - 1); } return (text.Trim(), flag); }); validItems.Clear(); validItems.UnionWith(((IEnumerable)(object)ItemCatalog.allItemDefs).Where((ItemDef idef) => nameTokens.Any(((string content, bool isInternalName) kvp) => (kvp.isInternalName ? idef.nameToken : ((Object)idef).name) == kvp.content))); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { //IL_0055: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Invalid comparison between Unknown and I4 //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Invalid comparison between Unknown and I4 //IL_0069: 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_0078: Invalid comparison between Unknown and I4 //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)sender)) { return; } int countEffective = GetCountEffective(sender); Dictionary consumedItemCountByTier = GetConsumedItemCountByTier(sender.inventory); float num = 0f; using (IEnumerator<(ItemTier, int)> enumerator = consumedItemCountByTier.Select((KeyValuePair x) => (x.Key, x.Value)).GetEnumerator()) { float num2; float num3; for (; enumerator.MoveNext(); num = num2 + num3) { (ItemTier, int) current = enumerator.Current; ItemTier item = current.Item1; int item2 = current.Item2; num2 = num; if ((int)item <= 1) { if ((int)item == 0) { goto IL_007c; } if ((int)item == 1) { goto IL_008a; } } else { if ((int)item == 6) { goto IL_007c; } if ((int)item == 7) { goto IL_008a; } } num3 = tier3Bonus * (float)item2; continue; IL_008a: num3 = tier2Bonus * (float)item2; continue; IL_007c: num3 = tier1Bonus * (float)item2; } } num *= (float)countEffective; if (((uint)buffEffectFlags & (true ? 1u : 0u)) != 0) { args.attackSpeedMultAdd += num; } if (((uint)buffEffectFlags & 2u) != 0) { args.damageMultAdd += num; } if (((uint)buffEffectFlags & 4u) != 0) { args.moveSpeedMultAdd += num; } if (((uint)buffEffectFlags & 8u) != 0) { args.jumpPowerMultAdd += num; } if (((uint)buffEffectFlags & 0x10u) != 0) { args.regenMultAdd += num; } if (((uint)buffEffectFlags & 0x20u) != 0) { args.critAdd += num * 100f; } if (((uint)buffEffectFlags & 0x40u) != 0) { args.armorAdd += num * 100f; } } private void CharacterMaster_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self) { orig.Invoke(self); } } [RegisterAchievement("TkSat_Kintsugi", "TkSat_KintsugiUnlockable", "", 3u, null)] public class TkSatKintsugiAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); CharacterMaster.OnInventoryChanged -= new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } private void CharacterMaster_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self) { orig.Invoke(self); if (!((Object)(object)((BaseAchievement)this).localUser.cachedMaster != (Object)(object)self)) { int consumedItemCount = Kintsugi.GetConsumedItemCount(self.inventory); int totalItemStacks = ((ItemCollection)(ref self.inventory.effectiveItemStacks)).GetTotalItemStacks(); if (totalItemStacks >= 20 && consumedItemCount > Mathf.CeilToInt((float)totalItemStacks / 2f)) { ((BaseAchievement)this).Grant(); } } } } public class Pinball : Item { internal PhysicMaterial bouncyPhysmat; internal GameObject effectPrefab; internal static UnlockableDef unlockable; private readonly HashSet> firedAttacks = new HashSet>(); private const float GC_INTERVAL = 2f; private float _gcStopwatch; public override ItemTier itemTier => (ItemTier)2; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOIntSlider("{0:N0}", 0, 20, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Number of extra projectile bounces at first stack.", AutoConfigFlags.None, new object[] { 0, int.MaxValue })] public int baseBounces { get; private set; } = 3; [AutoConfigRoOIntSlider("{0:N0}", 0, 20, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Number of extra projectile bounces per additional stack.", AutoConfigFlags.None, new object[] { 0, int.MaxValue })] public int stackBounces { get; private set; } = 2; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Fraction of original attack damage for bounced projectiles.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float bounceDamageFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:N0}%", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Percent chance to proc.", AutoConfigFlags.None, new object[] { 0f, 100f })] public float bounceChance { get; private set; } = 15f; [AutoConfigRoOString(null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Extra projectile names to blacklist (comma-delimited, leading/trailing whitespace will be ignored).", AutoConfigFlags.DeferForever, new object[] { })] public string blacklistedProjectiles { get; private set; } = "TreebotFlower1, TreebotFlower2, TreebotFlowerSeed"; [AutoConfigRoOSlider("{0:P0}", 0f, 2f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proportion of melee attack damage on fired projectiles.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float meleeProjectileDamage { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient for melee projectiles.", AutoConfigFlags.DeferForever, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 0.5f; public HashSet projectileNameBlacklist { get; private set; } = new HashSet(); public GameObject idrPrefab { get; private set; } public GameObject projectilePrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { (bounceChance / 100f).ToString("0%"), bounceDamageFrac.ToString("0%"), baseBounces.ToString("N0"), stackBounces.ToString("N0"), meleeProjectileDamage.ToString("0%") }; } public Pinball() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Pinball.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/pinballIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Pinball.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.06567f, 0.12138f, -0.20501f), localAngles = new Vector3(280.6782f, 297.5041f, 122.7027f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00143f, 0.00143f, -0.22823f), localAngles = new Vector3(281.4762f, 124.1527f, 312.8369f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.07875f, 0.19793f, -0.14871f), localAngles = new Vector3(346.105f, 246.2088f, 198.6338f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.02502f, -0.37262f, 3.06713f), localAngles = new Vector3(304.7492f, 11.28959f, 235.7366f), localScale = new Vector3(8f, 8f, 8f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.01673f, -0.18265f, 0.35104f), localAngles = new Vector3(13.1134f, 274.4481f, 9.74112f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.15394f, 0.07526f, -0.05401f), localAngles = new Vector3(303.8185f, 51.77041f, 340.8576f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.12752f, 0.14517f, -0.18434f), localAngles = new Vector3(279.9368f, 94.9445f, 337.786f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.18761f, 0.06765f, -0.29962f), localAngles = new Vector3(273.3469f, 10.00318f, 44.01978f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.01144f, 0.07258f, -0.16841f), localAngles = new Vector3(353.4411f, 267.4354f, 203.5448f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(1.58694f, 1.38868f, -1.89818f), localAngles = new Vector3(286.5735f, 115.4369f, 302.4759f), localScale = new Vector3(10f, 10f, 10f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.12912f, 0.64686f, -0.97308f), localAngles = new Vector3(331.9042f, 81.83606f, 9.11342f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.2635f, -0.18186f, 0.20648f), localAngles = new Vector3(278.9552f, 56.63836f, 307.4236f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.04817f, -0.09084f, -0.19568f), localAngles = new Vector3(322.1917f, 215.9342f, 229.2181f), localScale = new Vector3(1f, 1f, 1f) } }); } public override void SetupAttributes() { //IL_0049: 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_0060: 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_0071: Expected O, but got Unknown //IL_0077: Expected O, but got Unknown //IL_009d: 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) base.SetupAttributes(); NetworkingAPI.RegisterMessageType(); projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/PinballProjectile.prefab"); ((ProjectileExplosion)projectilePrefab.GetComponent()).blastProcCoefficient = procCoefficient; ContentAddition.AddProjectile(projectilePrefab); bouncyPhysmat = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/physmatBouncy.physicMaterial").WaitForCompletion(); GameObject val = new GameObject("TkSatTempSetupPrefabPrefab"); GameObject val2 = PrefabAPI.InstantiateClone(val, "TkSatTempSetupPrefab", false); Object.Destroy((Object)val); val2.AddComponent(); val2.AddComponent().duration = 1f; val2.AddComponent(); VFXAttributes obj = val2.AddComponent(); obj.vfxPriority = (VFXPriority)1; obj.vfxIntensity = (VFXIntensity)1; val2.AddComponent(); effectPrefab = PrefabAPI.InstantiateClone(val2, "TkSatPinballSFXHandler", false); Object.Destroy((Object)(object)val2); ContentAddition.AddEffect(effectPrefab); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/pinballIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void SetupConfig() { base.SetupConfig(); projectileNameBlacklist.UnionWith(from x in blacklistedProjectiles.Split(',') select x.Trim() + "(Clone)"); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown base.Install(); ProjectileController.Start += new hook_Start(ProjectileController_Start); ProjectileImpactExplosion.OnProjectileImpact += new hook_OnProjectileImpact(ProjectileImpactExplosion_OnProjectileImpact); ProjectileSingleTargetImpact.OnProjectileImpact += new hook_OnProjectileImpact(ProjectileSingleTargetImpact_OnProjectileImpact); ProjectileExplosion.Detonate += new hook_Detonate(ProjectileExplosion_Detonate); BulletAttack.ProcessHitList += new hook_ProcessHitList(BulletAttack_ProcessHitList); Run.FixedUpdate += new hook_FixedUpdate(Run_FixedUpdate); OverlapAttack.Fire += new hook_Fire(OverlapAttack_Fire); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown base.Uninstall(); ProjectileController.Start -= new hook_Start(ProjectileController_Start); ProjectileImpactExplosion.OnProjectileImpact -= new hook_OnProjectileImpact(ProjectileImpactExplosion_OnProjectileImpact); ProjectileSingleTargetImpact.OnProjectileImpact -= new hook_OnProjectileImpact(ProjectileSingleTargetImpact_OnProjectileImpact); ProjectileExplosion.Detonate -= new hook_Detonate(ProjectileExplosion_Detonate); BulletAttack.ProcessHitList -= new hook_ProcessHitList(BulletAttack_ProcessHitList); Run.FixedUpdate -= new hook_FixedUpdate(Run_FixedUpdate); OverlapAttack.Fire -= new hook_Fire(OverlapAttack_Fire); } private void Run_FixedUpdate(orig_FixedUpdate orig, Run self) { orig.Invoke(self); _gcStopwatch -= Time.fixedDeltaTime; if (_gcStopwatch <= 0f) { firedAttacks.RemoveWhere((WeakReference r) => !r.TryGetTarget(out var _)); _gcStopwatch = 2f; } } private bool OverlapAttack_Fire(orig_Fire orig, OverlapAttack self, List hitResults) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_0140: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) bool result = orig.Invoke(self, hitResults); CharacterBody val = default(CharacterBody); if (NetworkServer.active && Object.op_Implicit((Object)(object)self.attacker) && self.attacker.TryGetComponent(ref val) && !firedAttacks.Any((WeakReference x) => x.TryGetTarget(out var target) && target == self) && GetCountEffective(val) > 0) { float num = bounceChance; CharacterMaster master = val.master; if (Util.CheckRoll(num, (master != null) ? master.luck : 0f, val.master)) { ProjectileManager.instance.FireProjectile(new FireProjectileInfo { crit = val.RollCrit(), damage = self.damage * meleeProjectileDamage, damageColorIndex = (DamageColorIndex)3, force = 0f, owner = self.attacker, rotation = Quaternion.Euler(base.rng.nextNormalizedFloat * 360f, base.rng.nextNormalizedFloat * 360f, base.rng.nextNormalizedFloat * 360f), position = val.corePosition, procChainMask = self.procChainMask, projectilePrefab = projectilePrefab }); } firedAttacks.Add(new WeakReference(self)); } return result; } private GameObject BulletAttack_ProcessHitList(orig_ProcessHitList orig, BulletAttack self, List hits, ref Vector3 endPosition, List ignoreList) { //IL_0069: 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_007e: Unknown result type (might be due to invalid IL or missing references) //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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_019d: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025d: 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_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Expected O, but got Unknown //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown GameObject result = orig.Invoke(self, hits, ref endPosition, ignoreList); if (!Object.op_Implicit((Object)(object)self.owner)) { return result; } CharacterBody component = self.owner.GetComponent(); int countEffective = GetCountEffective(component); if (countEffective > 0) { int num = baseBounces + (countEffective - 1) * stackBounces; Vector3 bounceEnd = endPosition - self.aimVector * 0.25f; GameObject lastBounceTarget = null; float damage = self.damage; for (int i = 1; i <= num; i++) { float num2 = bounceChance; CharacterMaster master = component.master; if (!Util.CheckRoll(num2, (master != null) ? master.luck : 0f, component.master)) { return result; } IEnumerable<(GameObject, RaycastHit)> source = from kvp in (from x in CommonCode.GatherEnemies(TeamComponent.GetObjectTeam(self.owner), default(TeamIndex)) select CommonCode.GetRootWithLocators(((Component)x).gameObject)).Select(delegate(GameObject obj) { //IL_0011: 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_0039: 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_004d: 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_005d: 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_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_00a0: 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_007d: 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_00cc: 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_00bb: 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_00e1: 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) if ((Object)(object)obj == (Object)(object)lastBounceTarget) { return (null, default(RaycastHit)); } HealthComponent component2 = obj.GetComponent(); if (!Object.op_Implicit((Object)(object)component2) || !component2.alive) { return (null, default(RaycastHit)); } Vector3 val5 = obj.transform.position - bounceEnd; float magnitude = ((Vector3)(ref val5)).magnitude; if (magnitude > self.maxDistance) { return (null, default(RaycastHit)); } Ray val6 = default(Ray); ((Ray)(ref val6))..ctor(bounceEnd, ((Vector3)(ref val5)).normalized); if (Physics.Raycast(val6, magnitude, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { return (null, default(RaycastHit)); } RaycastHit item3 = default(RaycastHit); return (!Physics.Raycast(val6, ref item3, magnitude, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1)) ? ((GameObject)null, default(RaycastHit)) : (obj, item3); }) where (Object)(object)kvp.obj != (Object)null select kvp; if (source.Count() <= 0) { break; } (GameObject, RaycastHit) tuple = Item.instance.rng.NextElementUniform<(GameObject, RaycastHit)>(source.ToArray()); GameObject item = tuple.Item1; RaycastHit item2 = tuple.Item2; Vector3 val = item.transform.position - bounceEnd; Vector3 normalized = ((Vector3)(ref val)).normalized; BulletHit val2 = ((BasePool)(object)BulletAttack.bulletHitPool).Request(); self.damage = damage * bounceDamageFrac; self.InitBulletHitFromRaycastHit(ref val2, new Ray(bounceEnd, normalized), ref item2); self.ProcessHit(ref val2); if (Object.op_Implicit((Object)(object)self.tracerEffectPrefab)) { EffectData val3 = new EffectData { origin = item.transform.position, start = bounceEnd }; EffectManager.SpawnEffect(self.tracerEffectPrefab, val3, true); } EffectData val4 = new EffectData { origin = bounceEnd, start = bounceEnd }; EffectManager.SpawnEffect(effectPrefab, val4, true); bounceEnd = item.transform.position; lastBounceTarget = item; } self.damage = damage; } return result; } private void ProjectileExplosion_Detonate(orig_Detonate orig, ProjectileExplosion self) { PinballProjectileController component = ((Component)self).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !component.isBouncy) { orig.Invoke(self); } } private void ProjectileController_Start(orig_Start orig, ProjectileController self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.owner) || Object.op_Implicit((Object)(object)((Component)self).GetComponent()) || Object.op_Implicit((Object)(object)((Component)self).GetComponent()) || projectileNameBlacklist.Contains(((Object)((Component)self).gameObject).name)) { return; } CharacterBody component = self.owner.GetComponent(); int countEffective = GetCountEffective(component); Rigidbody component2 = ((Component)self).GetComponent(); if (countEffective > 0 && Object.op_Implicit((Object)(object)component2)) { float num = bounceChance; CharacterMaster master = component.master; if (Util.CheckRoll(num, (master != null) ? master.luck : 0f, component.master)) { ((Component)self).gameObject.AddComponent().maxBounces = baseBounces + stackBounces * (countEffective - 1); } } } private void ProjectileImpactExplosion_OnProjectileImpact(orig_OnProjectileImpact orig, ProjectileImpactExplosion self, ProjectileImpactInfo impactInfo) { //IL_0002: 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) orig.Invoke(self, impactInfo); PinballProjectileController component = ((Component)self).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.OnBounce(impactInfo); } } private void ProjectileSingleTargetImpact_OnProjectileImpact(orig_OnProjectileImpact orig, ProjectileSingleTargetImpact self, ProjectileImpactInfo impactInfo) { //IL_0002: 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) orig.Invoke(self, impactInfo); PinballProjectileController component = ((Component)self).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.OnBounce(impactInfo); } } } [RequireComponent(typeof(ProjectileController))] public class PinballProjectileController : MonoBehaviour { public struct MsgSetBounceTarget : INetMessage, ISerializableObject { private GameObject _target; private PinballProjectileController _projectile; public MsgSetBounceTarget(GameObject target, PinballProjectileController projectile) { _target = target; _projectile = projectile; } public void Deserialize(NetworkReader reader) { GameObject target = reader.ReadGameObject(); _target = target; GameObject val = reader.ReadGameObject(); if (Object.op_Implicit((Object)(object)val)) { _projectile = val.GetComponent(); } else { TinkersSatchelPlugin._logger.LogError((object)"Received MsgSetBounceTarget for nonexistent or non-networked projectile GameObject"); } } public readonly void Serialize(NetworkWriter writer) { writer.Write(_target); writer.Write(((Component)_projectile).gameObject); } public readonly void OnReceived() { if (Object.op_Implicit((Object)(object)_projectile) && !NetworkServer.active) { _projectile.currTarget = _target; } } } public int maxBounces; public int currentBounces; private bool origDestroyOnWorldPIE; private bool origDestroyOnEnemyPIE; private bool origDestroyOnWorldPSTI; private bool origDestroyOnEnemyPSTI; private float origDamagePIE; private float origDamagePSTI; private float origSpeed; private readonly List origPhysmats = new List(); private GameObject lastTarget; private GameObject currTarget; private ProjectileController projectile; private ProjectileImpactExplosion pie; private ProjectileSingleTargetImpact psti; private ProjectileSimple ps; private ProjectileExplosion pe; public bool isBouncy { get; private set; } private void Awake() { //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) isBouncy = true; projectile = ((Component)this).GetComponent(); pie = ((Component)this).GetComponent(); psti = ((Component)this).GetComponent(); ps = ((Component)this).GetComponent(); pe = ((Component)this).GetComponent(); if ((Object)(object)pe == (Object)(object)pie) { pe = null; } Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { origPhysmats.Add(componentsInChildren[i].material); componentsInChildren[i].material = Item.instance.bouncyPhysmat; } if (Object.op_Implicit((Object)(object)pie)) { origDestroyOnWorldPIE = pie.destroyOnWorld; origDestroyOnEnemyPIE = pie.destroyOnEnemy; pie.destroyOnWorld = false; pie.destroyOnEnemy = false; origDamagePIE = ((ProjectileExplosion)pie).projectileDamage.damage; } if (Object.op_Implicit((Object)(object)psti)) { origDestroyOnWorldPSTI = psti.destroyOnWorld; origDestroyOnEnemyPSTI = psti.destroyWhenNotAlive; psti.destroyOnWorld = false; psti.destroyWhenNotAlive = false; origDamagePSTI = psti.projectileDamage.damage; } if (Object.op_Implicit((Object)(object)ps)) { origSpeed = ps.desiredForwardSpeed; return; } Vector3 velocity = projectile.rigidbody.velocity; origSpeed = ((Vector3)(ref velocity)).magnitude; } private void FixedUpdate() { //IL_0096: 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_00ae: 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_00ca: Unknown result type (might be due to invalid IL or missing references) if (isBouncy && ((Object.op_Implicit((Object)(object)pie) && pie.stopwatch > pie.lifetime) || (Object.op_Implicit((Object)(object)ps) && ps.stopwatch > ps.lifetime))) { isBouncy = false; } if (Object.op_Implicit((Object)(object)currTarget)) { HealthComponent component = currTarget.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !component.alive) { currTarget = null; return; } Vector3 val = currTarget.transform.position - ((Component)this).transform.position; Vector3 velocity = ((Vector3)(ref val)).normalized * origSpeed; projectile.rigidbody.velocity = velocity; } } public void OnBounce(ProjectileImpactInfo impactInfo) { //IL_0000: 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_0108: 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_011e: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) GameObject rootWithLocators = CommonCode.GetRootWithLocators(((Component)impactInfo.collider).gameObject); if ((Object)(object)lastTarget != (Object)null && (Object)(object)rootWithLocators == (Object)(object)lastTarget) { return; } if (Object.op_Implicit((Object)(object)currTarget)) { lastTarget = currTarget; } else { currTarget = rootWithLocators; } currentBounces++; if (Object.op_Implicit((Object)(object)pie)) { ((ProjectileExplosion)pie).projectileDamage.damage = origDamagePIE * Item.instance.bounceDamageFrac; } if (Object.op_Implicit((Object)(object)psti)) { psti.projectileDamage.damage = origDamagePSTI * Item.instance.bounceDamageFrac; } CharacterMaster val = null; if (Object.op_Implicit((Object)(object)projectile) && Object.op_Implicit((Object)(object)projectile.owner)) { CharacterBody component = projectile.owner.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { val = component.master; } } if (NetworkServer.active) { EffectData val2 = new EffectData { origin = ((Component)this).gameObject.transform.position, start = ((Component)this).gameObject.transform.position }; EffectManager.SpawnEffect(Item.instance.effectPrefab, val2, true); } if (currentBounces >= maxBounces || !Util.CheckRoll(Item.instance.bounceChance, val.luck, val)) { isBouncy = false; currentBounces = maxBounces; Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].material = origPhysmats[i]; } if (Object.op_Implicit((Object)(object)pie)) { pie.destroyOnWorld = origDestroyOnWorldPIE; pie.destroyOnEnemy = origDestroyOnEnemyPIE; } if (Object.op_Implicit((Object)(object)psti)) { psti.destroyOnWorld = origDestroyOnWorldPSTI; psti.destroyWhenNotAlive = origDestroyOnEnemyPSTI; } } else { if (Object.op_Implicit((Object)(object)psti)) { psti.alive = true; } if (Object.op_Implicit((Object)(object)pie)) { pie.hasImpact = false; pie.stopwatch = 0f; pie.stopwatchAfterImpact = 0f; if (Object.op_Implicit((Object)(object)pie.impactEffect)) { ((ProjectileExplosion)pie).explosionEffect = pie.impactEffect; } ((ProjectileExplosion)pie).DetonateServer(); ((ProjectileExplosion)pie).alive = true; } if (Object.op_Implicit((Object)(object)pe)) { pe.DetonateServer(); } if (Object.op_Implicit((Object)(object)ps)) { ps.stopwatch = 0f; } } if (NetworkServer.active) { IEnumerable source = (from x in CommonCode.GatherEnemies(projectile.teamFilter.teamIndex, default(TeamIndex)) select CommonCode.GetRootWithLocators(((Component)x).gameObject)).Where(delegate(GameObject obj) { //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_0044: 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_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_006a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)obj == (Object)(object)lastTarget) { return false; } HealthComponent component2 = obj.GetComponent(); if (!Object.op_Implicit((Object)(object)component2) || !component2.alive) { return false; } Vector3 val5 = obj.transform.position - ((Component)this).transform.position; float magnitude = ((Vector3)(ref val5)).magnitude; return (!Physics.Raycast(new Ray(((Component)this).transform.position, ((Vector3)(ref val5)).normalized), magnitude, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) ? true : false; }); GameObject val3 = null; if (source.Count() > 0) { val3 = Item.instance.rng.NextElementUniform(source.ToArray()); } if (Object.op_Implicit((Object)(object)val3)) { currTarget = val3; Rigidbody rigidbody = projectile.rigidbody; Vector3 val4 = val3.transform.position - ((Component)this).transform.position; rigidbody.velocity = ((Vector3)(ref val4)).normalized * origSpeed; } else { lastTarget = null; currTarget = null; } NetMessageExtensions.Send((INetMessage)(object)new MsgSetBounceTarget(currTarget, this), (NetworkDestination)1); } projectile.rigidbody.angularVelocity = Random.insideUnitSphere * 15f; } } public class RandomPinballSFXOnEnable : MonoBehaviour { private void OnEnable() { float num = Random.Range(0f, 100f); for (int i = 0; i < 10; i++) { Util.PlaySound("Play_UI_obj_casinoChest_swap", ((Component)this).gameObject, "casinoChest_swapSpeed", num); } } } [RegisterAchievement("TkSat_Pinball", "TkSat_PinballUnlockable", "", 3u, null)] public class TkSatPinballAchievement : BaseAchievement { public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); CharacterMaster.OnInventoryChanged -= new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged); } private void CharacterMaster_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self) { orig.Invoke(self); if (!((Object)(object)((BaseAchievement)this).localUser.cachedMaster != (Object)(object)self)) { int num = 0; if (self.inventory.GetItemCountEffective(Items.ExplodeOnDeath) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.IgniteOnKill) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.Dagger) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.Icicle) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.LaserTurbine) > 0) { num++; } if (self.inventory.GetItemCountEffective(Items.BleedOnHitAndExplode) > 0) { num++; } if (num >= 3) { ((BaseAchievement)this).Grant(); } } } } public class ShrinkRay : Item { public override ItemTier itemTier => (ItemTier)2; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)3 }); [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Effect duration per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float duration { get; private set; } = 3f; [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Internal cooldown of applying the effect. Does not stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float icd { get; private set; } = 2.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Strength of the damage debuff (higher = less damage). Does not stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageDebuff { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfig("Strength of the model scale effect per stack (lower = smaller).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float scaleDebuff { get; private set; } = 0.5f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public BuffDef shrinkDebuff { get; private set; } public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { icd.ToString("N1"), damageDebuff.ToString("0%"), duration.ToString("N1") }; } public ShrinkRay() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/ShrinkRay.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/shrinkRayIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/ShrinkRay.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.31565f, -0.0445f, 0.04523f), localAngles = new Vector3(300.5455f, 297.5691f, 91.7804f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.22635f, 0.26941f, 0.01304f), localAngles = new Vector3(13.4581f, 291.0686f, 35.81881f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.20543f, -0.01136f, -0.1254f), localAngles = new Vector3(335.1445f, 238.071f, 73.80905f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(2.18319f, -0.78877f, 0.74221f), localAngles = new Vector3(7.56097f, 89.35254f, 108.851f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.26052f, 0.13688f, 0.07865f), localAngles = new Vector3(354.8487f, 286.5102f, 251.6627f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.16105f, 0.00864f, -0.1383f), localAngles = new Vector3(18.0823f, 42.60661f, 76.35323f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(-0.25048f, -0.03595f, -0.00376f), localAngles = new Vector3(11.4835f, 82.80101f, 352.5358f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.18394f, -0.07509f, 0.02655f), localAngles = new Vector3(8.07984f, 251.9991f, 228.8695f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ThighL", localPos = new Vector3(0.15595f, 0.13259f, 0.04387f), localAngles = new Vector3(356.5925f, 253.9449f, 262.8833f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-2.47602f, 0.03398f, -1.0808f), localAngles = new Vector3(332.6047f, 273.7401f, 72.44123f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "WeaponPlatformEnd", localPos = new Vector3(-0.28183f, -0.3983f, 0.16674f), localAngles = new Vector3(1.82438f, 278.0178f, 269.5744f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "BottomRail", localPos = new Vector3(4E-05f, 0.73052f, -0.08509f), localAngles = new Vector3(353.429f, 140.3837f, 282.2221f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Center", localPos = new Vector3(-0.15854f, -0.00375f, -0.05974f), localAngles = new Vector3(7.54796f, 267.8279f, 89.54227f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { //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) //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) base.SetupAttributes(); shrinkDebuff = ScriptableObject.CreateInstance(); shrinkDebuff.buffColor = Color.white; shrinkDebuff.canStack = true; shrinkDebuff.isDebuff = true; ((Object)shrinkDebuff).name = "TKSATShrink"; shrinkDebuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texDifficultyEasyIcon.png").WaitForCompletion(); ContentAddition.AddBuffDef(shrinkDebuff); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 base.Install(); GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy); CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost); CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBody_OnBuffFirstStackGained); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 base.Uninstall(); GlobalEventManager.OnHitEnemy -= new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy); CharacterBody.RecalculateStats -= new hook_RecalculateStats(CharacterBody_RecalculateStats); CharacterBody.OnBuffFinalStackLost -= new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost); CharacterBody.OnBuffFirstStackGained -= new hook_OnBuffFirstStackGained(CharacterBody_OnBuffFirstStackGained); } private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { orig.Invoke(self, damageInfo, victim); if (!NetworkServer.active || damageInfo == null || !Object.op_Implicit((Object)(object)damageInfo.attacker) || (disableSelfDamage && !((Object)(object)damageInfo.attacker != (Object)(object)victim))) { return; } int countEffective = GetCountEffective(damageInfo.attacker.GetComponent()); if (countEffective <= 0) { return; } ShrinkRayICDComponent shrinkRayICDComponent = damageInfo.attacker.GetComponent(); if (!Object.op_Implicit((Object)(object)shrinkRayICDComponent)) { shrinkRayICDComponent = damageInfo.attacker.AddComponent(); } if (Time.fixedTime - shrinkRayICDComponent.lastHit > icd) { shrinkRayICDComponent.lastHit = Time.fixedTime; ServerTimedSkillDisable serverTimedSkillDisable = victim.GetComponent(); if (!Object.op_Implicit((Object)(object)serverTimedSkillDisable)) { serverTimedSkillDisable = victim.AddComponent(); } serverTimedSkillDisable.ServerApply(duration * (float)countEffective, (SkillSlot)1); serverTimedSkillDisable.ServerApply(duration * (float)countEffective, (SkillSlot)2); serverTimedSkillDisable.ServerApply(duration * (float)countEffective, (SkillSlot)3); CharacterBody val = default(CharacterBody); if (victim.TryGetComponent(ref val)) { val.AddTimedBuff(shrinkDebuff, duration * (float)countEffective); } } } private void CharacterBody_OnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffDef); if (Object.op_Implicit((Object)(object)self) && (Object)(object)buffDef == (Object)(object)shrinkDebuff && Object.op_Implicit((Object)(object)self.modelLocator)) { Transform modelTransform = self.modelLocator.modelTransform; modelTransform.localScale *= scaleDebuff; } } private void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffDef); if (Object.op_Implicit((Object)(object)self) && (Object)(object)buffDef == (Object)(object)shrinkDebuff && Object.op_Implicit((Object)(object)self.modelLocator)) { Transform modelTransform = self.modelLocator.modelTransform; modelTransform.localScale /= scaleDebuff; } } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && self.HasBuff(shrinkDebuff)) { self.damage *= 1f - damageDebuff; } } } public class ShrinkRayICDComponent : MonoBehaviour { public float lastHit; } public class Skein : Item { internal static UnlockableDef unlockable; public override ItemTier itemTier => (ItemTier)2; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[2] { (ItemTag)3, (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Maximum damage/knockback to block per stack (hyperbolic).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float highMassFrac { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Maximum speed to add per stack (linear).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float lowMassFracAttack { get; private set; } = 0.3f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Maximum speed to add per stack (linear).", AutoConfigFlags.None, new object[] { 0f, 1f })] public float lowMassFracMove { get; private set; } = 0.4f; [AutoConfigRoOSlider("{0:N0} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Time required to reach maximum buff, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float massChangeDuration { get; private set; } = 5f; [AutoConfigRoOSlider("{0:P0}", 0f, 4f, null, null)] [AutoConfig("Rate at which buffs decay, relative to the charge rate.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float graceRate { get; private set; } = 2f; [AutoConfigRoOSlider("{0:N0} s", 0f, 10f, null, null)] [AutoConfig("Time after being hit to force movement state.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float hitIcd { get; private set; } = 0.25f; public BuffDef speedBuff { get; private set; } public BuffDef resistBuff { get; private set; } public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[6] { highMassFrac.ToString("0%"), lowMassFracMove.ToString("0%"), lowMassFracAttack.ToString("0%"), massChangeDuration.ToString("N0"), graceRate.ToString("0%"), hitIcd.ToString("N2") }; } public Skein() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Skein.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/skeinIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Skein.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.16662f, 0.23603f, -0.2328f), localAngles = new Vector3(283.0797f, 259.6789f, 87.20558f), localScale = new Vector3(0.23f, 0.23f, 0.23f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.21289f, 0.14872f, -0.10543f), localAngles = new Vector3(53.26719f, 171.0046f, 197.6588f), localScale = new Vector3(0.12f, 0.12f, 0.12f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.00118f, 0.178f, -0.28754f), localAngles = new Vector3(359.0837f, 93.76512f, 332.8747f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "SpineChest1", localPos = new Vector3(0.06337f, 1.26103f, -0.69081f), localAngles = new Vector3(2.39033f, 269.3893f, 47.91893f), localScale = new Vector3(4f, 4f, 4f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonHeadR", localPos = new Vector3(-0.18005f, 0.30757f, 0.18712f), localAngles = new Vector3(86.21277f, 286.0484f, 278.2581f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "BowHinge1R", localPos = new Vector3(-0.00901f, 0.15326f, -0.09964f), localAngles = new Vector3(85.83322f, 347.1405f, 331.8423f), localScale = new Vector3(0.45f, 0.45f, 0.45f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechUpperArmR", localPos = new Vector3(-0.15892f, 0.20699f, -0.01099f), localAngles = new Vector3(274.9109f, 12.15518f, 58.75174f), localScale = new Vector3(0.45f, 0.45f, 0.45f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00715f, 0.37187f, -0.16102f), localAngles = new Vector3(358.1779f, 265.442f, 97.43761f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00421f, 0.18537f, -0.31537f), localAngles = new Vector3(358.024f, 269.6058f, 22.69296f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.15033f, 1.48124f, -2.13107f), localAngles = new Vector3(359.6307f, 85.72971f, 269.808f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.14563f, 0.83292f, 0.7369f), localAngles = new Vector3(357.9048f, 91.49792f, 254.4164f), localScale = new Vector3(1.22f, 1.2f, 1.2f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(-0.33099f, -0.03768f, -0.0103f), localAngles = new Vector3(273.8419f, 305.2371f, 146.085f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.00086f, 0.31781f, -0.34701f), localAngles = new Vector3(0.06097f, 89.70734f, 340.4815f), localScale = new Vector3(0.45f, 0.45f, 0.45f) } }); } public override void SetupAttributes() { //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) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); speedBuff = ScriptableObject.CreateInstance(); speedBuff.buffColor = Color.white; speedBuff.canStack = true; speedBuff.isDebuff = false; ((Object)speedBuff).name = "TKSATSkeinSpeed"; speedBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/skeinSpeedBuffIcon.png"); ContentAddition.AddBuffDef(speedBuff); resistBuff = ScriptableObject.CreateInstance(); resistBuff.buffColor = Color.white; resistBuff.canStack = true; resistBuff.isDebuff = false; ((Object)resistBuff).name = "TKSATSkeinResist"; resistBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/skeinResistBuffIcon.png"); ContentAddition.AddBuffDef(resistBuff); unlockable = ScriptableObject.CreateInstance(); unlockable.cachedName = "TkSat_" + name + "Unlockable"; unlockable.sortScore = 200; unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/UnlockIcons/skeinIcon.png"); ContentAddition.AddUnlockableDef(unlockable); base.itemDef.unlockableDef = unlockable; } public override void Install() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Install(); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void Uninstall() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Uninstall(); CharacterBody.onBodyInventoryChangedGlobal -= CharacterBody_onBodyInventoryChangedGlobal; RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { //IL_0046: 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) bool flag = GetCountEffective(body) > 0; SkeinTracker component = ((Component)body).GetComponent(); if (flag && !Object.op_Implicit((Object)(object)component)) { ((Component)body).gameObject.AddComponent(); } else if (!flag && Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); body.SetBuffCount(Item.instance.speedBuff.buffIndex, 0); body.SetBuffCount(Item.instance.resistBuff.buffIndex, 0); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { int countEffective = GetCountEffective(sender); SkeinTracker component = ((Component)sender).GetComponent(); if (countEffective > 0 && Object.op_Implicit((Object)(object)component)) { args.moveSpeedMultAdd += component.GetMovementScalar() * (float)countEffective * lowMassFracMove; args.attackSpeedMultAdd += component.GetMovementScalar() * (float)countEffective * lowMassFracAttack; } } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0071: 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_007c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body)) { int countEffective = GetCountEffective(self.body); SkeinTracker component = ((Component)self).GetComponent(); if (countEffective > 0 && Object.op_Implicit((Object)(object)component)) { float num = 1f - (1f - Mathf.Pow(highMassFrac, (float)countEffective)) * component.GetResistanceScalar(); damageInfo.damage *= num; if (damageInfo.canRejectForce) { damageInfo.force *= num; } component.forcedMovingStopwatch += hitIcd; } } orig.Invoke(self, damageInfo); } } [RequireComponent(typeof(CharacterBody))] public class SkeinTracker : MonoBehaviour { private const float RECALC_TICK_RATE = 0.2f; private float movingStopwatch; private float stoppedStopwatch; private float recalcStopwatch; public float forcedMovingStopwatch; private Vector3 prevPos; private CharacterBody body; public float GetMovementScalar() { return Mathf.Clamp01(movingStopwatch / Item.instance.massChangeDuration); } public float GetResistanceScalar() { return Mathf.Clamp01(stoppedStopwatch / Item.instance.massChangeDuration); } private void Awake() { //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) body = ((Component)this).GetComponent(); prevPos = body.transform.position; } private void FixedUpdate() { //IL_002c: 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_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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_01d6: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !NetworkServer.active) { return; } float num = 0.1f * Time.fixedDeltaTime; Vector3 val = body.transform.position - prevPos; if (((Vector3)(ref val)).sqrMagnitude <= num * num && forcedMovingStopwatch <= 0f) { stoppedStopwatch += Time.fixedDeltaTime; if (stoppedStopwatch > Item.instance.massChangeDuration) { stoppedStopwatch = Item.instance.massChangeDuration; } movingStopwatch -= Time.fixedDeltaTime * Item.instance.graceRate; if (movingStopwatch < 0f) { movingStopwatch = 0f; } } else { if (forcedMovingStopwatch > 0f) { forcedMovingStopwatch -= Time.fixedDeltaTime; } movingStopwatch += Time.fixedDeltaTime; if (movingStopwatch > Item.instance.massChangeDuration) { movingStopwatch = Item.instance.massChangeDuration; } stoppedStopwatch -= Time.fixedDeltaTime * Item.instance.graceRate; if (stoppedStopwatch < 0f) { stoppedStopwatch = 0f; } } prevPos = body.transform.position; recalcStopwatch -= Time.fixedDeltaTime; if (recalcStopwatch <= 0f) { recalcStopwatch = 0.2f; body.statsDirty = true; body.SetBuffCount(Item.instance.resistBuff.buffIndex, Mathf.FloorToInt(GetResistanceScalar() * 100f)); body.SetBuffCount(Item.instance.speedBuff.buffIndex, Mathf.FloorToInt(GetMovementScalar() * 100f)); } } } [RegisterAchievement("TkSat_Skein", "TkSat_SkeinUnlockable", "", 3u, null)] public class TkSatSkeinAchievement : BaseAchievement { private float stopwatch; public override void OnInstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); RoR2Application.Update += new hook_Update(RoR2Application_Update); } public override void OnUninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((BaseAchievement)this).OnUninstall(); RoR2Application.Update -= new hook_Update(RoR2Application_Update); } private void RoR2Application_Update(orig_Update orig, RoR2Application self) { orig.Invoke(self); stopwatch -= Time.deltaTime; if (stopwatch <= 0f) { stopwatch = 1f; if (((BaseAchievement)this).userProfile.HasUnlockable(Defib.unlockable) && ((BaseAchievement)this).userProfile.HasUnlockable(ShootToHeal.unlockable) && ((BaseAchievement)this).userProfile.HasUnlockable(Pinball.unlockable) && ((BaseAchievement)this).userProfile.HasUnlockable(Lodestone.unlockable)) { ((BaseAchievement)this).Grant(); } } } } public class Wrangler : Item { public struct MsgWrangle : INetMessage, ISerializableObject { private CharacterBody _target; public MsgWrangle(CharacterBody target) { _target = target; } public void Deserialize(NetworkReader reader) { GameObject val = reader.ReadGameObject(); if (Object.op_Implicit((Object)(object)val)) { _target = val.GetComponent(); } else { TinkersSatchelPlugin._logger.LogError((object)"Received MsgWrangle for nonexistent or non-networked GameObject"); } } public readonly void Serialize(NetworkWriter writer) { writer.Write(((Component)_target).gameObject); } public readonly void OnReceived() { WranglerReceiverComponent wranglerReceiverComponent = default(WranglerReceiverComponent); if (Object.op_Implicit((Object)(object)_target) && ((Component)_target).TryGetComponent(ref wranglerReceiverComponent)) { wranglerReceiverComponent.ApplyOverride(); } } } private static readonly HashSet validBodyNames = new HashSet(); public override ItemTier itemTier => (ItemTier)2; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); public override bool itemIsAIBlacklisted { get; protected set; } = true; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Extra fire rate applied at 1 stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float baseExtraSpeed { get; private set; } = 0.4f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Extra fire rate applied per additional stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float stackExtraSpeed { get; private set; } = 0.4f; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Armor given to item's holder, per drone per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float ownerArmor { get; private set; } = 15f; [AutoConfigRoOSlider("{0:N0} m", 0f, 1000f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Maximum range (m) before breaking AI override and losing armor bonus.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float wrange { get; private set; } = 150f; [AutoConfigRoOString(null, null)] [AutoConfig("Which object names are allowed for RC Controller behavior (comma-delimited, leading/trailing whitespace will be ignored). WARNING: May have unintended results on some untested objects!", AutoConfigFlags.DeferForever, new object[] { })] public string objectNamesConfig { get; private set; } = string.Join(", ", "Drone1Body", "BackupDroneBody", "FlameDroneBody", "MegaDroneBody", "MissileDroneBody", "Turret1Body", "EngiTurretBody", "SquidTurretBody", "RoboBallGreenBuddyBody", "RoboBallRedBuddyBody"); public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[4] { wrange.ToString("N0"), baseExtraSpeed.ToString("0%"), stackExtraSpeed.ToString("0%"), ownerArmor.ToString("N0") }; } public Wrangler() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Wrangler.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/wranglerIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Wrangler.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MainWeapon", localPos = new Vector3(-0.04371f, 0.46627f, -0.05887f), localAngles = new Vector3(20.04837f, 269.312f, 28.16736f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzleGun", localPos = new Vector3(0.00204f, 0.06189f, -0.02282f), localAngles = new Vector3(8.42397f, 251.936f, 293.6512f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "GunR", localPos = new Vector3(-0.1934f, 0.13084f, 0.05881f), localAngles = new Vector3(289.4016f, 118.0818f, 4.18462f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmL", localPos = new Vector3(-0.88421f, 3.87637f, -1.00819f), localAngles = new Vector3(26.97832f, 314.7427f, 35.86337f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonHeadR", localPos = new Vector3(0.02736f, 0.32489f, 0.26456f), localAngles = new Vector3(309.8985f, 241.7234f, 327.4531f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "BowHinge2R", localPos = new Vector3(-0.04738f, 0.28482f, -0.06068f), localAngles = new Vector3(274.4703f, 36.94548f, 353.5578f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechHandL", localPos = new Vector3(-0.12094f, 0.15992f, 0.10351f), localAngles = new Vector3(21.41251f, 49.257f, 45.67459f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(-0.01649f, 0.01343f, 0.119f), localAngles = new Vector3(21.10289f, 92.18459f, 25.15307f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.02595f, -0.07708f, 0.05505f), localAngles = new Vector3(17.51008f, 90.17065f, 30.29689f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmL", localPos = new Vector3(-0.81568f, 2.08945f, 0.1021f), localAngles = new Vector3(21.27103f, 10.38826f, 33.45565f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "WeaponPlatform", localPos = new Vector3(0.19162f, -0.38473f, 0.26427f), localAngles = new Vector3(12.5555f, 183.4939f, 38.27634f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "TopRail", localPos = new Vector3(-0.05632f, 0.36385f, -0.00769f), localAngles = new Vector3(6.20734f, 94.62246f, 34.09255f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonEnd", localPos = new Vector3(0.33123f, -0.00193f, 0.00388f), localAngles = new Vector3(21.44305f, 193.6561f, 30.63062f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { base.SetupAttributes(); NetworkingAPI.RegisterMessageType(); } public override void SetupConfig() { base.SetupConfig(); validBodyNames.UnionWith(from x in objectNamesConfig.Split(',') select x.Trim() + "(Clone)"); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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 base.Install(); BaseAI.EvaluateSkillDrivers += new hook_EvaluateSkillDrivers(BaseAI_EvaluateSkillDrivers); BaseAI.UpdateBodyAim += new hook_UpdateBodyAim(BaseAI_UpdateBodyAim); BaseAI.UpdateBodyInputs += new hook_UpdateBodyInputs(BaseAI_UpdateBodyInputs); GenericSkill.RunRecharge += new hook_RunRecharge(GenericSkill_RunRecharge); PingerController.SetCurrentPing += new hook_SetCurrentPing(PingerController_SetCurrentPing); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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 base.Uninstall(); BaseAI.EvaluateSkillDrivers -= new hook_EvaluateSkillDrivers(BaseAI_EvaluateSkillDrivers); BaseAI.UpdateBodyAim -= new hook_UpdateBodyAim(BaseAI_UpdateBodyAim); BaseAI.UpdateBodyInputs -= new hook_UpdateBodyInputs(BaseAI_UpdateBodyInputs); GenericSkill.RunRecharge -= new hook_RunRecharge(GenericSkill_RunRecharge); PingerController.SetCurrentPing -= new hook_SetCurrentPing(PingerController_SetCurrentPing); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void PingerController_SetCurrentPing(orig_SetCurrentPing orig, PingerController self, PingInfo newPingInfo) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) PlayerCharacterMasterController val = default(PlayerCharacterMasterController); CharacterBody target = default(CharacterBody); if (((Component)self).TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.body) && GetCountEffective(val.body) > 0 && Object.op_Implicit((Object)(object)((PingInfo)(ref newPingInfo)).targetGameObject) && ((PingInfo)(ref newPingInfo)).targetGameObject.TryGetComponent(ref target)) { NetMessageExtensions.Send((INetMessage)(object)new MsgWrangle(target), (NetworkDestination)2); } orig.Invoke(self, newPingInfo); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { //IL_002e: 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_00bb: 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) if (!Object.op_Implicit((Object)(object)sender)) { return; } int countEffective = GetCountEffective(sender); if (countEffective > 0 && Object.op_Implicit((Object)(object)sender.master)) { MinionGroup val = MinionGroup.FindGroup(((NetworkBehaviour)sender.master).netId); if (val != null) { MinionOwnership[] members = val.members; foreach (MinionOwnership val2 in members) { if (!Object.op_Implicit((Object)(object)val2)) { continue; } CharacterMaster component = ((Component)val2).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { continue; } CharacterBody body = component.GetBody(); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive && validBodyNames.Contains(((Object)body).name)) { Vector3 val3 = body.corePosition - sender.corePosition; if (!(((Vector3)(ref val3)).magnitude > wrange)) { args.armorAdd += ownerArmor * (float)countEffective; } } } } } WranglerReceiverComponent component2 = ((Component)sender).GetComponent(); if (Object.op_Implicit((Object)(object)component2) && component2.cachedWranglerCount > 0) { args.attackSpeedMultAdd += baseExtraSpeed + stackExtraSpeed * (float)(component2.cachedWranglerCount - 1); } } private void GenericSkill_RunRecharge(orig_RunRecharge orig, GenericSkill self, float dt) { if (!Object.op_Implicit((Object)(object)self.characterBody)) { orig.Invoke(self, dt); return; } WranglerReceiverComponent component = ((Component)self.characterBody).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.cachedWranglerCount > 0) { dt *= baseExtraSpeed + stackExtraSpeed * (float)(component.cachedWranglerCount - 1); } orig.Invoke(self, dt); } private void BaseAI_UpdateBodyInputs(orig_UpdateBodyInputs orig, BaseAI self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.body) && self.leader != null) { WranglerReceiverComponent component = ((Component)self.body).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.isWrangled && Object.op_Implicit((Object)(object)self.leader.characterBody)) { bool down = self.leader.characterBody.inputBank.skill1.down; ((ButtonState)(ref self.bodyInputBank.skill1)).PushState(down); ((ButtonState)(ref self.bodyInputBank.skill2)).PushState(down); ((ButtonState)(ref self.bodyInputBank.skill3)).PushState(down); ((ButtonState)(ref self.bodyInputBank.skill4)).PushState(down); ((ButtonState)(ref self.bodyInputBank.activateEquipment)).PushState(down); } } } private SkillDriverEvaluation BaseAI_EvaluateSkillDrivers(orig_EvaluateSkillDrivers orig, BaseAI self) { //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_0015: 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_007d: 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_012e: 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_0128: Unknown result type (might be due to invalid IL or missing references) SkillDriverEvaluation val = orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self.body)) { return val; } WranglerReceiverComponent wranglerReceiverComponent = ((Component)self.body).GetComponent(); if (!Object.op_Implicit((Object)(object)wranglerReceiverComponent) && validBodyNames.Contains(((Object)self.body).name)) { wranglerReceiverComponent = ((Component)self.body).gameObject.AddComponent(); } if (!Object.op_Implicit((Object)(object)wranglerReceiverComponent)) { return val; } if (self.leader == null || !Object.op_Implicit((Object)(object)self.leader.characterBody) || Vector3.Distance(self.body.corePosition, self.leader.characterBody.corePosition) > wrange) { wranglerReceiverComponent.SetWranglerCount(0); } else { wranglerReceiverComponent.SetWranglerCount(GetCountEffective(self.leader.characterBody)); } if (wranglerReceiverComponent.isWrangled) { float num = 1f; if (Object.op_Implicit((Object)(object)self.bodyHealthComponent)) { num = self.bodyHealthComponent.combinedHealthFraction; } AISkillDriver val2 = Array.Find(self.skillDrivers, (AISkillDriver x) => x.customName == "HardLeashToLeader"); if (Object.op_Implicit((Object)(object)val2)) { return self.EvaluateSingleSkillDriver(ref val, val2, num).GetValueOrDefault(val); } } return val; } private void BaseAI_UpdateBodyAim(orig_UpdateBodyAim orig, BaseAI self, float deltaTime) { //IL_007d: 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_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_0095: 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) if (!Object.op_Implicit((Object)(object)self.body) || self.leader == null) { orig.Invoke(self, deltaTime); return; } WranglerReceiverComponent component = ((Component)self.body).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.isWrangled && Object.op_Implicit((Object)(object)self.leader.characterBody)) { WranglerSenderComponent wranglerSenderComponent = ((Component)self.leader.characterBody).GetComponent(); if (!Object.op_Implicit((Object)(object)wranglerSenderComponent)) { wranglerSenderComponent = self.leader.gameObject.AddComponent(); } ref BodyInputs bodyInputs = ref self.bodyInputs; Vector3 val = wranglerSenderComponent.cachedAimPosition - self.bodyInputBank.aimOrigin; bodyInputs.desiredAimDirection = ((Vector3)(ref val)).normalized; } orig.Invoke(self, deltaTime); } } [RequireComponent(typeof(CharacterBody))] public class WranglerReceiverComponent : MonoBehaviour { private GameObject laserObj; private LineRenderer laser; private CharacterBody body; private static readonly Color LASER_COLOR = Color.cyan; private const float SEEK_RANGE = 200f; private float lasWidth; private bool _hasStacks; private bool _wrangleToggle; public int cachedWranglerCount { get; private set; } public bool isWrangled { get { if (_hasStacks) { return _wrangleToggle; } return false; } } private void Awake() { //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_007f: 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) body = ((Component)this).GetComponent(); laserObj = Object.Instantiate(ChargeLaser.laserPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); laserObj.transform.parent = ((Component)this).transform; laser = laserObj.GetComponent(); laser.startWidth = 0f; laser.endWidth = 0f; laser.startColor = LASER_COLOR; laser.endColor = LASER_COLOR; } private void Update() { //IL_004f: 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_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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00b8: 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_00a3: Unknown result type (might be due to invalid IL or missing references) lasWidth = (isWrangled ? 0.05f : 0f); laser.startWidth = lasWidth; laser.endWidth = lasWidth; if (isWrangled) { Ray aimRay = body.inputBank.GetAimRay(); Vector3 aimOrigin = body.aimOrigin; Vector3 point = ((Ray)(ref aimRay)).GetPoint(200f); RaycastHit val = default(RaycastHit); if (Physics.Raycast(aimRay, ref val, 200f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask))) { point = ((RaycastHit)(ref val)).point; } laser.SetPosition(0, aimOrigin); laser.SetPosition(1, point); } } public void SetWranglerCount(int count) { if (cachedWranglerCount != count) { body.MarkAllStatsDirty(); } cachedWranglerCount = count; _hasStacks = count > 0; } public void ApplyOverride() { _wrangleToggle = !_wrangleToggle; } } [RequireComponent(typeof(CharacterBody))] public class WranglerSenderComponent : MonoBehaviour { private CharacterBody body; private const float SEEK_RANGE = 500f; public Vector3 cachedAimPosition { get; private set; } private void FixedUpdate() { //IL_0026: 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) //IL_004b: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { body = ((Component)this).GetComponent(); } Ray val = default(Ray); ((Ray)(ref val))..ctor(body.inputBank.aimOrigin, body.inputBank.aimDirection); RaycastHit val2 = default(RaycastHit); if (Util.CharacterRaycast(((Component)body).gameObject, val, ref val2, 500f, LayerMask.op_Implicit(LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)), (QueryTriggerInteraction)1)) { cachedAimPosition = ((RaycastHit)(ref val2)).point; } else { cachedAimPosition = ((Ray)(ref val)).GetPoint(500f); } } } public class ObsidianBrooch : Item { public override ItemTier itemTier => (ItemTier)6; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[2] { (ItemTag)1, (ItemTag)3 }); [AutoConfigRoOSlider("{0:N1}%", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Chance to trigger the effect. Effect can proc once per stack.", AutoConfigFlags.None, new object[] { 0f, 100f })] public float procChance { get; private set; } = 9f; [AutoConfigRoOSlider("{0:N0} m", 0f, 300f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Range to spread debuffs within.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float range { get; private set; } = 50f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[2] { (procChance / 100f).ToString("0%"), range.ToString("N0") }; } public ObsidianBrooch() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/ObsidianBrooch.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/obsidianBroochIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/ObsidianBrooch.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ClavicleL", localPos = new Vector3(0.00602f, 0.02158f, -0.05845f), localAngles = new Vector3(326.667f, 46.21878f, 309.2319f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "ClavicleL", localPos = new Vector3(0.17638f, 0.01995f, -0.04308f), localAngles = new Vector3(337.2352f, 25.6461f, 235.3091f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.11596f, 0.3307f, 0.15588f), localAngles = new Vector3(48.1331f, 358.3615f, 4.73243f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(0.87653f, 2.20273f, -1.89499f), localAngles = new Vector3(305.9784f, 11.63596f, 346.6215f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.14702f, 0.28206f, 0.22331f), localAngles = new Vector3(60.55042f, 51.2736f, 61.50257f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.02351f, 0.27867f, 0.14293f), localAngles = new Vector3(71.33205f, 332.5947f, 340.854f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(-0.00905f, 0.33928f, 0.44833f), localAngles = new Vector3(24.38f, 89.76019f, 89.72921f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.07183f, 0.24613f, 0.09748f), localAngles = new Vector3(6.03906f, 119.3976f, 52.03307f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.00041f, 0.26526f, 0.1553f), localAngles = new Vector3(59.80264f, 330.3053f, 336.2152f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.06301f, 0.91131f, 3.20592f), localAngles = new Vector3(75.99412f, 123.6586f, 127.9823f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(0.02898f, 0.3296f, 0.91459f), localAngles = new Vector3(63.96839f, 3.05332f, 351.5714f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(-0.07887f, 0.26481f, 0.29013f), localAngles = new Vector3(343.4581f, 64.80383f, 45.3977f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-0.00866f, 0.1104f, 0.20984f), localAngles = new Vector3(55.8921f, 64.53103f, 55.9848f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); } public override void SetupAttributes() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.SetupAttributes(); ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_001c: 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_0041: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val = ScriptableObject.CreateInstance(); val.relationshipType = ItemRelationshipTypes.ContagiousItem; val.relationships = (Pair[])(object)new Pair[1] { new Pair { itemDef1 = Item.instance.itemDef, itemDef2 = base.itemDef } }; orig.Invoke(providers.Concat((IEnumerable)(object)new ItemRelationshipProvider[1] { val }).ToArray()); }; } public override void SetupBehavior() { base.SetupBehavior(); base.itemDef.unlockableDef = TriBrooch.unlockable; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0039: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_01c0: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (!NetworkServer.active || damageInfo == null || !Object.op_Implicit((Object)(object)damageInfo.attacker) || DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)67108864)) != 0L || (disableSelfDamage && (Object)(object)damageInfo.attacker == (Object)(object)((Component)self).gameObject)) { return; } DotController val = DotController.FindDotController(((Component)self).gameObject); if (!Object.op_Implicit((Object)(object)val) || val.dotStackList.Count <= 0) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); int countEffective = GetCountEffective(component); if (countEffective <= 0) { return; } GameObject[] array = (from x in CommonCode.GatherEnemies(component.teamComponent.teamIndex, default(TeamIndex)) select CommonCode.GetRootWithLocators(((Component)x).gameObject)).Where(delegate(GameObject obj) { //IL_002d: 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_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) HealthComponent component2 = obj.GetComponent(); if (!Object.op_Implicit((Object)(object)component2) || !component2.alive || (Object)(object)component2 == (Object)(object)self) { return false; } Vector3 val5 = obj.transform.position - ((Component)self).transform.position; return (!(((Vector3)(ref val5)).magnitude > range)) ? true : false; }).ToArray(); if (array.Length == 0) { return; } for (int i = 0; i < countEffective; i++) { float num = procChance; CharacterMaster master = component.master; if (Util.CheckRoll(num, (master != null) ? master.luck : 0f, component.master)) { GameObject victimObject = base.rng.NextElementUniform(array); DotStack val2 = base.rng.NextElementUniform(val.dotStackList); InflictDotInfo val3 = default(InflictDotInfo); val3.attackerObject = damageInfo.attacker; val3.victimObject = victimObject; val3.duration = val2.timer; val3.dotIndex = val2.dotIndex; val3.totalDamage = val2.damage; val3.damageMultiplier = 1f; InflictDotInfo val4 = val3; DotController.InflictDot(ref val4); } } } } public class TimelostRum : Item { public int ignoreStack; public List<(BulletAttack bi, float timestamp, float delay)> delayedBulletAttacks = new List<(BulletAttack, float, float)>(); public List<(FireProjectileInfo fpi, float timestamp, float delay)> delayedProjectiles = new List<(FireProjectileInfo, float, float)>(); public List<(DamageInfo di, HealthComponent victim, float timestamp, float delay)> delayedMeleeHits = new List<(DamageInfo, HealthComponent, float, float)>(); public override ItemTier itemTier => (ItemTier)6; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:N1} s", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Delay per extra hit.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float delayTime { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Extra hit chance per item.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float procChance { get; private set; } = 0.1f; [AutoConfigRoOSlider("{0:P0}", 0f, 2f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Damage modifier for melee attacks.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float meleeDamage { get; private set; } = 0.25f; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { procChance.ToString("0%"), delayTime.ToString("N0"), meleeDamage.ToString("0%") }; } public TimelostRum() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/TimelostRum.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/timelostRumIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/TimelostRum.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.13119f, -0.06393f, 0.16501f), localAngles = new Vector3(346.8067f, 149.1297f, 148.1501f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.2665f, 0.11811f, -0.16573f), localAngles = new Vector3(22.71485f, 296.1542f, 2.15007f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.18271f, 0.07455f, 0.18935f), localAngles = new Vector3(341.6932f, 224.9207f, 311.7038f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-2.63318f, 1.12878f, -0.76901f), localAngles = new Vector3(338.0058f, 81.70578f, 309.2676f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.14437f, -0.07553f, 0.19465f), localAngles = new Vector3(10.26335f, 206.6532f, 332.7241f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-0.11582f, -0.02862f, 0.15584f), localAngles = new Vector3(39.45496f, 143.1629f, 354.4092f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.10281f, 0.05827f, 0.18212f), localAngles = new Vector3(21.50457f, 126.9122f, 37.36323f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-0.12145f, -0.01252f, 0.16036f), localAngles = new Vector3(18.989f, 142.332f, 10.45503f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-0.14285f, -0.05033f, 0.13735f), localAngles = new Vector3(23.13149f, 126.7038f, 336.1982f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-1.24654f, 3.66212f, -2.11572f), localAngles = new Vector3(60.13687f, 53.0797f, 164.6161f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FlowerBase", localPos = new Vector3(0.75783f, 0.7607f, 0.26494f), localAngles = new Vector3(51.73802f, 240.3004f, 148.5376f), localScale = new Vector3(0.7f, 0.7f, 0.7f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(0.41541f, -0.09895f, -0.00461f), localAngles = new Vector3(10.09852f, 293.4927f, 1.29182f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.17329f, 0.23201f, 0.15111f), localAngles = new Vector3(60.5887f, 239.5703f, 206.8694f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); } public override void SetupAttributes() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.SetupAttributes(); ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_001c: 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_0041: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val = ScriptableObject.CreateInstance(); val.relationshipType = ItemRelationshipTypes.ContagiousItem; val.relationships = (Pair[])(object)new Pair[1] { new Pair { itemDef1 = Item.instance.itemDef, itemDef2 = base.itemDef } }; orig.Invoke(providers.Concat((IEnumerable)(object)new ItemRelationshipProvider[1] { val }).ToArray()); }; } public override void SetupBehavior() { base.SetupBehavior(); base.itemDef.unlockableDef = Item.instance.unlockable; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown base.Install(); ProjectileManager.FireProjectile_FireProjectileInfo += new hook_FireProjectile_FireProjectileInfo(ProjectileManager_FireProjectile_FireProjectileInfo); BulletAttack.Fire += new hook_Fire(BulletAttack_Fire); Run.FixedUpdate += new hook_FixedUpdate(Run_FixedUpdate); OverlapAttack.PerformDamage += new Manipulator(OverlapAttack_PerformDamage); ArrowRain.DoFireArrowRain += new hook_DoFireArrowRain(ArrowRain_DoFireArrowRain); AimThrowableBase.FireProjectile += new hook_FireProjectile(AimThrowableBase_FireProjectile); FireMortar2.Fire += new hook_Fire(FireMortar2_Fire); MissileUtils.FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool += new hook_FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool(MissileUtils_FireMissile_MyKingdomForAStruct); TreebotFireFruitSeed.OnEnter += new hook_OnEnter(TreebotFireFruitSeed_OnEnter); PrepWall.OnExit += new hook_OnExit(PrepWall_OnExit); CreatePounder.OnExit += new hook_OnExit(CreatePounder_OnExit); AimFlower.FireProjectile += new hook_FireProjectile(AimFlower_FireProjectile); FireFlower2.OnEnter += new hook_OnEnter(FireFlower2_OnEnter); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath); FireMainBeamState.OnExit += new hook_OnExit(FireMainBeamState_OnExit); BaseThrowBombState.Fire += new hook_Fire(BaseThrowBombState_Fire); GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy); EquipmentSlot.FireGummyClone += new hook_FireGummyClone(EquipmentSlot_FireGummyClone); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown base.Uninstall(); ProjectileManager.FireProjectile_FireProjectileInfo -= new hook_FireProjectile_FireProjectileInfo(ProjectileManager_FireProjectile_FireProjectileInfo); BulletAttack.Fire -= new hook_Fire(BulletAttack_Fire); Run.FixedUpdate -= new hook_FixedUpdate(Run_FixedUpdate); ArrowRain.DoFireArrowRain -= new hook_DoFireArrowRain(ArrowRain_DoFireArrowRain); AimThrowableBase.FireProjectile -= new hook_FireProjectile(AimThrowableBase_FireProjectile); FireMortar2.Fire -= new hook_Fire(FireMortar2_Fire); MissileUtils.FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool -= new hook_FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool(MissileUtils_FireMissile_MyKingdomForAStruct); TreebotFireFruitSeed.OnEnter -= new hook_OnEnter(TreebotFireFruitSeed_OnEnter); PrepWall.OnExit -= new hook_OnExit(PrepWall_OnExit); CreatePounder.OnExit -= new hook_OnExit(CreatePounder_OnExit); AimFlower.FireProjectile -= new hook_FireProjectile(AimFlower_FireProjectile); FireFlower2.OnEnter -= new hook_OnEnter(FireFlower2_OnEnter); GlobalEventManager.OnCharacterDeath -= new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath); FireMainBeamState.OnExit -= new hook_OnExit(FireMainBeamState_OnExit); BaseThrowBombState.Fire -= new hook_Fire(BaseThrowBombState_Fire); GlobalEventManager.OnHitEnemy -= new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy); EquipmentSlot.FireGummyClone -= new hook_FireGummyClone(EquipmentSlot_FireGummyClone); } private void Run_FixedUpdate(orig_FixedUpdate orig, Run self) { //IL_0104: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (ignoreStack > 0) { TinkersSatchelPlugin._logger.LogError((object)"TimelostRum: ignoreStack was not empty on new frame, clearing. May be a cascading effect of another error, or a mod may be misusing ignoreStack."); ignoreStack = 0; } ignoreStack++; for (int num = delayedBulletAttacks.Count - 1; num >= 0; num--) { if (delayedBulletAttacks[num].bi == null) { delayedBulletAttacks.RemoveAt(num); } else if (Time.fixedTime - delayedBulletAttacks[num].timestamp > delayedBulletAttacks[num].delay) { delayedBulletAttacks[num].bi.Fire(); delayedBulletAttacks.RemoveAt(num); } } for (int num2 = delayedProjectiles.Count - 1; num2 >= 0; num2--) { if (Time.fixedTime - delayedProjectiles[num2].timestamp > delayedProjectiles[num2].delay) { ProjectileManager.instance.FireProjectile(delayedProjectiles[num2].fpi); delayedProjectiles.RemoveAt(num2); } } for (int num3 = delayedMeleeHits.Count - 1; num3 >= 0; num3--) { if (Time.fixedTime - delayedMeleeHits[num3].timestamp > delayedMeleeHits[num3].delay) { delayedMeleeHits[num3].victim.TakeDamage(delayedMeleeHits[num3].di); delayedMeleeHits.RemoveAt(num3); } } ignoreStack--; } private void BulletAttack_Fire(orig_Fire orig, BulletAttack self) { //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) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0113: 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_011d: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022d: 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_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_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Expected O, but got Unknown //IL_00d3: 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) orig.Invoke(self); if (ignoreStack > 0 || !Object.op_Implicit((Object)(object)self.owner)) { return; } CharacterBody component = self.owner.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } int countEffective = GetCountEffective(component); if (countEffective <= 0) { return; } float num = (float)countEffective * procChance; int num2 = (Util.CheckRoll(MathUtil.Wrap(num * 100f, 0f, 100f), component.master) ? 1 : 0) + (int)Mathf.Floor(num); Vector3 origin = self.origin; ModelLocator val = default(ModelLocator); ChildLocator val2 = default(ChildLocator); if (Object.op_Implicit((Object)(object)self.weapon) && self.weapon.TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.modelTransform) && ((Component)val.modelTransform).TryGetComponent(ref val2)) { Transform val3 = val2.FindChild(self.muzzleName); if (Object.op_Implicit((Object)(object)val3)) { origin = val3.position; } } for (int i = 1; i <= num2; i++) { delayedBulletAttacks.Add((new BulletAttack { aimVector = self.aimVector, bulletCount = self.bulletCount, damage = self.damage, damageColorIndex = self.damageColorIndex, damageType = self.damageType, falloffModel = self.falloffModel, filterCallback = self.filterCallback, force = self.force, hitCallback = self.hitCallback, HitEffectNormal = self.HitEffectNormal, hitEffectPrefab = self.hitEffectPrefab, hitMask = self.hitMask, isCrit = self.isCrit, maxDistance = self.maxDistance, maxSpread = self.maxSpread, minSpread = self.minSpread, modifyOutgoingDamageCallback = self.modifyOutgoingDamageCallback, muzzleName = self.muzzleName, origin = origin, owner = self.owner, procChainMask = self.procChainMask, procCoefficient = self.procCoefficient, queryTriggerInteraction = self.queryTriggerInteraction, radius = self.radius, smartCollision = self.smartCollision, sniper = self.sniper, spreadPitchScale = self.spreadPitchScale, spreadYawScale = self.spreadYawScale, stopperMask = self.stopperMask, tracerEffectPrefab = self.tracerEffectPrefab, weapon = CommonCode.worldSpaceWeaponDummy }, Time.fixedTime, (float)i * delayTime)); } } private void ProjectileManager_FireProjectile_FireProjectileInfo(orig_FireProjectile_FireProjectileInfo orig, ProjectileManager self, FireProjectileInfo fireProjectileInfo) { //IL_0002: 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_0026: 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_0046: 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) orig.Invoke(self, fireProjectileInfo); if (ignoreStack > 0 || !Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)fireProjectileInfo.owner) || !Object.op_Implicit((Object)(object)fireProjectileInfo.projectilePrefab) || Object.op_Implicit((Object)(object)fireProjectileInfo.projectilePrefab.GetComponent())) { return; } CharacterBody component = fireProjectileInfo.owner.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } int countEffective = GetCountEffective(component); if (countEffective > 0) { float num = (float)countEffective * procChance; int num2 = (Util.CheckRoll(MathUtil.Wrap(num * 100f, 0f, 100f), component.master) ? 1 : 0) + (int)Mathf.Floor(num); for (int i = 1; i <= num2; i++) { delayedProjectiles.Add((fireProjectileInfo, Time.fixedTime, (float)i * delayTime)); } } } private void OverlapAttack_PerformDamage(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0048: 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 i) => ILPatternMatchingExt.MatchCallOrCallvirt(i, "TakeDamage") }); int index = val.Index; val.Index = index - 1; val.Emit(OpCodes.Dup); val.GotoNext((MoveType)0, new Func[1] { (Instruction i) => ILPatternMatchingExt.MatchCallOrCallvirt(i, "TakeDamage") }); val.EmitDelegate>((Func)delegate(HealthComponent victim, DamageInfo di) { //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_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_009c: 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_00bd: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00df: 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_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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown CharacterBody val2 = default(CharacterBody); if (ignoreStack == 0 && Object.op_Implicit((Object)(object)di.attacker) && di.attacker.TryGetComponent(ref val2)) { int countEffective = GetCountEffective(val2); if (countEffective > 0) { float num = (float)countEffective * procChance; int num2 = (Util.CheckRoll(MathUtil.Wrap(num * 100f, 0f, 100f), val2.master) ? 1 : 0) + (int)Mathf.Floor(num); DamageInfo item = new DamageInfo { attacker = di.attacker, inflictor = di.inflictor, force = di.force, damage = di.damage * meleeDamage, crit = di.crit, position = di.position, procChainMask = di.procChainMask, procCoefficient = di.procCoefficient, damageColorIndex = di.damageColorIndex, damageType = di.damageType }; for (int j = 1; j <= num2; j++) { delayedMeleeHits.Add((item, victim, Time.fixedTime, (float)j * delayTime)); } } } return di; }); } private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { ignoreStack++; orig.Invoke(self, damageInfo, victim); ignoreStack--; } private void BaseThrowBombState_Fire(orig_Fire orig, BaseThrowBombState self) { int num; if (!(self is ThrowLunarSecondary)) { num = ((self is ThrowIcebomb) ? 1 : 0); if (num == 0) { goto IL_0025; } } else { num = 1; } ignoreStack++; goto IL_0025; IL_0025: orig.Invoke(self); if (num != 0) { ignoreStack--; } } private void FireMainBeamState_OnExit(orig_OnExit orig, FireMainBeamState self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void GlobalEventManager_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { ignoreStack++; orig.Invoke(self, damageReport); ignoreStack--; } private void FireFlower2_OnEnter(orig_OnEnter orig, FireFlower2 self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void AimFlower_FireProjectile(orig_FireProjectile orig, AimFlower self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void TreebotFireFruitSeed_OnEnter(orig_OnEnter orig, TreebotFireFruitSeed self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void PrepWall_OnExit(orig_OnExit orig, PrepWall self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void CreatePounder_OnExit(orig_OnExit orig, CreatePounder self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void ArrowRain_DoFireArrowRain(orig_DoFireArrowRain orig, ArrowRain self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private void MissileUtils_FireMissile_MyKingdomForAStruct(orig_FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool orig, Vector3 position, CharacterBody attackerBody, ProcChainMask procChainMask, GameObject victim, float missileDamage, bool isCrit, GameObject projectilePrefab, DamageColorIndex damageColorIndex, Vector3 initialDirection, float force, bool addMissileProc) { //IL_000f: 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_001b: 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) ignoreStack++; orig.Invoke(position, attackerBody, procChainMask, victim, missileDamage, isCrit, projectilePrefab, damageColorIndex, initialDirection, force, addMissileProc); ignoreStack--; } private void AimThrowableBase_FireProjectile(orig_FireProjectile orig, AimThrowableBase self) { int num; if (!(self is AimMortar2)) { num = ((self is CallAirstrikeBase) ? 1 : 0); if (num == 0) { goto IL_0025; } } else { num = 1; } ignoreStack++; goto IL_0025; IL_0025: orig.Invoke(self); if (num != 0) { ignoreStack--; } } private void FireMortar2_Fire(orig_Fire orig, FireMortar2 self) { ignoreStack++; orig.Invoke(self); ignoreStack--; } private bool EquipmentSlot_FireGummyClone(orig_FireGummyClone orig, EquipmentSlot self) { ignoreStack++; bool result = orig.Invoke(self); ignoreStack--; return result; } } public class VillainousVisage : Item { public Sprite buffIconResource; public override ItemTier itemTier => (ItemTier)6; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Fractional stealth attack damage bonus per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageFrac { get; private set; } = 0.13f; [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Duration of the stealth buff once triggered.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float buffDuration { get; private set; } = 1.3f; [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public BuffDef activeBuff { get; private set; } public BuffDef minStealthBuff { get; private set; } public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[2] { buffDuration.ToString("N0"), damageFrac.ToString("0%") }; } public VillainousVisage() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/EnterCombatDamage.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/enterCombatDamageIcon.png"); buffIconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/enterCombatDamageBuff.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/EnterCombatDamage.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Expected O, but got Unknown //IL_07a1: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_080a: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Expected O, but got Unknown //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08c9: Expected O, but got Unknown //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_0934: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.00501f, -0.00193f, 0.12535f), localAngles = new Vector3(358.3085f, 4.25592f, 0.28647f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.0005f, -0.0129f, 0.15562f), localAngles = new Vector3(11.92738f, 0.11231f, 359.9818f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.00029f, 0.16431f, 0.19222f), localAngles = new Vector3(5.89388f, 0.02066f, 359.9918f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.03406f, 5.18621f, 0.31968f), localAngles = new Vector3(289.403f, 178.8767f, 359.7504f), localScale = new Vector3(4f, 4f, 4f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(-0.00107f, -0.06354f, 0.16326f), localAngles = new Vector3(356.9086f, 0.00055f, 359.9797f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.00055f, -0.08314f, 0.13153f), localAngles = new Vector3(5.91824f, 0.01733f, 359.9877f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.00113f, 0.02785f, 0.15536f), localAngles = new Vector3(9.7558f, 357.37f, 0.27498f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.00026f, -0.05488f, 0.12542f), localAngles = new Vector3(12.64564f, 358.3316f, 0.90731f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HeadCenter", localPos = new Vector3(0.00025f, -0.06431f, 0.13606f), localAngles = new Vector3(346.3878f, 359.941f, 0.00644f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0.09223f, 2.98203f, -1.31453f), localAngles = new Vector3(8.1579f, 183.8814f, 4.21555f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(-0.00084f, -0.57127f, 0.37927f), localAngles = new Vector3(59.53689f, 0f, 0f), localScale = new Vector3(1f, 1f, 1f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FlowerBase", localPos = new Vector3(0.23973f, 0.54818f, 0.99367f), localAngles = new Vector3(16.77598f, 14.84138f, 359.2693f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(0f, 0.0247f, 0.1245f), localAngles = new Vector3(24.01353f, 0f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Head", localPos = new Vector3(-0.07638f, 0.04526f, 0.18096f), localAngles = new Vector3(0.561f, 321.2224f, 349.0082f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { //IL_0026: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown base.SetupAttributes(); activeBuff = ScriptableObject.CreateInstance(); activeBuff.buffColor = new Color(0.85f, 0.2f, 0.2f); activeBuff.canStack = false; activeBuff.isDebuff = false; ((Object)activeBuff).name = "TKSATVillainousVisageActive"; activeBuff.iconSprite = buffIconResource; ContentAddition.AddBuffDef(activeBuff); minStealthBuff = ScriptableObject.CreateInstance(); minStealthBuff.canStack = false; minStealthBuff.isDebuff = false; ((Object)minStealthBuff).name = "TKSATVillainousVisageIcd"; minStealthBuff.isHidden = true; ContentAddition.AddBuffDef(minStealthBuff); ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_001c: 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_0041: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val = ScriptableObject.CreateInstance(); val.relationshipType = ItemRelationshipTypes.ContagiousItem; val.relationships = (Pair[])(object)new Pair[1] { new Pair { itemDef1 = Item.instance.itemDef, itemDef2 = base.itemDef } }; orig.Invoke(providers.Concat((IEnumerable)(object)new ItemRelationshipProvider[1] { val }).ToArray()); }; } public override void SetupBehavior() { base.SetupBehavior(); base.itemDef.unlockableDef = Moustache.unlockable; } public override void Install() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void Uninstall() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); GlobalEventManager.onCharacterDeathGlobal -= GlobalEventManager_onCharacterDeathGlobal; HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport) { if (Object.op_Implicit((Object)(object)damageReport.attackerMaster) && GetCountEffective(damageReport.attackerMaster) > 0 && (damageReport.victimIsBoss || damageReport.victimIsChampion || damageReport.victimIsElite)) { CharacterBody body = damageReport.attackerMaster.GetBody(); if (Object.op_Implicit((Object)(object)body)) { body.AddTimedBuff(Buffs.Cloak, buffDuration); body.AddTimedBuff(activeBuff, buffDuration); body.AddTimedBuff(minStealthBuff, 0.13f); } } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { CharacterBody val = default(CharacterBody); if (Object.op_Implicit((Object)(object)self) && damageInfo != null && Object.op_Implicit((Object)(object)damageInfo.attacker) && (!disableSelfDamage || (Object)(object)damageInfo.attacker != (Object)(object)((Component)self).gameObject) && damageInfo.attacker.TryGetComponent(ref val) && val.HasBuff(activeBuff) && !val.HasBuff(minStealthBuff)) { val.ClearTimedBuffs(activeBuff); val.ClearTimedBuffs(Buffs.Cloak); damageInfo.damage *= 1f + (float)GetCountEffective(val) * damageFrac; } orig.Invoke(self, damageInfo); } } public class BrambleRing : Item { public ModdedDamageType damageType; public override ItemTier itemTier => (ItemTier)7; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:P0}", 0f, 0.999f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Amount of damage to reflect. Will be doubled by bleed proc. Stacks hyperbolically.", AutoConfigFlags.None, new object[] { 0f, 0.999f })] public float damageFrac { get; private set; } = 0.125f; [AutoConfigRoOSlider("{0:P0}", 0f, 0.999f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Amount of damage to convert to barrier. Stacks hyperbolically.", AutoConfigFlags.None, new object[] { 0f, 0.999f })] public float barrierFrac { get; private set; } = 0.125f; [AutoConfigRoOSlider("{0:P0}", 0f, 4f, null, null)] [AutoConfig("Multiplier to damageFrac vs players.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float vsPlayerScaling { get; private set; } = 0.25f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of the retaliation attack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } [AutoConfigRoOCheckbox(null, null)] [AutoConfig("If true, self-damage will not proc this item.", AutoConfigFlags.None, new object[] { })] public bool disableSelfDamage { get; private set; } = true; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[2] { damageFrac.ToString("0%"), barrierFrac.ToString("0%") }; } public BrambleRing() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/BrambleRing.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/brambleRingIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/BrambleRing.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.0437f, 0.12845f, -0.01743f), localAngles = new Vector3(270.0839f, 334.7889f, 0f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.03648f, 0.18758f, -0.00522f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.01785f, 0.16431f, 0.01802f), localAngles = new Vector3(330.1184f, 4.00532f, 351.3972f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Finger21L", localPos = new Vector3(-0.00153f, 0.36557f, 0.01404f), localAngles = new Vector3(13.40797f, 29.89699f, 356.7747f), localScale = new Vector3(1.4f, 1.4f, 1.4f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.01245f, 0.17834f, -0.0126f), localAngles = new Vector3(332.5649f, 350.0944f, 10.69863f), localScale = new Vector3(0.08f, 0.08f, 0.08f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.02588f, 0.13494f, -0.05978f), localAngles = new Vector3(313.258f, 261.7107f, 87.99889f), localScale = new Vector3(0.05f, 0.05f, 0.05f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechHandL", localPos = new Vector3(-0.02166f, 0.31159f, 0.0611f), localAngles = new Vector3(2.51191f, 75.04926f, 333.3042f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(0.01728f, 0.1692f, -0.02313f), localAngles = new Vector3(327.2125f, 18.24322f, 166.5908f), localScale = new Vector3(0.04f, 0.04f, 0.04f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(-0.03269f, 0.16912f, 0.01925f), localAngles = new Vector3(323.6763f, 241.3513f, 106.1961f), localScale = new Vector3(0.05f, 0.05f, 0.05f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Finger21R", localPos = new Vector3(0.03214f, 0.65431f, 0.06196f), localAngles = new Vector3(352.9313f, 353.4738f, 339.2639f), localScale = new Vector3(1f, 1f, 1f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "FootFrontL", localPos = new Vector3(0.01097f, 0.28171f, 0.02874f), localAngles = new Vector3(3.52974f, 348.55f, 352.2132f), localScale = new Vector3(0.7f, 0.7f, 0.7f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandR", localPos = new Vector3(-0.01874f, 0.12282f, -0.0035f), localAngles = new Vector3(296.2707f, 22.61896f, 82.80862f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "RingFinger", localPos = new Vector3(0.00702f, 0.04274f, 0.00275f), localAngles = new Vector3(3.66348f, 8.43588f, 5.24985f), localScale = new Vector3(0.06f, 0.06f, 0.06f) } }); } public override void SetupAttributes() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //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) base.SetupAttributes(); ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_001c: 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_0041: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val = ScriptableObject.CreateInstance(); val.relationshipType = ItemRelationshipTypes.ContagiousItem; val.relationships = (Pair[])(object)new Pair[1] { new Pair { itemDef1 = Item.instance.itemDef, itemDef2 = base.itemDef } }; orig.Invoke(providers.Concat((IEnumerable)(object)new ItemRelationshipProvider[1] { val }).ToArray()); }; damageType = DamageAPI.ReserveDamageType(); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Invalid comparison between Unknown and I4 //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) //IL_0102: 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) //IL_010c: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_018b: 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_01a6: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)self) || !self.alive || (disableSelfDamage && Object.op_Implicit((Object)(object)damageInfo.attacker) && (Object)(object)damageInfo.attacker == (Object)(object)((Component)self).gameObject)) { orig.Invoke(self, damageInfo); return; } float barrier = self.barrier; orig.Invoke(self, damageInfo); int countEffective = GetCountEffective(self.body); if (countEffective > 0) { float num = self.barrier - barrier; HealthComponent val = default(HealthComponent); if (num < 0f && Object.op_Implicit((Object)(object)damageInfo.attacker) && !DamageAPI.HasModdedDamageType(damageInfo, damageType) && damageInfo.attacker.TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.body)) { TeamIndex objectTeam = TeamComponent.GetObjectTeam(damageInfo.attacker); float num2 = Mathf.Clamp01(1f - 1f / (1f + damageFrac * (((int)objectTeam == 1) ? vsPlayerScaling : 1f) * (float)countEffective)); GenericDamageOrb val2 = new GenericDamageOrb { origin = damageInfo.position, damageValue = num * num2, damageType = default(DamageTypeCombo), isCrit = false, teamIndex = self.body.teamComponent.teamIndex, attacker = ((Component)self).gameObject, target = val.body.mainHurtBox, procCoefficient = procCoefficient, procChainMask = default(ProcChainMask), damageColorIndex = (DamageColorIndex)3, duration = 0.1f }; DamageAPI.AddModdedDamageType(val2, damageType); OrbManager.instance.AddOrb((Orb)(object)val2); EffectData val3 = new EffectData { origin = damageInfo.position, genericFloat = 0.1f }; val3.SetHurtBoxReference(val.body.mainHurtBox); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/OrbEffects/VoidLightningOrbEffect"), val3, true); DotController.InflictDot(damageInfo.attacker, ((Component)self).gameObject, val.body.mainHurtBox, (DotIndex)0, 3f, num * num2 / self.body.damage, (uint?)null); } self.AddBarrier(damageInfo.damage * Mathf.Clamp01(1f - 1f / (1f + barrierFrac * (float)countEffective))); } } } public class OrderedArmor : Item { public override ItemTier itemTier => (ItemTier)7; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)2 }); [AutoConfigRoOSlider("{0:N0}", 0f, 5000f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Armor given at minimum item type variety (1).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float armorAmtBase { get; private set; } = 100f; [AutoConfigRoOSlider("{0:P0}", 0f, 0.999f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Multiplier of armor scaling per additional item type (higher = less penalty).", AutoConfigFlags.None, new object[] { 0f, 0.999f })] public float varietyExp { get; private set; } = 0.975f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Linear multiplier for increased ArmorAmt per stack (higher = more powerful).", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float armorStacking { get; private set; } = 0.25f; public BuffDef statusBuff { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[3] { armorAmtBase.ToString("N0"), armorStacking.ToString("0%"), (1f - varietyExp).ToString("0%") }; } public OrderedArmor() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/OrderedArmor.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/orderedArmorIcon.png"); } public override void SetupAttributes() { //IL_0026: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown base.SetupAttributes(); statusBuff = ScriptableObject.CreateInstance(); statusBuff.buffColor = new Color(0.35f, 0.15f, 0.65f); statusBuff.canStack = true; statusBuff.isDebuff = false; ((Object)statusBuff).name = "TKSATOrderedArmor"; statusBuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion(); ContentAddition.AddBuffDef(statusBuff); ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_001c: 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_0041: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val = ScriptableObject.CreateInstance(); val.relationshipType = ItemRelationshipTypes.ContagiousItem; val.relationships = (Pair[])(object)new Pair[1] { new Pair { itemDef1 = Item.instance.itemDef, itemDef2 = base.itemDef } }; orig.Invoke(providers.Concat((IEnumerable)(object)new ItemRelationshipProvider[1] { val }).ToArray()); }; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); CharacterBody.FixedUpdate += new hook_FixedUpdate(On_CBFixedUpdate); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(Evt_GetStatCoefficients); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); CharacterBody.FixedUpdate -= new hook_FixedUpdate(On_CBFixedUpdate); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(Evt_GetStatCoefficients); } private void On_CBFixedUpdate(orig_FixedUpdate orig, CharacterBody self) { orig.Invoke(self); UpdateGGBuff(self); } private void Evt_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { OrderedArmorComponent component = ((Component)sender).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { args.armorAdd += component.calculatedArmorBonus; } } } public float CalculateArmor(Inventory inv) { int countEffective = GetCountEffective(inv); if (countEffective <= 0) { return 0f; } int totalItemTypes = GetTotalItemTypes(inv); return armorAmtBase * (1f + (float)countEffective * armorStacking) * Mathf.Pow(varietyExp, (float)(totalItemTypes - 1)); } private static int GetTotalItemTypes(Inventory inv) { //IL_002c: 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_0042: 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: Expected I4, but got Unknown int num = 0; ReadOnlySpan valuesSpan = inv.effectiveItemStacks.inner.GetValuesSpan(); ReadOnlySpan nonZeroIndicesSpan = ((ItemCollection)(ref inv.effectiveItemStacks)).GetNonZeroIndicesSpan(); for (int i = 0; i < nonZeroIndicesSpan.Length; i++) { ItemIndex val = nonZeroIndicesSpan[i]; ItemDef val2 = ItemCatalog.GetItemDef(val); if (!val2.hidden) { ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef(val2.tier); if ((Object)(object)itemTierDef != (Object)null && itemTierDef.isDroppable && valuesSpan[(int)val] > 0) { num++; } } } return num; } private void UpdateGGBuff(CharacterBody cb) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) OrderedArmorComponent orderedArmorComponent = ((Component)cb).GetComponent(); if (!Object.op_Implicit((Object)(object)orderedArmorComponent)) { orderedArmorComponent = ((Component)cb).gameObject.AddComponent(); } orderedArmorComponent.calculatedArmorBonus = CalculateArmor(cb.inventory); int num = Mathf.FloorToInt(orderedArmorComponent.calculatedArmorBonus); int buffCount = cb.GetBuffCount(statusBuff); if (num != buffCount) { cb.SetBuffCount(statusBuff.buffIndex, num); } } } public class OrderedArmorComponent : MonoBehaviour { public float calculatedArmorBonus; } public class VoidwispHive : Item { private GameObject wispPrefab; private SkillDef[] blacklistedSkills; public override ItemTier itemTier => (ItemTier)7; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOSlider("{0:N1} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Lifetime of Voidwisp Hive wisps.", AutoConfigFlags.DeferForever, new object[] { 0f, float.MaxValue })] public float wispDuration { get; private set; } = 10f; [AutoConfigRoOSlider("{0:P1}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Damage fraction dealt by Voidwisp attacks per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageAmt { get; private set; } = 0.08f; [AutoConfigRoOSlider("{0:N2} s", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Time, in seconds, between attacks.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageRate { get; private set; } = 0.5f; [AutoConfigRoOSlider("{0:N0} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Internal cooldown on each non-primary skill, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float perSkillCooldown { get; private set; } = 3f; [AutoConfigRoOSlider("{0:N0} s", 0f, 30f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Internal cooldown on primary skill, in seconds.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float primaryCooldown { get; private set; } = 6f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of wisp attacks.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 0.1f; public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[5] { perSkillCooldown.ToString("N0"), primaryCooldown.ToString("N0"), wispDuration.ToString("N0"), (1f / damageRate).ToString("N1"), damageAmt.ToString("0%") }; } public VoidwispHive() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/VoidwispHive.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/voidwispHiveIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/VoidwispHive.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Expected O, but got Unknown //IL_026f: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02ee: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0401: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Expected O, but got Unknown //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.06965f, -0.00208f, -0.17908f), localAngles = new Vector3(11.42411f, 356.2912f, 14.84471f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.36759f, -0.0275f, -0.1511f), localAngles = new Vector3(31.87035f, 332.9695f, 3.18838f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(0.08343f, 0.03755f, -0.13804f), localAngles = new Vector3(27.00084f, 326.5775f, 4.93487f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(1.06242f, -2.34785f, 2.19338f), localAngles = new Vector3(34.82076f, 356.4073f, 8.73201f), localScale = new Vector3(2f, 2f, 2f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.18945f, 0.06303f, 0.14275f), localAngles = new Vector3(19.74273f, 338.7649f, 343.2596f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.02239f, 0.15988f, -0.08744f), localAngles = new Vector3(14.62809f, 338.0782f, 18.2589f), localScale = new Vector3(0.15f, 0.15f, 0.15f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechBase", localPos = new Vector3(0.2564f, -0.07702f, -0.11248f), localAngles = new Vector3(42.98969f, 110.4701f, 5.24458f), localScale = new Vector3(0.15f, 0.15f, 0.15f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Pelvis", localPos = new Vector3(-0.1685f, -0.14564f, 0.12029f), localAngles = new Vector3(357.5521f, 355.006f, 105.9485f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Stomach", localPos = new Vector3(-0.19599f, 0.00391f, -0.083f), localAngles = new Vector3(350.6662f, 317.2625f, 21.97947f), localScale = new Vector3(0.15f, 0.15f, 0.15f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Chest", localPos = new Vector3(-1.92445f, 0.67058f, -2.02585f), localAngles = new Vector3(311.4177f, 28.43508f, 354.1869f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "PlatformBase", localPos = new Vector3(-0.66684f, 0.35616f, -0.25049f), localAngles = new Vector3(308.2326f, 10.8672f, 329.0782f), localScale = new Vector3(0.7f, 0.7f, 0.7f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Backpack", localPos = new Vector3(-0.10688f, -0.01631f, 0.1469f), localAngles = new Vector3(352.4358f, 63.85438f, 6.83272f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Center", localPos = new Vector3(-0.09843f, 0.06639f, -0.15171f), localAngles = new Vector3(15.08189f, 9.51543f, 15.89409f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); } public override void SetupAttributes() { //IL_0072: 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_0118: 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) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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: 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_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Expected O, but got Unknown base.SetupAttributes(); blacklistedSkills = (SkillDef[])(object)new SkillDef[7] { LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiCancelTargetingDummy"), LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiConfirmTargetDummy"), LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiBodyPlaceTurret"), LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiBodyPlaceWalkerTurret"), LegacyResourcesAPI.Load("SkillDefs/EngiBody/EngiHarpoons"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/CaptainCancelDummy"), LegacyResourcesAPI.Load("SkillDefs/CaptainBody/PrepSupplyDrop") }; Texture2D val = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/ColorRamps/texRampDefault.png").WaitForCompletion(); GameObject val2 = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/HealPack"), "TkSatTempSetupPrefab", false); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.3f, 0.05f, 0.4f); ((Behaviour)val2.GetComponent()).enabled = false; DestroyOnTimer component = val2.GetComponent(); component.duration = wispDuration; val2.GetComponent().delayBeforeBeginningBlinking = component.duration - 1f; TrailRenderer component2 = ((Component)val2.transform.Find("HealthOrbEffect/TrailParent/Trail")).gameObject.GetComponent(); ((Renderer)component2).material.SetTexture("_RemapTex", (Texture)(object)val); ((Renderer)component2).material.SetColor("_TintColor", val3); GameObject gameObject = ((Component)val2.transform.Find("HealthOrbEffect/VFX/Core")).gameObject; ColorOverLifetimeModule colorOverLifetime = gameObject.GetComponent().colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3, ((Color)(ref val3)).AlphaMultiplied(0f)); Transform transform = gameObject.transform; transform.localScale *= 0.5f; GameObject gameObject2 = ((Component)val2.transform.Find("HealthOrbEffect/VFX/PulseGlow")).gameObject; ColorOverLifetimeModule colorOverLifetime2 = gameObject2.GetComponent().colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime2)).color = new MinMaxGradient(val3, ((Color)(ref val3)).AlphaMultiplied(0f)); Transform transform2 = gameObject2.transform; transform2.localScale *= 0.5f; GameObject gameObject3 = ((Component)val2.transform.Find("PickupTrigger")).gameObject; gameObject3.transform.parent = null; Object.DestroyImmediate((Object)(object)gameObject3); GameObject gameObject4 = ((Component)val2.transform.Find("GravitationController")).gameObject; Object.Destroy((Object)(object)gameObject4.GetComponent()); VoidwispController voidwispController = gameObject4.AddComponent(); voidwispController.duration = component.duration; voidwispController.parentRigidbody = val2.GetComponent(); voidwispController.teamFilter = val2.GetComponent(); wispPrefab = PrefabAPI.InstantiateClone(val2, "TkSatVoidWisp", true); Object.Destroy((Object)(object)val2); ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_001c: 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_0041: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val4 = ScriptableObject.CreateInstance(); val4.relationshipType = ItemRelationshipTypes.ContagiousItem; val4.relationships = (Pair[])(object)new Pair[1] { new Pair { itemDef1 = Item.instance.itemDef, itemDef2 = base.itemDef } }; orig.Invoke(providers.Concat((IEnumerable)(object)new ItemRelationshipProvider[1] { val4 }).ToArray()); }; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 base.Install(); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); Fire.FireMissile += new hook_FireMissile(Fire_FireMissile); PlaceTurret.FixedUpdate += new hook_FixedUpdate(PlaceTurret_FixedUpdate); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(EquipmentSlot_PerformEquipmentAction); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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 base.Uninstall(); CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); Fire.FireMissile -= new hook_FireMissile(Fire_FireMissile); PlaceTurret.FixedUpdate -= new hook_FixedUpdate(PlaceTurret_FixedUpdate); EquipmentSlot.PerformEquipmentAction -= new hook_PerformEquipmentAction(EquipmentSlot_PerformEquipmentAction); } private void SpawnWisp(Vector3 pos, TeamIndex team, CharacterBody ownerBody) { //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0036: 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_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_0048: 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_0064: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.AngleAxis(Random.value * 360f, Vector3.up); Vector3 val2 = new Vector3(1f, 1f, 0f); Vector3 velocity = val * (((Vector3)(ref val2)).normalized * 15f); GameObject obj = Object.Instantiate(wispPrefab, pos, Random.rotation); obj.GetComponent().teamIndex = team; obj.GetComponent().velocity = velocity; ((Component)obj.transform.Find("GravitationController")).GetComponent().owner = ownerBody; NetworkServer.Spawn(obj); } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_006e: 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) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got I4 //IL_009d->IL009d: Incompatible stack types: O vs I4 //IL_0092->IL009d: Incompatible stack types: I4 vs O //IL_0092->IL009d: Incompatible stack types: O vs I4 orig.Invoke(self, skill); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.skillLocator) || blacklistedSkills.Contains(skill.skillDef) || GetCountEffective(self) <= 0) { return; } VoidwispHiveStopwatch voidwispHiveStopwatch = ((Component)self).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)voidwispHiveStopwatch)) { voidwispHiveStopwatch = ((Component)self).gameObject.AddComponent(); } if (voidwispHiveStopwatch.CheckProc(self.skillLocator.FindSkillSlot(skill))) { object obj = this; Vector3 corePosition = self.corePosition; int num; if (Object.op_Implicit((Object)(object)self.teamComponent)) { obj = self.teamComponent.teamIndex; num = (int)obj; } else { num = -1; obj = num; num = (int)obj; } ((VoidwispHive)num).SpawnWisp(corePosition, (TeamIndex)obj, self); } } private bool EquipmentSlot_PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { //IL_006b: 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_00a0: Expected O, but got I4 //IL_0095->IL0095: Incompatible stack types: O vs I4 //IL_0085->IL0095: Incompatible stack types: I4 vs O //IL_0085->IL0095: Incompatible stack types: O vs I4 bool result = orig.Invoke(self, equipmentDef); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.characterBody)) { if (GetCountEffective(self.characterBody) <= 0) { return result; } VoidwispHiveStopwatch voidwispHiveStopwatch = ((Component)self.characterBody).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)voidwispHiveStopwatch)) { voidwispHiveStopwatch = ((Component)self.characterBody).gameObject.AddComponent(); } if (voidwispHiveStopwatch.CheckProcEquipment()) { object obj = this; Vector3 corePosition = self.characterBody.corePosition; int num; if (Object.op_Implicit((Object)(object)self.characterBody.teamComponent)) { obj = self.characterBody.teamComponent.teamIndex; num = (int)obj; } else { num = -1; obj = num; num = (int)obj; } ((VoidwispHive)num).SpawnWisp(corePosition, (TeamIndex)obj, self.characterBody); } } return result; } private void Fire_FireMissile(orig_FireMissile orig, Fire self, HurtBox target, Vector3 position) { //IL_0003: 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) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got I4 //IL_0075->IL0075: Incompatible stack types: O vs I4 //IL_006a->IL0075: Incompatible stack types: I4 vs O //IL_006a->IL0075: Incompatible stack types: O vs I4 orig.Invoke(self, target, position); if (GetCountEffective(((EntityState)self).characterBody) <= 0) { return; } PixieTubeStopwatch pixieTubeStopwatch = ((Component)((EntityState)self).characterBody).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)pixieTubeStopwatch)) { pixieTubeStopwatch = ((Component)((EntityState)self).characterBody).gameObject.AddComponent(); } if (pixieTubeStopwatch.CheckProc((SkillSlot)2)) { object obj = this; Vector3 corePosition = ((EntityState)self).characterBody.corePosition; int num; if (Object.op_Implicit((Object)(object)((EntityState)self).teamComponent)) { obj = ((EntityState)self).teamComponent.teamIndex; num = (int)obj; } else { num = -1; obj = num; num = (int)obj; } ((VoidwispHive)num).SpawnWisp(corePosition, (TeamIndex)obj, ((EntityState)self).characterBody); } } private void PlaceTurret_FixedUpdate(orig_FixedUpdate orig, PlaceTurret self) { //IL_009e: 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_00c9: Expected O, but got I4 //IL_00be->IL00be: Incompatible stack types: O vs I4 //IL_00b3->IL00be: Incompatible stack types: I4 vs O //IL_00b3->IL00be: Incompatible stack types: O vs I4 orig.Invoke(self); if ((!((EntityState)self).inputBank.skill1.down && !((ButtonState)(ref ((EntityState)self).inputBank.skill4)).justPressed) || !self.currentPlacementInfo.ok || self.exitCountdown != 0.25f || !self.exitPending || GetCountEffective(((EntityState)self).characterBody) <= 0) { return; } PixieTubeStopwatch pixieTubeStopwatch = ((Component)((EntityState)self).characterBody).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)pixieTubeStopwatch)) { pixieTubeStopwatch = ((Component)((EntityState)self).characterBody).gameObject.AddComponent(); } if (pixieTubeStopwatch.CheckProc((SkillSlot)3)) { object obj = this; Vector3 corePosition = ((EntityState)self).characterBody.corePosition; int num; if (Object.op_Implicit((Object)(object)((EntityState)self).teamComponent)) { obj = ((EntityState)self).teamComponent.teamIndex; num = (int)obj; } else { num = -1; obj = num; num = (int)obj; } ((VoidwispHive)num).SpawnWisp(corePosition, (TeamIndex)obj, ((EntityState)self).characterBody); } } } public class VoidwispHiveStopwatch : MonoBehaviour { private readonly float[] stopwatches = new float[5]; public bool CheckProc(SkillSlot slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0010: 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_0020: Unknown result type (might be due to invalid IL or missing references) if ((int)slot == -1 || (int)slot > 3) { return false; } if (stopwatches[slot] <= 0f) { stopwatches[slot] = (((int)slot == 0) ? Item.instance.primaryCooldown : Item.instance.perSkillCooldown); return true; } return false; } public bool CheckProcEquipment() { if (stopwatches[4] <= 0f) { stopwatches[4] = Item.instance.perSkillCooldown; return true; } return false; } private void FixedUpdate() { for (int i = 0; i < stopwatches.Length; i++) { if (stopwatches[i] > 0f) { stopwatches[i] -= Time.fixedDeltaTime; } } } } [RequireComponent(typeof(SphereCollider))] public class VoidwispController : MonoBehaviour { public class VoidwispLightningOrb : LightningOrb { public override void Begin() { //IL_0003: 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_001a: 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_0031: Expected O, but got Unknown base.lightningType = (LightningType)10; ((Orb)this).duration = 0.06f; EffectData val = new EffectData { origin = ((Orb)this).origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(((Orb)this).target); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/OrbEffects/VoidLightningOrbEffect"), val, true); } } private float _attackRange = 15f; private float _attackRangeSq = 225f; private float _seekRange = 50f; private float _seekRangeSq = 2500f; public float idealOrbitRange = 8f; public float duration = 10f; public float dragDelay = 0.5f; public float dragStrength = 0.01f; public float zipDelayMin = 0.2f; public float zipDelayMax = 1f; public float zipStrengthMin = 5f; public float zipStrengthMax = 15f; public float zipDelayMultWithTarget = 0.5f; public TeamFilter teamFilter; public Rigidbody parentRigidbody; public CharacterBody owner; private float lifeStopwatch; private float zipStopwatch = 0.5f; private float attackStopwatch; private Transform target; private CharacterBody tgtBody; private SphereCollider coll; public float attackRange { get { return _attackRange; } set { _attackRange = value; _attackRangeSq = value * value; } } public float seekRange { get { return _seekRange; } set { _seekRange = value; _seekRangeSq = value * value; } } private bool GetCanPerformTargetingOps() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 if (NetworkServer.active && !Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)teamFilter)) { return (int)teamFilter.teamIndex != -1; } return false; } private void Awake() { coll = ((Component)this).GetComponent(); coll.radius = seekRange; } private void FixedUpdate() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_0125: 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_0137: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_01aa: 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_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) if (lifeStopwatch < duration) { lifeStopwatch += Time.fixedDeltaTime; } int num; if (Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)tgtBody) && Object.op_Implicit((Object)(object)tgtBody.healthComponent)) { num = (tgtBody.healthComponent.alive ? 1 : 0); if (num != 0) { goto IL_0069; } } else { num = 0; } target = null; goto IL_0069; IL_0069: bool flag = false; bool flag2 = false; Vector3 val = Vector3.zero; if (num != 0) { val = target.position - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; flag = sqrMagnitude < _seekRangeSq; flag2 = sqrMagnitude < _attackRangeSq; } Rigidbody obj = parentRigidbody; obj.velocity *= 1f - Mathf.Clamp01(lifeStopwatch / dragDelay) * dragStrength; zipStopwatch -= Time.fixedDeltaTime; if (zipStopwatch <= 0f) { zipStopwatch = Random.Range(zipDelayMin, zipDelayMax); if (flag) { Vector3 val2 = target.position - ((Vector3)(ref val)).normalized * idealOrbitRange; zipStopwatch *= zipDelayMultWithTarget; Rigidbody obj2 = parentRigidbody; Vector3 velocity = obj2.velocity; Vector3 val3 = val2 - ((Component)this).transform.position; obj2.velocity = velocity + (((Vector3)(ref val3)).normalized * 0.7f + Random.onUnitSphere * 0.3f) * Random.Range(zipStrengthMin, zipStrengthMax); } else { target = null; Rigidbody obj3 = parentRigidbody; obj3.velocity += Random.onUnitSphere * Random.Range(zipStrengthMin, zipStrengthMax); } } attackStopwatch -= Time.fixedDeltaTime; if (attackStopwatch < 0f) { attackStopwatch = 0f; } if (flag2 && attackStopwatch <= 0f) { attackStopwatch = Item.instance.damageRate; float num2 = 10f; int countEffective = Item.instance.GetCountEffective(owner); if (countEffective > 0) { num2 = owner.damage * (float)countEffective; } OrbManager.instance.AddOrb((Orb)(object)new VoidwispLightningOrb { origin = ((Component)this).transform.position, damageValue = num2 * Item.instance.damageAmt, isCrit = (Object.op_Implicit((Object)(object)owner) && owner.RollCrit()), bouncesRemaining = 0, teamIndex = teamFilter.teamIndex, attacker = (Object.op_Implicit((Object)(object)owner) ? ((Component)owner).gameObject : ((Component)this).gameObject), target = Util.FindBodyMainHurtBox(tgtBody), procCoefficient = Item.instance.procCoefficient, procChainMask = default(ProcChainMask), range = _attackRange + 5f, damageColorIndex = (DamageColorIndex)3 }); } Rigidbody obj4 = parentRigidbody; obj4.velocity -= Physics.gravity * Time.fixedDeltaTime; } private void OnTriggerStay(Collider other) { //IL_0044: 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_005c: Unknown result type (might be due to invalid IL or missing references) if (GetCanPerformTargetingOps()) { CharacterBody componentInParent = ((Component)other).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent) && Object.op_Implicit((Object)(object)componentInParent.healthComponent) && componentInParent.healthComponent.alive && Object.op_Implicit((Object)(object)componentInParent.teamComponent) && componentInParent.teamComponent.teamIndex != teamFilter.teamIndex && (int)componentInParent.teamComponent.teamIndex != 0) { target = ((Component)other).gameObject.transform; tgtBody = componentInParent; } } } } public class Loom : Item { public override ItemTier itemTier => (ItemTier)8; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[1] { (ItemTag)1 }); [AutoConfigRoOIntSlider("{0:N0}", 1, 10, null, null)] [AutoConfig("Maximum number of buff stacks per item stack.", AutoConfigFlags.None, new object[] { 1, int.MaxValue })] public int maxStacks { get; private set; } = 10; [AutoConfigRoOSlider("{0:P1}", 0f, 0.999f, null, null)] [AutoConfig("Attack speed multiplier reduction per buff stack.", AutoConfigFlags.None, new object[] { 0f, 0.999f })] public float stackAttack { get; private set; } = 0.05f; [AutoConfigRoOSlider("{0:P1}", 0f, 10f, null, null)] [AutoConfig("Damage multiplier addition per buff stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float stackDamage { get; private set; } = 0.125f; [AutoConfigRoOSlider("{0:N0} s", 0f, 30f, null, null)] [AutoConfig("Time before effect expires.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float window { get; private set; } = 3f; public BuffDef loomBuff { get; private set; } public GameObject idrPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[4] { stackAttack.ToString("0.0%"), stackDamage.ToString("0.0%"), window.ToString("N1"), maxStacks.ToString("N0") }; } public Loom() { base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Loom.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/loomIcon.png"); idrPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Display/Loom.prefab"); } public override void SetupModifyItemDef() { //IL_002b: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0074: 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_008f: 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_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_00b4: 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_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013d: 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_015e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01fc: 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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: 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_0279: Unknown result type (might be due to invalid IL or missing references) //IL_028f: 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_0299: 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_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: 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_02d8: Expected O, but got Unknown //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Expected O, but got Unknown //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Expected O, but got Unknown //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Expected O, but got Unknown //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Expected O, but got Unknown //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Expected O, but got Unknown //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Expected O, but got Unknown //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0733: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Expected O, but got Unknown //IL_07a1: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_080a: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Expected O, but got Unknown //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08c9: Expected O, but got Unknown //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_0934: Unknown result type (might be due to invalid IL or missing references) base.SetupModifyItemDef(); CommonCode.RetrieveDefaultMaterials(idrPrefab.GetComponent()); displayRules.Add("Bandit2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzleShotgun", localPos = new Vector3(0.0182f, -0.11949f, 0.17513f), localAngles = new Vector3(312.5091f, 15.56333f, 254.7946f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CaptainBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzleGun", localPos = new Vector3(0.15787f, -0.04485f, 0.19995f), localAngles = new Vector3(275.6631f, 222.1807f, 70.54312f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("CommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "GunR", localPos = new Vector3(-0.38451f, 0.0469f, 0.02783f), localAngles = new Vector3(285.653f, 207.5622f, 333.654f), localScale = new Vector3(0.1f, 0.1f, 0.1f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "GunL", localPos = new Vector3(0.38474f, 0.07447f, -0.02576f), localAngles = new Vector3(295.1262f, 204.6935f, 333.7171f), localScale = new Vector3(0.1f, 0.1f, 0.1f) } }); displayRules.Add("CrocoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmR", localPos = new Vector3(-1.37052f, 6.40454f, 0.33925f), localAngles = new Vector3(37.42741f, 311.1624f, 268.5512f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("EngiBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonHeadR", localPos = new Vector3(-0.09853f, 0.65828f, -0.02925f), localAngles = new Vector3(357.861f, 24.97364f, 107.2528f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("HuntressBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "Muzzle", localPos = new Vector3(-0.10289f, -0.12588f, 0.28935f), localAngles = new Vector3(66.76357f, 100.0334f, 201.5606f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("LoaderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MechHandR", localPos = new Vector3(-0.07617f, 0.49021f, 0.04608f), localAngles = new Vector3(28.23814f, 65.30327f, 71.42656f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("MageBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzleRight", localPos = new Vector3(-0.09397f, 0.09521f, 0.07436f), localAngles = new Vector3(53.29458f, 56.86463f, 159.9321f), localScale = new Vector3(0.2f, 0.2f, 0.2f) } }); displayRules.Add("MercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "HandL", localPos = new Vector3(-0.4703f, 0.12868f, -0.17719f), localAngles = new Vector3(339.133f, 322.2292f, 330.3595f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("ToolbotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "LowerArmL", localPos = new Vector3(1.13055f, 11.41728f, -0.8727f), localAngles = new Vector3(341.9f, 325.8047f, 70.39042f), localScale = new Vector3(3f, 3f, 3f) } }); displayRules.Add("TreebotBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzleSyringe", localPos = new Vector3(0.16624f, -0.18172f, 0.56866f), localAngles = new Vector3(288.9777f, 80.45465f, 195.4706f), localScale = new Vector3(0.8f, 0.8f, 0.8f) } }); displayRules.Add("RailgunnerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "MuzzlePistol", localPos = new Vector3(-0.06666f, -0.15216f, 0.40861f), localAngles = new Vector3(348.49f, 78.64636f, 349.3781f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); displayRules.Add("VoidSurvivorBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefabAddress = new AssetReferenceGameObject(""), followerPrefab = idrPrefab, childName = "CannonEnd", localPos = new Vector3(0.06157f, 0.34745f, -0.02382f), localAngles = new Vector3(14.44064f, 349.8533f, 86.79057f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); } public override void SetupAttributes() { //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) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown base.SetupAttributes(); loomBuff = ScriptableObject.CreateInstance(); loomBuff.buffColor = Color.white; loomBuff.canStack = true; loomBuff.isDebuff = false; ((Object)loomBuff).name = "TKSATLoomBuff"; loomBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/MiscIcons/loomBuffIcon.png"); ContentAddition.AddBuffDef(loomBuff); ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_001c: 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_0041: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val = ScriptableObject.CreateInstance(); val.relationshipType = ItemRelationshipTypes.ContagiousItem; val.relationships = (Pair[])(object)new Pair[1] { new Pair { itemDef1 = Item.instance.itemDef, itemDef2 = base.itemDef } }; orig.Invoke(providers.Concat((IEnumerable)(object)new ItemRelationshipProvider[1] { val }).ToArray()); }; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Install(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown base.Uninstall(); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, skill); int countEffective = GetCountEffective(self); if (countEffective > 0 && Object.op_Implicit((Object)(object)skill) && skill.isCombatSkill && (skill.baseRechargeInterval > 0f || (int)self.skillLocator.FindSkillSlot(skill) == 0)) { int buffCount = self.GetBuffCount(loomBuff); self.ClearTimedBuffs(loomBuff.buffIndex); self.SetBuffCount(loomBuff.buffIndex, 0); for (int i = 0; i < Math.Min(buffCount + 1, countEffective * maxStacks); i++) { self.AddTimedBuff(loomBuff, window, countEffective * maxStacks); } } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { int buffCount = sender.GetBuffCount(loomBuff); args.attackSpeedMultAdd -= (float)buffCount * stackAttack; args.damageMultAdd += (float)buffCount * stackDamage; } } } public class NautilusProtocol : Item { public struct MsgDetonateNautilus : INetMessage, ISerializableObject { private CharacterBody _target; public MsgDetonateNautilus(CharacterBody target) { _target = target; } public void Deserialize(NetworkReader reader) { GameObject val = reader.ReadGameObject(); if (Object.op_Implicit((Object)(object)val)) { _target = val.GetComponent(); } else { TinkersSatchelPlugin._logger.LogError((object)"Received MsgDetonateNautilus for nonexistent or non-networked GameObject"); } } public readonly void Serialize(NetworkWriter writer) { writer.Write(((Component)_target).gameObject); } public readonly void OnReceived() { NautilusTrackerComponent nautilusTrackerComponent = default(NautilusTrackerComponent); if (Object.op_Implicit((Object)(object)_target) && ((Component)_target).TryGetComponent(ref nautilusTrackerComponent)) { nautilusTrackerComponent.Detonate(); } } } private static readonly HashSet validBodyNames = new HashSet(); public override ItemTier itemTier => (ItemTier)8; public override ReadOnlyCollection itemTags => new ReadOnlyCollection((IList)(object)new ItemTag[2] { (ItemTag)1, (ItemTag)3 }); public override bool itemIsAIBlacklisted { get; protected set; } = true; [AutoConfigRoOSlider("{0:N0}", 0f, 100f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Armor applied per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float armorBuff { get; private set; } = 25f; [AutoConfigRoOSlider("{0:N0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Regen applied per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float regenBuff { get; private set; } = 2f; [AutoConfigRoOSlider("{0:N0}", 0f, 10f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Damage bonus multiplier applied per stack.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float damageBuff { get; private set; } = 0.2f; [AutoConfigRoOSlider("{0:N0} m", 0f, 1000f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Range (m) of the ping explosion.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float detRange { get; private set; } = 80f; [AutoConfigRoOSlider("{0:N0} s", 0f, 300f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Relative damage of the ping explosion.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float detDamage { get; private set; } = 1f; [AutoConfigRoOSlider("{0:N0}", 0f, 60f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage | AutoConfigUpdateActionTypes.InvalidateStats, false)] [AutoConfig("Minimum time between detonations on a single drone.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float detIcd { get; private set; } = 5f; [AutoConfigRoOSlider("{0:P0}", 0f, 1f, null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("Proc coefficient of the void detonation attack.", AutoConfigFlags.None, new object[] { 0f, 1f })] public float procCoefficient { get; private set; } = 1f; [AutoConfigRoOString(null, null)] [AutoConfig("Which object names are allowed for Nautilus Protocol behavior (comma-delimited, leading/trailing whitespace will be ignored). WARNING: May have unintended results on some untested objects!", AutoConfigFlags.DeferForever, new object[] { })] public string objectNamesConfig { get; private set; } = string.Join(", ", "Drone1Body", "BackupDroneBody", "FlameDroneBody", "MegaDroneBody", "MissileDroneBody", "Turret1Body", "EngiTurretBody", "SquidTurretBody", "RoboBallGreenBuddyBody", "RoboBallRedBuddyBody", "BulwarkDroneBody", "ItemDroneBody"); public GameObject hitEffectPrefab { get; private set; } protected override string[] GetDescStringArgs(string langID = null) { return new string[6] { armorBuff.ToString("N0"), regenBuff.ToString("N0"), damageBuff.ToString("P0"), detRange.ToString("N0"), detDamage.ToString("P0"), detIcd.ToString("N0") }; } public NautilusProtocol() { //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) base.modelResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Items/Nautilus.prefab"); base.iconResource = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/ItemIcons/nautilusIcon.png"); hitEffectPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/ElementalRingVoid/ElementalRingVoidImplodeEffect.prefab").WaitForCompletion(); } public override void SetupModifyItemDef() { base.SetupModifyItemDef(); } public override void SetupAttributes() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown base.SetupAttributes(); NetworkingAPI.RegisterMessageType(); ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers) { //IL_001c: 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_0041: Unknown result type (might be due to invalid IL or missing references) ItemRelationshipProvider val = ScriptableObject.CreateInstance(); val.relationshipType = ItemRelationshipTypes.ContagiousItem; val.relationships = (Pair[])(object)new Pair[1] { new Pair { itemDef1 = Item.instance.itemDef, itemDef2 = base.itemDef } }; orig.Invoke(providers.Concat((IEnumerable)(object)new ItemRelationshipProvider[1] { val }).ToArray()); }; } public override void SetupConfig() { base.SetupConfig(); validBodyNames.UnionWith(from x in objectNamesConfig.Split(',') select x.Trim() + "(Clone)"); } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Install(); PingerController.SetCurrentPing += new hook_SetCurrentPing(PingerController_SetCurrentPing); BaseAI.EvaluateSkillDrivers += new hook_EvaluateSkillDrivers(BaseAI_EvaluateSkillDrivers); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown base.Uninstall(); PingerController.SetCurrentPing -= new hook_SetCurrentPing(PingerController_SetCurrentPing); BaseAI.EvaluateSkillDrivers -= new hook_EvaluateSkillDrivers(BaseAI_EvaluateSkillDrivers); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && validBodyNames.Contains(((Object)sender).name)) { NautilusTrackerComponent component = ((Component)sender).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.cachedWranglerCount > 0) { args.damageMultAdd += damageBuff * (float)component.cachedWranglerCount; args.armorAdd += armorBuff * (float)component.cachedWranglerCount; args.baseRegenAdd += regenBuff * (float)component.cachedWranglerCount; } } } private void PingerController_SetCurrentPing(orig_SetCurrentPing orig, PingerController self, PingInfo newPingInfo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newPingInfo); PlayerCharacterMasterController val = default(PlayerCharacterMasterController); CharacterBody target = default(CharacterBody); if (((Component)self).TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.body) && GetCountEffective(val.body) > 0 && Object.op_Implicit((Object)(object)((PingInfo)(ref newPingInfo)).targetGameObject) && ((PingInfo)(ref newPingInfo)).targetGameObject.TryGetComponent(ref target)) { NetMessageExtensions.Send((INetMessage)(object)new MsgDetonateNautilus(target), (NetworkDestination)2); } } private SkillDriverEvaluation BaseAI_EvaluateSkillDrivers(orig_EvaluateSkillDrivers orig, BaseAI self) { //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_0015: 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_0097: Unknown result type (might be due to invalid IL or missing references) SkillDriverEvaluation result = orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self.body)) { return result; } NautilusTrackerComponent nautilusTrackerComponent = ((Component)self.body).GetComponent(); if (!Object.op_Implicit((Object)(object)nautilusTrackerComponent) && validBodyNames.Contains(((Object)self.body).name)) { nautilusTrackerComponent = ((Component)self.body).gameObject.AddComponent(); } if (!Object.op_Implicit((Object)(object)nautilusTrackerComponent)) { return result; } if (self.leader == null || !Object.op_Implicit((Object)(object)self.leader.characterBody)) { nautilusTrackerComponent.SetWranglerCount(0); } else { nautilusTrackerComponent.SetWranglerCount(GetCountEffective(self.leader.characterBody)); } return result; } } [RequireComponent(typeof(CharacterBody))] public class NautilusTrackerComponent : MonoBehaviour { private CharacterBody body; private float detCooldown; public int cachedWranglerCount { get; private set; } private void Awake() { body = ((Component)this).GetComponent(); } private void FixedUpdate() { if (detCooldown > 0f) { detCooldown -= Time.fixedDeltaTime; } } public void SetWranglerCount(int count) { if (cachedWranglerCount != count) { body.MarkAllStatsDirty(); } cachedWranglerCount = count; } public void Detonate() { //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_0052: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_009c: 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_00a3: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_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_00db: 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) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_0141: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown if (!(detCooldown > 0f)) { detCooldown = Item.instance.detIcd; float num = body.healthComponent.fullCombinedHealth / 2f; body.healthComponent.TakeDamage(new DamageInfo { damage = num * 2f, attacker = ((Component)body).gameObject, position = body.corePosition, damageType = DamageTypeCombo.op_Implicit((DamageType)66) }); new BlastAttack { attacker = ((Component)body).gameObject, attackerFiltering = (AttackerFiltering)2, baseDamage = num * Item.instance.detDamage, baseForce = 0f, crit = false, damageColorIndex = (DamageColorIndex)9, damageType = DamageTypeCombo.op_Implicit((DamageType)0), falloffModel = (FalloffModel)0, inflictor = ((Component)body).gameObject, position = body.corePosition, procChainMask = default(ProcChainMask), procCoefficient = Item.instance.procCoefficient, radius = Item.instance.detRange, teamIndex = body.teamComponent.teamIndex }.Fire(); EffectManager.SpawnEffect(Item.instance.hitEffectPrefab, new EffectData { scale = Item.instance.detRange, origin = body.corePosition, start = body.corePosition }, true); } } } public class CommandoPrimaryPulse : Module { public class Fire : BaseSkillState { public static float initialDamageCoefficient = 0.75f; public static float finalDamageCoefficient = 1.5f; public static float force = 0f; public static float baseEndLagDuration = 0.32f; public static float baseDurationPerShot = 0.1f; public static float recoilAmplitude = 4f; public static float spreadBloomValue = 0.125f; public static int burstCount = 4; private float duration; private float stopwatch; private int shotsFired; private void FireBulletAltMode(string targetMuzzle, int shotIndex) { //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_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_008a: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00b0: 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_00cc: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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) Ray aimRay = ((BaseState)this).GetAimRay(); Util.PlaySound(FirePistol2.firePistolSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)FirePistol2.muzzleEffectPrefab)) { EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, targetMuzzle, false); } if (((EntityState)this).isAuthority) { CommandoPrimaryPulseAltModeTracker commandoPrimaryPulseAltModeTracker = default(CommandoPrimaryPulseAltModeTracker); if (!((EntityState)this).gameObject.TryGetComponent(ref commandoPrimaryPulseAltModeTracker)) { commandoPrimaryPulseAltModeTracker = ((EntityState)this).gameObject.AddComponent(); } float num = Mathf.Lerp(initialDamageCoefficient, finalDamageCoefficient, (float)commandoPrimaryPulseAltModeTracker.consecutiveHitCount / 20f); 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 = Mathf.Lerp(initialDamageCoefficient, num, (float)shotIndex / ((float)burstCount - 1f)) * ((BaseState)this).damageStat, force = force, tracerEffectPrefab = FirePistol2.tracerEffectPrefab, muzzleName = targetMuzzle, hitEffectPrefab = FirePistol2.hitEffectPrefab, isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), radius = 0.1f, smartCollision = true, hitCallback = new HitCallback(AltModeHitCallback), damageType = DamageTypeCombo.GenericPrimary }.Fire(); } } private void FireBullet(string targetMuzzle, int shotIndex) { //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_0074: 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_0085: 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_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_009e: 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_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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_010f: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Util.PlaySound(FirePistol2.firePistolSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)FirePistol2.muzzleEffectPrefab)) { EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, targetMuzzle, false); } float num = recoilAmplitude / ((BaseState)this).attackSpeedStat; ((BaseState)this).AddRecoil(-0.7f * num, -1f * recoilAmplitude, -0.1f * num, 0.1f * num); 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 = Mathf.Lerp(initialDamageCoefficient, finalDamageCoefficient, (float)shotIndex / ((float)burstCount - 1f)) * ((BaseState)this).damageStat, force = force, tracerEffectPrefab = FirePistol2.tracerEffectPrefab, muzzleName = targetMuzzle, hitEffectPrefab = FirePistol2.hitEffectPrefab, isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), radius = 0.1f, smartCollision = true, damageType = DamageTypeCombo.GenericPrimary }.Fire(); } ((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue); } public static bool AltModeHitCallback(BulletAttack atk, ref BulletHit hitInfo) { bool result = BulletAttack.DefaultHitCallbackImplementation(atk, ref hitInfo); if (!Object.op_Implicit((Object)(object)atk.owner)) { return false; } CommandoPrimaryPulseAltModeTracker commandoPrimaryPulseAltModeTracker = default(CommandoPrimaryPulseAltModeTracker); if (!atk.owner.TryGetComponent(ref commandoPrimaryPulseAltModeTracker)) { commandoPrimaryPulseAltModeTracker = atk.owner.AddComponent(); } if (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) && Object.op_Implicit((Object)(object)hitInfo.hitHurtBox.healthComponent)) { commandoPrimaryPulseAltModeTracker.OnHit(((Component)hitInfo.hitHurtBox.healthComponent).gameObject); } else { commandoPrimaryPulseAltModeTracker.OnHit(null); } return result; } public override void OnEnter() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = (baseDurationPerShot * (float)burstCount + baseEndLagDuration) / ((BaseState)this).attackSpeedStat; ((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), 3f, false); stopwatch = 0f; shotsFired = 0; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch -= Time.fixedDeltaTime; while (stopwatch <= 0f && shotsFired < burstCount) { if (shotsFired % 2 == 0) { ((EntityState)this).PlayAnimation("Gesture Additive, Left", "FirePistol, Left"); if (Module.instance.altModeFocusFire) { FireBulletAltMode("MuzzleLeft", shotsFired); } else { FireBullet("MuzzleLeft", shotsFired); } } else { ((EntityState)this).PlayAnimation("Gesture Additive, Right", "FirePistol, Right"); if (Module.instance.altModeFocusFire) { FireBulletAltMode("MuzzleRight", shotsFired); } else { FireBullet("MuzzleRight", shotsFired); } } shotsFired++; stopwatch += baseDurationPerShot / ((BaseState)this).attackSpeedStat; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > duration && shotsFired >= burstCount) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } private bool setupSucceeded; private SkillFamily targetSkillFamily; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilEndGame; [AutoConfigRoOCheckbox(null, null)] [AutoConfigUpdateActions(AutoConfigUpdateActionTypes.InvalidateLanguage, false)] [AutoConfig("If true, skill will have no recoil and use an alternate mechanic: high-end damage will start at +0 compared to low-end, and ramp up while attacking the same enemy without missing.", AutoConfigFlags.None, new object[] { })] public bool altModeFocusFire { get; private set; } public SkillDef skillDef { get; private set; } public override void RefreshPermanentLanguage() { permanentGenericLanguageTokens["TKSAT_COMMANDO_PRIMARY_PULSE_DESCRIPTION"] = Language.GetString(altModeFocusFire ? "TKSAT_COMMANDO_PRIMARY_PULSE_DESCRIPTION_ALT" : "TKSAT_COMMANDO_PRIMARY_PULSE_DESCRIPTION_MAIN"); foreach (KeyValuePair item in Language.languagesByName) { if (!permanentSpecificLanguageTokens.ContainsKey(item.Key)) { permanentSpecificLanguageTokens.Add(item.Key, new Dictionary()); } permanentSpecificLanguageTokens[item.Key]["TKSAT_COMMANDO_PRIMARY_PULSE_DESCRIPTION"] = item.Value.GetLocalizedStringByToken(altModeFocusFire ? "TKSAT_COMMANDO_PRIMARY_PULSE_DESCRIPTION_ALT" : "TKSAT_COMMANDO_PRIMARY_PULSE_DESCRIPTION_MAIN"); } base.RefreshPermanentLanguage(); } public override void SetupAttributes() { //IL_0021: 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_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) base.SetupAttributes(); skillDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/SkillDefs/CommandoPrimaryPulse.asset"); targetSkillFamily = Addressables.LoadAssetAsync((object)"RoR2/Base/Commando/CommandoBodyPrimaryFamily.asset").WaitForCompletion(); bool flag = default(bool); skillDef.activationState = ContentAddition.AddEntityState(ref flag); if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on CommandoPrimaryPulse! Skill will not appear nor function."); } else if (!ContentAddition.AddSkillDef(skillDef)) { TinkersSatchelPlugin._logger.LogError((object)"SkillDef setup failed on CommandoPrimaryPulse! Skill will not appear nor function."); } else { setupSucceeded = true; } } public override void Install() { base.Install(); if (setupSucceeded) { targetSkillFamily.AddVariant(skillDef); } } public override void Uninstall() { base.Uninstall(); if (setupSucceeded) { targetSkillFamily.RemoveVariant(skillDef); } } } public class CommandoPrimaryPulseAltModeTracker : MonoBehaviour { private GameObject lastHitTarget; public int consecutiveHitCount { get; private set; } = 1; public void OnHit(GameObject hit) { if ((Object)(object)lastHitTarget == (Object)(object)hit) { consecutiveHitCount++; } else { consecutiveHitCount = 1; } lastHitTarget = hit; } } public class CommandoSpecialPlasmaGrenade : Module { public class Fire : ThrowGrenade { public override void OnEnter() { if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && (Object)(object)((EntityState)this).skillLocator.FindSkillByDef(Module.instance.scepterSkillDef) != (Object)null) { ((GenericProjectileBaseState)this).projectilePrefab = Module.instance.scepterProjectilePrefab; ((GenericProjectileBaseState)this).damageCoefficient = 10f; ((GenericProjectileBaseState)this).force = 1200f; } else { ((GenericProjectileBaseState)this).projectilePrefab = Module.instance.projectilePrefab; ((GenericProjectileBaseState)this).damageCoefficient = 5f; ((GenericProjectileBaseState)this).force = 700f; } ((GenericProjectileBaseState)this).minSpread = 0f; ((GenericProjectileBaseState)this).maxSpread = 0f; ((GenericProjectileBaseState)this).baseDuration = 0.5f; ((GenericProjectileBaseState)this).recoilAmplitude = 0f; ((GenericProjectileBaseState)this).attackSoundString = "Play_commando_M2_grenade_throw"; ((GenericProjectileBaseState)this).projectilePitchBonus = -10f; ((GenericProjectileBaseState)this).baseDelayBeforeFiringProjectile = 0f; ((GenericProjectileBaseState)this).bloom = 0f; ((GenericProjectileBaseState)this).OnEnter(); } public override void ModifyProjectileInfo(ref FireProjectileInfo fireProjectileInfo) { //IL_000d: 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) ((ThrowGrenade)this).ModifyProjectileInfo(ref fireProjectileInfo); fireProjectileInfo.damageTypeOverride = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)128), (DamageTypeExtended)0, (DamageSource)8); } } private bool setupSucceeded; private bool scepSetupSucceeded; private SkillFamily targetSkillFamily; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilEndGame; public SkillDef skillDef { get; private set; } public SkillDef scepterSkillDef { get; private set; } public GameObject projectilePrefab { get; private set; } public GameObject scepterProjectilePrefab { get; private set; } public override void SetupAttributes() { //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_0097: 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) //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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: 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_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); skillDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/SkillDefs/CommandoSpecialPlasmaGrenade.asset"); scepterSkillDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/SkillDefs/CIScepter/CommandoSpecialPlasmaGrenadeScep.asset"); projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/CommandoPlasmaGrenadeProjectile.prefab"); GameObject obj = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/Ghosts/CommandoPlasmaGrenadeGhost.prefab"); scepterProjectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/CommandoPlasmaGrenadeProjectileScep.prefab"); GameObject val = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/Ghosts/CommandoPlasmaGrenadeGhostScep.prefab"); targetSkillFamily = Addressables.LoadAssetAsync((object)"RoR2/Base/Commando/CommandoBodySpecialFamily.asset").WaitForCompletion(); Material material = Addressables.LoadAssetAsync((object)"RoR2/Base/Wisp/matWispFire.mat").WaitForCompletion(); Material material2 = Addressables.LoadAssetAsync((object)"RoR2/Base/ClayBoss/matClayBossLightshaft.mat").WaitForCompletion(); GameObject val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/LemurianBruiser/OmniExplosionVFXLemurianBruiserFireballImpact.prefab").WaitForCompletion(); ((Renderer)((Component)obj.transform.Find("RadialGlow")).gameObject.GetComponent()).material = material; projectilePrefab.GetComponent().explosionEffect = val2; ((Renderer)((Component)projectilePrefab.transform.Find("FuseVFX")).gameObject.GetComponent()).material = material2; GameObject obj2 = PrefabAPI.InstantiateClone(val2, "TkSatTempSetupPrefab", false); Transform transform = obj2.transform; transform.localScale *= 2f; GameObject val3 = PrefabAPI.InstantiateClone(obj2, "TkSatPlasmaGrenadeScepterExplosion", false); ((Renderer)((Component)val.transform.Find("RadialGlow")).gameObject.GetComponent()).material = material; scepterProjectilePrefab.GetComponent().explosionEffect = val3; ((Renderer)((Component)scepterProjectilePrefab.transform.Find("FuseVFX")).gameObject.GetComponent()).material = material2; bool flag = default(bool); SerializableEntityStateType activationState = ContentAddition.AddEntityState(ref flag); skillDef.activationState = activationState; scepterSkillDef.activationState = activationState; if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on CommandoSpecialPlasmaGrenade! Skill will not appear nor function."); } else if (!ContentAddition.AddSkillDef(skillDef)) { TinkersSatchelPlugin._logger.LogError((object)"SkillDef setup failed on CommandoSpecialPlasmaGrenade! Skill will not appear nor function."); } else { setupSucceeded = true; } ContentAddition.AddEffect(val3); ContentAddition.AddProjectile(projectilePrefab); ContentAddition.AddProjectile(scepterProjectilePrefab); if (Compat_AncientScepter.enabled) { if (!ContentAddition.AddSkillDef(scepterSkillDef)) { scepSetupSucceeded = false; } else { scepSetupSucceeded = Compat_AncientScepter.RegisterScepterSkill(scepterSkillDef, "CommandoBody", skillDef); } if (!scepSetupSucceeded) { TinkersSatchelPlugin._logger.LogError((object)"Ancient Scepter support failed for CommandoSpecialPlasmaGrenade! Ancient Scepter will not work on this skill."); } } } public override void Install() { base.Install(); if (setupSucceeded) { targetSkillFamily.AddVariant(skillDef); } } public override void Uninstall() { base.Uninstall(); if (setupSucceeded) { targetSkillFamily.RemoveVariant(skillDef); } } } [RequireComponent(typeof(ProjectileTargetComponent))] public class ProjectileSteerTowardsTargetRB : MonoBehaviour { public float targetSpeed; public float rotationSpeed; public float speedSpeed; private ProjectileTargetComponent targetComponent; private Rigidbody rb; private void Start() { targetComponent = ((Component)this).GetComponent(); rb = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_001e: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0056: 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) if (Object.op_Implicit((Object)(object)targetComponent.target)) { Rigidbody obj = rb; Vector3 velocity = rb.velocity; Vector3 val = ((Component)targetComponent.target).transform.position - ((Component)this).transform.position; obj.velocity = Vector3.RotateTowards(velocity, ((Vector3)(ref val)).normalized * targetSpeed, rotationSpeed * MathF.PI / 180f * Time.fixedDeltaTime, speedSpeed * Time.fixedDeltaTime); } } } public class CommandoUtilityJinkJet : Module { public class QuickDodge : BaseState { public override void OnEnter() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0032: 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_010f: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_0181: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Util.PlaySound("Play_commando_M2_grenade_explo", ((EntityState)this).gameObject); ChildLocator component = ((Component)((EntityState)this).GetModelAnimator()).GetComponent(); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded) { direction.y = 0.3f; } else { direction.y = Mathf.Min(direction.y, 0.15f); } ((Vector3)(ref direction)).Normalize(); GameObject jetEffect = DodgeState.jetEffect; if (Object.op_Implicit((Object)(object)jetEffect)) { Transform val = component.FindChild("LeftJet"); Transform val2 = component.FindChild("RightJet"); if (Object.op_Implicit((Object)(object)val)) { Object.Instantiate(jetEffect, val); } if (Object.op_Implicit((Object)(object)val2)) { Object.Instantiate(jetEffect, val2); } } float num = 1f; if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { num = ((EntityState)this).characterBody.sprintingSpeedMultiplier; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.velocity = Vector3.zero; float num2 = 1f; if (Item.instance.enabled) { num2 += (float)Item.instance.GetCountEffective(((EntityState)this).characterBody) * Item.instance.buffFrac * Module.instance.goFasterBuffFrac; } ((EntityState)this).characterMotor.velocity = direction * base.moveSpeedStat * num * 2.35f * num2; } if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } } private bool setupSucceeded; private SkillFamily targetSkillFamily; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilEndGame; [AutoConfigRoOSlider("{0:P0}", 0f, 10f, null, null)] [AutoConfig("Multiplier to GoFaster BuffFrac for this skill: multiplies launch speed.", AutoConfigFlags.None, new object[] { 0f, float.MaxValue })] public float goFasterBuffFrac { get; private set; } = 0.5f; public SkillDef skillDef { get; private set; } public override void SetupAttributes() { //IL_0021: 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_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) base.SetupAttributes(); skillDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/SkillDefs/CommandoUtilityJinkJet.asset"); targetSkillFamily = Addressables.LoadAssetAsync((object)"RoR2/Base/Commando/CommandoBodyUtilityFamily.asset").WaitForCompletion(); bool flag = default(bool); skillDef.activationState = ContentAddition.AddEntityState(ref flag); if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on CommandoUtilityJinkJet! Skill will not appear nor function."); } else if (!ContentAddition.AddSkillDef(skillDef)) { TinkersSatchelPlugin._logger.LogError((object)"SkillDef setup failed on CommandoUtilityJinkJet! Skill will not appear nor function."); } else { setupSucceeded = true; } Item.instance.handledSkillDefs.Add(skillDef); } public override void Install() { base.Install(); if (setupSucceeded) { targetSkillFamily.AddVariant(skillDef); } } public override void Uninstall() { base.Uninstall(); if (setupSucceeded) { targetSkillFamily.RemoveVariant(skillDef); } } } public class EngiPrimaryFlak : Module { public class FireContinuous : BaseSkillState, IStepSetter { public static GameObject effectPrefab; public static GameObject projectilePrefab; public static float recoilAmplitude = 1f; public static float spreadBloomValue = 0.3f; public static float baseDuration = 0.55f; private int whichMuzzle; private float duration; private void FireGrenade(string targetMuzzle) { //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_00b2: 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_00e2: 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_010f: 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) Util.PlaySound(FireGrenades.attackSoundString, ((EntityState)this).gameObject); Ray aimRay = ((BaseState)this).GetAimRay(); Transform modelTransform = ((EntityState)this).GetModelTransform(); ChildLocator val = default(ChildLocator); if (Object.op_Implicit((Object)(object)modelTransform) && ((Component)modelTransform).TryGetComponent(ref val)) { Transform val2 = val.FindChild(targetMuzzle); if (Object.op_Implicit((Object)(object)val2)) { ((Ray)(ref aimRay)).origin = val2.position; } } ((BaseState)this).AddRecoil(-1f * recoilAmplitude, -2f * recoilAmplitude, -1f * recoilAmplitude, 1f * recoilAmplitude); if (Object.op_Implicit((Object)(object)effectPrefab)) { EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, targetMuzzle, false); } if (((EntityState)this).isAuthority) { ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, ((EntityState)this).characterBody.spreadBloomAngle, 1f, 1f, 0f, 0f)), ((EntityState)this).gameObject, ((BaseState)this).damageStat, 0f, ((EntityState)this).characterBody.RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary); } ((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue); } public override void OnEnter() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), 3f, false); if (whichMuzzle == 0) { FireGrenade("MuzzleLeft"); ((EntityState)this).PlayCrossfade("Gesture Left Cannon, Additive", "FireGrenadeLeft", 0.1f); } else { FireGrenade("MuzzleRight"); ((EntityState)this).PlayCrossfade("Gesture Right Cannon, Additive", "FireGrenadeRight", 0.1f); } Util.PlaySound(ChargeGrenades.chargeLoopStartSoundString, ((EntityState)this).gameObject); } public override void OnExit() { ((EntityState)this).OnExit(); Util.PlaySound(ChargeGrenades.chargeLoopStopSoundString, ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } public void SetStep(int i) { whichMuzzle = i % 2; } } private bool setupSucceeded; private SkillFamily targetSkillFamily; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilEndGame; public GameObject projectilePrefab { get; private set; } public GameObject projectileGhost { get; private set; } public GameObject subProjectilePrefab { get; private set; } public GameObject subProjectileGhost { get; private set; } public SteppedSkillDef skillDef { get; private set; } public override void SetupAttributes() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/EngiFlakProjectile.prefab"); projectileGhost = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/Ghosts/EngiFlakGhost.prefab"); subProjectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/EngiFlakSubProjectile.prefab"); subProjectileGhost = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/Ghosts/EngiFlakSubGhost.prefab"); skillDef = ScriptableObject.CreateInstance(); ((SkillDef)skillDef).activationStateMachineName = "Weapon"; ((SkillDef)skillDef).skillNameToken = "TKSAT_ENGI_PRIMARY_FLAK_NAME"; ((SkillDef)skillDef).skillDescriptionToken = "TKSAT_ENGI_PRIMARY_FLAK_DESCRIPTION"; ((SkillDef)skillDef).interruptPriority = (InterruptPriority)0; ((SkillDef)skillDef).icon = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Textures/SkillIcons/EngiPrimaryFlak.png"); ((SkillDef)skillDef).baseRechargeInterval = 0f; ((SkillDef)skillDef).baseMaxStock = 1; ((SkillDef)skillDef).rechargeStock = 1; ((SkillDef)skillDef).requiredStock = 1; ((SkillDef)skillDef).stockToConsume = 1; ((SkillDef)skillDef).resetCooldownTimerOnUse = true; ((SkillDef)skillDef).fullRestockOnAssign = true; ((SkillDef)skillDef).dontAllowPastMaxStocks = false; ((SkillDef)skillDef).beginSkillCooldownOnSkillEnd = true; ((SkillDef)skillDef).cancelSprintingOnActivation = true; ((SkillDef)skillDef).forceSprintDuringState = false; ((SkillDef)skillDef).canceledFromSprinting = false; ((SkillDef)skillDef).isCombatSkill = true; ((SkillDef)skillDef).mustKeyPress = false; skillDef.stepCount = 2; skillDef.stepGraceDuration = 0.1f; Material material = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/matEngiTurret.mat").WaitForCompletion(); Material material2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/matTracerBrightTransparent.mat").WaitForCompletion(); GameObject effectPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/MuzzleflashSmokeRing.prefab").WaitForCompletion(); GameObject lifetimeExpiredEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiGrenadeExplosion.prefab").WaitForCompletion(); GameObject impactEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/Commando/HitsparkCommando.prefab").WaitForCompletion(); targetSkillFamily = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiBodyPrimaryFamily.asset").WaitForCompletion(); projectilePrefab.GetComponent().lifetimeExpiredEffect = lifetimeExpiredEffect; projectilePrefab.GetComponent().impactEffect = impactEffect; subProjectilePrefab.GetComponent().impactEffect = impactEffect; ((Renderer)projectileGhost.GetComponent()).material = material; ((Renderer)((Component)subProjectileGhost.transform.Find("SpikeModel")).GetComponent()).material = material; ((Renderer)((Component)subProjectileGhost.transform.Find("Trail")).GetComponent()).material = material2; FireContinuous.projectilePrefab = projectilePrefab; FireContinuous.effectPrefab = effectPrefab; bool flag = default(bool); ((SkillDef)skillDef).activationState = ContentAddition.AddEntityState(ref flag); ContentAddition.AddProjectile(projectilePrefab); ContentAddition.AddProjectile(subProjectilePrefab); if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on EngiPrimaryFlak! Skill will not appear nor function."); } else if (!ContentAddition.AddSkillDef((SkillDef)(object)skillDef)) { TinkersSatchelPlugin._logger.LogError((object)"SkillDef setup failed on EngiPrimaryFlak! Skill will not appear nor function."); } else { setupSucceeded = true; } } public override void Install() { base.Install(); if (setupSucceeded) { targetSkillFamily.AddVariant((SkillDef)(object)skillDef); } } public override void Uninstall() { base.Uninstall(); if (setupSucceeded) { targetSkillFamily.RemoveVariant((SkillDef)(object)skillDef); } } } public class EngiFlakShrapnelSpawner : MonoBehaviour { public Transform[] childPoints; public ProjectileController projc; public ProjectileDamage projd; public TeamFilter filt; public float range; public GameObject projectilePrefab; private const float MAX_TWEAK_ANGLE = 75f; public void OnDetonate() { //IL_0006: 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) HurtBox val = default(HurtBox); TeamComponent val2 = default(TeamComponent); IEnumerable hits = from x in Physics.OverlapSphere(((Component)this).transform.position, range, LayerMask.op_Implicit(CommonMasks.bullet), (QueryTriggerInteraction)1) where ((Component)x).TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.healthComponent) && ((Component)val.healthComponent).TryGetComponent(ref val2) && val2.teamIndex != filt.teamIndex select x; Transform[] array = childPoints; foreach (Transform originalPoint in array) { FireSmartAimShrapnel(originalPoint, hits); } } public void FireSmartAimShrapnel(Transform originalPoint, IEnumerable hits) { //IL_0008: 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_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_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_010e: 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_0131: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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) Ray ray = new Ray(originalPoint.position, originalPoint.forward); IEnumerable<(Collider, Vector3, float)> source = from x in hits.Select(delegate(Collider x) { //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_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) //IL_0021: 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_0029: 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_002c: 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) Vector3 val = x.ClosestPoint(((Ray)(ref ray)).origin) - ((Ray)(ref ray)).origin; Vector3 normalized = ((Vector3)(ref val)).normalized; return (x, normalized, Vector3.Angle(normalized, ((Ray)(ref ray)).direction)); }) where x.angle < 75f select x; if (source.Count() > 0) { ((Ray)(ref ray)).direction = source.OrderBy<(Collider, Vector3, float), float>(((Collider collider, Vector3 direction, float angle) x) => x.angle).First().Item2; } ProjectileManager.instance.FireProjectile(new FireProjectileInfo { damage = projd.damage * 0.25f, crit = projd.crit, damageColorIndex = (DamageColorIndex)0, force = 0f, owner = projc.owner, position = originalPoint.position, procChainMask = projc.procChainMask, projectilePrefab = Module.instance.subProjectilePrefab, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref ray)).direction), damageTypeOverride = DamageTypeCombo.GenericPrimary }); } } public class EngiSecondaryChaff : Module { public class Fire : BaseSkillState { public static GameObject effectPrefab; public static float recoilAmplitude = 0.5f; public static float spreadBloomValue = 0.15f; public static float baseDuration = 0.6f; public static float coneRange = 20f; public static float coneHalfAngleDegrees = 60f; public static float damageCoeff = 0.75f; public static int iterations = 4; private float duration; private float stopwatch; private Ray initialAimRay; private int firedCount; public override void OnEnter() { //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_0026: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; initialAimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).StartAimMode(initialAimRay, 2f, false); } public void FireFX() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_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) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown if (firedCount % 2 == 0) { ((EntityState)this).PlayCrossfade("Gesture Left Cannon, Additive", "FireGrenadeLeft", 0.1f); } else { ((EntityState)this).PlayCrossfade("Gesture Right Cannon, Additive", "FireGrenadeRight", 0.1f); } if (Object.op_Implicit((Object)(object)effectPrefab)) { EffectManager.SpawnEffect(effectPrefab, new EffectData { origin = ((Ray)(ref initialAimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref initialAimRay)).direction) }, true); } Util.PlaySound("Play_item_proc_firework_explo", ((EntityState)this).gameObject); } public void CleanseProjectiles(Ray aim) { //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_003b: Unknown result type (might be due to invalid IL or missing references) //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_004c: 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_0072: 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) float num = coneRange * coneRange; TeamIndex teamIndex = ((EntityState)this).teamComponent.teamIndex; List list = new List(); foreach (ProjectileController instances in InstanceTracker.GetInstancesList()) { Vector3 val = ((Component)instances).transform.position - ((Ray)(ref aim)).origin; if (!instances.cannotBeDeleted && instances.teamFilter.teamIndex != teamIndex && ((Vector3)(ref val)).sqrMagnitude < num && Vector3.Angle(((Ray)(ref aim)).direction, val) < coneHalfAngleDegrees) { list.Add(instances); } } for (int num2 = list.Count - 1; num2 >= 0; num2--) { Object.Destroy((Object)(object)((Component)list[num2]).gameObject); } } public void FireCone(Ray aim) { //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_0013: 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_00ec: 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) //IL_0111: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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: 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_0194: 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_01a0: Expected O, but got Unknown //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: 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_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) IEnumerable enumerable = from x in Physics.OverlapSphere(((Ray)(ref aim)).origin, coneRange, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)) where Vector3.Angle(((Ray)(ref aim)).direction, x.ClosestPoint(((Ray)(ref aim)).origin) - ((Ray)(ref aim)).origin) < coneHalfAngleDegrees select x; HashSet hashSet = new HashSet(); HurtBox hb = default(HurtBox); RaycastHit val3 = default(RaycastHit); foreach (Collider item in enumerable) { if (!Object.op_Implicit((Object)(object)item) || !((Component)item).TryGetComponent(ref hb) || !Object.op_Implicit((Object)(object)hb.healthComponent) || hashSet.Contains(hb.healthComponent)) { continue; } hashSet.Add(hb.healthComponent); if ((Object)(object)((EntityState)this).healthComponent == (Object)(object)hb.healthComponent || !FriendlyFireManager.ShouldSplashHitProceed(hb.healthComponent, ((EntityState)this).teamComponent.teamIndex)) { continue; } DamageInfo val = new DamageInfo { attacker = ((Component)((EntityState)this).characterBody).gameObject, canRejectForce = true, crit = ((EntityState)this).characterBody.RollCrit(), damage = ((EntityState)this).characterBody.damage * damageCoeff, damageColorIndex = (DamageColorIndex)0, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)131072), (DamageTypeExtended)0, (DamageSource)2), force = Vector3.zero, inflictor = null, procChainMask = default(ProcChainMask), procCoefficient = 0.5f, position = ((Component)hb).transform.position }; hb.healthComponent.TakeDamage(val); if (val.rejected || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master) || ((EntityState)this).characterBody.master.deployablesList == null || !Object.op_Implicit((Object)(object)hb.healthComponent.body) || !Object.op_Implicit((Object)(object)hb.healthComponent.body.master)) { continue; } BaseAI val2 = ((IEnumerable)hb.healthComponent.body.master.aiComponents).FirstOrDefault((Func)((BaseAI x) => ((Behaviour)x).isActiveAndEnabled)); if (!((Object)(object)val2 != (Object)null)) { continue; } foreach (DeployableInfo item2 in ((EntityState)this).characterBody.master.deployablesList.Where((DeployableInfo x) => Object.op_Implicit((Object)(object)x.deployable) && (int)x.slot == 1).OrderBy(delegate(DeployableInfo x) { //IL_0000: 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_0020: 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) Vector3 val4 = ((Component)x.deployable).transform.position - hb.healthComponent.body.aimOrigin; return ((Vector3)(ref val4)).sqrMagnitude; })) { Vector3 aimOrigin = hb.healthComponent.body.aimOrigin; Vector3 position = ((Component)item2.deployable).transform.position; CharacterMaster component = ((Component)item2.deployable).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { continue; } CharacterBody body = component.GetBody(); if (Object.op_Implicit((Object)(object)body)) { if (Object.op_Implicit((Object)(object)body.mainHurtBox)) { position = ((Component)body.mainHurtBox).transform.position; } if (!Physics.Linecast(aimOrigin, position, ref val3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { TauntDebuffController.ApplyTaunt(val2, body, 6f); } } } } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_008f: 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) ((EntityState)this).FixedUpdate(); stopwatch -= Time.fixedDeltaTime; while (stopwatch <= 0f && firedCount < iterations) { firedCount++; stopwatch += duration / (float)iterations; ((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue); ((BaseState)this).AddRecoil(-1f * recoilAmplitude, -2f * recoilAmplitude, -1f * recoilAmplitude, 1f * recoilAmplitude); FireFX(); CleanseProjectiles(initialAimRay); FireCone(initialAimRay); } if (((EntityState)this).isAuthority && firedCount >= iterations) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } private bool setupSucceeded; private SkillFamily targetSkillFamily; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilEndGame; public SkillDef skillDef { get; private set; } public override void SetupAttributes() { //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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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) base.SetupAttributes(); GameObject obj = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Misc/EngiChaffFlareEffect.prefab"); skillDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/SkillDefs/EngiSecondaryChaff.asset"); targetSkillFamily = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiBodySecondaryFamily.asset").WaitForCompletion(); Material material = Addressables.LoadAssetAsync((object)"RoR2/Base/Firework/matFireworkSparkle.mat").WaitForCompletion(); ((Renderer)obj.GetComponent()).material = material; Fire.effectPrefab = obj; ContentAddition.AddEffect(obj); bool flag = default(bool); skillDef.activationState = ContentAddition.AddEntityState(ref flag); if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on EngiSecondaryChaff! Skill will not appear nor function."); } else if (!ContentAddition.AddSkillDef(skillDef)) { TinkersSatchelPlugin._logger.LogError((object)"SkillDef setup failed on EngiSecondaryChaff! Skill will not appear nor function."); } else { setupSucceeded = true; } } public override void Install() { base.Install(); if (setupSucceeded) { targetSkillFamily.AddVariant(skillDef); } } public override void Uninstall() { base.Uninstall(); if (setupSucceeded) { targetSkillFamily.RemoveVariant(skillDef); } } } public class EngiUtilitySpeedispenser : Module { public class PlaceDispenser : PlaceTurret { public struct MsgConstructDispenser : INetMessage, ISerializableObject { private CharacterBody _body; private Vector3 _pos; private Quaternion _rot; private MasterIndex _masterIndex; public MsgConstructDispenser(CharacterBody body, Vector3 pos, Quaternion rot, MasterIndex masterIndex) { //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_000f: 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_0016: 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) _body = body; _pos = pos; _rot = rot; _masterIndex = masterIndex; } public void Deserialize(NetworkReader reader) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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) GameObject val = reader.ReadGameObject(); if (Object.op_Implicit((Object)(object)val)) { _body = val.GetComponent(); } _pos = reader.ReadVector3(); _rot = reader.ReadQuaternion(); _masterIndex = (MasterIndex)reader.ReadInt32(); } public readonly void Serialize(NetworkWriter writer) { //IL_0013: 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_002b: Unknown result type (might be due to invalid IL or missing references) writer.Write(((Component)_body).gameObject); writer.Write(_pos); writer.Write(_rot); writer.Write((int)_masterIndex); } public readonly void OnReceived() { //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_002c: 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_003d: Unknown result type (might be due to invalid IL or missing references) //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_0049: 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_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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_body) && Object.op_Implicit((Object)(object)_body.master)) { CharacterMaster val = new MasterSummon { masterPrefab = MasterCatalog.GetMasterPrefab(_masterIndex), position = _pos, rotation = _rot, summonerBodyObject = ((Component)_body).gameObject, ignoreTeamMemberLimit = true, inventoryToCopy = _body.inventory }.Perform(); Deployable val2 = ((Component)val).gameObject.AddComponent(); val2.onUndeploy = new UnityEvent(); val2.onUndeploy.AddListener(new UnityAction(val.TrueKill)); _body.master.AddDeployable(val2, Module.instance.deployableSlot); } } } public override void OnEnter() { //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) base.wristDisplayPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiTurretWristDisplay.prefab").WaitForCompletion(); base.blueprintPrefab = Module.instance.deployableBlueprint; base.turretMasterPrefab = Module.instance.deployableMaster; ((PlaceTurret)this).OnEnter(); } public override void FixedUpdate() { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).fixedAge = ((EntityState)this).fixedAge + Time.fixedDeltaTime; if (!((EntityState)this).isAuthority) { return; } base.entryCountdown -= Time.fixedDeltaTime; if (base.exitPending) { base.exitCountdown -= Time.fixedDeltaTime; if (base.exitCountdown <= 0f) { ((EntityState)this).outer.SetNextStateToMain(); } } else { if (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank) || !(base.entryCountdown <= 0f)) { return; } bool num = (((EntityState)this).inputBank.skill1.down || ((ButtonState)(ref ((EntityState)this).inputBank.skill4)).justPressed) && base.currentPlacementInfo.ok; bool justPressed = ((ButtonState)(ref ((EntityState)this).inputBank.skill2)).justPressed; if (!(num || justPressed)) { return; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && !justPressed) { NetMessageExtensions.Send((INetMessage)(object)new MsgConstructDispenser(((EntityState)this).characterBody, base.currentPlacementInfo.position, base.currentPlacementInfo.rotation, MasterCatalog.FindMasterIndex(base.turretMasterPrefab)), (NetworkDestination)2); if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator)) { GenericSkill skill = ((EntityState)this).skillLocator.GetSkill((SkillSlot)2); if (Object.op_Implicit((Object)(object)skill)) { skill.DeductStock(1); } } Util.PlaySound(base.placeSoundString, ((EntityState)this).gameObject); } ((PlaceTurret)this).DestroyBlueprints(); base.exitPending = true; } } } public class DispenserMainState : BaseMainState { public override bool shouldShowEnergy => true; public override string GetContextString(Interactor activator) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)((BaseCaptainSupplyDropState)this).GetInteractability(activator) == 1) { if (((BaseCaptainSupplyDropState)this).energyComponent.energy < 1f) { return Language.GetString("TKSAT_ENGI_SPEEDISPENSER_CONTEXT_CHARGING"); } return Language.GetString("TKSAT_ENGI_SPEEDISPENSER_CONTEXT_ALREADY_HAVE"); } return Language.GetString("TKSAT_ENGI_SPEEDISPENSER_CONTEXT"); } public override Interactability GetInteractability(Interactor activator) { CharacterBody component = ((Component)activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (!(((BaseCaptainSupplyDropState)this).energyComponent.energy < 1f) && !component.HasBuff(Module.instance.speedBuff)) { return (Interactability)2; } return (Interactability)1; } return (Interactability)0; } public override void OnInteractionBegin(Interactor activator) { CharacterBody component = ((Component)activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((BaseCaptainSupplyDropState)this).energyComponent.TakeEnergy(1f); component.AddTimedBuff(Module.instance.speedBuff, 15f); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static GetDeployableSameSlotLimit <>9__29_0; internal int b__29_0(CharacterMaster master, int countMult) { return 1; } } private bool setupSucceeded; private SkillFamily targetSkillFamily; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilEndGame; public SkillDef skillDef { get; private set; } public GameObject deployableBody { get; private set; } public GameObject deployableMaster { get; private set; } public GameObject deployableBlueprint { get; private set; } public BuffDef speedBuff { get; private set; } public DeployableSlot deployableSlot { get; private set; } public override void SetupAttributes() { //IL_0066: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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) //IL_00a1: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_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) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0521: 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_0504: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Expected O, but got Unknown base.SetupAttributes(); skillDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/SkillDefs/EngiUtilitySpeedispenser.asset"); GameObject val = PrefabAPI.InstantiateClone(TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserBody.prefab"), "TkSatTempSetupPrefab", false); deployableMaster = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserMaster.prefab"); deployableBlueprint = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserBlueprints.prefab"); targetSkillFamily = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiBodyUtilityFamily.asset").WaitForCompletion(); GameObject obj = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Captain/CaptainSupplyDrop, EquipmentRestock.prefab").WaitForCompletion(), "TkSatTempSetupPrefab2", false); Sprite iconSprite = Addressables.LoadAssetAsync((object)"RoR2/DLC1/AttackSpeedAndMoveSpeed/texCoffeeIcon.png").WaitForCompletion(); Material material = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/matEngiTurret.mat").WaitForCompletion(); Material val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/matBlueprintsOk.mat").WaitForCompletion(); Material invalidMaterial = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/matBlueprintsInvalid.mat").WaitForCompletion(); CharacterCameraParams cameraParams = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/ccpStandard.asset").WaitForCompletion(); GameObject val3 = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiTurretBlueprints.prefab").WaitForCompletion(); GameObject val4 = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiTurretBody.prefab").WaitForCompletion(); Material material2 = ((Component)val3.transform.Find("BlobLightProjector")).GetComponent().material; speedBuff = ScriptableObject.CreateInstance(); speedBuff.buffColor = Color.white; speedBuff.canStack = false; speedBuff.isDebuff = false; ((Object)speedBuff).name = "TKSATEngiSpeedispenserBuff"; speedBuff.iconSprite = iconSprite; val.GetComponent().cameraParams = cameraParams; ((Renderer)((Component)val.GetComponent().modelTransform).GetComponent()).material = material; Transform val5 = obj.transform.Find("ModelBase/captain supply drop/EnergyIndicatorContainer"); val5.SetParent(val.transform); val5.localScale *= 0.5f; val5.position -= new Vector3(0f, 1.5f, 0f); ChildLocator component = ((Component)val.GetComponent().modelTransform).GetComponent(); component.transformPairs[0].transform = val5; component.transformPairs[1].transform = val5.Find("Canvas/EnergyIndicatorBackgroundPanel/EnergyIndicator"); Object.Destroy((Object)(object)obj); deployableBody = PrefabAPI.InstantiateClone(val, "EngiSpeedispenserBody", true); Object.Destroy((Object)(object)val); deployableMaster.GetComponent().bodyPrefab = deployableBody; ((Component)deployableBlueprint.transform.Find("BlobLight")).GetComponent().material = material2; ((Renderer)((Component)deployableBlueprint.transform.Find("Model Base/SpeedispenserModel")).GetComponent()).material = val2; BlueprintController component2 = deployableBlueprint.GetComponent(); component2.okMaterial = val2; component2.invalidMaterial = invalidMaterial; AkEvent[] components = val3.GetComponents(); foreach (AkEvent val6 in components) { AkEvent obj2 = deployableBlueprint.AddComponent(); ((AkTriggerHandler)obj2).triggerList = ((AkTriggerHandler)val6).triggerList.ToArray().ToList(); ((AkTriggerHandler)obj2).useOtherObject = ((AkTriggerHandler)val6).useOtherObject; obj2.actionOnEventType = val6.actionOnEventType; obj2.curveInterpolation = val6.curveInterpolation; obj2.enableActionOnEvent = val6.enableActionOnEvent; obj2.data = val6.data; obj2.useCallbacks = val6.useCallbacks; obj2.Callbacks = val6.Callbacks.ToArray().ToList(); obj2.playingId = val6.playingId; obj2.soundEmitterObject = deployableBlueprint; obj2.transitionDuration = val6.transitionDuration; } components = val4.GetComponents(); foreach (AkEvent val7 in components) { AkEvent obj3 = deployableBody.AddComponent(); ((AkTriggerHandler)obj3).triggerList = ((AkTriggerHandler)val7).triggerList.ToArray().ToList(); ((AkTriggerHandler)obj3).useOtherObject = ((AkTriggerHandler)val7).useOtherObject; obj3.actionOnEventType = val7.actionOnEventType; obj3.curveInterpolation = val7.curveInterpolation; obj3.enableActionOnEvent = val7.enableActionOnEvent; obj3.data = val7.data; obj3.useCallbacks = val7.useCallbacks; obj3.Callbacks = val7.Callbacks.ToArray().ToList(); obj3.playingId = val7.playingId; obj3.soundEmitterObject = deployableBody; obj3.transitionDuration = val7.transitionDuration; } bool flag = default(bool); SerializableEntityStateType val8 = ContentAddition.AddEntityState(ref flag); if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on EngiUtilitySpeedispenser (DispenserMainState)! Deployable will be unusable."); } else { EntityStateMachine component3 = deployableBody.GetComponent(); component3.initialStateType = val8; component3.mainStateType = val8; } NetworkingAPI.RegisterMessageType(); ContentAddition.AddBuffDef(speedBuff); ContentAddition.AddBody(deployableBody); ContentAddition.AddMaster(deployableMaster); object obj4 = <>c.<>9__29_0; if (obj4 == null) { GetDeployableSameSlotLimit val9 = (CharacterMaster master, int countMult) => 1; <>c.<>9__29_0 = val9; obj4 = (object)val9; } deployableSlot = DeployableAPI.RegisterDeployableSlot((GetDeployableSameSlotLimit)obj4); skillDef.activationState = ContentAddition.AddEntityState(ref flag); if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on EngiUtilitySpeedispenser! Skill will not appear nor function."); } else if (!ContentAddition.AddSkillDef(skillDef)) { TinkersSatchelPlugin._logger.LogError((object)"SkillDef setup failed on EngiUtilitySpeedispenser! Skill will not appear nor function."); } else { setupSucceeded = true; } } public override void Install() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown base.Install(); if (setupSucceeded) { targetSkillFamily.AddVariant(skillDef); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } } public override void Uninstall() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown base.Uninstall(); if (setupSucceeded) { targetSkillFamily.RemoveVariant(skillDef); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && sender.HasBuff(speedBuff) && sender.isSprinting) { args.moveSpeedMultAdd += 0.5f; args.jumpPowerMultAdd += 0.25f; } } } public class HuntressPrimaryBombArrow : Module { public class Fire : BaseSkillState { public static float baseDuration = 0.45f; public static float damageModifier = 1.5f; public const string ATTACK_SOUND_STRING = "Play_huntress_m1_ready"; public const string MUZZLE_STRING = "Muzzle"; private bool hasFired; private Animator animator; private float duration; private void FireProjectile() { //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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_00af: 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) EffectManager.SimpleMuzzleFlash(Module.instance.muzzleFlashPrefab, ((EntityState)this).gameObject, "Muzzle", true); Ray aimRay = ((BaseState)this).GetAimRay(); Transform modelTransform = ((EntityState)this).GetModelTransform(); ChildLocator val = default(ChildLocator); if (Object.op_Implicit((Object)(object)modelTransform) && ((Component)modelTransform).TryGetComponent(ref val)) { Transform val2 = val.FindChild("Muzzle"); if (Object.op_Implicit((Object)(object)val2)) { ((Ray)(ref aimRay)).origin = val2.position; } } if (((EntityState)this).isAuthority) { ProjectileManager.instance.FireProjectile(Module.instance.projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageModifier, 0f, ((EntityState)this).characterBody.RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary); } } public override void OnEnter() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Util.PlayAttackSpeedSound("Play_huntress_m1_ready", ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); duration = baseDuration / ((BaseState)this).attackSpeedStat; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { animator = ((Component)modelTransform).GetComponent(); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), duration + 1f, false); } ((EntityState)this).PlayCrossfade("Gesture, Override", "FireSeekingShot", "FireSeekingShot.playbackRate", duration, duration * 0.2f / ((BaseState)this).attackSpeedStat); ((EntityState)this).PlayCrossfade("Gesture, Additive", "FireSeekingShot", "FireSeekingShot.playbackRate", duration, duration * 0.2f / ((BaseState)this).attackSpeedStat); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired && animator.GetFloat("FireSeekingShot.fire") > 0f) { hasFired = true; FireProjectile(); } if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } private bool setupSucceeded; private SkillFamily targetSkillFamily; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilEndGame; public SkillDef skillDef { get; private set; } public GameObject muzzleFlashPrefab { get; private set; } public GameObject projectilePrefab { get; private set; } public override void SetupAttributes() { //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_005f: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0090: 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_00e9: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); skillDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/SkillDefs/HuntressPrimaryBombArrow.asset"); projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/HuntressBombArrowProjectile.prefab"); GameObject val = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Projectiles/Ghosts/HuntressBombArrowGhost.prefab"); muzzleFlashPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/MuzzleflashHuntress.prefab").WaitForCompletion(); targetSkillFamily = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/HuntressBodyPrimaryFamily.asset").WaitForCompletion(); Material material = Addressables.LoadAssetAsync((object)"RoR2/Base/Firework/matFireworkSparkle.mat").WaitForCompletion(); GameObject explosionEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/OmniImpactVFXHuntress.prefab").WaitForCompletion(); ((Renderer)((Component)val.transform.Find("Sparks")).gameObject.GetComponent()).material = material; projectilePrefab.GetComponent().ghostPrefab = val; projectilePrefab.GetComponent().explosionEffect = explosionEffect; bool flag = default(bool); skillDef.activationState = ContentAddition.AddEntityState(ref flag); ContentAddition.AddProjectile(projectilePrefab); if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on HuntressPrimaryBombArrow! Skill will not appear nor function."); } else if (!ContentAddition.AddSkillDef(skillDef)) { TinkersSatchelPlugin._logger.LogError((object)"SkillDef setup failed on HuntressPrimaryBombArrow! Skill will not appear nor function."); } else { setupSucceeded = true; } } public override void Install() { base.Install(); if (setupSucceeded) { targetSkillFamily.AddVariant(skillDef); } } public override void Uninstall() { base.Uninstall(); if (setupSucceeded) { targetSkillFamily.RemoveVariant(skillDef); } } } public class HuntressSecondaryBola : Module { public class ThrowBola : ThrowGlaive { } private bool setupSucceeded; private SkillFamily targetSkillFamily; public override AutoConfigFlags enabledConfigFlags => AutoConfigFlags.DeferUntilEndGame; public SkillDef skillDef { get; private set; } public GameObject muzzleFlashPrefab { get; private set; } public GameObject orbEffectPrefab { get; private set; } public GameObject tetherPrefab { get; private set; } public override void SetupAttributes() { //IL_0036: 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_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_0066: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) base.SetupAttributes(); skillDef = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/SkillDefs/HuntressSecondaryBola.asset"); tetherPrefab = TinkersSatchelPlugin.resources.LoadAsset("Assets/TinkersSatchel/Prefabs/Misc/BolaTether.prefab"); muzzleFlashPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/MuzzleflashHuntress.prefab").WaitForCompletion(); targetSkillFamily = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/HuntressBodySecondaryFamily.asset").WaitForCompletion(); orbEffectPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/HuntressGlaiveOrbEffect.prefab").WaitForCompletion(); bool flag = default(bool); skillDef.activationState = ContentAddition.AddEntityState(ref flag); if (!flag) { TinkersSatchelPlugin._logger.LogError((object)"EntityState setup failed on HuntressSecondaryBola! Skill will not appear nor function."); } else if (!ContentAddition.AddSkillDef(skillDef)) { TinkersSatchelPlugin._logger.LogError((object)"SkillDef setup failed on HuntressSecondaryBola! Skill will not appear nor function."); } else { setupSucceeded = true; } } public override void Install() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown base.Install(); if (setupSucceeded) { targetSkillFamily.AddVariant(skillDef); ThrowGlaive.FireOrbGlaive += new hook_FireOrbGlaive(ThrowGlaive_FireOrbGlaive); } } public override void Uninstall() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown base.Uninstall(); if (setupSucceeded) { targetSkillFamily.RemoveVariant(skillDef); ThrowGlaive.FireOrbGlaive -= new hook_FireOrbGlaive(ThrowGlaive_FireOrbGlaive); } } private void ThrowGlaive_FireOrbGlaive(orig_FireOrbGlaive orig, ThrowGlaive self) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_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_00d3: 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) if (self is ThrowBola) { if (NetworkServer.active && !self.hasTriedToThrowGlaive) { self.hasTriedToThrowGlaive = true; if (Object.op_Implicit((Object)(object)self.initialOrbTarget)) { self.hasSuccessfullyThrownGlaive = true; Transform val = self.childLocator.FindChild("HandR"); EffectManager.SimpleMuzzleFlash(ThrowGlaive.muzzleFlashPrefab, ((EntityState)self).gameObject, "HandR", true); BolaOrb bolaOrb = new BolaOrb { lightningType = (LightningType)4, damageValue = 0f, teamIndex = TeamComponent.GetObjectTeam(((EntityState)self).gameObject), attacker = ((EntityState)self).gameObject, bouncesRemaining = 0, speed = 60f, bouncedObjects = new List(), range = 100f, origin = val.position, target = self.initialOrbTarget, damageType = DamageTypeCombo.GenericSecondary }; OrbManager.instance.AddOrb((Orb)(object)bolaOrb); } } } else { orig.Invoke(self); } } } public class BolaOrb : LightningOrb { public override void Begin() { //IL_0003: 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_001a: 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_0031: Expected O, but got Unknown base.lightningType = (LightningType)10; ((Orb)this).duration = 0.5f; EffectData val = new EffectData { origin = ((Orb)this).origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(((Orb)this).target); EffectManager.SpawnEffect(Module.instance.orbEffectPrefab, val, true); } public override void OnArrival() { ((LightningOrb)this).OnArrival(); CharacterBody attacker = default(CharacterBody); if (Object.op_Implicit((Object)(object)((Orb)this).target.healthComponent.body) && base.attacker.TryGetComponent(ref attacker)) { BolaTetherController.Inflict(((Orb)this).target.healthComponent.body, attacker); Util.PlaySound("Play_item_proc_whip", ((Component)((Orb)this).target).gameObject); } } } [RequireComponent(typeof(BezierCurveLine))] public class BolaTetherController : NetworkBehaviour { public struct MsgSetTargets : INetMessage, ISerializableObject { private BolaTetherController sender; private GameObject primaryTargetRoot; private GameObject targetRoot; private GameObject attackerRoot; public MsgSetTargets(BolaTetherController sender, GameObject primaryTargetRoot, GameObject targetRoot, GameObject attackerRoot) { this.sender = sender; this.primaryTargetRoot = primaryTargetRoot; this.targetRoot = targetRoot; this.attackerRoot = attackerRoot; } public void Deserialize(NetworkReader reader) { sender = reader.ReadGameObject().GetComponent(); primaryTargetRoot = reader.ReadGameObject(); targetRoot = reader.ReadGameObject(); attackerRoot = reader.ReadGameObject(); } public readonly void Serialize(NetworkWriter writer) { writer.Write(((Component)sender).gameObject); writer.Write(primaryTargetRoot); writer.Write(targetRoot); writer.Write(attackerRoot); } public readonly void OnReceived() { sender.primaryTargetRoot = primaryTargetRoot; sender.targetRoot = targetRoot; sender.attackerBody = attackerRoot.GetComponent(); } } private BezierCurveLine bezierCurveLine; private GameObject targetRoot; private GameObject primaryTargetRoot; private CharacterBody attackerBody; private const float REEL_SPEED = 10f; private const float TICK_INTERVAL = 0.5f; private const float ATTACH_TIME = 0.5f; private const int TICK_COUNT = 8; private const float RADIUS = 25f; private const float DAMAGE_PER_TICK = 0.375f; private float tickStopwatch; private int ticksRemaining = 8; private float fixedAge; private float age; private bool beginSiphon; private HealthComponent targetHealthComponent; private HealthComponent primaryTargetHealthComponent; public static void Inflict(CharacterBody victim, CharacterBody attacker) { //IL_0009: 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_000f: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_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_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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_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_0050: 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) //IL_00c1: 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) if (!NetworkServer.active) { return; } Vector3 corePosition = victim.corePosition; BullseyeSearch val = new BullseyeSearch { searchOrigin = corePosition, maxDistanceFilter = 25f, teamMaskFilter = TeamMask.GetEnemyTeams(attacker.teamComponent.teamIndex), sortMode = (SortMode)1, filterByLoS = true, searchDirection = Vector3.up }; val.RefreshCandidates(); foreach (HealthComponent item in from e in val.GetResults() select e.healthComponent into h where Object.op_Implicit((Object)(object)h) select h) { GameObject obj = Object.Instantiate(Module.instance.tetherPrefab, corePosition, Quaternion.identity); NetMessageExtensions.Send((INetMessage)(object)new MsgSetTargets(obj.GetComponent(), ((Component)victim).gameObject, ((Component)item).gameObject, ((Component)attacker).gameObject), (NetworkDestination)2); NetworkServer.Spawn(obj); item.body.AddTimedBuff(Buffs.Slow50, 4f); } } private void Awake() { bezierCurveLine = ((Component)this).GetComponent(); } private void DoDamageTick() { //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_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_0049: 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_0061: 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_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) //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_008b: 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) //IL_009d: 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_00a7: 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) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)targetHealthComponent)) { targetHealthComponent = targetRoot.GetComponent(); } if (Object.op_Implicit((Object)(object)primaryTargetRoot)) { DamageInfo val = new DamageInfo { position = targetRoot.transform.position, attacker = ((Component)attackerBody).gameObject, inflictor = null, damage = 0.375f * attackerBody.damage, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)0), crit = attackerBody.RollCrit(), force = Vector3.zero, procChainMask = default(ProcChainMask), procCoefficient = 0.25f }; targetHealthComponent.TakeDamage(val); if (!targetHealthComponent.alive && NetworkServer.active) { targetRoot = null; NetMessageExtensions.Send((INetMessage)(object)new MsgSetTargets(this, primaryTargetRoot, null, ((Component)attackerBody).gameObject), (NetworkDestination)1); } } } private Vector3 GetTargetRootPosition() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) if (Object.op_Implicit((Object)(object)targetHealthComponent)) { return targetHealthComponent.body.corePosition; } if (Object.op_Implicit((Object)(object)targetRoot)) { return targetRoot.transform.position; } return ((Component)this).transform.position; } private Vector3 GetPrimaryTargetRootPosition() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)primaryTargetHealthComponent) && Object.op_Implicit((Object)(object)primaryTargetRoot)) { primaryTargetHealthComponent = primaryTargetRoot.GetComponent(); } if (Object.op_Implicit((Object)(object)primaryTargetHealthComponent)) { return primaryTargetHealthComponent.body.corePosition; } if (Object.op_Implicit((Object)(object)primaryTargetRoot)) { return primaryTargetRoot.transform.position; } return ((Component)this).transform.position; } private void Update() { //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_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_002b: 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_0044: 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_0052: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; Vector3 primaryTargetRootPosition = GetPrimaryTargetRootPosition(); Vector3 targetRootPosition = GetTargetRootPosition(); ((Component)bezierCurveLine).transform.position = primaryTargetRootPosition; bezierCurveLine.endTransform.position = (beginSiphon ? targetRootPosition : Vector3.Lerp(primaryTargetRootPosition, targetRootPosition, age / 0.5f)); } private void FixedUpdate() { //IL_00a7: 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) //IL_00b2: 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) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_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_010e: Unknown result type (might be due to invalid IL or missing references) fixedAge += Time.fixedDeltaTime; if (!Object.op_Implicit((Object)(object)targetRoot) || (Object.op_Implicit((Object)(object)targetHealthComponent) && !targetHealthComponent.alive)) { if (NetworkServer.active) { Object.Destroy((Object)(object)((Component)this).gameObject); } return; } if (!beginSiphon && fixedAge >= 0.5f) { beginSiphon = true; return; } if (Object.op_Implicit((Object)(object)primaryTargetRoot) && Util.HasEffectiveAuthority(targetRoot) && (Object)(object)targetRoot != (Object)(object)primaryTargetRoot) { Vector3 val = primaryTargetRoot.transform.position - GetTargetRootPosition(); Vector3 val2 = ((Vector3)(ref val)).normalized * 10f * Time.fixedDeltaTime; CharacterMotor val3 = default(CharacterMotor); Rigidbody val4 = default(Rigidbody); if (targetRoot.TryGetComponent(ref val3)) { CharacterMotor obj = val3; obj.rootMotion += val2; } else if (targetRoot.TryGetComponent(ref val4)) { Rigidbody obj2 = val4; obj2.velocity += val2; } } if (!NetworkServer.active) { return; } tickStopwatch -= Time.fixedDeltaTime; if (tickStopwatch <= 0f) { tickStopwatch += 0.5f; DoDamageTick(); ticksRemaining--; if (ticksRemaining == 0) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } [BepInPlugin("com.ThinkInvisible.TinkersSatchel", "TinkersSatchel", "6.0.1")] [BepInDependency("com.bepis.r2api", "5.3.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class TinkersSatchelPlugin : BaseUnityPlugin { public const string ModVer = "6.0.1"; public const string ModName = "TinkersSatchel"; public const string ModGuid = "com.ThinkInvisible.TinkersSatchel"; private static ConfigFile cfgFile; internal static FilingDictionary allModules = new FilingDictionary(); internal static ManualLogSource _logger; internal static AssetBundle resources; private Module[] earlyLoad; private void Awake() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0147: Invalid comparison between Unknown and I4 _logger = ((BaseUnityPlugin)this).Logger; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TinkersSatchel.tinkerssatchel_assets")) { resources = AssetBundle.LoadFromStream(stream); } try { UnstubShaders(); } catch (Exception ex) { _logger.LogError((object)$"Shader unstub failed: {ex} {ex.Message}"); } cfgFile = new ConfigFile(Path.Combine(Paths.ConfigPath, "com.ThinkInvisible.TinkersSatchel.cfg"), true); Module.SetupModuleClass(); Module.ModInfo modInfo = default(Module.ModInfo); modInfo.displayName = "Tinker's Satchel"; modInfo.longIdentifier = "TinkersSatchel"; modInfo.shortIdentifier = "TKSAT"; modInfo.mainConfigFile = cfgFile; allModules = Module.InitAll(modInfo); earlyLoad = new Module[3] { Module.instance, Module.instance, Module.instance }; Module.SetupAll_PluginAwake(earlyLoad); Module.SetupAll_PluginAwake(allModules.Except(earlyLoad)); foreach (Module item2 in allModules.Except(earlyLoad)) { if (item2 is Item item) { ItemDef itemDef = item.itemDef; ItemTier itemTier = item.itemTier; ExpansionDef requiredExpansion = ((itemTier - 6 > 2) ? CommonCode.expansionDef : CommonCode.voidExpansionDef); itemDef.requiredExpansion = requiredExpansion; } else if (item2 is Equipment equipment) { equipment.equipmentDef.requiredExpansion = CommonCode.expansionDef; } else if (item2 is Artifact artifact) { artifact.artifactDef.requiredExpansion = CommonCode.expansionDef; } } } private void UnstubShaders() { //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) Material[] array = resources.LoadAllAssets(); foreach (Material val in array) { if (((Object)val.shader).name.StartsWith("STUB_")) { string name = ((Object)val.shader).name; val.shader = Addressables.LoadAssetAsync((object)name.Substring(5, name.Length - 5)).WaitForCompletion(); } } } private void Start() { Module.SetupAll_PluginStart(earlyLoad); Module.SetupAll_PluginStart(allModules.Except(earlyLoad)); } private void Update() { if (RoR2Application.loadFinished) { AutoConfigModule.Update(); } } } public class CursesKeepOSP : Module { public override bool managedEnable => true; public CursesKeepOSP() { base.enabled = false; } public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); CharacterBody.RecalculateStats += new Manipulator(IL_CBRecalcStats); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); CharacterBody.RecalculateStats -= new Manipulator(IL_CBRecalcStats); } private void IL_CBRecalcStats(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "Max"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "set_oneShotProtectionFraction") })) { int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((float origFrac, CharacterBody body) => body.oneShotProtectionFraction)); } else { TinkersSatchelPlugin._logger.LogError((object)"failed to apply IL patch (CurseKeepOSP)! CurseKeepOSP module will not work."); } } } public class EquipmentDroneLabels : Module { public override bool managedEnable => true; public override void Install() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Install(); CharacterBody.GetDisplayName += new hook_GetDisplayName(CharacterBody_GetDisplayName); } public override void Uninstall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.Uninstall(); CharacterBody.GetDisplayName -= new hook_GetDisplayName(CharacterBody_GetDisplayName); } private string CharacterBody_GetDisplayName(orig_GetDisplayName orig, CharacterBody self) { //IL_0022: 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) string text = orig.Invoke(self); if (((Object)self).name != "EquipmentDroneBody(Clone)") { return text; } EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(self.inventory.currentEquipmentIndex); if (Object.op_Implicit((Object)(object)equipmentDef)) { return text + " (" + Language.GetString(equipmentDef.nameToken) + ")"; } return text + " (???)"; } } }