public RaceModule(HeroInfo info) { mHeroInfo = info; mRaceMod = new PropGroup <int>(RecalcRaceMod);//, "RaceMod"); mHeroInfo.AddBasePropRelation(mRaceMod); }
public BasePointModule(HeroInfo info) { mHeroInfo = info; mBasePoints = new PropGroup <int>(null);//, "Base"); info.AddBasePropRelation(mBasePoints); }
public ClassModule(HeroInfo info) { mHeroInfo = info; mBasePropBonus = new PropGroup <int>(RecalcClassMod); mHeroInfo.AddAdvPropRelation(mBasePropBonus); }
internal void AddHero(HeroInfo heroInfo) { if (mHeroes == null) { mHeroes = new List <HeroInfo>(); } mHeroes.Add(heroInfo); }
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))); }
public BattleHeroInfo(HeroInfo info, int attackTurn, int side) { mHeroBaseInfo = info; mRemainHp = mHeroBaseInfo.GetAdvProp(enmPropType.HP); MIsAlive = true; MSide = side; MAttackTurn = attackTurn; }
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; }
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); }
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); }