Example #1
0
        public StarSystem(Configuration configuration, string primaryDescriptor)
        {
            _configuration = configuration;
            Information    = new TravInfo(_configuration);
            var ComLumAddFromPrim = 0.0;

            SystemHabitability = 0;
            systemType         = SystemType.SOLO;
            Primary            = new Star(configuration, Star.CharToType(primaryDescriptor[0]), primaryDescriptor[1], primaryDescriptor[2]);
            Primary.BuildSystem(ComLumAddFromPrim);
            FleshOut();
        }
Example #2
0
        public StarSystem(Configuration configuration)
        {
            _configuration     = configuration;
            Information        = new TravInfo(_configuration);
            SystemHabitability = 0;
            var ComLumAddFromPrimary = 0.0;

            if (_configuration.Generation == GenerationType.FULL)
            {
                systemType = Nature(false);
                Primary    = new Star(configuration);
                if (systemType == SystemType.TRINARY)
                {
                    Primary.NumCompanions = 2;
                }
                else if (systemType == SystemType.BINARY)
                {
                    Primary.NumCompanions = 1;
                }
                Primary.BuildSystem(ComLumAddFromPrimary);
                for (var i = 0; i < Primary.NumCompanions; i++)
                {
                    var companion = new CompanionStar(configuration);
                    Primary.Companions.Add(companion);
                    var retry = false;
                    do
                    {
                        for (var j = 0; j < i - 1; j++)
                        {
                            if (Primary.Companions[i].OrbitNum == Primary.Companions[j].OrbitNum)
                            {
                                Primary.Companions.Remove(companion);
                                companion = new CompanionStar(configuration);
                                Primary.Companions.Add(companion);
                                retry = true;
                            }
                        }
                    } while (retry);
                    Primary.AvaialbleOribits(i);
                }
                FleshOut();

                // Get the BG string
                BG = string.Format("{0}{1}", Primary.Count(Planet.WorldType.PLANETOID),
                                   Primary.Count(Planet.WorldType.LGG) + Primary.Count(Planet.WorldType.SGG));
            }
            else
            {
                Generate();
            }
        }
Example #3
0
        public Planet(Configuration configuration)
        {
            _configuration = configuration;
            Normal         = new TravInfo(configuration);
            Collapse       = new TravInfo(configuration);

            if (_configuration.CurrentCampaign == Campaign.HOSTILE)
            {
                Normal.CurrentCampaign   = new Hostile();
                Collapse.CurrentCampaign = new Hostile();
            }
            else
            {
                Normal.CurrentCampaign   = new Classic();
                Collapse.CurrentCampaign = new Classic();
            }
        }
Example #4
0
        public StarSystem(Configuration configuration, string primaryDescriptor, string secondaryDescriptor)
        {
            _configuration = configuration;
            Information    = new TravInfo(_configuration);
            var ComLumAddFromPrim = 0.0;

            SystemHabitability = 0;
            systemType         = SystemType.BINARY;
            Primary            = new Star(configuration, Star.CharToType(primaryDescriptor[0]), primaryDescriptor[1], primaryDescriptor[2]);
            Primary.BuildSystem(ComLumAddFromPrim);
            Primary.NumCompanions = 1;
            var companion = new CompanionStar(configuration, Star.CharToType(secondaryDescriptor[0]), secondaryDescriptor[1], secondaryDescriptor[2]);

            Primary.Companions.Add(companion);
            Primary.AvaialbleOribits(0);
            FleshOut();
        }
Example #5
0
        public StarSystem(Configuration configuration, string primaryDescriptor, string secondaryDescriptor, string trinaryDescriptor)
        {
            _configuration = configuration;
            Information    = new TravInfo(_configuration);
            var ComLumAddFromPrim = 0.0;

            SystemHabitability = 0;
            systemType         = SystemType.TRINARY;
            Primary            = new Star(configuration, Star.CharToType(primaryDescriptor[0]), primaryDescriptor[1], primaryDescriptor[2]);
            Primary.BuildSystem(ComLumAddFromPrim);
            Primary.NumCompanions = 2;
            var companion = new CompanionStar(configuration, Star.CharToType(secondaryDescriptor[0]), secondaryDescriptor[1], secondaryDescriptor[2]);

            Primary.Companions.Add(companion);

            companion = new CompanionStar(configuration, Star.CharToType(trinaryDescriptor[0]), trinaryDescriptor[1], trinaryDescriptor[2]);
            Primary.Companions.Add(companion);

            var retry = false;

            {
                retry = false;
                // Stop two companions existing iu the same orbit
                if (Primary.Companions[0].OrbitNum == Primary.Companions[1].OrbitNum)
                {
                    Primary.Companions.RemoveAt(1);
                    companion = new CompanionStar(configuration, Star.CharToType(trinaryDescriptor[0]), trinaryDescriptor[1], trinaryDescriptor[2]);
                    Primary.Companions.Add(companion);
                    retry = true;
                }
            } while (retry)
            {
                ;
            }
            Primary.AvaialbleOribits(0);
        }
Example #6
0
        // Make the changes necessary to represent the social information
        // of a subordiate world relative to the main world
        public void DoSubordinate(TravInfo main)
        {
            var builder = new StringBuilder();

            // Government
            var dieroll = Common.d6();

            if (main.Government.Value == 6)
            {
                dieroll += Pop.Value;
            }
            if (main.Government.Value == 7)
            {
                dieroll -= 1;
            }
            if (Pop.Value == 0)
            {
                Government.Value = 0;
            }
            else
            {
                if (dieroll > 4)
                {
                    Government.Value = 6;
                }
                else
                {
                    Government.Value = dieroll - 1;
                }
            }

            // Law
            if (Pop.Value == 0)
            {
                Law.Value = 0;
            }
            else
            {
                Law.Value = Common.d6() - 3 + main.Law.Value;
            }

            // Farming world
            if ((Atmosphere.Value >= 4 && Atmosphere.Value <= 9) && (Hydro.Value >= 4 && Hydro.Value <= 8) && Pop.Value >= 2)
            {
                builder.AppendFormat("{0} ", Languages.TradeCode_FarmingColony);
            }

            // Mining world
            if (main.Remarks.Contains(Languages.TradeCode_Industrial))
            {
                if (Pop.Value >= 2)
                {
                    builder.AppendFormat("{0} ", Languages.TradeCode_MiningColony);
                }
            }

            // Colony world
            if (Government.Value == 6 && Pop.Value >= 5)
            {
                builder.AppendFormat("{0} ", Languages.TradeCode_Colony);
            }

            // Research world
            if (main.TechLevel.Value >= 9 && main.Pop.Value >= 1 && Pop.Value > 0)
            {
                dieroll = Common.d6() + Common.d6();
                if (main.TechLevel.Value >= 10)
                {
                    dieroll += 2;
                }
                if (dieroll >= 11)
                {
                    builder.AppendFormat("{0} ", Languages.TradeCode_ResearchColony);
                }
            }

            // Mi?
            if (main.Pop.Value >= 8 && !main.Remarks.Contains(Languages.TradeCode_Poor) && Pop.Value > 0)
            {
                dieroll = Common.d6() + Common.d6();
                if (main.Pop.Value >= 9)
                {
                    dieroll += 1;
                }
                if (main.Atmosphere.Value == Atmosphere.Value)
                {
                    dieroll += 1;
                }
                if (dieroll >= 12)
                {
                    builder.AppendFormat("{0} ", Languages.TradeCode_MiningColony);
                }
            }

            // Bases
            if (main.Bases.Contains(Languages.Base_Naval) && Pop.Value >= 3)
            {
                builder.AppendFormat("{0} ", Languages.Subbase_Naval);
            }
            if (main.Bases.Contains(Languages.Base_Scout) && Pop.Value >= 2)
            {
                builder.AppendFormat("{0} ", Languages.Subbase_Scout);
            }

            // Finish up
            Remarks += builder.ToString();

            // Tech Level
            TechLevel.Value = CurrentCampaign.GenerateSubordinateTechLevel(this, main);

            // Spaceport
            dieroll = Common.d6();
            if (Pop.Value >= 6)
            {
                dieroll += 2;
            }
            if (Pop.Value == 1)
            {
                dieroll -= 2;
            }
            if (Pop.Value == 0)
            {
                dieroll -= 3;
            }

            if (dieroll < 3)
            {
                Starport = 'Y';
            }
            else if (dieroll == 3)
            {
                Starport = 'H';
            }
            else if (dieroll >= 6)
            {
                Starport = 'F';
                if (TechLevel.Value != main.TechLevel.Value)
                {
                    TechLevel.Value += 1;
                }
            }
            else
            {
                Starport = 'G';
            }

            if (Pop.Value == 0)
            {
                TechLevel.Value = 0;
            }

            // if the tech level is too low to support life on this world kill
            // everyone off!
            switch (Atmosphere.Value)
            {
            case 0:
            case 2:
            case 3:
            case 10:
            case 11:
            case 12:
                if (TechLevel.Value < 7)
                {
                    ClearDownSocialData();
                    return;
                }
                break;

            case 4:
            case 7:
            case 9:
                if (TechLevel.Value < 5)
                {
                    ClearDownSocialData();
                    return;
                }
                break;

            case 13:
            case 14:
                if (Hydro.Value == 10)
                {
                    if (TechLevel.Value < 7)
                    {
                        ClearDownSocialData();
                        return;
                    }
                }
                break;
            }
        }
Example #7
0
        public static List <Faction> GenerateFactions(TravInfo world, Configuration configuration)
        {
            var list        = new List <Faction>();
            var numFactions = Common.d3();

            if (world.Government.Value == 7)
            {
                numFactions++;
            }
            else if (world.Government.Value > 10)
            {
                numFactions--;
            }
            if (numFactions > 0 && world.Pop.Value > 0)
            {
                for (var i = 0; i < numFactions; i++)
                {
                    var faction = new Faction(configuration);
                    faction.Government.Value = Common.d6() + Common.d6() - 7 + world.Pop.Value;
                    faction.Strength.Value   = Common.d6() + Common.d6();
                    if (configuration.CurrentCampaign == Campaign.HAMMERSSLAMMERS)
                    {
                        var roll1 = Common.d6();
                        var roll2 = Common.d6();
                        switch (roll1)
                        {
                        case 1:
                            switch (roll2)
                            {
                            case 1: faction.Origin = Languages.FactionOrigin_EastUS; break;

                            case 2: faction.Origin = Languages.FactionOrigin_MidWestUS; break;

                            case 3: faction.Origin = Languages.FactionOrigin_SouthUS; break;

                            case 4: faction.Origin = Languages.FactionOrigin_WestUS; break;

                            case 5: faction.Origin = Languages.FactionOrigin_Canadian; break;

                            case 6: faction.Origin = Languages.FactionOrigin_Evangelical; break;
                            }
                            break;

                        case 2:
                            switch (roll2)
                            {
                            case 1: faction.Origin = Languages.FactionOrigin_Mexican; break;

                            case 2: faction.Origin = Languages.FactionOrigin_CentralAmerican; break;

                            case 3: faction.Origin = Languages.FactionOrigin_AmazonBasin; break;

                            case 4: faction.Origin = Languages.FactionOrigin_Andean; break;

                            case 5: faction.Origin = Languages.FactionOrigin_SouthAmerican; break;

                            case 6: faction.Origin = Languages.FactionOrigin_Catholic; break;
                            }
                            break;

                        case 3:
                            switch (roll2)
                            {
                            case 1: faction.Origin = Languages.FactionOrigin_Scandinavian; break;

                            case 2: faction.Origin = Languages.FactionOrigin_BritishIsles; break;

                            case 3: faction.Origin = Languages.FactionOrigin_EuropeanWestern; break;

                            case 4: faction.Origin = Languages.FactionOrigin_EuropeanEastern; break;

                            case 5: faction.Origin = Languages.FactionOrigin_EuropeanSouthern; break;

                            case 6: faction.Origin = Languages.FactionOrigin_Protestant; break;
                            }
                            break;

                        case 4:
                            switch (roll2)
                            {
                            case 1:
                            case 2: faction.Origin = Languages.FactionOrigin_Russian; break;

                            case 3:
                            case 4: faction.Origin = Languages.FactionOrigin_Chinese; break;

                            case 5: faction.Origin = Languages.FactionOrigin_Japanese; break;

                            case 6: faction.Origin = Languages.FactionOrigin_Buddist; break;
                            }
                            break;

                        case 5:
                            switch (roll2)
                            {
                            case 1: faction.Origin = Languages.FactionOrigin_Turkish; break;

                            case 2: faction.Origin = Languages.FactionOrigin_NorthAfrican; break;

                            case 3: faction.Origin = Languages.FactionOrigin_CentralAfrican; break;

                            case 4: faction.Origin = Languages.FactionOrigin_SouthAfrican; break;

                            case 5: faction.Origin = Languages.FactionOrigin_Indonesian; break;

                            case 6: faction.Origin = Languages.FactionOrigin_Islamic; break;
                            }
                            break;

                        case 6:
                            switch (roll2)
                            {
                            case 1: faction.Origin = Languages.FactionOrigin_Arabic; break;

                            case 2: faction.Origin = Languages.FactionOrigin_Australian; break;

                            case 3: faction.Origin = Languages.FactionOrigin_OldColony; break;

                            case 4: faction.Origin = Languages.FactionOrigin_MiddleColony; break;

                            case 5: faction.Origin = Languages.FactionOrigin_TheWay_Mainstream; break;

                            case 6: faction.Origin = Languages.FactionOrigin_TheWay_Heretical; break;
                            }
                            break;
                        }
                        // Now do the name
                        roll1 = Common.d6();
                        roll2 = Common.d6();
                        switch (roll1)
                        {
                        case 1:
                            switch (roll2)
                            {
                            case 1: faction.Name = Languages.FactionName_Republicans; break;

                            case 2: faction.Name = Languages.FactionName_Federalists; break;

                            case 3: faction.Name = Languages.FactionName_Royalists; break;

                            case 4: faction.Name = Languages.FactionName_Sepratists; break;

                            case 5: faction.Name = Languages.FactionName_Alliance; break;

                            case 6: faction.Name = Languages.FactionName_LeagueofBarons; break;
                            }
                            break;

                        case 2:
                            switch (roll2)
                            {
                            case 1: faction.Name = Languages.FactionName_TradeFederation; break;

                            case 2: faction.Name = Languages.FactionName_FarmersUnion; break;

                            case 3: faction.Name = Languages.FactionName_CitizensMovement; break;

                            case 4: faction.Name = Languages.FactionName_Revolutionaries; break;

                            case 5: faction.Name = Languages.FactionName_GloriousBrotherhood; break;

                            case 6: faction.Name = Languages.FactionName_FreedomParty; break;
                            }
                            break;

                        case 3:
                            switch (roll2)
                            {
                            case 1: faction.Name = Languages.FactionName_CorporateMilitia; break;

                            case 2: faction.Name = Languages.FactionName_Rebels; break;

                            case 3: faction.Name = Languages.FactionName_IndustryAlliance; break;

                            case 4: faction.Name = Languages.FactionName_Coalition; break;

                            case 5: faction.Name = Languages.FactionName_TripartateAlliance; break;

                            case 6: faction.Name = Languages.FactionName_CoastalUnion; break;
                            }
                            break;

                        case 4:
                            switch (roll2)
                            {
                            case 1: faction.Name = Languages.FactionName_Highlanders; break;

                            case 2: faction.Name = Languages.FactionName_SouthernStates; break;

                            case 3: faction.Name = Languages.FactionName_NorthStarLeague; break;

                            case 4: faction.Name = Languages.FactionName_TerranLoyalists; break;

                            case 5: faction.Name = Languages.FactionName_ProgressiveParty; break;

                            case 6: faction.Name = Languages.FactionName_Crusaders; break;
                            }
                            break;

                        case 5:
                            switch (roll2)
                            {
                            case 1: faction.Name = Languages.FactionName_MountainPartisans; break;

                            case 2: faction.Name = Languages.FactionName_Centralists; break;

                            case 3: faction.Name = Languages.FactionName_TreatyForces; break;

                            case 4: faction.Name = Languages.FactionName_WesternAlliance; break;

                            case 5: faction.Name = Languages.FactionName_EasternBloc; break;

                            case 6: faction.Name = Languages.FactionName_StabilityParty; break;
                            }
                            break;

                        case 6:
                            switch (roll2)
                            {
                            case 1: faction.Name = Languages.FactionName_ModerateAlliance; break;

                            case 2: faction.Name = Languages.FactionName_PeoplesParty; break;

                            case 3: faction.Name = Languages.FactionName_Imperialist; break;

                            case 4: faction.Name = Languages.FactionName_Monarchists; break;

                            case 5: faction.Name = Languages.FactionName_Liberators; break;

                            case 6: faction.Name = Languages.FactionName_PeaceFaction; break;
                            }
                            break;
                        }
                    }
                    list.Add(faction);
                }
            }

            return(list);
        }