public override void implement(VoteOption option) { base.implement(option); int nLibraries = 0; int nTemples = 0; foreach (Location loc in society.map.locations) { if (loc.soc == this.society) { if (loc.settlement is Set_Abbey) { nTemples += 1; } else if (loc.settlement is Set_University) { nLibraries += 1; } } } //Abort if (nTemples < society.map.param.awareness_minLocsForLightbringer && nLibraries < society.map.param.awareness_minLocsForLightbringer) { society.map.world.prefabStore.popMsg(society.getName() + " fails to begin the Lightbringer Ritual, despite having voted for it, as they have lost too many ritual locations before the vote ended."); return; } if (option.index == 0) { Overmind overmind = society.map.overmind; if (overmind.lightbringerCasters == null && society.getCapital() != null) { overmind.lightbringerCasters = society; overmind.lightRitualProgress = 0; overmind.lightbringerLocations = new List <Location>(); overmind.lightbringerCapital = society.getCapital(); int nUniversities = 0; nTemples = 0; List <Location> unis = new List <Location>(); List <Location> temples = new List <Location>(); foreach (Location loc in overmind.map.locations) { if (loc.soc == society) { if (loc.settlement is Set_University && nUniversities < society.map.param.awareness_lightbringerMaxLocs) { nUniversities += 1; unis.Add(loc); } if (loc.settlement is Set_Abbey && nTemples < society.map.param.awareness_lightbringerMaxLocs) { nTemples += 1; temples.Add(loc); } } } if (nUniversities > nTemples || (nTemples == nUniversities && (Eleven.random.Next(2) == 0))) { overmind.lightbringerLocations = unis; } else { overmind.lightbringerLocations = temples; } if (overmind.firstLightbringer) { } overmind.firstLightbringer = false; overmind.map.world.prefabStore.popLightbringerMsg(society); } } }
public Overmind_Automatic(Overmind overmind) { this.overmind = overmind; this.map = overmind.map; }