private void GenerateCursedArtefact()
        {
            GenerateCraftsmanship();
            _quirk1 = GenerateQuirk();
            switch (Globals.RollD10())
            {
            case 1:
            case 2:
                _markOfTheCurse = new DocContentItem("Bloodlust", 90);
                break;

            case 3:
            case 4:
                _markOfTheCurse = new DocContentItem("Mindkiller", 91);
                break;

            case 5:
            case 6:
                _markOfTheCurse = new DocContentItem("Alluring", 91);
                break;

            case 7:
            case 8:
                _markOfTheCurse = new DocContentItem("Entropic", 91);
                break;

            case 9:
            case 10:
                _markOfTheCurse = new DocContentItem("Deceitful", 92);
                break;
            }
        }
        private void GenerateOrkInhabitants()
        {
            int randValue = Globals.RollD10();

            if (randValue <= 4)
            {
                _inhabitantDevelopment = new DocContentItem("Advanced Industry", 46);
                for (int i = 0; i < 3; i++)
                {
                    ReduceRandomResource(Globals.RollD10(3) + 5);
                }
            }
            else if (randValue <= 5)
            {
                _inhabitantDevelopment = new DocContentItem("Colony", 46);
                ReduceAllResources(Globals.RollD5());
            }
            else if (randValue <= 8)
            {
                _inhabitantDevelopment = new DocContentItem("Primitive Clans", 46);
                ReduceRandomResource(Globals.RollD10() + 2);
            }
            else
            {
                _inhabitantDevelopment = new DocContentItem("Voidfarers", 47);
                for (int i = 0; i < 5; i++)
                {
                    ReduceRandomResource(Globals.RollD10(4) + 5);
                }
            }
        }
Example #3
0
        public DocContentItem GenerateDocItem()
        {
            string content = Race + " " + ShipType + " - " + Integrity + ".";

            DocItem = new DocContentItem(content, BookPage, "", BookSource);
            return(DocItem);
        }
 public override void ResetVariables()
 {
     base.ResetVariables();
     _treasureName         = new DocContentItem("");
     _origin               = TreasureOrigin.Undefined;
     _craftsmanship        = TreasureCraftsmanship.Undefined;
     _miraclesOfTheDarkAge = new List <DocContentItem>();
     _xenosConstruction    = new DocContentItem("");
     _markOfTheCurse       = new DocContentItem("");
     _quirk1               = "";
     _quirk2               = "";
 }
        private void GenerateMeleeWeapon()
        {
            _treasureType = TreasureType.MeleeWeapon;
            switch (Globals.RollD10())
            {
            case 1:
                _treasureName = new DocContentItem("Razorchain", 84, "Table 2-25: Melee Weapons");
                break;

            case 2:
                _treasureName = new DocContentItem("Chainsword", 84, "Table 2-25: Melee Weapons");
                break;

            case 3:
                _treasureName = new DocContentItem("Chain Axe", 84, "Table 2-25: Melee Weapons");
                break;

            case 4:
                _treasureName = new DocContentItem("Relic Shield", 84, "Table 2-25: Melee Weapons");
                break;

            case 5:
                _treasureName = new DocContentItem("Relic Glaive", 84, "Table 2-25: Melee Weapons");
                break;

            case 6:
                _treasureName = new DocContentItem("Relic Flail", 84, "Table 2-25: Melee Weapons");
                break;

            case 7:
                _treasureName = new DocContentItem("Charged Gauntlet", 84, "Table 2-25: Melee Weapons");
                break;

            case 8:
                _treasureName = new DocContentItem("Power Blade", 84, "Table 2-25: Melee Weapons");
                break;

            case 9:
                _treasureName = new DocContentItem("Power Axe", 84, "Table 2-25: Melee Weapons");
                break;

            case 10:
                _treasureName = new DocContentItem("Crystalline Blade", 84, "Table 2-25: Melee Weapons");
                break;
            }
        }
Example #6
0
        //public static List<ClassifierItem> ToClassifierItemList(this Dictionary<string, int> dictionary)
        //{
        //    var kvs = dictionary.Select(kvp => new ClassifierItem() { Id = kvp.Key});
        //    return string.Concat("[", string.Join(",", kvs), "]");
        //}

        public static DocContentItem ToDocContentItem(this IDataRecord record)
        {
            if (record == null)
            {
                throw new ArgumentNullException();
            }

            var result = new DocContentItem
            {
                id        = Convert.ToInt32(record["doc_par_id"]),
                parent_id = record["parent_doc_par_id"] as int?,
                eid       = record["eid"].ToString(),
                title     = $"{record["num"]} {record["heading"]}".Trim(),
                tooltip   = $"{record["num"]} {record["heading"]}".Trim()
            };

            return(result);
        }
        private void GenerateEldarInhabitants()
        {
            if (IsPlanetInhabitable() && Globals.RollD10() >= 9)
            {
                _maidenWorld = true;
                _habitabiliy = Habitabiliy.Verdant;
                foreach (OrganicCompound compound in OrganicCompounds)
                {
                    if (compound.Abundance > 0)
                    {
                        compound.Abundance += Globals.RollD10(2);
                    }
                }
            }
            int randValue = Globals.RollD10();

            if (randValue <= 3)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Primitive Clans (Exodites)", 42);
                    ReduceRandomResource(Globals.RollD10() + 2);
                    return;
                }
            }
            else if (randValue <= 8)
            {
                _inhabitantDevelopment = new DocContentItem("Orbital Habitation", 43);
                return;
            }
            else
            {
                _inhabitantDevelopment = new DocContentItem("Voidfarers", 43);

                /*
                 * for (int i = 0; i < 5; i++)
                 *  ReduceRandomResource(Globals.RollD10(4) + 5);
                 */
                return;
            }
            GenerateEldarInhabitants();
        }
        public virtual void ResetVariables()
        {
            _children.Clear();
            _flowDocument                   = new FlowDocument();
            _systemCreationRules            = new SystemCreationRules();
            _travelTimeFromSystemEdgeInDays = 0;
            _description           = "";
            _dirty                 = false;
            _inhabitants           = Species.None;
            _inhabitantDevelopment = new DocContentItem("");

            _resourceIndustrialMetal   = 0;
            _resourceOrnamental        = 0;
            _resourceRadioactive       = 0;
            _resourceExoticMaterial    = 0;
            _resourceArcheotechCache   = 0;
            _resourceXenosRuins        = 0;
            _resourceXenosRuinsSpecies = XenosRuinsSpecies.Undefined;
            OrganicCompounds           = new List <OrganicCompound>();
        }
        private void GenerateKrootInhabitants()
        {
            int randValue = Globals.RollD10();

            if (randValue <= 7)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Primitive Clans", 45);
                    ReduceRandomResource(Globals.RollD10() + 2);
                    return;
                }
            }
            else
            {
                _inhabitantDevelopment = new DocContentItem("Colony", 44);
                ReduceAllResources(Globals.RollD5());
                return;
            }
            GenerateKrootInhabitants();
        }
        private void GenerateRangedWeapon()
        {
            _treasureType = TreasureType.RangedWeapon;
            switch (Globals.RollD10())
            {
            case 1:
                _treasureName = new DocContentItem("Relic Javelin", 84, "Table 2-26: Ranged Weapons");
                break;

            case 2:
            case 3:
                _treasureName = new DocContentItem("Pistol", 84, "Table 2-26: Ranged Weapons");
                break;

            case 4:
            case 5:
                _treasureName = new DocContentItem("Rifle", 84, "Table 2-26: Ranged Weapons");
                break;

            case 6:
                _treasureName = new DocContentItem("Flamer", 84, "Table 2-26: Ranged Weapons");
                break;

            case 7:
                _treasureName = new DocContentItem("Thermal Cutter", 84, "Table 2-26: Ranged Weapons");
                break;

            case 8:
                _treasureName = new DocContentItem("Heavy Rifle", 84, "Table 2-26: Ranged Weapons");
                break;

            case 9:
                _treasureName = new DocContentItem("Hunter's Rifle", 84, "Table 2-26: Ranged Weapons");
                break;

            case 10:
                _treasureName = new DocContentItem("Scattergun", 84, "Table 2-26: Ranged Weapons");
                break;
            }
        }
        private void GenerateArmour()
        {
            _treasureType = TreasureType.Armour;
            switch (Globals.RollD10())
            {
            case 1:
            case 2:
                _treasureName = new DocContentItem("Reinforced Hauberk", 84, "Table 2-27: Armour");
                break;

            case 3:
                _treasureName = new DocContentItem("Reinforced Helm", 84, "Table 2-27: Armour");
                break;

            case 4:
            case 5:
                _treasureName = new DocContentItem("Meshweave Cloak", 84, "Table 2-27: Armour");
                break;

            case 6:
                _treasureName = new DocContentItem("Carapace Chestplate", 84, "Table 2-27: Armour");
                break;

            case 7:
                _treasureName = new DocContentItem("Carapace Helm", 84, "Table 2-27: Armour");
                break;

            case 8:
                _treasureName = new DocContentItem("Assassin's Bodyglove", 84, "Table 2-27: Armour");
                break;

            case 9:
                _treasureName = new DocContentItem("Light Power Armour", 138, "Table 5-12: Armour", RuleBook.CoreRuleBook);
                break;

            case 10:
                _treasureName = new DocContentItem("Power Armour", 138, "Table 5-12: Armour", RuleBook.CoreRuleBook);
                break;
            }
        }
        private void GenerateShipComponents()
        {
            _treasureType = TreasureType.ShipComponents;
            switch (Globals.RollD10())
            {
            case 1:
            case 2:
                _treasureName = new DocContentItem("Plasma Drive", 85, "Table 2-29: Ship Components");
                break;

            case 3:
                _treasureName = new DocContentItem("Warp Drive", 85, "Table 2-29: Ship Components");
                break;

            case 4:
                _treasureName = new DocContentItem("Gellar Field", 85, "Table 2-29: Ship Components");
                break;

            case 5:
                _treasureName = new DocContentItem("Void Shield", 85, "Table 2-29: Ship Components");
                break;

            case 6:
                _treasureName = new DocContentItem("Ship's Bridge", 85, "Table 2-29: Ship Components");
                break;

            case 7:
                _treasureName = new DocContentItem("Augur Array", 85, "Table 2-29: Ship Components");
                break;

            case 8:
            case 9:
                _treasureName = new DocContentItem("Lance", 85, "Table 2-29: Ship Components");
                break;

            case 10:
                _treasureName = new DocContentItem("Macrocannon", 85, "Table 2-29: Ship Components");
                break;
            }
        }
        private void GenerateRakGolInhabitants()
        {
            int randValue = Globals.RollD10();

            if (randValue <= 2)
            {
                _inhabitantDevelopment = new DocContentItem("Colony", 49);
                ReduceAllResources(Globals.RollD5());
            }
            else if (randValue <= 4)
            {
                _inhabitantDevelopment = new DocContentItem("Orbital Habitation", 49);
            }
            else
            {
                _inhabitantDevelopment = new DocContentItem("Voidfarers", 49);
                for (int i = 0; i < 5; i++)
                {
                    ReduceRandomResource(Globals.RollD10(4) + 5);
                }
            }
        }
 public void SetInhabitantDevelopmentLevelForStarfarers(StarfarerInhabitantDevelopmentLevel level)
 {
     if (level == StarfarerInhabitantDevelopmentLevel.Colony)
     {
         _inhabitantDevelopment = new DocContentItem("Colony", 41);
         ReduceAllResources(Globals.RollD5());
     }
     else if (level == StarfarerInhabitantDevelopmentLevel.OrbitalHabitation)
     {
         _inhabitantDevelopment = new DocContentItem("Orbital Habitation", 41);
     }
     else if (level == StarfarerInhabitantDevelopmentLevel.Voidfarers)
     {
         _inhabitantDevelopment = new DocContentItem("Voidfarers", 42);
         for (int i = 0; i < 5; i++)
         {
             ReduceRandomResource(Globals.RollD10(4) + 5);
         }
     }
     else
     {
         throw new Exception("Attempted to set a Starfarers development level that is invalid for this system feature.");
     }
 }
        private void GenerateAlienTechnology()
        {
            GenerateCraftsmanship();
            _quirk1 = GenerateQuirk();
            switch (Globals.RollD10())
            {
            case 1:
            case 2:
                _xenosConstruction = new DocContentItem("Ramshackle", 88);
                if (_treasureType == TreasureType.MeleeWeapon || _treasureType == TreasureType.RangedWeapon)
                {
                    _quirk2 = GenerateQuirk(_quirk1);
                }
                break;

            case 3:
            case 4:
                _xenosConstruction = new DocContentItem("Peerless Elegance", 89);
                break;

            case 5:
            case 6:
                _xenosConstruction = new DocContentItem("Innovative Design", 89);
                break;

            case 7:
            case 8:
                _xenosConstruction = new DocContentItem("Remnant of the Endless", 89);
                break;

            case 9:
            case 10:
                _xenosConstruction = new DocContentItem("Death-Dream's Fragment", 88);
                break;
            }
        }
        public void GenerateHumanInhabitants(StarfarerInhabitantDevelopmentLevel forcedLevel = StarfarerInhabitantDevelopmentLevel.Undefined)
        {
            int randValue = Globals.RollD10();

            switch (forcedLevel)
            {
            case StarfarerInhabitantDevelopmentLevel.Undefined:
                break;

            case StarfarerInhabitantDevelopmentLevel.Voidfarers:
                randValue = 10;
                break;

            case StarfarerInhabitantDevelopmentLevel.Colony:
                randValue = 5;
                break;

            case StarfarerInhabitantDevelopmentLevel.OrbitalHabitation:
                randValue = 6;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(forcedLevel));
            }

            if (randValue <= 2)
            {
                _inhabitantDevelopment = new DocContentItem("Advanced Industry", 40);
                for (int i = 0; i < 3; i++)
                {
                    ReduceRandomResource(Globals.RollD10(3) + 5);
                }
                return;
            }
            if (randValue <= 4)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Basic Industry", 41);
                    for (int i = 0; i < 5; i++)
                    {
                        ReduceRandomResource(Globals.RollD10(2) + 5);
                    }
                    return;
                }
            }
            else if (randValue <= 5)
            {
                _inhabitantDevelopment = new DocContentItem("Colony", 41);
                ReduceAllResources(Globals.RollD5());
                return;
            }
            else if (randValue <= 6)
            {
                _inhabitantDevelopment = new DocContentItem("Orbital Habitation", 41);
                return;
            }
            else if (randValue <= 8)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Pre-Industrial", 41);
                    int randomNumResources = Globals.Rand.Next(3);
                    for (int i = 0; i < randomNumResources; i++)
                    {
                        ReduceRandomResource(Globals.RollD10() + 5);
                    }
                    return;
                }
            }
            else if (randValue <= 9)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Primitive Clans", 42);
                    ReduceRandomResource(Globals.RollD10() + 2);
                    return;
                }
            }
            else
            {
                _inhabitantDevelopment = new DocContentItem("Voidfarers", 42);
                for (int i = 0; i < 5; i++)
                {
                    ReduceRandomResource(Globals.RollD10(4) + 5);
                }
                return;
            }
            GenerateHumanInhabitants();
        }
        public void GenerateXenosOtherInhabitants(StarfarerInhabitantDevelopmentLevel forcedLevel = StarfarerInhabitantDevelopmentLevel.Undefined)
        {
            int randValue = Globals.RollD10();

            switch (forcedLevel)
            {
            case StarfarerInhabitantDevelopmentLevel.Undefined:
                break;

            case StarfarerInhabitantDevelopmentLevel.Voidfarers:
                randValue = 10;
                break;

            case StarfarerInhabitantDevelopmentLevel.Colony:
                randValue = 4;
                break;

            case StarfarerInhabitantDevelopmentLevel.OrbitalHabitation:
                randValue = 5;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(forcedLevel));
            }

            if (randValue <= 1)
            {
                _inhabitantDevelopment = new DocContentItem("Advanced Industry", 40);
                for (int i = 0; i < 3; i++)
                {
                    ReduceRandomResource(Globals.RollD10(3) + 5);
                }
                return;
            }
            if (randValue <= 3)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Basic Industry", 41);
                    for (int i = 0; i < 5; i++)
                    {
                        ReduceRandomResource(Globals.RollD10(2) + 5);
                    }
                    return;
                }
            }
            else if (randValue <= 4)
            {
                _inhabitantDevelopment = new DocContentItem("Colony", 41);
                ReduceAllResources(Globals.RollD5());
                return;
            }
            else if (randValue <= 5)
            {
                _inhabitantDevelopment = new DocContentItem("Orbital Habitation", 41);
                return;
            }
            else if (randValue <= 7)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Pre-Industrial", 41);
                    int randomNumResources = Globals.Rand.Next(3);
                    for (int i = 0; i < randomNumResources; i++)
                    {
                        ReduceRandomResource(Globals.RollD10() + 5);
                    }
                    if (Properties.Settings.Default.BookKoronusBestiary)
                    {
                        _primitiveXenosNode.AddXenos(WorldType.TemperateWorld);
                    }
                    return;
                }
            }
            else if (randValue <= 9)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Primitive Clans", 42);
                    ReduceRandomResource(Globals.RollD10() + 2);
                    if (Properties.Settings.Default.BookKoronusBestiary)
                    {
                        _primitiveXenosNode.AddXenos(WorldType.TemperateWorld);
                    }
                    return;
                }
            }
            else
            {
                _inhabitantDevelopment = new DocContentItem("Voidfarers", 42);
                for (int i = 0; i < 5; i++)
                {
                    ReduceRandomResource(Globals.RollD10(4) + 5);
                }
                return;
            }
            GenerateXenosOtherInhabitants();
        }
        private void GenerateGearAndTools()
        {
            _treasureType = TreasureType.GearAndTools;
            switch (Globals.RollD10())
            {
            case 1:
                _treasureName = new DocContentItem("Auspex / Scanner", 143, "", RuleBook.CoreRuleBook);
                break;

            case 2:
                _treasureName = new DocContentItem("Combi-tool", 144, "", RuleBook.CoreRuleBook);
                break;

            case 3:
                int randValue = Globals.Rand.Next(77);
                if (randValue <= 2)
                {
                    _treasureName = new DocContentItem("Augur Array", 148, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 5)
                {
                    _treasureName = new DocContentItem("Augmented Senses", 148, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 6)
                {
                    _treasureName = new DocContentItem("Baleful Eye", 148, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 8)
                {
                    _treasureName = new DocContentItem("Ballistic Mechadentrite", 148, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 12)
                {
                    _treasureName = new DocContentItem("Bionic Arm", 148, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 16)
                {
                    _treasureName = new DocContentItem("Bionic Locomotion", 148, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 19)
                {
                    _treasureName = new DocContentItem("Bionic Respiratory System", 148, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 22)
                {
                    _treasureName = new DocContentItem("Bionic Heart", 149, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 24)
                {
                    _treasureName = new DocContentItem("Calculus Logi Upgrade", 149, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 26)
                {
                    _treasureName = new DocContentItem("Cortex Implants", 149, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 30)
                {
                    _treasureName = new DocContentItem("Cranial Armour", 149, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 33)
                {
                    _treasureName = new DocContentItem("Cybernetic Senses", 149, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 36)
                {
                    _treasureName = new DocContentItem("Locator Matrix", 150, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 38)
                {
                    _treasureName = new DocContentItem("Manipulator Mechadendrite", 150, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 40)
                {
                    _treasureName = new DocContentItem("Medicae Mechadendrite", 150, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 43)
                {
                    _treasureName = new DocContentItem("Memorance Implant", 150, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 46)
                {
                    _treasureName = new DocContentItem("Mind Impulse Unit", 150, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 49)
                {
                    _treasureName = new DocContentItem("MIU Weapon Interface", 151, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 51)
                {
                    _treasureName = new DocContentItem("Optical Mechadendrite", 151, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 54)
                {
                    _treasureName = new DocContentItem("Respiratory Filter Implant", 151, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 58)
                {
                    _treasureName = new DocContentItem("Scribe-tines", 151, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 60)
                {
                    _treasureName = new DocContentItem("Subskin Armour", 151, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 63)
                {
                    _treasureName = new DocContentItem("Synthetic Muscle Grafts", 151, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 65)
                {
                    _treasureName = new DocContentItem("Utility Mechadendrite", 151, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 69)
                {
                    _treasureName = new DocContentItem("Voidskin", 152, "", RuleBook.CoreRuleBook);
                }
                else if (randValue <= 72)
                {
                    _treasureName = new DocContentItem("Volitor Implant", 152, "", RuleBook.CoreRuleBook);
                }
                else
                {
                    _treasureName = new DocContentItem("Vox Implant", 152, "", RuleBook.CoreRuleBook);
                }
                break;

            case 4:
                _treasureName = new DocContentItem("Multicompass", 146, "", RuleBook.CoreRuleBook);
                break;

            case 5:
                _treasureName = new DocContentItem("Multikey", 145, "", RuleBook.CoreRuleBook);
                break;

            case 6:
                _treasureName = new DocContentItem("Navis Prima", 146, "", RuleBook.CoreRuleBook);
                break;

            case 7:
                _treasureName = new DocContentItem("Preysense Goggles", 140, "", RuleBook.CoreRuleBook);
                break;

            case 8:
                _treasureName = new DocContentItem("Chameleoline Cloak", 139, "", RuleBook.CoreRuleBook);
                break;

            case 9:
                _treasureName = new DocContentItem("Jump Pack", 144, "", RuleBook.CoreRuleBook);
                break;

            case 10:
                _treasureName = new DocContentItem("Void Suit", 140, "", RuleBook.CoreRuleBook);
                break;
            }
        }