コード例 #1
0
        public static CelestialSatellite Generate(Dice die)
        {
            CelestialSatellite celestialSatellite = new CelestialSatellite();

            celestialSatellite.CelestialType    = GenerateCelestialSatelliteType(die);
            celestialSatellite.TerraformingTier = GenerateTerraformationTier(die);

            if (celestialSatellite.TerraformingTier == TerraformationTier.Uninhabitable ||
                celestialSatellite.CelestialType == CelestialSatelliteType.GasCloud)
            {
                celestialSatellite.StageOfLife = LifeStage.NoLife;
            }
            else if (celestialSatellite.TerraformingTier == TerraformationTier.T1 ||
                     celestialSatellite.TerraformingTier == TerraformationTier.T2)
            {
                celestialSatellite.StageOfLife = GenerateStageOfLifeT1T2(die);
            }
            else
            {
                celestialSatellite.StageOfLife = GenerateStageOfLife(die);
            }

            // Calculate Resource Value
            celestialSatellite.ResourceValue = GenerateResourceValue(die);
            if (celestialSatellite.TerraformingTier == TerraformationTier.Uninhabitable)
            {
                celestialSatellite.ResourceValue += die.Roll(1, 10) + 10;
            }
            else if (celestialSatellite.TerraformingTier == TerraformationTier.T1)
            {
                celestialSatellite.ResourceValue += die.Roll(1, 5);
            }
            else if (celestialSatellite.TerraformingTier == TerraformationTier.T2)
            {
                celestialSatellite.ResourceValue += die.Roll(1, 3);
            }
            else if (celestialSatellite.TerraformingTier == TerraformationTier.T5)
            {
                celestialSatellite.ResourceValue += die.Roll(1, 5) + 3;
            }

            // Generate Sentient Species
            if (celestialSatellite.StageOfLife == LifeStage.SentientLife)
            {
                int numberOfSentients = GenerateNumberOfSentients(die);
                for (int i = 0; i < numberOfSentients; i++)
                {
                    celestialSatellite.Sentients.Add(SentientSpecies.Generate(die));
                }
            }

            return(celestialSatellite);
        }
コード例 #2
0
        public static SentientSpecies Generate(Dice die)
        {
            SentientSpecies sentient = new SentientSpecies();

            sentient.TechLevel = GenerateCivilizationTechLevel(die);

            #region Generate Species Physiology
            int maxNumberOfAnimalClassifications = GenerateMaxNumberOfAnimalClassifications(die);
            while (true)
            {
                if (sentient.Classifications.Count >= maxNumberOfAnimalClassifications)
                {
                    break;
                }
                AnimalClassification classification = GenerateAnimalClassification(die);

                bool acceptableClassification = true;
                foreach (var c in sentient.Classifications)
                {
                    if (classification == c)
                    {
                        acceptableClassification = false; break;
                    }
                }

                if (acceptableClassification)
                {
                    sentient.Classifications.Add(classification);
                    if (die.Roll(1, 20) < 10)
                    {
                        break;
                    }
                }
            }
            #endregion

            #region Generate Civilization Traits
            while (true)
            {
                if (sentient.Traits.Count >= 3)
                {
                    break;
                }
                CivilizationTraits trait = GenerateCivilizationTrait(die);

                bool acceptableTrait = true;
                if (sentient.Traits.Count == 0)
                {
                }
                else
                {
                    foreach (var t in sentient.Traits)
                    {
                        if (trait == t)
                        {
                            acceptableTrait = false; break;
                        }
                        else if ((trait == CivilizationTraits.Imperialist && t == CivilizationTraits.PeaceKeepers) ||
                                 (trait == CivilizationTraits.PeaceKeepers && t == CivilizationTraits.Imperialist))
                        {
                            acceptableTrait = false; break;
                        }

                        else if ((trait == CivilizationTraits.Communist && t == CivilizationTraits.Capitalist) ||
                                 (trait == CivilizationTraits.Capitalist && t == CivilizationTraits.Communist))
                        {
                            acceptableTrait = false; break;
                        }
                    }
                }

                if (acceptableTrait)
                {
                    sentient.Traits.Add(trait);
                }
            }
            #endregion

            return(sentient);
        }
コード例 #3
0
        public static CelestialBody Generate(Dice die)
        {
            CelestialBody celestialObject = new CelestialBody();

            celestialObject.CelestialType = GenerateCelestialBodyType(die);

            // Terraforming Tier
            if (celestialObject.CelestialType == CelestialBodyType.Blackhole ||
                celestialObject.CelestialType == CelestialBodyType.SubStar ||
                celestialObject.CelestialType == CelestialBodyType.Wormhole ||
                celestialObject.CelestialType == CelestialBodyType.Comet)
            {
                celestialObject.TerraformingTier = TerraformationTier.Uninhabitable;
            }
            else
            {
                celestialObject.TerraformingTier = GenerateTerraformationTier(die);
            }

            // Stage of Life
            if (celestialObject.TerraformingTier == TerraformationTier.Uninhabitable ||
                celestialObject.CelestialType == CelestialBodyType.Blackhole ||
                celestialObject.CelestialType == CelestialBodyType.SubStar ||
                celestialObject.CelestialType == CelestialBodyType.Wormhole ||
                celestialObject.CelestialType == CelestialBodyType.Comet)
            {
                celestialObject.StageOfLife = LifeStage.NoLife;
            }
            else if (celestialObject.TerraformingTier == TerraformationTier.T1 ||
                     celestialObject.TerraformingTier == TerraformationTier.T2 ||
                     celestialObject.CelestialType == CelestialBodyType.GasPlanet)
            {
                celestialObject.StageOfLife = GenerateStageOfLifeT1T2(die);
            }
            else
            {
                celestialObject.StageOfLife = GenerateStageOfLife(die);
            }

            // Calculate Resource Value
            celestialObject.ResourceValue = GenerateResourceValue(die);
            if (celestialObject.CelestialType == CelestialBodyType.Blackhole || celestialObject.CelestialType == CelestialBodyType.Wormhole)
            {
                celestialObject.ResourceValue = 0;
            }
            else if (celestialObject.TerraformingTier == TerraformationTier.Uninhabitable)
            {
                celestialObject.ResourceValue += die.Roll(1, 10) + 10;
            }
            else if (celestialObject.TerraformingTier == TerraformationTier.T1)
            {
                celestialObject.ResourceValue += die.Roll(1, 5);
            }
            else if (celestialObject.TerraformingTier == TerraformationTier.T2)
            {
                celestialObject.ResourceValue += die.Roll(1, 3);
            }
            else if (celestialObject.TerraformingTier == TerraformationTier.T5)
            {
                celestialObject.ResourceValue += die.Roll(1, 5) + 3;
            }

            // Generate Sentient Species
            if (celestialObject.StageOfLife == LifeStage.SentientLife)
            {
                int numberOfSentients = GenerateNumberOfSentients(die);
                for (int i = 0; i < numberOfSentients; i++)
                {
                    celestialObject.Sentients.Add(SentientSpecies.Generate(die));
                }
            }

            // Generate Celestial Satellites
            if (celestialObject.CelestialType == CelestialBodyType.Comet)
            {
            }
            else if (celestialObject.CelestialType == CelestialBodyType.Wormhole)
            {
            }
            //else if (celestialObject.CelestialType == CelestialBodyType.AsteroidBelt) { }
            else
            {
                int numberOfCelestialSatellites = GenerateNumberOfCelestialSatellites(die);
                for (int i = 0; i < numberOfCelestialSatellites; i++)
                {
                    celestialObject.OrbitingSatellites.Add(CelestialSatellite.Generate(die));
                }
            }

            return(celestialObject);
        }