Пример #1
0
        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
            }
        }
Пример #4
0
        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);
            }
        }
Пример #5
0
        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();
            }
        }
Пример #6
0
        public void specificStartup()
        {
            if (SystemInfo.operatingSystemFamily == OperatingSystemFamily.Windows)
            {
                Log("Windows! A windows OS");
                isWindows  = true;
                pathPrefix = "";
                separator  = "\\";
                string[] decomp = Application.dataPath.Split('/');
                for (int i = 0; i < decomp.Length - 1; i++)
                {
                    pathPrefix += decomp[i] + "/";
                }

                textureStore.world = this;
                textureStore.load();
                wordStore = new TextStore();
                wordStore.load();
            }
            else //if (SystemInfo.operatingSystemFamily == OperatingSystemFamily.Linux)
            {
                Log("The operating system is Linux based");
                pathPrefix = "";
                separator  = "/";
                string[] decomp = Application.dataPath.Split('/');
                for (int i = 0; i < decomp.Length - 1; i++)
                {
                    pathPrefix += decomp[i] + "/";
                }
                textureStore.world = this;
                textureStore.loadLinux();
                wordStore = new TextStore();
                wordStore.loadLinux(this);
            }

            //wordStore = new TextStore();
            //wordStore.load();
            Application.targetFrameRate = 60;
            GraphicalMap.world          = this;
            //Activity.load();

            GraphicalSociety.world = this;

            if (logging)
            {
                foreach (string f in Directory.GetFiles("logging" + separator + "people"))
                {
                    if (f.Contains(".log"))
                    {
                        File.Delete(f);
                    }
                }
                foreach (string f in Directory.GetFiles("logging" + separator + "societies"))
                {
                    if (f.Contains(".log"))
                    {
                        File.Delete(f);
                    }
                }
            }

            saveFolder    = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + World.separator + World.saveFolderName + World.separator;
            userModFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + World.separator + World.userModFolderName + World.separator;
        }