void OnHit() { if (seamoth.CanPilot() && seamoth.GetPilotingMode()) { Vector3 position = default(Vector3); GameObject gameObject = null; UWE.Utils.TraceFPSTargetPosition(seamoth.gameObject, 6.5f, ref gameObject, ref position, true); if (gameObject == null) { InteractionVolumeUser component = Player.main.gameObject.GetComponent <InteractionVolumeUser>(); if (component != null && component.GetMostRecent() != null) { gameObject = component.GetMostRecent().gameObject; } } if (gameObject) { LiveMixin liveMixin = gameObject.FindAncestor <LiveMixin>(); if (liveMixin) { bool flag = liveMixin.IsAlive(); liveMixin.TakeDamage(50f, position, DamageType.Normal, null); global::Utils.PlayFMODAsset(hitFishSound, this.front, 5f); } else { global::Utils.PlayFMODAsset(hitTerrainSound, this.front, 5f); } VFXSurface component2 = gameObject.GetComponent <VFXSurface>(); Vector3 euler = MainCameraControl.main.transform.eulerAngles + new Vector3(300f, 90f, 0f); VFXSurfaceTypeManager.main.Play(component2, VFXEventTypes.impact, position, Quaternion.Euler(euler), seamoth.gameObject.transform); gameObject.SendMessage("BashHit", this, SendMessageOptions.DontRequireReceiver); } } this.cooldownTime = Time.time + cooldownHit; }