Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically generate hardcoded species tables #191

Merged
merged 9 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions consts/pokemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@
"GENDER_RATIO_FEMALE_ONLY": 254,
"GENDER_RATIO_NO_GENDER": 255
}
},
"@PokemonFootprintSize": {
"type": "enum",
"as_preproc": true,
"values": [
"FOOTPRINT_SMALL",
"FOOTPRINT_MEDIUM",
"FOOTPRINT_LARGE"
]
}
}
}
11 changes: 11 additions & 0 deletions include/overlay113/footprint_data.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef POKEPLATINUM_FOOTPRINT_DATA_H
#define POKEPLATINUM_FOOTPRINT_DATA_H

typedef struct FootprintData {
u8 hasFootprint;
u8 footprintSize;
u16 unk_02;
} FootprintData;

#endif // POKEPLATINUM_FOOTPRINT_DATA_H

4 changes: 2 additions & 2 deletions include/overlay113/ov113_02260620.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void ov113_02260620(MessageLoader * param0, StringTemplate * param1, Window para
void ov113_02260714(Window param0[], u32 param1);
u16 ov113_0226072C(int param0, u32 param1);
int ov113_02260748(UnkStruct_ov113_02260818 * param0, int param1);
BOOL ov113_02260788(int param0, int param1, BOOL param2);
BOOL ov113_022607B8(int param0, int param1);
BOOL PokemonHasOverworldFootprint(int param0, int param1, BOOL param2);
int PokemonOverworldFootprintSize(int param0, int param1);

#endif // POKEPLATINUM_OV113_02260620_H
10 changes: 0 additions & 10 deletions include/overlay113/struct_ov113_02260D90.h

This file was deleted.

33 changes: 33 additions & 0 deletions include/tutor_movesets.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef POKEPLATINUM_TUTOR_MOVESETS_H
#define POKEPLATINUM_TUTOR_MOVESETS_H

#include "consts/moves.h"

enum TutorLocation {
TUTOR_LOCATION_ROUTE_212 = 0,
TUTOR_LOCATION_SURVIVAL_AREA,
TUTOR_LOCATION_SNOWPOINT_CITY,
};

typedef struct TeachableMove {
u16 moveID;
u8 redCost;
u8 blueCost;
u8 yellowCost;
u8 greenCost;
enum TutorLocation location;
} TeachableMove;

#include "res/field/tutorable_moves.h"

#define MOVESET_MASK_SIZE (s32)((NELEMS(sTeachableMoves) + 7) / 8)

// Each of the bits in this array correspond to a move in sTeachableMoves
// Therefore the size is dependent on how many teachable moves exist

typedef struct MovesetMask {
u8 maskData[MOVESET_MASK_SIZE];
} MovesetMask;

#endif // POKEPLATINUM_TUTOR_MOVESETS_H

2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ main = executable('main',
c_consts_generators,
asm_consts_generators,
naix_headers,
gen_species_headers,
tutorable_moves_h,
],
c_args: [
pokeplatinum_args,
Expand Down
12 changes: 12 additions & 0 deletions res/field/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
subdir('encounters')
subdir('events')
subdir('scripts')

move_tutors_json = files('move_tutors.json')

tutorable_moves_h = custom_target('tutorable_moves.h',
input: move_tutors_json,
output: 'tutorable_moves.h',
command: [
make_tutorable_moves_py,
'--schema', move_tutors_json,
'--output-dir', meson.current_build_dir(),
]
)
274 changes: 274 additions & 0 deletions res/field/move_tutors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
{
"static": true,
"const": true,
"type": "TeachableMove",
"name": "sTeachableMoves",
"moves": {
"MOVE_DIVE": {
"redCost": 2,
"blueCost": 4,
"yellowCost": 2,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_MUD_SLAP": {
"redCost": 4,
"blueCost": 4,
"yellowCost": 0,
"greenCost": 0,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_FURY_CUTTER": {
"redCost": 0,
"blueCost": 8,
"yellowCost": 0,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_ICY_WIND": {
"redCost": 0,
"blueCost": 6,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_ROLLOUT": {
"redCost": 4,
"blueCost": 2,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_THUNDER_PUNCH": {
"redCost": 2,
"blueCost": 6,
"yellowCost": 0,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_FIRE_PUNCH": {
"redCost": 2,
"blueCost": 6,
"yellowCost": 0,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_SUPERPOWER": {
"redCost": 8,
"blueCost": 0,
"yellowCost": 0,
"greenCost": 0,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_ICE_PUNCH": {
"redCost": 2,
"blueCost": 6,
"yellowCost": 0,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_IRON_HEAD": {
"redCost": 6,
"blueCost": 0,
"yellowCost": 2,
"greenCost": 0,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_AQUA_TAIL": {
"redCost": 6,
"blueCost": 0,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_OMINOUS_WIND": {
"redCost": 0,
"blueCost": 6,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_GASTRO_ACID": {
"redCost": 4,
"blueCost": 0,
"yellowCost": 2,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_SNORE": {
"redCost": 2,
"blueCost": 0,
"yellowCost": 4,
"greenCost": 2,
"location": "TUTOR_LOCATION_SNOWPOINT_CITY"
},
"MOVE_SPITE": {
"redCost": 0,
"blueCost": 0,
"yellowCost": 8,
"greenCost": 0,
"location": "TUTOR_LOCATION_SNOWPOINT_CITY"
},
"MOVE_AIR_CUTTER": {
"redCost": 2,
"blueCost": 4,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_HELPING_HAND": {
"redCost": 2,
"blueCost": 0,
"yellowCost": 4,
"greenCost": 2,
"location": "TUTOR_LOCATION_SNOWPOINT_CITY"
},
"MOVE_ENDEAVOR": {
"redCost": 4,
"blueCost": 0,
"yellowCost": 4,
"greenCost": 0,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_OUTRAGE": {
"redCost": 6,
"blueCost": 0,
"yellowCost": 2,
"greenCost": 0,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_ANCIENT_POWER": {
"redCost": 6,
"blueCost": 0,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_SYNTHESIS": {
"redCost": 0,
"blueCost": 0,
"yellowCost": 2,
"greenCost": 6,
"location": "TUTOR_LOCATION_SNOWPOINT_CITY"
},
"MOVE_SIGNAL_BEAM": {
"redCost": 2,
"blueCost": 2,
"yellowCost": 2,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_ZEN_HEADBUTT": {
"redCost": 0,
"blueCost": 4,
"yellowCost": 4,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_VACUUM_WAVE": {
"redCost": 2,
"blueCost": 4,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_EARTH_POWER": {
"redCost": 6,
"blueCost": 0,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_GUNK_SHOT": {
"redCost": 4,
"blueCost": 2,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_TWISTER": {
"redCost": 6,
"blueCost": 0,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_SEED_BOMB": {
"redCost": 4,
"blueCost": 0,
"yellowCost": 0,
"greenCost": 4,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_IRON_DEFENSE": {
"redCost": 4,
"blueCost": 2,
"yellowCost": 2,
"greenCost": 0,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_MAGNET_RISE": {
"redCost": 0,
"blueCost": 2,
"yellowCost": 4,
"greenCost": 2,
"location": "TUTOR_LOCATION_SNOWPOINT_CITY"
},
"MOVE_LAST_RESORT": {
"redCost": 0,
"blueCost": 0,
"yellowCost": 0,
"greenCost": 8,
"location": "TUTOR_LOCATION_SNOWPOINT_CITY"
},
"MOVE_BOUNCE": {
"redCost": 4,
"blueCost": 0,
"yellowCost": 2,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_TRICK": {
"redCost": 0,
"blueCost": 4,
"yellowCost": 4,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_HEAT_WAVE": {
"redCost": 4,
"blueCost": 2,
"yellowCost": 0,
"greenCost": 2,
"location": "TUTOR_LOCATION_SURVIVAL_AREA"
},
"MOVE_KNOCK_OFF": {
"redCost": 4,
"blueCost": 4,
"yellowCost": 0,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_SUCKER_PUNCH": {
"redCost": 0,
"blueCost": 6,
"yellowCost": 2,
"greenCost": 0,
"location": "TUTOR_LOCATION_ROUTE_212"
},
"MOVE_SWIFT": {
"redCost": 0,
"blueCost": 2,
"yellowCost": 2,
"greenCost": 4,
"location": "TUTOR_LOCATION_SNOWPOINT_CITY"
},
"MOVE_UPROAR": {
"redCost": 0,
"blueCost": 0,
"yellowCost": 6,
"greenCost": 2,
"location": "TUTOR_LOCATION_SNOWPOINT_CITY"
}
}
}
Loading
Loading