Beispiel #1
0
    public damageHitbox spawnAtk(damageHitbox myModel, damageHitbox myPrefab, Transform spot, unitHitbox attacker)
    {
        //Debug.Log("spawn: " + myModel);
        if (myModel == null)
        {
            return(null);
        }
        damageHitbox dambox      = Instantiate(myPrefab);
        Bullet       myBulltet   = dambox.GetComponent <Bullet>();
        Bullet       modelBullet = myModel.GetComponent <Bullet>();

        if (myBulltet != null)
        {
            myBulltet.setSpeed(modelBullet.speed);
            myBulltet.setBulletDistance(modelBullet.bulletDistance);
        }
        dambox.transform.position    = spot.position;
        dambox.transform.eulerAngles = myModel.transform.eulerAngles;
        // dambox.transform.eulerAngles += new Vector3(0, -(spreadAngle / 2) + (i * spreadAngle / 4), 0);
        dambox.setDamage(myModel.damage);
        dambox.duplicateAfterDoneDamage(myModel);
        dambox.setOwner(attacker);
        dambox.ultiRegen = myModel.ultiRegen;
        return(dambox);
    }
Beispiel #2
0
    public void doActionADD(unitHitbox attacker, unitHitbox target, damageHitbox damageHB)
    {
        // bomb damage is 1/3 of attack power
        if (Bomb != null && maxitemChange > 0)
        {
            int          bombDamage = unitOwner.damageManager.damageDataList[0].damage / 3;
            damageHitbox damageHb   = Bomb.GetComponent <damageHitbox>();
            damageHb.setOwner(unitOwner);
            damageHb.setDamage(bombDamage);

            GameObject BombInstance = Instantiate(Bomb);
            BombInstance.transform.position = target.transform.position;
            BombInstance.SetActive(true);

            itemCharge--;
            if (itemCharge <= 0)
            {
                var unitItem = unitOwner.GetComponent <ItemOnPlayer>();
                if (unitItem != null)
                {
                    unitItem.RemoveItem(mainItem);
                }
            }
        }
    }
    public damageHitbox fireUltiArrow()
    {
        if (!isUltimate)
        {
            return(null);
        }

        damageHitbox dambox = Instantiate(ultiModel);

        dambox.GetComponent <Collider>().enabled = true;
        Bullet myBulltet   = dambox.GetComponent <Bullet>();
        Bullet modelBullet = ultiShoot.GetComponent <Bullet>();

        dambox.transform.position    = shootSpot.position;
        dambox.transform.eulerAngles = ultiShoot.transform.eulerAngles;
        // dambox.transform.eulerAngles += new Vector3(0, -(spreadAngle / 2) + (i * spreadAngle / 4), 0);
        dambox.setDamage(ultiShoot.damage);
        dambox.duplicateAfterDoneDamage(ultiShoot);
        myBulltet.setSpeed(modelBullet.speed);
        myBulltet.setBulletDistance(modelBullet.bulletDistance);
        dambox.setOwner(hitbox);
        dambox.ultiRegen = ultiShoot.ultiRegen;
        ultimateManager.useUltimate();
        hideAvatar();
        ultimateManager.endUltimate();
        return(dambox);
    }
Beispiel #4
0
    public damageHitbox spawnBomb(damageHitbox myBase, damageHitbox myPrefab)
    {
        damageHitbox dambox = Instantiate(myPrefab);

        dambox.transform.position    = transform.position;
        dambox.transform.eulerAngles = myBase.transform.eulerAngles;
        // dambox.transform.eulerAngles += new Vector3(0, -(spreadAngle / 2) + (i * spreadAngle / 4), 0);
        dambox.setDamage(myBase.damage);
        dambox.duplicateAfterDoneDamage(myBase);
        dambox.setOwner(hitbox);
        dambox.ultiRegen = myBase.ultiRegen;
        return(dambox);
    }
Beispiel #5
0
    public void doActionADD(unitHitbox attacker, unitHitbox target, damageHitbox damageHB)
    {
        float randomNum = Random.Range(1f, 100f);

        if (randomNum > currentFreezeChance)
        {
            return;
        }

        GameObject   freezeBomb = Instantiate(freezeBombInstance, target.transform.position, Quaternion.identity);
        damageHitbox dhb        = freezeBomb.GetComponent <damageHitbox>();

        dhb.setOwner(owner);
        dhb.setDamage(currentDamage);
        freezeBomb.SetActive(true);
    }
    public damageHitbox spawnArrow(damageHitbox myModel)
    {
        damageHitbox dambox      = Instantiate(arrowPrefab);
        Bullet       myBulltet   = dambox.GetComponent <Bullet>();
        Bullet       modelBullet = myModel.GetComponent <Bullet>();

        dambox.transform.position    = shootSpot.position;
        dambox.transform.eulerAngles = shootSpot.eulerAngles;
        // dambox.transform.eulerAngles += new Vector3(0, -(spreadAngle / 2) + (i * spreadAngle / 4), 0);
        dambox.setDamage(myModel.damage);
        dambox.duplicateAfterDoneDamage(myModel);
        myBulltet.setSpeed(modelBullet.speed);
        myBulltet.setBulletDistance(modelBullet.bulletDistance);
        myBulltet.maxUnit = modelBullet.maxUnit;
        dambox.setOwner(hitbox);
        dambox.ultiRegen = myModel.ultiRegen;
        return(dambox);
    }
    public damageHitbox spawnDuplicate(Transform spot)
    {
        damageHitbox dambox      = Instantiate(myPrefab);
        Bullet       myBulltet   = dambox.GetComponent <Bullet>();
        Bullet       modelBullet = gameObject.GetComponent <Bullet>();

        dambox.transform.position    = spot.position;
        dambox.transform.eulerAngles = spot.transform.eulerAngles;
        dambox.transform.localScale  = dambox.transform.localScale * (1 + sizeMultifier);
        // dambox.transform.eulerAngles += new Vector3(0, -(spreadAngle / 2) + (i * spreadAngle / 4), 0);
        dambox.setDamage(this.damage);
        dambox.duplicateAfterDoneDamage(this);
        dambox.isFriendly   = this.isFriendly;
        dambox.isUnFriendly = this.isUnFriendly;
        if (myBulltet != null)
        {
            myBulltet.setSpeed(modelBullet.speed);
            myBulltet.setBulletDistance(modelBullet.bulletDistance);
        }
        dambox.setOwner(this.ownerUnit);
        dambox.ultiRegen = this.ultiRegen;
        return(dambox);
    }
    public damageHitbox spawnMagic(damageHitbox myModel, damageHitbox myPrefab, Transform spot)
    {
        damageHitbox dambox      = Instantiate(myPrefab);
        Bullet       myBulltet   = dambox.GetComponent <Bullet>();
        Bullet       modelBullet = myModel.GetComponent <Bullet>();

        dambox.transform.position    = spot.position;
        dambox.transform.eulerAngles = myModel.transform.eulerAngles;
        // dambox.transform.eulerAngles += new Vector3(0, -(spreadAngle / 2) + (i * spreadAngle / 4), 0);
        dambox.setDamage(myModel.damage);
        dambox.duplicateAfterDoneDamage(myModel);
        if (myBulltet != null)
        {
            myBulltet.setSpeed(modelBullet.speed);
            myBulltet.setBulletDistance(modelBullet.bulletDistance);
        }
        dambox.effect = myModel.effect;
        unitHitbox hitbox = gameObject.GetComponent <unitHitbox>();

        dambox.setOwner(hitbox);
        dambox.ultiRegen = myModel.ultiRegen;
        return(dambox);
    }