示例#1
0
 public void AddLevel(LevelSec levelSec)
 {
     Add(levelSec);
 }
示例#2
0
        static void CreateSkillLevels(SkillFile skill, string affixName, string layoutFile, bool isAttack)
        {
            LevelSec levelSec;
            // mana cost progression by skill level
            double manaCost = 2;
            double manaInc1 = 1;
            double manaInc2 = 0;
            double manaInc3 = 0.1;
            double manaInc4 = 0.005;
            // level requirement progression by skill level
            int levelReq    = 1;
            int levelReqInc = 1;
            // affix level progression by skill level
            double affixLevel     = 1;
            double affixLevelInc  = 2;
            double affixLevelInc2 = 0.106;

            if (!isAttack)
            {
                affixLevelInc  = 1;
                affixLevelInc2 = 0;
            }
            // add all the skill levels
            for (int skillLvl = 1; skillLvl <= 120; ++skillLvl)
            {
                // prepare all the needed sections
                if (isAttack)
                {
                    levelSec = new LevelSec(skillLvl, (int)(manaCost + 0.5), levelReq);
                }
                else
                {
                    levelSec = new LevelSec(skillLvl, 0, levelReq);
                }
                if (skillLvl > 100)
                {
                    levelSec.levelRequired = 0;
                }
                EventSec   eventSec   = new EventSec(EventSec.EVENT_TRIGGER, layoutFile);
                AffixesSec affixesSec = new AffixesSec(affixName);
                affixesSec.affixLevel = (int)(affixLevel + 0.5);
                // add the sections in the proper order
                eventSec.AddAffixes(affixesSec);
                levelSec.AddEvent(eventSec);
                skill.AddLevel(levelSec);

                // increase mana cost
                manaInc3 += manaInc4;
                manaInc2 += manaInc3;
                manaInc1 += manaInc2;
                manaCost += manaInc1;
                // increase level requirements
                if (skillLvl % 10 == 0)
                {
                    ++levelReqInc;
                }
                levelReq += levelReqInc;
                // increase affix level
                affixLevelInc += affixLevelInc2;
                affixLevel    += affixLevelInc;
            }
        }