Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of DBZ Mod v1.1.2
GohanMod.dll
Decompiled 5 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using GohanMod.Components; using GohanMod.DebugTools; using GohanMod.Effects; using GohanMod.Modules; using GohanMod.States; using KinematicCharacterController; using Microsoft.CodeAnalysis; using R2API; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("GohanMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+3c5f1687195f23d77fcf2f11ab1c90c0ab7fb190")] [assembly: AssemblyProduct("GohanMod")] [assembly: AssemblyTitle("GohanMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace GohanMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.dbzmod.dbzmod", "DBZ Mod", "1.1.2")] public class GohanPlugin : BaseUnityPlugin { public const string GUID = "com.dbzmod.dbzmod"; public const string NAME = "DBZ Mod"; public const string VERSION = "1.1.2"; internal static GohanPlugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } private void Awake() { Instance = this; Log = ((BaseUnityPlugin)this).Logger; if (Environment.GetEnvironmentVariable("DBZ_VANILLA") == "1" && string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DBZ_ONLY"))) { Step("autotest", AutoTest.TryStart); return; } Step("config", delegate { GohanConfig.Init(((BaseUnityPlugin)this).Config); }); Step("assets", GohanAssets.Init); Step("buffs", GohanBuffs.Init); Step("effects", GohanEffects.Init); Step("projectiles", GohanProjectiles.Init); Step("fighters", RegisterFighters); Step("config migration", GohanConfig.Migrate); Step("projectiles (fighters)", WarmProjectiles); Step("states", GohanStates.Init); foreach (FighterDef def in Fighters.All) { Step("character " + def.key, delegate { FighterFactory.Create(def); }); } foreach (FighterDef def2 in Fighters.All) { Step("language " + def2.key, delegate { def2.registerTokens?.Invoke(def2); }); } Step("ultimate descriptions", UltimateTexts.ApplyAll); Step("hooks", GohanHooks.Init); Step("afterimage listeners", AfterimageHopTracker.Prepare); Step("hud", KiHud.Init); Step("character select scroll", SurvivorGridScroll.Init); Step("title lineup", TitleLineup.Init); Step("drawn sword material", delegate { DrawnSword.MaterialFactory = delegate(Color c) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown Shader val = GohanAssets.Load<Shader>("RoR2/Base/Shaders/HGStandard.shader"); Material val2 = (Object.op_Implicit((Object)(object)val) ? new Material(val) : new Material(Shader.Find("Standard"))); val2.color = c; return val2; }; }); Step("options", RiskOfOptionsCompat.TryInit); Step("autotest", AutoTest.TryStart); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { Step("soundbanks", LoadSoundBanks); }); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { Step("catalog", Fighters.OnCatalogReady); }); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { Step("mask pools", GohanHooks.PurgeStaleMaskPools); }); Log.LogInfo((object)"DBZ Mod 1.1.2 loaded."); } private static void WarmProjectiles() { int num = 0; Type[] types = typeof(GohanPlugin).Assembly.GetTypes(); foreach (Type type in types) { FieldInfo[] fields = type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { object value; try { value = fieldInfo.GetValue(null); } catch { continue; } Func<GameObject> func = ((value is KiBlastProfile kiBlastProfile) ? kiBlastProfile.projectile : ((value is VolleyProfile volleyProfile) ? volleyProfile.projectile : null)); if (func == null) { continue; } try { if (Object.op_Implicit((Object)(object)func())) { num++; } } catch (Exception ex) { Log.LogWarning((object)("[DBZ] Projectile for " + type.Name + "." + fieldInfo.Name + " failed: " + ex.Message)); } } } Log.LogInfo((object)$"[DBZ] {num} fighter projectiles registered."); } private static void RegisterFighters() { Add("Gohan", GohanFighter.Build); Add("Goku", GokuFighter.Build); Add("Vegeta", VegetaFighter.Build); Add("Trunks", TrunksFighter.Build); Add("Piccolo", PiccoloFighter.Build); Add("Cell", CellFighter.Build); Add("Broly", BrolyFighter.Build); Add("Jiren", JirenFighter.Build); Add("Frieza", FriezaFighter.Build); Add("Beerus", BeerusFighter.Build); Step("fighters technique anims", TechniqueAnims.Apply); static void Add(string name, Func<FighterDef> build) { try { Fighters.Register(build()); } catch (Exception arg) { Log.LogError((object)$"[Gohan] Failed to build fighter '{name}': {arg}"); } } } private static void LoadSoundBanks() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Invalid comparison between Unknown and I4 //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Invalid comparison between Unknown and I4 //IL_003c: Unknown result type (might be due to invalid IL or missing references) string[] array = new string[2] { "DLC4_Enforcer", "Char_Drifter" }; uint num = default(uint); foreach (string text in array) { AKRESULT val = AkSoundEngine.LoadBank(text, ref num); if ((int)val != 1 && (int)val != 69) { Log.LogWarning((object)$"[Gohan] Sound bank {text}: {val}"); } } } private static void Step(string name, Action action) { string environmentVariable = Environment.GetEnvironmentVariable("DBZ_ONLY"); if (Environment.GetEnvironmentVariable("DBZ_VANILLA") == "1" && !string.IsNullOrEmpty(environmentVariable) && name != "autotest" && !Array.Exists(environmentVariable.Split(','), (string o) => name.StartsWith(o.Trim()))) { return; } try { action(); } catch (Exception arg) { Log.LogError((object)$"[Gohan] Failed during '{name}' setup: {arg}"); } } } } namespace GohanMod.States { public enum Anchor { Default, Hands, RightHand, LeftHand, Overhead, Forehead, Eyes, Mouth, Finger } public static class Anchors { private class Bones { public Transform model; public Avatar avatar; public bool searched; public Transform head; public Transform hips; public Transform eyeL; public Transform eyeR; public Transform fingerL; public Transform fingerR; } private static readonly ConditionalWeakTable<GohanController, Bones> cache = new ConditionalWeakTable<GohanController, Bones>(); private static Bones Get(GohanController c) { ModelLocator component = ((Component)c).GetComponent<ModelLocator>(); Transform val = (Object.op_Implicit((Object)(object)component) ? component.modelTransform : null); Animator val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent<Animator>() : null); Avatar val3 = (Object.op_Implicit((Object)(object)val2) ? val2.avatar : null); Bones value = cache.GetValue(c, (GohanController _) => new Bones()); if (value.searched && (Object)(object)value.model == (Object)(object)val && (Object)(object)value.avatar == (Object)(object)val3) { return value; } value.searched = true; value.model = val; value.avatar = val3; value.head = (value.hips = (value.eyeL = (value.eyeR = (value.fingerL = (value.fingerR = null))))); if (!Object.op_Implicit((Object)(object)val)) { return value; } if (Object.op_Implicit((Object)(object)val2) && val2.isHuman) { value.head = val2.GetBoneTransform((HumanBodyBones)10); value.hips = val2.GetBoneTransform((HumanBodyBones)0); value.eyeL = val2.GetBoneTransform((HumanBodyBones)21); value.eyeR = val2.GetBoneTransform((HumanBodyBones)22); value.fingerL = val2.GetBoneTransform((HumanBodyBones)29) ?? val2.GetBoneTransform((HumanBodyBones)28) ?? val2.GetBoneTransform((HumanBodyBones)27); value.fingerR = val2.GetBoneTransform((HumanBodyBones)44) ?? val2.GetBoneTransform((HumanBodyBones)43) ?? val2.GetBoneTransform((HumanBodyBones)42); } if (!Object.op_Implicit((Object)(object)value.head)) { ChildLocator component2 = ((Component)val).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component2)) { value.head = component2.FindChild("Head"); } } return value; } private static float Height(GohanController c, Bones b) { //IL_0020: 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) if (Object.op_Implicit((Object)(object)b.head) && Object.op_Implicit((Object)(object)b.hips)) { float num = Vector3.Distance(b.head.position, b.hips.position); if (num > 0.05f) { return Mathf.Clamp(num / 0.34f, 0.8f, 20f); } } FighterDef def = c.Def; if (def == null || !(def.modelHeight > 0f)) { return 1.7f; } return def.modelHeight; } private static Vector3 Facing(Ray aim) { //IL_0004: 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_003c: 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) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Ray)(ref aim)).direction.x, 0f, ((Ray)(ref aim)).direction.z); if (!(((Vector3)(ref val)).sqrMagnitude > 0.01f)) { return ((Ray)(ref aim)).direction; } return ((Vector3)(ref val)).normalized; } public static Vector3 Position(GohanController c, Anchor anchor, Ray aim, bool right = true) { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_00c8: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_0199: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) switch (anchor) { case Anchor.Hands: return c.GetHandsPosition(aim); case Anchor.RightHand: return c.GetHandPosition(right: true, aim); case Anchor.LeftHand: return c.GetHandPosition(right: false, aim); case Anchor.Default: return c.GetHandPosition(right, aim); default: { Bones bones = Get(c); float num = Height(c, bones); Vector3 val = Facing(aim); Vector3 val2 = (Object.op_Implicit((Object)(object)bones.head) ? bones.head.position : ((Object.op_Implicit((Object)(object)c.body) ? c.body.corePosition : ((Component)c).transform.position) + Vector3.up * (0.4f * num))); switch (anchor) { case Anchor.Overhead: return val2 + Vector3.up * (0.2f * num) + val * (0.03f * num); case Anchor.Forehead: return val2 + Vector3.up * (0.075f * num) + val * (0.06f * num); case Anchor.Mouth: return val2 + Vector3.up * (0.005f * num) + val * (0.065f * num); case Anchor.Eyes: if (Object.op_Implicit((Object)(object)bones.eyeL) && Object.op_Implicit((Object)(object)bones.eyeR)) { return (bones.eyeL.position + bones.eyeR.position) * 0.5f + val * (0.025f * num); } return val2 + Vector3.up * (0.04f * num) + val * (0.06f * num); case Anchor.Finger: { Transform val3 = (right ? bones.fingerR : bones.fingerL); if (Object.op_Implicit((Object)(object)val3)) { return val3.position + ((Ray)(ref aim)).direction * (0.015f * num); } return c.GetHandPosition(right, aim); } default: return c.GetHandPosition(right, aim); } } } } public static Vector3 EyeHalfSpacing(CharacterBody body, Ray aim, float minHalf) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_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_0010: 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_001f: 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_00a0: 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_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) Vector3 val = Vector3.Cross(Vector3.up, Facing(aim)); val = ((((Vector3)(ref val)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref val)).normalized : Vector3.right); GohanController gohanController = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent<GohanController>() : null); float num = 0.0306f; if (Object.op_Implicit((Object)(object)gohanController)) { Bones bones = Get(gohanController); num = ((Object.op_Implicit((Object)(object)bones.eyeL) && Object.op_Implicit((Object)(object)bones.eyeR)) ? (Vector3.Distance(bones.eyeL.position, bones.eyeR.position) * 0.5f) : (0.018f * Height(gohanController, bones))); } return val * Mathf.Max(num, minHalf); } } public static class Moves { public static HurtBox FindTarget(BaseState s, CharacterBody body, float range, float angle = 35f) { //IL_0073: 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_0041: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00fc: 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_0103: 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) HuntressTracker component = ((Component)body).GetComponent<HuntressTracker>(); HurtBox val = (Object.op_Implicit((Object)(object)component) ? component.GetTrackingTarget() : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive && Vector3.Distance(((Component)val).transform.position, body.corePosition) <= range) { return val; } Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(Object.op_Implicit((Object)(object)body.inputBank) ? body.inputBank.aimOrigin : body.corePosition, Object.op_Implicit((Object)(object)body.inputBank) ? body.inputBank.aimDirection : ((Component)body).transform.forward); BullseyeSearch val3 = new BullseyeSearch { searchOrigin = ((Ray)(ref val2)).origin, searchDirection = ((Ray)(ref val2)).direction, maxDistanceFilter = range, maxAngleFilter = angle, teamMaskFilter = TeamMask.GetEnemyTeams((TeamIndex)((!Object.op_Implicit((Object)(object)body.teamComponent)) ? 1 : ((int)body.teamComponent.teamIndex))), filterByLoS = true, sortMode = (SortMode)3 }; val3.RefreshCandidates(); val3.FilterOutGameObject(((Component)body).gameObject); return val3.GetResults().FirstOrDefault(); } public static Result Blast(BaseState s, CharacterBody body, Vector3 pos, float radius, float coefficient, float force, DamageSource source, bool stun = false, Vector3 bonus = default(Vector3), float proc = 1f, GameObject effect = null, float effectScale = 1f) { //IL_0019: 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_0031: 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_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_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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_008b: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00c2: 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 (Object.op_Implicit((Object)(object)effect)) { GohanEffects.Spawn(effect, pos, Quaternion.identity, effectScale); } HitboxDebug.Sphere(pos, radius); return new BlastAttack { attacker = ((Component)body).gameObject, inflictor = ((Component)body).gameObject, teamIndex = (TeamIndex)((!Object.op_Implicit((Object)(object)body.teamComponent)) ? 1 : ((int)body.teamComponent.teamIndex)), baseDamage = body.damage * coefficient, baseForce = force, bonusForce = bonus, position = pos, radius = radius, procCoefficient = proc, falloffModel = (FalloffModel)0, crit = body.RollCrit(), damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)(stun ? 32 : 0)), (DamageTypeExtended)0, source), attackerFiltering = (AttackerFiltering)2 }.Fire(); } public static void Popup(CharacterBody body, string text, Color c) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) KiHudBar.PopupIfLocal(body, text, c); } } public class MoveProfile { public string name; public Color color = new Color(0.4f, 0.8f, 1f); public Func<ConfigEntry<float>> cost = () => (ConfigEntry<float>)null; public bool announce; public DamageSource source = (DamageSource)8; public int guard = 50; public string chargeAnim; public string fireAnim; } public static class Anim { public static void Pose(BaseState s, string pose, string fallback, string fallbackLayer = "Gesture, Override") { MethodInfo method = typeof(EntityState).GetMethod("PlayCrossfade", BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[3] { typeof(string), typeof(string), typeof(float) }, null); if (!(method == null)) { if (!string.IsNullOrEmpty(pose)) { method.Invoke(s, new object[3] { "Gesture, Override", pose, 0.08f }); } else if (!string.IsNullOrEmpty(fallback)) { method.Invoke(s, new object[3] { fallbackLayer, fallback, 0.1f }); } } } public static string Mirror(Animator animator, string pose) { if (!Object.op_Implicit((Object)(object)animator) || string.IsNullOrEmpty(pose)) { return pose; } int layerIndex = animator.GetLayerIndex("Gesture, Override"); string text = pose + "_M"; if (layerIndex < 0 || !animator.HasState(layerIndex, Animator.StringToHash(text))) { return pose; } return text; } } public class VolleyProfile : MoveProfile { public float damagePerShot = 1.2f; public float shotsPerSecond = 5f; public float kiPerSecond = 15f; public float spread = 2.5f; public float minDuration = 0.6f; public float maxDuration = 6f; public int maxShots = 10; public const int BonusShotsPerMag = 2; public Func<GameObject> projectile = () => GohanProjectiles.KiBlast; public bool rightHandOnly; public LaserSpec laser; public OrbSpec orbs; public string sound = "Play_mage_m1_shoot"; } public abstract class FireVolley : BaseSkillState { private float timer; private bool leftHand; private GohanController gohan; private int shots; private int shotCap = int.MaxValue; private HurtBoxReference orbTarget; private Vector3 orbAnchor; protected abstract VolleyProfile Profile { get; } public VolleyProfile PublicProfile => Profile; public override void OnEnter() { //IL_00cd: 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_00ff: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); gohan = ((EntityState)this).GetComponent<GohanController>(); shotCap = Profile.maxShots; if (Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot) && Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot.skillDef)) { shotCap += 2 * Mathf.Max(0, ((BaseSkillState)this).activatorSkillSlot.maxStock - ((BaseSkillState)this).activatorSkillSlot.skillDef.baseMaxStock); } KiCost.SpendServer(((EntityState)this).characterBody, Profile.cost()); GohanStateUtil.SetGuard((EntityState)(object)this, Profile.guard); if (Profile.announce) { Moves.Popup(((EntityState)this).characterBody, Profile.name + "!", Profile.color); } ((BaseState)this).StartAimMode(2f, false); if (Profile.orbs != null) { if (((EntityState)this).isAuthority) { HoverOrbs.Lock(((EntityState)this).characterBody, ((BaseState)this).GetAimRay(), Profile.orbs, out orbTarget, out orbAnchor); } HoverOrbs.Begin(((EntityState)this).characterBody, ((HurtBoxReference)(ref orbTarget)).ResolveHurtBox(), orbAnchor, Profile); } } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.SetAimTimer(2f); float deltaTime = ((EntityState)this).GetDeltaTime(); bool flag = !Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot); if (!flag) { KiCost.DrainServer(((EntityState)this).characterBody, Profile.cost(), Profile.kiPerSecond, deltaTime); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).characterMotor.velocity.y < -1f) { ((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, -1f, ((EntityState)this).characterMotor.velocity.z); } timer -= deltaTime; if (timer <= 0f && (Profile.orbs == null || shots < shotCap)) { timer = 1f / (Profile.shotsPerSecond * Mathf.Clamp(((BaseState)this).attackSpeedStat, 0.5f, 4f)); Shoot(); shots++; } if (((EntityState)this).isAuthority) { bool flag2 = !flag && Profile.kiPerSecond > 0f && GohanBuffs.GetKi(((EntityState)this).characterBody) <= 0; bool flag3 = flag || ((BaseSkillState)this).IsKeyDownAuthority(); if ((((EntityState)this).fixedAge >= Profile.minDuration && !flag3) || ((EntityState)this).fixedAge >= Profile.maxDuration || flag2 || (shots >= shotCap && Profile.orbs == null)) { ((EntityState)this).outer.SetNextStateToMain(); } } } private void Shoot() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020f: 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_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) leftHand = !Profile.rightHandOnly && !leftHand; if (!string.IsNullOrEmpty(Profile.fireAnim)) { Anim.Pose((BaseState)(object)this, Profile.fireAnim, null); } else { ((EntityState)this).PlayCrossfade("Gesture, Override", leftHand ? "SwingFistLeft" : "SwingFistRight", "SwingFist.playbackRate", 0.22f, 0.03f); } Util.PlaySound(Profile.sound, ((EntityState)this).gameObject); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = (Object.op_Implicit((Object)(object)gohan) ? gohan.GetHandPosition(!leftHand, aimRay) : ((Ray)(ref aimRay)).origin); if (Profile.laser != null) { if (Profile.laser.originAnchor != Anchor.Default && Object.op_Implicit((Object)(object)gohan)) { val = Anchors.Position(gohan, Profile.laser.originAnchor, aimRay, !leftHand); } Ray aim = default(Ray); ((Ray)(ref aim))..ctor(((Ray)(ref aimRay)).origin, Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, Profile.spread, 1f, 1f, 0f, 0f)); Lasers.Fire((BaseState)(object)this, ((EntityState)this).characterBody, val, aim, Profile.laser, Profile.damagePerShot, Profile.source, ((EntityState)this).isAuthority, ((EntityState)this).isAuthority && ((BaseState)this).RollCrit()); return; } GameObject val2 = Profile.projectile(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)val2)) { Vector3 val3 = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, Profile.spread, 1f, 1f, 0f, 0f); ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = val2, position = val, rotation = Util.QuaternionSafeLookRotation(val3), owner = ((EntityState)this).gameObject, damage = ((BaseState)this).damageStat * Profile.damagePerShot, force = 150f, crit = ((BaseState)this).RollCrit(), damageTypeOverride = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, Profile.source) }); } } public override void OnExit() { if (Profile.orbs != null) { HoverOrbs.Release(((EntityState)this).characterBody); } ((EntityState)this).PlayAnimation("Gesture, Override", "Empty"); GohanStateUtil.SetGuard((EntityState)(object)this, 0); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } public override void OnSerialize(NetworkWriter writer) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); if (Profile.orbs != null) { NetworkExtensions.Write(writer, orbTarget); writer.Write(orbAnchor); } } public override void OnDeserialize(NetworkReader reader) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); if (Profile.orbs != null) { orbTarget = NetworkExtensions.ReadHurtBoxReference(reader); orbAnchor = reader.ReadVector3(); } } } public class RushProfile : MoveProfile { public float range = 20f; public float speed = 70f; public float damage = 4f; public float radius = 4.5f; public float launch = 1500f; public float slam; public bool passThrough; public float stopPast = 3f; public int hits = 1; public float hitInterval; public string staggerSound; public int slash; public float windup; public float maxCharge; public float minEndRadius; public float minEndDamage; public Color auraColor; public Color auraAccent; public float endRadius; public float endDamage; public Func<GameObject> impactEffect; public float impactEffectScale; public float impactShake = 1f; public bool impactRing; public Color impactColor; public Color impactAccent; public Color shellColor; public float shellRadius; public Color trailColor; public Color trailColor2; public float lifesteal; public float kiOnHit; } public abstract class RushStrike : BaseSkillState { private Vector3 direction; private float travel; private float maxTravel; private bool struck; private bool slashShown; private readonly HashSet<HealthComponent> passHit = new HashSet<HealthComponent>(); private bool dashPhase; private float charge = 1f; private GameObject aura; private RushAuraVisual dashAura; private SiphonTether tether; private int ghostsLeft; private int strikesDone; private int arcsShown; private float strikeAge; private Vector3 strikePos; protected abstract RushProfile Profile { get; } protected bool IsWindup { get { if (!dashPhase) { if (!(Profile.windup > 0f)) { return Profile.maxCharge > 0f; } return true; } return false; } } protected float ChargeFraction => charge; protected float EndRadius => Scaled((Profile.endRadius > 0f) ? Profile.endRadius : Profile.radius, Profile.minEndRadius); protected float EndDamage => Scaled((Profile.endDamage > 0f) ? Profile.endDamage : Profile.damage, Profile.minEndDamage); private int HitCount => Mathf.Max(1, Profile.hits); private bool Staggered { get { if (Profile.hitInterval > 0f) { return HitCount > 1; } return false; } } private float StaggerTime { get { if (!Staggered) { return 0f; } return (float)(HitCount - 1) * Profile.hitInterval; } } private float Scaled(float full, float min) { if (!(Profile.maxCharge > 0f) || !(min > 0f)) { return full; } return Mathf.Lerp(min, full, charge); } protected virtual RushStrike CreateDash() { return (RushStrike)Activator.CreateInstance(((object)this).GetType()); } public override void OnEnter() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: 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_0181: 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_01f9: 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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if (!dashPhase) { KiCost.SpendServer(((EntityState)this).characterBody, Profile.cost()); } GohanStateUtil.SetGuard((EntityState)(object)this, Profile.guard); if (!dashPhase && Profile.announce) { Moves.Popup(((EntityState)this).characterBody, Profile.name + "!", Profile.color); } if (Profile.slash > 0) { DrawnSword.Draw(((EntityState)this).GetModelTransform(), IsWindup ? 3f : (2.5f + StaggerTime)); } if (IsWindup) { EnterWindup(); return; } Util.PlaySound("Play_loader_shift_release", ((EntityState)this).gameObject); if (!string.IsNullOrEmpty(Profile.chargeAnim)) { Anim.Pose((BaseState)(object)this, Profile.chargeAnim, null); } else { ((EntityState)this).PlayCrossfade("FullBody, Override", "ChargePunch", "ChargePunch.playbackRate", 0.4f, 0.05f); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.35f); } if (NetworkServer.active && (Profile.lifesteal > 0f || Profile.kiOnHit > 0f)) { Lifesteal.Open(((EntityState)this).characterBody, Profile.lifesteal, Profile.kiOnHit, Profile.source); } StartDashVisuals(); if (((EntityState)this).isAuthority) { HurtBox val = Moves.FindTarget((BaseState)(object)this, ((EntityState)this).characterBody, Profile.range + 5f); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 normalized = ((Ray)(ref aimRay)).direction; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded) { Vector3 val2 = new Vector3(normalized.x, 0f, normalized.z); normalized = ((Vector3)(ref val2)).normalized; } Vector3 val3 = (Object.op_Implicit((Object)(object)val) ? (((Component)val).transform.position - ((EntityState)this).characterBody.corePosition) : (normalized * Profile.range)); maxTravel = Mathf.Min(Profile.range, Mathf.Max(0f, ((Vector3)(ref val3)).magnitude - 1.5f)); if (Profile.passThrough) { maxTravel = ((Object.op_Implicit((Object)(object)val) && Profile.stopPast > 0f) ? Mathf.Min(Profile.range, ((Vector3)(ref val3)).magnitude + Profile.stopPast) : Profile.range); } direction = ((((Vector3)(ref val3)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val3)).normalized : ((EntityState)this).characterDirection.forward); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); } GohanStateUtil.AntiGravity(((EntityState)this).characterMotor, on: true); } } public override void FixedUpdate() { //IL_0045: 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_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_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_0128: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (IsWindup) { WindupFixedUpdate(); return; } if (!slashShown && ((EntityState)this).fixedAge >= maxTravel / Profile.speed) { slashShown = true; ArrivalVisuals(((EntityState)this).characterBody.corePosition + direction * 1.5f); } else if (!slashShown && ghostsLeft > 0 && ((EntityState)this).fixedAge >= (float)(3 - ghostsLeft) * maxTravel / Profile.speed / 3f) { ghostsLeft--; AfterimageGhost.Spawn(((EntityState)this).GetModelTransform(), AfterimageGhost.Brighten(Profile.trailColor)); } else if (slashShown && Staggered && arcsShown < HitCount && ((EntityState)this).fixedAge >= maxTravel / Profile.speed + (float)arcsShown * Profile.hitInterval) { StrikeArc(((EntityState)this).characterBody.corePosition + direction * 1.5f); } if (!((EntityState)this).isAuthority) { return; } float num = Profile.speed * ((EntityState)this).GetDeltaTime(); if (!struck && travel < maxTravel) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += direction * num; ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = new Vector3(direction.x, 0f, direction.z); } travel += num; if (Profile.passThrough) { PassHits(); } } else if (!struck) { struck = true; strikeAge = ((EntityState)this).fixedAge; Strike(); } else if (strikesDone < HitCount && ((EntityState)this).fixedAge >= strikeAge + (float)strikesDone * Profile.hitInterval) { StrikeHit(); } if (struck && strikesDone >= HitCount && ((EntityState)this).fixedAge > travel / Profile.speed + 0.25f + StaggerTime) { ((EntityState)this).outer.SetNextStateToMain(); } if (((EntityState)this).fixedAge > 2.5f + StaggerTime) { ((EntityState)this).outer.SetNextStateToMain(); } } private void PassHits() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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) HitboxDebug.Sphere(((EntityState)this).characterBody.corePosition, Profile.radius, HitboxDebug.BlastColor, 0.06f); Vector3 corePosition = ((EntityState)this).characterBody.corePosition; float radius = Profile.radius; LayerIndex entityPrecise = LayerIndex.entityPrecise; foreach (HealthComponent item in (from c in Physics.OverlapSphere(corePosition, radius, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask)) select ((Component)c).GetComponent<HurtBox>() into h where Object.op_Implicit((Object)(object)h) && Object.op_Implicit((Object)(object)h.healthComponent) && (Object)(object)h.healthComponent != (Object)(object)((EntityState)this).healthComponent && h.teamIndex != ((BaseState)this).GetTeam() select h.healthComponent).Distinct().ToList()) { if (passHit.Add(item)) { Moves.Blast((BaseState)(object)this, ((EntityState)this).characterBody, Object.op_Implicit((Object)(object)item.body) ? item.body.corePosition : ((Component)item).transform.position, 2f, Profile.damage, 800f, Profile.source, stun: true, Vector3.up * 600f, 1f, GohanEffects.HeavyImpact, 2f); } } } private void Strike() { //IL_002f: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!string.IsNullOrEmpty(Profile.fireAnim)) { Anim.Pose((BaseState)(object)this, Profile.fireAnim, null); } Vector3 position = ((EntityState)this).characterBody.corePosition + direction * 1.5f; Util.PlaySound("Play_loader_R_shock", ((EntityState)this).gameObject); GohanStateUtil.Shake(position, Profile.impactShake, 0.4f); strikePos = position; for (int i = 0; i < (Staggered ? 1 : HitCount); i++) { StrikeHit(); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } } private void StrikeHit() { //IL_003d: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_00ec: 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_00f6: 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) int num = strikesDone++; Vector3 val = ((Profile.slam > 0f) ? (Vector3.down * Profile.slam) : (Vector3.up * Profile.launch)); float endRadius = EndRadius; GameObject effect = ((Profile.impactEffect != null) ? Profile.impactEffect() : GohanEffects.HeavyImpact); float effectScale = ((Profile.impactEffect == null) ? 3f : ((Profile.impactEffectScale > 0f) ? Profile.impactEffectScale : endRadius)); bool flag = num == Profile.hits - 1; Moves.Blast((BaseState)(object)this, ((EntityState)this).characterBody, strikePos, endRadius, EndDamage / (float)HitCount, 1500f, Profile.source, stun: true, flag ? val : Vector3.zero, (Staggered && !flag) ? 0.5f : 1f, effect, effectScale); } private void EnterWindup() { //IL_009b: 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_00a0: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_0108: 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_0131: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) if (Profile.maxCharge > 0f) { charge = 0f; } Anim.Pose((BaseState)(object)this, Profile.chargeAnim, "PowerUpPose"); Util.PlaySound("Play_loader_R_activate", ((EntityState)this).gameObject); GohanEffects.FlashOverlay(((EntityState)this).GetModelTransform(), Mathf.Max(0.3f, Profile.windup)); if (!Application.isBatchMode) { Color val = ((Profile.auraColor.a > 0f) ? Profile.auraColor : Profile.color); Color val2 = ((Profile.auraAccent.a > 0f) ? Profile.auraAccent : Color.Lerp(val, Color.white, 0.45f)); aura = new GameObject("DBZRushWindupAura"); aura.transform.SetParent(((EntityState)this).transform, false); aura.transform.localPosition = Vector3.up * 1f; GohanEffects.CreateParticles(aura.transform, "Flame", GohanEffects.GlowMaterial, new Color(val.r, val.g, val.b, 0.9f), 140f, 0.5f, 0.45f, 2.5f, 0.9f, worldSpace: true, (ParticleSystemShapeType)0, -1.2f); GohanEffects.CreateParticles(aura.transform, "Embers", GohanEffects.GlowMaterial, new Color(val2.r, val2.g, val2.b, 0.9f), 50f, 0.2f, 0.6f, 3f, 0.8f, worldSpace: true, (ParticleSystemShapeType)0, -2f); GohanEffects.CreateLight(aura.transform, val, 8f, 3f); } } public override void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)aura) && Profile.maxCharge > 0f) { aura.transform.localScale = Vector3.one * Mathf.Lerp(0.8f, 1.6f, Mathf.Clamp01((((EntityState)this).age - Profile.windup) / Profile.maxCharge)); } } private void WindupFixedUpdate() { //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) if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.SetAimTimer(1f); } if (((EntityState)this).isAuthority && !(((EntityState)this).fixedAge < Profile.windup)) { bool flag = Profile.maxCharge > 0f; if (flag) { charge = Mathf.Clamp01(charge + ((EntityState)this).GetDeltaTime() * Fighters.ChargeRate(((EntityState)this).characterBody) / Profile.maxCharge); } if (flag && !Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot)) { charge = 1f; } if (!flag || !(charge < 1f) || !((BaseSkillState)this).IsKeyDownAuthority() || !(((EntityState)this).fixedAge < Profile.windup + Profile.maxCharge * 3f)) { RushStrike rushStrike = CreateDash(); rushStrike.dashPhase = true; rushStrike.charge = (flag ? charge : 1f); ((EntityState)this).outer.SetNextState((EntityState)(object)rushStrike); } } } private void StartDashVisuals() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_00e5: 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) bool num = Profile.trailColor.a > 0f; if (num) { AfterimageGhost.Spawn(((EntityState)this).GetModelTransform(), AfterimageGhost.Brighten(Profile.trailColor)); ghostsLeft = 2; } if (num || Profile.shellColor.a > 0f) { float shellRadius = ((Profile.shellRadius > 0f) ? Profile.shellRadius : (Profile.passThrough ? Profile.radius : 0f)); dashAura = RushAuraVisual.Create(((EntityState)this).characterBody, Profile.shellColor, shellRadius, Profile.trailColor, (Profile.trailColor2.a > 0f) ? Profile.trailColor2 : Profile.trailColor); } if (Profile.lifesteal > 0f || Profile.kiOnHit > 0f) { tether = SiphonTether.Listen(((EntityState)this).characterBody, Profile.color, Profile.source); } } private void ArrivalVisuals(Vector3 center) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)dashAura)) { dashAura.Stop(); } dashAura = null; if (Staggered) { StrikeArc(center); } else if (Profile.slash > 0) { SwordSlashVisual.ForRush(((EntityState)this).characterBody, center, direction, Profile.slash == 2, EndRadius); } if (Profile.impactRing) { Vector3 val = center + (((EntityState)this).characterBody.footPosition - ((EntityState)this).characterBody.corePosition); Shockwave.PowerBurst(val, EndRadius, (Profile.impactColor.a > 0f) ? Profile.impactColor : Profile.color, 0.5f, center); if (Profile.impactAccent.a > 0f) { Shockwave.Ground(val, EndRadius, Profile.impactAccent, -1f, dust: false, 0.12f, center); } } OnArrival(center); } private void StrikeArc(Vector3 center) { //IL_007d: 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_0058: Unknown result type (might be due to invalid IL or missing references) int num = arcsShown++; if (num > 0) { Util.PlaySound(Profile.staggerSound ?? "Play_merc_sword_swing", ((EntityState)this).gameObject); } if (Profile.slash > 0) { if (num == HitCount - 1) { SwordSlashVisual.ForRush(((EntityState)this).characterBody, center, direction, Profile.slash == 2, EndRadius); } else { SwordSlashVisual.ForBarrage(((EntityState)this).characterBody, center, num, EndRadius); } } } protected virtual void OnArrival(Vector3 center) { } public override void OnExit() { if (Object.op_Implicit((Object)(object)aura)) { EntityState.Destroy((Object)(object)aura); } if (Object.op_Implicit((Object)(object)dashAura)) { dashAura.Stop(); } if (Object.op_Implicit((Object)(object)tether)) { tether.Close(0.5f); } if (NetworkServer.active && !IsWindup && (Profile.lifesteal > 0f || Profile.kiOnHit > 0f)) { Lifesteal.Close(((EntityState)this).characterBody); } if (IsWindup) { ((EntityState)this).PlayAnimation("Gesture, Override", "Empty"); } if (((EntityState)this).isAuthority && !IsWindup) { GohanStateUtil.AntiGravity(((EntityState)this).characterMotor, on: false); } GohanStateUtil.SetGuard((EntityState)(object)this, 0); if (!string.IsNullOrEmpty(Profile.chargeAnim) || !string.IsNullOrEmpty(Profile.fireAnim)) { ((EntityState)this).PlayAnimation("Gesture, Override", "Empty"); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(direction); writer.Write(maxTravel); writer.Write(dashPhase); writer.Write(charge); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); direction = reader.ReadVector3(); maxTravel = reader.ReadSingle(); dashPhase = reader.ReadBoolean(); charge = reader.ReadSingle(); } } public class TeleportProfile : MoveProfile { public float range = 40f; public float damage; public float radius = 5f; public float iframes = 0.5f; public int chain = 1; public int minStrikes; public bool requireTarget; } public abstract class TeleportStrike : BaseSkillState { private int done; private float timer; private readonly List<HurtBox> targets = new List<HurtBox>(); private readonly AfterimageHopTracker ghosts = new AfterimageHopTracker(); private bool syncedFound; protected abstract TeleportProfile Profile { get; } public override void OnEnter() { //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_009a: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_025f: 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) ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority) { HurtBox val = Moves.FindTarget((BaseState)(object)this, ((EntityState)this).characterBody, Profile.range, 45f); if (Object.op_Implicit((Object)(object)val)) { targets.Add(val); } if (Profile.chain > 1) { BullseyeSearch val2 = new BullseyeSearch { searchOrigin = ((EntityState)this).characterBody.corePosition, maxDistanceFilter = Profile.range, teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()), filterByLoS = false, sortMode = (SortMode)1 }; val2.RefreshCandidates(); val2.FilterOutGameObject(((EntityState)this).gameObject); targets.AddRange((from h in val2.GetResults() where Object.op_Implicit((Object)(object)h) && Object.op_Implicit((Object)(object)h.healthComponent) && !targets.Any((HurtBox t) => (Object)(object)t.healthComponent == (Object)(object)h.healthComponent) group h by h.healthComponent into g select g.First()).Take(Profile.chain - targets.Count)); } syncedFound = targets.Count > 0; } if (Profile.requireTarget && !syncedFound) { if (((EntityState)this).isAuthority) { Util.PlaySound("Play_UI_insufficient_funds", ((EntityState)this).gameObject); KiHudBar.PopupIfLocal(((EntityState)this).characterBody, "No target in range", Color.gray); } return; } KiCost.SpendServer(((EntityState)this).characterBody, Profile.cost()); if (Profile.announce) { Moves.Popup(((EntityState)this).characterBody, Profile.name + "!", Profile.color); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, Profile.iframes); } Util.PlaySound("Play_huntress_shift_mini_blink", ((EntityState)this).gameObject); Anim.Pose((BaseState)(object)this, Profile.chargeAnim, null); GohanEffects.Spawn(GohanEffects.DashEffect, ((EntityState)this).characterBody.corePosition, Quaternion.identity); ghosts.Begin(((EntityState)this).transform, ((EntityState)this).GetModelTransform(), Profile.color); if (((EntityState)this).isAuthority && targets.Count == 0) { Hop(null); } } private void Hop(HurtBox target) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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) if (!string.IsNullOrEmpty(Profile.fireAnim)) { Anim.Pose((BaseState)(object)this, Profile.fireAnim, null); } Vector3 val2; if (Object.op_Implicit((Object)(object)target)) { Vector3 val = ((Component)target).transform.position - ((EntityState)this).characterBody.corePosition; val.y = 0f; val2 = ((Component)target).transform.position + ((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : ((EntityState)this).characterDirection.forward) * 2.2f; } else { Ray aimRay = ((BaseState)this).GetAimRay(); float num = Profile.range; Ray val3 = aimRay; float num2 = num; LayerIndex world = LayerIndex.world; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, ref val4, num2, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { num = Mathf.Max(0f, ((RaycastHit)(ref val4)).distance - 1.5f); } val2 = ((Ray)(ref aimRay)).GetPoint(num); } TeleportHelper.TeleportBody(((EntityState)this).characterBody, val2, false); GohanEffects.Spawn(GohanEffects.DashEffect, val2, Quaternion.identity); if (Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val5 = ((Component)target).transform.position - val2; val5.y = 0f; if (((Vector3)(ref val5)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = ((Vector3)(ref val5)).normalized; } } if (Profile.damage > 0f && Object.op_Implicit((Object)(object)target)) { Util.PlaySound(GohanConfig.SoundPunchHeavy.Value, ((EntityState)this).gameObject); Moves.Blast((BaseState)(object)this, ((EntityState)this).characterBody, ((Component)target).transform.position, Profile.radius, Profile.damage, 1000f, Profile.source, stun: true, Vector3.up * 400f, 1f, GohanEffects.HeavyImpact, 2f); } } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); ghosts.Tick(((EntityState)this).fixedAge); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (!((EntityState)this).isAuthority) { return; } timer -= ((EntityState)this).GetDeltaTime(); int num = ((targets.Count != 0) ? Mathf.Max(targets.Count, Profile.minStrikes) : 0); if (done < num && timer <= 0f) { timer = 0.18f; HurtBox val = targets[done++ % targets.Count]; if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { Hop(val); } else if (done >= targets.Count) { done = num; } } if (done >= num && ((EntityState)this).fixedAge >= 0.2f) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (!string.IsNullOrEmpty(Profile.chargeAnim) || !string.IsNullOrEmpty(Profile.fireAnim)) { ((EntityState)this).PlayAnimation("Gesture, Override", "Empty"); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(syncedFound); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); syncedFound = reader.ReadBoolean(); } } public class BurstProfile : MoveProfile { public float radius = 12f; public float damage = 3f; public float knockback = 1500f; public bool stun = true; public float windup = 0.3f; public bool shockwave = true; public bool tintEffects; public Color? coreColor; public bool flashOnly; public float blindRadius; public float stunDuration; public float windupGrow; public float selfHealthCostFraction; public bool eraseProjectiles; public BlindSpec blind; } public class BlindSpec { public float stun = 4f; public float bossStun = 1.5f; public float weakened = 6f; public bool dropAggro = true; public float casterCloak = 2.5f; } public abstract class KiBurst : BaseSkillState { private bool fired; private GameObject growSphere; protected abstract BurstProfile Profile { get; } public override void OnEnter() { //IL_0060: 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_00c4: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); KiCost.SpendServer(((EntityState)this).characterBody, Profile.cost()); GohanStateUtil.SetGuard((EntityState)(object)this, Profile.guard); if (Profile.announce) { Moves.Popup(((EntityState)this).characterBody, Profile.name + "!", Profile.color); } Anim.Pose((BaseState)(object)this, Profile.chargeAnim, "PowerUpPose"); Util.PlaySound("Play_loader_R_activate", ((EntityState)this).gameObject); if (Profile.windupGrow > 0f) { growSphere = BurstFx.CreateGrowSphere((Color)(((??)Profile.coreColor) ?? Profile.color)); } } public override void Update() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)growSphere)) { BurstFx.UpdateGrowSphere(growSphere, ((EntityState)this).characterBody.corePosition, Profile.windupGrow, ((EntityState)this).age / Mathf.Max(0.05f, Profile.windup)); } } public override void FixedUpdate() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_013d: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (!fired && ((EntityState)this).fixedAge >= Profile.windup) { fired = true; if (Object.op_Implicit((Object)(object)growSphere)) { EntityState.Destroy((Object)(object)growSphere); } if (!string.IsNullOrEmpty(Profile.fireAnim)) { Anim.Pose((BaseState)(object)this, Profile.fireAnim, null); } if (Profile.flashOnly) { BurstFx.WhiteFlash(((EntityState)this).characterBody, Profile.radius, Profile.blindRadius); } else if (Profile.tintEffects || Profile.coreColor.HasValue) { BurstFx.TintedPuffs(((EntityState)this).characterBody, Profile.radius, Profile.color, Profile.coreColor); } else { GohanEffects.Spawn(GohanEffects.TransformBurst, ((EntityState)this).characterBody.footPosition, Quaternion.identity, Profile.radius, transmit: false); GohanEffects.Spawn(GohanEffects.BigExplosion, ((EntityState)this).characterBody.corePosition, Quaternion.identity, Profile.radius * 0.6f, transmit: false); } if (Profile.shockwave) { Shockwave.PowerBurst(((EntityState)this).characterBody.footPosition, Profile.radius, Profile.color, 0.6f, ((EntityState)this).characterBody.corePosition); } Util.PlaySound("Play_loader_R_shock", ((EntityState)this).gameObject); GohanStateUtil.Shake(((EntityState)this).characterBody.corePosition, 1.5f, 0.5f); if (((EntityState)this).isAuthority) { Moves.Blast((BaseState)(object)this, ((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition, Profile.radius, Profile.damage, Profile.knockback, Profile.source, Profile.stun && Profile.stunDuration <= 0f, Vector3.up * Profile.knockback * 0.4f); } if (NetworkServer.active) { BurstFx.ReleaseServer(((EntityState)this).characterBody, Profile.radius, (Profile.stun && Profile.blind == null) ? Profile.stunDuration : 0f, Profile.eraseProjectiles, Profile.selfHealthCostFraction); } if (NetworkServer.active && Profile.blind != null) { BurstFx.BlindServer(((EntityState)this).characterBody, Profile.radius, Profile.blind); } } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= Profile.windup + 0.25f) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)growSphere)) { EntityState.Destroy((Object)(object)growSphere); } ((EntityState)this).PlayAnimation("Gesture, Override", "Empty"); GohanStateUtil.SetGuard((EntityState)(object)this, 0); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class BombProfile : MoveProfile { public float minCharge = 1f; public float maxCharge = 3f; public float drainPerSecond = 10f; public float damage = 12f; public float minDamageFraction = 0.4f; public float radius = 12f; public float ballSize = 2.5f; public float speed = 45f; public bool overhead; public bool autoRelease; public Anchor ballAnchor; public MarkProfile mark; } public abstract class ChargeBomb : BaseSkillState { private GameObject ball; private GohanController gohan; protected float charge; protected abstract BombProfile Profile { get; } private float Fraction => Mathf.Clamp01(charge / Mathf.Max(0.1f, Profile.maxCharge)); protected abstract ThrowBomb CreateThrow(); public override void OnEnter() { //IL_006c: 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) ((BaseState)this).OnEnter(); gohan = ((EntityState)this).GetComponent<GohanController>(); KiCost.SpendServer(((EntityState)this).characterBody, Profile.cost()); GohanStateUtil.SetGuard((EntityState)(object)this, Profile.guard); if (Profile.announce) { Moves.Popup(((EntityState)this).characterBody, Profile.name + "!", Profile.color); } Anim.Pose((BaseState)(object)this, Profile.chargeAnim, Profile.overhead ? "PowerUpPose" : "KameCharge"); Util.PlaySound("Play_mage_m2_charge", ((EntityState)this).gameObject); ball = GohanEffects.CreateKiBall(null, Profile.color, 0.4f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 0.4f; } } private Vector3 BallPosition() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0076: 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) Ray aimRay = ((BaseState)this).GetAimRay(); if (Profile.ballAnchor != Anchor.Default && Object.op_Implicit((Object)(object)gohan)) { return Anchors.Position(gohan, Profile.ballAnchor, aimRay) + ((Profile.ballAnchor == Anchor.Overhead) ? Vector3.up : ((Ray)(ref aimRay)).direction) * (0.3f * Mathf.Lerp(0.4f, Profile.ballSize, Fraction)); } if (Profile.overhead) { return ((EntityState)this).characterBody.corePosition + Vector3.up * (1.8f + Profile.ballSize * 0.6f * Fraction); } if (!Object.op_Implicit((Object)(object)gohan)) { return ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction; } return gohan.GetHandsPosition(aimRay); } public override void Update() { //IL_0020: 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_0055: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)ball)) { ball.transform.position = BallPosition(); ball.transform.localScale = Vector3.one * Mathf.Lerp(0.4f, Profile.ballSize, Fraction); } } public override void FixedUpdate() { //IL_00cc: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.SetAimTimer(2f); float deltaTime = ((EntityState)this).GetDeltaTime(); charge += deltaTime * Fighters.ChargeRate(((EntityState)this).characterBody); bool flag = !Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot); if (!flag) { KiCost.DrainServer(((EntityState)this).characterBody, Profile.cost(), Profile.drainPerSecond, deltaTime); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).characterMotor.velocity.y < -1f) { ((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, -1f, ((EntityState)this).characterMotor.velocity.z); } if (((EntityState)this).isAuthority) { bool num = ((EntityState)this).fixedAge >= Profile.minCharge; bool flag2 = charge >= Profile.maxCharge; bool flag3 = !flag && GohanBuffs.GetKi(((EntityState)this).characterBody) <= 0 && ((EntityState)this).fixedAge > 0.2f; bool flag4 = (flag ? flag2 : (!((BaseSkillState)this).IsKeyDownAuthority() || (Profile.autoRelease && flag2))); if ((num && flag4) || flag3) { ThrowBomb throwBomb = CreateThrow(); throwBomb.fraction = Fraction; throwBomb.start = BallPosition(); ((EntityState)this).outer.SetNextState((EntityState)(object)throwBomb); } } } public override void OnExit() { if (Object.op_Implicit((Object)(object)ball)) { EntityState.Destroy((Object)(object)ball); } ((EntityState)this).PlayAnimation("Gesture, Override", "Empty"); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f; } GohanStateUtil.SetGuard((EntityState)(object)this, 0); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public abstract class ThrowBomb : BaseSkillState { public const float ThrowDuration = 0.3f; public float fraction = 1f; public Vector3 start; private Vector3 end; private HurtBoxReference markTarget; protected abstract BombProfile Profile { get; } public override void OnEnter() { //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_0043: 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_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_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_007f: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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_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) ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); float num = ((Profile.mark != null) ? Profile.mark.range : 120f); RaycastHit val = default(RaycastHit); if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay, ref val, num, CommonMasks.bullet, (QueryTriggerInteraction)1)) { num = ((RaycastHit)(ref val)).distance; } end = ((Ray)(ref aimRay)).GetPoint(num); if (start == Vector3.zero) { start = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 2f; } if (Profile.mark != null) { markTarget = HurtBoxReference.FromHurtBox(MarkBlast.FindTargets(((EntityState)this).characterBody, aimRay, Profile.mark).FirstOrDefault()); } } if (!string.IsNullOrEmpty(Profile.fireAnim)) { Anim.Pose((BaseState)(object)this, Profile.fireAnim, null); } else { ((EntityState)this).PlayAnimation("Grapple", "FireHookIntro"); } Util.PlaySound("Play_mage_m2_shoot", ((EntityState)this).gameObject); float num2 = Mathf.Lerp(Profile.radius * 0.45f, Profile.radius, fraction); float coefficient = Profile.damage * Mathf.Lerp(Profile.minDamageFraction, 1f, fraction); if (Profile.mark != null) { HurtBox val2 = ((HurtBoxReference)(ref markTarget)).ResolveHurtBox(); MarkBlast.Launch(((EntityState)this).characterBody, (IList<HurtBox>)(object)((!Object.op_Implicit((Object)(object)val2)) ? null : new HurtBox[1] { val2 }), end, Profile.mark, num2, coefficient, num2 / Mathf.Max(0.01f, Profile.radius), allowFallback: true); } else { BombFlight.Launch(((EntityState)this).characterBody, ((EntityState)this).isAuthority, start, end, Mathf.Max(0.15f, Vector3.Distance(start, end) / Profile.speed), Profile.color, Mathf.Lerp(0.4f, Profile.ballSize, fraction), num2, coefficient, fraction, Profile.source); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.3f) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).PlayAnimation("Grapple", "FireHookExit"); if (!string.IsNullOrEmpty(Profile.chargeAnim) || !string.IsNullOrEmpty(Profile.fireAnim)) { ((EntityState)this).PlayAnimation("Gesture, Override", "Empty"); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } public override void OnSerialize(NetworkWriter writer) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(fraction); writer.Write(start); writer.Write(end); if (Profile.mark != null) { NetworkExtensions.Write(writer, markTarget); } } public override void OnDeserialize(NetworkReader reader) { //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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((BaseSkillState)this).OnDeserialize(reader); fraction = reader.ReadSingle(); start = reader.ReadVector3(); end = reader.ReadVector3(); if (Profile.mark != null) { markTarget = NetworkExtensions.ReadHurtBoxReference(reader); } } } public class BombFlight : MonoBehaviour { private CharacterBody owner; private bool dealsDamage; private Vector3 start; private Vector3 end; private float flight; private float age; private float radius; private float coefficient; private float fraction; private DamageSource source; private Color color; public static void Launch(CharacterBody owner, bool dealsDamage, Vector3 start, Vector3 end, float flight, Color color, float size, float radius, float coefficient, float fraction, DamageSource source) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_005a: 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_0061: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0021: Expected O, but got Unknown GameObject val = GohanEffects.CreateKiBall(null, color, 1f); if (!Object.op_Implicit((Object)(object)val)) { val = new GameObject("DBZThrownBall"); } val.transform.localScale = Vector3.one * size; val.transform.position = start; BombFlight bombFlight = val.AddComponent<BombFlight>(); bombFlight.owner = owner; bombFlight.dealsDamage = dealsDamage; bombFlight.start = start; bombFlight.end = end; bombFlight.flight = flight; bombFlight.radius = radius; bombFlight.coefficient = coefficient; bombFlight.fraction = fraction; bombFlight.source = source; bombFlight.color = color; } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = Vector3.Lerp(start, end, Mathf.Clamp01(age / flight)); } private void FixedUpdate() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) age += Time.fixedDeltaTime; if (!(age < flight)) { GohanEffects.Spawn(GohanEffects.BigExplosion, end, Quaternion.identity, Mathf.Min(radius, 7f), transmit: false); GohanEffects.Spawn(GohanEffects.TransformBurst, end, Quaternion.identity, Mathf.Min(radius, 6f), transmit: false); Shockwave.PowerBurst(end, radius, color, 0.7f, end); if (Object.op_Implicit((Object)(object)owner)) { Util.PlaySound("Play_loader_R_shock", ((Component)owner).gameObject); } GohanStateUtil.Shake(end, Mathf.Lerp(0.8f, 2.5f, fraction), 0.7f); if (dealsDamage && Object.op_Implicit((Object)(object)owner) && Util.HasEffectiveAuthority(((Component)owner).gameObject)) { Moves.Blast(null, owner, end, radius, coefficient, 2500f, source, stun: true, Vector3.up * 800f); } Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class PierceProfile : MoveProfile { public float windup = 0.6f; public float damage = 12f; public float radius = 1.2f; public float range = 250f; public float explosion; public float explosionRadius = 8f;