예제 #1
0
    public void FullMedalDataInfo(NBMedalDataInfo p_info, BOH.MsgUserEquipmentInfo medalInforesp)
    {
        NBMedalConfInfo p_medalConfInfo = null;

        p_medalConfInfo = NBGameConfig.SharedConfig().GetMedalConfInfo(medalInforesp.equipid());

        NBEquipParametersConfInfo p_medalPara = NBGameConfig.SharedConfig().GetEquipParametersConfInfo(medalInforesp.quality(), medalInforesp.star());

        NBClassConfInfo pClassInfo = NBGameConfig.SharedConfig().GetClassConfInfo(p_medalConfInfo.ClassID);

        p_info.Entityid     = medalInforesp.Entityid;
        p_info.Iswear       = medalInforesp.Iswear;
        p_info.Experience   = medalInforesp.Experience;
        p_info.Level        = medalInforesp.Level;
        p_info.Quality      = medalInforesp.Quality;
        p_info.Star         = medalInforesp.Star;
        p_info.Ownerroleid  = medalInforesp.Ownerroleid;
        p_info.MedalID      = p_medalConfInfo.MedalID;
        p_info.Name         = p_medalConfInfo.Name;
        p_info.InitLevel    = p_medalConfInfo.AttriLevel;
        p_info.QualityLevel = p_medalConfInfo.QualityLevel;
        p_info.ClassID      = p_medalConfInfo.ClassID;
        p_info.SlotID       = p_medalConfInfo.SlotID;
        p_info.AtkAP_P      = p_medalConfInfo.AtkAP_P;
        p_info.AtkAP_M      = p_medalConfInfo.AtkAP_M;
        p_info.DefAP_P      = p_medalConfInfo.DefAP_P;
        p_info.DefAP_M      = p_medalConfInfo.DefAP_M;
        p_info.HPAP         = p_medalConfInfo.HPAP;
        p_info.DodgeAP      = p_medalConfInfo.DodgeAP;
        p_info.CriAP        = p_medalConfInfo.CriAP;
        p_info.AtkSpeedAP   = p_medalConfInfo.AtkSpeedAP;
        p_info.ResID        = p_medalConfInfo.ResID;
        /////////////////////////////
        string propstr = "";
        string temp;

        temp            = string.Format("{0}: {1}/{2} \n", NBStringResource.GetText("medal_level"), p_info.Level, NBGameWorld.SharedInstance().GetMe().GetLevel());
        p_info.Levelstr = temp;

        if (p_info.Star > 0)
        {
            temp           = string.Format("+ {0} \n", p_info.Star);
            p_info.Starstr = temp;
        }
        else
        {
            p_info.Starstr = "";
        }

        p_info.Serverpropstr = propstr.ToString();
        propstr = GetCurrentmedal(p_info, p_medalPara);

        NBLOG("Currentmedal:\n {0}", propstr);
        p_info.Propstr.Append(propstr);
    }
예제 #2
0
    public bool Init(string pMedalId)
    {
        bool bResult = false;

        if (pMedalId == string.Empty || pMedalId == "0")
        {
            NBGame.NB_LOG_WARNING("MedalId = NULL");
            goto Exit0;
        }

        m_medalId        = pMedalId;
        m_pMedalConfInfo = NBGameConfig.SharedConfig().GetMedalConfInfo(m_medalId);
        bResult          = true;

        switch (m_pMedalConfInfo.QualityLevel)
        {
        case 1:
            m_medalcolor = new Color(210, 210, 210);    //gray
            break;

        case 2:
            m_medalcolor = new Color(255, 255, 255);    //white
            break;

        case 3:
            m_medalcolor = new Color(40, 245, 130);    //green
            break;

        case 4:
            m_medalcolor = new Color(20, 143, 255);    //blue
            break;

        case 5:
            m_medalcolor = new Color(182, 59, 233);    //Purple
            break;

        case 6:
            m_medalcolor = new Color(255, 165, 50);    //Orange
            break;

        case 7:
            m_medalcolor = new Color(255, 0, 0);    //red
            break;

        default:
            m_medalcolor = new Color(96, 96, 96);    //gray
            break;
        }
        m_propstr = GetCurrentAttri();
        NBLOG("Currentequip:\n\n {0}", m_propstr.ToString());
Exit0:
        return(bResult);
    }
예제 #3
0
 public NBMedal()
 {
     m_medalId        = "";
     m_ownerroleid    = "";
     m_pMedalConfInfo = null;
     m_iswear         = 0;
     m_levelstr       = "";
     m_propstr        = "";
     m_starstr        = "";
     m_medalcolor     = new Color(210, 210, 210);//gray
     m_Atk_P          = 0;
     m_Atk_M          = 0;
     m_Def_P          = 0;
     m_Def_M          = 0;
     m_hP             = 0;
     m_Dodge          = 0;
     m_Cri            = 0;
     m_AtkSpeed       = 0;
 }
예제 #4
0
    //当前勋章属性计算 跟装备一样的计算
    public string GetCurrentAttri()
    {
        NBMedalConfInfo p_info = NBGameConfig.GetMedalConfInfo();

        if (p_info == null)
        {
            NB_ASSERT(false);
            return("");
        }

        NBEquipParametersConfInfo p_equipPara = NBGameConfig.SharedConfig().GetEquipParametersConfInfo(p_info.QualityLevel, p_info.StarLevel);

        if (p_equipPara == null)
        {
            NB_ASSERT(false);
            return("");
        }
        StringBuilder   propstr    = new StringBuilder();
        NBClassConfInfo pClassInfo = NBGameConfig.SharedConfig().getClassConfInfo(p_info.ClassID);

        if (p_equipPara != null)
        {
            m_Atk_P = CalcAttriCommon(p_info.AttriLevel, p_equipPara.initAtk_P, p_equipPara.atkAD_P, pClassInfo.AtkAP_P, p_info.AtkAP_P);
            if (m_Atk_P > 0)
            {
                propstr.Append(string.Format("{0} {1}\n\n", NBStringResource.GetText("equip_Atk_P"), m_Atk_P));
            }

            m_Atk_M = CalcAttriCommon(p_info.AttriLevel, p_equipPara.initAtk_M, p_equipPara.atkAD_M, pClassInfo.AtkAP_M, p_info.AtkAP_M);
            if (m_Atk_M > 0)
            {
                propstr.Append(string.Format("{0} {1}\n\n", NBStringResource.GetText("equip_Atk_M"), m_Atk_M));
            }


            m_Def_P = CalcAttriCommon(p_info.AttriLevel, p_equipPara.initDef_P, p_equipPara.defAD_P, pClassInfo.DefAP_P, p_info.DefAP_P);
            if (m_Def_P > 0)
            {
                propstr.Append(string.Format("{0} {1}\n\n", NBStringResource.GetText("equip_Def_P"), m_Def_P));
            }

            m_Def_M = CalcAttriCommon(p_info.AttriLevel, p_equipPara.initDef_M, p_equipPara.defAD_M, pClassInfo.DefAP_M, p_info.DefAP_M);
            if (m_Def_M > 0)
            {
                propstr.Append(string.Format("{0} {1}\n\n", NBStringResource.GetText("equip_Def_M"), m_Def_M));
            }

            m_hP = CalcAttriCommon(p_info.AttriLevel, p_equipPara.initHP, p_equipPara.hPAD, pClassInfo.HPAP, p_info.HPAP);
            if (m_hP > 0)
            {
                propstr.Append(string.Format("{0} {1}\n\n", NBStringResource.GetText("equip_HP"), m_hP));
            }

            m_Dodge = CalcAttriCommon(p_info.AttriLevel, p_equipPara.initDod, p_equipPara.DodgeAD, pClassInfo.DodgeAP, p_info.DodgeAP);
            if (m_Dodge > 0)
            {
                propstr.Append(string.Format("{0} {1}\n\n", NBStringResource.GetText("equip_Dodge"), m_Dodge));
            }

            m_Cri = CalcAttriCommon(p_info.AttriLevel, p_equipPara.initCri, p_equipPara.CriAD, pClassInfo.CritAP, p_info.CriAP);
            if (m_Cri > 0)
            {
                propstr.Append(string.Format("{0} {1}\n\n", NBStringResource.GetText("equip_Cri"), m_Cri));
            }

            m_AtkSpeed = CalcAttriCommon(p_info.AttriLevel, p_equipPara.initAtkSpeed, p_equipPara.AtkSpeedAD, pClassInfo.AtkSpeedAp, p_info.AtkSpeedAP);
            if (m_AtkSpeed > 0)
            {
                propstr.Append(string.Format("{0} {1}\n\n", NBStringResource.GetText("equip_AtkSpeed"), m_AtkSpeed));
            }
        }

        NBLOG("{0}", propstr.ToString());
        return(propstr.ToString());
    }