public static void EventManager_onCreatureHit(Creature creature, CollisionInstance collisionStruct) { if (collisionStruct.sourceColliderGroup?.collisionHandler?.item?.itemId == "IceSpike") { GainXP(XPGains.Hit); if (collisionStruct.damageStruct.hitRagdollPart.type == RagdollPart.Type.Head) { GainXP(XPGains.HeadShot); } if (creature != Player.currentCreature && !creature.isKilled) { if (creature.ragdoll.state != Ragdoll.State.Frozen) { if (!creature.GetComponent <IceSpellMWE>()) { creature.gameObject.AddComponent <IceSpellMWE>(); } IceSpellMWE scr = creature.GetComponent <IceSpellMWE>(); scr.SlowStartCoroutine(creature, 100f, 0f, 0f, 8f); } } } }
public void StopCapture() { captureTrigger.SetActive(false); for (int i = capturedObjects.Count - 1; i >= 0; i--) { Creature creature = capturedObjects[i].ragdollPart.ragdoll.creature; if (creature.GetComponent <IceSpellMWE>()) { IceSpellMWE scr = creature.GetComponent <IceSpellMWE>(); scr.UnFreezeCreature(creature); } capturedObjects.RemoveAt(i); } UnityEngine.Object.Destroy(captureTrigger.gameObject); }
protected void OnTrigger(Collider other, bool enter) { if (other.attachedRigidbody && !other.attachedRigidbody.isKinematic) { CollisionHandler component = other.attachedRigidbody.GetComponent <CollisionHandler>(); if (component && component.ragdollPart && component.ragdollPart.ragdoll != mana.creature.ragdoll && bubbleActive) { if (enter) { Creature creature = component.ragdollPart.ragdoll.creature; if (creature != Player.currentCreature && !creature.isKilled) { if (creature.ragdoll.state != Ragdoll.State.Frozen) { if (!creature.GetComponent <IceSpellMWE>()) { creature.gameObject.AddComponent <IceSpellMWE>(); } IceSpellMWE scr = creature.GetComponent <IceSpellMWE>(); scr.SlowStartCoroutine(creature, 100f, 0f, 0f, 50f); } } capturedObjects.Add(component); return; } else { Creature creature = component.ragdollPart.ragdoll.creature; if (creature.GetComponent <IceSpellMWE>()) { IceSpellMWE scr = creature.GetComponent <IceSpellMWE>(); scr.UnFreezeCreature(creature); } capturedObjects.Remove(component); } } } }
public override void OnImbueCollisionStart(CollisionInstance collisionInstance) { base.OnImbueCollisionStart(collisionInstance); if (collisionInstance.damageStruct.hitRagdollPart) { if (collisionInstance.damageStruct.damage > 1) { Creature creature = collisionInstance.targetCollider.GetComponentInParent <Creature>(); if (creature != Player.currentCreature && !creature.isKilled) { if (creature.animator.speed == 1) { if (!creature.GetComponent <IceSpellMWE>()) { creature.gameObject.AddComponent <IceSpellMWE>(); } IceSpellMWE scr = creature.GetComponent <IceSpellMWE>(); scr.SlowStartCoroutine(creature, collisionInstance.sourceColliderGroup.imbue.energy, 50f, 80f, 5f); } } } } }