Exemple #1
0
 public Partie(Joueur j1, Joueur j0, Position pInitiale)
 {
     this.j1   = j1;
     this.j0   = j0;
     pCourante = pInitiale.Clone();
 }
Exemple #2
0
        public Game()
        {
            Introduction();
            Map     world  = new Map(5, 30);
            Boolean indice = false;

            Console.WriteLine("Nom du joueur ?");
            string name     = Console.ReadLine();
            int    resultat = 0;

            Console.Clear();
            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine(@"
|  ,.------;:~~:-.      |   1- Un wookie
| /:.\`;;|||;:/;;:\     |   Avantage:
|:')\`:\||::/.-_':/)    |       +Def/hp
|`:`\\\ ;'||'.''/,.:\   |
|==`;.:`|;::/'/./';;=   |
|:-/-%%% | |%%%;;_- _:  |
|=// %wm)..(mw%`_ :`:\  |
|;;--', /88\ -,- :-~~|  |
|-;~~::'`~^~:`::`/`-=:) |
|(;':)%%%' `%%%.`:``:)\ |
|(\ %%%/dV##Vb`%%%%:`-. |
| |);/( ;~~~~ :)\`;;.``\|
| //\'/,/|;;|:(: |.|\;|\|
|/) |(/ | / \|\\`( )- ` |
|;):):)/.):|/) (`:`\\`-`|
|;%/ //;/(\`.':| ::`\\;`|
|;/~( \|./;)|.|):;\. \\-|
|/',:\//) ||`.|| (:\)):%|
|,|/;/(%;.||| (|(\:- ; :|
|_%__%:__;_:`_;_:_.\%_`_|

                                Continuer ->
");
            Console.ReadLine();
            Console.Clear();
            Console.WriteLine(@"
|      .x%%%%%%x.         |     2 - Un contrebandier
|     ,%%%%%%%%%%%        |     Avangtage :
|    ,%%%'  )'  \%        |         * Gagne 4 fois plus d'argent par combat
|   ,%x%) __   _ Y        |         + money
|   :%%% ~=-. <=~|        |         
|   :%%::. .:,\  |        |
|   `;%:`\. `-' .'        |
|    ``x`. -===-;         |
|     / `:`.__.;          |
|  .d8b.  :: ..`.         |
| d88888b.  '  /8         |
|d888888888b. ( 8b       /|
|~   ~`888888b  `8b     /:|
|  ' ' `888888   `8. _ /:/|
|'      )88888b   8b |):X |
|   ~ - |888888   `8b/:/:\|
|       |888888    88\/~~;|
|       (888888b   88|  / |
|\       \888888   8-:   /|
|_\_______\88888_.'___\__/|

                                Continuer ->
");
            Console.ReadLine();
            Console.Clear();

            Console.WriteLine(@"
|        .......       LS|          3 - Un Jedi
|      ::::::;;::.       |          Avantage :
|    .::;::::;::::.      |             * Attaque deux fois par combat
|   .::::::::::::::      |             * + Atk/Speed
|   ::`_```_```;:::.     |
|   ::=-) :=-`  ::::     |
| `::|  / :     `:::     |
|   '|  `~'     ;:::     |
|    :-:==-.   / :'      |
|    `. _    .'.d8:      |
| _.  |88bood88888._     |
|~  `-+8888888888P  `-. _|
|-'     ~~^^^^~~  `./8 ~ |
|8b /  /  |   \  \  `8   |
|P        `          8   |
|                    8b  |
|                    `8  |
|                     8b |
|         .           `8 |
|________/_\___________8_|

                                Continuer ->

");
            ;
            Console.ReadLine();
            Console.Clear();
            Console.WriteLine("\n Quel héros souhaites-tu incarner? \n 1- Un wookie \n 2- Un contrebandier \n 3- Un Jedi");
            int heros_want = Program.AskChoice(1, 3);

            Console.Clear();
            Console.WriteLine(@"
             _     _
            /_|   |_\
           //||   ||\\
          // ||   || \\
         //  ||___||  \\
        /     |   |     \    _
       /    __|   |__    \  /_\
      / .--~  |   |  ~--. \|   |
     /.~ __\  |   |  /   ~.|   |
    .~  `=='\ |   | /   _.-'.  |
   /  /      \|   |/ .-~    _.-'
  |           +---+  \  _.-~  |
  `=----.____/  #  \____.----='
   [::::::::|  (_)  |::::::::]
  .=----~~~~~\     /~~~~~----=.
  |          /`---'\          |
   \  \     /       \     /  /
    `.     /         \     .'
      `.  /._________.\  .'
        `--._________.--'     Vous embarquez dans le faucon millenium direction l'etoile de la mort ...

                                    Continuer ->
");

            Console.ReadLine();

            Console.ForegroundColor = ConsoleColor.White;
            Console.Clear();

            switch (heros_want)
            {
            case 1:
                heros = new wookie(name);
                break;

            case 2:
                heros = new contrebandier(name);
                break;

            case 3:
                heros = new jedi(name);
                break;
            }
            Boss Vador = new Vador();

            //world.affMap(heros);
            while ((resultat == 0))
            {
                world.affMap(heros);
                heros.Deplacement(world);

                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Indice)
                {
                    if (indice == false)
                    {
                        indice = heros.Indice();
                    }
                    else
                    {
                        Console.WriteLine("Vous avez déjà obtenu l'indice");
                    }
                }
                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Planet)
                {
                    Boss storm        = new Stormtrooper(heros);
                    int  storm_result = heros.Combat_storm(storm);
                    if (storm_result == 2)
                    {
                        heros.x = 1;
                        heros.y = 1;
                        Console.WriteLine("Vous avez perdu contre un stormtrooper... Retour au spawn.Vous perdez 100 euros \n Continuer ->");
                        Console.ReadLine();
                        Console.Clear();
                    }
                    else if (storm_result == 1)
                    {
                        Console.WriteLine("Vous avez gagné !");
                        Console.WriteLine("Il va falloir que J'avertisse Maitre Vador de la force de ce petit gamin... \n Continuer ->");
                        Console.ReadLine();
                        Console.Clear();
                    }
                }
                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Spawn)
                {
                    Console.Clear();
                    Console.WriteLine(@"
                                     /~\
                                    |oo )
                                    _\=/_
                    ___            /  _  \
                   / ()\          //|/.\|\\
                 _|_____|_        \\ \_/  ||
                | | === | |        \|\ /| ||
                |_|  O  |_|        # _ _/ #
                 ||  O  ||          | | |
                 ||__*__||          | | |
                |~ \___/ ~|         []|[]
                /=\ /=\ /=\         | | |
________________[_]_[_]_[_]________/_]_[_\_________________________
");
                    Console.Write("Vous etes sur la planete des revolutionnaires, vous recupèrez vos pv");
                    heros.hp = heros.hp_base * (heros.lvl + 1);
                    Thread.Sleep(1500);
                }
                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Boss)
                {
                    if (indice == false)
                    {
                        Console.WriteLine(@"
    .          __---__
  .     .   .-'...:...'-.               .          .
           / .  . : .__ .\
    .     /........./  \ .\  .   .                            .
         / :  :   :| () | :\                  .        .
        :...........\__/....:         .
 .      |___________________|              .                     .
        |...................|               .  
  .     :  :  :   :   :   : :                          .
      .  \................./      .            .
          \  .  . : .  .  /   .                                .
.      .   \._........._./  .        .                   .
              -..___..-                .         .
Vous ne pouvez pas entrer dans l'étoile de la mort sans indices !

                                Continuer ->
");
                        Console.ReadLine();
                    }
                    else
                    {
                        resultat = heros.Combat(Vador);
                    }
                }
                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Shop)
                {
                    Shop shop = new Shop(heros);
                    shop.affShop();
                }
                Console.Clear();
                //world.affMap(heros);
            }

            if (resultat == 1)
            {
                Console.Clear();
                Console.WriteLine(@"
           _.-'~~~~~~`-._
          /      ||      \
         /       ||       \
        |        ||        |
        | _______||_______ |
        |/ ----- \/ ----- \|
       /  (     )  (     )  \
      / \  ----- () -----  / \
     /   \      /||\      /   \
    /     \    /||||\    /     \
   /       \  /||||||\  /       \
  /_        \o========o/        _\
    `--...__|`-._  _.-'|__...--'
            |    `'    |             
");
                Console.Write(heros.name + " je suis ton Pere ....");
                Thread.Sleep(2500);
                Console.Clear();
                Console.WriteLine(@"
 _______ .__   __.  _______  
|   ____||  \ |  | |       \ 
|  |__   |   \|  | |  .--.  |
|   __|  |  . `  | |  |  |  |
|  |____ |  |\   | |  '--'  |
|_______||__| \__| |_______/ 
                             
");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine(@"

.______    _______ .______       _______   __    __  
|   _  \  |   ____||   _  \     |       \ |  |  |  | 
|  |_)  | |  |__   |  |_)  |    |  .--.  ||  |  |  | 
|   ___/  |   __|  |      /     |  |  |  ||  |  |  | 
|  |      |  |____ |  |\  \----.|  '--'  ||  `--'  | 
| _|      |_______|| _| `._____||_______/  \______/ ");
            }
        }
Exemple #3
0
        public Save()
        {
            Map    world    = new Map(5, 30);
            int    resultat = 0;
            Boss   Vador    = new Vador();
            string name;
            bool   indice;
            string type_heros;
            String path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            using (StreamReader sr = new StreamReader(path + @"\load_heros.txt"))
            {
                int    count = 0;
                string l1;
                sr.ReadLine();
                string[] tab = new string[4];
                while ((l1 = sr.ReadLine()) != null)
                {
                    tab[count] = l1;
                    count++;
                }
                name       = tab[0];
                indice     = bool.Parse(tab[2]);
                type_heros = tab[1];
            }
            if (type_heros == "jedi")
            {
                heros = new jedi(name);
            }
            else if (type_heros == "wookie")
            {
                heros = new wookie(name);
            }
            else if (type_heros == "contrebandier")
            {
                heros = new contrebandier(name);
            }
            else
            {
                Console.WriteLine("Erreur aucun heros");
            }

            heros.loadSave();

            while ((resultat == 0))
            {
                world.affMap(heros);
                heros.Deplacement(world);

                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Indice)
                {
                    if (indice == false)
                    {
                        indice = heros.Indice();
                    }
                    else
                    {
                        Console.WriteLine("Vous avez déjà obtenu l'indice");
                    }
                }
                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Planet)
                {
                    Boss storm        = new Stormtrooper(heros);
                    int  storm_result = heros.Combat_storm(storm);
                    if (storm_result == 2)
                    {
                        heros.x = 1;
                        heros.y = 1;
                        Console.WriteLine("Vous avez perdu contre un stormtrooper... Retour au spawn.Vous perdez 100 euros \n Continuer ->");
                        Console.ReadLine();
                        Console.Clear();
                    }
                    else if (storm_result == 1)
                    {
                        Console.WriteLine("Vous avez gagné !");
                        Console.WriteLine("Il va falloir que J'avertisse Maitre Vador de la force de ce petit gamin... \n Continuer ->");
                        Console.ReadLine();
                        Console.Clear();
                    }
                }
                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Spawn)
                {
                    Console.Clear();
                    Console.WriteLine(@"
                                     /~\
                                    |oo )
                                    _\=/_
                    ___            /  _  \
                   / ()\          //|/.\|\\
                 _|_____|_        \\ \_/  ||
                | | === | |        \|\ /| ||
                |_|  O  |_|        # _ _/ #
                 ||  O  ||          | | |
                 ||__*__||          | | |
                |~ \___/ ~|         []|[]
                /=\ /=\ /=\         | | |
________________[_]_[_]_[_]________/_]_[_\_________________________
");
                    Console.Write("Vous etes sur la planete des revolutionnaires, vous recupèrez vos pv");
                    heros.hp = heros.hp_base * (heros.lvl + 1);
                    Thread.Sleep(1500);
                }
                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Boss)
                {
                    if (indice == false)
                    {
                        Console.WriteLine(@"
    .          __---__
  .     .   .-'...:...'-.               .          .
           / .  . : .__ .\
    .     /........./  \ .\  .   .                            .
         / :  :   :| () | :\                  .        .
        :...........\__/....:         .
 .      |___________________|              .                     .
        |...................|               .  
  .     :  :  :   :   :   : :                          .
      .  \................./      .            .
          \  .  . : .  .  /   .                                .
.      .   \._........._./  .        .                   .
              -..___..-                .         .
Vous ne pouvez pas entrer dans l'étoile de la mort sans indices !

                                Continuer ->
");
                        Console.ReadLine();
                    }
                    else
                    {
                        resultat = heros.Combat(Vador);
                    }
                }
                if (world.Plateau[heros.x, heros.y].Type == Case.Lieu.Shop)
                {
                    Shop shop = new Shop(heros);
                    shop.affShop();
                }
                Console.Clear();
                //world.affMap(heros);
            }

            if (resultat == 1)
            {
                Console.Clear();
                Console.WriteLine(@"
           _.-'~~~~~~`-._
          /      ||      \
         /       ||       \
        |        ||        |
        | _______||_______ |
        |/ ----- \/ ----- \|
       /  (     )  (     )  \
      / \  ----- () -----  / \
     /   \      /||\      /   \
    /     \    /||||\    /     \
   /       \  /||||||\  /       \
  /_        \o========o/        _\
    `--...__|`-._  _.-'|__...--'
            |    `'    |             
");
                Console.Write(heros.name + " je suis ton Pere ....");
                Thread.Sleep(2500);
                Console.Clear();
                Console.WriteLine(@"
 _______ .__   __.  _______  
|   ____||  \ |  | |       \ 
|  |__   |   \|  | |  .--.  |
|   __|  |  . `  | |  |  |  |
|  |____ |  |\   | |  '--'  |
|_______||__| \__| |_______/ 
                             
");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine(@"

.______    _______ .______       _______   __    __  
|   _  \  |   ____||   _  \     |       \ |  |  |  | 
|  |_)  | |  |__   |  |_)  |    |  .--.  ||  |  |  | 
|   ___/  |   __|  |      /     |  |  |  ||  |  |  | 
|  |      |  |____ |  |\  \----.|  '--'  ||  `--'  | 
| _|      |_______|| _| `._____||_______/  \______/ ");
            }
        }