Esempio n. 1
0
        public static bool WinOrLose(bool winorlose)
        {
            const int lieshu = 50;

            if (winorlose == false)
            {
                GameHelper.Talking("", "不行,我还不能放弃!可我", false, lieshu, 36);
                Console.SetCursorPosition(lieshu, 38);
                Console.WriteLine("1.这次就这样败了吗……我不甘心!");
                Console.SetCursorPosition(lieshu, 39);
                Console.WriteLine("2.就这样吧……");
                Console.SetCursorPosition(lieshu, 40);


                int choose = int.Parse(Console.ReadLine());
                if (choose == 2)
                {
                    GameHelper.TalkingEnd(lieshu);
                    GameHelper.TalkingEnd(lieshu, 38);
                    Environment.Exit(0);
                    return(false);
                }
                GameHelper.TalkingEnd(lieshu, 36);
                GameHelper.TalkingEnd(lieshu, 38);
                return(false);
            }
            else
            {
                GameHelper.TalkingEnd(lieshu, 36);
                GameHelper.TalkingEnd(lieshu, 38);
                return(true);
            }
        } //如果失败还想继续挑战返回false;
Esempio n. 2
0
 public static bool IfSkill(Skill skill)
 {
     if (Player.Instance().dream > skill.dream)
     {
         Player.Instance().dream -= skill.dream;
         return(true);
     }
     else
     {
         GameHelper.Talking("技能释放失败!梦之精华不足! ", "无法启用梦之剑!", false);
         Console.ReadKey(true);
         GameHelper.TalkingEnd();
         return(false);
     }
 }//技能使用成功返回true
Esempio n. 3
0
 //每次战斗结束都可以选择是否升级梦之剑和升级技能
 public static void LevelUp()
 {
     if (Player.Instance().dream > Player.Instance().dreamsword.experience)
     {
         GameHelper.Talking("正在升级武器!", "正在消耗梦之精华为梦之剑注入魔力", false);
         GameHelper.TalkingEnd();
         Player.Instance().dream -= Player.Instance().dreamsword.experience;
         Player.Instance().dreamsword.level++;
         Player.Instance().dreamsword.name = GameRes.weapon[Player.Instance().dreamsword.level].name;
         Player.Instance().dreamsword.experience = GameRes.weapon[Player.Instance().dreamsword.level].experience;
         Player.Instance().dreamsword.dreamattack = GameRes.weapon[Player.Instance().dreamsword.level].dreamattack;
         Player.Instance().dream -= 30;
         Player.Instance().Show();
     }
     else
     {
         GameHelper.Talking("", "梦之精华不足!", false);
         GameHelper.TalkingEnd();
     }
 }
Esempio n. 4
0
        }           //展示勇者属性

        public void Turn(ref Monstor monstor)
        {
            GameHelper.Talking(Player.Instance().name, "这次决定很重要……我想——");
            GameHelper.Talking("1.那就普通攻击吧!", "2.利用梦之精华释放技能好了", false);

            int a = int.Parse(Console.ReadLine());

            GameHelper.TalkingEnd(); int skilleffect;
            switch (a)
            {
            case 1:
                int damage = Battle.AttackDamage(Player.Instance().dreamsword.dreamattack);
                Battle.BattleInformation(Player.Instance().name, monstor.name, damage);
                monstor.hp -= damage;
                Player.Instance().Show();
                break;

            case 2:
                GameHelper.Talking("", "那这次就决定是技能——", false);
                int skillid = int.Parse(Console.ReadLine()) - 1;           //从技能1到技能4选择
                GameHelper.TalkingEnd();
                if (Skill.IfSkill(Player.Instance().playerskill[skillid])) //技能释放成功
                {
                    skilleffect = Skill.UsingSkill(ref monstor,
                                                   Player.Instance().playerskill[skillid], dreamsword.dreamattack);
                    if (Instance().playerskill[skillid].type == 1)
                    {    //使用伤害性技能
                        monstor.hp -= skilleffect;
                        Battle.BattleInformation(Player.Instance().name, monstor.name, skilleffect);
                    }
                    else
                    {    //调用辅助类技能
                        Battle.BattleInformation(Player.Instance().name, monstor.name, skilleffect, 2,
                                                 Player.Instance().playerskill[skillid].describe);
                    }
                    Player.Instance().Show();
                }
                break;
            }//1为使用平A 2为技能
        }
Esempio n. 5
0
        public static bool BattleFighting(ref Monstor monstor, int xh = 0)
        {
            bool dreamoff    = false;//默认返回没有进入梦之地
            int  duihuacishu = 0;

            GameHelper.Talking(monstor.name, monstor.beforefight);
            Console.ReadKey(true);
            GameHelper.Talking(Player.Instance().name, monstor.playeranswer);
            Monstor.Show(monstor);
            GameHelper.TalkingEnd();
            bool winorlose = false;//失败时会不断挑战
            int  hp        = Player.Instance().hp;
            int  dream     = Player.Instance().dream;

            while (winorlose != true)
            {
                while (monstor.hp >= 0 && Player.Instance().hp > 0)
                {
                    Player.Instance().Turn(ref monstor);
                    Monstor.Turn(monstor);
                    Player.Instance().Show(); duihuacishu++;
                    if (duihuacishu % 2 == 0 && duihuacishu < 8)  //每隔一段时间触发对话
                    {
                        int j = xh + 4;
                        for (; xh < j; xh++)
                        {
                            GameHelper.Talking(GameRes.dialogue[xh].name, GameRes.dialogue[xh].text);
                            Console.ReadKey(true);
                        }
                    }
                }
                if (Player.Instance().hp <= 0)
                {
                    winorlose = false; winorlose = WinOrLose(winorlose);
                    Player.ReSet(hp, dream);
                }
                else
                {
                    winorlose = true;
                }
            }
            if (monstor.id % 2 != 0 && monstor.id <= 4)
            {
                GameHelper.Talking("", "是时候给予致命一击了!");
                GameHelper.TalkingEnd();
                GameHelper.Talking("1.给予致命一击,收割大量梦之精华!", "2.够了吧……不知道为什么,忍不下心来……", false);
                int choose = int.Parse(Console.ReadLine());
                if (choose == 1)
                {
                    Player.Instance().dream += monstor.dream += 20;
                    Player.Instance().hp    += 20;
                    GameHelper.Talking("", "战斗结束!                 ", false);
                    Console.ReadKey(true);
                    GameHelper.TalkingEnd();
                    Player.Instance().Show(); Monstor.ShowEnd();
                }
                else
                {
                    Player.Instance().dream += (monstor.dream / 4);
                    Player.Instance().hp    += 40;
                    Console.SetCursorPosition(50, 39);
                    Console.ReadKey(true);
                    Player.Instance().Show(); Monstor.ShowEnd();
                    dreamoff = true;
                }
            }
            return(dreamoff);
        }