Example #1
0
        public RaceModule(HeroInfo info)
        {
            mHeroInfo = info;

            mRaceMod = new PropGroup <int>(RecalcRaceMod);//, "RaceMod");
            mHeroInfo.AddBasePropRelation(mRaceMod);
        }
Example #2
0
        public BasePointModule(HeroInfo info)
        {
            mHeroInfo   = info;
            mBasePoints = new PropGroup <int>(null);//, "Base");

            info.AddBasePropRelation(mBasePoints);
        }
Example #3
0
        public ClassModule(HeroInfo info)
        {
            mHeroInfo      = info;
            mBasePropBonus = new PropGroup <int>(RecalcClassMod);

            mHeroInfo.AddAdvPropRelation(mBasePropBonus);
        }
Example #4
0
        internal void AddHero(HeroInfo heroInfo)
        {
            if (mHeroes == null)
            {
                mHeroes = new List <HeroInfo>();
            }

            mHeroes.Add(heroInfo);
        }
Example #5
0
        internal void AddHero(HeroInfo newHero)
        {
            SingletonFactory <UserInfo> .Instance.AddHero(newHero);

            //Console.WriteLine(string.Format("HP:{0}, AB:{1}, AC:{2}",
            //    newHero.GetAdvProp(enmPropType.HP),
            //    newHero.GetAdvProp(enmPropType.ATTACK_BONUS),
            //    newHero.GetAdvProp(enmPropType.ARMOR_CLASS)));
        }
Example #6
0
        public BattleHeroInfo(HeroInfo info, int attackTurn, int side)
        {
            mHeroBaseInfo = info;

            mRemainHp   = mHeroBaseInfo.GetAdvProp(enmPropType.HP);
            MIsAlive    = true;
            MSide       = side;
            MAttackTurn = attackTurn;
        }
Example #7
0
        public void AddHero(HeroInfo hero)
        {
            if (mHeroes == null)
            {
                mHeroes = new List <HeroInfo>();
            }

            if (!mHeroes.Contains(hero))
            {
                mHeroes.Add(hero);

                if (mTeam.MHeroes.Count < 6)
                {
                    mTeam.AddHero(hero);
                }

                //SingletonFactory<GameController>.Instance.SaveGame(null);
            }

            MTeamCreated = true;
        }
Example #8
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);
        }
Example #9
0
        private enmCommandResult DoChooseRace(object[] param)
        {
            if (mCreatingHero == null)
            {
                mCreatingHero = new HeroInfo();
            }

            byte raceId = 0;

            try
            {
                raceId = byte.Parse(param[0].ToString());
            }
            catch (Exception)
            {
                return(enmCommandResult.FAILED);
            }

            mCreatingHero.SetRace(raceId);

            return(enmCommandResult.SUCCESS);
        }