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 EntityStates; using EntityStates.AI.Walker; using EntityStates.Commando; using HG; using HG.BlendableTypes; using On.RoR2; using R2API; using R2API.Utils; using Rewired.ComponentControls.Effects; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.ResourceManagement.AsyncOperations; using WisadelMod.Modules; using WisadelMod.Modules.Achievements; using WisadelMod.Modules.Characters; using WisadelMod.Survivors.Wisadel; using WisadelMod.Survivors.Wisadel.Components; using WisadelMod.Survivors.Wisadel.SkillStates; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("WisadelMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("WisadelMod")] [assembly: AssemblyTitle("WisadelMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace WisadelMod { 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); } } [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.xpolarzide.WisadelMod", "Wis'adel from Arknights", "0.1.0")] public class WisadelPlugin : BaseUnityPlugin { public const string MODUID = "com.xpolarzide.WisadelMod"; public const string MODNAME = "Wis'adel from Arknights"; public const string MODVERSION = "0.1.0"; public const string DEVELOPER_PREFIX = "XPOLARZIDE"; public static WisadelPlugin instance; private void Awake() { instance = this; Log.Init(((BaseUnityPlugin)this).Logger); Language.Init(); new WisadelSurvivor().Initialize(); new ContentPacks().Initialize(); } } } namespace WisadelMod.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)WisadelPlugin.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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) GameObject val = assetBundle.LoadAsset(resourceName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(resourceName, ((Object)assetBundle).name); return null; } val.AddComponent().duration = 12f; val.AddComponent(); val.AddComponent().vfxPriority = (VFXPriority)2; EffectComponent val2 = val.AddComponent(); val2.applyScale = false; val2.effectIndex = (EffectIndex)(-1); val2.parentToReferencedTransform = parentToTransform; val2.positionAtReferencedTransform = true; val2.soundName = soundName; Content.CreateAndAddEffectDef(val); return val; } internal static GameObject CreateProjectileGhostPrefab(this AssetBundle assetBundle, string ghostName) { GameObject val = assetBundle.LoadAsset(ghostName); if ((Object)(object)val == (Object)null) { Log.Error("Failed to load ghost prefab " + ghostName); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } ConvertAllRenderersToHopooShader(val); return val; } internal static GameObject 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)WisadelPlugin.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); if (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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) foreach (KeyCode modifier in ((KeyboardShortcut)(ref entry)).Modifiers) { if (!Input.GetKey(modifier)) { return false; } } return Input.GetKeyDown(((KeyboardShortcut)(ref entry)).MainKey); } } 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_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) SurvivorDef val = ScriptableObject.CreateInstance(); val.bodyPrefab = bodyPrefab; val.displayPrefab = displayPrefab; val.primaryColor = charColor; val.cachedName = ((Object)bodyPrefab).name.Replace("Body", ""); val.displayNameToken = tokenPrefix + "NAME"; val.descriptionToken = tokenPrefix + "DESCRIPTION"; val.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR"; val.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE"; val.desiredSortPosition = sortPosition; val.unlockableDef = unlockableDef; AddSurvivorDef(val); } internal static void AddUnlockableDef(UnlockableDef unlockableDef) { ContentPacks.unlockableDefs.Add(unlockableDef); } internal static UnlockableDef CreateAndAddUnlockbleDef(string identifier, string nameToken, Sprite achievementIcon) { UnlockableDef val = ScriptableObject.CreateInstance(); val.cachedName = identifier; val.nameToken = nameToken; val.achievementIcon = achievementIcon; AddUnlockableDef(val); return val; } internal static void AddSkillDef(SkillDef skillDef) { ContentPacks.skillDefs.Add(skillDef); } internal static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } internal static void AddEntityState(Type entityState) { ContentPacks.entityStates.Add(entityState); } internal static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } internal static BuffDef CreateAndAddBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; AddBuffDef(val); return val; } internal static void AddEffectDef(EffectDef effectDef) { ContentPacks.effectDefs.Add(effectDef); } internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown EffectDef val = new EffectDef(effectPrefab); AddEffectDef(val); return val; } internal static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } internal static NetworkSoundEventDef CreateAndAddNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; AddNetworkSoundEventDef(val); return val; } } internal 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.xpolarzide.WisadelMod"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0069: 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_0085: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 //IL_00a5: 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) { ItemDisplayRuleSet itemDisplayRuleSet = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyName).GetComponent().modelTransform).GetComponent().itemDisplayRuleSet; KeyAssetRuleGroup[] keyAssetRuleGroups = 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_0019: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) 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_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0043: 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) 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_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) 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)WisadelPlugin.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)) { string path = Path.Combine(Directory.GetParent(((BaseUnityPlugin)WisadelPlugin.instance).Info.Location).FullName, "Language", "en", fileName); File.WriteAllText(path, 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name.Contains(materialName); }); if (Object.op_Implicit((Object)(object)val)) { Log.Debug(((Object)val).name + " has already been loaded. returning cached"); return val; } val = assetBundle.LoadAsset(materialName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(materialName, ((Object)assetBundle).name); return new Material(hotpoo); } return val.ConvertDefaultShaderToHopoo(); } public static Material SetHopooMaterial(this Material tempMat) { return tempMat.ConvertDefaultShaderToHopoo(); } public static Material ConvertDefaultShaderToHopoo(this Material tempMat) { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } public static Material SetSpecular(this Material material, float strength) { material.SetFloat("_SpecularStrength", strength); return material; } public static Material SetSpecular(this Material material, float strength, float exponent) { material.SetFloat("_SpecularStrength", strength); material.SetFloat("SpecularExponent", exponent); return material; } } internal static class 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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; Transform val2 = bodyPrefab.transform.Find("CameraPivot"); if ((Object)(object)val2 == (Object)null) { val2 = new GameObject("CameraPivot").transform; val2.parent = bodyPrefab.transform; val2.localPosition = bodyInfo.cameraPivotPosition; val2.localRotation = Quaternion.identity; } Transform val3 = bodyPrefab.transform.Find("AimOrigin"); if ((Object)(object)val3 == (Object)null) { val3 = new GameObject("AimOrigin").transform; val3.parent = bodyPrefab.transform; val3.localPosition = bodyInfo.aimOriginPosition; val3.localRotation = Quaternion.identity; } bodyPrefab.GetComponent().aimOriginTransform = val3; 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_0018: 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 flag = (Object)(object)val != (Object)null; if (!flag) { val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.AddComponent(); } val.body = bodyPrefab.GetComponent(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List(); if (!flag) { 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) 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_0025: 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 val = model.AddComponent(); val.baseFootstepString = "Play_player_footstep"; val.sprintFootstepOverrideString = ""; val.enableFootstepDust = true; val.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 val = model.AddComponent(); val.directionComponent = prefab.GetComponent(); val.pitchRangeMax = 60f; val.pitchRangeMin = -60f; val.yawRangeMin = -80f; val.yawRangeMax = 80f; val.pitchGiveupRange = 30f; val.yawGiveupRange = 10f; val.giveupDuration = 3f; val.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 val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true); val.GetComponent().bodyPrefab = bodyPrefab; Content.AddMasterPrefab(val); return val; } public static GameObject CreateBlankMasterPrefab(GameObject bodyPrefab, string masterName) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/CommandoMonsterMaster"), masterName, true); ContentPacks.masterPrefabs.Add(val); CharacterMaster component = val.GetComponent(); component.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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) 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]); } NetworkStateMachine component = bodyPrefab.GetComponent(); component.stateMachines = Array.Empty(); CharacterDeathBehavior component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.idleStateMachine = Array.Empty(); } SetStateOnHurt component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.idleStateMachine = Array.Empty(); } CharacterBody component4 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { component4.vehicleIdleStateMachine = Array.Empty(); } } public static EntityStateMachine AddEntityStateMachine(GameObject prefab, string machineName, Type mainStateType = null, Type initalStateType = null, bool addToHurt = true, bool addToDeath = true) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) 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 val2 = prefab.AddComponent(); val2.hitBoxes = list.ToArray(); val2.groupName = hitBoxGroupName; } } public class CustomRendererInfo { public string childName; public Material material = null; public bool dontHotpoo = false; public bool ignoreOverlays = false; } 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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); foreach (SkillSlot val in slots) { SkillSlot val2 = val; switch (val2 - -1) { case 1: component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary"); break; case 2: component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary"); break; case 3: component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility"); break; case 4: component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special"); break; } } } public static void ClearGenericSkills(GameObject targetPrefab) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren(); foreach (GenericSkill val in componentsInChildren) { Object.DestroyImmediate((Object)(object)val); } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, SkillSlot skillSlot, bool hidden = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); switch (skillSlot - -1) { case 1: return component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary", hidden); case 2: return component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary", hidden); case 3: return component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility", hidden); case 4: return component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special", hidden); case 0: Log.Error("Failed to create GenericSkill with skillslot None. If making a GenericSkill outside of the main 4, specify a familyName, and optionally a genericSkillName"); return null; default: return null; } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false) { return CreateGenericSkillWithSkillFamily(targetPrefab, familyName, familyName, hidden); } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string genericSkillName, string familyName, bool hidden = false) { GenericSkill val = targetPrefab.AddComponent(); val.skillName = genericSkillName; val.hideInCharacterSelect = hidden; SkillFamily val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = ((Object)targetPrefab).name + familyName + "Family"; val2.variants = (Variant[])(object)new Variant[0]; val._skillFamily = val2; Content.AddSkillFamily(val2); return val; } public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef, unlockableDef = unlockableDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static void AddSkillsToFamily(SkillFamily skillFamily, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSkillToFamily(skillFamily, skillDef); } } public static void AddPrimarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().primary.skillFamily, skillDefs); } public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().secondary.skillFamily, skillDefs); } public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().utility.skillFamily, skillDefs); } public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().special.skillFamily, skillDefs); } public static void AddUnlockablesToFamily(SkillFamily skillFamily, params UnlockableDef[] unlockableDefs) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < unlockableDefs.Length; i++) { Variant val = skillFamily.variants[i]; val.unlockableDef = unlockableDefs[i]; skillFamily.variants[i] = val; } } public static SkillDef CreateSkillDef(SkillDefInfo skillDefInfo) { return Skills.CreateSkillDef(skillDefInfo); } public static T CreateSkillDef(SkillDefInfo skillDefInfo) where T : SkillDef { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) 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).attackSpeedBuffsRestockSpeed = skillDefInfo.attackSpeedBuffsRestockSpeed; ((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 attackSpeedBuffsRestockSpeed = false; public bool resetCooldownTimerOnUse = false; public bool fullRestockOnAssign = true; public bool dontAllowPastMaxStocks = false; public bool beginSkillCooldownOnSkillEnd = false; public bool mustKeyPress = false; public bool isCombatSkill = true; public bool canceledFromSprinting = false; public bool cancelSprintingOnActivation = true; public bool forceSprintDuringState = false; public SkillDefInfo() { } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_0093: 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_00c9: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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 val = ScriptableObject.CreateInstance(); val.baseSkins = skinDefInfo.BaseSkins; val.icon = skinDefInfo.Icon; val.unlockableDef = skinDefInfo.UnlockableDef; val.rootObject = skinDefInfo.RootObject; defaultRendererInfos.CopyTo(skinDefInfo.RendererInfos, 0); val.rendererInfos = skinDefInfo.RendererInfos; val.gameObjectActivations = skinDefInfo.GameObjectActivations; val.meshReplacements = skinDefInfo.MeshReplacements; val.projectileGhostReplacements = skinDefInfo.ProjectileGhostReplacements; val.minionSkinReplacements = skinDefInfo.MinionSkinReplacements; val.nameToken = skinDefInfo.NameToken; ((Object)val).name = skinDefInfo.Name; SkinDef.Awake -= new hook_Awake(DoNothing); return val; } 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_001d: 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) 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 WisadelMod.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 = null; public float sortPosition = 100f; public GameObject crosshair = null; public GameObject podPrefab = null; public float maxHealth = 100f; public float healthRegen = 1f; public float armor = 0f; public float shield = 0f; 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 = 0f; public float shieldGrowth = 0f; public float damageGrowth = 2.4f; public float attackSpeedGrowth = 0f; public float critGrowth = 0f; public float moveSpeedGrowth = 0f; public float jumpPowerGrowth = 0f; 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_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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ae: 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_0013: 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_0073: 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 WisadelMod.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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_011c: 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) ((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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, playbackRateParam); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (((EntityState)this).isAuthority && attack.Fire((List)null)) { OnHitEnemyAuthority(); } } private void EnterAttack() { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); PlaySwingEffect(); if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } public override void FixedUpdate() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.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_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (stopwatch >= duration * earlyExitPercentTime) { return (InterruptPriority)0; } return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } public void SetStep(int i) { swingIndex = i; } } public 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 WisadelMod.Modules.Achievements { public abstract class BaseMasteryAchievement : BaseAchievement { public abstract string RequiredCharacterBody { get; } public abstract float RequiredDifficultyCoefficient { get; } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex(RequiredCharacterBody); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)runReport.gameEnding) || !runReport.gameEnding.isWin) { return; } DifficultyIndex val = runReport.ruleBook.FindDifficulty(); DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val); if (difficultyDef != null) { bool flag = difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient; bool flag2 = difficultyDef.nameToken == "INFERNO_NAME"; bool flag3 = (int)val >= 3 && (int)val <= 10; if (flag || flag2 || flag3) { ((BaseAchievement)this).Grant(); } } } } } namespace WisadelMod.Survivors.Wisadel { public static class WisadelAI { public static void Init(GameObject bodyPrefab, string masterName) { //IL_003a: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) GameObject val = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName); BaseAI component = val.GetComponent(); component.aimVectorDampTime = 0.1f; component.aimVectorMaxSpeed = 360f; AISkillDriver val2 = val.AddComponent(); val2.customName = "Use Primary Swing"; val2.skillSlot = (SkillSlot)0; val2.requiredSkill = null; val2.requireSkillReady = false; val2.requireEquipmentReady = false; val2.minUserHealthFraction = float.NegativeInfinity; val2.maxUserHealthFraction = float.PositiveInfinity; val2.minTargetHealthFraction = float.NegativeInfinity; val2.maxTargetHealthFraction = float.PositiveInfinity; val2.minDistance = 0f; val2.maxDistance = 8f; val2.selectionRequiresTargetLoS = false; val2.selectionRequiresOnGround = false; val2.selectionRequiresAimTarget = false; val2.maxTimesSelected = -1; val2.moveTargetType = (TargetType)0; val2.activationRequiresTargetLoS = false; val2.activationRequiresAimTargetLoS = false; val2.activationRequiresAimConfirmation = false; val2.movementType = (MovementType)1; val2.moveInputScale = 1f; val2.aimType = (AimType)1; val2.ignoreNodeGraph = false; val2.shouldSprint = false; val2.shouldFireEquipment = false; val2.buttonPressType = (ButtonPressType)0; val2.driverUpdateTimerOverride = -1f; val2.resetCurrentEnemyOnNextDriverSelection = false; val2.noRepeat = false; val2.nextHighPriorityOverride = null; AISkillDriver val3 = val.AddComponent(); val3.customName = "Use Secondary Shoot"; val3.skillSlot = (SkillSlot)1; val3.requireSkillReady = true; val3.minDistance = 0f; val3.maxDistance = 25f; val3.selectionRequiresTargetLoS = false; val3.selectionRequiresOnGround = false; val3.selectionRequiresAimTarget = false; val3.maxTimesSelected = -1; val3.moveTargetType = (TargetType)0; val3.activationRequiresTargetLoS = false; val3.activationRequiresAimTargetLoS = false; val3.activationRequiresAimConfirmation = true; val3.movementType = (MovementType)1; val3.moveInputScale = 1f; val3.aimType = (AimType)1; val3.buttonPressType = (ButtonPressType)0; AISkillDriver val4 = val.AddComponent(); val4.customName = "Use Utility Roll"; val4.skillSlot = (SkillSlot)2; val4.requireSkillReady = true; val4.minDistance = 8f; val4.maxDistance = 20f; val4.selectionRequiresTargetLoS = true; val4.selectionRequiresOnGround = false; val4.selectionRequiresAimTarget = false; val4.maxTimesSelected = -1; val4.moveTargetType = (TargetType)0; val4.activationRequiresTargetLoS = false; val4.activationRequiresAimTargetLoS = false; val4.activationRequiresAimConfirmation = false; val4.movementType = (MovementType)2; val4.moveInputScale = 1f; val4.aimType = (AimType)1; val4.buttonPressType = (ButtonPressType)0; AISkillDriver val5 = val.AddComponent(); val5.customName = "Use Special bomb"; val5.skillSlot = (SkillSlot)3; val5.requireSkillReady = true; val5.minDistance = 0f; val5.maxDistance = 20f; val5.selectionRequiresTargetLoS = false; val5.selectionRequiresOnGround = false; val5.selectionRequiresAimTarget = false; val5.maxTimesSelected = -1; val5.moveTargetType = (TargetType)0; val5.activationRequiresTargetLoS = false; val5.activationRequiresAimTargetLoS = false; val5.activationRequiresAimConfirmation = false; val5.movementType = (MovementType)1; val5.moveInputScale = 1f; val5.aimType = (AimType)1; val5.buttonPressType = (ButtonPressType)0; AISkillDriver val6 = val.AddComponent(); val6.customName = "Chase"; val6.skillSlot = (SkillSlot)(-1); val6.requireSkillReady = false; val6.minDistance = 0f; val6.maxDistance = float.PositiveInfinity; val6.moveTargetType = (TargetType)0; val6.activationRequiresTargetLoS = false; val6.activationRequiresAimTargetLoS = false; val6.activationRequiresAimConfirmation = false; val6.movementType = (MovementType)1; val6.moveInputScale = 1f; val6.aimType = (AimType)1; val6.buttonPressType = (ButtonPressType)0; } } public static class WisadelAssets { public static GameObject swordSwingEffect; public static GameObject swordHitImpactEffect; public static GameObject bombExplosionEffect; public static NetworkSoundEventDef swordHitSoundEvent; public static GameObject bombProjectilePrefab; private static AssetBundle _assetBundle; public static void Init(AssetBundle assetBundle) { _assetBundle = assetBundle; CreateEffects(); CreateProjectiles(); } private static void CreateEffects() { } private static void CreateProjectiles() { } } public static class WisadelBuffs { public static BuffDef armorBuff; public static void Init(AssetBundle assetBundle) { } } public static class WisadelConfig { public static ConfigEntry someConfigBool; public static ConfigEntry someConfigFloat; public static ConfigEntry someConfigFloatWithCustomRange; public static void Init() { } } public class WisadelItemDisplays : ItemDisplaysBase { protected override void SetItemDisplayRules(List itemDisplayRules) { } } public static class WisadelStates { public static void Init() { } } public static class WisadelStaticValues { public const float primaryDamageCoeficient = 1.5f; public const float primaryExplosionRadius = 2.5f; public static GameObject primaryProjectile; public static GameObject primaryHitEffect; public const float bombDamageCoefficient = 5.5f; public const float bombExplosionRadius = 5.5f; public static float arcRaiseInitial = 5f; public static float arcRaiseFinal = 0f; public static float arcForwardInitial = 0f; public static float arcForwardFinal = 5f; public static float arcRaiseExp = 1f; public static float arcForwardExp = 1f; public static GameObject bombProjectile; public static GameObject bombExplosionEffect; public static GameObject smokeTrailEffect; public const float revShotCoefficient = 2f; public const float revRailgunCoefficient = 5f; public static GameObject revMuzzleEffect; public static GameObject revHitEffect; public static GameObject revBeamEffect; public static GameObject revBlitzBeamEffect; public static GameObject revDeathEffect; public const float specialDamageCoefficient = 20f; public const float specialExplosionRadius = 20f; public static SkillDef primaryOverride; public static SkillDef secondaryOverride; public static SkillDef utilityOverride; public static GameObject specialProjectile; public static GameObject specialHitEffect; public const float markDamageMultiplier = 1.5f; public const float markDuration = 20f; public const float detonateDamageMultiplier = 3f; public const float detonateChance = 15f; public const float detonateRadius = 6f; public const float detonateDawnRadius = 15f; public static BuffDef markDebuff; public static GameObject markVisual; public static GameObject markDetonateEffect; public static GameObject markDetonateDawnEffect; public static void FireBomb(BaseSkillState state) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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) if (((EntityState)state).isAuthority && !((Object)(object)bombProjectile == (Object)null)) { Ray aimRay = ((BaseState)state).GetAimRay(); ProjectileManager.instance.FireProjectile(bombProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)state).gameObject, ((BaseState)state).damageStat * 5.5f, 1f, Util.CheckRoll(((BaseState)state).critStat, ((EntityState)state).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); Util.PlaySound("Play_Throw", ((Component)((EntityState)state).characterBody).gameObject); } } public static void AddMarkTo(CharacterBody victim, CharacterBody attacker) { //IL_0019: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)victim == (Object)null) && (TeamIndex?)victim.teamComponent.teamIndex != ((attacker != null) ? new TeamIndex?(attacker.teamComponent.teamIndex) : ((TeamIndex?)null))) { bool flag = victim.HasBuff(markDebuff); victim.AddTimedBuff(markDebuff, 20f); if (!flag) { Transform transform = ((Component)victim).gameObject.transform; GameObject val = Object.Instantiate(markVisual, transform.position, transform.rotation); val.transform.SetParent(transform); TemporaryVisualEffect component = val.GetComponent(); component.healthComponent = ((Component)victim).GetComponent(); component.parentTransform = victim.coreTransform; component.visualState = (VisualState)0; component.radius = victim.radius; } } } } public static class WisadelTokens { private static string markHex = "#9e2010"; private static string specialHex = "#bf2eac"; public static void Init() { AddWisadelTokens(); } public static void AddWisadelTokens() { string text = "XPOLARZIDE_WISADEL_"; string text2 = "She LOVES hearing people call her brand spanking new name! " + Environment.NewLine; string text3 = "..and so she left, her craving for destruction temporarily satiated."; string text4 = "..and so she left, embracing obliteration."; Language.Add(text + "NAME", "Wis'adel"); Language.Add(text + "DESCRIPTION", text2); Language.Add(text + "SUBTITLE", "The Arsonist"); Language.Add(text + "LORE", "How did we get here?"); Language.Add(text + "OUTRO_FLAVOR", text3); Language.Add(text + "OUTRO_FAILURE", text4); Language.Add(text + "MASTERY_SKIN_NAME", "Alternate"); Language.Add(text + "PASSIVE_NAME", "Shadow's Mark"); Language.Add(text + "PASSIVE_DESCRIPTION", $"Shadow's Mark can be applied to enemies and has a {15f}% chance to detonate for {150f}% TOTAL damage when hit."); Language.Add(text + "SKILL_DOUBLETAP_NAME", "Double Tap"); Language.Add(text + "SKILL_DOUBLETAP_DESCRIPTION", $"Fire two small AOE projectiles that deal {150f}% damage each."); Language.Add(text + "SKILL_DOUBLETAP_ALT", $"AssaultFire high-powered explosive shots that deal {2000f}% damage, which always detonates Shadow's Mark."); Language.Add(text + "SKILL_REVENANT_NAME", "Shadow of Revenant"); Language.Add(text + "SKILL_REVENANT_DESCRIPTION", "Place a sturdy monolith that fires at enemies and applies Shadow's Mark. [Backup Magazine] increases monolith attack speed."); Language.Add(text + "SKILL_REVENANT_ALT", "AssaultGain 1 stock. Monoliths no longer attack independently, but coordinate their attacks with Wis'adel."); Language.Add(text + "SKILL_BOMB_NAME", "Bomb and Weave"); Language.Add(text + "SKILL_BOMB_DESCRIPTION", $"Perform an evasive maneuver while throwing a bomb that deals {550f}% damage and applies Shadow's Mark."); Language.Add(text + "SKILL_BOMB_ALT", "AssaultEjects three bombs instead of one."); Language.Add(text + "SKILL_DAWN_NAME", "Explosive Dawn"); Language.Add(text + "SKILL_DAWN_DESCRIPTION", "Enter Assault state. "); Language.Add(text + "REVENANT_SHOOT_NAME", "Revenant's Touch"); Language.Add(text + "REVENANT_SHOOT_DESCRIPTION", $"Fires a ray dealing {200f}% damage that applies Shadow's Mark."); Language.Add(Tokens.GetAchievementNameToken("XPOLARZIDE_WISADEL_masteryAchievement"), "Wisadel: Mastery"); Language.Add(Tokens.GetAchievementDescriptionToken("XPOLARZIDE_WISADEL_masteryAchievement"), "As Wisadel, beat the game or obliterate on Monsoon."); } } public static class WisadelUnlockables { public static UnlockableDef characterUnlockableDef; public static UnlockableDef masterySkinUnlockableDef; public static void Init() { masterySkinUnlockableDef = Content.CreateAndAddUnlockbleDef("XPOLARZIDE_WISADEL_masteryUnlockable", Tokens.GetAchievementNameToken("XPOLARZIDE_WISADEL_masteryAchievement"), CharacterBase.instance.assetBundle.LoadAsset("texMasteryAchievement")); } } public class WisadelSurvivor : SurvivorBase { public const string WISADEL_PREFIX = "XPOLARZIDE_WISADEL_"; public override string assetBundleName => "wisadelbundle"; public override string bodyName => "WisadelBody"; public override string masterName => "WisadelMonsterMaster"; public override string modelPrefabName => "mdlWisadel"; public override string displayPrefabName => "mdlWisadelMenu"; public override string survivorTokenPrefix => "XPOLARZIDE_WISADEL_"; public override BodyInfo bodyInfo => new BodyInfo { bodyName = bodyName, bodyNameToken = "XPOLARZIDE_WISADEL_NAME", subtitleNameToken = "XPOLARZIDE_WISADEL_SUBTITLE", characterPortrait = assetBundle.LoadAsset("texWisadelIcon"), bodyColor = Color.red, sortPosition = 100f, crosshair = Asset.LoadCrosshair("Standard"), podPrefab = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/SurvivorPod"), maxHealth = 110f, healthRegen = 1.5f, armor = 5f, jumpCount = 1 }; public override CustomRendererInfo[] customRendererInfos => new CustomRendererInfo[5] { new CustomRendererInfo { childName = "BodyModel", material = assetBundle.LoadMaterial("matWisadel") }, new CustomRendererInfo { childName = "GunChamberModel", material = assetBundle.LoadMaterial("matGuns") }, new CustomRendererInfo { childName = "GunPistolModel", material = assetBundle.LoadMaterial("matGuns") }, new CustomRendererInfo { childName = "GunMagModel", material = assetBundle.LoadMaterial("matGuns") }, new CustomRendererInfo { childName = "GunStockModel", material = assetBundle.LoadMaterial("matGuns") } }; public override UnlockableDef characterUnlockableDef => WisadelUnlockables.characterUnlockableDef; public override ItemDisplaysBase itemDisplays => new WisadelItemDisplays(); 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 Initialize() { base.Initialize(); } public override void InitializeCharacter() { WisadelUnlockables.Init(); base.InitializeCharacter(); WisadelConfig.Init(); WisadelStates.Init(); WisadelTokens.Init(); WisadelAssets.Init(assetBundle); WisadelBuffs.Init(assetBundle); InitializeEntityStateMachines(); InitializeSkills(); InitializeSkins(); InitializeCharacterMaster(); InitializeBuffs(); InitializeEffects(); InitializePrimaryProjectile(); InitializeUtilityProjectile(); InitializeSpecialProjectile(); InitializeRevenantBlueprint(); InitializeRevenantMaster(); InitializeRevenantBody(); AdditionalBodySetup(); AddHooks(); } private void InitializeBuffs() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = "RevenantMark"; val.buffColor = Color.white; val.canStack = false; val.isDebuff = true; val.iconSprite = assetBundle.LoadAsset("texPassiveIcon"); Content.AddBuffDef(val); WisadelStaticValues.markDebuff = val; } private void InitializeEffects() { WisadelStaticValues.markDetonateEffect = SetupEffect("MarkDetonateEffect", timedDestroy: true, 1f, 6f); WisadelStaticValues.markDetonateDawnEffect = SetupEffect("MarkDetonateDawnEffect", timedDestroy: true, 1f, 15f); WisadelStaticValues.primaryHitEffect = SetupEffect("BulletHitEffect", timedDestroy: true, 1f, 2.5f); WisadelStaticValues.specialHitEffect = SetupEffect("BulletHitBlitzEffect", timedDestroy: true, 2f, 20f, "Play_BlitzHit"); WisadelStaticValues.bombExplosionEffect = SetupEffect("BombExplosionEffect", timedDestroy: true, 2f, 5.5f, "Play_BombExplosion"); WisadelStaticValues.smokeTrailEffect = SetupEffect("SmokeTrailEffect"); WisadelStaticValues.revHitEffect = SetupEffect("RevHitEffect", timedDestroy: true); WisadelStaticValues.revMuzzleEffect = SetupEffect("RevMuzzleEffect", timedDestroy: true); WisadelStaticValues.revBeamEffect = SetupEffect("RevBeamEffect", timedDestroy: true, 2f); WisadelStaticValues.revBlitzBeamEffect = SetupEffect("RevBeamBlitzEffect", timedDestroy: true, 2f); WisadelStaticValues.revDeathEffect = SetupEffect("RevDeathEffect", timedDestroy: true, 2f); ApplyShakeTo(WisadelStaticValues.bombExplosionEffect, 27.5f, 1f, 40f, 0.5f); ApplyShakeTo(WisadelStaticValues.specialHitEffect, 100f, 1.5f, 50f, 0.75f); ApplyLightDecayTo(((Component)WisadelStaticValues.specialHitEffect.transform.GetChild(4)).gameObject, 1f); WisadelStaticValues.revBeamEffect.AddComponent(); WisadelStaticValues.revBlitzBeamEffect.AddComponent(); EmitForATime emitForATime = WisadelStaticValues.smokeTrailEffect.AddComponent(); emitForATime.duration = 0.5f; GameObject val = PrefabAPI.InstantiateClone(assetBundle.LoadAsset("MarkIndicatorEffect"), "MarkIndicatorEffect", false); val.AddComponent(); val.AddComponent(); TemporaryVisualEffect val2 = val.AddComponent(); GameObject gameObject = ((Component)val.transform.GetChild(0)).gameObject; val2.visualTransform = gameObject.transform; RotateAroundAxis val3 = gameObject.AddComponent(); val3.speed = (Speed)1; val3.slowRotationSpeed = 180f; val3.fastRotationSpeed = 360f; WisadelStaticValues.markVisual = val; } private GameObject SetupEffect(string assetKey, bool timedDestroy = false, float lifetime = 1f, float radius = -1f, string sound = "", bool parent = false) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) GameObject val = assetBundle.LoadAsset(assetKey); if ((Object)(object)val == (Object)null) { Debug.LogError((object)("SetupEffect(): Asset Key '" + assetKey + "' doesn't exist.")); return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, assetKey, false); EffectComponent val3 = val2.AddComponent(); if (timedDestroy) { DestroyOnTimer val4 = val2.AddComponent(); val4.SetDuration(lifetime); } if (radius > 0f) { float num = radius * 0.1f; val2.transform.localScale = new Vector3(num, num, num); } if (sound != "") { val3.soundName = sound; } if (parent) { val3.parentToReferencedTransform = true; val3.positionAtReferencedTransform = true; } Content.CreateAndAddEffectDef(val2); return val2; } private void ApplyShakeTo(GameObject obj, float radius, float amplitude, float frequency, float duration = 0.15f) { ShakeEmitter val = obj.AddComponent(); val.wave.amplitude = amplitude; val.wave.frequency = frequency; val.radius = radius; val.duration = duration; } private void ApplyLightDecayTo(GameObject obj, float time) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown LightIntensityCurve val = obj.AddComponent(); AnimationCurve val2 = new AnimationCurve(); val2.AddKey(0f, 1f); val2.AddKey(1f, 0f); val.curve = val2; val.timeMax = time; } private void InitializePrimaryProjectile() { //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_00b7: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(assetBundle.LoadAsset("BulletGhost"), "BulletGhost", false); val.AddComponent(); DetachTrailOnDestroy val2 = val.AddComponent(); val2.targetTrailRenderers = val.GetComponentsInChildren(); GameObject val3 = Addressables.LoadAssetAsync((object)"RoR2/Base/Mage/MageFireboltBasic.prefab").WaitForCompletion(); GameObject val4 = PrefabAPI.InstantiateClone(val3, "WisadelProjectile"); ProjectileController component = val4.GetComponent(); component.ghostPrefab = val; ProjectileSimple component2 = val4.GetComponent(); component2.lifetime = 2.5f; component2.desiredForwardSpeed = 80f; ProjectileImpactExplosion component3 = val4.GetComponent(); component3.impactEffect = WisadelStaticValues.primaryHitEffect; ((ProjectileExplosion)component3).blastRadius = 2.5f; ProjectileDamage component4 = val4.GetComponent(); component4.damageType.damageType = (DamageType)0; WisadelStaticValues.primaryProjectile = val4; } private void InitializeSpecialProjectile() { //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_00b7: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(assetBundle.LoadAsset("BulletGhostBlitz"), "BulletGhostBlitz", false); val.AddComponent(); DetachTrailOnDestroy val2 = val.AddComponent(); val2.targetTrailRenderers = val.GetComponentsInChildren(); GameObject val3 = Addressables.LoadAssetAsync((object)"RoR2/Base/Mage/MageFireboltBasic.prefab").WaitForCompletion(); GameObject val4 = PrefabAPI.InstantiateClone(val3, "WisadelBlitzProjectile"); ProjectileController component = val4.GetComponent(); component.ghostPrefab = val; ProjectileSimple component2 = val4.GetComponent(); component2.lifetime = 2.5f; component2.desiredForwardSpeed = 80f; ProjectileImpactExplosion component3 = val4.GetComponent(); component3.impactEffect = WisadelStaticValues.specialHitEffect; ((ProjectileExplosion)component3).blastRadius = 20f; ProjectileDamage component4 = val4.GetComponent(); component4.damageType.damageType = (DamageType)0; SphereCollider componentInChildren = val4.GetComponentInChildren(); componentInChildren.radius = 1f; WisadelStaticValues.specialProjectile = val4; } private void InitializeUtilityProjectile() { //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) GameObject val = PrefabAPI.InstantiateClone(assetBundle.LoadAsset("BombGhost"), "BombGhost", false); val.AddComponent(); GameObject val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion(); GameObject val3 = PrefabAPI.InstantiateClone(val2, "WisadelBomb"); ProjectileController component = val3.GetComponent(); component.ghostPrefab = val; ProjectileImpactExplosion component2 = val3.GetComponent(); component2.impactEffect = WisadelStaticValues.bombExplosionEffect; ((ProjectileExplosion)component2).SetExplosionRadius(5.5f); val3.AddComponent(); WisadelStaticValues.bombProjectile = val3; } private void InitializeRevenantBlueprint() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiTurretBlueprints.prefab").WaitForCompletion(); GameObject val2 = (ShadowOfRevenant.blueprintPrefab = PrefabAPI.InstantiateClone(val, "RevenantBlueprint", false)); GameObject val3 = null; foreach (Transform item in val2.transform) { Transform val4 = item; if (((Object)((Component)val4).gameObject).name == "mdlEngiTurret (1)") { val3 = ((Component)val4).gameObject; } } if ((Object)(object)val3 != (Object)null) { Object.Destroy((Object)(object)val3); } GameObject val5 = PrefabAPI.InstantiateClone(assetBundle.LoadAsset("RevenantModel"), "Revenant Model", false); val5.transform.SetParent(val2.transform); val5.transform.localPosition = Vector3.zero; val2.GetComponent().renderers[0] = (Renderer)(object)((Component)val5.transform.GetChild(0)).GetComponent(); } private void InitializeRevenantMaster() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiTurretMaster.prefab").WaitForCompletion(); GameObject val2 = (ShadowOfRevenant.turretMasterPrefab = PrefabAPI.InstantiateClone(val, "RevenantMaster")); Content.AddMasterPrefab(val2); BaseAI component = val2.GetComponent(); component.aimVectorDampTime = 0f; component.aimVectorMaxSpeed = 100000f; AISkillDriver val3 = val2.GetComponents()[0]; val3.maxDistance = 80f; ((Behaviour)val3).enabled = false; AISkillDriver val4 = val2.GetComponents()[1]; val4.moveTargetType = (TargetType)0; } private void InitializeRevenantBody() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Expected O, but got Unknown //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiTurretBody.prefab").WaitForCompletion(); GameObject val2 = PrefabAPI.InstantiateClone(val, "RevenantBody"); ShadowOfRevenant.turretMasterPrefab.GetComponent().bodyPrefab = val2; Content.AddCharacterBodyPrefab(val2); ((Object)val2).name = "RevenantBody"; val2.AddComponent(); CharacterBody component = val2.GetComponent(); component.baseNameToken = "XPOLARZIDE_WISADEL_SKILL_REVENANT_NAME"; component.bodyFlags = (BodyFlags)0; component.baseMaxHealth = 300f; component.baseDamage = 16f; component.levelMaxHealth = 80f; component.levelDamage = 5f; component.alwaysAim = true; component.portraitIcon = assetBundle.LoadAsset("texRevenantIcon"); component.aimOriginTransform.Translate(new Vector3(0f, 2.5f, 0f)); ModelLocator component2 = val2.GetComponent(); component2.noCorpse = true; EntityStateMachine component3 = val2.GetComponent(); ((SerializableEntityStateType)(ref component3.initialStateType)).typeName = "EntityStates.GenericCharacterMain"; Object.Destroy((Object)(object)val2.GetComponents()[1]); CharacterDeathBehavior component4 = val2.GetComponent(); component4.deathStateMachine = component3; component4.deathState = new SerializableEntityStateType(typeof(RevDeath)); component4.idleStateMachine = (EntityStateMachine[])(object)new EntityStateMachine[0]; NetworkStateMachine component5 = val2.GetComponent(); component5.stateMachines = (EntityStateMachine[])(object)new EntityStateMachine[1] { component3 }; CapsuleCollider component6 = val2.GetComponent(); component6.center = new Vector3(0f, 0.1f, 0f); component6.height = 3.6f; component6.radius = 1f; Deployable component7 = val2.GetComponent(); HealthComponent hc = val2.GetComponent(); component7.onUndeploy.AddListener((UnityAction)delegate { //IL_000a: 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) hc.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); }); Object.Destroy((Object)(object)val2.GetComponent()); SfxLocator component8 = val2.GetComponent(); component8.deathSound = "Play_RevDestroy"; Object.Destroy((Object)(object)val2.GetComponent()); Object.Destroy((Object)(object)val2.GetComponent()); Skills.ClearGenericSkills(val2); Skills.CreateGenericSkillWithSkillFamily(val2, (SkillSlot)0); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "RevenantShoot"; skillDefInfo.skillNameToken = "XPOLARZIDE_WISADEL_REVENANT_SHOOT_NAME"; skillDefInfo.skillDescriptionToken = "XPOLARZIDE_WISADEL_REVENANT_SHOOT_DESCRIPTION"; skillDefInfo.skillIcon = assetBundle.LoadAsset("texPrimaryIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(RevShoot)); skillDefInfo.activationStateMachineName = "Body"; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.baseRechargeInterval = 4f; skillDefInfo.attackSpeedBuffsRestockSpeed = true; SkillDef val3 = Skills.CreateSkillDef(skillDefInfo); Skills.AddPrimarySkills(val2, val3); val2.GetComponent().primary.rechargeStopwatch = 0f; Transform child = val2.transform.GetChild(0).GetChild(0); Object.Destroy((Object)(object)((Component)child.GetChild(1)).gameObject); Object.Destroy((Object)(object)((Component)child.GetChild(2)).gameObject); GameObject val4 = PrefabAPI.InstantiateClone(assetBundle.LoadAsset("RevenantModel"), "Revenant Model", false); val4.transform.SetParent(child); val4.transform.localPosition = Vector3.zero; GameObject gameObject = ((Component)child.GetChild(0)).gameObject; gameObject.transform.position = ((Component)val4.GetComponent().FindChild("Peak")).transform.position; GameObject val5 = new GameObject("Hurtbox"); val5.transform.SetParent(child, false); BoxCollider val6 = val5.AddComponent(); val6.center = new Vector3(0f, 2f, 0f); val6.size = new Vector3(2.5f, 4f, 2.5f); HurtBox val7 = val5.AddComponent(); val7.healthComponent = hc; val7.isBullseye = true; val5.layer = LayerMask.NameToLayer("EntityPrecise"); val5.AddComponent(); Object.Destroy((Object)(object)((Component)child).GetComponent()); Object.Destroy((Object)(object)((Component)child).GetComponent()); Object.Destroy((Object)(object)((Component)child).GetComponent()); CharacterModel component9 = ((Component)child).GetComponent(); component9.itemDisplayRuleSet = null; HurtBoxGroup component10 = ((Component)child).GetComponent(); component10.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val7 }; component10.mainHurtBox = val7; ModelSkinController component11 = ((Component)child).GetComponent(); component11.skins = (SkinDef[])(object)new SkinDef[0]; } public static void Load(string guid, Action callback) where T : Object { //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) AssetReferenceT val = new AssetReferenceT(guid); AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle handle) { callback(handle.Result); }; } private void AdditionalBodySetup() { AddHitboxes(); bodyPrefab.AddComponent(); Transform val = ((Component)prefabCharacterBody).GetComponent().modelChildLocator.FindChild("Wings"); ParticleSystemActivator particleSystemActivator = ((Component)val).gameObject.AddComponent(); particleSystemActivator.activeOnAwake = false; ParticleSystem[] array = (ParticleSystem[])(object)new ParticleSystem[val.childCount]; for (int i = 0; i < val.childCount; i++) { array[i] = ((Component)val.GetChild(i)).GetComponent(); } particleSystemActivator.particleSystems = array; CharacterDirection component = bodyPrefab.GetComponent(); component.turnSpeed = 1440f; } public void AddHitboxes() { } public override void InitializeEntityStateMachines() { Prefabs.ClearEntityStateMachines(bodyPrefab); Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(GenericCharacterMain), typeof(SpawnTeleporterState)); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon"); Prefabs.AddEntityStateMachine(bodyPrefab, "Dawn"); } public override void InitializeSkills() { Skills.ClearGenericSkills(bodyPrefab); AddPassiveSkill(); AddEntityStates(); AddPrimarySkills(); AddSecondarySkills(); AddUtiitySkills(); AddSpecialSkills(); } private void AddEntityStates() { Content.AddEntityState(typeof(DoubleTap)); Content.AddEntityState(typeof(Blitz)); Content.AddEntityState(typeof(ShadowOfRevenant)); Content.AddEntityState(typeof(RevShoot)); Content.AddEntityState(typeof(RevDeath)); Content.AddEntityState(typeof(BombAndWeave)); Content.AddEntityState(typeof(BlitzAndWeave)); Content.AddEntityState(typeof(ExplosiveDawn)); } private void AddPassiveSkill() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) bodyPrefab.GetComponent().passiveSkill = new PassiveSkill { enabled = true, skillNameToken = "XPOLARZIDE_WISADEL_PASSIVE_NAME", skillDescriptionToken = "XPOLARZIDE_WISADEL_PASSIVE_DESCRIPTION", icon = assetBundle.LoadAsset("texPassiveIcon") }; } private void AddPrimarySkills() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)0); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "WisadelDoubleTap"; skillDefInfo.skillNameToken = "XPOLARZIDE_WISADEL_SKILL_DOUBLETAP_NAME"; skillDefInfo.skillDescriptionToken = "XPOLARZIDE_WISADEL_SKILL_DOUBLETAP_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "XPOLARZIDE_WISADEL_SKILL_DOUBLETAP_ALT" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("texPrimaryIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(DoubleTap)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.interruptPriority = (InterruptPriority)0; skillDefInfo.baseRechargeInterval = 0f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddPrimarySkills(bodyPrefab, val); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "WisadelBlitz"; skillDefInfo.skillNameToken = "XPOLARZIDE_WISADEL_SKILL_BLITZ_NAME"; skillDefInfo.skillDescriptionToken = "XPOLARZIDE_WISADEL_SKILL_BLITZ_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("texPrimaryIcon2"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(Blitz)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.baseRechargeInterval = float.PositiveInfinity; skillDefInfo.baseMaxStock = 5; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef primaryOverride = Skills.CreateSkillDef(skillDefInfo); WisadelStaticValues.primaryOverride = primaryOverride; } private void AddSecondarySkills() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)1); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "WisadelShadowOfRevenant"; skillDefInfo.skillNameToken = "XPOLARZIDE_WISADEL_SKILL_REVENANT_NAME"; skillDefInfo.skillDescriptionToken = "XPOLARZIDE_WISADEL_SKILL_REVENANT_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "XPOLARZIDE_WISADEL_SKILL_REVENANT_ALT" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("texSecondaryIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ShadowOfRevenant)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.baseRechargeInterval = 30f; skillDefInfo.baseMaxStock = 2; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 0; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = true; skillDefInfo.mustKeyPress = true; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddSecondarySkills(bodyPrefab, val); SkillDef val2 = Object.Instantiate(val); val2.icon = assetBundle.LoadAsset("texSecondaryIcon2"); WisadelStaticValues.secondaryOverride = val2; } private void AddUtiitySkills() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)2); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "WisadelBombAndWeave"; skillDefInfo.skillNameToken = "XPOLARZIDE_WISADEL_SKILL_BOMB_NAME"; skillDefInfo.skillDescriptionToken = "XPOLARZIDE_WISADEL_SKILL_BOMB_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "XPOLARZIDE_WISADEL_SKILL_BOMB_ALT" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("texUtilityIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(BombAndWeave)); skillDefInfo.activationStateMachineName = "Body"; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.baseRechargeInterval = 6f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = true; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddUtilitySkills(bodyPrefab, val); SkillDef val2 = Object.Instantiate(val); val2.icon = assetBundle.LoadAsset("texUtilityIcon2"); val2.activationState = new SerializableEntityStateType(typeof(BlitzAndWeave)); WisadelStaticValues.utilityOverride = val2; } private void AddSpecialSkills() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)3); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "WisadelExplosiveDawn"; skillDefInfo.skillNameToken = "XPOLARZIDE_WISADEL_SKILL_DAWN_NAME"; skillDefInfo.skillDescriptionToken = "XPOLARZIDE_WISADEL_SKILL_DAWN_DESCRIPTION"; skillDefInfo.skillIcon = assetBundle.LoadAsset("texSpecialIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ExplosiveDawn)); skillDefInfo.activationStateMachineName = "Dawn"; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 30f; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = true; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddSpecialSkills(bodyPrefab, val); } public override void InitializeSkins() { ModelSkinController val = ((Component)prefabCharacterModel).gameObject.AddComponent(); ChildLocator component = ((Component)prefabCharacterModel).GetComponent(); RendererInfo[] baseRendererInfos = prefabCharacterModel.baseRendererInfos; List list = new List(); SkinDef item = Skins.CreateSkinDef("DEFAULT_SKIN", assetBundle.LoadAsset("texMainSkin"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject); list.Add(item); val.skins = list.ToArray(); } public override void InitializeCharacterMaster() { WisadelAI.Init(bodyPrefab, masterName); } private void AddHooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(OnRecalculateStats); GlobalEventManager.onServerDamageDealt += OnServerDamageDealt; } private static void OnServerDamageDealt(DamageReport damageReport) { CharacterBody attackerBody = damageReport.attackerBody; CharacterBody victimBody = damageReport.victimBody; if (!((Object)(object)attackerBody == (Object)null) && !((Object)(object)victimBody == (Object)null)) { WisadelComponent component = ((Component)attackerBody).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.OnDamageDealt(damageReport); } } } private static void OnRecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if ((Object)(object)((Component)self).GetComponent() != (Object)null) { self.skillLocator.secondaryBonusStockSkill.SetBonusStockFromBody(0); } } } } namespace WisadelMod.Survivors.Wisadel.SkillStates { public class Blitz : BaseSkillState { public static float damageCoefficient = 20f; public static float procCoefficient = 1f; public static float baseDuration = 2f; public static float followupDelay = 0.1f; public static float force = 800f; public static float recoil = 3f; public static float range = 256f; private float duration; private bool firedFirst; private WisadelComponent wisadelComponent; public override void OnEnter() { ((BaseState)this).OnEnter(); wisadelComponent = ((Component)((EntityState)this).characterBody).GetComponent(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(2f); ((EntityState)this).PlayAnimation("Rifle", "RifleShoot", "Attack.playbackrate", 1f, 0f); Util.PlaySound("Play_BlitzShoot", ((EntityState)this).gameObject); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!firedFirst) { FireProjectile(); firedFirst = true; } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void FireProjectile() { //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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); Quaternion val = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction); RaycastHit val3 = default(RaycastHit); Vector3 position = ((!Util.CharacterRaycast(((EntityState)this).gameObject, val2, ref val3, 10000f, LayerMask.op_Implicit(LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)), (QueryTriggerInteraction)0)) ? (((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 10000f) : ((RaycastHit)(ref val3)).point); wisadelComponent.CoordinateAttack(position); ProjectileManager.instance.FireProjectile(WisadelStaticValues.specialProjectile, ((Ray)(ref aimRay)).origin, val, ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class BlitzAndWeave : BaseSkillState { public static float duration = 0.5f; public static float arcRaiseInitial = WisadelStaticValues.arcRaiseInitial; public static float arcRaiseFinal = WisadelStaticValues.arcRaiseFinal; public static float arcForwardInitial = WisadelStaticValues.arcForwardInitial; public static float arcForwardFinal = WisadelStaticValues.arcForwardFinal; public static float arcRaiseExp = WisadelStaticValues.arcRaiseExp; public static float arcForwardExp = WisadelStaticValues.arcForwardExp; public static float dodgeFOV = DodgeState.dodgeFOV; private Vector3 forwardDirection; private Vector3 raiseDirection; private Vector3 attackPos; private bool backwards; private int shotsFired; private Animator animator; public override void OnEnter() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Expected O, but got Unknown //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); shotsFired = 0; Vector3 val = (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) ? ((EntityState)this).inputBank.aimDirection : ((EntityState)this).transform.forward); val.y = 0f; ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = Vector3.zero; if (((EntityState)this).isAuthority && (Object)(object)((EntityState)this).inputBank != (Object)null) { val3 = ((EntityState)this).inputBank.moveVector; } float num = Vector3.Dot(val3, val); float num2 = Vector3.Dot(val3, normalized); if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { num = 1f; } backwards = num < 0f; forwardDirection = (backwards ? (-val) : val); raiseDirection = Vector3.up; if (Mathf.Abs(num2) > 0.01f) { float num3 = num2 * -90f; raiseDirection = Quaternion.AngleAxis(num3, val) * Vector3.up; } if (backwards) { raiseDirection.y = 0f; } Ray aimRay = ((BaseState)this).GetAimRay(); attackPos = ((Ray)(ref aimRay)).origin + val * ((arcForwardInitial + arcForwardFinal) / 2f) * ((BaseState)this).moveSpeedStat * duration; string text = "DashLeft"; if ((num2 > 0f && num >= 0f) || (num2 < 0f && num < 0f)) { text = "DashRight"; } ((EntityState)this).PlayAnimation("Dash", text); Util.PlaySound("Play_Dash", ((EntityState)this).gameObject); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f * duration); } EffectData val4 = new EffectData { origin = ((Component)((EntityState)this).characterBody.mainHurtBox).transform.position, rotation = ((Component)((EntityState)this).characterBody.mainHurtBox).transform.rotation }; GameObject gameObject = ((Component)EffectManager.GetAndActivatePooledEffect(WisadelStaticValues.smokeTrailEffect, val4.origin, val4.rotation)).gameObject; gameObject.transform.SetParent(((Component)((EntityState)this).characterBody.mainHurtBox).transform, true); } private void FireProjectile() { if (((EntityState)this).isAuthority && !((Object)(object)WisadelStaticValues.bombProjectile == (Object)null)) { WisadelStaticValues.FireBomb((BaseSkillState)(object)this); shotsFired++; } } public override void FixedUpdate() { //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = ((EntityState)this).fixedAge / duration; if (shotsFired == 0 && num >= 0f) { FireProjectile(); } if (shotsFired == 1 && num >= 0.5f) { FireProjectile(); } if (shotsFired == 2 && num >= 1f) { FireProjectile(); } float num2 = Mathf.Clamp01(((EntityState)this).fixedAge / duration); float num3 = Mathf.Pow(num2, arcRaiseExp); float num4 = Mathf.Pow(num2, arcForwardExp); Vector3 val; if (backwards) { float num5 = Mathf.Pow(1f - num2, arcForwardExp); float num6 = Mathf.Lerp(arcForwardInitial, arcForwardFinal, num5); val = (forwardDirection + raiseDirection) * num6; } else { float num6 = Mathf.Lerp(arcForwardInitial, arcForwardFinal, num4); float num7 = Mathf.Lerp(arcRaiseInitial, arcRaiseFinal, num3); val = forwardDirection * num6 + raiseDirection * num7; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = ((BaseState)this).moveSpeedStat * val; } if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, num2); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = -1f; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; } ((EntityState)this).OnExit(); } public override void OnSerialize(NetworkWriter writer) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(forwardDirection); writer.Write(raiseDirection); } public override void OnDeserialize(NetworkReader reader) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); forwardDirection = reader.ReadVector3(); raiseDirection = reader.ReadVector3(); } } public class BombAndWeave : BaseSkillState { public static float duration = 0.5f; public static float arcRaiseInitial = WisadelStaticValues.arcRaiseInitial; public static float arcRaiseFinal = WisadelStaticValues.arcRaiseFinal; public static float arcForwardInitial = WisadelStaticValues.arcForwardInitial; public static float arcForwardFinal = WisadelStaticValues.arcForwardFinal; public static float arcRaiseExp = WisadelStaticValues.arcRaiseExp; public static float arcForwardExp = WisadelStaticValues.arcForwardExp; public static float dodgeFOV = DodgeState.dodgeFOV; private Vector3 forwardDirection; private Vector3 raiseDirection; private bool backwards; public override void OnEnter() { //IL_0028: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_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_00cb: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Vector3 val = (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) ? ((EntityState)this).inputBank.aimDirection : ((EntityState)this).transform.forward); val.y = 0f; ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = Vector3.zero; if (((EntityState)this).isAuthority && (Object)(object)((EntityState)this).inputBank != (Object)null) { val3 = ((EntityState)this).inputBank.moveVector; } float num = Vector3.Dot(val3, val); float num2 = Vector3.Dot(val3, normalized); if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { num = 1f; } backwards = num < 0f; forwardDirection = (backwards ? (-val) : val); raiseDirection = Vector3.up; if (Mathf.Abs(num2) > 0.01f) { float num3 = num2 * -90f; raiseDirection = Quaternion.AngleAxis(num3, val) * Vector3.up; } if (backwards) { raiseDirection.y = 0f; } WisadelStaticValues.FireBomb((BaseSkillState)(object)this); string text = "DashLeft"; if ((num2 > 0f && num >= 0f) || (num2 < 0f && num < 0f)) { text = "DashRight"; } ((EntityState)this).PlayAnimation("Dash", text); Util.PlaySound("Play_Dash", ((EntityState)this).gameObject); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f * duration); } EffectData val4 = new EffectData { origin = ((Component)((EntityState)this).characterBody.mainHurtBox).transform.position, rotation = ((Component)((EntityState)this).characterBody.mainHurtBox).transform.rotation }; GameObject gameObject = ((Component)EffectManager.GetAndActivatePooledEffect(WisadelStaticValues.smokeTrailEffect, val4.origin, val4.rotation)).gameObject; gameObject.transform.SetParent(((Component)((EntityState)this).characterBody.mainHurtBox).transform, true); } public override void FixedUpdate() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_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_008d: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = Mathf.Clamp01(((EntityState)this).fixedAge / duration); float num2 = Mathf.Pow(num, arcRaiseExp); float num3 = Mathf.Pow(num, arcForwardExp); float num4 = Mathf.Lerp(arcForwardInitial, arcForwardFinal, num3); float num5 = Mathf.Lerp(arcRaiseInitial, arcRaiseFinal, num2); Vector3 val = default(Vector3); if (backwards) { val.y = 0f; } val = forwardDirection * num4 + raiseDirection * num5; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = ((BaseState)this).moveSpeedStat * val; } Transform modelBaseTransform = ((EntityState)this).modelLocator.modelBaseTransform; if (((Vector3)(ref val)).sqrMagnitude > 0.001f) { modelBaseTransform.forward = ((Vector3)(ref val)).normalized; } if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, num); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = -1f; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; } ((EntityState)this).OnExit(); } public override void OnSerialize(NetworkWriter writer) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(forwardDirection); writer.Write(raiseDirection); } public override void OnDeserialize(NetworkReader reader) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); forwardDirection = reader.ReadVector3(); raiseDirection = reader.ReadVector3(); } } public class DoubleTap : BaseSkillState { public static float damageCoefficient = 1.5f; public static float procCoefficient = 1f; public static float baseDuration = 1f; public static float effectiveDuration = 0.6f; public static float followupDelay = 0.1f; public static GameObject projectilePrefab = WisadelStaticValues.primaryProjectile; public static float force = 800f; public static float recoil = 3f; public static float range = 256f; private float duration; private bool firedFirst; private bool firedSecond; private const int animVariations = 2; private string[] animLayerNames = new string[4] { "Gun1", "Gun4", "Gun2", "Gun3" }; private string[] muzzleNames = new string[4] { "GunPistolMuzzle", "GunStockMuzzle", "GunMagMuzzle", "GunChamberMuzzle" }; private byte animIndex = 0; private int fireStep = 0; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(1f); string text = ((animIndex == 0) ? "Attack1" : "Attack2"); ((EntityState)this).PlayCrossfade("Attacking", text, "Attack.playbackrate", 1f, 0.1f); Util.PlaySound("Play_PrimaryShoot", ((EntityState)this).gameObject); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!((EntityState)this).isAuthority) { return; } if (!firedFirst) { FireProjectile(); firedFirst = true; } if (!firedSecond && ((EntityState)this).fixedAge >= followupDelay) { FireProjectile(); firedSecond = true; } if (((EntityState)this).fixedAge >= duration * effectiveDuration && ((EntityState)this).inputBank.skill1.down) { DoubleTap doubleTap = new DoubleTap(); animIndex++; if (animIndex >= 2) { animIndex = 0; } doubleTap.animIndex = animIndex; ((EntityState)this).outer.SetNextState((EntityState)(object)doubleTap); } else if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } private void FireProjectile() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { string text = animLayerNames[animIndex * 2 + fireStep]; ((EntityState)this).PlayAnimation(text, "GunAttack", "Attack.playbackrate", 1f, 0f); fireStep++; Transform val = ((EntityState)this).GetModelChildLocator().FindChild(muzzleNames[animIndex]); Ray aimRay = ((BaseState)this).GetAimRay(); TrajectoryAimAssist.ApplyTrajectoryAimAssist(ref aimRay, projectilePrefab, ((EntityState)this).gameObject, 1f); ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(animIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); animIndex = reader.ReadByte(); } } public class ExplosiveDawn : BaseSkillState { private WisadelComponent wisadelComponent = null; private float toggleCooldown; private int stockOnActivation; private float enterDuration = 1f; private float exitDuration = 0.1f; private float exitStopwatch = 0f; private bool queueExit = false; public override void OnEnter() { ((BaseState)this).OnEnter(); toggleCooldown = 0.5f; if ((Object)(object)wisadelComponent == (Object)null) { wisadelComponent = ((Component)((EntityState)this).characterBody).GetComponent(); } EnterTransformation(); } public override void OnExit() { ExitTransformation(); ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); toggleCooldown -= ((EntityState)this).GetDeltaTime(); ((EntityState)this).skillLocator.special.rechargeStopwatch = 0f; if (((EntityState)this).skillLocator.primary.stock <= 0 || (((ButtonState)(ref ((EntityState)this).inputBank.skill4)).justPressed && toggleCooldown <= 0f)) { ExitTransformation(); queueExit = true; } if (queueExit) { exitStopwatch += ((EntityState)this).GetDeltaTime(); if (exitStopwatch > exitDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } } private void EnterTransformation() { int stock = ((EntityState)this).skillLocator.secondary.stock; float rechargeStopwatch = ((EntityState)this).skillLocator.secondary.rechargeStopwatch; ((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, WisadelStaticValues.primaryOverride, (SkillOverridePriority)2); ((EntityState)this).skillLocator.secondary.SetSkillOverride((object)this, WisadelStaticValues.secondaryOverride, (SkillOverridePriority)2); ((EntityState)this).skillLocator.utility.SetSkillOverride((object)this, WisadelStaticValues.utilityOverride, (SkillOverridePriority)2); ((EntityState)this).skillLocator.secondary.stock = Mathf.Min(stock + 1, ((EntityState)this).skillLocator.secondary.maxStock); ((EntityState)this).skillLocator.secondary.rechargeStopwatch = rechargeStopwatch; stockOnActivation = ((EntityState)this).skillLocator.special.stock; ((EntityState)this).skillLocator.special.stock = 0; wisadelComponent.EnableDawn(); ((EntityState)this).PlayAnimation("Rifle", "RifleEnter"); Util.PlaySound("Play_DawnEnter", ((EntityState)this).gameObject); } private void ExitTransformation() { int stock = ((EntityState)this).skillLocator.secondary.stock; float rechargeStopwatch = ((EntityState)this).skillLocator.secondary.rechargeStopwatch; ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, WisadelStaticValues.primaryOverride, (SkillOverridePriority)2); ((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)this, WisadelStaticValues.secondaryOverride, (SkillOverridePriority)2); ((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)this, WisadelStaticValues.utilityOverride, (SkillOverridePriority)2); ((EntityState)this).skillLocator.secondary.stock = stock; ((EntityState)this).skillLocator.secondary.rechargeStopwatch = rechargeStopwatch; ((EntityState)this).skillLocator.special.stock = stockOnActivation; wisadelComponent.DisableDawn(); ((EntityState)this).PlayAnimation("Rifle", "RifleExit"); Util.PlaySound("Play_DawnExit", ((EntityState)this).gameObject); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class RevDeath : GenericCharacterDeath { 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown ((GenericCharacterDeath)this).OnEnter(); EffectManager.SpawnEffect(WisadelStaticValues.revDeathEffect, new EffectData { origin = ((EntityState)this).transform.position }, true); EntityState.Destroy((Object)(object)((EntityState)this).gameObject); } public override void OnExit() { ((GenericCharacterDeath)this).DestroyModel(); ((GenericCharacterDeath)this).OnExit(); } } public class RevShoot : BaseSkillState { public static float damageCoefficient = 2f; public static float maxDistance = 1000f; public static float beamTravelDuration = 0.15f; private Transform muzzleTransform; private GameObject beam; public override void OnEnter() { ((BaseState)this).OnEnter(); ChildLocator componentInChildren = ((Component)((EntityState)this).GetModelTransform()).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { muzzleTransform = componentInChildren.FindChild("Peak"); } if ((Object)(object)muzzleTransform == (Object)null) { Debug.LogError((object)"RevShoot: Could not find Peak!"); } else { Fire(); } ((EntityState)this).outer.SetNextStateToMain(); } private void Fire() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0093: Expected O, but got Unknown //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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 point = ((Ray)(ref aimRay)).GetPoint(maxDistance); Quaternion val = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); RaycastHit val2 = default(RaycastHit); if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay, ref val2, maxDistance, LayerMask.op_Implicit(LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)), (QueryTriggerInteraction)0)) { point = ((RaycastHit)(ref val2)).point; } EffectManager.SpawnEffect(WisadelStaticValues.revMuzzleEffect, new EffectData { origin = muzzleTransform.position, rotation = val }, true); beam = ((Component)EffectManager.GetAndActivatePooledEffect(WisadelStaticValues.revBeamEffect, muzzleTransform.position, val)).gameObject; if (((EntityState)this).isAuthority) { BulletAttack val3 = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = muzzleTransform.position, aimVector = ((Ray)(ref aimRay)).direction, bulletCount = 1u, damage = 2f * ((BaseState)this).damageStat, procCoefficient = 1f, minSpread = 0f, maxSpread = 0f, force = 0f, radius = 0f, maxDistance = maxDistance, hitEffectPrefab = WisadelStaticValues.revHitEffect, isCrit = ((BaseState)this).RollCrit(), muzzleName = "Peak" }; val3.hitCallback = new HitCallback(OnHit); beam.GetComponent().StartMovingTo(point); val3.Fire(); Util.PlaySound("Play_RevShoot", ((EntityState)this).gameObject); } } private bool OnHit(BulletAttack bulletAttack, ref BulletHit hitInfo) { bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo); if ((Object)(object)hitInfo.hitHurtBox != (Object)null) { HealthComponent healthComponent = hitInfo.hitHurtBox.healthComponent; beam.GetComponent().StartMovingTo(((Component)healthComponent).transform); if ((Object)(object)healthComponent != (Object)null) { healthComponent.body.AddTimedBuff(WisadelStaticValues.markDebuff, 20f); AttachDebuffVisual(healthComponent); } } return result; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } private void AttachDebuffVisual(HealthComponent healthComponent) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)healthComponent).gameObject.transform; GameObject val = Object.Instantiate(WisadelStaticValues.markVisual, transform.position, transform.rotation); val.transform.SetParent(transform); CharacterBody component = ((Component)transform).GetComponent(); TemporaryVisualEffect component2 = val.GetComponent(); component2.parentTransform = component.coreTransform; component2.visualState = (VisualState)0; component2.healthComponent = healthComponent; component2.radius = component.radius; } } public class ShadowOfRevenant : BaseSkillState { private struct PlacementInfo { public bool ok; public Vector3 position; public Quaternion rotation; } public static GameObject blueprintPrefab; public static GameObject turretMasterPrefab; private BlueprintController blueprints; private const float placementMaxUp = 1f; private const float placementMaxDown = 3f; private const float placementForwardDistance = 2f; private const float turretHeight = 1.82f; private const float turretRadius = 0.5f; private const float turretCenter = 0f; private const float turretModelYOffset = -0.75f; private const float entryDelay = 0.1f; private const float exitDelay = 0.25f; private float exitCountdown; private float entryCountdown; private bool exitPending; private bool isPlacing; private PlacementInfo currentPlacementInfo; public override void OnEnter() { //IL_0052: 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) ((BaseState)this).OnEnter(); if (isPlacing) { ((EntityState)this).outer.SetNextStateToMain(); isPlacing = false; return; } isPlacing = true; if (((EntityState)this).isAuthority) { currentPlacementInfo = GetPlacementInfo(); blueprints = Object.Instantiate(blueprintPrefab, currentPlacementInfo.position, currentPlacementInfo.rotation).GetComponent(); } entryCountdown = 0.1f; exitCountdown = 0.25f; exitPending = false; } private PlacementInfo GetPlacementInfo() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; direction.y = 0f; ((Vector3)(ref direction)).Normalize(); ((Ray)(ref aimRay)).direction = direction; PlacementInfo result = new PlacementInfo { ok = false, rotation = Util.QuaternionSafeLookRotation(-direction) }; Ray val = default(Ray); ((Ray)(ref val))..ctor(((Ray)(ref aimRay)).GetPoint(2f) + Vector3.up * 1f, Vector3.down); float num = 4f; float num2 = num; RaycastHit val2 = default(RaycastHit); if (Physics.SphereCast(val, 0.5f, ref val2, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)) && ((RaycastHit)(ref val2)).normal.y > 0.5f) { num2 = ((RaycastHit)(ref val2)).distance; result.ok = true; } Vector3 point = ((Ray)(ref val)).GetPoint(num2 + 0.5f); result.position = point; if (result.ok && Physics.CheckCapsule(result.position + Vector3.up * 1.32f, result.position + Vector3.up * 0.5f, 0.45f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(CommonMasks.characterBodiesOrDefault))) { result.ok = false; } return result; } private void DestroyBlueprints() { if (Object.op_Implicit((Object)(object)blueprints)) { EntityState.Destroy((Object)(object)((Component)blueprints).gameObject); blueprints = null; } } public override void OnExit() { ((EntityState)this).OnExit(); DestroyBlueprints(); } public override void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); currentPlacementInfo = GetPlacementInfo(); if (Object.op_Implicit((Object)(object)blueprints)) { blueprints.PushState(currentPlacementInfo.position, currentPlacementInfo.rotation, currentPlacementInfo.ok); } } public override void FixedUpdate() { //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (!((EntityState)this).isAuthority) { return; } entryCountdown -= ((EntityState)this).GetDeltaTime(); if (exitPending) { exitCountdown -= ((EntityState)this).GetDeltaTime(); if (exitCountdown <= 0f) { ((EntityState)this).outer.SetNextStateToMain(); isPlacing = false; } } else { if (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank) || !(entryCountdown <= 0f)) { return; } if (((EntityState)this).inputBank.skill1.down && currentPlacementInfo.ok) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { Util.PlaySound("Play_RevPlace", ((EntityState)this).gameObject); ((EntityState)this).characterBody.SendConstructTurret(((EntityState)this).characterBody, currentPlacementInfo.position + new Vector3(0f, 0.25f, 0f), currentPlacementInfo.rotation, MasterCatalog.FindMasterIndex(turretMasterPrefab)); if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator)) { GenericSkill skill = ((EntityState)this).skillLocator.GetSkill((SkillSlot)1); if (Object.op_Implicit((Object)(object)skill)) { skill.DeductStock(1); } } } DestroyBlueprints(); exitPending = true; } if (((ButtonState)(ref ((EntityState)this).inputBank.skill2)).justPressed) { DestroyBlueprints(); exitPending = true; } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } } namespace WisadelMod.Survivors.Wisadel.Components { internal class BombMarkApplier : MonoBehaviour { private ProjectileImpactExplosion explosion; private void Awake() { explosion = ((Component)this).GetComponent(); if ((Object)(object)explosion != (Object)null) { ProjectileImpactExplosion obj = explosion; ((ProjectileExplosion)obj).OnProjectileExplosion = (Action)Delegate.Combine(((ProjectileExplosion)obj).OnProjectileExplosion, new Action(OnExplosion)); } else { Debug.LogWarning((object)"[BombMarkApplier]: No ProjectileImpactExplosion"); } } private void OnDestroy() { if ((Object)(object)explosion != (Object)null) { ProjectileImpactExplosion obj = explosion; ((ProjectileExplosion)obj).OnProjectileExplosion = (Action)Delegate.Remove(((ProjectileExplosion)obj).OnProjectileExplosion, new Action(OnExplosion)); } } private void OnExplosion(BlastAttack blastAttack, Result result) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } HitPoint[] hitPoints = result.hitPoints; foreach (HitPoint val in hitPoints) { if ((Object)(object)val.hurtBox == (Object)null) { continue; } CharacterBody val2 = val.hurtBox.healthComponent?.body; if ((Object)(object)val2 != (Object)null) { CharacterBody attacker = null; if (Object.op_Implicit((Object)(object)blastAttack.attacker)) { attacker = blastAttack.attacker.GetComponent(); } WisadelStaticValues.AddMarkTo(val2, attacker); } } } } internal class DebugBoxCollider : MonoBehaviour { private BoxCollider box; private void Awake() { box = ((Component)this).GetComponent(); } private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)box).transform.TransformPoint(box.center); Vector3 val2 = ((Component)box).transform.TransformVector(box.size.x * 0.5f, 0f, 0f); Vector3 val3 = ((Component)box).transform.TransformVector(0f, box.size.y * 0.5f, 0f); Vector3 val4 = ((Component)box).transform.TransformVector(0f, 0f, box.size.z * 0.5f); Vector3 val5 = val - val2 - val3 - val4; Vector3 val6 = val + val2 - val3 - val4; Vector3 val7 = val + val2 + val3 - val4; Vector3 val8 = val - val2 + val3 - val4; Vector3 val9 = val - val2 - val3 + val4; Vector3 val10 = val + val2 - val3 + val4; Vector3 val11 = val + val2 + val3 + val4; Vector3 val12 = val - val2 + val3 + val4; Debug.DrawLine(val5, val6, Color.red); Debug.DrawLine(val6, val7, Color.red); Debug.DrawLine(val7, val8, Color.red); Debug.DrawLine(val8, val5, Color.red); Debug.DrawLine(val9, val10, Color.red); Debug.DrawLine(val10, val11, Color.red); Debug.DrawLine(val11, val12, Color.red); Debug.DrawLine(val12, val9, Color.red); Debug.DrawLine(val5, val9, Color.red); Debug.DrawLine(val6, val10, Color.red); Debug.DrawLine(val7, val11, Color.red); Debug.DrawLine(val8, val12, Color.red); } } public class EmitForATime : MonoBehaviour { public TrailRenderer trail; public float duration = 1f; public float fixedAge = 0f; private void Awake() { trail = ((Component)this).GetComponent(); trail.emitting = true; fixedAge = 0f; } private void FixedUpdate() { if (trail.emitting) { fixedAge += Time.fixedDeltaTime; if (fixedAge >= duration) { trail.emitting = false; } } } } internal class LerpToPos : MonoBehaviour { private Vector3 end; private Transform target; private float speed = 256f; private bool isTravelling; public void StartMovingTo(Vector3 targetPos, float speed = 256f) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) target = null; end = targetPos; isTravelling = true; this.speed = speed; } public void StartMovingTo(Transform targetTransform, float speed = 256f) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) target = targetTransform; end = targetTransform.position; isTravelling = true; this.speed = speed; } private void Update() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (isTravelling) { if ((Object)(object)target != (Object)null) { end = target.position; } ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, end, speed * Time.deltaTime); if (((Component)this).transform.position == end) { isTravelling = false; } } } } public class ParticleSystemActivator : MonoBehaviour { public bool activeOnAwake = true; public ParticleSystem[] particleSystems = (ParticleSystem[])(object)new ParticleSystem[0]; private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) ParticleSystem[] array = particleSystems; foreach (ParticleSystem val in array) { MainModule main = val.main; ((MainModule)(ref main)).playOnAwake = activeOnAwake; } if (activeOnAwake) { Activate(); } else { Deactivate(); } } public void Activate() { ParticleSystem[] array = particleSystems; foreach (ParticleSystem val in array) { if (!val.isPlaying) { val.Play(); } } } public void Deactivate() { ParticleSystem[] array = particleSystems; foreach (ParticleSystem val in array) { if (val.isPlaying) { val.Stop(); } } } } internal class RevenantComponent : MonoBehaviour { private WisadelComponent wisadelComponent; private CharacterBody body; private EntityStateMachine stateMachine; private BaseAI ai; private AISkillDriver sd; private Transform muzzleTransform; private GameObject beam; private IEnumerator Start() { body = ((Component)this).GetComponent(); CharacterMaster turretMaster = body.master; object obj; if (turretMaster == null) { obj = null; } else { MinionOwnership minionOwnership = turretMaster.minionOwnership; obj = ((minionOwnership != null) ? minionOwnership.ownerMaster : null); } CharacterMaster survivorMaster = (CharacterMaster)obj; CharacterBody survivorBody = ((survivorMaster != null) ? survivorMaster.GetBody() : null); stateMachine = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Body"); ai = ((Component)turretMaster).GetComponent(); sd = ((Component)turretMaster).GetComponents()[0]; if ((Object)(object)survivorBody != (Object)null) { wisadelComponent = ((Component)survivorBody).GetComponent(); if ((Object)(object)wisadelComponent != (Object)null) { wisadelComponent.revenantList.Add(this); int magStacks = wisadelComponent.characterBody.inventory.GetItemCountEffective(Items.SecondarySkillMagazine); body.inventory.GiveItemPermanent(Items.BoostAttackSpeed, 10 * magStacks); } } ModelLocator modelLocator = ((Component)body).GetComponent(); ChildLocator childLocator = ((Component)modelLocator.modelTransform).GetComponentInChildren(); muzzleTransform = childLocator.FindChild("Peak"); yield return null; if (wisadelComponent.dawnMode) { Deactivate(); } else { Reactivate(); } } private void OnDestroy() { if ((Object)(object)wisadelComponent != (Object)null) { wisadelComponent.revenantList.Remove(this); } } public void Deactivate() { if ((Object)(object)ai != (Object)null) { ((Behaviour)sd).enabled = false; } } public void Reactivate() { if ((Object)(object)ai != (Object)null) { ((Behaviour)sd).enabled = true; } } public void FireEmpoweredAt(Vector3 target) { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown float num = 1000000f; Vector3 position = muzzleTransform.position; Vector3 val = target - position; Vector3 normalized = ((Vector3)(ref val)).normalized; Quaternion val2 = Util.QuaternionSafeLookRotation(normalized); Ray val3 = default(Ray); ((Ray)(ref val3))..ctor(position, normalized); Vector3 point = ((Ray)(ref val3)).GetPoint(num); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, ref val4, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)0)) { point = ((RaycastHit)(ref val4)).point; } EffectManager.SpawnEffect(WisadelStaticValues.revMuzzleEffect, new EffectData { origin = position, rotation = val2 }, true); beam = ((Component)EffectManager.GetAndActivatePooledEffect(WisadelStaticValues.revBlitzBeamEffect, position, val2)).gameObject; beam.GetComponent().StartMovingTo(point); EntityState state = stateMachine.state; BaseState val5 = (BaseState)(object)((state is BaseState) ? state : null); if (val5 != null && ((EntityState)val5).isAuthority) { BulletAttack val6 = new BulletAttack { owner = ((Component)this).gameObject, weapon = ((Component)this).gameObject, origin = position, aimVector = normalized, bulletCount = 1u, damage = 5f * val5.damageStat, procCoefficient = 1f, minSpread = 0f, maxSpread = 0f, force = 0f, radius = 2f, maxDistance = Vector3.Distance(position, point), hitEffectPrefab = WisadelStaticValues.revHitEffect, isCrit = val5.RollCrit(), muzzleName = "Peak", stopperMask = LayerMask.op_Implicit(0) }; val6.hitCallback = new HitCallback(OnHit); val6.Fire(); } } private bool OnHit(BulletAttack bulletAttack, ref BulletHit hitInfo) { bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo); if ((Object)(object)hitInfo.hitHurtBox != (Object)null) { HealthComponent healthComponent = hitInfo.hitHurtBox.healthComponent; if ((Object)(object)healthComponent != (Object)null) { WisadelStaticValues.AddMarkTo(healthComponent.body, body); } } return result; } } internal class ShadowsMarkDestroy : MonoBehaviour { public CharacterBody body; private void Start() { Transform parent = ((Component)this).transform.GetParent(); if ((Object)(object)parent != (Object)null) { CharacterBody component = ((Component)parent).GetComponent(); body = component; } if ((Object)(object)body == (Object)null) { Debug.LogWarning((object)"[ShadowsMarkEffect]: Not linked to buff."); } } private void FixedUpdate() { if ((Object)(object)body != (Object)null && !body.HasBuff(WisadelStaticValues.markDebuff)) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal class WisadelComponent : MonoBehaviour { public CharacterBody characterBody; public ParticleSystemActivator wings; public List revenantList = new List(); public bool dawnMode = false; private void Awake() { characterBody = ((Component)this).GetComponent(); wings = ((Component)characterBody.modelLocator.modelChildLocator.FindChild("Wings")).GetComponent(); } public void EnableDawn() { dawnMode = true; foreach (RevenantComponent revenant in revenantList) { revenant.Deactivate(); } wings.Activate(); } public void DisableDawn() { dawnMode = false; foreach (RevenantComponent revenant in revenantList) { revenant.Reactivate(); } wings.Deactivate(); } public void CoordinateAttack(Vector3 position) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) foreach (RevenantComponent revenant in revenantList) { revenant.FireEmpoweredAt(position); } } public void OnDamageDealt(DamageReport damageReport) { if (damageReport.victimBody.HasBuff(WisadelStaticValues.markDebuff) && ShouldDetonate()) { CharacterBody victimBody = damageReport.victimBody; victimBody.RemoveBuff(WisadelStaticValues.markDebuff); Detonate(damageReport); } } public bool ShouldDetonate() { if (dawnMode) { return true; } return Util.CheckRoll(15f, ((Component)this).GetComponent().master); } private void Detonate(DamageReport damageReport) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) CharacterBody victimBody = damageReport.victimBody; float radius; GameObject val; if (dawnMode) { radius = 15f; val = WisadelStaticValues.markDetonateDawnEffect; } else { radius = 6f; val = WisadelStaticValues.markDetonateEffect; } BlastAttack val2 = new BlastAttack { attacker = ((Component)this).gameObject, inflictor = ((Component)this).gameObject, position = victimBody.corePosition, radius = radius, baseDamage = damageReport.damageInfo.damage * 3f, bonusForce = Vector3.zero, procCoefficient = 1f, falloffModel = (FalloffModel)0, damageType = DamageTypeCombo.op_Implicit((DamageType)0), teamIndex = characterBody.teamComponent.teamIndex, attackerFiltering = (AttackerFiltering)0 }; EffectManager.SpawnEffect(val, new EffectData { origin = victimBody.corePosition, rotation = victimBody.coreTransform.rotation }, true); Util.PlaySound(dawnMode ? "Play_DetonateLarge" : "Play_Detonate", ((Component)victimBody).gameObject); val2.Fire(); } } } namespace WisadelMod.Survivors.Wisadel.Achievements { [RegisterAchievement("XPOLARZIDE_WISADEL_masteryAchievement", "XPOLARZIDE_WISADEL_masteryUnlockable", null, 10u, null)] public class WisadelMasteryAchievement : BaseMasteryAchievement { public const string identifier = "XPOLARZIDE_WISADEL_masteryAchievement"; public const string unlockableIdentifier = "XPOLARZIDE_WISADEL_masteryUnlockable"; public override string RequiredCharacterBody => CharacterBase.instance.bodyName; public override float RequiredDifficultyCoefficient => 3f; } }