Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Script started on Thu 06 Sep 2012 05:30:56 PM PDT
- % cat TrainerEXP.c
- /* * * * *
- * The Trainer Trap *
- Starrodkirby86
- * Helps calculate the EXP given *
- by trainers & wild PKMN.
- * v.0.5, 9/6/2012 *
- * * * * */
- #include <stdio.h> /* printf, scanf functions */
- #include <math.h> /* Math library. */
- #include <string.h> /* String functions. */
- int
- main()
- {
- double owner, /* 1 if wild, 1.5 if trainer's */
- ot, /* 1 if ot, 1.5 if traded, 1.7 if international */
- base_exp, /* Base EXP of PKMN, Lookup manually */
- lucky, /* 1.5 if Lucky Egg, 1 if not */
- level, /* Level of the fainted Pokemon */
- participants; /* Number of Pokemon participating */
- int final_exp; /* Final EXP number */
- int name_rand; /* Name randomization. */
- char trainer[128], /* Trainer name */
- pokemon[16]; /* Pokemon name */
- /* Ask for data */
- printf("What's this Pokemon's name?\n");
- scanf("%s", pokemon);
- printf("Enter 1 if %s is wild. Enter 1.5 if %s is owned by a Trainer.\n",pokemon,pokemon);
- scanf("%lf", &owner);
- printf("What's %s's level?\n",pokemon);
- scanf("%lf", &level);
- printf("What's %s's base EXP?\n",pokemon);
- scanf("%lf", &base_exp);
- printf("Enter 1 if your Pokemon is your own. 1.5 if traded, 1.7 if internationally traded.\n");
- scanf("%lf", &ot);
- printf("Type in 1.5 if your Pokemon is holding a Lucky Egg. Otherwise, type 1.\n");
- scanf("%lf", &lucky);
- printf("How many Pokemon participated in the battle?\n");
- scanf("%lf", &participants);
- /* Calculations. */
- final_exp = ( owner * ot * base_exp * lucky * level ) / ( 7 * participants );
- if(owner == 1.5)
- {
- name_rand = rand(0,5);
- if(rand == 0)
- {strcpy(trainer, "Youngster Joey");}
- else if (rand == 1)
- {strcpy(trainer, "Gym Leader Brock");}
- else if (rand == 2)
- {strcpy(trainer, "Rival Gary");}
- else if (rand == 3)
- {strcpy(trainer, "Team Rocket Grunt");}
- else if (rand == 4)
- {strcpy(trainer, "Bug Catcher Sammy");}
- else if (rand == 5)
- {strcpy(trainer, "Heartbreaker Charles");}
- else
- {strcpy(trainer, "PKMN Trainer Cal");}
- }
- if(owner == 1.5)
- {
- printf("%s's %s gives %d EXP.\n",trainer,pokemon,final_exp);
- }
- else
- {
- printf("The wild %s gives %d EXP.\n",pokemon,final_exp);
- }
- /* Results.
- printf("%s gives %d EXP.\n",pokemon,final_exp);*/
- return(0);
- }
- % exit
- % exit
- Script done on Thu 06 Sep 2012 05:31:06 PM PDT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement