예제 #1
0
        public static void ChangeOtherPLayerObjToNormal(Obj_OtherPlayer otherPlayer)
        {
            Tab_ItemVisual tabItemVisual = TableManager.GetItemVisualByID(otherPlayer.ModelVisualID, 0);

            if (tabItemVisual == null)
            {
                tabItemVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
                if (tabItemVisual == null)
                {
                    return;
                }
            }

            int nCharmodelID = otherPlayer.GetCharModelID(tabItemVisual, otherPlayer.Profession);

            Tab_CharModel charModel = TableManager.GetCharModelByID(nCharmodelID, 0);

            if (charModel == null)
            {
                return;
            }

            otherPlayer.AnimationFilePath = charModel.AnimPath;
            otherPlayer.ModelID           = nCharmodelID;
            LoadModelToRoot(nCharmodelID, EResourceType.CharacterModel,
                            LoadModelComplete, otherPlayer.gameObject, charModel, false);
        }
예제 #2
0
    static public void CancelEquipFlyWing(Obj_OtherPlayer playerObj, bool isClear = true)
    {
        if (playerObj != null && playerObj.gameObject != null)
        {
            Transform gFlyWingtransform = null;
            if (playerObj.MountObj != null && playerObj.MountObj.gameObject != null)
            {
                gFlyWingtransform = playerObj.MountObj.gameObject.transform.FindChild(GlobeVar.STR_FATHER_MODE_NAME + "/" + GlobeVar.STR_MODE_NAME);
            }
            else
            {
                gFlyWingtransform = playerObj.gameObject.transform.FindChild(GlobeVar.STR_FATHER_MODE_NAME + "/" + GlobeVar.STR_MODE_NAME);
            }

            if (gFlyWingtransform == null || gFlyWingtransform.gameObject == null)
            {
                DestoryFlyWing(playerObj);
                return;
            }

            gFlyWingtransform.parent = null;
            playerObj.FlyWingObj     = null;
            playerObj.ObjEffectController.OnCancalFlyWing();
            Destroy(gFlyWingtransform.gameObject);
        }
    }
예제 #3
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_MOUNT_DATA packet = (GC_MOUNT_DATA )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            int nObjServerID = packet.ObjServerID;
            int nMountID     = packet.MountID;

            int EnterSceneServerID = GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterSceneServerID;

            // Çг¡¾°»º´æ
            if (EnterSceneServerID == nObjServerID)
            {
                GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterSceneMountID = nMountID;
            }
            else
            {
                Obj_Character obj = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(nObjServerID);

                if (obj)
                {
                    if (obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER ||
                        obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
                    {
                        Obj_OtherPlayer Player = obj as Obj_OtherPlayer;
                        Player.ShowRideOnEffect = true;
                        Player.RideOrUnMount(nMountID);
                    }

                    else
                    {
                        if (nMountID == GlobeVar.INVALID_ID)
                        {
                            Obj_MainPlayer main = Singleton <ObjManager> .Instance.MainPlayer;
                            if (main != null)
                            {
                                main.RideOrUnMount(nMountID);
                            }
                        }
                    }
                }
                else
                {
                    if (nMountID == GlobeVar.INVALID_ID)
                    {
                        Obj_MainPlayer main = Singleton <ObjManager> .Instance.MainPlayer;
                        if (main != null)
                        {
                            main.RideOrUnMount(nMountID);
                        }
                    }
                }
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_BROADCASTPSSTATE packet = (GC_BROADCASTPSSTATE)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            Obj_OtherPlayer _otherPlayer = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(packet.ObjId) as Obj_OtherPlayer;

            if (_otherPlayer)
            {
                _otherPlayer.PaoShangState = packet.State;
                _otherPlayer.UpdatePaoShangStateEffect(_otherPlayer.PaoShangState);
                if (ReliveLogic.Instance() != null)
                {
                    if (Singleton <ObjManager> .GetInstance().MainPlayer != null &&
                        Singleton <ObjManager> .GetInstance().MainPlayer.ServerID == _otherPlayer.ServerID)
                    {
                        ReliveLogic.Instance().ChangeShowInfoPaoShangChange();
                    }
                }
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
예제 #5
0
    // 创建坐骑
    public void InitMount(Obj_OtherPlayer PlayerObj, int nMountID)
    {
        if (PlayerObj == null)
        {
            return;
        }

        Tab_MountBase MountBase = TableManager.GetMountBaseByID(nMountID, 0);

        if (null == MountBase)
        {
            LogModule.DebugLog("MountBase.txt has not Line ID=" + nMountID);
            return;
        }
        Tab_CharMount MountTable = TableManager.GetCharMountByID(MountBase.ModelID, 0);

        if (MountTable == null)
        {
            LogModule.DebugLog("CharMount.txt has not Line ID=" + MountBase.ModelID);
            return;
        }
        GameObject Obj = PlayerObj.gameObject;

        if (Obj == null)
        {
            return;
        }

        //PlayerObj.MountID = nMountID;
        m_PlayerObj = PlayerObj;

        Singleton <ObjManager> .GetInstance().ReloadModel(Obj, MountTable.MountModel, Obj_Mount.OnAsycLoadMount, PlayerObj, MountTable.BindPoint);
    }
예제 #6
0
    void Start()
    {
        if (m_BindObj != null)
        {
            Obj_OtherPlayer objOtherPlayer = m_BindObj.GetComponent <Obj_OtherPlayer>();
            if (null != objOtherPlayer)
            {
                // 关于直接创建坐骑上的玩家的名字板高度修正 应该也会执行一次Obj_Mount的RideMount 相当于设置了两次高度 没什么大影响 暂时不删除此处
                m_fDeltaHeight = objOtherPlayer.DeltaHeight + objOtherPlayer.GetMountNameBoardHeight();
            }
            else
            {
                Obj_Character objCharacter = m_BindObj.GetComponent <Obj_Character>();
                if (null != objCharacter)
                {
                    m_fDeltaHeight = objCharacter.DeltaHeight;
                }
            }

            m_Position     = new Vector3(0, m_fDeltaHeight, 0);
            m_BindObjTrans = m_BindObj.transform;
        }

        m_Transform = transform;
    }
예제 #7
0
        public virtual void UpdateOtherPlayerChangeState(int nChangeState)
        {
            if (ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
            {
                Obj_OtherPlayer otherPlayer = this as Obj_OtherPlayer;
                if (nChangeState == (int)Games.GlobeDefine.GameDefine_Globe.ChangeModeState.CHANGE_2 ||
                    nChangeState == (int)Games.GlobeDefine.GameDefine_Globe.ChangeModeState.CHANGE_1 ||
                    nChangeState == (int)Games.GlobeDefine.GameDefine_Globe.ChangeModeState.NORMAL)
                {
                    if (otherPlayer.IsLoadingModel)
                    {
                        otherPlayer.WaitChangeState = nChangeState;
                        return;
                    }
                }

                if (nChangeState != otherPlayer.CurChangeState)
                {
                    otherPlayer.CurChangeState = nChangeState;

                    otherPlayer.IsLoadingModel = true;
                    otherPlayer.ChangeModeVisual(otherPlayer.CurChangeState);
                }
            }
        }
예제 #8
0
    public override void OnWeaponEquOk(Tab_WeaponModel tabData)
    {
        OnWeaponUnEquOk();
        if (tabData == null)
        {
            return;
        }
        base.OnWeaponEquOk(tabData);
        Obj_OtherPlayer otherPlayer = m_cachedObjCharacter as Obj_OtherPlayer;

        if (otherPlayer != null && (otherPlayer.LWeaponObject != null || otherPlayer.RWeaponObject))
        {
            Transform effectPointBone;
            if (otherPlayer.LWeaponObject != null)
            {
                effectPointBone = otherPlayer.LWeaponObject.transform.Find(tabData.LWeaponBindPointPath);
                if (effectPointBone != null)
                {
                    if (m_effectBindPointCache.ContainsKey(GlobeVar.EFFECT_BIND_POINT_LWEAPON))
                    {
                        m_effectBindPointCache[GlobeVar.EFFECT_BIND_POINT_LWEAPON] = effectPointBone.gameObject;
                    }
                    else
                    {
                        m_effectBindPointCache.Add(GlobeVar.EFFECT_BIND_POINT_LWEAPON, effectPointBone.gameObject);
                    }
                    m_effectBindPointsOnWeaponList.Add(GlobeVar.EFFECT_BIND_POINT_LWEAPON);
                }
            }
            if (otherPlayer.RWeaponObject != null)
            {
                effectPointBone = otherPlayer.RWeaponObject.transform.Find(tabData.RWeaponBindPointPath);
                if (effectPointBone != null)
                {
                    if (m_effectBindPointCache.ContainsKey(GlobeVar.EFFECT_BIND_POINT_RWEAPON))
                    {
                        m_effectBindPointCache[GlobeVar.EFFECT_BIND_POINT_RWEAPON] = effectPointBone.gameObject;
                    }
                    else
                    {
                        m_effectBindPointCache.Add(GlobeVar.EFFECT_BIND_POINT_RWEAPON, effectPointBone.gameObject);
                    }
                    m_effectBindPointsOnWeaponList.Add(GlobeVar.EFFECT_BIND_POINT_RWEAPON);
                }
            }

            int count = tabData.getWeaponEffectCount();
            int effectId;
            for (int i = 0; i < count; i++)
            {
                effectId = tabData.GetWeaponEffectbyIndex(i);
                if (effectId >= 0)
                {
                    PlayEffect(effectId);
                }
            }
        }
    }
예제 #9
0
    static void OnLoadHeadInfo(GameObject resObj, object parent, object fun)
    {
        if (null != resObj)
        {
            if (null != GameManager.gameManager.ActiveScene.NameBoardRoot)
            {
                resObj.transform.parent = GameManager.gameManager.ActiveScene.NameBoardRoot.transform;
            }

            resObj.transform.localPosition = Vector3.zero;
            resObj.transform.localRotation = Quaternion.LookRotation(Vector3.forward);
            BillBoard billboard = resObj.GetComponent <BillBoard>();
            if (null == billboard)
            {
                billboard = resObj.AddComponent <BillBoard>();
                if (null != billboard)
                {
                    billboard.BindObj = parent as GameObject;
                }
            }
            else
            {
                billboard.BindObj = parent as GameObject;
                billboard.enabled = true;
            }

            //由于会复用,所以需要重新设置名字版的高度修正
            if (null != billboard && null != billboard.BindObj)
            {
                Obj_OtherPlayer objOtherPlayer = billboard.BindObj.GetComponent <Obj_OtherPlayer>();
                if (null != objOtherPlayer)
                {
                    billboard.fDeltaHeight = objOtherPlayer.DeltaHeight + objOtherPlayer.GetMountNameBoardHeight();
                }
                else
                {
                    Obj_Character objCharacter = billboard.BindObj.GetComponent <Obj_Character>();
                    if (null != objCharacter)
                    {
                        billboard.fDeltaHeight = objCharacter.DeltaHeight;
                    }
                }
            }

            LoadHeadInfoDelegate delFun = fun as LoadHeadInfoDelegate;
            if (null != delFun)
            {
                delFun(resObj);
            }
        }
        else
        {
            LogModule.ErrorLog("load headinfo fail");
        }
    }
예제 #10
0
    public override void OnFlyWingOk(int id, GameObject flyWingModObj)
    {
        if (flyWingModObj == null)
        {
            return;
        }

        Tab_FlyWingClient flyWingClient = TableManager.GetFlyWingClientByID(id, 0);

        if (flyWingClient == null)
        {
            return;
        }

        Obj_OtherPlayer otherPlayer = m_cachedObjCharacter as Obj_OtherPlayer;

        if (otherPlayer != null)
        {
            // 绑点1
            Transform effectPointBoneFirst;
            effectPointBoneFirst = flyWingModObj.transform.Find(flyWingClient.EffectPointNameFirst);
            if (effectPointBoneFirst)
            {
                if (m_effectBindPointCache.ContainsKey(GlobeVar.EFFECT_BIND_POINT_LFLYWING))
                {
                    m_effectBindPointCache[GlobeVar.EFFECT_BIND_POINT_LFLYWING] = effectPointBoneFirst.gameObject;
                }
                else
                {
                    m_effectBindPointCache.Add(GlobeVar.EFFECT_BIND_POINT_LFLYWING, effectPointBoneFirst.gameObject);
                }
                m_effectBindPointsOnFlyWingList.Add(GlobeVar.EFFECT_BIND_POINT_LFLYWING);
            }
            // 绑点2
            Transform effectPointBoneSecond;
            effectPointBoneSecond = flyWingModObj.transform.Find(flyWingClient.EffectPointNameSecond);
            if (effectPointBoneSecond)
            {
                if (m_effectBindPointCache.ContainsKey(GlobeVar.EFFECT_BIND_POINT_RFLYWING))
                {
                    m_effectBindPointCache[GlobeVar.EFFECT_BIND_POINT_RFLYWING] = effectPointBoneSecond.gameObject;
                }
                else
                {
                    m_effectBindPointCache.Add(GlobeVar.EFFECT_BIND_POINT_RFLYWING, effectPointBoneSecond.gameObject);
                }
                m_effectBindPointsOnFlyWingList.Add(GlobeVar.EFFECT_BIND_POINT_RFLYWING);
            }

            PlayEffect(flyWingClient.EffectIdFirst);
            PlayEffect(flyWingClient.EffectIdSecond);
            PlayEffect(flyWingClient.EffectIdThrid);
            PlayEffect(flyWingClient.EffectIdFour);
        }
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_SYNC_ACTIVETITLE packet = (GC_SYNC_ACTIVETITLE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            if (packet.Serverid != Singleton <ObjManager> .GetInstance().MainPlayer.ServerID)
            {
                Obj_Character obj = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(packet.Serverid);

                if (obj != null)
                {
                    if (obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER ||
                        obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_ZOMBIE_PLAYER)
                    {
                        Obj_OtherPlayer objOtherPlayer = (Obj_OtherPlayer)obj;
                        if (objOtherPlayer != null)
                        {
                            Tab_TitleData tabTitleData = TableManager.GetTitleDataByID(packet.Titleid, 0);
                            if (tabTitleData != null)
                            {
                                string strTitle = Utils.GetTitleColor(tabTitleData.ColorLevel);
                                if (tabTitleData.Type >= (int)USERDEF_SUBTYPE.TITLE_DEFTYPE_NUM)
                                {
                                    // 系统称号
                                    strTitle += tabTitleData.InvestitiveName;
                                }
                                else if ((int)USERDEF_SUBTYPE.TITLE_DEFTYPE_INVALID < tabTitleData.Type && tabTitleData.Type < (int)USERDEF_SUBTYPE.TITLE_DEFTYPE_NUM)
                                {
                                    // 自定义称号
                                    if (packet.HasTitlename)
                                    {
                                        strTitle += packet.Titlename;
                                    }
                                }
                                objOtherPlayer.CurTitleID          = packet.Titleid;
                                objOtherPlayer.StrTitleInvestitive = strTitle;
                                objOtherPlayer.ShowTitleInvestitive();
                            }
                            else
                            {
                                objOtherPlayer.CurTitleID          = GlobeVar.INVALID_ID;
                                objOtherPlayer.StrTitleInvestitive = "";
                                objOtherPlayer.ShowTitleInvestitive();
                            }
                        }
                    }
                }
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
예제 #12
0
 public void Init(Obj_OtherPlayer player)
 {
     UpdatePaoShangIcon(player.PaoShangState);
     if (player is Obj_MainPlayer)
     {
         m_bIsMainPlayer = true;
     }
     else
     {
         m_bIsMainPlayer = false;
     }
 }
예제 #13
0
 static public void ShowHideFlyWing(Obj_OtherPlayer playerObj, int flyWingId, bool isShow)
 {
     if (isShow && flyWingId != GlobeVar.INVALID_ID)
     {
         // 显示
         EquipFlyWing(playerObj, flyWingId);
     }
     else
     {
         // 销毁
         CancelEquipFlyWing(playerObj, false);
     }
 }
예제 #14
0
        /// <summary>
        /// 战斗力
        /// </summary>
        /// <returns></returns>
        public int GetNextlevelCombatValue()
        {
            // todo_xiake
            float fTotalCombatValue = 0.0f;

            //血影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.MAXHP) * 0.2f);
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.MAXMP) * 0.1f);

            int nProfession = GameManager.gameManager.PlayerDataPool.Profession;

            if (Obj_OtherPlayer.IsPhysicsProfession(nProfession))
            {
                //物理攻击影响
                fTotalCombatValue += (GetComBatAttrById(COMBATATTE.PYSATTACK) * 2.0f);
                //物理防御影响
                int nPDef = GetComBatAttrById(COMBATATTE.PYSDEF);
                int nMDef = GetComBatAttrById(COMBATATTE.MAGDEF);
                fTotalCombatValue += ((nPDef * 0.6f) + (nMDef * 0.4f)) * 2.0f;
            }
            else if (Obj_OtherPlayer.IsMagicAttackProfession(nProfession))
            {
                //法术攻击影响
                fTotalCombatValue += (GetComBatAttrById(COMBATATTE.MAGATTACK) * 2.0f);
                //法术防御影响
                int nPDef = GetComBatAttrById(COMBATATTE.PYSDEF);
                int nMDef = GetComBatAttrById(COMBATATTE.MAGDEF);
                fTotalCombatValue += ((nPDef * 0.4f) + (nMDef * 0.6f)) * 2.0f;
            }

            //血影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.MAXHP) * 0.2f);
            //命中影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.HIT) * 2.5f);
            //闪避影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.DODGE) * 3.125f);
            //暴击影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.CRITICAL) * 2.4f);
            //暴抗影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.DECRITICAL) * 3.192f);
            //穿透影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.STRIKE) * 8.3f);
            //韧性影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.DUCTICAL) * 8.3f);
            //暴击加成影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.CRITIADD) * 6.5f);
            //暴击减免影响
            fTotalCombatValue += (GetComBatAttrById(COMBATATTE.CRITIMIS) * 6.5f);

            return((int)fTotalCombatValue);
        }
예제 #15
0
        public static int GetGemCombatValue(int gemid)
        {
            float fTotalCombatValue = 0.0f;

            if (null == Singleton <ObjManager> .GetInstance().MainPlayer)
            {
                return((int)fTotalCombatValue);
            }

            //血影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.MAXHP, gemid) * 0.2f);
            int profession = Singleton <ObjManager> .GetInstance().MainPlayer.Profession;

            if (Obj_OtherPlayer.IsPhysicsProfession(profession))
            {
                //物理攻击影响
                fTotalCombatValue += (GetGemAttrValue(COMBATATTE.PYSATTACK, gemid) * 2.0f);
                //物理防御影响
                int nPDef = GetGemAttrValue(COMBATATTE.PYSDEF, gemid);
                int nMDef = GetGemAttrValue(COMBATATTE.MAGDEF, gemid);
                fTotalCombatValue += ((nPDef * 0.6f) + (nMDef * 0.4f)) * 2.0f;
            }
            else if (Obj_OtherPlayer.IsMagicAttackProfession(profession))
            {
                //法术攻击影响
                fTotalCombatValue += (GetGemAttrValue(COMBATATTE.MAGATTACK, gemid) * 2.0f);
                //法术防御影响
                int nPDef = GetGemAttrValue(COMBATATTE.PYSDEF, gemid);
                int nMDef = GetGemAttrValue(COMBATATTE.MAGDEF, gemid);
                fTotalCombatValue += ((nPDef * 0.4f) + (nMDef * 0.6f)) * 2.0f;
            }
            //命中影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.HIT, gemid) * 2.5f);
            //闪避影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.DODGE, gemid) * 3.125f);
            //暴击影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.CRITICAL, gemid) * 2.4f);
            //暴抗影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.DECRITICAL, gemid) * 3.192f);
            //穿透影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.STRIKE, gemid) * 8.3f);
            //韧性影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.DUCTICAL, gemid) * 8.3f);
            //暴击加成影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.CRITIADD, gemid) * 6.5f);
            //暴击减免影响
            fTotalCombatValue += (GetGemAttrValue(COMBATATTE.CRITIMIS, gemid) * 6.5f);

            return((int)fTotalCombatValue);
        }
예제 #16
0
    // 下马
    static public void UnMount(Obj_OtherPlayer PlayerObj)
    {
        if (PlayerObj == null || PlayerObj.MountObj == null)
        {
            return;
        }

        Transform gMountPlayerTrans = PlayerObj.MountObj.gameObject.transform.FindChild("Model");

        if (gMountPlayerTrans == null || gMountPlayerTrans.gameObject == null)
        {
            DestroyMount(PlayerObj.MountObj);
            PlayerObj.MountObj = null;
            return;
        }

        GameObject Obj = PlayerObj.gameObject;

        if (Obj != null)
        {
            gMountPlayerTrans.parent = Obj.transform;

            if (false == Singleton <ObjManager> .GetInstance().ReloadModel(Obj, gMountPlayerTrans.gameObject, PlayerObj.AnimationFilePath))
            {
                return;
            }
            int mountId = PlayerObj.MountID;
            PlayerObj.MountObj      = null;
            PlayerObj.MountID       = -1;
            PlayerObj.IsNeedUnMount = false;
            PlayerObj.OnSwithObjAnimState(PlayerObj.CurObjAnimState);
            if (PlayerObj.ObjEffectController != null)
            {
                PlayerObj.ObjEffectController.OnMountOff(mountId);
            }

            // 下坐骑时名字板高度恢复
            if (PlayerObj.HeadInfoBoard != null)
            {
                BillBoard billboard = PlayerObj.HeadInfoBoard.GetComponent <BillBoard>();
                if (billboard != null)
                {
                    billboard.RecoverHeight();
                }
            }

            PlayerObj.UnMountWeapon();
        }
    }
예제 #17
0
    public static void DestoryFlyWing(Obj_OtherPlayer other)
    {
        if (other == null || other.FlyWingObj == null)
        {
            return;
        }
        GameObject gGameObject = other.FlyWingObj.gameObject;

        if (gGameObject)
        {
            other.FlyWingObj = null;
            //other.ObjEffectController.OnCancalFlyWing();
            //Destroy(gGameObject);
        }
    }
예제 #18
0
    int GetAddCombatValue()
    {
        float fTotalCombatValue = 0.0f;

        //血影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[0] * 0.2f);
        fTotalCombatValue += ((float)m_TrainingEffectVal[1] * 0.1f);

        int nProfession = GameManager.gameManager.PlayerDataPool.Profession;

        if (Obj_OtherPlayer.IsPhysicsProfession(nProfession))
        {
            //物理攻击影响
            fTotalCombatValue += ((float)m_TrainingEffectVal[2] * 2.0f);
            //物理防御影响
            int nPDef = m_TrainingEffectVal[4];
            int nMDef = m_TrainingEffectVal[5];
            fTotalCombatValue += (((float)nPDef * 0.6f) + ((float)nMDef * 0.4f)) * 2.0f;
        }
        else if (Obj_OtherPlayer.IsMagicAttackProfession(nProfession))
        {
            //法术攻击影响
            fTotalCombatValue += ((float)m_TrainingEffectVal[3] * 2.0f);
            //法术防御影响
            int nPDef = m_TrainingEffectVal[4];
            int nMDef = m_TrainingEffectVal[5];
            fTotalCombatValue += (((float)nPDef * 0.4f) + ((float)nMDef * 0.6f)) * 2.0f;
        }

        //命中影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[6] * 2.5f);
        //闪避影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[7] * 3.125f);
        //暴击影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[8] * 2.4f);
        //暴抗影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[9] * 3.192f);
        //穿透影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[10] * 8.3f);
        //韧性影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[11] * 8.3f);
        //暴击加成影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[12] * 6.5f);
        //暴击减免影响
        fTotalCombatValue += ((float)m_TrainingEffectVal[13] * 6.5f);

        return((int)fTotalCombatValue);
    }
예제 #19
0
        public static void CreateOtherPlayerHided(Obj_OtherPlayer obj, Obj_HidePlayerData data)
        {
            if (data == null || obj == null || obj.gameObject == null)
            {
                LogModule.ErrorLog("CreateOtherPlayerHided called but data == null || obj == null ||obj.gameObject == null");
                return;
            }
            Tab_CharModel charModel = TableManager.GetCharModelByID(data.CharModelId, 0);

            if (charModel == null)
            {
                return;
            }
            LoadModelToRoot(data.CharModelId, EResourceType.CharacterModel, LoadModelComplete, obj.gameObject, charModel, obj.CurChangeState == (int)GameDefine_Globe.ChangeModeState.CHANGE_2 || obj.CurChangeState == (int)GameDefine_Globe.ChangeModeState.CHANGE_1);
            //ReloadModel(curChar.gameObject, curObjData.ResPath, AsycCreateOtherPlayerOver, curObjData.InitData);
        }
예제 #20
0
    public void InitFlyWingObj(Obj_OtherPlayer otherPlayer, int flyWingId)
    {
        Tab_FlyWing flyWing = TableManager.GetFlyWingByID(flyWingId, 0);

        if (flyWing == null)
        {
            return;
        }

        Tab_FlyWingClient flyWingClient = TableManager.GetFlyWingClientByID(flyWingId, 0);

        if (flyWingClient == null)
        {
            return;
        }

        Singleton <ObjManager> .GetInstance().ReloadModel(otherPlayer.gameObject, flyWingClient.ModeName, onAsyLoadFlyWing, otherPlayer, flyWingId);
    }
예제 #21
0
    static public void EquipFlyWing(Obj_OtherPlayer playerObj, int flyWingId)
    {
        if (playerObj == null || playerObj.gameObject == null)
        {
            return;
        }

        playerObj.FlyWingObj = playerObj.gameObject.GetComponent <Obj_FlyWing> ();
        if (playerObj.FlyWingObj == null)
        {
            playerObj.FlyWingObj = playerObj.gameObject.AddComponent <Obj_FlyWing>() as Obj_FlyWing;
        }

        if (playerObj.FlyWingObj)
        {
            playerObj.FlyWingObj.InitFlyWingObj(playerObj, flyWingId);
        }
    }
예제 #22
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_RET_ISWILDENEMY2USER packet = (GC_RET_ISWILDENEMY2USER)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            Obj_OtherPlayer _otherPlayer = Singleton <ObjManager> .GetInstance().FindOtherPlayerInScene(packet.UserGuid);

            if (_otherPlayer != null)
            {
                _otherPlayer.IsWildEnemyForMainPlayer = (packet.IsEnemy == 1 ? true : false);
                _otherPlayer.SetNameBoardColor();
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
예제 #23
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_STOP packet = (GC_STOP)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }

            //临时代码,先返回,调试的时候打开
            //return (uint)PACKET_EXE.PACKET_EXE_CONTINUE;

            //判断ServerID
            if (packet.Serverid == GlobeVar.INVALID_ID)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }

            //查找该NPC
            Obj_Character obj = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(packet.Serverid);

            if (null == obj)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }
            //轻功状态下停止轻功
            if (obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
            {
                Obj_OtherPlayer _otherPlayer = obj as Obj_OtherPlayer;
                if (_otherPlayer && _otherPlayer.IsLightState)
                {
                    _otherPlayer.EndLightSkillMove();
                }
            }
            //查找Obj是否绑定AutoMove组件
            AutoMove autoMove = obj.AutoMoveComponent;

            if (null != autoMove)
            {
                autoMove.InterruptMove(packet);
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
예제 #24
0
        public void EnterTeamFollow()
        {
            // 副本,无法进入组队跟随
            if (GameManager.gameManager.ActiveScene.IsCopyScene())
            {
                return;
            }

            //没有队伍,无法进入组队跟随状态
            if (GlobeVar.INVALID_ID == GameManager.gameManager.PlayerDataPool.TeamInfo.TeamID)
            {
                return;
            }

            //如果自己是队长,也无法进入组队跟随
            if (IsTeamLeader())
            {
                return;
            }

            //根据队长的Guid找到ServerID
            TeamMember teamLeader = GameManager.gameManager.PlayerDataPool.TeamInfo.teamMember[0];

            //如果队伍信息非法或者自己是队长
            if (teamLeader.IsValid())
            {
                //遍历
                foreach (KeyValuePair <string, Obj> obj in Singleton <ObjManager> .GetInstance().ObjPools)
                {
                    //只能跟随其他玩家
                    if (obj.Value.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
                    {
                        Obj_OtherPlayer player = obj.Value as Obj_OtherPlayer;
                        if (null != player && player.GUID == teamLeader.Guid)
                        {
                            m_nFollowServerID = player.ServerID;
                            m_followObjChar   = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(m_nFollowServerID);

                            break;
                        }
                    }
                }
            }
        }
예제 #25
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_BROADCAST_BELLEDATA packet = (GC_BROADCAST_BELLEDATA)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            Dictionary <int, Belle> belleDic;

            if (BelleData.AllOtherPlayerBelleMap.TryGetValue(packet.CharGuid, out belleDic))
            {
                if (belleDic != null)
                {
                    if (belleDic.ContainsKey(packet.BelleId))
                    {
                        belleDic.Remove(packet.BelleId);
                    }
                    belleDic.Add(packet.BelleId, new Belle(packet.BelleId, packet.BelleClose, packet.BelleLevel));
                }
                else
                {
                    BelleData.AllOtherPlayerBelleMap.Remove(packet.CharGuid);
                    belleDic = new Dictionary <int, Belle>();
                    BelleData.AllOtherPlayerBelleMap.Add(packet.CharGuid, belleDic);
                    belleDic.Add(packet.BelleId, new Belle(packet.BelleId, packet.BelleClose, packet.BelleLevel));
                }
            }
            else
            {
                belleDic = new Dictionary <int, Belle>();
                BelleData.AllOtherPlayerBelleMap.Add(packet.CharGuid, belleDic);
                belleDic.Add(packet.BelleId, new Belle(packet.BelleId, packet.BelleClose, packet.BelleLevel));
            }
            Obj_OtherPlayer _otherPlayer = Singleton <ObjManager> .GetInstance().FindOtherPlayerInScene(packet.CharGuid);

            if (_otherPlayer != null)
            {
                _otherPlayer.UpdateBelleShowDelay();
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_SYN_LOVERINFO packet = (GC_SYN_LOVERINFO)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic

            GameManager.gameManager.PlayerDataPool.LoverGUID = packet.LoverGuid;
            //结婚对象 在可见范围内 则修改名字颜色
            if (packet.LoverGuid != GlobeVar.INVALID_GUID)
            {
                Obj_OtherPlayer _objChar = Singleton <ObjManager> .GetInstance().FindOtherPlayerInScene(packet.LoverGuid);

                if (null != _objChar && _objChar.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
                {
                    _objChar.SetNameBoardColor();
                }
            }
            else //离婚了 就重置附近玩家的名字
            {
                Dictionary <string, Obj> targets = Singleton <ObjManager> .GetInstance().ObjPools;

                foreach (Obj targetObj in targets.Values)
                {
                    if (targetObj != null && targetObj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
                    {
                        Obj_OtherPlayer _Player = targetObj as Obj_OtherPlayer;
                        if (_Player)
                        {
                            _Player.SetNameBoardColor();
                        }
                    }
                }
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
예제 #27
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_TEAM_TRANS_EFFECT packet = (GC_TEAM_TRANS_EFFECT)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            Obj_OtherPlayer player = Singleton <ObjManager> .GetInstance().FindOtherPlayerInScene(packet.MemberGuid);

            if (player != null)
            {
                player.PlayEffect(GlobeVar.TEAMTRANS_EFFECTID);
            }

            if (Singleton <ObjManager> .Instance.MainPlayer != null && Singleton <ObjManager> .Instance.MainPlayer.GUID == packet.MemberGuid)
            {
                Singleton <ObjManager> .Instance.MainPlayer.PlayEffect(GlobeVar.TEAMTRANS_EFFECTID);
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
예제 #28
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_UPDATE_FOLLOWSTATE packet = (GC_UPDATE_FOLLOWSTATE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            int           nObjID       = packet.ObjID;
            int           nFollowState = packet.FollowState;
            Obj_Character obj          = Singleton <ObjManager> .Instance.FindObjCharacterInScene(nObjID);

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

            if (obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER ||
                obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
            {
                Obj_OtherPlayer player = obj as Obj_OtherPlayer;
                if (player != null)
                {
                    // 逻辑处理
                    player.IsInTeamFollow = (nFollowState == 1 ? true : false);
                }
            }

            // 更新下UI
            if (obj.ObjType == GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER)
            {
                if (MissionDialogAndLeftTabsLogic.Instance())
                {
                    MissionDialogAndLeftTabsLogic.Instance().UpdateButtonTeamFollow();
                }
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
예제 #29
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_CHANGE_PKLIST packet = (GC_CHANGE_PKLIST )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic

            GameManager.gameManager.PlayerDataPool.IsCanPKLegal = (packet.IsPKListEmpty == 0 ? true : false);
            //修改主角名字颜色
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer)
            {
                _mainPlayer.SetNameBoardColor();
            }

            int nObjId = packet.ObjId;//加入或者移出主角反击列表的玩家
            Obj _obj   = Singleton <ObjManager> .GetInstance().FindObjInScene(nObjId);

            if (_obj == null)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }
            if (_obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER &&
                _obj.ObjType != Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER)
            {
                Obj_OtherPlayer _player = _obj.GetComponent <Obj_OtherPlayer>();
                if (_player)
                {
                    _player.IsInMainPlayerPKList = (packet.IsInPkList == 1 ? true : false);
                    _player.SetNameBoardColor();
                }
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
예제 #30
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_RET_CHANGE_PKMODLE packet = (GC_RET_CHANGE_PKMODLE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            Obj _obj = Singleton <ObjManager> .GetInstance().FindObjInScene(packet.ObjId);

            if (_obj == null)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }
            if (_obj.ObjType != GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER &&
                _obj.ObjType != GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }
            Obj_OtherPlayer _player = _obj.GetComponent <Obj_OtherPlayer>();

            _player.PkModle = packet.PKModle;
            _player.OptChangPKModle();
            if (PKInfoSetLogic.Instance() != null)
            {
                PKInfoSetLogic.Instance().SwitchBtnState();
            }
            if (NewFunctionLogic.Instance() != null)
            {
                NewFunctionLogic.Instance().SetPkLabel(_player.PkModle == (int)CharacterDefine.PKMODLE.KILL);
            }
            if (FunctionButtonLogic.Instance() != null)
            {
                FunctionButtonLogic.Instance().UpdateNewFunctionButtonState(FunctionButtonLogic.DynamicLogo.PKModel);
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }