Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4.  
  5. class MainClass
  6. {
  7. static string piege = "";
  8. public static void Main (string[] args) {
  9. var inventaire = new List<string>() { "" };
  10.  
  11. string all_DeTrapeur = "";
  12. string element_detrapeur = "";
  13.  
  14. for (int i = 0; i < inventaire.Count; i++)
  15. {
  16. if (inventaire[i].Contains(all_DeTrapeur))
  17. element_detrapeur = inventaire[i];
  18. }
  19.  
  20.  
  21.  
  22. int score = 0;
  23. bool mort = false;
  24. string englais_gauche = "left";
  25. string englais_droite = "right";
  26. string englais_avant = "forward";
  27. bool anticheater = false;
  28. string repcinematique;
  29. bool cinematique = true;
  30.  
  31.  
  32.  
  33. string[] anticheat = new string[3]
  34. { "gauche", "droite", "avant" };
  35.  
  36. string result1 = string.Join(",", anticheat[0]);
  37. string result2 = string.Join(",", anticheat[1]);
  38. string result3 = string.Join(",", anticheat[2]);
  39.  
  40.  
  41.  
  42.  
  43.  
  44. //Introduction
  45. Console.WriteLine("The Maze V2\n");
  46. System.Threading.Thread.Sleep(400);
  47. Console.WriteLine("Loading...");
  48. System.Threading.Thread.Sleep(4000);
  49. Console.WriteLine("\n\n\nChoisissez votre language / Choose your language: En/Fr");
  50. Console.WriteLine("");
  51. string choix_language = Convert.ToString(Console.ReadLine());
  52. if (choix_language == "fr")
  53. {
  54. Console.WriteLine("\nNouveaux ajouts : \n -Choix du language entre Francais et Anglais\n -Nouveau Système De Boutique!\n -Nouveau Sytème D'inventaire!\n -Nouvelle Item Ajouté a La Boutique!\n\nProchainement : \n -De Nouveaux Items!\n -De Meilleurs Optimisations et Beaucoup de Nouveaux Bugs Seront Fixés");
  55. Console.WriteLine("");
  56. Console.WriteLine("");
  57. Console.WriteLine("");
  58. Console.WriteLine("Appuyez sur entrer pour continuer.");
  59. Console.ReadLine();
  60. }
  61. else if (choix_language == "en")
  62. {
  63. Console.WriteLine("\nNew additions: : \n -Choice of language between French and English\n -New Shop System!\n -New Inventory System!\n -New Item In The Shop!\nComing soon : \n -New Items! \n");
  64. Console.WriteLine("");
  65. Console.WriteLine("");
  66. Console.WriteLine("");
  67. Console.WriteLine("Appuyez sur entrer pour continuer.");
  68. Console.ReadLine();
  69. }
  70.  
  71.  
  72.  
  73.  
  74.  
  75. if (choix_language == "fr")
  76. {
  77. Console.WriteLine("Souhaitez-vous passer le tutoriel? (O/N)");
  78. repcinematique = Console.ReadLine();
  79. if (repcinematique == "o")
  80. {
  81. cinematique = false;
  82. }
  83. }
  84. else if (choix_language == "en")
  85. {
  86. Console.WriteLine("Would you like to pass the tutorial? (Y/N)");
  87. repcinematique = Console.ReadLine();
  88. if (repcinematique == "y")
  89. {
  90. cinematique = false;
  91. }
  92. }
  93.  
  94.  
  95. if (cinematique == true)
  96. {
  97. if (choix_language == "fr")
  98. {
  99. Console.WriteLine("Bonjour et bienvenue dans le labyrinthe.");
  100. Console.WriteLine("");
  101. Console.WriteLine("");
  102. Console.WriteLine("Appuyez sur entrer pour continuer.");
  103. Console.ReadLine();
  104.  
  105. Console.WriteLine("Dans celui-ci, vous devrez vous rendre le plus loin possible sans faire face aux pièges !");
  106. Console.WriteLine("");
  107. Console.WriteLine("");
  108. Console.WriteLine("Appuyez sur entrer pour continuer.");
  109. Console.ReadLine();
  110.  
  111. Console.WriteLine("Vous aurez 1 chance sur 3 de tomber sur un piège à chaque chemins que vous prenez.");
  112. Console.WriteLine("");
  113. Console.WriteLine("");
  114. Console.WriteLine("Appuyez sur entrer pour commencer.");
  115. Console.ReadLine();
  116. }
  117. else if (choix_language == "en")
  118. {
  119. Console.WriteLine("Welcome to the maze.");
  120. Console.WriteLine("");
  121. Console.WriteLine("");
  122. Console.WriteLine("Press enter to continue.");
  123. Console.ReadLine();
  124.  
  125. Console.WriteLine("In this maze you’ll have to get the fartest without dying to the traps!");
  126. Console.WriteLine("");
  127. Console.WriteLine("");
  128. Console.WriteLine("Press enter to continue.");
  129. Console.ReadLine();
  130.  
  131. Console.WriteLine("You only have 1 life so be careful!");
  132. System.Threading.Thread.Sleep(1500);
  133. Console.WriteLine("");
  134.  
  135. }
  136. }
  137. //Script Jeu
  138. if (choix_language == "fr")
  139. {
  140. if (cinematique == true)
  141. {
  142. Console.WriteLine("\nVous vous réveillez dans un ascenseur en marche.");
  143. Console.WriteLine("");
  144. Console.WriteLine("");
  145. Console.WriteLine("Appuyez sur entrer pour commencer.");
  146. Console.ReadLine();
  147. Console.WriteLine("La porte s'ouvre et vous vous retrouvez dans une grande salle. Celle-ci est dotée de trois grand couloirs, un a gauche, un a droite et un tout-droit.");
  148. System.Threading.Thread.Sleep(6000);
  149. Console.WriteLine("");
  150. Console.WriteLine("Faites attention ! L'un des trois chemins peut contenir un piège.");
  151. Console.WriteLine("");
  152. Console.WriteLine("");
  153. Console.WriteLine("");
  154. Console.WriteLine("");
  155. System.Threading.Thread.Sleep(2000);
  156. }
  157.  
  158. }
  159. else if (choix_language == "en")
  160. {
  161. if (cinematique == true)
  162. {
  163. Console.WriteLine("\nYou just woke up in a working elevator.");
  164. Console.WriteLine("");
  165. Console.WriteLine("");
  166. Console.WriteLine("Press enter to continue.");
  167. Console.ReadLine();
  168. Console.WriteLine("The door opens and you walk in a giant room. It has multiple ways: right, left and forward.");
  169. System.Threading.Thread.Sleep(2500);
  170. Console.WriteLine("Some paths might be gathered with traps...");
  171. Console.WriteLine("");
  172. Console.WriteLine("");
  173.  
  174. }
  175. result1 = englais_gauche;
  176. result2 = englais_droite;
  177. result3 = englais_avant;
  178. Console.WriteLine("(enter left, to go left, right, to go right, or forward, to go forward.");
  179. }
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204. bool menu = true;
  205. int prix_detrapeur = 20;
  206. int argent = 0;
  207. string choix_menu_fr = "";
  208. string choix_menu_en = "";
  209. string choix_chemin = "";
  210.  
  211. while (mort == false)
  212. {
  213. //Gestion Menu
  214. while (menu == true)
  215. {
  216. if (choix_language == "fr")
  217. {
  218. Console.WriteLine("\n\n---------------------------------------------------------------------\n\n Argent : " + argent + "$" + "\n Points : " + score + "\n\n----------------------------------------------------\n-Boutique (tape 'boutique' puis Entre)\n----------------------------------------------------\n-Revendre tes points pour gagner de l'argent (tape 'revente' puis Entre)\n----------------------------------------------------\n-Inventaire (tape 'inv' puis Entre)\n----------------------------------------------------\n\n -Tape 'continuer' puis Entre pour débuter le jeu");
  219. choix_menu_fr = Convert.ToString(Console.ReadLine());
  220. }
  221. else if (choix_language == "en")
  222. {
  223. Console.WriteLine("\n\n---------------------------------------------------------------------\n\n Money:" + argent + "$" + "\n Points : " + score + " points" + "\n\n----------------------------------------------------\n-Shop (type 'shop' then Enter)\n----------------------------------------------------\n-Resell your accumulated points to get money (type 'resell' then Enter)\n----------------------------------------------------\n-Inventory (type 'inv' then Enter)\n----------------------------------------------------\n\n -Type 'continue' then Enter to begin the game.");
  224. choix_menu_en = Convert.ToString(Console.ReadLine());
  225. }
  226.  
  227. //Gestion Boutique
  228.  
  229.  
  230. if (choix_menu_fr == "boutique")
  231. {
  232. Console.WriteLine("\n\n\n\n\n---------------------------------------------------------------------\n\n Argent : " + argent + "$" + "\n Points : " + score + "\n\n---------------------------------------------------------------------\n\n Boutique\n\n----------------------------------------------------\n 20$ -DéTrapeur (Prévoyez l'arrivée d'un piège en le détruisant sans même l'avoir vue !) tape 'detrapeur' puis Entre pour acheter \n----------------------------------------------------\n\n -En développement...\n\nTape retour pour retourner au menu. ");
  233. string choix_boutique_fr = Convert.ToString(Console.ReadLine());
  234. //Achat Détrapeur
  235. if (choix_boutique_fr == "detrapeur")
  236. {
  237. if (argent < prix_detrapeur)
  238. {
  239. Console.WriteLine("\nVous n'avez pas assez d'argent !\nAllez vendre vos points accumulés dans l'option revente.\n\nAppuyez sur 'Entrer' pour retourner.");
  240.  
  241. System.Threading.Thread.Sleep(3500);
  242. menu = true;
  243.  
  244. }
  245. else if (argent >= prix_detrapeur)
  246. {
  247.  
  248.  
  249.  
  250.  
  251.  
  252. Console.WriteLine("\nVous avez acheté un DéTrapeur pour " + prix_detrapeur + "$\n\nAppuyez sur Entrer pour retourner au menu.");
  253. element_detrapeur = element_detrapeur + "DéTrapeur ";
  254. argent -= 20;
  255. menu = true;
  256. }
  257. }
  258. }
  259. else if (choix_menu_en == "shop")
  260. {
  261. Console.WriteLine("\n\n\n\n\n---------------------------------------------------------------------\n\n Money : " + argent + "$" + "\n Points : " + score + "\n\n---------------------------------------------------------------------\n\n Shop\n---------------------------------------------------------------------\n\n---------------------------------------------------------------------\n 20$ -UnTraper (Predict the arrival of a trap by destroying it without even seeing it!) type untraper then Enter to buy \n---------------------------------------------------------------------\n\n -In development...\n---------------------------------------------------------------------\n\nType 'return' to return to the menu. ");
  262.  
  263. string choix_boutique_en = Convert.ToString(Console.ReadLine());
  264. //Achat Détrapeur Anglais
  265. if (choix_boutique_en == "untraper")
  266. {
  267. if (argent < prix_detrapeur)
  268. {
  269. Console.WriteLine("\nYou don't have enough money !\nGo sell your accumulated points in the resell option.");
  270. System.Threading.Thread.Sleep(2500);
  271. menu = true;
  272.  
  273. }
  274. else if (argent >= prix_detrapeur)
  275. {
  276. element_detrapeur = element_detrapeur + " |UnTraper| ";
  277. Console.WriteLine("You bought an UnTraper for " + prix_detrapeur + "$\n\nPress 'Enter' to return to the menu.");
  278. argent -= 20;
  279. menu = true;
  280. }
  281. }
  282. }
  283. if (choix_menu_fr == "inv")
  284. {
  285. if (element_detrapeur == "")
  286. {
  287. Console.WriteLine("\nVous n'avez rien dans votre inventaire !\n\nAppuyez sur 'Entrer' pour retourner.");
  288. System.Threading.Thread.Sleep(2500);
  289. menu = true;
  290. }
  291. else
  292. {
  293. Console.WriteLine("Tu as: " + element_detrapeur);
  294. Console.WriteLine("\nAppuyez sur Entrer pour retourner au menu.");
  295. }
  296. }
  297. else if (choix_menu_en == "inv")
  298. {
  299. if (element_detrapeur == "")
  300. {
  301. Console.WriteLine("\nYou got nothing in your inventory !");
  302. System.Threading.Thread.Sleep(2500);
  303. menu = true;
  304. }
  305. else
  306. {
  307. Console.WriteLine("\nYou have: " + element_detrapeur);
  308. }
  309. }
  310. if (choix_menu_fr == "revente")
  311. {
  312. if (score == 0)
  313. {
  314. menu = true;
  315. Console.WriteLine("\nVous n'avez pas de points a revendre !\n\nAppuyez sur 'Entrer' pour retourner.");
  316.  
  317.  
  318. }
  319. else if (score > 0)
  320. {
  321. argent += score * 10;
  322. Console.WriteLine("Vous avez vendu " + score + " points pour " + score * 10 + "$\n\nAppuyez sur Entrer pour revenir au menu.");
  323.  
  324. score = 0;
  325. }
  326. }
  327. else if (choix_menu_en == "resell")
  328. {
  329. if (score == 0)
  330. {
  331. menu = true;
  332. Console.WriteLine("\nYou don't have any points to resell !");
  333. System.Threading.Thread.Sleep(2500);
  334. }
  335. else if (score > 0)
  336. {
  337. argent += score * 10;
  338. Console.WriteLine("You sold " + score + " points for " + score * 10 + "$");
  339. score = 0;
  340. }
  341. }
  342. if (choix_menu_fr == "continuer")
  343. {
  344. System.Threading.Thread.Sleep(1500);
  345. Console.WriteLine("\n\n(entre gauche, pour aller à gauche, droite, pour aller à droite, ou avant, pour aller en avant.)");
  346. menu = false;
  347. }
  348. else if (choix_menu_en == "continue")
  349. {
  350. System.Threading.Thread.Sleep(1500);
  351. Console.WriteLine("\n\n(enter left, to go left, right, to go right, or forward, to go forward.)");
  352. menu = false;
  353. }
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379. choix_chemin = Convert.ToString(Console.ReadLine());
  380. Random random = new Random();
  381.  
  382. if (choix_language == "fr")
  383. {
  384. var names_fr = new List<string> { "gauche", "droite", "avant" };
  385.  
  386. int index_fr = random.Next(names_fr.Count);
  387. var name_fr = names_fr[index_fr];
  388. names_fr.RemoveAt(index_fr);
  389.  
  390. piege = name_fr;
  391. }
  392. else if (choix_language == "en")
  393. {
  394. var names_en = new List<string> { "left", "right", "forward" };
  395.  
  396. int index_en = random.Next(names_en.Count);
  397. var name_en = names_en[index_en];
  398. names_en.RemoveAt(index_en);
  399.  
  400. piege = name_en;
  401. }
  402.  
  403. if (choix_chemin != result1)
  404. if (choix_chemin != result2)
  405. if (choix_chemin != result3)
  406. if (choix_language == "en")
  407. {
  408. anticheater = true;
  409. Console.WriteLine("Have you tryed to cheat right there? Or was it just a mistake? Please restart the program.");
  410. mort = true;
  411. }
  412. else if (choix_language == "fr")
  413. {
  414. anticheater = true;
  415. Console.WriteLine("Avez-vous essayé de tricher? Ou n'était-ce qu'une erreur? Veuillez redémarrer le programme.");
  416. mort = true;
  417. }
  418.  
  419.  
  420.  
  421.  
  422.  
  423. if (mort != true)
  424. {
  425. if (choix_chemin != piege)
  426. {
  427. if (choix_language == "fr")
  428. {
  429. score += 1;
  430. Console.WriteLine("Bravo ! Tu as maintenant " + score + " points.");
  431. menu = true;
  432.  
  433.  
  434. }
  435. else if (choix_language == "en")
  436. {
  437. score += 1;
  438. Console.WriteLine("Great! You now have " + score + " points.");
  439. menu = true;
  440.  
  441.  
  442. }
  443.  
  444. }
  445. }
  446. if (choix_chemin == piege)
  447. {
  448. if (anticheater != true)
  449. {
  450. if (choix_language == "fr")
  451. {
  452. if (element_detrapeur == "DéTrapeur")
  453. {
  454. Console.WriteLine("Tu possède un DéTrapeur et un piège est face à toi !\n\n");
  455. Console.WriteLine("Tape 'utiliser' pour te sauver mais perdre ton DéTrapeur (Tu peut toujours en racheter un autre dans la boutique!)");
  456. string utiliser_detrapeur = Convert.ToString(Console.ReadLine());
  457. if (utiliser_detrapeur == "utiliser")
  458. {
  459. mort = false;
  460. Console.WriteLine("Tu as survécu!");
  461. System.Threading.Thread.Sleep(3500);
  462. }
  463. else if (element_detrapeur == "")
  464. {
  465. mort = true;
  466. Console.WriteLine("Tu est tombé dans le piège, perdu!");
  467. }
  468. }
  469.  
  470. }
  471. else if (choix_language == "en")
  472. {
  473. if (element_detrapeur == "UnTraper")
  474. {
  475. Console.WriteLine("You got an UnTraper and a trap is facing you!\n\n");
  476. Console.WriteLine("Type 'use' to save yourself but loose your UnTraper. (You may always buy another one at the shop!)");
  477. string utiliser_detrapeur_en = Convert.ToString(Console.ReadLine());
  478. if (utiliser_detrapeur_en == "use")
  479. {
  480. menu = true;
  481. mort = false;
  482. Console.WriteLine("Tu as survécu!");
  483. System.Threading.Thread.Sleep(3500);
  484. }
  485. else
  486. {
  487. mort = true;
  488. Console.WriteLine("You fell on a trap, game over !");
  489. }
  490.  
  491. }
  492. }
  493.  
  494. }
  495. }
  496. }
  497. }
  498. }
  499. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement