private void CommitDecisionsNight() { //Debug.Log ("Poison Level is: " + wellScript.GetPoisonLevel()); //execute decisions simultaneously for (int i = 0; i < opponentList.Count; ++i) { VillageScript opponentScript = opponentList [i].GetComponent <VillageScript> (); opponentScript.swapProbabilities(); int randomInt = Random.Range(0, 100); //Debug.Log ("Decision made with: " + randomInt); //Debug.Log(opponentScript.GetNextDecisionProbability () + " | " + randomInt); if (opponentScript.GetCurrentDecisionProbability() > randomInt) { wellScript.PoisonWell(); //opponentScript.ConsumeWater (); if (myPlayerVillageScript.GetPlayerVisit()) { needText = true; tempText += "\t-" + opponentScript.GetName() + "\n"; } } } if (!needText) { tempText = ""; } }
private void CommitDecisionsDay() { needText = false; //execute decisions simultaneously for (int i = 0; i < opponentList.Count; ++i) { VillageScript opponentScript = opponentList [i].GetComponent <VillageScript> (); opponentScript.swapProbabilities(); int randomInt = Random.Range(0, 100); //Debug.Log(opponentScript.GetNextDecisionProbability () + " | " + randomInt); if (opponentScript.GetCurrentDecisionProbability() > randomInt) { opponentScript.VillageCollectsWater(); if (myPlayerVillageScript.GetPlayerVisit()) { needText = true; tempText += "\t-" + opponentScript.GetName() + "\n"; } } } if (!needText) { tempText = ""; } }