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 KisameSurvivor v1.2.0
plugins/KisameSurvivor/KisameSurvivor.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using EntityStates; using HG.BlendableTypes; using KinematicCharacterController; using KisameSurvivor.Audio; using KisameSurvivor.Data; using KisameSurvivor.Fx; using KisameSurvivor.Model; using KisameSurvivor.States; using Microsoft.CodeAnalysis; using R2API; using R2API.Utils; using RoR2; using RoR2.ConVar; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("RoR2")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 KisameSurvivor { public static class KisameBody { public static GameObject BodyPrefab { get; private set; } public static GameObject DisplayPrefab { get; private set; } public static SurvivorDef SurvivorDef { get; private set; } public static void Build() { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) GameObject obj = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody"); if (!Object.op_Implicit((Object)(object)obj)) { throw new Exception("CommandoBody not found; cannot clone"); } KisameItemDisplays.CaptureFromCommando(obj); BodyPrefab = PrefabAPI.InstantiateClone(obj, "KisameBody", true); for (int num = BodyPrefab.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)BodyPrefab.transform.GetChild(num)).gameObject); } SfxLocator component = BodyPrefab.GetComponent<SfxLocator>(); if (Object.op_Implicit((Object)(object)component)) { component.deathSound = ""; component.barkSound = ""; } ConfigureCharacterBody(BodyPrefab); RebuildModelHierarchy(BodyPrefab); ContentAddition.AddBody(BodyPrefab); KisameSkills.ConfigureSkillLocator(BodyPrefab); CharacterDeathBehavior component2 = BodyPrefab.GetComponent<CharacterDeathBehavior>(); if (Object.op_Implicit((Object)(object)component2)) { component2.deathState = new SerializableEntityStateType(typeof(KisameDeath)); } DisplayPrefab = BuildDisplayPrefab(); SkinDef val = BuildSkin(); Skins.AddSkinToCharacter(BodyPrefab, val); ModelSkinController componentInChildren = BodyPrefab.GetComponentInChildren<ModelSkinController>(); ModelSkinController componentInChildren2 = DisplayPrefab.GetComponentInChildren<ModelSkinController>(); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren2)) { componentInChildren2.skins = componentInChildren.skins; } SurvivorDef = ScriptableObject.CreateInstance<SurvivorDef>(); ((Object)SurvivorDef).name = "Kisame"; SurvivorDef.cachedName = "Kisame"; SurvivorDef.bodyPrefab = BodyPrefab; SurvivorDef.displayPrefab = DisplayPrefab; SurvivorDef.primaryColor = new Color(0.22f, 0.48f, 0.92f); SurvivorDef.displayNameToken = "KISAME_NAME"; SurvivorDef.descriptionToken = "KISAME_DESCRIPTION"; SurvivorDef.outroFlavorToken = "KISAME_OUTRO_FLAVOR"; SurvivorDef.mainEndingEscapeFailureFlavorToken = "KISAME_OUTRO_FAILURE"; SurvivorDef.desiredSortPosition = 17f; ContentAddition.AddSurvivorDef(SurvivorDef); KisamePlugin.Log.LogInfo((object)"KisameBody + SurvivorDef registered."); } private static void ConfigureCharacterBody(GameObject prefab) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = prefab.GetComponent<CharacterBody>(); component.baseNameToken = "KISAME_NAME"; component.subtitleNameToken = "KISAME_SUBTITLE"; component.portraitIcon = (Texture)(object)KisameAssets.LoadSprite("portrait.png").texture; component.bodyColor = new Color(0.22f, 0.48f, 0.92f); component.baseMaxHealth = 140f; component.levelMaxHealth = 42f; component.baseRegen = 1.25f; component.levelRegen = 0.25f; component.baseMaxShield = 0f; component.levelMaxShield = 0f; component.baseDamage = 12f; component.levelDamage = 2.4f; component.baseAttackSpeed = 1f; component.levelAttackSpeed = 0f; component.baseCrit = 1f; component.levelCrit = 0f; component.baseArmor = 20f; component.levelArmor = 0f; component.baseMoveSpeed = 7f; component.levelMoveSpeed = 0f; component.baseJumpPower = 15f; component.levelJumpPower = 0f; component.baseJumpCount = 1; component.baseAcceleration = 70f; component.sprintingSpeedMultiplier = 1.45f; component.autoCalculateLevelStats = false; component.rootMotionInMainState = false; component.hullClassification = (HullClassification)0; component.isChampion = false; } private static GameObject RebuildModelHierarchy(GameObject bodyPrefab) { //IL_000c: 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_0030: 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_0067: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_01ae: 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_025e: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = bodyPrefab.GetComponent<CharacterBody>(); Transform transform = new GameObject("ModelBase").transform; transform.SetParent(bodyPrefab.transform, false); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; Transform transform2 = new GameObject("CameraPivot").transform; transform2.SetParent(bodyPrefab.transform, false); transform2.localPosition = new Vector3(0f, 1.35f, 0f); Transform transform3 = new GameObject("AimOrigin").transform; transform3.SetParent(bodyPrefab.transform, false); transform3.localPosition = new Vector3(0f, 1.45f, 0f); component.aimOriginTransform = transform3; GameObject val = new GameObject("mdlKisame"); val.transform.SetParent(transform, false); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one; ChildLocator val2 = val.AddComponent<ChildLocator>(); CharacterModel obj = val.AddComponent<CharacterModel>(); obj.body = component; obj.itemDisplayRuleSet = KisameItemDisplays.RuleSet; obj.autoPopulateLightInfos = true; obj.invisibilityCount = 0; obj.temporaryOverlays = new List<TemporaryOverlayInstance>(); obj.baseRendererInfos = Array.Empty<RendererInfo>(); val.AddComponent<ModelSkinController>().skins = Array.Empty<SkinDef>(); val.AddComponent<KisameAnimDriver>(); val.AddComponent<KisameModelController>().IsLobbyDisplay = false; GameObject val3 = new GameObject("MainHurtBox"); val3.layer = LayerIndex.entityPrecise.intVal; val3.transform.SetParent(val.transform, false); val3.transform.localPosition = new Vector3(0f, 0.95f, 0f); CapsuleCollider obj2 = val3.AddComponent<CapsuleCollider>(); obj2.radius = 0.4f; obj2.height = 1.7f; obj2.direction = 1; HurtBoxGroup val4 = val.AddComponent<HurtBoxGroup>(); HurtBox val5 = val3.AddComponent<HurtBox>(); val5.isBullseye = true; val5.isSniperTarget = true; val5.damageModifier = (DamageModifier)0; val5.healthComponent = bodyPrefab.GetComponent<HealthComponent>(); val5.hurtBoxGroup = val4; val5.indexInGroup = 0; val4.mainHurtBox = val5; val4.bullseyeCount = 1; val4.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val5 }; bodyPrefab.GetComponent<HealthComponent>().body = component; val2.transformPairs = (NameTransformPair[])(object)new NameTransformPair[1] { new NameTransformPair { name = "MainHurtbox", transform = val3.transform } }; ModelLocator component2 = bodyPrefab.GetComponent<ModelLocator>(); component2.modelTransform = val.transform; component2.modelBaseTransform = transform; component2.dontDetatchFromParent = false; component2.normalizeToFloor = false; CharacterDirection component3 = bodyPrefab.GetComponent<CharacterDirection>(); if (Object.op_Implicit((Object)(object)component3)) { component3.targetTransform = transform; component3.overrideAnimatorForwardTransform = null; component3.rootMotionAccumulator = null; component3.modelAnimator = null; component3.driveFromRootRotation = false; component3.turnSpeed = 720f; } CameraTargetParams component4 = bodyPrefab.GetComponent<CameraTargetParams>(); if (Object.op_Implicit((Object)(object)component4)) { component4.cameraPivotTransform = transform2; CharacterCameraParams val6 = ScriptableObject.CreateInstance<CharacterCameraParams>(); ((Object)val6).name = "ccpKisame"; CharacterCameraParamsData data = (Object.op_Implicit((Object)(object)component4.cameraParams) ? component4.cameraParams.data : CharacterCameraParamsData.basic); data.pivotVerticalOffset = BlendableFloat.op_Implicit(1.35f); data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(1.6f, 0.2f, -6.2f)); val6.data = data; component4.cameraParams = val6; } return val; } private static SkinDef BuildSkin() { //IL_0022: 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) GameObject gameObject = ((Component)BodyPrefab.GetComponent<ModelLocator>().modelTransform).gameObject; Sprite icon = KisameAssets.LoadSprite("portrait.png"); return Skins.CreateNewSkinDef(new SkinDefParamsInfo { Name = "skinKisameDefault", NameToken = "KISAME_SKIN_NAME", Icon = icon, RootObject = gameObject, BaseSkins = Array.Empty<SkinDef>(), RendererInfos = Array.Empty<RendererInfo>(), GameObjectActivations = Array.Empty<GameObjectActivation>(), MeshReplacements = Array.Empty<MeshReplacement>(), ProjectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(), MinionSkinReplacements = Array.Empty<MinionSkinReplacement>() }); } private static GameObject BuildDisplayPrefab() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0072: Expected O, but got Unknown //IL_0078: Expected O, but got Unknown GameObject val = new GameObject("KisameDisplay"); val.AddComponent<ChildLocator>().transformPairs = Array.Empty<NameTransformPair>(); CharacterModel obj = val.AddComponent<CharacterModel>(); obj.autoPopulateLightInfos = true; obj.invisibilityCount = 0; obj.temporaryOverlays = new List<TemporaryOverlayInstance>(); obj.baseRendererInfos = Array.Empty<RendererInfo>(); val.AddComponent<ModelSkinController>().skins = Array.Empty<SkinDef>(); val.AddComponent<KisameAnimDriver>(); val.AddComponent<KisameModelController>().IsLobbyDisplay = true; GameObject result = PrefabAPI.InstantiateClone(val, "KisameDisplay", false); Object.Destroy((Object)val); return result; } } public static class KisameContent { public const string Prefix = "KISAME_"; private static readonly Dictionary<string, string> Tokens = new Dictionary<string, string> { { "KISAME_NAME", "Kisame" }, { "KISAME_SUBTITLE", "The Monster of the Hidden Mist" }, { "KISAME_DESCRIPTION", "Kisame is a melee bruiser who fights with Samehada. The blade drinks from whatever it cuts, and the water he throws keeps moving after it leaves his hand.\n\n<color=#CCD3E0> ! Samehada is a four-hit combo. The bite marks the target with Drain.\n ! Water Shark Bomb sends three sharks that bend toward nearby enemies.\n ! Water Body is a short rush. Passing through a Drained enemy refunds it.\n ! Great Shark Bullet is a slow shark that swallows enemy projectiles, grows, and bursts.\n</color>" }, { "KISAME_LORE", "\"Samehada is not a sword you swing and forget. It is hungry. Stand in front of it long enough and it will take more than blood.\"" }, { "KISAME_OUTRO_FLAVOR", "..and so he left, Samehada still dripping, already looking for the next thing worth eating." }, { "KISAME_OUTRO_FAILURE", "..and so he sank, and the blade kept chewing on the quiet." }, { "KISAME_PASSIVE_NAME", "Samehada's Appetite" }, { "KISAME_PASSIVE_DESC", "Direct Samehada hits heal Kisame for <style=cIsHealing>10% of that hit</style> (<style=cIsHealing>5%</style> against bosses and champions). The bite marks enemies with <style=cIsUtility>Drain</style> for 5 seconds. Item procs do not heal." }, { "KISAME_PRIMARY_NAME", "Samehada" }, { "KISAME_PRIMARY_DESC", "A four-link combo for <style=cIsDamage>240% + 240% + 290% (two cuts) + 440% damage</style>. Hold to chain. The last hit is a bite that applies <style=cIsUtility>Drain</style>." }, { "KISAME_SECONDARY_NAME", "Water Shark Bomb" }, { "KISAME_SECONDARY_DESC", "Loose <style=cIsDamage>3 sharks</style> that bend toward enemies. Each shark deals <style=cIsDamage>340% damage</style> in a small blast on contact, and splashes on terrain instead of fizzling." }, { "KISAME_UTILITY_NAME", "Water Body" }, { "KISAME_UTILITY_DESC", "Dissolve into water and rush <style=cIsUtility>18 meters</style> for <style=cIsDamage>340% damage</style>. Kisame cannot be hit during the rush and leaves a slowing wake. Touching a <style=cIsUtility>Drained</style> enemy refunds the cooldown." }, { "KISAME_SPECIAL_NAME", "Great Shark Bullet" }, { "KISAME_SPECIAL_DESC", "Send a fast shark that <style=cIsUtility>grows as it travels and eats enemy projectiles</style>. It bursts when it reaches an enemy, hits the world, or runs out of travel: <style=cIsDamage>1200% damage</style> at its starting size, up to <style=cIsDamage>1750%</style> when fully grown. It does not damage anything before the burst." }, { "KISAME_SKIN_NAME", "Hidden Mist" } }; public static void RegisterTokens() { foreach (KeyValuePair<string, string> token in Tokens) { LanguageAPI.Add(token.Key, token.Value); } } public static void SelfVerifyTokens() { int num = 0; foreach (KeyValuePair<string, string> token in Tokens) { string text = Language.GetString(token.Key); if (!string.IsNullOrEmpty(text) && text != token.Key) { num++; } else { KisamePlugin.Log.LogWarning((object)("[KisameVerify] Unresolved token: " + token.Key)); } } KisamePlugin.Log.LogInfo((object)$"[KisameVerify] Token verification: {num}/{Tokens.Count} resolved."); } } [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.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.woo.kisamesurvivor", "KisameSurvivor", "1.2.0")] public class KisamePlugin : BaseUnityPlugin { public const string PluginGUID = "com.woo.kisamesurvivor"; public const string PluginName = "KisameSurvivor"; public const string PluginVersion = "1.2.0"; public static ManualLogSource Log { get; private set; } public static KisamePlugin Instance { get; private set; } public static string PluginDir { get; private set; } private void Awake() { Instance = this; Log = ((BaseUnityPlugin)this).Logger; PluginDir = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); Log.LogInfo((object)("KisameSurvivor 1.2.0 initializing from " + PluginDir)); try { KisameAssets.Init(PluginDir); KisameAudio.Init(PluginDir); KisameAudio.Lang = ((((BaseUnityPlugin)this).Config.Bind<string>("Audio", "VoiceLanguage", "JP", "Kisame's voice: JP (original Japanese) or EN (English dub).").Value.Trim().ToLowerInvariant() == "en") ? "en" : "jp"); KisameContent.RegisterTokens(); KisameSkills.Init(); KisameBody.Build(); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnGameLoaded)); Log.LogInfo((object)"KisameSurvivor Awake complete."); } catch (Exception arg) { Log.LogError((object)$"Awake failed: {arg}"); } } private void OnGameLoaded() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0025: 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) try { KisameContent.SelfVerifyTokens(); SurvivorIndex val = SurvivorCatalog.FindSurvivorIndex("Kisame"); BodyIndex val2 = BodyCatalog.FindBodyIndex("KisameBody"); Log.LogInfo((object)$"[KisameVerify] Catalog check: SurvivorIndex={val} BodyIndex={val2}"); } catch (Exception arg) { Log.LogError((object)$"OnGameLoaded verify failed: {arg}"); } } } public static class KisameSkills { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__25_0; internal void <CreateBuffs>b__25_0(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)SlowBuff) && sender.HasBuff(SlowBuff)) { args.moveSpeedMultAdd -= 0.45f; } } } private static BodyIndex _kisameIndex = (BodyIndex)(-1); public static SkillDef PrimarySkillDef { get; private set; } public static SkillDef SecondarySkillDef { get; private set; } public static SkillDef UtilitySkillDef { get; private set; } public static SkillDef SpecialSkillDef { get; private set; } public static BuffDef DrainBuff { get; private set; } public static BuffDef SlowBuff { get; private set; } public static void Init() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0027: 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_0093: 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_0119: Unknown result type (might be due to invalid IL or missing references) CreateBuffs(); bool flag = default(bool); ContentAddition.AddEntityState<SamehadaCombo>(ref flag); ContentAddition.AddEntityState<WaterSharkBomb>(ref flag); ContentAddition.AddEntityState<WaterBodyDash>(ref flag); ContentAddition.AddEntityState<GreatSharkBullet>(ref flag); ContentAddition.AddEntityState<KisameDeath>(ref flag); PrimarySkillDef = CreateSkillDef("KisamePrimarySamehada", "KISAME_PRIMARY_NAME", "KISAME_PRIMARY_DESC", KisameAssets.LoadSprite("primary.png"), new SerializableEntityStateType(typeof(SamehadaCombo)), "Weapon", 0f, 1, 1, 0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, (InterruptPriority)0); SecondarySkillDef = CreateSkillDef("KisameSecondarySharkBomb", "KISAME_SECONDARY_NAME", "KISAME_SECONDARY_DESC", KisameAssets.LoadSprite("secondary.png"), new SerializableEntityStateType(typeof(WaterSharkBomb)), "Weapon", 4.5f, 1, 1, 1, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, (InterruptPriority)1); UtilitySkillDef = CreateSkillDef("KisameUtilityWaterBody", "KISAME_UTILITY_NAME", "KISAME_UTILITY_DESC", KisameAssets.LoadSprite("utility.png"), new SerializableEntityStateType(typeof(WaterBodyDash)), "Body", 6f, 1, 1, 1, isCombatSkill: false, mustKeyPress: true, cancelSprintingOnActivation: true, (InterruptPriority)2); SpecialSkillDef = CreateSkillDef("KisameSpecialDaikodan", "KISAME_SPECIAL_NAME", "KISAME_SPECIAL_DESC", KisameAssets.LoadSprite("special.png"), new SerializableEntityStateType(typeof(GreatSharkBullet)), "Weapon", 12f, 1, 1, 1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: true, (InterruptPriority)2); ContentAddition.AddSkillDef(PrimarySkillDef); ContentAddition.AddSkillDef(SecondarySkillDef); ContentAddition.AddSkillDef(UtilitySkillDef); ContentAddition.AddSkillDef(SpecialSkillDef); } private static void CreateBuffs() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown DrainBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)DrainBuff).name = "bdKisameDrain"; DrainBuff.buffColor = new Color(0.15f, 0.35f, 0.85f); DrainBuff.canStack = false; DrainBuff.isDebuff = true; DrainBuff.iconSprite = KisameAssets.LoadSprite("primary.png"); ContentAddition.AddBuffDef(DrainBuff); SlowBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)SlowBuff).name = "bdKisameWaterSlow"; SlowBuff.buffColor = new Color(0.45f, 0.75f, 1f); SlowBuff.canStack = false; SlowBuff.isDebuff = true; SlowBuff.iconSprite = KisameAssets.LoadSprite("utility.png"); ContentAddition.AddBuffDef(SlowBuff); GlobalEventManager.onServerDamageDealt += OnServerDamageDealt; object obj = <>c.<>9__25_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)SlowBuff) && sender.HasBuff(SlowBuff)) { args.moveSpeedMultAdd -= 0.45f; } }; <>c.<>9__25_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; } private static void OnServerDamageDealt(DamageReport report) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Invalid comparison between Unknown and I4 //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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) CharacterBody val = report?.attackerBody; if (!Object.op_Implicit((Object)(object)val) || report.damageInfo == null || (int)report.damageInfo.damageType.damageSource != 1) { return; } if ((int)_kisameIndex == -1) { _kisameIndex = BodyCatalog.FindBodyIndex(KisameBody.BodyPrefab); } if (val.bodyIndex == _kisameIndex) { CharacterBody victimBody = report.victimBody; bool flag = Object.op_Implicit((Object)(object)victimBody) && (victimBody.isChampion || (Object.op_Implicit((Object)(object)victimBody.master) && victimBody.master.isBoss)); if (Object.op_Implicit((Object)(object)val.healthComponent) && report.damageDealt > 0f) { val.healthComponent.Heal(report.damageDealt * (flag ? 0.05f : 0.1f), default(ProcChainMask), true); } if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)DrainBuff) && report.damageInfo.procCoefficient >= 0.99f) { victimBody.AddTimedBuff(DrainBuff, 5f); } } } private static SkillDef CreateSkillDef(string name, string nameToken, string descToken, Sprite icon, SerializableEntityStateType activationState, string machineName, float rechargeInterval, int baseMaxStock, int rechargeStock, int stockToConsume, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, InterruptPriority interruptPriority) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) SkillDef obj = ScriptableObject.CreateInstance<SkillDef>(); obj.skillName = name; ((Object)obj).name = name; obj.skillNameToken = nameToken; obj.skillDescriptionToken = descToken; obj.icon = icon; obj.activationState = activationState; obj.activationStateMachineName = machineName; obj.baseRechargeInterval = rechargeInterval; obj.baseMaxStock = baseMaxStock; obj.rechargeStock = rechargeStock; obj.requiredStock = ((stockToConsume > 0) ? 1 : 0); obj.stockToConsume = stockToConsume; obj.resetCooldownTimerOnUse = false; obj.fullRestockOnAssign = true; obj.dontAllowPastMaxStocks = false; obj.beginSkillCooldownOnSkillEnd = true; obj.cancelSprintingOnActivation = cancelSprintingOnActivation; obj.forceSprintDuringState = false; obj.canceledFromSprinting = false; obj.isCombatSkill = isCombatSkill; obj.mustKeyPress = mustKeyPress; obj.interruptPriority = interruptPriority; obj.keywordTokens = Array.Empty<string>(); return obj; } public static void ConfigureSkillLocator(GameObject bodyPrefab) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = bodyPrefab.GetComponent<SkillLocator>(); component.passiveSkill = new PassiveSkill { enabled = true, skillNameToken = "KISAME_PASSIVE_NAME", skillDescriptionToken = "KISAME_PASSIVE_DESC", icon = KisameAssets.LoadSprite("portrait.png") }; AssignSkillSlot(component.primary, PrimarySkillDef, "Primary"); AssignSkillSlot(component.secondary, SecondarySkillDef, "Secondary"); AssignSkillSlot(component.utility, UtilitySkillDef, "Utility"); AssignSkillSlot(component.special, SpecialSkillDef, "Special"); } private static void AssignSkillSlot(GenericSkill slot, SkillDef def, string name) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val).name = "KisameBody" + name + "Family"; Variant[] array = new Variant[1]; Variant val2 = new Variant { skillDef = def, unlockableDef = null }; ((Variant)(ref val2)).viewableNode = new Node(def.skillNameToken, false, (Node)null); array[0] = val2; val.variants = (Variant[])(object)array; val.defaultVariantIndex = 0u; slot._skillFamily = val; ContentAddition.AddSkillFamily(val); } } } namespace KisameSurvivor.States { public abstract class KisameSkillState : BaseSkillState { protected KisameModelController Model; private static readonly Collider[] Overlap = (Collider[])(object)new Collider[32]; protected readonly List<HealthComponent> _hit = new List<HealthComponent>(8); protected virtual DamageSource Source => (DamageSource)1; public override void OnEnter() { ((BaseState)this).OnEnter(); Transform modelTransform = ((EntityState)this).GetModelTransform(); Model = (Object.op_Implicit((Object)(object)modelTransform) ? ((Component)modelTransform).GetComponent<KisameModelController>() : null); } protected Vector3 FlatAim() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0049: 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_004e: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).transform.forward); } val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude < 0.0001f)) { return ((Vector3)(ref val)).normalized; } return Vector3.forward; } protected int CollectHits(Vector3 center, float radius) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) _hit.Clear(); Collider[] overlap = Overlap; LayerIndex entityPrecise = LayerIndex.entityPrecise; int num = Physics.OverlapSphereNonAlloc(center, radius, overlap, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask), (QueryTriggerInteraction)2); TeamIndex team = ((BaseState)this).GetTeam(); for (int i = 0; i < num; i++) { HurtBox val = (Object.op_Implicit((Object)(object)Overlap[i]) ? ((Component)Overlap[i]).GetComponent<HurtBox>() : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive && !((Object)(object)val.healthComponent.body == (Object)(object)((EntityState)this).characterBody) && FriendlyFireManager.ShouldSplashHitProceed(val.healthComponent, team) && !_hit.Contains(val.healthComponent)) { _hit.Add(val.healthComponent); } } return _hit.Count; } public static DamageTypeCombo WithDamageSource(DamageType type, DamageSource source) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return new DamageTypeCombo(DamageTypeCombo.op_Implicit(type), (DamageTypeExtended)0, source); } protected void Blast(Vector3 center, float radius, float coefficient, float force, float proc) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), position = center, radius = radius, baseDamage = ((BaseState)this).damageStat * coefficient, baseForce = force, bonusForce = Vector3.up * (force * 0.2f), crit = ((BaseState)this).RollCrit(), damageType = WithDamageSource((DamageType)0, Source), falloffModel = (FalloffModel)0, procCoefficient = proc, damageColorIndex = (DamageColorIndex)0, attackerFiltering = (AttackerFiltering)2 }.Fire(); } protected void SlowAround(Vector3 center, float radius, float seconds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) CollectHits(center, radius); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)KisameSkills.SlowBuff)) { return; } for (int i = 0; i < _hit.Count; i++) { CharacterBody val = (Object.op_Implicit((Object)(object)_hit[i]) ? _hit[i].body : null); if (Object.op_Implicit((Object)(object)val)) { val.AddTimedBuff(KisameSkills.SlowBuff, seconds); } } } protected bool TouchedDrained() { if (!Object.op_Implicit((Object)(object)KisameSkills.DrainBuff)) { return false; } for (int i = 0; i < _hit.Count; i++) { CharacterBody val = (Object.op_Implicit((Object)(object)_hit[i]) ? _hit[i].body : null); if (Object.op_Implicit((Object)(object)val) && val.HasBuff(KisameSkills.DrainBuff)) { return true; } } return false; } } public sealed class KisameComboTracker : MonoBehaviour { public int Step; public float Expire; } public class SamehadaCombo : KisameSkillState { private static readonly string[] Clips = new string[4] { "Primary1", "Primary2", "Primary3", "Primary4" }; private static readonly float[] Coeffs = new float[4] { 2.4f, 2.4f, 1.45f, 4.4f }; private const float ClipSpeed = 1.9f; private int _step; private int _next; private float _speed; private float _duration; private float[] _marks; private bool _chained; private KisameComboTracker _tracker; public override void OnEnter() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); _tracker = ((EntityState)this).GetComponent<KisameComboTracker>() ?? ((EntityState)this).gameObject.AddComponent<KisameComboTracker>(); if (Time.time > _tracker.Expire) { _tracker.Step = 0; } _step = _tracker.Step; _tracker.Step = (_step + 1) % Clips.Length; _speed = 1.9f * Mathf.Max(0.8f, ((BaseState)this).attackSpeedStat); string clip = Clips[_step]; _duration = KisameClipData.Duration(clip) / _speed; float[] array = KisameClipData.Hits(clip); _marks = new float[array.Length]; for (int i = 0; i < array.Length; i++) { _marks[i] = array[i] / _speed; } Model?.PlayAction(clip, _duration, _speed); ((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), _duration + 0.3f, false); } public override void FixedUpdate() { //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_0034: 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) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { ((EntityState)this).characterMotor.moveDirection = ((EntityState)this).inputBank.moveVector * 0.75f; } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.moveVector = FlatAim(); } while (_next < _marks.Length && ((EntityState)this).fixedAge >= _marks[_next]) { Swing(_next++); } if (((EntityState)this).isAuthority) { if (((EntityState)this).fixedAge >= _duration * 0.8f && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.skill1.down && _step < Clips.Length - 1) { _chained = true; ((EntityState)this).outer.SetNextState((EntityState)(object)new SamehadaCombo()); } else if (((EntityState)this).fixedAge >= _duration) { ((EntityState)this).outer.SetNextStateToMain(); } } } private void Swing(int hitNo) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_00bc: 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_00d0: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_0150: 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_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) bool flag = _step == 3; KisameAudio.Sfx("swing", 5, flag ? 0.95f : 0.8f, ((EntityState)this).transform.position); KisameAudio.Sfx("cloth", 2, 0.5f, ((EntityState)this).transform.position); if (flag) { KisameAudio.Voice("atk_m", 4, 1f, 0.2f, 0.9f, ((EntityState)this).transform.position); } else if (hitNo == 0) { KisameAudio.Voice("atk_s", 4, 0.75f, 0.35f, 0.85f, ((EntityState)this).transform.position); } Vector3 val = ((EntityState)this).transform.position + FlatAim() * (flag ? 2.1f : 1.8f) + Vector3.up * 1.15f; float radius = (flag ? 2.9f : 2.4f); if (((EntityState)this).isAuthority) { if (CollectHits(val, radius) > 0) { KisameAudio.Sfx("hit", 3, flag ? 1f : 0.85f, val); KisameFx.StormHit(val, FlatAim(), flag ? 1.4f : 1f); KisameFx.Droplets(val, flag ? 1.3f : 0.8f, flag ? 30 : 16); } Blast(val, radius, Coeffs[_step], flag ? 260f : 90f, flag ? 1f : 0.7f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = FlatAim() * (flag ? 6f : 2.5f); } } } public override void OnExit() { if (Object.op_Implicit((Object)(object)_tracker)) { _tracker.Expire = Time.time + 1.1f; } if (!_chained && _step < Clips.Length - 1) { Model?.PlayAction("Sheath", 0.3f, 1.4f); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class WaterSharkBomb : KisameSkillState { private float _duration; private float _speed; private float _mark; private bool _fired; protected override DamageSource Source => (DamageSource)2; public override void OnEnter() { //IL_0076: 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) base.OnEnter(); _speed = 1.5f * Mathf.Max(0.8f, ((BaseState)this).attackSpeedStat); _duration = KisameClipData.Duration("Secondary") / _speed; _mark = KisameClipData.Hits("Secondary")[0] / _speed; Model?.PlayAction("Secondary", _duration, _speed); ((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), 0.8f, false); KisameAudio.Voice("jutsu", 1, 1f, 0.3f, 0.95f, ((EntityState)this).transform.position); KisamePlugin.Log.LogInfo((object)"[Kisame] Water Shark Bomb"); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!_fired && ((EntityState)this).fixedAge >= _mark) { _fired = true; LooseSharks(); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= _duration * 0.9f) { ((EntityState)this).outer.SetNextStateToMain(); } } private void LooseSharks() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (Object.op_Implicit((Object)(object)Model) ? Model.HandPosition() : ((EntityState)this).characterBody.corePosition); val += FlatAim() * 0.8f + Vector3.up * 0.15f; KisameAudio.Sfx("throw", 2, 0.9f, val); float[] array = new float[3] { -20f, 0f, 20f }; for (int i = 0; i < array.Length; i++) { Vector3 val2 = Quaternion.Euler(0f, array[i], 0f) * FlatAim(); (KisameEffect.Spawn("bomb", "Fly", val, Quaternion.LookRotation(val2, Vector3.up), 0.42f, loop: true) ?? KisameFx.SpawnShark(val, Quaternion.LookRotation(val2, Vector3.up), 0.9f)).AddComponent<KisameWaterShark>().Init(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), ((BaseState)this).damageStat, ((BaseState)this).RollCrit(), val2); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class WaterBodyDash : KisameSkillState { public const float Distance = 18f; public const float Duration = 0.5f; private const float DamageCoefficient = 3.4f; private const float HitRadius = 2.4f; private Vector3 _dir; private Vector3 _last; private float _traveled; private float _slowTick; private float _splashTick; private bool _refund; private HurtBoxGroup _hurtGroup; private bool _hurtCounted; private int _struck; private readonly HashSet<HealthComponent> _passed = new HashSet<HealthComponent>(); protected override DamageSource Source => (DamageSource)4; public override void OnEnter() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); _dir = FlatAim(); _last = ((EntityState)this).transform.position; Model?.PlayAction("Utility", 0.5f, KisameClipData.Duration("Utility") / 0.5f); KisameAudio.Voice("dash", 3, 0.9f, 0.3f, 0.9f, ((EntityState)this).transform.position); KisameAudio.Sfx("dive", 1, 0.85f, ((EntityState)this).transform.position); KisameAudio.Sfx("dash", 2, 0.8f, ((EntityState)this).transform.position); KisameFx.StormDash(((EntityState)this).transform.position, _dir); Transform modelTransform = ((EntityState)this).GetModelTransform(); _hurtGroup = (Object.op_Implicit((Object)(object)modelTransform) ? ((Component)modelTransform).GetComponent<HurtBoxGroup>() : null); if (Object.op_Implicit((Object)(object)_hurtGroup)) { HurtBoxGroup hurtGroup = _hurtGroup; int hurtBoxesDeactivatorCounter = hurtGroup.hurtBoxesDeactivatorCounter; hurtGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter + 1; _hurtCounted = true; } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } KisamePlugin.Log.LogInfo((object)"[Kisame] Water Body"); } public override void FixedUpdate() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = 41.399998f * Time.fixedDeltaTime; if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && (Object)(object)((BaseCharacterController)((EntityState)this).characterMotor).Motor != (Object)null) { ((EntityState)this).characterMotor.velocity = Vector3.zero; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += _dir * num; ((EntityState)this).characterMotor.moveDirection = Vector3.zero; if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.moveVector = _dir; } } float traveled = _traveled; Vector3 val = ((EntityState)this).transform.position - _last; _traveled = traveled + ((Vector3)(ref val)).magnitude; _last = ((EntityState)this).transform.position; StrikePassedEnemies(); _splashTick -= Time.fixedDeltaTime; if (_splashTick <= 0f) { _splashTick = 0.09f; KisameEffect.Spawn("mptc06", "Play", ((EntityState)this).transform.position, Quaternion.LookRotation(_dir), 0.28f, loop: false); } _slowTick -= Time.fixedDeltaTime; if (_slowTick <= 0f) { _slowTick = 0.08f; if (((EntityState)this).isAuthority || NetworkServer.active) { SlowAround(((EntityState)this).transform.position + Vector3.up, 2.2f, 1.6f); if (((EntityState)this).isAuthority && !_refund && TouchedDrained()) { _refund = true; } } } if (((EntityState)this).isAuthority && (((EntityState)this).fixedAge >= 0.6f || _traveled >= 18f)) { ((EntityState)this).outer.SetNextStateToMain(); } } private void StrikePassedEnemies() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00f5: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } int num = CollectHits(((EntityState)this).transform.position + Vector3.up, 2.4f); for (int i = 0; i < num; i++) { HealthComponent val = _hit[i]; if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.body) && _passed.Add(val)) { _struck++; CharacterBody body = val.body; val.TakeDamage(new DamageInfo { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, damage = ((BaseState)this).damageStat * 3.4f, damageType = KisameSkillState.WithDamageSource((DamageType)0, (DamageSource)4), damageColorIndex = (DamageColorIndex)0, position = body.corePosition, force = Vector3.zero, crit = ((BaseState)this).RollCrit(), procCoefficient = 0.7f }); KisameAudio.Sfx("hit", 3, 0.8f, body.corePosition); KisameFx.StormHit(body.corePosition, _dir, 1f); } } } public override void OnExit() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_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) KisameEffect.Spawn("mptc06", "Play", ((EntityState)this).transform.position, Quaternion.LookRotation(_dir), 0.5f, loop: false); if (_hurtCounted && Object.op_Implicit((Object)(object)_hurtGroup)) { HurtBoxGroup hurtGroup = _hurtGroup; int hurtBoxesDeactivatorCounter = hurtGroup.hurtBoxesDeactivatorCounter; hurtGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter - 1; } _hurtCounted = false; ((EntityState)this).OnExit(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = _dir * 8f; } if (_refund && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.utility)) { GenericSkill utility = ((EntityState)this).skillLocator.utility; if (utility.stock < utility.maxStock) { utility.AddOneStock(); } KisamePlugin.Log.LogInfo((object)"[Kisame] Water Body refunded on Drain"); } KisamePlugin.Log.LogInfo((object)$"[Kisame] Water Body end: {_traveled:0.00} m, {_struck} struck"); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class GreatSharkBullet : KisameSkillState { private float _duration; private float _speed; private float _mark; private bool _fired; protected override DamageSource Source => (DamageSource)8; public override void OnEnter() { //IL_008f: 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) base.OnEnter(); _speed = 1.7f * Mathf.Max(0.8f, ((BaseState)this).attackSpeedStat); _duration = KisameClipData.Duration("Special") / _speed; _mark = KisameClipData.Hits("Special")[0] / _speed; Model?.PlayAction("Special", _duration, _speed); KisameAudio.Voice("special", 6, 1f, 0.3f, 1f, ((EntityState)this).transform.position); ((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), 1.2f, true); KisamePlugin.Log.LogInfo((object)"[Kisame] Great Shark Bullet"); } public override void FixedUpdate() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; } if (!_fired && ((EntityState)this).fixedAge >= _mark) { _fired = true; Launch(); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= _duration) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Launch() { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = FlatAim(); Vector3 position = ((EntityState)this).characterBody.corePosition + val * 1.4f; GameObject val2 = KisameEffect.Spawn("great", "Fly", position, Quaternion.LookRotation(val, Vector3.up), 0.5f, loop: true); bool flag = (Object)(object)val2 != (Object)null; if (!Object.op_Implicit((Object)(object)val2)) { val2 = KisameFx.SpawnShark(position, Quaternion.LookRotation(val, Vector3.up), 1.8f); } KisameDaikodan kisameDaikodan = val2.AddComponent<KisameDaikodan>(); kisameDaikodan.Init(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), ((BaseState)this).damageStat, ((BaseState)this).RollCrit(), val); kisameDaikodan.VisualScale = (flag ? 0.5f : 1.7f); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class KisameDeath : GenericCharacterDeath { public override void PlayDeathAnimation(float crossfadeDuration = 0.1f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) KisameAudio.Voice("death", 1, 1f, 0f, 1f, ((EntityState)this).transform.position); Transform modelTransform = ((EntityState)this).GetModelTransform(); (Object.op_Implicit((Object)(object)modelTransform) ? ((Component)modelTransform).GetComponent<KisameModelController>() : null)?.PlayAction("Death", 2.5f); } } public class KisameWaterShark : MonoBehaviour { private GameObject _attacker; private TeamIndex _team; private float _damageStat; private bool _crit; private Vector3 _dir; private float _life = 1.55f; private bool _done; private static readonly Collider[] Hits = (Collider[])(object)new Collider[16]; public void Init(GameObject attacker, TeamIndex team, float damageStat, bool crit, Vector3 dir) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_003a: Unknown result type (might be due to invalid IL or missing references) _attacker = attacker; _team = team; _damageStat = damageStat; _crit = crit; _dir = ((((Vector3)(ref dir)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref dir)).normalized : Vector3.forward); } private void FixedUpdate() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0068: 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_008a: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (_done) { return; } _life -= Time.fixedDeltaTime; Steer(); float num = 24f * Time.fixedDeltaTime; Vector3 position = ((Component)this).transform.position; Vector3 dir = _dir; LayerIndex world = LayerIndex.world; RaycastHit val = default(RaycastHit); if (Physics.SphereCast(position, 0.25f, dir, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { Transform transform = ((Component)this).transform; transform.position += _dir * Mathf.Max(0f, ((RaycastHit)(ref val)).distance - 0.1f); Pop(); return; } Vector3 val2 = ((Component)this).transform.position + _dir * num; Vector3 val3 = val2 + Vector3.up * 3f; Vector3 down = Vector3.down; world = LayerIndex.world; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, down, ref val4, 8f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { val2.y = Mathf.Max(val2.y, ((RaycastHit)(ref val4)).point.y + 0.35f); } ((Component)this).transform.position = val2; ((Component)this).transform.rotation = Quaternion.LookRotation(_dir, Vector3.up); if (TouchingEnemy()) { Pop(); } else if (_life <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Steer() { //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_0012: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_0101: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; float num = 324f; Vector3 position = ((Component)this).transform.position; Collider[] hits = Hits; LayerIndex entityPrecise = LayerIndex.entityPrecise; int num2 = Physics.OverlapSphereNonAlloc(position, 18f, hits, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask), (QueryTriggerInteraction)2); for (int i = 0; i < num2; i++) { HurtBox val2 = (Object.op_Implicit((Object)(object)Hits[i]) ? ((Component)Hits[i]).GetComponent<HurtBox>() : null); if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)val2.healthComponent) || !val2.healthComponent.alive || !FriendlyFireManager.ShouldSplashHitProceed(val2.healthComponent, _team)) { continue; } Vector3 val3 = val2.healthComponent.body.corePosition - ((Component)this).transform.position; if (!(Vector3.Dot(((Vector3)(ref val3)).normalized, _dir) < 0.35f)) { float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; val = val2.healthComponent.body.corePosition; } } } if (!(val == Vector3.zero)) { Vector3 val4 = val - ((Component)this).transform.position; val4.y *= 0.25f; if (!(((Vector3)(ref val4)).sqrMagnitude < 0.01f)) { _dir = Vector3.RotateTowards(_dir, ((Vector3)(ref val4)).normalized, 1.7f * Time.fixedDeltaTime, 0f); } } } private bool TouchingEnemy() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Collider[] hits = Hits; LayerIndex entityPrecise = LayerIndex.entityPrecise; int num = Physics.OverlapSphereNonAlloc(position, 0.9f, hits, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask), (QueryTriggerInteraction)2); for (int i = 0; i < num; i++) { HurtBox val = (Object.op_Implicit((Object)(object)Hits[i]) ? ((Component)Hits[i]).GetComponent<HurtBox>() : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive && FriendlyFireManager.ShouldSplashHitProceed(val.healthComponent, _team)) { return true; } } return false; } private void Pop() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0022: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_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) _done = true; if (NetworkServer.active) { new BlastAttack { attacker = _attacker, inflictor = ((Component)this).gameObject, teamIndex = _team, position = ((Component)this).transform.position, radius = 2.2f, baseDamage = _damageStat * 3.4f, baseForce = 380f, bonusForce = Vector3.up * 120f, crit = _crit, damageType = KisameSkillState.WithDamageSource((DamageType)0, (DamageSource)2), falloffModel = (FalloffModel)0, procCoefficient = 0.8f, damageColorIndex = (DamageColorIndex)0, attackerFiltering = (AttackerFiltering)2 }.Fire(); } KisameFx.StormPop(((Component)this).transform.position, ((Component)this).transform.rotation, 1f); Object.Destroy((Object)(object)((Component)this).gameObject); } } public class KisameDaikodan : MonoBehaviour { private GameObject _attacker; private TeamIndex _team; private float _damageStat; private bool _crit; private Vector3 _dir; private float _age; private float _scale = 1f; private int _eaten; private bool _done; public float VisualScale = 1.7f; private const float Life = 2.2f; private const float Speed = 16f; private static readonly Collider[] Hits = (Collider[])(object)new Collider[24]; public void Init(GameObject attacker, TeamIndex team, float damageStat, bool crit, Vector3 dir) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_003a: Unknown result type (might be due to invalid IL or missing references) _attacker = attacker; _team = team; _damageStat = damageStat; _crit = crit; _dir = ((((Vector3)(ref dir)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref dir)).normalized : Vector3.forward); } private void FixedUpdate() { //IL_0057: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) if (_done) { return; } _age += Time.fixedDeltaTime; EatProjectiles(); _scale = Mathf.Min(2.5f, 1f + (float)_eaten * 0.15f + _age * 0.22f); ((Component)this).transform.localScale = Vector3.one * (VisualScale * _scale); float num = 16f * Time.fixedDeltaTime; Vector3 position = ((Component)this).transform.position; float num2 = 0.45f * _scale; Vector3 dir = _dir; float num3 = num + 0.05f; LayerIndex world = LayerIndex.world; RaycastHit val = default(RaycastHit); if (Physics.SphereCast(position, num2, dir, ref val, num3, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { Transform transform = ((Component)this).transform; transform.position += _dir * Mathf.Max(0f, ((RaycastHit)(ref val)).distance - 0.2f); Detonate(); return; } Transform transform2 = ((Component)this).transform; transform2.position += _dir * num; ((Component)this).transform.rotation = Quaternion.LookRotation(_dir, Vector3.up); if (TouchingEnemy()) { Detonate(); } else if (_age >= 2.2f) { Detonate(); } } private bool TouchingEnemy() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; float num = 1.2f * _scale; Collider[] hits = Hits; LayerIndex entityPrecise = LayerIndex.entityPrecise; int num2 = Physics.OverlapSphereNonAlloc(position, num, hits, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask), (QueryTriggerInteraction)2); for (int i = 0; i < num2; i++) { HurtBox val = (Object.op_Implicit((Object)(object)Hits[i]) ? ((Component)Hits[i]).GetComponent<HurtBox>() : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive && FriendlyFireManager.ShouldSplashHitProceed(val.healthComponent, _team)) { return true; } } return false; } private void EatProjectiles() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } LayerIndex projectile = LayerIndex.projectile; int num = LayerMask.op_Implicit(((LayerIndex)(ref projectile)).mask); int num2 = Physics.OverlapSphereNonAlloc(((Component)this).transform.position, 1.15f * _scale, Hits, num, (QueryTriggerInteraction)2); for (int i = 0; i < num2; i++) { if (Object.op_Implicit((Object)(object)Hits[i])) { ProjectileController componentInParent = ((Component)Hits[i]).GetComponentInParent<ProjectileController>(); if (Object.op_Implicit((Object)(object)componentInParent) && Object.op_Implicit((Object)(object)componentInParent.teamFilter) && componentInParent.teamFilter.teamIndex != _team && (!Object.op_Implicit((Object)(object)componentInParent.owner) || !Object.op_Implicit((Object)(object)_attacker) || !((Object)(object)componentInParent.owner == (Object)(object)_attacker))) { _eaten++; Object.Destroy((Object)(object)((Component)componentInParent).gameObject); } } } } private void Detonate() { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if (!_done) { _done = true; float num = Mathf.Clamp01((_scale - 1f) / 1.5f); float num2 = 12f + 5.5f * num; if (NetworkServer.active) { new BlastAttack { attacker = _attacker, inflictor = ((Component)this).gameObject, teamIndex = _team, position = ((Component)this).transform.position, radius = 5.5f * _scale, baseDamage = _damageStat * num2, baseForce = 1400f, bonusForce = Vector3.up * 500f, crit = _crit, damageType = KisameSkillState.WithDamageSource((DamageType)0, (DamageSource)8), falloffModel = (FalloffModel)0, procCoefficient = 1f, damageColorIndex = (DamageColorIndex)0, attackerFiltering = (AttackerFiltering)2 }.Fire(); } KisameEffect.Spawn("great", "End", ((Component)this).transform.position, ((Component)this).transform.rotation, 0.6f * _scale, loop: false); KisameFx.StormPop(((Component)this).transform.position, ((Component)this).transform.rotation, 2.6f * _scale); KisameAudio.Sfx("burst", 2, 1f, ((Component)this).transform.position); KisameEffect.Spawn("mptc04", "Play", ((Component)this).transform.position, ((Component)this).transform.rotation, 0.7f * _scale, loop: false); KisamePlugin.Log.LogInfo((object)$"[Kisame] Daikodan burst scale={_scale:0.00} eaten={_eaten} coeff={num2:0.00}"); Object.Destroy((Object)(object)((Component)this).gameObject); } } } } namespace KisameSurvivor.Model { public sealed class KisameAnimDriver : MonoBehaviour { private KisameRigInstance _rig; private KisameModelPack _pack; private KisameClipSet _clips; private KisameClip _current; private KisameClip _prev; private float _time; private float _prevTime; private float _speed = 1f; private bool _loop = true; private float _blendDuration; private float _blendElapsed; private readonly Dictionary<string, int> _boneIdx = new Dictionary<string, int>(); private Vector3[] _workPos; private Quaternion[] _workRot; private Vector3[] _workScale; private Vector3[] _prevPos; private Quaternion[] _prevRot; private Vector3[] _prevScale; public string CurrentClipName => _current?.Name ?? ""; public void Setup(KisameRigInstance rig, KisameModelPack pack, KisameClipSet clips) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_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) _rig = rig; _pack = pack; _clips = clips; int num = pack.BoneNames.Length; _workPos = (Vector3[])(object)new Vector3[num]; _workRot = (Quaternion[])(object)new Quaternion[num]; _workScale = (Vector3[])(object)new Vector3[num]; _prevPos = (Vector3[])(object)new Vector3[num]; _prevRot = (Quaternion[])(object)new Quaternion[num]; _prevScale = (Vector3[])(object)new Vector3[num]; for (int i = 0; i < num; i++) { _boneIdx[pack.BoneNames[i]] = i; _workPos[i] = pack.RestPos[i]; _workRot[i] = pack.RestRot[i]; _workScale[i] = pack.RestScale[i]; } } public bool HasClip(string name) { if (_clips != null && !string.IsNullOrEmpty(name)) { return _clips.Clips.ContainsKey(name); } return false; } public void Play(string clipName, bool loop = true, float speed = 1f, float crossFade = 0.12f, bool forceRestart = false) { if (_clips == null || string.IsNullOrEmpty(clipName)) { return; } if (!_clips.Clips.TryGetValue(clipName, out var value)) { KisamePlugin.Log.LogWarning((object)("[anim] missing clip " + clipName)); return; } if (!forceRestart && _current == value && _loop == loop) { _speed = speed; return; } if (_current != null && crossFade > 0.001f) { _prev = _current; _prevTime = _time; _blendDuration = crossFade; _blendElapsed = 0f; } else { _prev = null; _blendDuration = 0f; } _current = value; _time = 0f; _loop = loop; _speed = Mathf.Max(0.05f, speed); } private void LateUpdate() { //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) if (_rig == null || _pack == null || _current == null) { return; } float deltaTime = Time.deltaTime; _time += deltaTime * _speed; if (_loop) { if (_current.Duration > 0.001f) { _time %= _current.Duration; } } else if (_time > _current.Duration) { _time = _current.Duration; } Evaluate(_current, _time, _workPos, _workRot, _workScale); float num = 1f; if (_prev != null && _blendDuration > 0.001f) { _blendElapsed += deltaTime; num = Mathf.Clamp01(_blendElapsed / _blendDuration); if (num < 1f) { Evaluate(_prev, _prevTime, _prevPos, _prevRot, _prevScale); } else { _prev = null; } } int num2 = _rig.Bones.Length; for (int i = 0; i < num2; i++) { Transform val = _rig.Bones[i]; if (Object.op_Implicit((Object)(object)val)) { if (i == 0) { val.localPosition = Vector3.zero; val.localRotation = Quaternion.identity; val.localScale = Vector3.one; } else if (num < 1f) { val.localPosition = Vector3.Lerp(_prevPos[i], _workPos[i], num); val.localRotation = Quaternion.Slerp(_prevRot[i], _workRot[i], num); val.localScale = Vector3.Lerp(_prevScale[i], _workScale[i], num); } else { val.localPosition = _workPos[i]; val.localRotation = _workRot[i]; val.localScale = _workScale[i]; } } } } private void Evaluate(KisameClip clip, float t, Vector3[] outPos, Quaternion[] outRot, Vector3[] outScale) { //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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0260: 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_02eb: 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_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) int num = _pack.BoneNames.Length; for (int i = 0; i < num; i++) { outPos[i] = _pack.RestPos[i]; outRot[i] = _pack.RestRot[i]; outScale[i] = _pack.RestScale[i]; } Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); Quaternion val3 = default(Quaternion); Quaternion val4 = default(Quaternion); Vector3 val5 = default(Vector3); Vector3 val6 = default(Vector3); foreach (KisameChannel channel in clip.Channels) { if (!_boneIdx.TryGetValue(channel.Bone, out var value)) { continue; } int num2 = channel.Times.Length; if (num2 == 0) { continue; } float num3 = 0f; int num4; int num5; if (num2 == 1 || t <= channel.Times[0]) { num4 = (num5 = 0); } else if (t >= channel.Times[num2 - 1]) { num4 = (num5 = num2 - 1); } else { int num6 = 0; int num7 = num2 - 1; while (num7 - num6 > 1) { int num8 = num6 + num7 >> 1; if (channel.Times[num8] <= t) { num6 = num8; } else { num7 = num8; } } num4 = num6; num5 = num7; float num9 = channel.Times[num5] - channel.Times[num4]; num3 = ((num9 > 1E-05f) ? ((t - channel.Times[num4]) / num9) : 0f); } if (channel.Type == 0) { ((Vector3)(ref val))..ctor(channel.Values[num4 * 3], channel.Values[num4 * 3 + 1], channel.Values[num4 * 3 + 2]); ((Vector3)(ref val2))..ctor(channel.Values[num5 * 3], channel.Values[num5 * 3 + 1], channel.Values[num5 * 3 + 2]); outPos[value] = ((num3 > 0f) ? Vector3.Lerp(val, val2, num3) : val); } else if (channel.Type == 1) { ((Quaternion)(ref val3))..ctor(channel.Values[num4 * 4], channel.Values[num4 * 4 + 1], channel.Values[num4 * 4 + 2], channel.Values[num4 * 4 + 3]); ((Quaternion)(ref val4))..ctor(channel.Values[num5 * 4], channel.Values[num5 * 4 + 1], channel.Values[num5 * 4 + 2], channel.Values[num5 * 4 + 3]); outRot[value] = ((num3 > 0f) ? Quaternion.Slerp(val3, val4, num3) : val3); } else if (channel.Type == 2) { ((Vector3)(ref val5))..ctor(channel.Values[num4 * 3], channel.Values[num4 * 3 + 1], channel.Values[num4 * 3 + 2]); ((Vector3)(ref val6))..ctor(channel.Values[num5 * 3], channel.Values[num5 * 3 + 1], channel.Values[num5 * 3 + 2]); outScale[value] = ((num3 > 0f) ? Vector3.Lerp(val5, val6, num3) : val5); } } } } public static class KisameItemDisplays { private struct BoneFrame { public Quaternion Rotation; public float Scale; } private static readonly Dictionary<string, BoneFrame> _commandoFrames = new Dictionary<string, BoneFrame>(); private static float _commandoHeight; private static bool _loggedRatio; private const float BuildFactor = 0.9f; private static readonly Dictionary<string, string> BoneMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) { { "Base", "trall" }, { "Root", "trall" }, { "Pelvis", "pelvis" }, { "Stomach", "spine" }, { "Chest", "spine1" }, { "Neck", "neck" }, { "Head",