Ejemplo n.º 1
0
        private static void adjustAttribute(ref MainAttribute attr,int typeIndex)
        {
            double hpPercent = 1.0 * BasicRandomTypeTable.ElementAt(typeIndex).Value[(int)ATTRIBUTEINDEX.HP] / 100.0;
            double atkPercent = 1.0 * BasicRandomTypeTable.ElementAt(typeIndex).Value[(int)ATTRIBUTEINDEX.ATK] / 100.0;
            double defPercent = 1.0 * BasicRandomTypeTable.ElementAt(typeIndex).Value[(int)ATTRIBUTEINDEX.DEF] / 100.0;

            attr.HP = (int)(attr.HP * hpPercent);
            attr.ATK = (int)(attr.ATK * atkPercent);
            attr.DEF = (int)(attr.DEF * defPercent);

            attr.HP_GROWTH = (int)(attr.HP_GROWTH * hpPercent);
            attr.ATK_GROWTH = (int)(attr.ATK_GROWTH * atkPercent);
            attr.DEF_GROWTH = (int)(attr.DEF_GROWTH * defPercent);
        }
Ejemplo n.º 2
0
        public static General GenerateGeneral(int id, string name,int soldierType, MainAttribute attribute)
        {
            General config = new General();
            config.ID = id;

            config.Name = name;
            config.Title = "";
            config.Star = 1;
            config.SoldierType = soldierType;
            config.Nationality = 0;
            config.InitialLv = 1;
            config.IconID = "g0.png";
            config.ModelPatch = ModelPatchList[soldierType];
            config.AttackType = soldierType == 3 ? 8003 : 1;
            config.CriticalRate = 200;
            config.DodgeRate = 200;
            config.HitRate = 100;
            config.Souls = 0;
            config.RankUpLevel1Costs = "2,1003,100;";
            config.RankUpLevel2Costs = "2,1003,200;";
            config.RankUpLevel3Costs = "2,1003,300;";
            config.RankUpLevel4Costs = "2,1003,400;";
            config.RankUpLevel5Costs = "2,1003,500;";
            config.Rank1LeastLevel = 10;
            config.Rank2LeastLevel = 20;
            config.Rank3LeastLevel = 30;
            config.Rank4LeastLevel = 40;
            config.Rank5LeastLevel = 50;

            config.HP = attribute.HP;
            config.AttackPower = attribute.ATK;
            config.DefensePower = attribute.DEF;
            config.HPGrowth = attribute.HP_GROWTH;
            config.ATKGrowth = attribute.ATK_GROWTH;
            config.DEFGrowth = attribute.DEF_GROWTH;

            config.MoveSpeed = attribute.MOVE_SPEED;
            config.AttackRange = attribute.ATTACK_RANGE;
            config.AttackSpeed = attribute.ATTACK_SPEED;

            return config;
        }