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); } }
public void ReduceBasePoint(enmPropType type, int reducePoint = 1) { PropItem <int> pi = mBasePoints.GetPropItem((int)type); if (pi != null) { pi.SetValue(pi.GetValue() - reducePoint); } }
public void AddBasePoint(enmPropType type, int addPoint = 1) { PropItem <int> pi = mBasePoints.GetPropItem((int)type); if (pi != null) { pi.SetValue(pi.GetValue() + addPoint); } }
public int GetRaceMod(enmPropType type) { PropItem <int> pi = mRaceMod.GetPropItem((int)type); if (pi != null) { return(pi.GetValue()); } return(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); } }
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))); } }
public int GetAdvProp(enmPropType type) { PropItem <int> pi = mAdvProp.GetPropItem((int)type); if (pi != null) { return(pi.GetValue()); } return(0); }
public int GetBasePoint(enmPropType type) { PropItem <int> pi = mBasePoints.GetPropItem((int)type); if (pi != null) { return(pi.GetValue()); } return(0); }
public int GetClassMod(enmPropType type) { PropItem <int> pi = mBasePropBonus.GetPropItem((int)type); if (pi != null) { return(pi.GetValue()); } return(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); }
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); }
public void ReduceInitBp(enmPropType type) { mBasePointModule.ReduceBasePoint(type); }
public void AddInitBp(enmPropType type) { mBasePointModule.AddBasePoint(type); }
public int GetInitBP(enmPropType type) { return(mBasePointModule.GetBasePoint(type)); }