Esempio n. 1
0
        public void AddNewItem(ArtifactIndex index, bool skipNotification = false)
        {
            if (ConfigField == null)
            {
                return;
            }
            if (items.Any(item => item.artifactIndex == index))
            {
                return;
            }
            var itemGameObject = Instantiate(itemPrefab, contentContainer);

            var itemController = itemGameObject.GetComponent <ArtifactBlacklistItemController>();

            itemController.text.text     = (int)index >= dropdown.options.Count - 1 ? "{Missing artifact}" : dropdown.options[(int)index].text;
            itemController.artifactIndex = index;

            itemGameObject.SetActive(true);

            items.Add(itemController);
            if (skipNotification)
            {
                return;
            }
            ConfigField.OnItemAdded(index, itemGameObject.transform.GetSiblingIndex());
        }
Esempio n. 2
0
 // Token: 0x06000A07 RID: 2567 RVA: 0x00046818 File Offset: 0x00044A18
 static ArtifactMask()
 {
     for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++)
     {
         ArtifactMask.all.AddArtifact(artifactIndex);
     }
 }
Esempio n. 3
0
 // Token: 0x06001787 RID: 6023 RVA: 0x0006F864 File Offset: 0x0006DA64
 public override void OverrideRuleChoices(RuleChoiceMask mustInclude, RuleChoiceMask mustExclude)
 {
     base.OverrideRuleChoices(mustInclude, mustExclude);
     base.ForceChoice(mustInclude, mustExclude, "Difficulty.Normal");
     base.ForceChoice(mustInclude, mustExclude, "Misc.StartingMoney.50");
     base.ForceChoice(mustInclude, mustExclude, "Misc.StageOrder.Random");
     base.ForceChoice(mustInclude, mustExclude, "Misc.KeepMoneyBetweenStages.Off");
     for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++)
     {
         RuleDef       ruleDef       = RuleCatalog.FindRuleDef(artifactIndex.ToString());
         RuleChoiceDef ruleChoiceDef = (ruleDef != null) ? ruleDef.FindChoice("Off") : null;
         if (ruleChoiceDef != null)
         {
             base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef);
         }
     }
     for (ItemIndex itemIndex = ItemIndex.Syringe; itemIndex < ItemIndex.Count; itemIndex++)
     {
         RuleDef       ruleDef2       = RuleCatalog.FindRuleDef("Items." + itemIndex.ToString());
         RuleChoiceDef ruleChoiceDef2 = (ruleDef2 != null) ? ruleDef2.FindChoice("On") : null;
         if (ruleChoiceDef2 != null)
         {
             base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef2);
         }
     }
     for (EquipmentIndex equipmentIndex = EquipmentIndex.CommandMissile; equipmentIndex < EquipmentIndex.Count; equipmentIndex++)
     {
         RuleDef       ruleDef3       = RuleCatalog.FindRuleDef("Equipment." + equipmentIndex.ToString());
         RuleChoiceDef ruleChoiceDef3 = (ruleDef3 != null) ? ruleDef3.FindChoice("On") : null;
         if (ruleChoiceDef3 != null)
         {
             base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef3);
         }
     }
 }
Esempio n. 4
0
        public void AddNewItem(ArtifactIndex key, int value, bool skipNotification = false)
        {
            if (ConfigField == null)
            {
                return;
            }
            if (items.ContainsKey(key))
            {
                return;
            }
            ArtifactsRandomizerPlugin.InstanceLogger.LogWarning(key);
            var itemGameObject = Instantiate(itemPrefab, contentContainer);

            var itemController = itemGameObject.GetComponent <ArtifactWeightItemController>();

            itemController.text.text = (int)key >= dropdown.options.Count - 1 ? "{Missing artifact}" : dropdown.options[(int)key].text;
            itemController.inputField.SetTextWithoutNotify(value.ToString());
            itemController.artifactIndex = key;

            itemGameObject.SetActive(true);

            items.Add(key, itemController);
            if (skipNotification)
            {
                return;
            }
            ConfigField.OnItemAdded(key, value);
        }
Esempio n. 5
0
        public static RuleDef FromArtifact(ArtifactIndex artifactIndex)
        {
            var artifactDef = ArtifactCatalog.GetArtifactDef(artifactIndex);
            var ruleDef     = new RuleDef($"Artifacts.{artifactIndex}", artifactDef.nameToken);

            var ruleChoiceDef = ruleDef.AddChoice("On");

            ruleChoiceDef.spritePath       = artifactDef.smallIconSelectedPath;
            ruleChoiceDef.tooltipBodyToken = artifactDef.descriptionToken;
            ruleChoiceDef.unlockableName   = artifactDef.unlockableName;
            ruleChoiceDef.artifactIndex    = artifactIndex;
            ruleChoiceDef.tooltipNameColor = new Color32(74, 50, 149, byte.MaxValue);
            ruleChoiceDef.tooltipNameToken = $"{artifactDef.nameToken} On";

            var ruleChoiceDef2 = ruleDef.AddChoice("Off");

            ruleChoiceDef2.spritePath      = artifactDef.smallIconDeselectedPath;
            ruleChoiceDef2.materialPath    = "Materials/UI/matRuleChoiceOff";
            ruleChoiceDef.tooltipBodyToken = artifactDef.descriptionToken;
            ruleChoiceDef.tooltipNameColor = new Color32(74, 50, 149, byte.MaxValue);
            ruleChoiceDef.tooltipNameToken = $"{artifactDef.nameToken} Off";

            ruleDef.MakeNewestChoiceDefault();

            return(ruleDef);
        }
Esempio n. 6
0
 // Token: 0x06000A04 RID: 2564 RVA: 0x0000814A File Offset: 0x0000634A
 public void ToggleArtifact(ArtifactIndex artifactIndex)
 {
     if (artifactIndex < ArtifactIndex.Command || artifactIndex >= ArtifactIndex.Count)
     {
         return;
     }
     this.a ^= (ushort)(1 << (int)artifactIndex);
 }
Esempio n. 7
0
 // Token: 0x06000A0D RID: 2573 RVA: 0x000081E0 File Offset: 0x000063E0
 public static ArtifactDef GetArtifactDef(ArtifactIndex artifactIndex)
 {
     if (artifactIndex < ArtifactIndex.Command || artifactIndex >= ArtifactIndex.Count)
     {
         return(null);
     }
     return(ArtifactCatalog.artifactDefs[(int)artifactIndex]);
 }
Esempio n. 8
0
 // Token: 0x06000A05 RID: 2565 RVA: 0x0000816A File Offset: 0x0000636A
 public void RemoveArtifact(ArtifactIndex artifactIndex)
 {
     if (artifactIndex < ArtifactIndex.Command || artifactIndex >= ArtifactIndex.Count)
     {
         return;
     }
     this.a &= (ushort)(~(ushort)(1 << (int)artifactIndex));
 }
        // Token: 0x06002348 RID: 9032 RVA: 0x000A6480 File Offset: 0x000A4680
        private void Start()
        {
            RectTransform component = base.GetComponent <RectTransform>();

            for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++)
            {
                UnityEngine.Object.Instantiate <GameObject>(this.artifactTogglePrefab, component).GetComponent <ArtifactToggleController>().artifactIndex = artifactIndex;
            }
        }
Esempio n. 10
0
 public void DeleteItem(ArtifactIndex key)
 {
     if (ConfigField == null)
     {
         return;
     }
     items.Remove(key);
     ConfigField.OnItemRemoved(key);
 }
Esempio n. 11
0
        // Token: 0x060015BF RID: 5567 RVA: 0x0005CB68 File Offset: 0x0005AD68
        public override void OverrideRuleChoices(RuleChoiceMask mustInclude, RuleChoiceMask mustExclude)
        {
            base.OverrideRuleChoices(mustInclude, mustExclude);
            base.ForceChoice(mustInclude, mustExclude, "Difficulty.Normal");
            base.ForceChoice(mustInclude, mustExclude, "Misc.StartingMoney.50");
            base.ForceChoice(mustInclude, mustExclude, "Misc.StageOrder.Random");
            base.ForceChoice(mustInclude, mustExclude, "Misc.KeepMoneyBetweenStages.Off");
            for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++)
            {
                RuleDef       ruleDef       = RuleCatalog.FindRuleDef(artifactIndex.ToString());
                RuleChoiceDef ruleChoiceDef = (ruleDef != null) ? ruleDef.FindChoice("Off") : null;
                if (ruleChoiceDef != null)
                {
                    base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef);
                }
            }
            ItemIndex itemIndex = ItemIndex.Syringe;
            ItemIndex itemCount = (ItemIndex)ItemCatalog.itemCount;

            while (itemIndex < itemCount)
            {
                ItemDef       itemDef        = ItemCatalog.GetItemDef(itemIndex);
                RuleDef       ruleDef2       = RuleCatalog.FindRuleDef("Items." + itemDef.name);
                RuleChoiceDef ruleChoiceDef2 = (ruleDef2 != null) ? ruleDef2.FindChoice("On") : null;
                if (ruleChoiceDef2 != null)
                {
                    base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef2);
                }
                itemIndex++;
            }
            EquipmentIndex equipmentIndex = EquipmentIndex.CommandMissile;
            EquipmentIndex equipmentCount = (EquipmentIndex)EquipmentCatalog.equipmentCount;

            while (equipmentIndex < equipmentCount)
            {
                EquipmentDef  equipmentDef   = EquipmentCatalog.GetEquipmentDef(equipmentIndex);
                RuleDef       ruleDef3       = RuleCatalog.FindRuleDef("Equipment." + equipmentDef.name);
                RuleChoiceDef ruleChoiceDef3 = (ruleDef3 != null) ? ruleDef3.FindChoice("On") : null;
                if (ruleChoiceDef3 != null)
                {
                    base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef3);
                }
                equipmentIndex++;
            }
        }
        // Token: 0x060018D6 RID: 6358 RVA: 0x0006AE78 File Offset: 0x00069078
        public static RuleDef FromArtifact(ArtifactIndex artifactIndex)
        {
            ArtifactDef   artifactDef   = ArtifactCatalog.GetArtifactDef(artifactIndex);
            RuleDef       ruleDef       = new RuleDef("Artifacts." + artifactIndex.ToString(), artifactDef.nameToken);
            RuleChoiceDef ruleChoiceDef = ruleDef.AddChoice("On", null, false);

            ruleChoiceDef.spritePath       = artifactDef.smallIconSelectedPath;
            ruleChoiceDef.tooltipBodyToken = artifactDef.descriptionToken;
            ruleChoiceDef.unlockableName   = artifactDef.unlockableName;
            ruleChoiceDef.artifactIndex    = artifactIndex;
            RuleChoiceDef ruleChoiceDef2 = ruleDef.AddChoice("Off", null, false);

            ruleChoiceDef2.spritePath       = artifactDef.smallIconDeselectedPath;
            ruleChoiceDef2.materialPath     = "Materials/UI/matRuleChoiceOff";
            ruleChoiceDef2.tooltipBodyToken = null;
            ruleDef.MakeNewestChoiceDefault();
            return(ruleDef);
        }
        private static void Init()
        {
            RuleCatalog.AddCategory("RULE_HEADER_DIFFICULTY", new Color32(28, 99, 150, byte.MaxValue));
            RuleCatalog.AddRule(RuleDef.FromDifficulty());
            RuleCatalog.AddCategory("RULE_HEADER_ARTIFACTS", new Color32(74, 50, 149, byte.MaxValue), "RULE_ARTIFACTS_EMPTY_TIP", new Func <bool>(RuleCatalog.HiddenTestFalse));
            for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++)
            {
                RuleCatalog.AddRule(RuleDef.FromArtifact(artifactIndex));
            }
            RuleCatalog.AddCategory("RULE_HEADER_ITEMS", new Color32(147, 225, 128, byte.MaxValue), null, new Func <bool>(RuleCatalog.HiddenTestItemsConvar));
            List <ItemIndex> list      = new List <ItemIndex>();
            ItemIndex        itemIndex = ItemIndex.Syringe;
            ItemIndex        itemCount = (ItemIndex)ItemCatalog.itemCount;

            while (itemIndex < itemCount)
            {
                list.Add(itemIndex);
                itemIndex++;
            }
            foreach (ItemIndex itemIndex2 in from i in list
                     where ItemCatalog.GetItemDef(i).inDroppableTier
                     orderby ItemCatalog.GetItemDef(i).tier
                     select i)
            {
                RuleCatalog.AddRule(RuleDef.FromItem(itemIndex2));
            }
            RuleCatalog.AddCategory("RULE_HEADER_EQUIPMENT", new Color32(byte.MaxValue, 128, 0, byte.MaxValue), null, new Func <bool>(RuleCatalog.HiddenTestItemsConvar));
            List <EquipmentIndex> list2          = new List <EquipmentIndex>();
            EquipmentIndex        equipmentIndex = EquipmentIndex.CommandMissile;
            EquipmentIndex        equipmentCount = (EquipmentIndex)EquipmentCatalog.equipmentCount;

            while (equipmentIndex < equipmentCount)
            {
                list2.Add(equipmentIndex);
                equipmentIndex++;
            }
            foreach (EquipmentIndex equipmentIndex2 in from i in list2
                     where EquipmentCatalog.GetEquipmentDef(i).canDrop
                     select i)
            {
                RuleCatalog.AddRule(RuleDef.FromEquipment(equipmentIndex2));
            }
            RuleCatalog.AddCategory("RULE_HEADER_MISC", new Color32(192, 192, 192, byte.MaxValue), null, new Func <bool>(RuleCatalog.HiddenTestFalse));
            RuleDef       ruleDef       = new RuleDef("Misc.StartingMoney", "RULE_MISC_STARTING_MONEY");
            RuleChoiceDef ruleChoiceDef = ruleDef.AddChoice("0", 0U, true);

            ruleChoiceDef.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_0_NAME";
            ruleChoiceDef.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_0_DESC";
            ruleChoiceDef.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            RuleChoiceDef ruleChoiceDef2 = ruleDef.AddChoice("15", 15U, true);

            ruleChoiceDef2.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_15_NAME";
            ruleChoiceDef2.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_15_DESC";
            ruleChoiceDef2.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            ruleDef.MakeNewestChoiceDefault();
            RuleChoiceDef ruleChoiceDef3 = ruleDef.AddChoice("50", 50U, true);

            ruleChoiceDef3.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_50_NAME";
            ruleChoiceDef3.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_50_DESC";
            ruleChoiceDef3.spritePath       = "Textures/MiscIcons/texRuleBonusStartingMoney";
            ruleChoiceDef3.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            RuleCatalog.AddRule(ruleDef);
            RuleDef       ruleDef2       = new RuleDef("Misc.StageOrder", "RULE_MISC_STAGE_ORDER");
            RuleChoiceDef ruleChoiceDef4 = ruleDef2.AddChoice("Normal", StageOrder.Normal, true);

            ruleChoiceDef4.tooltipNameToken = "RULE_STAGEORDER_CHOICE_NORMAL_NAME";
            ruleChoiceDef4.tooltipBodyToken = "RULE_STAGEORDER_CHOICE_NORMAL_DESC";
            ruleChoiceDef4.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            ruleDef2.MakeNewestChoiceDefault();
            RuleChoiceDef ruleChoiceDef5 = ruleDef2.AddChoice("Random", StageOrder.Random, true);

            ruleChoiceDef5.tooltipNameToken = "RULE_STAGEORDER_CHOICE_RANDOM_NAME";
            ruleChoiceDef5.tooltipBodyToken = "RULE_STAGEORDER_CHOICE_RANDOM_DESC";
            ruleChoiceDef5.spritePath       = "Textures/MiscIcons/texRuleMapIsRandom";
            ruleChoiceDef5.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            RuleCatalog.AddRule(ruleDef2);
            RuleDef ruleDef3 = new RuleDef("Misc.KeepMoneyBetweenStages", "RULE_MISC_KEEP_MONEY_BETWEEN_STAGES");

            ruleDef3.AddChoice("On", true, true).tooltipBodyToken   = "RULE_KEEPMONEYBETWEENSTAGES_CHOICE_ON_DESC";
            ruleDef3.AddChoice("Off", false, true).tooltipBodyToken = "RULE_KEEPMONEYBETWEENSTAGES_CHOICE_OFF_DESC";
            ruleDef3.MakeNewestChoiceDefault();
            RuleCatalog.AddRule(ruleDef3);
            for (int k = 0; k < RuleCatalog.allRuleDefs.Count; k++)
            {
                RuleDef ruleDef4 = RuleCatalog.allRuleDefs[k];
                ruleDef4.globalIndex = k;
                for (int j = 0; j < ruleDef4.choices.Count; j++)
                {
                    RuleChoiceDef ruleChoiceDef6 = ruleDef4.choices[j];
                    ruleChoiceDef6.localIndex  = j;
                    ruleChoiceDef6.globalIndex = RuleCatalog.allChoicesDefs.Count;
                    RuleCatalog.allChoicesDefs.Add(ruleChoiceDef6);
                }
            }
            RuleCatalog.availability.MakeAvailable();
        }
Esempio n. 14
0
 // Token: 0x06000A02 RID: 2562 RVA: 0x0000810E File Offset: 0x0000630E
 public bool HasArtifact(ArtifactIndex artifactIndex)
 {
     return(artifactIndex >= ArtifactIndex.Command && artifactIndex < ArtifactIndex.Count && ((int)this.a & 1 << (int)artifactIndex) != 0);
 }
Esempio n. 15
0
 private static void EndEditArtifactChance(ArtifactIndex key, float newValue)
 {
     ArtifactChancesDict[key] = newValue;
     UpdateArtifactChances();
 }
Esempio n. 16
0
 private static void RemoveArtifactChance(ArtifactIndex key)
 {
     ArtifactChancesDict.Remove(key);
     UpdateArtifactChances();
 }
Esempio n. 17
0
 private static void AddArtifactChance(ArtifactIndex key, float value)
 {
     ArtifactChancesDict.Add(key, value);
     UpdateArtifactChances();
 }
Esempio n. 18
0
 private static void EndEditArtifactWeight(ArtifactIndex key, int newValue)
 {
     ArtifactWeightsDict[key] = newValue;
     UpdateArtifactWeights();
 }
Esempio n. 19
0
 private static void RemoveArtifactWeight(ArtifactIndex key)
 {
     ArtifactWeightsDict.Remove(key);
     UpdateArtifactWeights();
 }
Esempio n. 20
0
 private static void AddArtifactWeight(ArtifactIndex key, int value)
 {
     ArtifactWeightsDict.Add(key, value);
     UpdateArtifactWeights();
 }
Esempio n. 21
0
 public void ItemEndEdit(ArtifactIndex key, int newValue)
 {
     ConfigField.OnItemEndEdit(key, newValue);
 }
Esempio n. 22
0
 // Token: 0x06000A0B RID: 2571 RVA: 0x000081D6 File Offset: 0x000063D6
 private static void RegisterArtifact(ArtifactIndex artifactIndex, ArtifactDef artifactDef)
 {
     ArtifactCatalog.artifactDefs[(int)artifactIndex] = artifactDef;
 }
Esempio n. 23
0
 private static void AddBlacklistIndex(ArtifactIndex item, int index)
 {
     BlacklistIndices.Insert(index, item);
     Blacklist.Value = string.Join(", ", BlacklistIndices);
 }
Esempio n. 24
0
        static patch_RuleCatalog()
        {
            allRuleDefs                = new List <RuleDef>();
            allChoicesDefs             = new List <RuleChoiceDef>();
            allCategoryDefs            = new List <RuleCategoryDef>();
            ruleDefsByGlobalName       = new Dictionary <string, RuleDef>();
            ruleChoiceDefsByGlobalName = new Dictionary <string, RuleChoiceDef>();
            ruleShowItems              = new BoolConVar("rule_show_items", ConVarFlags.None, "1",
                                                        "Whether or not to allow voting on items in the pregame rules.");
            RuleCatalog.AddCategory("RULE_HEADER_DIFFICULTY", new Color32(28, 99, 150, byte.MaxValue));
            RuleCatalog.AddRule(RuleDef.FromDifficulty());
            RuleCatalog.AddCategory("RULE_HEADER_ARTIFACTS", new Color32(74, 50, 149, byte.MaxValue), null,
                                    RuleCatalog.HiddenTestFalse);
            for (ArtifactIndex artifactIndex = 0; artifactIndex < ArtifactIndex.Count; artifactIndex++)
            {
                RuleCatalog.AddRule(RuleDef.FromArtifact(artifactIndex));
            }

            RuleCatalog.AddCategory("RULE_HEADER_ITEMS", new Color32(147, 225, 128, byte.MaxValue), null,
                                    RuleCatalog.HiddenTestItemsConvar);
            var list = new List <ItemIndex>();

            for (ItemIndex itemIndex = 0; itemIndex < ItemIndex.Count; itemIndex++)
            {
                list.Add(itemIndex);
            }

            foreach (var itemIndex2 in from i in list
                     where ItemCatalog.GetItemDef(i).inDroppableTier
                     orderby ItemCatalog.GetItemDef(i).tier
                     select i)
            {
                RuleCatalog.AddRule(RuleDef.FromItem(itemIndex2));
            }

            RuleCatalog.AddCategory("RULE_HEADER_EQUIPMENT", new Color32(byte.MaxValue, 128, 0, byte.MaxValue), null,
                                    RuleCatalog.HiddenTestItemsConvar);
            var list2 = new List <EquipmentIndex>();

            for (EquipmentIndex equipmentIndex = 0; equipmentIndex < EquipmentIndex.Count; equipmentIndex++)
            {
                list2.Add(equipmentIndex);
            }

            foreach (var equipmentIndex2 in from i in list2
                     where EquipmentCatalog.GetEquipmentDef(i).canDrop
                     select i)
            {
                RuleCatalog.AddRule(RuleDef.FromEquipment(equipmentIndex2));
            }

            RuleCatalog.AddCategory("RULE_HEADER_MISC", new Color32(192, 192, 192, byte.MaxValue), null,
                                    RuleCatalog.HiddenTestFalse);
            var ruleDef       = new RuleDef("Misc.StartingMoney", "RULE_MISC_STARTING_MONEY");
            var ruleChoiceDef = ruleDef.AddChoice("0", 0, true);

            ruleChoiceDef.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_0_NAME";
            ruleChoiceDef.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_0_DESC";
            ruleChoiceDef.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            var ruleChoiceDef2 = ruleDef.AddChoice("15", 15, true);

            ruleChoiceDef2.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_15_NAME";
            ruleChoiceDef2.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_15_DESC";
            ruleChoiceDef2.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            ruleDef.MakeNewestChoiceDefault();
            var ruleChoiceDef3 = ruleDef.AddChoice("50", 50, true);

            ruleChoiceDef3.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_50_NAME";
            ruleChoiceDef3.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_50_DESC";
            ruleChoiceDef3.spritePath       = "Textures/MiscIcons/texRuleBonusStartingMoney";
            ruleChoiceDef3.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            RuleCatalog.AddRule(ruleDef);
            var ruleDef2       = new RuleDef("Misc.StageOrder", "RULE_MISC_STAGE_ORDER");
            var ruleChoiceDef4 = ruleDef2.AddChoice("Normal", 0, true);

            ruleChoiceDef4.tooltipNameToken = "RULE_STAGEORDER_CHOICE_NORMAL_NAME";
            ruleChoiceDef4.tooltipBodyToken = "RULE_STAGEORDER_CHOICE_NORMAL_DESC";
            ruleChoiceDef4.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            ruleDef2.MakeNewestChoiceDefault();
            var ruleChoiceDef5 = ruleDef2.AddChoice("Random", 1, true);

            ruleChoiceDef5.tooltipNameToken = "RULE_STAGEORDER_CHOICE_RANDOM_NAME";
            ruleChoiceDef5.tooltipBodyToken = "RULE_STAGEORDER_CHOICE_RANDOM_DESC";
            ruleChoiceDef5.spritePath       = "Textures/MiscIcons/texRuleMapIsRandom";
            ruleChoiceDef5.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin);
            RuleCatalog.AddRule(ruleDef2);
            var ruleDef3 = new RuleDef("Misc.KeepMoneyBetweenStages", "RULE_MISC_KEEP_MONEY_BETWEEN_STAGES");

            ruleDef3.AddChoice("On", 1, true).tooltipBodyToken  = "RULE_KEEPMONEYBETWEENSTAGES_CHOICE_ON_DESC";
            ruleDef3.AddChoice("Off", 0, true).tooltipBodyToken = "RULE_KEEPMONEYBETWEENSTAGES_CHOICE_OFF_DESC";
            ruleDef3.MakeNewestChoiceDefault();
            RuleCatalog.AddRule(ruleDef3);
            for (var k = 0; k < RuleCatalog.allRuleDefs.Count; k++)
            {
                var ruleDef4 = RuleCatalog.allRuleDefs[k];
                ruleDef4.globalIndex = k;
                for (var j = 0; j < ruleDef4.choices.Count; j++)
                {
                    var ruleChoiceDef6 = ruleDef4.choices[j];
                    ruleChoiceDef6.localIndex  = j;
                    ruleChoiceDef6.globalIndex = RuleCatalog.allChoicesDefs.Count;
                    RuleCatalog.allChoicesDefs.Add(ruleChoiceDef6);
                }
            }

            RuleCatalog.availability.MakeAvailable();
        }