示例#1
0
    // 得到自己的队伍信息(从自己的数据池获取)
    void FillMyInfo(TeamMemberInfo member)
    {
        if (member == null)
        {
            throw new NullReferenceException("team member in FillMyInfo(member)");
        }

        CObject_PlayerMySelf pMe = CObjectManager.Instance.getPlayerMySelf();

        CCharacterData pMyData = pMe.GetCharacterData();

        if (null == pMyData)
        {
            return;
        }
        member.m_szNick        = pMyData.Get_Name();
        member.m_uFamily       = pMyData.Get_MenPai();
        member.m_uDataID       = pMyData.Get_RaceID();
        member.m_uLevel        = pMyData.Get_Level();
        member.m_nPortrait     = pMyData.Get_PortraitID();
        member.m_WorldPos.m_fX = pMe.GetPosition().x;
        member.m_WorldPos.m_fZ = pMe.GetPosition().z;
        member.m_nHP           = pMyData.Get_HP();
        member.m_dwMaxHP       = pMyData.Get_MaxHP();
        member.m_nMP           = pMyData.Get_MP();
        member.m_dwMaxMP       = pMyData.Get_MaxMP();
        member.m_nAnger        = 100; // 客户端没有
        member.m_WeaponID      = pMyData.Get_Equip(HUMAN_EQUIP.HEQUIP_WEAPON);
        member.m_CapID         = pMyData.Get_Equip(HUMAN_EQUIP.HEQUIP_CAP);
        member.m_ArmourID      = pMyData.Get_Equip(HUMAN_EQUIP.HEQUIP_ARMOR);
        member.m_CuffID        = pMyData.Get_Equip(HUMAN_EQUIP.HEQUIP_CUFF);
        member.m_FootID        = pMyData.Get_Equip(HUMAN_EQUIP.HEQUIP_BOOT);
        member.m_uBackID       = pMyData.Get_Equip(HUMAN_EQUIP.HEQUIP_BACK);//  [8/30/2010 Sun]
        member.m_bDead         = (pMe.CharacterLogic_Get() == ENUM_CHARACTER_LOGIC.CHARACTER_LOGIC_DEAD);

        member.m_uFaceMeshID = pMyData.Get_FaceMesh();
        member.m_uHairMeshID = pMyData.Get_HairMesh();
        member.m_uHairColor  = pMyData.Get_HairColor();
    }
        public string GetData(string typeName)
        {
            if (CObjectManager.Instance.getPlayerMySelf() == null)
            {
                return("");
            }

            CCharacterData pCharData = CObjectManager.Instance.getPlayerMySelf().GetCharacterData();

            if (typeName == "LEVEL")      //等级
            {
                return(pCharData.Get_Level().ToString());
            }
            else if (typeName == "HP") //生命值
            {
                return(pCharData.Get_HP().ToString());
            }
            else if (typeName == "MP") //魔法值
            {
                return(pCharData.Get_MP().ToString());
            }
            else if (typeName == "MENPAI")  //门派
            {
                return(pCharData.Get_MenPai().ToString());
            }
            else if (typeName == "AMBIT") //境界名称
            {
                return(pCharData.Get_Ambit().ToString());
            }
            else if (typeName == "PORTRAIT") //头像
            {
                //得到玩家和自己的头像
                string pImageName = "";
                //打开生物定义表
                _DBC_CHAR_FACE pFaceImage = CDataBaseSystem.Instance.GetDataBase <_DBC_CHAR_FACE>((int)DataBaseStruct.DBC_CHAR_FACE).Search_Index_EQU(pCharData.Get_PortraitID());

                if (pFaceImage != null)
                {
                    pImageName = pFaceImage.pImageSetName;
                }

                //else // 默认状态不显示头像图标, 头像图标显示空
                //{
                //	pFaceImage = (const _DBC_CHAR_FACE*)(s_pFaceImageDBC->Search_LineNum_EQU(0));
                //	pImageName = pFaceImage->pImageSetName;
                //}//

                return(pImageName);
            }
            else if (typeName == "STR") //力量 力量 金
            {                           //基础值
                return((pCharData.Get_STR() - pCharData.Get_BringSTR()).ToString());
            }
            else if (typeName == "SPR") //灵气 灵力 木
            {
                return((pCharData.Get_SPR() - pCharData.Get_BringSPR()).ToString());
            }
            else if (typeName == "CON") //体制 体制 水
            {
                return((pCharData.Get_CON() - pCharData.Get_BringCON()).ToString());
            }
            else if (typeName == "INT") //定力 智力 火
            {
                return((pCharData.Get_INT() - pCharData.Get_BringINT()).ToString());
            }
            else if (typeName == "DEX") //身法 敏捷 土
            {
                return((pCharData.Get_DEX() - pCharData.Get_BringDEX()).ToString());
            }
            else if (typeName == "BRING_STR")
            {
                return(pCharData.Get_BringSTR().ToString());
            }
            else if (typeName == "BRING_SPR")
            {
                return(pCharData.Get_BringSPR().ToString());
            }
            else if (typeName == "BRING_CON")
            {
                return(pCharData.Get_BringCON().ToString());
            }
            else if (typeName == "BRING_INT")
            {
                return(pCharData.Get_BringINT().ToString());
            }
            else if (typeName == "BRING_DEX")
            {
                return(pCharData.Get_BringDEX().ToString());
            }
            else if (typeName == "ATT_PHYSICS")                 //物理攻击力
            {
                return(pCharData.Get_AttPhysics().ToString());
            }
            else if (typeName == "ATT_MAGIC")                           // 魔法攻击力 [7/16/2011 ivan edit]
            {
                return(pCharData.Get_AttMagic().ToString());
            }
            else if (typeName == "DEF_PHYSICS")                 //物理防御力
            {
                return(pCharData.Get_DefPhysics().ToString());
            }
            else if (typeName == "DEF_MAGIC")                           //魔法防御力
            {
                return(pCharData.Get_DefMagic().ToString());
            }
            else if (typeName == "HIT")                                 //命中率
            {
                return(pCharData.Get_Hit().ToString());
            }
            else if (typeName == "MISS")                                //闪避率
            {
                return(pCharData.Get_Miss().ToString());
            }
            else if (typeName == "CRITRATE")                            //会心率
            {
                return(pCharData.Get_CritRate().ToString());
            }
            else if (typeName == "DEFCRITRATE")                 // 会心防御 [12/24/2010 ivan edit]
            {
                return(pCharData.Get_DefCritRate().ToString());
            }
            else if (typeName == "MAXHP")   //最大生命值
            {
                return(pCharData.Get_MaxHP().ToString());
            }
            else if (typeName == "MAXMP") //最大魔法值
            {
                return(pCharData.Get_MaxMP().ToString());
            }

            return("0");
        }