예제 #1
0
 private void salvageAdd_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(boostLetter.Text) && salvageList.SelectedItem != null)
     {
         Salvage s = (Salvage)salvageList.SelectedItem;
         AddSalvageToTree(s, salvageTree.Nodes[(int)s.level]);
     }
 }
예제 #2
0
        private void AddSalvageToTree(Salvage s, TreeNode node)
        {
            TreeNode n = new TreeNode(s.displayName);

            n.Name = s.name;
            if (s.rarity > Salvage.Rarity.Common)
            {
                n.BackColor = (s.rarity == Salvage.Rarity.Uncommon) ? Color.Yellow : Color.Orange;
            }
            node.Nodes.Add(n);
            UpdateSalvageList(node);
            node.Expand();
        }
예제 #3
0
        public string GetDropRecipe(List <int> craftingCost, List <Salvage> salvageList)
        {
            string s = String.Empty;

            foreach (Boost boost in boostList)
            {
                for (int level = minLevel; level <= maxLevel; level++)
                {
                    s += "DetailRecipe " + boost.name + "_" + level + Environment.NewLine;
                    s += "{" + Environment.NewLine;
                    s += "\tDisplayName \"" + PString(displayName + ": " + boost.displayName + " (Recipe)") + "\"" + Environment.NewLine;
                    s += "\tDisplayHelp \"" + PString("This recipe builds the " + displayName + ": " + boost.displayName + " Enhancement") + "\"" + Environment.NewLine;
                    s += "\tDisplayTabName \"P1273912828\"" + Environment.NewLine;
                    s += "\tType Drop" + Environment.NewLine;
                    s += "\tWorkshop Worktable_Invention" + Environment.NewLine;
                    s += "\tEnhancementReward Boosts.Crafted_" + boost.name + ".Crafted_" + boost.name + Environment.NewLine;
                    s += "\tIcon " + iconName + Environment.NewLine;
                    s += "\tLevel " + level + Environment.NewLine;
                    s += "\tRarity " + rarity + Environment.NewLine;
                    s += "\tMaxInvAmount 100" + Environment.NewLine;
                    s += "\tNumUses 1" + Environment.NewLine;
                    s += "\tCreationCost " + craftingCost[level - 1] + Environment.NewLine;
                    s += "\tSellToVendor " + (level * 200) + Environment.NewLine;
                    s += "\tCreatesEnhancement 1" + Environment.NewLine;
                    if (boost.salvage != null)
                    {
                        s += Environment.NewLine;
                        foreach (string sid in boost.salvage)
                        {
                            Salvage salvage = salvageList.Find(x => x.name.Equals(sid));
                            if (salvage.level == Salvage.Level.Low && level < 26)
                            {
                                s += "\tSalvageComponent 1 " + sid + Environment.NewLine;
                            }
                            else if (salvage.level == Salvage.Level.Mid && level > 25 && level < 41)
                            {
                                s += "\tSalvageComponent 1 " + sid + Environment.NewLine;
                            }
                            else if (salvage.level == Salvage.Level.High && level > 40)
                            {
                                s += "\tSalvageComponent 1 " + sid + Environment.NewLine;
                            }
                        }
                    }
                    s += "}" + Environment.NewLine + Environment.NewLine;
                }
            }
            return(s);
        }
예제 #4
0
        private void UpdateSalvageTree(Boost boost)
        {
            List <TreeNode> lvlNodes = new List <TreeNode>();

            lvlNodes.Add(new TreeNode("Low Level (10-25)"));
            lvlNodes.Add(new TreeNode("Mid Level (26-40)"));
            lvlNodes.Add(new TreeNode("High Level (41-50)"));

            if (boost.salvage != null)
            {
                foreach (string sid in boost.salvage)
                {
                    Salvage s = salvage.Find(x => x.name.Equals(sid));
                    AddSalvageToTree(s, lvlNodes[(int)s.level]);
                }
            }

            salvageTree.Nodes.Clear();
            foreach (TreeNode node in lvlNodes)
            {
                salvageTree.Nodes.Add(node);
            }
            salvageList.Items.Clear();
        }