Ejemplo n.º 1
0
    //当前勋章属性计算
    public string GetCurrentmedal(NBMedalDataInfo p_info, NBEquipParametersConfInfo p_medalPara)
    {
        StringBuilder   propstr = new StringBuilder();
        string          temp;
        NBClassConfInfo pClassInfo = NBGameConfig.SharedConfig().GetClassConfInfo(p_info.ClassID);

        if (p_medalPara != null)
        {
            p_info.Atk_P = (p_medalPara.initAtk_P + p_medalPara.atkAD_P * p_info.Level) * (p_info.AtkAP_P) / 100 * (100 + pClassInfo.AtkAP_P) / 100;
            if (p_info.Atk_P > 0)
            {
                temp = string.Format("{0}: {1} \n", NBStringResource.GetText("medal_Atk_P"), p_info.Atk_P);
                propstr.Append(temp);
            }
            p_info.Atk_M = (p_medalPara.initAtk_M + p_medalPara.atkAD_M * p_info.Level) * (float)(p_info.AtkAP_M) / 100 * (100 + pClassInfo.AtkAP_M) / 100;
            if (p_info.Atk_M > 0)
            {
                temp = string.Format("{0}: {1} \n", NBStringResource.GetText("medal_Atk_M"), p_info.Atk_M);
                propstr.Append(temp);
            }

            p_info.Def_P = (p_medalPara.initDef_P + p_medalPara.defAD_P * p_info.Level) * (p_info.DefAP_P) / 100 * (100 + pClassInfo.DefAP_P) / 100;
            if (p_info.Def_P > 0)
            {
                temp = string.Format("{0}: {1} \n", NBStringResource.GetText("medal_Def_P"), p_info.Def_P);
                propstr.Append(temp);
            }
            p_info.Def_M = (p_medalPara.initDef_M + p_medalPara.defAD_M * p_info.Level) * (p_info.DefAP_M) / 100 * (100 + pClassInfo.DefAP_M) / 100;
            if (p_info.Def_M > 0)
            {
                temp = string.Format("{0}: {1} \n", NBStringResource.GetText("medal_Def_M"), p_info.Def_M);
                propstr.Append(temp);
            }
            p_info.HP = (p_medalPara.initHP + p_medalPara.hPAD * p_info.Level) * (p_info.HPAP) / 100 * (100 + pClassInfo.HPAP) / 100;
            if (p_info.HP > 0)
            {
                temp = string.Format("{0}: {1} \n", NBStringResource.GetText("medal_HP"), p_info.HP);
                propstr.Append(temp);
            }
            p_info.Dodge = (p_medalPara.initDod + p_medalPara.DodgeAD * p_info.Level) * (p_info.DodgeAP) / 100 * (100 + pClassInfo.DodgeAP) / 100;
            if (p_info.Dodge > 0)
            {
                temp = string.Format("{0}: {1} \n", NBStringResource.GetText("medal_Dodge"), p_info.Dodge);
                propstr.Append(temp);
            }
            p_info.Cri = (p_medalPara.initCri + p_medalPara.CriAD * p_info.Level) * (p_info.CriAP) / 100 * (100 + pClassInfo.CritAP) / 100;
            if (p_info.Cri > 0)
            {
                temp = string.Format("{0}: {1} \n", NBStringResource.GetText("medal_Cri"), p_info.Cri);
                propstr.Append(temp);
            }
            p_info.AtkSpeed = (p_medalPara.initAtkSpeed + p_medalPara.AtkSpeedAD * p_info.Level) * (p_info.AtkSpeedAP) / 100 * (100 + pClassInfo.AtkSpeedAp) / 100;
            if (p_info.AtkSpeed > 0)
            {
                temp = string.Format("{0}: {1} \n", NBStringResource.GetText("medal_AtkSpeed"), p_info.AtkSpeed);
                propstr.Append(temp);
            }
        }
        return(propstr.ToString());
    }
Ejemplo n.º 2
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);
    }
Ejemplo n.º 3
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());
    }