示例#1
0
        public virtual Stone WhatYouDrop(Ennemy E)
        {
            switch (E.drop)
            {
            case 'h':
                return(new Heal());

            case 'a':
                return(new Attack());

            case 'b':
                return(new Booster());

            case 'i':
                switch (E.name)
                {
                case "Hulk":
                    return(new SpaceStone());

                case "Vision":
                    return(new MindStone());

                case "Docteur Strange":
                    return(new TimeStone());

                case "Gamorra":
                    return(new SoulStone());

                case "StarLord":
                    return(new RealityStone());

                default:
                    return(new SpaceStone());
                }

            default:
                return(new Heal());
            }
        }
示例#2
0
        public static void MainGame(Player player, Map map)
        {
            end       = false;
            skipToEnd = false;
            winGame   = false;

            while (!end)
            {
                if (!map.box[player.position[0], player.position[1]].visited)
                {
                    if (map.box[player.position[0], player.position[1]].ennemy != null)
                    {
                        Ennemy e = map.box[player.position[0], player.position[1]].ennemy;
                        if (e.Name == "Vision")
                        {
                            if (player.Fight(e))
                            {
                                Console.ReadLine();
                                Console.Clear();

                                Map mapFinalBoss = new Map(1);

                                if (player.Fight(mapFinalBoss.box[0, 0].ennemy))
                                {
                                    end       = true;
                                    skipToEnd = true;
                                    winGame   = true;
                                }
                                else
                                {
                                    end       = true;
                                    skipToEnd = true;
                                }
                            }
                            else
                            {
                                end       = true;
                                skipToEnd = true;
                            }
                        }
                        else
                        {
                            if (!player.Fight(e))
                            {
                                end       = true;
                                skipToEnd = true;
                            }
                            Console.ReadLine();
                            Console.Clear();
                        }
                    }
                    else
                    {
                        Stone s = map.box[player.position[0], player.position[1]].stone;
                        player.PickUp(s);
                    }
                    map.box[player.position[0], player.position[1]].visited = true;
                }
                else
                {
                    Console.WriteLine("Vous êtes déjà venu par ici ...");
                }

                if (!skipToEnd)
                {
                    if (player.lifePoints > 0)
                    {
                        bool next = false;
                        while (!next)
                        {
                            Console.WriteLine("1 : Avancer");
                            Console.WriteLine("2 : Regarder dans l'inventaire");
                            Console.WriteLine("3 : Voir la carte");
                            Console.WriteLine("4 : Voir les statistiques");
                            Console.WriteLine("5 : Sauvegarder");
                            int c = Menu.AskChoice("Qu'allez-vous faire ?", 1, 5);

                            switch (c)
                            {
                            case 1:
                                next = true;
                                player.Move();
                                break;

                            case 2:
                                player.ShowInventory();
                                int c1 = Menu.AskChoice("Que voulez-vous ?", 1, 3);
                                switch (c1)
                                {
                                case 1:
                                    player.ShowStoneInventory();
                                    int c2 = Menu.AskChoice("Quelle gemme voulez-vous utiliser ?", 1, 4);
                                    switch (c2)
                                    {
                                    case 1:
                                        if (player.stoneInventory["Gemme de Soin"] > 0)
                                        {
                                            Heal h = new Heal();
                                            h.Use(player);
                                        }
                                        else
                                        {
                                            Console.WriteLine("Vous n'avez plus de gemme de soin ...");
                                        }
                                        break;

                                    case 2:
                                        Console.WriteLine("Ce n'est pas le moment d'utiliser ça !");
                                        break;

                                    case 3:
                                        if (player.stoneInventory["Gemme d'Amélioration"] > 0)
                                        {
                                            Booster b = new Booster();
                                            b.Use(player);
                                        }
                                        else
                                        {
                                            Console.WriteLine("Vous n'avez plus de gemme d'amélioration ...");
                                        }
                                        break;

                                    case 4:
                                        Console.Clear();
                                        continue;
                                    }
                                    break;

                                case 2:
                                    player.ShowInfinityStoneInventory();
                                    int c3 = Menu.AskChoice("Quelle Pierre d'Infinitée voulez-vous utiliser ?", 1, 7);
                                    switch (c3)
                                    {
                                    case 4:
                                        Witch e = new Witch();
                                        player.UseInfinityStone(c3, e);
                                        break;

                                    case 7:
                                        Console.Clear();
                                        continue;

                                    default:
                                        Console.WriteLine("Il serait plus prudent de ne pas utiliser cette Pierre maintenant");
                                        break;
                                    }
                                    break;

                                case 3:
                                    Console.Clear();
                                    continue;
                                }
                                break;

                            case 3:
                                map.ShowMap(player);
                                break;

                            case 4:
                                player.ShowStats();
                                break;

                            case 5:
                                player.Save(map);
                                break;
                            }
                            Console.ReadLine();
                            Console.Clear();
                        }
                    }
                }
            }
        }