diff --git a/SCHIZO/Creatures/Ermshark/Ermshark.cs b/SCHIZO/Creatures/Ermshark/Ermshark.cs index 91bec800..a1ceb1db 100644 --- a/SCHIZO/Creatures/Ermshark/Ermshark.cs +++ b/SCHIZO/Creatures/Ermshark/Ermshark.cs @@ -65,7 +65,7 @@ private void Mitosis(Vector3 position, GameObject hurtEffect) const float splitScaleModifier = 0.69f; if (!_ermsharkPrefab) { - LOGGER.LogError($"No prefab for mitosis, committing Minecraft"); + LOGGER.LogWarning("No prefab for mitosis, committing Minecraft"); mitosisRemaining = 0; SOS(); return; @@ -73,7 +73,10 @@ private void Mitosis(Vector3 position, GameObject hurtEffect) liveMixin.ResetHealth(); transform.position = position + Random.insideUnitSphere * 0.5f; - transform.GetChild(0).localScale *= splitScaleModifier; + Transform model = transform.GetChild(0); + model.localScale *= splitScaleModifier; + // if the shark gets small enough, carrying other fish looks weird (bc they're bigger than it) + if (model.localScale.x < 0.3f) DisableCarry(gameObject); mitosisRemaining--; SpawnDecoy(position); @@ -93,7 +96,13 @@ private void SpawnDecoy(Vector3 position) ermshark.mitosisRemaining = mitosisRemaining; - CarryCreature carry = decoy.GetComponent(); - if (carry) carry.enabled = false; + DisableCarry(decoy); + } + + private static void DisableCarry(GameObject shark) + { + // forgor there are actually two of them on the shark + foreach (CarryCreature carry in shark.GetComponents()) + Destroy(carry); } } diff --git a/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs b/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs index 492b9721..394d62e4 100644 --- a/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs +++ b/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs @@ -21,7 +21,9 @@ public override void OnTouch(Collider collider) if (player) { GameObject heldObject = Inventory.main.GetHeldObject(); - if (heldObject && canBeFed && player.CanBeAttacked() && TryEat(heldObject, true)) + if (heldObject && canBeFed && player.CanBeAttacked() + && !heldObject.GetComponent() // otherwise decoy ermsharks eat ermfish from your hands + && TryEat(heldObject, true)) { if (this.GetBiteSound()) Utils.PlayEnvSound(this.GetBiteSound(), mouth.transform.position); gameObject.SendMessage("OnMeleeAttack", heldObject, SendMessageOptions.DontRequireReceiver); diff --git a/SCHIZO/Events/ErmfishDefenseForce/ErmfishDefenseForce.cs b/SCHIZO/Events/ErmfishDefenseForce/ErmfishDefenseForce.cs index c747e8b0..51c3ad48 100644 --- a/SCHIZO/Events/ErmfishDefenseForce/ErmfishDefenseForce.cs +++ b/SCHIZO/Events/ErmfishDefenseForce/ErmfishDefenseForce.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; -using RuntimeDebugDraw; using Unity.Collections; using UnityEngine; using UWE; @@ -184,8 +183,8 @@ private IEnumerator SpawnDefenderGroup(Defender defender) .OrderBy(hit => hit.point.DistanceSqrXZ(player.transform.position)) .FirstOrDefault(); if (blockingHit.point != default) - spawnPos = blockingHit.point; - + spawnPos = blockingHit.point + blockingHit.normal * 0.1f; + GameObject instance = GameObject.Instantiate(prefab); instance.transform.position = spawnPos; if (debugSpawns)