Beispiel #1
0
        public Pudge(Unit9 owner, MultiSleeper abilitySleeper, Sleeper orbwalkSleeper, ControllableUnitMenu menu)
            : base(owner, abilitySleeper, orbwalkSleeper, menu)
        {
            this.ComboAbilities = new Dictionary <AbilityId, Func <ActiveAbility, UsableAbility> >
            {
                { AbilityId.pudge_meat_hook, x => this.hook = new MeatHook(x) },
                { AbilityId.pudge_rot, x => this.rot = new Rot(x) },
                { AbilityId.pudge_dismember, x => this.dismember = new Dismember(x) },

                { AbilityId.item_blink, x => this.blink = new BlinkDaggerPudge(x) },
                { AbilityId.item_swift_blink, x => this.blink = new BlinkDaggerPudge(x) },
                { AbilityId.item_arcane_blink, x => this.blink = new BlinkDaggerPudge(x) },
                { AbilityId.item_overwhelming_blink, x => this.blink = new BlinkDaggerPudge(x) },
                { AbilityId.item_force_staff, x => this.force = new ForceStaff(x) },
                { AbilityId.item_blade_mail, x => this.bladeMail = new ShieldAbility(x) },
                { AbilityId.item_spirit_vessel, x => this.vessel = new DebuffAbility(x) },
                { AbilityId.item_urn_of_shadows, x => this.urn = new DebuffAbility(x) },
                { AbilityId.item_rod_of_atos, x => this.atos = new DisableAbility(x) },
                { AbilityId.item_gungir, x => this.gungir = new DisableAbility(x) },
                { AbilityId.item_shivas_guard, x => this.shiva = new DebuffAbility(x) },
                { AbilityId.item_ethereal_blade, x => this.ethereal = new DebuffAbility(x) },
                { AbilityId.item_dagon_5, x => this.dagon = new NukeAbility(x) },
                { AbilityId.item_nullifier, x => this.nullifier = new Nullifier(x) },
                { AbilityId.item_bloodthorn, x => this.bloodthorn = new Bloodthorn(x) },
                { AbilityId.item_black_king_bar, x => this.bkb = new ShieldAbility(x) },
                { AbilityId.item_lotus_orb, x => this.lotus = new ShieldAbility(x) },
            };
        }
Beispiel #2
0
    IEnumerator ThrowHook()
    {
        skillInProgress[0] = true;
        GameObject MeatHook = Instantiate(MeatHookPrefab, MeatHookPrefab.transform.position, MeatHookPrefab.transform.rotation);

        MeatHook.SetActive(true);
        MeatHook hook = MeatHook.GetComponent <MeatHook>();

        hook.self = gameObject;
        float hookSpeed = 20f;

        Vector2 mouseP         = controller.actionCenter.mouse.position;
        Vector3 targetLocation = new Vector3(mouseP.x, 0f, mouseP.y);

        targetLocation.y = MeatHook.transform.position.y;
        Vector3 moveDir = (targetLocation - MeatHook.transform.position).normalized;

        float dTravelled = 0f;
        float distance   = (targetLocation - MeatHook.transform.position).magnitude;

        MeatHook.transform.LookAt(new Vector3(targetLocation.x, MeatHook.transform.position.y, targetLocation.z));
        //Fly to target
        while (dTravelled < distance)
        {
            if (!hook.hit)
            {
                MeatHook.transform.position += moveDir * hookSpeed * Time.deltaTime;
                dTravelled += hookSpeed * Time.deltaTime;
            }
            else
            {
                break;
            }
            yield return(null);
        }

        if (hook.hit && hook.tag != controller.tag)
        {
            //controller.DealDamage(hook.hitObject.GetComponent<HeroController>(), stats.skills[0].Damage[skillLvls[0]]);
        }

        //Return to hero
        targetLocation = transform.position;
        dTravelled     = 0f;
        distance       = (targetLocation - MeatHook.transform.position).magnitude;
        moveDir        = (targetLocation - MeatHook.transform.position).normalized;
        MeatHook.transform.LookAt(MeatHook.transform.position - moveDir);
        while (dTravelled < distance)
        {
            MeatHook.transform.position += moveDir * hookSpeed * Time.deltaTime;
            dTravelled += hookSpeed * Time.deltaTime;
            yield return(null);
        }
        Destroy(MeatHook);
        skillInProgress[0] = false;
    }
        // Token: 0x06000413 RID: 1043 RVA: 0x00016940 File Offset: 0x00014B40
        public void HookAlly(TargetManager targetManager)
        {
            MeatHook meatHook = this.hook;

            if (meatHook == null || !meatHook.Ability.CanBeCasted(true))
            {
                return;
            }
            Unit9             target           = targetManager.Target;
            PredictionInput9  predictionInput  = this.hook.Ability.GetPredictionInput(target, null);
            PredictionOutput9 predictionOutput = this.hook.Ability.GetPredictionOutput(predictionInput);

            if (predictionOutput.HitChance < 1)
            {
                return;
            }
            this.hook.Ability.UseAbility(predictionOutput.CastPosition, false, false);
        }