public SingleIncome GetTotalBouns(CultData playersTotal) { int nankaiDekita = 0; if (playersTotal.GetLevels()[0] > 0) { nankaiDekita = cultCostPer.GetIncome()[0] / playersTotal.GetLevels()[0]; } //Fire if (playersTotal.GetLevels()[1] > 0) { nankaiDekita = cultCostPer.GetIncome()[1] / playersTotal.GetLevels()[1]; } //water if (playersTotal.GetLevels()[2] > 0) { nankaiDekita = cultCostPer.GetIncome()[2] / playersTotal.GetLevels()[2]; } //earth if (playersTotal.GetLevels()[3] > 0) { nankaiDekita = cultCostPer.GetIncome()[3] / playersTotal.GetLevels()[3]; } //air return(cultPerBonus.Multiply(nankaiDekita)); }
//Returns true if 10 is reached public bool Add_To_Track_Level(CultIncome income, int[] max) { int temp_value; //Just for comparing before/after for (int i = 0; i < 4; i++) { temp_value = levels[i]; levels[i] += income.GetIncome()[i]; Check_magic_owed(temp_value, levels[i]); //if the cult level passes a certain point then the player recieves magic; } //Make everything the max for (int i = 0; i < levels.Length; i++) { if (levels[i] > max[i]) { levels[i] = max[i]; } } //Check the max if (levels[0] >= 10 && max[0] == 10) { return(true); } if (levels[0] >= 10 && max[0] == 10) { return(true); } if (levels[0] >= 10 && max[0] == 10) { return(true); } if (levels[0] >= 10 && max[0] == 10) { return(true); } return(false); }