예제 #1
0
파일: Case.cs 프로젝트: yukii/RPG
 public Case()
 {
     ennemy   = null;
     obj      = "";
     this.pnj = null;
 }
예제 #2
0
파일: Case.cs 프로젝트: yukii/RPG
 public Case(string obj)
 {
     ennemy   = null;
     this.obj = obj;
     this.pnj = null;
 }
예제 #3
0
파일: Case.cs 프로젝트: yukii/RPG
 public Case(Ennemy enn)
 {
     this.ennemy = enn;
     this.obj    = "";
     this.pnj    = null;
 }
예제 #4
0
파일: Case.cs 프로젝트: yukii/RPG
 public Case(Personnage pnj)
 {
     this.pnj = pnj;
     ennemy   = null;
     obj      = "";
 }
예제 #5
0
파일: Game.cs 프로젝트: yukii/RPG
        public void Combat(Ennemy e)
        {
            int energyE   = 0;
            int energyJ   = 0;
            int atkEnnemy = 0;
            int choice    = 0;

            while ((e.pv > 0) && (!Death()))
            {
                Personnage.AsciiFight(e.name);
                Console.WriteLine("Vous avez " + player.pv + " pv.");
                Console.WriteLine(e.name + " a " + e.pv + " pv.");

                if (!Personnage.AttackSpe(energyE, e.energy))
                {
                    atkEnnemy = e.AtkEnnemy(player);
                }
                else if (e.all_atk[e.nameATK[3]] == -4)
                {
                    Console.WriteLine("Clement utilise Malus au mémoire");
                    Console.WriteLine("Votre attaque est divisé par 2");
                    player.atk /= 4;
                    energyE     = 0;
                }
                else
                {
                    atkEnnemy = e.all_atk[e.nameATK[3]];
                    energyE   = 0;
                }

                player.pv = Personnage.Attack(player.pv, player.def, atkEnnemy, e.atk);
                Thread.Sleep(2000);
                if ((atkEnnemy + e.atk - player.def) > 0)
                {
                    Console.WriteLine(e.name + " vous inflige " + (atkEnnemy + e.atk - player.def) + "dégats.");
                }
                else
                {
                    Console.WriteLine(e.name + "vous inflige 0 dégats");
                }
                Thread.Sleep(2000);

                if (!Personnage.AttackSpe(energyJ, player.energy))
                {
                    Console.WriteLine();
                    Console.WriteLine("Quelle attaque utilisez vous ?");
                    choice = menu.PrintMenu(player.nameAtk);
                }
                else
                {
                    choice  = 3;
                    energyJ = 0;
                }

                e.pv = Personnage.Attack(e.pv, e.def, player.all_atk[player.nameAtk[choice - 1]], player.atk);
                if ((player.all_atk[player.nameAtk[choice - 1]] + player.atk - e.def) > 0)
                {
                    Console.WriteLine("Vous avez infligé " + (player.all_atk[player.nameAtk[choice - 1]] + player.atk - e.def) + " dégats.");
                }
                else
                {
                    Console.WriteLine("Vous avez infligé 0 dégats");
                }

                Thread.Sleep(2000);
                Console.Clear();
            }
            if (e.pv <= 0)
            {
                Console.WriteLine("Vous avez battu " + e.name);
                player.LevelUP(e.xpDrop);
                player.RamasserObj(e.objet);
                Thread.Sleep(1000);
            }
        }
예제 #6
0
        //placements des PNJ
        private void All_PNJ()
        {
            //etage 1
            pnjRand        = new Personnage("Visiteur Random", "Il y a une JPO aujourd'hui ?", 0);
            myMap[0][4, 5] = new Case(pnjRand);

            pnjRand        = new Personnage("Gardien", "La sortie est vers le bas.", 0);
            myMap[0][5, 0] = new Case(pnjRand);

            pnjRand        = new Personnage("Emmanuel", "Je t'ai laissé un dossier sur ton bureau", 0);
            myMap[0][7, 0] = new Case(pnjRand);

            //etage 2
            pnjRand        = new Personnage("Brahim", "J'ai vu les Power Rangers :o", 0);
            myMap[1][1, 4] = new Case(pnjRand);

            pnjRand        = new Personnage("Emmanuel", "Tu as pensé à rechargé ta vie ?", 0);
            myMap[1][4, 4] = new Case(pnjRand);

            //etage 3
            pnjRand        = new Personnage("Imène", "J'ai peur !! Il y a des ISEE Zombies partout !!", 0);
            myMap[2][9, 2] = new Case(pnjRand);

            //etage 4
            pnjRand        = new Personnage("Clément", "Je veux avoir des Pokémons !!", 0);
            myMap[3][0, 7] = new Case(pnjRand);

            pnjRand        = new Personnage("Charif", "Il y a des boissons, de la nourriture et du café en bas.", 0);
            myMap[3][1, 4] = new Case(pnjRand);

            pnjRand        = new Personnage("Salim", "Je peux te spoiler ?", 0);
            myMap[3][2, 3] = new Case(pnjRand);

            pnjRand        = new Personnage("Aviel", "Je suis un élève fantôme, tu ne me vois pas.", 0);
            myMap[3][2, 5] = new Case(pnjRand);

            pnjRand        = new Personnage("Emmanuel", "Tu devrais croiser mon double à l'étage 1.", 0);
            myMap[3][4, 7] = new Case(pnjRand);

            pnjRand        = new Personnage("Antoine", "Tu veux bien m'entrainer à LOL ?", 0);
            myMap[3][5, 2] = new Case(pnjRand);

            pnjRand        = new Personnage("Thomas", "A quand le labo cuisine ?", 0);
            myMap[3][6, 4] = new Case(pnjRand);

            pnjRand        = new Personnage("Jean", "Qu'est-ce que tu veux ?", 0);
            myMap[3][6, 6] = new Case(pnjRand);

            pnjRand        = new Personnage("Ingesup anonyme", "Tu n'aurais pas vu mon clavier mécanique ?", 0);
            myMap[3][6, 7] = new Case(pnjRand);

            pnjRand        = new Personnage("Adrien", "J'ai pas compris.", 0);
            myMap[3][7, 2] = new Case(pnjRand);

            pnjRand        = new Personnage("Perceval", "C'est pas faux.", 0);
            myMap[3][7, 5] = new Case(pnjRand);

            pnjRand        = new Personnage("Gauthier", "Fais attention il y a des ISEE sauvages !", 0);
            myMap[3][8, 2] = new Case(pnjRand);

            pnjRand        = new Personnage("Abdel", "Je m'ennuie...", 0);
            myMap[3][8, 5] = new Case(pnjRand);

            pnjRand        = new Personnage("Dieu", "Attention aux pièges et bon courage !! Je t'attendrai au paradis :)", 0);
            myMap[3][9, 4] = new Case(pnjRand);
        }