예제 #1
0
    void OnFriendFellowPress()
    {
        if (false == GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.IsValid())
        {
            return;
        }

        Tab_CabalFellowAttr tabFellow = TableManager.GetCabalFellowAttrByID(GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.DataId, 0);

        if (tabFellow == null)
        {
            return;
        }

        Tab_CabalFellowTallentSkill tabTalent = TableManager.GetCabalFellowTallentSkillByID(GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.TalentSkill, 0);

        if (tabTalent == null)
        {
            return;
        }

        m_PartnerAttrWindow.SetActive(true);
        m_PartnerAttrWindow.transform.localPosition = new Vector3(200, 0, 0);

        m_PartnerAttr_HeadIcon.spriteName      = tabFellow.Icon;
        m_PartnerAttr_Quality.spriteName       = FellowTool.GetFellowQualityFrame(GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.Quality);
        m_PartnerAttr_Name.text                = GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.Name;
        m_PartnerAttr_Lucky.text               = GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.Lucky.ToString();
        m_PartnerAttr_Level.text               = GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.Level.ToString();
        m_PartnerAttr_TalentIcon.spriteName    = tabTalent.Icon;
        m_PartnerAttr_TalentQuality.spriteName = FellowTool.GetFellowTallentSkillQualityPic(tabTalent.Id);
        m_PartnerAttr_TalentName.text          = tabTalent.Name;
        m_PartnerAttr_TalentDesc.text          = tabTalent.SkillDesc;
    }
예제 #2
0
        public int GetBaseStarExp()
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);

            if (line != null)
            {
                switch ((FELLOWQUALITY)m_nQuality)
                {
                case FELLOWQUALITY.WHITE:
                    return(line.StarExpWhite);

                case FELLOWQUALITY.GREEN:
                    return(line.StarExpGreen);

                case FELLOWQUALITY.BLUE:
                    return(line.StarExpBlue);

                case FELLOWQUALITY.PURPLE:
                    return(line.StarExpPurple);

                case FELLOWQUALITY.ORANGE:
                    return(line.StarExpOrange);

                default:
                    return(line.StarExpWhite);
                }
            }
            return(0);
        }
예제 #3
0
        /// <summary>
        /// 伙伴普攻ID
        /// </summary>
        /// <returns></returns>
        public int GetFirstSkillId()
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);

            if (line != null)
            {
                return(line.FirstSkillId);
            }
            return(-1);
        }
예제 #4
0
        /// <summary>
        /// 头像
        /// </summary>
        /// <returns></returns>
        public string GetIcon()
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);

            if (line != null)
            {
                return(line.Icon);
            }
            return(null);
        }
예제 #5
0
        /// <summary>
        /// 伙伴分类ID 1动物 2人形
        /// </summary>
        /// <returns></returns>
        public int GetClassId()
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);

            if (line != null)
            {
                return(line.ClassId);
            }
            return(0);
        }
예제 #6
0
        public int GetCallLevel()
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);

            if (line != null)
            {
                return(line.CallLevel);
            }
            return(GlobeVar.INVALID_ID);
        }
예제 #7
0
        public int GetBlessValueByStar(int starLv)
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);

            if (line == null)
            {
                return(GlobeVar.INVALID_ID);
            }

            return(m_BaseBless + (m_nLevel - 1) * line.LevelAddBless + GetAttach_Bless(starLv));
        }
예제 #8
0
        public int GetGuardValue()
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);

            if (line == null)
            {
                return(GlobeVar.INVALID_ID);
            }

            return(m_BaseGuard + (m_nLevel - 1) * line.LevelAddGuard + GetAttach_Guard(m_nStarLevel));
        }
예제 #9
0
 /// <summary>
 /// IsValid
 /// </summary>
 /// <returns></returns>
 public bool IsValid()
 {
     if (m_nDataId >= 0)
     {
         Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);
         if (line != null)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #10
0
    void UpdateFellowInfo_Model(Fellow fellow)
    {
        if (m_FakeObjGameObject == null || m_PartnerFakeObj == null)
        {
            if (m_PartnerFakeObj != null)
            {
                DestroyPartnerFakeObj();
            }

            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(fellow.DataId, 0);
            if (line == null)
            {
                return;
            }
            int fakeObjId = line.FakeObjId;

            m_PartnerFakeObj = new FakeObject();
            if (m_PartnerFakeObj == null)
            {
                return;
            }

            m_PartnerFakeObj.initFakeObject(fakeObjId, GameManager.gameManager.ActiveScene.FakeObjTrans, out m_FakeObjGameObject);
            m_ModelDrag.ModelTrans = m_PartnerFakeObj.ObjAnim.transform;
        }
        else
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(fellow.DataId, 0);
            if (line == null)
            {
                return;
            }
            int fakeObjId = line.FakeObjId;

            Tab_FakeObject FakeObjTable = TableManager.GetFakeObjectByID(fakeObjId, 0);
            if (FakeObjTable == null)
            {
                return;
            }

            Singleton <ObjManager> .GetInstance().ReloadModel(m_FakeObjGameObject,
                                                              FakeObjTable.FakeObjModel,
                                                              Singleton <ObjManager> .GetInstance().AsycLoadFakeObjOver,
                                                              FakeObjTable,
                                                              m_PartnerFakeObj);
        }
    }
예제 #11
0
        public int GetAttach_Bless(int starLv)
        {
            Tab_CabalFellowAttr lineAttr = TableManager.GetCabalFellowAttrByID(m_nDataId, 0);
            Tab_CabalFellowStar lineStar = TableManager.GetCabalFellowStarByID(starLv, 0);

            if (lineAttr != null && lineStar != null)
            {
                int nAddValue = 0;
                if (starLv > 0)
                {
                    nAddValue = lineStar.GetAttachAttrbyIndex((int)FELLOWATTR.FELLOWATTR_BLESS);
                }
                float result = (float)lineAttr.AttachBlessRatio * 0.01f * (nAddValue + lineAttr.AttachBlessOffset);
                return((int)result);
            }
            return(0);
        }
예제 #12
0
 void SetNameLabel()
 {
     if (m_eItemType == ITEM_TYPE.TYPE_ITEM)
     {
         Tab_CommonItem tabCommonItem = TableManager.GetCommonItemByID(m_ItemID, 0);
         if (tabCommonItem != null)
         {
             m_Name           = tabCommonItem.Name;
             m_NameLabel.text = m_Name;
             int nExistTime = tabCommonItem.ExistTime;
             if (nExistTime > 0)
             {
                 m_NameLabel.text += StrDictionary.GetClientDictionaryString("#{3316}", (float)nExistTime / 60f / 24f);
             }
         }
     }
     else if (m_eItemType == ITEM_TYPE.TYPE_FASHION)
     {
         Tab_FashionData tabFashionData = TableManager.GetFashionDataByID(m_ItemID, 0);
         if (tabFashionData != null)
         {
             m_Name           = tabFashionData.Name;
             m_NameLabel.text = m_Name;
         }
     }
     else if (m_eItemType == ITEM_TYPE.TYPE_FELLOW)
     {
         Tab_CabalFellowAttr tabFellowAttr = TableManager.GetCabalFellowAttrByID(m_ItemID, 0);
         if (tabFellowAttr != null)
         {
             m_Name           = tabFellowAttr.Name;
             m_NameLabel.text = m_Name;
         }
     }
     else if (m_eItemType == ITEM_TYPE.TYPE_MOUNT)
     {
         Tab_MountBase tabMountBase = TableManager.GetMountBaseByID(m_ItemID, 0);
         if (tabMountBase != null)
         {
             m_Name           = tabMountBase.Name;
             m_NameLabel.text = m_Name;
         }
     }
 }
    bool ShowPet(int petId)
    {
        Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(petId, 0);

        if (line == null)
        {
            return(false);
        }
        int fakeObjId = line.FakeObjId;

        Tab_FakeObject FakeObjTable = TableManager.GetFakeObjectByID(fakeObjId, 0);

        if (FakeObjTable == null)
        {
            return(false);
        }

        m_FakeObj = new FakeObject();
        if (m_FakeObj == null)
        {
            return(false);
        }

        if (false == m_FakeObj.initFakeObject(fakeObjId, GameManager.gameManager.ActiveScene.FakeObjTrans))
        {
            return(false);
        }
        m_ModelDrag.ModelTrans = m_FakeObj.ObjAnim.transform;

        GameManager.gameManager.ActiveScene.InitFakeObjRoot(m_FakeObjLeft, m_FakeObjRight);
        GameManager.gameManager.ActiveScene.ShowFakeObj();
        return(true);

//         Singleton<ObjManager>.GetInstance().ReloadModel(m_FakeObjGameObject,
//             FakeObjTable.FakeObjModel,
//             Singleton<ObjManager>.GetInstance().AsycLoadFakeObjOver,
//             FakeObjTable,
//             m_PartnerFakeObj);
    }
예제 #14
0
    public void OnRebirthClick(Fellow fellow)
    {
        if (fellow == null)
        {
            return;
        }

        if (false == fellow.IsValid())
        {
            return;
        }

        Tab_CabalFellowAttr tabAttr = TableManager.GetCabalFellowAttrByID(fellow.DataId, 0);

        if (tabAttr == null)
        {
            return;
        }

        Tab_CabalFellowAttr tabBaby = TableManager.GetCabalFellowAttrByID(tabAttr.BabyFellowId, 0);

        if (tabBaby == null)
        {
            LogModule.ErrorLog("The fellow has not baby state, fellow id = " + fellow.DataId);
            return;
        }

        m_CurFellowIcon.spriteName         = fellow.GetIcon();
        m_CurFellowQualityFrame.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
        m_CurFellowNameLabel.text          = fellow.Name;
        m_RebirthFellowIcon.spriteName     = tabBaby.Icon;
        m_RebirthFellowNameLabel.text      = tabBaby.Name;
        m_RebirthItemSlot.InitInfo_Yuanbao(null, GlobeVar.PARTNER_REBIRTH_YUANBAO.ToString(), true);

        m_RebirthWindow.SetActive(true);

        m_FellowBuffer = fellow;
    }
예제 #15
0
        //创建伙伴
        public static void CreateFellowModel(Obj_Init_Data initData)
        {
            if (null == initData)
            {
                return;
            }

            Tab_CabalFellowAttr fellowAttr = TableManager.GetCabalFellowAttrByID(initData.m_RoleBaseID, 0);

            if (null == fellowAttr)
            {
                return;
            }
            //根据ModelId找到CharModel资源
            Tab_CharModel charModel = TableManager.GetCharModelByID(fellowAttr.ModelId, 0);

            if (null == charModel)
            {
                return;
            }
            GameObject fellow = ResourceManager.InstantiateResource("Prefab/Model/FellowRoot", initData.m_ServerID.ToString()) as GameObject;

            if (null != fellow)
            {
                //加载逻辑体,同时异步加载渲染体
                Obj_Fellow objFellow = fellow.AddComponent <Obj_Fellow>();

                if (objFellow && objFellow.Init(initData))
                {
                    objFellow.CanLogic = true;
                    Singleton <ObjManager> .Instance.AddPoolObj(objFellow.ServerID.ToString(), objFellow);
                }
                LoadModelToRoot(fellowAttr.ModelId, EResourceType.CharacterModel, LoadModelComplete, fellow, charModel,
                                null);
                //ReloadModel(fellow, charModel.ResPath, AsycCreateFellowOver, initData);
            }
        }
예제 #16
0
    void HandleFitOnFellow(int nGoodsId, int nFellowID)
    {
        m_FitOnVisual.Clear();

        Tab_CabalFellowAttr tabFellowAttr = TableManager.GetCabalFellowAttrByID(nFellowID, 0);

        if (tabFellowAttr == null)
        {
            return;
        }

        Tab_FakeObject tabFakeObject = TableManager.GetFakeObjectByID(tabFellowAttr.FakeObjId, 0);

        if (tabFakeObject == null)
        {
            return;
        }

        m_FitOnVisual.FellowGoodsID = nGoodsId;
        m_FitOnVisual.FellowID      = nFellowID;

        m_FitOnFakeObj.initFakeObject(tabFellowAttr.FakeObjId, GameManager.gameManager.ActiveScene.FakeObjTrans, out m_FitOnGameObject);
        m_ModelDrag.ModelTrans = m_FitOnFakeObj.ObjAnim.transform;
    }
예제 #17
0
        public override bool Init(Obj_Init_Data initData)
        {
            if (null == m_ObjTransform)
            {
                m_ObjTransform = gameObject.transform;
            }

            m_ObjTransform.position = ActiveScene.GetTerrainPosition(new Vector3(initData.m_fX, 0, initData.m_fZ));

            //暂时 写死了 后面再用服务器
            m_ObjTransform.Rotate(Vector3.up * 135);

            //服务器发过来的信息
            this.ServerID       = initData.m_ServerID;
            BaseAttr.RoleBaseID = initData.m_RoleBaseID;
            BaseAttr.RoleName   = initData.m_StrName;
            m_OwnerObjId        = initData.m_OwnerObjId;
            StealthLev          = initData.m_StealthLev;
            m_Quality           = initData.m_FellowQuality;
            OptStealthLevChange();
            //防止伙伴追上人物导致动作不流畅 把客户端主角伙伴速度修改为和人物一样
            if (IsOwnedByMainPlayer() == true)
            {
                Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjId = ServerID;

                Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjGuid = initData.m_Guid;

                BaseAttr.MoveSpeed = Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.MoveSpeed;
            }
            else
            {
                Obj_OtherPlayer otherPlayer = Singleton <ObjManager> .Instance.FindObjInScene(m_OwnerObjId) as Obj_OtherPlayer;

                if (null != otherPlayer)
                {
                    otherPlayer.FellowID = ServerID;
                    m_bVisible           = otherPlayer.IsVisibleChar();
                }

                BaseAttr.MoveSpeed = initData.m_MoveSpeed;
            }
            Tab_CabalFellowAttr fellowAttrTab = TableManager.GetCabalFellowAttrByID(BaseAttr.RoleBaseID, 0);

            if (fellowAttrTab != null)
            {
                //初始化CharModelID,并读取部分客户端信息
                ModelID = fellowAttrTab.ModelId;
                Tab_CharModel charModel = TableManager.GetCharModelByID(ModelID, 0);
                if (null != charModel)
                {
                    BaseAttr.HeadPic = charModel.HeadPic;
                    //设置动作路径
                    AnimationFilePath = charModel.AnimPath;
                    //设置名字版高度
                    DeltaHeight = charModel.HeadInfoHeight;

                    m_ObjTransform.localScale    = new Vector3(charModel.Scale, charModel.Scale, charModel.Scale);
                    m_ObjTransform.localRotation = Utils.DirServerToClient(initData.m_fDir);
                }
            }


            //初始化寻路代理
            InitNavAgent();

            //初始化AutoMove功能模块
            //if (gameObject.GetComponent<AutoMove>() == null)
            //{
            gameObject.AddComponent <AutoMove>();
            //}

            //初始化动画,需要在AnimationFilePath被赋值后进行
            if (AnimLogic == null)
            {
                AnimLogic = gameObject.AddComponent <AnimationLogic>();
            }
            //初始化特效
            if (ObjEffectController == null)
            {
                ObjEffectController = gameObject.AddComponent <CharacterEffectBehaviourController>();
            }

            //召出播放特效
            if (Singleton <ObjManager> .GetInstance().MainPlayer != null)
            {
                if (m_OwnerObjId == Singleton <ObjManager> .GetInstance().MainPlayer.ServerID)
                {
                    if (GameManager.gameManager.PlayerDataPool.FellowPlayerEffect == true)
                    {
                        //PlayEffect(52);
                        GameManager.gameManager.PlayerDataPool.FellowPlayerEffect = false;
                    }
                }
            }

            if (IsDie())
            {
                OnCorpse();
            }
            else
            {
                if (Objanimation != null)
                {
                    Objanimation.Stop();
                }
                CurObjAnimState = Games.GlobeDefine.GameDefine_Globe.OBJ_ANIMSTATE.STATE_NORMOR;
            }

            InitNameBoard();

            return(base.Init(initData));
        }
예제 #18
0
    void UpdateFriendFellowModel()
    {
        if (false == GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.IsValid())
        {
            DestroyFriendPartnerFakeObj();
            return;
        }

        int nFriendFellowDataId = GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.DataId;

        m_FriendLockFlag.SetActive(nFriendFellowDataId == GlobeVar.INVALID_ID);
        m_FriendTips.SetActive(nFriendFellowDataId == GlobeVar.INVALID_ID);
        if (nFriendFellowDataId == GlobeVar.INVALID_ID)
        {
            DestroyFriendPartnerFakeObj();
            return;
        }
        if (m_FriendFakeObjGameObject == null || m_FriendPartnerFakeObj == null)
        {
            if (m_FriendPartnerFakeObj != null)
            {
                DestroyFriendPartnerFakeObj();
            }

            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(nFriendFellowDataId, 0);
            if (line == null)
            {
                return;
            }
            int fakeObjId = line.FakeObjId;

            m_FriendPartnerFakeObj = new FakeObject();
            if (m_FriendPartnerFakeObj == null)
            {
                return;
            }

            m_FriendPartnerFakeObj.initFakeObject(fakeObjId, m_FriendFellowModel, out m_FriendFakeObjGameObject);
        }
        else
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(nFriendFellowDataId, 0);
            if (line == null)
            {
                return;
            }
            int fakeObjId = line.FakeObjId;

            Tab_FakeObject FakeObjTable = TableManager.GetFakeObjectByID(fakeObjId, 0);
            if (FakeObjTable == null)
            {
                return;
            }

            Singleton <ObjManager> .GetInstance().ReloadModel(m_FriendFakeObjGameObject,
                                                              FakeObjTable.FakeObjModel,
                                                              Singleton <ObjManager> .GetInstance().AsycLoadFakeObjOver,
                                                              FakeObjTable,
                                                              m_FriendPartnerFakeObj);
        }
    }
예제 #19
0
    void UpdateChooseFellowModel(int nChooseDataId = GlobeVar.INVALID_ID)
    {
        // 用于加载玩家所选伙伴模型
        // 在未开始繁殖时 nChooseDataId = GlobeVar.INVALID_ID 使用脚本中m_BabyFellow的dataid
        // 在繁殖中时 因为会将所选伙伴从伙伴槽中删除 所以需要传参nChooseDataId 来加载对应模型

        int nFellowDataId = GlobeVar.INVALID_ID;

        if (nChooseDataId == GlobeVar.INVALID_ID)
        {
            if (m_BabyFellow == null)
            {
                return;
            }
            nFellowDataId = m_BabyFellow.DataId;
        }
        else
        {
            nFellowDataId = nChooseDataId;
        }

        if (nFellowDataId == GlobeVar.INVALID_ID)
        {
            return;
        }

        if (m_ChooseFakeObjGameObject == null || m_ChoosePartnerFakeObj == null)
        {
            if (m_ChoosePartnerFakeObj != null)
            {
                DestroyPartnerFakeObj();
            }

            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(nFellowDataId, 0);
            if (line == null)
            {
                return;
            }
            int fakeObjId = line.FakeObjId;

            m_ChoosePartnerFakeObj = new FakeObject();
            if (m_ChoosePartnerFakeObj == null)
            {
                return;
            }

            m_ChoosePartnerFakeObj.initFakeObject(fakeObjId, m_PlayerFellowModel, out m_ChooseFakeObjGameObject);
        }
        else
        {
            Tab_CabalFellowAttr line = TableManager.GetCabalFellowAttrByID(nFellowDataId, 0);
            if (line == null)
            {
                return;
            }
            int fakeObjId = line.FakeObjId;

            Tab_FakeObject FakeObjTable = TableManager.GetFakeObjectByID(fakeObjId, 0);
            if (FakeObjTable == null)
            {
                return;
            }

            Singleton <ObjManager> .GetInstance().ReloadModel(m_ChooseFakeObjGameObject,
                                                              FakeObjTable.FakeObjModel,
                                                              Singleton <ObjManager> .GetInstance().AsycLoadFakeObjOver,
                                                              FakeObjTable,
                                                              m_ChoosePartnerFakeObj);
        }
    }