Advertisement
NewDenverCity

Untitled

Jan 16th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.59 KB | None | 0 0
  1. #include <pokeagb/pokeagb.h>
  2. #include "judge.h"
  3.  
  4. static const struct Contestant fishing_contestants[] =
  5. {
  6.   {SPECIES_MAGIKARP, 1, 1, 5},
  7.     {SPECIES_GYARADOS, 2, 20, 30},
  8.     {SPECIES_WAILORD, 3, 50, 60}
  9.     /* just an example tbh */
  10. };
  11.  
  12. static void fishing_contest(u8 entry_number)
  13. {
  14.     u32 *contestants;
  15.     struct Pokemon* contestants = malloc_and_clear(sizeof(Pokemon) * entry_number); /* treat contestants like an array */
  16.     memcpy(*contestants[0], *party_opponent[0], sizeof(Pokemon)); /* the 0th entry is you */
  17.     u8 loop_counter;
  18.     u8 table_slot = rand() % number_of_encounters;
  19.     u16 entrant_species;
  20.     u8 entrant_level;
  21.     for (loop_counter = 0; loop_counter < entry_number - 1; loop_counter++); /* generate a pokemon from the fishing_contestants list, make the pokemon from that list */
  22.     {
  23.         entrant_species = fishing_contestants[table_slot]->species;
  24.         entrant_level = get_generated_level(entrant_species);
  25.         make_pokemon_full(*contestants[loop_counter + 1], entrant_species, entrant_level, 0x21, 1, 0, 2, 0); /* don't use the given PID or TID */
  26.     }
  27.     judge(contestants, entry_number); /* get the stuff and store the results into vars */
  28.     return;
  29. }
  30.  
  31. u8 get_generated_level(u16 entrant_species)
  32. {
  33.     entrant_level = (rand() % (fishing_contestants[table_slot]->max_level - fishing_contestants[table_slot]->min_level) + fishing_contestants[table_slot]->min_level);
  34.     return entrant_level;
  35. }
  36.  
  37. void judge(u32 *contestants, u8 entry_number)
  38. {
  39.     u8 counter;
  40.     for (counter = 0; counter < entry_number; counter++)
  41.     {
  42.        
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement