예제 #1
0
        static void Main(string[] args)
        {
            /* Inventory inventory = new Inventory();
             *
             *            inventory.Menu();
             *
             * /*      string playername = "";
             *  string playerchoice = "";
             *    Character Player;
             *    Console.WriteLine("Enter Your name");
             *   playername = Console.ReadLine();
             *
             *    while (playerchoice != "1" && playerchoice != "2")
             *    {
             *
             *        //Display menu
             *        Console.WriteLine("\nChoose a job:");
             *        Console.WriteLine("1: Knight");
             *        Console.WriteLine("2: Wizard");
             *        playerchoice = Console.ReadLine();
             *    }
             *    if (playerchoice == "1")
             *    {
             *        Player = new Wizzard(playername);
             *    }
             *    else if (playerchoice == "2")
             *    {
             *        Player = new Knight(playername);
             *    }
             *    else
             *    {
             *        Player = new Character(playername);
             *    }
             *    Player.Print();
             *    Player.openinventory();
             *    Player.Print();
             *
             *
             *
             *
             *    Console.ReadKey();
             */


            Console.WriteLine("What is your name?");
            string name;

            name = Console.ReadLine();


            Monster   test          = new Monster("test 1", 1, 10); //creates monster with the name testmonster with a health of 100 and a damage of 10
            Monster   test2         = new Monster("test 2", 1, 10);
            Monster   test3         = new Monster("test 3", 1, 10);
            Monster   test4         = new Monster("test 4", 1, 10);
            Character player        = new Knight(name);
            Character testcharacter = new Wizzard("Test character");

            Creature[] Myteam            = { player, testcharacter };
            Creature[] otherCreatureTeam = { test, test2 }; //removed test 1 and 2 to check something
            Creature[] CreatureTeam      = { test3, test4 };
            Creature[] nothing           = {};



            //                   roomname  N  S   E  W  Description
            Scene Room      = new Scene("Room", 1, 3, -1, 2, "just a big empty room \nTo the north a court yard is a courtyard \nto the south is a path to the village \nWest is a graveyard", CreatureTeam); // 0
            Scene courtyard = new Scene("Courtyard", -1, 0, -1, -1, "just a normal courtyard \nThere is a room to the south", nothing);                                                                       // 1
            Scene Graveyard = new Scene("GraveYard", -1, -1, 0, -1, "The graveyard is very scary \nThere is a room to the north", otherCreatureTeam);                                                         // 2
            Scene villige   = new Scene("Village", 0, -1, -1, -1, "A normal villige there is nothing interesting here \nThere is a room to the north", CreatureTeam);                                         //3



            Scene[] scenes = { Room, courtyard, Graveyard, villige };
            Map     map    = new Map(0, scenes, Myteam);

            map.Menu();



            Encounter encounter = new Encounter(otherCreatureTeam, CreatureTeam);

            /*   encounter.Print();
             *
             *
             * /*  player.openinventory();
             * encounter.Start();
             */

            Console.ReadKey();



            return;



            return;

            /* Inventory inventory = new Inventory();
             *
             * inventory.Menu();*/

            /*string name = "";
             * string choice = "";
             * // Character Player;
             * Console.WriteLine("Enter Your name");
             * name = Console.ReadLine();
             *
             * while (choice != "1" && choice != "2")
             * {
             *
             *   //Display menu
             *   Console.WriteLine("\nChoose a job:");
             *   Console.WriteLine("1: Knight");
             *   Console.WriteLine("2: Wizard");
             *   choice = Console.ReadLine();
             * }
             * if (choice == "1")
             * {
             *   Player = new Wizzard(name);
             * }
             * else if (choice == "2")
             * {
             *   Player = new Knight(name);
             * }
             * else
             * {
             *   Player = new Character(name);
             * }
             * Player.Print();
             *
             *
             *
             * Console.ReadKey();
             * Console.WriteLine();
             * Character character2 = new Character("character2");
             * character2.Print();
             *
             * while (choice != "0")
             * {
             *   Console.WriteLine("\nWhose inventory");
             *
             *   Console.WriteLine("1: " + Player.name());
             *   Console.WriteLine("2: " + character2.name());
             *   choice = Console.ReadLine();
             *   if (choice == "1")
             *   {
             *       Player.Print();
             *       Console.WriteLine(Player.name());
             *       Player.openinventory();
             *
             *   }
             *   else if (choice == "2")
             *   {
             *       character2.Print();
             *       Console.WriteLine(character2.name());
             *       character2.openinventory();
             *   }
             *
             *
             *   string[] stringarray = new string[3];
             *   Character[] party = { Player, character2, new Character("character3") };
             *
             *   Console.ReadKey();
             * }*/
        }
예제 #2
0
        static void Main(string[] args)
        {
            //0: Courtyard
            //1: Castle Gate
            //2: Grave Yard
            //3: Village

            Scene courtyard  = new Scene("Courtyard", 1, 3, -1, 2, "The courtyard is wide and open to the sky. There is a small garden nearby. There are exits to the north, south, and west.");
            Scene castleGate = new Scene("Castle Gate", -1, 0, -1, -1, "There is a massive gate at the entrance to the \ncastle. It appears to be locked. There is an exit to the south. ");
            Scene graveyard  = new Scene("Graveyard", -1, -1, 0, -1, "The graveyard is pretty spooky. Nonetheless, you pay respects. There is an exit to the east. ");
            Scene village    = new Scene("Village", 0, -1, -1, -1, "There is a village. There are a bunch of buildings, I guess. There is an exit to the north. ");

            Scene[] scenes = { courtyard, castleGate, graveyard, village };
            Map     map    = new Map(0, scenes);

            map.Menu();
            return;


            Monster Vegeta = new Monster("Vegeta", 100, 50);
            Monster Buu    = new Monster("Buu", 100, 50);
            Monster Cell   = new Monster("Cell", 100, 50);
            Monster Omega  = new Monster("Omega", 100, 50);

            Cell.Print();
            Buu.Print();

            Monster[] team1 = { Vegeta, Buu };
            Monster[] team2 = { Cell, Omega };

            Encounter encounter = new Encounter(team1, team2);

            encounter.Print();
            encounter.BeginRound();

            Console.ReadKey();
            return;

            //Inventory inventory = new Inventory();
            //inventory.Menu();
            string name   = "";
            string choice = "";

            while (choice != "1" && choice != "2" && choice != "3" && choice != "4")
            {
                Console.WriteLine("Whose Inventory: ");
                name = Console.ReadLine();
                //Display menu
                Console.WriteLine("\nChoose a job: ");
                Console.WriteLine("1: Knight");
                Console.WriteLine("2: Wizard");
                Console.WriteLine("3: Rogue");
                Console.WriteLine("4: Berserker");
                choice = Console.ReadLine();
            }
            Character player;

            if (choice == "1")
            {
                player = new Knight(name);
            }
            else if (choice == "2")
            {
                player = new Wizard(name);
            }
            else if (choice == "3")
            {
                player = new Rogue(name);
            }
            else if (choice == "4")
            {
                player = new Berserker(name);
            }
            else
            {
                player = new Character(name);
            }
            player.Print();

            player.OpenInventory();

            Rogue Hit = new Rogue("Hit");

            Hit.Print();
            Console.WriteLine("");

            Knight    Goku   = new Knight("Goku");
            Wizard    Frieza = new Wizard("Frieza");
            Berserker Broly  = new Berserker("Broly");

            Goku.Print();
            Console.WriteLine("");
            Frieza.Print();
            Console.WriteLine("");
            Broly.Print();
            Console.WriteLine("");

            while (choice != "1" && choice != "2" && choice != "3" && choice != "4")
            {
                Console.WriteLine("\nWhose Inventory? ");
                Console.WriteLine("0: Exit");
                Console.WriteLine("1: " + player.Name());
                Console.WriteLine("2: " + Goku.Name());
                Console.WriteLine("3: " + Frieza.Name());
                Console.WriteLine("4: " + Broly.Name());
            }


            player.Experience = 30;
            player.Experience = player.Experience + 50;
            player.Experience++;
            player.Experience += 40;
            player.Experience += 40;
            player.Experience += 40;
            player.Experience += 40;
            player.Experience += 40;
            player.Experience += 40;
            player.Experience += 40;
            player.Experience += 40;
            player.Experience += 40;
            player.Experience += 40;

            int[] testArray = new int[4];

            testArray[0] = 1;
            testArray[1] = 3;
            testArray[2] = 5;
            testArray[3] = 7;

            int[] testArray2 = { 2, 4, 6, 8 };

            string[] stringArray = new string[3];

            Character[] party = { player, Goku, Frieza, Broly, new Character("Like") };

            Console.ReadKey();
        }
예제 #3
0
        static void Main(string[] args)
        {
            Monster monster1 = new Monster("Carbuncle", 30, 10, 50);

            Console.WriteLine("Health: " + monster1.Health);

            Spellbook spellbook = new Spellbook(2);

            spellbook.Page1(monster1);
            Console.WriteLine("Health: " + monster1.Health);
            spellbook.Page2(monster1);
            Console.WriteLine("Health: " + monster1.Health);

            void Flame(Creature target)
            {
                target.Health -= 15;
                Console.WriteLine("Flame deals 15 damage to " + target.GetName());
            }

            spellbook.Page1 = Flame;
            spellbook.Page1(monster1);
            Console.WriteLine("Health: " + monster1.Health);
            void Cure(Creature target)
            {
                target.Health += 10;
                Console.WriteLine("Cure heals 10 damage to " + target.GetName());
            }

            spellbook.Page2 = Cure;
            spellbook.Page2(monster1);
            Console.WriteLine("Health: " + monster1.Health);

            spellbook.Page1 += Spellbook.Cure;
            spellbook.Page1(monster1);
            Console.WriteLine("Health: " + monster1.Health);

            spellbook.book[0] = Flame;
            spellbook.book[1] = Spellbook.Cure;
            spellbook.book[0](monster1);
            Console.WriteLine("Health: " + monster1.Health);

            Console.ReadKey();

            return;

            //Character test = new Character("Test");
            //Console.WriteLine(test.GetDamage());



            //Inventory inventory = new Inventory();
            //inventory.Menu();

            string name   = "";
            string choice = "";

            Console.WriteLine("What is the Hero's name?");
            name = Console.ReadLine();
            while (choice != "1" && choice != "2" && choice != "3")
            {
                //Job Choice Menu
                Console.WriteLine("\nChoose a job:");
                Console.WriteLine("1: Knight");
                Console.WriteLine("2: Rogue");
                Console.WriteLine("3: Mage");
                choice = Console.ReadLine();
            }
            Character hero;

            if (choice == "1")
            {
                hero   = new Knight(name);
                choice = "";
            }
            else if (choice == "2")
            {
                hero   = new Rogue(name);
                choice = "";
            }
            else if (choice == "3")
            {
                hero   = new Mage(name);
                choice = "";
            }
            else
            {
                hero   = new Character(name);
                choice = "";
            }

            Character companion1 = new Rogue("Daniel");
            Character companion2 = new Mage("Tanis");

            /*
             * while (choice != "0")
             * {
             *  //Character Inventory Choice Menu
             *  Console.WriteLine("\nWhose Inventory are you opening?");
             *  Console.WriteLine("0: Exit");
             *  Console.WriteLine("1: " + hero.GetName());
             *  Console.WriteLine("2: " + companion1.GetName());
             *  Console.WriteLine("3: " + companion2.GetName());
             *  choice = Console.ReadLine();
             *  if (choice == "1")
             *  {
             *      hero.Print();
             *      hero.OpenInventory();
             *      Console.WriteLine(hero.GetDamage());
             *  }
             *  else if (choice == "2")
             *  {
             *      companion1.Print();
             *      companion1.OpenInventory();
             *  }
             *  else if (choice == "3")
             *  {
             *      companion2.Print();
             *      companion2.OpenInventory();
             *  }
             * }
             */

            //Creates Monsters
            //Monster monster1 = new Monster("Carbuncle", 30, 10, 50);
            Monster monster2 = new Monster("Slime", 15, 5, 50);

            //Arrays Monsters
            Creature[] goodTeam  = { hero, companion1, companion2 };
            Creature[] badTeam   = { monster1, monster2 };
            Creature[] emptyTeam = { };

            //Creates Scenes
            //0: Courtyard
            //1: Castle Gate
            //2: Graveyard
            //3: Village
            Scene scene1 = new Scene("Courtyard", 1, 3, 2, -1, emptyTeam, "The courtyard is wide. A number of nobles mill about the garden. There are exits to the north, south, and west.");
            Scene scene2 = new Scene("Castle Gate", -1, 0, -1, -1, emptyTeam, "The massive gate of the Castle is currently closed. You can only leave to the south.");
            Scene scene3 = new Scene("Graveyard", 3, -1, -1, 0, badTeam, "The graveyard is earily quiet. Many graves are in disrepair and have dead flowers. There exits to the east and north.");
            Scene scene4 = new Scene("Village", 0, 2, -1, -1, emptyTeam, "The village is bustling with activity. Many shops line the streets and most have criers advertising their wares. There are exits to the south and north.");

            Scene[] scenes = { scene1, scene2, scene3, scene4 };
            Map     map    = new Map(0, scenes, goodTeam);

            /*
             * map.PrintCurrentScene();
             * map.CurrentSceneID = 1;
             * map.PrintCurrentScene();
             * map.CurrentSceneID = 2;
             * map.PrintCurrentScene();
             * map.CurrentSceneID = 3;
             * map.PrintCurrentScene();
             * map.CurrentSceneID = 4;
             */

            map.Menu();

            hero.Print();
            companion1.Print();
            companion2.Print();


            Console.ReadKey();

            return;
        }