Ejemplo n.º 1
0
        // 显示BuffInfo
        static void AppendInfoAndDisplay(WGAbilityInfo __instance, string str)
        {
            var t = Traverse.Create(__instance);

            t.Field("infos").Method("Add", __instance.CreateTipInfo(WGTip.TipType.Context, str, "")).GetValue();
            t.Field("ability_tip").Method("ShowTip", new Type[] { typeof(List <TipInfo>) }, new object[] { t.Field("infos").GetValue() }).GetValue();
        }
Ejemplo n.º 2
0
        public static bool SkillExpPatch_UI(ref WGAbilityInfo __instance, SkillData skill)
        {
            if (skill == null || skill.Item == null)
            {
                return(true);
            }
            __instance.gameObject.SetActive(true);
            var infos = Traverse.Create(__instance).Field("infos").GetValue <List <TipInfo> >();
            var unit  = Traverse.Create(__instance).Field("unit").GetValue <WuxiaUnit>();

            infos.Clear();
            infos.Add(__instance.CreateTipInfo(WGTip.TipType.VeryBigTitle, skill.Item.Name, ""));
            // +
            if (skill.Item.RequireValue > 0 && skillExpInBattle.Value)
            {
                string title = string.Format("Lv.{0} {1}/{2}", skill.Level, skill.Exp, skillMaxLevel.Value);
                if (skill.Level == skill.MaxLevel)
                {
                    title = "Lv.Max";
                }
                infos.Add(__instance.CreateTipInfo(WGTip.TipType.Title, title, ""));
            }
            string text = Game.Data.Get <StringTable>("SecondaryInterface1401").Text;

            infos.Add(__instance.CreateTipInfo(WGTip.TipType.TitleImportantValue, text, skill.Item.RequestMP.ToString()));
            string text2 = Game.Data.Get <StringTable>("SecondaryInterface1402").Text;
            string value = skill.GetPredictionDamage(unit.GetFormulaProperty(), unit.info, 0, unit).ToString();

            infos.Add(__instance.CreateTipInfo(WGTip.TipType.TitleValue, text2, value));
            string text3  = Game.Data.Get <StringTable>("SecondaryInterface1403").Text;
            string value2 = string.Empty;

            if (skill.Item.MinRange == 0 && skill.Item.MaxRange == 0)
            {
                value2 = Game.Data.Get <StringTable>("SecondaryInterface0706").Text;
            }
            else
            {
                value2 = skill.Item.MinRange + " - " + skill.Item.MaxRange;
            }
            infos.Add(__instance.CreateTipInfo(WGTip.TipType.TitleValue, text3, value2));
            string text4 = string.Empty;

            switch (skill.Item.TargetArea)
            {
            case TargetArea.Line:
            case TargetArea.LineCharge:
                text4 = Game.Data.Get <StringTable>("SecondaryInterface0702").Text;
                break;

            case TargetArea.Fan:
                text4 = Game.Data.Get <StringTable>("SecondaryInterface0703").Text;
                break;

            case TargetArea.Ring:
                if (skill.Item.AOE > 0)
                {
                    text4 = Game.Data.Get <StringTable>("SecondaryInterface0705").Text;
                    text4 = string.Format(text4, skill.Item.AOE);
                }
                else
                {
                    text4 = Game.Data.Get <StringTable>("SecondaryInterface0701").Text;
                }
                break;

            case TargetArea.RingGroup:
                text4 = Game.Data.Get <StringTable>("SecondaryInterface0704").Text;
                break;

            case TargetArea.LineGroup:
                text4 = Game.Data.Get <StringTable>("SecondaryInterface0708").Text;
                break;
            }
            string text5 = Game.Data.Get <StringTable>("SecondaryInterface1404").Text;

            infos.Add(__instance.CreateTipInfo(WGTip.TipType.TitleValue, text5, text4));
            string text6 = Game.Data.Get <StringTable>("SecondaryInterface1405").Text;

            infos.Add(__instance.CreateTipInfo(WGTip.TipType.TitleValue, text6, skill.MaxCD.ToString()));
            string text7 = Game.Data.Get <StringTable>("SecondaryInterface1406").Text;

            infos.Add(__instance.CreateTipInfo(WGTip.TipType.Title, text7, ""));
            infos.Add(__instance.CreateTipInfo(WGTip.TipType.Context, skill.Item.Description, ""));
            Traverse.Create(__instance).Field("ability_tip").GetValue <WGTip>().ShowTip(infos);
            return(false);
        }