public void SetRune(RuneOptim.swar.Rune rune)
        {
            Tag = rune;
            if (rune == null)
            {
                _imageSlot = null;
                Refresh();
                return;
            }

            grade = rune.Grade;

            _imageSlot = runeSlotImages[rune.Slot];
            _imageSet  = runeSetImages[rune.Set];

            _imageBack = runeRarityImages[rune.Rarity];
            coolness   = rune.Rarity;

            _imageStars = Resources.Runes.star_unawakened;
            if (rune.Level == 15)
            {
                _imageStars = Resources.Runes.star_awakened;
            }

            Refresh();
        }
Esempio n. 2
0
            private double calcSort(RuneOptim.swar.Rune r)
            {
                if (r == null)
                {
                    return(0);
                }
                Monster m = null;

                if (!r.ManageStats.GetOrAdd("Mon", 0).EqualTo(0))
                {
                    m = Program.Data.GetMonster((ulong)r.ManageStats["Mon"]);
                }

                Build b = null;

                if (m != null)
                {
                    b = Program.Builds.FirstOrDefault(bu => bu.Mon == m);
                }
                double ret = r.ManageStats?.GetOrAdd("bestBuildPercent", 0) ?? 0;

                ret *= r.BarionEfficiency;
                ret /= (b?.Priority ?? 0 + 100);
                ret *= 1 + Math.Sqrt(r.ManageStats.GetOrAdd("LoadFilt", 0) / (r.ManageStats.GetOrAdd("LoadGen", 0) + 1000));
                ret *= 10000;

                return(ret);
            }
Esempio n. 3
0
            public static ServedResult renderRune(RuneOptim.swar.Rune r, bool forceExpand = false)
            {
                if (r == null)
                {
                    return("");
                }
                var ret = new ServedResult("div")
                {
                    contentDic = { { "class", "\"rune-box\"" } }
                };

                string trashId = r.Id.ToString() + "_" + rand.Next();

                var mainspan = new ServedResult("span")
                {
                    contentList =
                    {
                        new ServedResult("a")
                        {
                            contentDic =
                            {
                                { "href", "\"javascript:showhide('" + trashId + "')\"" }
                            },
                            contentList ={ "+" }
                        },
                        " " + " " + r.Main.Value + " " + r.Main.Type + " +" + r.Level + " (" + r.ManageStats?.GetOrAdd("bestBuildPercent", 0).ToString("0.##") + ")"
                    }
                };

                // colour name base on level
                switch (r.Level / 3)
                {
                case 5:
                case 4:
                    mainspan.contentDic.Add("style", "\"color: darkorange\"");
                    break;

                case 3:
                    mainspan.contentDic.Add("style", "\"color: purple\"");
                    break;

                case 2:
                    mainspan.contentDic.Add("style", "\"color: cornflourblue\"");
                    break;

                case 1:
                    mainspan.contentDic.Add("style", "\"color: limegreen\"");
                    break;
                }
                // show the proper background
                var runebackName = "normal";

                switch (r.Rarity)
                {
                case 4:
                    runebackName = "legend";
                    break;

                case 3:
                    runebackName = "hero";
                    break;

                case 2:
                    runebackName = "rare";
                    break;

                case 1:
                    runebackName = "magic";
                    break;
                }

                ret.contentList.Add(mainspan);
                var hidediv = new ServedResult("div")
                {
                    contentDic = { { "id", '"' + trashId + '"' }, { "class", '"' + $"rune-details stars-{r.Grade} rarity-{r.Rarity} level-{r.Level} slot-{r.Slot}" + '"' } }
                };

                if (!forceExpand && (r.Level == 15 || (r.Slot % 2 == 1 && r.Level >= 12)))
                {
                    hidediv.contentDic.Add("style", "\"display:none\"");
                }
                //hidediv.contentList.Add("<img src=\"/runes/" + r.Set.ToString() + ".png\" style=\"position:relative;left:1em;height:2em;\" />");
                //hidediv.contentList.Add("<img src=\"/runes/rune" + r.Slot.ToString() + ".png\" style=\"z-index:-1;position:relative;left:-2em;\" />");



                hidediv.contentList.Add(
                    new ServedResult("div")
                {
                    contentDic  = { { "class", "\"rune-icon rune-icon-back rune-back " + runebackName + "\"" }, },
                    contentList =
                    {
                        new ServedResult("div")
                        {
                            contentDic ={                  { "class", "\"rune-icon rune-icon-body rune-body rune-slot" + r.Slot + "\"" }, }, contentList =
                            {
                                new ServedResult("div")
                                {
                                    contentDic ={                  { "class", "\"rune-icon rune-icon-set rune-set " + r.Set + "\""             }, }, contentList ={ " " }
                                }
                            }
                        }
                    }
                });

                var propdiv = new ServedResult("div")
                {
                    contentDic = { { "class", "\"rune-box-right\"" } }
                };

                if (r.Innate != null && r.Innate.Type > RuneOptim.swar.Attr.Null)
                {
                    propdiv.contentList.Add(new ServedResult("div")
                    {
                        contentDic  = { { "class", "\"rune-prop rune-sub rune-innate\"" } },
                        contentList = { "+" + r.Innate.Type + " " + r.Innate.Value }
                    });
                }
                propdiv.contentList.Add(new ServedResult("div")
                {
                    contentDic  = { { "class", "\"monster-name rune-prop rune-monster-name\"" } },
                    contentList = { new ServedResult("a")
                                    {
                                        contentDic ={                  { "href", "\"monsters/" + r.AssignedName + "\"" } }, contentList = { r.AssignedName }
                                    } }
                });
                hidediv.contentList.Add(propdiv);
                hidediv.contentList.Add("<br/>");
                for (int i = 0; i < 4; i++)
                {
                    if (r.Subs == null || r.Subs.Count <= i || r.Subs[i].Type <= Attr.Null)
                    {
                        continue;
                    }
                    var s = r.Subs[i];
                    hidediv.contentList.Add(new ServedResult("span")
                    {
                        contentDic  = { { "class", "\"rune-prop rune-sub rune-sub" + i + "\"" } },
                        contentList = { "+" + s.Value + " " + s.Type }
                    });
                    hidediv.contentList.Add(new ServedResult("br"));
                }
                ret.contentList.Add(hidediv);
                return(ret);
            }
Esempio n. 4
0
 public RuneProxy(Rune r)
 {
     _r = r;
 }