Ejemplo n.º 1
0
        public bool BossBattleResult(Player player, Monster monster, List <Enigma> enigmas)
        {
            this.PlayerStats  = player;
            this.MonsterStats = monster;
            this.isPlayerTurn = false;
            string newPhase = "|\n|\n|\n|\n|\n";

            Utils.SlowConsoleWriter("Vous vous battez contre: " + monster.Name + "\n\n");
            Console.WriteLine(monster.Image + "\n\n");

            while (MonsterStats.Health > 0 && PlayerStats.Health > 0)
            {
                var turn = new BossTurn();
                var Turn = new Turn();
                Utils.SlowConsoleWriter("Tour n°" + (TurnCounter + 1));
                if (TurnCounter > enigmas.Count - 1)
                {
                    Utils.SlowConsoleWriter("TROOOOOOOOOOP TARRRRDDD  HAHAHAHAH !");
                    return(false);
                }
                else
                {
                    if (isPlayerTurn)
                    {
                        var enigmarandom = new EnigmaRepository();
                        turn.StartBossTurn(PlayerStats, MonsterStats, enigmarandom.GetRamdomEnigma());
                        isPlayerTurn = !isPlayerTurn;
                        TurnCounter++;
                        Utils.SlowConsoleWriter(newPhase);
                    }
                    else
                    {
                        Turn.StartTurn(PlayerStats, MonsterStats, isPlayerTurn);
                        isPlayerTurn = !isPlayerTurn;
                        Utils.SlowConsoleWriter(newPhase);
                    }
                }
            }

            if (MonsterStats.Health <= 0)
            {
                Utils.SlowConsoleWriter("Combat Terminé !");
                return(true);
            }
            else
            {
                Utils.SlowConsoleWriter("Combat Terminé !");
                return(false);
            }
        }
Ejemplo n.º 2
0
        public void StartGame()
        {
            var item  = new ItemRepository();
            var items = item.GetItems();

            var lootphase = new Lootphase();

            Console.WriteLine("Heuh j'ai affaire à qui la ?? (Entrez votre nom) :");
            var playerName = Console.ReadLine();

            var dialogue = new DialogueRepository();

            dialogue.ShowDialogue("Intro", dialogue.GetDialogue(), Utils.random);

            var playerItem = lootphase.DroppedItems(items, Utils.random);
            var player     = new Player(0, playerName, Utils.random.Next(25, 100), playerItem.IdItem, playerItem, Utils.random.Next(5, 25));
            var monster    = new MonsterRepository();
            var monsters   = monster.GetMonsters();
            var stage      = new Stage();
            var dialogues  = dialogue.GetDialogue();

            var resultstage = stage.StartStage(player, monsters, monster, items, dialogues);

            if (resultstage == true)
            {
                int i = 0;
                do
                {
                    resultstage = stage.StartStage(player, monsters, monster, items, dialogues);
                    i++;
                }while (resultstage == true && i < 4);
                if (resultstage == true)
                {
                    var  bossbattle       = new BossBattle();
                    var  enigma           = new EnigmaRepository();
                    var  ramdomEnigma     = new Enigma();
                    bool bossbatlleresult = bossbattle.BossBattleResult(player, monster.MonsterChoosen(monsters, Utils.random), enigma.GetEnigma());
                }
            }
            else
            {
                Console.WriteLine("Vous avez perdu !");
            }
        }