示例#1
0
        /// <summary>计算伙伴技能加成战力</summary>
        public static float GetPartnerSkillPowerPer(LTPartnerData partnerData)
        {
            float         skillPer        = 0;
            SkillTemplate commonSkillTem  = SkillTemplateManager.Instance.GetTemplateWithAwake(partnerData, partnerData.HeroStat.common_skill);
            SkillTemplate passiveSkillTem = SkillTemplateManager.Instance.GetTemplateWithAwake(partnerData, partnerData.HeroStat.passive_skill);
            SkillTemplate activeSkillTem  = SkillTemplateManager.Instance.GetTemplateWithAwake(partnerData, partnerData.HeroStat.active_skill);

            skillPer = partnerData.CommonSkillLevel * commonSkillTem.BattleRating +
                       partnerData.PassiveSkillLevel * passiveSkillTem.BattleRating +
                       partnerData.ActiveSkillLevel * activeSkillTem.BattleRating;
            SkillTemplate starskill;

            switch (partnerData.Star)
            {
            case 5:
                starskill = SkillTemplateManager.Instance.GetTemplate(partnerData.HeroStat.starskill5);
                skillPer += starskill.BattleRating;
                break;

            case 6:
                starskill = SkillTemplateManager.Instance.GetTemplate(partnerData.HeroStat.starskill5);
                skillPer += starskill.BattleRating;
                starskill = SkillTemplateManager.Instance.GetTemplate(partnerData.HeroStat.starskill6);
                skillPer += starskill.BattleRating;
                break;

            default:
                break;
            }
            return(skillPer);
        }
示例#2
0
        public Hashtable GetSkillInfo(int skill_id)
        {
            SkillTemplate data = GetTemplate(skill_id);

            return(new Hashtable()
            {
                { "skillType", data.Type }, { "moveName", data.MoveName }
            });
        }
示例#3
0
        public int GetSkillType(int skill_id)
        {
            int           type = 0;
            SkillTemplate data = GetTemplate(skill_id);

            if (data != null)
            {
                type = (int)data.Type;
            }
            else
            {
                Debug.LogError("没有找到对应的skill_id:{0}", skill_id);
            }
            return(type);
        }
示例#4
0
        public Hashtable GetTemplateEx(int skill_id)
        {
            SkillTemplate data = GetTemplate(skill_id);

            return(new Hashtable()
            {
                { "moveName", data.MoveName },
                { "doubleHitCount", data.DoubleHitCount },
                { "actionPosition", data.ActionPosition },
                { "targetPosition", data.TargetPosition },
                { "id", data.ID },
                { "fadeEnvironment", data.FadeEnvironment },
                { "targetDistance", data.TargetDistance },
                { "ignoreCollide", data.IgnoreCollide },
                { "hideOthers", data.HideOthers }
            });
        }
示例#5
0
        //其他人技能显示觉醒替换
        public SkillTemplate GetTemplateWithAwake(int infoId, int skill_id, int awakelevel, Action action = null)
        {
            SkillTemplate skillTemplate = null;

            if (skill_id <= 0)
            {
                return(null);
            }
            if (!m_skillDataDictionary.TryGetValue(skill_id, out skillTemplate))
            {
                return(null);
                //skillTemplate= m_skillDataDictionary[skill_id];
            }
            HeroAwakeInfoTemplate curAwakenTemplate = CharacterTemplateManager.Instance.GetHeroAwakeInfoByInfoID(infoId);

            if (awakelevel > 0 && skill_id == curAwakenTemplate.beforeSkill)
            {
                skillTemplate = Instance.GetTemplate(curAwakenTemplate.laterSkill);
                action?.Invoke();
            }
            // EB.Debug.LogWarning("GetTemplate: skill not found, id = {0}", skill_id);
            return(skillTemplate);
        }
示例#6
0
        /// <summary>计算技能及装备套装加成的战力</summary>
        public static float GetOtherCombatPower(LTAttributesData attr, int[] _skill, int[] skill_level, List <int> ECid, int infoId, int star, int awakenlevel)
        {
            SkillTemplate commonSkillTem  = SkillTemplateManager.Instance.GetTemplateWithAwake(infoId, _skill[0], awakenlevel);
            SkillTemplate passiveSkillTem = SkillTemplateManager.Instance.GetTemplateWithAwake(infoId, _skill[1], awakenlevel);
            SkillTemplate activeSkillTem  = SkillTemplateManager.Instance.GetTemplateWithAwake(infoId, _skill[2], awakenlevel);
            float         skillPer        = skill_level[0] * commonSkillTem.BattleRating +
                                            skill_level[1] * passiveSkillTem.BattleRating +
                                            skill_level[2] * activeSkillTem.BattleRating;
            int           skillid;
            SkillTemplate skilltemp;

            switch (star)
            {
            case 5:
                skillid   = CharacterTemplateManager.Instance.GetHeroStatByInfoId(infoId).starskill5;
                skilltemp = SkillTemplateManager.Instance.GetTemplate(skillid);
                skillPer += skilltemp.BattleRating;
                break;

            case 6:
                skillid   = CharacterTemplateManager.Instance.GetHeroStatByInfoId(infoId).starskill5;
                skilltemp = SkillTemplateManager.Instance.GetTemplate(skillid);
                skillPer += skilltemp.BattleRating;
                skillid   = CharacterTemplateManager.Instance.GetHeroStatByInfoId(infoId).starskill6;
                skilltemp = SkillTemplateManager.Instance.GetTemplate(skillid);
                skillPer += skilltemp.BattleRating;
                break;

            default:
                break;
            }

            skillPer += GetEquipSuitPer(ECid);
            float power = attr.Power() * (1 + attr.PowerPer()) * (1 + skillPer);

            return(power);
        }
示例#7
0
        void ShowInfo(string type, string id)
        {
            if (type == LTShowItemType.TYPE_RES || type == LTShowItemType.TYPE_HEROMEDAL || type == LTShowItemType.TYPE_ACTICKET || type == LTShowItemType.TYPE_VIPPOINT)
            {
                int resNum = BalanceResourceUtil.GetResValue(id);

                ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_RES, true);
                HaveNumLabel.text   = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), resNum);
                int resIdInEconemy = BalanceResourceUtil.GetResID(id);
                Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(resIdInEconemy);
                if (itemInfo != null)
                {
                    DescTextLabel.text = itemInfo.Desc;
                }
                else
                {
                    DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC");
                }
            }
            else if (type == LTShowItemType.TYPE_HEROSHARD)
            {
                int num = GameItemUtil.GetInventoryItemNum(id);

                ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_HEROSHARD, true);
                HaveNumLabel.text   = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), num);
                Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id);
                if (itemInfo != null)
                {
                    DescTextLabel.text = itemInfo.Desc;
                }
                else
                {
                    DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC");
                }
            }
            else if (type == LTShowItemType.TYPE_HEADFRAME)
            {
                ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_HEADFRAME);
                HaveNumLabel.text   = string.Format(string.Empty);
                var data = EconemyTemplateManager.Instance.GetHeadFrame(id, 1);
                DescTextLabel.text = data.desc;
            }
            else if (type == LTShowItemType.TYPE_SCROLL)
            {
                ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_SCROLL);
                HaveNumLabel.text   = string.Empty;
                Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(id));
                DescTextLabel.text = skillTpl.Description;
            }
            else
            {
                int num = GameItemUtil.GetInventoryItemNum(id);
                //运营活动的脚印数量不存背包,数量要特殊获取
                if (type == LTShowItemType.TYPE_ACTIVITY)
                {
                    if (id.Equals("2005"))
                    {
                        id = "2012";
                    }
                    DataLookupsCache.Instance.SearchDataByID("tl_acs." + id + ".current", out num);
                }

                ShowItem.LTItemData = new LTShowItemData(id, 1, type, true);
                HaveNumLabel.text   = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), num);
                Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id);
                if (itemInfo != null)
                {
                    DescTextLabel.text = itemInfo.Desc;
                }
                else
                {
                    DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC");
                }
            }
        }
示例#8
0
        private SkillTemplate ParseTemplate(GM.DataCache.SkillTemplate skill)
        {
            SkillTemplate skill_data = new SkillTemplate();

            skill_data.ID = skill.Id;
            using (ZString.Block())
            {
                ZString strID = ZString.Format("ID_combat_skills_{0}_name", skill_data.ID);
                skill_data.Name = EB.Localizer.GetTableString(strID, skill.Name);;                 //skill.Name;

                strID = ZString.Format("ID_combat_skills_{0}_description", skill_data.ID);
                skill_data.Description = EB.Localizer.GetTableString(strID, skill.Description);;                 //skill.Description;
            }

            skill_data.Icon             = skill.Icon;
            skill_data.Type             = (eSkillType)(skill.SkillType);
            skill_data.SelectTargetType = (eSkillSelectTargetType)skill.Target;
            skill_data.SPCost           = skill.SPCost;
            skill_data.MaxCooldown      = skill.CooldownTurnNum;
            string move = skill.Action ?? string.Empty;

            if (!move.Equals(string.Empty))
            {
                StringView view = new StringView(move);
                var        list = view.Split2List('.');
                if (list.Count == 1)
                {
                    move = "Moves." + move;
                }
                list = null;
            }
            else
            {
                move = "Moves.";
            }

            skill_data.AnimatorStateFullPathName = move;
            int action_position = skill.SkillPosition;

            switch (action_position)
            {
            case 0:
                skill_data.ActionPosition = MoveEditor.Move.eSkillActionPositionType.ORIGINAL;
                skill_data.TargetPosition = MoveEditor.Move.eSkillTargetPositionType.SELECT_TARGET_OR_FIRST_TARGET;
                break;

            case 1:
                skill_data.ActionPosition = MoveEditor.Move.eSkillActionPositionType.MIDPOINT;
                skill_data.TargetPosition = MoveEditor.Move.eSkillTargetPositionType.SELECT_TARGET_OR_FIRST_TARGET;
                break;

            case 2:
                skill_data.ActionPosition = MoveEditor.Move.eSkillActionPositionType.TARGET;
                skill_data.TargetPosition = MoveEditor.Move.eSkillTargetPositionType.SELECT_TARGET_OR_FIRST_TARGET;
                break;

            case 3:
                skill_data.ActionPosition = MoveEditor.Move.eSkillActionPositionType.TARGET;
                skill_data.TargetPosition = MoveEditor.Move.eSkillTargetPositionType.TARGETS;
                break;

            case 4:
                skill_data.ActionPosition = MoveEditor.Move.eSkillActionPositionType.MIDLINE;
                skill_data.TargetPosition = MoveEditor.Move.eSkillTargetPositionType.SELECT_TARGET_OR_FIRST_TARGET;
                break;

            case 5:
                skill_data.ActionPosition = MoveEditor.Move.eSkillActionPositionType.MIDPOINT;
                skill_data.TargetPosition = MoveEditor.Move.eSkillTargetPositionType.TARGETS;
                break;

            default:
                skill_data.ActionPosition = MoveEditor.Move.eSkillActionPositionType.ORIGINAL;
                skill_data.TargetPosition = MoveEditor.Move.eSkillTargetPositionType.SELECT_TARGET_OR_FIRST_TARGET;
                break;
            }
            skill_data.TargetDistance  = skill.TargetDistance / 100.0f;
            skill_data.IgnoreCollide   = true;
            skill_data.HideOthers      = skill.HideOthers;
            skill_data.FadeEnvironment = (eEnvironmentHideType)skill.FadeEnvironment;
            skill_data.BattleRating    = skill.BattleRating;
            if (!string.IsNullOrEmpty(skill.BuffDescribleId))
            {
                skill_data.BuffDescribleID = new List <int>();
                StringView view = new StringView(skill.BuffDescribleId);
                var        ids  = view.Split2List(',');
                for (int i = 0; i < ids.Count; i++)
                {
                    int buffid = 0;
                    int.TryParse(ids[i].ToString(), out buffid);
                    if (buffid != 0)
                    {
                        skill_data.BuffDescribleID.Add(buffid);
                    }
                }
            }
            return(skill_data);
        }
示例#9
0
        public bool IsComBo(int skill_id)
        {
            SkillTemplate skill_data = GetTemplate(skill_id);

            return(skill_data.Type == Hotfix_LT.Data.eSkillType.COMBO);
        }
示例#10
0
        public int GetMaxCooldown(int skill_id)
        {
            SkillTemplate data = GetTemplate(skill_id);

            return(data.MaxCooldown);
        }
示例#11
0
        public string GetSkillIcon(int skill_id)
        {
            SkillTemplate data = GetTemplate(skill_id);

            return(data.Icon);
        }