Ejemplo n.º 1
0
        public static void CreatPlayer()
        {
            Console.WriteLine("\n\t\t\t创建角色");
            Console.WriteLine("\t角色名称:");
            Console.Write("\t");
            Playerrole.Instance.name = Console.ReadLine();
            Console.WriteLine("\t角色职业:1.战士  2.刺客  3.法师(每个职业成长率不同,技能相同)\n\tps:因为太麻烦了...");
            Console.Write("\t");
            Playerrole.Instance.jobid = int.Parse(Console.ReadLine());
            Console.WriteLine("\t1.确认  2.重新输入");
            Console.Write("\t");
hehe:
            string cs = Console.ReadLine();

            if (cs == "")
            {
                goto hehe;
            }
            int n = int.Parse(cs);

            if (n == 1)
            {
                Instance.basehp   = GameRes.GetJob(Instance.jobid).hp;
                Instance.basemp   = GameRes.GetJob(Instance.jobid).mp;
                Instance.baseatk  = GameRes.GetJob(Instance.jobid).atk;
                Instance.hprate   = GameRes.GetJob(Instance.jobid).hprate;
                Instance.mprate   = GameRes.GetJob(Instance.jobid).mprate;
                Instance.atkrate  = GameRes.GetJob(Instance.jobid).atkrate;
                Playerrole.weapon = GameRes.GetWeapon(1);
                Playerrole.equip1 = GameRes.GetEquip(1);
                Playerrole.equip2 = GameRes.GetEquip(4);
                Playerrole.equip3 = GameRes.GetEquip(6);
                Playerrole.skill1 = GameRes.GetSkill(1);
                Playerrole.skill2 = GameRes.GetSkill(2);
                Playerrole.skill3 = GameRes.GetSkill(3);
                Playerrole.skill4 = GameRes.GetSkill(4);
                Playerrole.skill5 = GameRes.GetSkill(5);

                Program.Mainui();
            }
        }
Ejemplo n.º 2
0
        private static void BuyWeapon()
        {
            hape :    Console.Clear();
            Console.WriteLine("\t武器:");
            for (int i = 1; i < 6; i++)
            {
                _ = new Weapon();
                Weapon weapon = GameRes.GetWeapon(i);
                Console.WriteLine("id:{0}\t武器名:{1}\t攻击力:{2}\t价格:{3}", weapon.id, weapon.name, weapon.atk, weapon.price);
            }
            Console.SetCursorPosition(0, 20);
            for (int a = 0; a < 79; a++)
            {
                Console.Write("-");
            }
            Console.SetCursorPosition(0, 21);
            Console.WriteLine("你的选择:(输入武器id购买,输入0返回商店)");
            Console.SetCursorPosition(0, 22);
hehe:
            string cs = Console.ReadLine();

            if (cs == "")
            {
                goto hehe;
            }
            int n = int.Parse(cs);

            switch (n)
            {
            case 0: shop(); break;

            case 1:
                if (Playerrole.Instance.gold >= GameRes.GetWeapon(1).price)
                {
                    Playerrole.weapon = GameRes.GetWeapon(1);
                    Console.WriteLine("购买成功.你还有{0}金币", Playerrole.Instance.gold);
                    Console.ReadKey();
                    Console.Clear();
                    goto hape;
                }
                else
                {
                    Console.WriteLine("没钱你还想买,白嫖吗?,想peach");
                    Console.ReadKey();
                    goto hehe;
                }

            case 2:
                if (Playerrole.Instance.gold >= GameRes.GetWeapon(2).price)
                {
                    Playerrole.weapon = GameRes.GetWeapon(2);
                    Console.WriteLine("购买成功.你还有{0}金币", Playerrole.Instance.gold);
                    Console.ReadKey();
                    Console.Clear();
                    goto hape;
                }
                else
                {
                    Console.WriteLine("没钱你还想买,白嫖吗?,想peach");
                    Console.ReadKey();
                    goto hehe;
                }

            case 3:
                Console.Clear();
                if (Playerrole.Instance.gold >= GameRes.GetWeapon(3).price)
                {
                    Playerrole.weapon         = GameRes.GetWeapon(3);
                    Playerrole.Instance.gold -= Playerrole.weapon.price;
                    Console.WriteLine("购买成功.你还有{0}金币", Playerrole.Instance.gold);
                    Console.ReadKey();
                    Console.Clear();
                    goto hape;
                }
                else
                {
                    Console.WriteLine("没钱你还想买,白嫖吗?,想peach");
                    Console.ReadKey();
                    goto hehe;
                }

            case 4:
                if (Playerrole.Instance.gold >= GameRes.GetWeapon(4).price)
                {
                    Playerrole.weapon         = GameRes.GetWeapon(4);
                    Playerrole.Instance.gold -= Playerrole.weapon.price;
                    Console.WriteLine("购买成功.你还有{0}金币", Playerrole.Instance.gold);
                    Console.ReadKey();
                    Console.Clear();
                    goto hape;
                }
                else
                {
                    Console.WriteLine("没钱你还想买,白嫖吗?,想peach");
                    Console.ReadKey();
                    goto hehe;
                }

            case 5:
                if (Playerrole.Instance.gold >= GameRes.GetWeapon(5).price)
                {
                    Playerrole.weapon         = GameRes.GetWeapon(5);
                    Playerrole.Instance.gold -= Playerrole.weapon.price;
                    Console.WriteLine("购买成功.你还有{0}金币", Playerrole.Instance.gold);
                    Console.ReadKey();
                    Console.Clear();
                    goto hape;
                }
                else
                {
                    Console.WriteLine("没钱你还想买,白嫖吗?,想peach");
                    Console.ReadKey();
                    goto hehe;
                }

            default:
                goto hape;
            }
        }
Ejemplo n.º 3
0
        public static void shop()
        {
            Console.Clear();
            Console.WriteLine("欢迎来到商店(本店只卖不买,更换后原有装备消失)");
            Console.WriteLine("\t武器:");
            for (int i = 1; i < 6; i++)
            {
                _ = new Weapon();
                Weapon weapon = GameRes.GetWeapon(i);
                Console.WriteLine("id:{0}\t武器名:{1}\t攻击力:{2}\t价格:{3}", weapon.id, weapon.name, weapon.atk, weapon.price);
            }
            Console.WriteLine("\t装备:");
            for (int i = 1; i < 9; i++)
            {
                _ = new Equip();
                Equip equip = GameRes.GetEquip(i);
                Console.WriteLine("id:{0}\t装备名:{1}\t血量:{2}\t法力值:{3}\t价格{4}", equip.id, equip.name, equip.hp, equip.mp, equip.price);
            }
            Console.WriteLine("\t道具:");
            for (int i = 1; i < 6; i++)
            {
                _ = new Item();
                Item item = GameRes.GetItem(i);
                Console.WriteLine("id:{0}\t道具名:{1}\t回复血量:{2}\t回复法力值:{3}\t价格:{4}", item.id, item.name, item.hp, item.mp, item.price);
            }
            Console.SetCursorPosition(65, 3);
            Console.WriteLine("选择行动:");
            Console.SetCursorPosition(65, 4);
            Console.WriteLine("0.返回主界面");
            Console.SetCursorPosition(65, 5);
            Console.WriteLine("1.购买武器");
            Console.SetCursorPosition(65, 6);
            Console.WriteLine("2.购买装备");
            Console.SetCursorPosition(65, 7);
            Console.WriteLine("3.购买道具");
            Console.SetCursorPosition(0, 22);
            for (int i = 0; i < 79; i++)
            {
                Console.Write("-");
            }
            Console.SetCursorPosition(0, 23);
            Console.WriteLine("你的选择:");
            Console.SetCursorPosition(0, 24);
hehe:
            string cs = Console.ReadLine();

            if (cs == "")
            {
                goto hehe;
            }
            int n = int.Parse(cs);

            switch (n)
            {
            case 1: BuyWeapon(); break;

            case 2: BuyEquip(); break;

            case 3: BuyItem(); break;

            case 0: Program.Mainui(); break;

            default:
                goto hehe;
            }
        }