コード例 #1
0
        void ForceGrab()
        {
            var bestmin = GrabbableObjects.MaxOrDefault(x => x.priority).unit;

            if (bestmin != null)
            {
                if (ObjectManager.Player.Spellbook.CastSpell(SpellSlot.W, bestmin))
                {
                    LastWTick = Utils.TickCount;
                }
            }
        }
コード例 #2
0
ファイル: GrabbingHand.cs プロジェクト: danicas92/Vornik
    public void GrabObject(GameObject Object)
    {
        Object.transform.position = Vector3.zero;
        Object.transform.rotation = Quaternion.identity;
        pivot.transform.rotation  = Quaternion.identity;

        GrabbableObjects go = Object.GetComponent <GrabbableObjects>();
        //pivot.transform.Rotate( go.GetGrabRotation());

        TrackedPoseDriver tpd = Object.AddComponent <TrackedPoseDriver>();

        tpd.UseRelativeTransform  = true;
        tpd.poseProviderComponent = bpp;
    }
コード例 #3
0
ファイル: GrabbingHand.cs プロジェクト: danicas92/Vornik
    public void OnTriggerStay(Collider colliderObject)
    {
        //Mira si se puede coger, si hay otro en la mano, si estamos pulsando y si el objeto esta cogido por otra mano
        if (colliderObject.CompareTag("Grab") && Input.GetAxis(InputName) >= 0.15f && !Grabbing && !colliderObject.gameObject.GetComponent <GrabbableObjects>().GetGrabbed())
        {
            currentObject = colliderObject.gameObject;
            GrabbableObjects grabbableObjects = currentObject.GetComponent <GrabbableObjects>();
            GrabObject(currentObject);
            Grabbing = true;
            grabbableObjects.SetGrabbed(true);
            colliderObject.GetComponent <Rigidbody>().useGravity = false;

            //handGrabMovement.Grab();
        }
    }
コード例 #4
0
        void CastW(Obj_AI_Hero paramtarget)
        {
            var targ = paramtarget == null?TargetSelector.GetTarget(SpellManager.W.Range, TargetSelector.DamageType.Magical) : paramtarget;

            if (targ == null)
            {
                return;
            }

            if (HasSecondW)
            {
                var result = SpellManager.W2.GetAoeSPrediction();

                if (result.HitCount > 0)
                {
                    SpellManager.W2.Cast(result.CastPosition);
                    return;
                }

                else if (result.HitCount == 0)
                {
                    var pred = SpellManager.W2.GetSPrediction(targ);
                    if (pred.HitChance >= HitChance.Low)
                    {
                        SpellManager.W2.Cast(pred.CastPosition);
                        return;
                    }
                    //Common if SPrediction cant find
                    else
                    {
                        var predc = SpellManager.W2.GetPrediction(targ);
                        if (predc.Hitchance >= HitChance.VeryHigh)
                        {
                            SpellManager.W2.Cast(predc.CastPosition);
                            return;
                        }
                    }
                }
            }



            //Add if W about to run out, throw at closeby minions?
            //if first W
            else if (WGood)
            {
                var target = paramtarget == null?TargetSelector.GetTarget(0.90f *SpellManager.W.Range, TargetSelector.DamageType.Magical) : paramtarget;

                if (target != null)
                {
                    var bestmin = GrabbableObjects.MaxOrDefault(x => x.priority).unit;
                    if (bestmin != null)
                    {
                        if (ObjectManager.Player.Spellbook.CastSpell(SpellSlot.W, bestmin))
                        {
                            LastWTick = Utils.TickCount;
                        }
                    }
                }
            }
        }