示例#1
0
        public Government Mutate(int numChanges)
        {
            Government g = new Government();

            g.frame_suffix                = frame_suffix;
            g.title_prefix                = title_prefix;
            g.aggression                  = aggression;
            g.allowReligionHead           = allowReligionHead;
            g.allow_looting               = allow_looting;
            g.allow_title_revokation      = allow_title_revokation;
            g.allows_matrilineal_marriage = allows_matrilineal_marriage;
            g.barons_need_dynasty         = barons_need_dynasty;
            g.can_be_granted_kingdoms_and_empires_by_other_government = can_be_granted_kingdoms_and_empires_by_other_government;
            g.can_build_castle    = can_build_castle;
            g.can_build_city      = can_build_city;
            g.can_build_forts     = can_build_forts;
            g.can_build_holdings  = can_build_holdings;
            g.can_build_temple    = can_build_temple;
            g.can_build_tribal    = can_build_tribal;
            g.can_create_kingdoms = can_create_kingdoms;
            g.can_grant_kingdoms_and_empires_to_other_government = can_grant_kingdoms_and_empires_to_other_government;
            g.can_imprison_without_reason    = can_imprison_without_reason;
            g.can_revoke_without_reason      = can_revoke_without_reason;
            g.can_usurp_kingdoms_and_empires = can_usurp_kingdoms_and_empires;
            g.dukes_called_kings             = dukes_called_kings;
            g.free_retract_vassalage         = free_retract_vassalage;
            g.have_gender_laws             = have_gender_laws;
            g.ignores_de_jure_laws         = ignores_de_jure_laws;
            g.is_patrician                 = is_patrician;
            g.merchant_republic            = merchant_republic;
            g.uses_decadence               = uses_decadence;
            g.uses_jizya_tax               = uses_jizya_tax;
            g.uses_piety_for_law_change    = uses_piety_for_law_change;
            g.uses_prestige_for_law_change = uses_prestige_for_law_change;

            g.accepts_liege_governments.AddRange(accepts_liege_governments);
            g.preferred_holdings.AddRange(preferred_holdings);
            g.allowed_holdings.AddRange(allowed_holdings);
            g.allowed_holdings_culture.AddRange(allowed_holdings_culture);
            g.allowed_holdings_culture_and_religion.AddRange(allowed_holdings_culture_and_religion);
//            g.cultureAllow.AddRange(cultureAllow);
            g.builds_with_prestige.AddRange(builds_with_prestige);
            g.builds_with_piety.AddRange(builds_with_piety);
            g.color = color;
            g.type  = type;
            g.SetType(type);


            for (int n = 0; n < numChanges; n++)
            {
                g.DoChange();
            }
            if (!GovernmentManager.instance.governments.Contains(g))
            {
                GovernmentManager.instance.governments.Add(g);
            }
            return(g);
        }
示例#2
0
        public Government CreateNewGovernment(CultureParser culture)
        {
            Government g = new Government();

            g.type = "tribal";
            Government r = g.Mutate(8);

            r.name = culture.dna.GetMaleName();
            string s = r.name;

            r.name = StarNames.SafeName(r.name) + "_government";
            LanguageManager.instance.Add(r.name, s);
            culture.Governments.Add(r);
            r.SetType(r.type);
            if (!r.cultureAllow.Contains(culture.Name))
            {
                r.cultureAllow.Add(culture.Name);   //    governments.Add(r);
            }
            return(r);
        }
示例#3
0
        public Government Mutate(int numChanges)
        {
            Government g = new Government();

            g.frame_suffix                = frame_suffix;
            g.title_prefix                = title_prefix;
            g.aggression                  = aggression;
            g.allowReligionHead           = allowReligionHead;
            g.allow_looting               = allow_looting;
            g.allow_title_revokation      = allow_title_revokation;
            g.allows_matrilineal_marriage = allows_matrilineal_marriage;
            g.barons_need_dynasty         = barons_need_dynasty;
            g.can_be_granted_kingdoms_and_empires_by_other_government = can_be_granted_kingdoms_and_empires_by_other_government;
            g.can_build_castle    = can_build_castle;
            g.can_build_city      = can_build_city;
            g.can_build_forts     = can_build_forts;
            g.can_build_holdings  = can_build_holdings;
            g.can_build_temple    = can_build_temple;
            g.can_build_tribal    = can_build_tribal;
            g.can_create_kingdoms = can_create_kingdoms;
            g.can_grant_kingdoms_and_empires_to_other_government = can_grant_kingdoms_and_empires_to_other_government;
            g.can_imprison_without_reason    = can_imprison_without_reason;
            g.can_revoke_without_reason      = can_revoke_without_reason;
            g.can_usurp_kingdoms_and_empires = can_usurp_kingdoms_and_empires;
            g.dukes_called_kings             = dukes_called_kings;
            g.free_retract_vassalage         = free_retract_vassalage;
            g.have_gender_laws             = have_gender_laws;
            g.ignores_de_jure_laws         = ignores_de_jure_laws;
            g.is_patrician                 = is_patrician;
            g.merchant_republic            = merchant_republic;
            g.uses_decadence               = uses_decadence;
            g.uses_jizya_tax               = uses_jizya_tax;
            g.uses_piety_for_law_change    = uses_piety_for_law_change;
            g.uses_prestige_for_law_change = uses_prestige_for_law_change;

            g.accepts_liege_governments.AddRange(accepts_liege_governments);
            g.preferred_holdings.AddRange(preferred_holdings);
            g.allowed_holdings.AddRange(allowed_holdings);
            g.allowed_holdings_culture.AddRange(allowed_holdings_culture);
            g.allowed_holdings_culture_and_religion.AddRange(allowed_holdings_culture_and_religion);
//            g.cultureAllow.AddRange(cultureAllow);
            g.builds_with_prestige.AddRange(builds_with_prestige);
            g.builds_with_piety.AddRange(builds_with_piety);
            g.color = color;
            g.type  = type;
            g.SetType(type);
            if (type == "feudal")
            {
                if (Rand.Next(5) == 0)
                {
                    switch (Rand.Next(2))
                    {
                    case 0:
                        g.type = "theocracy";
                        break;

                    case 1:
                        g.type = "republic";
                        break;
                    }

                    SetType(g.type);
                }
            }
            else if (type == "tribal")
            {
                if (Rand.Next(3) == 0)
                {
                    g.type = "feudal";

                    SetType(g.type);
                }
            }
            else if (type == "theocracy")
            {
                if (Rand.Next(5) == 0)
                {
                    switch (Rand.Next(2))
                    {
                    case 0:
                        g.type = "republic";
                        break;

                    case 1:
                        g.type = "feudal";
                        break;
                    }

                    SetType(g.type);
                }
            }


            if (type == "nomadic")
            {
                if (Rand.Next(5) == 0 || GovernmentManager.instance.numNomadic > 10)
                {
                    g.type = "tribal";

                    SetType(g.type);
                }
            }

            if (type == "tribal" && GovernmentManager.instance.numTribal > 20)
            {
                g.type = "feudal";

                SetType(g.type);
            }

            if (type == "tribal")
            {
                GovernmentManager.instance.numTribal++;
            }

            if (type == "nomadic")
            {
                GovernmentManager.instance.numNomadic++;
            }

/*
 *          if (Rand.Next(5) == 0)
 *          {
 *
 *              switch (Rand.Next(5))
 *              {
 *                  case 0:
 *                      g.type = "feudal";
 *                      g.can_build_castle = true;
 *                      if (!g.allowed_holdings.Contains("CASTLE"))
 *                          g.allowed_holdings.Add("CASTLE");
 *                      if (!g.preferred_holdings.Contains("CASTLE"))
 *                          g.preferred_holdings.Add("CASTLE");
 *                     break;
 *                  case 1:
 *                      g.type = "tribal";
 *                       g.preferred_holdings.Clear();
 *                          g.allowed_holdings.Clear();
 *                        g.allowed_holdings.Add("TRIBAL");
 *                        g.preferred_holdings.Add("TRIBAL");
 *                        g.can_build_tribal = true;
 *                      break;
 *                  case 2:
 *                      g.type = "nomadic";
 *                      g.preferred_holdings.Clear();
 *                      g.allowed_holdings.Clear();
 *                      g.allowed_holdings.Add("NOMAD");
 *                      g.preferred_holdings.Add("NOMAD");
 *                      break;
 *                  case 3:
 *                      g.type = "theocracy";
 *                      if (!g.allowed_holdings.Contains("TEMPLE"))
 *                          g.allowed_holdings.Add("TEMPLE");
 *                      if (!g.preferred_holdings.Contains("TEMPLE"))
 *                          g.preferred_holdings.Add("TEMPLE");
 *                      g.can_build_temple = true;
 *                      break;
 *                  case 4:
 *                      g.type = "republic";
 *                      break;
 *              }
 *          }
 */


            for (int n = 0; n < numChanges; n++)
            {
                g.DoChange();
            }
            if (!GovernmentManager.instance.governments.Contains(g))
            {
                GovernmentManager.instance.governments.Add(g);
            }
            return(g);
        }
示例#4
0
        public Government Mutate(int numChanges)
        {
          
            Government g = new Government();

            g.frame_suffix = frame_suffix;
            g.title_prefix = title_prefix;
            g.aggression = aggression;
            g.allowReligionHead = allowReligionHead;
            g.allow_looting = allow_looting;
            g.allow_title_revokation = allow_title_revokation;
            g.allows_matrilineal_marriage = allows_matrilineal_marriage;
            g.barons_need_dynasty = barons_need_dynasty;
            g.can_be_granted_kingdoms_and_empires_by_other_government = can_be_granted_kingdoms_and_empires_by_other_government;
            g.can_build_castle = can_build_castle;
            g.can_build_city = can_build_city;
            g.can_build_forts = can_build_forts;
            g.can_build_holdings = can_build_holdings;
            g.can_build_temple = can_build_temple;
            g.can_build_tribal = can_build_tribal;
            g.can_create_kingdoms = can_create_kingdoms;
            g.can_grant_kingdoms_and_empires_to_other_government = can_grant_kingdoms_and_empires_to_other_government;
            g.can_imprison_without_reason = can_imprison_without_reason;
            g.can_revoke_without_reason = can_revoke_without_reason;
            g.can_usurp_kingdoms_and_empires = can_usurp_kingdoms_and_empires;
            g.dukes_called_kings = dukes_called_kings;
            g.free_retract_vassalage = free_retract_vassalage;
            g.have_gender_laws = have_gender_laws;
            g.ignores_de_jure_laws = ignores_de_jure_laws;
            g.is_patrician = is_patrician;
            g.merchant_republic = merchant_republic;
            g.uses_decadence = uses_decadence;
            g.uses_jizya_tax = uses_jizya_tax;
            g.uses_piety_for_law_change = uses_piety_for_law_change;
            g.uses_prestige_for_law_change = uses_prestige_for_law_change;

            g.accepts_liege_governments.AddRange(accepts_liege_governments);
            g.preferred_holdings.AddRange(preferred_holdings);
            g.allowed_holdings.AddRange(allowed_holdings);
            g.allowed_holdings_culture.AddRange(allowed_holdings_culture);
            g.allowed_holdings_culture_and_religion.AddRange(allowed_holdings_culture_and_religion);
//            g.cultureAllow.AddRange(cultureAllow);
            g.builds_with_prestige.AddRange(builds_with_prestige);
            g.builds_with_piety.AddRange(builds_with_piety);
            g.color = color;
            g.type = type;
            g.SetType(type);
            if (type == "feudal")
            {
                if (Rand.Next(5) == 0)
                {
                    switch (Rand.Next(2))
                    {
                        case 0:
                            g.type = "theocracy";
                            break;
                        case 1:
                            g.type = "republic";
                            break;

                    }

                    SetType(g.type);
                }
            }
            else if (type == "tribal")
            {
                if (Rand.Next(3) == 0)
                {
                    g.type = "feudal";
                     
                    SetType(g.type);
                }
            }
            else if (type == "theocracy")
            {
                if (Rand.Next(5) == 0)
                {
                    switch (Rand.Next(2))
                    {
                        case 0:
                            g.type = "republic";
                            break;
                        case 1:
                            g.type = "feudal";
                            break;

                    }

                    SetType(g.type);
                }
            }

            
            if (type == "nomadic")
            {
                if (Rand.Next(5) == 0 || GovernmentManager.instance.numNomadic > 10)
                {
                    g.type = "tribal";
           
                    SetType(g.type);
                }
            }

            if (type == "tribal" && GovernmentManager.instance.numTribal > 20)
            {
                g.type = "feudal";

                SetType(g.type);
            }

            if (type == "tribal")
                GovernmentManager.instance.numTribal++;

            if (type == "nomadic")
                GovernmentManager.instance.numNomadic++;

/*
            if (Rand.Next(5) == 0)
            {
              
                switch (Rand.Next(5))
                {
                    case 0:
                        g.type = "feudal";
                        g.can_build_castle = true;
                        if (!g.allowed_holdings.Contains("CASTLE"))
                            g.allowed_holdings.Add("CASTLE");
                        if (!g.preferred_holdings.Contains("CASTLE"))
                            g.preferred_holdings.Add("CASTLE");
                       break;
                    case 1:
                        g.type = "tribal";
                         g.preferred_holdings.Clear();
                            g.allowed_holdings.Clear();
                          g.allowed_holdings.Add("TRIBAL");
                          g.preferred_holdings.Add("TRIBAL");
                          g.can_build_tribal = true;
                        break;
                    case 2:
                        g.type = "nomadic";
                        g.preferred_holdings.Clear();
                        g.allowed_holdings.Clear();
                        g.allowed_holdings.Add("NOMAD");
                        g.preferred_holdings.Add("NOMAD");
                        break;
                    case 3:
                        g.type = "theocracy";
                        if (!g.allowed_holdings.Contains("TEMPLE"))
                            g.allowed_holdings.Add("TEMPLE");
                        if (!g.preferred_holdings.Contains("TEMPLE"))
                            g.preferred_holdings.Add("TEMPLE");
                        g.can_build_temple = true;
                        break;
                    case 4:
                        g.type = "republic";
                        break;
                }
            }
            */


            for (int n = 0; n < numChanges; n++)
            {
                g.DoChange();
            }
            if(!GovernmentManager.instance.governments.Contains(g))
                GovernmentManager.instance.governments.Add(g);
            return g;
        }