Esempio n. 1
0
    protected void LateUpdate()
    {
        if (GameManager.o.pause)
        {
            return;
        }

        if (active1 != null && active1CooldownCurrent > 0)
        {
            active1CooldownCurrent -= Time.deltaTime * 0.25f;
        }
        if (active2 != null && active2CooldownCurrent > 0)
        {
            active2CooldownCurrent -= Time.deltaTime * 0.25f;
        }

        if (specialCharge)
        {
            specialChargeTime += Time.deltaTime;
            if (specialChargeTime > specialChargeTimeMax)
            {
                specialChargeTime = specialChargeTimeMax;
            }
            if (Special())
            {
                LockInput(0.1f);
                animator.state = "special";
            }
            else
            {
                specialCharge = false;
                if (currentMagic >= 1)
                {
                    specialCooldownCurrent = specialCooldown;
                    animator.state         = "special fire";
                    LockInput(0.3f);

                    ProjectileHeroArrow t = (ProjectileHeroArrow)Instantiate(projArrow);
                    t.transform.position = transform.position + (Vector3)box.offset;
                    t.direction          = direction;
                    t.team = team;

                    if (specialChargeTime == specialChargeTimeMax && currentMagic >= 2)
                    {
                        currentMagic -= 2;
                        t.speed       = t.speed * 2;
                        t.dropTime    = 5;
                    }
                    else
                    {
                        currentMagic -= 1;
                        t.speed       = t.speed * (1 + (0.1f * Mathf.Floor(6 * (specialChargeTime / specialChargeTimeMax))));
                        t.dropTime    = t.dropTime * (1 + (0.1f * Mathf.Floor(6 * (specialChargeTime / specialChargeTimeMax))));
                    }
                }
            }
        }
    }
Esempio n. 2
0
    protected void LateUpdate()
    {
        if (specialCharge)
        {
            specialChargeTime += Time.deltaTime;
            if (specialChargeTime > specialChargeTimeMax)
            {
                specialChargeTime = specialChargeTimeMax;
            }
            if (Special())
            {
                LockInput(0);
            }
            else
            {
                specialCharge    = false;
                animator.special = false;
                if (SpecialReleased() && currentMagic >= 1)
                {
                    specialCooldownCurrent = specialCooldown;
                    animator.specialFire   = true;
                    LockInput(0.3f);

                    ProjectileHeroArrow t = (ProjectileHeroArrow)Instantiate(projArrow);
                    t.transform.position = transform.position + (Vector3)box.offset;
                    t.direction          = direction;
                    t.team = team;

                    if (specialChargeTime == specialChargeTimeMax && currentMagic >= 2)
                    {
                        currentMagic -= 2;
                        t.speed       = t.speed * 2;
                        t.dropTime    = 5;
                    }
                    else
                    {
                        currentMagic -= 1;
                        t.speed       = t.speed * (1 + (0.1f * Mathf.Floor(6 * (specialChargeTime / specialChargeTimeMax))));
                        t.dropTime    = t.dropTime * (1 + (0.1f * Mathf.Floor(6 * (specialChargeTime / specialChargeTimeMax))));
                    }
                }
            }
        }
    }