Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- void damageTurn(char *cPokemonName1,char *cPokemonName2,char *c1stName,char *c2ndName,
- char *sAttack1,char *sAttack2,char *sAttack3,char *sAttack4,
- char sType1,char sType2,char cAT1,char cAT2,
- int nAbp1,int nApp1,int nAbp2,int nApp2,int nApp3,int nApp4,int nP1hp,int nP1Uhp,
- char *s2Attack1,char *s2Attack2,char *s2Attack3,char *s2Attack4,
- char s2Type1,char s2Type2,char c2AT1,char c2AT2,
- int n2Abp1,int n2App1,int n2Abp2,int n2App2,int n2App3,int n2App4,int nP2hp,int nP2Uhp,char cChoice1,char cChoice2)
- {
- int nY = 0;
- int n2Y = 0;
- switch (cChoice1){
- case 'a':
- if (nApp1!=0){
- if(cAT1=='f'){
- if(cChoice2=='c'){
- nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='F' || s2Type1=='W' || s2Type1=='G' || s2Type2=='F' || s2Type2=='W' || s2Type2=='G'){
- nP2Uhp = nP2Uhp-nAbp1/2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='L' || s2Type1=='I' || s2Type2=='L' || s2Type2=='I'){
- nP2Uhp = nP2Uhp-nAbp1*2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='E' || s2Type2=='E'){
- nP2Uhp = nP2Uhp-nAbp1;
- nApp1 = nApp1 -1;
- }
- }
- nY=0;
- }
- if(cAT1=='w'){
- if(cChoice2=='c'){
- nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='W' || s2Type1=='L' || s2Type2=='W' || s2Type2=='L'){
- nP2Uhp = nP2Uhp-nAbp1/2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='F' || s2Type1=='G' || s2Type2=='F' || s2Type2=='G'){
- nP2Uhp = nP2Uhp-nAbp1*2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='E' || s2Type2=='I'){
- nP2Uhp = nP2Uhp-nAbp1;
- nApp1 = nApp1 -1;
- }
- }
- nY=0;
- }
- if(cAT1=='e'){
- if(cChoice2=='c'){
- nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='L' || s2Type2=='L'){
- nP2Uhp = nP2Uhp-nAbp1/2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='W' || s2Type2=='W'){
- nP2Uhp = nP2Uhp-nAbp1*2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='E' || s2Type1=='F' || s2Type1=='I' || s2Type2=='F' || s2Type2=='E' || s2Type2=='I'){
- nP2Uhp = nP2Uhp-nAbp1;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='G' || s2Type2=='G'){
- nP2Uhp;
- }
- }
- nY=0;
- }
- if(cAT1=='g'){
- if(cChoice2=='c'){
- nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='W' || s2Type1=='L' || s2Type1=='I' || s2Type2=='W' || s2Type2=='L'|| s2Type2=='I'){
- nP2Uhp = nP2Uhp-nAbp1/2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='F' || s2Type1=='E' || s2Type2=='F' || s2Type2=='E'){
- nP2Uhp = nP2Uhp-nAbp1*2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='G' || s2Type2=='G'){
- nP2Uhp = nP2Uhp-nAbp1;
- nApp1 = nApp1 -1;
- }
- }
- nY=0;
- }
- if(cAT1=='i'){
- if(cChoice2=='c'){
- nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='F' || s2Type2=='F'){
- nP2Uhp = nP2Uhp-nAbp1/2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='W' || s2Type1=='L' || s2Type1=='G' || s2Type2=='G' || s2Type2=='W' || s2Type2=='L'){
- nP2Uhp = nP2Uhp-nAbp1*2;
- nApp1 = nApp1 -1;
- }
- else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='I'|| s2Type2=='E'){
- nP2Uhp = nP2Uhp-nAbp1;
- nApp1 = nApp1 -1;
- }
- }
- nY=0;
- }
- }
- if(nApp1==0){
- nApp1=0;
- }
- break;
- case 'b':
- if (nApp2!=0){
- if(cAT2=='f'){
- if(cChoice2=='c'){
- nP2Uhp = nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='F' || s2Type1=='W' || s2Type1=='G' || s2Type2=='F' || s2Type2=='W' || s2Type2=='G'){
- nP2Uhp = nP2Uhp-nAbp2/2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='L' || s2Type1=='I' || s2Type2=='L' || s2Type2=='I'){
- nP2Uhp = nP2Uhp-nAbp2*2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='E' || s2Type2=='E'){
- nP2Uhp = nP2Uhp-nAbp2;
- nApp2 = nApp2 -1;
- }
- }
- nY=0;
- }
- if(cAT2=='w'){
- if(cChoice2=='c'){
- nP2Uhp = nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='W' || s2Type1=='L' || s2Type2=='W' || s2Type2=='L'){
- nP2Uhp = nP2Uhp-nAbp2/2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='F' || s2Type1=='G' || s2Type2=='F' || s2Type2=='G'){
- nP2Uhp = nP2Uhp-nAbp2*2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='E' || s2Type2=='I'){
- nP2Uhp = nP2Uhp-nAbp2;
- nApp2 = nApp2 -1;
- }
- }
- nY=0;
- }
- if(cAT2=='e'){
- if(cChoice2=='c'){
- nP2Uhp = nP2Uhp ;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='L' || s2Type2=='L'){
- nP2Uhp = nP2Uhp-nAbp2/2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='W' || s2Type2=='W'){
- nP2Uhp = nP2Uhp-nAbp2*2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='E' || s2Type1=='F' || s2Type1=='I' || s2Type2=='F' || s2Type2=='E' || s2Type2=='I'){
- nP2Uhp = nP2Uhp-nAbp2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='G' || s2Type2=='G'){
- nP2Uhp;
- }
- }
- nY=0;
- }
- if(cAT2=='g'){
- if(cChoice2=='c'){
- nP2Uhp = nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='W' || s2Type1=='L' || s2Type1=='I' || s2Type2=='W' || s2Type2=='L'|| s2Type2=='I'){
- nP2Uhp = nP2Uhp-nAbp2/2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='F' || s2Type1=='E' || s2Type2=='F' || s2Type2=='E'){
- nP2Uhp = nP2Uhp-nAbp2*2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='G' || s2Type2=='G'){
- nP2Uhp = nP2Uhp-nAbp2;
- nApp2 = nApp2 -1;
- }
- }
- nY=0;
- }
- if(cAT2=='i'){
- if(cChoice2=='c'){
- nP2Uhp = nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='F' || s2Type2=='F'){
- nP2Uhp = nP2Uhp-nAbp2/2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='W' || s2Type1=='L' || s2Type1=='G' || s2Type2=='G' || s2Type2=='W' || s2Type2=='L'){
- nP2Uhp = nP2Uhp-nAbp2*2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='I'|| s2Type2=='E'){
- nP2Uhp = nP2Uhp-nAbp1;
- nApp2 = nApp2 -1;
- }
- }
- nY=0;
- }
- if(cAT2=='l'){
- if(cChoice2=='c'){
- nP2Uhp = nP2Uhp;
- }
- else if(cChoice2!='c'){
- if(s2Type1=='F' || s2Type2=='F'|| s2Type1=='L' || s2Type2=='L'){
- nP2Uhp = nP2Uhp-nAbp2/2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='W' || s2Type1=='G' || s2Type2=='G' || s2Type2=='W'){
- nP2Uhp = nP2Uhp-nAbp2*2;
- nApp2 = nApp2 -1;
- }
- else if(s2Type1=='E' || s2Type2=='I' || s2Type1=='E' || s2Type2=='I'){
- nP2Uhp;
- }
- }
- nY=0;
- }
- }
- if(nApp2==0){
- nApp2=0;
- }
- break;
- case 'c':
- if(nApp3!=0){
- nApp3 = nApp3-1;
- }
- if(nApp3==0){
- nApp3=0;
- }
- break;
- case 'd':
- if(nY==0){
- if(nApp4!=0){
- nApp4 = nApp4-1;
- nAbp1 = nAbp1*2;
- nAbp2 = nAbp2*2;
- nY=1;
- }
- if(nApp4==0){
- nApp4=0;
- }
- }
- if(nY==1){
- }
- break;
- }
- switch (cChoice2){
- case 'a':
- if (n2App1!=0){
- if(c2AT1=='f'){
- if(cChoice1=='c'){
- nP1Uhp;
- }
- else if(cChoice1!='c'){
- if(sType1=='F' || sType1=='W' || sType1=='G' || sType2=='F' || sType2=='W' || sType2=='G'){
- nP1Uhp = nP1Uhp-n2Abp1/2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='L' || sType1=='I' || sType2=='L' || sType2=='I'){
- nP1Uhp = nP1Uhp-n2Abp1*2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='E' || sType2=='E'){
- nP1Uhp = nP1Uhp-n2Abp1;
- n2App1 = n2App1 -1;
- }
- }
- n2Y=0;
- }
- if(c2AT1=='w'){
- if(cChoice1=='c'){
- nP1Uhp;
- }
- else if(cChoice1!='c'){
- if(sType1=='W' || sType1=='L' || sType2=='W' || sType2=='L'){
- nP1Uhp = nP1Uhp-n2Abp1/2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='F' || sType1=='G' || sType2=='F' || sType2=='G'){
- nP1Uhp = nP1Uhp-n2Abp1*2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='E' || sType1=='I' || sType2=='E' || sType2=='I'){
- nP1Uhp = nP1Uhp-n2Abp1;
- n2App1 = n2App1 -1;
- }
- }
- n2Y=0;
- }
- if(c2AT1=='e'){
- if(cChoice1=='c'){
- nP2Uhp;
- }
- else if(cChoice1!='c'){
- if(sType1=='L' || sType2=='L'){
- nP1Uhp = nP1Uhp-n2Abp1/2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='W' || sType2=='W'){
- nP1Uhp = nP1Uhp-n2Abp1*2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='E' || sType1=='F' || sType1=='I' || sType2=='F' || sType2=='E' || sType2=='I'){
- nP1Uhp = nP1Uhp-n2Abp1;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='G' || sType2=='G'){
- nP1Uhp;
- }
- }
- n2Y=0;
- }
- if(c2AT1=='g'){
- if(cChoice1=='c'){
- nP1Uhp;
- }
- else if(cChoice1!='c'){
- if(sType1=='W' || sType1=='L' || sType1=='I' || sType2=='W' || sType2=='L'|| sType2=='I'){
- nP1Uhp = nP1Uhp-n2Abp1/2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='F' || sType1=='E' || sType2=='F' || sType2=='E'){
- nP1Uhp = nP1Uhp-n2Abp1*2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='G' || sType2=='G'){
- nP1Uhp = nP1Uhp-n2Abp1;
- n2App1 = n2App1 -1;
- }
- }
- n2Y=0;
- }
- if(c2AT1=='i'){
- if(cChoice1=='c'){
- nP1Uhp;
- }
- else if(cChoice2!='c'){
- if(sType1=='F' || sType2=='F'){
- nP1Uhp = nP1Uhp-n2Abp1/2;
- n2App1 = n2App1 -1;
- }
- else if(sType1=='W' || sType1=='L' || sType1=='G' || sType2=='G' || sType2=='W' || sType2=='L'){
- nP1Uhp = nP1Uhp-n2Abp1*2;
- n2App1 = n2App1 -1;
- }
- else if(s2Type1=='E' || s2Type1=='I' || s2Type2=='I'|| s2Type2=='E'){
- nP2Uhp = nP2Uhp-nAbp1;
- nApp1 = nApp1 -1;
- }
- }
- n2Y=0;
- }
- }
- if(n2App1==0){
- n2App1=0;
- }
- break;
- case 'b':
- if (n2App2!=0){
- if(c2AT2=='f'){
- if(cChoice1=='c'){
- nP1Uhp = nP1Uhp;
- }
- else if(cChoice2!='c'){
- if(sType1=='F' || sType1=='W' || sType1=='G' || sType2=='F' || sType2=='W' || sType2=='G'){
- nP1Uhp = nP1Uhp-n2Abp2/2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='L' || sType1=='I' || sType2=='L' || sType2=='I'){
- nP1Uhp = nP1Uhp-n2Abp2*2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='E' || sType2=='E'){
- nP1Uhp = nP1Uhp-n2Abp2;
- n2App2 = n2App2 -1;
- }
- }
- n2Y=0;
- }
- if(c2AT2=='w'){
- if(cChoice1=='c'){
- nP1Uhp = nP1Uhp;
- }
- else if(cChoice1!='c'){
- if(sType1=='W' || sType1=='L' || sType2=='W' || sType2=='L'){
- nP1Uhp = nP1Uhp-n2Abp2/2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='F' || sType1=='G' || sType2=='F' || sType2=='G'){
- nP1Uhp = nP1Uhp-n2Abp2*2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='E' || sType1=='I' || sType2=='E' || sType2=='I'){
- nP1Uhp = nP1Uhp-n2Abp2;
- n2App2 = n2App2 -1;
- }
- }
- n2Y=0;
- }
- if(c2AT2=='e'){
- if(cChoice1=='c'){
- nP1Uhp = nP1Uhp ;
- }
- else if(cChoice1!='c'){
- if(sType1=='L' || sType2=='L'){
- nP1Uhp = nP1Uhp-n2Abp2/2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='W' || sType2=='W'){
- nP1Uhp = nP1Uhp-n2Abp2*2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='E' || sType1=='F' || sType1=='I' || sType2=='F' || sType2=='E' || sType2=='I'){
- nP1Uhp = nP1Uhp-n2Abp2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='G' || sType2=='G'){
- nP1Uhp;
- }
- }
- n2Y=0;
- }
- if(c2AT2=='g'){
- if(cChoice1=='c'){
- nP1Uhp = nP1Uhp;
- }
- else if(cChoice1!='c'){
- if(sType1=='W' || sType1=='L' || sType1=='I' || sType2=='W' || sType2=='L'|| sType2=='I'){
- nP1Uhp = nP1Uhp-n2Abp2/2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='F' || sType1=='E' || sType2=='F' || sType2=='E'){
- nP1Uhp = nP1Uhp-n2Abp2*2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='G' || sType2=='G'){
- nP1Uhp = nP1Uhp-n2Abp2;
- n2App2 = n2App2 -1;
- }
- }
- n2Y=0;
- }
- if(c2AT2=='i'){
- if(cChoice1=='c'){
- nP1Uhp = nP1Uhp;
- }
- else if(cChoice1!='c'){
- if(sType1=='F' || sType2=='F'){
- nP1Uhp = nP1Uhp-n2Abp2/2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='W' || sType1=='L' || sType1=='G' || sType2=='G' || sType2=='W' || sType2=='L'){
- nP1Uhp = nP1Uhp-n2Abp2*2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='E' || sType1=='I' || sType2=='I'|| sType2=='E'){
- nP2Uhp = nP2Uhp-nAbp1;
- n2App2 = n2App2 -1;
- }
- }
- n2Y=0;
- }
- if(c2AT2=='l'){
- if(cChoice1=='c'){
- nP1Uhp = nP1Uhp;
- }
- else if(cChoice1!='c'){
- if(sType1=='F' || sType2=='F'|| sType1=='L' || sType2=='L'){
- nP1Uhp = nP1Uhp-n2Abp2/2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='W' || sType1=='G' || sType2=='G' || sType2=='W'){
- nP1Uhp = nP1Uhp-n2Abp2*2;
- n2App2 = n2App2 -1;
- }
- else if(sType1=='E' || sType2=='I' || sType1=='E' || sType2=='I'){
- nP1Uhp;
- }
- }
- n2Y=0;
- }
- }
- if(n2App2==0){
- n2App2=0;
- }
- break;
- case 'c':
- if(n2App3!=0){
- n2App3 = n2App3-1;
- }
- if(n2App3==0){
- n2App3=0;
- }
- break;
- case 'd':
- if(n2Y==0){
- if(n2App4!=0){
- n2App4 = nApp4-1;
- n2Abp1 = nAbp1*2;
- n2Abp2 = nAbp2*2;
- n2Y=1;
- }
- if(nApp4==0){
- nApp4=0;
- }
- }
- if(n2Y==1){
- }
- break;
- }
- /*pickMove(cPokemonName1,cPokemonName2,c1stName,c2ndName,
- sAttack1,sAttack2,sAttack3,sAttack4,
- sType1,sType2,cAT1,cAT2,
- nAbp1,nApp1,nAbp2,nApp2,nApp3,nApp4,nP1hp,nP1Uhp,
- s2Attack1,s2Attack2,s2Attack3,s2Attack4,
- s2Type1,s2Type2,c2AT1,c2AT2,
- n2Abp1,n2App1,n2Abp2,n2App2,n2App3,n2App4,nP2hp,nP2Uhp);*/
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void pickMove(char *cPokemonName1,char *cPokemonName2,char *c1stName,char *c2ndName,
- char *sAttack1,char *sAttack2,char *sAttack3,char *sAttack4,
- char sType1,char sType2,char cAT1,char cAT2,
- int nAbp1,int nApp1,int nAbp2,int nApp2,int nApp3,int nApp4,int nP1hp,int nP1Uhp,
- char *s2Attack1,char *s2Attack2,char *s2Attack3,char *s2Attack4,
- char s2Type1,char s2Type2,char c2AT1,char c2AT2,
- int n2Abp1,int n2App1,int n2Abp2,int n2App2,int n2App3,int n2App4,int nP2hp,int nP2Uhp) // user will pick their move
- {
- char cChoice1, cChoice2;
- if (nP1Uhp!=0 || nP2Uhp!=0){
- printf("\n\n\n\t %5s's Pokemon \t\t\t\t\t\t\t %5s's Pokemon \n", c1stName,c2ndName); // displays the match
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t|| %s ||\t\t\t\t\t\t\t|| %s || \n",cPokemonName1, cPokemonName2 );
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("\t %d/%d \t\t\t\t\t\t\t %d/%d \n\n", nP1Uhp,nP1hp,nP2Uhp, nP2hp);
- printf("Player 1:\n");
- printf("%s\n", cPokemonName1);
- printf("Choose your move:\n");
- printf("%s--BP:%d--PP:%d [A]\n", sAttack1,nAbp1,nApp1);
- printf("%s--BP:%d--PP:%d [B]\n", sAttack2,nAbp2,nApp2);
- printf("%s--BP:00--PP:%d [C]\n", sAttack3,nApp3);
- printf("%s--BP:00--PP:%d [D]\n", sAttack4,nApp4);
- scanf("%c", &cChoice1);
- cChoice1 = tolower(cChoice1);
- fflush(stdin);
- printf("\n\n\n\t %5s's Pokemon \t\t\t\t\t\t\t %5s's Pokemon \n", c1stName,c2ndName); // displays the match
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t|| %s ||\t\t\t\t\t\t\t|| %s || \n",cPokemonName1, cPokemonName2 );
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("\t %d/%d \t\t\t\t\t\t\t %d/%d \n\n", nP1Uhp,nP1hp,nP2Uhp, nP2hp);
- printf("Player 2:\n");
- printf("%s\n", cPokemonName1);
- printf("Choose your move:\n");
- printf("%s--BP:%d--PP:%d [A]\n", s2Attack1,n2Abp1,n2App1);
- printf("%s--BP:%d--PP:%d [B]\n", s2Attack2,n2Abp2,n2App2);
- printf("%s--BP:00--PP:%d [C]\n", s2Attack3,n2App3);
- printf("%s--BP:00--PP:%d [D]\n", s2Attack4,n2App4);
- scanf("%c", &cChoice2);
- cChoice2 = tolower(cChoice2);
- fflush(stdin);
- damageTurn(cPokemonName1,cPokemonName2,c1stName,c2ndName,
- sAttack1,sAttack2,sAttack3,sAttack4,sType1,sType2,cAT1, cAT2,nAbp1, nApp1, nAbp2, nApp2, nApp3, nApp4,nP1hp,nP1Uhp,
- s2Attack1,s2Attack2,s2Attack3,s2Attack4,s2Type1,s2Type2,c2AT1, c2AT2,n2Abp1, n2App1, n2Abp2, n2App2, n2App3, n2App4,nP2hp,nP2Uhp,cChoice1,cChoice2);
- }
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void mainGame(char cPokemon1,char cPokemon2, char *cPokemonName1,char *cPokemonName2,char *c1stName,char *c2ndName){
- char *sAttack1,*sAttack2,*sAttack3,*sAttack4,*s2Attack1,*s2Attack2,*s2Attack3,*s2Attack4; //pokemon's moves
- char sType1,sType2, s2Type1,s2Type2; // pokemon types
- char cAT1, cAT2, c2AT1, c2AT2; // pokemon's attack types
- int nAbp1, nApp1, nAbp2, nApp2, nApp3, nApp4, n2Abp1, n2App1, n2Abp2, n2App2, n2App3, n2App4; // pokemon's bp & pp
- int nP1hp, nP2hp; // pokemon's hp
- int nP1Uhp, nP2Uhp; // pokemon's updated hp
- switch(cPokemon1){ // player 1's pokemon stats
- case 'e':
- sType1 = 'F';
- sType2 = 'N';
- nP1hp = 150;
- nP1Uhp = 150;
- sAttack1 = "Fire Blast";
- cAT1 = 'f';
- nAbp1 = 30;
- nApp1 = 5;
- sAttack2 = "Earthquake";
- cAT2 = 'g';
- nAbp2 = 30;
- nApp2 = 5;
- sAttack3 = "Protect";
- nApp3 = 5;
- sAttack4 = "Charge Up";
- nApp4 = 5;
- break;
- case 'm':
- sType1 = 'W';
- sType2 = 'N';
- nP1hp = 200;
- nP1Uhp = 2000;
- sAttack1 = "Scald";
- cAT1 = 'w';
- nAbp1 = 20;
- nApp1 = 7;
- sAttack2 = "Ice Beam";
- cAT2 = 'i';
- nAbp2 = 20;
- nApp2 = 7;
- sAttack3 = "Protect";
- nApp3 = 5;
- sAttack4 = "Charge Up";
- nApp4 = 5;
- break;
- case 't':
- sType1 = 'L';
- sType2 = 'G';
- nP1hp = 220;
- nP1Uhp = 220;
- sAttack1 = "Dig";
- cAT1 = 'g';
- nAbp1 = 20;
- nApp1 = 7;
- sAttack2 = "Leaf Storm";
- cAT2 = 'l';
- nAbp2 = 40;
- nApp2 = 5;
- sAttack3 = "Protect";
- nApp3 = 5;
- sAttack4 = "Charge Up";
- nApp4 = 5;
- break;
- case 'p':
- sType1 = 'E';
- sType2 = 'N';
- nP1hp = 120;
- nP1Uhp = 120;
- sAttack1 = "Thunderbolt";
- cAT1 = 'e';
- nAbp1 = 10;
- nApp1 = 10;
- sAttack2 = "Dig";
- cAT2 = 'g';
- nAbp2 = 20;
- nApp2 = 7;
- sAttack3 = "Protect";
- nApp3 = 5;
- sAttack4 = "Charge Up";
- nApp4 = 5;
- break;
- case 'g':
- sType1 = 'G';
- sType2 = 'N';
- nP1hp = 150;
- nP1Uhp = 150;
- sAttack1 = "Fissure";
- cAT1 = 'g';
- nAbp1 = 40;
- nApp1 = 5;
- sAttack2 = "Fire Blast";
- cAT2 = 'f';
- nAbp2 = 30;
- nApp2 = 5;
- sAttack3 = "Protect";
- nApp3 = 5;
- sAttack4 = "Charge Up";
- nApp4 = 5;
- break;
- case 'l':
- sType1 = 'I';
- sType2 = 'W';
- nP1hp = 190;
- nP1Uhp = 190;
- sAttack1 = "Ice Beam";
- cAT1 = 'i';
- nAbp1 = 20;
- nApp1 = 7;
- sAttack2 = "Scald";
- cAT2 = 'w';
- nAbp2 = 20;
- nApp2 = 7;
- sAttack3 = "Protect";
- nApp3 = 5;
- sAttack4 = "Charge Up";
- nApp4 = 5;
- break;
- case 's':
- sType1 = 'G';
- sType2 = 'E';
- nP1hp = 130;
- nP1Uhp = 130;
- sAttack1 = "Water Gun";
- cAT1 = 'w';
- nAbp1 = 10;
- nApp1 = 10;
- sAttack2 = "Earthquake";
- cAT2 = 'g';
- nAbp2 = 30;
- nApp2 = 5;
- sAttack3 = "Protect";
- nApp3 = 5;
- sAttack4 = "Charge Up";
- nApp4 = 5;
- break;
- }
- switch(cPokemon2){ // player's 2 pokemon stats
- case 'e':
- s2Type1 = 'F';
- s2Type2 = 'N';
- nP2hp = 150;
- nP2Uhp = 150;
- s2Attack1 = "Fire Blast";
- c2AT1 = 'f';
- n2Abp1 = 30;
- n2App1 = 5;
- s2Attack2 = "Earthquake";
- c2AT2 = 'g';
- n2Abp2 = 30;
- n2App2 = 5;
- s2Attack3 = "Protect";
- n2App3 = 5;
- s2Attack4 = "Charge Up";
- n2App4 = 5;
- break;
- case 'm':
- s2Type1 = 'W';
- s2Type2 = 'N';
- nP2hp = 200;
- nP2Uhp = 200;
- s2Attack1 = "Scald";
- c2AT1 = 'w';
- n2Abp1 = 20;
- n2App1 = 7;
- s2Attack2 = "Ice Beam";
- c2AT2 = 'i';
- n2Abp2 = 20;
- n2App2 = 7;
- s2Attack3 = "Protect";
- n2App3 = 5;
- s2Attack4 = "Charge Up";
- n2App4 = 5;
- break;
- case 't':
- s2Type1 = 'L';
- s2Type2 = 'G';
- nP2hp = 220;
- nP2Uhp = 220;
- s2Attack1 = "Dig";
- c2AT1 = 'g';
- n2Abp1 = 20;
- n2App1 = 7;
- s2Attack2 = "Leaf Storm";
- c2AT2 = 'l';
- n2Abp2 = 40;
- n2App2 = 5;
- s2Attack3 = "Protect";
- n2App3 = 5;
- s2Attack4 = "Charge Up";
- n2App4 = 5;
- break;
- case 'p':
- s2Type1 = 'E';
- s2Type2 = 'N';
- nP2hp = 120;
- nP2Uhp = 120;
- s2Attack1 = "Thunderbolt";
- c2AT1 = 'e';
- n2Abp1 = 10;
- n2App1 = 10;
- s2Attack2 = "Dig";
- c2AT2 = 'g';
- n2Abp2 = 20;
- n2App2 = 7;
- s2Attack3 = "Protect";
- n2App3 = 5;
- s2Attack4 = "Charge Up";
- n2App4 = 5;
- break;
- case 'g':
- s2Type1 = 'G';
- s2Type2 = 'N';
- nP2hp = 150;
- nP2Uhp = 150;
- s2Attack1 = "Fissure";
- c2AT1 = 'g';
- n2Abp1 = 40;
- n2App1 = 5;
- s2Attack2 = "Fire Blast";
- c2AT2 = 'f';
- n2Abp2 = 30;
- n2App2 = 5;
- s2Attack3 = "Protect";
- n2App3 = 5;
- s2Attack4 = "Charge Up";
- n2App4 = 5;
- break;
- case 'l':
- s2Type1 = 'I';
- s2Type2 = 'W';
- nP2hp = 190;
- nP2Uhp = 190;
- s2Attack1 = "Ice Beam";
- c2AT1 = 'i';
- n2Abp1 = 20;
- n2App1 = 7;
- s2Attack2 = "Scald";
- c2AT2 = 'w';
- n2Abp2 = 20;
- n2App2 = 7;
- s2Attack3 = "Protect";
- n2App3 = 5;
- s2Attack4 = "Charge Up";
- n2App4 = 5;
- break;
- case 's':
- s2Type1 = 'G';
- s2Type2 = 'E';
- nP2hp = 130;
- nP2Uhp = 130;
- s2Attack1 = "Water Gun";
- c2AT1 = 'w';
- n2Abp1 = 10;
- n2App1 = 10;
- s2Attack2 = "Earthquake";
- c2AT2 = 'g';
- n2Abp2 = 30;
- n2App2 = 5;
- s2Attack3 = "Protect";
- n2App3 = 5;
- s2Attack4 = "Charge Up";
- n2App4 = 5;
- break;
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- pickMove(cPokemonName1,cPokemonName2,c1stName,c2ndName,
- sAttack1,sAttack2,sAttack3,sAttack4,sType1,sType2,cAT1, cAT2,nAbp1, nApp1, nAbp2, nApp2, nApp3, nApp4,nP1hp,nP1Uhp,
- s2Attack1,s2Attack2,s2Attack3,s2Attack4,s2Type1,s2Type2,c2AT1, c2AT2,n2Abp1, n2App1, n2Abp2, n2App2, n2App3, n2App4,nP2hp,nP2Uhp);
- }
- void transition(char cPokemon1,char cPokemon2,char *c1stName,char *c2ndName){
- char *cPokemonName1, *cPokemonName2;
- switch(cPokemon1){ //displays the chosen pokemon Name
- case 'e': cPokemonName1 = "Entei";
- break;
- case 'm': cPokemonName1 = "Milotic";
- break;
- case 't': cPokemonName1 = "Torterra";
- break;
- case 'p': cPokemonName1 = "Pikachu";
- break;
- case 'g': cPokemonName1 = "Groudon";
- break;
- case 'l': cPokemonName1 = "Lapras";
- break;
- case 's': cPokemonName1 = "Stunfisk";
- break;
- }
- switch(cPokemon2){
- case 'e': cPokemonName2 = "Entei";
- break;
- case 'm': cPokemonName2 = "Milotic";
- break;
- case 't': cPokemonName2 = "Torterra";
- break;
- case 'p': cPokemonName2 = "Pikachu";
- break;
- case 'g': cPokemonName2 = "Groudon";
- break;
- case 'l': cPokemonName2 = "Lapras";
- break;
- case 's': cPokemonName2 = "Stunfisk";
- break;
- }
- 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
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t|| %s ||\t\t\t VS\t\t\t\t|| %s || \n",cPokemonName1, cPokemonName2 );
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t ============= \t\t\t\t\t\t\t =============\n\n\n");
- printf("\t\t\t\t\t\t\t\t ==============================================\n");
- printf("\t\t\t\t\t\t\t\t|| INSTRUCTION ||\n");
- printf("\t\t\t\t\t\t\t\t|| ||\n");
- printf("\t\t\t\t\t\t\t\t|| Player 1 will make the first attack, ||\n");
- printf("\t\t\t\t\t\t\t\t|| then Player 2. Each Player will take ||\n");
- printf("\t\t\t\t\t\t\t\t|| turns selecting moves their Pokemon ||\n");
- printf("\t\t\t\t\t\t\t\t|| will use. The objective is to defeat ||\n");
- printf("\t\t\t\t\t\t\t\t|| your opponent's pokemon and win. ||\n");
- printf("\t\t\t\t\t\t\t\t|| ||\n");
- printf("\t\t\t\t\t\t\t\t ==============================================\n\n");
- mainGame(cPokemon1, cPokemon2, cPokemonName1,cPokemonName2,c1stName,c2ndName);
- }
- void pokemonSelection(char *c1stName,char *c2ndName){
- char cPokemon1, cPokemon2;
- printf("\n\t %5s's Pokemon \t\t\t\t\t\t\t %5s's Pokemon \n", c1stName,c2ndName);
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("---------------------------------------------------------------------------------------------------------------------------------------------\n");
- printf("|| | | | | Unique Move 1 | Unique Move 2 ||\n");
- printf("||----------|---------|---------|------|-------------------------------------------------|-------------------------------------------------||\n");
- printf("|| Name | Type1 | Type2 | HP | Name | Base Power | Power Points | Type | Name | Base Power | Power Points | Type || \n");
- printf("||----------|-------------------|------|------------|------------|--------------|--------|------------|------------|--------------|--------||\n");
- printf("|| -Entei | -Fire | -None | -150 | Fire Blast | -30 damage | 5pp | Fire | Earthquake | -30 damage | 5pp | Ground || [E]\n");
- printf("|| -Milotic | Water | -None | -200 | -Scald | -20 damage | 7pp | -Water | Ice Beam | -20 damage | 7pp | -Ice || [M]\n");
- printf("|| Torterra | Grass | -Ground | -220 | -Dig | -20 damage | 7pp | Ground | Leaf Storm | -40 damage | 5pp | -Grass || [T]\n");
- printf("|| -Pikachu |-Electric| -None | -120 |-Thunderbolt| -10 damage | 10pp |Electric| -Dig | -20 damage | 7pp | Ground || [P]\n");
- printf("|| -Groudon | -Ground | -None | -150 | -Fissure | -40 damage | 5pp | Ground | Fire Blast | -30 damage | 5pp | Fire || [G]\n");
- printf("|| Lapras | Ice | Water | -190 | Ice Beam | -20 damage | 7pp |Electric| -Scald | -20 damage | 7pp | Water || [L]\n");
- printf("|| Stunfisk | -Ground |-Electric| -130 | -Water Gun | -10 damage | 10pp | -Water | Earthquake | -30 damage | 5pp | Ground || [S]\n");
- printf("---------------------------------------------------------------------------------------------------------------------------------------------\n");
- printf("\n\tProfessor Oak: %5s, please select your pokemon.", c1stName); // pokemon selection phase
- scanf("%c", &cPokemon1);
- cPokemon1 = tolower(cPokemon1);
- fflush(stdin);
- printf("\n\tProfessor Oak: %5s, please select your pokemon.", c2ndName);
- scanf("%c", &cPokemon2);
- cPokemon2 = tolower(cPokemon2);
- fflush(stdin);
- transition(cPokemon1, cPokemon2, c1stName, c2ndName);
- }
- void firstPart(){
- char c1stName[100],c2ndName[100];
- /* gets the names of the two
- players */
- printf("(5characters only)\n");
- printf("Player 1 NAME:");
- scanf("%s", &c1stName);
- fflush(stdin);
- printf("\nPlayer 2 NAME:");
- scanf("%s", &c2ndName);
- fflush(stdin);
- pokemonSelection(c1stName, c2ndName);
- }
- void start(){ // main screen
- char cChoice;
- printf("\t\t\t\t\t\t\t\t\t\t Enter:");
- scanf("%c", &cChoice);
- fflush(stdin);
- printf("\n");
- cChoice = tolower(cChoice); // to make the reply valid for lower and uppercase input
- if (cChoice == 'a' ){ // proceed to the main game
- firstPart();
- }
- else if (cChoice == 'b'){ // exits the program
- printf("\t\t\t\t\t THANK YOU FOR PLAYING");
- }
- else{ // invalid output
- printf("\t\t\t\t\t\t Wrong Input.\n");
- start();
- }
- }
- int main()
- {
- printf("\t\t\t\t\t\t\t\t ==============================================\n");
- printf("\t\t\t\t\t\t\t\t|| ||\n");
- printf("\t\t\t\t\t\t\t\t|| ||\n");
- printf("\t\t\t\t\t\t\t\t|| 1 V 1 ||\n");
- printf("\t\t\t\t\t\t\t\t|| ||\n");
- printf("\t\t\t\t\t\t\t\t|| POKEMON BATTLE SIMULATOR ||\n");
- printf("\t\t\t\t\t\t\t\t|| ||\n");
- printf("\t\t\t\t\t\t\t\t|| ||\n");
- printf("\t\t\t\t\t\t\t\t|| ||\n");
- printf("\t\t\t\t\t\t\t\t ==============================================\n\n");
- printf("\t\t\t\t\t\t\t\t [A] [B] \n");
- printf("\t\t\t\t\t\t\t\t START END \n");
- start();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement