Ejemplo n.º 1
0
        public void OnLevelUp(int level, int levelUp)
        {
            // increase evolved skill point
            if (level % 4 == 0)
            {
                ++_skill.evolvedSkillPoint;
                for (var i = 1; i <= levelUp; i++)
                {
                    if ((level - i) % 4 == 0)
                    {
                        ++_skill.evolvedSkillPoint;
                    }
                }
            }

            // Stat
            _stat.AutoAddPoint(false);
            var point = StatCalculator.GeneratePoint(levelUp, _stat.initPoint);

            _stat.SetPoint(point);
            // HP
            _hp.SetMaxHp(levelUp, false);
            // Treasures
//			BattleController.treasure = Treasure.GetFor(this);
        }
Ejemplo n.º 2
0
        void AutoCalculateProbability(params float[] percents)
        {
            var _0 = 0;
            var _1 = 0;
            var _2 = 0;
            var _3 = 0;
            var _4 = 0;

            foreach (var statIndex in StatCalculator.GetStatWithProbability(point, percents))
            {
                switch (statIndex)
                {
                case 0:
                    ++_0;
                    break;

                case 1:
                    ++_1;
                    break;

                case 2:
                    ++_2;
                    break;

                case 3:
                    ++_3;
                    break;

                case 4:
                    ++_4;
                    break;

                default:
                    break;
                }
            }
            this.point = 0;

            AddPoint(StatType.Strength, _0);
            AddPoint(StatType.Dexterity, _1);
            AddPoint(StatType.Intelligent, _2);
            AddPoint(StatType.Vitality, _3);
            AddPoint(StatType.Luck, _4);
        }