Beispiel #1
0
        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);
                    }
                }
            }
        }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 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);
             }
         }
     }
 }
Beispiel #4
0
 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);
                 }
             }
         }
     }
 }