using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using HG.BlendableTypes;
using IL.EntityStates;
using IL.RoR2;
using IL.RoR2.CameraModes;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using On.RoR2.CharacterAI;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using TPDespair.ZetSizeController.Properties;
using UnityEngine;
using UnityEngine.Networking;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ZetSizeController")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ZetSizeController")]
[assembly: AssemblyTitle("ZetSizeController")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace TPDespair.ZetSizeController
{
public static class Configuration
{
public static ConfigEntry<float> SizeChangeRate { get; set; }
public static ConfigEntry<bool> IgnoreSizeLimit { get; set; }
public static ConfigEntry<bool> IgnoreSizeExponent { get; set; }
public static ConfigEntry<float> AbsoluteSizeLimit { get; set; }
public static ConfigEntry<bool> ValidateMonsterSize { get; set; }
public static ConfigEntry<bool> AllowStatHook { get; set; }
public static ConfigEntry<bool> ModifyCamera { get; set; }
public static ConfigEntry<bool> ModifyInteraction { get; set; }
public static ConfigEntry<bool> ModifyOverlap { get; set; }
public static ConfigEntry<bool> ModifyAnimation { get; set; }
public static ConfigEntry<int> ShrinkifactEnable { get; set; }
public static ConfigEntry<float> ShrinkifactMult { get; set; }
public static ConfigEntry<bool> ShrinkifactExtend { get; set; }
public static ConfigEntry<bool> ShrinkifactPlayer { get; set; }
public static ConfigEntry<bool> ShrinkifactMonster { get; set; }
public static ConfigEntry<float> ShrinkifactHealth { get; set; }
public static ConfigEntry<float> ShrinkifactDamage { get; set; }
public static ConfigEntry<float> ShrinkifactMovement { get; set; }
public static ConfigEntry<int> TitanifactEnable { get; set; }
public static ConfigEntry<float> TitanifactMult { get; set; }
public static ConfigEntry<bool> TitanifactExtend { get; set; }
public static ConfigEntry<bool> TitanifactPlayer { get; set; }
public static ConfigEntry<bool> TitanifactMonster { get; set; }
public static ConfigEntry<float> TitanifactHealth { get; set; }
public static ConfigEntry<float> TitanifactDamage { get; set; }
public static ConfigEntry<float> TitanifactMovement { get; set; }
public static ConfigEntry<int> SplitifactEnable { get; set; }
public static ConfigEntry<float> SplitifactChance { get; set; }
public static ConfigEntry<float> SplitifactMult { get; set; }
public static ConfigEntry<int> SplitifactMaxSmallFly { get; set; }
public static ConfigEntry<int> SplitifactMaxLesser { get; set; }
public static ConfigEntry<int> SplitifactMaxGreater { get; set; }
public static ConfigEntry<int> SplitifactMaxChampion { get; set; }
public static ConfigEntry<float> PlayerSizeIncrease { get; set; }
public static ConfigEntry<float> PlayerSizeMult { get; set; }
public static ConfigEntry<float> PlayerSizeExponent { get; set; }
public static ConfigEntry<float> PlayerSizeLimit { get; set; }
public static ConfigEntry<bool> PlayerSizeLimitExtendable { get; set; }
public static ConfigEntry<float> LesserSizeIncrease { get; set; }
public static ConfigEntry<float> LesserSizeMult { get; set; }
public static ConfigEntry<float> LesserSizeExponent { get; set; }
public static ConfigEntry<float> LesserSizeLimit { get; set; }
public static ConfigEntry<float> GreaterSizeIncrease { get; set; }
public static ConfigEntry<float> GreaterSizeMult { get; set; }
public static ConfigEntry<float> GreaterSizeExponent { get; set; }
public static ConfigEntry<float> GreaterSizeLimit { get; set; }
public static ConfigEntry<float> ChampionSizeIncrease { get; set; }
public static ConfigEntry<float> ChampionSizeMult { get; set; }
public static ConfigEntry<float> ChampionSizeExponent { get; set; }
public static ConfigEntry<float> ChampionSizeLimit { get; set; }
public static ConfigEntry<float> ModifierMult { get; set; }
public static ConfigEntry<float> CoreItemModifierLimit { get; set; }
public static ConfigEntry<float> KnurlSizeIncrease { get; set; }
public static ConfigEntry<float> PearlSizeIncrease { get; set; }
public static ConfigEntry<float> StoneFluxSizeIncrease { get; set; }
public static ConfigEntry<float> BossSizeIncrease { get; set; }
public static ConfigEntry<float> EliteSizeIncrease { get; set; }
public static ConfigEntry<float> EliteCountSizeIncrease { get; set; }
public static ConfigEntry<float> EliteCountExponent { get; set; }
public static ConfigEntry<float> HeadhunterSizeIncrease { get; set; }
public static ConfigEntry<float> HeadhunterExponent { get; set; }
public static ConfigEntry<float> GlassModifierLimit { get; set; }
public static ConfigEntry<float> GlassSizeMult { get; set; }
public static ConfigEntry<float> TonicSizeMult { get; set; }
public static ConfigEntry<float> PlayerLevelSizeIncrease { get; set; }
public static ConfigEntry<float> PlayerLevelSizeExponent { get; set; }
public static ConfigEntry<float> PlayerLevelSizeLimit { get; set; }
public static ConfigEntry<float> MonsterLevelSizeIncrease { get; set; }
public static ConfigEntry<float> MonsterLevelSizeExponent { get; set; }
public static ConfigEntry<float> MonsterLevelSizeLimit { get; set; }
public static ConfigEntry<float> ItemScoreSizeIncrease { get; set; }
public static ConfigEntry<float> ItemScoreSizeExponent { get; set; }
public static ConfigEntry<float> ItemScoreSizeLimit { get; set; }
public static ConfigEntry<float> ItemScoreT1Effect { get; set; }
public static ConfigEntry<float> ItemScoreT2Effect { get; set; }
public static ConfigEntry<float> ItemScoreT3Effect { get; set; }
public static ConfigEntry<float> ItemScoreBossEffect { get; set; }
public static ConfigEntry<float> ItemScoreLunarEffect { get; set; }
internal static void Init(ConfigFile Config)
{
SizeChangeRate = Config.Bind<float>("1a-General", "sizeChangeRate", 0.25f, "Rate of size change per second. Higher values = faster. 0 is instant.");
IgnoreSizeLimit = Config.Bind<bool>("1a-General", "ignoreSizeLimit", false, "Set all sizeclass limits to extreme values.");
IgnoreSizeExponent = Config.Bind<bool>("1a-General", "ignoreSizeExponent", false, "Set all sizeclass exponents to 1.");
AbsoluteSizeLimit = Config.Bind<float>("1a-General", "absoluteSizeLimit", 4f, "Prevent anything from scaling past value. Overwritten by ignoreSizeLimit.");
ValidateMonsterSize = Config.Bind<bool>("1a-General", "validateMonsterSize", true, "Wait a bit until size changes are made for monsters after spawning.");
AllowStatHook = Config.Bind<bool>("1c-Effects", "allowStatHook", true, "Allows changing stat values. Used for artifact effects.");
ModifyCamera = Config.Bind<bool>("1c-Effects", "modifyCamera", true, "Modify camera to scale with size.");
ModifyInteraction = Config.Bind<bool>("1c-Effects", "modifyInteraction", true, "Modify interaction range to scale with size.");
ModifyOverlap = Config.Bind<bool>("1c-Effects", "modifyOverlap", true, "Modify overlap attacks for some monsters to scale better with size.");
ModifyAnimation = Config.Bind<bool>("1c-Effects", "modifyAnimation", true, "Modify movement animation speed to scale with size.");
ShrinkifactEnable = Config.Bind<int>("2a-Artifacts - Shrink", "shrinkifactEnable", 1, "Artifact of Miniaturization. 0 = Disabled, 1 = Artifact Available, 2 = Always Active");
ShrinkifactMult = Config.Bind<float>("2a-Artifacts - Shrink", "shrinkifactMult", 0.65f, "Size multiplier of Artifact of Miniaturization. Unaffected by sizeclass exponent.");
ShrinkifactExtend = Config.Bind<bool>("2a-Artifacts - Shrink", "shrinkifactExtend", true, "Artifact of Miniaturization modifies minimum size limits.");
ShrinkifactPlayer = Config.Bind<bool>("2a-Artifacts - Shrink", "shrinkifactPlayer", true, "Artifact of Miniaturization applies to players.");
ShrinkifactMonster = Config.Bind<bool>("2a-Artifacts - Shrink", "shrinkifactMonster", true, "Artifact of Miniaturization applies to monsters.");
ShrinkifactHealth = Config.Bind<float>("2a-Artifacts - Shrink", "shrinkifactHealth", 1f, "Artifact of Miniaturization health multiplier.");
ShrinkifactDamage = Config.Bind<float>("2a-Artifacts - Shrink", "shrinkifactDamage", 1f, "Artifact of Miniaturization damage multiplier.");
ShrinkifactMovement = Config.Bind<float>("2a-Artifacts - Shrink", "shrinkifactMovement", 1f, "Artifact of Miniaturization movement speed multiplier.");
TitanifactEnable = Config.Bind<int>("2b-Artifacts - Grow", "titanifactEnable", 1, "Artifact of the Giants. 0 = Disabled, 1 = Artifact Available, 2 = Always Active");
TitanifactMult = Config.Bind<float>("2b-Artifacts - Grow", "titanifactMult", 1.5f, "Size multiplier of Artifact of the Giants. Unaffected by sizeclass exponent.");
TitanifactExtend = Config.Bind<bool>("2b-Artifacts - Grow", "titanifactExtend", true, "Artifact of the Giants modifies maximum size limits.");
TitanifactPlayer = Config.Bind<bool>("2b-Artifacts - Grow", "titanifactPlayer", false, "Artifact of the Giants applies to players.");
TitanifactMonster = Config.Bind<bool>("2b-Artifacts - Grow", "titanifactMonster", true, "Artifact of the Giants applies to monsters.");
TitanifactHealth = Config.Bind<float>("2b-Artifacts - Grow", "titanifactHealth", 1.5f, "Artifact of the Giants health multiplier.");
TitanifactDamage = Config.Bind<float>("2b-Artifacts - Grow", "titanifactDamage", 1.5f, "Artifact of the Giants damage multiplier.");
TitanifactMovement = Config.Bind<float>("2b-Artifacts - Grow", "titanifactMovement", 1f, "Artifact of the Giants movement speed multiplier.");
SplitifactEnable = Config.Bind<int>("2c-Artifacts - Split", "splitifactEnable", 1, "Artifact of Fragmentation. 0 = Disabled, 1 = Artifact Available, 2 = Always Active");
SplitifactChance = Config.Bind<float>("2c-Artifacts - Split", "splitifactChance", 0.5f, "Chance that any monster will be selected for splitting. 0.5 = 50% chance that a monster will be made larger and split on death.");
SplitifactMult = Config.Bind<float>("2c-Artifacts - Split", "splitifactMult", 1.5f, "Size multiplier per remaining split for Artifact of Fragmentation. Unaffected by sizeclass exponent.");
SplitifactMaxSmallFly = Config.Bind<int>("2c-Artifacts - Split", "splitifactMaxSmallFly", 1, "Maximum amount of splits for small flying monsters. Lowest between this value and sizeclass value is chosen.");
SplitifactMaxLesser = Config.Bind<int>("2c-Artifacts - Split", "splitifactMaxLesser", 2, "Maximum amount of splits for lesser monsters.");
SplitifactMaxGreater = Config.Bind<int>("2c-Artifacts - Split", "splitifactMaxGreater", 1, "Maximum amount of splits for greater monsters.");
SplitifactMaxChampion = Config.Bind<int>("2c-Artifacts - Split", "splitifactMaxChampion", 0, "Maximum amount of splits for champion monsters.");
PlayerSizeIncrease = Config.Bind<float>("3a-Size - Player", "playerSizeIncrease", 0f, "Size increase of players.");
PlayerSizeMult = Config.Bind<float>("3a-Size - Player", "playerSizeMult", 1f, "Size multiplier on players.");
PlayerSizeExponent = Config.Bind<float>("3a-Size - Player", "playerSizeExponent", 0.65f, "Apply exponent to final player size.");
PlayerSizeLimit = Config.Bind<float>("3a-Size - Player", "playerSizeLimit", 2f, "Maximum size of players. Higher values can make skill usage on some characters awkward.");
PlayerSizeLimitExtendable = Config.Bind<bool>("3a-Size - Player", "playerSizeLimitExtendable", false, "Whether player size limit can be extended by other effects.");
LesserSizeIncrease = Config.Bind<float>("3b-Size - Lesser", "lesserSizeIncrease", 0f, "Size increase of lesser monsters.");
LesserSizeMult = Config.Bind<float>("3b-Size - Lesser", "lesserSizeMult", 1f, "Size multiplier on lesser monsters.");
LesserSizeExponent = Config.Bind<float>("3b-Size - Lesser", "lesserSizeExponent", 0.65f, "Apply exponent to final lesser monster size.");
LesserSizeLimit = Config.Bind<float>("3b-Size - Lesser", "lesserSizeLimit", 3f, "Maximum size of lesser monsters.");
GreaterSizeIncrease = Config.Bind<float>("3c-Size - Greater", "greaterSizeIncrease", 0f, "Size increase of greater monsters.");
GreaterSizeMult = Config.Bind<float>("3c-Size - Greater", "greaterSizeMult", 1f, "Size multiplier on greater monsters.");
GreaterSizeExponent = Config.Bind<float>("3c-Size - Greater", "greaterSizeExponent", 0.5f, "Apply exponent to final greater monster size.");
GreaterSizeLimit = Config.Bind<float>("3c-Size - Greater", "greaterSizeLimit", 2f, "Maximum size of greater monsters.");
ChampionSizeIncrease = Config.Bind<float>("3d-Size - Champion", "championSizeIncrease", 0f, "Size increase of champion monsters.");
ChampionSizeMult = Config.Bind<float>("3d-Size - Champion", "championSizeMult", 1f, "Size multiplier on champion monsters.");
ChampionSizeExponent = Config.Bind<float>("3d-Size - Champion", "championSizeExponent", 0.5f, "Apply exponent to final champion monster size.");
ChampionSizeLimit = Config.Bind<float>("3d-Size - Champion", "championSizeLimit", 2f, "Maximum size of champion monsters.");
ModifierMult = Config.Bind<float>("4a-Modifiers - General", "modifierMult", 1f, "Multiply increase modifier effects in modifiers sections. Multiplies item effects after limits.");
CoreItemModifierLimit = Config.Bind<float>("4b-Modifiers - Core", "coreItemEffectLimit", 5f, "Maximum modifier effect multiplier for : Knurl, Pearls, StoneFlux. 5 = SQRT(25), item effect caps out at 25 items for each core item.");
KnurlSizeIncrease = Config.Bind<float>("4b-Modifiers - Core", "knurlSizeIncrease", 0.1f, "Size increase from Titanic Knurl. Value multiplied by SQRT of item count.");
PearlSizeIncrease = Config.Bind<float>("4b-Modifiers - Core", "pearlSizeIncrease", 0.1f, "Size increase from Pearl(x1) and Irradiant Pearl(x2.5). Value multiplied by SQRT of item count.");
StoneFluxSizeIncrease = Config.Bind<float>("4b-Modifiers - Core", "stoneFluxSizeIncrease", 0.2f, "Size increase from Stone Flux Pauldron. Value multiplied by SQRT of item count.");
BossSizeIncrease = Config.Bind<float>("4b-Modifiers - Core", "bossSizeIncrease", 0.2f, "Size increase from being in a boss group.");
EliteSizeIncrease = Config.Bind<float>("4b-Modifiers - Core", "eliteSizeIncrease", 0.1f, "Size increase from having any elite buff.");
EliteCountSizeIncrease = Config.Bind<float>("4b-Modifiers - Core", "eliteCountSizeIncrease", 0.1f, "Size increase per elite buff. Value multiplied by EliteCountExponent of buff count.");
EliteCountExponent = Config.Bind<float>("4b-Modifiers - Core", "eliteCountExponent", 0.5f, "Exponent applied to buff count for EliteCountSizeIncrease.");
HeadhunterSizeIncrease = Config.Bind<float>("4b-Modifiers - Core", "headhunterSizeIncrease", 0.1f, "Size increase per elite buff. Value multiplied by HeadhunterExponent of buff count.");
HeadhunterExponent = Config.Bind<float>("4b-Modifiers - Core", "headhunterExponent", 0.5f, "Exponent applied to buff count for HeadhunterSizeIncrease.");
GlassModifierLimit = Config.Bind<float>("4b-Modifiers - Core", "glassEffectLimit", 0.25f, "Minimum modifier effect for : ShapedGlass.");
GlassSizeMult = Config.Bind<float>("4b-Modifiers - Core", "glassSizeMult", 0.9f, "Size multiplier per Shaped Glass. Unaffected by modifierMult. Ignores sizeclass exponent.");
TonicSizeMult = Config.Bind<float>("4b-Modifiers - Core", "tonicSizeMult", 1.25f, "Size multiplier from Spinel Tonic. Unaffected by modifierMult. Ignores sizeclass exponent.");
PlayerLevelSizeIncrease = Config.Bind<float>("4c-Modifiers - LevelScaling", "playerLevelSizeIncrease", 0f, "Size increase from levels for players. 0 to disable. 0.01 would be the default if enabled.");
PlayerLevelSizeExponent = Config.Bind<float>("4c-Modifiers - LevelScaling", "playerLevelSizeExponent", 1f, "Exponent applied to player level for size increase.");
PlayerLevelSizeLimit = Config.Bind<float>("4c-Modifiers - LevelScaling", "playerLevelSizeLimit", 0.5f, "Limit for size increase from player level.");
MonsterLevelSizeIncrease = Config.Bind<float>("4c-Modifiers - LevelScaling", "monsterLevelSizeIncrease", 0f, "Size increase from levels for monsters. 0 to disable. 0.02 would be the default if enabled.");
MonsterLevelSizeExponent = Config.Bind<float>("4c-Modifiers - LevelScaling", "monsterLevelSizeExponent", 0.65f, "Exponent applied to monster level for size increase.");
MonsterLevelSizeLimit = Config.Bind<float>("4c-Modifiers - LevelScaling", "monsterLevelSizeLimit", 0.5f, "Limit for size increase from monster level.");
ItemScoreSizeIncrease = Config.Bind<float>("4d-Modifiers - ItemScoreScaling", "itemScoreSizeIncrease", 0f, "Size increase from itemscore. 0 to disable. 0.01 would be the default if enabled.");
ItemScoreSizeExponent = Config.Bind<float>("4d-Modifiers - ItemScoreScaling", "itemScoreSizeExponent", 0.65f, "Exponent applied to itemscore for size increase.");
ItemScoreSizeLimit = Config.Bind<float>("4d-Modifiers - ItemScoreScaling", "itemScoreSizeLimit", 0.5f, "Limit for size increase from itemscore.");
ItemScoreT1Effect = Config.Bind<float>("4d-Modifiers - ItemScoreScaling", "itemScoreT1Effect", 1f, "Amount of added itemscore per T1 item.");
ItemScoreT2Effect = Config.Bind<float>("4d-Modifiers - ItemScoreScaling", "itemScoreT2Effect", 2f, "Amount of added itemscore per T2 item.");
ItemScoreT3Effect = Config.Bind<float>("4d-Modifiers - ItemScoreScaling", "itemScoreT3Effect", 6f, "Amount of added itemscore per T3 item.");
ItemScoreBossEffect = Config.Bind<float>("4d-Modifiers - ItemScoreScaling", "itemScoreBossEffect", 4f, "Amount of added itemscore per Boss item.");
ItemScoreLunarEffect = Config.Bind<float>("4d-Modifiers - ItemScoreScaling", "itemScoreLunarEffect", 4f, "Amount of added itemscore per Lunar item.");
}
}
public enum SizeClass
{
None,
Player,
Lesser,
Greater,
Champion
}
public class SizeData : MonoBehaviour
{
public NetworkInstanceId netId;
public SizeClass sizeClass = SizeClass.None;
public float heightVerticalOffset = 0f;
public float interactionRange = 1f;
public float playbackSpeed = 1f;
public Vector3 size;
public float height = 0f;
public int validation = 0;
public bool newData = true;
public float scale = 1f;
public float target = 1f;
public float forceUpdate = 0f;
public bool ready = false;
}
public static class SizeManager
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static hook_RecalculateStats <>9__19_0;
public static hook_FixedUpdate <>9__28_0;
public static hook_OnDestroy <>9__31_0;
public static Func<Instruction, bool> <>9__34_1;
public static Func<PrintController, float, float> <>9__34_2;
public static Manipulator <>9__34_0;
public static Func<Instruction, bool> <>9__35_1;
public static Func<Vector3, CameraRigController, Vector3> <>9__35_2;
public static Manipulator <>9__35_0;
public static Func<Instruction, bool> <>9__36_1;
public static Func<Instruction, bool> <>9__36_2;
public static Func<float, CameraRigController, float> <>9__36_3;
public static Manipulator <>9__36_0;
public static Func<Instruction, bool> <>9__37_1;
public static Func<Instruction, bool> <>9__37_2;
public static Func<Instruction, bool> <>9__37_3;
public static Func<InteractionDriver, float, float> <>9__37_5;
public static Manipulator <>9__37_0;
public static Func<Instruction, bool> <>9__38_1;
public static Func<Instruction, bool> <>9__38_2;
public static Func<Instruction, bool> <>9__38_3;
public static Func<Instruction, bool> <>9__38_4;
public static Func<Instruction, bool> <>9__38_5;
public static Func<float, CharacterBody, float> <>9__38_6;
public static Manipulator <>9__38_0;
public static Func<Instruction, bool> <>9__39_1;
public static Func<Instruction, bool> <>9__39_2;
public static Func<Instruction, bool> <>9__39_3;
public static Func<Instruction, bool> <>9__39_4;
public static Func<Instruction, bool> <>9__39_5;
public static Func<float, CharacterBody, float> <>9__39_6;
public static Manipulator <>9__39_0;
public static Func<Instruction, bool> <>9__40_1;
public static Func<Instruction, bool> <>9__40_2;
public static Func<Instruction, bool> <>9__40_3;
public static Func<Instruction, bool> <>9__40_4;
public static Func<Instruction, bool> <>9__40_5;
public static Func<float, CharacterBody, float> <>9__40_6;
public static Manipulator <>9__40_0;
public static Func<Instruction, bool> <>9__41_1;
public static Func<Vector3, OverlapAttack, Vector3> <>9__41_2;
public static Manipulator <>9__41_0;
public static Func<Instruction, bool> <>9__42_1;
public static Func<Vector3, OverlapAttack, Vector3> <>9__42_2;
public static Manipulator <>9__42_0;
public static Func<EntityState, float> <>9__43_1;
public static Func<Instruction, bool> <>9__43_2;
public static Func<Instruction, bool> <>9__43_3;
public static Func<Instruction, bool> <>9__43_4;
public static Func<Instruction, bool> <>9__43_5;
public static Func<Instruction, bool> <>9__43_6;
public static Func<Instruction, bool> <>9__43_7;
public static Func<Instruction, bool> <>9__43_8;
public static Manipulator <>9__43_0;
internal void <RecalculateStatsHook>b__19_0(orig_RecalculateStats orig, CharacterBody self)
{
GetSizeData(self);
orig.Invoke(self);
RecalcSizeData(self);
}
internal void <FixedUpdateHook>b__28_0(orig_FixedUpdate orig, CharacterBody self)
{
orig.Invoke(self);
UpdateSize(self, instant: false);
}
internal void <OnDestroyHook>b__31_0(orig_OnDestroy orig, CharacterBody self)
{
DestroySizeData(self);
orig.Invoke(self);
}
internal void <FixPrintController>b__34_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_004d: 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_008d: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<PrintController>(x, "maxPrintHeight")
}))
{
val.Index += 1;
val.Emit(OpCodes.Ldarg, 0);
val.Emit(OpCodes.Ldarg, 1);
val.EmitDelegate<Func<PrintController, float, float>>((Func<PrintController, float, float>)delegate(PrintController printController, float sample)
{
//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)
CharacterModel characterModel = printController.characterModel;
if (Object.op_Implicit((Object)(object)characterModel))
{
CharacterBody body = characterModel.body;
if (Object.op_Implicit((Object)(object)body))
{
if (body.bodyIndex == ClayableTemplarBodyIndex)
{
return 1f;
}
if (sample >= 1f)
{
return 100f;
}
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return Mathf.Max(1f, component.scale);
}
}
}
return 1f;
});
val.Emit(OpCodes.Mul);
}
else
{
ZetSizeControllerPlugin.LogWarn("FixPrintController Failed");
}
}
internal bool <FixPrintController>b__34_1(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<PrintController>(x, "maxPrintHeight");
}
internal float <FixPrintController>b__34_2(PrintController printController, float sample)
{
//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)
CharacterModel characterModel = printController.characterModel;
if (Object.op_Implicit((Object)(object)characterModel))
{
CharacterBody body = characterModel.body;
if (Object.op_Implicit((Object)(object)body))
{
if (body.bodyIndex == ClayableTemplarBodyIndex)
{
return 1f;
}
if (sample >= 1f)
{
return 100f;
}
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return Mathf.Max(1f, component.scale);
}
}
}
return 1f;
}
internal void <CameraDistanceHook>b__35_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//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_008e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 13)
}))
{
val.Index += 1;
val.Emit(OpCodes.Ldloc, 13);
val.Emit(OpCodes.Ldloc, 1);
val.EmitDelegate<Func<Vector3, CameraRigController, Vector3>>((Func<Vector3, CameraRigController, Vector3>)delegate(Vector3 direction, CameraRigController camRig)
{
//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)
//IL_0040: 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_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)
CharacterBody targetBody = camRig.targetBody;
if (Object.op_Implicit((Object)(object)targetBody))
{
SizeData component = ((Component)targetBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return direction * component.scale;
}
}
return direction;
});
val.Emit(OpCodes.Stloc, 13);
}
else
{
ZetSizeControllerPlugin.LogWarn("CameraDistanceHook Failed");
}
}
internal bool <CameraDistanceHook>b__35_1(Instruction x)
{
return ILPatternMatchingExt.MatchStloc(x, 13);
}
internal Vector3 <CameraDistanceHook>b__35_2(Vector3 direction, CameraRigController camRig)
{
//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)
//IL_0040: 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_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)
CharacterBody targetBody = camRig.targetBody;
if (Object.op_Implicit((Object)(object)targetBody))
{
SizeData component = ((Component)targetBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return direction * component.scale;
}
}
return direction;
}
internal void <CameraVerticalOffsetHook>b__36_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdflda<CharacterCameraParamsData>(x, "pivotVerticalOffset"),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<BlendableFloat>(x, "value")
}))
{
val.Index += 2;
val.Emit(OpCodes.Ldloc, 0);
val.EmitDelegate<Func<float, CameraRigController, float>>((Func<float, CameraRigController, float>)delegate(float vertical, CameraRigController camRig)
{
CharacterBody targetBody = camRig.targetBody;
if (Object.op_Implicit((Object)(object)targetBody))
{
SizeData component = ((Component)targetBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return vertical * component.scale + component.heightVerticalOffset;
}
}
return vertical;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("CameraVerticalOffsetHook Failed");
}
}
internal bool <CameraVerticalOffsetHook>b__36_1(Instruction x)
{
return ILPatternMatchingExt.MatchLdflda<CharacterCameraParamsData>(x, "pivotVerticalOffset");
}
internal bool <CameraVerticalOffsetHook>b__36_2(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<BlendableFloat>(x, "value");
}
internal float <CameraVerticalOffsetHook>b__36_3(float vertical, CameraRigController camRig)
{
CharacterBody targetBody = camRig.targetBody;
if (Object.op_Implicit((Object)(object)targetBody))
{
SizeData component = ((Component)targetBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return vertical * component.scale + component.heightVerticalOffset;
}
}
return vertical;
}
internal void <InteractionDriverHook>b__37_0(ILContext il)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Expected O, but got Unknown
//IL_00ad: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
<>c__DisplayClass37_0 CS$<>8__locals0 = new <>c__DisplayClass37_0();
ILCursor val = new ILCursor(il);
CS$<>8__locals0.rangeIndex = -1;
if (val.TryGotoNext(new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<InteractionDriver>(x, "get_interactor"),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<Interactor>(x, "maxInteractionDistance"),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.rangeIndex)
}))
{
val.Index += 4;
val.Emit(OpCodes.Ldarg, 0);
val.Emit(OpCodes.Ldloc, CS$<>8__locals0.rangeIndex);
val.EmitDelegate<Func<InteractionDriver, float, float>>((Func<InteractionDriver, float, float>)delegate(InteractionDriver driver, float range)
{
CharacterBody characterBody = driver.characterBody;
if (Object.op_Implicit((Object)(object)characterBody))
{
SizeData component = ((Component)characterBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
range *= component.interactionRange;
}
}
return range;
});
val.Emit(OpCodes.Stloc, CS$<>8__locals0.rangeIndex);
}
else
{
ZetSizeControllerPlugin.LogWarn("InteractionHook Failed");
}
}
internal bool <InteractionDriverHook>b__37_1(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool <InteractionDriverHook>b__37_2(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt<InteractionDriver>(x, "get_interactor");
}
internal bool <InteractionDriverHook>b__37_3(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<Interactor>(x, "maxInteractionDistance");
}
internal float <InteractionDriverHook>b__37_5(InteractionDriver driver, float range)
{
CharacterBody characterBody = driver.characterBody;
if (Object.op_Implicit((Object)(object)characterBody))
{
SizeData component = ((Component)characterBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
range *= component.interactionRange;
}
}
return range;
}
internal void <PickupPickerHook>b__38_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<PickupPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<PickupPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchMul(x)
}))
{
val.Index += 5;
val.Emit(OpCodes.Ldloc, 1);
val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("PickupPickerHook Failed");
}
}
internal bool <PickupPickerHook>b__38_1(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool <PickupPickerHook>b__38_2(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<PickupPickerController>(x, "cutoffDistance");
}
internal bool <PickupPickerHook>b__38_3(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool <PickupPickerHook>b__38_4(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<PickupPickerController>(x, "cutoffDistance");
}
internal bool <PickupPickerHook>b__38_5(Instruction x)
{
return ILPatternMatchingExt.MatchMul(x);
}
internal float <PickupPickerHook>b__38_6(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
}
internal void <TieredPickupPickerHook>b__39_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<TieredPickupPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<TieredPickupPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchMul(x)
}))
{
val.Index += 5;
val.Emit(OpCodes.Ldloc, 1);
val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("TieredPickupPickerHook Failed");
}
}
internal bool <TieredPickupPickerHook>b__39_1(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool <TieredPickupPickerHook>b__39_2(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<TieredPickupPickerController>(x, "cutoffDistance");
}
internal bool <TieredPickupPickerHook>b__39_3(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool <TieredPickupPickerHook>b__39_4(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<TieredPickupPickerController>(x, "cutoffDistance");
}
internal bool <TieredPickupPickerHook>b__39_5(Instruction x)
{
return ILPatternMatchingExt.MatchMul(x);
}
internal float <TieredPickupPickerHook>b__39_6(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
}
internal void <DroneScrapperPickerHook>b__40_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DroneScrapperPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DroneScrapperPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchMul(x)
}))
{
val.Index += 5;
val.Emit(OpCodes.Ldloc, 1);
val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("DroneScrapperPickerHook Failed");
}
}
internal bool <DroneScrapperPickerHook>b__40_1(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool <DroneScrapperPickerHook>b__40_2(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<DroneScrapperPickerController>(x, "cutoffDistance");
}
internal bool <DroneScrapperPickerHook>b__40_3(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool <DroneScrapperPickerHook>b__40_4(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld<DroneScrapperPickerController>(x, "cutoffDistance");
}
internal bool <DroneScrapperPickerHook>b__40_5(Instruction x)
{
return ILPatternMatchingExt.MatchMul(x);
}
internal float <DroneScrapperPickerHook>b__40_6(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
}
internal void <OverlapAttackPositionHook>b__41_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 4)
}))
{
val.Emit(OpCodes.Ldarg, 0);
val.EmitDelegate<Func<Vector3, OverlapAttack, Vector3>>((Func<Vector3, OverlapAttack, Vector3>)delegate(Vector3 position, OverlapAttack attack)
{
//IL_008b: 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_0090: 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_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_0031: 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_0039: 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_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_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_0059: 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_006d: Unknown result type (might be due to invalid IL or missing references)
GameObject attacker = attack.attacker;
if (Object.op_Implicit((Object)(object)attacker))
{
CharacterBody component = attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component))
{
Vector3 val2 = position - component.corePosition;
if (component.bodyIndex == BeetleBodyIndex || component.bodyIndex == BeetleCrystalBodyIndex)
{
((Vector3)(ref val2))..ctor(val2.x, val2.y * 0.5f, val2.z);
}
position = component.corePosition + val2;
}
}
return position;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("OverlapAttackPositionHook Failed");
}
}
internal bool <OverlapAttackPositionHook>b__41_1(Instruction x)
{
return ILPatternMatchingExt.MatchStloc(x, 4);
}
internal Vector3 <OverlapAttackPositionHook>b__41_2(Vector3 position, OverlapAttack attack)
{
//IL_008b: 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_0090: 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_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_0031: 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_0039: 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_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_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_0059: 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_006d: Unknown result type (might be due to invalid IL or missing references)
GameObject attacker = attack.attacker;
if (Object.op_Implicit((Object)(object)attacker))
{
CharacterBody component = attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component))
{
Vector3 val = position - component.corePosition;
if (component.bodyIndex == BeetleBodyIndex || component.bodyIndex == BeetleCrystalBodyIndex)
{
((Vector3)(ref val))..ctor(val.x, val.y * 0.5f, val.z);
}
position = component.corePosition + val;
}
}
return position;
}
internal void <OverlapAttackScaleHook>b__42_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 5)
}))
{
val.Emit(OpCodes.Ldarg, 0);
val.EmitDelegate<Func<Vector3, OverlapAttack, Vector3>>((Func<Vector3, OverlapAttack, Vector3>)delegate(Vector3 scale, OverlapAttack attack)
{
//IL_00af: 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_00b4: 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_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)
//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_0051: 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_0069: 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_009f: 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)
GameObject attacker = attack.attacker;
if (Object.op_Implicit((Object)(object)attacker))
{
CharacterBody component = attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component))
{
if (component.bodyIndex == BeetleBodyIndex || component.bodyIndex == BeetleCrystalBodyIndex)
{
((Vector3)(ref scale))..ctor(scale.x * 1.25f, scale.y * 2.5f, scale.z * 1.25f);
}
if (component.bodyIndex == ImpBodyIndex || component.bodyIndex == LemurianBodyIndex)
{
scale *= 1.75f;
}
}
}
return scale;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("OverlapAttackScaleHook Failed");
}
}
internal bool <OverlapAttackScaleHook>b__42_1(Instruction x)
{
return ILPatternMatchingExt.MatchStloc(x, 5);
}
internal Vector3 <OverlapAttackScaleHook>b__42_2(Vector3 scale, OverlapAttack attack)
{
//IL_00af: 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_00b4: 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_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)
//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_0051: 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_0069: 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_009f: 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)
GameObject attacker = attack.attacker;
if (Object.op_Implicit((Object)(object)attacker))
{
CharacterBody component = attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component))
{
if (component.bodyIndex == BeetleBodyIndex || component.bodyIndex == BeetleCrystalBodyIndex)
{
((Vector3)(ref scale))..ctor(scale.x * 1.25f, scale.y * 2.5f, scale.z * 1.25f);
}
if (component.bodyIndex == ImpBodyIndex || component.bodyIndex == LemurianBodyIndex)
{
scale *= 1.75f;
}
}
}
return scale;
}
internal void <AnimationHook>b__43_0(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
//IL_0043: 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_00e9: 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_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: 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_0262: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
VariableDefinition val2 = new VariableDefinition(((MemberReference)il.Body.Method).Module.TypeSystem.Single);
il.Body.Variables.Add(val2);
val.Index = 0;
val.Emit(OpCodes.Ldarg, 0);
val.EmitDelegate<Func<EntityState, float>>((Func<EntityState, float>)delegate(EntityState entityState)
{
CharacterBody characterBody = entityState.characterBody;
if (Object.op_Implicit((Object)(object)characterBody))
{
SizeData component = ((Component)characterBody).GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return component.playbackSpeed;
}
}
return 1f;
});
val.Emit(OpCodes.Stloc, val2);
int num = default(int);
if (val.TryGotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(AnimationParameters).GetField("mainRootPlaybackRate")),
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num)
}))
{
val.Index += 2;
val.Emit(OpCodes.Ldloc, val2);
val.Emit(OpCodes.Mul);
}
else
{
ZetSizeControllerPlugin.LogWarn("AnimationHook:rootMotion Failed");
}
if (!val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(AnimationParameters).GetField("walkSpeed"))
}))
{
ZetSizeControllerPlugin.LogWarn("AnimationHook:walkSpeed Failed");
return;
}
if (val.TryGotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterBody"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_moveSpeed")
}))
{
val.Index += 2;
val.Emit(OpCodes.Ldloc, val2);
val.Emit(OpCodes.Mul);
}
else
{
ZetSizeControllerPlugin.LogWarn("AnimationHook:Body.moveSpeed Failed");
}
if (val.TryGotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterMotor"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMotor>(x, "get_walkSpeed")
}))
{
val.Index += 2;
val.Emit(OpCodes.Ldloc, val2);
val.Emit(OpCodes.Mul);
}
else
{
ZetSizeControllerPlugin.LogWarn("AnimationHook:Motor.walkSpeed Failed");
}
}
internal float <AnimationHook>b__43_1(EntityState entityState)
{
CharacterBody characterBody = entityState.characterBody;
if (Object.op_Implicit((Object)(object)characterBody))
{
SizeData component = ((Component)characterBody).GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return component.playbackSpeed;
}
}
return 1f;
}
internal bool <AnimationHook>b__43_2(Instruction x)
{
return ILPatternMatchingExt.MatchLdsfld(x, typeof(AnimationParameters).GetField("mainRootPlaybackRate"));
}
internal bool <AnimationHook>b__43_3(Instruction x)
{
int num = default(int);
return ILPatternMatchingExt.MatchLdloc(x, ref num);
}
internal bool <AnimationHook>b__43_4(Instruction x)
{
return ILPatternMatchingExt.MatchLdsfld(x, typeof(AnimationParameters).GetField("walkSpeed"));
}
internal bool <AnimationHook>b__43_5(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterBody");
}
internal bool <AnimationHook>b__43_6(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_moveSpeed");
}
internal bool <AnimationHook>b__43_7(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterMotor");
}
internal bool <AnimationHook>b__43_8(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMotor>(x, "get_walkSpeed");
}
}
[CompilerGenerated]
private sealed class <>c__DisplayClass37_0
{
public int rangeIndex;
internal bool <InteractionDriverHook>b__4(Instruction x)
{
return ILPatternMatchingExt.MatchStloc(x, ref rangeIndex);
}
}
private static readonly List<string> LesserBodyNames = new List<string>
{
"BackupDroneBody", "BeetleBody", "BeetleCrystalBody", "ClayBody", "Drone1Body", "Drone2Body", "EmergencyDroneBody", "EquipmentDroneBody", "FlameDroneBody", "FlyingVerminBody",
"GipBody", "HermitCrabBody", "ImpBody", "JellyfishBody", "LemurianBody", "LunarExploderBody", "MiniMushroomBody", "MinorConstructAttachableBody", "MinorConstructBody", "MinorConstructOnKillBody",
"MissileDroneBody", "MoffeinClayManBody", "SquidTurretBody", "Turret1Body", "UrchinTurretBody", "VerminBody", "VoidBarnacleBody", "VoidInfestorBody", "VultureBody", "WispBody",
"WispSoulBody"
};
private static readonly List<BodyIndex> LesserBodyIndexes = new List<BodyIndex>();
private static readonly List<string> GreaterBodyNames = new List<string>
{
"ArchWispBody", "BeetleGuardAllyBody", "BeetleGuardBody", "BeetleGuardCrystalBody", "BellBody", "BisonBody", "BomberBody", "ClayBruiserBody", "ClayGrenadierBody", "DroneCommanderBody",
"EngiBeamTurretBody", "EngiTurretBody", "EngiWalkerTurretBody", "GeepBody", "GolemBody", "GreaterWispBody", "GupBody", "LemurianBruiserBody", "LunarGolemBody", "LunarKnightBody",
"LunarWispBody", "MajorConstructBody", "MegaDroneBody", "NullifierBody", "ParentBody", "RoboBallGreenBuddyBody", "RoboBallMiniBody", "RoboBallRedBuddyBody", "ScavBody", "ShopkeeperBody",
"VoidJailerBody"
};
private static readonly List<BodyIndex> GreaterBodyIndexes = new List<BodyIndex>();
private static readonly List<string> ChampionBodyNames = new List<string>
{
"AncientWispBody", "BeetleQueen2Body", "BrotherBody", "BrotherGlassBody", "BrotherHurtBody", "ClayBossBody", "DireseekerBody", "ElectricWormBody", "GrandParentBody", "GravekeeperBody",
"ImpBossBody", "MagmaWormBody", "MegaConstructBody", "MoffeinAncientWispBody", "RoboBallBossBody", "ScavLunar1Body", "ScavLunar2Body", "ScavLunar3Body", "ScavLunar4Body", "SuperRoboBallBossBody",
"TitanBody", "TitanGoldBody", "VagrantBody", "VoidMegaCrabBody"
};
private static readonly List<BodyIndex> ChampionBodyIndexes = new List<BodyIndex>();
private static BodyIndex BeetleBodyIndex = (BodyIndex)(-1);
private static BodyIndex BeetleCrystalBodyIndex = (BodyIndex)(-1);
private static BodyIndex ImpBodyIndex = (BodyIndex)(-1);
private static BodyIndex LemurianBodyIndex = (BodyIndex)(-1);
private static BodyIndex RexBodyIndex = (BodyIndex)(-1);
private static BodyIndex ClayableTemplarBodyIndex = (BodyIndex)(-1);
private static BuffIndex HeadhunterBuff = (BuffIndex)(-1);
private static ItemTier LunarVoidTier = (ItemTier)1000;
private static ItemIndex RelicMassIndex = (ItemIndex)(-1);
public static Action<CharacterBody, SizeData> onSizeDataCreated;
internal static void Init()
{
((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)PopulateBodyIndexes);
RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(PopulateIndexes));
RecalculateStatsHook();
FixedUpdateHook();
OnDestroyHook();
CharacterBody.onBodyStartGlobal += RecalcSizeData;
VehicleSeat.onPassengerExitGlobal += ResizeOnVehicleExit;
FixPrintController();
if (Configuration.ModifyCamera.Value)
{
CameraDistanceHook();
CameraVerticalOffsetHook();
}
if (Configuration.ModifyInteraction.Value)
{
InteractionDriverHook();
PickupPickerHook();
TieredPickupPickerHook();
DroneScrapperPickerHook();
}
if (Configuration.ModifyOverlap.Value)
{
OverlapAttackPositionHook();
OverlapAttackScaleHook();
}
if (Configuration.ModifyAnimation.Value)
{
AnimationHook();
}
}
private static void PopulateBodyIndexes()
{
//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_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Invalid comparison between Unknown and I4
//IL_0030: 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_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_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Invalid comparison between Unknown and I4
//IL_009d: 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_00f1: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Invalid comparison between Unknown and I4
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: 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_0166: 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_017a: 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_0189: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
foreach (string lesserBodyName in LesserBodyNames)
{
BodyIndex val = BodyCatalog.FindBodyIndex(lesserBodyName);
if ((int)val != -1 && !LesserBodyIndexes.Contains(val))
{
LesserBodyIndexes.Add(val);
}
}
foreach (string greaterBodyName in GreaterBodyNames)
{
BodyIndex val = BodyCatalog.FindBodyIndex(greaterBodyName);
if ((int)val != -1 && !GreaterBodyIndexes.Contains(val))
{
GreaterBodyIndexes.Add(val);
}
}
foreach (string championBodyName in ChampionBodyNames)
{
BodyIndex val = BodyCatalog.FindBodyIndex(championBodyName);
if ((int)val != -1 && !ChampionBodyIndexes.Contains(val))
{
ChampionBodyIndexes.Add(val);
}
}
BeetleBodyIndex = BodyCatalog.FindBodyIndex("BeetleBody");
BeetleCrystalBodyIndex = BodyCatalog.FindBodyIndex("BeetleCrystalBody");
ImpBodyIndex = BodyCatalog.FindBodyIndex("ImpBody");
LemurianBodyIndex = BodyCatalog.FindBodyIndex("LemurianBody");
RexBodyIndex = BodyCatalog.FindBodyIndex("TreebotBody");
ClayableTemplarBodyIndex = BodyCatalog.FindBodyIndex("Templar_Survivor");
ZetSizeControllerPlugin.LogWarn("PopulateBodyIndexes : Lesser[" + LesserBodyIndexes.Count + "] Greater[" + GreaterBodyIndexes.Count + "] Champion[" + ChampionBodyIndexes.Count + "]");
}
private static void PopulateIndexes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Invalid comparison between Unknown and I4
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Invalid comparison between Unknown and I4
//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_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Invalid comparison between Unknown and I4
//IL_0032: 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_0052: 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_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)
BuffIndex val = BuffCatalog.FindBuffIndex("TKSATShrink");
if ((int)val != -1)
{
}
val = BuffCatalog.FindBuffIndex("ZetHeadHunter");
if ((int)val != -1)
{
HeadhunterBuff = val;
}
ItemIndex val2 = ItemCatalog.FindItemIndex("RelicOfMass");
if ((int)val2 != -1)
{
RelicMassIndex = val2;
}
ItemTierDef val3 = ItemTierCatalog.FindTierDef("VoidLunarTierDef");
if (Object.op_Implicit((Object)(object)val3))
{
LunarVoidTier = val3.tier;
}
}
private static void RecalculateStatsHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__19_0;
if (obj == null)
{
hook_RecalculateStats val = delegate(orig_RecalculateStats orig, CharacterBody self)
{
GetSizeData(self);
orig.Invoke(self);
RecalcSizeData(self);
};
<>c.<>9__19_0 = val;
obj = (object)val;
}
CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
}
private static void RecalcSizeData(CharacterBody self)
{
//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)
SizeData sizeData = GetSizeData(self);
if (!Object.op_Implicit((Object)(object)sizeData))
{
return;
}
float characterScale = GetCharacterScale(self, sizeData);
if (sizeData.target != characterScale)
{
if (sizeData.sizeClass == SizeClass.Player)
{
string[] obj = new string[6] { "Player Size : ", null, null, null, null, null };
NetworkInstanceId netId = sizeData.netId;
obj[1] = ((object)(NetworkInstanceId)(ref netId)).ToString();
obj[2] = " - ";
obj[3] = $"{sizeData.target:0.###}";
obj[4] = " => ";
obj[5] = $"{characterScale:0.###}";
ZetSizeControllerPlugin.LogWarn(string.Concat(obj));
}
sizeData.target = characterScale;
}
if (sizeData.newData)
{
sizeData.newData = false;
UpdateSize(self, instant: true);
}
}
private static SizeData GetSizeData(CharacterBody body)
{
//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_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_00b3: 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_0193: 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_014f: 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)
if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.masterObject))
{
SizeData sizeData = ((Component)body).gameObject.GetComponent<SizeData>();
if (!Object.op_Implicit((Object)(object)sizeData))
{
if (!HasTransform(body))
{
return null;
}
if (!ValidateScale(body))
{
return null;
}
SizeClass sizeClass = GetSizeClass(body);
if (sizeClass == SizeClass.None)
{
return null;
}
sizeData = ((Component)body).gameObject.AddComponent<SizeData>();
sizeData.netId = ((NetworkBehaviour)body).netId;
sizeData.size = body.modelLocator.modelTransform.localScale;
sizeData.height = Mathf.Abs(body.corePosition.y - body.footPosition.y) * 2f;
sizeData.sizeClass = sizeClass;
if (sizeClass != SizeClass.Player && Configuration.ValidateMonsterSize.Value)
{
sizeData.validation = 3;
}
sizeData.newData = true;
onSizeDataCreated?.Invoke(body, sizeData);
sizeData.ready = true;
if (sizeClass == SizeClass.Player)
{
body.SetBuffCount(ZetSizeControllerContent.Buffs.ZetPlayerSizeClass.buffIndex, 1);
NetworkInstanceId netId = sizeData.netId;
ZetSizeControllerPlugin.LogWarn("Created Player SizeData : " + ((object)(NetworkInstanceId)(ref netId)).ToString());
ZetSizeControllerPlugin.LogWarn("-- Height : " + sizeData.height);
}
else
{
body.SetBuffCount(ZetSizeControllerContent.Buffs.ZetMonsterSizeClass.buffIndex, 1);
}
}
if (!sizeData.ready)
{
return null;
}
return sizeData;
}
return null;
}
private static bool HasTransform(CharacterBody self)
{
return Object.op_Implicit((Object)(object)self.modelLocator) && Object.op_Implicit((Object)(object)self.modelLocator.modelTransform);
}
private static bool ValidateScale(CharacterBody 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_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_001e: 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)
if (self.bodyIndex == RexBodyIndex && Mathf.Abs(self.modelLocator.modelTransform.localScale.x - 0.75f) >= 0.01f)
{
return false;
}
if (self.bodyIndex == ClayableTemplarBodyIndex && Mathf.Abs(self.modelLocator.modelTransform.localScale.x - 0.9f) >= 0.01f)
{
return false;
}
return true;
}
private static SizeClass GetSizeClass(CharacterBody self)
{
//IL_001a: 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_004c: 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_0069: Invalid comparison between Unknown and I4
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Invalid comparison between Unknown and I4
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Invalid comparison between Unknown and I4
if (self.isPlayerControlled)
{
return SizeClass.Player;
}
if (LesserBodyIndexes.Contains(self.bodyIndex))
{
return SizeClass.Lesser;
}
if (GreaterBodyIndexes.Contains(self.bodyIndex))
{
return SizeClass.Greater;
}
if (ChampionBodyIndexes.Contains(self.bodyIndex))
{
return SizeClass.Champion;
}
if ((int)self.hullClassification == 2)
{
return SizeClass.Champion;
}
if ((int)self.hullClassification == 1)
{
return SizeClass.Greater;
}
if ((int)self.hullClassification == 0)
{
return SizeClass.Lesser;
}
return SizeClass.None;
}
private static float GetCharacterScale(CharacterBody self, SizeData sizeData)
{
//IL_03a5: 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_0273: Invalid comparison between Unknown and I4
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
float value;
float num2;
float value2;
float num;
float num3;
switch (sizeData.sizeClass)
{
case SizeClass.Player:
num = Configuration.PlayerSizeIncrease.Value;
value = Configuration.PlayerSizeMult.Value;
num2 = Configuration.PlayerSizeExponent.Value;
value2 = Configuration.PlayerSizeLimit.Value;
num3 = 0.5f;
break;
case SizeClass.Lesser:
num = Configuration.LesserSizeIncrease.Value;
value = Configuration.LesserSizeMult.Value;
num2 = Configuration.LesserSizeExponent.Value;
value2 = Configuration.LesserSizeLimit.Value;
num3 = 0.5f;
break;
case SizeClass.Greater:
num = Configuration.GreaterSizeIncrease.Value;
value = Configuration.GreaterSizeMult.Value;
num2 = Configuration.GreaterSizeExponent.Value;
value2 = Configuration.GreaterSizeLimit.Value;
num3 = 0.35f;
break;
case SizeClass.Champion:
num = Configuration.ChampionSizeIncrease.Value;
value = Configuration.ChampionSizeMult.Value;
num2 = Configuration.ChampionSizeExponent.Value;
value2 = Configuration.ChampionSizeLimit.Value;
num3 = 0.25f;
break;
default:
return 1f;
}
value2 = Mathf.Min(Configuration.AbsoluteSizeLimit.Value, value2);
if (Configuration.IgnoreSizeLimit.Value)
{
value2 = 999f;
num3 = 0.1f;
}
if (Configuration.IgnoreSizeExponent.Value)
{
num2 = 1f;
}
float num4 = 1f;
float value3 = Configuration.ModifierMult.Value;
Inventory inventory = self.inventory;
int itemCountEffective;
if (Object.op_Implicit((Object)(object)inventory))
{
float value4 = Configuration.CoreItemModifierLimit.Value;
itemCountEffective = inventory.GetItemCountEffective(Items.Knurl);
if (itemCountEffective > 0)
{
num += value3 * Configuration.KnurlSizeIncrease.Value * Mathf.Min(value4, Mathf.Sqrt((float)itemCountEffective));
}
itemCountEffective = 10 * self.inventory.GetItemCountEffective(Items.Pearl);
itemCountEffective += 25 * self.inventory.GetItemCountEffective(Items.ShinyPearl);
if (itemCountEffective > 0)
{
num += value3 * Configuration.PearlSizeIncrease.Value * Mathf.Min(value4, Mathf.Sqrt((float)itemCountEffective / 10f));
}
itemCountEffective = inventory.GetItemCountEffective(Items.HalfSpeedDoubleHealth);
if (itemCountEffective > 0)
{
num += value3 * Configuration.StoneFluxSizeIncrease.Value * Mathf.Min(value4, Mathf.Sqrt((float)itemCountEffective));
}
if ((int)RelicMassIndex != -1)
{
itemCountEffective = inventory.GetItemCountEffective(RelicMassIndex);
if (itemCountEffective > 0)
{
num += value3 * Configuration.StoneFluxSizeIncrease.Value * Mathf.Min(value4, Mathf.Sqrt((float)itemCountEffective));
}
}
itemCountEffective = inventory.GetItemCountPermanent(ZetSizeControllerContent.Items.ZetSplitTracker);
if (itemCountEffective > 1)
{
num4 *= Mathf.Pow(Configuration.SplitifactMult.Value, (float)(itemCountEffective - 1));
}
itemCountEffective = inventory.GetItemCountEffective(Items.LunarDagger);
if (itemCountEffective > 0)
{
num4 *= Mathf.Max(Configuration.GlassModifierLimit.Value, Mathf.Pow(Configuration.GlassSizeMult.Value, (float)itemCountEffective));
}
num += value3 * GetItemScoreScaling(inventory);
}
if (self.isBoss)
{
num += value3 * Configuration.BossSizeIncrease.Value;
}
itemCountEffective = self.eliteBuffCount;
if (itemCountEffective > 0)
{
num += value3 * Configuration.EliteSizeIncrease.Value;
num += value3 * Configuration.EliteCountSizeIncrease.Value * Mathf.Pow((float)itemCountEffective, Configuration.EliteCountExponent.Value);
}
itemCountEffective = self.GetBuffCount(HeadhunterBuff);
if (itemCountEffective > 0)
{
num += value3 * Configuration.HeadhunterSizeIncrease.Value * Mathf.Pow((float)itemCountEffective, Configuration.HeadhunterExponent.Value);
}
if (self.HasBuff(Buffs.TonicBuff))
{
num4 *= Configuration.TonicSizeMult.Value;
}
num += value3 * GetLevelScaling(sizeData.sizeClass == SizeClass.Player, self.level);
if (num < 0f)
{
num = -0.01f * Util.ConvertAmplificationPercentageIntoReductionPercentage(Mathf.Abs(num) * 100f);
}
float num5 = Mathf.Max(0.1f, value * (1f + num));
if (num5 > 1f)
{
num5 = Mathf.Pow(num5, num2);
}
if (ZetShrinkifact.Enabled)
{
if (sizeData.sizeClass == SizeClass.Player)
{
if (Configuration.ShrinkifactPlayer.Value)
{
num4 *= Configuration.ShrinkifactMult.Value;
if (Configuration.ShrinkifactExtend.Value)
{
num3 *= Configuration.ShrinkifactMult.Value;
}
}
}
else if (Configuration.ShrinkifactMonster.Value)
{
num4 *= Configuration.ShrinkifactMult.Value;
if (Configuration.ShrinkifactExtend.Value)
{
num3 *= Configuration.ShrinkifactMult.Value;
}
}
}
if (ZetTitanifact.Enabled)
{
if (sizeData.sizeClass == SizeClass.Player)
{
if (Configuration.TitanifactPlayer.Value)
{
num4 *= Configuration.TitanifactMult.Value;
if (Configuration.TitanifactExtend.Value && Configuration.PlayerSizeLimitExtendable.Value)
{
value2 *= Configuration.TitanifactMult.Value;
}
}
}
else if (Configuration.TitanifactMonster.Value)
{
num4 *= Configuration.TitanifactMult.Value;
if (Configuration.TitanifactExtend.Value)
{
value2 *= Configuration.TitanifactMult.Value;
}
}
}
num3 = Mathf.Max(num3, 0.1f);
num5 *= num4;
return Mathf.Clamp(num5, num3, Mathf.Max(num3, value2));
}
private static float GetItemScoreScaling(Inventory inventory)
{
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Invalid comparison between Unknown and I4
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
float value = Configuration.ItemScoreSizeIncrease.Value;
if (value > 0f)
{
float num = 0f;
float value2 = Configuration.ItemScoreT1Effect.Value;
float value3 = Configuration.ItemScoreT2Effect.Value;
float value4 = Configuration.ItemScoreT3Effect.Value;
float value5 = Configuration.ItemScoreBossEffect.Value;
float value6 = Configuration.ItemScoreLunarEffect.Value;
num += value2 * (float)inventory.GetTotalItemCountOfTier((ItemTier)0);
num += value2 * (float)inventory.GetTotalItemCountOfTier((ItemTier)6);
num += value3 * (float)inventory.GetTotalItemCountOfTier((ItemTier)1);
num += value3 * (float)inventory.GetTotalItemCountOfTier((ItemTier)7);
num += value4 * (float)inventory.GetTotalItemCountOfTier((ItemTier)2);
num += value4 * (float)inventory.GetTotalItemCountOfTier((ItemTier)8);
num += value5 * (float)inventory.GetTotalItemCountOfTier((ItemTier)4);
num += value5 * (float)inventory.GetTotalItemCountOfTier((ItemTier)9);
num += value6 * (float)inventory.GetTotalItemCountOfTier((ItemTier)3);
if ((int)LunarVoidTier != 1000)
{
num += value6 * (float)inventory.GetTotalItemCountOfTier(LunarVoidTier);
}
if (num > 0f)
{
value *= Mathf.Pow(num, Configuration.ItemScoreSizeExponent.Value);
return Mathf.Min(value, Configuration.ItemScoreSizeLimit.Value);
}
}
return 0f;
}
private static float GetLevelScaling(bool isPlayer, float level)
{
if (level > 1.99f)
{
float value;
float value2;
float num;
if (isPlayer)
{
num = Mathf.Abs(Configuration.PlayerLevelSizeIncrease.Value);
if (num == 0f)
{
return 0f;
}
value = Configuration.PlayerLevelSizeExponent.Value;
value2 = Configuration.PlayerLevelSizeLimit.Value;
}
else
{
num = Mathf.Abs(Configuration.MonsterLevelSizeIncrease.Value);
if (num == 0f)
{
return 0f;
}
value = Configuration.MonsterLevelSizeExponent.Value;
value2 = Configuration.MonsterLevelSizeLimit.Value;
}
num *= Mathf.Pow(level - 1f, value);
return Mathf.Min(num, value2);
}
return 0f;
}
private static void FixedUpdateHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__28_0;
if (obj == null)
{
hook_FixedUpdate val = delegate(orig_FixedUpdate orig, CharacterBody self)
{
orig.Invoke(self);
UpdateSize(self, instant: false);
};
<>c.<>9__28_0 = val;
obj = (object)val;
}
CharacterBody.FixedUpdate += (hook_FixedUpdate)obj;
}
private static void UpdateSize(CharacterBody self, bool instant)
{
//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)
if (!Object.op_Implicit((Object)(object)self))
{
return;
}
SizeData component = ((Component)self).gameObject.GetComponent<SizeData>();
if (!Object.op_Implicit((Object)(object)component))
{
return;
}
float fixedDeltaTime = Time.fixedDeltaTime;
bool value = Configuration.ValidateMonsterSize.Value;
bool flag = component.sizeClass == SizeClass.Player;
if (!value || flag || component.validation <= 1)
{
if (value && !flag && component.validation == 1)
{
component.size = self.modelLocator.modelTransform.localScale;
instant = true;
}
bool flag2 = false;
bool flag3 = component.forceUpdate > 0f;
if (flag3 || component.scale != component.target)
{
flag2 = true;
float value2 = Configuration.SizeChangeRate.Value;
if (instant || flag3 || value2 <= 0f)
{
component.scale = component.target;
}
else
{
float num = fixedDeltaTime * component.scale * value2;
if (component.scale < component.target)
{
component.scale = Mathf.Min(component.scale + num, component.target);
}
else
{
component.scale = Mathf.Max(component.scale - num, component.target);
}
}
}
if (flag2 && HasTransform(self))
{
SetSize(self, component);
}
if (component.forceUpdate > 0f)
{
component.forceUpdate = Mathf.Max(0f, component.forceUpdate - fixedDeltaTime);
}
}
if (component.validation > 0)
{
component.validation--;
}
}
private static void SetSize(CharacterBody body, SizeData sizeData)
{
//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_0010: 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_0028: 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_0038: 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)
bool flag = body.bodyIndex == RexBodyIndex;
Vector3 size = sizeData.size;
float scale = sizeData.scale;
body.modelLocator.modelTransform.localScale = new Vector3(size.x * scale, size.y * scale, size.z * scale);
float num = sizeData.height / 2f * (scale - 1f);
if (flag)
{
num *= 1.75f;
}
sizeData.heightVerticalOffset = num;
sizeData.playbackSpeed = Mathf.Clamp(1f / scale, 0.125f, 4f);
float num2 = (flag ? 0.4f : 2f);
sizeData.interactionRange = 1f + Mathf.Max(0f, scale - 1f) / num2;
}
private static void OnDestroyHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__31_0;
if (obj == null)
{
hook_OnDestroy val = delegate(orig_OnDestroy orig, CharacterBody self)
{
DestroySizeData(self);
orig.Invoke(self);
};
<>c.<>9__31_0 = val;
obj = (object)val;
}
CharacterBody.OnDestroy += (hook_OnDestroy)obj;
}
private static void DestroySizeData(CharacterBody self)
{
//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)
if (!Object.op_Implicit((Object)(object)self))
{
return;
}
SizeData component = ((Component)self).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
if (component.sizeClass == SizeClass.Player)
{
NetworkInstanceId netId = component.netId;
ZetSizeControllerPlugin.LogWarn("Destroying Player SizeData : " + ((object)(NetworkInstanceId)(ref netId)).ToString());
}
Object.Destroy((Object)(object)component);
}
}
private static void ResizeOnVehicleExit(VehicleSeat seat, GameObject gameObject)
{
CharacterBody component = gameObject.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component))
{
SizeData component2 = gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component2))
{
component2.scale = component2.target - 0.01f;
UpdateSize(component, instant: true);
}
}
}
private static void FixPrintController()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__34_0;
if (obj == null)
{
Manipulator val = delegate(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_004d: 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_008d: Unknown result type (might be due to invalid IL or missing references)
ILCursor val2 = new ILCursor(il);
if (val2.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<PrintController>(x, "maxPrintHeight")
}))
{
val2.Index += 1;
val2.Emit(OpCodes.Ldarg, 0);
val2.Emit(OpCodes.Ldarg, 1);
val2.EmitDelegate<Func<PrintController, float, float>>((Func<PrintController, float, float>)delegate(PrintController printController, float sample)
{
//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)
CharacterModel characterModel = printController.characterModel;
if (Object.op_Implicit((Object)(object)characterModel))
{
CharacterBody body = characterModel.body;
if (Object.op_Implicit((Object)(object)body))
{
if (body.bodyIndex == ClayableTemplarBodyIndex)
{
return 1f;
}
if (sample >= 1f)
{
return 100f;
}
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return Mathf.Max(1f, component.scale);
}
}
}
return 1f;
});
val2.Emit(OpCodes.Mul);
}
else
{
ZetSizeControllerPlugin.LogWarn("FixPrintController Failed");
}
};
<>c.<>9__34_0 = val;
obj = (object)val;
}
PrintController.SetPrintThreshold += (Manipulator)obj;
}
private static void CameraDistanceHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__35_0;
if (obj == null)
{
Manipulator val = delegate(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//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_008e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val2 = new ILCursor(il);
if (val2.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 13)
}))
{
val2.Index += 1;
val2.Emit(OpCodes.Ldloc, 13);
val2.Emit(OpCodes.Ldloc, 1);
val2.EmitDelegate<Func<Vector3, CameraRigController, Vector3>>((Func<Vector3, CameraRigController, Vector3>)delegate(Vector3 direction, CameraRigController camRig)
{
//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)
//IL_0040: 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_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)
CharacterBody targetBody = camRig.targetBody;
if (Object.op_Implicit((Object)(object)targetBody))
{
SizeData component = ((Component)targetBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return direction * component.scale;
}
}
return direction;
});
val2.Emit(OpCodes.Stloc, 13);
}
else
{
ZetSizeControllerPlugin.LogWarn("CameraDistanceHook Failed");
}
};
<>c.<>9__35_0 = val;
obj = (object)val;
}
CameraModePlayerBasic.UpdateInternal += (Manipulator)obj;
}
private static void CameraVerticalOffsetHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__36_0;
if (obj == null)
{
Manipulator val = delegate(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
ILCursor val2 = new ILCursor(il);
if (val2.TryGotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdflda<CharacterCameraParamsData>(x, "pivotVerticalOffset"),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<BlendableFloat>(x, "value")
}))
{
val2.Index += 2;
val2.Emit(OpCodes.Ldloc, 0);
val2.EmitDelegate<Func<float, CameraRigController, float>>((Func<float, CameraRigController, float>)delegate(float vertical, CameraRigController camRig)
{
CharacterBody targetBody = camRig.targetBody;
if (Object.op_Implicit((Object)(object)targetBody))
{
SizeData component = ((Component)targetBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
return vertical * component.scale + component.heightVerticalOffset;
}
}
return vertical;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("CameraVerticalOffsetHook Failed");
}
};
<>c.<>9__36_0 = val;
obj = (object)val;
}
CameraModePlayerBasic.CalculateTargetPivotPosition += (Manipulator)obj;
}
private static void InteractionDriverHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__37_0;
if (obj == null)
{
Manipulator val = delegate(ILContext il)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Expected O, but got Unknown
//IL_00ad: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
ILCursor val2 = new ILCursor(il);
int rangeIndex = -1;
if (val2.TryGotoNext(new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<InteractionDriver>(x, "get_interactor"),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<Interactor>(x, "maxInteractionDistance"),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref rangeIndex)
}))
{
val2.Index += 4;
val2.Emit(OpCodes.Ldarg, 0);
val2.Emit(OpCodes.Ldloc, rangeIndex);
val2.EmitDelegate<Func<InteractionDriver, float, float>>((Func<InteractionDriver, float, float>)delegate(InteractionDriver driver, float range)
{
CharacterBody characterBody = driver.characterBody;
if (Object.op_Implicit((Object)(object)characterBody))
{
SizeData component = ((Component)characterBody).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
range *= component.interactionRange;
}
}
return range;
});
val2.Emit(OpCodes.Stloc, rangeIndex);
}
else
{
ZetSizeControllerPlugin.LogWarn("InteractionHook Failed");
}
};
<>c.<>9__37_0 = val;
obj = (object)val;
}
InteractionDriver.FindBestInteractableObject += (Manipulator)obj;
}
private static void PickupPickerHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__38_0;
if (obj == null)
{
Manipulator val = delegate(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
ILCursor val2 = new ILCursor(il);
if (val2.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<PickupPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<PickupPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchMul(x)
}))
{
val2.Index += 5;
val2.Emit(OpCodes.Ldloc, 1);
val2.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("PickupPickerHook Failed");
}
};
<>c.<>9__38_0 = val;
obj = (object)val;
}
PickupPickerController.FixedUpdateServer += (Manipulator)obj;
}
private static void TieredPickupPickerHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__39_0;
if (obj == null)
{
Manipulator val = delegate(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
ILCursor val2 = new ILCursor(il);
if (val2.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<TieredPickupPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<TieredPickupPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchMul(x)
}))
{
val2.Index += 5;
val2.Emit(OpCodes.Ldloc, 1);
val2.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("TieredPickupPickerHook Failed");
}
};
<>c.<>9__39_0 = val;
obj = (object)val;
}
TieredPickupPickerController.FixedUpdateServer += (Manipulator)obj;
}
private static void DroneScrapperPickerHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__40_0;
if (obj == null)
{
Manipulator val = delegate(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
ILCursor val2 = new ILCursor(il);
if (val2.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DroneScrapperPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DroneScrapperPickerController>(x, "cutoffDistance"),
(Instruction x) => ILPatternMatchingExt.MatchMul(x)
}))
{
val2.Index += 5;
val2.Emit(OpCodes.Ldloc, 1);
val2.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float cutoff, CharacterBody body)
{
SizeData component = ((Component)body).gameObject.GetComponent<SizeData>();
if (Object.op_Implicit((Object)(object)component))
{
float interactionRange = component.interactionRange;
cutoff *= interactionRange * interactionRange;
}
return cutoff;
});
}
else
{
ZetSizeControllerPlugin.LogWarn("DroneScrapperPickerHook Failed");
}
};
<>c.<>9__40_0 = val;
obj = (object)val;
}
DroneScrapperPickerController.FixedUpdateServer += (Manipulator)obj;
}
private static void OverlapAttackPositionHook()
{
//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_0020: Expected O, but got Unknown
object obj = <>c.<>9__41_0;
if (obj == null)
{
Manipulator val = delegate(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val2 = new ILCursor(il);
if (val2.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 4)
}))
{
val2.Emit(OpCodes.Ldarg, 0);
val2.EmitDelegate<Func<Vector3, OverlapAttack, Vector3>>((Func<Vector3, OverlapAttack, Vector3>)delegate(Vector3 position, OverlapAttack attack)
{
//IL_008b: Unknown result type (might be due to invalid IL or missin