Example #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();
        }
Example #2
0
 public static void Patch_DisplayBuffId(WGAbilityInfo __instance, BufferInfo info)
 {
     if (DebugOn.Value)
     {
         BuffFileId.Value = info.BufferId;
         AppendInfoAndDisplay(__instance, string.Format("BuffID=[{0}]", info.BufferId));
     }
 }
Example #3
0
 public static void Patch_DisplayPropsBuffId(WGAbilityInfo __instance, Props props)
 {
     if (DebugOn.Value)
     {
         if (props.BuffList != null && props.BuffList.Count > 0)
         {
             var bs = from b in props.BuffList select b;
             AppendInfoAndDisplay(__instance, string.Format("Buffs=[{0}]", string.Join(",", bs)));
         }
     }
 }
        public static void OnElementHoverPatch_nonbattleChangeElement(ref UIAttributeList __instance)
        {
            Heluo.Logger.LogError("OnElementHoverPatch_nonbattleChangeElement start");

            if (!GameGlobal.IsInBattle)
            {
                WGAbilityInfo abilityInfo = __instance.abilityInfo;
                abilityInfo.gameObject.SetActive(false);
            }
            Heluo.Logger.LogError("OnElementHoverPatch_nonbattleChangeElement end");
        }
Example #5
0
        public static void Patch_DisplayMantraBuffId(WGAbilityInfo __instance, MantraData data)
        {
            if (DebugOn.Value)
            {
                if (data.Item.BufferEffects != null && data.Item.BufferEffects.Count > 0)
                {
                    var bs = from b in data.Item.BufferEffects select string.Format("{0}:[{1}]", b.MartraLevel, b.BufferId);

                    AppendInfoAndDisplay(__instance, string.Format("Buffs={0}", string.Join(",", bs)));
                }
            }
        }
Example #6
0
 public static void Patch_DisplaySkillBuffId(WGAbilityInfo __instance, SkillData skill)
 {
     if (DebugOn.Value)
     {
         string s = "";
         if (skill.Item.SelfBuffList != null && skill.Item.SelfBuffList.Count > 0)
         {
             var bs = from b in skill.Item.SelfBuffList select b;
             s += string.Format("SelfBuffs=[{0}]\n", string.Join(",", bs));
         }
         if (skill.Item.TargetBuffList != null && skill.Item.TargetBuffList.Count > 0)
         {
             var bs = from b in skill.Item.TargetBuffList select b;
             s += string.Format("TargetBuffs=[{0}]", string.Join(",", bs));
         }
         if (!string.IsNullOrEmpty(s))
         {
             AppendInfoAndDisplay(__instance, s);
         }
     }
 }
Example #7
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);
        }