示例#1
0
    /// <summary>
    /// 填充基础建筑信息
    /// </summary>
    private static void CalcSoldierInfo(s_soldier_typeInfo I, ref SoldierInfo Info)
    {
        if (I == null || Info == null)
        {
            return;
        }
        //获取三围
        //初始值
        s_soldierstar_typeInfo StarInfo = GetSoldierStarData(Info.SoldierTypeID, Info.StarLevel);

        if (StarInfo != null)
        {
            Info.m_strength_grow     = StarInfo.strength_growth;
            Info.m_agility_grow      = StarInfo.agility_growth;
            Info.m_intelligence_grow = StarInfo.intelligence_growth;
            Info.m_concussion       += StarInfo.concussion;
        }


        //当前-初始.
        int oriStrength = 0;
        int oriAgility  = 0;
        int oriIntell   = 0;

        int oriStar = GetSoldierOriginalStar(Info.SoldierTypeID);
        s_soldierstar_typeInfo OriInfo = GetSoldierStarData(Info.SoldierTypeID, oriStar);

        if (OriInfo != null && StarInfo != null)
        {
            oriStrength = OriInfo.strength_growth;
            oriAgility  = OriInfo.agility_growth;
            oriIntell   = OriInfo.intelligence_growth;
        }
        //被动技能附加属性
        Info.m_Skill.SetAddrData(ref Info.m_AddAttr);

        Info.m_strength     = ScriptM.Formula <int>("CALC_STRENGTH", Info.m_strength_grow, oriStrength, Info.Level, I.strength);
        Info.m_agility      = ScriptM.Formula <int>("CALC_AGILITY", Info.m_agility_grow, oriAgility, Info.Level, I.agility);
        Info.m_intelligence = ScriptM.Formula <int>("CALC_INTELLIGENCE", Info.m_intelligence_grow, oriIntell, Info.Level, I.intelligence);
        //增加进阶属性,目前只有冲击力
        s_soldierqualityInfo qualityinfo = GetqualityInfoData(Info.SoldierTypeID, Info.Quality);

        if (qualityinfo != null)
        {
            Info.m_concussion += qualityinfo.concussion;
        }
        //爆击及闪避
        s_soldier_experienceInfo ExpInfo = SoldierM.GetSoldierExpData(Info.Level);

        if (ExpInfo != null)
        {
            Info.m_critratio  = ExpInfo.critratio;
            Info.m_dodgeratio = ExpInfo.dodgeratio;
        }
        //阶数,添加装备附加属性
        AddEquipAttr(ref Info);
        CalcSoldierAttr(ref Info);
    }
示例#2
0
    /// <summary>
    /// 获取升阶所需资源
    /// </summary>
    /// <param name="SoldierType">炮弹兵类型</param>
    /// <param name="Quality">当前阶</param>
    /// <param name="NeedMaterial">需要材料,key item id,value 数量</param>
    /// <param name="Star">建筑星级</param>
    /// <returns>建筑数据,null 获取失败</returns>
    public static void GetUpQualityNeed(int SoldierType, int CurQuality, ref int LimitLevel,
                                        ref int equipID1, ref int equipID2, ref int equipID3,
                                        ref int equipID4, ref int equipID5, ref int equipID6)
    {
        s_soldierqualityInfo Info = GetqualityInfoData(SoldierType, CurQuality);

        if (Info != null)
        {
            equipID1 = Info.equipment0;
            equipID2 = Info.equipment1;
            equipID3 = Info.equipment2;
            equipID4 = Info.equipment3;
            equipID5 = Info.equipment4;
            equipID6 = Info.equipment5;
        }
        //
        s_soldierqualityInfo Info1 = GetqualityInfoData(SoldierType, ConfigM.GetNextQuality(CurQuality));

        if (Info1 != null)
        {
            LimitLevel = Info1.levellimit;
        }
    }
示例#3
0
    /// <summary>
    /// 获取炮弹兵当前品阶下穿的装备(itemtypeid)
    /// </summary>
    /// <param name="SoldierType">炮弹兵类型</param>
    /// <param name="Quality">炮弹兵拼接 </param>
    /// <param name="Position">装备插槽 </param>
    public static int GetSoldierEquip(int SoldierType, int Quality, int Position)
    {
        s_soldierqualityInfo Info = GetqualityInfoData(SoldierType, Quality);

        if (Info != null)
        {
            if (Position == 0)
            {
                return(Info.equipment0);
            }
            else if (Position == 1)
            {
                return(Info.equipment1);
            }
            else if (Position == 2)
            {
                return(Info.equipment2);
            }
            else if (Position == 3)
            {
                return(Info.equipment3);
            }
            else if (Position == 4)
            {
                return(Info.equipment4);
            }
            else if (Position == 5)
            {
                return(Info.equipment5);
            }
            else
            {
                return(0);
            }
        }
        return(0);
    }
示例#4
0
    /// <summary>
    /// 改炮弹兵类型能穿该装备
    /// </summary>
    /// <param name="SoldireTypeID">炮弹兵类型</param>
    /// <param name="ItemTypeID">装备类型 </param>
    public static bool CheckCanPutEquip(int SoldireTypeID, int ItemTypeID)
    {
        //炮弹兵所有的阶数
        List <int> lQuality = new List <int> ();

        lQuality = ConfigM.GetQualityList();

        foreach (int Quality in lQuality)
        {
            s_soldierqualityInfo Info = GetqualityInfoData(SoldireTypeID, Quality);
            if (Info == null)
            {
                continue;
            }
            else if (Info.equipment0 == ItemTypeID || Info.equipment1 == ItemTypeID ||
                     Info.equipment2 == ItemTypeID || Info.equipment3 == ItemTypeID ||
                     Info.equipment4 == ItemTypeID || Info.equipment5 == ItemTypeID)
            {
                return(true);
            }
        }

        return(false);
    }
示例#5
0
    /// <summary>
    /// 获取炮弹兵适合穿的装备
    /// </summary>
    private static List <int> GetAllEquipType(SoldierInfo Info)
    {
        List <int> l = new List <int>();

        if (Info == null)
        {
            return(l);
        }
        List <int> lQuality = new List <int>();

        lQuality = ConfigM.GetPrevQuality(Info.Quality);
        //早阶的装备
        foreach (int Q in lQuality)
        {
            s_soldierqualityInfo qualityinfo = GetqualityInfoData(Info.SoldierTypeID, Q);
            if (qualityinfo != null)
            {
                l.Add(qualityinfo.equipment0);
                l.Add(qualityinfo.equipment1);
                l.Add(qualityinfo.equipment2);
                l.Add(qualityinfo.equipment3);
                l.Add(qualityinfo.equipment4);
                l.Add(qualityinfo.equipment5);
            }
        }
        //当前穿的装备
        s_soldierqualityInfo Nowqualityinfo = GetqualityInfoData(Info.SoldierTypeID, Info.Quality);

        if (Nowqualityinfo != null)
        {
            if (Info.Equipment0 != 0)
            {
                l.Add(Nowqualityinfo.equipment0);
            }

            if (Info.Equipment1 != 0)
            {
                l.Add(Nowqualityinfo.equipment1);
            }

            if (Info.Equipment2 != 0)
            {
                l.Add(Nowqualityinfo.equipment2);
            }

            if (Info.Equipment3 != 0)
            {
                l.Add(Nowqualityinfo.equipment3);
            }


            if (Info.Equipment4 != 0)
            {
                l.Add(Nowqualityinfo.equipment4);
            }


            if (Info.Equipment5 != 0)
            {
                l.Add(Nowqualityinfo.equipment5);
            }
        }
        return(l);
    }