Advertisement
Guest User

fthrgf

a guest
Apr 29th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 52.32 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace PlayerMonsterSpajanje
  8. {
  9. class Program
  10. {
  11. public static ConsoleColor boja;
  12. public static string monsterChoice;
  13. public static string monsterChoice1;
  14. public static string monsterChoice2;
  15. public static string monsterChoice3;
  16. public static string monsterChoice4;
  17. static int monsterRandom;
  18.  
  19.  
  20. static void Main(string[] args)
  21. {
  22.  
  23.  
  24. Console.WriteLine("What is the name of your Hero?");
  25. Player playa = new Player();
  26. Console.WriteLine("You choose to be" + playa.race + " named " + playa.name + "!" );
  27. Console.Write("Your Attack is " + playa.attack + ", your Defense is " + playa.defense + ", you have " );
  28. if (playa.currentHP >= 0 && playa.currentHP < 7)
  29. {
  30. boja = ConsoleColor.Red;
  31. }
  32. if (playa.currentHP >= 7 && playa.currentHP < 14)
  33. {
  34. boja = ConsoleColor.Yellow;
  35. }
  36. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  37. {
  38. boja = ConsoleColor.Green;
  39. }
  40. Console.ForegroundColor = boja;
  41. Console.Write("" + playa.currentHP + "");
  42. Console.ResetColor();
  43. Console.Write(" HP! \n \n ");
  44.  
  45. Monsta daMonsta = new Monsta();
  46.  
  47. Console.WriteLine("Your enemy is " + daMonsta.Race + "" + daMonsta.Class + "!");
  48.  
  49. Item daItem = new Item();
  50. Armor daArmor = new Armor();
  51.  
  52. Console.Write("His Attack is " + daItem.MaxDamage + ", his Defense is " + daArmor.armorDef + ", he has ");
  53. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  54. {
  55. boja = ConsoleColor.Red;
  56. }
  57. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  58. {
  59. boja = ConsoleColor.Yellow;
  60. }
  61. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  62. {
  63. boja = ConsoleColor.Green;
  64. }
  65. Console.ForegroundColor = boja;
  66. Console.Write("" + daMonsta.monsterHP + "");
  67. Console.ResetColor();
  68. Console.Write(" HP! \n \n ");
  69. Console.WriteLine("Hope you win!");
  70.  
  71. while (daMonsta.monsterHP >= 1)
  72. {
  73. Console.WriteLine("Choose 5 of your next actions!");
  74. Console.WriteLine("Press A for attack, or D for defense");
  75.  
  76. var actionChoice = Console.ReadKey();
  77. if (actionChoice.Key == ConsoleKey.A)
  78. Console.WriteLine(" = Attack");
  79. if (actionChoice.Key == ConsoleKey.D)
  80. Console.WriteLine(" = Defense");
  81. var actionChoice1 = Console.ReadKey();
  82. if (actionChoice1.Key == ConsoleKey.A)
  83. Console.WriteLine(" = Attack");
  84. if (actionChoice1.Key == ConsoleKey.D)
  85. Console.WriteLine(" = Defense");
  86. var actionChoice2 = Console.ReadKey();
  87. if (actionChoice2.Key == ConsoleKey.A)
  88. Console.WriteLine(" = Attack");
  89. if (actionChoice2.Key == ConsoleKey.D)
  90. Console.WriteLine(" = Defense");
  91. var actionChoice3 = Console.ReadKey();
  92. if (actionChoice3.Key == ConsoleKey.A)
  93. Console.WriteLine(" = Attack");
  94. if (actionChoice3.Key == ConsoleKey.D)
  95. Console.WriteLine(" = Defense");
  96. var actionChoice4 = Console.ReadKey();
  97. if (actionChoice4.Key == ConsoleKey.A)
  98. Console.WriteLine(" = Attack \n ");
  99. if (actionChoice4.Key == ConsoleKey.D)
  100. Console.WriteLine(" = Defense \n ");
  101.  
  102. Console.WriteLine("The monster chooses...");
  103.  
  104. monsterRandom = Monsta.gener.Next(1, 10);
  105. if (monsterRandom >= 1 && monsterRandom < 3)
  106. monsterChoice = "Attack";
  107. if (monsterRandom >= 3 && monsterRandom < 5)
  108. monsterChoice = "Defense";
  109. if (monsterRandom >= 5 && monsterRandom < 8)
  110. monsterChoice = "Attack";
  111. if (monsterRandom >= 8 && monsterRandom < 10)
  112. monsterChoice = "Defense";
  113. monsterRandom = Monsta.gener.Next(1, 10);
  114. if (monsterRandom >= 1 && monsterRandom < 3)
  115. monsterChoice1 = "Attack";
  116. if (monsterRandom >= 3 && monsterRandom < 5)
  117. monsterChoice1 = "Defense";
  118. if (monsterRandom >= 5 && monsterRandom < 8)
  119. monsterChoice1 = "Attack";
  120. if (monsterRandom >= 8 && monsterRandom < 10)
  121. monsterChoice1 = "Defense";
  122. monsterRandom = Monsta.gener.Next(1, 10);
  123. if (monsterRandom >= 1 && monsterRandom < 3)
  124. monsterChoice2 = "Attack";
  125. if (monsterRandom >= 3 && monsterRandom < 5)
  126. monsterChoice2 = "Defense";
  127. if (monsterRandom >= 5 && monsterRandom < 8)
  128. monsterChoice2 = "Attack";
  129. if (monsterRandom >= 8 && monsterRandom < 10)
  130. monsterChoice2 = "Defense";
  131. monsterRandom = Monsta.gener.Next(1, 10);
  132. if (monsterRandom >= 1 && monsterRandom < 3)
  133. monsterChoice3 = "Attack";
  134. if (monsterRandom >= 3 && monsterRandom < 5)
  135. monsterChoice3 = "Defense";
  136. if (monsterRandom >= 5 && monsterRandom < 8)
  137. monsterChoice3 = "Attack";
  138. if (monsterRandom >= 8 && monsterRandom < 10)
  139. monsterChoice3 = "Defense";
  140. monsterRandom = Monsta.gener.Next(1, 10);
  141. if (monsterRandom >= 1 && monsterRandom < 3)
  142. monsterChoice4 = "Attack \n ";
  143. if (monsterRandom >= 3 && monsterRandom < 5)
  144. monsterChoice4 = "Defense \n ";
  145. if (monsterRandom >= 5 && monsterRandom < 8)
  146. monsterChoice4 = "Attack \n ";
  147. if (monsterRandom >= 8 && monsterRandom < 10)
  148. monsterChoice4 = "Defense \n ";
  149. Console.WriteLine(monsterChoice);
  150. Console.WriteLine(monsterChoice1);
  151. Console.WriteLine(monsterChoice2);
  152. Console.WriteLine(monsterChoice3);
  153. Console.WriteLine(monsterChoice4, " \n ");
  154.  
  155. if (actionChoice.Key == ConsoleKey.A && monsterChoice == "Attack")
  156. {
  157. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  158. {
  159. break;
  160. }
  161. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  162. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  163. Console.Write("You swing and hit each other, the monster has ");
  164. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  165. {
  166. boja = ConsoleColor.Red;
  167. }
  168. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  169. {
  170. boja = ConsoleColor.Yellow;
  171. }
  172. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  173. {
  174. boja = ConsoleColor.Green;
  175. }
  176. Console.ForegroundColor = boja;
  177. Console.Write("" + daMonsta.monsterHP + "");
  178. Console.ResetColor();
  179. Console.Write(" HP left, you have ");
  180. if (playa.currentHP >= 0 && playa.currentHP < 7)
  181. {
  182. boja = ConsoleColor.Red;
  183. }
  184. if (playa.currentHP >= 7 && playa.currentHP < 14)
  185. {
  186. boja = ConsoleColor.Yellow;
  187. }
  188. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  189. {
  190. boja = ConsoleColor.Green;
  191. }
  192. Console.ForegroundColor = boja;
  193. Console.Write("" + playa.currentHP + "");
  194. Console.ResetColor();
  195. Console.Write(" HP left! \n ");
  196. }
  197. if (actionChoice.Key == ConsoleKey.A && monsterChoice == "Defense")
  198. {
  199. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  200. Console.Write("You swing and hit the monster, the monster has ");
  201. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  202. {
  203. boja = ConsoleColor.Red;
  204. }
  205. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  206. {
  207. boja = ConsoleColor.Yellow;
  208. }
  209. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  210. {
  211. boja = ConsoleColor.Green;
  212. }
  213. Console.ForegroundColor = boja;
  214. Console.Write("" + daMonsta.monsterHP + "");
  215. Console.ResetColor();
  216. Console.Write(" HP left! \n ");
  217. }
  218. if (actionChoice.Key == ConsoleKey.D && monsterChoice == "Attack")
  219. {
  220. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  221. Console.Write("The monster swings and hits you, you have ");
  222. if (playa.currentHP >= 0 && playa.currentHP < 7)
  223. {
  224. boja = ConsoleColor.Red;
  225. }
  226. if (playa.currentHP >= 7 && playa.currentHP < 14)
  227. {
  228. boja = ConsoleColor.Yellow;
  229. }
  230. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  231. {
  232. boja = ConsoleColor.Green;
  233. }
  234. Console.ForegroundColor = boja;
  235. Console.Write("" + playa.currentHP + "");
  236. Console.ResetColor();
  237. Console.Write(" HP left! \n ");
  238. }
  239. if (actionChoice.Key == ConsoleKey.D && monsterChoice == "Defense")
  240. {
  241. Console.Write("You slam your shields together, no one takes damage, you have ");
  242. if (playa.currentHP >= 0 && playa.currentHP < 7)
  243. {
  244. boja = ConsoleColor.Red;
  245. }
  246. if (playa.currentHP >= 7 && playa.currentHP < 14)
  247. {
  248. boja = ConsoleColor.Yellow;
  249. }
  250. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  251. {
  252. boja = ConsoleColor.Green;
  253. }
  254. Console.ForegroundColor = boja;
  255. Console.Write("" + playa.currentHP + "");
  256. Console.ResetColor();
  257. Console.Write(" HP left, your enemy has ");
  258. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  259. {
  260. boja = ConsoleColor.Red;
  261. }
  262. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  263. {
  264. boja = ConsoleColor.Yellow;
  265. }
  266. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  267. {
  268. boja = ConsoleColor.Green;
  269. }
  270. Console.ForegroundColor = boja;
  271. Console.Write("" + daMonsta.monsterHP + "");
  272. Console.ResetColor();
  273. Console.Write(" HP left! \n ");
  274. }
  275. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  276. {
  277. break;
  278. }
  279.  
  280. if (actionChoice1.Key == ConsoleKey.A && monsterChoice1 == "Attack")
  281. {
  282. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  283. {
  284. break;
  285. }
  286. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  287. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  288. Console.Write("You swing and hit each other, the monster has ");
  289. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  290. {
  291. boja = ConsoleColor.Red;
  292. }
  293. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  294. {
  295. boja = ConsoleColor.Yellow;
  296. }
  297. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  298. {
  299. boja = ConsoleColor.Green;
  300. }
  301. Console.ForegroundColor = boja;
  302. Console.Write("" + daMonsta.monsterHP + "");
  303. Console.ResetColor();
  304. Console.Write(" HP left, you have ");
  305. if (playa.currentHP >= 0 && playa.currentHP < 7)
  306. {
  307. boja = ConsoleColor.Red;
  308. }
  309. if (playa.currentHP >= 7 && playa.currentHP < 14)
  310. {
  311. boja = ConsoleColor.Yellow;
  312. }
  313. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  314. {
  315. boja = ConsoleColor.Green;
  316. }
  317. Console.ForegroundColor = boja;
  318. Console.Write("" + playa.currentHP + "");
  319. Console.ResetColor();
  320. Console.Write(" HP left! \n ");
  321. }
  322. if (actionChoice1.Key == ConsoleKey.A && monsterChoice1 == "Defense")
  323. {
  324. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  325. Console.Write("You swing and hit the monster, the monster has ");
  326. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  327. {
  328. boja = ConsoleColor.Red;
  329. }
  330. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  331. {
  332. boja = ConsoleColor.Yellow;
  333. }
  334. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  335. {
  336. boja = ConsoleColor.Green;
  337. }
  338. Console.ForegroundColor = boja;
  339. Console.Write("" + daMonsta.monsterHP + "");
  340. Console.ResetColor();
  341. Console.Write(" HP left! \n ");
  342. }
  343. if (actionChoice1.Key == ConsoleKey.D && monsterChoice1 == "Attack")
  344. {
  345. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  346. Console.Write("The monster swings and hits you, you have ");
  347. if (playa.currentHP >= 0 && playa.currentHP < 7)
  348. {
  349. boja = ConsoleColor.Red;
  350. }
  351. if (playa.currentHP >= 7 && playa.currentHP < 14)
  352. {
  353. boja = ConsoleColor.Yellow;
  354. }
  355. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  356. {
  357. boja = ConsoleColor.Green;
  358. }
  359. Console.ForegroundColor = boja;
  360. Console.Write("" + playa.currentHP + "");
  361. Console.ResetColor();
  362. Console.Write(" HP left! \n ");
  363. }
  364. if (actionChoice1.Key == ConsoleKey.D && monsterChoice1 == "Defense")
  365. {
  366. Console.Write("You slam your shields together, no one takes damage, you have ");
  367. if (playa.currentHP >= 0 && playa.currentHP < 7)
  368. {
  369. boja = ConsoleColor.Red;
  370. }
  371. if (playa.currentHP >= 7 && playa.currentHP < 14)
  372. {
  373. boja = ConsoleColor.Yellow;
  374. }
  375. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  376. {
  377. boja = ConsoleColor.Green;
  378. }
  379. Console.ForegroundColor = boja;
  380. Console.Write("" + playa.currentHP + "");
  381. Console.ResetColor();
  382. Console.Write(" HP left, your enemy has ");
  383. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  384. {
  385. boja = ConsoleColor.Red;
  386. }
  387. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  388. {
  389. boja = ConsoleColor.Yellow;
  390. }
  391. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  392. {
  393. boja = ConsoleColor.Green;
  394. }
  395. Console.ForegroundColor = boja;
  396. Console.Write("" + daMonsta.monsterHP + "");
  397. Console.ResetColor();
  398. Console.Write(" HP left! \n ");
  399. }
  400. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  401. {
  402. break;
  403. }
  404.  
  405. if (actionChoice2.Key == ConsoleKey.A && monsterChoice2 == "Attack")
  406. {
  407. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  408. {
  409. break;
  410. }
  411. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  412. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  413. Console.Write("You swing and hit each other, the monster has ");
  414. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  415. {
  416. boja = ConsoleColor.Red;
  417. }
  418. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  419. {
  420. boja = ConsoleColor.Yellow;
  421. }
  422. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  423. {
  424. boja = ConsoleColor.Green;
  425. }
  426. Console.ForegroundColor = boja;
  427. Console.Write("" + daMonsta.monsterHP + "");
  428. Console.ResetColor();
  429. Console.Write(" HP left, you have ");
  430. if (playa.currentHP >= 0 && playa.currentHP < 7)
  431. {
  432. boja = ConsoleColor.Red;
  433. }
  434. if (playa.currentHP >= 7 && playa.currentHP < 14)
  435. {
  436. boja = ConsoleColor.Yellow;
  437. }
  438. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  439. {
  440. boja = ConsoleColor.Green;
  441. }
  442. Console.ForegroundColor = boja;
  443. Console.Write("" + playa.currentHP + "");
  444. Console.ResetColor();
  445. Console.Write(" HP left! \n ");
  446. }
  447. if (actionChoice2.Key == ConsoleKey.A && monsterChoice2 == "Defense")
  448. {
  449. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  450. Console.Write("You swing and hit the monster, the monster has ");
  451. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  452. {
  453. boja = ConsoleColor.Red;
  454. }
  455. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  456. {
  457. boja = ConsoleColor.Yellow;
  458. }
  459. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  460. {
  461. boja = ConsoleColor.Green;
  462. }
  463. Console.ForegroundColor = boja;
  464. Console.Write("" + daMonsta.monsterHP + "");
  465. Console.ResetColor();
  466. Console.Write(" HP left! \n ");
  467. }
  468. if (actionChoice2.Key == ConsoleKey.D && monsterChoice2 == "Attack")
  469. {
  470. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  471. Console.Write("The monster swings and hits you, you have ");
  472. if (playa.currentHP >= 0 && playa.currentHP < 7)
  473. {
  474. boja = ConsoleColor.Red;
  475. }
  476. if (playa.currentHP >= 7 && playa.currentHP < 14)
  477. {
  478. boja = ConsoleColor.Yellow;
  479. }
  480. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  481. {
  482. boja = ConsoleColor.Green;
  483. }
  484. Console.ForegroundColor = boja;
  485. Console.Write("" + playa.currentHP + "");
  486. Console.ResetColor();
  487. Console.Write(" HP left! \n ");
  488. }
  489. if (actionChoice2.Key == ConsoleKey.D && monsterChoice2 == "Defense")
  490. {
  491. Console.Write("You slam your shields together, no one takes damage, you have ");
  492. if (playa.currentHP >= 0 && playa.currentHP < 7)
  493. {
  494. boja = ConsoleColor.Red;
  495. }
  496. if (playa.currentHP >= 7 && playa.currentHP < 14)
  497. {
  498. boja = ConsoleColor.Yellow;
  499. }
  500. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  501. {
  502. boja = ConsoleColor.Green;
  503. }
  504. Console.ForegroundColor = boja;
  505. Console.Write("" + playa.currentHP + "");
  506. Console.ResetColor();
  507. Console.Write(" HP left, your enemy has ");
  508. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  509. {
  510. boja = ConsoleColor.Red;
  511. }
  512. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  513. {
  514. boja = ConsoleColor.Yellow;
  515. }
  516. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  517. {
  518. boja = ConsoleColor.Green;
  519. }
  520. Console.ForegroundColor = boja;
  521. Console.Write("" + daMonsta.monsterHP + "");
  522. Console.ResetColor();
  523. Console.Write(" HP left! \n ");
  524. }
  525. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  526. {
  527. break;
  528. }
  529.  
  530. if (actionChoice3.Key == ConsoleKey.A && monsterChoice3 == "Attack")
  531. {
  532. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  533. {
  534. break;
  535. }
  536. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  537. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  538. Console.Write("You swing and hit each other, the monster has ");
  539. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  540. {
  541. boja = ConsoleColor.Red;
  542. }
  543. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  544. {
  545. boja = ConsoleColor.Yellow;
  546. }
  547. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  548. {
  549. boja = ConsoleColor.Green;
  550. }
  551. Console.ForegroundColor = boja;
  552. Console.Write("" + daMonsta.monsterHP + "");
  553. Console.ResetColor();
  554. Console.Write(" HP left, you have ");
  555. if (playa.currentHP >= 0 && playa.currentHP < 7)
  556. {
  557. boja = ConsoleColor.Red;
  558. }
  559. if (playa.currentHP >= 7 && playa.currentHP < 14)
  560. {
  561. boja = ConsoleColor.Yellow;
  562. }
  563. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  564. {
  565. boja = ConsoleColor.Green;
  566. }
  567. Console.ForegroundColor = boja;
  568. Console.Write("" + playa.currentHP + "");
  569. Console.ResetColor();
  570. Console.Write(" HP left! \n ");
  571. }
  572. if (actionChoice3.Key == ConsoleKey.A && monsterChoice3 == "Defense")
  573. {
  574. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  575. Console.Write("You swing and hit the monster, the monster has ");
  576. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  577. {
  578. boja = ConsoleColor.Red;
  579. }
  580. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  581. {
  582. boja = ConsoleColor.Yellow;
  583. }
  584. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  585. {
  586. boja = ConsoleColor.Green;
  587. }
  588. Console.ForegroundColor = boja;
  589. Console.Write("" + daMonsta.monsterHP + "");
  590. Console.ResetColor();
  591. Console.Write(" HP left! \n ");
  592. }
  593. if (actionChoice3.Key == ConsoleKey.D && monsterChoice3 == "Attack")
  594. {
  595. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  596. Console.Write("The monster swings and hits you, you have ");
  597. if (playa.currentHP >= 0 && playa.currentHP < 7)
  598. {
  599. boja = ConsoleColor.Red;
  600. }
  601. if (playa.currentHP >= 7 && playa.currentHP < 14)
  602. {
  603. boja = ConsoleColor.Yellow;
  604. }
  605. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  606. {
  607. boja = ConsoleColor.Green;
  608. }
  609. Console.ForegroundColor = boja;
  610. Console.Write("" + playa.currentHP + "");
  611. Console.ResetColor();
  612. Console.Write(" HP left! \n ");
  613. }
  614. if (actionChoice3.Key == ConsoleKey.D && monsterChoice3 == "Defense")
  615. {
  616. Console.WriteLine("You slam your shields together, no one takes damage, you have ");
  617. if (playa.currentHP >= 0 && playa.currentHP < 7)
  618. {
  619. boja = ConsoleColor.Red;
  620. }
  621. if (playa.currentHP >= 7 && playa.currentHP < 14)
  622. {
  623. boja = ConsoleColor.Yellow;
  624. }
  625. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  626. {
  627. boja = ConsoleColor.Green;
  628. }
  629. Console.ForegroundColor = boja;
  630. Console.Write("" + playa.currentHP + "");
  631. Console.ResetColor();
  632. Console.Write(" HP left, your enemy has ");
  633. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  634. {
  635. boja = ConsoleColor.Red;
  636. }
  637. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  638. {
  639. boja = ConsoleColor.Yellow;
  640. }
  641. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  642. {
  643. boja = ConsoleColor.Green;
  644. }
  645. Console.ForegroundColor = boja;
  646. Console.Write("" + daMonsta.monsterHP + "");
  647. Console.ResetColor();
  648. Console.Write(" HP left! \n ");
  649. }
  650. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  651. {
  652. break;
  653. }
  654. if (actionChoice3.Key == ConsoleKey.A && monsterChoice3 == "Attack")
  655. {
  656. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  657. {
  658. break;
  659. }
  660. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  661. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  662. Console.Write("You swing and hit each other, the monster has ");
  663. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  664. {
  665. boja = ConsoleColor.Red;
  666. }
  667. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  668. {
  669. boja = ConsoleColor.Yellow;
  670. }
  671. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  672. {
  673. boja = ConsoleColor.Green;
  674. }
  675. Console.ForegroundColor = boja;
  676. Console.Write("" + daMonsta.monsterHP + "");
  677. Console.ResetColor();
  678. Console.Write(" HP left, you have ");
  679. if (playa.currentHP >= 0 && playa.currentHP < 7)
  680. {
  681. boja = ConsoleColor.Red;
  682. }
  683. if (playa.currentHP >= 7 && playa.currentHP < 14)
  684. {
  685. boja = ConsoleColor.Yellow;
  686. }
  687. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  688. {
  689. boja = ConsoleColor.Green;
  690. }
  691. Console.ForegroundColor = boja;
  692. Console.Write("" + playa.currentHP + "");
  693. Console.ResetColor();
  694. Console.Write(" HP left! \n ");
  695. }
  696. if (actionChoice3.Key == ConsoleKey.A && monsterChoice3 == "Defense")
  697. {
  698. daMonsta.monsterHP = daMonsta.monsterHP - playa.attack;
  699. Console.Write("You swing and hit the monster, the monster has ");
  700. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  701. {
  702. boja = ConsoleColor.Red;
  703. }
  704. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  705. {
  706. boja = ConsoleColor.Yellow;
  707. }
  708. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  709. {
  710. boja = ConsoleColor.Green;
  711. }
  712. Console.ForegroundColor = boja;
  713. Console.Write("" + daMonsta.monsterHP + "");
  714. Console.ResetColor();
  715. Console.Write(" HP left! \n ");
  716. }
  717. if (actionChoice3.Key == ConsoleKey.D && monsterChoice3 == "Attack")
  718. {
  719. playa.currentHP = playa.currentHP - daItem.MaxDamage;
  720. Console.Write("The monster swings and hits you, you have ");
  721. if (playa.currentHP >= 0 && playa.currentHP < 7)
  722. {
  723. boja = ConsoleColor.Red;
  724. }
  725. if (playa.currentHP >= 7 && playa.currentHP < 14)
  726. {
  727. boja = ConsoleColor.Yellow;
  728. }
  729. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  730. {
  731. boja = ConsoleColor.Green;
  732. }
  733. Console.ForegroundColor = boja;
  734. Console.Write("" + playa.currentHP + "");
  735. Console.ResetColor();
  736. Console.Write(" HP left! \n ");
  737. }
  738. if (actionChoice3.Key == ConsoleKey.D && monsterChoice3 == "Defense")
  739. {
  740. Console.Write("You slam your shields together, no one takes damage, you have ");
  741. if (playa.currentHP >= 0 && playa.currentHP < 7)
  742. {
  743. boja = ConsoleColor.Red;
  744. }
  745. if (playa.currentHP >= 7 && playa.currentHP < 14)
  746. {
  747. boja = ConsoleColor.Yellow;
  748. }
  749. if (playa.currentHP >= 14 && playa.currentHP <= 20)
  750. {
  751. boja = ConsoleColor.Green;
  752. }
  753. Console.ForegroundColor = boja;
  754. Console.Write("" + playa.currentHP + "");
  755. Console.ResetColor();
  756. Console.Write(" HP left, your enemy has ");
  757. if (daMonsta.monsterHP >= 0 && daMonsta.monsterHP < 7)
  758. {
  759. boja = ConsoleColor.Red;
  760. }
  761. if (daMonsta.monsterHP >= 7 && daMonsta.monsterHP < 14)
  762. {
  763. boja = ConsoleColor.Yellow;
  764. }
  765. if (daMonsta.monsterHP >= 14 && daMonsta.monsterHP <= 20)
  766. {
  767. boja = ConsoleColor.Green;
  768. }
  769. Console.ForegroundColor = boja;
  770. Console.Write("" + daMonsta.monsterHP + "");
  771. Console.ResetColor();
  772. Console.Write(" HP left! \n ");
  773. }
  774. if (daMonsta.monsterHP <= 0 || playa.currentHP <= 0)
  775. {
  776. break;
  777. }
  778.  
  779. }
  780.  
  781. if (daMonsta.monsterHP <= 0)
  782. {
  783. Console.WriteLine("You killed the monster, good job! \n ");
  784. }
  785. else if (playa.currentHP <= 0)
  786. {
  787. Console.WriteLine("The monster killed you, go in the corner and be ashamed of yourself... \n ");
  788. }
  789.  
  790.  
  791.  
  792. Console.ReadKey();
  793.  
  794. }
  795.  
  796. }
  797. }
  798. class Player
  799. {
  800. public Player()
  801. {
  802. charName();
  803. RaceChoice();
  804. playerAttack();
  805. playerDefense();
  806. playerCurrentHP();
  807. playerMaxHP();
  808.  
  809. }
  810.  
  811. public string name;
  812. public int raceChoice;
  813. public string race;
  814. public int attack;
  815. public int defense;
  816. public int currentHP;
  817. public int maxHP;
  818.  
  819.  
  820. private void charName()
  821. {
  822. name = Console.ReadLine();
  823. }
  824.  
  825.  
  826. private void RaceChoice()
  827. {
  828. Console.WriteLine("Which race is your Hero going to be : [1] Human ");
  829. Console.WriteLine(" [2] Elf ");
  830. Console.WriteLine(" [3] Dwarf ");
  831. Console.WriteLine(" [4] Orc");
  832.  
  833. raceChoice = int.Parse(Console.ReadLine());
  834.  
  835. if (raceChoice == 1)
  836. race = " Human";
  837.  
  838. if (raceChoice == 2)
  839. race = " Elf";
  840.  
  841. if (raceChoice == 3)
  842. race = " Dwarf";
  843.  
  844. if (raceChoice == 4)
  845. race = " Orc";
  846. }
  847.  
  848. private void playerAttack()
  849. {
  850. if (race == " Human")
  851. attack = 3;
  852.  
  853. if (race == " Elf")
  854. attack = 2;
  855.  
  856. if (race == " Dwarf")
  857. attack = 3;
  858.  
  859. if (race == " Orc")
  860. attack = 4;
  861.  
  862. }
  863.  
  864. private void playerDefense()
  865. {
  866. if (race == " Human")
  867. {
  868. defense = 2;
  869. }
  870. if (race == " Elf")
  871. {
  872. defense = 1;
  873. }
  874. if (race == " Dwarf")
  875. {
  876. defense = 3;
  877. }
  878. if (race == " Orc")
  879. {
  880. defense = 3;
  881. }
  882. }
  883.  
  884. private void playerCurrentHP()
  885. {
  886. if (race == " Human")
  887. {
  888. currentHP = 20;
  889. }
  890. if (race == " Elf")
  891. {
  892. currentHP = 20;
  893. }
  894. if (race == " Dwarf")
  895. {
  896. currentHP = 20;
  897. }
  898. if (race == " Orc")
  899. {
  900. currentHP = 20;
  901. }
  902. }
  903.  
  904. private void playerMaxHP()
  905. {
  906. if (race == " Human")
  907. {
  908. maxHP = 20;
  909. }
  910. if (race == " Elf")
  911. {
  912. maxHP = 20;
  913. }
  914. if (race == " Dwarf")
  915. {
  916. maxHP = 20;
  917. }
  918. if (race == " Orc")
  919. {
  920. maxHP = 20;
  921. }
  922. }
  923. }
  924.  
  925. /* Monsta daMonsta = new Monsta();
  926. Item forMonsta = new Item();
  927. Armor defMonsta = new Armor();
  928. Console.WriteLine(daMonsta.Race + "" + daMonsta.Class + "" + " has " + forMonsta.Rarity + " " + forMonsta.Type + "" + " with damage (" + forMonsta.MinDamage + " - " + forMonsta.MaxDamage + ") " + "wearing" + defMonsta.armorType + "" + " with def. rating of " + defMonsta.armorDef + "!");
  929. if (forMonsta.Rarity == "Common")
  930. Console.ForegroundColor = ConsoleColor.White;
  931. if (forMonsta.Rarity == "Uncommon")
  932. Console.ForegroundColor = ConsoleColor.Green;
  933. if (forMonsta.Rarity == "Rare")
  934. Console.ForegroundColor = ConsoleColor.Blue;
  935. if (forMonsta.Rarity == "Epic")
  936. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  937. if (forMonsta.Rarity == "Legendary")
  938. Console.ForegroundColor = ConsoleColor.Yellow;
  939.  
  940. }
  941. }
  942. }
  943.  
  944. static void GetInput()
  945. {
  946. Console.WriteLine("How much monsters do you want to summon? ");
  947. PlayerChoice = int.Parse(Console.ReadLine());
  948. Console.Clear();
  949. } */
  950.  
  951. class Monsta
  952. {
  953. public static Random gener = new Random();
  954.  
  955. public string Race;
  956. public string Class;
  957. public int monsterHP;
  958. public int curentMonsHP;
  959.  
  960. public Monsta()
  961. {
  962. GenerateRace();
  963. GenerateClass();
  964. MonsterHP();
  965. MonsterCurrentHP();
  966. }
  967.  
  968. private void GenerateRace()
  969. {
  970. int _race = gener.Next(1, 340);
  971.  
  972. if (_race >= 1 && _race < 30)
  973. Race = "Gnome";
  974. if (_race >= 30 && _race < 60)
  975. Race = "Gremlin";
  976. if (_race >= 60 && _race < 90)
  977. Race = "Imp";
  978. if (_race >= 90 && _race < 120)
  979. Race = "Kobold";
  980. if (_race >= 120 && _race < 150)
  981. Race = "Incubus";
  982. if (_race >= 150 && _race < 165)
  983. Race = "Succubus";
  984. if (_race >= 165 && _race < 180)
  985. Race = "Goblin";
  986. if (_race >= 180 && _race < 195)
  987. Race = "Gorgon";
  988. if (_race >= 195 && _race < 205)
  989. Race = "Lamia";
  990. if (_race >= 205 && _race < 215)
  991. Race = "Troll";
  992. if (_race >= 215 && _race < 225)
  993. Race = "Siren";
  994. if (_race >= 225 && _race < 235)
  995. Race = "Ogre";
  996. if (_race >= 235 && _race < 245)
  997. Race = "Orc";
  998. if (_race >= 245 && _race < 249)
  999. Race = "Ent";
  1000. if (_race >= 249 && _race < 259)
  1001. Race = "Dryad";
  1002. if (_race >= 259 && _race < 275)
  1003. Race = "Rusalka";
  1004. if (_race >= 275 && _race < 295)
  1005. Race = "Ghoul";
  1006. if (_race >= 295 && _race < 310)
  1007. Race = "Gargoyle";
  1008. if (_race >= 310 && _race < 315)
  1009. Race = "Hydra";
  1010. if (_race >= 315 && _race < 322)
  1011. Race = "Demons";
  1012. if (_race >= 322 && _race < 330)
  1013. Race = "Werewolf";
  1014. if (_race >= 330 && _race < 336)
  1015. Race = "Vampire";
  1016. if (_race >= 336 && _race < 339)
  1017. Race = "Dragonling";
  1018. if (_race >= 339 && _race < 340)
  1019. Race = "Dragon";
  1020. }
  1021.  
  1022. private void GenerateClass()
  1023. {
  1024. int _class = gener.Next(1, 100);
  1025.  
  1026. if (_class >= 1 && _class <= 9)
  1027. Class = " Rogue";
  1028. if (_class >= 9 && _class <= 18)
  1029. Class = " Warrior";
  1030. if (_class >= 18 && _class <= 25)
  1031. Class = " Paladin";
  1032. if (_class >= 25 && _class <= 45)
  1033. Class = " Hunter";
  1034. if (_class >= 45 && _class <= 55)
  1035. Class = " Priest";
  1036. if (_class >= 55 && _class <= 61)
  1037. Class = " Mage";
  1038. if (_class >= 61 && _class <= 67)
  1039. Class = " Summoner";
  1040. if (_class >= 67 && _class <= 71)
  1041. Class = " Necromancer";
  1042. if (_class >= 71 && _class <= 76)
  1043. Class = " Knight";
  1044. if (_class >= 76 && _class <= 99)
  1045. Class = " Peasant";
  1046. if (_class == 100)
  1047. Class = " Vegan Feminist Progressive Hipster";
  1048. }
  1049.  
  1050. private void MonsterHP()
  1051. {
  1052. if (Race == "Gnome")
  1053. {
  1054. monsterHP = 10;
  1055. }
  1056. if (Race == "Gremlin")
  1057. {
  1058. monsterHP = 10;
  1059. }
  1060. if (Race == "Imp")
  1061. {
  1062. monsterHP = 10;
  1063. }
  1064. if (Race == "Kobold")
  1065. {
  1066. monsterHP = 10;
  1067. }
  1068. if (Race == "Incubus")
  1069. {
  1070. monsterHP = 12;
  1071. }
  1072. if (Race == "Succubus")
  1073. {
  1074. monsterHP = 12;
  1075. }
  1076. if (Race == "Goblin")
  1077. {
  1078. monsterHP = 13;
  1079. }
  1080. if (Race == "Gorgon")
  1081. {
  1082. monsterHP = 13;
  1083. }
  1084. if (Race == "Lamia")
  1085. {
  1086. monsterHP = 14;
  1087. }
  1088. if (Race == "Troll")
  1089. {
  1090. monsterHP = 14;
  1091. }
  1092. if (Race == "Siren")
  1093. {
  1094. monsterHP = 15;
  1095. }
  1096. if (Race == "Ogre")
  1097. {
  1098. monsterHP = 15;
  1099. }
  1100. if (Race == "Orc")
  1101. {
  1102. monsterHP = 14;
  1103. }
  1104. if (Race == "Ent")
  1105. {
  1106. monsterHP = 20;
  1107. }
  1108. if (Race == "Dryad")
  1109. {
  1110. monsterHP = 16;
  1111. }
  1112. if (Race == "Rusalka")
  1113. {
  1114. monsterHP = 16;
  1115. }
  1116. if (Race == "Ghoul")
  1117. {
  1118. monsterHP = 17;
  1119. }
  1120. if (Race == "Gargoyle")
  1121. {
  1122. monsterHP = 16;
  1123. }
  1124. if (Race == "Hydra")
  1125. {
  1126. monsterHP = 18;
  1127. }
  1128. if (Race == "Demon")
  1129. {
  1130. monsterHP = 20;
  1131. }
  1132. if (Race == "Werewolf")
  1133. {
  1134. monsterHP = 16;
  1135. }
  1136. if (Race == "Vampire")
  1137. {
  1138. monsterHP = 15;
  1139. }
  1140. if (Race == "Dragonling")
  1141. {
  1142. monsterHP = 19;
  1143. }
  1144. if (Race == "Dragon")
  1145. {
  1146. monsterHP = 20;
  1147. }
  1148. }
  1149.  
  1150. private void MonsterCurrentHP()
  1151. {
  1152. if (Race == "Gnome")
  1153. {
  1154. curentMonsHP = 10;
  1155. }
  1156. if (Race == "Gremlin")
  1157. {
  1158. curentMonsHP = 10;
  1159. }
  1160. if (Race == "Imp")
  1161. {
  1162. curentMonsHP = 10;
  1163. }
  1164. if (Race == "Kobold")
  1165. {
  1166. curentMonsHP = 10;
  1167. }
  1168. if (Race == "Incubus")
  1169. {
  1170. curentMonsHP = 12;
  1171. }
  1172. if (Race == "Succubus")
  1173. {
  1174. curentMonsHP = 12;
  1175. }
  1176. if (Race == "Goblin")
  1177. {
  1178. curentMonsHP = 13;
  1179. }
  1180. if (Race == "Gorgon")
  1181. {
  1182. curentMonsHP = 13;
  1183. }
  1184. if (Race == "Lamia")
  1185. {
  1186. curentMonsHP = 14;
  1187. }
  1188. if (Race == "Troll")
  1189. {
  1190. curentMonsHP = 14;
  1191. }
  1192. if (Race == "Siren")
  1193. {
  1194. curentMonsHP = 15;
  1195. }
  1196. if (Race == "Ogre")
  1197. {
  1198. curentMonsHP = 15;
  1199. }
  1200. if (Race == "Orc")
  1201. {
  1202. curentMonsHP = 14;
  1203. }
  1204. if (Race == "Ent")
  1205. {
  1206. curentMonsHP = 20;
  1207. }
  1208. if (Race == "Dryad")
  1209. {
  1210. curentMonsHP = 16;
  1211. }
  1212. if (Race == "Rusalka")
  1213. {
  1214. curentMonsHP = 16;
  1215. }
  1216. if (Race == "Ghoul")
  1217. {
  1218. curentMonsHP = 17;
  1219. }
  1220. if (Race == "Gargoyle")
  1221. {
  1222. curentMonsHP = 16;
  1223. }
  1224. if (Race == "Hydra")
  1225. {
  1226. curentMonsHP = 18;
  1227. }
  1228. if (Race == "Demon")
  1229. {
  1230. curentMonsHP = 20;
  1231. }
  1232. if (Race == "Werewolf")
  1233. {
  1234. curentMonsHP = 16;
  1235. }
  1236. if (Race == "Vampire")
  1237. {
  1238. curentMonsHP = 15;
  1239. }
  1240. if (Race == "Dragonling")
  1241. {
  1242. curentMonsHP = 19;
  1243. }
  1244. if (Race == "Dragon")
  1245. {
  1246. curentMonsHP = 20;
  1247. }
  1248. }
  1249. }
  1250.  
  1251. class Item
  1252. {
  1253. private static Random _randomGenarator = new Random();
  1254.  
  1255. public Item()
  1256. {
  1257. GenerateType();
  1258. GenerateRarity();
  1259. GenerateMinDamage();
  1260. GenerateMaxDamage();
  1261. GenerateValue();
  1262. }
  1263.  
  1264. public string Type;
  1265. public string Rarity;
  1266. public int MinDamage;
  1267. public int MaxDamage;
  1268. public int Value;
  1269.  
  1270. private void GenerateType()
  1271. {
  1272. int _type = _randomGenarator.Next(1, 11);
  1273.  
  1274. if (_type == 1)
  1275. this.Type = "Sword";
  1276. if (_type == 2)
  1277. this.Type = "Flail";
  1278. if (_type == 3)
  1279. this.Type = "Bow";
  1280. if (_type == 4)
  1281. this.Type = "Mace";
  1282. if (_type == 5)
  1283. this.Type = "Spear";
  1284. if (_type == 6)
  1285. this.Type = "Axe";
  1286. if (_type == 7)
  1287. this.Type = "Dagger";
  1288. if (_type == 8)
  1289. this.Type = "Whip";
  1290. if (_type == 9)
  1291. this.Type = "Warhammer";
  1292. if (_type == 10)
  1293. this.Type = "Glaive";
  1294. }
  1295.  
  1296. private void GenerateRarity()
  1297. {
  1298. int rarityIndex = _randomGenarator.Next(1, 1001);
  1299. if (rarityIndex >= 1 && rarityIndex < 800)
  1300. {
  1301. this.Rarity = "Common";
  1302. }
  1303. if (rarityIndex >= 800 && rarityIndex < 920)
  1304. {
  1305. this.Rarity = "Uncommon";
  1306. }
  1307. if (rarityIndex >= 920 && rarityIndex < 985)
  1308. {
  1309. this.Rarity = "Rare";
  1310. }
  1311. if (rarityIndex >= 985 && rarityIndex < 997)
  1312. {
  1313. this.Rarity = "Epic";
  1314. }
  1315. if (rarityIndex >= 997 && rarityIndex <= 1000)
  1316. {
  1317. this.Rarity = "Legendary";
  1318. }
  1319. }
  1320.  
  1321. private void GenerateMinDamage()
  1322. {
  1323. if (this.Rarity == "Common")
  1324. {
  1325. this.MinDamage = _randomGenarator.Next(1, 3);
  1326. }
  1327. if (this.Rarity == "Uncommon")
  1328. {
  1329. this.MinDamage = _randomGenarator.Next(2, 5);
  1330. }
  1331. if (this.Rarity == "Rare")
  1332. {
  1333. this.MinDamage = _randomGenarator.Next(3, 7);
  1334. }
  1335. if (this.Rarity == "Epic")
  1336. {
  1337. this.MinDamage = _randomGenarator.Next(5, 11);
  1338. }
  1339. if (this.Rarity == "Legendary")
  1340. {
  1341. this.MinDamage = _randomGenarator.Next(7, 14);
  1342. }
  1343.  
  1344. }
  1345.  
  1346. private void GenerateMaxDamage()
  1347. {
  1348. if (this.Rarity == "Common")
  1349. {
  1350. this.MaxDamage = _randomGenarator.Next(2, 4);
  1351. }
  1352. if (this.Rarity == "Uncommon")
  1353. {
  1354. this.MaxDamage = _randomGenarator.Next(3, 6);
  1355. }
  1356. if (this.Rarity == "Rare")
  1357. {
  1358. this.MaxDamage = _randomGenarator.Next(5, 10);
  1359. }
  1360. if (this.Rarity == "Epic")
  1361. {
  1362. this.MaxDamage = _randomGenarator.Next(7, 13);
  1363. }
  1364. if (this.Rarity == "Legendary")
  1365. {
  1366. this.MaxDamage = _randomGenarator.Next(11, 17);
  1367. }
  1368. }
  1369.  
  1370. private void GenerateValue()
  1371. {
  1372. if (this.Rarity == "Common")
  1373. {
  1374. this.Value = 5 + _randomGenarator.Next(1, 25);
  1375. }
  1376. if (this.Rarity == "Uncommon")
  1377. {
  1378. this.Value = 30 + _randomGenarator.Next(1, 70);
  1379. }
  1380. if (this.Rarity == "Rare")
  1381. {
  1382. this.Value = 100 + _randomGenarator.Next(1, 100);
  1383. }
  1384. if (this.Rarity == "Epic")
  1385. {
  1386. this.Value = 200 + _randomGenarator.Next(1, 800);
  1387. }
  1388. if (this.Rarity == "Legendary")
  1389. {
  1390. this.Value = 1000 + _randomGenarator.Next(1, 1001);
  1391. }
  1392. }
  1393. }
  1394.  
  1395. class Armor
  1396. {
  1397. private static Random gener = new Random();
  1398.  
  1399. public Armor()
  1400. {
  1401. GenArmorType();
  1402. GenArmorDef();
  1403. }
  1404.  
  1405. public string armorType;
  1406. public int armorDef;
  1407.  
  1408. private void GenArmorType()
  1409. {
  1410. int armorIndex = gener.Next(1, 101);
  1411.  
  1412. if (armorIndex >= 1 && armorIndex <= 40)
  1413. {
  1414. armorType = " Leather Armor";
  1415. }
  1416.  
  1417. if (armorIndex >= 40 && armorIndex <= 68)
  1418. {
  1419. armorType = " Std. Leather Armor";
  1420. }
  1421.  
  1422. if (armorIndex >= 68 && armorIndex <= 83)
  1423. {
  1424. armorType = " Scale Armor";
  1425. }
  1426.  
  1427. if (armorIndex >= 83 && armorIndex <= 93)
  1428. {
  1429. armorType = " Mail Armor";
  1430. }
  1431.  
  1432. if (armorIndex >= 93 && armorIndex <= 98)
  1433. {
  1434. armorType = " Plate Armor";
  1435. }
  1436.  
  1437. if (armorIndex >= 98 && armorIndex <= 100)
  1438. {
  1439. armorType = " Full Plate Armor";
  1440. }
  1441.  
  1442. }
  1443.  
  1444. private void GenArmorDef()
  1445. {
  1446. if (armorType == " Leather Armor")
  1447. {
  1448. this.armorDef = gener.Next(1, 2);
  1449. }
  1450.  
  1451. if (armorType == " Std.Leather Armor")
  1452. {
  1453. armorDef = gener.Next(3, 4);
  1454. }
  1455.  
  1456. if (armorType == " Scale Armor")
  1457. {
  1458. armorDef = gener.Next(7, 8);
  1459. }
  1460.  
  1461. if (armorType == " Mail Armor")
  1462. {
  1463. armorDef = gener.Next(9, 10);
  1464. }
  1465.  
  1466. if (armorType == " Plate Armor")
  1467. {
  1468. armorDef = gener.Next(12, 13);
  1469. }
  1470.  
  1471. if (armorType == " Full Plate Armor")
  1472. {
  1473. armorDef = gener.Next(19, 20);
  1474. }
  1475. }
  1476.  
  1477.  
  1478.  
  1479. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement