Esempio n. 1
0
    public float GetEventAndBiomeMultiplier(Globals.energySubTypes subType, Globals.biome bioType)
    {
        float test = eventAndBiomeMatrix[(int)subType - 2, (int)bioType];

        Debug.Log("test: " + test);
        return(test);
    }
Esempio n. 2
0
	//between 0 - 1 usually
	//is function of population in town and the effects

/*	public Biome(Biome biomeToCopy){
		health = biomeToCopy.health;
		center = biomeToCopy.center;
		biomeType = biomeToCopy.biomeType;
		resources = biomeToCopy.resources;
		yeildRate = biomeToCopy.yeildRate;
	} */

	public Biome(int biomeNumber){
		float health = 1f;
		biomeType = (Globals.biome)biomeNumber;
		resources = Globals.retBiomeResources(biomeType, biomeNumber*3);
		float tempTotal = 0f;
		for (int counter = 0; counter < 3; counter++) {
			yeildRate [counter] = Random.Range (.2f, 1f);
			tempTotal += yeildRate [counter];
		}
		tempTotal /= 2;
		for (int counter = 0; counter < 3; counter++) {
			yeildRate[counter] /= tempTotal/2;
			int tempRounder = (int) (yeildRate [counter] * 100);
			yeildRate [counter] = (float) tempRounder / 100;
			//Debug.Log (resources [counter] + " <-- resource ; percentYeild --> " + yeildRate [counter]);
		}
	}
Esempio n. 3
0
    //between 0 - 1 usually
    //is function of population in town and the effects

/*	public Biome(Biome biomeToCopy){
 *              health = biomeToCopy.health;
 *              center = biomeToCopy.center;
 *              biomeType = biomeToCopy.biomeType;
 *              resources = biomeToCopy.resources;
 *              yeildRate = biomeToCopy.yeildRate;
 *      } */

    public Biome(int biomeNumber)
    {
        float health = 1f;

        biomeType = (Globals.biome)biomeNumber;
        resources = Globals.retBiomeResources(biomeType, biomeNumber * 3);
        float tempTotal = 0f;

        for (int counter = 0; counter < 3; counter++)
        {
            yeildRate [counter] = Random.Range(.2f, 1f);
            tempTotal          += yeildRate [counter];
        }
        tempTotal /= 2;
        for (int counter = 0; counter < 3; counter++)
        {
            yeildRate[counter] /= tempTotal / 2;
            int tempRounder = (int)(yeildRate [counter] * 100);
            yeildRate [counter] = (float)tempRounder / 100;
            //Debug.Log (resources [counter] + " <-- resource ; percentYeild --> " + yeildRate [counter]);
        }
    }