using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DIOOH.Modules; using DIOOH.Modules.Characters; using DIOOH.Survivors.DIO; using DIOOH.Survivors.DIO.Components; using DIOOH.Survivors.DIO.SkillStates; using EntityStates; using EntityStates.AI.Walker; using EntityStates.ClayBruiser.Weapon; using EntityStates.GolemMonster; using EntityStates.GreaterWispMonster; using EntityStates.TitanMonster; using EntityStates.Wisp1Monster; using HG; using HG.BlendableTypes; using NAudio.Wave; using On.EntityStates.ClayBruiser.Weapon; using On.EntityStates.GolemMonster; using On.EntityStates.GreaterWispMonster; using On.EntityStates.TitanMonster; using On.EntityStates.Wisp1Monster; using On.RoR2; using On.RoR2.Orbs; using On.RoR2.Projectile; using R2API; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DIOOH")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("DIOOH")] [assembly: AssemblyTitle("DIOOH")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace DIOOH { [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.ES15.DIOOH", "DIOOH", "1.0.2")] public class DIOOHPlugin : BaseUnityPlugin { public const string MODUID = "com.ES15.DIOOH"; public const string MODNAME = "DIOOH"; public const string MODVERSION = "1.0.2"; public const string DEVELOPER_PREFIX = "ES15"; public static DIOOHPlugin instance; private void Awake() { instance = this; Log.Init(((BaseUnityPlugin)this).Logger); Language.Init(); new DIOSurvivor().Initialize(); new ContentPacks().Initialize(); } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace DIOOH.Modules { internal static class Asset { internal static Dictionary loadedBundles = new Dictionary(); internal static AssetBundle LoadAssetBundle(string bundleName) { if (bundleName == "myassetbundle") { Log.Error("AssetBundle name hasn't been changed. not loading any assets to avoid conflicts.\nMake sure to rename your assetbundle filename and rename the AssetBundleName field in your character setup code "); return null; } if (loadedBundles.ContainsKey(bundleName)) { return loadedBundles[bundleName]; } AssetBundle val = null; try { val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)DIOOHPlugin.instance).Info.Location), "AssetBundles", bundleName)); } catch (Exception arg) { Log.Error($"Error loading asset bundle, {bundleName}. Your asset bundle must be in a folder next to your mod dll called 'AssetBundles'. Follow the guide to build and install your mod correctly!\n{arg}"); } loadedBundles[bundleName] = val; return val; } internal static GameObject CloneTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } val.GetComponent().speed = 250f; val.GetComponent().length = 50f; Content.CreateAndAddEffectDef(val); return val; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren(); foreach (MeshRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).sharedMaterial)) { ((Renderer)val).sharedMaterial.ConvertDefaultShaderToHopoo(); } } SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).sharedMaterial)) { ((Renderer)val2).sharedMaterial.ConvertDefaultShaderToHopoo(); } } } internal static GameObject LoadCrosshair(string crosshairName) { GameObject val = LegacyResourcesAPI.Load("Prefabs/Crosshair/" + crosshairName + "Crosshair"); if ((Object)(object)val == (Object)null) { Log.Error("could not load crosshair with the name " + crosshairName + ". defaulting to Standard"); return LegacyResourcesAPI.Load("Prefabs/Crosshair/StandardCrosshair"); } return val; } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, bool parentToTransform) { return assetBundle.LoadEffect(resourceName, "", parentToTransform); } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, string soundName = "", bool parentToTransform = false) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) GameObject val = assetBundle.LoadAsset(resourceName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(resourceName, ((Object)assetBundle).name); return null; } val.AddComponent().duration = 12f; val.AddComponent(); val.AddComponent().vfxPriority = (VFXPriority)2; EffectComponent obj = val.AddComponent(); obj.applyScale = false; obj.effectIndex = (EffectIndex)(-1); obj.parentToReferencedTransform = parentToTransform; obj.positionAtReferencedTransform = true; obj.soundName = soundName; Content.CreateAndAddEffectDef(val); return val; } internal static GameObject CreateProjectileGhostPrefab(this AssetBundle assetBundle, string ghostName) { GameObject val = assetBundle.LoadAsset(ghostName); if ((Object)(object)val == (Object)null) { Log.Error("Failed to load ghost prefab " + ghostName); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } ConvertAllRenderersToHopooShader(val); return val; } internal static GameObject CloneProjectilePrefab(string prefabName, string newPrefabName) { return PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/" + prefabName), newPrefabName); } internal static GameObject LoadAndAddProjectilePrefab(this AssetBundle assetBundle, string newPrefabName) { GameObject val = assetBundle.LoadAsset(newPrefabName); if ((Object)(object)val == (Object)null) { Log.ErrorAssetBundle(newPrefabName, ((Object)assetBundle).name); return null; } Content.AddProjectilePrefab(val); return val; } } public static class Config { public static ConfigFile MyConfig = ((BaseUnityPlugin)DIOOHPlugin.instance).Config; public static ConfigEntry CharacterEnableConfig(string section, string characterName, string description = "", bool enabledByDefault = true) { if (string.IsNullOrEmpty(description)) { description = "Set to false to disable this character and as much of its code and content as possible"; } return BindAndOptions(section, "Enable " + characterName, enabledByDefault, description, restartRequired: true); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, string description = "", bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, 0f, 20f, description, restartRequired); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, float min, float max, string description = "", bool restartRequired = false) { if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } ConfigEntry result = MyConfig.Bind(section, name, defaultValue, description); Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); return result; } public static ConfigEntry BindAndOptionsSlider(string section, string name, float defaultValue, string description, float min = 0f, float max = 20f, bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, min, max, description, restartRequired); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void TryRegisterOption(ConfigEntry entry, float min, float max, bool restartRequired) { } public static bool GetKeyPressed(KeyboardShortcut entry) { //IL_0010: 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) foreach (KeyCode modifier in ((KeyboardShortcut)(ref entry)).Modifiers) { if (!Input.GetKey(modifier)) { return false; } } return Input.GetKeyDown(((KeyboardShortcut)(ref entry)).MainKey); } } internal class Content { internal static void AddCharacterBodyPrefab(GameObject bprefab) { ContentPacks.bodyPrefabs.Add(bprefab); } internal static void AddMasterPrefab(GameObject prefab) { ContentPacks.masterPrefabs.Add(prefab); } internal static void AddProjectilePrefab(GameObject prefab) { ContentPacks.projectilePrefabs.Add(prefab); } internal static void AddSurvivorDef(SurvivorDef survivorDef) { ContentPacks.survivorDefs.Add(survivorDef); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) SurvivorDef obj = ScriptableObject.CreateInstance(); obj.bodyPrefab = bodyPrefab; obj.displayPrefab = displayPrefab; obj.primaryColor = charColor; obj.cachedName = ((Object)bodyPrefab).name.Replace("Body", ""); obj.displayNameToken = tokenPrefix + "NAME"; obj.descriptionToken = tokenPrefix + "DESCRIPTION"; obj.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR"; obj.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE"; obj.desiredSortPosition = sortPosition; obj.unlockableDef = unlockableDef; AddSurvivorDef(obj); } internal static void AddUnlockableDef(UnlockableDef unlockableDef) { ContentPacks.unlockableDefs.Add(unlockableDef); } internal static UnlockableDef CreateAndAddUnlockbleDef(string identifier, string nameToken, Sprite achievementIcon) { UnlockableDef obj = ScriptableObject.CreateInstance(); obj.cachedName = identifier; obj.nameToken = nameToken; obj.achievementIcon = achievementIcon; AddUnlockableDef(obj); return obj; } internal static void AddSkillDef(SkillDef skillDef) { ContentPacks.skillDefs.Add(skillDef); } internal static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } internal static void AddEntityState(Type entityState) { ContentPacks.entityStates.Add(entityState); } internal static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } internal static BuffDef CreateAndAddBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) BuffDef obj = ScriptableObject.CreateInstance(); ((Object)obj).name = buffName; obj.buffColor = buffColor; obj.canStack = canStack; obj.isDebuff = isDebuff; obj.eliteDef = null; obj.iconSprite = buffIcon; AddBuffDef(obj); return obj; } internal static void AddEffectDef(EffectDef effectDef) { ContentPacks.effectDefs.Add(effectDef); } internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_000d: Expected O, but got Unknown EffectDef val = new EffectDef(effectPrefab); AddEffectDef(val); return val; } internal static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } internal static NetworkSoundEventDef CreateAndAddNetworkSoundEventDef(string eventName) { NetworkSoundEventDef obj = ScriptableObject.CreateInstance(); obj.akId = AkSoundEngine.GetIDFromString(eventName); obj.eventName = eventName; AddNetworkSoundEventDef(obj); return obj; } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List bodyPrefabs = new List(); public static List masterPrefabs = new List(); public static List projectilePrefabs = new List(); public static List survivorDefs = new List(); public static List unlockableDefs = new List(); public static List skillFamilies = new List(); public static List skillDefs = new List(); public static List entityStates = new List(); public static List buffDefs = new List(); public static List effectDefs = new List(); public static List networkSoundEventDefs = new List(); public string identifier => "com.ES15.DIOOH"; public void Initialize() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); contentPack.survivorDefs.Add(survivorDefs.ToArray()); contentPack.unlockableDefs.Add(unlockableDefs.ToArray()); contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.entityStateTypes.Add(entityStates.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.effectDefs.Add(effectDefs.ToArray()); contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } internal static class ItemDisplayCheck { public static List allDisplayedItems; public static void PrintUnused(ItemDisplayRuleSet itemDisplayRuleSet, string bodyName = "") { PrintUnused((IEnumerable)itemDisplayRuleSet.keyAssetRuleGroups.ToList(), bodyName); } public static void PrintUnused(IEnumerable ruleSet = null, string bodyName = "") { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) string text = "generating item displays for " + bodyName; if (allDisplayedItems == null) { LazyGatherAllItems(); } List list = new List(allDisplayedItems); string text2 = ""; if (ruleSet != null) { foreach (KeyAssetRuleGroup item in ruleSet) { if (item.displayRuleGroup.rules.Length != 0) { list.Remove(item.keyAsset); if (string.IsNullOrEmpty(text2)) { text2 = item.displayRuleGroup.rules[0].childName; } } } } if (string.IsNullOrEmpty(text2)) { text2 = "Chest"; } foreach (Object item2 in list) { string text3 = ""; if (ItemDisplays.KeyAssetDisplayPrefabs.ContainsKey(item2)) { text3 += SpitOutNewRule(item2, text2, ItemDisplays.KeyAssetDisplayPrefabs[item2]); } else { Log.Error($"COULD NOT FIND DISPLAY PREFABS FOR KEYASSET {item2}"); } text += text3; } Log.Message(text); } private static void LazyGatherAllItems() { allDisplayedItems = new List(ItemDisplays.KeyAssetDisplayPrefabs.Keys); allDisplayedItems.Sort(delegate(Object item1, Object item2) { if (item1 is ItemDef && item2 is ItemDef) { return item1.name.CompareTo(item2.name); } if (item1 is EquipmentDef && item2 is EquipmentDef) { return item1.name.CompareTo(item2.name); } if (item1 is ItemDef && item2 is EquipmentDef) { return -1; } return (item1 is EquipmentDef && item2 is ItemDef) ? 1 : 0; }); } private static string SpitOutNewRule(Object asset, string firstCompatibleChild, ItemDisplayRule[] displayRules) { //IL_0031: 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) if (displayRules.Length == 0) { return $"\n[NO DISPLAY RULES FOUND FOR THE KEYASSET {asset}"; } string text = "\n itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets[\"" + asset.name + "\"]"; for (int i = 0; i < displayRules.Length; i++) { text = (((int)displayRules[i].limbMask != 0) ? (text + ",\n" + $" ItemDisplays.CreateLimbMaskDisplayRule(LimbFlags.{displayRules[i].limbMask})") : (text + ",\n ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay(\"" + ((Object)displayRules[i].followerPrefab).name + "\"),\n \"" + firstCompatibleChild + "\",\n new Vector3(2, 2, 2),\n new Vector3(0, 0, 0),\n new Vector3(1, 1, 1)\n )")); } return text + "\n ));"; } } internal static class ItemDisplays { private static Dictionary itemDisplayPrefabs = new Dictionary(); public static Dictionary KeyAssetDisplayPrefabs = new Dictionary(); public static Dictionary KeyAssets = new Dictionary(); public static int queuedDisplays; public static bool initialized = false; public static void LazyInit() { if (!initialized) { initialized = true; PopulateDisplays(); } } internal static void DisposeWhenDone() { queuedDisplays--; if (queuedDisplays <= 0 && initialized) { initialized = false; itemDisplayPrefabs = null; KeyAssetDisplayPrefabs = null; KeyAssets = null; } } internal static void PopulateDisplays() { PopulateFromBody("LoaderBody"); } private static void PopulateFromBody(string bodyName) { KeyAssetRuleGroup[] keyAssetRuleGroups = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyName).GetComponent().modelTransform).GetComponent().itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < keyAssetRuleGroups.Length; i++) { ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules; KeyAssetDisplayPrefabs[keyAssetRuleGroups[i].keyAsset] = rules; KeyAssets[keyAssetRuleGroups[i].keyAsset.name] = keyAssetRuleGroups[i].keyAsset; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (Object.op_Implicit((Object)(object)followerPrefab)) { string key = ((Object)followerPrefab).name?.ToLowerInvariant(); if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } } private static void PopulateCustomLightningArm() { GameObject val = PrefabAPI.InstantiateClone(itemDisplayPrefabs["displaylightningarmright"], "DisplayLightningCustom", false); LimbMatcher component = val.GetComponent(); component.limbPairs[0].targetChildLimb = "LightningArm1"; component.limbPairs[1].targetChildLimb = "LightningArm2"; component.limbPairs[2].targetChildLimb = "LightningArmEnd"; itemDisplayPrefabs["displaylightningarmcustom"] = val; } public static GameObject LoadDisplay(string name) { if (itemDisplayPrefabs.ContainsKey(name.ToLowerInvariant()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLowerInvariant()])) { return itemDisplayPrefabs[name.ToLowerInvariant()]; } Log.Error("item display " + name + " returned null"); return null; } public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(string itemName, params ItemDisplayRule[] rules) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return CreateDisplayRuleGroupWithRules(GetKeyAssetFromString(itemName), rules); } public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(Object keyAsset_, params ItemDisplayRule[] rules) { //IL_0015: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (keyAsset_ == (Object)null) { Log.Error("could not find keyasset"); } return new KeyAssetRuleGroup { keyAsset = keyAsset_, displayRuleGroup = new DisplayRuleGroup { rules = rules } }; } public static ItemDisplayRule CreateDisplayRule(string prefabName, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return CreateDisplayRule(LoadDisplay(prefabName), childName, position, rotation, scale); } public static ItemDisplayRule CreateDisplayRule(GameObject itemPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { //IL_0002: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) return new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = childName, followerPrefab = itemPrefab, limbMask = (LimbFlags)0, localPos = position, localAngles = rotation, localScale = scale }; } public static ItemDisplayRule CreateLimbMaskDisplayRule(LimbFlags limb) { //IL_0002: 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) return new ItemDisplayRule { ruleType = (ItemDisplayRuleType)1, limbMask = limb, childName = "", followerPrefab = null }; } private static Object GetKeyAssetFromString(string itemName) { Object val = (Object)(object)LegacyResourcesAPI.Load("ItemDefs/" + itemName); if (val == (Object)null) { val = (Object)(object)LegacyResourcesAPI.Load("EquipmentDefs/" + itemName); } if (val == (Object)null) { Log.Error("Could not load keyasset for " + itemName); } return val; } } internal static class Language { public static string TokensOutput = ""; public static bool usingLanguageFolder = false; public static bool printingEnabled = false; public static void Init() { if (usingLanguageFolder) { Language.collectLanguageRootFolders += Language_collectLanguageRootFolders; } } private static void Language_collectLanguageRootFolders(List obj) { string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)DIOOHPlugin.instance).Info.Location), "Language"); if (Directory.Exists(text)) { obj.Add(text); } } public static void Add(string token, string text) { if (!usingLanguageFolder) { LanguageAPI.Add(token, text); } if (printingEnabled) { TokensOutput = TokensOutput + "\n \"" + token + "\" : \"" + text.Replace(Environment.NewLine, "\\n").Replace("\n", "\\n") + "\","; } } public static void PrintOutput(string fileName = "") { if (printingEnabled) { string text = "{\n strings:\n {" + TokensOutput + "\n }\n}"; Log.Message(fileName + ": \n" + text); if (!string.IsNullOrEmpty(fileName)) { File.WriteAllText(Path.Combine(Directory.GetParent(((BaseUnityPlugin)DIOOHPlugin.instance).Info.Location).FullName, "Language", "en", fileName), text); } TokensOutput = ""; } } } internal static class Materials { private static List cachedMaterials = new List(); internal static Shader hotpoo = LegacyResourcesAPI.Load("Shaders/Deferred/HGStandard"); public static Material LoadMaterial(this AssetBundle assetBundle, string materialName) { return assetBundle.CreateHopooMaterialFromBundle(materialName); } public static Material CreateHopooMaterialFromBundle(this AssetBundle assetBundle, string materialName) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name.Contains(materialName); }); if (Object.op_Implicit((Object)(object)val)) { Log.Debug(((Object)val).name + " has already been loaded. returning cached"); return val; } val = assetBundle.LoadAsset(materialName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(materialName, ((Object)assetBundle).name); return new Material(hotpoo); } return val.ConvertDefaultShaderToHopoo(); } public static Material SetHopooMaterial(this Material tempMat) { return tempMat.ConvertDefaultShaderToHopoo(); } public static Material ConvertDefaultShaderToHopoo(this Material tempMat) { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)tempMat) && (((Object)tempMat).name.StartsWith("matDIO") || ((Object)tempMat).name.StartsWith("matTWOH"))) { return tempMat; } if (cachedMaterials.Contains(tempMat)) { Log.Debug(((Object)tempMat).name + " has already been converted. returning cached"); return tempMat; } string text = ((Object)tempMat.shader).name.ToLowerInvariant(); if (!text.StartsWith("standard") && !text.StartsWith("autodesk")) { Log.Debug(((Object)tempMat).name + " is not unity standard shader. aborting material conversion"); return tempMat; } float? num = null; Color? val = null; if (tempMat.IsKeywordEnabled("_NORMALMAP")) { num = tempMat.GetFloat("_BumpScale"); } if (tempMat.IsKeywordEnabled("_EMISSION")) { val = tempMat.GetColor("_EmissionColor"); } tempMat.shader = hotpoo; tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); tempMat.SetTexture("_NormalTex", tempMat.GetTexture("_BumpMap")); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (tempMat.IsKeywordEnabled("NOCULL")) { tempMat.SetInt("_Cull", 0); } if (tempMat.IsKeywordEnabled("LIMBREMOVAL")) { tempMat.SetInt("_LimbRemovalOn", 1); } cachedMaterials.Add(tempMat); return tempMat; } public static Material MakeUnique(this Material material) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } public static Material SetSpecular(this Material material, float strength) { material.SetFloat("_SpecularStrength", strength); return material; } public static Material SetSpecular(this Material material, float strength, float exponent) { material.SetFloat("_SpecularStrength", strength); material.SetFloat("SpecularExponent", exponent); return material; } } internal static class Prefabs { private static PhysicMaterial ragdollMaterial; public static GameObject CreateDisplayPrefab(AssetBundle assetBundle, string displayPrefabName, GameObject prefab) { GameObject val = assetBundle.LoadAsset(displayPrefabName); if ((Object)(object)val == (Object)null) { Log.Error("could not load display prefab " + displayPrefabName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } CharacterModel val2 = val.GetComponent(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent(); } val2.baseRendererInfos = prefab.GetComponentInChildren().baseRendererInfos; Asset.ConvertAllRenderersToHopooShader(val); return val; } public static GameObject LoadCharacterModel(AssetBundle assetBundle, string modelName) { GameObject val = assetBundle.LoadAsset(modelName); if ((Object)(object)val == (Object)null) { Log.Error("could not load model prefab " + modelName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } return val; } public static GameObject LoadCharacterBody(AssetBundle assetBundle, string bodyName) { GameObject val = assetBundle.LoadAsset(bodyName); if ((Object)(object)val == (Object)null) { Log.Error("could not load body prefab " + bodyName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } return val; } public static GameObject CloneCharacterBody(BodyInfo bodyInfo) { GameObject val = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"); if (!Object.op_Implicit((Object)(object)val)) { Log.Error(bodyInfo.bodyNameToClone + " Body to clone is not a valid body, character creation failed"); return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, bodyInfo.bodyName); for (int num = val2.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(num)).gameObject); } return val2; } public static GameObject CreateBodyPrefab(AssetBundle assetBundle, string modelPrefabName, BodyInfo bodyInfo) { return CreateBodyPrefab(LoadCharacterModel(assetBundle, modelPrefabName), bodyInfo); } public static GameObject CreateBodyPrefab(GameObject model, BodyInfo bodyInfo) { return CreateBodyPrefab(CloneCharacterBody(bodyInfo), model, bodyInfo); } public static GameObject CreateBodyPrefab(GameObject newBodyPrefab, AssetBundle assetBundle, string modelName, BodyInfo bodyInfo) { return CreateBodyPrefab(newBodyPrefab, LoadCharacterModel(assetBundle, modelName), bodyInfo); } public static GameObject CreateBodyPrefab(AssetBundle assetBundle, string bodyPrefabName, string modelPrefabName, BodyInfo bodyInfo) { return CreateBodyPrefab(LoadCharacterBody(assetBundle, bodyPrefabName), LoadCharacterModel(assetBundle, modelPrefabName), bodyInfo); } public static GameObject CreateBodyPrefab(GameObject newBodyPrefab, GameObject model, BodyInfo bodyInfo) { if ((Object)(object)model == (Object)null || (Object)(object)newBodyPrefab == (Object)null) { Log.Error($"Character creation failed. Model: {model}, Body: {newBodyPrefab}"); return null; } SetupCharacterBody(newBodyPrefab, bodyInfo); Transform modelBaseTransform = AddCharacterModelToSurvivorBody(newBodyPrefab, model.transform, bodyInfo); SetupModelLocator(newBodyPrefab, modelBaseTransform, model.transform); SetupCharacterDirection(newBodyPrefab, modelBaseTransform, model.transform); SetupCameraTargetParams(newBodyPrefab, bodyInfo); SetupCapsuleCollider(newBodyPrefab); Content.AddCharacterBodyPrefab(newBodyPrefab); return newBodyPrefab; } private static void SetupCharacterBody(GameObject newBodyPrefab, BodyInfo bodyInfo) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = newBodyPrefab.GetComponent(); component.baseNameToken = bodyInfo.bodyNameToken; component.subtitleNameToken = bodyInfo.subtitleNameToken; component.portraitIcon = bodyInfo.characterPortrait; component.bodyColor = bodyInfo.bodyColor; component._defaultCrosshairPrefab = bodyInfo.crosshair; component.hideCrosshair = false; component.preferredPodPrefab = bodyInfo.podPrefab; component.baseMaxHealth = bodyInfo.maxHealth; component.baseRegen = bodyInfo.healthRegen; component.baseArmor = bodyInfo.armor; component.baseMaxShield = bodyInfo.shield; component.baseDamage = bodyInfo.damage; component.baseAttackSpeed = bodyInfo.attackSpeed; component.baseCrit = bodyInfo.crit; component.baseMoveSpeed = bodyInfo.moveSpeed; component.baseJumpPower = bodyInfo.jumpPower; component.autoCalculateLevelStats = bodyInfo.autoCalculateLevelStats; if (bodyInfo.autoCalculateLevelStats) { component.levelMaxHealth = Mathf.Round(component.baseMaxHealth * 0.3f); component.levelMaxShield = Mathf.Round(component.baseMaxShield * 0.3f); component.levelRegen = component.baseRegen * 0.2f; component.levelMoveSpeed = 0f; component.levelJumpPower = 0f; component.levelDamage = component.baseDamage * 0.2f; component.levelAttackSpeed = 0f; component.levelCrit = 0f; component.levelArmor = 0f; } else { component.levelMaxHealth = bodyInfo.healthGrowth; component.levelMaxShield = bodyInfo.shieldGrowth; component.levelRegen = bodyInfo.regenGrowth; component.levelMoveSpeed = bodyInfo.moveSpeedGrowth; component.levelJumpPower = bodyInfo.jumpPowerGrowth; component.levelDamage = bodyInfo.damageGrowth; component.levelAttackSpeed = bodyInfo.attackSpeedGrowth; component.levelCrit = bodyInfo.critGrowth; component.levelArmor = bodyInfo.armorGrowth; } component.baseAcceleration = bodyInfo.acceleration; component.baseJumpCount = bodyInfo.jumpCount; component.sprintingSpeedMultiplier = 1.45f; component.bodyFlags = (BodyFlags)16; component.rootMotionInMainState = false; component.hullClassification = (HullClassification)0; component.isChampion = false; } private static Transform AddCharacterModelToSurvivorBody(GameObject bodyPrefab, Transform modelTransform, BodyInfo bodyInfo) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0043: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) Transform val = bodyPrefab.transform.Find("ModelBase"); if ((Object)(object)val == (Object)null) { val = new GameObject("ModelBase").transform; val.parent = bodyPrefab.transform; val.localPosition = bodyInfo.modelBasePosition; val.localRotation = Quaternion.identity; } modelTransform.parent = ((Component)val).transform; modelTransform.localPosition = Vector3.zero; modelTransform.localRotation = Quaternion.identity; if ((Object)(object)bodyPrefab.transform.Find("CameraPivot") == (Object)null) { Transform transform = new GameObject("CameraPivot").transform; transform.parent = bodyPrefab.transform; transform.localPosition = bodyInfo.cameraPivotPosition; transform.localRotation = Quaternion.identity; } Transform val2 = bodyPrefab.transform.Find("AimOrigin"); if ((Object)(object)val2 == (Object)null) { val2 = new GameObject("AimOrigin").transform; val2.parent = bodyPrefab.transform; val2.localPosition = bodyInfo.aimOriginPosition; val2.localRotation = Quaternion.identity; } bodyPrefab.GetComponent().aimOriginTransform = val2; return ((Component)val).transform; } private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { if (Object.op_Implicit((Object)(object)prefab.GetComponent())) { CharacterDirection component = prefab.GetComponent(); component.targetTransform = modelBaseTransform; component.overrideAnimatorForwardTransform = null; component.rootMotionAccumulator = null; component.modelAnimator = ((Component)modelTransform).GetComponent(); component.driveFromRootRotation = false; component.turnSpeed = 720f; } } private static void SetupCameraTargetParams(GameObject prefab, BodyInfo bodyInfo) { CameraTargetParams component = prefab.GetComponent(); component.cameraParams = bodyInfo.cameraParams; component.cameraPivotTransform = prefab.transform.Find("CameraPivot"); } private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { ModelLocator component = prefab.GetComponent(); component.modelTransform = modelTransform; component.modelBaseTransform = modelBaseTransform; } private static void SetupCapsuleCollider(GameObject prefab) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = prefab.GetComponent(); component.center = new Vector3(0f, 0f, 0f); component.radius = 0.5f; component.height = 1.82f; component.direction = 1; } public static CharacterModel SetupCharacterModel(GameObject bodyPrefab, CustomRendererInfo[] customInfos = null) { CharacterModel val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.GetComponent(); bool num = (Object)(object)val != (Object)null; if (!num) { val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.AddComponent(); } val.body = bodyPrefab.GetComponent(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List(); if (!num) { SetupCustomRendererInfos(val, customInfos); } else { SetupPreAttachedRendererInfos(val); } SetupHurtboxGroup(bodyPrefab, ((Component)val).gameObject); SetupAimAnimator(bodyPrefab, ((Component)val).gameObject); SetupFootstepController(((Component)val).gameObject); SetupRagdoll(((Component)val).gameObject); return val; } public static void SetupPreAttachedRendererInfos(CharacterModel characterModel) { for (int i = 0; i < characterModel.baseRendererInfos.Length; i++) { if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { characterModel.baseRendererInfos[i].defaultMaterial = characterModel.baseRendererInfos[i].renderer.sharedMaterial; } if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { Log.Error($"no material for rendererinfo of this renderer: {characterModel.baseRendererInfos[i].renderer}"); } characterModel.baseRendererInfos[i].defaultMaterial.ConvertDefaultShaderToHopoo(); } } public static void SetupCustomRendererInfos(CharacterModel characterModel, CustomRendererInfo[] customInfos) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) ChildLocator component = ((Component)characterModel).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("Failed CharacterModel setup: ChildLocator component does not exist on the model"); return; } List list = new List(); for (int i = 0; i < customInfos.Length; i++) { if (!Object.op_Implicit((Object)(object)component.FindChild(customInfos[i].childName))) { Log.Error("Trying to add a RendererInfo for a renderer that does not exist: " + customInfos[i].childName); continue; } Renderer component2 = ((Component)component.FindChild(customInfos[i].childName)).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Material val = customInfos[i].material; if ((Object)(object)val == (Object)null) { val = ((!customInfos[i].dontHotpoo) ? component2.sharedMaterial.ConvertDefaultShaderToHopoo() : component2.sharedMaterial); } list.Add(new RendererInfo { renderer = component2, defaultMaterial = val, ignoreOverlays = customInfos[i].ignoreOverlays, defaultShadowCastingMode = (ShadowCastingMode)1 }); } } characterModel.baseRendererInfos = list.ToArray(); } private static void SetupHurtboxGroup(GameObject bodyPrefab, GameObject model) { SetupMainHurtboxesFromChildLocator(bodyPrefab, model); SetHurtboxesHealthComponents(bodyPrefab); } private static void SetupMainHurtboxesFromChildLocator(GameObject bodyPrefab, GameObject model) { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bodyPrefab.GetComponent() != (Object)null) { Log.Debug("Hitboxgroup already exists on model prefab. aborting code setup"); return; } ChildLocator component = model.GetComponent(); if (string.IsNullOrEmpty(component.FindChildNameInsensitive("MainHurtbox"))) { Log.Error("Could not set up main hurtbox: make sure you have a transform pair in your prefab's ChildLocator called 'MainHurtbox'"); return; } HurtBoxGroup val = model.AddComponent(); HurtBox val2 = null; GameObject val3 = component.FindChildGameObjectInsensitive("HeadHurtbox"); if (Object.op_Implicit((Object)(object)val3)) { Log.Debug("HeadHurtboxFound. Setting up"); val2 = val3.AddComponent(); ((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal; val2.healthComponent = bodyPrefab.GetComponent(); val2.isBullseye = false; val2.isSniperTarget = true; val2.damageModifier = (DamageModifier)0; val2.hurtBoxGroup = val; val2.indexInGroup = 1; } HurtBox val4 = component.FindChildGameObjectInsensitive("MainHurtbox").AddComponent(); ((Component)val4).gameObject.layer = LayerIndex.entityPrecise.intVal; val4.healthComponent = bodyPrefab.GetComponent(); val4.isBullseye = true; val4.isSniperTarget = (Object)(object)val2 == (Object)null; val4.damageModifier = (DamageModifier)0; val4.hurtBoxGroup = val; val4.indexInGroup = 0; if (Object.op_Implicit((Object)(object)val2)) { val.hurtBoxes = (HurtBox[])(object)new HurtBox[2] { val4, val2 }; } else { val.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val4 }; } val.mainHurtBox = val4; val.bullseyeCount = 1; } private static string FindChildNameInsensitive(this ChildLocator childLocator, string child) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) return childLocator.transformPairs.Where((NameTransformPair pair) => pair.name.ToLowerInvariant() == child.ToLowerInvariant()).FirstOrDefault().name; } private static Transform FindChildInsensitive(this ChildLocator childLocator, string child) { return childLocator.FindChild(childLocator.FindChildNameInsensitive(child)); } private static GameObject FindChildGameObjectInsensitive(this ChildLocator childLocator, string child) { return childLocator.FindChildGameObject(childLocator.FindChildNameInsensitive(child)); } public static void SetHurtboxesHealthComponents(GameObject bodyPrefab) { HealthComponent component = bodyPrefab.GetComponent(); HurtBoxGroup[] componentsInChildren = bodyPrefab.GetComponentsInChildren(); foreach (HurtBoxGroup val in componentsInChildren) { val.mainHurtBox.healthComponent = component; for (int j = 0; j < val.hurtBoxes.Length; j++) { val.hurtBoxes[j].healthComponent = component; } } } private static void SetupFootstepController(GameObject model) { FootstepHandler obj = model.AddComponent(); obj.baseFootstepString = "Play_player_footstep"; obj.sprintFootstepOverrideString = ""; obj.enableFootstepDust = true; obj.footstepDustPrefab = LegacyResourcesAPI.Load("Prefabs/GenericFootstepDust"); } private static void SetupRagdoll(GameObject model) { RagdollController component = model.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } if ((Object)(object)ragdollMaterial == (Object)null) { ragdollMaterial = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren().bones[1]).GetComponent().material; } Transform[] bones = component.bones; foreach (Transform val in bones) { if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.layer = LayerIndex.ragdoll.intVal; Collider component2 = ((Component)val).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.sharedMaterial = ragdollMaterial; } else { Log.Error($"Ragdoll bone {((Component)val).gameObject} doesn't have a collider. Ragdoll will break."); } } } } private static void SetupAimAnimator(GameObject prefab, GameObject model) { AimAnimator obj = model.AddComponent(); obj.directionComponent = prefab.GetComponent(); obj.pitchRangeMax = 60f; obj.pitchRangeMin = -60f; obj.yawRangeMin = -80f; obj.yawRangeMax = 80f; obj.pitchGiveupRange = 30f; obj.yawGiveupRange = 10f; obj.giveupDuration = 3f; obj.inputBank = prefab.GetComponent(); } public static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy) { CloneDopplegangerMaster(bodyPrefab, masterName, masterToCopy); } public static GameObject CloneDopplegangerMaster(GameObject bodyPrefab, string masterName, string masterToCopy) { GameObject obj = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true); obj.GetComponent().bodyPrefab = bodyPrefab; Content.AddMasterPrefab(obj); return obj; } public static GameObject CreateBlankMasterPrefab(GameObject bodyPrefab, string masterName) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/CommandoMonsterMaster"), masterName, true); ContentPacks.masterPrefabs.Add(val); val.GetComponent().bodyPrefab = bodyPrefab; AISkillDriver[] components = val.GetComponents(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } return val; } public static GameObject LoadMaster(this AssetBundle assetBundle, GameObject bodyPrefab, string assetName) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = assetBundle.LoadAsset(assetName); BaseAI val2 = val.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = val.AddComponent(); val2.aimVectorDampTime = 0.1f; val2.aimVectorMaxSpeed = 360f; } val2.scanState = new SerializableEntityStateType(typeof(Wander)); EntityStateMachine component = val.GetComponent(); if ((Object)(object)component == (Object)null) { AddEntityStateMachine(val, "AI", typeof(Wander), typeof(Wander)); } val2.stateMachine = component; CharacterMaster val3 = val.GetComponent(); if ((Object)(object)val3 == (Object)null) { val3 = val.AddComponent(); } val3.bodyPrefab = bodyPrefab; val3.teamIndex = (TeamIndex)2; Content.AddMasterPrefab(val); return val; } public static void ClearEntityStateMachines(GameObject bodyPrefab) { EntityStateMachine[] components = bodyPrefab.GetComponents(); for (int num = components.Length - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)components[num]); } bodyPrefab.GetComponent().stateMachines = Array.Empty(); CharacterDeathBehavior component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.idleStateMachine = Array.Empty(); } SetStateOnHurt component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.idleStateMachine = Array.Empty(); } CharacterBody component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.vehicleIdleStateMachine = Array.Empty(); } } public static EntityStateMachine AddEntityStateMachine(GameObject prefab, string machineName, Type mainStateType = null, Type initalStateType = null, bool addToHurt = true, bool addToDeath = true) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine val = EntityStateMachine.FindByCustomName(prefab, machineName); if ((Object)(object)val == (Object)null) { val = prefab.AddComponent(); } else { Log.Message("An Entity State Machine already exists with the name " + machineName + ". replacing."); } val.customName = machineName; if (mainStateType == null) { mainStateType = typeof(Idle); } val.mainStateType = new SerializableEntityStateType(mainStateType); if (initalStateType == null) { initalStateType = typeof(Idle); } val.initialStateType = new SerializableEntityStateType(initalStateType); NetworkStateMachine component = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && addToDeath) { component2.idleStateMachine = component2.idleStateMachine.Append(val).ToArray(); } SetStateOnHurt component3 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3) && addToHurt) { component3.idleStateMachine = component3.idleStateMachine.Append(val).ToArray(); } CharacterBody component4 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { component4.vehicleIdleStateMachine = component4.vehicleIdleStateMachine.Append(val).ToArray(); } return val; } public static EntityStateMachine AddMainEntityStateMachine(GameObject bodyPrefab, string machineName = "Body", Type mainStateType = null, Type initalStateType = null) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine val = EntityStateMachine.FindByCustomName(bodyPrefab, machineName); if ((Object)(object)val == (Object)null) { val = bodyPrefab.AddComponent(); } else { Log.Message("An Entity State Machine already exists with the name " + machineName + ". replacing."); } val.customName = machineName; if (mainStateType == null) { mainStateType = typeof(GenericCharacterMain); } val.mainStateType = new SerializableEntityStateType(mainStateType); if (initalStateType == null) { initalStateType = typeof(SpawnTeleporterState); } val.initialStateType = new SerializableEntityStateType(initalStateType); NetworkStateMachine component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.deathStateMachine = val; } SetStateOnHurt component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.targetStateMachine = val; } return val; } public static void SetupHitBoxGroup(GameObject modelPrefab, string hitBoxGroupName, params string[] hitboxChildNames) { ChildLocator component = modelPrefab.GetComponent(); Transform[] array = (Transform[])(object)new Transform[hitboxChildNames.Length]; for (int i = 0; i < hitboxChildNames.Length; i++) { array[i] = component.FindChild(hitboxChildNames[i]); if ((Object)(object)array[i] == (Object)null) { Log.Error("missing hitbox for " + hitboxChildNames[i]); } } SetupHitBoxGroup(modelPrefab, hitBoxGroupName, array); } public static void SetupHitBoxGroup(GameObject prefab, string hitBoxGroupName, params Transform[] hitBoxTransforms) { List list = new List(); foreach (Transform val in hitBoxTransforms) { if ((Object)(object)val == (Object)null) { Log.Error("Error setting up hitboxGroup for " + hitBoxGroupName + ": hitbox transform was null"); continue; } HitBox item = ((Component)val).gameObject.AddComponent(); ((Component)val).gameObject.layer = LayerIndex.projectile.intVal; list.Add(item); } if (list.Count == 0) { Log.Error("No hitboxes were set up. aborting setting up hitboxGroup for " + hitBoxGroupName); return; } HitBoxGroup obj = prefab.AddComponent(); obj.hitBoxes = list.ToArray(); obj.groupName = hitBoxGroupName; } } public class CustomRendererInfo { public string childName; public Material material; public bool dontHotpoo; public bool ignoreOverlays; } internal static class Skills { public static void CreateSkillFamilies(GameObject targetPrefab) { SkillSlot[] array = new SkillSlot[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); CreateSkillFamilies(targetPrefab, (SkillSlot[])(object)array); } public static void CreateSkillFamilies(GameObject targetPrefab, params SkillSlot[] slots) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); foreach (SkillSlot val in slots) { switch (val - -1) { case 1: component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary"); break; case 2: component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary"); break; case 3: component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility"); break; case 4: component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special"); break; } } } public static void ClearGenericSkills(GameObject targetPrefab) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, SkillSlot skillSlot, bool hidden = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); switch (skillSlot - -1) { case 1: return component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary", hidden); case 2: return component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary", hidden); case 3: return component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility", hidden); case 4: return component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special", hidden); case 0: Log.Error("Failed to create GenericSkill with skillslot None. If making a GenericSkill outside of the main 4, specify a familyName, and optionally a genericSkillName"); return null; default: return null; } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false) { return CreateGenericSkillWithSkillFamily(targetPrefab, familyName, familyName, hidden); } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string genericSkillName, string familyName, bool hidden = false) { GenericSkill obj = targetPrefab.AddComponent(); obj.skillName = genericSkillName; obj.hideInCharacterSelect = hidden; SkillFamily val = ScriptableObject.CreateInstance(); ((Object)val).name = ((Object)targetPrefab).name + familyName + "Family"; val.variants = (Variant[])(object)new Variant[0]; obj._skillFamily = val; Content.AddSkillFamily(val); return obj; } public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0051: 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) Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef, unlockableDef = unlockableDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static void AddSkillsToFamily(SkillFamily skillFamily, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSkillToFamily(skillFamily, skillDef); } } public static void AddPrimarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().primary.skillFamily, skillDefs); } public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().secondary.skillFamily, skillDefs); } public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().utility.skillFamily, skillDefs); } public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().special.skillFamily, skillDefs); } public static void AddUnlockablesToFamily(SkillFamily skillFamily, params UnlockableDef[] unlockableDefs) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < unlockableDefs.Length; i++) { Variant val = skillFamily.variants[i]; val.unlockableDef = unlockableDefs[i]; skillFamily.variants[i] = val; } } public static SkillDef CreateSkillDef(SkillDefInfo skillDefInfo) { return Skills.CreateSkillDef(skillDefInfo); } public static T CreateSkillDef(SkillDefInfo skillDefInfo) where T : SkillDef { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) T val = ScriptableObject.CreateInstance(); ((SkillDef)val).skillName = skillDefInfo.skillName; ((Object)(object)val).name = skillDefInfo.skillName; ((SkillDef)val).skillNameToken = skillDefInfo.skillNameToken; ((SkillDef)val).skillDescriptionToken = skillDefInfo.skillDescriptionToken; ((SkillDef)val).icon = skillDefInfo.skillIcon; ((SkillDef)val).activationState = skillDefInfo.activationState; ((SkillDef)val).activationStateMachineName = skillDefInfo.activationStateMachineName; ((SkillDef)val).interruptPriority = skillDefInfo.interruptPriority; ((SkillDef)val).baseMaxStock = skillDefInfo.baseMaxStock; ((SkillDef)val).baseRechargeInterval = skillDefInfo.baseRechargeInterval; ((SkillDef)val).rechargeStock = skillDefInfo.rechargeStock; ((SkillDef)val).requiredStock = skillDefInfo.requiredStock; ((SkillDef)val).stockToConsume = skillDefInfo.stockToConsume; ((SkillDef)val).dontAllowPastMaxStocks = skillDefInfo.dontAllowPastMaxStocks; ((SkillDef)val).beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd; ((SkillDef)val).canceledFromSprinting = skillDefInfo.canceledFromSprinting; ((SkillDef)val).forceSprintDuringState = skillDefInfo.forceSprintDuringState; ((SkillDef)val).fullRestockOnAssign = skillDefInfo.fullRestockOnAssign; ((SkillDef)val).resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse; ((SkillDef)val).isCombatSkill = skillDefInfo.isCombatSkill; ((SkillDef)val).mustKeyPress = skillDefInfo.mustKeyPress; ((SkillDef)val).cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation; ((SkillDef)val).keywordTokens = skillDefInfo.keywordTokens; Content.AddSkillDef((SkillDef)(object)val); return val; } } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public string[] keywordTokens = Array.Empty(); public Sprite skillIcon; public SerializableEntityStateType activationState; public string activationStateMachineName; public InterruptPriority interruptPriority; public float baseRechargeInterval; public int baseMaxStock = 1; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public bool resetCooldownTimerOnUse; public bool fullRestockOnAssign = true; public bool dontAllowPastMaxStocks; public bool beginSkillCooldownOnSkillEnd; public bool mustKeyPress; public bool isCombatSkill = true; public bool canceledFromSprinting; public bool cancelSprintingOnActivation = true; public bool forceSprintDuringState; public SkillDefInfo() { } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; cancelSprintingOnActivation = !agile; if (agile) { keywordTokens = new string[1] { "KEYWORD_AGILE" }; } interruptPriority = (InterruptPriority)0; isCombatSkill = true; baseRechargeInterval = 0f; requiredStock = 0; stockToConsume = 0; } } internal static class Skins { internal struct SkinDefInfo { internal SkinDef[] BaseSkins; internal Sprite Icon; internal string NameToken; internal UnlockableDef UnlockableDef; internal GameObject RootObject; internal RendererInfo[] RendererInfos; internal MeshReplacement[] MeshReplacements; internal GameObjectActivation[] GameObjectActivations; internal ProjectileGhostReplacement[] ProjectileGhostReplacements; internal MinionSkinReplacement[] MinionSkinReplacements; internal string Name; } internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] defaultRendererInfos, GameObject root, UnlockableDef unlockableDef = null) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown SkinDefInfo skinDefInfo = new SkinDefInfo { BaseSkins = Array.Empty(), GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0], Icon = skinIcon, MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0], MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0], Name = skinName, NameToken = skinName, ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0], RendererInfos = (RendererInfo[])(object)new RendererInfo[defaultRendererInfos.Length], RootObject = root, UnlockableDef = unlockableDef }; SkinDef.Awake += new hook_Awake(DoNothing); SkinDef obj = ScriptableObject.CreateInstance(); obj.baseSkins = skinDefInfo.BaseSkins; obj.icon = skinDefInfo.Icon; obj.unlockableDef = skinDefInfo.UnlockableDef; obj.rootObject = skinDefInfo.RootObject; defaultRendererInfos.CopyTo(skinDefInfo.RendererInfos, 0); obj.rendererInfos = skinDefInfo.RendererInfos; obj.gameObjectActivations = skinDefInfo.GameObjectActivations; obj.meshReplacements = skinDefInfo.MeshReplacements; obj.projectileGhostReplacements = skinDefInfo.ProjectileGhostReplacements; obj.minionSkinReplacements = skinDefInfo.MinionSkinReplacements; obj.nameToken = skinDefInfo.NameToken; ((Object)obj).name = skinDefInfo.Name; SkinDef.Awake -= new hook_Awake(DoNothing); return obj; } private static void DoNothing(orig_Awake orig, SkinDef self) { } private static RendererInfo[] getRendererMaterials(RendererInfo[] defaultRenderers, params Material[] materials) { RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length]; defaultRenderers.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { try { array[i].defaultMaterial = materials[i]; } catch { Log.Error("error adding skin rendererinfo material. make sure you're not passing in too many"); } } return array; } internal static MeshReplacement[] getMeshReplacements(AssetBundle assetBundle, RendererInfo[] defaultRendererInfos, params string[] meshes) { //IL_0017: 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) List list = new List(); for (int i = 0; i < defaultRendererInfos.Length; i++) { if (!string.IsNullOrEmpty(meshes[i])) { list.Add(new MeshReplacement { renderer = defaultRendererInfos[i].renderer, mesh = assetBundle.LoadAsset(meshes[i]) }); } } return list.ToArray(); } } internal static class Tokens { public const string agilePrefix = "Agile."; public static string DamageText(string text) { return "" + text + ""; } public static string DamageValueText(float value) { return $"{value * 100f}% damage"; } public static string UtilityText(string text) { return "" + text + ""; } public static string RedText(string text) { return HealthText(text); } public static string HealthText(string text) { return "" + text + ""; } public static string KeywordText(string keyword, string sub) { return "" + keyword + "" + sub + ""; } public static string ScepterDescription(string desc) { return "\nSCEPTER: " + desc + ""; } public static string GetAchievementNameToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME"; } public static string GetAchievementDescriptionToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_DESCRIPTION"; } } } namespace DIOOH.Modules.Characters { public abstract class CharacterBase where T : CharacterBase, new() { public abstract string assetBundleName { get; } public abstract string bodyName { get; } public abstract string modelPrefabName { get; } public abstract BodyInfo bodyInfo { get; } public virtual CustomRendererInfo[] customRendererInfos { get; } public virtual ItemDisplaysBase itemDisplays { get; } public static T instance { get; private set; } public abstract AssetBundle assetBundle { get; protected set; } public abstract GameObject bodyPrefab { get; protected set; } public abstract CharacterBody prefabCharacterBody { get; protected set; } public abstract GameObject characterModelObject { get; protected set; } public abstract CharacterModel prefabCharacterModel { get; protected set; } public virtual void Initialize() { instance = this as T; assetBundle = Asset.LoadAssetBundle(assetBundleName); InitializeCharacter(); } public virtual void InitializeCharacter() { InitializeCharacterBodyPrefab(); InitializeItemDisplays(); } protected virtual void InitializeCharacterBodyPrefab() { characterModelObject = Prefabs.LoadCharacterModel(assetBundle, modelPrefabName); bodyPrefab = Prefabs.CreateBodyPrefab(characterModelObject, bodyInfo); prefabCharacterBody = bodyPrefab.GetComponent(); prefabCharacterModel = Prefabs.SetupCharacterModel(bodyPrefab, customRendererInfos); } public virtual void InitializeItemDisplays() { ItemDisplayRuleSet val = ScriptableObject.CreateInstance(); ((Object)val).name = "idrs" + bodyName; prefabCharacterModel.itemDisplayRuleSet = val; if (itemDisplays != null) { ItemDisplays.queuedDisplays++; ContentManager.onContentPacksAssigned += SetItemDisplays; } } public void SetItemDisplays(ReadOnlyArray obj) { itemDisplays.SetItemDisplays(prefabCharacterModel.itemDisplayRuleSet); } public abstract void InitializeEntityStateMachines(); public abstract void InitializeSkills(); public abstract void InitializeSkins(); public abstract void InitializeCharacterMaster(); } public class BodyInfo { public string bodyName = ""; public string bodyNameToken = ""; public string subtitleNameToken = ""; public string bodyNameToClone = "Commando"; public Color bodyColor = Color.white; public Texture characterPortrait; public float sortPosition = 100f; public GameObject crosshair; public GameObject podPrefab; public float maxHealth = 100f; public float healthRegen = 1f; public float armor; public float shield; public int jumpCount = 1; public float damage = 12f; public float attackSpeed = 1f; public float crit = 1f; public float moveSpeed = 7f; public float acceleration = 80f; public float jumpPower = 15f; public bool autoCalculateLevelStats = true; public float healthGrowth = 30.000002f; public float regenGrowth = 0.2f; public float armorGrowth; public float shieldGrowth; public float damageGrowth = 2.4f; public float attackSpeedGrowth; public float critGrowth; public float moveSpeedGrowth; public float jumpPowerGrowth; public Vector3 aimOriginPosition = new Vector3(0f, 1.6f, 0f); public Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f); public Vector3 cameraPivotPosition = new Vector3(0f, 0.8f, 0f); public float cameraParamsVerticalOffset = 1.37f; public float cameraParamsDepth = -10f; private CharacterCameraParams _cameraParams; public CharacterCameraParams cameraParams { get { //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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_cameraParams == (Object)null) { _cameraParams = ScriptableObject.CreateInstance(); _cameraParams.data.minPitch = BlendableFloat.op_Implicit(-70f); _cameraParams.data.maxPitch = BlendableFloat.op_Implicit(70f); _cameraParams.data.wallCushion = BlendableFloat.op_Implicit(0.1f); _cameraParams.data.pivotVerticalOffset = BlendableFloat.op_Implicit(cameraParamsVerticalOffset); _cameraParams.data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, cameraParamsDepth)); } return _cameraParams; } set { _cameraParams = value; } } } public abstract class ItemDisplaysBase { public void SetItemDisplays(ItemDisplayRuleSet itemDisplayRuleSet) { List list = new List(); ItemDisplays.LazyInit(); SetItemDisplayRules(list); itemDisplayRuleSet.keyAssetRuleGroups = list.ToArray(); ItemDisplays.DisposeWhenDone(); } protected abstract void SetItemDisplayRules(List itemDisplayRules); } public abstract class SurvivorBase : CharacterBase where T : SurvivorBase, new() { public abstract string masterName { get; } public abstract string displayPrefabName { get; } public abstract string survivorTokenPrefix { get; } public abstract UnlockableDef characterUnlockableDef { get; } public abstract GameObject displayPrefab { get; protected set; } public override void InitializeCharacter() { base.InitializeCharacter(); InitializeDisplayPrefab(); InitializeSurvivor(); } protected virtual void InitializeDisplayPrefab() { displayPrefab = Prefabs.CreateDisplayPrefab(assetBundle, displayPrefabName, bodyPrefab); } protected virtual void InitializeSurvivor() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) Content.CreateSurvivor(bodyPrefab, displayPrefab, bodyInfo.bodyColor, survivorTokenPrefix, characterUnlockableDef, bodyInfo.sortPosition); } protected virtual void AddCssPreviewSkill(int indexFromEditor, SkillFamily skillFamily, SkillDef skillDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("trying to add skillChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor"); return; } component.skillChangeResponses[indexFromEditor].triggerSkillFamily = skillFamily; component.skillChangeResponses[indexFromEditor].triggerSkill = skillDef; } protected virtual void AddCssPreviewSkin(int indexFromEditor, SkinDef skinDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("trying to add skinChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor"); } else { component.skinChangeResponses[indexFromEditor].triggerSkin = skinDef; } } protected virtual void FinalizeCSSPreviewDisplayController() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)displayPrefab)) { return; } CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } component.bodyPrefab = bodyPrefab; List list = new List(); for (int i = 0; i < component.skillChangeResponses.Length; i++) { if ((Object)(object)component.skillChangeResponses[i].triggerSkillFamily != (Object)null) { list.Add(component.skillChangeResponses[i]); } } component.skillChangeResponses = list.ToArray(); } } } namespace DIOOH.Modules.BaseStates { public abstract class BaseMeleeAttack : BaseSkillState, IStepSetter { public int swingIndex; protected string hitboxGroupName = "SwordGroup"; protected DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0); protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartPercentTime = 0.2f; protected float attackEndPercentTime = 0.4f; protected float earlyExitPercentTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected string playbackRateParam = "Slash.playbackRate"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound = (NetworkSoundEventIndex)(-1); protected OverlapAttack attack; public float duration; private bool hasFired; private float hitPauseTimer; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; public override void OnEnter() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = damageType; attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup(hitboxGroupName); attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = impactSound; ModifyOverlapAttack(attack); } protected virtual void ModifyOverlapAttack(OverlapAttack attack) { } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), playbackRateParam, duration, 0.05f); } public override void OnExit() { if (inHitPause) { RemoveHitstop(); } ((EntityState)this).OnExit(); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } protected virtual void OnHitEnemyAuthority() { Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } ApplyHitstop(); } protected void ApplyHitstop() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, playbackRateParam); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (((EntityState)this).isAuthority && attack.Fire((List)null)) { OnHitEnemyAuthority(); } } private void EnterAttack() { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); PlaySwingEffect(); if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } public override void FixedUpdate() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.deltaTime; if (hitPauseTimer <= 0f && inHitPause) { RemoveHitstop(); } if (!inHitPause) { stopwatch += Time.deltaTime; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat(playbackRateParam, 0f); } } bool flag = stopwatch >= duration * attackStartPercentTime; bool flag2 = stopwatch >= duration * attackEndPercentTime; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { if (!hasFired) { EnterAttack(); } FireAttack(); } if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void RemoveHitstop() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } public override InterruptPriority GetMinimumInterruptPriority() { if (!(stopwatch >= duration * earlyExitPercentTime)) { return (InterruptPriority)1; } return (InterruptPriority)0; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } public void SetStep(int i) { swingIndex = i; } } public abstract class BaseTimedSkillState : BaseSkillState { protected float duration; protected float castStartTime; protected float castEndTime; protected bool hasFired; protected bool isFiring; protected bool hasExited; public abstract float TimedBaseDuration { get; } public abstract float TimedBaseCastStartPercentTime { get; } public virtual float TimedBaseCastEndPercentTime => 1f; public override void OnEnter() { InitDurationValues(); ((BaseState)this).OnEnter(); } protected virtual void InitDurationValues() { duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat; castStartTime = TimedBaseCastStartPercentTime * duration; castEndTime = TimedBaseCastEndPercentTime * duration; } protected virtual void OnCastEnter() { } protected virtual void OnCastFixedUpdate() { } protected virtual void OnCastUpdate() { } protected virtual void OnCastExit() { } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); bool flag = ((EntityState)this).fixedAge >= castStartTime; bool flag2 = ((EntityState)this).fixedAge >= castEndTime; isFiring = false; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { isFiring = true; OnCastFixedUpdate(); if (!hasFired) { OnCastEnter(); hasFired = true; } } if (flag2 && !hasExited) { hasExited = true; OnCastExit(); } if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { ((EntityState)this).Update(); if (isFiring) { OnCastUpdate(); } } } public class ExampleTimedSkillState : BaseTimedSkillState { public override float TimedBaseDuration => 1.5f; public override float TimedBaseCastStartPercentTime => 0.2f; public override float TimedBaseCastEndPercentTime => 0.9f; protected override void OnCastEnter() { } protected override void OnCastFixedUpdate() { } protected override void OnCastExit() { } } public class ExampleDelayedSkillState : BaseTimedSkillState { public override float TimedBaseDuration => 1.5f; public override float TimedBaseCastStartPercentTime => 0.2f; protected override void OnCastEnter() { } } } namespace DIOOH.Modules.Achievements { public abstract class BaseMasteryAchievement : BaseAchievement { public abstract string RequiredCharacterBody { get; } public abstract float RequiredDifficultyCoefficient { get; } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex(RequiredCharacterBody); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)runReport.gameEnding) || !runReport.gameEnding.isWin) { return; } DifficultyIndex val = runReport.ruleBook.FindDifficulty(); DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val); if (difficultyDef != null) { bool num = difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient; bool flag = difficultyDef.nameToken == "INFERNO_NAME"; bool flag2 = (int)val >= 3 && (int)val <= 10; if (num || flag || flag2) { ((BaseAchievement)this).Grant(); } } } } } namespace DIOOH.Survivors.DIO { public static class DIOBuffs { public static BuffDef timeStopDebuff; public static void Init(AssetBundle assetBundle) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) timeStopDebuff = Content.CreateAndAddBuff("DIOTimeStop", assetBundle.LoadAsset("texTimeStopIcon"), Color.white, canStack: false, isDebuff: true); } } public static class DIOConfig { public static ConfigEntry timeStopDuration; public static ConfigEntry timeStopCooldown; public static ConfigEntry secondaryCooldown; public static ConfigEntry flurryDuration; public static ConfigEntry blockCooldown; public static ConfigEntry voiceVolume; public static void Init() { timeStopDuration = Config.BindAndOptions("DIO", "Time Stop Duration", 4f, 0f, 10f, "How long ZA WARUDO freezes the world, in seconds"); timeStopCooldown = Config.BindAndOptions("DIO", "Time Stop Cooldown", 30f, 0f, 120f, "Cooldown of ZA WARUDO, starts when the stop ends"); secondaryCooldown = Config.BindAndOptions("DIO", "Muda Dash Cooldown", 5f, 0f, 30f, "Cooldown of the MUDA dash"); flurryDuration = Config.BindAndOptions("DIO", "Muda Flurry Base Duration", 2f, 0.5f, 10f, "Base duration of the MUDA flurry beatdown; +0.1s per 1% bonus attack speed"); voiceVolume = Config.BindAndOptions("DIO", "Voice Volume", 0.35f, 0f, 2f, "Volume of DIO's voice lines"); blockCooldown = Config.BindAndOptions("DIO", "Stand Guard Cooldown", 15f, 0f, 60f, "Cooldown of Stand Guard, starts when the block ends"); } } public class RealityRewriteMarker : MonoBehaviour { } public static class DIOHooks { private static BodyIndex dioBodyIndex = (BodyIndex)(-1); private static bool freeChestUsedThisStage; private static bool IsDIO(CharacterBody body) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return false; } if ((int)dioBodyIndex == -1) { dioBodyIndex = BodyCatalog.FindBodyIndex("DIOBody"); } return body.bodyIndex == dioBodyIndex; } public static void RegisterHooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); CharacterBody.onBodyStartGlobal += ApplyLuckBonus; Inventory.CalculateEquipmentCooldownScale += new hook_CalculateEquipmentCooldownScale(Inventory_CalculateEquipmentCooldownScale); PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin); Stage.onServerStageBegin += delegate { freeChestUsedThisStage = false; }; GlobalEventManager.onCharacterDeathGlobal += delegate(DamageReport report) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (report != null && IsDIO(report.victimBody)) { DIOSounds.Play("Deadsfx", report.victimBody.corePosition); } }; } private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)self.body) && damageInfo != null && !damageInfo.rejected) { TheWorldComponent component = ((Component)self.body).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.blockActive) { Vector3 val = Vector3.zero; bool flag = false; if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { val = damageInfo.attacker.transform.position; flag = true; } else if (Object.op_Implicit((Object)(object)damageInfo.inflictor)) { val = damageInfo.inflictor.transform.position; flag = true; } else if (damageInfo.position != Vector3.zero) { val = damageInfo.position; flag = true; } if (flag) { Vector3 val2 = (Object.op_Implicit((Object)(object)self.body.inputBank) ? self.body.inputBank.aimDirection : self.body.transform.forward); Vector3 val3 = val - self.body.corePosition; if (((Vector3)(ref val3)).sqrMagnitude > 0.01f && Vector3.Angle(val2, val3) <= 60f) { damageInfo.rejected = true; EffectManager.SpawnEffect(AssetReferences.damageRejectedPrefab, new EffectData { origin = ((damageInfo.position != Vector3.zero) ? damageInfo.position : self.body.corePosition) }, true); if (Util.CheckRoll(self.body.crit, self.body.master)) { self.Heal(damageInfo.damage, default(ProcChainMask), true); } } } } } orig.Invoke(self, damageInfo); } private static void ApplyLuckBonus(CharacterBody body) { if (NetworkServer.active && IsDIO(body) && Object.op_Implicit((Object)(object)body.master) && !Object.op_Implicit((Object)(object)((Component)body.master).gameObject.GetComponent())) { ((Component)body.master).gameObject.AddComponent(); CharacterMaster master = body.master; master.luck += 1f; } } private static float Inventory_CalculateEquipmentCooldownScale(orig_CalculateEquipmentCooldownScale orig, Inventory self) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) float num = orig.Invoke(self); CharacterMaster component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.GetBody()) && IsDIO(component.GetBody()) && self.currentEquipmentIndex == Equipment.Lightning.equipmentIndex) { num *= 0.5f; } return num; } private static void PurchaseInteraction_OnInteractionBegin(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 bool flag = false; int num = 0; if (NetworkServer.active && !freeChestUsedThisStage && Object.op_Implicit((Object)(object)activator) && (int)self.costType == 1 && self.cost > 0 && ((Object)self).name.Contains("Chest")) { CharacterBody component = ((Component)activator).GetComponent(); if (IsDIO(component) && Object.op_Implicit((Object)(object)component.master)) { flag = true; num = self.cost; } } orig.Invoke(self, activator); if (flag) { ((Component)activator).GetComponent().master.GiveMoney((uint)num); freeChestUsedThisStage = true; } } } public static class DIOSounds { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__4_1; public static Func>, string> <>9__4_0; public static Func <>9__5_0; public static FrameDecompressorBuilder <>9__8_0; internal bool b__4_1(string f) { if (!f.EndsWith(".mp3", StringComparison.OrdinalIgnoreCase)) { return f.EndsWith(".wav", StringComparison.OrdinalIgnoreCase); } return true; } internal string b__4_0(KeyValuePair> g) { return $"{g.Key}({g.Value.Count})"; } internal float b__5_0(string _) { return Random.value; } internal IMp3FrameDecompressor b__8_0(WaveFormat wf) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown return (IMp3FrameDecompressor)new AcmMp3FrameDecompressor(wf); } } private static readonly Dictionary> groups = new Dictionary>(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary> bags = new Dictionary>(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary lastPlayed = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary attached = new Dictionary(); private static float Volume => Mathf.Clamp((DIOConfig.voiceVolume != null) ? DIOConfig.voiceVolume.Value : 1f, 0f, 2f); public static void Init() { string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)DIOOHPlugin.instance).Info.Location), "Sounds"); if (!Directory.Exists(text)) { Log.Warning("[DIOSounds] Sounds folder not found: " + text); return; } foreach (string item in from f in Directory.GetFiles(text) where f.EndsWith(".mp3", StringComparison.OrdinalIgnoreCase) || f.EndsWith(".wav", StringComparison.OrdinalIgnoreCase) select f) { string key = Path.GetFileNameWithoutExtension(item).TrimEnd("0123456789".ToCharArray()); if (!groups.TryGetValue(key, out var value)) { value = new List(); groups[key] = value; } value.Add(item); } Log.Info("[DIOSounds] groups loaded from disk: " + string.Join(", ", groups.Select((KeyValuePair> g) => $"{g.Key}({g.Value.Count})"))); } private static string Next(string group) { if (!groups.TryGetValue(group, out var value) || value.Count == 0) { return null; } if (value.Count == 1) { return value[0]; } if (!bags.TryGetValue(group, out var value2) || value2.Count == 0) { List list = value.OrderBy((string _) => Random.value).ToList(); lastPlayed.TryGetValue(group, out var value3); if (value3 != null && list[0] == value3) { int num = Random.Range(1, list.Count); List list2 = list; int index = num; string value4 = list[num]; string value5 = list[0]; list[0] = value4; list2[index] = value5; } value2 = new Queue(list); bags[group] = value2; } string text = value2.Dequeue(); lastPlayed[group] = text; return text; } private static WaveOutEvent StartPlayback(string file) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0047: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown try { ? val; if (!file.EndsWith(".mp3", StringComparison.OrdinalIgnoreCase)) { val = new WaveFileReader(file); } else { object obj = <>c.<>9__8_0; if (obj == null) { FrameDecompressorBuilder val2 = (WaveFormat wf) => (IMp3FrameDecompressor)new AcmMp3FrameDecompressor(wf); <>c.<>9__8_0 = val2; obj = (object)val2; } val = new Mp3FileReaderBase(file, (FrameDecompressorBuilder)obj); } WaveStream reader = (WaveStream)val; WaveChannel32 volumeStream = new WaveChannel32(reader) { Volume = Volume }; WaveOutEvent output = new WaveOutEvent(); output.Init((IWaveProvider)(object)volumeStream); output.PlaybackStopped += delegate { try { output.Dispose(); ((Stream)(object)volumeStream).Dispose(); ((Stream)(object)reader).Dispose(); } catch { } }; output.Play(); return output; } catch (Exception ex) { Log.Error("[DIOSounds] playback failed for " + file + ": " + ex.Message); return null; } } public static void Play(string group, Vector3 position) { string text = Next(group); if (text != null) { StartPlayback(text); } } public static void Play2D(string group) { string text = Next(group); if (text != null) { StartPlayback(text); } } public static void PlayAttached(string group, GameObject owner) { string text = Next(group); if (text != null && Object.op_Implicit((Object)(object)owner)) { StopAttached(owner); WaveOutEvent val = StartPlayback(text); if (val != null) { attached[owner] = val; } } } public static void StopAttached(GameObject owner) { if (Object.op_Implicit((Object)(object)owner) && attached.TryGetValue(owner, out var value)) { try { value.Stop(); } catch { } attached.Remove(owner); } } } public static class DIOStates { public static void Init() { Content.AddEntityState(typeof(ThrowKnife)); Content.AddEntityState(typeof(MudaDash)); Content.AddEntityState(typeof(MudaFlurry)); Content.AddEntityState(typeof(StandBlock)); Content.AddEntityState(typeof(ZaWarudo)); Content.AddEntityState(typeof(TimeFrozenState)); } } public static class DIOStaticValues { public const float knifeDamageCoefficient = 1.5f; public const float flurryDamageCoefficient = 1f; public const float blockArcHalfAngle = 60f; } public static class DIOTokens { public static void Init() { string text = "ES15_DIO_"; string text2 = "DIO fights alongside his Stand, The World, draining the life of all who oppose him." + Environment.NewLine + Environment.NewLine + "< ! > Knives are your reliable poke - throw them while repositioning." + Environment.NewLine + Environment.NewLine + "< ! > MUDA Dash into an enemy to unleash The World's flurry." + Environment.NewLine + Environment.NewLine + "< ! > ZA WARUDO stops time itself - you can still act while the world is frozen." + Environment.NewLine + Environment.NewLine; Language.Add(text + "NAME", "DIO"); Language.Add(text + "DESCRIPTION", text2); Language.Add(text + "SUBTITLE", "The World Over Heaven"); Language.Add(text + "LORE", "You thought your first survivor would be someone else, but it was me, DIO!"); Language.Add(text + "OUTRO_FLAVOR", "..and so he left, wondering if this, too, was part of his plan."); Language.Add(text + "OUTRO_FAILURE", "..and so he was erased, his ambitions turning to dust."); Language.Add(text + "PASSIVE_NAME", "Reality Rewrite"); Language.Add(text + "PASSIVE_DESCRIPTION", "Rare things happen twice as often. The Royal Capacitor recharges twice as fast. The first chest DIO opens each stage is free."); Language.Add(text + "PRIMARY_KNIFE_NAME", "Knife Throw"); Language.Add(text + "PRIMARY_KNIFE_DESCRIPTION", "Throw a fan of knives for 3x150% damage."); Language.Add(text + "SECONDARY_MUDADASH_NAME", "MUDA MUDA MUDA"); Language.Add(text + "SECONDARY_MUDADASH_DESCRIPTION", "Dash forward. Colliding with an enemy, The World unleashes a flurry of punches for 100% damage per hit, scaling with attack speed."); Language.Add(text + "UTILITY_BLOCK_NAME", "Stand Guard"); Language.Add(text + "UTILITY_BLOCK_DESCRIPTION", "Hold to have The World nullify all damage from the direction you face. Max 5 seconds."); Language.Add(text + "SPECIAL_ZAWARUDO_NAME", "ZA WARUDO"); Language.Add(text + "SPECIAL_ZAWARUDO_DESCRIPTION", "Stop time for 4 seconds. Enemies and projectiles freeze - DIO does not."); } } public class DIOSurvivor : SurvivorBase { public const string DIO_PREFIX = "ES15_DIO_"; private static readonly string[] rendererChildNames = new string[11] { "DIO_body_001", "DIO_gold", "DIO_hair_001", "DIO_eye_r", "DIO_eye_l", "DIO_eyelashes_001", "TWOH_Body_001", "TWOH_Gold_001", "TWOH_White_001", "TWOH_Eyes_001", "TWOH_Hands_001" }; public override string assetBundleName => "diobundle"; public override string bodyName => "DIOBody"; public override string masterName => "DIOMonsterMaster"; public override string modelPrefabName => "mdlDIO"; public override string displayPrefabName => "DIODisplay"; public override string survivorTokenPrefix => "ES15_DIO_"; public override BodyInfo bodyInfo => new BodyInfo { bodyName = bodyName, bodyNameToken = "ES15_DIO_NAME", subtitleNameToken = "ES15_DIO_SUBTITLE", characterPortrait = assetBundle.LoadAsset("texDIOIcon"), bodyColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)200, (byte)40, byte.MaxValue)), sortPosition = 100f, crosshair = Asset.LoadCrosshair("Standard"), podPrefab = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/SurvivorPod"), maxHealth = 120f, healthRegen = 1.5f, armor = 10f, jumpCount = 1 }; public override CustomRendererInfo[] customRendererInfos => Array.ConvertAll(rendererChildNames, (string name) => new CustomRendererInfo { childName = name, dontHotpoo = true }); public override UnlockableDef characterUnlockableDef => null; public override ItemDisplaysBase itemDisplays => null; public override AssetBundle assetBundle { get; protected set; } public override GameObject bodyPrefab { get; protected set; } public override CharacterBody prefabCharacterBody { get; protected set; } public override GameObject characterModelObject { get; protected set; } public override CharacterModel prefabCharacterModel { get; protected set; } public override GameObject displayPrefab { get; protected set; } public override void InitializeCharacter() { base.InitializeCharacter(); DIOConfig.Init(); DIOStates.Init(); DIOTokens.Init(); DIOSounds.Init(); DIOBuffs.Init(assetBundle); if (Object.op_Implicit((Object)(object)displayPrefab)) { displayPrefab.AddComponent(); } InitializeEntityStateMachines(); InitializeSkills(); InitializeSkins(); InitializeCharacterMaster(); AdditionalBodySetup(); AddHooks(); } private void AdditionalBodySetup() { AddHitboxes(); bodyPrefab.AddComponent(); } public void AddHitboxes() { Prefabs.SetupHitBoxGroup(characterModelObject, "PunchGroup", "PunchHitbox"); } public override void InitializeEntityStateMachines() { Prefabs.ClearEntityStateMachines(bodyPrefab); Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(GenericCharacterMain), typeof(SpawnTeleporterState)); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon"); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon2"); } public override void InitializeSkills() { Skills.ClearGenericSkills(bodyPrefab); AddPassiveSkill(); AddPrimarySkills(); AddSecondarySkills(); AddUtilitySkills(); AddSpecialSkills(); } private void AddPassiveSkill() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) bodyPrefab.GetComponent().passiveSkill = new PassiveSkill { enabled = true, skillNameToken = "ES15_DIO_PASSIVE_NAME", skillDescriptionToken = "ES15_DIO_PASSIVE_DESCRIPTION", icon = assetBundle.LoadAsset("texPassiveIcon") }; } private void AddPrimarySkills() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)0); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo("DIOKnife", "ES15_DIO_PRIMARY_KNIFE_NAME", "ES15_DIO_PRIMARY_KNIFE_DESCRIPTION", assetBundle.LoadAsset("texPrimaryIcon"), new SerializableEntityStateType(typeof(ThrowKnife)), "Weapon", agile: true)); Skills.AddPrimarySkills(bodyPrefab, val); } private void AddSecondarySkills() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)1); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "DIOMudaDash", skillNameToken = "ES15_DIO_SECONDARY_MUDADASH_NAME", skillDescriptionToken = "ES15_DIO_SECONDARY_MUDADASH_DESCRIPTION", skillIcon = assetBundle.LoadAsset("texSecondaryIcon"), activationState = new SerializableEntityStateType(typeof(MudaDash)), activationStateMachineName = "Weapon", interruptPriority = (InterruptPriority)2, baseRechargeInterval = DIOConfig.secondaryCooldown.Value, baseMaxStock = 1, rechargeStock = 1, requiredStock = 1, stockToConsume = 1, mustKeyPress = true, isCombatSkill = true, cancelSprintingOnActivation = false }); Skills.AddSecondarySkills(bodyPrefab, val); } private void AddUtilitySkills() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)2); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "DIOStandBlock", skillNameToken = "ES15_DIO_UTILITY_BLOCK_NAME", skillDescriptionToken = "ES15_DIO_UTILITY_BLOCK_DESCRIPTION", skillIcon = assetBundle.LoadAsset("texUtilityIcon"), activationState = new SerializableEntityStateType(typeof(StandBlock)), activationStateMachineName = "Weapon", interruptPriority = (InterruptPriority)2, baseRechargeInterval = DIOConfig.blockCooldown.Value, baseMaxStock = 1, rechargeStock = 1, requiredStock = 1, stockToConsume = 1, beginSkillCooldownOnSkillEnd = true, mustKeyPress = false, isCombatSkill = false }); Skills.AddUtilitySkills(bodyPrefab, val); } private void AddSpecialSkills() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)3); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "DIOZaWarudo", skillNameToken = "ES15_DIO_SPECIAL_ZAWARUDO_NAME", skillDescriptionToken = "ES15_DIO_SPECIAL_ZAWARUDO_DESCRIPTION", skillIcon = assetBundle.LoadAsset("texSpecialIcon"), activationState = new SerializableEntityStateType(typeof(ZaWarudo)), activationStateMachineName = "Weapon2", interruptPriority = (InterruptPriority)1, baseRechargeInterval = DIOConfig.timeStopCooldown.Value, baseMaxStock = 1, beginSkillCooldownOnSkillEnd = true, mustKeyPress = true, isCombatSkill = false }); Skills.AddSpecialSkills(bodyPrefab, val); } public override void InitializeSkins() { ModelSkinController obj = ((Component)prefabCharacterModel).gameObject.AddComponent(); RendererInfo[] baseRendererInfos = prefabCharacterModel.baseRendererInfos; List list = new List(); SkinDef item = Skins.CreateSkinDef("DEFAULT_SKIN", assetBundle.LoadAsset("texMainSkin"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject); list.Add(item); obj.skins = list.ToArray(); } public override void InitializeCharacterMaster() { Prefabs.CloneDopplegangerMaster(bodyPrefab, masterName, "Merc"); } private void AddHooks() { ZaWarudo.RegisterHooks(); DIOHooks.RegisterHooks(); } } } namespace DIOOH.Survivors.DIO.SkillStates { public class MudaDash : BaseSkillState { public static float baseDuration = 0.8f; public static float speedCoefficient = 4f; public static float minSpeed = 15f; public static float hitRadius = 2.5f; public static float windupStartTime = 0.45f; private Vector3 dashVector; private bool startedFlurry; private bool startedWindup; private TheWorldComponent theWorld; public override void OnEnter() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); dashVector = ((EntityState)this).inputBank.aimDirection; ((Vector3)(ref dashVector)).Normalize(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = dashVector; } ((EntityState)this).characterBody.isSprinting = false; theWorld = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)theWorld)) { theWorld.Summon(baseDuration + 0.5f); } ((EntityState)this).PlayCrossfade("FullBody, Override", "Roll", "Roll.playbackRate", baseDuration, 0.05f); CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); } public override void FixedUpdate() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = Mathf.Max(((BaseState)this).moveSpeedStat * speedCoefficient, minSpeed); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += dashVector * num * ((EntityState)this).GetDeltaTime(); } if (!startedWindup && ((EntityState)this).fixedAge >= windupStartTime && Object.op_Implicit((Object)(object)theWorld)) { startedWindup = true; theWorld.StartHeldWindup(baseDuration + 0.5f, ((BaseState)this).attackSpeedStat); } if (((EntityState)this).isAuthority && !startedFlurry && CheckForTarget()) { startedFlurry = true; Log.Info($"[MudaDash] contact at {((EntityState)this).fixedAge:F2}s, starting flurry (windup started: {startedWindup})"); ((EntityState)this).outer.SetNextState((EntityState)(object)new MudaFlurry()); } else if (((EntityState)this).fixedAge >= baseDuration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private bool CheckForTarget() { //IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((EntityState)this).characterBody.corePosition + dashVector * hitRadius, hitRadius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)); for (int i = 0; i < array.Length; i++) { HurtBox component = ((Component)array[i]).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && (Object)(object)component.healthComponent != (Object)(object)((EntityState)this).healthComponent && component.teamIndex != ((EntityState)this).teamComponent.teamIndex) { return true; } } return false; } public override void OnExit() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class MudaFlurry : BaseState { public static float damageCoefficient = 1f; public static float procCoefficient = 0.6f; public static float damageFrequency = 10f; public static float minDuration = 0.25f; public static float durationPerAttackSpeedPercent = 0.1f; private float stopwatch; private float attackStopwatch; private float maxDuration; private float windupDelay; private OverlapAttack overlapAttack; private TheWorldComponent theWorld; private Vector3 lockedForward; public override void OnEnter() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown ((BaseState)this).OnEnter(); float num = Mathf.Max(0f, (base.attackSpeedStat - 1f) * 100f); maxDuration = DIOConfig.flurryDuration.Value + num * durationPerAttackSpeedPercent; windupDelay = 0.8f / base.attackSpeedStat; lockedForward = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).transform.forward); overlapAttack = new OverlapAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), damage = damageCoefficient * base.damageStat, hitEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/ImpactEffects/HitsparkCommando"), hitBoxGroup = ((BaseState)this).FindHitBoxGroup("PunchGroup"), isCrit = ((BaseState)this).RollCrit(), procCoefficient = procCoefficient, forceVector = Vector3.zero }; theWorld = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)theWorld)) { theWorld.AddTime(windupDelay + maxDuration + 0.5f); theWorld.ResumeWindup(base.attackSpeedStat); } DIOSounds.PlayAttached("MudaMuda", ((EntityState)this).gameObject); ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash2", "Slash.playbackRate", maxDuration, 0.1f); } public override void FixedUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = new Vector3(0f, 0.5f, 0f); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = lockedForward; } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && !((EntityState)this).inputBank.skill2.down) { ((EntityState)this).outer.SetNextStateToMain(); return; } float deltaTime = ((EntityState)this).GetDeltaTime(); stopwatch += deltaTime; attackStopwatch += deltaTime; float num = 1f / damageFrequency / base.attackSpeedStat; if (attackStopwatch >= num) { attackStopwatch -= num; if (Object.op_Implicit((Object)(object)theWorld)) { theWorld.AddTime(num * 4f); theWorld.SetFlurryRate(base.attackSpeedStat); } if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f, -2f, -0.5f, 0.5f); } overlapAttack.ResetIgnoredHealthComponents(); List list = new List(); bool flag = overlapAttack.Fire(list); for (int i = 0; i < list.Count; i++) { HealthComponent healthComponent = list[i].healthComponent; if (Object.op_Implicit((Object)(object)healthComponent) && Object.op_Implicit((Object)(object)healthComponent.body)) { CharacterMotor characterMotor = healthComponent.body.characterMotor; if (Object.op_Implicit((Object)(object)characterMotor)) { characterMotor.velocity = Vector3.zero; } Rigidbody rigidbody = healthComponent.body.rigidbody; if (Object.op_Implicit((Object)(object)rigidbody)) { rigidbody.velocity = Vector3.zero; } } } if (!flag && stopwatch >= minDuration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); return; } } if (stopwatch >= windupDelay + maxDuration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)theWorld)) { theWorld.Dismiss(0.2f); } DIOSounds.StopAttached(((EntityState)this).gameObject); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class StandBlock : BaseSkillState { public static float maxHoldDuration = 5f; private TheWorldComponent theWorld; public override void OnEnter() { ((BaseState)this).OnEnter(); theWorld = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)theWorld)) { theWorld.Summon(maxHoldDuration + 0.5f); theWorld.blockActive = true; } DIOSounds.PlayAttached("Guard", ((EntityState)this).gameObject); ((EntityState)this).characterBody.SetAimTimer(maxHoldDuration); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)theWorld)) { theWorld.AddTime(0.3f); } if (((EntityState)this).isAuthority && ((Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && !((EntityState)this).inputBank.skill3.down) || ((EntityState)this).fixedAge >= maxHoldDuration)) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)theWorld)) { theWorld.blockActive = false; theWorld.Dismiss(0.2f); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class ThrowKnife : BaseSkillState { public static float damageCoefficient = 1.5f; public static float procCoefficient = 0.6f; public static float baseDuration = 0.7f; public static float fireFraction = 0.68f; public static float targetSearchRange = 60f; public static float targetSearchAngle = 60f; public static float fanSpreadAngle = 10f; private float duration; private float fireTime; private bool hasFired; private bool isCrit; private bool hasTarget; public override void OnEnter() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = fireFraction * duration; isCrit = ((BaseState)this).RollCrit(); hasTarget = (Object)(object)FindAnyTarget(((BaseState)this).GetAimRay()) != (Object)null; if (!hasTarget) { duration = 0.1f; return; } ((EntityState)this).characterBody.SetAimTimer(2f); ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash1", "Slash.playbackRate", duration, 0.05f); } private HurtBox FindAnyTarget(Ray aimRay) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) List list = FindTargets(aimRay, 1); if (list.Count > 0) { return list[0]; } return WideSearch(aimRay, 1).FirstOrDefault(); } private List WideSearch(Ray aimRay, int maxTargets) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) BullseyeSearch val = new BullseyeSearch { searchOrigin = ((Ray)(ref aimRay)).origin, searchDirection = ((Ray)(ref aimRay)).direction, maxDistanceFilter = targetSearchRange, maxAngleFilter = 360f, teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()), filterByLoS = true, sortMode = (SortMode)1 }; val.RefreshCandidates(); val.FilterOutGameObject(((EntityState)this).gameObject); return val.GetResults().Take(maxTargets).ToList(); } private int KnifeCount() { int num = ((!isCrit) ? 1 : 3); if (ZaWarudo.TIMESTOP_ACTIVE) { num += 2; } return num; } private List FindTargets(Ray aimRay, int maxTargets) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) BullseyeSearch val = new BullseyeSearch { searchOrigin = ((Ray)(ref aimRay)).origin, searchDirection = ((Ray)(ref aimRay)).direction, maxDistanceFilter = targetSearchRange, maxAngleFilter = targetSearchAngle, teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()), filterByLoS = true, sortMode = (SortMode)2 }; val.RefreshCandidates(); val.FilterOutGameObject(((EntityState)this).gameObject); return val.GetResults().Take(maxTargets).ToList(); } private void Fire() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown if (hasFired) { return; } hasFired = true; ((BaseState)this).AddRecoil(-0.5f, -1f, -0.5f, 0.5f); ((EntityState)this).characterBody.AddSpreadBloom(1f); if (!((EntityState)this).isAuthority) { return; } int num = KnifeCount(); Ray aimRay = ((BaseState)this).GetAimRay(); List list = FindTargets(aimRay, num); if (list.Count == 0) { list = WideSearch(aimRay, num); } for (int i = 0; i < num; i++) { if (list.Count <= 0) { break; } HurtBox target = list[i % list.Count]; Vector3 val = Quaternion.AngleAxis(((float)i - (float)(num - 1) * 0.5f) * fanSpreadAngle, Vector3.up) * ((Ray)(ref aimRay)).direction; Vector3 origin = ((Ray)(ref aimRay)).origin + val * 1.5f; HuntressArrowOrb val2 = new HuntressArrowOrb { damageValue = ((EntityState)this).characterBody.damage * damageCoefficient, isCrit = isCrit, teamIndex = ((BaseState)this).GetTeam(), attacker = ((EntityState)this).gameObject, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, origin = origin, target = target }; OrbManager.instance.AddOrb((Orb)(object)val2); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (hasTarget && ((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { if (hasFired) { return (InterruptPriority)0; } return (InterruptPriority)1; } } public class TimeFrozenState : BaseState { public float duration; public override void OnEnter() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.speed = 0f; } if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbody) && !((EntityState)this).rigidbody.isKinematic) { ((EntityState)this).rigidbody.velocity = Vector3.zero; if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor)) { ((EntityState)this).rigidbodyMotor.moveVector = Vector3.zero; } } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.speed = 1f; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class ZaWarudo : BaseSkillState { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__25_0; public static hook_Simulate <>9__25_1; public static hook_ShouldUpdateRunStopwatch <>9__25_2; public static hook_FixedUpdate <>9__25_3; public static hook_FixedUpdate <>9__25_4; public static hook_FixedUpdate <>9__25_5; public static hook_UpdateOrb <>9__25_6; public static hook_FixedUpdate <>9__25_7; public static hook_FixedUpdate <>9__25_8; public static hook_FixedUpdate <>9__25_9; public static hook_FixedUpdate <>9__25_10; public static hook_FixedUpdate <>9__25_11; public static hook_UpdateBuffs <>9__25_12; public static hook_FixedUpdate <>9__25_13; public static hook_Update <>9__25_14; public static hook_FixedUpdate <>9__25_15; public static hook_Update <>9__25_16; public static hook_FixedUpdate <>9__25_17; public static hook_FixedUpdate <>9__25_18; public static hook_FixedUpdate <>9__25_19; public static hook_FixedUpdate <>9__25_20; public static hook_FixedUpdate <>9__25_21; public static hook_Update <>9__25_22; public static hook_FixedUpdate <>9__25_23; public static hook_FixedUpdate <>9__25_24; public static hook_FixedUpdateServer <>9__25_25; public static hook_OnDeathStart <>9__25_26; internal void b__25_0(Stage stage) { PrewarmVisual(); } internal void b__25_1(orig_Simulate orig, CombatDirector self, float deltaTime) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self, deltaTime); } } internal bool b__25_2(orig_ShouldUpdateRunStopwatch orig, Run self) { if (orig.Invoke(self)) { return !TIMESTOP_ACTIVE; } return false; } internal void b__25_3(orig_FixedUpdate orig, ProjectileSimple self) { //IL_004e: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (TIMESTOP_ACTIVE) { ProjectileController component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.teamFilter) && component.teamFilter.teamIndex == CASTER_TEAM) { orig.Invoke(self); return; } Rigidbody component2 = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.velocity = FrozenVelocity(component2); component2.angularVelocity = Vector3.zero; return; } } orig.Invoke(self); } internal void b__25_4(orig_FixedUpdate orig, ProjectileImpactExplosion self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_5(orig_FixedUpdate orig, OrbManager self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_6(orig_UpdateOrb orig, OrbEffect self, float deltaTime) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self, deltaTime); } } internal void b__25_7(orig_FixedUpdate orig, RigidbodyMotor self) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!TIMESTOP_ACTIVE) { orig.Invoke(self); return; } TeamComponent component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.teamIndex == CASTER_TEAM) { orig.Invoke(self); } else { self.rigid.velocity = FrozenVelocity(self.rigid); } } internal void b__25_8(orig_FixedUpdate orig, DelayBlast self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_9(orig_FixedUpdate orig, DestroyOnTimer self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_10(orig_FixedUpdate orig, DotController self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_11(orig_FixedUpdate orig, CharacterBody self) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!TIMESTOP_ACTIVE || self.timedBuffs == null) { return; } float fixedDeltaTime = Time.fixedDeltaTime; for (int i = 0; i < self.timedBuffs.Count; i++) { TimedBuff val = self.timedBuffs[i]; if (!Object.op_Implicit((Object)(object)DIOBuffs.timeStopDebuff) || val.buffIndex != DIOBuffs.timeStopDebuff.buffIndex) { val.timer += fixedDeltaTime; } } } internal void b__25_12(orig_UpdateBuffs orig, CharacterBody self, float deltaTime) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self, deltaTime); } } internal void b__25_13(orig_FixedUpdate orig, DotController self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_14(orig_Update orig, ChargeLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_15(orig_FixedUpdate orig, ChargeLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_16(orig_Update orig, ChargeMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_17(orig_FixedUpdate orig, ChargeMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_18(orig_FixedUpdate orig, FireMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_19(orig_FixedUpdate orig, ChargeGoldMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_20(orig_FixedUpdate orig, FireGoldMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_21(orig_FixedUpdate orig, MinigunFire self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_22(orig_Update orig, ChargeEmbers self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_23(orig_FixedUpdate orig, ChargeEmbers self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_24(orig_FixedUpdate orig, ChargeCannons self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } internal void b__25_25(orig_FixedUpdateServer orig, WormBodyPositionsDriver self) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } else { self.chaserVelocity = Vector3.zero; } } internal void b__25_26(orig_OnDeathStart orig, WormBodyPositions2 self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } } public static bool TIMESTOP_ACTIVE = false; public static TeamIndex CASTER_TEAM = (TeamIndex)(-1); private static float startupDuration = 0.4f; private float timeStopDuration; private float stopwatch; private bool stopped; private bool poseFreedom; private CharacterBody bodyUsed; private ColorGrading colorGrading; private LensDistortion lensDistortion; private readonly List pausedParticles = new List(); private PostProcessVolume ppVolume; private static int castCounter; private static PostProcessVolume sharedVolume; public override void OnEnter() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); timeStopDuration = DIOConfig.timeStopDuration.Value + 0.1f * Mathf.Max(0f, ((EntityState)this).characterBody.level - 1f); bodyUsed = ((EntityState)this).characterBody; CASTER_TEAM = (TeamIndex)((!Object.op_Implicit((Object)(object)((EntityState)this).teamComponent)) ? 1 : ((int)((EntityState)this).teamComponent.teamIndex)); ((EntityState)this).PlayAnimation("Gesture, Override", "ThrowBomb", "ThrowBomb.playbackRate", startupDuration, 0f); DIOSounds.PlayAttached("ZaWarudo", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch += ((EntityState)this).GetDeltaTime(); if (stopwatch >= startupDuration && !stopped) { stopped = true; TIMESTOP_ACTIVE = true; FreezeAllEnemies(); CreateTimeStopVisual(); PauseAllParticles(); Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.speed = 0f; } } if (stopped && !poseFreedom && stopwatch >= startupDuration + 0.5f) { poseFreedom = true; Animator modelAnimator2 = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator2)) { modelAnimator2.speed = 1f; } } if (stopwatch >= startupDuration + timeStopDuration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.speed = 1f; } if (stopped) { TIMESTOP_ACTIVE = false; ProjectileSimple[] array = Object.FindObjectsOfType(); foreach (ProjectileSimple obj in array) { obj.SetForwardSpeed(obj.desiredForwardSpeed); } foreach (ParticleSystem pausedParticle in pausedParticles) { if (Object.op_Implicit((Object)(object)pausedParticle) && pausedParticle.isPaused) { pausedParticle.Play(true); } } pausedParticles.Clear(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Util.CheckRoll(30f, ((EntityState)this).characterBody.master)) { DIOSounds.Play("DioSayonaraDa", ((EntityState)this).characterBody.corePosition); } } if (Object.op_Implicit((Object)(object)ppVolume)) { RuntimeUtilities.DestroyVolume(ppVolume, true, true); ppVolume = null; colorGrading = null; lensDistortion = null; } ((EntityState)this).OnExit(); } public static void PrewarmVisual() { EnsureVolume(); } private static PostProcessVolume EnsureVolume() { if (Object.op_Implicit((Object)(object)sharedVolume)) { return sharedVolume; } ColorGrading val = ScriptableObject.CreateInstance(); ((ParameterOverride)(object)((PostProcessEffectSettings)val).enabled).Override(true); ((ParameterOverride)(object)val.hueShift).Override(0f); ((ParameterOverride)(object)val.saturation).Override(0f); LensDistortion val2 = ScriptableObject.CreateInstance(); ((ParameterOverride)(object)((PostProcessEffectSettings)val2).enabled).Override(true); ((ParameterOverride)(object)val2.intensity).Override(0f); sharedVolume = PostProcessManager.instance.QuickVolume(LayerMask.NameToLayer("PostProcess"), 9999f, (PostProcessEffectSettings[])(object)new PostProcessEffectSettings[2] { (PostProcessEffectSettings)val, (PostProcessEffectSettings)val2 }); sharedVolume.weight = 0f; return sharedVolume; } private void CreateTimeStopVisual() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown try { GameObject val = new GameObject("DIOZaWarudoVolume"); val.layer = LayerMask.NameToLayer("PostProcess"); ColorGrading val2 = ScriptableObject.CreateInstance(); ((ParameterOverride)(object)((PostProcessEffectSettings)val2).enabled).Override(true); ((ParameterOverride)(object)val2.gradingMode).Override((GradingMode)1); ((ParameterOverride)(object)val2.hueShift).Override(0f); ((ParameterOverride)(object)val2.saturation).Override(0f); LensDistortion val3 = ScriptableObject.CreateInstance(); ((ParameterOverride)(object)((PostProcessEffectSettings)val3).enabled).Override(true); ((ParameterOverride)(object)val3.intensity).Override(0f); PostProcessProfile val4 = ScriptableObject.CreateInstance(); val4.settings.Add((PostProcessEffectSettings)(object)val2); val4.settings.Add((PostProcessEffectSettings)(object)val3); val4.isDirty = true; ppVolume = val.AddComponent(); ppVolume.profile = val4; ppVolume.isGlobal = true; castCounter++; ppVolume.priority = 9999f + (float)(castCounter % 100) * 0.01f; ppVolume.weight = 1f; CameraRigController val5 = ((CameraRigController.readOnlyInstancesList.Count > 0) ? CameraRigController.readOnlyInstancesList[0] : null); PostProcessLayer val6 = ((Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)val5.sceneCam)) ? ((Component)val5.sceneCam).GetComponent() : null); if (Object.op_Implicit((Object)(object)val6)) { ((Behaviour)val6).enabled = false; ((Behaviour)val6).enabled = true; List list = new List(); PostProcessManager.instance.GetActiveVolumes(val6, list, true, true); Log.Info($"[ZaWarudo] visual: layerKicked=True, inActiveList={list.Contains(ppVolume)}, activeCount={list.Count}, volLayer={((Component)ppVolume).gameObject.layer}, camMask={((LayerMask)(ref val6.volumeLayer)).value}, weight={ppVolume.weight}"); } else { Log.Info("[ZaWarudo] visual: no PostProcessLayer found on scene camera!"); } ppVolume.profile.TryGetSettings(ref colorGrading); ppVolume.profile.TryGetSettings(ref lensDistortion); if ((Object)(object)colorGrading != (Object)null) { ((ParameterOverride)(object)colorGrading.hueShift).value = 0f; ((ParameterOverride)(object)colorGrading.saturation).value = 0f; } if ((Object)(object)lensDistortion != (Object)null) { ((ParameterOverride)(object)lensDistortion.intensity).value = 0f; } } catch (Exception ex) { Log.Error("[ZaWarudo] visual creation failed: " + ex); } } private void PauseAllParticles() { ParticleSystem[] array = Object.FindObjectsOfType(); foreach (ParticleSystem val in array) { if (val.isPlaying) { val.Pause(true); pausedParticles.Add(val); } } } public override void Update() { ((EntityState)this).Update(); if (stopped && !((Object)(object)colorGrading == (Object)null)) { if (Object.op_Implicit((Object)(object)ppVolume)) { ppVolume.weight = 1f; } float num = stopwatch - startupDuration; float num2 = 0.75f; float num3 = timeStopDuration - num2; Animate(colorGrading.hueShift, 0f, 180f, 0f, 0.5f, num); Animate(lensDistortion.intensity, 0f, 65f, 0f, 0.5f, num); Animate(lensDistortion.intensity, 65f, 0f, 0.5f, 0.5f, num); Animate(colorGrading.saturation, 0f, 45f, 0.5f, 1f, num); if (num > 1f && num < num3) { ((ParameterOverride)(object)lensDistortion.intensity).value = Mathf.Sin((num - 1f) * 4f) * 10f; } Animate(colorGrading.saturation, 45f, 0f, num3, num2, num); Animate(colorGrading.hueShift, 180f, 0f, num3, num2, num); if (num >= num3) { Animate(lensDistortion.intensity, 10f, 0f, num3, num2, num); } } } private static void Animate(FloatParameter param, float from, float to, float start, float window, float time) { float num = time - start; if (!(num <= 0f)) { ((ParameterOverride)(object)param).value = Mathf.Lerp(from, to, num / window); } } private void FreezeAllEnemies() { //IL_0019: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)bodyUsed)) { return; } Collider[] array = Physics.OverlapSphere(bodyUsed.transform.position, float.MaxValue, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)); List list = new List(); Collider[] array2 = array; for (int i = 0; i < array2.Length; i++) { HurtBox component = ((Component)array2[i]).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.healthComponent) || (Object)(object)component.healthComponent == (Object)(object)bodyUsed.healthComponent || list.Contains(component.hurtBoxGroup) || component.teamIndex == bodyUsed.teamComponent.teamIndex) { continue; } list.Add(component.hurtBoxGroup); CharacterBody body = component.healthComponent.body; if (Object.op_Implicit((Object)(object)body)) { EntityStateMachine component2 = ((Component)body).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.SetState((EntityState)(object)new TimeFrozenState { duration = timeStopDuration }); } if (NetworkServer.active && Object.op_Implicit((Object)(object)DIOBuffs.timeStopDebuff)) { body.AddTimedBuff(DIOBuffs.timeStopDebuff, timeStopDuration); } } } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } public static void RegisterHooks() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Expected O, but got Unknown //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Expected O, but got Unknown //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Expected O, but got Unknown //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Expected O, but got Unknown //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Expected O, but got Unknown //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Expected O, but got Unknown //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Expected O, but got Unknown //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Expected O, but got Unknown //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Expected O, but got Unknown //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Expected O, but got Unknown //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Expected O, but got Unknown //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Expected O, but got Unknown //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Expected O, but got Unknown //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Expected O, but got Unknown Stage.onStageStartGlobal += delegate { PrewarmVisual(); }; object obj = <>c.<>9__25_1; if (obj == null) { hook_Simulate val = delegate(orig_Simulate orig, CombatDirector self, float deltaTime) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self, deltaTime); } }; <>c.<>9__25_1 = val; obj = (object)val; } CombatDirector.Simulate += (hook_Simulate)obj; object obj2 = <>c.<>9__25_2; if (obj2 == null) { hook_ShouldUpdateRunStopwatch val2 = (orig_ShouldUpdateRunStopwatch orig, Run self) => orig.Invoke(self) && !TIMESTOP_ACTIVE; <>c.<>9__25_2 = val2; obj2 = (object)val2; } Run.ShouldUpdateRunStopwatch += (hook_ShouldUpdateRunStopwatch)obj2; object obj3 = <>c.<>9__25_3; if (obj3 == null) { hook_FixedUpdate val3 = delegate(orig_FixedUpdate orig, ProjectileSimple self) { //IL_004e: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (TIMESTOP_ACTIVE) { ProjectileController component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.teamFilter) && component.teamFilter.teamIndex == CASTER_TEAM) { orig.Invoke(self); return; } Rigidbody component2 = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.velocity = FrozenVelocity(component2); component2.angularVelocity = Vector3.zero; return; } } orig.Invoke(self); }; <>c.<>9__25_3 = val3; obj3 = (object)val3; } ProjectileSimple.FixedUpdate += (hook_FixedUpdate)obj3; object obj4 = <>c.<>9__25_4; if (obj4 == null) { hook_FixedUpdate val4 = delegate(orig_FixedUpdate orig, ProjectileImpactExplosion self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_4 = val4; obj4 = (object)val4; } ProjectileImpactExplosion.FixedUpdate += (hook_FixedUpdate)obj4; object obj5 = <>c.<>9__25_5; if (obj5 == null) { hook_FixedUpdate val5 = delegate(orig_FixedUpdate orig, OrbManager self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_5 = val5; obj5 = (object)val5; } OrbManager.FixedUpdate += (hook_FixedUpdate)obj5; object obj6 = <>c.<>9__25_6; if (obj6 == null) { hook_UpdateOrb val6 = delegate(orig_UpdateOrb orig, OrbEffect self, float deltaTime) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self, deltaTime); } }; <>c.<>9__25_6 = val6; obj6 = (object)val6; } OrbEffect.UpdateOrb += (hook_UpdateOrb)obj6; object obj7 = <>c.<>9__25_7; if (obj7 == null) { hook_FixedUpdate val7 = delegate(orig_FixedUpdate orig, RigidbodyMotor self) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } else { TeamComponent component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.teamIndex == CASTER_TEAM) { orig.Invoke(self); } else { self.rigid.velocity = FrozenVelocity(self.rigid); } } }; <>c.<>9__25_7 = val7; obj7 = (object)val7; } RigidbodyMotor.FixedUpdate += (hook_FixedUpdate)obj7; object obj8 = <>c.<>9__25_8; if (obj8 == null) { hook_FixedUpdate val8 = delegate(orig_FixedUpdate orig, DelayBlast self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_8 = val8; obj8 = (object)val8; } DelayBlast.FixedUpdate += (hook_FixedUpdate)obj8; object obj9 = <>c.<>9__25_9; if (obj9 == null) { hook_FixedUpdate val9 = delegate(orig_FixedUpdate orig, DestroyOnTimer self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_9 = val9; obj9 = (object)val9; } DestroyOnTimer.FixedUpdate += (hook_FixedUpdate)obj9; object obj10 = <>c.<>9__25_10; if (obj10 == null) { hook_FixedUpdate val10 = delegate(orig_FixedUpdate orig, DotController self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_10 = val10; obj10 = (object)val10; } DotController.FixedUpdate += (hook_FixedUpdate)obj10; object obj11 = <>c.<>9__25_11; if (obj11 == null) { hook_FixedUpdate val11 = delegate(orig_FixedUpdate orig, CharacterBody self) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (TIMESTOP_ACTIVE && self.timedBuffs != null) { float fixedDeltaTime = Time.fixedDeltaTime; for (int i = 0; i < self.timedBuffs.Count; i++) { TimedBuff val27 = self.timedBuffs[i]; if (!Object.op_Implicit((Object)(object)DIOBuffs.timeStopDebuff) || val27.buffIndex != DIOBuffs.timeStopDebuff.buffIndex) { val27.timer += fixedDeltaTime; } } } }; <>c.<>9__25_11 = val11; obj11 = (object)val11; } CharacterBody.FixedUpdate += (hook_FixedUpdate)obj11; object obj12 = <>c.<>9__25_12; if (obj12 == null) { hook_UpdateBuffs val12 = delegate(orig_UpdateBuffs orig, CharacterBody self, float deltaTime) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self, deltaTime); } }; <>c.<>9__25_12 = val12; obj12 = (object)val12; } CharacterBody.UpdateBuffs += (hook_UpdateBuffs)obj12; object obj13 = <>c.<>9__25_13; if (obj13 == null) { hook_FixedUpdate val13 = delegate(orig_FixedUpdate orig, DotController self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_13 = val13; obj13 = (object)val13; } DotController.FixedUpdate += (hook_FixedUpdate)obj13; object obj14 = <>c.<>9__25_14; if (obj14 == null) { hook_Update val14 = delegate(orig_Update orig, ChargeLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_14 = val14; obj14 = (object)val14; } ChargeLaser.Update += (hook_Update)obj14; object obj15 = <>c.<>9__25_15; if (obj15 == null) { hook_FixedUpdate val15 = delegate(orig_FixedUpdate orig, ChargeLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_15 = val15; obj15 = (object)val15; } ChargeLaser.FixedUpdate += (hook_FixedUpdate)obj15; object obj16 = <>c.<>9__25_16; if (obj16 == null) { hook_Update val16 = delegate(orig_Update orig, ChargeMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_16 = val16; obj16 = (object)val16; } ChargeMegaLaser.Update += (hook_Update)obj16; object obj17 = <>c.<>9__25_17; if (obj17 == null) { hook_FixedUpdate val17 = delegate(orig_FixedUpdate orig, ChargeMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_17 = val17; obj17 = (object)val17; } ChargeMegaLaser.FixedUpdate += (hook_FixedUpdate)obj17; object obj18 = <>c.<>9__25_18; if (obj18 == null) { hook_FixedUpdate val18 = delegate(orig_FixedUpdate orig, FireMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_18 = val18; obj18 = (object)val18; } FireMegaLaser.FixedUpdate += (hook_FixedUpdate)obj18; object obj19 = <>c.<>9__25_19; if (obj19 == null) { hook_FixedUpdate val19 = delegate(orig_FixedUpdate orig, ChargeGoldMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_19 = val19; obj19 = (object)val19; } ChargeGoldMegaLaser.FixedUpdate += (hook_FixedUpdate)obj19; object obj20 = <>c.<>9__25_20; if (obj20 == null) { hook_FixedUpdate val20 = delegate(orig_FixedUpdate orig, FireGoldMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_20 = val20; obj20 = (object)val20; } FireGoldMegaLaser.FixedUpdate += (hook_FixedUpdate)obj20; object obj21 = <>c.<>9__25_21; if (obj21 == null) { hook_FixedUpdate val21 = delegate(orig_FixedUpdate orig, MinigunFire self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_21 = val21; obj21 = (object)val21; } MinigunFire.FixedUpdate += (hook_FixedUpdate)obj21; object obj22 = <>c.<>9__25_22; if (obj22 == null) { hook_Update val22 = delegate(orig_Update orig, ChargeEmbers self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_22 = val22; obj22 = (object)val22; } ChargeEmbers.Update += (hook_Update)obj22; object obj23 = <>c.<>9__25_23; if (obj23 == null) { hook_FixedUpdate val23 = delegate(orig_FixedUpdate orig, ChargeEmbers self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_23 = val23; obj23 = (object)val23; } ChargeEmbers.FixedUpdate += (hook_FixedUpdate)obj23; object obj24 = <>c.<>9__25_24; if (obj24 == null) { hook_FixedUpdate val24 = delegate(orig_FixedUpdate orig, ChargeCannons self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_24 = val24; obj24 = (object)val24; } ChargeCannons.FixedUpdate += (hook_FixedUpdate)obj24; object obj25 = <>c.<>9__25_25; if (obj25 == null) { hook_FixedUpdateServer val25 = delegate(orig_FixedUpdateServer orig, WormBodyPositionsDriver self) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } else { self.chaserVelocity = Vector3.zero; } }; <>c.<>9__25_25 = val25; obj25 = (object)val25; } WormBodyPositionsDriver.FixedUpdateServer += (hook_FixedUpdateServer)obj25; object obj26 = <>c.<>9__25_26; if (obj26 == null) { hook_OnDeathStart val26 = delegate(orig_OnDeathStart orig, WormBodyPositions2 self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } }; <>c.<>9__25_26 = val26; obj26 = (object)val26; } WormBodyPositions2.OnDeathStart += (hook_OnDeathStart)obj26; } private static Vector3 FrozenVelocity(Rigidbody rb) { //IL_0041: 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) bool flag = false; AntiGravityForce component = ((Component)rb).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { flag = component.antiGravityCoefficient == 1f; } if (!rb.useGravity || flag) { return Vector3.zero; } return new Vector3(0f, 0.5f, 0f); } } } namespace DIOOH.Survivors.DIO.Components { public class DIODisplayVoice : MonoBehaviour { private void OnEnable() { DIOSounds.Play2D("ChSelect"); } } public class TheWorldComponent : MonoBehaviour { private const string childLocatorName = "TheWorldModel"; private const float minActiveTime = 0.2f; private float stopwatch; private bool active; private bool warnedMissing; public bool blockActive; public const float windupFreezeFraction = 0.2f; public const float mudaStartClipLength = 1f; private bool windupFreezePending; private GameObject GetModel() { CharacterBody component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelLocator) || !Object.op_Implicit((Object)(object)component.modelLocator.modelTransform)) { return null; } ChildLocator component2 = ((Component)component.modelLocator.modelTransform).GetComponent(); if (!Object.op_Implicit((Object)(object)component2)) { return null; } Transform val = component2.FindChild("TheWorldModel"); if (!Object.op_Implicit((Object)(object)val)) { if (!warnedMissing) { Log.Warning("TheWorldComponent: ChildLocator entry 'TheWorldModel' not found on model. The Stand will be invisible until the model prefab has it."); warnedMissing = true; } return null; } return ((Component)val).gameObject; } private Animator GetStandAnimator() { GameObject model = GetModel(); if (!Object.op_Implicit((Object)(object)model)) { return null; } return model.GetComponent(); } private void Show(float duration) { GameObject model = GetModel(); if (Object.op_Implicit((Object)(object)model)) { model.SetActive(true); active = true; stopwatch = Mathf.Max(stopwatch, duration + 0.2f); } } public void Summon(float duration) { Show(duration); Animator standAnimator = GetStandAnimator(); if (Object.op_Implicit((Object)(object)standAnimator)) { standAnimator.CrossFadeInFixedTime("StanceUp", 0.05f); } } public void StartFlurry(float duration, float playbackRate) { Show(duration); Animator standAnimator = GetStandAnimator(); if (Object.op_Implicit((Object)(object)standAnimator)) { standAnimator.SetFloat("Flurry.playbackRate", playbackRate); standAnimator.SetFloat("MudaStart.playbackRate", playbackRate); standAnimator.CrossFadeInFixedTime("MudaStart", 0.05f); } } public void StartHeldWindup(float duration, float playbackRate) { Show(duration); Animator standAnimator = GetStandAnimator(); if (Object.op_Implicit((Object)(object)standAnimator)) { standAnimator.SetFloat("MudaStart.playbackRate", playbackRate); standAnimator.CrossFadeInFixedTime("MudaStart", 0.1f); windupFreezePending = true; } } public void ResumeWindup(float playbackRate) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) windupFreezePending = false; Animator standAnimator = GetStandAnimator(); if (!Object.op_Implicit((Object)(object)standAnimator)) { return; } standAnimator.SetFloat("MudaStart.playbackRate", playbackRate); standAnimator.SetFloat("Flurry.playbackRate", playbackRate); AnimatorStateInfo currentAnimatorStateInfo = standAnimator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("MudaStart") && !((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("MudaFlurry")) { AnimatorStateInfo nextAnimatorStateInfo = standAnimator.GetNextAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref nextAnimatorStateInfo)).IsName("MudaStart")) { standAnimator.CrossFadeInFixedTime("MudaStart", 0.05f); } } } public void Dismiss(float delay) { if (active) { stopwatch = Mathf.Min(stopwatch, delay); } } public void AddTime(float duration) { Show(duration); } public void SetFlurryRate(float playbackRate) { Animator standAnimator = GetStandAnimator(); if (Object.op_Implicit((Object)(object)standAnimator)) { standAnimator.SetFloat("Flurry.playbackRate", playbackRate); } } private void FixedUpdate() { //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) if (windupFreezePending) { Animator standAnimator = GetStandAnimator(); if (Object.op_Implicit((Object)(object)standAnimator)) { AnimatorStateInfo currentAnimatorStateInfo = standAnimator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("MudaStart") && ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime >= 0.2f) { standAnimator.SetFloat("MudaStart.playbackRate", 0f); windupFreezePending = false; } } } if (stopwatch > 0f) { stopwatch -= Time.fixedDeltaTime; } else if (active) { GameObject model = GetModel(); if (Object.op_Implicit((Object)(object)model)) { model.SetActive(false); } active = false; } } } }