diff --git a/Makefile b/Makefile index 131189a..56784c0 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ include $(DEVKITARM)/base_tools SRC_FILES ?= $(wildcard src/*.c) OBJ_FILES ?= $(SRC_FILES:src/%.c=build/src/%.o) -CFLAGS = -Iinclude -mlong-calls -Wall -Wextra -mthumb -mno-thumb-interwork -fno-inline -fno-builtin -std=gnu11 -mabi=apcs-gnu -mcpu=arm7tdmi -march=armv4t -mtune=arm7tdmi -x c -c -MMD -g -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast -Wno-stringop-overflow $(EXTRA_CFLAGS) +CFLAGS = -Iinclude -mlong-calls -Wall -Wextra -mthumb -mno-thumb-interwork -fno-inline -fno-builtin -std=gnu11 -mabi=apcs-gnu -mcpu=arm7tdmi -march=armv4t -mtune=arm7tdmi -x c -c -MMD -g -mthumb-interwork -Wimplicit -Wparentheses -Wno-unused -Werror -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast -Wno-stringop-overflow $(EXTRA_CFLAGS) LD = $(PREFIX)ld LDFLAGS = --relocatable -T rom.ld $(EXTRA_LDFLAGS) diff --git a/README.md b/README.md index 53c7e22..b0228fd 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ This patch is mostly compatible with vanilla saves. The bag expansion patch **wi - Disease type removal - Type icons reverted to default Ruby ones - Emerald style Save Prompt +- Colored stat values based on nature +- Repeated item usage
diff --git a/config.asm b/config.asm index 61c887b..bb5634b 100644 --- a/config.asm +++ b/config.asm @@ -42,6 +42,13 @@ ; Enable this to have shadows on NPCs like in HGSS. .definelabel OW_EVENT_SHADOWS, 1 +; Nature based colored stats in the Summary Screen. +.definelabel COLORED_STATS, 1 + +; WIP +; Use items repeatedly without going back to the bag each time. +.definelabel REPEATED_ITEM, 1 + ; Bugfixes ; -------- diff --git a/include/constants/songs.h b/include/constants/songs.h new file mode 100644 index 0000000..9a268f9 --- /dev/null +++ b/include/constants/songs.h @@ -0,0 +1,379 @@ +#ifndef GUARD_CONSTANTS_SONGS_H +#define GUARD_CONSTANTS_SONGS_H + +// Original JP names listed on right, along with any additional notes + +#define MUS_DUMMY 0 // MUS_DUMMY +#define SE_USE_ITEM 1 // SE_KAIFUKU +#define SE_PC_LOGIN 2 // SE_PC_LOGIN +#define SE_PC_OFF 3 // SE_PC_OFF +#define SE_PC_ON 4 // SE_PC_ON +#define SE_SELECT 5 // SE_SELECT +#define SE_WIN_OPEN 6 // SE_WIN_OPEN +#define SE_WALL_HIT 7 // SE_WALL_HIT +#define SE_DOOR 8 // SE_DOOR +#define SE_EXIT 9 // SE_KAIDAN +#define SE_LEDGE 10 // SE_DANSA +#define SE_BIKE_BELL 11 // SE_JITENSYA +#define SE_NOT_EFFECTIVE 12 // SE_KOUKA_L +#define SE_EFFECTIVE 13 // SE_KOUKA_M +#define SE_SUPER_EFFECTIVE 14 // SE_KOUKA_H +#define SE_BALL_OPEN 15 // SE_BOWA2 +#define SE_FAINT 16 // SE_POKE_DEAD +#define SE_FLEE 17 // SE_NIGERU +#define SE_SLIDING_DOOR 18 // SE_JIDO_DOA +#define SE_SHIP 19 // SE_NAMINORI +#define SE_BANG 20 // SE_BAN +#define SE_PIN 21 // SE_PIN (General "good", commonly for "!") +#define SE_BOO 22 // SE_BOO (General "bad") +#define SE_BALL 23 // SE_BOWA (Giving Poké Ball to nurse, Poké Ball shake, etc) +#define SE_CONTEST_PLACE 24 // SE_JYUNI +#define SE_A 25 // SE_A (Bard sounds) +#define SE_I 26 // SE_I +#define SE_U 27 // SE_U +#define SE_E 28 // SE_E +#define SE_O 29 // SE_O +#define SE_N 30 // SE_N +#define SE_SUCCESS 31 // SE_SEIKAI +#define SE_FAILURE 32 // SE_HAZURE +#define SE_EXP 33 // SE_EXP +#define SE_BIKE_HOP 34 // SE_JITE_PYOKO +#define SE_SWITCH 35 // SE_MU_PACHI +#define SE_CLICK 36 // SE_TK_KASYA +#define SE_FU_ZAKU 37 // SE_FU_ZAKU (Unknown purpose, unused) +#define SE_CONTEST_CONDITION_LOSE 38 // SE_FU_ZAKU2 +#define SE_LAVARIDGE_FALL_WARP 39 // SE_FU_ZUZUZU +#define SE_ICE_STAIRS 40 // SE_RU_GASHIN +#define SE_ICE_BREAK 41 // SE_RU_GASYAN +#define SE_ICE_CRACK 42 // SE_RU_BARI +#define SE_FALL 43 // SE_RU_HYUU +#define SE_UNLOCK 44 // SE_KI_GASYAN +#define SE_WARP_IN 45 // SE_TK_WARPIN +#define SE_WARP_OUT 46 // SE_TK_WARPOUT +#define SE_REPEL 47 // SE_TU_SAA +#define SE_ROTATING_GATE 48 // SE_HI_TURUN +#define SE_TRUCK_MOVE 49 // SE_TRACK_MOVE +#define SE_TRUCK_STOP 50 // SE_TRACK_STOP +#define SE_TRUCK_UNLOAD 51 // SE_TRACK_HAIKI +#define SE_TRUCK_DOOR 52 // SE_TRACK_DOOR +#define SE_BERRY_BLENDER 53 // SE_MOTER +#define SE_CARD 54 // SE_CARD +#define SE_SAVE 55 // SE_SAVE +#define SE_BALL_BOUNCE_1 56 // SE_KON +#define SE_BALL_BOUNCE_2 57 // SE_KON2 +#define SE_BALL_BOUNCE_3 58 // SE_KON3 +#define SE_BALL_BOUNCE_4 59 // SE_KON4 +#define SE_BALL_TRADE 60 // SE_SUIKOMU +#define SE_BALL_THROW 61 // SE_NAGERU +#define SE_NOTE_C 62 // SE_TOY_C +#define SE_NOTE_D 63 // SE_TOY_D +#define SE_NOTE_E 64 // SE_TOY_E +#define SE_NOTE_F 65 // SE_TOY_F +#define SE_NOTE_G 66 // SE_TOY_G +#define SE_NOTE_A 67 // SE_TOY_A +#define SE_NOTE_B 68 // SE_TOY_B +#define SE_NOTE_C_HIGH 69 // SE_TOY_C1 +#define SE_PUDDLE 70 // SE_MIZU +#define SE_BRIDGE_WALK 71 // SE_HASHI +#define SE_ITEMFINDER 72 // SE_DAUGI +#define SE_DING_DONG 73 // SE_PINPON +#define SE_BALLOON_RED 74 // SE_FUUSEN1 +#define SE_BALLOON_BLUE 75 // SE_FUUSEN2 +#define SE_BALLOON_YELLOW 76 // SE_FUUSEN3 +#define SE_BREAKABLE_DOOR 77 // SE_TOY_KABE +#define SE_MUD_BALL 78 // SE_TOY_DANGO +#define SE_FIELD_POISON 79 // SE_DOKU +#define SE_ESCALATOR 80 // SE_ESUKA +#define SE_THUNDERSTORM 81 // SE_T_AME +#define SE_THUNDERSTORM_STOP 82 // SE_T_AME_E +#define SE_DOWNPOUR 83 // SE_T_OOAME +#define SE_DOWNPOUR_STOP 84 // SE_T_OOAME_E +#define SE_RAIN 85 // SE_T_KOAME +#define SE_RAIN_STOP 86 // SE_T_KOAME_E +#define SE_THUNDER 87 // SE_T_KAMI +#define SE_THUNDER2 88 // SE_T_KAMI2 +#define SE_ELEVATOR 89 // SE_ELEBETA +#define SE_LOW_HEALTH 90 // SE_HINSI +#define SE_EXP_MAX 91 // SE_EXPMAX +#define SE_ROULETTE_BALL 92 // SE_TAMAKORO +#define SE_ROULETTE_BALL2 93 // SE_TAMAKORO_E +#define SE_TAILLOW_WING_FLAP 94 // SE_BASABASA +#define SE_SHOP 95 // SE_REGI +#define SE_CONTEST_HEART 96 // SE_C_GAJI +#define SE_CONTEST_CURTAIN_RISE 97 // SE_C_MAKU_U +#define SE_CONTEST_CURTAIN_FALL 98 // SE_C_MAKU_D +#define SE_CONTEST_ICON_CHANGE 99 // SE_C_PASI +#define SE_CONTEST_ICON_CLEAR 100 // SE_C_SYU +#define SE_CONTEST_MONS_TURN 101 // SE_C_PIKON +#define SE_SHINY 102 // SE_REAPOKE +#define SE_INTRO_BLAST 103 // SE_OP_BASYU +#define SE_MUGSHOT 104 // SE_BT_START +#define SE_APPLAUSE 105 // SE_DENDOU +#define SE_VEND 106 // SE_JIHANKI +#define SE_ORB 107 // SE_TAMA +#define SE_DEX_SCROLL 108 // SE_Z_SCROLL +#define SE_DEX_PAGE 109 // SE_Z_PAGE +#define SE_POKENAV_ON 110 // SE_PN_ON +#define SE_POKENAV_OFF 111 // SE_PN_OFF +#define SE_DEX_SEARCH 112 // SE_Z_SEARCH +#define SE_EGG_HATCH 113 // SE_TAMAGO +#define SE_BALL_TRAY_ENTER 114 // SE_TB_START +#define SE_BALL_TRAY_BALL 115 // SE_TB_KON +#define SE_BALL_TRAY_EXIT 116 // SE_TB_KARA +#define SE_GLASS_FLUTE 117 // SE_BIDORO +// Move SFX +#define SE_M_THUNDERBOLT 118 // SE_W085 +#define SE_M_THUNDERBOLT2 119 // SE_W085B +#define SE_M_HARDEN 120 // SE_W231 +#define SE_M_NIGHTMARE 121 // SE_W171 +#define SE_M_VITAL_THROW 122 // SE_W233 +#define SE_M_VITAL_THROW2 123 // SE_W233B +#define SE_M_BUBBLE 124 // SE_W145 +#define SE_M_BUBBLE2 125 // SE_W145B +#define SE_M_BUBBLE3 126 // SE_W145C +#define SE_M_RAIN_DANCE 127 // SE_W240 +#define SE_M_CUT 128 // SE_W015 +#define SE_M_STRING_SHOT 129 // SE_W081 +#define SE_M_STRING_SHOT2 130 // SE_W081B +#define SE_M_ROCK_THROW 131 // SE_W088 +#define SE_M_GUST 132 // SE_W016 +#define SE_M_GUST2 133 // SE_W016B +#define SE_M_DOUBLE_SLAP 134 // SE_W003 +#define SE_M_DOUBLE_TEAM 135 // SE_W104 +#define SE_M_RAZOR_WIND 136 // SE_W013 +#define SE_M_ICY_WIND 137 // SE_W196 +#define SE_M_THUNDER_WAVE 138 // SE_W086 +#define SE_M_COMET_PUNCH 139 // SE_W004 +#define SE_M_MEGA_KICK 140 // SE_W025 +#define SE_M_MEGA_KICK2 141 // SE_W025B +#define SE_M_CRABHAMMER 142 // SE_W152 +#define SE_M_JUMP_KICK 143 // SE_W026 +#define SE_M_FLAME_WHEEL 144 // SE_W172 +#define SE_M_FLAME_WHEEL2 145 // SE_W172B +#define SE_M_FLAMETHROWER 146 // SE_W053 +#define SE_M_FIRE_PUNCH 147 // SE_W007 +#define SE_M_TOXIC 148 // SE_W092 +#define SE_M_SACRED_FIRE 149 // SE_W221 +#define SE_M_SACRED_FIRE2 150 // SE_W221B +#define SE_M_EMBER 151 // SE_W052 +#define SE_M_TAKE_DOWN 152 // SE_W036 +#define SE_M_BLIZZARD 153 // SE_W059 +#define SE_M_BLIZZARD2 154 // SE_W059B +#define SE_M_SCRATCH 155 // SE_W010 +#define SE_M_VICEGRIP 156 // SE_W011 +#define SE_M_WING_ATTACK 157 // SE_W017 +#define SE_M_FLY 158 // SE_W019 +#define SE_M_SAND_ATTACK 159 // SE_W028 +#define SE_M_RAZOR_WIND2 160 // SE_W013B +#define SE_M_BITE 161 // SE_W044 +#define SE_M_HEADBUTT 162 // SE_W029 +#define SE_M_SURF 163 // SE_W057 +#define SE_M_HYDRO_PUMP 164 // SE_W056 +#define SE_M_WHIRLPOOL 165 // SE_W250 +#define SE_M_HORN_ATTACK 166 // SE_W030 +#define SE_M_TAIL_WHIP 167 // SE_W039 +#define SE_M_MIST 168 // SE_W054 +#define SE_M_POISON_POWDER 169 // SE_W077 +#define SE_M_BIND 170 // SE_W020 +#define SE_M_DRAGON_RAGE 171 // SE_W082 +#define SE_M_SING 172 // SE_W047 +#define SE_M_PERISH_SONG 173 // SE_W195 +#define SE_M_PAY_DAY 174 // SE_W006 +#define SE_M_DIG 175 // SE_W091 +#define SE_M_DIZZY_PUNCH 176 // SE_W146 +#define SE_M_SELF_DESTRUCT 177 // SE_W120 +#define SE_M_EXPLOSION 178 // SE_W153 +#define SE_M_ABSORB_2 179 // SE_W071B +#define SE_M_ABSORB 180 // SE_W071 +#define SE_M_SCREECH 181 // SE_W103 +#define SE_M_BUBBLE_BEAM 182 // SE_W062 +#define SE_M_BUBBLE_BEAM2 183 // SE_W062B +#define SE_M_SUPERSONIC 184 // SE_W048 +#define SE_M_BELLY_DRUM 185 // SE_W187 +#define SE_M_METRONOME 186 // SE_W118 +#define SE_M_BONEMERANG 187 // SE_W155 +#define SE_M_LICK 188 // SE_W122 +#define SE_M_PSYBEAM 189 // SE_W060 +#define SE_M_FAINT_ATTACK 190 // SE_W185 +#define SE_M_SWORDS_DANCE 191 // SE_W014 +#define SE_M_LEER 192 // SE_W043 +#define SE_M_SWAGGER 193 // SE_W207 +#define SE_M_SWAGGER2 194 // SE_W207B +#define SE_M_HEAL_BELL 195 // SE_W215 +#define SE_M_CONFUSE_RAY 196 // SE_W109 +#define SE_M_SNORE 197 // SE_W173 +#define SE_M_BRICK_BREAK 198 // SE_W280 +#define SE_M_GIGA_DRAIN 199 // SE_W202 +#define SE_M_PSYBEAM2 200 // SE_W060B +#define SE_M_SOLAR_BEAM 201 // SE_W076 +#define SE_M_PETAL_DANCE 202 // SE_W080 +#define SE_M_TELEPORT 203 // SE_W100 +#define SE_M_MINIMIZE 204 // SE_W107 +#define SE_M_SKETCH 205 // SE_W166 +#define SE_M_SWIFT 206 // SE_W129 +#define SE_M_REFLECT 207 // SE_W115 +#define SE_M_BARRIER 208 // SE_W112 +#define SE_M_DETECT 209 // SE_W197 +#define SE_M_LOCK_ON 210 // SE_W199 +#define SE_M_MOONLIGHT 211 // SE_W236 +#define SE_M_CHARM 212 // SE_W204 +#define SE_M_CHARGE 213 // SE_W268 +#define SE_M_STRENGTH 214 // SE_W070 +#define SE_M_HYPER_BEAM 215 // SE_W063 +#define SE_M_WATERFALL 216 // SE_W127 +#define SE_M_REVERSAL 217 // SE_W179 +#define SE_M_ACID_ARMOR 218 // SE_W151 +#define SE_M_SANDSTORM 219 // SE_W201 +#define SE_M_TRI_ATTACK 220 // SE_W161 +#define SE_M_TRI_ATTACK2 221 // SE_W161B +#define SE_M_ENCORE 222 // SE_W227 +#define SE_M_ENCORE2 223 // SE_W227B +#define SE_M_BATON_PASS 224 // SE_W226 +#define SE_M_MILK_DRINK 225 // SE_W208 +#define SE_M_ATTRACT 226 // SE_W213 +#define SE_M_ATTRACT2 227 // SE_W213B +#define SE_M_MORNING_SUN 228 // SE_W234 +#define SE_M_FLATTER 229 // SE_W260 +#define SE_M_SAND_TOMB 230 // SE_W328 +#define SE_M_GRASSWHISTLE 231 // SE_W320 +#define SE_M_SPIT_UP 232 // SE_W255 +#define SE_M_DIVE 233 // SE_W291 +#define SE_M_EARTHQUAKE 234 // SE_W089 +#define SE_M_TWISTER 235 // SE_W239 +#define SE_M_SWEET_SCENT 236 // SE_W230 +#define SE_M_YAWN 237 // SE_W281 +#define SE_M_SKY_UPPERCUT 238 // SE_W327 +#define SE_M_STAT_INCREASE 239 // SE_W287 +#define SE_M_HEAT_WAVE 240 // SE_W257 +#define SE_M_UPROAR 241 // SE_W253 +#define SE_M_HAIL 242 // SE_W258 +#define SE_M_COSMIC_POWER 243 // SE_W322 +#define SE_M_TEETER_DANCE 244 // SE_W298 +#define SE_M_STAT_DECREASE 245 // SE_W287B +#define SE_M_HAZE 246 // SE_W114 +#define SE_M_HYPER_BEAM2 247 // SE_W063B + +// Music +#define MUS_STOP 349 // MUS_STOP +#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI +#define MUS_GSC_ROUTE38 351 // MUS_FIELD13 +#define MUS_CAUGHT 352 // MUS_KACHI22 +#define MUS_VICTORY_WILD 353 // MUS_KACHI2 +#define MUS_VICTORY_GYM_LEADER 354 // MUS_KACHI3 +#define MUS_VICTORY_LEAGUE 355 // MUS_KACHI5 +#define MUS_C_COMM_CENTER 356 // MUS_PCC +#define MUS_GSC_PEWTER 357 // MUS_NIBI +#define MUS_C_VS_LEGEND_BEAST 358 // MUS_SUIKUN +#define MUS_ROUTE101 359 // MUS_DOORO1 +#define MUS_ROUTE110 360 // MUS_DOORO_X1 +#define MUS_ROUTE120 361 // MUS_DOORO_X3 +#define MUS_PETALBURG 362 // MUS_MACHI_S2 +#define MUS_OLDALE 363 // MUS_MACHI_S4 +#define MUS_GYM 364 // MUS_GIM +#define MUS_SURF 365 // MUS_NAMINORI +#define MUS_PETALBURG_WOODS 366 // MUS_DAN01 +#define MUS_LEVEL_UP 367 // MUS_FANFA1 +#define MUS_HEAL 368 // MUS_ME_ASA +#define MUS_OBTAIN_BADGE 369 // MUS_ME_BACHI +#define MUS_OBTAIN_ITEM 370 // MUS_FANFA4 +#define MUS_EVOLVED 371 // MUS_FANFA5 +#define MUS_OBTAIN_TMHM 372 // MUS_ME_WAZA +#define MUS_LILYCOVE_MUSEUM 373 // MUS_BIJYUTU +#define MUS_ROUTE122 374 // MUS_DOORO_X4 +#define MUS_OCEANIC_MUSEUM 375 // MUS_FUNE_KAN +#define MUS_EVOLUTION_INTRO 376 // MUS_ME_SHINKA +#define MUS_EVOLUTION 377 // MUS_SHINKA +#define MUS_MOVE_DELETED 378 // MUS_ME_WASURE +#define MUS_ENCOUNTER_GIRL 379 // MUS_SYOUJOEYE +#define MUS_ENCOUNTER_MALE 380 // MUS_BOYEYE +#define MUS_ABANDONED_SHIP 381 // MUS_DAN02 +#define MUS_FORTREE 382 // MUS_MACHI_S3 +#define MUS_BIRCH_LAB 383 // MUS_ODAMAKI +#define MUS_B_TOWER 384 // MUS_B_TOWER +#define MUS_ENCOUNTER_SWIMMER 385 // MUS_SWIMEYE +#define MUS_CAVE_OF_ORIGIN 386 // MUS_DAN03 +#define MUS_OBTAIN_BERRY 387 // MUS_ME_KINOMI +#define MUS_AWAKEN_LEGEND 388 // MUS_ME_TAMA +#define MUS_SLOTS_JACKPOT 389 // MUS_ME_B_BIG +#define MUS_SLOTS_WIN 390 // MUS_ME_B_SMALL +#define MUS_TOO_BAD 391 // MUS_ME_ZANNEN +#define MUS_ROULETTE 392 // MUS_BD_TIME +#define MUS_LINK_CONTEST_P1 393 // MUS_TEST1 +#define MUS_LINK_CONTEST_P2 394 // MUS_TEST2 +#define MUS_LINK_CONTEST_P3 395 // MUS_TEST3 +#define MUS_LINK_CONTEST_P4 396 // MUS_TEST4 +#define MUS_ENCOUNTER_RICH 397 // MUS_TEST +#define MUS_VERDANTURF 398 // MUS_GOMACHI0 +#define MUS_RUSTBORO 399 // MUS_GOTOWN +#define MUS_POKE_CENTER 400 // MUS_POKECEN +#define MUS_ROUTE104 401 // MUS_NEXTROAD +#define MUS_ROUTE119 402 // MUS_GRANROAD +#define MUS_CYCLING 403 // MUS_CYCLING +#define MUS_POKE_MART 404 // MUS_FRIENDLY +#define MUS_LITTLEROOT 405 // MUS_MISHIRO +#define MUS_MT_CHIMNEY 406 // MUS_TOZAN +#define MUS_ENCOUNTER_FEMALE 407 // MUS_GIRLEYE +#define MUS_LILYCOVE 408 // MUS_MINAMO +#define MUS_ROUTE111 409 // MUS_ASHROAD +#define MUS_HELP 410 // MUS_EVENT0 +#define MUS_UNDERWATER 411 // MUS_DEEPDEEP +#define MUS_VICTORY_TRAINER 412 // MUS_KACHI1 +#define MUS_TITLE 413 // MUS_TITLE3 +#define MUS_INTRO 414 // MUS_DEMO1 +#define MUS_ENCOUNTER_MAY 415 // MUS_GIRL_SUP +#define MUS_ENCOUNTER_INTENSE 416 // MUS_HAGESHII +#define MUS_ENCOUNTER_COOL 417 // MUS_KAKKOII +#define MUS_ROUTE113 418 // MUS_KAZANBAI +#define MUS_ENCOUNTER_AQUA 419 // MUS_AQA_0 +#define MUS_FOLLOW_ME 420 // MUS_TSURETEK +#define MUS_ENCOUNTER_BRENDAN 421 // MUS_BOY_SUP +#define MUS_EVER_GRANDE 422 // MUS_RAINBOW +#define MUS_ENCOUNTER_SUSPICIOUS 423 // MUS_AYASII +#define MUS_VICTORY_AQUA_MAGMA 424 // MUS_KACHI4 +#define MUS_CABLE_CAR 425 // MUS_ROPEWAY +#define MUS_GAME_CORNER 426 // MUS_CASINO +#define MUS_DEWFORD 427 // MUS_HIGHTOWN +#define MUS_SAFARI_ZONE 428 // MUS_SAFARI +#define MUS_VICTORY_ROAD 429 // MUS_C_ROAD +#define MUS_AQUA_MAGMA_HIDEOUT 430 // MUS_AJITO +#define MUS_SAILING 431 // MUS_M_BOAT +#define MUS_MT_PYRE 432 // MUS_M_DUNGON +#define MUS_SLATEPORT 433 // MUS_FINECITY +#define MUS_MT_PYRE_EXTERIOR 434 // MUS_MACHUPI +#define MUS_SCHOOL 435 // MUS_P_SCHOOL +#define MUS_HALL_OF_FAME 436 // MUS_DENDOU +#define MUS_FALLARBOR 437 // MUS_TONEKUSA +#define MUS_SEALED_CHAMBER 438 // MUS_MABOROSI +#define MUS_CONTEST_WINNER 439 // MUS_CON_FAN +#define MUS_CONTEST 440 // MUS_CONTEST0 +#define MUS_ENCOUNTER_MAGMA 441 // MUS_MGM0 +#define MUS_INTRO_BATTLE 442 // MUS_T_BATTLE +#define MUS_WEATHER_KYOGRE 443 // MUS_OOAME +#define MUS_WEATHER_GROUDON 444 // MUS_HIDERI +#define MUS_SOOTOPOLIS 445 // MUS_RUNECITY +#define MUS_CONTEST_RESULTS 446 // MUS_CON_K +#define MUS_HALL_OF_FAME_ROOM 447 // MUS_EIKOU_R +#define MUS_TRICK_HOUSE 448 // MUS_KARAKURI +#define MUS_ENCOUNTER_TWINS 449 // MUS_HUTAGO +#define MUS_ENCOUNTER_ELITE_FOUR 450 // MUS_SITENNOU +#define MUS_ENCOUNTER_HIKER 451 // MUS_YAMA_EYE +#define MUS_CONTEST_LOBBY 452 // MUS_CONLOBBY +#define MUS_ENCOUNTER_INTERVIEWER 453 // MUS_INTER_V +#define MUS_ENCOUNTER_CHAMPION 454 // MUS_DAIGO +#define MUS_CREDITS 455 // MUS_THANKFOR +#define MUS_END 456 // MUS_END +#define MUS_VS_WILD 457 // MUS_BATTLE27 +#define MUS_VS_AQUA_MAGMA 458 // MUS_BATTLE31 +#define MUS_VS_TRAINER 459 // MUS_BATTLE20 +#define MUS_VS_GYM_LEADER 460 // MUS_BATTLE32 +#define MUS_VS_CHAMPION 461 // MUS_BATTLE33 +#define MUS_VS_REGI 462 // MUS_BATTLE36 +#define MUS_VS_KYOGRE_GROUDON 463 // MUS_BATTLE34 +#define MUS_VS_RIVAL 464 // MUS_BATTLE35 +#define MUS_VS_ELITE_FOUR 465 // MUS_BATTLE38 +#define MUS_VS_AQUA_MAGMA_LEADER 466 // MUS_BATTLE30 +#define MUS_GSC_RADIO_TOWER_TAKEOVER 467 + +#define MUS_ROUTE_118 0x7FFF // Map is split into 2 music sections. controlled by GetCurrLocationDefaultMusic(). + +#endif // GUARD_CONSTANTS_SONGS_H diff --git a/include/item_use.h b/include/item_use.h new file mode 100644 index 0000000..7bf85a1 --- /dev/null +++ b/include/item_use.h @@ -0,0 +1,3 @@ +#pragma once + +extern u16 gSpecialVar_ItemId; \ No newline at end of file diff --git a/include/menu.h b/include/menu.h index 3d303e2..f42263d 100644 --- a/include/menu.h +++ b/include/menu.h @@ -8,6 +8,7 @@ extern u16 gMenuTextTileOffset; u8 *AlignStringInMenuWindow(u8 *, const u8 *, u8, u8); void Menu_PrintText(const u8 *str, u8 left, u8 top); u8 Menu_PrintTextPixelCoords(const u8 *text, u8 left, u16 top, u8 a4); +void MenuPrint_Centered(const u8 *, u8, u8, u16); void MenuPrint_RightAligned(const u8 *, u8, u8); void AppendToList(u8 *list, u8 *pindex, u32 value); u8 *AlignInt1InMenuWindow(u8 *dest, s32 value, u8 alignAmount, u8 alignType); diff --git a/include/party_menu.h b/include/party_menu.h new file mode 100644 index 0000000..ab0d010 --- /dev/null +++ b/include/party_menu.h @@ -0,0 +1,62 @@ +#pragma once + +extern u8 gPartyMenuUseExitCallback; + +#define pmStatGrowths data +#define pmSetupState data[0] +#define pmMonIndex data[1] +#define pmUnk268 data[2] +#define pmUnk272 data[7] +#define pmUnk27E data[13] +#define pmUnk280 data[14] +#define pmUnk282 data[15] + +struct Unk201B000 +{ + struct Pokemon unk0[6]; + u8 menuType; + u8 promptTextId; + TaskFunc menuHandler; + u8 menuHandlerTaskId; + u8 unk261; + u8 unk262; // Never read + u8 unk263; + s16 data[16]; +}; + +struct PartyMenu +{ + /*0x00*/ struct Pokemon *pokemon; + /*0x04*/ u8 unk4; + /*0x05*/ u8 primarySelectedMonIndex; + /*0x06*/ u16 secondarySelectedIndex; + /*0x08*/ u16 unk8; + /*0x0A*/ u8 pad_0A[2]; + /*0x0C*/ s32 unkC; + /*0x10*/ TaskFunc unk10; + /*0x14*/ TaskFunc unk14; +}; + +extern struct Unk201B000 gPartyMenu2; +extern struct PartyMenu gPartyMenu; + +u8 *GetMonNickname(struct Pokemon *pokemon, u8 *stringBuffer); +bool8 IsBlueYellowRedFlute(u16); +u8 GetMonStatusAndPokerus(struct Pokemon *mon); +void sub_806F8AC(u8 taskId); +void sub_806E8D0(u8 taskId, u16 b, TaskFunc c); +bool8 IsMedicineIneffective(struct Pokemon *pkmn, u16 item); +bool8 IsHPRecoveryItem(u16 item); +bool8 ExecuteTableBasedItemEffect__(u8, u16, u8); +void GetMedicineItemEffectMessage(u16); +void TryPrintPartyMenuMonNickname(u8 monIndex, struct Pokemon *pokemon); +void PartyMenuUpdateLevelOrStatus(struct Pokemon *, u8); +void Task_ClosePartyMenuAfterText(u8 taskId); +u8 DisplayPartyMenuMessage(const u8 *message, u8 noClearAfter); +void PrintPartyMenuPromptText(u8 textId, u8 b); +void ReturnToBagFromPartyMenu(u8 taskId); + +void HandleItemUsePartyMenu(u8 taskID); +u8 GetItemEffectType(u16 item); +void PartyMenuEraseMsgBoxAndFrame(void); + diff --git a/include/pokemon.h b/include/pokemon.h index 4e148fe..1755b50 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -93,6 +93,7 @@ bool8 CheckIfMonCanUseHM(struct Pokemon *mon, u16 hm); bool8 CheckIfPartyCanUseTM(u16 tm); u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex); bool8 IsHMMove(u16 move); +u8 GetNature(struct Pokemon *mon); enum { @@ -104,4 +105,6 @@ enum STAT_STAGE_SPDEF, // 5 STAT_STAGE_ACC, // 6 STAT_STAGE_EVASION, // 7 -}; \ No newline at end of file +}; + +extern const s8 gNatureStatTable[25][5]; \ No newline at end of file diff --git a/include/sound.h b/include/sound.h new file mode 100644 index 0000000..599b8af --- /dev/null +++ b/include/sound.h @@ -0,0 +1,3 @@ +#pragma once + +void PlaySE(u16 songNum); \ No newline at end of file diff --git a/include/task.h b/include/task.h index 7e8e866..54bf2c0 100644 --- a/include/task.h +++ b/include/task.h @@ -20,3 +20,4 @@ u8 CreateTask(TaskFunc func, u8 priority); bool8 FuncIsActiveTask(TaskFunc func); u8 FindTaskIdByFunc(TaskFunc func); u8 DestroyTask(u8 taskId); +void TaskDummy(u8 taskId); diff --git a/main.asm b/main.asm index dc8fb84..cca5a94 100644 --- a/main.asm +++ b/main.asm @@ -52,10 +52,12 @@ .include "scripts/bag_expansion.asm" .include "scripts/colored_field_moves.asm" +.include "scripts/colored_stats.asm" .include "scripts/emerald_save_prompt.asm" .include "scripts/hm_system.asm" .include "scripts/ow_shadows.asm" .include "scripts/ps_split.asm" +.include "scripts/repeated_item.asm" .include "scripts/repel_prompt.asm" .include "scripts/reusable_tms.asm" .include "scripts/summary_screen.asm" diff --git a/rom.ld b/rom.ld index 499ead9..48b7dc7 100644 --- a/rom.ld +++ b/rom.ld @@ -9,7 +9,12 @@ memcpy = 0x815b890 | 1; gBattleMoves = 0x81fb12c; gItems = 0x83c5564; +gSpecialVar_ItemId = 0x203855e; +gNatureStatTable = 0x81fd070; +gPartyMenuUseExitCallback = 0x202e8f4; sMonSummaryScreen = 0x2018000; +gPartyMenu = 0x201C000; +gPartyMenu2 = 0x201B000; gObjectEvents = 0x30048a0; gPlayerAvatar = 0x202e858; gFieldEffectArguments = 0x202ff84; @@ -90,6 +95,7 @@ gOtherText_Player = 0x842c983; gOtherText_Badges = 0x842c98a; gOtherText_Pokedex = 0x842c992; gOtherText_PlayTime = 0x842c99a; +gOtherText_WontHaveAnyEffect = 0x840ef85; gWeatherFuncs = 0x8396fc8; gWeatherPalStateFuncs = 0x83970b8; @@ -103,6 +109,7 @@ ConvertIntToDecimalStringN = 0x8006bc4 | 1; ConvertIntToDecimalString = 0x8006ddc | 1; AlignStringInMenuWindow = 0x8072c74 | 1; Menu_PrintText = 0x8071e50 | 1; +MenuPrint_Centered = 0x8072bd8 | 1; MenuPrint_RightAligned = 0x8072b4c | 1; HighlightSelectedOption = 0x80a425c | 1; PrintCancelOption = 0x80a42b0 | 1; @@ -144,6 +151,7 @@ BeginNormalPaletteFade = 0x8073bf4 | 1; Weather_SetBlendCoeffs = 0x807db64 | 1; ApplyGammaShift = 0x807cebc | 1; CreateTask = 0x807aa88 | 1; +TaskDummy = 0x807ac50 | 1; FuncIsActiveTask = 0x807acbc | 1; Task_WeatherInit = 0x807c9e4 | 1; Task_WeatherMain = 0x807ca34 | 1; @@ -242,4 +250,25 @@ ObjectEventIsMovementOverridden = 0x806051c | 1; ObjectEventClearHeldMovementIfActive = 0x80605b4 | 1; SetRainStrengthFromSoundEffect = 0x807dd5c | 1; -FieldEffectStop = 0x808583c | 1; \ No newline at end of file +FieldEffectStop = 0x808583c | 1; + +sub_806E8D0 = 0x806E8D0 | 1; +IsHPRecoveryItem = 0x806fb7c | 1; +IsMedicineIneffective = 0x806fd90 | 1; +ExecuteTableBasedItemEffect__ = 0x806fdc4 | 1; +GetMedicineItemEffectMessage = 0x806fbd0 | 1; +TryPrintPartyMenuMonNickname = 0x806e07c | 1; +sub_806F8AC = 0x806f8ac | 1; +IsBlueYellowRedFlute = 0x807002c | 1; +GetMonNickname = 0x806e0ec | 1; +GetMonStatusAndPokerus = 0x80a1cd8 | 1; +PartyMenuUpdateLevelOrStatus = 0x806fbb4 | 1; +Task_ClosePartyMenuAfterText = 0x806fb0c | 1; +DisplayPartyMenuMessage = 0x806e834 | 1; +PrintPartyMenuPromptText = 0x806d538 | 1; +PlaySE = 0x8075494 | 1; +ReturnToBagFromPartyMenu = 0x808B224 | 1; +HandleItemUsePartyMenu = 0x808B0C0 | 1; +GetItemEffectType = 0x8070e48 | 1; +PartyMenuEraseMsgBoxAndFrame = 0x806d5a4 | 1; +GetNature = 0x803f464 | 1; diff --git a/scripts/colored_stats.asm b/scripts/colored_stats.asm new file mode 100644 index 0000000..5af96d9 --- /dev/null +++ b/scripts/colored_stats.asm @@ -0,0 +1,16 @@ +.if COLORED_STATS +.org 0x809ffbc +ldr r0, =(@Hook | 1) +bx r0 +.pool + +.autoregion +.align 2 +@Hook: +mov r0, r5 +bl SummaryScreen_PrintPokemonStats +ldr r0, =(0x80A0048 | 1) +bx r0 +.pool +.endautoregion +.endif \ No newline at end of file diff --git a/scripts/repeated_item.asm b/scripts/repeated_item.asm new file mode 100644 index 0000000..eed5a59 --- /dev/null +++ b/scripts/repeated_item.asm @@ -0,0 +1,4 @@ +.if REPEATED_ITEM +.org 0x808b178 +.word (Task_ItemUseCallback | 1) +.endif diff --git a/src/party_menu.c b/src/party_menu.c new file mode 100644 index 0000000..dcb4b3d --- /dev/null +++ b/src/party_menu.c @@ -0,0 +1,25 @@ +#include "types.h" +#include "pokemon.h" +#include "task.h" +#include "item.h" +#include "party_menu.h" +#include "item_menu.h" +#include "menu.h" +#include "item_use.h" +#include "sound.h" +#include "text.h" +#include "constants/songs.h" +#include "constants/pokemon.h" +#include "palette.h" + +void Task_ItemUseCallback(u8 taskId) +{ + if (GetItemEffectType(gSpecialVar_ItemId) && CheckBagHasItem(gSpecialVar_ItemId, 1)) + { + Menu_EraseWindowRect(3, 14, 26, 19); + PrintPartyMenuPromptText(gPartyMenu2.promptTextId, 0); + gTasks[taskId].func = HandleItemUsePartyMenu; + } + else + ReturnToBagFromPartyMenu(taskId); +} \ No newline at end of file diff --git a/src/summary_screen.c b/src/summary_screen.c index 175e373..49d72cc 100644 --- a/src/summary_screen.c +++ b/src/summary_screen.c @@ -24,3 +24,38 @@ s8 ChangeSummaryPokemonNormal(s8 delta) return index; } + +void PrintStatText(struct Pokemon *mon, u8 stat, u8 nature, u8 left, u8 top, u16 width) +{ + u8 *buffer = gStringVar1; + s8 mod = gNatureStatTable[nature][stat - MON_DATA_ATK]; + + *(buffer++) = EXT_CTRL_CODE_BEGIN; + *(buffer++) = EXT_CTRL_CODE_COLOR; + + switch (mod) + { + case 0: // Neutral + *(buffer++) = 0xF; // Black + break; + case 1: // Increased + *(buffer++) = 0x9; // Red + break; + case -1: // Decreased + *(buffer++) = 0x2; // Light Blue + break; + } + + ConvertIntToDecimalString(buffer, GetMonData(mon, stat)); + MenuPrint_Centered(gStringVar1, left, top, width); +} + +void SummaryScreen_PrintPokemonStats(struct Pokemon *mon) +{ + u8 nature = GetNature(mon); + PrintStatText(mon, MON_DATA_ATK, nature, 16, 9, 50); + PrintStatText(mon, MON_DATA_DEF, nature, 16, 11, 50); + PrintStatText(mon, MON_DATA_SPATK, nature, 27, 7, 18); + PrintStatText(mon, MON_DATA_SPDEF, nature, 27, 9, 18); + PrintStatText(mon, MON_DATA_SPEED, nature, 27, 11, 18); +} \ No newline at end of file