Example #1
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:     // If it's the shield
            shieldLevel++;
            break;

        default:     // If it's any Weapon PowerUp
                     // Check the current weapon type
            if (pu.type == weapons[0].type)
            {
                // then increase the number of weapons of this type
                Weapon w = GetEmptyWeaponSlot();     // Find an available weapon
                if (w != null)
                {
                    // Set it to pu.type
                    w.SetType(pu.type);
                }
            }
            else
            {
                // If this is a different weapon
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #2
0
    public void AbsorbPowerUp(GameObject go)
    {
        // print(go + "man zoinks");
        PowerUp pu = go.GetComponent <PowerUp>();  //pu is not existent why

        // print(pu + "man zoinks");
        switch (pu.type)
        {
        case WeaponType.shield:
            shieldLevel++;
            break;

        default:
            if (pu.type == weapons[0].type)
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    w.SetType(pu.type);
                }
            }
            else
            {
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
//        print("OHNNONOOOOO"+this.gameObject+"HII"+" "+pu);
        pu.AbsorbedBy(this.gameObject);
    }
Example #3
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:
            ShieldLevel++;
            break;

        default:
            // Если оружие того же типа, установить в pu.type
            if (pu.type == weapons[0].Type)
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    w.SetType(pu.type);
                }
            }
            else     // Если оружие другого типа
            {
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(gameObject);
    }
Example #4
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:
            shieldLevel++;
            break;

        default:
            if (pu.type == weapons[0].type)
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    w.SetType(pu.type);
                }
            }
            else
            {
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #5
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield: shieldLevel++;     // lines 110 to 120 uncomment
            break;

        default: if (pu.type == weapons[0].type)       // if it is the same type
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    w.SetType(pu.type);
                }
            }
            else         // if this is a different weapon
            {
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #6
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu  = go.GetComponent <PowerUp>();
        Vector3 pos = transform.position;

        switch (pu.type)
        {
        case WeaponType.warp:
            _possibleWarp = true;
            _numOfWarp    = 3;
            break;

        case WeaponType.shield:
            shieldLevel += Random.Range(1, 4 - shieldLevel);
            break;

        case WeaponType.boost:

            speed          *= 2;
            _speedIncreased = true;
            break;

        default:
            break;
        }
        //NEED TO ACTUALLY PUT SHIT INTO HERE !!!!! !! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! __ ! _!_! _! !_!_

        pu.AbsorbedBy(this.gameObject);
    }
Example #7
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:
            shieldLevel++;
            break;

        default:
            // Это какой то из типо оружия
            if (pu.type == weapons[0].type)
            {
                // Увеличиваем количество оружий этого типа
                Weapon w = GetEmptyWeaponSlot();        // Находим доступный слот
                if (w != null)
                {
                    w.SetType(pu.type);
                }
            }
            else
            {
                // Если это другое оружие
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #8
0
    // you do not need to adjust Absorb PowerUp:  Nick: altered this code for fun, wanted weapons to not clear, and first blaster to never change.
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:
            shieldLevel++;
            break;

        default:
            if (pu.type == weapons[0].type)
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)   // there is an empty slot
                {
                    // Set it to pu.type
                    w.SetType(pu.type);
                }
                else     // if there are no more empty weapon slots
                //each different type pickup replaces first slot with diff type in it
                {
                    //TODO: Add code here that would replace the current weapon slot with the new powerup if it is a different type once no more empty slots
                }
            }
            else
            {
                //If this is a different weapon type
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(gameObject);
    }
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:     // a
            shieldLevel++;
            break;

        default:  // b
            if (pu.type == weapons[0].type)
            {     // If it is the same type // c
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    // Set it to pu.type
                    w.SetType(pu.type);
                }
            }
            else
            {     // If this is a different weapon type // d
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #10
0
    public void AbsorbPowerUp(GameObject go)
    {
        print("AbsorbPowerUp : " + go.name);
        PowerUp pu = go.GetComponent <PowerUp>();

        print("AbsorbPowerUp : " + pu.Type);
        switch (pu.Type)
        {
        case WeaponType.Shield:
            ShieldLevel++;
            break;

        default:
            if (pu.Type == Weapons[0].Type)
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    w.SetType(pu.Type);
                }
            }
            else
            {
                ClearWeapons();
                Weapons[0].SetType(pu.Type);
            }
            break;
        }
        pu.AbsorbedBy(gameObject);
    }
Example #11
0
    private void AbsorbPowerUp(GameObject go)
    {
        PowerUp pwrUp = go.GetComponent <PowerUp>();

        switch (pwrUp.type)
        {
        case WeaponType.SHIELD:
            shieldLevel++;
            break;

        default:
            if (pwrUp.type == weapons[0].type)
            {
                Weapon wep = GetEmptyWeaponSlot();
                if (wep != null)
                {
                    wep.SetType(pwrUp.type);
                }
            }
            else
            {
                ClearWeapons();
                weapons[0].SetType(pwrUp.type);
            }
            break;
        }
        pwrUp.AbsorbedBy(gameObject);
    }
Example #12
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case Main.WeaponType.shield:
            if (shieldLevel == 4)
            {
                shieldLevel = 4;
            }
            else
            {
                shieldLevel++;
            }

            break;

        case Main.WeaponType.movementSpeed:
            speed += 10;
            break;

        case Main.WeaponType.attackSpeed:
            if (Main.GetWeaponDefintion(Main.WeaponType.blaster).delayBetweenShots > 0.25f)
            {
                Main.GetWeaponDefintion(Main.WeaponType.gun).delayBetweenShots     *= 0.7f;
                Main.GetWeaponDefintion(Main.WeaponType.blaster).delayBetweenShots *= 0.7f;
            }
            break;

        default:     // nothing
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #13
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:                                              // a
                                shieldLevel++;
            break;

        default:                                                          // b
                            if(pu.type == weapons[0].type)
            {                                                             // If it is the same type  // c
                                    Weapon w = GetEmptyWeaponSlot();

                if (w != null)
                {
                                            // Set it to pu.type
                                            w.SetType(pu.type);
                }
            }

            else
            {     // If this is a different weapon type               // d
                                    ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;

            // Leave this switch block empty for now.
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #14
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        if (AudioManager.S.playSounds)
        {
            UIManager.S.GetComponent <AudioSource>().Play();
        }
        switch (pu.type)
        {
        case WeaponType.shield:     // If it's the Shield
            shieldLevel++;
            break;

        case WeaponType.gold:     // If it's GOLD
            UIManager.S.AddScore(UIManager.S.bonusScore);
            break;

        case WeaponType.invincibility:     // If it's the invincibility one
            if (AudioManager.S.playCopyrightSounds)
            {
                AudioManager.S.GetComponent <AudioSource>().Stop();
                if (!GetComponent <AudioSource>().isPlaying)
                {
                    GetComponent <AudioSource>().Play();
                }
            }
            else
            {
                GetComponent <AudioSource>().Stop();
            }
            StartCoroutine(invincibilityCountdown());
            break;

        default:     // If it's any Weapon PowerUp
            // Check the current Weapon type
            if (pu.type == weapons[0].type)
            {
                // Then increase the number of Weapons of this type
                Weapon w = GetEmptyWeaponSlot();     // Find an available Weapon
                if (w != null)
                {
                    // Set it to pu.type
                    w.SetType(pu.type);
                }
            }
            else
            {
                // If this is a different Weapon
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #15
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:
            shieldLevel++;
            break;

        case WeaponType.nitro:
            if (speed + 10 < 60)
            {
                speed += 10;
            }
            particle = GetComponent <ParticleSystem>();
            particle.Play();
            break;

        case WeaponType.giant:
            if (giantcount < 3)
            {
                Vector3 sc = new Vector3(.2f, .2f, .2f);
                transform.localScale += sc;
                shieldLevel          += 50;
                speed -= 5;
                giantcount++;
            }
            break;

        default:
            if (pu.type == weapons[0].type)
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    // Set it to pu.type
                    w.SetType(pu.type);
                }
            }
            else
            {
                //If this is a different weapon type
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(gameObject);
    }
Example #16
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.boost:
            shipSpeed = 130f;
            break;

        case WeaponType.fastShoot:
            projectileSpeed = 1000f;
            break;

        case WeaponType.clear:
            GameObject[] enemies = GameObject.FindGameObjectsWithTag("enemy0");
            for (var i = 0; i < enemies.Length; i++)              //clears all of the enemies off the screen
            {
                Destroy(enemies[i]);
            }
            GameObject[] enemies1 = GameObject.FindGameObjectsWithTag("enemy1");
            for (var i = 0; i < enemies1.Length; i++)              //clears all of the enemies off the screen
            {
                Destroy(enemies1[i]);
            }
            GameObject[] enemies2 = GameObject.FindGameObjectsWithTag("enemy3");
            for (var i = 0; i < enemies2.Length; i++)              //clears all of the enemies off the screen
            {
                Destroy(enemies2[i]);
            }
            break;

        default:
            if (pu.type == weapons[0].type)
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    w.SetType(pu.type);
                }
            }
            else
            {
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.nuke:
            //When the nuke is absorbed by the user, increment the number of nukes allowed
            Spawn.S.nukeCounter++;
            //Update the UI-text
            GameObject.Find("NukeCounter").GetComponent <UnityEngine.UI.Text>().text = "Nuke Counter: " + Spawn.S.nukeCounter;
            break;

        case WeaponType.shield:     // a
            shieldLevel++;
            break;

        case WeaponType.EMP:
            //Call stun method
            pu.Stun();
            FindObjectOfType <AudioManager>().Play("EMP");
            break;

        case WeaponType.X2:
            Spawn.S.pickupTime     = Time.time;
            Spawn.S.isDoubleTime   = true;
            Spawn.S.x2Slider.value = 1;
            Spawn.S.timeTracker    = 0;
            Spawn.S.x2Slider.gameObject.SetActive(true);
            //Spawn.S.InitiateDoublePoints();
            break;

        default:
            if (pu.type == weapons[0].type)
            {
                Weapons w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    w.SetType(pu.type);
                }
            }
            else
            {
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #18
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.none:
            break;

        case WeaponType.blaster:
            break;

        case WeaponType.spread:
            break;

        case WeaponType.phaser:
            break;

        case WeaponType.missile:
            break;

        case WeaponType.laser:
            break;

        case WeaponType.shield:
            shieldLevel++;
            break;

        default:    //如果是任何一种武器升级道具
            //检查当前武器类型
            if (pu.type == weapons[0].type)
            {
                //增加该类型武器的数量
                Weapon w = GetEmptyWeaponSlot();    //找到一个空白武器位置
                if (w != null)
                {
                    //将其赋值给pu.type
                    w.SetType(pu.type);
                }
            }
            else
            {
                //如果武器类型不一样
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #19
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp> ();

        Main.S.SetOldWeapon(pu);
        Debug.Log(pu.type);
        switch (pu.type)
        {
        case WeaponType.shield:
            shieldLevel++;
            break;

        case WeaponType.nuke:                    //power up : nuke
            int BombCount = Main.S.getBombCount();
            BombCount += 1;                      //accumulate bombs count
            Main.S.setBombCountText(BombCount);
            SwitchWeapons(Main.S.GetOldWeapon());
            break;

        case WeaponType.undamaged:              //power up : undamaged
            energy.changeHP(1);                 //accumulate energy bar
            if (energy.currentHP == 3)
            {
                setBottomText("You're Invincible!");
                harm             = false;
                startHarmCount   = true;
                energy.currentHP = 0;
            }
            break;

        default:
            if (pu.type == weapons [0].type)                    // if it's the same weapon type
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    w.SetType(pu.type);
                }
            }
            else               //different weapon type, switch to same level
            {
                SwitchWeapons(pu.type);
            }
            break;
        }         // end switch

        pu.AbsorbedBy(this.gameObject);
    }
Example #20
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        weapon.Type      = pu.type;
        currentWeaponDef = GameManager.GetWeaponDefinition(weapon.Type);
        powerupLife      = currentWeaponDef.powerUpLife;
        powerupStart     = Time.time;
        if (!powerupOn)
        {
            GameManager.powerUpIcon.enabled = !GameManager.powerUpIcon.enabled;
        }
        GameManager.powerUpIcon.sprite = currentWeaponDef.powerupSprite;
        powerupOn = true;
        pu.AbsorbedBy(this.gameObject);
    }
Example #21
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:         // If it's the shield
            shieldLevel++;
            break;

        case WeaponType.fireRate:
            Main.S.weaponDefinitions [0].delayBetweenShots = 0.1f;
            Main.S.weaponDefinitions [1].delayBetweenShots = 0.2f;
            fireRateReset = 8;
            fireRateOn    = 1;
            break;

        case WeaponType.speed:
            speed      = 40;
            speedReset = 8;
            speedOn    = 1;
            break;

        default:         // If it's any Weapon PowerUp
            // Check the current weapon type
            if (pu.type == weapons[0].type)
            {
                // then increase the number of weapons of this type
                Weapon w = GetEmptyWeaponSlot();                 // Find an available weapon
                if (w != null)
                {
                    // Set it to pu.type
                    w.SetType(pu.type);
                }
            }
            else
            {
                // If this is a different weapon
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #22
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case PowerUpItemType.currency:
            Debug.Log("currency powerup absorbed. do something");
            break;

        case PowerUpItemType.brickHitAoe:
            Debug.Log("AOE powerup absorbed. do something");
            break;

        default:
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #23
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:
            A.shieldLevel++;
            break;

        default:
            if (pu.type == weapons[0].type)
            {
                Weapon w  = GetEmptyWeaponSlot();
                Weapon wf = GetEmptyWeaponSlotF();

                if (w != null)
                {
                    w.SetType(pu.type);
                    wf.SetType(pu.type);
                    weaponCounter++;

                    if (isFocusMode == true)
                    {
                        weapons[weaponCounter].SetActive(false);
                    }
                    if (isFocusMode == false)
                    {
                        weaponsF[weaponCounter].SetActive(false);
                    }
                }
            }
            else
            {
                ClearWeapons();
                weapons[0].SetType(pu.type);
                weaponCounter = 0;
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #24
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>(); //creates power up object and retrieves components

        switch (pu.type)                          //switch statement depending on type of powerup absorbed
        {
        case PowerUpType.speed:                   // if speed, set timer to zero and speed to 70
            speed  = 70f;
            _timer = 0;
            fast.gameObject.SetActive(true);     //display speed icon
            break;


        case PowerUpType.invincible:     //if invincible, turn it on and set timer to zero
            _invincible = false;
            _timer      = 0;
            star.gameObject.SetActive(true);     //display star icon
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #25
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:
            shieldLevel++;
            break;

        default:
            // if(pu.type == weapons[0].type)
            // {
            //     Weapon w = GetEmptyWeaponSlot();
            //     if(w != null)
            //     {
            //         w.SetType(pu.type);
            //     }
            // }
            // else
            // {
            //     ClearWeapons();
            //     weapons[0].SetType(pu.type);
            // }
            for (int i = 0; i < 5; i++)
            {
                if (!weaponStates[pu.type][i])
                {
                    weaponStates[pu.type][i] = true;
                    if (pu.type == weaponTypes[activeWeapon])
                    {
                        SetWeapons(pu.type);
                    }
                    break;
                }
            }
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
Example #26
0
    public void AbsorbPowerUp(GameObject go)
    {
                PowerUp pu = go.GetComponent <PowerUp>();

                switch(pu.type)
        {
                       case WeaponType.shield :                                        
                                                       shieldLevel++;

                            break;

                        default :                                                        
                            if(pu.type == weapons[0].type) // If its the same type then dont do anythinnn
            {
                                    Weapon w = GetEmptyWeaponSlot();

                                    if(w != null)
                {
                                            // Set it to pu.type
                                            w.SetType(pu.type);

                                        
                }
                                
            }

            else         // If this is a different weapon type then change it
            {
                                    ClearWeapons();
                                    weapons[0].SetType(pu.type);
                                
            }
                            break;

                    
        }
                pu.AbsorbedBy(this.gameObject);
            
    }
Example #27
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.shield:
            shieldLevel++;
            break;

        default:
            if (pu.type == weapons[0].type)
            {
                Weapon w = GetEmptyWeaponSlot();
                if (w != null)
                {
                    // Set it to pu.type
                    w.SetType(pu.type);
                }
            }
            else
            {
                //If this is a different weapon type
                if (weapons[0].type == WeaponType.laser)
                {
                    foreach (GameObject laserObj in GameObject.FindGameObjectsWithTag("ProjectileHero"))
                    {
                        Destroy(laserObj);
                    }
                }
                ClearWeapons();
                weapons[0].SetType(pu.type);
            }
            break;
        }
        pu.AbsorbedBy(gameObject);
    }
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp powerUp = go.GetComponent <PowerUp>();

        switch (powerUp.type)
        {
        case WeaponType.shield:     // if the item is a shield, just attempt to increase the shield.
            shieldLevel++;
            break;

        default:     // else, change weapons if neeed be
            if (powerUp.type != _weapon.type)
            {
                _weapon.SetType(powerUp.type);
            }     // regardless of what powerup was picked up, reset the duration element so that a fresh start occurs.
            _TurnPowerUpOff  = true;
            _weaponDuration  = powerUp.duration;
            _weaponStartLife = Time.time;
            break;
        }
        //plays audio, then destorys gameobject.
        _audioSource.PlayOneShot(pickedUpSound);
        powerUp.AbsorbedBy(this.gameObject);
    }
Example #29
0
    public void AbsorbPowerUp(GameObject go)
    {
        PowerUp pu = go.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case WeaponType.BonusLife:
            ExtraLifeManager.ELM.addExtraLife(); // activate corresponding function of singleton Extra Life Manager
            ++extraLives;                        // increment extra lives count
            Debug.Log("BonusLife PowerUp collected");
            break;

        case WeaponType.Invincible:
            CooldownManager.CM.activateCooldown(pu.type);     // activate corresponding function of singleton Cooldown Manager, passing powerup type
            Debug.Log("Invincible PowerUp Collected");
            break;

        case WeaponType.Blaster:
            CooldownManager.CM.activateCooldown(pu.type);     // activate corresponding function of singleton Cooldown Manager, passing powerup type
            Debug.Log("Blaster PowerUp Collected");
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }
    public void AbsorbPowerUp(GameObject lastContact)
    {
        PowerUp pu = lastContact.GetComponent <PowerUp>();

        switch (pu.type)
        {
        case PowerUp.PowerUpType.AddBomb:
            GetComponentInChildren <Shooting>().bombNum++;
            break;

        case PowerUp.PowerUpType.WhosYourDaddy:
            whosYourDaddy();
            break;

        case PowerUp.PowerUpType.AutoShooting:
            autoFire();
            break;

        case PowerUp.PowerUpType.SpeedUp:
            speedUp();
            break;
        }
        pu.AbsorbedBy(this.gameObject);
    }