예제 #1
0
파일: EndLessDesert.cs 프로젝트: crybx/mud
        IZone IZoneCode.Generate()
        {
            RandomZoneGeneration randZoneGen = new RandomZoneGeneration(10, 10, zoneId);
            RoomDescription description = new RoomDescription();
            description.LongDescription = "Dunes gently roll off into the horizon like waves on the ocean.";
            description.ExamineDescription = "The sand is a soft almost powdery substance that lets you sink up to your ankles.";
            description.ShortDescription = "Desert";
            randZoneGen.RoomDescriptions.Add(description);

            IZone zone = randZoneGen.Generate();
            zone.InGameDaysTillReset = 1;
            zone.Name = nameof(EndLessDesert);


            Random random = new Random(zoneId);
            IRoom room = zone.Rooms[random.Next(zone.Rooms.Count) + 1];
            room.LongDescription = "Lush trees grow around the small lake forming every desert travelers dream, an oasis.";
            room.ExamineDescription = "A small lake is a pale cool blue color inviting you to take a drink and cool off from the hot desert air.";
            room.ShortDescription = "Oasis";

            IEnchantment enchantment = new HeartbeatBigTickEnchantment();
            enchantment.ActivationPercent = 100;
            enchantment.Effect = new DoorwayToUnderworld();
            room.Enchantments.Add(enchantment);

            ZoneHelper.ConnectZone(zone.Rooms[6], Direction.North, 9, 93);

            return zone;
        }
예제 #2
0
        public IZone Generate()
        {
            List <string> names = new List <string>()
            {
                "Falim Nasha", "Bushem Dinon", "Stavelm Eaglelash", "Giu Thunderbash", "Marif Hlisk", "Fim Grirgav", "Strarcar Marshgem", "Storth Shadowless", "Tohkue-zid Lendikrafk", "Vozif Jikrehd", "Dranrovelm Igenomze", "Zathis Vedergi", "Mieng Chiao", "Thuiy Chim", "Sielbonron Canderger", "Craldu Gacevi",
                "Rumeim Shennud", "Nilen Cahrom", "Bei Ashspark", "Hii Clanbraid", "Sodif Vatsk", "Por Rorduz", "Grorcerth Forestsoar", "Gath Distantthorne", "Duhvat-keuf Faltrueltrim", "Ham-kaoz Juhpafk", "Rolvoumvald Gibenira", "Rondit Vumregi", "Foy Sheiy", "Fiop Tei", "Fruenrucu Jalbese", "Fhanun Guldendal"
            };

            RandomZoneGeneration randZoneGen = new RandomZoneGeneration(5, 5, Zone.Id);
            RoomDescription      description = new RoomDescription();

            description.LookDescription    = "The dirt has been freshly disturbed where a body has been recently placed in the ground.";
            description.ExamineDescription = "Some flowers have been placed on the headstone that belongs to {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "The headstone has been here a while and is starting to show its age.";
            description.ExamineDescription = "The headstone name has worn off and is impossible to read.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "A grand tower of marble rises to the sky.  This person must have been important or rich in life.";
            description.ExamineDescription = "The tombstone belongs to {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "A small flat stone marker is all shows where this person is buried.";
            description.ExamineDescription = "The grave marker belongs to {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "There is a small bench for resting as one walks among the tombstones.";
            description.ExamineDescription = "A pair of angles are carved into the sides of the feet on the bench.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "Crosses give hint that the owner might have been religions in life.";
            description.ExamineDescription = "Here lies {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "The statue a weeping angle stands watch over the deceased.";
            description.ExamineDescription = "The grave belongs to {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            FlavorOption option = new FlavorOption();

            option.FlavorValues.Add("{name}", names);
            description.FlavorOption.Add(option);
            randZoneGen.RoomDescriptions.Add(description);

            Zone      = randZoneGen.Generate();
            Zone.Name = nameof(GrandViewGraveYard);

            int creatueChoices = 0;

            MethodInfo[] methods = this.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance);
            foreach (MethodInfo info in methods)
            {
                if (info.ReturnType == typeof(INonPlayerCharacter) && info.Name != "BuildNpc")
                {
                    creatueChoices++;
                }
            }

            int        percent            = (int)Math.Round(5d / creatueChoices, 0);
            List <int> hoursToSpawnUndead = new List <int>();

            for (int i = 12; i < 24; i++)
            {
                hoursToSpawnUndead.Add(i);
            }

            HeartbeatBigTickEnchantment enchantmentSkeleton = new HeartbeatBigTickEnchantment();

            enchantmentSkeleton.ActivationPercent = .2;
            enchantmentSkeleton.Effect            = new LoadMob()
            {
                HoursToLoad = hoursToSpawnUndead
            };
            enchantmentSkeleton.Parameter = new EffectParameter()
            {
                Performer = Skeleton(), RoomMessage = new TranslationMessage("The skeleton rises slowly out of its grave.")
            };

            HeartbeatBigTickEnchantment enchantmentZombie = new HeartbeatBigTickEnchantment();

            enchantmentSkeleton.ActivationPercent = .2;
            enchantmentZombie.Effect = new LoadMob()
            {
                HoursToLoad = hoursToSpawnUndead
            };
            enchantmentZombie.Parameter = new EffectParameter()
            {
                Performer = Zombie(), RoomMessage = new TranslationMessage("A zombie burst forth from it grave hungry for brains.")
            };

            foreach (IRoom room in Zone.Rooms.Values)
            {
                ILoadableItems loadable = (ILoadableItems)room;
                loadable.LoadableItems.Add(new LoadPercentage()
                {
                    PercentageLoad = percent, Object = Crow()
                });
                room.Attributes.Add(RoomAttribute.Outdoor);
                room.Attributes.Add(RoomAttribute.Weather);

                room.Enchantments.Add(enchantmentSkeleton);
                room.Enchantments.Add(enchantmentZombie);
            }

            SetRoom13();

            Zone.Rooms.Add(26, Room26());

            ConnectRooms();

            return(Zone);
        }
예제 #3
0
        IZone IZoneCode.Generate()
        {
            RandomZoneGeneration randZoneGen = new RandomZoneGeneration(10, 10, zoneId);
            RoomDescription      description = new RoomDescription();

            description.LongDescription    = "This part of the field is tilled and ready to be planted.";
            description.ExamineDescription = "The dirt is rich and will support a good crop.";
            description.ShortDescription   = "Farmland";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LongDescription    = "While the {crop} looks healthy it is still to young to eat.";
            description.ExamineDescription = "A tall crop of {crop} is growing here.";
            description.ShortDescription   = "Farmland";
            FlavorOption option = new FlavorOption();

            option.FlavorValues.Add("{crop}", new List <string>()
            {
                "corn", "wheat", "grapes"
            });
            description.FlavorOption.Add(option);
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LongDescription    = "The field is full of tall grass.";
            description.ExamineDescription = "The field is full of tall grass that seems to flow around you as you walk through it.";
            description.ShortDescription   = "Farmland";
            randZoneGen.RoomDescriptions.Add(description);

            option            = new FlavorOption();
            option.FlavorText = "A {type} fence runs parallel to you a {distance} away.";
            option.FlavorValues.Add("{type}", new List <string>()
            {
                "wooden", "stone"
            });
            option.FlavorValues.Add("{distance}", new List <string>()
            {
                "short", "long"
            });
            randZoneGen.RoomFlavorText.Add(option);

            option            = new FlavorOption();
            option.FlavorText = "A rusted horse shoe has been lost and lies rusting away.";
            randZoneGen.RoomFlavorText.Add(option);

            option            = new FlavorOption();
            option.FlavorText = "A small hill rises to the {direction} in the distance.";
            option.FlavorValues.Add("{direction}", new List <string>()
            {
                "north", "east", "south", "west"
            });
            randZoneGen.RoomFlavorText.Add(option);

            IZone zone = randZoneGen.Generate();

            zone.InGameDaysTillReset = 1;
            zone.Name = nameof(GrandViewDeepForest);


            description = new RoomDescription();
            description.LongDescription    = "A road runs through the farm lands.";
            description.ExamineDescription = "Two wagon ruts cut into the soil.";
            description.ShortDescription   = "Road";
            randZoneGen.RoadDescription    = description;
            randZoneGen.AddRoad(zone, null, new ZoneConnection()
            {
                ZoneId = 8, RoomId = 1
            }, new ZoneConnection()
            {
                ZoneId = 14, RoomId = 6
            }, new ZoneConnection()
            {
                ZoneId = 4, RoomId = 6
            });

            int animalChoices = 0;

            MethodInfo[] methods = this.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance);
            foreach (MethodInfo info in methods)
            {
                if (info.ReturnType == typeof(INonPlayerCharacter) && info.Name != "BuildNpc")
                {
                    animalChoices++;
                }
            }


            int percent = 20 / animalChoices;

            foreach (IRoom room in zone.Rooms.Values)
            {
                ILoadableItems loadable = (ILoadableItems)room;
                loadable.LoadableItems.Add(new LoadPercentage()
                {
                    PercentageLoad = percent, Object = Cow()
                });
                loadable.LoadableItems.Add(new LoadPercentage()
                {
                    PercentageLoad = percent, Object = Horse()
                });
                loadable.LoadableItems.Add(new LoadPercentage()
                {
                    PercentageLoad = percent, Object = Chicken()
                });
            }
            return(zone);
        }