Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.78 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4.  
  5. void damageTurn(char *cPokemonName1,char *cPokemonName2,char *c1stName,char *c2ndName,
  6. char *sAttack1,char *sAttack2,char *sAttack3,char *sAttack4,
  7. char sType1,char sType2,char cAT1,char cAT2,
  8. int nAbp1,int nApp1,int nAbp2,int nApp2,int nApp3,int nApp4,int nP1hp,int nP1Uhp,
  9. char *s2Attack1,char *s2Attack2,char *s2Attack3,char *s2Attack4,
  10. char s2Type1,char s2Type2,char c2AT1,char c2AT2,
  11. int n2Abp1,int n2App1,int n2Abp2,int n2App2,int n2App3,int n2App4,int nP2hp,int nP2Uhp,char cChoice1,char cChoice2)
  12. {
  13. int nY = 0;
  14. int n2Y = 0;
  15. switch (cChoice1){
  16. case 'a':
  17. if (nApp1!=0){
  18. if(cAT1=='f'){
  19. if(cChoice2=='c'){
  20. nP2Uhp;
  21. }
  22. else if(cChoice2!='c'){
  23. if(s2Type1=='F' || s2Type1=='W' || s2Type1=='G' || s2Type2=='F' || s2Type2=='W' || s2Type2=='G'){
  24. nP2Uhp = nP2Uhp-nAbp1/2;
  25. nApp1 = nApp1 -1;
  26. }
  27. else if(s2Type1=='L' || s2Type1=='I' || s2Type2=='L' || s2Type2=='I'){
  28. nP2Uhp = nP2Uhp-nAbp1*2;
  29. nApp1 = nApp1 -1;
  30. }
  31. else if(s2Type1=='E' || s2Type2=='E'){
  32. nP2Uhp = nP2Uhp-nAbp1;
  33. nApp1 = nApp1 -1;
  34. }
  35. }
  36. nY=0;
  37. }
  38. if(cAT1=='w'){
  39. if(cChoice2=='c'){
  40. nP2Uhp;
  41. }
  42. else if(cChoice2!='c'){
  43. if(s2Type1=='W' || s2Type1=='L' || s2Type2=='W' || s2Type2=='L'){
  44. nP2Uhp = nP2Uhp-nAbp1/2;
  45. nApp1 = nApp1 -1;
  46. }
  47. else if(s2Type1=='F' || s2Type1=='G' || s2Type2=='F' || s2Type2=='G'){
  48. nP2Uhp = nP2Uhp-nAbp1*2;
  49. nApp1 = nApp1 -1;
  50. }
  51. else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='E' || s2Type2=='I'){
  52. nP2Uhp = nP2Uhp-nAbp1;
  53. nApp1 = nApp1 -1;
  54. }
  55. }
  56. nY=0;
  57. }
  58. if(cAT1=='e'){
  59. if(cChoice2=='c'){
  60. nP2Uhp;
  61. }
  62. else if(cChoice2!='c'){
  63. if(s2Type1=='L' || s2Type2=='L'){
  64. nP2Uhp = nP2Uhp-nAbp1/2;
  65. nApp1 = nApp1 -1;
  66. }
  67. else if(s2Type1=='W' || s2Type2=='W'){
  68. nP2Uhp = nP2Uhp-nAbp1*2;
  69. nApp1 = nApp1 -1;
  70. }
  71. else if(s2Type1=='E' || s2Type1=='F' || s2Type1=='I' || s2Type2=='F' || s2Type2=='E' || s2Type2=='I'){
  72. nP2Uhp = nP2Uhp-nAbp1;
  73. nApp1 = nApp1 -1;
  74. }
  75. else if(s2Type1=='G' || s2Type2=='G'){
  76. nP2Uhp;
  77. }
  78. }
  79. nY=0;
  80. }
  81. if(cAT1=='g'){
  82. if(cChoice2=='c'){
  83. nP2Uhp;
  84. }
  85. else if(cChoice2!='c'){
  86. if(s2Type1=='W' || s2Type1=='L' || s2Type1=='I' || s2Type2=='W' || s2Type2=='L'|| s2Type2=='I'){
  87. nP2Uhp = nP2Uhp-nAbp1/2;
  88. nApp1 = nApp1 -1;
  89. }
  90. else if(s2Type1=='F' || s2Type1=='E' || s2Type2=='F' || s2Type2=='E'){
  91. nP2Uhp = nP2Uhp-nAbp1*2;
  92. nApp1 = nApp1 -1;
  93. }
  94. else if(s2Type1=='G' || s2Type2=='G'){
  95. nP2Uhp = nP2Uhp-nAbp1;
  96. nApp1 = nApp1 -1;
  97. }
  98. }
  99. nY=0;
  100. }
  101. if(cAT1=='i'){
  102. if(cChoice2=='c'){
  103. nP2Uhp;
  104. }
  105. else if(cChoice2!='c'){
  106. if(s2Type1=='F' || s2Type2=='F'){
  107. nP2Uhp = nP2Uhp-nAbp1/2;
  108. nApp1 = nApp1 -1;
  109. }
  110. else if(s2Type1=='W' || s2Type1=='L' || s2Type1=='G' || s2Type2=='G' || s2Type2=='W' || s2Type2=='L'){
  111. nP2Uhp = nP2Uhp-nAbp1*2;
  112. nApp1 = nApp1 -1;
  113. }
  114. else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='I'|| s2Type2=='E'){
  115. nP2Uhp = nP2Uhp-nAbp1;
  116. nApp1 = nApp1 -1;
  117. }
  118. }
  119. nY=0;
  120. }
  121. }
  122. if(nApp1==0){
  123. nApp1=0;
  124. }
  125. break;
  126. case 'b':
  127. if (nApp2!=0){
  128. if(cAT2=='f'){
  129. if(cChoice2=='c'){
  130. nP2Uhp = nP2Uhp;
  131. }
  132. else if(cChoice2!='c'){
  133. if(s2Type1=='F' || s2Type1=='W' || s2Type1=='G' || s2Type2=='F' || s2Type2=='W' || s2Type2=='G'){
  134. nP2Uhp = nP2Uhp-nAbp2/2;
  135. nApp2 = nApp2 -1;
  136. }
  137. else if(s2Type1=='L' || s2Type1=='I' || s2Type2=='L' || s2Type2=='I'){
  138. nP2Uhp = nP2Uhp-nAbp2*2;
  139. nApp2 = nApp2 -1;
  140. }
  141. else if(s2Type1=='E' || s2Type2=='E'){
  142. nP2Uhp = nP2Uhp-nAbp2;
  143. nApp2 = nApp2 -1;
  144. }
  145. }
  146. nY=0;
  147. }
  148. if(cAT2=='w'){
  149. if(cChoice2=='c'){
  150. nP2Uhp = nP2Uhp;
  151. }
  152. else if(cChoice2!='c'){
  153. if(s2Type1=='W' || s2Type1=='L' || s2Type2=='W' || s2Type2=='L'){
  154. nP2Uhp = nP2Uhp-nAbp2/2;
  155. nApp2 = nApp2 -1;
  156. }
  157. else if(s2Type1=='F' || s2Type1=='G' || s2Type2=='F' || s2Type2=='G'){
  158. nP2Uhp = nP2Uhp-nAbp2*2;
  159. nApp2 = nApp2 -1;
  160. }
  161. else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='E' || s2Type2=='I'){
  162. nP2Uhp = nP2Uhp-nAbp2;
  163. nApp2 = nApp2 -1;
  164. }
  165. }
  166. nY=0;
  167. }
  168. if(cAT2=='e'){
  169. if(cChoice2=='c'){
  170. nP2Uhp = nP2Uhp ;
  171. }
  172. else if(cChoice2!='c'){
  173. if(s2Type1=='L' || s2Type2=='L'){
  174. nP2Uhp = nP2Uhp-nAbp2/2;
  175. nApp2 = nApp2 -1;
  176. }
  177. else if(s2Type1=='W' || s2Type2=='W'){
  178. nP2Uhp = nP2Uhp-nAbp2*2;
  179. nApp2 = nApp2 -1;
  180. }
  181. else if(s2Type1=='E' || s2Type1=='F' || s2Type1=='I' || s2Type2=='F' || s2Type2=='E' || s2Type2=='I'){
  182. nP2Uhp = nP2Uhp-nAbp2;
  183. nApp2 = nApp2 -1;
  184. }
  185. else if(s2Type1=='G' || s2Type2=='G'){
  186. nP2Uhp;
  187. }
  188. }
  189. nY=0;
  190. }
  191. if(cAT2=='g'){
  192. if(cChoice2=='c'){
  193. nP2Uhp = nP2Uhp;
  194. }
  195. else if(cChoice2!='c'){
  196. if(s2Type1=='W' || s2Type1=='L' || s2Type1=='I' || s2Type2=='W' || s2Type2=='L'|| s2Type2=='I'){
  197. nP2Uhp = nP2Uhp-nAbp2/2;
  198. nApp2 = nApp2 -1;
  199. }
  200. else if(s2Type1=='F' || s2Type1=='E' || s2Type2=='F' || s2Type2=='E'){
  201. nP2Uhp = nP2Uhp-nAbp2*2;
  202. nApp2 = nApp2 -1;
  203. }
  204. else if(s2Type1=='G' || s2Type2=='G'){
  205. nP2Uhp = nP2Uhp-nAbp2;
  206. nApp2 = nApp2 -1;
  207. }
  208. }
  209. nY=0;
  210. }
  211. if(cAT2=='i'){
  212. if(cChoice2=='c'){
  213. nP2Uhp = nP2Uhp;
  214. }
  215. else if(cChoice2!='c'){
  216. if(s2Type1=='F' || s2Type2=='F'){
  217. nP2Uhp = nP2Uhp-nAbp2/2;
  218. nApp2 = nApp2 -1;
  219. }
  220. else if(s2Type1=='W' || s2Type1=='L' || s2Type1=='G' || s2Type2=='G' || s2Type2=='W' || s2Type2=='L'){
  221. nP2Uhp = nP2Uhp-nAbp2*2;
  222. nApp2 = nApp2 -1;
  223. }
  224. else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='I'|| s2Type2=='E'){
  225. nP2Uhp = nP2Uhp-nAbp1;
  226. nApp2 = nApp2 -1;
  227. }
  228. }
  229. nY=0;
  230. }
  231. if(cAT2=='l'){
  232. if(cChoice2=='c'){
  233. nP2Uhp = nP2Uhp;
  234. }
  235. else if(cChoice2!='c'){
  236. if(s2Type1=='F' || s2Type2=='F'|| s2Type1=='L' || s2Type2=='L'){
  237. nP2Uhp = nP2Uhp-nAbp2/2;
  238. nApp2 = nApp2 -1;
  239. }
  240. else if(s2Type1=='W' || s2Type1=='G' || s2Type2=='G' || s2Type2=='W'){
  241. nP2Uhp = nP2Uhp-nAbp2*2;
  242. nApp2 = nApp2 -1;
  243. }
  244. else if(s2Type1=='E' || s2Type2=='I' || s2Type1=='E' || s2Type2=='I'){
  245. nP2Uhp;
  246. }
  247. }
  248. nY=0;
  249. }
  250. }
  251. if(nApp2==0){
  252. nApp2=0;
  253. }
  254. break;
  255. case 'c':
  256. if(nApp3!=0){
  257. nApp3 = nApp3-1;
  258. }
  259. if(nApp3==0){
  260. nApp3=0;
  261. }
  262. break;
  263. case 'd':
  264. if(nY==0){
  265. if(nApp4!=0){
  266. nApp4 = nApp4-1;
  267. nAbp1 = nAbp1*2;
  268. nAbp2 = nAbp2*2;
  269. nY=1;
  270. }
  271. if(nApp4==0){
  272. nApp4=0;
  273. }
  274. }
  275. if(nY==1){
  276. }
  277. break;
  278. }
  279. switch (cChoice2){
  280. case 'a':
  281. if (n2App1!=0){
  282. if(c2AT1=='f'){
  283. if(cChoice1=='c'){
  284. nP1Uhp;
  285. }
  286. else if(cChoice1!='c'){
  287. if(sType1=='F' || sType1=='W' || sType1=='G' || sType2=='F' || sType2=='W' || sType2=='G'){
  288. nP1Uhp = nP1Uhp-n2Abp1/2;
  289. n2App1 = n2App1 -1;
  290. }
  291. else if(sType1=='L' || sType1=='I' || sType2=='L' || sType2=='I'){
  292. nP1Uhp = nP1Uhp-n2Abp1*2;
  293. n2App1 = n2App1 -1;
  294. }
  295. else if(sType1=='E' || sType2=='E'){
  296. nP1Uhp = nP1Uhp-n2Abp1;
  297. n2App1 = n2App1 -1;
  298. }
  299. }
  300. n2Y=0;
  301. }
  302. if(c2AT1=='w'){
  303. if(cChoice1=='c'){
  304. nP1Uhp;
  305. }
  306. else if(cChoice1!='c'){
  307. if(sType1=='W' || sType1=='L' || sType2=='W' || sType2=='L'){
  308. nP1Uhp = nP1Uhp-n2Abp1/2;
  309. n2App1 = n2App1 -1;
  310. }
  311. else if(sType1=='F' || sType1=='G' || sType2=='F' || sType2=='G'){
  312. nP1Uhp = nP1Uhp-n2Abp1*2;
  313. n2App1 = n2App1 -1;
  314. }
  315. else if(sType1=='E' || sType1=='I' || sType2=='E' || sType2=='I'){
  316. nP1Uhp = nP1Uhp-n2Abp1;
  317. n2App1 = n2App1 -1;
  318. }
  319. }
  320. n2Y=0;
  321. }
  322. if(c2AT1=='e'){
  323. if(cChoice1=='c'){
  324. nP2Uhp;
  325. }
  326. else if(cChoice1!='c'){
  327. if(sType1=='L' || sType2=='L'){
  328. nP1Uhp = nP1Uhp-n2Abp1/2;
  329. n2App1 = n2App1 -1;
  330. }
  331. else if(sType1=='W' || sType2=='W'){
  332. nP1Uhp = nP1Uhp-n2Abp1*2;
  333. n2App1 = n2App1 -1;
  334. }
  335. else if(sType1=='E' || sType1=='F' || sType1=='I' || sType2=='F' || sType2=='E' || sType2=='I'){
  336. nP1Uhp = nP1Uhp-n2Abp1;
  337. n2App1 = n2App1 -1;
  338. }
  339. else if(sType1=='G' || sType2=='G'){
  340. nP1Uhp;
  341. }
  342. }
  343. n2Y=0;
  344. }
  345. if(c2AT1=='g'){
  346. if(cChoice1=='c'){
  347. nP1Uhp;
  348. }
  349. else if(cChoice1!='c'){
  350. if(sType1=='W' || sType1=='L' || sType1=='I' || sType2=='W' || sType2=='L'|| sType2=='I'){
  351. nP1Uhp = nP1Uhp-n2Abp1/2;
  352. n2App1 = n2App1 -1;
  353. }
  354. else if(sType1=='F' || sType1=='E' || sType2=='F' || sType2=='E'){
  355. nP1Uhp = nP1Uhp-n2Abp1*2;
  356. n2App1 = n2App1 -1;
  357. }
  358. else if(sType1=='G' || sType2=='G'){
  359. nP1Uhp = nP1Uhp-n2Abp1;
  360. n2App1 = n2App1 -1;
  361. }
  362. }
  363. n2Y=0;
  364. }
  365. if(c2AT1=='i'){
  366. if(cChoice1=='c'){
  367. nP1Uhp;
  368. }
  369. else if(cChoice2!='c'){
  370. if(sType1=='F' || sType2=='F'){
  371. nP1Uhp = nP1Uhp-n2Abp1/2;
  372. n2App1 = n2App1 -1;
  373. }
  374. else if(sType1=='W' || sType1=='L' || sType1=='G' || sType2=='G' || sType2=='W' || sType2=='L'){
  375. nP1Uhp = nP1Uhp-n2Abp1*2;
  376. n2App1 = n2App1 -1;
  377. }
  378. else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='I'|| s2Type2=='E'){
  379. nP2Uhp = nP2Uhp-nAbp1;
  380. nApp1 = nApp1 -1;
  381. }
  382. }
  383. n2Y=0;
  384. }
  385. }
  386. if(n2App1==0){
  387. n2App1=0;
  388. }
  389. break;
  390. case 'b':
  391. if (n2App2!=0){
  392. if(c2AT2=='f'){
  393. if(cChoice1=='c'){
  394. nP1Uhp = nP1Uhp;
  395. }
  396. else if(cChoice2!='c'){
  397. if(sType1=='F' || sType1=='W' || sType1=='G' || sType2=='F' || sType2=='W' || sType2=='G'){
  398. nP1Uhp = nP1Uhp-n2Abp2/2;
  399. n2App2 = n2App2 -1;
  400. }
  401. else if(sType1=='L' || sType1=='I' || sType2=='L' || sType2=='I'){
  402. nP1Uhp = nP1Uhp-n2Abp2*2;
  403. n2App2 = n2App2 -1;
  404. }
  405. else if(sType1=='E' || sType2=='E'){
  406. nP1Uhp = nP1Uhp-n2Abp2;
  407. n2App2 = n2App2 -1;
  408. }
  409. }
  410. n2Y=0;
  411. }
  412. if(c2AT2=='w'){
  413. if(cChoice1=='c'){
  414. nP1Uhp = nP1Uhp;
  415. }
  416. else if(cChoice1!='c'){
  417. if(sType1=='W' || sType1=='L' || sType2=='W' || sType2=='L'){
  418. nP1Uhp = nP1Uhp-n2Abp2/2;
  419. n2App2 = n2App2 -1;
  420. }
  421. else if(sType1=='F' || sType1=='G' || sType2=='F' || sType2=='G'){
  422. nP1Uhp = nP1Uhp-n2Abp2*2;
  423. n2App2 = n2App2 -1;
  424. }
  425. else if(sType1=='E' || sType1=='I' || sType2=='E' || sType2=='I'){
  426. nP1Uhp = nP1Uhp-n2Abp2;
  427. n2App2 = n2App2 -1;
  428. }
  429. }
  430. n2Y=0;
  431. }
  432. if(c2AT2=='e'){
  433. if(cChoice1=='c'){
  434. nP1Uhp = nP1Uhp ;
  435. }
  436. else if(cChoice1!='c'){
  437. if(sType1=='L' || sType2=='L'){
  438. nP1Uhp = nP1Uhp-n2Abp2/2;
  439. n2App2 = n2App2 -1;
  440. }
  441. else if(sType1=='W' || sType2=='W'){
  442. nP1Uhp = nP1Uhp-n2Abp2*2;
  443. n2App2 = n2App2 -1;
  444. }
  445. else if(sType1=='E' || sType1=='F' || sType1=='I' || sType2=='F' || sType2=='E' || sType2=='I'){
  446. nP1Uhp = nP1Uhp-n2Abp2;
  447. n2App2 = n2App2 -1;
  448. }
  449. else if(sType1=='G' || sType2=='G'){
  450. nP1Uhp;
  451. }
  452. }
  453. n2Y=0;
  454. }
  455. if(c2AT2=='g'){
  456. if(cChoice1=='c'){
  457. nP1Uhp = nP1Uhp;
  458. }
  459. else if(cChoice1!='c'){
  460. if(sType1=='W' || sType1=='L' || sType1=='I' || sType2=='W' || sType2=='L'|| sType2=='I'){
  461. nP1Uhp = nP1Uhp-n2Abp2/2;
  462. n2App2 = n2App2 -1;
  463. }
  464. else if(sType1=='F' || sType1=='E' || sType2=='F' || sType2=='E'){
  465. nP1Uhp = nP1Uhp-n2Abp2*2;
  466. n2App2 = n2App2 -1;
  467. }
  468. else if(sType1=='G' || sType2=='G'){
  469. nP1Uhp = nP1Uhp-n2Abp2;
  470. n2App2 = n2App2 -1;
  471. }
  472. }
  473. n2Y=0;
  474. }
  475. if(c2AT2=='i'){
  476. if(cChoice1=='c'){
  477. nP1Uhp = nP1Uhp;
  478. }
  479. else if(cChoice1!='c'){
  480. if(sType1=='F' || sType2=='F'){
  481. nP1Uhp = nP1Uhp-n2Abp2/2;
  482. n2App2 = n2App2 -1;
  483. }
  484. else if(sType1=='W' || sType1=='L' || sType1=='G' || sType2=='G' || sType2=='W' || sType2=='L'){
  485. nP1Uhp = nP1Uhp-n2Abp2*2;
  486. n2App2 = n2App2 -1;
  487. }
  488. else if(sType1=='E' || sType1=='I' || sType2=='I'|| sType2=='E'){
  489. nP2Uhp = nP2Uhp-nAbp1;
  490. n2App2 = n2App2 -1;
  491. }
  492. }
  493. n2Y=0;
  494. }
  495. if(c2AT2=='l'){
  496. if(cChoice1=='c'){
  497. nP1Uhp = nP1Uhp;
  498. }
  499. else if(cChoice1!='c'){
  500. if(sType1=='F' || sType2=='F'|| sType1=='L' || sType2=='L'){
  501. nP1Uhp = nP1Uhp-n2Abp2/2;
  502. n2App2 = n2App2 -1;
  503. }
  504. else if(sType1=='W' || sType1=='G' || sType2=='G' || sType2=='W'){
  505. nP1Uhp = nP1Uhp-n2Abp2*2;
  506. n2App2 = n2App2 -1;
  507. }
  508. else if(sType1=='E' || sType2=='I' || sType1=='E' || sType2=='I'){
  509. nP1Uhp;
  510. }
  511. }
  512. n2Y=0;
  513. }
  514. }
  515. if(n2App2==0){
  516. n2App2=0;
  517. }
  518. break;
  519. case 'c':
  520. if(n2App3!=0){
  521. n2App3 = n2App3-1;
  522. }
  523. if(n2App3==0){
  524. n2App3=0;
  525. }
  526. break;
  527. case 'd':
  528. if(n2Y==0){
  529. if(n2App4!=0){
  530. n2App4 = nApp4-1;
  531. n2Abp1 = nAbp1*2;
  532. n2Abp2 = nAbp2*2;
  533. n2Y=1;
  534. }
  535. if(nApp4==0){
  536. nApp4=0;
  537. }
  538. }
  539. if(n2Y==1){
  540. }
  541. break;
  542. }
  543. /*pickMove(cPokemonName1,cPokemonName2,c1stName,c2ndName,
  544. sAttack1,sAttack2,sAttack3,sAttack4,
  545. sType1,sType2,cAT1,cAT2,
  546. nAbp1,nApp1,nAbp2,nApp2,nApp3,nApp4,nP1hp,nP1Uhp,
  547. s2Attack1,s2Attack2,s2Attack3,s2Attack4,
  548. s2Type1,s2Type2,c2AT1,c2AT2,
  549. n2Abp1,n2App1,n2Abp2,n2App2,n2App3,n2App4,nP2hp,nP2Uhp);*/
  550. }
  551. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  552. void pickMove(char *cPokemonName1,char *cPokemonName2,char *c1stName,char *c2ndName,
  553. char *sAttack1,char *sAttack2,char *sAttack3,char *sAttack4,
  554. char sType1,char sType2,char cAT1,char cAT2,
  555. int nAbp1,int nApp1,int nAbp2,int nApp2,int nApp3,int nApp4,int nP1hp,int nP1Uhp,
  556. char *s2Attack1,char *s2Attack2,char *s2Attack3,char *s2Attack4,
  557. char s2Type1,char s2Type2,char c2AT1,char c2AT2,
  558. int n2Abp1,int n2App1,int n2Abp2,int n2App2,int n2App3,int n2App4,int nP2hp,int nP2Uhp) // user will pick their move
  559. {
  560. char cChoice1, cChoice2;
  561. if (nP1Uhp!=0 || nP2Uhp!=0){
  562. printf("\n\n\n\t %5s's Pokemon \t\t\t\t\t\t\t %5s's Pokemon \n", c1stName,c2ndName); // displays the match
  563. printf("\t ============= \t\t\t\t\t\t\t =============\n");
  564. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  565. printf("\t|| %s ||\t\t\t\t\t\t\t|| %s || \n",cPokemonName1, cPokemonName2 );
  566. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  567. printf("\t ============= \t\t\t\t\t\t\t =============\n");
  568. printf("\t %d/%d \t\t\t\t\t\t\t %d/%d \n\n", nP1Uhp,nP1hp,nP2Uhp, nP2hp);
  569. printf("Player 1:\n");
  570. printf("%s\n", cPokemonName1);
  571. printf("Choose your move:\n");
  572. printf("%s--BP:%d--PP:%d [A]\n", sAttack1,nAbp1,nApp1);
  573. printf("%s--BP:%d--PP:%d [B]\n", sAttack2,nAbp2,nApp2);
  574. printf("%s--BP:00--PP:%d [C]\n", sAttack3,nApp3);
  575. printf("%s--BP:00--PP:%d [D]\n", sAttack4,nApp4);
  576. scanf("%c", &cChoice1);
  577. cChoice1 = tolower(cChoice1);
  578. fflush(stdin);
  579.  
  580. printf("\n\n\n\t %5s's Pokemon \t\t\t\t\t\t\t %5s's Pokemon \n", c1stName,c2ndName); // displays the match
  581. printf("\t ============= \t\t\t\t\t\t\t =============\n");
  582. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  583. printf("\t|| %s ||\t\t\t\t\t\t\t|| %s || \n",cPokemonName1, cPokemonName2 );
  584. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  585. printf("\t ============= \t\t\t\t\t\t\t =============\n");
  586. printf("\t %d/%d \t\t\t\t\t\t\t %d/%d \n\n", nP1Uhp,nP1hp,nP2Uhp, nP2hp);
  587. printf("Player 2:\n");
  588. printf("%s\n", cPokemonName1);
  589. printf("Choose your move:\n");
  590. printf("%s--BP:%d--PP:%d [A]\n", s2Attack1,n2Abp1,n2App1);
  591. printf("%s--BP:%d--PP:%d [B]\n", s2Attack2,n2Abp2,n2App2);
  592. printf("%s--BP:00--PP:%d [C]\n", s2Attack3,n2App3);
  593. printf("%s--BP:00--PP:%d [D]\n", s2Attack4,n2App4);
  594. scanf("%c", &cChoice2);
  595. cChoice2 = tolower(cChoice2);
  596. fflush(stdin);
  597.  
  598. damageTurn(cPokemonName1,cPokemonName2,c1stName,c2ndName,
  599. sAttack1,sAttack2,sAttack3,sAttack4,sType1,sType2,cAT1, cAT2,nAbp1, nApp1, nAbp2, nApp2, nApp3, nApp4,nP1hp,nP1Uhp,
  600. s2Attack1,s2Attack2,s2Attack3,s2Attack4,s2Type1,s2Type2,c2AT1, c2AT2,n2Abp1, n2App1, n2Abp2, n2App2, n2App3, n2App4,nP2hp,nP2Uhp,cChoice1,cChoice2);
  601. }
  602. }
  603.  
  604. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  605. void mainGame(char cPokemon1,char cPokemon2, char *cPokemonName1,char *cPokemonName2,char *c1stName,char *c2ndName){
  606. char *sAttack1,*sAttack2,*sAttack3,*sAttack4,*s2Attack1,*s2Attack2,*s2Attack3,*s2Attack4; //pokemon's moves
  607. char sType1,sType2, s2Type1,s2Type2; // pokemon types
  608. char cAT1, cAT2, c2AT1, c2AT2; // pokemon's attack types
  609. int nAbp1, nApp1, nAbp2, nApp2, nApp3, nApp4, n2Abp1, n2App1, n2Abp2, n2App2, n2App3, n2App4; // pokemon's bp & pp
  610. int nP1hp, nP2hp; // pokemon's hp
  611. int nP1Uhp, nP2Uhp; // pokemon's updated hp
  612.  
  613. switch(cPokemon1){ // player 1's pokemon stats
  614. case 'e':
  615. sType1 = 'F';
  616. sType2 = 'N';
  617. nP1hp = 150;
  618. nP1Uhp = 150;
  619. sAttack1 = "Fire Blast";
  620. cAT1 = 'f';
  621. nAbp1 = 30;
  622. nApp1 = 5;
  623. sAttack2 = "Earthquake";
  624. cAT2 = 'g';
  625. nAbp2 = 30;
  626. nApp2 = 5;
  627. sAttack3 = "Protect";
  628. nApp3 = 5;
  629. sAttack4 = "Charge Up";
  630. nApp4 = 5;
  631. break;
  632. case 'm':
  633. sType1 = 'W';
  634. sType2 = 'N';
  635. nP1hp = 200;
  636. nP1Uhp = 2000;
  637. sAttack1 = "Scald";
  638. cAT1 = 'w';
  639. nAbp1 = 20;
  640. nApp1 = 7;
  641. sAttack2 = "Ice Beam";
  642. cAT2 = 'i';
  643. nAbp2 = 20;
  644. nApp2 = 7;
  645. sAttack3 = "Protect";
  646. nApp3 = 5;
  647. sAttack4 = "Charge Up";
  648. nApp4 = 5;
  649. break;
  650. case 't':
  651. sType1 = 'L';
  652. sType2 = 'G';
  653. nP1hp = 220;
  654. nP1Uhp = 220;
  655. sAttack1 = "Dig";
  656. cAT1 = 'g';
  657. nAbp1 = 20;
  658. nApp1 = 7;
  659. sAttack2 = "Leaf Storm";
  660. cAT2 = 'l';
  661. nAbp2 = 40;
  662. nApp2 = 5;
  663. sAttack3 = "Protect";
  664. nApp3 = 5;
  665. sAttack4 = "Charge Up";
  666. nApp4 = 5;
  667. break;
  668. case 'p':
  669. sType1 = 'E';
  670. sType2 = 'N';
  671. nP1hp = 120;
  672. nP1Uhp = 120;
  673. sAttack1 = "Thunderbolt";
  674. cAT1 = 'e';
  675. nAbp1 = 10;
  676. nApp1 = 10;
  677. sAttack2 = "Dig";
  678. cAT2 = 'g';
  679. nAbp2 = 20;
  680. nApp2 = 7;
  681. sAttack3 = "Protect";
  682. nApp3 = 5;
  683. sAttack4 = "Charge Up";
  684. nApp4 = 5;
  685. break;
  686. case 'g':
  687. sType1 = 'G';
  688. sType2 = 'N';
  689. nP1hp = 150;
  690. nP1Uhp = 150;
  691. sAttack1 = "Fissure";
  692. cAT1 = 'g';
  693. nAbp1 = 40;
  694. nApp1 = 5;
  695. sAttack2 = "Fire Blast";
  696. cAT2 = 'f';
  697. nAbp2 = 30;
  698. nApp2 = 5;
  699. sAttack3 = "Protect";
  700. nApp3 = 5;
  701. sAttack4 = "Charge Up";
  702. nApp4 = 5;
  703. break;
  704. case 'l':
  705. sType1 = 'I';
  706. sType2 = 'W';
  707. nP1hp = 190;
  708. nP1Uhp = 190;
  709. sAttack1 = "Ice Beam";
  710. cAT1 = 'i';
  711. nAbp1 = 20;
  712. nApp1 = 7;
  713. sAttack2 = "Scald";
  714. cAT2 = 'w';
  715. nAbp2 = 20;
  716. nApp2 = 7;
  717. sAttack3 = "Protect";
  718. nApp3 = 5;
  719. sAttack4 = "Charge Up";
  720. nApp4 = 5;
  721. break;
  722. case 's':
  723. sType1 = 'G';
  724. sType2 = 'E';
  725. nP1hp = 130;
  726. nP1Uhp = 130;
  727. sAttack1 = "Water Gun";
  728. cAT1 = 'w';
  729. nAbp1 = 10;
  730. nApp1 = 10;
  731. sAttack2 = "Earthquake";
  732. cAT2 = 'g';
  733. nAbp2 = 30;
  734. nApp2 = 5;
  735. sAttack3 = "Protect";
  736. nApp3 = 5;
  737. sAttack4 = "Charge Up";
  738. nApp4 = 5;
  739. break;
  740. }
  741. switch(cPokemon2){ // player's 2 pokemon stats
  742. case 'e':
  743. s2Type1 = 'F';
  744. s2Type2 = 'N';
  745. nP2hp = 150;
  746. nP2Uhp = 150;
  747. s2Attack1 = "Fire Blast";
  748. c2AT1 = 'f';
  749. n2Abp1 = 30;
  750. n2App1 = 5;
  751. s2Attack2 = "Earthquake";
  752. c2AT2 = 'g';
  753. n2Abp2 = 30;
  754. n2App2 = 5;
  755. s2Attack3 = "Protect";
  756. n2App3 = 5;
  757. s2Attack4 = "Charge Up";
  758. n2App4 = 5;
  759. break;
  760. case 'm':
  761. s2Type1 = 'W';
  762. s2Type2 = 'N';
  763. nP2hp = 200;
  764. nP2Uhp = 200;
  765. s2Attack1 = "Scald";
  766. c2AT1 = 'w';
  767. n2Abp1 = 20;
  768. n2App1 = 7;
  769. s2Attack2 = "Ice Beam";
  770. c2AT2 = 'i';
  771. n2Abp2 = 20;
  772. n2App2 = 7;
  773. s2Attack3 = "Protect";
  774. n2App3 = 5;
  775. s2Attack4 = "Charge Up";
  776. n2App4 = 5;
  777. break;
  778. case 't':
  779. s2Type1 = 'L';
  780. s2Type2 = 'G';
  781. nP2hp = 220;
  782. nP2Uhp = 220;
  783. s2Attack1 = "Dig";
  784. c2AT1 = 'g';
  785. n2Abp1 = 20;
  786. n2App1 = 7;
  787. s2Attack2 = "Leaf Storm";
  788. c2AT2 = 'l';
  789. n2Abp2 = 40;
  790. n2App2 = 5;
  791. s2Attack3 = "Protect";
  792. n2App3 = 5;
  793. s2Attack4 = "Charge Up";
  794. n2App4 = 5;
  795. break;
  796. case 'p':
  797. s2Type1 = 'E';
  798. s2Type2 = 'N';
  799. nP2hp = 120;
  800. nP2Uhp = 120;
  801. s2Attack1 = "Thunderbolt";
  802. c2AT1 = 'e';
  803. n2Abp1 = 10;
  804. n2App1 = 10;
  805. s2Attack2 = "Dig";
  806. c2AT2 = 'g';
  807. n2Abp2 = 20;
  808. n2App2 = 7;
  809. s2Attack3 = "Protect";
  810. n2App3 = 5;
  811. s2Attack4 = "Charge Up";
  812. n2App4 = 5;
  813. break;
  814. case 'g':
  815. s2Type1 = 'G';
  816. s2Type2 = 'N';
  817. nP2hp = 150;
  818. nP2Uhp = 150;
  819. s2Attack1 = "Fissure";
  820. c2AT1 = 'g';
  821. n2Abp1 = 40;
  822. n2App1 = 5;
  823. s2Attack2 = "Fire Blast";
  824. c2AT2 = 'f';
  825. n2Abp2 = 30;
  826. n2App2 = 5;
  827. s2Attack3 = "Protect";
  828. n2App3 = 5;
  829. s2Attack4 = "Charge Up";
  830. n2App4 = 5;
  831. break;
  832. case 'l':
  833. s2Type1 = 'I';
  834. s2Type2 = 'W';
  835. nP2hp = 190;
  836. nP2Uhp = 190;
  837. s2Attack1 = "Ice Beam";
  838. c2AT1 = 'i';
  839. n2Abp1 = 20;
  840. n2App1 = 7;
  841. s2Attack2 = "Scald";
  842. c2AT2 = 'w';
  843. n2Abp2 = 20;
  844. n2App2 = 7;
  845. s2Attack3 = "Protect";
  846. n2App3 = 5;
  847. s2Attack4 = "Charge Up";
  848. n2App4 = 5;
  849. break;
  850. case 's':
  851. s2Type1 = 'G';
  852. s2Type2 = 'E';
  853. nP2hp = 130;
  854. nP2Uhp = 130;
  855. s2Attack1 = "Water Gun";
  856. c2AT1 = 'w';
  857. n2Abp1 = 10;
  858. n2App1 = 10;
  859. s2Attack2 = "Earthquake";
  860. c2AT2 = 'g';
  861. n2Abp2 = 30;
  862. n2App2 = 5;
  863. s2Attack3 = "Protect";
  864. n2App3 = 5;
  865. s2Attack4 = "Charge Up";
  866. n2App4 = 5;
  867. break;
  868. }
  869. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  870. pickMove(cPokemonName1,cPokemonName2,c1stName,c2ndName,
  871. sAttack1,sAttack2,sAttack3,sAttack4,sType1,sType2,cAT1, cAT2,nAbp1, nApp1, nAbp2, nApp2, nApp3, nApp4,nP1hp,nP1Uhp,
  872. s2Attack1,s2Attack2,s2Attack3,s2Attack4,s2Type1,s2Type2,c2AT1, c2AT2,n2Abp1, n2App1, n2Abp2, n2App2, n2App3, n2App4,nP2hp,nP2Uhp);
  873. }
  874.  
  875.  
  876. void transition(char cPokemon1,char cPokemon2,char *c1stName,char *c2ndName){
  877.  
  878. char *cPokemonName1, *cPokemonName2;
  879.  
  880. switch(cPokemon1){ //displays the chosen pokemon Name
  881. case 'e': cPokemonName1 = "Entei";
  882. break;
  883. case 'm': cPokemonName1 = "Milotic";
  884. break;
  885. case 't': cPokemonName1 = "Torterra";
  886. break;
  887. case 'p': cPokemonName1 = "Pikachu";
  888. break;
  889. case 'g': cPokemonName1 = "Groudon";
  890. break;
  891. case 'l': cPokemonName1 = "Lapras";
  892. break;
  893. case 's': cPokemonName1 = "Stunfisk";
  894. break;
  895. }
  896. switch(cPokemon2){
  897. case 'e': cPokemonName2 = "Entei";
  898. break;
  899. case 'm': cPokemonName2 = "Milotic";
  900. break;
  901. case 't': cPokemonName2 = "Torterra";
  902. break;
  903. case 'p': cPokemonName2 = "Pikachu";
  904. break;
  905. case 'g': cPokemonName2 = "Groudon";
  906. break;
  907. case 'l': cPokemonName2 = "Lapras";
  908. break;
  909. case 's': cPokemonName2 = "Stunfisk";
  910. break;
  911. }
  912. printf("\n\n\n\t %5s's Pokemon \t\t\t\t\t\t\t %5s's Pokemon \n", c1stName,c2ndName); // displays the trainer matchup
  913. printf("\t ============= \t\t\t\t\t\t\t =============\n");
  914. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  915. printf("\t|| %s ||\t\t\t VS\t\t\t\t|| %s || \n",cPokemonName1, cPokemonName2 );
  916. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  917. printf("\t ============= \t\t\t\t\t\t\t =============\n\n\n");
  918. printf("\t\t\t\t\t\t\t\t ==============================================\n");
  919. printf("\t\t\t\t\t\t\t\t|| INSTRUCTION ||\n");
  920. printf("\t\t\t\t\t\t\t\t|| ||\n");
  921. printf("\t\t\t\t\t\t\t\t|| Player 1 will make the first attack, ||\n");
  922. printf("\t\t\t\t\t\t\t\t|| then Player 2. Each Player will take ||\n");
  923. printf("\t\t\t\t\t\t\t\t|| turns selecting moves their Pokemon ||\n");
  924. printf("\t\t\t\t\t\t\t\t|| will use. The objective is to defeat ||\n");
  925. printf("\t\t\t\t\t\t\t\t|| your opponent's pokemon and win. ||\n");
  926. printf("\t\t\t\t\t\t\t\t|| ||\n");
  927. printf("\t\t\t\t\t\t\t\t ==============================================\n\n");
  928.  
  929. mainGame(cPokemon1, cPokemon2, cPokemonName1,cPokemonName2,c1stName,c2ndName);
  930. }
  931.  
  932. void pokemonSelection(char *c1stName,char *c2ndName){
  933. char cPokemon1, cPokemon2;
  934. printf("\n\t %5s's Pokemon \t\t\t\t\t\t\t %5s's Pokemon \n", c1stName,c2ndName);
  935. printf("\t ============= \t\t\t\t\t\t\t =============\n");
  936. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  937. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  938. printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
  939. printf("\t ============= \t\t\t\t\t\t\t =============\n");
  940. printf("---------------------------------------------------------------------------------------------------------------------------------------------\n");
  941. printf("|| | | | | Unique Move 1 | Unique Move 2 ||\n");
  942. printf("||----------|---------|---------|------|-------------------------------------------------|-------------------------------------------------||\n");
  943. printf("|| Name | Type1 | Type2 | HP | Name | Base Power | Power Points | Type | Name | Base Power | Power Points | Type || \n");
  944. printf("||----------|-------------------|------|------------|------------|--------------|--------|------------|------------|--------------|--------||\n");
  945. printf("|| -Entei | -Fire | -None | -150 | Fire Blast | -30 damage | 5pp | Fire | Earthquake | -30 damage | 5pp | Ground || [E]\n");
  946. printf("|| -Milotic | Water | -None | -200 | -Scald | -20 damage | 7pp | -Water | Ice Beam | -20 damage | 7pp | -Ice || [M]\n");
  947. printf("|| Torterra | Grass | -Ground | -220 | -Dig | -20 damage | 7pp | Ground | Leaf Storm | -40 damage | 5pp | -Grass || [T]\n");
  948. printf("|| -Pikachu |-Electric| -None | -120 |-Thunderbolt| -10 damage | 10pp |Electric| -Dig | -20 damage | 7pp | Ground || [P]\n");
  949. printf("|| -Groudon | -Ground | -None | -150 | -Fissure | -40 damage | 5pp | Ground | Fire Blast | -30 damage | 5pp | Fire || [G]\n");
  950. printf("|| Lapras | Ice | Water | -190 | Ice Beam | -20 damage | 7pp |Electric| -Scald | -20 damage | 7pp | Water || [L]\n");
  951. printf("|| Stunfisk | -Ground |-Electric| -130 | -Water Gun | -10 damage | 10pp | -Water | Earthquake | -30 damage | 5pp | Ground || [S]\n");
  952. printf("---------------------------------------------------------------------------------------------------------------------------------------------\n");
  953. printf("\n\tProfessor Oak: %5s, please select your pokemon.", c1stName); // pokemon selection phase
  954. scanf("%c", &cPokemon1);
  955. cPokemon1 = tolower(cPokemon1);
  956. fflush(stdin);
  957. printf("\n\tProfessor Oak: %5s, please select your pokemon.", c2ndName);
  958. scanf("%c", &cPokemon2);
  959. cPokemon2 = tolower(cPokemon2);
  960. fflush(stdin);
  961. transition(cPokemon1, cPokemon2, c1stName, c2ndName);
  962. }
  963.  
  964. void firstPart(){
  965. char c1stName[100],c2ndName[100];
  966. /* gets the names of the two
  967. players */
  968. printf("(5characters only)\n");
  969. printf("Player 1 NAME:");
  970. scanf("%s", &c1stName);
  971. fflush(stdin);
  972. printf("\nPlayer 2 NAME:");
  973. scanf("%s", &c2ndName);
  974. fflush(stdin);
  975. pokemonSelection(c1stName, c2ndName);
  976. }
  977.  
  978. void start(){ // main screen
  979. char cChoice;
  980. printf("\t\t\t\t\t\t\t\t\t\t Enter:");
  981. scanf("%c", &cChoice);
  982. fflush(stdin);
  983. printf("\n");
  984. cChoice = tolower(cChoice); // to make the reply valid for lower and uppercase input
  985. if (cChoice == 'a' ){ // proceed to the main game
  986. firstPart();
  987. }
  988. else if (cChoice == 'b'){ // exits the program
  989. printf("\t\t\t\t\t THANK YOU FOR PLAYING");
  990. }
  991. else{ // invalid output
  992. printf("\t\t\t\t\t\t Wrong Input.\n");
  993. start();
  994. }
  995. }
  996.  
  997.  
  998. int main()
  999. {
  1000. printf("\t\t\t\t\t\t\t\t ==============================================\n");
  1001. printf("\t\t\t\t\t\t\t\t|| ||\n");
  1002. printf("\t\t\t\t\t\t\t\t|| ||\n");
  1003. printf("\t\t\t\t\t\t\t\t|| 1 V 1 ||\n");
  1004. printf("\t\t\t\t\t\t\t\t|| ||\n");
  1005. printf("\t\t\t\t\t\t\t\t|| POKEMON BATTLE SIMULATOR ||\n");
  1006. printf("\t\t\t\t\t\t\t\t|| ||\n");
  1007. printf("\t\t\t\t\t\t\t\t|| ||\n");
  1008. printf("\t\t\t\t\t\t\t\t|| ||\n");
  1009. printf("\t\t\t\t\t\t\t\t ==============================================\n\n");
  1010. printf("\t\t\t\t\t\t\t\t [A] [B] \n");
  1011. printf("\t\t\t\t\t\t\t\t START END \n");
  1012. start();
  1013.  
  1014. return 0;
  1015. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement