Esempio n. 1
0
    public void AE_EndJump()
    {
        nav.enabled          = true;
        mainCollider.enabled = true;
        Instantiate(jumpHitEffectPrefab, transform.position, Quaternion.identity);

        Collider[] colls       = Physics.OverlapSphere(transform.position, jumpSplash, LayerMask.GetMask("Enemy"));
        float      physicPower = Mathf.Lerp(300f, 450.0f, growRate);

        foreach (var item in colls)
        {
            NPC target = item.GetComponent <NPC>();
            if (target)
            {
                Vector3 subVec    = target.transform.position - transform.position;
                float   distRate  = 1.0f - (subVec.magnitude / jumpSplash);
                float   curDamage = distRate * mStompDamage;
                target.GetDamaged(curDamage);
                target.Rigid.AddForce(subVec.normalized * distRate * physicPower);
            }
        }

        camShaker.ShakeCaller(2.5f, 1.5f);
        SoundMgr.Instance.Play(mainSoundPlayer, "GolemHit", 1.0f);
    }
Esempio n. 2
0
    public override void AE_StartAttack()
    {
        if (trail)
        {
            trail.StartTrail();
        }
        weapon.StartAttack();

        camShaker.ShakeCaller(0.1f, 0.2f);
    }
Esempio n. 3
0
    public void InitGolem(Player player, float growRate)
    {
        this.growRate = growRate;

        EBoss boss = FindObjectOfType <EBoss>();

        if (boss)
        {
            if (hpBar == null)
            {
                hpBar = Instantiate(hpBarPrefab, uiCanvas).GetComponent <HPBar>();
            }
            hpBar.ShowUp(!boss.IsCurseOn);
        }

        this.player = player;

        if (nav)
        {
            nav.enabled = true;
        }
        if (mainCollider)
        {
            mainCollider.enabled = true;
        }

        float mAttRad = Mathf.Lerp(attRad.x, attRad.y, growRate);

        sqrAttRad = mAttRad * mAttRad;
        float mScale = Mathf.Lerp(bodyScale.x, bodyScale.y, growRate);

        transform.localScale = new Vector3(mScale, mScale, mScale);
        mStompDamage         = Mathf.Lerp(stompDamage.x, stompDamage.y, growRate);
        maxHP      = Mathf.Lerp(maxHPRange.x, maxHPRange.y, growRate);
        curHP      = maxHP;
        jumpSplash = Mathf.Lerp(jumpSplashRange.x, jumpSplashRange.y, growRate);
        GetComponent <CapsuleCollider>().radius = Mathf.Lerp(colliderSizeRange.x, colliderSizeRange.y, growRate);
        fist = GetComponentInChildren <MeleeWeapon>();
        fist.SetDamage(Mathf.Lerp(attDamage.x, attDamage.y, growRate));

        camShaker = Camera.main.GetComponent <CameraShakeSimpleScript>();
        camShaker.ShakeCaller(3.5f, 2.0f);

        StartCoroutine(IE_Enable());
    }