예제 #1
0
        public Mob GenerateOne()
        {
            // completely unbiased. YOU WILL GET THE WORST MOBS ANYWAY
            var template = GenGod.SelectOne(_templates);

            var health  = new Dice(template.HealthDice);
            var attack  = new Dice(template.AttackDice);
            var defense = new Dice(template.DefenseDice);

            return(new Mob(_level, _grid, template, health.Roll(), attack.Roll(), defense.Roll()));
        }
예제 #2
0
        public void MoveRandomly()
        {
            var directions = new[] {
                Direction.Up,
                Direction.Down,
                Direction.Left,
                Direction.Right,
                Direction.UpRight,
                Direction.UpLeft,
                Direction.DownLeft,
                Direction.DownRight
            };

            Direction direction;

            do
            {
                direction = GenGod.SelectOne(directions);
            } while (Move(direction) == MoveResult.Blocked);
        }