public void ClearPopulation() { population = 0.0f; farmers = builders = traders = soldiers = scholars = 0; foodUnits = 0.0f; foodEfficiency = 1.2f; sanitation = 30; healthcare = -0.2f; unrestDecay = 0.8f; lastPopGrowth = 0.0f; storedFood = 0.0f; unrest = unrestCultural = unrestReligious = 0.0f; culture = null; cultureBonus = 0.0f; disaster = null; disasterDuration = 0; religion = null; religionBonus = 0.0f; infrastructurePoints = 0.0f; for (int i = 0; i < infrastructureLevels.Length; i++) { infrastructureLevels[i] = 1; } plannedInfrastructure = null; constructionBonus = 0.0f; government = null; prosperity = 0.0f; foreach (WS_ResourceStack stack in resStacks) { stack.amount = 0; } caravan = null; qualityBonus = 1.0f; exploitationBonus = 1.0f; armyBonus = 0.5f; defenseBonus = 1.0f; currentTech = null; storedTechPoints = 0.0f; availableTech.Clear(); researchedTech.Clear(); }
protected override bool SuccessCheck() { triggeredDisaster = null; float higherChance = 0.0f; foreach (WS_Disaster disaster in WS_World.disasters) { if (disaster.Chance(tile) > higherChance) { higherChance = disaster.Chance(tile); triggeredDisaster = disaster; } } return(Random.Range(0.0f, 1.0f) < higherChance); }
protected override bool SuccessCheck() { spreadDisaster = null; float higherChance = 0.0f; foreach (WS_Tile neighbor in tile.Neighbors()) { if (neighbor.disaster != null) { if (neighbor.disaster.SpreadChance(tile) > higherChance) { higherChance = neighbor.disaster.SpreadChance(tile); spreadDisaster = neighbor.disaster; } } } return(Random.Range(0.0f, 1.0f) < higherChance); }