コード例 #1
0
 private void AddNPCs(string name, int min, int max)
 {
     //Random rand = new Random(Guid.NewGuid().GetHashCode());
     for (int i = 0; i < rand.Next(min, max + 1); i++)
     {
         NPCs.Add(new NPC(name, friendly));
     }
 }
コード例 #2
0
        public void AddNPC(NPC n)
        {
            if (NPCs == null)
            {
                NPCs = new List <NPC>();
            }

            NPCs.Add(n);
        }
コード例 #3
0
ファイル: Screen.cs プロジェクト: eldan-dex/randio
        //Like Map.Update, updates player, NPCs, items, events and displayed text. Also advances the intro/outro as needed and checks for task completion
        public override void Update(GameTime gameTime, KeyboardState keyboardState)
        {
            Player.Update(gameTime, keyboardState);
            UpdateNPCs(gameTime);
            UpdateItems(gameTime);
            UpdateEvents();
            TextAnimationMgr.Update();

            if (CheckOutOfMap((int)Player.Position.Y) == -1)
            {
                //player fell down, reset player
                ResetPlayer();
            }

            //Player entered the "red door"
            if (exitZone != null && CheckZone(exitZone))
            {
                Game.Dialogue = new Dialogue(device, this, "Start your adventure now?", delegate { exitZone = null; Game.endIntro = true; Game.Loading = new Loading(device, this, "Game is now loading..."); }, delegate { ResetPlayer(); });
            }

            //Player is trying to reach all "green doors"
            if (movementTestZones != null)
            {
                foreach (Zone z in movementTestZones)
                {
                    if (CheckZone(z))
                    {
                        z.Deactivate();
                    }
                }

                //Success, create next task
                if (!movementTestZones.Any(x => x.Active == true))
                {
                    movementTestZones = null;
                    SetText("Good.\nNow there is an Item and an NPC (which can move around and attack you).\nUse your action keys to pick the item up (K) and attack the NPC (J)!", 50);
                    NPCs.Add(new NPC(device, this, new Vector2(400, 400), 0, tiles[0], 32, 32));
                    items.Add(new Item(this, device, Item.ItemType.Weapon, 0, new Vector2(600, 600), 0, 16, 16, true, null, new ItemProperties("ITEM")));
                }
            }

            if (Player.HeldItem != null)
            {
                pickedUpItem = true;
            }

            //Item picked up and NPC is dead, show red door and last part of text
            if (!lastStage && pickedUpItem && NPCs.Count == 0) //0 NPCs if item has been held means that the NPC is dead
            {
                lastStage = true;
                SetText("Well done!\nYou seem ready, " + Player.Name + ".\nYour objective in the game is to complete all the quests.\nIf you can't or don't want to, press ESC to end the current map and see\ngame statistics.\n\nTo start the game, jump through the red door.", 50);
                exitZone = GetScreenZone(device, Color.Red);
            }
        }
コード例 #4
0
 /// <summary>
 /// [EDITOR ONLY]
 /// </summary>
 /// <param name="_character"></param>
 public void AddCharacter(Character _character)
 {
     if (_character.IsPlayable == true && PCs.Contains(_character) == false)
     {
         PCs.Add(_character);
     }
     else if (_character.IsPlayable == false && NPCs.Contains(_character) == false)
     {
         NPCs.Add(_character);
     }
 }
コード例 #5
0
        /// <summary>
        /// Places the player and all NPCs on the map
        /// </summary>
        private void CreateHumans()
        {
            // place player near their house
            Vector3 coords = new Vector2(-3.43f, -2.34f);

            //  Place the player
            Player = Instantiate(playerPrefab.GetComponent <Player>(),
                                 coords,
                                 Quaternion.identity);
            // give the player a unique id
            Player.myID = 0;
            // Set player status to inactive. Will get avtivated when we leave the house
            Player.gameObject.SetActive(false);

            PlayerHouse playerHouseScript = PlayerHouse.GetComponent <PlayerHouse>();

            // Set the player inside the house
            playerHouseScript.NotifyPlayerIsClose(true);
            playerHouseScript.NotifyPlayerInside(true);
            // Set the player var of the house
            playerHouseScript.setPlayer(Player.gameObject);


            //  Place the NPCs in the grid
            for (int i = 0; i < npcNumber; i++)
            {
                NPCs.Add(Instantiate(npcPrefab.GetComponent <NPC>(),
                                     randomGridForHumans.RandomCoords[i],
                                     Quaternion.identity));
                // give all npcs a unique id
                NPCs[i].myID = i + 1;
            }

            //  Infect one them.
            NPCs[Mathf.RoundToInt(npcNumber / 2f)].SetInitialCondition(NPC.EXPOSED);

            //  Place the NPC_AIs in the grid
            for (int i = 0; i < npcAINumber; i++)
            {
                NPC_AIs.Add(Instantiate(npcAIPrefab.GetComponent <NPC_AI>(),
                                        randomGridForHumans.RandomCoords[i],
                                        Quaternion.identity));
                // give all npcs with ai a unique id
                NPC_AIs[i].myID = npcNumber + 1 + i;
                // give them a unique layer so that they are allowed on bridges
                NPC_AIs[i].gameObject.layer = LayerMask.NameToLayer("NPC_AI");
            }
            //  Infect one them.
            NPC_AIs[Mathf.RoundToInt(npcAINumber / 2f)].SetInitialCondition(NPC.EXPOSED);
        }
コード例 #6
0
        public void ParseOverworld(BinaryReader b)
        {
            uint fileSize = b.ReadUInt32();

            if (fileSize < 0x4)
            {
                b.Close();
                throw new Exception("Invalid overworld container.");
            }

            byte interactableCount = b.ReadByte();
            byte npcCount          = b.ReadByte();
            byte warpCount         = b.ReadByte();
            byte triggerCount      = b.ReadByte();

            for (int i = 0; i < interactableCount; ++i)
            {
                Interactables.Add(new Interactable(b));
            }

            for (int i = 0; i < npcCount; ++i)
            {
                NPCs.Add(new NPC(b));
            }

            for (int i = 0; i < warpCount; ++i)
            {
                Warps.Add(new Warp(b));
            }

            for (int i = 0; i < triggerCount; ++i)
            {
                Triggers.Add(new Trigger(b));
            }

            while (b.PeekChar() != 0)
            {
                LevelScripts.Add(new LevelScriptDeclaration(b));
            }

            b.BaseStream.Position += 0x2;

            int index = 0;

            while (b.PeekChar() != 0 && b.PeekChar() != -1 && index < LevelScripts.Count)
            {
                LevelScripts[index++].Data = new LevelScriptData(b);
            }
        }
コード例 #7
0
ファイル: Parser.cs プロジェクト: phoenix-oosd/EVTC-2-CSV
        private void AddAgent()
        {
            string address   = _br.ReadUInt64Hex();                        // 8 bytes: Address
            int    pLower    = BitConverter.ToUInt16(_br.ReadBytes(2), 0); // 2 bytes: Prof (lower bytes)
            int    pUpper    = BitConverter.ToUInt16(_br.ReadBytes(2), 0); // 2 bytes: prof (upper bytes)
            int    isElite   = _br.ReadInt32();                            // 4 bytes: IsElite
            int    toughness = _br.ReadInt32();                            // 4 bytes: Toughness
            int    healing   = _br.ReadInt32();                            // 4 bytes: Healing
            int    condition = _br.ReadInt32();                            // 4 bytes: Condition
            string name      = _br.ReadUTF8(68);                           // 68 bytes: Name

            // Add Agent by Type
            Profession profession = ParseProfession(pLower, pUpper, isElite);

            switch (profession)
            {
            case Profession.Gadget:
                Gadgets.Add(new Gadget()
                {
                    Address  = address,
                    PseudoId = pLower,
                    Name     = name
                });
                return;

            case Profession.NPC:
                NPCs.Add(new NPC()
                {
                    Address   = address,
                    SpeciesId = pLower,
                    Toughness = toughness,
                    Healing   = healing,
                    Condition = condition,
                    Name      = name
                });
                return;

            default:
                Players.Add(new Player(name)
                {
                    Address    = address,
                    Profession = profession,
                    Toughness  = toughness,
                    Healing    = healing,
                    Condition  = condition,
                });
                return;
            }
        }
コード例 #8
0
        public void SpawnEntity(NPC npc)
        {
            var msg = Networking.CreateMessage();

            msg.Write((byte)GameScreen.ServerHeaders.SPAWN_ENTITY);

            msg.Write((int)npc.GetNPCType());
            msg.Write(npc.transform.position.X);
            msg.Write(npc.transform.position.Y);
            msg.Write(npc.Tag);

            Networking.SendMessage(msg, NetDeliveryMethod.ReliableOrdered, 1);

            NPCs.Add(npc);
        }
コード例 #9
0
        void AddNPC(XElement NPC)
        {
            string[] location = ((string)NPC.Element("Location")).Split(' ');
            int      x        = int.Parse(location[0]);
            int      y        = int.Parse(location[1]);

            if ((string)NPC.Element("ObjectName") == "OldMan")
            {
                NPCs.Add(new OldMan(new Vector2(x * XSCALE + XOFFSET, y * YSCALE + YOFFSET)));
                Dialogue = NPC.Element("Dialogue").Value;
            }
            else
            {
                Console.WriteLine("ERROR: " + (string)NPC.Element("ObjectName") + " is not a recognized NPC.");
            }
        }
コード例 #10
0
        public void Load(String filename)
        {
            Clear();
            FileStream fs = new FileStream(filename, FileMode.Open);
            var        f  = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();

            Simulation = (Common.Motion.Simulation)f.Deserialize(fs);
            foreach (var o in Simulation.All)
            {
                if (o is Common.Motion.NPC)
                {
                    NPCs.Add((Common.Motion.NPC)o);
                }
                else if (o is Common.Motion.Unit)
                {
                    Units.Add((Common.Motion.Unit)o);
                }
            }
            Invalidate();
        }
コード例 #11
0
        private static void ReadNPCs()
        {
            ushort Count = Reader.ReadUInt16();

            for (ushort i = 0; i < Count; i++)
            {
                NPCData npc = new NPCData();
                npc.ID    = Reader.ReadInt32();
                npc.Quest = ReadString();
                npc.Trunk = Reader.ReadInt16();
                npc.Shop  = new List <ShopItemData>();
                byte ItemCount = Reader.ReadByte();
                for (byte iw = 0; iw < ItemCount; iw++)
                {
                    ShopItemData item = new ShopItemData();
                    item.ID    = Reader.ReadInt32();
                    item.Price = Reader.ReadInt32();
                    item.Stock = Reader.ReadInt32();
                    npc.Shop.Add(item);
                }
                NPCs.Add(npc.ID, npc);
            }
        }
コード例 #12
0
        //
        // initialize the NPCs
        //
        private void InitializeCastleNPCs()
        {
            NPCs.Add(new NPC
            {
                Name       = "Troll",
                RoomID     = 3,
                Type       = NPC.NPCType.TROLL,
                HasMessage = true,
                Message    = Environment.NewLine + "\t" + "To the depths of the dungeon you dared to go," + Environment.NewLine +
                             "\t" + "But fear not, for mercy I'm inclined to show." + Environment.NewLine +
                             "\t" + "3 guesses you'll get for a Riddle I'll give;" + Environment.NewLine +
                             "\t" + "You must answer correctly if you want to live." + Environment.NewLine +
                             "\t" + "For after guess 3, if you're wrong you're dead;" + Environment.NewLine +
                             "\t" + "For my newly sharpened guillotine will chop off your head!"
            });
            NPCs.Add(new NPC
            {
                Name       = "Monk",
                RoomID     = 1,
                Type       = NPC.NPCType.MONK,
                HasMessage = true,
                Message    = Environment.NewLine + "\t" + "If healing magic is what you seek, " + Environment.NewLine +
                             "\t" + "Then listen carefully to what I speak," + Environment.NewLine +
                             "\t" + "For 200 coin value you'll get your choice," + Environment.NewLine +
                             "\t" + "Of bag A or bag B, but heed my voice." + Environment.NewLine +
                             "\t" + "A roll of the dice is what you'll get," + Environment.NewLine +
                             "\t" + "To live, or die, a 50/50 bet." + Environment.NewLine +
                             "\t" + "If a guarantee is what you crave," + Environment.NewLine +
                             "\t" + "And 300 coin value you have saved," + Environment.NewLine +
                             "\t" + "Then a healing potion you can buy," + Environment.NewLine +
                             "\t" + "Drink this, and today, you will not die!"
            });
            NPCs.Add(new NPC
            {
                Name       = "Wizard",
                RoomID     = 6,
                Type       = NPC.NPCType.WIZARD,
                HasMessage = true,
                Message    = Environment.NewLine + "\t" + "The tower's my sanctuary, where my secrets I do keep, \n" + Environment.NewLine +
                             "\t" + "On guard a fierce dragon, it never ever does sleep, \n" + Environment.NewLine +
                             "\t" + "If you take or touch an item, that belongs to me, \n" + Environment.NewLine +
                             "\t" + "My beloved pet will inevitably see. \n" + Environment.NewLine +
                             "\t" + "You'd have to be invisible to escape from his flame, \n" + Environment.NewLine +
                             "\t" + "A gift only gotten from the boy who is lame. \n" + Environment.NewLine
            });
            NPCs.Add(new NPC
            {
                Name       = "Lame Boy",
                RoomID     = 4,
                Type       = NPC.NPCType.LAME_BOY,
                HasMessage = true,
                Message    = Environment.NewLine + "\t" + "In the kitchen I'm bound to stay, " + Environment.NewLine +
                             "\t" + "I can't go out to run and play, " + Environment.NewLine +
                             "\t" + "My legs they do not work you see, " + Environment.NewLine +
                             "\t" + "A miserable wretch I'll always be, " + Environment.NewLine +
                             "\t" + "Wherein my hope in you does lie, " + Environment.NewLine +
                             "\t" + "Should a healing potion you go and buy, " + Environment.NewLine +
                             "\t" + "Bring it back to me, a reward I'll give," + Environment.NewLine +
                             "\t" + "A cloak of invisibility so you may live ," + Environment.NewLine
            });

            NPCs.Add(new NPC
            {
                Name         = "Goblin",
                RoomID       = -1,
                Type         = NPC.NPCType.Goblin,
                GameObjectID = 5,
                HasMessage   = true,
                Message      = Environment.NewLine + "\t" + "Mischief making is our game;" + Environment.NewLine +
                               "\t" + "We love to hurt and cause you pain, " + Environment.NewLine +
                               "\t" + "We freely move from room to room, " + Environment.NewLine +
                               "\t" + "To spread fear and endless gloom, " + Environment.NewLine +
                               "\t" + "Each time we strike, your health will drop, " + Environment.NewLine +
                               "\t" + "So make the kitchen your next stop, " + Environment.NewLine +
                               "\t" + "Where a plate of food you can buy," + Environment.NewLine +
                               "\t" + "To improve your health, lest you die." + Environment.NewLine
            });
        }
コード例 #13
0
ファイル: NPCList.cs プロジェクト: crashcoot/Behemoth
 public void Add(NPC n)
 {
     NPCs.Add(n);
 }
コード例 #14
0
ファイル: MapDataFile.cs プロジェクト: yuexiae/Revise
        /// <summary>
        /// Loads the file from the specified stream.
        /// </summary>
        /// <param name="stream">The stream to read from.</param>
        public override void Load(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream, Encoding.GetEncoding("EUC-KR"));

            int blockCount = reader.ReadInt32();

            for (int i = 0; i < blockCount; i++)
            {
                MapBlockType type = (MapBlockType)reader.ReadInt32();

                if (!Enum.IsDefined(typeof(MapBlockType), type))
                {
                    throw new InvalidMapBlockTypeException((int)type);
                }

                int  offset    = reader.ReadInt32();
                long nextBlock = stream.Position;

                stream.Seek(offset, SeekOrigin.Begin);

                if (type == MapBlockType.MapInformation)
                {
                    MapPosition  = new IntVector2(reader.ReadInt32(), reader.ReadInt32());
                    ZonePosition = new IntVector2(reader.ReadInt32(), reader.ReadInt32());
                    World        = reader.ReadMatrix();
                    Name         = reader.ReadString();
                }
                else if (type == MapBlockType.WaterPatch)
                {
                    WaterPatches = new MapWaterPatches();
                    WaterPatches.Read(reader);
                }
                else
                {
                    if (type == MapBlockType.WaterPlane)
                    {
                        WaterSize = reader.ReadSingle();
                    }

                    int  entryCount = reader.ReadInt32();
                    Type classType  = type.GetAttributeValue <MapBlockTypeAttribute, Type>(x => x.Type);

                    for (int j = 0; j < entryCount; j++)
                    {
                        IMapBlock block = (IMapBlock)Activator.CreateInstance(classType);
                        block.Read(reader);

                        switch (type)
                        {
                        case MapBlockType.Object:
                            Objects.Add((MapObject)block);
                            break;

                        case MapBlockType.NPC:
                            NPCs.Add((MapNPC)block);
                            break;

                        case MapBlockType.Building:
                            Buildings.Add((MapBuilding)block);
                            break;

                        case MapBlockType.Sound:
                            Sounds.Add((MapSound)block);
                            break;

                        case MapBlockType.Effect:
                            Effects.Add((MapEffect)block);
                            break;

                        case MapBlockType.Animation:
                            Animations.Add((MapAnimation)block);
                            break;

                        case MapBlockType.MonsterSpawn:
                            MonsterSpawns.Add((MapMonsterSpawn)block);
                            break;

                        case MapBlockType.WaterPlane:
                            WaterPlanes.Add((MapWaterPlane)block);
                            break;

                        case MapBlockType.WarpPoint:
                            WarpPoints.Add((MapWarpPoint)block);
                            break;

                        case MapBlockType.CollisionObject:
                            CollisionObjects.Add((MapCollisionObject)block);
                            break;

                        case MapBlockType.EventObject:
                            EventObjects.Add((MapEventObject)block);
                            break;
                        }
                    }
                }


                if (i < blockCount - 1)
                {
                    stream.Seek(nextBlock, SeekOrigin.Begin);
                }
            }
        }
コード例 #15
0
        public static void LoadGameData()
        {
            #region Items

            Items.Add(new Weapon("Knife", "A sharp and shiny kitchen knife.", true, 50));
            Items.Add(new Weapon("Remotecontrol", "*Advertisement* This is a Sony remote control *Advertisement*", true, 20));
            Items.Add(new Weapon("Baseballbat", "Probably not used to hit a baseball in this context", true, 15));
            Items.Add(new Weapon("PoolCue", "Sports implement consisting of a tapering rod used to strike a cue ball in pool or billiards", true, 30));

            Items.Add(new Item("Winebottle", "It says Cabernet Sauvignon, 2003, California on it.", true));
            Items.Add(new Item("Beer", "A tasty bottle from Bavaria", true));
            Items.Add(new Item("Candle", "Looks like a candle.", true));
            Items.Add(new Item("Book", "A book with recipies for thai meals.", true));
            Items.Add(new Item("Tequila", "Mexican booze (most ejoyable with lemon and salt.)", true));
            Items.Add(new Item("Sunglasses", "You wear them - it darkens your sight.", true));
            Items.Add(new Item("Towel", "Use it to dry yourself.", true));
            Items.Add(new Item("Phone", "Waterproof portable phone.", true));
            Items.Add(new Item("Soap", "Use it to clean your hands properly. Hygiene is important!", true));
            Items.Add(new Item("Toiletpaper", "Well, it's toiletpaper.", true));
            Items.Add(new Item("Wallet", "Filled with a stack of bills.", true));
            Items.Add(new Item("Armchair", "Looks pretty comfy!", false));
            Items.Add(new Item("Pooltable", "A six-pocket billiards table on which pool is played.", false));

            Items.Add(new Healer("Firstaidkit", "Could possibly help you if you're hurt.", true, 50));
            Items.Add(new Healer("Banana", "This Thing is yellow and bended.", true, 30));
            Items.Add(new Healer("Popcorn", "In case you prefer sweet popcorn, they're salty.", true, 20));

            WinningItem = GetItemByName("Phone");

            #endregion

            #region Rooms

            Rooms.Add(new Room("Livingroom", "A luxurious, modern and wide opened living room"));
            Rooms.Add(new Room("Kitchen", "If you were a chef, you would love this Kitchen. But unfortunately you don't know how to cook."));
            Rooms.Add(new Room("Homecinema", "A bunch of armchairs lined up in front of a gigantic Screen surrounded by an increndible soundsystem"));
            Rooms.Add(new Room("Bathroom", "For beeing next to a home theatre, it's pretty enormous"));
            Rooms.Add(new Room("Garden", "If Fengh Shui was a person, he would have been the garden architect"));
            Rooms.Add(new Room("Pool", "Filled with refreshing turquoise water"));
            Rooms.Add(new Room("Entrance", "Some fancy cars, a huge fountain and exotic plants."));

            #endregion

            #region RoomNeighbors

            GetRoomByName("Entrance").Neighbors.Add(Direction.north, GetRoomByName("Livingroom"));

            GetRoomByName("Livingroom").Neighbors.Add(Direction.west, GetRoomByName("Kitchen"));
            GetRoomByName("Livingroom").Neighbors.Add(Direction.east, GetRoomByName("Homecinema"));
            GetRoomByName("Livingroom").Neighbors.Add(Direction.north, GetRoomByName("Garden"));
            GetRoomByName("Livingroom").Neighbors.Add(Direction.south, GetRoomByName("Entrance"));


            GetRoomByName("Homecinema").Neighbors.Add(Direction.east, GetRoomByName("Bathroom"));
            GetRoomByName("Homecinema").Neighbors.Add(Direction.west, GetRoomByName("Livingroom"));

            GetRoomByName("Bathroom").Neighbors.Add(Direction.west, GetRoomByName("Homecinema"));

            GetRoomByName("Kitchen").Neighbors.Add(Direction.east, GetRoomByName("Livingroom"));

            GetRoomByName("Garden").Neighbors.Add(Direction.south, GetRoomByName("Livingroom"));
            GetRoomByName("Garden").Neighbors.Add(Direction.north, GetRoomByName("Pool"));

            GetRoomByName("Pool").Neighbors.Add(Direction.south, GetRoomByName("Garden"));

            #endregion

            #region Player

            Player = new Player("Player", "The main Player", 100, 5, GetRoomByName("Entrance"));

            #endregion

            #region AddItemsToRooms

            GetRoomByName("Livingroom").Items.Add(GetItemByName("Beer"));
            GetRoomByName("Livingroom").Items.Add(GetItemByName("Book"));
            GetRoomByName("Livingroom").Items.Add(GetItemByName("Candle"));
            GetRoomByName("Livingroom").Items.Add(GetItemByName("Pooltable"));
            GetRoomByName("Livingroom").Items.Add(GetItemByName("PoolCue"));

            GetRoomByName("Kitchen").Items.Add(GetItemByName("Knife"));
            GetRoomByName("Kitchen").Items.Add(GetItemByName("Banana"));
            GetRoomByName("Kitchen").Items.Add(GetItemByName("Winebottle"));

            GetRoomByName("Homecinema").Items.Add(GetItemByName("Popcorn"));
            GetRoomByName("Homecinema").Items.Add(GetItemByName("Remotecontrol"));
            GetRoomByName("Homecinema").Items.Add(GetItemByName("Tequila"));
            GetRoomByName("Homecinema").Items.Add(GetItemByName("Armchair"));


            GetRoomByName("Garden").Items.Add(GetItemByName("Sunglasses"));
            GetRoomByName("Garden").Items.Add(GetItemByName("Towel"));

            GetRoomByName("Bathroom").Items.Add(GetItemByName("Soap"));
            GetRoomByName("Bathroom").Items.Add(GetItemByName("Toiletpaper"));
            GetRoomByName("Bathroom").Items.Add(GetItemByName("Firstaidkit"));


            GetRoomByName("Pool").Items.Add(GetItemByName("Phone"));

            #endregion

            #region NPCs

            NPCs.Add(new NPC("Mom", "Just a typical Mom.", 100, 15, false, false, true));
            NPCs.Add(new NPC("Thief", "Standing behind the bar it seems like he is the owner of the tavern.", 100, 10, true, true, true));
            NPCs.Add(new NPC("Mosquito", "A mosquito, that always stings", 60, 2, true, true, false));

            #endregion

            #region AddItemsToInventories

            Player.Inventory.Add(GetItemByName("Wallet"));


            GetNPCByName("Thief").Inventory.Add(GetItemByName("BaseballBat"));

            #endregion

            #region AddNPCsToRooms

            GetRoomByName("Kitchen").NPCs.Add(GetNPCByName("Mom"));
            GetRoomByName("Homecinema").NPCs.Add(GetNPCByName("Thief"));
            GetRoomByName("Garden").NPCs.Add(GetNPCByName("Mosquito"));

            #endregion

            #region NPCDialogLines

            GetNPCByName("Thief").DialogLines.Add(new CreatureDialogLine("F**k! Я думал, что здесь никого нет. Вы владелец?", 0, null));
            GetNPCByName("Thief").DialogLines.Add(new CreatureDialogLine("I kill you!", 1, null));
            GetNPCByName("Thief").DialogLines.Add(new CreatureDialogLine("U want die?", 2, null));

            GetNPCByName("Mom").DialogLines.Add(new CreatureDialogLine("Hello my Darling!", 0, null));
            GetNPCByName("Mom").DialogLines.Add(new CreatureDialogLine("Can't you keep your stuff together? I might help you if you bring my sunglasses. I left them outside.", 1, null));
            GetNPCByName("Mom").DialogLines.Add(new CreatureDialogLine("How dare you?! Well, if you don't need your phone..", 2, null));
            GetNPCByName("Mom").DialogLines.Add(new CreatureDialogLine("Forget about it.. First my sunglasses!", 3, null));
            GetNPCByName("Mom").DialogLines.Add(new CreatureDialogLine("Thank you very much. Don't forget about the fact, that your phone is waterproof! I mean, you literally take it anywhere with you...)", 4, null));

            #endregion

            #region PlayerDialogModels

            Player.Dialogs.Add(new PlayerDialogModel(GetNPCByName("Thief")));
            Player.Dialogs.Add(new PlayerDialogModel(GetNPCByName("Mom")));

            #endregion

            #region PlayerDialogLines

            GetPlayerDialogModelByDialogPartnerName("Thief").DialogLines.Add(new PlayerDialogLine("This is my House! What do you want here?! Get out!", 0, null, 1, 1));
            GetPlayerDialogModelByDialogPartnerName("Thief").DialogLines.Add(new PlayerDialogLine("What are u doing here? Would you please leave or I call the police.", 0, null, 2, 2));
            GetPlayerDialogModelByDialogPartnerName("Thief").DialogLines.Add(new PlayerDialogLine("No.", 2, null, 1, 1));

            GetPlayerDialogModelByDialogPartnerName("Mom").DialogLines.Add(new PlayerDialogLine("Hey Mom! Have you seen my phone anywhere?", 0, null, 1, 1));
            GetPlayerDialogModelByDialogPartnerName("Mom").DialogLines.Add(new PlayerDialogLine("U probably don't even know where it is and just want to use me...", 1, null, 2, 2));
            GetPlayerDialogModelByDialogPartnerName("Mom").DialogLines.Add(new PlayerDialogLine("Here, your sunglasses - take it back! (Giving sunglasses to Mom)", 1, GetItemByName("Sunglasses"), 1, 4));
            GetPlayerDialogModelByDialogPartnerName("Mom").DialogLines.Add(new PlayerDialogLine("So where is my phone?!", 2, null, 1, 3));
            GetPlayerDialogModelByDialogPartnerName("Mom").DialogLines.Add(new PlayerDialogLine("Here, your sunglasses - take it back! (Giving sunglasses to Mom)", 3, GetItemByName("Sunglasses"), 1, 4));

            #endregion
        }
コード例 #16
0
        public static void LoadGameData()
        {
            #region Items

            Items.Add(new Item("Medicine", "Some Medicine for the stomach, maybe I need this!", true));
            Items.Add(new Item("Rotten Burger", "I don't think I should eat this anymore", false));
            Items.Add(new Item("Ketchup", "Ketchup without friese...", false));
            Items.Add(new Item("Soda Cup", "Nothing left anymore.", false));

            Items.Add(new Weapon("Extinguisher", "A extinguisher, maybe I will need this for some...danger.", true, 10));
            Items.Add(new Weapon("Kitchen Knife", "Damn, this knife is rally sharp.", true, 12));

            Items.Add(new Potion("Pumpkin Spice Java Chip Frappuccino", "Get some new energy from all that suger and coffein.", true, 50));
            Items.Add(new Potion("Small Fries", "Yuck! Cold and limp", true, 20));
            Items.Add(new Potion("Half Sandwich", "The other half is wrapped, should be okay .", true, 20));
            Items.Add(new Potion("Big Bacon Burger", "The grail of all burgers.", true, 150));
            Items.Add(new Potion("Big King", "Not bad for the beginning!.", true, 80));

            WinningItem = GetItemByName("Big Bacon Burger");

            #endregion

            #region Rooms

            Rooms.Add(new Room("Mc Donalds", "Just your local Mc Donalds, nothing special.", null));
            Rooms.Add(new Room("Subway", "To healty for me right now.", null));
            Rooms.Add(new Room("KFC", "Yummi Fried Chicken.", null));
            Rooms.Add(new Room("Burger King", "Flame Grilled, like I like it!.", null));
            Rooms.Add(new Room("Five Guys", "The place of the best burgers!", GetItemByName("Big Bacon Burger")));
            Rooms.Add(new Room("Starbucks", "Fresh Coffee, tasty!.", null));

            #endregion

            #region RoomNeighbors

            GetRoomByName("Mc Donalds").Neighbors.Add(Direction.west, GetRoomByName("Starbucks"));
            GetRoomByName("Mc Donalds").Neighbors.Add(Direction.south, GetRoomByName("Burger King"));

            GetRoomByName("Starbucks").Neighbors.Add(Direction.west, GetRoomByName("Mc Donalds"));
            GetRoomByName("Starbucks").Neighbors.Add(Direction.south, GetRoomByName("Subway"));

            GetRoomByName("Subway").Neighbors.Add(Direction.east, GetRoomByName("Burger King"));
            GetRoomByName("Subway").Neighbors.Add(Direction.north, GetRoomByName("Starbucks"));

            GetRoomByName("Burger King").Neighbors.Add(Direction.north, GetRoomByName("Mc Donalds"));
            GetRoomByName("Burger King").Neighbors.Add(Direction.east, GetRoomByName("Five Guys"));
            GetRoomByName("Burger King").Neighbors.Add(Direction.south, GetRoomByName("KFC"));
            GetRoomByName("Burger King").Neighbors.Add(Direction.west, GetRoomByName("Subway"));

            GetRoomByName("Five Guys").Neighbors.Add(Direction.west, GetRoomByName("Burger King"));

            GetRoomByName("KFC").Neighbors.Add(Direction.north, GetRoomByName("Burger King"));


            #endregion

            #region Player

            Player = new Player("Player", "That's me!", 100, 5, GetRoomByName("Starbucks"));

            #endregion

            #region AddItemsToRooms

            GetRoomByName("KFC").Items.Add(GetItemByName("Tray"));
            GetRoomByName("KFC").Items.Add(GetItemByName("Rotten Burger"));

            GetRoomByName("Subway").Items.Add(GetItemByName("Half Sandwich"));

            GetRoomByName("Starbucks").Items.Add(GetItemByName("Pumpkin Spice Java Chip Frappuccino"));

            GetRoomByName("Mc Donalds").Items.Add(GetItemByName("Small Fries"));
            GetRoomByName("Mc Donalds").Items.Add(GetItemByName("Medicine"));

            GetRoomByName("Burger King").Items.Add(GetItemByName("Soda Cup"));
            GetRoomByName("Burger King").Items.Add(GetItemByName("Ketchup"));

            GetRoomByName("Five Guys").Items.Add(GetItemByName("Big Bacon Burger"));

            #endregion

            #region NPCs

            NPCs.Add(new NPC("Staff", "He is not looking very well...", 100, 15, false, false, true));
            NPCs.Add(new NPC("Fat Guy", "I think this guy is here all day.", 100, 20, true, false, true));
            NPCs.Add(new NPC("Chef", "The master of this place.", 110, 8, true, true, true));

            #endregion

            #region AddItemsToInventories

            GetNPCByName("Staff").Inventory.Add(GetItemByName("Big King"));
            GetNPCByName("Chef").Inventory.Add(GetItemByName("Kitchen Knife"));

            #endregion

            #region AddNPCsToRooms

            GetRoomByName("Burger King").NPCs.Add(GetNPCByName("Staff"));
            GetRoomByName("KFC").NPCs.Add(GetNPCByName("Fat Guy"));
            GetRoomByName("Five Guys").NPCs.Add(GetNPCByName("Chef"));

            #endregion

            #region NPCDialogLines

            GetNPCByName("Fat Guy").DialogLines.Add(new CreatureDialogLine("What do you want?!", 0, null));
            GetNPCByName("Fat Guy").DialogLines.Add(new CreatureDialogLine("Get away from my food", 1, null));
            GetNPCByName("Fat Guy").DialogLines.Add(new CreatureDialogLine("No!", 2, null));

            GetNPCByName("Chef").DialogLines.Add(new CreatureDialogLine("Noone is allowed to enter my kitchen!", 0, null));
            GetNPCByName("Chef").DialogLines.Add(new CreatureDialogLine("YOU WILL NEVER GET MY FOOD!", 1, null));
            GetNPCByName("Chef").DialogLines.Add(new CreatureDialogLine("NOONE IS ALLOWED TO ENTER!", 2, null));

            GetNPCByName("Staff").DialogLines.Add(new CreatureDialogLine("Hello welcome to Burger King how can I help you?", 0, null));
            GetNPCByName("Staff").DialogLines.Add(new CreatureDialogLine("You are at Burger King, i think we have some good food here.", 1, null));
            GetNPCByName("Staff").DialogLines.Add(new CreatureDialogLine("If you can find some medicine for me, maybe I can give you some free Food...", 2, null));
            GetNPCByName("Staff").DialogLines.Add(new CreatureDialogLine("Look at the other Burger Restaurants, people get there sick all the time!", 3, null));
            GetNPCByName("Staff").DialogLines.Add(new CreatureDialogLine("Maybe somwhere were you can find greasy food.", 4, null));
            GetNPCByName("Staff").DialogLines.Add(new CreatureDialogLine("Yes, come back if you found something, i can give you a bit food for it!", 5, null));
            GetNPCByName("Staff").DialogLines.Add(new CreatureDialogLine("Thank you bro! Here, some leftover food", 6, GetItemByName("Big King")));

            #endregion

            #region PlayerDialogModels

            Player.Dialogs.Add(new PlayerDialogModel(GetNPCByName("Fat Guy")));
            Player.Dialogs.Add(new PlayerDialogModel(GetNPCByName("Staff")));
            Player.Dialogs.Add(new PlayerDialogModel(GetNPCByName("Chef")));

            #endregion

            #region PlayerDialogLines

            GetPlayerDialogModelByDialogPartnerName("Fat Guy").DialogLines.Add(new PlayerDialogLine("Hello.", 0, null, 1, 1));
            GetPlayerDialogModelByDialogPartnerName("Fat Guy").DialogLines.Add(new PlayerDialogLine("Can I get something of your food? You dont look like you need it", 0, null, 2, 2));
            GetPlayerDialogModelByDialogPartnerName("Fat Guy").DialogLines.Add(new PlayerDialogLine("please!", 2, null, 1, 1));

            GetPlayerDialogModelByDialogPartnerName("Chef").DialogLines.Add(new PlayerDialogLine("Are you the Chef of this place?.", 0, null, 1, 1));
            GetPlayerDialogModelByDialogPartnerName("Chef").DialogLines.Add(new PlayerDialogLine("Please give me something to eat.", 0, null, 2, 2));

            GetPlayerDialogModelByDialogPartnerName("Staff").DialogLines.Add(new PlayerDialogLine("Im looking for a fantastic burger, do you know where i can get one?", 0, null, 1, 1));
            GetPlayerDialogModelByDialogPartnerName("Staff").DialogLines.Add(new PlayerDialogLine("You are looking not very well my friend", 0, null, 2, 2));
            GetPlayerDialogModelByDialogPartnerName("Staff").DialogLines.Add(new PlayerDialogLine("You dont look ver well, maybe you need some Medicine?", 1, null, 1, 5));
            GetPlayerDialogModelByDialogPartnerName("Staff").DialogLines.Add(new PlayerDialogLine("Where I can find it?", 2, null, 1, 3));
            GetPlayerDialogModelByDialogPartnerName("Staff").DialogLines.Add(new PlayerDialogLine("Where can i find something what can help you?", 3, null, 1, 4));
            GetPlayerDialogModelByDialogPartnerName("Staff").DialogLines.Add(new PlayerDialogLine("Here is your medicine, hope it helps.", 3, GetItemByName("Medicine"), 2, 6));
            GetPlayerDialogModelByDialogPartnerName("Staff").DialogLines.Add(new PlayerDialogLine("Got some medicine for you!. (Give Medicine to Staff)", 4, GetItemByName("Medicine"), 1, 6));

            #endregion
        }