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); }
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); }