Esempio n. 1
0
        private void CreateMonsters(Mogwai mogwai)
        {
            // not implemented
            _monsters.Add(Monsters.Rat);

            // dispose the created monsters to floor
        }
Esempio n. 2
0
        protected override void GenerateRooms(Mogwai mogwai, Shift shift)
        {
            int n = 1;                              // should be determined by information of shift and mogwai

            bool[,] blueprint = new bool[n, n];     // can be substituted with an n*(n - 1) array

            // TODO: create random connected graph from the blueprint.
            // TODO: create a dungeon with long main chain with few side rooms
            // here, it is obviously { { false } }


            // TODO: assign random rooms with probabilities
            // here, the only room is deterministically a monster room
            var rooms = new Room[n];

            for (int i = 0; i < n; i++)
            {
                rooms[i] = new SimpleRoom(this, mogwai);
            }

            // specify pointers
            for (int i = 0; i < n; i++)
            {
                for (int j = i + 1; j < n; j++) // only concern upper diagonal of the matrix
                {
                    if (blueprint[i, j])
                    {
                        Room.Connect(rooms[i], rooms[j]);
                    }
                }
            }

            // set entrance (or maybe we can create a specific class for entrance)
            Entrance = rooms[0];
        }
Esempio n. 3
0
        public override void NextStep(Mogwai mogwai, Shift shift)
        {
            if (AdventureState == AdventureState.CREATION)
            {
                Entrance.Initialise(mogwai);
                AdventureState = AdventureState.RUNNING;
            }

            if (!Enter())
            {
                AdventureState = AdventureState.FAILED;
                return;
            }

            AdventureState = AdventureState.COMPLETED;
        }
Esempio n. 4
0
        public SimpleRoom(Dungeon parent, Mogwai mogwai) : base(parent)
        {
            const int length = 5;

            Width  = length;
            Length = length;
            var floor = new Tile[length, length];

            // Initialise Tiles
            for (int i = 0; i < length; i++)
            {
                for (int j = 0; j < length; j++)
                {
                    floor[i, j] = new StoneTile(this, new Coordinate(i, j));
                }
            }


            // deploy monsters and the adventurer
            Monster[] monsters = { Monsters.Rat };
            for (int i = 0; i < monsters.Length; i++)
            {
                while (true)
                {
                    //var x = parent.DungeonDice.Roll(length, -1);
                    //var y = parent.DungeonDice.Roll(length, -1);
                    var  x    = 4;
                    var  y    = 4;
                    Tile tile = floor[x, y];
                    if (!tile.IsOccupied)
                    {
                        monsters[i].Coordinate = new Coordinate(x, y);
                        break;
                    }
                }
            }

            mogwai.Coordinate = new Coordinate(length / 2, 0);

            Floor = floor;

            _fight = new SimpleCombat(this, new [] { mogwai }, monsters);
            //_fight.Create(mogwai, Parent.CreationShift);
        }
Esempio n. 5
0
 public virtual void Initialise(Mogwai mogwai)
 {
 }
Esempio n. 6
0
 public override void Initialise(Mogwai mogwai)
 {
 }
Esempio n. 7
0
 public override void Initialise(Mogwai mogwai)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
 public override bool Interact(Mogwai mogwai)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
 public abstract bool Interact(Mogwai mogwai);
Esempio n. 10
0
 public SimpleDungeon(Mogwai mogwai, Shift shift) : base(mogwai, shift)
 {
 }
Esempio n. 11
0
 /// <summary>
 /// Generates rooms and corridors
 /// </summary>
 protected virtual void GenerateRooms(Mogwai mogwai, Shift shift)
 {
 }
Esempio n. 12
0
        //public bool[,] Blueprint { get; protected set; }

        public Dungeon(Mogwai mogwai, Shift creationShift)
        {
            CreationShift = creationShift;
            DungeonDice   = creationShift.MogwaiDice; // set dungeon dice using the creation shift
            GenerateRooms(mogwai, creationShift);
        }