public void Randomizer() { for (int i = 0; i < ethicNeedList.Count; i++) { ethicNeed eN = ethicNeedList[i]; eN.constValue = Random.Range(-100f, 100f) * eN.randomValue; } basicNeed = 100; UpdateCitizen(); }
public void UpdateCitizen() { #region ethical needs update // Ethical Needs Community com = home.GetComponent <Community>(); wealthPart = wealth / com.totalWealth; float tempFloat = -(fear * 0.3f) + (education * 0.5f) + (basicNeed * 0.5f) - (religiousity * 0.35f) - (luxuryNeed * 0.35f); ethicNeed eN = ethicNeedList[0]; tempFloat *= 1 - eN.randomValue; eN.varValue = tempFloat; eN.totalValue = eN.varValue + eN.constValue; //public float SecurityLiberation; tempFloat = -(fear * 0.5f) + (education * 0.7f) + (basicNeed * 0.3f) - (religiousity * 0.5f) - (luxuryNeed * 0.0f); tempFloat *= 1 - eN.randomValue; eN = ethicNeedList[1]; eN.varValue = tempFloat; eN.totalValue = eN.varValue + eN.constValue; //public float PrecautionGrowth; tempFloat = -(fear * 0.45f) + (education * 0.4f) + (basicNeed * 0.6f) - (religiousity * 0.45f) - (luxuryNeed * 0.1f); eN = ethicNeedList[2]; eN.varValue = tempFloat; eN.totalValue = eN.varValue + eN.constValue; //public float SpiritualismScience; tempFloat = -(fear * 0.5f) + (education * 0.8f) + (basicNeed * 0.2f) - (religiousity * 0.5f) - (luxuryNeed * 0.0f); tempFloat *= 1 - eN.randomValue; eN = ethicNeedList[3]; eN.varValue = tempFloat; eN.totalValue = eN.varValue + eN.constValue; //public float ConflictPeace; tempFloat = -(fear * 0.7f) + (education * 0.8f) + (basicNeed * 0.2f) - (religiousity * 0.3f) - (luxuryNeed * 0.0f); tempFloat *= 1 - eN.randomValue; eN = ethicNeedList[4]; eN.varValue = tempFloat; eN.totalValue = eN.varValue + eN.constValue; //public float PrivilegeSocialjustice; tempFloat = -(fear * 0.4f) + (education * 2f) - (basicNeed * 0.6f) - (religiousity * 0.6f) - (luxuryNeed * 0.4f); tempFloat *= 1 - eN.randomValue; eN = ethicNeedList[5]; eN.varValue = tempFloat; eN.totalValue = eN.varValue + eN.constValue; //public float IsolationInclusion; tempFloat = -(fear * 0.8f) + (education * 0.5f) + (basicNeed * 0.5f) - (religiousity * 0.2f) - (luxuryNeed * 0.0f); tempFloat *= 1 - eN.randomValue; eN = ethicNeedList[6]; eN.varValue = tempFloat; eN.totalValue = eN.varValue + eN.constValue; #endregion // Power System power = wealthPart * com.citizens.Count; // jobsearch }