Skip to content

Commit

Permalink
Decompile item data
Browse files Browse the repository at this point in the history
  • Loading branch information
Nomura-RH committed Jul 30, 2023
1 parent e8cc33c commit d7f2733
Show file tree
Hide file tree
Showing 6 changed files with 713 additions and 2 deletions.
158 changes: 158 additions & 0 deletions include/constants/items.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,161 @@
#define POCKET_ITEMS 0
#define POCKET_MEDICINE 1
#define POCKET_BALLS 2
#define POCKET_TMHMS 3
#define POCKET_BERRIES 4
#define POCKET_MAIL 5
#define POCKET_BATTLE_ITEMS 6
#define POCKET_KEY_ITEMS 7
#define POCKETS_COUNT 8

#define HOLD_EFFECT_NONE 0
#define HOLD_EFFECT_HP_RESTORE 1
#define HOLD_EFFECT_GIRATINA_BOOST 2
#define HOLD_EFFECT_DIALGA_BOOST 3
#define HOLD_EFFECT_PALKIA_BOOST 4
#define HOLD_EFFECT_PRZ_RESTORE 5
#define HOLD_EFFECT_SLP_RESTORE 6
#define HOLD_EFFECT_PSN_RESTORE 7
#define HOLD_EFFECT_BRN_RESTORE 8
#define HOLD_EFFECT_FRZ_RESTORE 9
#define HOLD_EFFECT_PP_RESTORE 10
#define HOLD_EFFECT_CONFUSE_RESTORE 11
#define HOLD_EFFECT_STATUS_RESTORE 12
#define HOLD_EFFECT_HP_PCT_RESTORE 13
#define HOLD_EFFECT_HP_RESTORE_SPICY 14
#define HOLD_EFFECT_HP_RESTORE_DRY 15
#define HOLD_EFFECT_HP_RESTORE_SWEET 16
#define HOLD_EFFECT_HP_RESTORE_BITTER 17
#define HOLD_EFFECT_HP_RESTORE_SOUR 18
#define HOLD_EFFECT_WEAKEN_SE_FIRE 19
#define HOLD_EFFECT_WEAKEN_SE_WATER 20
#define HOLD_EFFECT_WEAKEN_SE_ELECTRIC 21
#define HOLD_EFFECT_WEAKEN_SE_GRASS 22
#define HOLD_EFFECT_WEAKEN_SE_ICE 23
#define HOLD_EFFECT_WEAKEN_SE_FIGHT 24
#define HOLD_EFFECT_WEAKEN_SE_POISON 25
#define HOLD_EFFECT_WEAKEN_SE_GROUND 26
#define HOLD_EFFECT_WEAKEN_SE_FLYING 27
#define HOLD_EFFECT_WEAKEN_SE_PSYCHIC 28
#define HOLD_EFFECT_WEAKEN_SE_BUG 29
#define HOLD_EFFECT_WEAKEN_SE_ROCK 30
#define HOLD_EFFECT_WEAKEN_SE_GHOST 31
#define HOLD_EFFECT_WEAKEN_SE_DRAGON 32
#define HOLD_EFFECT_WEAKEN_SE_DARK 33
#define HOLD_EFFECT_WEAKEN_SE_STEEL 34
#define HOLD_EFFECT_WEAKEN_NORMAL 35
#define HOLD_EFFECT_PINCH_ATK_UP 36
#define HOLD_EFFECT_PINCH_DEF_UP 37
#define HOLD_EFFECT_PINCH_SPEED_UP 38
#define HOLD_EFFECT_PINCH_SPATK_UP 39
#define HOLD_EFFECT_PINCH_SPDEF_UP 40
#define HOLD_EFFECT_PINCH_CRITRATE_UP 41
#define HOLD_EFFECT_PINCH_RANDOM_UP 42
#define HOLD_EFFECT_HP_RESTORE_SE 43
#define HOLD_EFFECT_PINCH_ACC_UP 44
#define HOLD_EFFECT_PINCH_PRIORITY 45
#define HOLD_EFFECT_RECOIL_PHYSICAL 46
#define HOLD_EFFECT_RECOIL_SPECIAL 47
#define HOLD_EFFECT_ACC_REDUCE 48
#define HOLD_EFFECT_STATDOWN_RESTORE 49
#define HOLD_EFFECT_EXP_UP_SPEED_DOWN 50
#define HOLD_EFFECT_EXP_SHARE 51
#define HOLD_EFFECT_SOMETIMES_PRIORITY 52
#define HOLD_EFFECT_FRIENDSHIP_UP 53
#define HOLD_EFFECT_HEAL_INFATUATION 54
#define HOLD_EFFECT_CHOICE_ATK 55
#define HOLD_EFFECT_CRIT_UP 56
#define HOLD_EFFECT_STRENGTHEN_BUG 57
#define HOLD_EFFECT_MONEY_UP 58
#define HOLD_EFFECT_ENCOUNTERS_DOWN 59
#define HOLD_EFFECT_LATI_SPECIAL 60
#define HOLD_EFFECT_CLAMPERL_SPATK 61
#define HOLD_EFFECT_CLAMPERL_SPDEF 62
#define HOLD_EFFECT_FLEE 63
#define HOLD_EFFECT_NO_EVOLVE 64
#define HOLD_EFFECT_MAYBE_ENDURE 65
#define HOLD_EFFECT_EXP_UP 66
#define HOLD_EFFECT_CRITRATE_UP 67
#define HOLD_EFFECT_STRENGTHEN_STEEL 68
#define HOLD_EFFECT_HP_RESTORE_GRADUAL 69
#define HOLD_EFFECT_EVOLVE_SEADRA 70
#define HOLD_EFFECT_PIKA_SPATK_UP 71
#define HOLD_EFFECT_STRENGTHEN_GROUND 72
#define HOLD_EFFECT_STRENGTHEN_ROCK 73
#define HOLD_EFFECT_STRENGTHEN_GRASS 74
#define HOLD_EFFECT_STRENGTHEN_DARK 75
#define HOLD_EFFECT_STRENGTHEN_FIGHT 76
#define HOLD_EFFECT_STRENGTHEN_ELECTRIC 77
#define HOLD_EFFECT_STRENGTHEN_WATER 78
#define HOLD_EFFECT_STRENGTHEN_FLYING 79
#define HOLD_EFFECT_STRENGTHEN_POISON 80
#define HOLD_EFFECT_STRENGTHEN_ICE 81
#define HOLD_EFFECT_STRENGTHEN_GHOST 82
#define HOLD_EFFECT_STRENGTHEN_PSYCHIC 83
#define HOLD_EFFECT_STRENGTHEN_FIRE 84
#define HOLD_EFFECT_STRENGTHEN_DRAGON 85
#define HOLD_EFFECT_STRENGTHEN_NORMAL 86
#define HOLD_EFFECT_EVOLVE_PORYGON 87
#define HOLD_EFFECT_HP_RESTORE_ON_DMG 88
#define HOLD_EFFECT_CHANSEY_CRITRATE_UP 89
#define HOLD_EFFECT_DITTO_DEF_UP 90
#define HOLD_EFFECT_CUBONE_ATK_UP 91
#define HOLD_EFFECT_FARFETCHD_CRITRATE_UP 92
#define HOLD_EFFECT_ACCURACY_UP 93
#define HOLD_EFFECT_POWER_UP_PHYS 94
#define HOLD_EFFECT_POWER_UP_SPEC 95
#define HOLD_EFFECT_POWER_UP_SE 96
#define HOLD_EFFECT_EXTEND_SCREENS 97
#define HOLD_EFFECT_HP_DRAIN_ON_ATK 98
#define HOLD_EFFECT_CHARGE_SKIP 99
#define HOLD_EFFECT_PSN_USER 100
#define HOLD_EFFECT_BRN_USER 101
#define HOLD_EFFECT_DITTO_SPEED_UP 102
#define HOLD_EFFECT_ENDURE 103
#define HOLD_EFFECT_CRITRATE_UP_SLOWER 104
#define HOLD_EFFECT_BOOST_REPEATED 105
#define HOLD_EFFECT_SPEED_DOWN_GROUNDED 106
#define HOLD_EFFECT_SPEED_DOWN 107
#define HOLD_EFFECT_RECIPROCATE_INFAT 108
#define HOLD_EFFECT_HP_RESTORE_PSN_TYPE 109
#define HOLD_EFFECT_EXTEND_HAIL 110
#define HOLD_EFFECT_EXTEND_SANDSTORM 111
#define HOLD_EFFECT_EXTEND_SUN 112
#define HOLD_EFFECT_EXTEND_RAIN 113
#define HOLD_EFFECT_EXTEND_TRAPPING 114
#define HOLD_EFFECT_CHOICE_SPEED 115
#define HOLD_EFFECT_DMG_USER_CONTACT_XFR 116
#define HOLD_EFFECT_LVLUP_ATK_EV_UP 117
#define HOLD_EFFECT_LVLUP_DEF_EV_UP 118
#define HOLD_EFFECT_LVLUP_SPATK_EV_UP 119
#define HOLD_EFFECT_LVLUP_SPDEF_EV_UP 120
#define HOLD_EFFECT_LVLUP_SPEED_EV_UP 121
#define HOLD_EFFECT_LVLUP_HP_EV_UP 122
#define HOLD_EFFECT_SWITCH 123
#define HOLD_EFFECT_LEECH_BOOST 124
#define HOLD_EFFECT_CHOICE_SPATK 125
#define HOLD_EFFECT_ARCEUS_FIRE 126
#define HOLD_EFFECT_ARCEUS_WATER 127
#define HOLD_EFFECT_ARCEUS_ELECTRIC 128
#define HOLD_EFFECT_ARCEUS_GRASS 129
#define HOLD_EFFECT_ARCEUS_ICE 130
#define HOLD_EFFECT_ARCEUS_FIGHT 131
#define HOLD_EFFECT_ARCEUS_POISON 132
#define HOLD_EFFECT_ARCEUS_GROUND 133
#define HOLD_EFFECT_ARCEUS_FLYING 134
#define HOLD_EFFECT_ARCEUS_PSYCHIC 135
#define HOLD_EFFECT_ARCEUS_BUG 136
#define HOLD_EFFECT_ARCEUS_ROCK 137
#define HOLD_EFFECT_ARCEUS_GHOST 138
#define HOLD_EFFECT_ARCEUS_DRAGON 139
#define HOLD_EFFECT_ARCEUS_DARK 140
#define HOLD_EFFECT_ARCEUS_STEEL 141
#define HOLD_EFFECT_EVOLVE_RHYDON 142
#define HOLD_EFFECT_EVOLVE_ELECTABUZZ 143
#define HOLD_EFFECT_EVOLVE_MAGMAR 144
#define HOLD_EFFECT_EVOLVE_PORYGON2 145
#define HOLD_EFFECT_EVOLVE_DUSCLOPS 146

#define ITEM_NONE 0

// Balls
Expand Down
22 changes: 22 additions & 0 deletions include/constants/pokemon.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
#ifndef POKEPLATINUM_CONSTANTS_POKEMON_H
#define POKEPLATINUM_CONSTANTS_POKEMON_H

// Pokemon types
#define TYPE_NONE 255
#define TYPE_NORMAL 0
#define TYPE_FIGHTING 1
#define TYPE_FLYING 2
#define TYPE_POISON 3
#define TYPE_GROUND 4
#define TYPE_ROCK 5
#define TYPE_BUG 6
#define TYPE_GHOST 7
#define TYPE_STEEL 8
#define TYPE_MYSTERY 9
#define TYPE_FIRE 10
#define TYPE_WATER 11
#define TYPE_GRASS 12
#define TYPE_ELECTRIC 13
#define TYPE_PSYCHIC 14
#define TYPE_ICE 15
#define TYPE_DRAGON 16
#define TYPE_DARK 17
#define NUMBER_OF_MON_TYPES 18

enum {
MON_DATA_PERSONALITY,
MON_DATA_1,
Expand Down
26 changes: 24 additions & 2 deletions res/itemtool/itemdata/meson.build
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
pl_item_data_format_txt = files('pl_item_data_format.txt')
pl_item_data_csv = files('pl_item_data.csv')

pl_item_data_narc = custom_target('pl_item_data.narc',
output: 'pl_item_data.narc',
input: [
pl_item_data_format_txt,
pl_item_data_csv
],
command: [
csv2bin_exe,
'compile',
'@INPUT1@',
'@OUTPUT0@',
'@INPUT0@',
'--narc',
'--pad', '0xFF',
'-i', '@SOURCE_ROOT@/include'
]
)

nitrofs_files += pl_item_data_narc

prebuilt_files = [
'item_data.narc',
'item_icon.narc',
'nuts_data.narc',
'pl_item_data.narc'
'nuts_data.narc'
]

foreach f : prebuilt_files
Expand Down
Loading

0 comments on commit d7f2733

Please sign in to comment.