Ejemplo n.º 1
0
        public void OnTeleUnGrabAction(Handle handle, Telekinesis teleGrabber)
        {
            if (handle == item.mainHandleRight)
            {
                handle1Grabbed = false;
            }
            else
            {
                handle2Grabbed = false;
            }

            if (!handle2Grabbed && !handle1Grabbed)
            {
                handle.rb.isKinematic = true;
            }


            if (data == null)
            {
                AddFrameToList();
            }



            UpdateData();
        }
Ejemplo n.º 2
0
        private static void Postfix(Telekinesis __instance)
        {
            var caster = __instance.interactor.bodyHand.caster;

            if (__instance.catchedHandle && caster.currentSpell && caster.currentSpell is SpellLightning)
            {
                float manaCost = Electrical.ItemChargeSettings.manaPerSec * Time.deltaTime;
                if (caster.caster.currentMana > manaCost)
                {
                    caster.caster.currentMana -= manaCost;
                    var existingBolts = __instance.catchedHandle.GetComponents <LightningBolt>();
                    if (existingBolts.Length < 4)
                    {
                        var toHand = __instance.catchedHandle.transform.position - caster.bodyHand.transform.position;
                        if (toHand.sqrMagnitude < 3f)
                        {
                            LightningBolt.QueueLightningBolt(__instance.catchedHandle.gameObject, caster.currentSpell as SpellLightning, Random.Range(0.1f, 0.4f));
                            if (__instance.catchedHandle.item)
                            {
                                ChargeGrabbedPatch.ChargeItem(__instance.catchedHandle.item);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 internal static void Postfix(Item __instance, Handle handle, Telekinesis teleGrabber)
 {
     if (Instance.IsTimeFrozen && handle.handlers.Count == 0)
     {
         __instance.gameObject.AddComponent <DelayFreeze>();
     }
 }
Ejemplo n.º 4
0
    public GameObject anaNode;                  //ANALYTICS

    void Start()
    {
//		TM = transform.parent.GetComponent<TimeManager>();

        TeleK       = GetComponent <Telekinesis>();
        TimeSlow    = GetComponent <TimeSlow>();
        reticule    = GetComponent <playerAim>();
        MindBullets = GetComponent <MindBullets>();

        selectWeapon(Weapon.NoWeapon);
    }
Ejemplo n.º 5
0
        public void OnTeleUnGrab(Handle handle, Telekinesis teleGrabber)
        {
            gameObject.GetComponent <Item>().Despawn(5);


            if (chargeTimer == null)
            {
                return;
            }
            chargeTimer.Stop();
            chargeTimer.Interval = spellChargeTime * MILLISECONDS; // Reset timer.
        }
Ejemplo n.º 6
0
        public void OnTeleGrabAction(Handle handle, Telekinesis teleGrabber)
        {
            handle.rb.isKinematic = false;

            if (handle == item.mainHandleRight)
            {
                handle1Grabbed = true;
            }
            else
            {
                handle2Grabbed = true;
            }
        }
Ejemplo n.º 7
0
        public void OnTeleUnGrabAction(Handle handle, Telekinesis teleGrabber)
        {
            if (!teleUngrabbing)
            {
                teleUngrabbing      = true;
                item.rb.isKinematic = true;
                if (!module.freezeEnemiesInTheAir)
                {
                    teleGrabber.TryRelease();
                    isEnding = true;
                    DarkChains.DarkChainDestroy(item, myRagdollPart, ragdollHandle, teleGrabber, neck);
                }

                if (neck && module.choking)
                {
                    chokeSFX.Stop();
                    choking = false;
                    NPC.OnChoke(false);
                    NPC.speak.enabled       = true;
                    NPC.speak.speakLoudness = 1f;
                }
            }
        }
Ejemplo n.º 8
0
        public void OnTeleGrabAction(Handle handle, Telekinesis teleGrabber)
        {
            teleUngrabbing = false;

            if (item.rb.isKinematic == true)
            {
                item.rb.isKinematic = false;
            }

            if (neck && NPC.state != Creature.State.Dead && module.choking)
            {
                chokeSFX.Stop();
                chokeSFX.Play();
                choking = true;
                NPC.OnChoke(true);
                NPC.speak.enabled       = false;
                NPC.speak.speakLoudness = 0f;


                if (NPC.GetHeldobject(Side.Left))
                {
                    if (NPC.GetHeldobject(Side.Left).handles.Count > 0)
                    {
                        NPC.GetHeldobject(Side.Left).handles[0].handlers[0].UnGrab(false);
                    }
                }

                if (NPC.GetHeldobject(Side.Right))
                {
                    if (NPC.GetHeldobject(Side.Right).handles.Count > 0)
                    {
                        NPC.GetHeldobject(Side.Right).handles[0].handlers[0].UnGrab(false);
                    }
                }
            }
        }
Ejemplo n.º 9
0
 public void OnTeleGrab(Handle handle, Telekinesis teleGrabber)
 {
     Charge();
 }
Ejemplo n.º 10
0
 internal static void Postfix(Item __instance, Handle handle, Telekinesis teleGrabber)
 {
     Instance.UnFreezeItem(__instance);
 }
Ejemplo n.º 11
0
 void ShieldTeleGrab(Handle handle, Telekinesis teleGrabber)
 {
     target = null;
 }
Ejemplo n.º 12
0
 private void Start()
 {
     Telekinesis = Player.GetComponent <Telekinesis>();
     Fire        = Player.GetComponent <Fireball>();
 }
Ejemplo n.º 13
0
        public static void DarkChainDestroy(Item chain, RagdollPart ragdollPart, RagdollHandle ragdollHandle, Telekinesis telekinesis, bool neck)
        {
            telekinesis.TryRelease();

            DestroySelf.Destroy(chain.gameObject);

            if (ragdollPart.ragdoll.parts.Count > 0)
            {
                foreach (RagdollPart part in ragdollPart.ragdoll.parts)
                {
                    part.rb.isKinematic = false;
                }
            }

            if (ragdollHandle.ragdollPart.ragdoll.parts.Count > 0)
            {
                foreach (RagdollPart part in ragdollHandle.ragdollPart.ragdoll.parts)
                {
                    part.rb.isKinematic = false;
                }
            }


            ragdollPart.ragdoll.SetState(BS.Ragdoll.State.Fallen);
            if (ragdollPart.ragdoll.creature.health.currentHealth <= 0)
            {
                ragdollPart.ragdoll.SetState(BS.Ragdoll.State.Dead);
            }


            if (ragdollHandle.name == "NPC(neck)(chained)")
            {
                ragdollHandle.name = "NPC(neck)";
            }
            else if (ragdollHandle.name == "NPC(chained)")
            {
                ragdollHandle.name = "NPC";
            }
            else
            {
                Debug.Log("The ragdollHandle was neither the neck nor a default part");
            }
            //ragdollPart.ragdoll.RefreshFall();
            ragdollPart.ragdoll.allowStandUp = true;
            ragdollHandle.tag = "Untagged";
        }
Ejemplo n.º 14
0
        public void CheckTeleNPC(Telekinesis telekinesis)
        {
            if (telekinesis.catchedHandle != null)
            {
                if (telekinesis.catchedHandle.tag == "Untagged")
                {
                    if (telekinesis.catchedHandle.name == "NPC" || telekinesis.catchedHandle.name == "NPC(neck)")
                    {
                        RagdollHandle rdHandle = telekinesis.catchedHandle as RagdollHandle;

                        if (rdHandle.ragdollPart != null)
                        {
                            Item chain = Catalog.current.GetData <ItemData>("DarkChain", true).Spawn(true);

                            rdHandle.ragdollPart.ragdoll.allowStandUp = false;


                            chainedParts.Add(rdHandle);
                            darkChains.Add(chain);

                            chain.transform.position = rdHandle.ragdollPart.transf.position;
                            chain.transform.rotation = rdHandle.ragdollPart.transf.rotation;


                            if (chain.gameObject != null)
                            {
                                if (chain.gameObject.GetComponent <ItemDarkChain>() != null)
                                {
                                    chain.gameObject.GetComponent <ItemDarkChain>().myRagdollPart = rdHandle.ragdollPart;
                                    chain.gameObject.GetComponent <ItemDarkChain>().ragdollHandle = rdHandle;
                                }
                            }


                            if (telekinesis.catchedHandle.name == "NPC(neck)")
                            {
                                chain.gameObject.GetComponent <ItemDarkChain>().sliceable = false;
                                chain.gameObject.GetComponent <ItemDarkChain>().neck      = true;
                                telekinesis.catchedHandle.name = "NPC(neck)(chained)";
                            }
                            else
                            {
                                chain.gameObject.GetComponent <ItemDarkChain>().sliceable = true;
                                chain.gameObject.GetComponent <ItemDarkChain>().neck      = false;
                                telekinesis.catchedHandle.name = "NPC(chained)";
                            }

                            if (rdHandle.ragdollPart.ragdoll.state != BS.Ragdoll.State.Dead)
                            {
                                rdHandle.ragdollPart.ragdoll.SetState(BS.Ragdoll.State.Fallen);
                            }

                            chain.gameObject.GetComponent <ItemDarkChain>().Initialize();

                            Debug.Log("Catched handle name: " + telekinesis.catchedHandle.name);

                            telekinesis.catchedHandle.tag = "IgnoreTK";

                            telekinesis.TryRelease();
                            telekinesis.targetHandle = chain.mainHandleRight;
                            telekinesis.TryCatch();
                        }
                    }
                }
            }
        }
Ejemplo n.º 15
0
 void HammerTeleGrab(Handle handle, Telekinesis teleGrabber)
 {
     target   = null;
     isHoming = false;
 }
Ejemplo n.º 16
0
 public void OnTeleUngrabEvent(Handle handle, Telekinesis teleGrabber)
 {
     ResetCollisions();
 }