private void SpawnFirstLevelFighter(string userId)
        {
            var shortSword   = _weaponFactory.Create("Short Sword");
            var fighterStats = new Statistics()
            {
                AbilityScores = new AbilityScores(16, 14, 16, 9, 9, 8),
                AttackScores  = new AttackScores(shortSword, 1),
                DefenseScores = new DefenseScores(14, 11)
            };

            var jools = new Player(id: userId, "Jools", "Human", "Fighter", level: 1, fighterStats)
            {
                Inventory = new Inventory
                {
                    Items = new List <Item>
                    {
                        shortSword,
                        new Item {
                            Name = "Studded Leather", Id = Guid.NewGuid().ToString()
                        }
                    }
                }
            };

            SpawnInRandomOpenCell(jools);
            _creatureRegistry.Register(jools);
        }
Exemple #2
0
        public void SpawnRandomly(int creatureCount)
        {
            for (var i = 0; i < creatureCount; ++i)
            {
                var creature        = _creatureFactory.CreateRandom();
                var autonomousModel = _autonomousFactory.Create("simpledefender", creature);
                var openCell        = _playArea.GameMap.GetRandomOpenCell();

                // TODO: Simplify all the registering.
                _playArea.GameMap.Add(openCell.X, openCell.Y, creature);
                creature.Position.SetPosition(openCell.X, openCell.Y);
                _autonomousRegistry.Register(autonomousModel);
                _creatureRegistry.Register(creature);
                _recipientRegistry.Register(autonomousModel);
            }
        }