public void survivorBonus(int roundEnded)
    {
        if (engineerSurvivors > 0)
        {
            for (int q = 0; q <= engineerSurvivors; q++)         //Test Death for unAllocatedSurvivors
            {
                int randomEngineerDeath = (int)Random.Range(0f, 10f);
                if (randomEngineerDeath > 0 && randomEngineerDeath < 2)                 // If 1
                {
                    totalSurvivorDeathCounter++;
                    engineerSurvivors--;
                }
            }
        }
        if (scrapSurvivors > 0)         //Add Scraps End-of-Round Bonuses
        {
            int scrapGenerated = 0;
            int randomScrap    = (int)Random.Range(0f, 10f);
            scrapGenerated = (scrapSurvivors + roundEnded + randomScrap) * 10;
            playerScript.addScraps(scrapGenerated);

            for (int q = 0; q <= scrapSurvivors; q++)         //Test Death for unAllocatedSurvivors
            {
                int randomScrapDeath = (int)Random.Range(0f, 10f);
                if (randomScrapDeath > 0 && randomScrapDeath < 2)                 // If 1
                {
                    totalSurvivorDeathCounter++;
                    scrapSurvivors--;
                }
            }
        }
        if (ammoSurvivors > 0)        //Add Ammo End-of-Round Bonuses
        {
            int randomAmmo = (int)Random.Range((0f + ammoSurvivors + roundEnded) * 2, 25f);
            primaryController.addRandomAmmo(randomAmmo);

            for (int q = 0; q <= ammoSurvivors; q++)         //Test Death for unAllocatedSurvivors
            {
                int randomAmmoDeath = (int)Random.Range(0f, 10f);
                if (randomAmmoDeath > 0 && randomAmmoDeath < 2)                 // If 1
                {
                    totalSurvivorDeathCounter++;
                    ammoSurvivors--;
                }
            }
        }
        if (totalSurvivorDeathCounter > 0)                         // If there are dead survivors
        {
            foundSurvivors           -= totalSurvivorDeathCounter; //Reduces foundSurvivors by total lost
            totalSurvivorDeathCounter = 0;
        }
    }
示例#2
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        if (coll.gameObject.tag == "RocketExplosion")
        {
            currentHealth -= 90;            //Take 90 Health of Damage if caught within Rocket Explosion
        }
        if (coll.gameObject.tag == "RotatingLaserBeam")
        {
            currentHealth -= 20;
        }
        if (coll.gameObject.tag == "LaserLine")
        {
            currentHealth -= 20;
        }
        if (coll.gameObject.tag == "DeathZone")
        {
            currentHealth = 0;
        }
        if (coll.gameObject.tag == "HealthPack")
        {
            int randomHealthAmount = (int)Random.Range(15f, 30f); //Random Number for Random Object
            currentHealth += randomHealthAmount;                  //Gain Random Amount of Health Health from HealthPack
            if (bitten)                                           // Reset Bitten Result
            {
                bitten              = false;
                biteTimer           = 8f;      //Reset BiteTimer
                biteDamage          = 1f;      //Reset BiteDamage Timer
                bittenTextureEffect = 8f;
            }
            coll.gameObject.DestroyAPS();
            soundControllerScript.playSFX("DingDing");
        }
        if (coll.gameObject.tag == "ScrapsPack")
        {
            int randomScrapsAmount = (int)Random.Range(10f, 20f); //Random Number for Random Object
            currentScraps += randomScrapsAmount;                  //Random Amount of Scraps
            coll.gameObject.DestroyAPS();
            soundControllerScript.playSFX("ScrapDing");
        }
        if (coll.gameObject.tag == "AmmoPack")
        {
            int randomAmmoAmount = (int)Random.Range(10f, 17f);           //Random Number for Random Object
            primaryController.addRandomAmmo(randomAmmoAmount);
            coll.gameObject.DestroyAPS();
            soundControllerScript.playSFX("gunCock");
        }
        if (coll.gameObject.tag == "DildoBullet")
        {
            primaryController.addAmmo(9, 1);
            coll.gameObject.DestroyAPS();
        }

        if (coll.gameObject.tag == "store")                // Enable store if player walks within range
        {
            if (storeControllerScript.getStoreAvailable()) //Check to see if in the middle of round
            {
                storeControllerScript.setDisplayStore(true);
            }
        }
        if (coll.gameObject.tag == "RadiationPool")         // Initial Collision with Radiation Pool
        {
            currentHealth -= 10;
            //This is to give red texture from Radiation Pool like Zombies
            bitten              = true;
            biteTimer           = 8f;          //Reset BiteTimer
            biteDamage          = 1f;          //Reset BiteDamage Timer
            bittenTextureEffect = 8f;
        }
        if (coll.gameObject.tag == "Survivor")         // Initial Collision with Radiation Pool
        {
            if (survivorButtonsController.getFoundSurvivors() < survivorButtonsController.getMaxSurvivors())
            {
                survivorButtonsController.addUnallocatedSurvivors();
                survivorButtonsController.addFoundSurvivors();
            }
            coll.gameObject.DestroyAPS();
            soundControllerScript.playSFX("DingDing");
        }
    }