Decompiled source of ChefMod v2.3.8
plugins/Gnome-ChefMod/ChefMod.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using ChefMod; using ChefMod.Achievements; using ChefMod.Components; using ChefMod.Hooks; using ChefMod.Modules; using ChefMod.Properties; using ChefPlugin; using EntityStates; using EntityStates.Chef; using HG; using HG.BlendableTypes; using IL.RoR2; using KinematicCharacterController; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using R2API; using R2API.Networking; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using Survariants; using TILER2; using ThinkInvisible.ClassicItems; using ThreeEyedGames; using UnityEngine; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using Zio.FileSystems; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyCompany("ChefMod")] [assembly: AssemblyProduct("ChefMod")] [assembly: AssemblyTitle("ChefMod")] [assembly: AssemblyInformationalVersion("1.0.0+0b7ebc02085d04ebce57db2270ce3d6d3bf9a31e")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] public class CustomRendererInfo { public string childName; public Material material; public bool ignoreOverlays; public CustomRendererInfo(string childName_, Material mat_) { childName = childName_; material = mat_; ignoreOverlays = false; } public CustomRendererInfo(string childName_, Material mat_, bool ignoreOverlays_) { childName = childName_; material = mat_; ignoreOverlays = ignoreOverlays_; } } public class PrefabBuilder { public string prefabName; public GameObject model; public GameObject modelBase = new GameObject("ModelBase"); public GameObject camPivot = new GameObject("CameraPivot"); public GameObject aimOrigin = new GameObject("AimOrigin"); public GameObject preferredPodPrefab; public CustomRendererInfo[] defaultCustomRendererInfos; public CustomRendererInfo[] masteryCustomRendererInfos; public Sprite defaultSkinIcon; public Sprite masterySkinIcon; public string masteryAchievementUnlockable; private GameObject prefab; private Transform transform; private CharacterDirection dir; private CharacterBody body; private CharacterMotor motor; private CameraTargetParams camParams; private ModelLocator locator; private CharacterModel charModel; private ChildLocator childLocator; private TeamComponent teamComponent; private HealthComponent health; private CharacterDeathBehavior deathBehavior; private Rigidbody rigidbody; private CapsuleCollider collider; private KinematicCharacterMotor kMotor; private HurtBoxGroup hurtbox; private CapsuleCollider coll1; private HurtBox hb; private FootstepHandler footstep; private AimAnimator aimer; private RendererInfo[] defaultRendererInfos; private RendererInfo[] masteryRendererInfos; public GameObject CreatePrefab() { if (prefabName == "") { Debug.LogWarning((object)"Prefab name has not been set."); prefabName = "RandomAssSurvivorBody"; } prefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody"), prefabName, true); prefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true; SetupModelBase(); SetupCamera(); SetupAim(); if (!Object.op_Implicit((Object)(object)model)) { Debug.LogError((object)("Character model has not been loaded, returning null. " + prefabName + " will not function properly.")); return null; } transform = model.transform; dir = prefab.GetComponent<CharacterDirection>(); body = prefab.GetComponent<CharacterBody>(); motor = prefab.GetComponent<CharacterMotor>(); camParams = prefab.GetComponent<CameraTargetParams>(); locator = prefab.GetComponent<ModelLocator>(); charModel = ((Component)transform).gameObject.AddComponent<CharacterModel>(); childLocator = model.GetComponent<ChildLocator>(); if ((Object)(object)prefab.GetComponent<TeamComponent>() != (Object)null) { teamComponent = prefab.GetComponent<TeamComponent>(); } else { teamComponent = prefab.GetComponent<TeamComponent>(); } health = prefab.GetComponent<HealthComponent>(); deathBehavior = prefab.GetComponent<CharacterDeathBehavior>(); rigidbody = prefab.GetComponent<Rigidbody>(); collider = prefab.GetComponent<CapsuleCollider>(); kMotor = prefab.GetComponent<KinematicCharacterMotor>(); hurtbox = model.AddComponent<HurtBoxGroup>(); coll1 = model.GetComponentInChildren<CapsuleCollider>(); hb = ((Component)coll1).gameObject.AddComponent<HurtBox>(); footstep = model.AddComponent<FootstepHandler>(); aimer = model.AddComponent<AimAnimator>(); SetupModelTransform(); SetupCharacterDirection(); SetupCharacterBody(); SetupCharacterMotor(); SetupCameraParams(); SetupModelLocator(); SetupModel(); SetupRendererInfos(); SetupSkins(); SetupTeamComponent(); SetupHealthComponent(); SetupInteractors(); SetupDeathBehavior(); SetupRigidBody(); if (Object.op_Implicit((Object)(object)model.GetComponent<RagdollController>())) { Debug.LogWarning((object)"hope this doesn't FUCK everything"); Object.Destroy((Object)(object)model.GetComponent<RagdollController>()); } SetupCollider(); SetupKCharacterMotor(); SetupHurtbox(); SetupFootstep(); SetupAimAnimator(); SetupHitbox(); ChefContent.bodyPrefabs.Add(prefab); return prefab; } public GameObject createDisplayPrefab(string displayPrefab) { GameObject val = Assets.chefAssetBundle.LoadAsset<GameObject>(displayPrefab); CharacterModel val2 = val.AddComponent<CharacterModel>(); val2.autoPopulateLightInfos = true; val2.invisibilityCount = 0; val2.temporaryOverlays = new List<TemporaryOverlayInstance>(); val2.baseRendererInfos = getRendererInfos(val.GetComponent<ChildLocator>(), defaultCustomRendererInfos); return val; } private void SetupRendererInfos() { defaultRendererInfos = getRendererInfos(childLocator, defaultCustomRendererInfos); charModel.baseRendererInfos = defaultRendererInfos; if (masteryCustomRendererInfos != null) { masteryRendererInfos = getRendererInfos(childLocator, masteryCustomRendererInfos); } } private static RendererInfo[] getRendererInfos(ChildLocator childLocator, CustomRendererInfo[] customRendererInfos) { //IL_000f: 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_0055: Unknown result type (might be due to invalid IL or missing references) List<RendererInfo> list = new List<RendererInfo>(); for (int i = 0; i < customRendererInfos.Length; i++) { list.Add(new RendererInfo { renderer = ((Component)childLocator.FindChild(customRendererInfos[i].childName)).GetComponent<Renderer>(), defaultMaterial = customRendererInfos[i].material, ignoreOverlays = customRendererInfos[i].ignoreOverlays, defaultShadowCastingMode = (ShadowCastingMode)1 }); } return list.ToArray(); } private void SetupModelBase() { //IL_0097: 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) Object.Destroy((Object)(object)((Component)prefab.transform.Find("ModelBase")).gameObject); Object.Destroy((Object)(object)((Component)prefab.transform.Find("CameraPivot")).gameObject); Object.Destroy((Object)(object)((Component)prefab.transform.Find("AimOrigin")).gameObject); modelBase.transform.parent = prefab.transform; modelBase.transform.localPosition = new Vector3(0f, -0.95f, 0f); modelBase.transform.localRotation = Quaternion.identity; } private void SetupCamera() { //IL_0037: 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_0063: Unknown result type (might be due to invalid IL or missing references) camPivot.transform.parent = prefab.transform; camPivot.transform.localPosition = new Vector3(0f, -0.95f, 0f); camPivot.transform.rotation = Quaternion.identity; camPivot.transform.localScale = Vector3.one; } private void SetupAim() { //IL_0037: 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_0063: Unknown result type (might be due to invalid IL or missing references) aimOrigin.transform.parent = prefab.transform; aimOrigin.transform.localPosition = new Vector3(0f, 1.4f, 0f); aimOrigin.transform.rotation = Quaternion.identity; aimOrigin.transform.localScale = Vector3.one; } private void SetupModelTransform() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) transform.parent = modelBase.transform; transform.localRotation = Quaternion.identity; } private void SetupCharacterDirection() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) dir.moveVector = Vector3.zero; dir.targetTransform = modelBase.transform; dir.overrideAnimatorForwardTransform = null; dir.rootMotionAccumulator = null; dir.modelAnimator = model.GetComponentInChildren<Animator>(); dir.driveFromRootRotation = false; dir.turnSpeed = 720f; } private void SetupCharacterBody() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ((Object)body).name = prefabName; body.bodyFlags = (BodyFlags)16; body.rootMotionInMainState = false; body.mainRootSpeed = 0f; body.aimOriginTransform = aimOrigin.transform; body.hullClassification = (HullClassification)0; if ((Object)(object)preferredPodPrefab != (Object)null) { body.preferredPodPrefab = preferredPodPrefab; } } private void SetupCharacterMotor() { motor.walkSpeedPenaltyCoefficient = 1f; motor.characterDirection = dir; motor.muteWalkMotion = false; motor.mass = 100f; motor.airControl = 0.25f; motor.disableAirControlUntilCollision = false; motor.generateParametersOnAwake = true; } private void SetupCameraParams() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) camParams.cameraParams = ScriptableObject.CreateInstance<CharacterCameraParams>(); CharacterCameraParams cameraParams = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponent<CameraTargetParams>().cameraParams; camParams.cameraParams.data.pivotVerticalOffset = BlendableFloat.op_Implicit(1.4f); ((Object)camParams.cameraParams).name = "CHEFcam"; camParams.cameraParams.data.maxPitch = cameraParams.data.maxPitch; camParams.cameraParams.data.minPitch = cameraParams.data.minPitch; camParams.cameraParams.data.wallCushion = cameraParams.data.wallCushion; camParams.cameraParams.data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, -11f)); camParams.cameraPivotTransform = null; camParams.recoil = Vector2.zero; camParams.dontRaycastToPivot = false; } private void SetupModelLocator() { locator.modelTransform = transform; locator.modelBaseTransform = modelBase.transform; locator.dontReleaseModelOnDeath = false; locator.autoUpdateModelTransform = true; locator.dontDetatchFromParent = false; locator.noCorpse = false; locator.normalizeToFloor = false; locator.preserveModel = false; } private void SetupTeamComponent() { teamComponent.hideAllyCardDisplay = false; teamComponent.teamIndex = (TeamIndex)(-1); } private void SetupHealthComponent() { health.body = null; health.dontShowHealthbar = false; health.globalDeathEventChanceCoefficient = 1f; } private void SetupInteractors() { prefab.GetComponent<Interactor>().maxInteractionDistance = 3f; prefab.GetComponent<InteractionDriver>().highlightInteractor = true; } private void SetupDeathBehavior() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) deathBehavior.deathStateMachine = prefab.GetComponent<EntityStateMachine>(); deathBehavior.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath)); } private void SetupRigidBody() { rigidbody.mass = 100f; rigidbody.drag = 0f; rigidbody.angularDrag = 0f; rigidbody.useGravity = false; rigidbody.isKinematic = true; rigidbody.interpolation = (RigidbodyInterpolation)0; rigidbody.collisionDetectionMode = (CollisionDetectionMode)0; rigidbody.constraints = (RigidbodyConstraints)0; } private void SetupCollider() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) ((Collider)collider).isTrigger = false; ((Collider)collider).material = null; collider.center = Vector3.zero; collider.direction = 1; } private void SetupModel() { //IL_0022: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) charModel.body = body; charModel.baseRendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { defaultMaterial = ((Renderer)model.GetComponentInChildren<SkinnedMeshRenderer>()).material, renderer = (Renderer)(object)model.GetComponentInChildren<SkinnedMeshRenderer>(), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false } }; charModel.autoPopulateLightInfos = true; charModel.invisibilityCount = 0; charModel.temporaryOverlays = new List<TemporaryOverlayInstance>(); } private void SetupKCharacterMotor() { //IL_008a: 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_00b2: 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) kMotor.CharacterController = (ICharacterController)(object)motor; kMotor.Capsule = collider; kMotor.GroundDetectionExtraDistance = 0f; kMotor.MaxStepHeight = 0.2f; kMotor.MinRequiredStepDepth = 0.1f; kMotor.MaxStableSlopeAngle = 55f; kMotor.MaxStableDistanceFromLedge = 0.5f; kMotor.MaxStableDenivelationAngle = 55f; kMotor.RigidbodyInteractionType = (RigidbodyInteractionType)0; kMotor.PreserveAttachedRigidbodyMomentum = true; kMotor.HasPlanarConstraint = false; kMotor.PlanarConstraintAxis = Vector3.up; kMotor.StepHandling = (StepHandlingMethod)0; kMotor.InteractiveRigidbodyHandling = true; kMotor.playerCharacter = true; kMotor.LedgeAndDenivelationHandling = true; } private void SetupHurtbox() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) ((Component)hb).gameObject.layer = LayerIndex.entityPrecise.intVal; hb.healthComponent = health; hb.isBullseye = true; hb.damageModifier = (DamageModifier)0; hb.hurtBoxGroup = hurtbox; hb.indexInGroup = 0; hb.isSniperTarget = true; hurtbox.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { hb }; hurtbox.mainHurtBox = hb; hurtbox.bullseyeCount = 1; } private void SetupFootstep() { footstep.baseFootstepString = "Play_player_footstep"; footstep.sprintFootstepOverrideString = ""; footstep.enableFootstepDust = true; footstep.footstepDustPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/GenericFootstepDust"); } private void SetupAimAnimator() { aimer.inputBank = prefab.GetComponent<InputBankTest>(); aimer.directionComponent = dir; aimer.pitchRangeMax = 60f; aimer.pitchRangeMin = -60f; aimer.yawRangeMax = 90f; aimer.yawRangeMin = -90f; aimer.pitchGiveupRange = 30f; aimer.yawGiveupRange = 10f; aimer.giveupDuration = 3f; } private void SetupHitbox() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown foreach (Transform item in transform) { Transform val = item; if (((Object)val).name.Contains("Hitbox")) { HitBoxGroup val2 = model.AddComponent<HitBoxGroup>(); HitBox val3 = ((Component)val).gameObject.AddComponent<HitBox>(); val2.groupName = ((Object)val).name; val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 }; } } } private void SetupSkins() { //IL_001d: 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_00bd: 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) GameObject gameObject = ((Component)transform).gameObject; CharacterModel component = gameObject.GetComponent<CharacterModel>(); ModelSkinController val = gameObject.AddComponent<ModelSkinController>(); SkinDefInfo val2 = default(SkinDefInfo); val2.Name = "DEFAULT_SKIN"; val2.NameToken = "DEFAULT_SKIN"; val2.Icon = defaultSkinIcon; val2.RootObject = gameObject; val2.RendererInfos = component.baseRendererInfos; val2.GameObjectActivations = Array.Empty<GameObjectActivation>(); val2.MeshReplacements = Array.Empty<MeshReplacement>(); val2.BaseSkins = Array.Empty<SkinDef>(); val2.MinionSkinReplacements = Array.Empty<MinionSkinReplacement>(); val2.ProjectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); SkinDefInfo val3 = val2; Material defaultMaterial = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/BrotherGlassBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial; RendererInfo[] rendererInfos = val3.RendererInfos; RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[rendererInfos.Length]; rendererInfos.CopyTo(array, 0); array[0].defaultMaterial = defaultMaterial; SkinDef val4 = LoadoutAPI.CreateNewSkinDef(val3); SkinDef[] skins = (SkinDef[])(object)new SkinDef[1] { val4 }; val.skins = skins; } public static bool RegisterNewBody(GameObject bodyObject) { if (Object.op_Implicit((Object)(object)bodyObject)) { ChefContent.bodyPrefabs.Add(bodyObject); return true; } Debug.LogError((object)("FATAL ERROR:" + ((Object)bodyObject).name + " failed to register to the body catalog!")); return false; } } namespace EntityStates.Chef { public class ChefMain : GenericCharacterMain { private ChildLocator childLocator; public static RuntimeAnimatorController displayAnimatorController = ChefContent.survivorDefs[0].displayPrefab.GetComponentInChildren<Animator>().runtimeAnimatorController; private RuntimeAnimatorController cachedAnimatorController; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); childLocator = ((EntityState)this).GetModelChildLocator(); if ((Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)ChefMod.ChefPlugin.altPrimaryDef || (Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)ChefMod.ChefPlugin.boostedAltPrimaryDef) { ((Component)childLocator.FindChild("Cleaver")).gameObject.SetActive(false); ((Component)childLocator.FindChild("Knife")).gameObject.SetActive(true); } if ((Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)ChefMod.ChefPlugin.primaryDef || (Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)ChefMod.ChefPlugin.boostedPrimaryDef) { ((Component)childLocator.FindChild("Cleaver")).gameObject.SetActive(true); ((Component)childLocator.FindChild("Knife")).gameObject.SetActive(false); } cachedAnimatorController = ((BaseCharacterMain)this).modelAnimator.runtimeAnimatorController; } public override void Update() { ((GenericCharacterMain)this).Update(); } public override void HandleMovements() { ((GenericCharacterMain)this).HandleMovements(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { int num = 5; if (((EntityState)this).characterBody.moveSpeed > ((EntityState)this).characterBody.baseMoveSpeed * (float)num && ((EntityState)this).characterBody.isSprinting) { ((BaseCharacterMain)this).modelAnimator.runtimeAnimatorController = displayAnimatorController; ((BaseCharacterMain)this).modelAnimator.speed = Mathf.Max(((EntityState)this).characterBody.moveSpeed / ((EntityState)this).characterBody.baseMoveSpeed * (float)num / 4f, 1f); ((EntityState)this).modelLocator.normalizeToFloor = true; } else { ((BaseCharacterMain)this).modelAnimator.runtimeAnimatorController = cachedAnimatorController; ((BaseCharacterMain)this).modelAnimator.speed = 1f; ((EntityState)this).modelLocator.normalizeToFloor = false; } } } public override void OnExit() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00d7: Expected O, but got Unknown if (((EntityState)this).characterBody.healthComponent.health < 1f) { BlastAttack val = new BlastAttack(); val.radius = 0.25f; val.procCoefficient = 1f; val.position = ((EntityState)this).characterBody.corePosition; val.attacker = ((EntityState)this).gameObject; val.crit = true; val.baseDamage = 1000000f; val.falloffModel = (FalloffModel)0; val.baseForce = 300f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.attackerFiltering = (AttackerFiltering)2; Result val2 = val.Fire(); GameObject val3 = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/omnieffect/OmniExplosionVFX"); EffectData val4 = new EffectData { scale = 15f, origin = ((EntityState)this).characterBody.corePosition }; EffectManager.SpawnEffect(val3, val4, true); CharacterDirection componentInChildren = ((Component)((EntityState)this).characterBody).gameObject.GetComponentInChildren<CharacterDirection>(); SkinnedMeshRenderer[] componentsInChildren = ((Component)componentInChildren.modelAnimator).GetComponentsInChildren<SkinnedMeshRenderer>(); foreach (SkinnedMeshRenderer val5 in componentsInChildren) { ((Component)val5).gameObject.SetActive(false); } MeshRenderer[] componentsInChildren2 = ((Component)componentInChildren.modelAnimator).GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val6 in componentsInChildren2) { ((Component)val6).gameObject.SetActive(false); } ((Component)childLocator.FindChild("Cleaver")).gameObject.SetActive(false); ((Component)childLocator.FindChild("Knife")).gameObject.SetActive(false); } ((GenericCharacterMain)this).OnExit(); } } internal class Flambe : BaseState { public float damageCoefficient = 5f; public float maxDistance = 25f; public float baseDuration = 1f; public float throwTime = 0.25f; private float duration; private bool hasThrown; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; ((EntityState)this).PlayAnimation("Fullbody, Override", "SecondaryBoosted", "Secondary.playbackRate", duration, 0f); ((EntityState)this).PlayAnimation("Gesture, Override", "SecondaryBoosted", "Secondary.playbackRate", duration, 0f); ((BaseState)this).StartAimMode(2f, false); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration * throwTime && !hasThrown) { hasThrown = true; Throw(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Throw() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).StartAimMode(0.2f, false); FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = ChefMod.ChefPlugin.flamballPrefab; val.position = ((Ray)(ref aimRay)).origin + 1.5f * ((Ray)(ref aimRay)).direction; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction) * Quaternion.FromToRotation(Vector3.left, Vector3.up); val.owner = ((EntityState)this).gameObject; val.damage = ((EntityState)this).characterBody.damage * 5f; val.force = 50f; val.crit = ((BaseState)this).RollCrit(); val.damageColorIndex = (DamageColorIndex)0; val.target = null; ((FireProjectileInfo)(ref val)).speedOverride = 100f; ((FireProjectileInfo)(ref val)).fuseOverride = -1f; FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); Util.PlaySound("DIng", ((EntityState)this).gameObject); Util.PlaySound("Fireball", ((EntityState)this).gameObject); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (hasThrown) { return (InterruptPriority)0; } return (InterruptPriority)2; } } internal class MinceHoming : BaseState { public float baseDuration = 0.5f; public float throwTime = 0.36f; private float duration; private bool hasThrown; private List<CharacterBody> victimBodyList = new List<CharacterBody>(); public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; ((EntityState)this).PlayAnimation("Gesture, Override", "PrimaryBoosted", "PrimaryCleaver.playbackRate", duration, 0f); ((BaseState)this).StartAimMode(2f, false); } private void Throw() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_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) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00d6: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) if (!((EntityState)this).isAuthority) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = new Vector3(((Ray)(ref aimRay)).direction.z, 0f, -1f * ((Ray)(ref aimRay)).direction.x); Vector3 normalized = ((Vector3)(ref val)).normalized; CoomerangProjectile component = Cleaver.projectilePrefab.GetComponent<CoomerangProjectile>(); component.followRet = false; getHitList(((EntityState)this).characterBody.corePosition, 40f); foreach (CharacterBody victimBody in victimBodyList) { Vector3 val2 = victimBody.corePosition - ((EntityState)this).characterBody.corePosition; val2 = ((Vector3)(ref val2)).normalized; FireProjectileInfo val3 = default(FireProjectileInfo); val3.projectilePrefab = Cleaver.projectilePrefab; val3.position = ((EntityState)this).characterBody.corePosition + 1.5f * val2; val3.rotation = Util.QuaternionSafeLookRotation(val2); val3.owner = ((EntityState)this).gameObject; val3.damage = ((EntityState)this).characterBody.damage * 1.5f; val3.force = 50f; val3.crit = ((BaseState)this).RollCrit(); val3.damageColorIndex = (DamageColorIndex)0; val3.target = null; ((FireProjectileInfo)(ref val3)).speedOverride = 16f; ((FireProjectileInfo)(ref val3)).fuseOverride = -1f; FireProjectileInfo val4 = val3; ProjectileManager.instance.FireProjectile(val4); Util.PlaySound("CleaverThrow", ((EntityState)this).gameObject); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration * throwTime && !hasThrown) { hasThrown = true; Throw(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } private void getHitList(Vector3 position, float radius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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) Collider[] array = Physics.OverlapSphere(position, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask)); int i = 0; int num = 0; for (; i < array.Length; i++) { if (num >= 12) { break; } HealthComponent component = ((Component)array[i]).GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component)) { TeamComponent component2 = ((Component)component).GetComponent<TeamComponent>(); if (component2.teamIndex != ((EntityState)this).characterBody.teamComponent.teamIndex) { AddToList(component.body); num++; } } } } private void AddToList(CharacterBody component) { if (!victimBodyList.Contains(component)) { victimBodyList.Add(component); } } } internal class SearOld : BaseSkillState { public float damageCoefficient = 5f; public float maxDistance = 25f; public float baseDuration = 1f; public float throwTime = 0.25f; private float duration; private bool hasThrown; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayAnimation("Fullbody, Override", "Secondary", "Secondary.playbackRate", duration, 0f); ((EntityState)this).PlayAnimation("Gesture, Override", "Secondary", "Secondary.playbackRate", duration, 0f); ((BaseState)this).StartAimMode(2f, false); } private void Throw() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = ChefMod.ChefPlugin.foirballPrefab; val.position = ((Ray)(ref aimRay)).origin + 1.5f * ((Ray)(ref aimRay)).direction; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction) * Quaternion.FromToRotation(Vector3.left, Vector3.up); val.owner = ((EntityState)this).gameObject; val.damage = ((EntityState)this).characterBody.damage * 5f; val.force = 50f; val.crit = ((BaseState)this).RollCrit(); val.damageColorIndex = (DamageColorIndex)0; val.target = null; ((FireProjectileInfo)(ref val)).speedOverride = 100f; ((FireProjectileInfo)(ref val)).fuseOverride = -1f; FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); Util.PlaySound("DIng", ((EntityState)this).gameObject); Util.PlaySound("Fireball", ((EntityState)this).gameObject); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration * throwTime && !hasThrown) { hasThrown = true; Throw(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (hasThrown) { return (InterruptPriority)0; } return (InterruptPriority)2; } } internal class Fry : BaseSkillState { public float baseDuration = 0.3f; public float throwTime = 0.38f; private float duration; private bool hasThrown; private Vector3 thePoint; private List<CharacterBody> victimList = new List<CharacterBody>(); private Ray aimRay; public override void OnEnter() { //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) ((BaseState)this).OnEnter(); aimRay = ((BaseState)this).GetAimRay(); duration = baseDuration; ((EntityState)this).PlayCrossfade("Gesture, Override", "Primary", "PrimaryCleaver.playbackRate", duration, 0.05f); ((BaseState)this).StartAimMode(2f, false); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration * throwTime && !hasThrown) { hasThrown = true; Throw(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Throw() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown if (!((EntityState)this).isAuthority) { return; } ((BaseState)this).StartAimMode(0.2f, false); BlastAttack val = new BlastAttack(); val.radius = 10f; val.procCoefficient = 1f; val.position = ((Ray)(ref aimRay)).origin; val.attacker = ((EntityState)this).gameObject; val.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master); val.baseDamage = 0.1f; val.falloffModel = (FalloffModel)0; val.baseForce = 3f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.damageType = DamageTypeCombo.op_Implicit((DamageType)32); val.attackerFiltering = (AttackerFiltering)2; getVictim(val); thePoint = ((Ray)(ref aimRay)).origin + 30f * ((Ray)(ref aimRay)).direction; foreach (CharacterBody victim in victimList) { DamageInfo val2 = new DamageInfo { attacker = ((EntityState)this).gameObject, crit = ((BaseState)this).RollCrit(), damage = 5f * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)128), force = Vector3.forward, inflictor = ((EntityState)this).gameObject, procCoefficient = 1f }; if (Object.op_Implicit((Object)(object)victim.characterMotor)) { launch(victim); FryLanding fryLanding = ((Component)victim).gameObject.AddComponent<FryLanding>(); fryLanding.damageInfo = val2; } else { victim.healthComponent.TakeDamage(val2); } Util.PlaySound("PanHit", ((EntityState)this).gameObject); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (hasThrown) { return (InterruptPriority)0; } return (InterruptPriority)2; } private void getVictim(BlastAttack ba) { //IL_0002: 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_0049: 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) Collider[] array = Physics.OverlapSphere(ba.position, ba.radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask)); int i = 0; int num = 0; for (; i < array.Length; i++) { if (num >= 12) { break; } HealthComponent component = ((Component)array[i]).GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component)) { TeamComponent component2 = ((Component)component).GetComponent<TeamComponent>(); if (component2.teamIndex != TeamComponent.GetObjectTeam(((EntityState)this).gameObject)) { AddToList(component.body); num++; } } } } private void AddToList(CharacterBody candidate) { if (!victimList.Contains(candidate)) { victimList.Add(candidate); } } private void launch(CharacterBody charB) { //IL_0024: 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_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_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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) float num = 35f; if (charB.characterMotor.mass > 300f) { num = 1f; } Vector3 val = thePoint - charB.corePosition; val.y = 0f; val = ((Vector3)(ref val)).normalized; val.y = 1f; charB.characterMotor.rootMotion.y += 0.5f; CharacterMotor characterMotor = charB.characterMotor; characterMotor.velocity += num * ((Vector3)(ref val)).normalized; } } public class Roast : BaseState { public float baseDuration = 0.1f; public float throwTime = 0.38f; private float duration; private bool hasThrown; private Vector3 direction; private Tuple<CharacterBody, float> victim = new Tuple<CharacterBody, float>(null, 100f); private Ray aimRay; public override void OnEnter() { //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) ((BaseState)this).OnEnter(); aimRay = ((BaseState)this).GetAimRay(); duration = baseDuration; ((EntityState)this).PlayCrossfade("Gesture, Override", "Primary", "PrimaryCleaver.playbackRate", duration, 0.05f); ((BaseState)this).StartAimMode(2f, false); } private void Throw() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Expected O, but got Unknown if (!((EntityState)this).isAuthority) { return; } ((BaseState)this).StartAimMode(0.2f, false); BlastAttack val = new BlastAttack(); val.radius = 5f; val.procCoefficient = 1f; val.position = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 2.5f; val.attacker = ((EntityState)this).gameObject; val.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master); val.baseDamage = 0.1f; val.falloffModel = (FalloffModel)0; val.baseForce = 3f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.damageType = DamageTypeCombo.op_Implicit((DamageType)32); val.attackerFiltering = (AttackerFiltering)2; Vector3 normalized = default(Vector3); ((Vector3)(ref normalized))..ctor(((Ray)(ref aimRay)).direction.x, 0f, ((Ray)(ref aimRay)).direction.z); normalized = ((Vector3)(ref normalized)).normalized; direction = new Vector3(normalized.x, 2f, normalized.z); getVictim(val); if (Object.op_Implicit((Object)(object)victim.Item1)) { DamageInfo damageInfo = new DamageInfo { attacker = ((EntityState)this).gameObject, crit = ((BaseState)this).RollCrit(), damage = 10f * base.damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)128), force = Vector3.forward, inflictor = ((EntityState)this).gameObject, procCoefficient = 1f }; if (Object.op_Implicit((Object)(object)victim.Item1.characterMotor)) { launch(victim.Item1); Destroct destroct = ((Component)victim.Item1).gameObject.AddComponent<Destroct>(); destroct.damageInfo = damageInfo; } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration * throwTime && !hasThrown) { hasThrown = true; Throw(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (hasThrown) { return (InterruptPriority)0; } return (InterruptPriority)2; } private void getVictim(BlastAttack ba) { //IL_0002: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 Collider[] array = Physics.OverlapSphere(ba.position, ba.radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask)); int i = 0; int num = 0; for (; i < array.Length; i++) { if (num >= 12) { break; } HealthComponent component = ((Component)array[i]).GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component)) { TeamComponent component2 = ((Component)component).GetComponent<TeamComponent>(); if ((int)component2.teamIndex != 1) { Compare(component.body); num++; } } } } private void Compare(CharacterBody candidate) { //IL_0002: 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_0017: Unknown result type (might be due to invalid IL or missing references) Vector3 val = candidate.corePosition - ((EntityState)this).characterBody.corePosition; if (((Vector3)(ref val)).magnitude < victim.Item2) { victim = new Tuple<CharacterBody, float>(candidate, ((Vector3)(ref val)).magnitude); } } private void launch(CharacterBody charB) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) float num = 100f; if (charB.characterMotor.mass > 300f) { num = 1f; } charB.characterMotor.rootMotion.y += 1f; CharacterMotor characterMotor = charB.characterMotor; characterMotor.velocity += num * ((Ray)(ref aimRay)).direction; } } internal class Special : BaseSkillState { public float baseDuration = 0.1f; private float duration; public override void OnEnter() { //IL_002f: 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_0048: 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_00e2: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; if (!((EntityState)this).isAuthority) { return; } RaycastHit[] array = Physics.SphereCastAll(((EntityState)this).characterBody.corePosition, 20f, Vector3.up, 5f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)0); for (int i = 0; i < array.Length; i++) { Collider collider = ((RaycastHit)(ref array[i])).collider; if (!Object.op_Implicit((Object)(object)((Component)collider).gameObject)) { continue; } HurtBox component = ((Component)collider).GetComponent<HurtBox>(); if (Object.op_Implicit((Object)(object)component)) { HealthComponent healthComponent = component.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent) && Object.op_Implicit((Object)(object)healthComponent.body.teamComponent) && healthComponent.body.teamComponent.teamIndex == ((EntityState)this).characterBody.teamComponent.teamIndex && !healthComponent.body.HasBuff(ChefMod.ChefPlugin.foodBuff)) { healthComponent.body.AddTimedBuff(ChefMod.ChefPlugin.foodBuff, 4f); } } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)3; } } public class Julienne : BaseState { public static GameObject projectilePrefab; public static float damageCoefficient = 1.3f; public static float fireInterval = 0.08f; private float stopwatch = fireInterval; private int stabcount; private float lastUpdateTime; private bool knifeThrown = false; private Transform rightShoulder; private ChildLocator childLocator; public override void OnEnter() { ((BaseState)this).OnEnter(); lastUpdateTime = Time.time; stabcount = (int)(16f * base.attackSpeedStat); childLocator = ((EntityState)this).GetModelChildLocator(); rightShoulder = childLocator.FindChild("RightShoulder"); ((BaseState)this).StartAimMode(2f, false); ((EntityState)this).PlayAnimation("Gesture, Override", "AltPrimary"); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (stabcount > 0) { stopwatch += Time.time - lastUpdateTime; lastUpdateTime = Time.time; float num = fireInterval / base.attackSpeedStat; if (stopwatch > num) { stopwatch -= num; stabcount--; Throw(); } } else { ((EntityState)this).outer.SetNextStateToMain(); } } private void Throw() { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound("Play_ChefMod_Cleaver_Throw", ((EntityState)this).gameObject); if (!knifeThrown) { knifeThrown = true; ((Component)rightShoulder).gameObject.SetActive(false); } if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = projectilePrefab; val.position = ((Ray)(ref aimRay)).origin; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val.owner = ((EntityState)this).gameObject; val.damage = base.damageStat * Slice.damageCoefficient; val.force = (1.5f + base.attackSpeedStat) * 3f; val.crit = ((BaseState)this).RollCrit(); val.damageColorIndex = (DamageColorIndex)0; ((FireProjectileInfo)(ref val)).speedOverride = 160f; ((FireProjectileInfo)(ref val)).fuseOverride = -1f; FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); } } public override void OnExit() { ((Component)rightShoulder).gameObject.SetActive(true); ((EntityState)this).PlayAnimation("Gesture, Override", "AltPrimaryEnd"); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class Mince : BaseState { public static float baseDuration = 0.76f; public static float baseThrowDelay = 0.259f; public static float damageCoefficient = 1.2f; private float throwDelay; private float duration; private bool hasThrown; public static int verticalIntensity = 2; public static float horizontalIntensity = 1f; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; throwDelay = baseThrowDelay / base.attackSpeedStat; ((EntityState)this).PlayAnimation("Gesture, Override", "PrimaryBoosted", "PrimaryCleaver.playbackRate", duration, 0f); ((BaseState)this).StartAimMode(2f, false); } private void Throw() { //IL_0018: 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_0073: 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_009c: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_018d: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { bool crit = ((BaseState)this).RollCrit(); FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = Cleaver.projectilePrefab; val.position = ((EntityState)this).characterBody.corePosition; val.owner = ((EntityState)this).gameObject; val.damage = base.damageStat * damageCoefficient; val.force = 50f; val.crit = crit; val.damageColorIndex = (DamageColorIndex)0; val.target = null; ((FireProjectileInfo)(ref val)).speedOverride = 16f; ((FireProjectileInfo)(ref val)).fuseOverride = -1f; FireProjectileInfo val2 = val; Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; direction.y = 0f; ((Vector3)(ref direction)).Normalize(); float num = Mathf.Atan2(direction.z, direction.x); Vector3 val3 = default(Vector3); for (int i = -1 * verticalIntensity; i <= verticalIntensity; i++) { float num2 = 0f; if (verticalIntensity != 0) { num2 = (float)i * (1f / (2f * (float)verticalIntensity)) * MathF.PI; } float num3 = Mathf.Cos(num2); int num4 = Mathf.Max(1, Mathf.FloorToInt(horizontalIntensity * MathF.PI * 2f * num3)); for (int j = 0; j < num4; j++) { float num5 = num + MathF.PI * 2f * ((float)j / (float)num4); ((Vector3)(ref val3))..ctor(num3 * Mathf.Cos(num5), Mathf.Sin(num2), num3 * Mathf.Sin(num5)); val2.rotation = Util.QuaternionSafeLookRotation(val3); ProjectileManager.instance.FireProjectile(val2); } } } hasThrown = true; Util.PlaySound("Play_ChefMod_Cleaver_Throw", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasThrown) { if (((EntityState)this).fixedAge > throwDelay) { Throw(); } } else if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class Cleaver : BaseSkillState { public static GameObject projectilePrefab; public static float damageCoefficient = 1.5f; public float baseDuration = 0.52f; public float throwTime = 0.38f; private float duration; private bool hasThrown; private ChildLocator childLocator; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayCrossfade("Gesture, Override", "Primary", "PrimaryCleaver.playbackRate", duration, 0.05f); childLocator = ((EntityState)this).GetModelChildLocator(); ((BaseState)this).StartAimMode(2f, false); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration * throwTime && !hasThrown) { hasThrown = true; Throw(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Throw() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_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_0109: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = new Vector3(((Ray)(ref aimRay)).direction.z, 0f, -1f * ((Ray)(ref aimRay)).direction.x); Vector3 normalized = ((Vector3)(ref val)).normalized; FireProjectileInfo val2 = default(FireProjectileInfo); val2.projectilePrefab = projectilePrefab; val2.position = ((Ray)(ref aimRay)).origin; val2.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val2.owner = ((EntityState)this).gameObject; val2.damage = ((EntityState)this).characterBody.damage * damageCoefficient; val2.force = 50f; val2.crit = ((BaseState)this).RollCrit(); val2.damageColorIndex = (DamageColorIndex)0; val2.target = null; ((FireProjectileInfo)(ref val2)).speedOverride = 16f; ((FireProjectileInfo)(ref val2)).fuseOverride = -1f; FireProjectileInfo val3 = val2; ((Component)childLocator.FindChild("Cleaver")).gameObject.SetActive(false); ProjectileManager.instance.FireProjectile(val3); } Util.PlaySound("Play_ChefMod_Cleaver_Throw", ((EntityState)this).gameObject); } public override void OnExit() { ((Component)childLocator.FindChild("Cleaver")).gameObject.SetActive(true); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class Slice : BaseState { public static GameObject projectilePrefab; public static float damageCoefficient = 1.2f; public bool returned = false; public bool knifeThrown = false; public KnifeHandler knifeHandler; private Transform rightShoulder; private ChildLocator childLocator; public override void OnEnter() { ((BaseState)this).OnEnter(); knifeHandler = ((EntityState)this).GetComponent<KnifeHandler>(); childLocator = ((EntityState)this).GetModelChildLocator(); rightShoulder = childLocator.FindChild("RightShoulder"); ((BaseState)this).StartAimMode(2f, false); ((EntityState)this).PlayAnimation("Gesture, Override", "AltPrimary"); ThrowKnife(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && knifeThrown && !knifeHandler.knifeThrown) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((Component)rightShoulder).gameObject.SetActive(true); ((EntityState)this).PlayAnimation("Gesture, Override", "AltPrimaryEnd"); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } private void ThrowKnife() { //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_004e: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_00e9: 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_00f0: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound("Play_ChefMod_Cleaver_Throw", ((EntityState)this).gameObject); ((Component)rightShoulder).gameObject.SetActive(false); if (((EntityState)this).isAuthority) { knifeHandler.ThrowKnife(); knifeThrown = true; Ray aimRay = ((BaseState)this).GetAimRay(); FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = projectilePrefab; val.position = ((Ray)(ref aimRay)).origin; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val.owner = ((EntityState)this).gameObject; val.damage = base.damageStat * damageCoefficient; val.force = (1.5f + base.attackSpeedStat) * 1.5f; val.crit = ((BaseState)this).RollCrit(); val.damageColorIndex = (DamageColorIndex)0; ((FireProjectileInfo)(ref val)).speedOverride = 160f; ((FireProjectileInfo)(ref val)).fuseOverride = -1f; FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); } } } public class PrepBlaze : PrepSear { public override void NextState() { ((EntityState)this).outer.SetNextState((EntityState)(object)new FireBlaze()); } } public class FireBlaze : FireSear { public new static float damageCoefficient = 4.2f; public static GameObject ExplosionEffectBoosted; protected override GameObject explosion => ExplosionEffectBoosted; public override void PlaySound() { Util.PlaySound("Play_Chefmod_Sear2", ((EntityState)this).gameObject); } public override void ModifyBullet(BulletAttack ba) { //IL_001f: 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) ba.damage = ((BaseState)this).damageStat * damageCoefficient; ba.radius = 2.1f; DamageAPI.AddModdedDamageType(ba, ChefMod.ChefPlugin.chefFireballOnHit); DamageAPI.AddModdedDamageType(ba, ChefMod.ChefPlugin.chefSear); } } public class PrepSear : BaseState { public static float baseDuration = 0.5f; public static string prepSoundString = "Play_ChefMod_Ding"; private float duration; public bool specialBoosted = false; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; Util.PlaySound(prepSoundString, ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("Fullbody, Override", "Secondary", "Secondary.playbackRate", duration * 4f, 0f); ((EntityState)this).PlayAnimation("Gesture, Override", "Secondary", "Secondary.playbackRate", duration * 4f, 0f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.SetAimTimer(2f); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { NextState(); } } public virtual void NextState() { ((EntityState)this).outer.SetNextState((EntityState)(object)new FireSear()); } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class FireSear : BaseState { public static float blastEffectRadius = 2f; public static float blastSpacing; public static GameObject ExplosionEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/omnieffect/OmniExplosionVFX"); public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/impacteffects/missileexplosionvfx"); public static float damageCoefficient = 2.6f; public static float force = 2400f; public static int bulletCount; public static float baseDuration = 0.5f; public static float recoilAmplitude = 1f; private float duration; public static float procCoefficient = 1f; public static Vector3 flameScale = new Vector3(0.14f, 0.14f, 0.07f); private static Vector3 flameEffectOffset = new Vector3(0f, 0.012f, 0.015f); public static GameObject flamethrowerEffectPrefab = null; private Transform flamethrowerTransform; private ChildLocator childLocator; protected virtual GameObject explosion => ExplosionEffectPrefab; public virtual void PlaySound() { Util.PlaySound("Play_Chefmod_Sear", ((EntityState)this).gameObject); } public override void OnEnter() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0085: 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_0092: 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_009e: 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_00e3: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01a7: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; ((BaseState)this).AddRecoil(-3f * recoilAmplitude, -5f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude); PlaySound(); Ray aimRay = ((BaseState)this).GetAimRay(); EffectData val = new EffectData(); val.scale = 2.9f; float num = 0f; while (num <= 48f) { num += blastEffectRadius + blastSpacing; Vector3 origin = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * num; val.origin = origin; EffectManager.SpawnEffect(explosion, val, false); } if (((EntityState)this).isAuthority) { ((BaseState)this).StartAimMode(aimRay, 2f, false); BulletAttack val2 = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = 0f, bulletCount = 1u, damage = damageCoefficient * base.damageStat, damageType = DamageTypeCombo.op_Implicit((DamageType)160), procCoefficient = procCoefficient, force = force, falloffModel = (FalloffModel)0, hitEffectPrefab = hitEffectPrefab, tracerEffectPrefab = null, isCrit = ((BaseState)this).RollCrit(), radius = 2f, smartCollision = true, maxDistance = 48f, stopperMask = ((LayerIndex)(ref LayerIndex.world)).collisionMask, hitMask = CommonMasks.bullet, queryTriggerInteraction = (QueryTriggerInteraction)0 }; ModifyBullet(val2); val2.Fire(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterBody.characterMotor.ApplyForce(-2000f * ((Ray)(ref aimRay)).direction, true, false); } } } public virtual void ModifyBullet(BulletAttack ba) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) DamageAPI.AddModdedDamageType(ba, ChefMod.ChefPlugin.chefSear); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); UpdateFlamethrowerEffect(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)flamethrowerTransform)) { EntityState.Destroy((Object)(object)((Component)flamethrowerTransform).gameObject); } ((EntityState)this).OnExit(); } private void UpdateFlamethrowerEffect() { //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_0020: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)flamethrowerTransform)) { Transform obj = flamethrowerTransform; Ray aimRay = ((BaseState)this).GetAimRay(); obj.forward = ((Ray)(ref aimRay)).direction; } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class Meal : BaseSkillState { private class SkillStatus { public int stock; public float stopwatch; public SkillStatus(int stock, float stopwatch) { this.stock = stock; this.stopwatch = stopwatch; } } private int boostPrimary = 0; private int boostSecondary = 0; private int boostUtility = 0; private SkillStatus primaryStatus; private SkillStatus secondaryStatus; private SkillStatus utilityStatus; public bool playSound = true; public override void OnEnter() { //IL_0011: 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) ((EntityState)this).GetModelChildLocator().FindChild("Hat").localScale = Vector3.one * 1.4f; if (playSound) { Util.PlaySound("Play_ChefMod_Special", ((EntityState)this).gameObject); } if (((EntityState)this).isAuthority) { if ((Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)ChefMod.ChefPlugin.primaryDef) { primaryStatus = new SkillStatus(((EntityState)this).skillLocator.primary.stock, ((EntityState)this).skillLocator.primary.rechargeStopwatch); ((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, ChefMod.ChefPlugin.boostedPrimaryDef, (SkillOverridePriority)4); boostPrimary = 1; } else if ((Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)ChefMod.ChefPlugin.altPrimaryDef) { primaryStatus = new SkillStatus(((EntityState)this).skillLocator.primary.stock, ((EntityState)this).skillLocator.primary.rechargeStopwatch); ((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, ChefMod.ChefPlugin.boostedAltPrimaryDef, (SkillOverridePriority)4); boostPrimary = 1; } if ((Object)(object)((EntityState)this).skillLocator.secondary.baseSkill == (Object)(object)ChefMod.ChefPlugin.secondaryDef) { secondaryStatus = new SkillStatus(((EntityState)this).skillLocator.secondary.stock, ((EntityState)this).skillLocator.secondary.rechargeStopwatch); ((EntityState)this).skillLocator.secondary.SetSkillOverride((object)this, ChefMod.ChefPlugin.boostedSecondaryDef, (SkillOverridePriority)4); boostSecondary = 1; } else if ((Object)(object)((EntityState)this).skillLocator.secondary.baseSkill == (Object)(object)ChefMod.ChefPlugin.altSecondaryDef) { secondaryStatus = new SkillStatus(((EntityState)this).skillLocator.secondary.stock, ((EntityState)this).skillLocator.secondary.rechargeStopwatch); ((EntityState)this).skillLocator.secondary.SetSkillOverride((object)this, ChefMod.ChefPlugin.boostedAltSecondaryDef, (SkillOverridePriority)4); boostSecondary = 1; } if ((Object)(object)((EntityState)this).skillLocator.utility.baseSkill == (Object)(object)ChefMod.ChefPlugin.utilityDef) { utilityStatus = new SkillStatus(((EntityState)this).skillLocator.utility.stock, ((EntityState)this).skillLocator.utility.rechargeStopwatch); ((EntityState)this).skillLocator.utility.SetSkillOverride((object)this, ChefMod.ChefPlugin.boostedUtilityDef, (SkillOverridePriority)4); boostUtility = 1; } ((EntityState)this).skillLocator.primary.stock = ((EntityState)this).skillLocator.primary.maxStock; ((EntityState)this).skillLocator.secondary.stock = ((EntityState)this).skillLocator.secondary.maxStock; ((EntityState)this).skillLocator.utility.stock = ((EntityState)this).skillLocator.utility.maxStock; } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); int num = boostPrimary * ((EntityState)this).skillLocator.primary.maxStock + boostSecondary * ((EntityState)this).skillLocator.secondary.maxStock + boostUtility * ((EntityState)this).skillLocator.utility.maxStock; int num2 = boostPrimary * ((EntityState)this).skillLocator.primary.stock + boostSecondary * ((EntityState)this).skillLocator.secondary.stock + boostUtility * ((EntityState)this).skillLocator.utility.stock; if (num2 < num && ((EntityState)this).isAuthority) { NextState(); } } public virtual void NextState() { ((EntityState)this).outer.SetNextStateToMain(); } public override void OnExit() { //IL_0011: 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) ((EntityState)this).GetModelChildLocator().FindChild("Hat").localScale = Vector3.one * 1f; if (((EntityState)this).isAuthority) { if (boostPrimary != 0) { if ((Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)ChefMod.ChefPlugin.primaryDef) { ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, ChefMod.ChefPlugin.boostedPrimaryDef, (SkillOverridePriority)4); } else if ((Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)ChefMod.ChefPlugin.altPrimaryDef) { ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, ChefMod.ChefPlugin.boostedAltPrimaryDef, (SkillOverridePriority)4); } ((EntityState)this).skillLocator.primary.stock = primaryStatus.stock; ((EntityState)this).skillLocator.primary.rechargeStopwatch = primaryStatus.stopwatch; } if (boostSecondary != 0) { if ((Object)(object)((EntityState)this).skillLocator.secondary.baseSkill == (Object)(object)ChefMod.ChefPlugin.secondaryDef) { ((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)this, ChefMod.ChefPlugin.boostedSecondaryDef, (SkillOverridePriority)4); } else if ((Object)(object)((EntityState)this).skillLocator.secondary.baseSkill == (Object)(object)ChefMod.ChefPlugin.altSecondaryDef) { ((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)this, ChefMod.ChefPlugin.boostedAltSecondaryDef, (SkillOverridePriority)4); } ((EntityState)this).skillLocator.secondary.stock = secondaryStatus.stock; ((EntityState)this).skillLocator.secondary.rechargeStopwatch = secondaryStatus.stopwatch; } if (boostUtility != 0) { ((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)this, ChefMod.ChefPlugin.boostedUtilityDef, (SkillOverridePriority)4); ((EntityState)this).skillLocator.utility.stock = utilityStatus.stock; ((EntityState)this).skillLocator.utility.rechargeStopwatch = utilityStatus.stopwatch; } } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class MealScepter : Meal { public override void NextState() { ((EntityState)this).outer.SetNextState((EntityState)(object)new Meal { playSound = false }); } } public class Marinate : BaseState { public static float buffOverlapDuration = 0.1f; public static float baseDuration = 1.5f; private float duration; public float speedMultiplier = 2f; private float buffOverlapStopwatch; private Vector3 idealDirection; private ChildLocator childLocator; private EmissionModule emissionator; private float lastUpdateTime; private float oilSpillTimer; private bool isCrit; public override void OnEnter() { //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) ((BaseState)this).OnEnter(); isCrit = ((BaseState)this).RollCrit(); oilSpillTimer = 0f; lastUpdateTime = Time.time; duration = baseDuration; childLocator = ((EntityState)this).GetModelChildLocator(); emissionator = ((Component)childLocator.FindChild("OilParticles")).GetComponent<ParticleSystem>().emission; if (((EntityState)this).isAuthority) { ((EmissionModule)(ref emissionator)).enabled = true; ((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); if (!((EntityState)this).characterMotor.isGrounded) { ((EntityState)this).characterMotor.velocity.y = 15f; } ((EntityState)this).PlayAnimation("Fullbody, Override", "UtilityStart"); } } public override void FixedUpdate() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = Time.time - lastUpdateTime; lastUpdateTime = Time.time; if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); return; } if (((EntityState)this).isAuthority) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.isSprinting = true; } UpdateDirection(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.moveVector = idealDirection; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.disableAirControlUntilCollision) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += GetIdealVelocity() * num; } } if (oilSpillTimer <= 0f) { Vector3 idealVelocity = GetIdealVelocity(); float num2 = ((Vector3)(ref idealVelocity)).magnitude / ((EntityState)this).characterBody.moveSpeed; int num3 = Mathf.FloorToInt(4f * num2); oilSpillTimer = (float)num3 / 60f; FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = OilSlick.projectilePrefab; val.position = ((EntityState)this).characterBody.corePosition; val.rotation = Quaternion.identity; val.owner = ((EntityState)this).gameObject; val.damage = ((EntityState)this).characterBody.damage * 0.25f; val.crit = isCrit; FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); } else { oilSpillTimer -= num; } } if (NetworkServer.active) { buffOverlapStopwatch += num; if (buffOverlapStopwatch >= OilSlick.buffOverlapDuration) { buffOverlapStopwatch -= OilSlick.buffOverlapDuration; ApplyOilServer(); } } } private void ApplyOilServer() { //IL_000d: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) List<HealthComponent> list = new List<HealthComponent>(); Collider[] array = Physics.OverlapSphere(((EntityState)this).transform.position, 12f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)); for (int i = 0; i < array.Length; i++) { HurtBox component = ((Component)array[i]).GetComponent<HurtBox>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && !list.Contains(component.healthComponent)) { list.Add(component.healthComponent); if (Object.op_Implicit((Object)(object)component.healthComponent.body.teamComponent) && component.healthComponent.body.teamComponent.teamIndex != ((BaseState)this).GetTeam()) { component.healthComponent.body.AddTimedBuff(ChefMod.ChefPlugin.oilBuff, 4f); } } } } public override void OnExit() { ((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); ((EmissionModule)(ref emissionator)).enabled = false; ((EntityState)this).PlayAnimation("Fullbody, Override", "UtilityEnd"); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } private void UpdateDirection() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_004c: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { Vector2 val = Util.Vector3XZToVector2XY(((EntityState)this).inputBank.moveVector); if (val != Vector2.zero) { ((Vector2)(ref val)).Normalize(); Vector3 val2 = new Vector3(val.x, 0f, val.y); idealDirection = ((Vector3)(ref val2)).normalized; } } } private Vector3 GetIdealVelocity() { //IL_0007: Unknown result type (might be due to invalid IL or mi