示例#1
0
        public static int RoundDieRoll(float num, DieRollType typ)
        {
            num = (int)Math.Floor(num);
            if (num < 0)
            {
                if (typ == DieRollType.Damage || typ == DieRollType.HitPoint)
                {
                    // Hitpoint and damage die rolls always have a minimum of one
                    num = 1;
                }
            }

            return((int)num);
        }
示例#2
0
文件: D20Math.cs 项目: kamilion/WISP
        public static int RoundDieRoll(float num, DieRollType typ)
        {
            num = (int)Math.Floor(num);
            if(num < 0)
            {
                if(typ == DieRollType.Damage || typ == DieRollType.HitPoint)
                {
                    // Hitpoint and damage die rolls always have a minimum of one
                    num = 1;
                }
            }

            return (int)num;
        }