Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <pokeagb/pokeagb.h>
- #include "judge.h"
- static const struct Contestant fishing_contestants[] =
- {
- {SPECIES_MAGIKARP, 1, 1, 5},
- {SPECIES_GYARADOS, 2, 20, 30},
- {SPECIES_WAILORD, 3, 50, 60}
- /* just an example tbh */
- };
- static void fishing_contest(u8 entry_number)
- {
- u32 *contestants;
- struct Pokemon* contestants = malloc_and_clear(sizeof(Pokemon) * entry_number); /* treat contestants like an array */
- memcpy(*contestants[0], *party_opponent[0], sizeof(Pokemon)); /* the 0th entry is you */
- u8 loop_counter;
- u8 table_slot = rand() % number_of_encounters;
- u16 entrant_species;
- u8 entrant_level;
- 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 */
- {
- entrant_species = fishing_contestants[table_slot]->species;
- entrant_level = get_generated_level(entrant_species);
- make_pokemon_full(*contestants[loop_counter + 1], entrant_species, entrant_level, 0x21, 1, 0, 2, 0); /* don't use the given PID or TID */
- }
- judge(contestants, entry_number); /* get the stuff and store the results into vars */
- return;
- }
- u8 get_generated_level(u16 entrant_species)
- {
- entrant_level = (rand() % (fishing_contestants[table_slot]->max_level - fishing_contestants[table_slot]->min_level) + fishing_contestants[table_slot]->min_level);
- return entrant_level;
- }
- void judge(u32 *contestants, u8 entry_number)
- {
- u8 counter;
- for (counter = 0; counter < entry_number; counter++)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement