public Person(Society soc) { this.society = soc; firstName = TextStore.getName(isMale); politics_militarism = Math.Pow(Eleven.random.NextDouble(), 0.75); //Bias towards 0 politics_militarism = 1 - politics_militarism; //0 to 1, bias towards 1 politics_militarism = (2 * politics_militarism) - 1; //1 to -1, bias towards 1 //Add permanent threats threat_enshadowedNobles = new ThreatItem(map, this); threat_enshadowedNobles.form = ThreatItem.formTypes.ENSHADOWED_NOBLES; threat_enshadowedNobles.responseCode = ThreatItem.RESPONSE_DARKNESSWITHIN; threatEvaluations.Add(threat_enshadowedNobles); }
public override void turnTick(Unit unit) { if (unit.person == null) { unit.task = null; return; } string prevName = unit.getName(); dur += 1; if (dur >= unit.location.map.param.unit_newIdentityTime) { unit.person.house = null; unit.person.lastName = TextStore.getName(false); int nHunters = 0; foreach (Unit u in unit.location.map.units) { if (u.person != null && u is Unit_Investigator && u.person.getRelation(unit.person).suspicion > 0) { nHunters += 1; } } foreach (SocialGroup sg in unit.location.map.socialGroups) { if (sg is Society) { Society soc = (Society)sg; soc.enemies.Remove(unit); foreach (Person p in soc.people) { p.purgeRelObj(unit.person.index); } } } unit.location.map.world.prefabStore.popMsg(prevName + " has changed their identity, they are now known as " + unit.getName() + ". This removes noble suspicion, and allows" + " them to enter nations they were exiled from, but agents who are suspicious of them (" + nHunters + " agents) will not be fooled, and may well immediately begin warning the nobles again."); unit.task = null; Evidence e = new Evidence(unit.location.map.turn); e.pointsTo = unit; e.weight = unit.location.map.param.unit_majorEvidence; unit.location.evidence.Add(e); } }
public Person(Society soc) { this.society = soc; firstName = TextStore.getName(isMale); madness = new Insanity_Sane(); maxSanity = Eleven.random.Next(map.param.insanity_maxSanity); sanity = maxSanity; if (World.logging) { log = new LogBox(this); } politics_militarism = Math.Pow(Eleven.random.NextDouble(), 2);//Bias towards 0 //Chance of pacifism if (Eleven.random.NextDouble() < 0.33) { politics_militarism *= -1; } //Add permanent threats threat_enshadowedNobles = new ThreatItem(map, this); threat_enshadowedNobles.form = ThreatItem.formTypes.ENSHADOWED_NOBLES; threat_enshadowedNobles.responseCode = ThreatItem.RESPONSE_DARKNESSWITHIN; threatEvaluations.Add(threat_enshadowedNobles); for (int i = 0; i < 3; i++) { Trait add = map.globalist.getTrait(this); if (add == null) { break; } traits.Add(add); if (Eleven.random.Next(2) == 0) { break; } //50% chance to add another trait } }
public Society(Map map, Location location) : base(map) { setName("DEFAULT_SOC_NAME"); sovereign = new Title_Sovereign(this); titles.Add(sovereign); econEffects = new List <EconEffect>(); if (map.simplified) { socType = new SocType_Monarchy(); } for (int i = 0; i < 3; i++) { House house = new House(); house.name = TextStore.getName(false); house.background = Eleven.random.Next(World.self.textureStore.layerBack.Count); house.culture = map.sampleCulture(location); houses.Add(house); } }
public Person(Society soc, House assignedHouse = null) { this.society = soc; index = World.staticMap.personIndexCount; World.staticMap.personIndexCount += 1; World.staticMap.persons.Add(this);//I can't believe this awful structure is required, but it is, for serializing. Not allowed references to others firstName = TextStore.getName(isMale); madness = new Insanity_Sane(); maxSanity = Eleven.random.Next(map.param.insanity_maxSanity); sanity = maxSanity; if (World.logging) { log = new LogBox(this); } //politics_militarism = Math.Pow(Eleven.random.NextDouble(), 2);//Bias towards 0 ////Chance of pacifism //if (Eleven.random.NextDouble() < 0.33) { // politics_militarism *= -1; //} if (assignedHouse == null) { assignedHouse = society.houses[Eleven.random.Next(society.houses.Count)]; } house = assignedHouse; if (house != null) { culture = house.culture; } if (culture == null) { culture = map.sampleCulture(soc); } //Add permanent threats threat_agents = new ThreatItem(map, this); threat_agents.form = ThreatItem.formTypes.AGENTS; threatEvaluations.Add(threat_agents); threat_enshadowedNobles = new ThreatItem(map, this); threat_enshadowedNobles.form = ThreatItem.formTypes.ENSHADOWED_NOBLES; threatEvaluations.Add(threat_enshadowedNobles); threat_plague = new ThreatItem(map, this); threat_plague.form = ThreatItem.formTypes.PLAGUE; threatEvaluations.Add(threat_plague); if (!map.simplified) { traits.Add(map.globalist.getTrait_Political(this)); for (int i = 0; i < 2; i++) { Trait add = map.globalist.getTrait(this); if (add == null) { break; } traits.Add(add); if (Eleven.random.Next(2) == 0) { break; } //50% chance to add another trait } } if (World.advancedEdition && culture != null) { assignCulture(); } }