Esempio n. 1
0
        public static GameComponent GenerateDwarf(
            Vector3 Position,
            ComponentManager Manager,
            string Allies,
            EmployeeClass DwarfClass,
            int Level, Gender gender, int seed)
        {
            Dwarf toReturn = new Dwarf(Manager, new CreatureStats(DwarfClass, Level)
            {
                Gender = gender, RandomSeed = seed, VoicePitch = CreatureStats.GetRandomVoicePitch(gender)
            }, Allies, Manager.World.PlanService, Manager.World.PlayerFaction, "Dwarf", DwarfClass, Position);

            toReturn.AddThought(Thought.CreateStandardThought(Thought.ThoughtType.JustArrived, Manager.World.Time.CurrentDate), false);
            return(toReturn.Physics);
        }
Esempio n. 2
0
        public static GameComponent GenerateDwarf(
            Vector3 Position,
            ComponentManager Manager,
            String DwarfClass,
            int Level, Gender gender, int seed)
        {
            var toReturn = new Dwarf(Manager, new CreatureStats("Dwarf", DwarfClass, Level)
            {
                Gender = gender, RandomSeed = seed, VoicePitch = GetRandomVoicePitch(gender)
            }, Manager.World.PlayerFaction, "Dwarf", Position);

            toReturn.AddThought("I just arrived to this new land.", new TimeSpan(3, 0, 0, 0), 20.0f);

            if (toReturn.Equipment.HasValue(out var equipment))
            {
                foreach (var equippedItem in toReturn.Stats.CurrentClass.StartingEquipment)
                {
                    equipment.EquipItem(new Resource(equippedItem.TypeName));
                }
            }

            return(toReturn.Physics);
        }
Esempio n. 3
0
        public void Hire(Applicant currentApplicant)
        {
            List <Room> rooms = GetRooms().Where(room => room.RoomData.Name == "BalloonPort").ToList();

            if (rooms.Count == 0)
            {
                return;
            }

            Economy.CurrentMoney -= currentApplicant.Level.Pay * 4;
            Dwarf newMinion =
                EntityFactory.GenerateDwarf(
                    rooms.First().GetBoundingBox().Center() + Vector3.UnitY * 15,
                    Components, GameState.Game.Content, GameState.Game.GraphicsDevice, PlayState.ChunkManager,
                    PlayState.Camera, this, PlayState.PlanService, "Player", currentApplicant.Class, currentApplicant.Level.Index).GetChildrenOfType <Dwarf>().First();

            newMinion.Stats.CurrentClass = currentApplicant.Class;
            newMinion.Stats.LevelIndex   = currentApplicant.Level.Index - 1;
            newMinion.Stats.LevelUp();
            newMinion.Stats.FullName = currentApplicant.Name;
            newMinion.AI.AddMoney(currentApplicant.Level.Pay * 4);

            PlayState.AnnouncementManager.Announce("New Hire!", currentApplicant.Name + " was hired as a " + currentApplicant.Level.Name, newMinion.AI.ZoomToMe);
        }