public void InitElementSkill(int skillid)
    {
        Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

        if (tabSkill == null)
        {
            return;
        }

        Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(skillid, 0);

        if (tabSkillEx == null)
        {
            return;
        }

        Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);

        if (tabBase == null)
        {
            return;
        }

        m_TallentSkillId = GlobeVar.INVALID_ID;
        m_ElementSkillId = skillid;

        m_SkillIcon.spriteName = tabBase.Icon;
        //取消品质
        //m_QualityPic.spriteName = FellowTool.GetChatFellowElementSkillQualityPic(skillid);
        m_TallentBgPic.gameObject.SetActive(false);
        //  m_LevelLabel.text = FellowTool.GetFellowElementLevelText(skillid);
    }
示例#2
0
    public static AutoSelSkillItem CreateItem(GameObject grid, GameObject resItem, AutoFightLogic parent, int OwnIndex, int nSkillId, bool IsToggle)
    {
        Tab_SkillEx _skillEx = TableManager.GetSkillExByID(nSkillId, 0);

        if (_skillEx != null)
        {
            Tab_SkillBase _skillBase = TableManager.GetSkillBaseByID(_skillEx.BaseId, 0);
            if (_skillBase != null && _skillBase.PriorityAutoFight != -1)
            {
                GameObject newItem = Utils.BindObjToParent(resItem, grid, nSkillId.ToString());
                if (null != newItem)
                {
                    AutoSelSkillItem curItemComponent = newItem.GetComponent <AutoSelSkillItem>();
                    if (null != curItemComponent)
                    {
//                        curItemComponent.m_nSkillID = nSkillId;
                        curItemComponent.m_AutoSkillSprite.spriteName = _skillBase.Icon;
                        curItemComponent.m_AutoSkillToggle.value      = IsToggle;
                        curItemComponent.m_nOwnIndex = OwnIndex;
                        return(curItemComponent);
                    }
                }
            }
        }
        return(null);
    }
示例#3
0
        private int SeleSkillByPriority()
        {
            int nSelectSkillId = GetChangeStateNormalSkillID();
            int nMaxPriority   = -1;

            for (int ii = 0; ii < m_player.OwnSkillInfo.Length; ++ii)
            {
                int         nCurrSkillId = m_player.OwnSkillInfo[ii].SkillId;
                Tab_SkillEx tabSkillEx   = TableManager.GetSkillExByID(nCurrSkillId, 0);
                if (null != tabSkillEx)
                {
                    Tab_SkillBase tabSkillBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
                    if (null != tabSkillBase)
                    {
                        if (1 == m_player.IsAutoSelSkillID(ii) || (-1 == m_player.IsAutoSelSkillID(ii) && 0 < tabSkillBase.PriorityAutoFight))
                        {
                            if (m_player.CheckBeforUseSkill(nCurrSkillId, false) &&
                                CheckXpSkill(tabSkillBase)
                                )
                            {
                                int nCurrPriority = tabSkillBase.PriorityAutoFight;
                                if (nCurrPriority > nMaxPriority)
                                {
                                    nSelectSkillId = nCurrSkillId;
                                    nMaxPriority   = nCurrPriority;
                                }
                            }
                        }
                    }
                }
            }
            return(nSelectSkillId);
        }
    public void UpdateSkillBarInfo(int nSkillIndex)
    {
        m_nSkillIndex = nSkillIndex;
        Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

        if (_mainPlayer == null)
        {
            return;
        }
        if (m_nSkillIndex > 0 && m_nSkillIndex < _mainPlayer.OwnSkillInfo.Length)
        {
            int         nSkillId = _mainPlayer.OwnSkillInfo[m_nSkillIndex].SkillId;
            Tab_SkillEx _skillEx = TableManager.GetSkillExByID(nSkillId, 0);
            if (_skillEx != null)
            {
                Tab_SkillBase _skillBase = TableManager.GetSkillBaseByID(_skillEx.BaseId, 0);
                if (_skillBase != null)
                {
                    m_IconSprite.spriteName = _skillBase.Icon;
                    m_IconSprite.MakePixelPerfect();
                    m_IconSprite.gameObject.SetActive(true);
                }
            }
        }
    }
示例#5
0
        //获取当前变身状态下的普攻连续技的首段技能ID
        private int GetChangeStateNormalSkillID()
        {
            int nCurrentChangeState = m_player.GetCurrentChangeState();

            for (int ii = 0; ii < m_player.OwnSkillInfo.Length; ++ii)
            {
                int nCurrSkillId = m_player.OwnSkillInfo[ii].SkillId;
                if (IsNormalSkill(nCurrSkillId))
                {
                    Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(nCurrSkillId, 0);
                    if (null != tabSkillEx)
                    {
                        Tab_SkillBase tabSkillBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
                        if (null != tabSkillBase)
                        {
                            if (tabSkillBase.GetChangeModebyIndex(nCurrentChangeState) >= 0)
                            {
                                return(nCurrSkillId);
                            }
                        }
                    }
                }
            }
            return(m_player.OwnSkillInfo[0].SkillId);
        }
示例#6
0
    void ClickSkillNextInfo()
    {
        if (m_ShenQiItem == null)
        {
            return;
        }
        if (m_ShenQiItem.IsEquipMent() == false)
        {
            return;
        }
        int SkillInfIndex = (int)ShenQiDyData.SkillId;

        if (SkillInfIndex >= 0 && SkillInfIndex < m_ShenQiItem.DynamicData.Length)
        {
            Tab_ShenQiSkillInfo _ShenQiSkillInfo = TableManager.GetShenQiSkillInfoByID(m_ShenQiItem.DynamicData[(int)ShenQiDyData.SkillId], 0);
            if (_ShenQiSkillInfo != null)
            {
                Tab_SkillEx _nextSkillEx = TableManager.GetSkillExByID(_ShenQiSkillInfo.NextSkillId, 0);
                if (_nextSkillEx != null)
                {
                    m_ShenQiSkillDecLable.text = _nextSkillEx.SkillDesc;
                    m_ShowSkillInfoNextBt.SetActive(false);
                    m_ShowSkillInfoBackBt.SetActive(true);
                }
            }
        }
    }
示例#7
0
    int _getSkillIndexIdByActivieyId(int id)
    {
        Tab_SkillEx skillEx = TableManager.GetSkillExByID(id, 0);

        if (skillEx == null)
        {
            return(-1);
        }

        Tab_SkillBase skillBase = TableManager.GetSkillBaseByID(skillEx.BaseId, 0);

        if (skillBase == null)
        {
            return(-1);
        }

        Obj_MainPlayer rUser = Singleton <ObjManager> .Instance.MainPlayer;

        if (rUser == null)
        {
            return(-1);
        }

        for (int skillIndex = 0; skillIndex < rUser.OwnSkillInfo.Length; skillIndex++)
        {
            if (rUser.OwnSkillInfo[skillIndex].SkillId == skillEx.SkillExID)
            {
                return(skillIndex);
            }
        }

        return(-1);
    }
    /// <summary>
    /// 打开选择学习技能书界面
    /// </summary>
    /// <param name="go"></param>
    void OpenChooseSkillBookDialog(GameObject go)
    {
        Utils.CleanGrid(m_SkillChooseGrid);

        List <Tab_CabalFellowElementSkillBook> FellowSkillBookList = GameManager.gameManager.PlayerDataPool.BackPack.GetSkillLearnBooksByElementType(m_Fellow.ElementAttr);

        if (FellowSkillBookList.Count <= 0)
        {
            GUIData.AddNotifyData("#{11500}");
            return;
        }
        //选择技能书界面
        m_SkillChooseWindow.SetActive(true);

        int index = 0;

        //foreach (Tab_CabalFellowElementSkillBook book in GameManager.gameManager.PlayerDataPool.BackPack.GetSkillLearnBooksByElementType(m_Fellow.ElementAttr))
        foreach (Tab_CabalFellowElementSkillBook book in FellowSkillBookList)
        {
            if (m_Fellow.IsHaveSkillId(book.SkillId))
            {
                continue;
            }
            Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(book.SkillId, 0);
            if (tabSkill == null)
            {
                continue;
            }

            Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(book.SkillId, 0);
            if (tabSkillEx == null)
            {
                continue;
            }

            Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
            if (tabBase == null)
            {
                continue;
            }
            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject SkillItem = Utils.BindObjToParent(m_SkillChooseItem, m_SkillChooseGrid, itemName);
            if (SkillItem != null && SkillItem.GetComponent <PartnerSkillChooseItemLogic>() != null)
            {
                SkillItem.GetComponent <PartnerSkillChooseItemLogic>().Init(book);
            }
            index += 1;
        }

        if (m_SkillChooseGrid.GetComponent <UIGrid>() != null)
        {
            m_SkillChooseGrid.GetComponent <UIGrid>().Reposition();
        }

        if (PartnerFrameLogic.Instance().NewPlayerGuideFlag_Step == 4)
        {
            PartnerFrameLogic.Instance().NewPlayerGuide(5);
        }
    }
示例#9
0
    private void LevelUpShenQiSkill()
    {
        if (m_ShenQiItem == null)
        {
            GUIData.AddNotifyData2Client(false, "#{4966}");
            return;
        }
        if (m_ShenQiItem.IsValid() == false)
        {
            GUIData.AddNotifyData2Client(false, "#{4966}");
            return;
        }
        Tab_ShenQiInfo _ShenQiInfo = TableManager.GetShenQiInfoByID(m_ShenQiItem.DataID, 0);

        if (_ShenQiInfo == null)
        {
            GUIData.AddNotifyData2Client(false, "#{4966}");
            return;
        }
        //技能信息
        int SkillInfIndex = (int)ShenQiDyData.SkillId;

        if (SkillInfIndex >= 0 && SkillInfIndex < m_ShenQiItem.DynamicData.Length)
        {
            Tab_SkillEx _skillEx = TableManager.GetSkillExByID(m_ShenQiItem.DynamicData[(int)ShenQiDyData.SkillId], 0);
            if (_skillEx != null)
            {
                Tab_ShenQiSkillInfo _ShenQiSkillInfo = TableManager.GetShenQiSkillInfoByID(m_ShenQiItem.DynamicData[(int)ShenQiDyData.SkillId], 0);
                if (_ShenQiSkillInfo != null)
                {
                    //技能已达上限
                    if (_ShenQiSkillInfo.NextSkillId == -1)
                    {
                        GUIData.AddNotifyData2Client(false, "#{4964}");
                        return;
                    }
                    //技能上限
                    if (_skillEx.Level >= _ShenQiInfo.MaxSkillLev)
                    {
                        GUIData.AddNotifyData2Client(false, "#{4947}");
                        return;
                    }
                    int nSuiPianNum    = _ShenQiSkillInfo.NeedItemNum;
                    int nSuiPianOwnNum = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(_ShenQiSkillInfo.NeedItemId);
                    if (nSuiPianNum > nSuiPianOwnNum)
                    {
                        GUIData.AddNotifyData2Client(false, "#{4946}");
                        return;
                    }
                    //发包升级
                    CG_SHENQI_SKILLLEVELUP packet = (CG_SHENQI_SKILLLEVELUP)PacketDistributed.CreatePacket(MessageID.PACKET_CG_SHENQI_SKILLLEVELUP);
                    packet.ShenqiGuid = m_ShenQiItem.Guid;
                    packet.SendPacket();
                }
            }
        }
    }
示例#10
0
    void OnEnable()
    {
        if (SkillLevelUpRoot.Instance() != null)
        {
            m_SelectSkillEx = SkillLevelUpRoot.Instance().SelectSkillEx;
        }

        SetGetItemWinData();
    }
示例#11
0
        //显示技能名字
        public static void ShowSkillName(int skillId, int senderId, string skillName = "")
        {
            Obj_Character skillSender = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(senderId);

            if (skillSender == null)
            {
                LogModule.DebugLog("MainPlayer is Null:" + senderId);
                return;
            }
            Tab_SkillEx skillExInfo = TableManager.GetSkillExByID(skillId, 0);

            if (skillExInfo == null)
            {
                LogModule.DebugLog("SkillExinfo is Null: " + skillId);
                return;
            }
            int           BaseSkillId = skillExInfo.BaseId;
            Tab_SkillBase skillBase   = TableManager.GetSkillBaseByID(BaseSkillId, 0);

            if (skillBase == null)
            {
                LogModule.DebugLog("SkillBaseInfo is Null" + BaseSkillId);
                return;
            }

            //显示技能名字
            if (skillName == "")
            {
                if ((skillBase.SkillClass & (int)SKILLCLASS.PASSIVITY) != 0)
                {
                    skillSender.ShowDamageBoard_SkillName(Games.GlobeDefine.GameDefine_Globe.DAMAGEBOARD_TYPE.SKILL_NAME, skillBase.Name, false);
                }
                else
                {
                    if (skillSender.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER ||
                        skillSender.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
                    {
                        skillSender.ShowDamageBoard_SkillName(Games.GlobeDefine.GameDefine_Globe.DAMAGEBOARD_TYPE.SKILL_NAME, skillBase.Name);
                    }
                    else if (skillSender.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_NPC)
                    {
                        skillSender.ShowDamageBoard_SkillName(Games.GlobeDefine.GameDefine_Globe.DAMAGEBOARD_TYPE.SKILL_NAME_NPC, skillBase.Name, false);
                    }
                    else
                    {
                        skillSender.ShowDamageBoard_SkillName(Games.GlobeDefine.GameDefine_Globe.DAMAGEBOARD_TYPE.SKILL_NAME, skillBase.Name, false);
                    }
                }
            }
            else
            {
                skillSender.ShowDamageBoard_SkillName(Games.GlobeDefine.GameDefine_Globe.DAMAGEBOARD_TYPE.SKILL_NAME, skillName, false);
            }
        }
示例#12
0
        //是否度过连续技的后续技能可使用时间(后摇时间)
        private bool CheckNextSkillEffectTimeOver()
        {
            if (IsUsingRepeatSkillWithNext())
            {
                Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(CurUseSkillId, 0);
                if (null != tabSkillEx)
                {
//                    float y = Time.time * 1000 - CurUseSkillStartTime;
                    return(Time.time * 1000 > (CurUseSkillStartTime + tabSkillEx.NextSkillEffectTime));
                }
            }
            return(false);
        }
示例#13
0
        //是否度过连续技的后续技能不可使用时间(前摇时间)
        private bool CheckTimeUsingNextContinueSkill()
        {
            if (IsUsingRepeatSkillWithNext())
            {
                Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(CurUseSkillId, 0);
                if (null != tabSkillEx)
                {
//                    float x = Time.time * 1000 - CurUseSkillStartTime;
                    return(Time.time * 1000 > (CurUseSkillStartTime + tabSkillEx.NextSkillDisabledTime));
                }
            }
            return(false);
        }
示例#14
0
    void OnClickSkill(int index)
    {
        if (index >= 0 && index < SKILL_NUM)
        {
            //设置技能选中状态
            ClearSkillChoose();
            m_SkillSelect[index].gameObject.SetActive(true);

            int skillid = m_SkillID[index];
            //设置当前选择技能
            m_CurSelectSkill      = skillid;
            m_CurSelectSkillIndex = index;
            //显示技能描述
            Tab_SkillEx lineSkillEx = TableManager.GetSkillExByID(skillid, 0);
            if (lineSkillEx != null)
            {
                m_SkillDesc.text = lineSkillEx.SkillDesc;
            }
            //所有按钮隐藏
            m_SkillLearnBtn.gameObject.SetActive(false);
            m_SkillActiveBtn.gameObject.SetActive(false);
            m_SkillForgetBtn.gameObject.SetActive(false);

            if (m_SkillOwn[index])
            {
                //已经拥有
                //显示遗忘按钮
                m_SkillForgetBtn.gameObject.SetActive(true);
            }

            //显示按钮
            if (m_SkillActive[index])
            {
                if (m_SkillOwn[index] == false)
                {
                    //未学习
                    //显示学习按钮
                    m_SkillLearnBtn.gameObject.SetActive(true);
                }
            }
            else
            {
                if (GameManager.gameManager.PlayerDataPool.IsMasterChief())
                {
                    //只有掌门才显示激活按钮
                    m_SkillActiveBtn.gameObject.SetActive(true);
                    m_SkillNameInput.gameObject.SetActive(true);
                }
            }
        }
    }
示例#15
0
        //判定技能是否为普攻
        private bool IsNormalSkill(int nSkillId)
        {
            Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(nSkillId, 0);

            if (null != tabSkillEx)
            {
                Tab_SkillBase tabSkillBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
                if (null != tabSkillBase)
                {
                    return(0 != (tabSkillBase.SkillClass & (int)SKILLCLASS.AUTOREPEAT));
                }
            }
            return(false);
        }
示例#16
0
    public void UpdateButtonInfo(int nSkillIndex)
    {
        m_nSkillIndex = nSkillIndex;
        Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

        if (_mainPlayer == null)
        {
            return;
        }
        if (m_nSkillIndex >= 0 && m_nSkillIndex < _mainPlayer.OwnSkillInfo.Length)
        {
            int         nSkillId = _mainPlayer.OwnSkillInfo[m_nSkillIndex].SkillId;
            Tab_SkillEx _skillEx = TableManager.GetSkillExByID(nSkillId, 0);
            if (_skillEx != null)
            {
                Tab_SkillBase _skillBase = TableManager.GetSkillBaseByID(_skillEx.BaseId, 0);
                if (_skillBase != null)
                {
                    //师门技能显示自定义名字
                    if ((_skillBase.SkillClass & (int)SKILLCLASS.MASTERSKILL) != 0)
                    {
                        m_SkillNameLabel.text = GameManager.gameManager.PlayerDataPool.GetMasterSkillName(nSkillId);
                        if (m_SkillNameLabel.text == "")
                        {
                            m_SkillNameLabel.text = _skillBase.Name;
                        }
                    }
                    else
                    {
                        m_SkillNameLabel.text = _skillBase.Name;
                    }
                    m_nSkillID     = nSkillId;
                    m_nSkillBaseId = _skillEx.BaseId;
                    m_SkillIconSprite.spriteName = _skillBase.Icon;
                    m_SkillIconSprite.MakePixelPerfect();
                    m_SkillLevLabel.text = StrDictionary.GetClientDictionaryString("#{2162}", _skillEx.Level);
                    //是否要显示升级提醒的角标
                    if (SkillRootLogic.IsCanLevelUpSkill(nSkillId) ||
                        SkillRootLogic.IsCanLevelUpMasterSkill(nSkillId))
                    {
                        m_LevelTipsIcon.SetActive(true);
                    }
                    else
                    {
                        m_LevelTipsIcon.SetActive(false);
                    }
                }
            }
        }
    }
示例#17
0
    void OnLoadPVPSkillItem(GameObject resItem, object param)
    {
        if (null == resItem)
        {
            LogModule.ErrorLog("load pvp skill item fail");
            return;
        }

        Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

        Utils.CleanGrid(m_PVPSkillListGrid);
        m_ItemInfo.Clear();
        if (_mainPlayer)
        {
            m_ObjCurSkillInfo.SetActive(false);
            //普攻和XP不可升级
            int nIndex = 0;
            for (int i = 0; i < _mainPlayer.OwnSkillInfo.Length; i++)
            {
                int         nSkillId = _mainPlayer.OwnSkillInfo[i].SkillId;
                Tab_SkillEx _skillEx = TableManager.GetSkillExByID(nSkillId, 0);
                if (_skillEx != null)
                {
                    Tab_SkillBase _skillBase = TableManager.GetSkillBaseByID(_skillEx.BaseId, 0);
                    if (_skillBase != null &&
                        (_skillBase.SkillClass & (int)SKILLCLASS.AUTOREPEAT) == 0 &&
                        (_skillBase.SkillClass & (int)SKILLCLASS.XP) == 0)
                    {
                        PVPSkillListItem _skillItem = PVPSkillListItem.CreateItem(m_PVPSkillListGrid, resItem, nIndex.ToString(), this, _skillBase.Name, "LV:" + _skillEx.Level.ToString(), nSkillId);
                        if (_skillItem != null)
                        {
                            m_ItemInfo.Add(nIndex.ToString(), _skillItem);
                            nIndex++;
                        }
                    }
                }
            }
            m_PVPSkillListGrid.GetComponent <UIGrid>().Reposition();
            m_PVPSkillListGrid.GetComponent <UITopGrid>().Recenter(false);
            if (m_curItemIndexName == "" && m_ItemInfo.ContainsKey("0"))
            {
                ShowCurSkill(m_ItemInfo["0"]);
            }
            else if (m_ItemInfo.ContainsKey(m_curItemIndexName))
            {
                ShowCurSkill(m_ItemInfo[m_curItemIndexName]);
            }
        }
    }
示例#18
0
    void InitElementSkill_Info(int skillid)
    {
        Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

        if (tabSkill == null)
        {
            return;
        }

        Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(skillid, 0);

        if (tabSkillEx == null)
        {
            return;
        }

        Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);

        if (tabBase == null)
        {
            return;
        }

        m_TallentSkillId = GlobeVar.INVALID_ID;
        m_ElementSkillId = skillid;

        Tab_CabalFellowElementSkill tabNextSkill = TableManager.GetCabalFellowElementSkillByID(tabSkill.NextSkillId, 0);

        if (tabNextSkill == null)
        {
            lblSkillLv.text = "MAX";
        }
        sprSkillIcon.spriteName = tabBase.Icon;
        sprSkillIcon.gameObject.SetActive(true);

        lblSkillLv.text = FellowTool.GetFellowElementLevelText(skillid);
        lblSkillLv.transform.parent.gameObject.SetActive(true);
        lblSkillName.text = tabBase.Name;
        lblSkillDesc.text = tabBase.SkillIntro;
        objLock.SetActive(false);
        enhanceSkill.SetActive(true);
        UIEventListener.Get(enhanceSkill).onClick = ShowEnhanceDialog;
        if (PartnerFrameLogic.Instance() != null)
        {
            PartnerFrameLogic.Instance().UpdateDevelopRemindPoint();
        }
    }
示例#19
0
    public void ShowCurSkill(PVPSkillListItem item)
    {
        if (null == item)
        {
            return;
        }
        m_ObjCurSkillInfo.SetActive(true);
        m_curItemIndexName = item.name;
        item.EnableHighlight(true);

        m_LabelCurSkillName.text = item.m_LabelName.text;
        m_LabelCurSkillLeve.text = item.m_LabelLev.text;
        m_nCurSkillId            = item.SkillId;
        Tab_SkillEx _CurskillEx           = TableManager.GetSkillExByID(item.SkillId, 0);
        int         nCurSkillCombatValue  = 0;
        int         nNextSkillCombatValue = 0;

        if (_CurskillEx != null)
        {
            m_LableCurSkillInfo.text = _CurskillEx.SkillDesc;
            nCurSkillCombatValue     = _CurskillEx.CombatValue;
        }
        Tab_SkillLevelUp _skillLevUp = TableManager.GetSkillLevelUpByID(m_nCurSkillId, 0);

        if (_skillLevUp != null)
        {
            if (_skillLevUp.NextSkillId != -1)
            {
                m_LabelEnergyCost.text = _skillLevUp.NeedConsume.ToString();
                Tab_SkillEx _NextskillEx = TableManager.GetSkillExByID(_skillLevUp.NextSkillId, 0);
                if (_NextskillEx != null)
                {
                    m_LableNextSkillInfo.text = _NextskillEx.SkillDesc;
                    nNextSkillCombatValue     = _NextskillEx.CombatValue;
                }
                int nCombatValueAdd = nNextSkillCombatValue - nCurSkillCombatValue;
                m_LabelPowerAdd.text = nCombatValueAdd.ToString();
            }
            else
            {
                m_LabelEnergyCost.text    = "0";
                m_LableNextSkillInfo.text = "";
                m_LabelPowerAdd.text      = "0";
            }
        }
    }
示例#20
0
        //获取连续技的后续技能ID
        private int GetNextContinueSkillId()
        {
            Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(CurUseSkillId, 0);

            if (null != tabSkillEx)
            {
                Tab_SkillBase tabSkillBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
                if (null != tabSkillBase)
                {
                    if (-1 != tabSkillEx.NextContinueSkillId && tabSkillEx.NextContinueSkillId != GetRepeatSkillFirstID(CurUseSkillId))
                    {
                        return(tabSkillEx.NextContinueSkillId);
                    }
                }
            }
            return(-1);
        }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_RET_SELOBJ_INFO packet = (GC_RET_SELOBJ_INFO )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
//            int nObjId = packet.ObjId;
            int            nSelObjId   = packet.SeleobjId;
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer == null)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }

            Obj_Character selObj = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(nSelObjId);

            if (selObj)
            {
                _mainPlayer.SelectTarget = selObj;
            }
            else
            {
                _mainPlayer.SelectTarget = null;
            }
            //更新选择目标头像
            _mainPlayer.UpdateTargetFrame(selObj);
            //如果选择的目标在播放技能范围的特效 切换目标时得 修改特效播放的对象
            if (_mainPlayer.CurPressSkillId != -1 && _mainPlayer.SelectTarget)
            {
                Tab_SkillEx _skillEx = TableManager.GetSkillExByID(_mainPlayer.CurPressSkillId, 0);
                if (_skillEx != null)
                {
                    if (_skillEx.RangeEffectType != -1 && _skillEx.RangeEffectTarType == (int)SKILLRANGEEFFECTTAR.SELECTTARGET)
                    {
                        _mainPlayer.SelectTarget.PlaySkillRangeEffect();
                    }
                }
            }

            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
示例#22
0
    public void UpdateNoStudyButtonInfo(int nSkillId)
    {
        Tab_SkillEx _skillEx = TableManager.GetSkillExByID(nSkillId, 0);

        if (_skillEx != null)
        {
            Tab_SkillBase _skillBase = TableManager.GetSkillBaseByID(_skillEx.BaseId, 0);
            if (_skillBase != null)
            {
                //师门技能显示自定义名字
                if ((_skillBase.SkillClass & (int)SKILLCLASS.MASTERSKILL) != 0)
                {
                    m_SkillNameLabel.text = String.Format("[FF0000]{0}", GameManager.gameManager.PlayerDataPool.GetMasterSkillName(nSkillId));
                    if (m_SkillNameLabel.text == "")
                    {
                        m_SkillNameLabel.text = String.Format("[FF0000]{0}", _skillBase.Name);
                    }
                    m_SkillLevLabel.text = "";
                }
                else
                {
                    m_SkillNameLabel.text = String.Format("[FF0000]{0}", _skillBase.Name);
                    //显示可以激活的等级
                    for (int i = 1; i <= TableManager.GetSkillActive().Count; i++)
                    {
                        Tab_SkillActive _skillActiveInfo = TableManager.GetSkillActiveByID(i, 0);
                        if (_skillActiveInfo != null)
                        {
                            if (_skillActiveInfo.SkillId == nSkillId)
                            {
                                m_SkillLevLabel.text = String.Format("[FF0000]{0}", StrDictionary.GetClientDictionaryString("#{2770}", _skillActiveInfo.Level));
                                break;
                            }
                        }
                    }
                }
                m_SkillIconSprite.spriteName = _skillBase.Icon;
                m_SkillIconSprite.MakePixelPerfect();
                m_nSkillIndex  = -1;
                m_nSkillID     = nSkillId;
                m_nSkillBaseId = _skillEx.BaseId;
                m_LevelTipsIcon.SetActive(false);
            }
        }
    }
    public void PlaySkillWarningEffect(int skillExId)
    {
        if (m_BaseEffectBindPoint == null)
        {
            return;
        }
        Tab_SkillEx skillEx = TableManager.GetSkillExByID(skillExId, 0);

        if (skillEx == null || skillEx.getImpactCount() == 0)
        {
            return;
        }
        BaseSkillWarningEffect   com;
        SkillWarningEffectStruct data;

        switch (skillEx.RangeEffectType)
        {
        case (int)SKILLRANGEEFFECTTYPE.RECT:
        {
            data.WarnIngShapeType  = SKILLRANGEEFFECTTYPE.RECT;
            data.RangeEffectSize01 = skillEx.GetRangeEffectSizebyIndex(0);
            data.RangeEffectSize02 = skillEx.GetRangeEffectSizebyIndex(1);
            data.ShowWarningTime   = skillEx.SkillDelayTime / 1000f;
            GameObject go = ResourceManager.InstantiateResource(GlobeVar.SKILL_WARNING_EFFECT_RECT) as GameObject;
            if (go == null)
            {
                return;
            }
            Utils.SetParent(go.transform, m_BaseEffectBindPoint);
            com = go.AddComponent <RectSkillWarningEffect>();
            break;
        }

        default:
        {
            return;
        }
        }
        if (com != null)
        {
            com.InitComponent();
            com.StartFill(data);
        }
    }
示例#24
0
        //获取连续技的首段技能ID
        private int GetRepeatSkillFirstID(int nSkillId)
        {
            Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(nSkillId, 0);

            if (null != tabSkillEx)
            {
                Tab_SkillBase tabSkillBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
                if (null != tabSkillBase)
                {
                    if (0 < tabSkillEx.NextContinueSkillId)
                    {
                        if (tabSkillBase.FirstIndex < m_player.OwnSkillInfo.Length)
                        {
                            return(m_player.OwnSkillInfo[tabSkillBase.FirstIndex].SkillId);
                        }
                    }
                }
            }
            return(-1);
        }
示例#25
0
    private string _getSkillBaseIconName(int SkillActiveId)
    {
        //Tab_SkillActive skillActTab = TableManager.GetSkillActiveByID(SkillActiveId,0);
        //if(skillActTab == null )
        //	return "";

        Tab_SkillEx skillEx = TableManager.GetSkillExByID(SkillActiveId, 0);

        if (skillEx == null)
        {
            return("");
        }

        Tab_SkillBase skillBase = TableManager.GetSkillBaseByID(skillEx.BaseId, 0);  // skillEx.BaseId

        if (skillBase == null)
        {
            return("");
        }

        return(skillBase.Icon);
    }
示例#26
0
    public void SetSquadInfor(CObjInfor tObjInfor)
    {
        mID              = tObjInfor.id;
        mSquadCamp       = (SquadCamp)tObjInfor.camp;
        mUnitCount       = tObjInfor.unitcount;
        mHP              = tObjInfor.hp;
        mHPMax           = tObjInfor.maxhp;
        mSquadAttack     = tObjInfor.attack;
        mSquadDefence    = tObjInfor.defence;
        mSp              = tObjInfor.sp;
        mlevel           = tObjInfor.level;
        mBornPosionX     = tObjInfor.posx;
        mBornPosionZ     = tObjInfor.posz;
        mSquadTemplateID = tObjInfor.unitDataId;
        mBornPosionIndex = tObjInfor.arrangeindex;
        Tab_RoleBaseAttr tRoleBaseAttr = TableManager.GetRoleBaseAttrByID(tObjInfor.unitDataId)[0];

        mUnitTemplateID = tRoleBaseAttr.UnitDataID;
        mSkillIDList    = tObjInfor.skilldataid;
        Tab_SkillEx tSkillEx = TableManager.GetSkillExByID(mSkillIDList[0])[0];

        SkillTemplateID = tSkillEx.SkillDataID;
    }
    private UInt64 m_MasterGuid;           //师门GUID

    //根据数据初始化控件
    public void Init(MasterPreviewInfo info, int nIndex)
    {
        //判断数据合法性
        if (info.MasterGuid == GlobeVar.INVALID_GUID)
        {
            return;
        }

        m_MasterGuid = info.MasterGuid;

        //填充数据
        if (null != m_MasterIndexLable)
        {
            m_MasterIndexLable.text = nIndex.ToString();
        }
        if (null != m_MasterNameLabel)
        {
            m_MasterNameLabel.text = info.MasterName;
        }
        if (null != m_MasterChiefNameLabel)
        {
            m_MasterChiefNameLabel.text = info.MasterChiefName;
        }
        if (null != m_MasterTorchLabel)
        {
            m_MasterTorchLabel.text = info.MasterTorch.ToString();
        }
        if (null != m_MasterMemberNumLabel)
        {
            m_MasterMemberNumLabel.text = info.MasterCurMemberNum.ToString();
        }
        int SkillIndex = 0;

        if (info.MasterSkillId1 >= 0)
        {
            Tab_SkillEx lineSkillEx = TableManager.GetSkillExByID(info.MasterSkillId1, 0);
            if (lineSkillEx != null)
            {
                Tab_SkillBase lineSkillBase = TableManager.GetSkillBaseByID(lineSkillEx.BaseId, 0);
                if (lineSkillBase != null &&
                    SkillIndex >= 0 &&
                    SkillIndex < m_MasterSkillSprite.Length &&
                    null != m_MasterSkillSprite[SkillIndex])
                {
                    m_MasterSkillSprite[SkillIndex].gameObject.SetActive(true);
                    m_MasterSkillSprite[SkillIndex].spriteName = lineSkillBase.Icon;
                    SkillIndex = SkillIndex + 1;
                }
            }
        }
        if (info.MasterSkillId2 >= 0)
        {
            Tab_SkillEx lineSkillEx = TableManager.GetSkillExByID(info.MasterSkillId2, 0);
            if (lineSkillEx != null)
            {
                Tab_SkillBase lineSkillBase = TableManager.GetSkillBaseByID(lineSkillEx.BaseId, 0);
                if (lineSkillBase != null &&
                    SkillIndex >= 0 &&
                    SkillIndex < m_MasterSkillSprite.Length &&
                    null != m_MasterSkillSprite[SkillIndex])
                {
                    m_MasterSkillSprite[SkillIndex].gameObject.SetActive(true);
                    m_MasterSkillSprite[SkillIndex].spriteName = lineSkillBase.Icon;
                    SkillIndex = SkillIndex + 1;
                }
            }
        }
        if (info.MasterSkillId3 >= 0)
        {
            Tab_SkillEx lineSkillEx = TableManager.GetSkillExByID(info.MasterSkillId3, 0);
            if (lineSkillEx != null)
            {
                Tab_SkillBase lineSkillBase = TableManager.GetSkillBaseByID(lineSkillEx.BaseId, 0);
                if (lineSkillBase != null &&
                    SkillIndex >= 0 &&
                    SkillIndex < m_MasterSkillSprite.Length &&
                    null != m_MasterSkillSprite[SkillIndex])
                {
                    m_MasterSkillSprite[SkillIndex].gameObject.SetActive(true);
                    m_MasterSkillSprite[SkillIndex].spriteName = lineSkillBase.Icon;
                    SkillIndex = SkillIndex + 1;
                }
            }
        }
        for (; SkillIndex < 4; SkillIndex++)
        {
            if (SkillIndex >= 0 &&
                SkillIndex < m_MasterSkillSprite.Length &&
                null != m_MasterSkillSprite[SkillIndex])
            {
                m_MasterSkillSprite[SkillIndex].gameObject.SetActive(false);
            }
        }
    }
示例#28
0
        public override void UpdateAI()
        {
            base.UpdateAI();
            if (m_player == null || m_player.Controller == null)
            {
                return;
            }
            if (m_player.IsDie())
            {
                return;
            }
            if (m_player.Controller.CombatFlag == false)
            {
                return;
            }
            if (m_player.AutoComabat == false)
            {
                return;
            }
            //轻功状态下 不挂机
            if (m_player.QingGongState)
            {
                return;
            }
            if (m_player.AcceleratedMotion != null && m_player.AcceleratedMotion.Going == true)
            {
                return;
            }
            //剧情播放中不挂机
            if (m_player.IsInModelStory)
            {
                return;
            }
            // 跟随不挂机
            if (false == m_player.IsTeamLeader() && m_player.IsInTeamFollow)
            {
                return;
            }
            if (Cutscene.CutsceneManager.Instance.IsPlayingMovieStory)
            {
                return;
            }
            //阻塞状态不挂机
            if (Cutscene.CutsceneManager.Instance.BlockAutoBattle)
            {
                return;
            }
            //自动交接任务的寻路过程中不挂机
            if (null != GameManager.gameManager.AutoSearch &&
                true == GameManager.gameManager.AutoSearch.IsAutoSearching)
            {
                return;
            }
            //modify 普通攻击:可以连续按。在技能结束前可以再次释放不能直接return。
            if (m_player.SkillCore.IsUsingSkill)
            {
                bool shouldReturn = true;
                if ((Time.time * 1000 - CurUseSkillStartTime) >= m_nNormalSkillInterval)
                {
                    if (IsNormalSkill(CurUseSkillId))
                    {
                        shouldReturn = false;
                    }
                }
                if (shouldReturn)
                {
                    return;
                }
            }

            #region UnUsed

            /* if (m_player.SkillCore.IsUsingSkill)
             * {
             *
             *   return;
             *   if (m_player.SkillCore.UsingSkillBaseInfo != null && m_player.SkillCore.UsingSkillExInfo !=null)
             *   {
             *       //正在使用祝融掌 则检测下当前目标是否还存在 不存在则重新选取目标
             *       //if (m_player.SkillCore.UsingSkillBaseInfo.Id ==(int)SKILLBASEID.ZLZ)
             *       //{
             *       //    if (m_player.SelectTarget ==null || m_player.SelectTarget.IsDie())
             *       //    {
             *       //        Obj_Character _NewAttackCharacter = SeleCanAttackTar(m_player.SkillCore.UsingSkillExInfo.Radius);
             *       //        if (_NewAttackCharacter != null)
             *       //        {
             *       //            //设置新的选中目标
             *       //            m_player.OnSelectTarget(_NewAttackCharacter.gameObject,false);
             *       //            m_player.MoveTo(_NewAttackCharacter.transform.position, _NewAttackCharacter.gameObject,1.0f);
             *       //        }
             *       //    }
             *       //}
             *
             *       //连续技特殊判定:
             *       //1、判定玩家是否主动打断;
             *       //2、不判定是否释放完成,一直尝试是否可释放;
             *       if (IsPlayerBreakRepeatSkill())
             *       {
             *           ClearPlayerBreakRepeatSkill();
             *           return;
             *       }
             *       //非连续技则等待一帧
             *       if (!IsUsingRepeatSkillWithNext())
             *       {
             *           return;
             *       }
             *   }
             * }
             * else
             * {
             *   if (m_fLastUseEndTime <=0.1f)
             *   {
             *       m_fLastUseEndTime = Time.time;
             *   }
             * }*/
            #endregion
            //留个缓冲时间
            //if (Time.time -m_fLastUseEndTime <0.5f)
            //{
            //    return;
            //}
            //有轻功点了出现了 向轻功点移动
            if (m_player.AutoMovetoQGPointId != -1)
            {
                //打断挂机状态
                m_player.BreakAutoCombatState();

                /*if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_YANZIWU)
                 * {
                 *  //燕子坞轻功点移动
                 *  m_player.AutoFightFlyInYanZiWu();
                 * }*/
                m_player.AutoMovetoQGPointId = -1;
                return;
            }
            m_fLastUseEndTime = 0.0f;
            int skillId = SeleSkill();
            if (skillId == -1)
            {
                return;
            }
            Tab_SkillEx skillExInfo = TableManager.GetSkillExByID(skillId, 0);
            if (skillExInfo == null)
            {
                return;
            }
            Tab_SkillBase skillBaseInfo = TableManager.GetSkillBaseByID(skillExInfo.BaseId, 0);
            if (skillBaseInfo == null)
            {
                return;
            }

            Obj_Character CanAttackCharacter = null;
            //如果当前选中的目标是敌对的了 则不需要再次选取目标
            if (m_player.SelectTarget != null && m_player.SelectTarget.IsDie() == false)
            {
                if (Reputation.IsEnemy(m_player.SelectTarget) ||
                    Reputation.IsNeutral(m_player.SelectTarget))
                {
                    CanAttackCharacter = m_player.SelectTarget;
                }
            }

            float skillRadius = skillExInfo.Radius;

            if (CanAttackCharacter == null ||
                (CanAttackCharacter != null && IsDisStartPointTooFar(skillRadius, CanAttackCharacter.Position))
                )
            {
                CanAttackCharacter = SeleCanAttackTar(skillRadius);
            }
            //是否有攻击目标 没有攻击目标就不要自动放技能了
            if (CanAttackCharacter == null)
            {
                /*
                 * if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_ZHENLONGQIJU)
                 * {
                 *  Vector3 pos = new Vector3(18, m_player.gameObject.transform.position.y, 16);
                 *  m_player.MoveTo(pos, null, 0.0f);
                 *
                 * }
                 * if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_YANGWANGGUMU)
                 * {
                 *  Vector3 pos = new Vector3(20, m_player.gameObject.transform.position.y, 21);
                 *  m_player.MoveTo(pos, null, 0.0f);
                 * }
                 *
                 * if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_YANZIWU)
                 * {
                 *  m_player.AutoFightInYanziwu();
                 * }
                 * if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_FOURVILLAIN)
                 * {
                 *  Singleton<ObjManager>.Instance.MainPlayer.AutoFightInFourVillain();
                 * }
                 */
                if (GameManager.gameManager.ActiveScene != null && GameManager.gameManager.ActiveScene.IsStoryCopyScene())
                {
                    if (Singleton <ObjManager> .GetInstance().MainPlayer != null)
                    {
                        if (Singleton <ObjManager> .GetInstance().MainPlayer.AutoComabat)
                        {
                            float x = 0.0f, y = 0.0f, z = 0.0f;
                            if (GameManager.gameManager.ActiveScene.GetGuideDestination(ref x, ref z))
                            {
                                y = GameManager.gameManager.ActiveScene.GetTerrainHeight(new Vector3(x, 0.0f, z));
                                Singleton <ObjManager> .GetInstance().MainPlayer.MoveTo(new Vector3(x, y, z), null, 0.0f);
                            }
                        }
                    }
                }
                return;
            }
            //如果在野外场景攻击其它玩家return;
            if (CanAttackCharacter.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
            {
                if (GameManager.gameManager.ActiveScene.IsWildeScene())
                {
                    return;
                }
            }
            //设置为选中目标
            m_player.OnSelectTarget(CanAttackCharacter.gameObject, false);
            //距离不过 先跑过去
            float dis          = Vector3.Distance(m_player.Position, CanAttackCharacter.Position);
            float diffDistance = dis - skillRadius;
            m_player.CurUseSkillId = skillId;
            //需要向目标移动 则想目标移动
            if (diffDistance > 0 && skillBaseInfo.IsMoveToTarInAutoCombat == 1)
            {
                //move
                if (m_player.IsMoving == false && m_player.IsCanOperate_Move())
                {
                    m_player.MoveTo(CanAttackCharacter.Position, CanAttackCharacter.gameObject, skillRadius - 1.0f);
                    return;
                }
            }
            m_player.UseSkillOpt(skillId, null);
        }
示例#29
0
    void Init(string spriteName, GameObject destGameObject, NEWITEMTYPE type, int IntParam = GlobeVar.INVALID_ID, GameObject attachGameObject = null, string itemName = "", string strFuncName = "", string strDec = "")
    {
        _forShowWin();
        m_destGameObject = destGameObject;
        m_AttachItem.SetActive(false);
        hasAttachSkill = false;
        if (type == NEWITEMTYPE.TYPE_SKILL)
        {
            Dictionary <int, List <Tab_SkillActive> > dicTab_SkillActive = TableManager.GetSkillActive();

            foreach (KeyValuePair <int, List <Tab_SkillActive> > kv in dicTab_SkillActive)
            {
                Tab_SkillActive _skillActive = kv.Value[0];

                //有附带技能
                if (_skillActive.SkillId == IntParam && _skillActive.AttachSkillId != -1)
                {
                    m_AttachItem.SetActive(true);
                    m_NeedToShow           = true;
                    m_AttachItemIcon.atlas = SkillAtlas;


                    Tab_SkillEx _tabSkillEx = TableManager.GetSkillExByID(_skillActive.AttachSkillId, 0);
                    if (_tabSkillEx != null)
                    {
                        Tab_SkillBase _sttachSkillBase = TableManager.GetSkillBaseByID(_tabSkillEx.BaseId, 0);
                        if (_sttachSkillBase != null)
                        {
                            hasAttachSkill = true;
                            m_AttachItemIcon.spriteName = _sttachSkillBase.Icon;
                            m_AttachItemIcon.MakePixelPerfect();
                            m_AttachNameLabel.text = _sttachSkillBase.Name;
                            m_AttachDescLabel.text = _tabSkillEx.SkillDesc;
                            m_AttachItemIcon.gameObject.transform.localScale = Vector3.one;
                        }
                    }
                }
            }

            if (hasAttachSkill)
            {
                m_MainItem.transform.localPosition = new Vector3(12, -84, 0);
            }

            m_ItemIcon.atlas      = SkillAtlas;
            m_ItemIcon.spriteName = spriteName;
            //m_ItemIcon.MakePixelPerfect();
            m_SprTitle.spriteName = "Newjineng";// new skill

            Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(IntParam, 0);
            if (tabSkillEx != null)
            {
                Tab_SkillBase _skillBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
                if (_skillBase != null)
                {
                    m_NameLabel.text = _skillBase.Name;
                    m_DescLabel.text = tabSkillEx.SkillDesc;
                    m_ItemIcon.gameObject.transform.localScale = Vector3.one;
                }
            }
        }
        else if (type == NEWITEMTYPE.TYPE_MENUBAR)
        {
            m_ItemIcon.atlas      = MainMenuBarAtlas;
            m_ItemIcon.spriteName = spriteName;
            //m_ItemIcon.MakePixelPerfect();
            m_ItemIcon.gameObject.transform.localScale = Vector3.one;
            m_SprTitle.spriteName = "Newxitong";
            m_NameLabel.text      = strFuncName;
            m_DescLabel.text      = "      " + strDec;
            m_ItemName.text       = itemName;
        }
        else if (type == NEWITEMTYPE.TYPE_FUNCTION)
        {
            if (IntParam == m_openServerId)
            {
                _hideShowWin();
                // 开服奖励的单独对待
                OpenServer.fakeId          = 67;
                OpenServer.destroyCallBack = () =>
                {
                    if (FunctionButtonLogic.Instance() != null)
                    {
                        FunctionButtonLogic.Instance().ShowTweenPosition();
                    }
                };
                UIManager.ShowUI(UIInfo.OpenServer, (bSuccess, param) =>
                {
                    if (bSuccess && OpenServer.Instance() != null)
                    {
                        OpenServer.Instance().ShowRideDesc();
                    }
                });
            }
            else
            {
                m_ItemIcon.atlas      = MainUIAtlas;
                m_ItemIcon.spriteName = spriteName;
                m_ItemIcon.gameObject.SetActive(!string.IsNullOrEmpty(spriteName));
                m_ItemIcon.MakePixelPerfect();
                m_ItemIcon.gameObject.transform.localScale = Vector3.one;
                m_SprTitle.spriteName = "Newxitong";
                m_NameLabel.text      = strFuncName;
                m_DescLabel.text      = "      " + strDec;
                m_ItemName.text       = itemName;
            }
        }
        else if (type == NEWITEMTYPE.TYPE_QINGGONG)
        {
            m_ItemIcon.atlas      = SkillAtlas;
            m_ItemIcon.spriteName = spriteName;
            m_ItemIcon.MakePixelPerfect();
            m_SprTitle.spriteName = "Newjineng";// new skill

            m_NameLabel.text = StrDictionary.GetClientDictionaryString("#{4584}");
            m_DescLabel.text = "      " + StrDictionary.GetClientDictionaryString("#{4586}");
            m_ItemIcon.gameObject.transform.localScale = 0.7f * Vector3.one;
        }
        else if (type == NEWITEMTYPE.TYPE_FELLOW3DSHOW)
        {
            _hideShowWin();
//            Transform parent = m_ItemIcon.transform.parent;
            m_ItemIcon.atlas = null;
            m_ItemIcon.transform.parent.FindChild("BGSprite").GetComponent <UISprite>().atlas = null;
            m_ItemIcon.transform.parent.FindChild("Sprite").GetComponent <UISprite>().atlas   = null;
            OpenServer.fakeId          = 79;
            OpenServer.destroyCallBack = () =>
            {
                NewItemOnClick();
            };
            UIManager.ShowUI(UIInfo.OpenServer, (bSuccess, param) =>
            {
                if (bSuccess && OpenServer.Instance() != null)
                {
                    OpenServer.Instance().ShowFellowDesc();
                }
            });
        }

        m_ItemTween.Reset();
        m_ItemTween.gameObject.SetActive(false);

        if (hasAttachSkill)
        {
            m_AttachItemTween.Reset();
            if (attachGameObject != null)
            {
                m_AttachItemTween.to = m_AttachItemTween.gameObject.transform.parent.InverseTransformPoint(attachGameObject.transform.position);
            }
        }

        m_ItemType = type;
        m_IntParam = IntParam;
    }
示例#30
0
    //显示装备属性
    public void ShowAttr(GameItem item, bool bUnEquiped = false)
    {
        ClearInfo();
        //获得身上对应槽位的装备
        int      slotindex    = item.GetEquipSlotIndex();
        GameItem compareEquip = GameManager.gameManager.PlayerDataPool.EquipPack.GetItem(slotindex);

        Tab_EquipAttr line = TableManager.GetEquipAttrByID(item.DataID, 0);

        if (line != null)
        {
            int index = 0;
            //血上限
            if (line.HP > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.HP, "HP");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXHP);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.HP * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.HP);
                ++index;
            }
            //血上限(百分比)
            if (line.HPPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.HPPer, "HPPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXHP);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.HPPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //蓝上限
            if (line.MP > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MP, "MP");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXMP);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.MP * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.MP);
                ++index;
            }
            //蓝上限(百分比)
            if (line.MPPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MPPer, "MPPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXMP);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.MPPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //物理攻击
            if (line.PhysicsAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsAttack, "PhysicsAttack");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSATTACK);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.PhysicsAttack * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.PhysicsAttack);
                ++index;
            }
            //物理攻击(百分比)
            if (line.PhysicsAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsAttackPer, "PhysicsAttackPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSATTACK);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.PhysicsAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //法术攻击
            if (line.MagicAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicAttack, "MagicAttack");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGATTACK);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.MagicAttack * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.MagicAttack);
                ++index;
            }
            //法术攻击(百分比)
            if (line.MagicAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicAttackPer, "MagicAttackPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGATTACK);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.MagicAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //物理防御
            if (line.PhysicsDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsDefence, "PhysicsDefence");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSDEF);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.PhysicsDefence * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.PhysicsDefence);
                ++index;
            }
            //物理防御(百分比)
            if (line.PhysicsDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsDefencePer, "PhysicsDefencePer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSDEF);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.PhysicsDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //法术防御
            if (line.MagicDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicDefence, "MagicDefence");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGDEF);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.MagicDefence * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.MagicDefence);
                ++index;
            }
            //法术防御(百分比)
            if (line.MagicDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicDefencePer, "MagicDefencePer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGDEF);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.MagicDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //攻击速度
            if (line.AttackSpeed > 0 && index < m_Attr.Length && index >= 0)
            {
                //策划要求 隐藏装备攻速属性
                //m_Attr[index].text = string.Format("{0}+{1}", ConvertAttrToString(COMBATATTE.ATTACKSPEED), line.AttackSpeed);
                //m_Attr[index].gameObject.SetActive(true);
                ////策划要求 攻速不受强化和打星影响
                //++index;
            }
            //攻击速度(百分比)
            if (line.AttackSpeedPer > 0 && index < m_Attr.Length && index >= 0)
            {
                //策划要求 隐藏装备攻速属性
                //m_Attr[index].text = string.Format("{0}+{1}%", ConvertAttrToString(COMBATATTE.ATTACKSPEED), line.AttackSpeedPer * 100);
                //m_Attr[index].gameObject.SetActive(true);
                //++index;
            }
            //全攻击
            if (line.AllAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllAttack, "AllAttack");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1000);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.AllAttack * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.AllAttack);
                ++index;
            }
            //全攻击(百分比)
            if (line.AllAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllAttackPer, "AllAttackPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1000);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.AllAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //全防御
            if (line.AllDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllDefence, "AllDefence");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1001);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.AllDefence * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.AllDefence);
                ++index;
            }
            //全防御(百分比)
            if (line.AllDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllDefencePer, "AllDefencePer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1001);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.AllDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            // delete cut lines
            //if (index >= 1)
            //{
            //    if ((index - 1) >= 0 && (index - 1) < m_CutLine.Length)
            //    {
            //        m_CutLine[index - 1].SetActive(true);
            //    }

            //}
            //附加属性
            for (int attrIndex = 0; attrIndex < line.getAddAttrTypeCount(); ++attrIndex)
            {
                int   attrType  = line.GetAddAttrTypebyIndex(attrIndex);
                float attrValue = line.GetAddAttrValuebyIndex(attrIndex);
                if ((attrType >= (int)COMBATATTE.MAXHP && attrType < (int)COMBATATTE.COMBATATTE_MAXNUM) || attrType == 1000 || attrType == 1001)
                {
                    if (attrValue > 0)
                    {
                        if (index < m_Attr.Length && index >= 0)
                        {
                            //策划要求隐藏装备攻速属性
                            if (attrType == (int)COMBATATTE.ATTACKSPEED)
                            {
                                continue;
                            }

                            string strColor = GetAttrColor(bUnEquiped, compareEquip, attrValue, "AddAttr", attrIndex);
                            m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)attrType);
                            m_AttrValue[index].text = strColor + string.Format("+{0}", (int)attrValue);
                            m_AttrWhole[index].SetActive(true);
                            if (attrType != (int)COMBATATTE.ATTACKSPEED) //策划要求 攻速不受强化和打星影响
                            {
                                //强化
                                SetEnchanceAndStarAttr(item, index, attrValue, true);
                                //策划要求 附加属性不受打星影响
                            }
                            ++index;
                        }
                    }
                }
            }
            //附加属性(百分比)
            for (int attrIndex = 0; attrIndex < line.getAddAttrTypeCount(); ++attrIndex)
            {
                int   attrType = line.GetAddAttrTypebyIndex(attrIndex);
                float attrPer  = line.GetAddAttrPerbyIndex(attrIndex);
                if (attrType >= (int)COMBATATTE.MAXHP && attrType < (int)COMBATATTE.COMBATATTE_MAXNUM && attrPer > 0)
                {
                    if (index < m_Attr.Length && index >= 0)
                    {
                        string strColor = GetAttrColor(bUnEquiped, compareEquip, attrPer, "AddAttrPer", attrIndex);

                        m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)attrIndex);
                        m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(attrPer * 100));
                        m_AttrWhole[index].SetActive(true);
                        ++index;
                    }
                }
            }

            //神器属性
            if (item != null && item.IsShenQiEquipMent())
            {
                Tab_ShenQiInfo _ShenQiInfo = TableManager.GetShenQiInfoByID(item.DataID, 0);
                if (_ShenQiInfo != null)
                {
                    //   技能信息
                    int SkillInfIndex = (int)ShenQiDyData.SkillId;
                    if (SkillInfIndex >= 0 && SkillInfIndex < item.DynamicData.Length)
                    {
                        Tab_SkillEx _skillEx = TableManager.GetSkillExByID(item.DynamicData[(int)ShenQiDyData.SkillId], 0);
                        if (_skillEx != null)
                        {
                            Tab_SkillBase _SkillBase = TableManager.GetSkillBaseByID(_skillEx.BaseId, 0);
                            if (_SkillBase != null)
                            {
                                // delete cut lines
                                //if (index >= 1 && index - 1 < m_CutLine.Length)
                                //{
                                //    m_CutLine[index - 1].SetActive(true);
                                //}
                                m_ShenQiSkillNameLable.text = _SkillBase.Name + "(" + _skillEx.Level + "/" + _ShenQiInfo.MaxSkillLev + ")";
                                m_ShenQiSkillDescLable.text = _skillEx.SkillDesc;
                                m_ShenQiSkillName.SetActive(true);
                                m_ShenQiSkillDesc.SetActive(true);
                            }
                        }
                    }
                    //属性条
                    int nLastAttrIndex = -1;
                    for (int i = 0; i < (int)ShenQiInfo.MAXRANDATTRNUM && i < m_ShenQiAttrWhole.Length; i++)
                    {
                        if (i + (int)ShenQiDyData.Attr1Info >= 0 && i + (int)ShenQiDyData.Attr1Info < item.DynamicData.Length)
                        {
                            int AttrRandData = item.DynamicData[i + (int)ShenQiDyData.Attr1Info];
                            if (AttrRandData > 0)
                            {
                                int AttrType    = item.GetShenQiRandAttrType(AttrRandData);
                                int AttrNum     = item.GetShenQiRandAttrNum(AttrRandData);
                                int AttrQuality = item.GetShenQiRandAttrQuality(AttrRandData);
                                m_ShenQiAttrName[i].text = Utils.GetItemNameColor(AttrQuality + 1) + Utils.GetAttrTypeString(AttrType);
                                //if (1 + _ShenQiInfo.ShenQiRefixPer > 0 && _ShenQiInfo.ShenQiRefixPer > 0)
                                //{
                                //    int nBaseAttr = (int)((AttrNum * 1.0f) / (1 + _ShenQiInfo.ShenQiRefixPer));
                                //    int nFixAttr = (int)(AttrNum * _ShenQiInfo.ShenQiRefixPer);
                                //    m_ShenQiAttrValue[i].text = Utils.GetItemNameColor(AttrQuality+1) + "+" + nBaseAttr.ToString() + "+" + nFixAttr.ToString();
                                //}
                                //else
                                {
                                    m_ShenQiAttrValue[i].text = Utils.GetItemNameColor(AttrQuality + 1) + "+" + AttrNum;
                                }
                                m_ShenQiAttrWhole[i].SetActive(true);
                                nLastAttrIndex = i;
                            }
                        }
                    }
                    //分界线
                    //   m_ShenQiSkillCutLine.SetActive(true);
                    if (nLastAttrIndex >= 0 && nLastAttrIndex < m_ShenQiAttrCutLine.Length)
                    {
                        m_ShenQiAttrCutLine[nLastAttrIndex].SetActive(true);
                    }
                    //m_ShenQiCutLine2.SetActive(true);
                }
            }
            //m_Grid.Reposition();
            //m_TopGrid.Recenter(true);
            m_Table.sorted          = true;
            m_Table.hideInactive    = true;
            m_Table.keepWithinPanel = true;
            m_Table.repositionNow   = true;
        }
    }