Пример #1
0
        private void InitUI()
        {
            this.Details.gameObject.SetActive(false);
            SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(this.heroNPC);

            string[] AllSkillName = heroMainData.skill_id.Split(new char[]
            {
                ','
            });
            SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(AllSkillName[0]);
            string         skill_icon    = skillMainData.skill_icon;

            string[] array = skill_icon.Split(new char[]
            {
                '_'
            });
            this.atlas = null;
            this.atlas = Resources.Load <UIAtlas>("Texture/Skiller/" + array[0] + "_" + array[1]);
            if (null == this.atlas)
            {
                return;
            }
            GridHelper.FillGrid <PropViewSkillItem>(this.skillGrid, this.skillItem, 4, delegate(int idx, PropViewSkillItem comp)
            {
                comp.name         = idx.ToString();
                comp.DragCallBack = new Callback <GameObject, bool>(this.ChangeState);
                comp.Init(idx, AllSkillName[idx], this.atlas);
            });
            this.skillGrid.Reposition();
        }
Пример #2
0
 private void BindSkill(string skill, ObserveHeroSkill skillComp)
 {
     try
     {
         SysSkillMainVo skillData   = SkillUtility.GetSkillData(skill, -1, -1);
         string         skill_icon  = skillData.skill_icon;
         Texture        mainTexture = ResourceManager.Load <Texture>(skill_icon, true, true, null, 0, false);
         skillComp.Texture.mainTexture = mainTexture;
         if (skillComp.Level)
         {
             int skillLevel = this._hero.skillManager.GetSkillLevel(skill);
             skillComp.Level.text = skillLevel.ToString();
         }
         float num         = 0f;
         float skillCDTime = this._hero.GetSkillCDTime(skill);
         if (skillCDTime > 0f)
         {
             num = this._hero.GetCDTime(skill) / skillCDTime;
         }
         skillComp.Mask.fillAmount = num;
         this.SetMaskEnableStatus(skillComp.Mask, num);
     }
     catch (Exception e)
     {
         ClientLogger.LogException(e);
     }
 }
Пример #3
0
        private void OnPassiveItemChanged(BuffItem item, int dataIndex)
        {
            string         text      = this.passive_skills[dataIndex];
            SysSkillMainVo skillData = SkillUtility.GetSkillData(text, -1, -1);

            item.name = text;
            item.SetTexture(skillData.skill_icon);
        }
Пример #4
0
    public static SysSkillMainVo GetSkillData(string skillID, int level = -1, int skin = -1)
    {
        SysSkillMainVo    skillMainData    = BaseDataMgr.instance.GetSkillMainData(skillID);
        SysSkillLevelupVo skillLevelupData = SkillUtility.GetSkillLevelupData(skillID, level);
        SysSkillSkinVo    skillSkinData    = SkillUtility.GetSkillSkinData(skillID, skin);

        return(SkillUtility.GetSkillData(skillMainData, skillLevelupData, skillSkinData));
    }
Пример #5
0
    public void ShowSKill(string str)
    {
        SysSummonersSkillVo dataById      = BaseDataMgr.instance.GetDataById <SysSummonersSkillVo>(str);
        SysSkillMainVo      skillMainData = BaseDataMgr.instance.GetSkillMainData(dataById.skill_id);

        this.texture.mainTexture = ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false);
        this.texture.depth       = 2;
    }
        public void Init(int idx, string idxName, UIAtlas atlas)
        {
            this.skillIndex            = idx + SkillIndex._1st;
            this.skillFrame.spriteName = "Hero_skill_frame";
            SysSkillMainVo skillData = SkillUtility.GetSkillData(idxName, -1, -1);

            this.skillPic.atlas      = atlas;
            this.skillPic.spriteName = skillData.skill_icon;
            UIEventListener.Get(this.skillFrame.gameObject).onMobileHover = new UIEventListener.BoolDelegate(this.CheckState);
        }
Пример #7
0
    public static int GetSkillLevelMax(string skillID)
    {
        SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(skillID);

        if (skillMainData != null)
        {
            return(skillMainData.skill_levelmax);
        }
        return(0);
    }
Пример #8
0
 public SkillData(string skill_id)
 {
     this.skillId = skill_id;
     this.config  = SkillUtility.GetSkillData(this.skillId, -1, -1);
     if (this.config == null)
     {
         return;
     }
     this.Parse(this.config);
 }
Пример #9
0
 private void UpdateSkills()
 {
     for (int i = 0; i < this.mSkillIds.Count; i++)
     {
         SysSkillMainVo skillData = SkillUtility.GetSkillData(this.mSkillIds[i], -1, -1);
         UITexture      component = this.SkillIcons.GetChild(i).GetComponent <UITexture>();
         component.name = this.mSkillIds[i];
         string  skill_icon  = skillData.skill_icon;
         Texture mainTexture = ResourceManager.Load <Texture>(skill_icon, true, true, null, 0, false);
         component.mainTexture = mainTexture;
     }
 }
Пример #10
0
        public SkillData(string skill_id, int level, int skin)
        {
            SysSkillMainVo skillData = SkillUtility.GetSkillData(skill_id, level, skin);

            this.skillId = skill_id;
            this.config  = skillData;
            if (this.config == null)
            {
                return;
            }
            this.Parse(this.config);
        }
Пример #11
0
    private void RefreshUI_summonerSkill()
    {
        string skillID = this.heroShowInfo.SkillID;
        bool   flag    = !string.IsNullOrEmpty(skillID);

        this.com_selectHeroSkillItem.gameObject.SetActive(flag);
        if (flag)
        {
            SysSummonersSkillVo dataById      = BaseDataMgr.instance.GetDataById <SysSummonersSkillVo>(skillID);
            SysSkillMainVo      skillMainData = BaseDataMgr.instance.GetSkillMainData(dataById.skill_id);
            this.SkillTexture.mainTexture = ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false);
        }
    }
Пример #12
0
 private static SysSkillMainVo CopySkillData(ref SysSkillMainVo baseData)
 {
     return(new SysSkillMainVo
     {
         unikey = baseData.unikey,
         skill_id = baseData.skill_id,
         skill_name = baseData.skill_name,
         skill_description = baseData.skill_description,
         skill_description2 = baseData.skill_description2,
         skill_description3 = baseData.skill_description3,
         skill_icon = baseData.skill_icon,
         skill_index = baseData.skill_index,
         skill_type = baseData.skill_type,
         skill_logic_type = baseData.skill_logic_type,
         skill_trigger = baseData.skill_trigger,
         skill_prop = baseData.skill_prop,
         distance = baseData.distance,
         target_type = baseData.target_type,
         effective_range = baseData.effective_range,
         max_num = baseData.max_num,
         need_target = baseData.need_target,
         sing_time = baseData.sing_time,
         guide_time = baseData.guide_time,
         interrupt = baseData.interrupt,
         cost = baseData.cost,
         cost_upgrade = baseData.cost_upgrade,
         skill_phase = baseData.skill_phase,
         skill_interval = baseData.skill_interval,
         cd = baseData.cd,
         cd_upgrade = baseData.cd_upgrade,
         hard_cd = baseData.hard_cd,
         skill_mutex = baseData.skill_mutex,
         ready_action_ids = baseData.ready_action_ids,
         start_action_ids = baseData.start_action_ids,
         hit_action_ids = baseData.hit_action_ids,
         end_action_ids = baseData.end_action_ids,
         init_higheff_ids = baseData.init_higheff_ids,
         start_higheff_ids = baseData.start_higheff_ids,
         hit_higheff_ids = baseData.hit_higheff_ids,
         start_buff_ids = baseData.start_buff_ids,
         hit_buff_ids = baseData.hit_buff_ids,
         hit_trigger_type = baseData.hit_trigger_type,
         hit_time = baseData.hit_time,
         damage_id = baseData.damage_id,
         skill_levelmax = baseData.skill_levelmax,
         skill_unique = baseData.skill_unique,
         is_autoattackseltarget_onskillend = baseData.is_autoattackseltarget_onskillend,
         ConjureRangetype = baseData.ConjureRangetype,
         SkillExtraParam = baseData.SkillExtraParam
     });
 }
Пример #13
0
        private List <SkillDataItem> GetSummonerSkillList()
        {
            List <SkillDataItem>        list      = new List <SkillDataItem>();
            Dictionary <string, object> dicByType = BaseDataMgr.instance.GetDicByType <SysSummonersSkillVo>();
            int userLevel = CharacterDataMgr.instance.GetUserLevel(ModelManager.Instance.Get_userData_filed_X("Exp"));

            for (int i = 0; i < dicByType.Keys.Count; i++)
            {
                SysSummonersSkillVo dataById      = BaseDataMgr.instance.GetDataById <SysSummonersSkillVo>(dicByType.Keys.ElementAt(i));
                SysSkillMainVo      skillMainData = BaseDataMgr.instance.GetSkillMainData(dataById.skill_id);
                SkillDataItem       item          = new SkillDataItem(dataById.id.ToString(), userLevel, dataById.level_limit, LanguageManager.Instance.GetStringById(skillMainData.skill_name), ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false));
                list.Add(item);
            }
            return(list);
        }
Пример #14
0
    public static SysSkillMainVo GetSkillData(SysSkillMainVo mainVo, SysSkillLevelupVo levelupVo, SysSkillSkinVo skinVo)
    {
        if (mainVo == null)
        {
            return(null);
        }
        SysSkillMainVo result = SkillUtility.CopySkillData(ref mainVo);

        if (levelupVo != null)
        {
            SkillUtility.LevelUpImpact(ref result, ref levelupVo);
        }
        if (skinVo != null)
        {
            SkillUtility.SkinImpact(ref result, ref skinVo);
        }
        return(result);
    }
Пример #15
0
    private void RefreshUI_summonerSkill()
    {
        ReadyPlayerSampleInfo memInfo = this.MemInfo;

        this.sp_summonerSkill.gameObject.SetActive(false);
        if (!string.IsNullOrEmpty(memInfo.selfDefSkillId))
        {
            SysSummonersSkillVo dataById = BaseDataMgr.instance.GetDataById <SysSummonersSkillVo>(memInfo.selfDefSkillId);
            if (dataById != null)
            {
                SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(dataById.skill_id);
                if (skillMainData != null)
                {
                    this.sp_summonerSkill.mainTexture = ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false);
                    this.sp_summonerSkill.gameObject.SetActive(true);
                }
            }
        }
    }
        private List <SkillDataItem> GetSkillListData(string battleId)
        {
            List <SkillDataItem> list     = new List <SkillDataItem>();
            SysBattleSceneVo     dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(battleId);
            int userLevel = CharacterDataMgr.instance.GetUserLevel(ModelManager.Instance.Get_userData_filed_X("Exp"));

            string[] array = dataById.summoners_skill.Split(new char[]
            {
                ','
            });
            for (int i = 0; i < array.Length; i++)
            {
                SysSummonersSkillVo dataById2     = BaseDataMgr.instance.GetDataById <SysSummonersSkillVo>(array[i]);
                SysSkillMainVo      skillMainData = BaseDataMgr.instance.GetSkillMainData(dataById2.skill_id);
                SkillDataItem       item          = new SkillDataItem(dataById2.id.ToString(), userLevel, dataById2.level_limit, LanguageManager.Instance.GetStringById(skillMainData.skill_name), ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false));
                list.Add(item);
            }
            return(list);
        }
        public void UpdateSkillStudy()
        {
            Units         player       = PlayerControlMgr.Instance.GetPlayer();
            SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(player.npc_id);

            string[] heroSkills = heroMainData.skill_id.Split(new char[]
            {
                ','
            });
            GridHelper.FillGrid <SkillShowItem>(this.mSkillGird, this.mSkillItem, (heroSkills.Length <= 4) ? heroSkills.Length : 4, delegate(int idx, SkillShowItem comp)
            {
                SysSkillMainVo skillData = SkillUtility.GetSkillData(heroSkills[idx], -1, -1);
                Texture textue           = null;
                string type   = (skillData.skill_trigger != 3) ? "(主动)" : "(被动)";
                string unikey = skillData.skill_id + "_lv0" + ((player.getSkillById(skillData.skill_id).skillLevel != 0) ? player.getSkillById(skillData.skill_id).skillLevel : 1).ToString();
                SysSkillLevelupVo dataById = BaseDataMgr.instance.GetDataById <SysSkillLevelupVo>(unikey);
                comp.Init(textue, skillData.skill_name, type, SkillView.FixSkillTxtInfo(BaseDataMgr.instance.GetLanguageData(dataById.skill_description).content, player), !player.skillManager.IsSkillUnlock(skillData.skill_id), (dataById.cd / (1f + player.GetAttr(AttrType.NormalSkillCooling))).ToString("0.0"));
            });
            this.mSkillGird.Reposition();
        }
Пример #18
0
        private void ChangeSkillText(int index)
        {
            SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(this.heroNPC);

            string[] AllSkillName = heroMainData.skill_id.Split(new char[]
            {
                ','
            });
            SysSkillMainVo skillData = SkillUtility.GetSkillData(AllSkillName[index - 1], -1, -1);

            this.skillName.text        = LanguageManager.Instance.GetStringById(skillData.skill_name);
            this.skillDescription.text = LanguageManager.Instance.GetStringById(skillData.skill_description);
            if (skillData.skill_trigger == 3)
            {
                this.activeSkill.gameObject.SetActive(false);
                this.passiveSkill.gameObject.SetActive(true);
                this.passiveSkill.text = LanguageManager.Instance.GetStringById("HeroAltar_Passive");
            }
            else
            {
                this.activeSkill.gameObject.SetActive(true);
                this.passiveSkill.gameObject.SetActive(false);
                this.DealWithActiveSkill(AllSkillName[index - 1]);
            }
            SysSkillDescVo    dataById  = BaseDataMgr.instance.GetDataById <SysSkillDescVo>(AllSkillName[index - 1] + "_lv01");
            SysSkillLevelupVo dataById2 = BaseDataMgr.instance.GetDataById <SysSkillLevelupVo>(AllSkillName[index - 1] + "_lv01");

            this.Lv4.gameObject.SetActive(4 == dataById2.skill_levelmax);
            for (int num = 0; num != this.skillEffectGrid.transform.childCount; num++)
            {
                this.skillEffectGrid.transform.GetChild(num).gameObject.SetActive(true);
            }
            GridHelper.FillGrid <PropViewSkillEffect>(this.skillEffectGrid, this.skillEffect, (dataById != null) ? dataById.effect_num : 0, delegate(int idx, PropViewSkillEffect comp)
            {
                comp.name = index.ToString();
                comp.Init(AllSkillName[index - 1], idx);
            });
            this.skillEffectGrid.Reposition();
        }
Пример #19
0
        private void ShowSkillData(string skillID)
        {
            SysSummonersSkillVo dataById      = BaseDataMgr.instance.GetDataById <SysSummonersSkillVo>(skillID);
            SysSkillMainVo      skillMainData = BaseDataMgr.instance.GetSkillMainData(dataById.skill_id);

            this.R_Texture.mainTexture = ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false);
            if ("[]" != dataById.display_picture && string.Empty != dataById.display_picture)
            {
                this.R_Performance.mainTexture = ResourceManager.Load <Texture>(dataById.display_picture, true, true, null, 0, false);
            }
            this.R_Name.text = LanguageManager.Instance.GetStringById(skillMainData.skill_name);
            int userLevel = CharacterDataMgr.instance.GetUserLevel(ModelManager.Instance.Get_userData_filed_X("Exp"));

            if (userLevel < dataById.level_limit)
            {
                this.R_Grade.text = "[ff0000]" + LanguageManager.Instance.GetStringById("SummonerSkillUI_NeedSummonerLevel").Replace("*", dataById.level_limit.ToString());
            }
            else
            {
                this.R_Grade.text = "[00ffcc]" + LanguageManager.Instance.GetStringById("SummonerSkillUI_NeedSummonerLevel").Replace("*", dataById.level_limit.ToString());
            }
            this.R_Introduction.text = LanguageManager.Instance.GetStringById(skillMainData.skill_description);
        }
Пример #20
0
    public void InsertData(string skillID, int skin)
    {
        SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(skillID);

        if (skillMainData != null)
        {
            int skill_levelmax = skillMainData.skill_levelmax;
            if (skill_levelmax <= 0)
            {
                this.DoInsert(skillID, 0, skin);
            }
            else
            {
                for (int i = 1; i <= skill_levelmax; i++)
                {
                    this.DoInsert(skillID, i, skin);
                }
            }
        }
        else
        {
            Debug.LogError("没有找到这个技能 error id=" + skillID + " 请检查技能升级表");
        }
    }
Пример #21
0
    public static bool IsSkillPassive(string skillID)
    {
        SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(skillID);

        return(skillMainData != null && skillMainData.skill_trigger == 3);
    }
Пример #22
0
    public static bool IsSkillCanLevelUp(string skillID)
    {
        SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(skillID);

        return(skillMainData != null && skillMainData.skill_levelmax > 0);
    }
Пример #23
0
 private static void SkinImpact(ref SysSkillMainVo baseData, ref SysSkillSkinVo skinData)
 {
     if (!SkillUtility.CheckStringDefault(skinData.skill_name))
     {
         baseData.skill_name = skinData.skill_name;
     }
     if (!SkillUtility.CheckStringDefault(skinData.skill_description))
     {
         baseData.skill_description = skinData.skill_description;
     }
     if (!SkillUtility.CheckStringDefault(skinData.skill_description2))
     {
         baseData.skill_description2 = skinData.skill_description2;
     }
     if (!SkillUtility.CheckStringDefault(skinData.skill_description3))
     {
         baseData.skill_description3 = skinData.skill_description3;
     }
     if (!SkillUtility.CheckStringDefault(skinData.skill_icon))
     {
         baseData.skill_icon = skinData.skill_icon;
     }
     if (!SkillUtility.CheckIntDefault(skinData.skill_index))
     {
         baseData.skill_index = skinData.skill_index;
     }
     if (!SkillUtility.CheckIntDefault(skinData.skill_type))
     {
         baseData.skill_type = skinData.skill_type;
     }
     if (!SkillUtility.CheckIntDefault(skinData.skill_logic_type))
     {
         baseData.skill_logic_type = skinData.skill_logic_type;
     }
     if (!SkillUtility.CheckIntDefault(skinData.skill_trigger))
     {
         baseData.skill_trigger = skinData.skill_trigger;
     }
     if (!SkillUtility.CheckIntDefault(skinData.skill_prop))
     {
         baseData.skill_prop = skinData.skill_prop;
     }
     if (!SkillUtility.CheckFloatDefault(skinData.distance))
     {
         baseData.distance = skinData.distance;
     }
     if (!SkillUtility.CheckStringDefault(skinData.target_type))
     {
         baseData.target_type = skinData.target_type;
     }
     if (!SkillUtility.CheckStringDefault(skinData.effective_range))
     {
         baseData.effective_range = skinData.effective_range;
     }
     if (!SkillUtility.CheckIntDefault(skinData.max_num))
     {
         baseData.max_num = skinData.max_num;
     }
     if (!SkillUtility.CheckStringDefault(skinData.need_target))
     {
         baseData.need_target = skinData.need_target;
     }
     if (!SkillUtility.CheckFloatDefault(skinData.sing_time))
     {
         baseData.sing_time = skinData.sing_time;
     }
     if (!SkillUtility.CheckStringDefault(skinData.guide_time))
     {
         baseData.guide_time = skinData.guide_time;
     }
     if (!SkillUtility.CheckIntDefault(skinData.interrupt))
     {
         baseData.interrupt = skinData.interrupt;
     }
     if (!SkillUtility.CheckStringDefault(skinData.cost))
     {
         baseData.cost = skinData.cost;
     }
     if (!SkillUtility.CheckFloatDefault(skinData.cost_upgrade))
     {
         baseData.cost_upgrade = skinData.cost_upgrade;
     }
     if (!SkillUtility.CheckStringDefault(skinData.skill_phase))
     {
         baseData.skill_phase = skinData.skill_phase;
     }
     if (!SkillUtility.CheckFloatDefault(skinData.skill_interval))
     {
         baseData.skill_interval = skinData.skill_interval;
     }
     if (!SkillUtility.CheckFloatDefault(skinData.cd))
     {
         baseData.cd = skinData.cd;
     }
     if (!SkillUtility.CheckFloatDefault(skinData.cd_upgrade))
     {
         baseData.cd_upgrade = skinData.cd_upgrade;
     }
     if (!SkillUtility.CheckFloatDefault(skinData.hard_cd))
     {
         baseData.hard_cd = skinData.hard_cd;
     }
     if (!SkillUtility.CheckStringDefault(skinData.skill_mutex))
     {
         baseData.skill_mutex = skinData.skill_mutex;
     }
     if (!SkillUtility.CheckStringDefault(skinData.ready_action_ids))
     {
         baseData.ready_action_ids = skinData.ready_action_ids;
     }
     if (!SkillUtility.CheckStringDefault(skinData.start_action_ids))
     {
         baseData.start_action_ids = skinData.start_action_ids;
     }
     if (!SkillUtility.CheckStringDefault(skinData.hit_action_ids))
     {
         baseData.hit_action_ids = skinData.hit_action_ids;
     }
     if (!SkillUtility.CheckStringDefault(skinData.end_action_ids))
     {
         baseData.end_action_ids = skinData.end_action_ids;
     }
     if (!SkillUtility.CheckStringDefault(skinData.init_higheff_ids))
     {
         baseData.init_higheff_ids = skinData.init_higheff_ids;
     }
     if (!SkillUtility.CheckStringDefault(skinData.start_higheff_ids))
     {
         baseData.start_higheff_ids = skinData.start_higheff_ids;
     }
     if (!SkillUtility.CheckStringDefault(skinData.hit_higheff_ids))
     {
         baseData.hit_higheff_ids = skinData.hit_higheff_ids;
     }
     if (!SkillUtility.CheckStringDefault(skinData.start_buff_ids))
     {
         baseData.start_buff_ids = skinData.start_buff_ids;
     }
     if (!SkillUtility.CheckStringDefault(skinData.hit_buff_ids))
     {
         baseData.hit_buff_ids = skinData.hit_buff_ids;
     }
     if (!SkillUtility.CheckIntDefault(skinData.hit_trigger_type))
     {
         baseData.hit_trigger_type = skinData.hit_trigger_type;
     }
     if (!SkillUtility.CheckStringDefault(skinData.hit_time))
     {
         baseData.hit_time = skinData.hit_time;
     }
     if (!SkillUtility.CheckStringDefault(skinData.damage_id))
     {
         baseData.damage_id = skinData.damage_id;
     }
 }
Пример #24
0
        public void Parse(SysSkillMainVo skillAttr)
        {
            if (StringUtils.CheckValid(skillAttr.ConjureRangetype))
            {
                this.IsUseSkillPointer = true;
                string[] array = skillAttr.ConjureRangetype.Split(new char[]
                {
                    '|'
                });
                if (array.Length > 0)
                {
                    string text = array[0];
                    switch (text)
                    {
                    case "1":
                        if (array.Length == 3)
                        {
                            this.SkillPointerType = SkillPointerType.RectanglePointer;
                            this.PointerLength    = float.Parse(array[1]);
                            this.PointerWidth     = float.Parse(array[2]);
                        }
                        break;

                    case "2":
                        if (array.Length == 2)
                        {
                            this.SkillPointerType = SkillPointerType.CirclePointer;
                            this.PointerRadius    = float.Parse(array[1]);
                        }
                        break;

                    case "3":
                        if (array.Length == 3)
                        {
                            this.SkillPointerType   = SkillPointerType.SectorPointer;
                            this.PointerRadius      = float.Parse(array[1]);
                            this.SectorPointerAngle = float.Parse(array[2]);
                        }
                        break;
                    }
                }
            }
            this.logicType = (SkillLogicType)skillAttr.skill_logic_type;
            string str = Convert.ToString(skillAttr.need_target);

            int[] stringToInt = StringUtils.GetStringToInt(str, '|');
            if (stringToInt != null && stringToInt.Length > 0)
            {
                this.needTarget = (stringToInt[0] != 0);
            }
            if (stringToInt != null && stringToInt.Length > 1)
            {
                this.skillCastingType = stringToInt[1];
            }
            this.skill_prop = skillAttr.skill_prop;
            if (StringUtils.CheckValid(skillAttr.skill_mutex))
            {
                this.skillMutexs = StringUtils.GetStringValue(skillAttr.skill_mutex, ',');
            }
            if (StringUtils.CheckValid(skillAttr.guide_time))
            {
                string[] stringValue = StringUtils.GetStringValue(skillAttr.guide_time, '|');
                this.isGuide       = (stringValue != null && float.Parse(stringValue[0]) > 0f);
                this.guideTime     = ((!this.isGuide) ? 0f : float.Parse(stringValue[1]));
                this.guideInterval = ((!this.isGuide) ? 0f : float.Parse(stringValue[2]));
                if (stringValue.Length > 3 && this.isGuide)
                {
                    this.isShowGuideBar = (int.Parse(stringValue[3]) != 0);
                }
                this.interrupt = (skillAttr.interrupt != 0);
            }
            if (StringUtils.CheckValid(skillAttr.cost))
            {
                this.cost_ids = StringUtils.GetStringToInt(skillAttr.cost, ',');
            }
            if (StringUtils.CheckValid(skillAttr.target_type))
            {
                int[] stringToInt2 = StringUtils.GetStringToInt(skillAttr.target_type, '|');
                this.targetCamp = (SkillTargetCamp)((stringToInt2 == null) ? 0 : stringToInt2[0]);
                this.targetTag  = (TargetTag)((stringToInt2.Length <= 1) ? 0 : stringToInt2[1]);
            }
            if (StringUtils.CheckValid(skillAttr.effective_range))
            {
                string[] stringValue2 = StringUtils.GetStringValue(skillAttr.effective_range, ',');
                if (stringValue2.Length > 0)
                {
                    float[] stringToFloat = StringUtils.GetStringToFloat(stringValue2[0], '|');
                    this.effectiveRangeType = (this.selectRangeType = ((stringToFloat == null) ? EffectiveRangeType.None : ((EffectiveRangeType)stringToFloat[0])));
                    this.effectRange1       = (this.selectRange1 = ((stringToFloat.Length <= 1) ? 0f : stringToFloat[1]));
                    this.effectRange2       = (this.selectRange2 = ((stringToFloat.Length <= 2) ? 0f : stringToFloat[2]));
                }
                if (stringValue2.Length > 1)
                {
                    float[] stringToFloat2 = StringUtils.GetStringToFloat(stringValue2[1], '|');
                    this.selectRangeType = ((stringToFloat2 == null) ? EffectiveRangeType.None : ((EffectiveRangeType)stringToFloat2[0]));
                    this.selectRange1    = ((stringToFloat2.Length <= 1) ? 0f : stringToFloat2[1]);
                    this.selectRange2    = ((stringToFloat2.Length <= 2) ? 0f : stringToFloat2[2]);
                }
            }
            this.isAbsorbMp             = false;
            this.isDiJianWoZeng         = false;
            this.damageProbability      = 100f;
            this.isCanMoveInSkillCastin = false;
            this.isMoveSkill            = false;
            if (StringUtils.CheckValid(skillAttr.skill_mutex))
            {
                string[] stringValue3 = StringUtils.GetStringValue(skillAttr.skill_mutex, ',');
                for (int i = 0; i < stringValue3.Length; i++)
                {
                    string[] stringValue4 = StringUtils.GetStringValue(stringValue3[i], '|');
                    if (stringValue4[0] == "1")
                    {
                        this.damageProbability = (float)int.Parse(stringValue4[1]);
                    }
                    else if (stringValue4[0] == "2")
                    {
                        if (stringValue4[1] == "1")
                        {
                            this.isAbsorbMp = true;
                        }
                        else if (stringValue4[1] == "0")
                        {
                            this.isAbsorbMp = false;
                        }
                    }
                    else if (stringValue4[0] == "3")
                    {
                        if (stringValue4[1] == "1")
                        {
                            this.isDiJianWoZeng = true;
                        }
                        else if (stringValue4[1] == "0")
                        {
                            this.isDiJianWoZeng = false;
                        }
                    }
                    else if (stringValue4[0] == "4")
                    {
                        if (stringValue4[1] == "1")
                        {
                            this.isCanMoveInSkillCastin = true;
                        }
                        else if (stringValue4[1] == "0")
                        {
                            this.isCanMoveInSkillCastin = false;
                        }
                    }
                    else if (stringValue4[0] == "6")
                    {
                        if (stringValue4[1] == "1")
                        {
                            this.continueMoveAfterSkillEnd = true;
                        }
                        else if (stringValue4[1] == "0")
                        {
                            this.continueMoveAfterSkillEnd = false;
                        }
                    }
                    else if (stringValue4[0] == "7")
                    {
                        if (stringValue4[1] == "1")
                        {
                            this.isMoveSkill = true;
                        }
                        else if (stringValue4[1] == "0")
                        {
                            this.isMoveSkill = false;
                        }
                    }
                }
            }
            if (StringUtils.CheckValid(skillAttr.ready_action_ids))
            {
                this.ready_actions = StringUtils.GetStringValue(skillAttr.ready_action_ids, ',');
            }
            if (StringUtils.CheckValid(skillAttr.start_action_ids))
            {
                string[]      stringValue5 = StringUtils.GetStringValue(skillAttr.start_action_ids, ',');
                List <string> list         = new List <string>();
                List <string> list2        = new List <string>();
                for (int j = 0; j < stringValue5.Length; j++)
                {
                    string[] stringValue6 = StringUtils.GetStringValue(stringValue5[j], '|');
                    if (stringValue6.Length == 2)
                    {
                        if (stringValue6[0] == "1")
                        {
                            list.Add(stringValue6[1]);
                        }
                        else if (stringValue6[0] == "2")
                        {
                            list2.Add(stringValue6[1]);
                        }
                    }
                    else if (stringValue6.Length == 1)
                    {
                        list.Add(stringValue6[0]);
                    }
                }
                this.start_actions      = list.ToArray();
                this.crit_start_actions = list2.ToArray();
            }
            if (StringUtils.CheckValid(skillAttr.hit_action_ids))
            {
                string[]      stringValue7 = StringUtils.GetStringValue(skillAttr.hit_action_ids, ',');
                List <string> list3        = new List <string>();
                List <string> list4        = new List <string>();
                List <string> list5        = new List <string>();
                for (int k = 0; k < stringValue7.Length; k++)
                {
                    string[] stringValue8 = StringUtils.GetStringValue(stringValue7[k], '|');
                    if (stringValue8.Length == 2)
                    {
                        if (stringValue8[0] == "1")
                        {
                            list3.Add(stringValue8[1]);
                        }
                        else if (stringValue8[0] == "2")
                        {
                            list4.Add(stringValue8[1]);
                        }
                        else if (stringValue8[0] == "3")
                        {
                            list5.Add(stringValue8[1]);
                        }
                    }
                    else if (stringValue8.Length == 1)
                    {
                        list3.Add(stringValue8[0]);
                    }
                }
                this.hit_actions        = list3.ToArray();
                this.crit_hit_actions   = list4.ToArray();
                this.friend_hit_actions = list5.ToArray();
            }
            if (StringUtils.CheckValid(skillAttr.end_action_ids))
            {
                this.end_actions = StringUtils.GetStringValue(skillAttr.end_action_ids, ',');
            }
            if (StringUtils.CheckValid(skillAttr.init_higheff_ids))
            {
                this.init_higheff_ids = StringUtils.GetStringValue(skillAttr.init_higheff_ids, ',');
            }
            if (StringUtils.CheckValid(skillAttr.start_higheff_ids))
            {
                this.start_higheff_ids = StringUtils.GetStringValue(skillAttr.start_higheff_ids, ',');
            }
            if (StringUtils.CheckValid(skillAttr.hit_higheff_ids))
            {
                this.hit_higheff_ids = StringUtils.GetStringValue(skillAttr.hit_higheff_ids, ',');
            }
            if (StringUtils.CheckValid(skillAttr.start_buff_ids))
            {
                this.start_buff_ids = StringUtils.GetStringValue(skillAttr.start_buff_ids, ',');
            }
            if (StringUtils.CheckValid(skillAttr.hit_buff_ids))
            {
                this.hit_buff_ids = StringUtils.GetStringValue(skillAttr.hit_buff_ids, ',');
            }
            if (StringUtils.CheckValid(skillAttr.skill_phase))
            {
                string[] stringValue9 = StringUtils.GetStringValue(skillAttr.skill_phase, ',');
                if (stringValue9 != null && stringValue9.Length == 3)
                {
                    this.castBefore = float.Parse(stringValue9[0]);
                    this.castIn     = float.Parse(stringValue9[1]);
                    this.castEnd    = float.Parse(stringValue9[2]);
                }
            }
            if (this.config.skill_type == 1)
            {
                this.interruptBefore = SkillInterruptType.Force;
            }
            else if (this.config.skill_type == 2)
            {
                this.interruptBefore = SkillInterruptType.Passive;
            }
            this.interruptIn  = (SkillInterruptType)this.config.interrupt;
            this.interruptEnd = SkillInterruptType.Force;
            if (StringUtils.CheckValid(skillAttr.hit_time))
            {
                this.hitTimes = StringUtils.GetStringToFloat(skillAttr.hit_time, ',');
            }
            if (StringUtils.CheckValid(skillAttr.damage_id))
            {
                this.damage_ids = StringUtils.GetStringToInt(skillAttr.damage_id, ',');
            }
            if (StringUtils.CheckValid(skillAttr.skill_unique))
            {
                int[] stringToInt3 = StringUtils.GetStringToInt(skillAttr.skill_unique, '|');
                if (stringToInt3 != null && stringToInt3.Length == 2)
                {
                    this.m_nSkillUnique = stringToInt3[0];
                    this.m_nPriority    = stringToInt3[1];
                }
            }
        }
Пример #25
0
    public void Init(VictPlayerType side, HeroData data, VictPlayerType type, VictPlayerData playerData, bool isSelf = false, bool isFriend = false)
    {
        if (side == type)
        {
            this.P_Frame.color = new Color32(7, 154, 0, 255);
            this.P_BG2.color   = new Color32(0, 154, 91, 171);
        }
        else
        {
            this.P_Frame.color = new Color32(222, 0, 0, 255);
            this.P_BG2.color   = new Color32(132, 5, 5, 171);
        }
        isSelf = playerData.IsControlPlayer;
        SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(data.HeroID);

        this.P_HeroPic.spriteName = heroMainData.avatar_icon;
        if (LevelManager.Instance.IsPvpBattleType)
        {
            this.P_SummonerName.text = playerData.SummonerName;
            this.P_SummonerSkill.gameObject.SetActive(true);
            SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(playerData.SummonerSkillID);
            if (skillMainData != null)
            {
                this.P_SummonerSkill.mainTexture = ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false);
            }
            else
            {
                this.P_SummonerSkill.gameObject.SetActive(false);
            }
        }
        else
        {
            this.P_SummonerName.text = LanguageManager.Instance.GetStringById(heroMainData.name);
            this.P_SummonerSkill.gameObject.SetActive(false);
        }
        this.SetIsHighestKillHero(playerData.isHighestKillHero);
        this.SetIsHighestKillMonster(playerData.isHighestKillMonster);
        this.P_HeroLevel.text      = data.LV.ToString();
        this.P_HeroPic.parent.name = data.HeroID;
        this.P_KillHero.text       = playerData.KillHero.ToString();
        this.P_KillMonster.text    = playerData.KillMonster.ToString();
        this.P_Kill.text           = "/" + playerData.Death.ToString();
        this.P_KillAssist.text     = "/" + playerData.KillAssist.ToString();
        this.P_BG1.gameObject.SetActive(isSelf);
        if (isSelf)
        {
            this.P_SummonerName.color = new Color(0.9647059f, 0.9019608f, 0.360784322f);
        }
        else
        {
            this.P_SummonerName.color = Color.white;
        }
        if (playerData.SelfIsDeath && !GameManager.IsGameOver())
        {
            this.P_BG2.gameObject.SetActive(true);
            this.LeftDeathTimeLabel.text = playerData.LeftDeathTime.ToString();
        }
        else
        {
            this.P_BG2.gameObject.SetActive(false);
        }
        this.P_AddFriend.gameObject.SetActive(!isSelf && !isFriend);
        this.P_AddFriend.name = playerData.SummonerId;
        UIEventListener.Get(this.P_AddFriend.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickAddFriend);
        this.CheckEquipment(playerData);
        if (this.SilencedIcon != null)
        {
            UIEventListener.Get(this.SilencedIcon.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickBlock);
            if (Singleton <StatisticView> .Instance.blockedSummonerList.Contains(playerData.SummonerId))
            {
                this.SilencedOn(true);
            }
            else
            {
                this.SilencedOn(false);
            }
            if (!isSelf && side == type)
            {
                this.SilencedIcon.gameObject.SetActive(true);
            }
            else
            {
                this.SilencedIcon.gameObject.SetActive(false);
            }
        }
        if (playerData.LastChamRank <= 50)
        {
            this.P_SummonerName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(playerData.LastChamRank);
        }
    }