Пример #1
0
        private void RecalcPropMod()
        {
            PropItem <int> piBase;
            int            val;

            for (enmPropType type = enmPropType.BP_MIN + 1; type < enmPropType.BP_MAX; type++)
            {
                piBase = mBaseProp.GetPropItem((int)type);
                if (piBase != null)
                {
                    if (piBase.GetValue() < 10)
                    {
                        val = (piBase.GetValue() - 11) / 2;
                    }
                    else
                    {
                        val = (piBase.GetValue() - 10) / 2;
                    }
                }
                else
                {
                    val = 0;
                }

                mPropMod.SetPropItem((int)type, val);
            }
        }
Пример #2
0
        public void ReduceBasePoint(enmPropType type, int reducePoint = 1)
        {
            PropItem <int> pi = mBasePoints.GetPropItem((int)type);

            if (pi != null)
            {
                pi.SetValue(pi.GetValue() - reducePoint);
            }
        }
Пример #3
0
        public void AddBasePoint(enmPropType type, int addPoint = 1)
        {
            PropItem <int> pi = mBasePoints.GetPropItem((int)type);

            if (pi != null)
            {
                pi.SetValue(pi.GetValue() + addPoint);
            }
        }
Пример #4
0
        public int GetRaceMod(enmPropType type)
        {
            PropItem <int> pi = mRaceMod.GetPropItem((int)type);

            if (pi != null)
            {
                return(pi.GetValue());
            }
            return(0);
        }
Пример #5
0
        private void RecalcBaseProps()
        {
            int val;

            for (enmPropType type = enmPropType.BP_MIN + 1; type < enmPropType.BP_MAX; type++)
            {
                val = mRaceModule.GetRaceMod(type) + mBasePointModule.GetBasePoint(type);
                mBaseProp.SetPropItem((int)type, val);
            }
        }
Пример #6
0
        public void DoPrint()
        {
            Console.WriteLine(string.Format("{0} ({1} {2})", Name, GetRace(), GetMainClassName()));
            mClassModule.DoPrintExp();

            for (enmPropType type = enmPropType.BP_MIN + 1; type < enmPropType.BP_MAX; ++type)
            {
                Console.WriteLine(string.Format("{0} {1} ({2})", type, this.GetBaseProp(type), this.GetBasePropMod(type)));
            }
        }
Пример #7
0
        public int GetAdvProp(enmPropType type)
        {
            PropItem <int> pi = mAdvProp.GetPropItem((int)type);

            if (pi != null)
            {
                return(pi.GetValue());
            }
            return(0);
        }
Пример #8
0
        public int GetBasePoint(enmPropType type)
        {
            PropItem <int> pi = mBasePoints.GetPropItem((int)type);

            if (pi != null)
            {
                return(pi.GetValue());
            }
            return(0);
        }
Пример #9
0
        public int GetClassMod(enmPropType type)
        {
            PropItem <int> pi = mBasePropBonus.GetPropItem((int)type);

            if (pi != null)
            {
                return(pi.GetValue());
            }
            return(0);
        }
Пример #10
0
        private enmCommandResult DoRoll(object[] param)
        {
            _bp = new Dictionary <enmPropType, int>();
            for (enmPropType type = enmPropType.BP_MIN + 1; type < enmPropType.BP_MAX; ++type)
            {
                _bp[type] = GameLogic.Dice(3, 6);
            }
            mCreatingHero.InitBasePoints(_bp);

            return(enmCommandResult.SUCCESS);
        }
Пример #11
0
        public static HeroInfo CreateRandomHero(byte hType, int crLevel)
        {
            HeroInfo info = new HeroInfo();

            if (hType == 2)
            {
                info.SetRace((byte)Dice(1, SingletonFactory <RaceConfig> .Instance.GetMaxId(hType), 100));
            }
            else
            {
                info.SetRace((byte)Dice(1, SingletonFactory <RaceConfig> .Instance.GetMaxId(hType)));
            }
            info.SetClassLevel((byte)Dice(1, SingletonFactory <ClassConfig> .Instance.GetMaxId()), 1);

            int diceNum, dice;

            switch (crLevel)
            {
            case 1:
                diceNum = 1;
                dice    = 4;
                break;

            default:
                diceNum = 3;
                dice    = 6;
                break;
            }

            Dictionary <enmPropType, int> basePoints = new Dictionary <enmPropType, int>();

            for (enmPropType type = enmPropType.BP_MIN + 1; type < enmPropType.BP_MAX; type++)
            {
                basePoints[type] = Dice(diceNum, dice);
            }
            info.InitBasePoints(basePoints);

            return(info);
        }
Пример #12
0
 public void ReduceInitBp(enmPropType type)
 {
     mBasePointModule.ReduceBasePoint(type);
 }
Пример #13
0
 public void AddInitBp(enmPropType type)
 {
     mBasePointModule.AddBasePoint(type);
 }
Пример #14
0
 public int GetInitBP(enmPropType type)
 {
     return(mBasePointModule.GetBasePoint(type));
 }