Merge branch 'master' of https://github.com/pret/pokeemerald into build-makefile-cleanup

This commit is contained in:
GriffinR
2024-08-31 00:10:55 -04:00
173 changed files with 1454 additions and 1159 deletions
-1
View File
@@ -21,7 +21,6 @@ sound/**/*.bin
sound/songs/midi/*.s sound/songs/midi/*.s
tools/agbcc tools/agbcc
*.map *.map
*.ld
*.bat *.bat
*.dump *.dump
*.sa* *.sa*
+16 -13
View File
@@ -33,27 +33,23 @@ WSL1 is the preferred terminal to build **pokeemerald**. The following instructi
- Otherwise, **open WSL** and go to [Choosing where to store pokeemerald (WSL1)](#Choosing-where-to-store-pokeemerald-WSL1). - Otherwise, **open WSL** and go to [Choosing where to store pokeemerald (WSL1)](#Choosing-where-to-store-pokeemerald-WSL1).
### Installing WSL1 ### Installing WSL1
1. Open [Windows Powershell **as Administrator**](https://i.imgur.com/QKmVbP9.png), and run the following command (Right Click or Shift+Insert is paste in the Powershell). 1. Open [Windows Powershell **as Administrator**](https://i.imgur.com/QKmVbP9.png), and run the following commands (Right Click or Shift+Insert is paste in the Powershell).
```powershell ```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart wsl --install -d Ubuntu --enable-wsl1
``` ```
2. Once the process finishes, restart your machine. 2. Once the process finishes, restart your machine.
3. The next step is to choose and install a Linux distribution from the Microsoft Store. The following instructions will assume Ubuntu as the Linux distribution of choice. 3. Open Windows Powershell **as Administrator** again (after restarting), and run the following command to configure Ubuntu to use WSL1.
```powershell
wsl --set-version Ubuntu 1
```
<details> <details>
<summary><i>Note for advanced users...</i></summary> <summary><i>Note...</i></summary>
> You can pick a preferred Linux distribution, but setup instructions may differ. Debian should work with the given instructions, but has not been tested. > WSL may open automatically after restarting, but you can ignore it for now.
</details>
4. Open the [Microsoft Store Linux Selection](https://aka.ms/wslstore), click Ubuntu, then click Get, which will install the Ubuntu distribution.
<details>
<summary><i>Notes...</i></summary>
> Note 1: If a dialog pops up asking for you to sign into a Microsoft Account, then just close the dialog.
> Note 2: If the link does not work, then open the Microsoft Store manually, and search for the Ubuntu app (choose the one with no version number).
</details> </details>
### Setting up WSL1 ### Setting up WSL1
@@ -354,6 +350,13 @@ Then proceed to [Choosing where to store pokeemerald (Linux)](#choosing-where-to
> [install devkitARM on Arch Linux](#installing-devkitarm-on-arch-linux). > [install devkitARM on Arch Linux](#installing-devkitarm-on-arch-linux).
</details> </details>
### NixOS
Run the following command to start an interactive shell with the necessary packages:
```bash
nix-shell -p pkgsCross.arm-embedded.stdenv.cc git pkg-config libpng
```
Then proceed to [Choosing where to store pokeemerald (Linux)](#choosing-where-to-store-pokeemerald-linux).
### Other distributions ### Other distributions
_(Specific instructions for other distributions would be greatly appreciated!)_ _(Specific instructions for other distributions would be greatly appreciated!)_
+10 -10
View File
@@ -106,7 +106,7 @@ DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR)
SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR) SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR)
MID_BUILDDIR = $(OBJ_DIR)/$(MID_SUBDIR) MID_BUILDDIR = $(OBJ_DIR)/$(MID_SUBDIR)
SHELL := /bin/bash -o pipefail SHELL := bash -o pipefail
# Set flags for tools # Set flags for tools
ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN) ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN)
@@ -137,8 +137,6 @@ ifeq ($(DINFO),1)
override CFLAGS += -g override CFLAGS += -g
endif endif
LDFLAGS = -Map ../../$(MAP)
# Variable filled out in other make files # Variable filled out in other make files
AUTO_GEN_TARGETS := AUTO_GEN_TARGETS :=
include make_tools.mk include make_tools.mk
@@ -265,6 +263,8 @@ include spritesheet_rules.mk
include json_data_rules.mk include json_data_rules.mk
include songs.mk include songs.mk
generated: $(AUTO_GEN_TARGETS)
%.s: ; %.s: ;
%.png: ; %.png: ;
%.pal: ; %.pal: ;
@@ -286,7 +286,7 @@ clean-generated:
-rm -f $(AUTO_GEN_TARGETS) -rm -f $(AUTO_GEN_TARGETS)
ifeq ($(MODERN),0) ifeq ($(MODERN),0)
$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE) $(C_BUILDDIR)/libc.o: CC1 := $(TOOLS_DIR)/agbcc/bin/old_agbcc$(EXE)
$(C_BUILDDIR)/libc.o: CFLAGS := -O2 $(C_BUILDDIR)/libc.o: CFLAGS := -O2
$(C_BUILDDIR)/siirtc.o: CFLAGS := -mthumb-interwork $(C_BUILDDIR)/siirtc.o: CFLAGS := -mthumb-interwork
$(C_BUILDDIR)/agb_flash.o: CFLAGS := -O -mthumb-interwork $(C_BUILDDIR)/agb_flash.o: CFLAGS := -O -mthumb-interwork
@@ -294,7 +294,7 @@ $(C_BUILDDIR)/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork
$(C_BUILDDIR)/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork $(C_BUILDDIR)/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork
$(C_BUILDDIR)/m4a.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE) $(C_BUILDDIR)/m4a.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE)
$(C_BUILDDIR)/record_mixing.o: CFLAGS += -ffreestanding $(C_BUILDDIR)/record_mixing.o: CFLAGS += -ffreestanding
$(C_BUILDDIR)/librfu_intr.o: CC1 := tools/agbcc/bin/agbcc_arm$(EXE) $(C_BUILDDIR)/librfu_intr.o: CC1 := $(TOOLS_DIR)/agbcc/bin/agbcc_arm$(EXE)
$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet $(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet
else else
$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast $(C_BUILDDIR)/librfu_intr.o: CFLAGS := -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast
@@ -318,7 +318,7 @@ define C_DEP_IMPL
$1.o: $2 $1.o: $2
ifeq (,$(KEEP_TEMPS)) ifeq (,$(KEEP_TEMPS))
@echo "$$(CC1) <flags> -o $$@ $$<" @echo "$$(CC1) <flags> -o $$@ $$<"
@$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) $$< charmap.txt -i | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ -
else else
@$$(CPP) $$(CPPFLAGS) $$< -o $3.i @$$(CPP) $$(CPPFLAGS) $$< -o $3.i
@$$(PREPROC) $3.i charmap.txt | $$(CC1) $$(CFLAGS) -o $3.s @$$(PREPROC) $3.i charmap.txt | $$(CC1) $$(CFLAGS) -o $3.s
@@ -353,7 +353,7 @@ endef
# As above but first doing a preprocessor pass # As above but first doing a preprocessor pass
define ASM_DEP_PREPROC define ASM_DEP_PREPROC
$1.o: $2 $1.o: $2
$$(PREPROC) $$< charmap.txt | $$(CPP) $(INCLUDE_SCANINC_ARGS) - | $$(AS) $$(ASFLAGS) -o $$@ $$(PREPROC) $$< charmap.txt | $$(CPP) $(INCLUDE_SCANINC_ARGS) - | $$(PREPROC) -ie $$< charmap.txt | $$(AS) $$(ASFLAGS) -o $$@
$(call ASM_SCANINC,$1,$2) $(call ASM_SCANINC,$1,$2)
endef endef
@@ -389,10 +389,10 @@ $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt
# Linker script # Linker script
ifeq ($(MODERN),0) ifeq ($(MODERN),0)
LD_SCRIPT := ld_script.txt LD_SCRIPT := ld_script.ld
LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld
else else
LD_SCRIPT := ld_script_modern.txt LD_SCRIPT := ld_script_modern.ld
LD_SCRIPT_DEPS := LD_SCRIPT_DEPS :=
endif endif
@@ -407,7 +407,7 @@ libagbsyscall:
# Elf from object files # Elf from object files
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall $(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ <objects> <lib>" @echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ <objects> <lib>"
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB) @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
# Builds the rom from the elf file # Builds the rom from the elf file
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
if [[ -d "$DEVKITARM/bin/" ]]; then if [[ -d "$DEVKITARM/bin/" ]]; then
OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump" OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump"
@@ -320,6 +320,9 @@ MossdeepCity_SpaceCenter_2F_EventScript_DefeatedMaxieTabitha::
setobjectmovementtype LOCALID_SCIENTIST, MOVEMENT_TYPE_WANDER_AROUND setobjectmovementtype LOCALID_SCIENTIST, MOVEMENT_TYPE_WANDER_AROUND
addobject LOCALID_SCIENTIST addobject LOCALID_SCIENTIST
fadescreen FADE_FROM_BLACK fadescreen FADE_FROM_BLACK
#ifdef BUGFIX
releaseall
#endif
end end
MossdeepCity_SpaceCenter_2F_EventScript_StevenFacePlayer:: MossdeepCity_SpaceCenter_2F_EventScript_StevenFacePlayer::
+2 -2
View File
@@ -205,8 +205,8 @@ gScriptCmdTable::
.4byte ScrCmd_nop1 @ 0xca .4byte ScrCmd_nop1 @ 0xca
.4byte ScrCmd_nop1 @ 0xcb .4byte ScrCmd_nop1 @ 0xcb
.4byte ScrCmd_nop1 @ 0xcc .4byte ScrCmd_nop1 @ 0xcc
.4byte ScrCmd_setmonmodernfatefulencounter @ 0xcd .4byte ScrCmd_setmodernfatefulencounter @ 0xcd
.4byte ScrCmd_checkmonmodernfatefulencounter @ 0xce .4byte ScrCmd_checkmodernfatefulencounter @ 0xce
.4byte ScrCmd_trywondercardscript @ 0xcf .4byte ScrCmd_trywondercardscript @ 0xcf
.4byte ScrCmd_nop1 @ 0xd0 .4byte ScrCmd_nop1 @ 0xd0
.4byte ScrCmd_warpspinenter @ 0xd1 .4byte ScrCmd_warpspinenter @ 0xd1
+3
View File
@@ -53,6 +53,9 @@ SafariZone_EventScript_ChoosePokeblock::
special OpenPokeblockCaseOnFeeder special OpenPokeblockCaseOnFeeder
waitstate waitstate
goto_if_ne VAR_RESULT, 0xFFFF, SafariZone_EventScript_PokeblockPlaced goto_if_ne VAR_RESULT, 0xFFFF, SafariZone_EventScript_PokeblockPlaced
#ifdef BUGFIX
releaseall @ Only gets called from EventScript_PokeBlockFeeder which uses lockall.
#endif
end end
SafariZone_EventScript_PokeblockPlaced:: SafariZone_EventScript_PokeblockPlaced::
+26 -11
View File
@@ -1,8 +1,11 @@
#include "global.h" #include "global.h"
#include "malloc.h"
static void *sHeapStart; static void *sHeapStart;
static u32 sHeapSize; static u32 sHeapSize;
ALIGNED(4) EWRAM_DATA u8 gHeap[HEAP_SIZE] = {0};
#define MALLOC_SYSTEM_ID 0xA3A3 #define MALLOC_SYSTEM_ID 0xA3A3
struct MemBlock { struct MemBlock {
@@ -52,18 +55,24 @@ void *AllocInternal(void *heapStart, u32 size)
if (size & 3) if (size & 3)
size = 4 * ((size / 4) + 1); size = 4 * ((size / 4) + 1);
for (;;) { for (;;)
{
// Loop through the blocks looking for unused block that's big enough. // Loop through the blocks looking for unused block that's big enough.
if (!pos->flag) { if (!pos->flag)
{
foundBlockSize = pos->size; foundBlockSize = pos->size;
if (foundBlockSize >= size) { if (foundBlockSize >= size)
if (foundBlockSize - size < 2 * sizeof(struct MemBlock)) { {
if (foundBlockSize - size < 2 * sizeof(struct MemBlock))
{
// The block isn't much bigger than the requested size, // The block isn't much bigger than the requested size,
// so just use it. // so just use it.
pos->flag = TRUE; pos->flag = TRUE;
} else { }
else
{
// The block is significantly bigger than the requested // The block is significantly bigger than the requested
// size, so split the rest into a separate block. // size, so split the rest into a separate block.
foundBlockSize -= sizeof(struct MemBlock); foundBlockSize -= sizeof(struct MemBlock);
@@ -95,15 +104,18 @@ void *AllocInternal(void *heapStart, u32 size)
void FreeInternal(void *heapStart, void *pointer) void FreeInternal(void *heapStart, void *pointer)
{ {
if (pointer) { if (pointer)
{
struct MemBlock *head = (struct MemBlock *)heapStart; struct MemBlock *head = (struct MemBlock *)heapStart;
struct MemBlock *block = (struct MemBlock *)((u8 *)pointer - sizeof(struct MemBlock)); struct MemBlock *block = (struct MemBlock *)((u8 *)pointer - sizeof(struct MemBlock));
block->flag = FALSE; block->flag = FALSE;
// If the freed block isn't the last one, merge with the next block // If the freed block isn't the last one, merge with the next block
// if it's not in use. // if it's not in use.
if (block->next != head) { if (block->next != head)
if (!block->next->flag) { {
if (!block->next->flag)
{
block->size += sizeof(struct MemBlock) + block->next->size; block->size += sizeof(struct MemBlock) + block->next->size;
block->next->magic = 0; block->next->magic = 0;
block->next = block->next->next; block->next = block->next->next;
@@ -114,8 +126,10 @@ void FreeInternal(void *heapStart, void *pointer)
// If the freed block isn't the first one, merge with the previous block // If the freed block isn't the first one, merge with the previous block
// if it's not in use. // if it's not in use.
if (block != head) { if (block != head)
if (!block->prev->flag) { {
if (!block->prev->flag)
{
block->prev->next = block->next; block->prev->next = block->next;
if (block->next != head) if (block->next != head)
@@ -132,7 +146,8 @@ void *AllocZeroedInternal(void *heapStart, u32 size)
{ {
void *mem = AllocInternal(heapStart, size); void *mem = AllocInternal(heapStart, size);
if (mem != NULL) { if (mem != NULL)
{
if (size & 3) if (size & 3)
size = 4 * ((size / 4) + 1); size = 4 * ((size / 4) + 1);
+2 -2
View File
@@ -1,7 +1,6 @@
#ifndef GUARD_ALLOC_H #ifndef GUARD_ALLOC_H
#define GUARD_ALLOC_H #define GUARD_ALLOC_H
#define HEAP_SIZE 0x1C000
#define FREE_AND_SET_NULL(ptr) \ #define FREE_AND_SET_NULL(ptr) \
{ \ { \
@@ -11,7 +10,8 @@
#define TRY_FREE_AND_SET_NULL(ptr) if (ptr != NULL) FREE_AND_SET_NULL(ptr) #define TRY_FREE_AND_SET_NULL(ptr) if (ptr != NULL) FREE_AND_SET_NULL(ptr)
extern u8 gHeap[]; #define HEAP_SIZE 0x1C000
extern u8 gHeap[HEAP_SIZE];
void *Alloc(u32 size); void *Alloc(u32 size);
void *AllocZeroed(u32 size); void *AllocZeroed(u32 size);

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

+49 -1
View File
@@ -1,6 +1,6 @@
JASC-PAL JASC-PAL
0100 0100
48 96
123 131 0 123 131 0
255 255 255 255 255 255
222 222 222 222 222 222
@@ -49,3 +49,51 @@ JASC-PAL
49 139 255 49 139 255
189 156 90 189 156 90
0 0 0 0 0 0
123 131 0
255 255 255
255 238 0
255 189 0
255 115 0
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
49 213 74
24 131 32
189 156 90
0 0 0
123 131 0
255 255 255
197 32 32
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
189 0 0
74 148 180
8 90 131
189 156 90
0 0 0
123 131 0
255 255 255
197 32 32
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
180 205 246
49 139 255
189 156 90
0 0 0
-51
View File
@@ -1,51 +0,0 @@
JASC-PAL
0100
48
123 131 0
255 255 255
255 238 0
255 189 0
255 115 0
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
49 213 74
24 131 32
189 156 90
0 0 0
123 131 0
255 255 255
197 32 32
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
189 0 0
74 148 180
8 90 131
189 156 90
0 0 0
123 131 0
255 255 255
197 32 32
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
180 205 246
49 139 255
189 156 90
0 0 0

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 111 B

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

+1
View File
@@ -0,0 +1 @@
redyellowgreen_frame.bin
Binary file not shown.
+3 -3
View File
@@ -21,7 +21,7 @@ JPCONTESTGFXDIR := graphics/contest/japanese
POKEDEXGFXDIR := graphics/pokedex POKEDEXGFXDIR := graphics/pokedex
STARTERGFXDIR := graphics/starter_choose STARTERGFXDIR := graphics/starter_choose
NAMINGGFXDIR := graphics/naming_screen NAMINGGFXDIR := graphics/naming_screen
SPINDAGFXDIR := graphics/spinda_spots SPINDAGFXDIR := graphics/pokemon/spinda/spots
types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark
contest_types := cool beauty cute smart tough contest_types := cool beauty cute smart tough
@@ -290,10 +290,10 @@ $(FONTGFXDIR)/short.fwjpnfont: $(FONTGFXDIR)/japanese_short.png
$(FONTGFXDIR)/braille.fwjpnfont: $(FONTGFXDIR)/braille.png $(FONTGFXDIR)/braille.fwjpnfont: $(FONTGFXDIR)/braille.png
$(GFX) $< $@ $(GFX) $< $@
$(FONTGFXDIR)/frlg_male.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_male_font.png $(FONTGFXDIR)/frlg_male.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_male.png
$(GFX) $< $@ $(GFX) $< $@
$(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female_font.png $(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female.png
$(GFX) $< $@ $(GFX) $< $@
+13 -13
View File
@@ -420,7 +420,7 @@ struct BattleStruct
u8 arenaTurnCounter; u8 arenaTurnCounter;
u8 turnSideTracker; u8 turnSideTracker;
u8 unused_6[3]; u8 unused_6[3];
u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party. u8 givenExpMons; // Bits for enemy party's Pokémon that gave exp to player's party.
u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte] u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte]
u16 castformPalette[NUM_CASTFORM_FORMS][16]; u16 castformPalette[NUM_CASTFORM_FORMS][16];
union { union {
@@ -440,7 +440,7 @@ struct BattleStruct
u16 arenaStartHp[2]; u16 arenaStartHp[2];
u8 arenaLostPlayerMons; // Bits for party member, lost as in referee's decision, not by fainting. u8 arenaLostPlayerMons; // Bits for party member, lost as in referee's decision, not by fainting.
u8 arenaLostOpponentMons; u8 arenaLostOpponentMons;
u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed pokemon. u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed Pokémon.
}; };
// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider, // The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,
@@ -460,26 +460,26 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER
typeArg = gBattleMoves[move].type; \ typeArg = gBattleMoves[move].type; \
} }
#define IS_TYPE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY) #define IS_TYPE_PHYSICAL(moveType) (moveType < TYPE_MYSTERY)
#define IS_TYPE_SPECIAL(moveType)(moveType > TYPE_MYSTERY) #define IS_TYPE_SPECIAL(moveType) (moveType > TYPE_MYSTERY)
#define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0)) #define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0))
#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type)) #define IS_BATTLER_OF_TYPE(battlerId, type) ((gBattleMons[battlerId].types[0] == type || gBattleMons[battlerId].types[1] == type))
#define SET_BATTLER_TYPE(battlerId, type) \ #define SET_BATTLER_TYPE(battlerId, type) \
{ \ { \
gBattleMons[battlerId].type1 = type; \ gBattleMons[battlerId].types[0] = type; \
gBattleMons[battlerId].type2 = type; \ gBattleMons[battlerId].types[1] = type; \
} }
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8 #define GET_STAT_BUFF_ID(n) ((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
#define GET_STAT_BUFF_VALUE2(n)((n & 0xF0)) #define GET_STAT_BUFF_VALUE2(n) ((n & 0xF0))
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40 #define GET_STAT_BUFF_VALUE(n) (((n >> 4) & 7)) // 0x10, 0x20, 0x40
#define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit #define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit
#define SET_STAT_BUFF_VALUE(n)((((n) << 4) & 0xF0)) #define SET_STAT_BUFF_VALUE(n) ((((n) << 4) & 0xF0))
#define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7)) #define SET_STATCHANGER(statId, stage, goesDown) (gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7))
// NOTE: The members of this struct have hard-coded offsets // NOTE: The members of this struct have hard-coded offsets
// in include/constants/battle_script_commands.h // in include/constants/battle_script_commands.h
@@ -595,7 +595,7 @@ struct BattleSpriteData
struct MonSpritesGfx struct MonSpritesGfx
{ {
void *firstDecompressed; // ptr to the decompressed sprite of the first pokemon void *firstDecompressed; // ptr to the decompressed sprite of the first Pokémon
union { union {
void *ptr[MAX_BATTLERS_COUNT]; void *ptr[MAX_BATTLERS_COUNT];
u8 *byte[MAX_BATTLERS_COUNT]; u8 *byte[MAX_BATTLERS_COUNT];
+1 -2
View File
@@ -124,8 +124,7 @@ struct ChooseMoveStruct
u8 currentPp[MAX_MON_MOVES]; u8 currentPp[MAX_MON_MOVES];
u8 maxPp[MAX_MON_MOVES]; u8 maxPp[MAX_MON_MOVES];
u16 species; u16 species;
u8 monType1; u8 monTypes[2];
u8 monType2;
}; };
enum enum
+3 -3
View File
@@ -23,9 +23,9 @@ struct MultiPartnerMenuPokemon
}; };
// defines for the u8 array gTypeEffectiveness // defines for the u8 array gTypeEffectiveness
#define TYPE_EFFECT_ATK_TYPE(i)((gTypeEffectiveness[i + 0])) #define TYPE_EFFECT_ATK_TYPE(i) ((gTypeEffectiveness[i + 0]))
#define TYPE_EFFECT_DEF_TYPE(i)((gTypeEffectiveness[i + 1])) #define TYPE_EFFECT_DEF_TYPE(i) ((gTypeEffectiveness[i + 1]))
#define TYPE_EFFECT_MULTIPLIER(i)((gTypeEffectiveness[i + 2])) #define TYPE_EFFECT_MULTIPLIER(i) ((gTypeEffectiveness[i + 2]))
// defines for the gTypeEffectiveness multipliers // defines for the gTypeEffectiveness multipliers
#define TYPE_MUL_NO_EFFECT 0 #define TYPE_MUL_NO_EFFECT 0
+3 -3
View File
@@ -33,9 +33,9 @@
#define ABILITYEFFECT_WATER_SPORT 254 #define ABILITYEFFECT_WATER_SPORT 254
#define ABILITYEFFECT_SWITCH_IN_WEATHER 255 #define ABILITYEFFECT_SWITCH_IN_WEATHER 255
#define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0)) #define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId) (AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0))
#define ABILITY_ON_FIELD(abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, abilityId, 0, 0)) #define ABILITY_ON_FIELD(abilityId) (AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, abilityId, 0, 0))
#define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0)) #define ABILITY_ON_FIELD2(abilityId) (AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0))
// For the first argument of ItemBattleEffects, to deteremine which block of item effects to try // For the first argument of ItemBattleEffects, to deteremine which block of item effects to try
#define ITEMEFFECT_ON_SWITCH_IN 0 #define ITEMEFFECT_ON_SWITCH_IN 0
+1 -1
View File
@@ -176,7 +176,7 @@
#define HITMARKER_ATTACKSTRING_PRINTED (1 << 10) #define HITMARKER_ATTACKSTRING_PRINTED (1 << 10)
#define HITMARKER_NO_PPDEDUCT (1 << 11) #define HITMARKER_NO_PPDEDUCT (1 << 11)
#define HITMARKER_SWAP_ATTACKER_TARGET (1 << 12) #define HITMARKER_SWAP_ATTACKER_TARGET (1 << 12)
#define HITMARKER_IGNORE_SAFEGUARD (1 << 13) #define HITMARKER_STATUS_ABILITY_EFFECT (1 << 13)
#define HITMARKER_SYNCHRONISE_EFFECT (1 << 14) #define HITMARKER_SYNCHRONISE_EFFECT (1 << 14)
#define HITMARKER_RUN (1 << 15) #define HITMARKER_RUN (1 << 15)
#define HITMARKER_IGNORE_ON_AIR (1 << 16) #define HITMARKER_IGNORE_ON_AIR (1 << 16)
+2 -2
View File
@@ -16,12 +16,12 @@
#define PALACE_DATA_WIN_STREAK 1 #define PALACE_DATA_WIN_STREAK 1
#define PALACE_DATA_WIN_STREAK_ACTIVE 2 #define PALACE_DATA_WIN_STREAK_ACTIVE 2
// Pokemon in Battle Palace have a move "group" type preference depending on nature // Pokémon in Battle Palace have a move "group" type preference depending on nature
#define PALACE_MOVE_GROUP_ATTACK 0 #define PALACE_MOVE_GROUP_ATTACK 0
#define PALACE_MOVE_GROUP_DEFENSE 1 #define PALACE_MOVE_GROUP_DEFENSE 1
#define PALACE_MOVE_GROUP_SUPPORT 2 #define PALACE_MOVE_GROUP_SUPPORT 2
// In palace doubles battles pokemon have a target preference depending on nature // In palace doubles battles Pokémon have a target preference depending on nature
#define PALACE_TARGET_STRONGER 0 #define PALACE_TARGET_STRONGER 0
#define PALACE_TARGET_WEAKER 1 #define PALACE_TARGET_WEAKER 1
#define PALACE_TARGET_RANDOM 2 #define PALACE_TARGET_RANDOM 2
+1 -1
View File
@@ -62,7 +62,7 @@
#define DEPT_STORE_FLOORNUM_11F 14 #define DEPT_STORE_FLOORNUM_11F 14
#define DEPT_STORE_FLOORNUM_ROOFTOP 15 #define DEPT_STORE_FLOORNUM_ROOFTOP 15
// Lilycove Pokemon Trainer Fan Club // Lilycove Pokémon Trainer Fan Club
#define NUM_TRAINER_FAN_CLUB_MEMBERS 8 #define NUM_TRAINER_FAN_CLUB_MEMBERS 8
#define FANCLUB_GOT_FIRST_FANS 7 #define FANCLUB_GOT_FIRST_FANS 7
+1
View File
@@ -8,6 +8,7 @@
#define NUM_FOG_DIAGONAL_SPRITES 20 #define NUM_FOG_DIAGONAL_SPRITES 20
#define NUM_SANDSTORM_SPRITES 20 #define NUM_SANDSTORM_SPRITES 20
#define NUM_SWIRL_SANDSTORM_SPRITES 5 #define NUM_SWIRL_SANDSTORM_SPRITES 5
#define NUM_SNOWFLAKE_SPRITES 16
// Controls how the weather should be changing the screen palettes. // Controls how the weather should be changing the screen palettes.
#define WEATHER_PAL_STATE_CHANGING_WEATHER 0 #define WEATHER_PAL_STATE_CHANGING_WEATHER 0
+84 -80
View File
@@ -2,6 +2,7 @@
#define GUARD_CONSTANTS_FLAGS_H #define GUARD_CONSTANTS_FLAGS_H
#include "constants/opponents.h" #include "constants/opponents.h"
#include "constants/rematches.h"
// Temporary Flags // Temporary Flags
// These temporary flags are are cleared every time a map is loaded. They are used // These temporary flags are are cleared every time a map is loaded. They are used
@@ -375,86 +376,89 @@
#define FLAG_MET_FRONTIER_BEAUTY_MOVE_TUTOR 0x15A #define FLAG_MET_FRONTIER_BEAUTY_MOVE_TUTOR 0x15A
#define FLAG_MET_FRONTIER_SWIMMER_MOVE_TUTOR 0x15B #define FLAG_MET_FRONTIER_SWIMMER_MOVE_TUTOR 0x15B
// Trainer Rematch Flags // Flags for whether a rematchable trainer has been registered in the player's Match Call.
#define FLAG_MATCH_CALL_REGISTERED 0x15C // Most are used implicitly by adding their REMATCH_* id to TRAINER_REGISTERED_FLAGS_START.
#define FLAG_REMATCH_ROSE 0x15D // Some Match Call entries (like those for gym leaders, Wally, and all non-trainer NPCs like Prof. Birch)
#define FLAG_REMATCH_ANDRES 0x15E // have their own separate flag that needs to be set to be enabled; see src/pokenav_match_call_data.c
#define FLAG_REMATCH_DUSTY 0x15F #define TRAINER_REGISTERED_FLAGS_START 0x15C
#define FLAG_REMATCH_LOLA 0x160 #define FLAG_REGISTERED_ROSE (TRAINER_REGISTERED_FLAGS_START + REMATCH_ROSE)
#define FLAG_REMATCH_RICKY 0x161 #define FLAG_REGISTERED_ANDRES (TRAINER_REGISTERED_FLAGS_START + REMATCH_ANDRES)
#define FLAG_REMATCH_LILA_AND_ROY 0x162 #define FLAG_REGISTERED_DUSTY (TRAINER_REGISTERED_FLAGS_START + REMATCH_DUSTY)
#define FLAG_REMATCH_CRISTIN 0x163 #define FLAG_REGISTERED_LOLA (TRAINER_REGISTERED_FLAGS_START + REMATCH_LOLA)
#define FLAG_REMATCH_BROOKE 0x164 #define FLAG_REGISTERED_RICKY (TRAINER_REGISTERED_FLAGS_START + REMATCH_RICKY)
#define FLAG_REMATCH_WILTON 0x165 #define FLAG_REGISTERED_LILA_AND_ROY (TRAINER_REGISTERED_FLAGS_START + REMATCH_LILA_AND_ROY)
#define FLAG_REMATCH_VALERIE 0x166 #define FLAG_REGISTERED_CRISTIN (TRAINER_REGISTERED_FLAGS_START + REMATCH_CRISTIN)
#define FLAG_REMATCH_CINDY 0x167 #define FLAG_REGISTERED_BROOKE (TRAINER_REGISTERED_FLAGS_START + REMATCH_BROOKE)
#define FLAG_REMATCH_THALIA 0x168 #define FLAG_REGISTERED_WILTON (TRAINER_REGISTERED_FLAGS_START + REMATCH_WILTON)
#define FLAG_REMATCH_JESSICA 0x169 #define FLAG_REGISTERED_VALERIE (TRAINER_REGISTERED_FLAGS_START + REMATCH_VALERIE)
#define FLAG_REMATCH_WINSTON 0x16A #define FLAG_REGISTERED_CINDY (TRAINER_REGISTERED_FLAGS_START + REMATCH_CINDY)
#define FLAG_REMATCH_STEVE 0x16B #define FLAG_REGISTERED_THALIA (TRAINER_REGISTERED_FLAGS_START + REMATCH_THALIA)
#define FLAG_REMATCH_TONY 0x16C #define FLAG_REGISTERED_JESSICA (TRAINER_REGISTERED_FLAGS_START + REMATCH_JESSICA)
#define FLAG_REMATCH_NOB 0x16D #define FLAG_REGISTERED_WINSTON (TRAINER_REGISTERED_FLAGS_START + REMATCH_WINSTON)
#define FLAG_REMATCH_KOJI 0x16E #define FLAG_REGISTERED_STEVE (TRAINER_REGISTERED_FLAGS_START + REMATCH_STEVE)
#define FLAG_REMATCH_FERNANDO 0x16F #define FLAG_REGISTERED_TONY (TRAINER_REGISTERED_FLAGS_START + REMATCH_TONY)
#define FLAG_REMATCH_DALTON 0x170 #define FLAG_REGISTERED_NOB (TRAINER_REGISTERED_FLAGS_START + REMATCH_NOB)
#define FLAG_REMATCH_BERNIE 0x171 #define FLAG_REGISTERED_KOJI (TRAINER_REGISTERED_FLAGS_START + REMATCH_KOJI)
#define FLAG_REMATCH_ETHAN 0x172 #define FLAG_REGISTERED_FERNANDO (TRAINER_REGISTERED_FLAGS_START + REMATCH_FERNANDO)
#define FLAG_REMATCH_JOHN_AND_JAY 0x173 #define FLAG_REGISTERED_DALTON (TRAINER_REGISTERED_FLAGS_START + REMATCH_DALTON)
#define FLAG_REMATCH_JEFFREY 0x174 #define FLAG_REGISTERED_BERNIE (TRAINER_REGISTERED_FLAGS_START + REMATCH_BERNIE)
#define FLAG_REMATCH_CAMERON 0x175 #define FLAG_REGISTERED_ETHAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_ETHAN)
#define FLAG_REMATCH_JACKI 0x176 #define FLAG_REGISTERED_JOHN_AND_JAY (TRAINER_REGISTERED_FLAGS_START + REMATCH_JOHN_AND_JAY)
#define FLAG_REMATCH_WALTER 0x177 #define FLAG_REGISTERED_JEFFREY (TRAINER_REGISTERED_FLAGS_START + REMATCH_JEFFREY)
#define FLAG_REMATCH_KAREN 0x178 #define FLAG_REGISTERED_CAMERON (TRAINER_REGISTERED_FLAGS_START + REMATCH_CAMERON)
#define FLAG_REMATCH_JERRY 0x179 #define FLAG_REGISTERED_JACKI (TRAINER_REGISTERED_FLAGS_START + REMATCH_JACKI)
#define FLAG_REMATCH_ANNA_AND_MEG 0x17A #define FLAG_REGISTERED_WALTER (TRAINER_REGISTERED_FLAGS_START + REMATCH_WALTER)
#define FLAG_REMATCH_ISABEL 0x17B #define FLAG_REGISTERED_KAREN (TRAINER_REGISTERED_FLAGS_START + REMATCH_KAREN)
#define FLAG_REMATCH_MIGUEL 0x17C #define FLAG_REGISTERED_JERRY (TRAINER_REGISTERED_FLAGS_START + REMATCH_JERRY)
#define FLAG_REMATCH_TIMOTHY 0x17D #define FLAG_REGISTERED_ANNA_AND_MEG (TRAINER_REGISTERED_FLAGS_START + REMATCH_ANNA_AND_MEG)
#define FLAG_REMATCH_SHELBY 0x17E #define FLAG_REGISTERED_ISABEL (TRAINER_REGISTERED_FLAGS_START + REMATCH_ISABEL)
#define FLAG_REMATCH_CALVIN 0x17F #define FLAG_REGISTERED_MIGUEL (TRAINER_REGISTERED_FLAGS_START + REMATCH_MIGUEL)
#define FLAG_REMATCH_ELLIOT 0x180 #define FLAG_REGISTERED_TIMOTHY (TRAINER_REGISTERED_FLAGS_START + REMATCH_TIMOTHY)
#define FLAG_REMATCH_ISAIAH 0x181 #define FLAG_REGISTERED_SHELBY (TRAINER_REGISTERED_FLAGS_START + REMATCH_SHELBY)
#define FLAG_REMATCH_MARIA 0x182 #define FLAG_REGISTERED_CALVIN (TRAINER_REGISTERED_FLAGS_START + REMATCH_CALVIN)
#define FLAG_REMATCH_ABIGAIL 0x183 #define FLAG_REGISTERED_ELLIOT (TRAINER_REGISTERED_FLAGS_START + REMATCH_ELLIOT)
#define FLAG_REMATCH_DYLAN 0x184 #define FLAG_REGISTERED_ISAIAH (TRAINER_REGISTERED_FLAGS_START + REMATCH_ISAIAH)
#define FLAG_REMATCH_KATELYN 0x185 #define FLAG_REGISTERED_MARIA (TRAINER_REGISTERED_FLAGS_START + REMATCH_MARIA)
#define FLAG_REMATCH_BENJAMIN 0x186 #define FLAG_REGISTERED_ABIGAIL (TRAINER_REGISTERED_FLAGS_START + REMATCH_ABIGAIL)
#define FLAG_REMATCH_PABLO 0x187 #define FLAG_REGISTERED_DYLAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_DYLAN)
#define FLAG_REMATCH_NICOLAS 0x188 #define FLAG_REGISTERED_KATELYN (TRAINER_REGISTERED_FLAGS_START + REMATCH_KATELYN)
#define FLAG_REMATCH_ROBERT 0x189 #define FLAG_REGISTERED_BENJAMIN (TRAINER_REGISTERED_FLAGS_START + REMATCH_BENJAMIN)
#define FLAG_REMATCH_LAO 0x18A #define FLAG_REGISTERED_PABLO (TRAINER_REGISTERED_FLAGS_START + REMATCH_PABLO)
#define FLAG_REMATCH_CYNDY 0x18B #define FLAG_REGISTERED_NICOLAS (TRAINER_REGISTERED_FLAGS_START + REMATCH_NICOLAS)
#define FLAG_REMATCH_MADELINE 0x18C #define FLAG_REGISTERED_ROBERT (TRAINER_REGISTERED_FLAGS_START + REMATCH_ROBERT)
#define FLAG_REMATCH_JENNY 0x18D #define FLAG_REGISTERED_LAO (TRAINER_REGISTERED_FLAGS_START + REMATCH_LAO)
#define FLAG_REMATCH_DIANA 0x18E #define FLAG_REGISTERED_CYNDY (TRAINER_REGISTERED_FLAGS_START + REMATCH_CYNDY)
#define FLAG_REMATCH_AMY_AND_LIV 0x18F #define FLAG_REGISTERED_MADELINE (TRAINER_REGISTERED_FLAGS_START + REMATCH_MADELINE)
#define FLAG_REMATCH_ERNEST 0x190 #define FLAG_REGISTERED_JENNY (TRAINER_REGISTERED_FLAGS_START + REMATCH_JENNY)
#define FLAG_REMATCH_CORY 0x191 #define FLAG_REGISTERED_DIANA (TRAINER_REGISTERED_FLAGS_START + REMATCH_DIANA)
#define FLAG_REMATCH_EDWIN 0x192 #define FLAG_REGISTERED_AMY_AND_LIV (TRAINER_REGISTERED_FLAGS_START + REMATCH_AMY_AND_LIV)
#define FLAG_REMATCH_LYDIA 0x193 #define FLAG_REGISTERED_ERNEST (TRAINER_REGISTERED_FLAGS_START + REMATCH_ERNEST)
#define FLAG_REMATCH_ISAAC 0x194 #define FLAG_REGISTERED_CORY (TRAINER_REGISTERED_FLAGS_START + REMATCH_CORY)
#define FLAG_REMATCH_GABRIELLE 0x195 #define FLAG_REGISTERED_EDWIN (TRAINER_REGISTERED_FLAGS_START + REMATCH_EDWIN)
#define FLAG_REMATCH_CATHERINE 0x196 #define FLAG_REGISTERED_LYDIA (TRAINER_REGISTERED_FLAGS_START + REMATCH_LYDIA)
#define FLAG_REMATCH_JACKSON 0x197 #define FLAG_REGISTERED_ISAAC (TRAINER_REGISTERED_FLAGS_START + REMATCH_ISAAC)
#define FLAG_REMATCH_HALEY 0x198 #define FLAG_REGISTERED_GABRIELLE (TRAINER_REGISTERED_FLAGS_START + REMATCH_GABRIELLE)
#define FLAG_REMATCH_JAMES 0x199 #define FLAG_REGISTERED_CATHERINE (TRAINER_REGISTERED_FLAGS_START + REMATCH_CATHERINE)
#define FLAG_REMATCH_TRENT 0x19A #define FLAG_REGISTERED_JACKSON (TRAINER_REGISTERED_FLAGS_START + REMATCH_JACKSON)
#define FLAG_REMATCH_SAWYER 0x19B #define FLAG_REGISTERED_HALEY (TRAINER_REGISTERED_FLAGS_START + REMATCH_HALEY)
#define FLAG_REMATCH_KIRA_AND_DAN 0x19C #define FLAG_REGISTERED_JAMES (TRAINER_REGISTERED_FLAGS_START + REMATCH_JAMES)
#define FLAG_REMATCH_WALLY 0x19D #define FLAG_REGISTERED_TRENT (TRAINER_REGISTERED_FLAGS_START + REMATCH_TRENT)
#define FLAG_REMATCH_ROXANNE 0x19E #define FLAG_REGISTERED_SAWYER (TRAINER_REGISTERED_FLAGS_START + REMATCH_SAWYER)
#define FLAG_REMATCH_BRAWLY 0x19F #define FLAG_REGISTERED_KIRA_AND_DAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_KIRA_AND_DAN)
#define FLAG_REMATCH_WATTSON 0x1A0 #define FLAG_REGISTERED_WALLY (TRAINER_REGISTERED_FLAGS_START + REMATCH_WALLY)
#define FLAG_REMATCH_FLANNERY 0x1A1 #define FLAG_REGISTERED_ROXANNE (TRAINER_REGISTERED_FLAGS_START + REMATCH_ROXANNE)
#define FLAG_REMATCH_NORMAN 0x1A2 #define FLAG_REGISTERED_BRAWLY (TRAINER_REGISTERED_FLAGS_START + REMATCH_BRAWLY)
#define FLAG_REMATCH_WINONA 0x1A3 #define FLAG_REGISTERED_WATTSON (TRAINER_REGISTERED_FLAGS_START + REMATCH_WATTSON)
#define FLAG_REMATCH_TATE_AND_LIZA 0x1A4 #define FLAG_REGISTERED_FLANNERY (TRAINER_REGISTERED_FLAGS_START + REMATCH_FLANNERY)
// Note: FLAG_REMATCH_JUAN is handled by FLAG_ENABLE_JUAN_MATCH_CALL instead. #define FLAG_REGISTERED_NORMAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_NORMAN)
#define FLAG_REMATCH_SIDNEY 0x1A5 #define FLAG_REGISTERED_WINONA (TRAINER_REGISTERED_FLAGS_START + REMATCH_WINONA)
#define FLAG_REMATCH_PHOEBE 0x1A6 #define FLAG_REGISTERED_TATE_AND_LIZA (TRAINER_REGISTERED_FLAGS_START + REMATCH_TATE_AND_LIZA)
#define FLAG_REMATCH_GLACIA 0x1A7 #define FLAG_REGISTERED_JUAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_JUAN)
#define FLAG_REMATCH_DRAKE 0x1A8 #define FLAG_REGISTERED_SIDNEY (TRAINER_REGISTERED_FLAGS_START + REMATCH_SIDNEY)
#define FLAG_REMATCH_WALLACE 0x1A9 #define FLAG_REGISTERED_PHOEBE (TRAINER_REGISTERED_FLAGS_START + REMATCH_PHOEBE)
#define FLAG_REGISTERED_GLACIA (TRAINER_REGISTERED_FLAGS_START + REMATCH_GLACIA)
#define FLAG_REGISTERED_DRAKE (TRAINER_REGISTERED_FLAGS_START + REMATCH_DRAKE)
#define FLAG_REGISTERED_WALLACE (TRAINER_REGISTERED_FLAGS_START + REMATCH_WALLACE)
#define FLAG_UNUSED_0x1AA 0x1AA // Unused Flag #define FLAG_UNUSED_0x1AA 0x1AA // Unused Flag
#define FLAG_UNUSED_0x1AB 0x1AB // Unused Flag #define FLAG_UNUSED_0x1AB 0x1AB // Unused Flag
+2 -2
View File
@@ -2,9 +2,9 @@
#define GUARD_CONSTANTS_GLOBAL_H #define GUARD_CONSTANTS_GLOBAL_H
// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. // Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen.
// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen. // In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen.
// In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------". // In Gen 4 only, migrated Pokémon with Diamond, Pearl, or Platinum's ID show as "----------".
// Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh". // Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh".
// In Gen 4 and up, migrated Pokemon with HeartGold or SoulSilver's ID show the otherwise unused "Johto" string. // In Gen 4 and up, migrated Pokémon with HeartGold or SoulSilver's ID show the otherwise unused "Johto" string.
#define VERSION_SAPPHIRE 1 #define VERSION_SAPPHIRE 1
#define VERSION_RUBY 2 #define VERSION_RUBY 2
#define VERSION_EMERALD 3 #define VERSION_EMERALD 3
+4 -4
View File
@@ -23,7 +23,7 @@
#define FIRST_BALL ITEM_MASTER_BALL #define FIRST_BALL ITEM_MASTER_BALL
#define LAST_BALL ITEM_PREMIER_BALL #define LAST_BALL ITEM_PREMIER_BALL
// Pokemon Items // Pokémon Items
#define ITEM_POTION 13 #define ITEM_POTION 13
#define ITEM_ANTIDOTE 14 #define ITEM_ANTIDOTE 14
#define ITEM_BURN_HEAL 15 #define ITEM_BURN_HEAL 15
@@ -441,8 +441,8 @@
#define NUM_ROUTE_114_MAN_BERRIES (LAST_ROUTE_114_MAN_BERRY - FIRST_ROUTE_114_MAN_BERRY + 1) #define NUM_ROUTE_114_MAN_BERRIES (LAST_ROUTE_114_MAN_BERRY - FIRST_ROUTE_114_MAN_BERRY + 1)
#define NUM_ROUTE_114_MAN_BERRIES_SKIPPED (FIRST_ROUTE_114_MAN_BERRY - FIRST_BERRY_INDEX) #define NUM_ROUTE_114_MAN_BERRIES_SKIPPED (FIRST_ROUTE_114_MAN_BERRY - FIRST_BERRY_INDEX)
#define ITEM_TO_BERRY(itemId)(((itemId) - FIRST_BERRY_INDEX) + 1) #define ITEM_TO_BERRY(itemId) (((itemId) - FIRST_BERRY_INDEX) + 1)
#define ITEM_TO_MAIL(itemId)((itemId) - FIRST_MAIL_INDEX) #define ITEM_TO_MAIL(itemId) ((itemId) - FIRST_MAIL_INDEX)
#define MAIL_NONE 0xFF #define MAIL_NONE 0xFF
#define NUM_TECHNICAL_MACHINES 50 #define NUM_TECHNICAL_MACHINES 50
@@ -476,7 +476,7 @@
#define ITEM_B_USE_MEDICINE 1 #define ITEM_B_USE_MEDICINE 1
#define ITEM_B_USE_OTHER 2 #define ITEM_B_USE_OTHER 2
// Check if the item is one that can be used on a Pokemon. // Check if the item is one that can be used on a Pokémon.
#define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= MAX_BERRY_INDEX) #define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= MAX_BERRY_INDEX)
#endif // GUARD_CONSTANTS_ITEMS_H #endif // GUARD_CONSTANTS_ITEMS_H
+71 -71
View File
@@ -9,18 +9,6 @@
#define METATILE_BattleDome_Door_Lobby 0x209 #define METATILE_BattleDome_Door_Lobby 0x209
#define METATILE_BattleDome_Door_PreBattleRoom 0x20A #define METATILE_BattleDome_Door_PreBattleRoom 0x20A
// gTileset_BattleFrontierOutsideEast
#define METATILE_BattleFrontierOutsideEast_Door 0x3FC
#define METATILE_BattleFrontierOutsideEast_Door_BattleArena 0x291
#define METATILE_BattleFrontierOutsideEast_Door_BattleTower 0x329
#define METATILE_BattleFrontierOutsideEast_Door_Sliding 0x396
// gTileset_BattleFrontierOutsideWest
#define METATILE_BattleFrontierOutsideWest_Door 0x3FC
#define METATILE_BattleFrontierOutsideWest_Door_BattleDome 0x28A
#define METATILE_BattleFrontierOutsideWest_Door_BattleFactory 0x263
#define METATILE_BattleFrontierOutsideWest_Door_Sliding 0x396
// gTileset_BattleFrontier // gTileset_BattleFrontier
#define METATILE_BattleFrontier_CorridorOpenDoor_Bottom 0x20F #define METATILE_BattleFrontier_CorridorOpenDoor_Bottom 0x20F
#define METATILE_BattleFrontier_CorridorOpenDoor_Top 0x207 #define METATILE_BattleFrontier_CorridorOpenDoor_Top 0x207
@@ -36,6 +24,18 @@
#define METATILE_BattleFrontier_Elevator_Top1 0x32A #define METATILE_BattleFrontier_Elevator_Top1 0x32A
#define METATILE_BattleFrontier_Elevator_Top2 0x32B #define METATILE_BattleFrontier_Elevator_Top2 0x32B
// gTileset_BattleFrontierOutsideEast
#define METATILE_BattleFrontierOutsideEast_Door 0x3FC
#define METATILE_BattleFrontierOutsideEast_Door_BattleArena 0x291
#define METATILE_BattleFrontierOutsideEast_Door_BattleTower 0x329
#define METATILE_BattleFrontierOutsideEast_Door_Sliding 0x396
// gTileset_BattleFrontierOutsideWest
#define METATILE_BattleFrontierOutsideWest_Door 0x3FC
#define METATILE_BattleFrontierOutsideWest_Door_BattleDome 0x28A
#define METATILE_BattleFrontierOutsideWest_Door_BattleFactory 0x263
#define METATILE_BattleFrontierOutsideWest_Door_Sliding 0x396
// gTileset_BattlePalace // gTileset_BattlePalace
#define METATILE_BattlePalace_Door 0x219 #define METATILE_BattlePalace_Door 0x219
@@ -272,6 +272,18 @@
#define METATILE_Lavaridge_NormalGrass 0x206 #define METATILE_Lavaridge_NormalGrass 0x206
#define METATILE_Lavaridge_RockWall 0x274 #define METATILE_Lavaridge_RockWall 0x274
// gTileset_Lilycove
#define METATILE_Lilycove_Door 0x246
#define METATILE_Lilycove_Door_DeptStore 0x30C
#define METATILE_Lilycove_Door_SafariZone 0x32D
#define METATILE_Lilycove_Door_Wooden 0x28E
#define METATILE_Lilycove_Wailmer0 0x290
#define METATILE_Lilycove_Wailmer0_Alt 0x298
#define METATILE_Lilycove_Wailmer1 0x291
#define METATILE_Lilycove_Wailmer1_Alt 0x299
#define METATILE_Lilycove_Wailmer2 0x2A0
#define METATILE_Lilycove_Wailmer3 0x2A1
// gTileset_LilycoveMuseum // gTileset_LilycoveMuseum
#define METATILE_LilycoveMuseum_Painting0_Left 0x25A #define METATILE_LilycoveMuseum_Painting0_Left 0x25A
#define METATILE_LilycoveMuseum_Painting0_Right 0x25B #define METATILE_LilycoveMuseum_Painting0_Right 0x25B
@@ -284,17 +296,31 @@
#define METATILE_LilycoveMuseum_Painting4_Left 0x262 #define METATILE_LilycoveMuseum_Painting4_Left 0x262
#define METATILE_LilycoveMuseum_Painting4_Right 0x263 #define METATILE_LilycoveMuseum_Painting4_Right 0x263
// gTileset_Lilycove // gTileset_Mauville
#define METATILE_Lilycove_Door 0x246 #define METATILE_Mauville_DeepSand_BottomMid 0x259
#define METATILE_Lilycove_Door_DeptStore 0x30C #define METATILE_Mauville_DeepSand_Center 0x251
#define METATILE_Lilycove_Door_SafariZone 0x32D #define METATILE_Mauville_Door 0x2AC
#define METATILE_Lilycove_Door_Wooden 0x28E #define METATILE_Mauville_Door_BattleTent 0x3D4
#define METATILE_Lilycove_Wailmer0 0x290 #define METATILE_Mauville_Door_CyclingRoad 0x289
#define METATILE_Lilycove_Wailmer0_Alt 0x298 #define METATILE_Mauville_Door_Verdanturf 0x3A1
#define METATILE_Lilycove_Wailmer1 0x291 #define METATILE_Mauville_MirageTower_Tile0 0x3D8
#define METATILE_Lilycove_Wailmer1_Alt 0x299 #define METATILE_Mauville_MirageTower_Tile1 0x3D9
#define METATILE_Lilycove_Wailmer2 0x2A0 #define METATILE_Mauville_MirageTower_Tile10 0x3E4
#define METATILE_Lilycove_Wailmer3 0x2A1 #define METATILE_Mauville_MirageTower_Tile11 0x3E5
#define METATILE_Mauville_MirageTower_Tile2 0x3DA
#define METATILE_Mauville_MirageTower_Tile3 0x3E0
#define METATILE_Mauville_MirageTower_Tile4 0x3E1
#define METATILE_Mauville_MirageTower_Tile5 0x3E2
#define METATILE_Mauville_MirageTower_Tile6 0x3E8
#define METATILE_Mauville_MirageTower_Tile7 0x3E9
#define METATILE_Mauville_MirageTower_Tile8 0x3EA
#define METATILE_Mauville_MirageTower_Tile9 0x3F0
#define METATILE_Mauville_MirageTower_TileA 0x3F1
#define METATILE_Mauville_MirageTower_TileB 0x3F2
#define METATILE_Mauville_MirageTower_TileC 0x3DB
#define METATILE_Mauville_MirageTower_TileD 0x3DC
#define METATILE_Mauville_MirageTower_TileE 0x3DD
#define METATILE_Mauville_MirageTower_TileF 0x3E3
// gTileset_MauvilleGym // gTileset_MauvilleGym
#define METATILE_MauvilleGym_FloorTile 0x21A #define METATILE_MauvilleGym_FloorTile 0x21A
@@ -325,38 +351,16 @@
#define METATILE_MauvilleGym_RedBeamV1_On 0x241 #define METATILE_MauvilleGym_RedBeamV1_On 0x241
#define METATILE_MauvilleGym_RedBeamV2_On 0x249 #define METATILE_MauvilleGym_RedBeamV2_On 0x249
// gTileset_Mauville
#define METATILE_Mauville_DeepSand_BottomMid 0x259
#define METATILE_Mauville_DeepSand_Center 0x251
#define METATILE_Mauville_Door 0x2AC
#define METATILE_Mauville_Door_BattleTent 0x3D4
#define METATILE_Mauville_Door_CyclingRoad 0x289
#define METATILE_Mauville_Door_Verdanturf 0x3A1
#define METATILE_Mauville_MirageTower_Tile0 0x3D8
#define METATILE_Mauville_MirageTower_Tile1 0x3D9
#define METATILE_Mauville_MirageTower_Tile10 0x3E4
#define METATILE_Mauville_MirageTower_Tile11 0x3E5
#define METATILE_Mauville_MirageTower_Tile2 0x3DA
#define METATILE_Mauville_MirageTower_Tile3 0x3E0
#define METATILE_Mauville_MirageTower_Tile4 0x3E1
#define METATILE_Mauville_MirageTower_Tile5 0x3E2
#define METATILE_Mauville_MirageTower_Tile6 0x3E8
#define METATILE_Mauville_MirageTower_Tile7 0x3E9
#define METATILE_Mauville_MirageTower_Tile8 0x3EA
#define METATILE_Mauville_MirageTower_Tile9 0x3F0
#define METATILE_Mauville_MirageTower_TileA 0x3F1
#define METATILE_Mauville_MirageTower_TileB 0x3F2
#define METATILE_Mauville_MirageTower_TileC 0x3DB
#define METATILE_Mauville_MirageTower_TileD 0x3DC
#define METATILE_Mauville_MirageTower_TileE 0x3DD
#define METATILE_Mauville_MirageTower_TileF 0x3E3
// gTileset_MeteorFalls // gTileset_MeteorFalls
#define METATILE_MeteorFalls_CaveEntrance_Bottom 0x24E #define METATILE_MeteorFalls_CaveEntrance_Bottom 0x24E
#define METATILE_MeteorFalls_CaveEntrance_Left 0x24D #define METATILE_MeteorFalls_CaveEntrance_Left 0x24D
#define METATILE_MeteorFalls_CaveEntrance_Right 0x24F #define METATILE_MeteorFalls_CaveEntrance_Right 0x24F
#define METATILE_MeteorFalls_CaveEntrance_Top 0x246 #define METATILE_MeteorFalls_CaveEntrance_Top 0x246
// gTileset_Mossdeep
#define METATILE_Mossdeep_Door 0x2A1
#define METATILE_Mossdeep_Door_SpaceCenter 0x2ED
// gTileset_MossdeepGameCorner // gTileset_MossdeepGameCorner
#define METATILE_MossdeepGameCorner_CounterClosed_Bottom 0x232 #define METATILE_MossdeepGameCorner_CounterClosed_Bottom 0x232
#define METATILE_MossdeepGameCorner_CounterClosed_Top 0x22A #define METATILE_MossdeepGameCorner_CounterClosed_Top 0x22A
@@ -366,10 +370,6 @@
// gTileset_MossdeepGym // gTileset_MossdeepGym
#define METATILE_MossdeepGym_YellowArrow_Right 0x250 #define METATILE_MossdeepGym_YellowArrow_Right 0x250
// gTileset_Mossdeep
#define METATILE_Mossdeep_Door 0x2A1
#define METATILE_Mossdeep_Door_SpaceCenter 0x2ED
// gTileset_Pacifidlog // gTileset_Pacifidlog
#define METATILE_Pacifidlog_Door 0x21A #define METATILE_Pacifidlog_Door 0x21A
#define METATILE_Pacifidlog_FloatingLogs_HorizontalLeft 0x250 #define METATILE_Pacifidlog_FloatingLogs_HorizontalLeft 0x250
@@ -388,6 +388,11 @@
#define METATILE_Pacifidlog_SubmergedLogs_VerticalBottom 0x262 #define METATILE_Pacifidlog_SubmergedLogs_VerticalBottom 0x262
#define METATILE_Pacifidlog_SubmergedLogs_VerticalTop 0x25A #define METATILE_Pacifidlog_SubmergedLogs_VerticalTop 0x25A
// gTileset_Petalburg
#define METATILE_Petalburg_Door_BirchsLab 0x249
#define METATILE_Petalburg_Door_Littleroot 0x248
#define METATILE_Petalburg_Door_Oldale 0x287
// gTileset_PetalburgGym // gTileset_PetalburgGym
#define METATILE_PetalburgGym_Door 0x224 #define METATILE_PetalburgGym_Door 0x224
#define METATILE_PetalburgGym_RoomEntrance_Left 0x210 #define METATILE_PetalburgGym_RoomEntrance_Left 0x210
@@ -398,11 +403,6 @@
#define METATILE_PetalburgGym_SlidingDoor_Frame3 0x21B #define METATILE_PetalburgGym_SlidingDoor_Frame3 0x21B
#define METATILE_PetalburgGym_SlidingDoor_Frame4 0x21C #define METATILE_PetalburgGym_SlidingDoor_Frame4 0x21C
// gTileset_Petalburg
#define METATILE_Petalburg_Door_BirchsLab 0x249
#define METATILE_Petalburg_Door_Littleroot 0x248
#define METATILE_Petalburg_Door_Oldale 0x287
// gTileset_PokemonCenter // gTileset_PokemonCenter
#define METATILE_PokemonCenter_CounterBarrier 0x25D #define METATILE_PokemonCenter_CounterBarrier 0x25D
#define METATILE_PokemonCenter_Door_CableClub 0x264 #define METATILE_PokemonCenter_Door_CableClub 0x264
@@ -431,14 +431,6 @@
#define METATILE_PokemonCenter_Floor_ShadowTop 0x21E #define METATILE_PokemonCenter_Floor_ShadowTop 0x21E
#define METATILE_PokemonCenter_Floor_ShadowTop_Alt 0x2DC #define METATILE_PokemonCenter_Floor_ShadowTop_Alt 0x2DC
// gTileset_RSMossdeepGym
#define METATILE_RSMossdeepGym_RedArrow_Down 0x205
#define METATILE_RSMossdeepGym_RedArrow_Left 0x20C
#define METATILE_RSMossdeepGym_RedArrow_Right 0x204
#define METATILE_RSMossdeepGym_RedArrow_Up 0x20D
#define METATILE_RSMossdeepGym_Switch_Down 0x239
#define METATILE_RSMossdeepGym_Switch_Up 0x238
// gTileset_Rustboro // gTileset_Rustboro
#define METATILE_Rustboro_Door_Gray 0x21F #define METATILE_Rustboro_Door_Gray 0x21F
#define METATILE_Rustboro_Door_Tan 0x22F #define METATILE_Rustboro_Door_Tan 0x22F
@@ -726,11 +718,6 @@
#define METATILE_Slateport_Door 0x2DC #define METATILE_Slateport_Door 0x2DC
#define METATILE_Slateport_Door_BattleTent 0x393 #define METATILE_Slateport_Door_BattleTent 0x393
// gTileset_SootopolisGym
#define METATILE_SootopolisGym_Ice_Broken 0x206
#define METATILE_SootopolisGym_Ice_Cracked 0x20E
#define METATILE_SootopolisGym_Stairs 0x207
// gTileset_Sootopolis // gTileset_Sootopolis
#define METATILE_Sootopolis_Door 0x21E #define METATILE_Sootopolis_Door 0x21E
#define METATILE_Sootopolis_Door_Closed 0x248 #define METATILE_Sootopolis_Door_Closed 0x248
@@ -738,6 +725,11 @@
#define METATILE_Sootopolis_GymDoor_Closed 0x250 #define METATILE_Sootopolis_GymDoor_Closed 0x250
#define METATILE_Sootopolis_RoughWater 0x290 #define METATILE_Sootopolis_RoughWater 0x290
// gTileset_SootopolisGym
#define METATILE_SootopolisGym_Ice_Broken 0x206
#define METATILE_SootopolisGym_Ice_Cracked 0x20E
#define METATILE_SootopolisGym_Stairs 0x207
// gTileset_TrainerHill // gTileset_TrainerHill
#define METATILE_TrainerHill_CounterDoor 0x334 #define METATILE_TrainerHill_CounterDoor 0x334
#define METATILE_TrainerHill_Door_Elevator_Lobby 0x32C #define METATILE_TrainerHill_Door_Elevator_Lobby 0x32C
@@ -787,4 +779,12 @@
#define METATILE_Underwater_FloorShadow 0x228 #define METATILE_Underwater_FloorShadow 0x228
#define METATILE_Underwater_RockWall 0x21E #define METATILE_Underwater_RockWall 0x21E
// Other
#define METATILE_RSMossdeepGym_RedArrow_Down 0x205
#define METATILE_RSMossdeepGym_RedArrow_Left 0x20C
#define METATILE_RSMossdeepGym_RedArrow_Right 0x204
#define METATILE_RSMossdeepGym_RedArrow_Up 0x20D
#define METATILE_RSMossdeepGym_Switch_Down 0x239
#define METATILE_RSMossdeepGym_Switch_Up 0x238
#endif // GUARD_METATILE_LABELS_H #endif // GUARD_METATILE_LABELS_H
+3 -3
View File
@@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_POKEDEX_H #ifndef GUARD_CONSTANTS_POKEDEX_H
#define GUARD_CONSTANTS_POKEDEX_H #define GUARD_CONSTANTS_POKEDEX_H
// National Pokedex order // National Pokédex order
enum { enum {
NATIONAL_DEX_NONE, NATIONAL_DEX_NONE,
// Kanto // Kanto
@@ -425,7 +425,7 @@ enum {
#define JOHTO_DEX_COUNT NATIONAL_DEX_CELEBI #define JOHTO_DEX_COUNT NATIONAL_DEX_CELEBI
#define NATIONAL_DEX_COUNT NATIONAL_DEX_DEOXYS #define NATIONAL_DEX_COUNT NATIONAL_DEX_DEOXYS
// Hoenn Pokedex order // Hoenn Pokédex order
enum { enum {
HOENN_DEX_NONE, HOENN_DEX_NONE,
HOENN_DEX_TREECKO, HOENN_DEX_TREECKO,
@@ -631,7 +631,7 @@ enum {
HOENN_DEX_JIRACHI, HOENN_DEX_JIRACHI,
HOENN_DEX_DEOXYS, HOENN_DEX_DEOXYS,
// End of Hoenn Dex (see HOENN_DEX_COUNT) // End of Hoenn Dex (see HOENN_DEX_COUNT)
// Here below have values but are excluded from the Pokedex // Here below have values but are excluded from the Pokédex
HOENN_DEX_BULBASAUR, HOENN_DEX_BULBASAUR,
HOENN_DEX_IVYSAUR, HOENN_DEX_IVYSAUR,
HOENN_DEX_VENUSAUR, HOENN_DEX_VENUSAUR,
+6 -6
View File
@@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_POKEMON_H #ifndef GUARD_CONSTANTS_POKEMON_H
#define GUARD_CONSTANTS_POKEMON_H #define GUARD_CONSTANTS_POKEMON_H
// Pokemon types // Pokémon types
#define TYPE_NONE 255 #define TYPE_NONE 255
#define TYPE_NORMAL 0 #define TYPE_NORMAL 0
#define TYPE_FIGHTING 1 #define TYPE_FIGHTING 1
@@ -23,7 +23,7 @@
#define TYPE_DARK 17 #define TYPE_DARK 17
#define NUMBER_OF_MON_TYPES 18 #define NUMBER_OF_MON_TYPES 18
// Pokemon egg groups // Pokémon egg groups
#define EGG_GROUP_NONE 0 #define EGG_GROUP_NONE 0
#define EGG_GROUP_MONSTER 1 #define EGG_GROUP_MONSTER 1
#define EGG_GROUP_WATER_1 2 #define EGG_GROUP_WATER_1 2
@@ -43,7 +43,7 @@
#define EGG_GROUPS_PER_MON 2 #define EGG_GROUPS_PER_MON 2
// Pokemon natures // Pokémon natures
#define NATURE_HARDY 0 #define NATURE_HARDY 0
#define NATURE_LONELY 1 #define NATURE_LONELY 1
#define NATURE_BRAVE 2 #define NATURE_BRAVE 2
@@ -71,7 +71,7 @@
#define NATURE_QUIRKY 24 #define NATURE_QUIRKY 24
#define NUM_NATURES 25 #define NUM_NATURES 25
// Pokemon Stats // Pokémon Stats
#define STAT_HP 0 #define STAT_HP 0
#define STAT_ATK 1 #define STAT_ATK 1
#define STAT_DEF 2 #define STAT_DEF 2
@@ -220,7 +220,7 @@
#define GROWTH_FAST 4 #define GROWTH_FAST 4
#define GROWTH_SLOW 5 #define GROWTH_SLOW 5
// Body colors for pokedex search // Body colors for Pokédex search
#define BODY_COLOR_RED 0 #define BODY_COLOR_RED 0
#define BODY_COLOR_BLUE 1 #define BODY_COLOR_BLUE 1
#define BODY_COLOR_YELLOW 2 #define BODY_COLOR_YELLOW 2
@@ -263,7 +263,7 @@
#define MON_PIC_HEIGHT 64 #define MON_PIC_HEIGHT 64
#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2) #define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2)
// Most pokemon have 2 frames (a default and an alternate for their animation). // Most Pokémon have 2 frames (a default and an alternate for their animation).
// There are 4 exceptions: // There are 4 exceptions:
// - Castform has 4 frames, 1 for each form // - Castform has 4 frames, 1 for each form
// - Deoxys has 2 frames, 1 for each form // - Deoxys has 2 frames, 1 for each form
+6
View File
@@ -0,0 +1,6 @@
#ifndef GUARD_CONSTANTS_POKEMON_ICON_H
#define GUARD_CONSTANTS_POKEMON_ICON_H
#define POKE_ICON_BASE_PAL_TAG 56000
#endif // GUARD_CONSTANTS_POKEMON_ICON_H
+89
View File
@@ -0,0 +1,89 @@
#ifndef GUARD_REMATCHES_H
#define GUARD_REMATCHES_H
enum {
REMATCH_ROSE,
REMATCH_ANDRES,
REMATCH_DUSTY,
REMATCH_LOLA,
REMATCH_RICKY,
REMATCH_LILA_AND_ROY,
REMATCH_CRISTIN,
REMATCH_BROOKE,
REMATCH_WILTON,
REMATCH_VALERIE,
REMATCH_CINDY,
REMATCH_THALIA,
REMATCH_JESSICA,
REMATCH_WINSTON,
REMATCH_STEVE,
REMATCH_TONY,
REMATCH_NOB,
REMATCH_KOJI,
REMATCH_FERNANDO,
REMATCH_DALTON,
REMATCH_BERNIE,
REMATCH_ETHAN,
REMATCH_JOHN_AND_JAY,
REMATCH_JEFFREY,
REMATCH_CAMERON,
REMATCH_JACKI,
REMATCH_WALTER,
REMATCH_KAREN,
REMATCH_JERRY,
REMATCH_ANNA_AND_MEG,
REMATCH_ISABEL,
REMATCH_MIGUEL,
REMATCH_TIMOTHY,
REMATCH_SHELBY,
REMATCH_CALVIN,
REMATCH_ELLIOT,
REMATCH_ISAIAH,
REMATCH_MARIA,
REMATCH_ABIGAIL,
REMATCH_DYLAN,
REMATCH_KATELYN,
REMATCH_BENJAMIN,
REMATCH_PABLO,
REMATCH_NICOLAS,
REMATCH_ROBERT,
REMATCH_LAO,
REMATCH_CYNDY,
REMATCH_MADELINE,
REMATCH_JENNY,
REMATCH_DIANA,
REMATCH_AMY_AND_LIV,
REMATCH_ERNEST,
REMATCH_CORY,
REMATCH_EDWIN,
REMATCH_LYDIA,
REMATCH_ISAAC,
REMATCH_GABRIELLE,
REMATCH_CATHERINE,
REMATCH_JACKSON,
REMATCH_HALEY,
REMATCH_JAMES,
REMATCH_TRENT,
REMATCH_SAWYER,
REMATCH_KIRA_AND_DAN,
REMATCH_WALLY_VR, // Entries above WALLY are considered normal trainers, from Wally below are special trainers
REMATCH_ROXANNE,
REMATCH_BRAWLY,
REMATCH_WATTSON,
REMATCH_FLANNERY,
REMATCH_NORMAN,
REMATCH_WINONA,
REMATCH_TATE_AND_LIZA,
REMATCH_JUAN,
REMATCH_SIDNEY, // Entries from SIDNEY below are considered part of REMATCH_ELITE_FOUR_ENTRIES.
REMATCH_PHOEBE,
REMATCH_GLACIA,
REMATCH_DRAKE,
REMATCH_WALLACE,
REMATCH_TABLE_ENTRIES // The total number of rematch entries. Must be last in enum
};
#define REMATCH_SPECIAL_TRAINER_START REMATCH_WALLY_VR
#define REMATCH_ELITE_FOUR_ENTRIES REMATCH_SIDNEY
#endif // GUARD_REMATCHES_H
+1 -1
View File
@@ -170,7 +170,7 @@
#define NUM_SECRET_BASE_FLAGS 32 // by definition, bitfield of 2 u16s #define NUM_SECRET_BASE_FLAGS 32 // by definition, bitfield of 2 u16s
// TV Show states for Pokemon Contest Live Updates // TV Show states for Pokémon Contest Live Updates
#define CONTESTLIVE_STATE_INTRO 0 #define CONTESTLIVE_STATE_INTRO 0
#define CONTESTLIVE_STATE_WON_BOTH_ROUNDS 1 #define CONTESTLIVE_STATE_WON_BOTH_ROUNDS 1
#define CONTESTLIVE_STATE_BETTER_ROUND2 2 #define CONTESTLIVE_STATE_BETTER_ROUND2 2
+1 -1
View File
@@ -209,7 +209,7 @@ struct ContestantStatus
u8 comboAppealBonus; u8 comboAppealBonus;
u8 repeatJam; u8 repeatJam;
u8 nextTurnOrder; // turn position u8 nextTurnOrder; // turn position
u8 attentionLevel; // How much the Pokemon "stood out" u8 attentionLevel; // How much the Pokémon "stood out"
u8 contestantAnimTarget; u8 contestantAnimTarget;
}; };
+4 -4
View File
@@ -28,9 +28,9 @@ struct MonCoords
u8 y_offset; u8 y_offset;
}; };
#define MON_COORDS_SIZE(width, height)(DIV_ROUND_UP(width, 8) << 4 | DIV_ROUND_UP(height, 8)) #define MON_COORDS_SIZE(width, height) (DIV_ROUND_UP(width, 8) << 4 | DIV_ROUND_UP(height, 8))
#define GET_MON_COORDS_WIDTH(size)((size >> 4) * 8) #define GET_MON_COORDS_WIDTH(size) ((size >> 4) * 8)
#define GET_MON_COORDS_HEIGHT(size)((size & 0xF) * 8) #define GET_MON_COORDS_HEIGHT(size) ((size & 0xF) * 8)
struct TrainerMonNoItemDefaultMoves struct TrainerMonNoItemDefaultMoves
{ {
@@ -91,7 +91,7 @@ struct Trainer
/*0x24*/ union TrainerMonPtr party; /*0x24*/ union TrainerMonPtr party;
}; };
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F)) #define TRAINER_ENCOUNTER_MUSIC(trainer) ((gTrainers[trainer].encounterMusic_gender & 0x7F))
extern const u16 gMinigameDigits_Pal[]; extern const u16 gMinigameDigits_Pal[];
extern const u32 gMinigameDigits_Gfx[]; extern const u32 gMinigameDigits_Gfx[];
+8 -2
View File
@@ -71,6 +71,12 @@ enum ReflectionTypes
#define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18) #define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18)
#define GROUND_EFFECT_FLAG_SEAWEED (1 << 19) #define GROUND_EFFECT_FLAG_SEAWEED (1 << 19)
// Sprite data for the CameraObject functions
#define sCamera_FollowSpriteId data[0]
#define sCamera_State data[1]
#define sCamera_MoveX data[2]
#define sCamera_MoveY data[3]
struct StepAnimTable struct StepAnimTable
{ {
const union AnimCmd *const *anims; const union AnimCmd *const *anims;
@@ -123,7 +129,7 @@ u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup);
u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation); u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation);
u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *); u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *);
void SetSpritePosToMapCoords(s16 mapX, s16 mapY, s16 *destX, s16 *destY); void SetSpritePosToMapCoords(s16 mapX, s16 mapY, s16 *destX, s16 *destY);
void CameraObjectReset1(void); void CameraObjectReset(void);
void ObjectEventSetGraphicsId(struct ObjectEvent *, u8 graphicsId); void ObjectEventSetGraphicsId(struct ObjectEvent *, u8 graphicsId);
void ObjectEventTurn(struct ObjectEvent *, u8 direction); void ObjectEventTurn(struct ObjectEvent *, u8 direction);
void ObjectEventTurnByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 direction); void ObjectEventTurnByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 direction);
@@ -211,7 +217,7 @@ u16 GetObjectPaletteTag(u8 palSlot);
void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible); void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible);
s16 GetFigure8XOffset(s16 idx); s16 GetFigure8XOffset(s16 idx);
s16 GetFigure8YOffset(s16 idx); s16 GetFigure8YOffset(s16 idx);
void CameraObjectReset2(void); void CameraObjectFreeze(void);
u8 GetObjectEventBerryTreeId(u8 objectEventId); u8 GetObjectEventBerryTreeId(u8 objectEventId);
void SetBerryTreeJustPicked(u8 mapId, u8 mapNumber, u8 mapGroup); void SetBerryTreeJustPicked(u8 mapId, u8 mapNumber, u8 mapGroup);
bool8 IsBerryTreeSparkling(u8 localId, u8 mapNum, u8 mapGroup); bool8 IsBerryTreeSparkling(u8 localId, u8 mapNum, u8 mapGroup);
+1 -1
View File
@@ -75,7 +75,7 @@
#define DISPLAY_TILE_HEIGHT (DISPLAY_HEIGHT / TILE_HEIGHT) #define DISPLAY_TILE_HEIGHT (DISPLAY_HEIGHT / TILE_HEIGHT)
// Size of different tile formats in bytes // Size of different tile formats in bytes
#define TILE_SIZE(bpp)((bpp) * TILE_WIDTH * TILE_HEIGHT / 8) #define TILE_SIZE(bpp) ((bpp) * TILE_WIDTH * TILE_HEIGHT / 8)
#define TILE_SIZE_1BPP TILE_SIZE(1) // 8 #define TILE_SIZE_1BPP TILE_SIZE(1) // 8
#define TILE_SIZE_4BPP TILE_SIZE(4) // 32 #define TILE_SIZE_4BPP TILE_SIZE(4) // 32
#define TILE_SIZE_8BPP TILE_SIZE(8) // 64 #define TILE_SIZE_8BPP TILE_SIZE(8) // 64
+1 -1
View File
@@ -131,7 +131,7 @@ struct MapEvents
struct MapConnection struct MapConnection
{ {
u8 direction; u8 direction;
u32 offset; s32 offset;
u8 mapGroup; u8 mapGroup;
u8 mapNum; u8 mapNum;
}; };
+5 -5
View File
@@ -80,7 +80,7 @@
// Used in cases where division by 0 can occur in the retail version. // Used in cases where division by 0 can occur in the retail version.
// Avoids invalid opcodes on some emulators, and the otherwise UB. // Avoids invalid opcodes on some emulators, and the otherwise UB.
#ifdef UBFIX #ifdef UBFIX
#define SAFE_DIV(a, b) ((b) ? (a) / (b) : 0) #define SAFE_DIV(a, b) (((b) != 0) ? (a) / (b) : 0)
#else #else
#define SAFE_DIV(a, b) ((a) / (b)) #define SAFE_DIV(a, b) ((a) / (b))
#endif #endif
@@ -89,7 +89,7 @@
// There are cases where GF does a&(n-1) where we would really like to have a%n, because // There are cases where GF does a&(n-1) where we would really like to have a%n, because
// if n is changed to a value that isn't a power of 2 then a&(n-1) is unlikely to work as // if n is changed to a value that isn't a power of 2 then a&(n-1) is unlikely to work as
// intended, and a%n for powers of 2 isn't always optimized to use &. // intended, and a%n for powers of 2 isn't always optimized to use &.
#define MOD(a, n)(((n) & ((n)-1)) ? ((a) % (n)) : ((a) & ((n)-1))) #define MOD(a, n) (((n) & ((n)-1)) ? ((a) % (n)) : ((a) & ((n)-1)))
// Extracts the upper 16 bits of a 32-bit number // Extracts the upper 16 bits of a 32-bit number
#define HIHALF(n) (((n) & 0xFFFF0000) >> 16) #define HIHALF(n) (((n) & 0xFFFF0000) >> 16)
@@ -130,12 +130,12 @@
f; \ f; \
}) })
#define DIV_ROUND_UP(val, roundBy)(((val) / (roundBy)) + (((val) % (roundBy)) ? 1 : 0)) #define DIV_ROUND_UP(val, roundBy) (((val) / (roundBy)) + (((val) % (roundBy)) ? 1 : 0))
#define ROUND_BITS_TO_BYTES(numBits) DIV_ROUND_UP(numBits, 8) #define ROUND_BITS_TO_BYTES(numBits) DIV_ROUND_UP(numBits, 8)
// NUM_DEX_FLAG_BYTES allocates more flags than it needs to, as NUM_SPECIES includes the "old unown" // NUM_DEX_FLAG_BYTES allocates more flags than it needs to, as NUM_SPECIES includes the "old unown"
// values that don't appear in the Pokedex. NATIONAL_DEX_COUNT does not include these values. // values that don't appear in the Pokédex. NATIONAL_DEX_COUNT does not include these values.
#define NUM_DEX_FLAG_BYTES ROUND_BITS_TO_BYTES(NUM_SPECIES) #define NUM_DEX_FLAG_BYTES ROUND_BITS_TO_BYTES(NUM_SPECIES)
#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT) #define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT)
#define NUM_TRENDY_SAYING_BYTES ROUND_BITS_TO_BYTES(NUM_TRENDY_SAYINGS) #define NUM_TRENDY_SAYING_BYTES ROUND_BITS_TO_BYTES(NUM_TRENDY_SAYINGS)
@@ -520,7 +520,7 @@ struct SaveBlock2
/*0x90*/ u8 filler_90[0x8]; /*0x90*/ u8 filler_90[0x8];
/*0x98*/ struct Time localTimeOffset; /*0x98*/ struct Time localTimeOffset;
/*0xA0*/ struct Time lastBerryTreeUpdate; /*0xA0*/ struct Time lastBerryTreeUpdate;
/*0xA8*/ u32 gcnLinkFlags; // Read by Pokemon Colosseum/XD /*0xA8*/ u32 gcnLinkFlags; // Read by Pokémon Colosseum/XD
/*0xAC*/ u32 encryptionKey; /*0xAC*/ u32 encryptionKey;
/*0xB0*/ struct PlayersApprentice playerApprentice; /*0xB0*/ struct PlayersApprentice playerApprentice;
/*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT]; /*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT];
+6 -6
View File
@@ -32,7 +32,7 @@ extern const u32 gBallGfx_Premier[];
extern const u32 gBallPal_Premier[]; extern const u32 gBallPal_Premier[];
extern const u32 gOpenPokeballGfx[]; extern const u32 gOpenPokeballGfx[];
// pokemon gfx // Pokémon gfx
extern const u32 gMonFrontPic_Bulbasaur[]; extern const u32 gMonFrontPic_Bulbasaur[];
extern const u32 gMonPalette_Bulbasaur[]; extern const u32 gMonPalette_Bulbasaur[];
extern const u32 gMonBackPic_Bulbasaur[]; extern const u32 gMonBackPic_Bulbasaur[];
@@ -3282,7 +3282,7 @@ extern const u32 gBattleTerrainPalette_StadiumGlacia[];
extern const u32 gBattleTerrainPalette_StadiumDrake[]; extern const u32 gBattleTerrainPalette_StadiumDrake[];
extern const u32 gBattleTerrainPalette_StadiumWallace[]; extern const u32 gBattleTerrainPalette_StadiumWallace[];
// pokedex // Pokédex
extern const u32 gPokedexInterface_Gfx[]; extern const u32 gPokedexInterface_Gfx[];
extern const u16 gPokedexBgHoenn_Pal[]; extern const u16 gPokedexBgHoenn_Pal[];
extern const u32 gPokedexMenu_Gfx[]; extern const u32 gPokedexMenu_Gfx[];
@@ -4005,7 +4005,7 @@ extern const u32 gBerryPalette_Starf[];
extern const u32 gBerryPic_Enigma[]; extern const u32 gBerryPic_Enigma[];
extern const u32 gBerryPalette_Enigma[]; extern const u32 gBerryPalette_Enigma[];
//pokenav //PokéNav
extern const u16 gPokenavCondition_Pal[]; extern const u16 gPokenavCondition_Pal[];
extern const u32 gPokenavCondition_Gfx[]; extern const u32 gPokenavCondition_Gfx[];
extern const u32 gPokenavCondition_Tilemap[]; extern const u32 gPokenavCondition_Tilemap[];
@@ -4879,11 +4879,11 @@ extern const u16 gSlotMachineReelTimePikachu_Pal[];
extern const u32 gBattleAnimBgTilemap_Sandstorm[]; extern const u32 gBattleAnimBgTilemap_Sandstorm[];
extern const u32 gBattleAnimBgImage_Sandstorm[]; extern const u32 gBattleAnimBgImage_Sandstorm[];
// Pokedex Area Screen // Pokédex Area Screen
extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[];
extern const u16 gPokedexAreaScreenAreaUnknown_Pal[]; extern const u16 gPokedexAreaScreenAreaUnknown_Pal[];
// Pokemon Storage System // Pokémon Storage System
extern const u32 gStorageSystemMenu_Gfx[]; extern const u32 gStorageSystemMenu_Gfx[];
extern const u16 gStorageSystemPartyMenu_Pal[]; extern const u16 gStorageSystemPartyMenu_Pal[];
extern const u32 gStorageSystemPartyMenu_Tilemap[]; extern const u32 gStorageSystemPartyMenu_Tilemap[];
@@ -5011,7 +5011,7 @@ extern const u32 gBerryCrush_Crusher_Gfx[];
extern const u16 gBerryCrush_Crusher_Pal[]; extern const u16 gBerryCrush_Crusher_Pal[];
extern const u32 gBerryCrush_TextWindows_Tilemap[]; extern const u32 gBerryCrush_TextWindows_Tilemap[];
// Pokenav // PokéNav
extern const u32 gPokenavMessageBox_Gfx[]; extern const u32 gPokenavMessageBox_Gfx[];
extern const u32 gPokenavMessageBox_Tilemap[]; extern const u32 gPokenavMessageBox_Tilemap[];
extern const u16 gPokenavMessageBox_Pal[]; extern const u16 gPokenavMessageBox_Pal[];
+1 -84
View File
@@ -1,90 +1,7 @@
#ifndef GUARD_TRAINER_REMATCH_H #ifndef GUARD_TRAINER_REMATCH_H
#define GUARD_TRAINER_REMATCH_H #define GUARD_TRAINER_REMATCH_H
enum { #include "constants/rematches.h"
REMATCH_ROSE,
REMATCH_ANDRES,
REMATCH_DUSTY,
REMATCH_LOLA,
REMATCH_RICKY,
REMATCH_LILA_AND_ROY,
REMATCH_CRISTIN,
REMATCH_BROOKE,
REMATCH_WILTON,
REMATCH_VALERIE,
REMATCH_CINDY,
REMATCH_THALIA,
REMATCH_JESSICA,
REMATCH_WINSTON,
REMATCH_STEVE,
REMATCH_TONY,
REMATCH_NOB,
REMATCH_KOJI,
REMATCH_FERNANDO,
REMATCH_DALTON,
REMATCH_BERNIE,
REMATCH_ETHAN,
REMATCH_JOHN_AND_JAY,
REMATCH_JEFFREY,
REMATCH_CAMERON,
REMATCH_JACKI,
REMATCH_WALTER,
REMATCH_KAREN,
REMATCH_JERRY,
REMATCH_ANNA_AND_MEG,
REMATCH_ISABEL,
REMATCH_MIGUEL,
REMATCH_TIMOTHY,
REMATCH_SHELBY,
REMATCH_CALVIN,
REMATCH_ELLIOT,
REMATCH_ISAIAH,
REMATCH_MARIA,
REMATCH_ABIGAIL,
REMATCH_DYLAN,
REMATCH_KATELYN,
REMATCH_BENJAMIN,
REMATCH_PABLO,
REMATCH_NICOLAS,
REMATCH_ROBERT,
REMATCH_LAO,
REMATCH_CYNDY,
REMATCH_MADELINE,
REMATCH_JENNY,
REMATCH_DIANA,
REMATCH_AMY_AND_LIV,
REMATCH_ERNEST,
REMATCH_CORY,
REMATCH_EDWIN,
REMATCH_LYDIA,
REMATCH_ISAAC,
REMATCH_GABRIELLE,
REMATCH_CATHERINE,
REMATCH_JACKSON,
REMATCH_HALEY,
REMATCH_JAMES,
REMATCH_TRENT,
REMATCH_SAWYER,
REMATCH_KIRA_AND_DAN,
REMATCH_WALLY_VR, // Entries above WALLY are considered normal trainers, from Wally below are special trainers
REMATCH_ROXANNE,
REMATCH_BRAWLY,
REMATCH_WATTSON,
REMATCH_FLANNERY,
REMATCH_NORMAN,
REMATCH_WINONA,
REMATCH_TATE_AND_LIZA,
REMATCH_JUAN,
REMATCH_SIDNEY, // Entries from SIDNEY below are considered part of REMATCH_ELITE_FOUR_ENTRIES.
REMATCH_PHOEBE,
REMATCH_GLACIA,
REMATCH_DRAKE,
REMATCH_WALLACE,
REMATCH_TABLE_ENTRIES // The total number of rematch entries. Must be last in enum
};
#define REMATCH_SPECIAL_TRAINER_START REMATCH_WALLY_VR
#define REMATCH_ELITE_FOUR_ENTRIES REMATCH_SIDNEY
void UpdateGymLeaderRematch(void); void UpdateGymLeaderRematch(void);
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef GUARD_MAIL_H #ifndef GUARD_MAIL_H
#define GUARD_MAIL_H #define GUARD_MAIL_H
#define IS_ITEM_MAIL(itemId)((itemId == ITEM_ORANGE_MAIL \ #define IS_ITEM_MAIL(itemId) ((itemId == ITEM_ORANGE_MAIL \
|| itemId == ITEM_HARBOR_MAIL \ || itemId == ITEM_HARBOR_MAIL \
|| itemId == ITEM_GLITTER_MAIL \ || itemId == ITEM_GLITTER_MAIL \
|| itemId == ITEM_MECH_MAIL \ || itemId == ITEM_MECH_MAIL \
+1 -1
View File
@@ -44,7 +44,7 @@ enum {
// The number of extra sparkles shown on a Pokémon's condition screen. // The number of extra sparkles shown on a Pokémon's condition screen.
// All Pokémon start with 1, so the max here is MAX_CONDITION_SPARKLES - 1 // All Pokémon start with 1, so the max here is MAX_CONDITION_SPARKLES - 1
#define GET_NUM_CONDITION_SPARKLES(sheen)((sheen) != MAX_SHEEN) ? (sheen) / ((u32)MAX_SHEEN / (MAX_CONDITION_SPARKLES - 1) + 1) : MAX_CONDITION_SPARKLES - 1; #define GET_NUM_CONDITION_SPARKLES(sheen) ((sheen) != MAX_SHEEN) ? (sheen) / ((u32)MAX_SHEEN / (MAX_CONDITION_SPARKLES - 1) + 1) : MAX_CONDITION_SPARKLES - 1;
#define CONDITION_GRAPH_TOP_Y 56 #define CONDITION_GRAPH_TOP_Y 56
#define CONDITION_GRAPH_BOTTOM_Y 121 #define CONDITION_GRAPH_BOTTOM_Y 121
+1 -2
View File
@@ -276,8 +276,7 @@ struct BattlePokemon
/*0x17*/ u32 abilityNum:1; /*0x17*/ u32 abilityNum:1;
/*0x18*/ s8 statStages[NUM_BATTLE_STATS]; /*0x18*/ s8 statStages[NUM_BATTLE_STATS];
/*0x20*/ u8 ability; /*0x20*/ u8 ability;
/*0x21*/ u8 type1; /*0x21*/ u8 types[2];
/*0x22*/ u8 type2;
/*0x23*/ u8 unknown; /*0x23*/ u8 unknown;
/*0x24*/ u8 pp[MAX_MON_MOVES]; /*0x24*/ u8 pp[MAX_MON_MOVES];
/*0x28*/ u16 hp; /*0x28*/ u16 hp;
+1 -1
View File
@@ -14,7 +14,7 @@ void ShowPokemonSummaryScreenHandleDeoxys(u8 mode, struct BoxPokemon *mons, u8 m
u8 GetMoveSlotToReplace(void); u8 GetMoveSlotToReplace(void);
void SummaryScreen_SetAnimDelayTaskId(u8 taskId); void SummaryScreen_SetAnimDelayTaskId(u8 taskId);
// The Pokemon Summary Screen can operate in different modes. Certain features, // The Pokémon Summary Screen can operate in different modes. Certain features,
// such as move re-ordering, are available in the different modes. // such as move re-ordering, are available in the different modes.
enum PokemonSummaryScreenMode enum PokemonSummaryScreenMode
{ {
+4 -4
View File
@@ -65,8 +65,8 @@ struct PokenavMonList
enum enum
{ {
POKENAV_MODE_NORMAL, // Chosen from Start menu. POKENAV_MODE_NORMAL, // Chosen from Start menu.
POKENAV_MODE_FORCE_CALL_READY, // Pokenav tutorial before calling Mr. Stone POKENAV_MODE_FORCE_CALL_READY, // PokéNav tutorial before calling Mr. Stone
POKENAV_MODE_FORCE_CALL_EXIT, // Pokenav tutorial after calling Mr. Stone POKENAV_MODE_FORCE_CALL_EXIT, // PokéNav tutorial after calling Mr. Stone
}; };
enum enum
@@ -232,8 +232,8 @@ enum
[CHECK_PAGE_INTRO_2] = gText_MatchCall##name##_Intro2} [CHECK_PAGE_INTRO_2] = gText_MatchCall##name##_Intro2}
// Pokenav Function IDs // PokéNav Function IDs
// Indices into the LoopedTask tables for each of the main Pokenav features // Indices into the LoopedTask tables for each of the main PokéNav features
enum RegionMapFuncIds enum RegionMapFuncIds
{ {
+2 -2
View File
@@ -13,8 +13,8 @@ u16 Random2(void);
// The number 1103515245 comes from the example implementation of rand and srand // The number 1103515245 comes from the example implementation of rand and srand
// in the ISO C standard. // in the ISO C standard.
#define ISO_RANDOMIZE1(val)(1103515245 * (val) + 24691) #define ISO_RANDOMIZE1(val) (1103515245 * (val) + 24691)
#define ISO_RANDOMIZE2(val)(1103515245 * (val) + 12345) #define ISO_RANDOMIZE2(val) (1103515245 * (val) + 12345)
//Sets the initial seed value of the pseudorandom number generator //Sets the initial seed value of the pseudorandom number generator
void SeedRng(u16 seed); void SeedRng(u16 seed);
+6 -6
View File
@@ -519,7 +519,7 @@ extern const u8 gText_Speed[];
extern const u8 gText_Dash[]; extern const u8 gText_Dash[];
extern const u8 gText_Plus[]; extern const u8 gText_Plus[];
//pokedex text //Pokédex text
extern const u8 gText_CryOf[]; extern const u8 gText_CryOf[];
extern const u8 gText_SizeComparedTo[]; extern const u8 gText_SizeComparedTo[];
extern const u8 gText_PokedexRegistration[]; extern const u8 gText_PokedexRegistration[];
@@ -1121,7 +1121,7 @@ extern const u8 gTrickHouse_Mechadoll_Six2[];
extern const u8 gTrickHouse_Mechadoll_Seven2[]; extern const u8 gTrickHouse_Mechadoll_Seven2[];
extern const u8 gTrickHouse_Mechadoll_Eight2[]; extern const u8 gTrickHouse_Mechadoll_Eight2[];
// Pokedex strings // Pokédex strings
extern const u8 gText_SearchForPkmnBasedOnParameters[]; extern const u8 gText_SearchForPkmnBasedOnParameters[];
extern const u8 gText_SwitchPokedexListings[]; extern const u8 gText_SwitchPokedexListings[];
extern const u8 gText_ReturnToPokedex[]; extern const u8 gText_ReturnToPokedex[];
@@ -2874,7 +2874,7 @@ extern const u8 gText_WantToPlayAgain[];
extern const u8 gText_CommunicationStandby3[]; extern const u8 gText_CommunicationStandby3[];
extern const u8 gText_SomeoneDroppedOut[]; extern const u8 gText_SomeoneDroppedOut[];
// Pokemon jump // Pokémon jump
extern const u8 gText_WantToPlayAgain2[]; extern const u8 gText_WantToPlayAgain2[];
extern const u8 gText_SomeoneDroppedOut2[]; extern const u8 gText_SomeoneDroppedOut2[];
extern const u8 gText_CommunicationStandby4[]; extern const u8 gText_CommunicationStandby4[];
@@ -2949,7 +2949,7 @@ extern const u8 gText_CutenessContest[];
extern const u8 gText_SmartnessContest[]; extern const u8 gText_SmartnessContest[];
extern const u8 gText_ToughnessContest[]; extern const u8 gText_ToughnessContest[];
// Pokenav Match Call // PokéNav Match Call
extern const u8 gText_CallCantBeMadeHere[]; extern const u8 gText_CallCantBeMadeHere[];
extern const u8 gText_NumberRegistered[]; extern const u8 gText_NumberRegistered[];
extern const u8 gText_NumberOfBattles[]; extern const u8 gText_NumberOfBattles[];
@@ -2959,7 +2959,7 @@ extern const u8 gText_Call[];
extern const u8 gText_Check[]; extern const u8 gText_Check[];
extern const u8 gText_Cancel6[]; extern const u8 gText_Cancel6[];
// Pokenav Menu Handler // PokéNav Menu Handler
extern const u8 gText_CheckMapOfHoenn[]; extern const u8 gText_CheckMapOfHoenn[];
extern const u8 gText_CheckPokemonInDetail[]; extern const u8 gText_CheckPokemonInDetail[];
extern const u8 gText_CallRegisteredTrainer[]; extern const u8 gText_CallRegisteredTrainer[];
@@ -2976,7 +2976,7 @@ extern const u8 gText_FindToughPokemon[];
extern const u8 gText_ReturnToConditionMenu[]; extern const u8 gText_ReturnToConditionMenu[];
extern const u8 gText_NoRibbonWinners[]; extern const u8 gText_NoRibbonWinners[];
// Pokenav // PokéNav
extern const u8 gText_NumberIndex[]; extern const u8 gText_NumberIndex[];
extern const u8 gText_RibbonsF700[]; extern const u8 gText_RibbonsF700[];
+22 -24
View File
@@ -3,6 +3,13 @@ ENTRY(Start)
gNumMusicPlayers = 4; gNumMusicPlayers = 4;
gMaxLines = 0; gMaxLines = 0;
MEMORY
{
EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
}
/* Modify the following load addresses as needed to make more room. Alternately, delete both the /* Modify the following load addresses as needed to make more room. Alternately, delete both the
declarations below and their references further down to get rid of the gaps. */ declarations below and their references further down to get rid of the gaps. */
@@ -10,15 +17,10 @@ __anim_mon_load_address = 0x8b00000;
__gfx_load_address = 0x8c00000; __gfx_load_address = 0x8c00000;
SECTIONS { SECTIONS {
. = 0x2000000;
ewram (NOLOAD) : ewram 0x2000000 (NOLOAD) :
ALIGN(4) ALIGN(4)
{ {
gHeap = .;
. = 0x1C000;
INCLUDE "sym_ewram.ld" INCLUDE "sym_ewram.ld"
src/*.o(ewram_data); src/*.o(ewram_data);
gflib/*.o(ewram_data); gflib/*.o(ewram_data);
@@ -26,12 +28,9 @@ SECTIONS {
*libc.a:impure.o(.data); *libc.a:impure.o(.data);
*libc.a:locale.o(.data); *libc.a:locale.o(.data);
*libc.a:mallocr.o(.data); *libc.a:mallocr.o(.data);
. = 0x40000; } > EWRAM
}
. = 0x3000000; iwram 0x3000000 (NOLOAD) :
iwram (NOLOAD) :
ALIGN(4) ALIGN(4)
{ {
/* .bss starts at 0x3000000 */ /* .bss starts at 0x3000000 */
@@ -46,10 +45,9 @@ SECTIONS {
/* COMMON starts at 0x30022A8 */ /* COMMON starts at 0x30022A8 */
INCLUDE "sym_common.ld" INCLUDE "sym_common.ld"
*libc.a:sbrkr.o(COMMON); *libc.a:sbrkr.o(COMMON);
end = .; } > IWRAM
. = 0x8000;
}
/* BEGIN ROM DATA */
. = 0x8000000; . = 0x8000000;
.text : .text :
@@ -343,7 +341,7 @@ SECTIONS {
src/gym_leader_rematch.o(.text); src/gym_leader_rematch.o(.text);
src/battle_transition_frontier.o(.text); src/battle_transition_frontier.o(.text);
src/international_string_util.o(.text); src/international_string_util.o(.text);
} =0 } > ROM =0
script_data : script_data :
ALIGN(4) ALIGN(4)
@@ -356,7 +354,7 @@ SECTIONS {
data/battle_ai_scripts.o(script_data); data/battle_ai_scripts.o(script_data);
data/contest_ai_scripts.o(script_data); data/contest_ai_scripts.o(script_data);
data/mystery_event_script_cmd_table.o(script_data); data/mystery_event_script_cmd_table.o(script_data);
} =0 } > ROM =0
lib_text : lib_text :
ALIGN(4) ALIGN(4)
@@ -440,7 +438,7 @@ SECTIONS {
*libc.a:libcfunc.o(.text); *libc.a:libcfunc.o(.text);
*libc.a:lseekr.o(.text); *libc.a:lseekr.o(.text);
*libc.a:readr.o(.text); *libc.a:readr.o(.text);
} =0 } > ROM =0
.rodata : .rodata :
ALIGN(4) ALIGN(4)
@@ -705,7 +703,7 @@ SECTIONS {
data/mystery_gift.o(.rodata); data/mystery_gift.o(.rodata);
src/m4a_tables.o(.rodata); src/m4a_tables.o(.rodata);
data/sound_data.o(.rodata); data/sound_data.o(.rodata);
} =0 } > ROM =0
song_data : song_data :
ALIGN(4) ALIGN(4)
@@ -1240,7 +1238,7 @@ SECTIONS {
sound/songs/midi/ph_nurse_blend.o(.rodata); sound/songs/midi/ph_nurse_blend.o(.rodata);
sound/songs/midi/ph_nurse_held.o(.rodata); sound/songs/midi/ph_nurse_held.o(.rodata);
sound/songs/midi/ph_nurse_solo.o(.rodata); sound/songs/midi/ph_nurse_solo.o(.rodata);
} =0 } > ROM =0
lib_rodata : lib_rodata :
SUBALIGN(4) SUBALIGN(4)
@@ -1293,7 +1291,7 @@ SECTIONS {
*libc.a:lseekr.o(.rodata); *libc.a:lseekr.o(.rodata);
*libc.a:readr.o(.rodata); *libc.a:readr.o(.rodata);
src/libisagbprn.o(.rodata); src/libisagbprn.o(.rodata);
} =0 } > ROM =0
multiboot_data : multiboot_data :
ALIGN(4) ALIGN(4)
@@ -1301,19 +1299,19 @@ SECTIONS {
data/multiboot_ereader.o(.rodata); data/multiboot_ereader.o(.rodata);
data/multiboot_berry_glitch_fix.o(.rodata); data/multiboot_berry_glitch_fix.o(.rodata);
data/multiboot_pokemon_colosseum.o(.rodata); data/multiboot_pokemon_colosseum.o(.rodata);
} =0 } > ROM =0
anim_mon_front_pic_data __anim_mon_load_address : anim_mon_front_pic_data __anim_mon_load_address :
ALIGN(4) ALIGN(4)
{ {
src/anim_mon_front_pics.o(.rodata); src/anim_mon_front_pics.o(.rodata);
} =0 } > ROM =0
gfx_data __gfx_load_address : gfx_data __gfx_load_address :
ALIGN(4) ALIGN(4)
{ {
src/graphics.o(.rodata); src/graphics.o(.rodata);
} =0 } > ROM =0
extra : extra :
ALIGN(4) ALIGN(4)
@@ -1323,7 +1321,7 @@ SECTIONS {
src/*.o(.rodata); src/*.o(.rodata);
gflib/*.o(.rodata); gflib/*.o(.rodata);
data/*.o(.rodata); data/*.o(.rodata);
} = 0 } > ROM = 0
/* DWARF debug sections. /* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning Symbols in the DWARF debugging sections are relative to the beginning
+24 -30
View File
@@ -3,46 +3,40 @@ ENTRY(Start)
gNumMusicPlayers = 4; gNumMusicPlayers = 4;
gMaxLines = 0; gMaxLines = 0;
SECTIONS { MEMORY
. = 0x2000000; {
EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
ewram (NOLOAD) : IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
ALIGN(4) ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
{
gHeap = .;
. = 0x1C000;
src/*.o(ewram_data);
gflib/*.o(ewram_data);
. = 0x40000;
} }
. = 0x3000000; SECTIONS {
iwram (NOLOAD) : ewram 0x2000000 (NOLOAD) :
ALIGN(4)
{
src/*.o(ewram_data);
gflib/*.o(ewram_data);
} > EWRAM
iwram 0x3000000 (NOLOAD) :
ALIGN(4) ALIGN(4)
{ {
/* .bss starts at 0x3000000 */
src/*.o(.bss); src/*.o(.bss);
gflib/*.o(.bss); gflib/*.o(.bss);
data/*.o(.bss); data/*.o(.bss);
*libc.a:*.o(.bss*); *libc.a:*.o(.bss*);
*libnosys.a:*.o(.bss*); *libnosys.a:*.o(.bss*);
/* .bss.code starts at 0x3001AA8 */
src/m4a.o(.bss.code); src/m4a.o(.bss.code);
/* COMMON starts at 0x30022A8 */
src/*.o(COMMON); src/*.o(COMMON);
gflib/*.o(COMMON); gflib/*.o(COMMON);
*libc.a:*.o(COMMON); *libc.a:*.o(COMMON);
*libnosys.a:*.o(COMMON); *libnosys.a:*.o(COMMON);
end = .; } > IWRAM
. = 0x8000;
}
/* BEGIN ROM DATA */
. = 0x8000000; . = 0x8000000;
.text : .text :
@@ -55,13 +49,13 @@ SECTIONS {
gflib/*.o(.text*); gflib/*.o(.text*);
src/*.o(.text*); src/*.o(.text*);
asm/*.o(.text*); asm/*.o(.text*);
} =0 } > ROM =0
script_data : script_data :
ALIGN(4) ALIGN(4)
{ {
data/*.o(script_data); data/*.o(script_data);
} =0 } > ROM =0
lib_text : lib_text :
ALIGN(4) ALIGN(4)
@@ -82,7 +76,7 @@ SECTIONS {
*libc.a:*.o(.text*); *libc.a:*.o(.text*);
*libnosys.a:*.o(.text*); *libnosys.a:*.o(.text*);
src/libisagbprn.o(.text); src/libisagbprn.o(.text);
} =0 } > ROM =0
.rodata : .rodata :
ALIGN(4) ALIGN(4)
@@ -90,13 +84,13 @@ SECTIONS {
src/*.o(.rodata*); src/*.o(.rodata*);
gflib/*.o(.rodata*); gflib/*.o(.rodata*);
data/*.o(.rodata*); data/*.o(.rodata*);
} =0 } > ROM =0
song_data : song_data :
ALIGN(4) ALIGN(4)
{ {
sound/songs/*.o(.rodata); sound/songs/*.o(.rodata);
} =0 } > ROM =0
lib_rodata : lib_rodata :
SUBALIGN(4) SUBALIGN(4)
@@ -121,19 +115,19 @@ SECTIONS {
data/multiboot_ereader.o(.rodata); data/multiboot_ereader.o(.rodata);
data/multiboot_berry_glitch_fix.o(.rodata); data/multiboot_berry_glitch_fix.o(.rodata);
data/multiboot_pokemon_colosseum.o(.rodata); data/multiboot_pokemon_colosseum.o(.rodata);
} =0 } > ROM =0
anim_mon_front_pic_data : anim_mon_front_pic_data :
ALIGN(4) ALIGN(4)
{ {
src/anim_mon_front_pics.o(.rodata); src/anim_mon_front_pics.o(.rodata);
} =0 } > ROM =0
gfx_data : gfx_data :
ALIGN(4) ALIGN(4)
{ {
src/graphics.o(.rodata); src/graphics.o(.rodata);
} =0 } > ROM =0
/* DWARF debug sections. /* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning Symbols in the DWARF debugging sections are relative to the beginning
+1 -5
View File
@@ -10,17 +10,13 @@ TOOL_NAMES := aif2pcm bin2c gbafix gbagfx jsonproc mapjson mid2agb preproc ramsc
TOOLDIRS := $(TOOL_NAMES:%=$(TOOLS_DIR)/%) TOOLDIRS := $(TOOL_NAMES:%=$(TOOLS_DIR)/%)
# Tool making doesnt require a pokeemerald dependency scan. # Tool making doesnt require a pokeemerald dependency scan.
RULES_NO_SCAN += tools check-tools clean-tools $(TOOLDIRS) $(CHECKTOOLDIRS) RULES_NO_SCAN += tools check-tools clean-tools $(TOOLDIRS)
.PHONY: $(RULES_NO_SCAN) .PHONY: $(RULES_NO_SCAN)
tools: $(TOOLDIRS) tools: $(TOOLDIRS)
check-tools: $(CHECKTOOLDIRS)
$(TOOLDIRS): $(TOOLDIRS):
@$(MAKE) -C $@ @$(MAKE) -C $@
$(CHECKTOOLDIRS):
@$(MAKE) -C $@
clean-tools: clean-tools:
@$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);)
+3 -4
View File
@@ -18,10 +18,9 @@ MAP_EVENTS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/events.inc,$(MAP_DIRS))
MAP_HEADERS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/header.inc,$(MAP_DIRS)) MAP_HEADERS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/header.inc,$(MAP_DIRS))
$(DATA_ASM_BUILDDIR)/maps.o: $(DATA_ASM_SUBDIR)/maps.s $(LAYOUTS_DIR)/layouts.inc $(LAYOUTS_DIR)/layouts_table.inc $(MAPS_DIR)/headers.inc $(MAPS_DIR)/groups.inc $(MAPS_DIR)/connections.inc $(MAP_CONNECTIONS) $(MAP_HEADERS) $(DATA_ASM_BUILDDIR)/maps.o: $(DATA_ASM_SUBDIR)/maps.s $(LAYOUTS_DIR)/layouts.inc $(LAYOUTS_DIR)/layouts_table.inc $(MAPS_DIR)/headers.inc $(MAPS_DIR)/groups.inc $(MAPS_DIR)/connections.inc $(MAP_CONNECTIONS) $(MAP_HEADERS)
$(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@
$(DATA_ASM_BUILDDIR)/map_events.o: $(DATA_ASM_SUBDIR)/map_events.s $(MAPS_DIR)/events.inc $(MAP_EVENTS) $(DATA_ASM_BUILDDIR)/map_events.o: $(DATA_ASM_SUBDIR)/map_events.s $(MAPS_DIR)/events.inc $(MAP_EVENTS)
$(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@
$(MAPS_OUTDIR)/%/header.inc $(MAPS_OUTDIR)/%/events.inc $(MAPS_OUTDIR)/%/connections.inc: $(MAPS_DIR)/%/map.json $(MAPS_OUTDIR)/%/header.inc $(MAPS_OUTDIR)/%/events.inc $(MAPS_OUTDIR)/%/connections.inc: $(MAPS_DIR)/%/map.json
$(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json $(@D) $(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json $(@D)
@@ -30,4 +29,4 @@ $(MAPS_OUTDIR)/connections.inc $(MAPS_OUTDIR)/groups.inc $(MAPS_OUTDIR)/events.i
$(MAPJSON) groups emerald $< $(MAPS_OUTDIR) $(INCLUDECONSTS_OUTDIR) $(MAPJSON) groups emerald $< $(MAPS_OUTDIR) $(INCLUDECONSTS_OUTDIR)
$(LAYOUTS_OUTDIR)/layouts.inc $(LAYOUTS_OUTDIR)/layouts_table.inc $(INCLUDECONSTS_OUTDIR)/layouts.h: $(LAYOUTS_DIR)/layouts.json $(LAYOUTS_OUTDIR)/layouts.inc $(LAYOUTS_OUTDIR)/layouts_table.inc $(INCLUDECONSTS_OUTDIR)/layouts.h: $(LAYOUTS_DIR)/layouts.json
$(MAPJSON) layouts emerald $< $(LAYOUTS_OUTDIR) $(INCLUDECONSTS_OUTDIR) $(MAPJSON) layouts emerald $< $(LAYOUTS_OUTDIR) $(INCLUDECONSTS_OUTDIR)
+9 -9
View File
@@ -1119,16 +1119,16 @@ static void Cmd_get_type(void)
switch (typeVar) switch (typeVar)
{ {
case AI_TYPE1_USER: // AI user primary type case AI_TYPE1_USER: // AI user primary type
AI_THINKING_STRUCT->funcResult = gBattleMons[sBattler_AI].type1; AI_THINKING_STRUCT->funcResult = gBattleMons[sBattler_AI].types[0];
break; break;
case AI_TYPE1_TARGET: // target primary type case AI_TYPE1_TARGET: // target primary type
AI_THINKING_STRUCT->funcResult = gBattleMons[gBattlerTarget].type1; AI_THINKING_STRUCT->funcResult = gBattleMons[gBattlerTarget].types[0];
break; break;
case AI_TYPE2_USER: // AI user secondary type case AI_TYPE2_USER: // AI user secondary type
AI_THINKING_STRUCT->funcResult = gBattleMons[sBattler_AI].type2; AI_THINKING_STRUCT->funcResult = gBattleMons[sBattler_AI].types[1];
break; break;
case AI_TYPE2_TARGET: // target secondary type case AI_TYPE2_TARGET: // target secondary type
AI_THINKING_STRUCT->funcResult = gBattleMons[gBattlerTarget].type2; AI_THINKING_STRUCT->funcResult = gBattleMons[gBattlerTarget].types[1];
break; break;
case AI_TYPE_MOVE: // type of move being pointed to case AI_TYPE_MOVE: // type of move being pointed to
AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].type; AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].type;
@@ -1392,7 +1392,7 @@ static void Cmd_get_ability(void)
} }
else else
{ {
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1. AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no Pokémon has ability 2 and no ability 1.
} }
} }
else else
@@ -1445,7 +1445,7 @@ static void Cmd_check_ability(void)
} }
else else
{ {
ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1. ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no Pokémon has ability 2 and no ability 1.
} }
} }
else else
@@ -1457,9 +1457,9 @@ static void Cmd_check_ability(void)
if (ability == 0) if (ability == 0)
AI_THINKING_STRUCT->funcResult = 2; // Unable to answer. AI_THINKING_STRUCT->funcResult = 2; // Unable to answer.
else if (ability == gAIScriptPtr[2]) else if (ability == gAIScriptPtr[2])
AI_THINKING_STRUCT->funcResult = 1; // Pokemon has the ability we wanted to check. AI_THINKING_STRUCT->funcResult = 1; // Pokémon has the ability we wanted to check.
else else
AI_THINKING_STRUCT->funcResult = 0; // Pokemon doesn't have the ability we wanted to check. AI_THINKING_STRUCT->funcResult = 0; // Pokémon doesn't have the ability we wanted to check.
gAIScriptPtr += 3; gAIScriptPtr += 3;
} }
@@ -1527,7 +1527,7 @@ static void Cmd_if_type_effectiveness(void)
// TypeCalc does not assign to gMoveResultFlags, Cmd_typecalc does // TypeCalc does not assign to gMoveResultFlags, Cmd_typecalc does
// This makes the check for gMoveResultFlags below always fail // This makes the check for gMoveResultFlags below always fail
// This is how you get the "dual non-immunity" glitch, where AI // This is how you get the "dual non-immunity" glitch, where AI
// will use ineffective moves on immune pokémon if the second type // will use ineffective moves on immune pokémon if the second type
// has a non-neutral, non-immune effectiveness // has a non-neutral, non-immune effectiveness
#ifdef BUGFIX #ifdef BUGFIX
+5 -5
View File
@@ -51,7 +51,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
if (gBattleMons[GetBattlerAtPosition(opposingPosition)].ability != ABILITY_WONDER_GUARD) if (gBattleMons[GetBattlerAtPosition(opposingPosition)].ability != ABILITY_WONDER_GUARD)
return FALSE; return FALSE;
// Check if Pokemon has a super effective move. // Check if Pokémon has a super effective move.
for (opposingBattler = GetBattlerAtPosition(opposingPosition), i = 0; i < MAX_MON_MOVES; i++) for (opposingBattler = GetBattlerAtPosition(opposingPosition), i = 0; i < MAX_MON_MOVES; i++)
{ {
move = gBattleMons[gActiveBattler].moves[i]; move = gBattleMons[gActiveBattler].moves[i];
@@ -81,7 +81,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
else else
party = gEnemyParty; party = gEnemyParty;
// Find a Pokemon in the party that has a super effective move. // Find a Pokémon in the party that has a super effective move.
for (i = firstId; i < lastId; i++) for (i = firstId; i < lastId; i++)
{ {
if (GetMonData(&party[i], MON_DATA_HP) == 0) if (GetMonData(&party[i], MON_DATA_HP) == 0)
@@ -113,7 +113,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
} }
} }
return FALSE; // There is not a single Pokemon in the party that has a super effective move against a mon with Wonder Guard. return FALSE; // There is not a single Pokémon in the party that has a super effective move against a mon with Wonder Guard.
} }
static bool8 FindMonThatAbsorbsOpponentsMove(void) static bool8 FindMonThatAbsorbsOpponentsMove(void)
@@ -706,8 +706,8 @@ u8 GetMostSuitableMonToSwitchInto(void)
u8 type1 = gSpeciesInfo[species].types[0]; u8 type1 = gSpeciesInfo[species].types[0];
u8 type2 = gSpeciesInfo[species].types[1]; u8 type2 = gSpeciesInfo[species].types[1];
u8 typeDmg = TYPE_MUL_NORMAL; u8 typeDmg = TYPE_MUL_NORMAL;
ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type1, type1, type2, &typeDmg); ModulateByTypeEffectiveness(gBattleMons[opposingBattler].types[0], type1, type2, &typeDmg);
ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type2, type1, type2, &typeDmg); ModulateByTypeEffectiveness(gBattleMons[opposingBattler].types[1], type1, type2, &typeDmg);
/* Possible bug: this comparison gives the type that takes the most damage, when /* Possible bug: this comparison gives the type that takes the most damage, when
a "good" AI would want to select the type that takes the least damage. Unknown if this a "good" AI would want to select the type that takes the least damage. Unknown if this
Executable → Regular
+2 -11
View File
@@ -3673,7 +3673,6 @@ static void AnimTask_UproarDistortion_Step(u8 taskId)
static void AnimJaggedMusicNote(struct Sprite *sprite) static void AnimJaggedMusicNote(struct Sprite *sprite)
{ {
int var1;
u8 battler = !gBattleAnimArgs[0] ? gBattleAnimAttacker : gBattleAnimTarget; u8 battler = !gBattleAnimArgs[0] ? gBattleAnimAttacker : gBattleAnimTarget;
if (GetBattlerSide(battler) == B_SIDE_OPPONENT) if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
@@ -3684,16 +3683,8 @@ static void AnimJaggedMusicNote(struct Sprite *sprite)
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->data[1] = (u16)sprite->x << 3; sprite->data[1] = (u16)sprite->x << 3;
sprite->data[2] = (u16)sprite->y << 3; sprite->data[2] = (u16)sprite->y << 3;
sprite->data[3] = (gBattleAnimArgs[1] << 3) / 8;
var1 = gBattleAnimArgs[1] << 3; sprite->data[4] = (gBattleAnimArgs[2] << 3) / 8;
if (var1 < 0)
var1 += 7;
sprite->data[3] = var1 >> 3;
var1 = gBattleAnimArgs[2] << 3;
if (var1 < 0)
var1 += 7;
sprite->data[4] = var1 >> 3;
sprite->oam.tileNum += gBattleAnimArgs[3] * 16; sprite->oam.tileNum += gBattleAnimArgs[3] * 16;
sprite->callback = AnimJaggedMusicNote_Step; sprite->callback = AnimJaggedMusicNote_Step;
+1 -1
View File
@@ -493,7 +493,7 @@ static void AnimFistOrFootRandomPos(struct Sprite *sprite)
y *= -1; y *= -1;
if (GET_BATTLER_SIDE2(battler) == B_SIDE_PLAYER) if (GET_BATTLER_SIDE2(battler) == B_SIDE_PLAYER)
y += 0xFFF0; y -= 16;
sprite->x += x; sprite->x += x;
sprite->y += y; sprite->y += y;
+4 -2
View File
@@ -628,11 +628,13 @@ static void AnimTask_SpiteTargetShadow_Step1(u8 taskId)
task->data[3] = 16; task->data[3] = 16;
task->data[13] = GetAnimBattlerSpriteId(ANIM_TARGET); task->data[13] = GetAnimBattlerSpriteId(ANIM_TARGET);
task->data[4] = OBJ_PLTT_ID2(gSprites[task->data[13]].oam.paletteNum); task->data[4] = OBJ_PLTT_ID2(gSprites[task->data[13]].oam.paletteNum);
if (position == 1) { if (position == 1)
{
u16 mask = DISPCNT_BG1_ON; u16 mask = DISPCNT_BG1_ON;
mask2 = mask; mask2 = mask;
} }
else { else
{
u16 mask = DISPCNT_BG2_ON; u16 mask = DISPCNT_BG2_ON;
mask2 = mask; mask2 = mask;
} }
+1 -1
View File
@@ -535,7 +535,7 @@ static void SlideMonToOriginalPos_Step(struct Sprite *sprite)
} }
// Linearly translates a mon to a target offset. The horizontal offset // Linearly translates a mon to a target offset. The horizontal offset
// is mirrored for the opponent's pokemon, and the vertical offset // is mirrored for the opponent's Pokémon, and the vertical offset
// is only mirrored if arg 3 is set to 1. // is only mirrored if arg 3 is set to 1.
// arg 0: 0 = attacker, 1 = target // arg 0: 0 = attacker, 1 = target
// arg 1: target x pixel offset // arg 1: target x pixel offset
+2 -2
View File
@@ -77,7 +77,7 @@ static const u8 sCastformBackSpriteYCoords[NUM_CASTFORM_FORMS] =
[CASTFORM_ICE] = 0, [CASTFORM_ICE] = 0,
}; };
// Placeholders for pokemon sprites to be created for a move animation effect (e.g. Role Play / Snatch) // Placeholders for Pokémon sprites to be created for a move animation effect (e.g. Role Play / Snatch)
#define TAG_MOVE_EFFECT_MON_1 55125 #define TAG_MOVE_EFFECT_MON_1 55125
#define TAG_MOVE_EFFECT_MON_2 55126 #define TAG_MOVE_EFFECT_MON_2 55126
@@ -2085,7 +2085,7 @@ u8 GetBattlerSpriteBGPriorityRank(u8 battlerId)
return 1; return 1;
} }
// Create pokemon sprite to be used for a move animation effect (e.g. Role Play / Snatch) // Create Pokémon sprite to be used for a move animation effect (e.g. Role Play / Snatch)
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm) u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm)
{ {
u8 spriteId; u8 spriteId;
+2 -10
View File
@@ -59,15 +59,7 @@ static const union AnimCmd sAnim_SludgeBombHit[] =
static const union AnimCmd *const sAnims_PoisonProjectile[] = static const union AnimCmd *const sAnims_PoisonProjectile[] =
{ {
sAnim_PoisonProjectile, sAnim_PoisonProjectile,
};
static const union AnimCmd *const sAnims_AcidPoisonDroplet[] =
{
sAnim_AcidPoisonDroplet, sAnim_AcidPoisonDroplet,
};
static const union AnimCmd *const sAnims_SludgeBombHit[] =
{
sAnim_SludgeBombHit, sAnim_SludgeBombHit,
}; };
@@ -122,7 +114,7 @@ const struct SpriteTemplate gSludgeBombHitParticleSpriteTemplate =
.tileTag = ANIM_TAG_POISON_BUBBLE, .tileTag = ANIM_TAG_POISON_BUBBLE,
.paletteTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE,
.oam = &gOamData_AffineNormal_ObjNormal_16x16, .oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = sAnims_SludgeBombHit, .anims = &sAnims_PoisonProjectile[2],
.images = NULL, .images = NULL,
.affineAnims = sAffineAnims_SludgeBombHit, .affineAnims = sAffineAnims_SludgeBombHit,
.callback = AnimSludgeBombHitParticle, .callback = AnimSludgeBombHitParticle,
@@ -145,7 +137,7 @@ const struct SpriteTemplate gAcidPoisonDropletSpriteTemplate =
.tileTag = ANIM_TAG_POISON_BUBBLE, .tileTag = ANIM_TAG_POISON_BUBBLE,
.paletteTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE,
.oam = &gOamData_AffineDouble_ObjNormal_16x16, .oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = sAnims_AcidPoisonDroplet, .anims = &sAnims_PoisonProjectile[1],
.images = NULL, .images = NULL,
.affineAnims = gAffineAnims_Droplet, .affineAnims = gAffineAnims_Droplet,
.callback = AnimAcidPoisonDroplet, .callback = AnimAcidPoisonDroplet,
+1 -8
View File
@@ -558,7 +558,6 @@ void AnimTask_Rollout(u8 taskId)
{ {
u16 var0, var1, var2, var3; u16 var0, var1, var2, var3;
u8 rolloutCounter; u8 rolloutCounter;
int var5;
s16 pan1, pan2; s16 pan1, pan2;
struct Task *task; struct Task *task;
@@ -582,13 +581,7 @@ void AnimTask_Rollout(u8 taskId)
task->data[11] = 0; task->data[11] = 0;
task->data[9] = 0; task->data[9] = 0;
task->data[12] = 1; task->data[12] = 1;
task->data[10] = (task->data[8] / 8) - 1;
var5 = task->data[8];
if (var5 < 0)
var5 += 7;
task->data[10] = (var5 >> 3) - 1;
task->data[2] = var0 * 8; task->data[2] = var0 * 8;
task->data[3] = var1 * 8; task->data[3] = var1 * 8;
task->data[4] = ((var2 - var0) * 8) / task->data[8]; task->data[4] = ((var2 - var0) * 8) / task->data[8];
+1 -1
View File
@@ -529,7 +529,7 @@ static void LinkOpponentBufferExecCompleted(void)
static void LinkOpponentHandleGetMonData(void) static void LinkOpponentHandleGetMonData(void)
{ {
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;
+1 -1
View File
@@ -423,7 +423,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void LinkPartnerHandleGetMonData(void) static void LinkPartnerHandleGetMonData(void)
{ {
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;
+2 -2
View File
@@ -534,7 +534,7 @@ static void OpponentBufferExecCompleted(void)
static void OpponentHandleGetMonData(void) static void OpponentHandleGetMonData(void)
{ {
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;
@@ -2007,7 +2007,7 @@ static void OpponentHandleEndLinkBattle(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_LINK && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) if (gBattleTypeFlags & BATTLE_TYPE_LINK && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER))
{ {
gMain.inBattle = 0; gMain.inBattle = FALSE;
gMain.callback1 = gPreBattleCallback1; gMain.callback1 = gPreBattleCallback1;
SetMainCallback2(gMain.savedCallback); SetMainCallback2(gMain.savedCallback);
} }
+4 -4
View File
@@ -485,7 +485,7 @@ static void HandleInputChooseMove(void)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
if (moveInfo->moves[gMoveSelectionCursor[gActiveBattler]] == MOVE_CURSE) if (moveInfo->moves[gMoveSelectionCursor[gActiveBattler]] == MOVE_CURSE)
{ {
if (moveInfo->monType1 != TYPE_GHOST && moveInfo->monType2 != TYPE_GHOST) if (moveInfo->monTypes[0] != TYPE_GHOST && moveInfo->monTypes[1] != TYPE_GHOST)
moveTarget = MOVE_TARGET_USER; moveTarget = MOVE_TARGET_USER;
else else
moveTarget = MOVE_TARGET_SELECTED; moveTarget = MOVE_TARGET_SELECTED;
@@ -981,12 +981,12 @@ static void Intro_TryShinyAnimShowHealthbox(void)
bool32 bgmRestored = FALSE; bool32 bgmRestored = FALSE;
bool32 battlerAnimsDone = FALSE; bool32 battlerAnimsDone = FALSE;
// Start shiny animation if applicable for 1st pokemon // Start shiny animation if applicable for 1st Pokémon
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
// Start shiny animation if applicable for 2nd pokemon // Start shiny animation if applicable for 2nd Pokémon
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]); TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
@@ -1581,7 +1581,7 @@ static void PrintLinkStandbyMsg(void)
static void PlayerHandleGetMonData(void) static void PlayerHandleGetMonData(void)
{ {
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;
+1 -1
View File
@@ -607,7 +607,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void PlayerPartnerHandleGetMonData(void) static void PlayerPartnerHandleGetMonData(void)
{ {
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;
+1 -1
View File
@@ -515,7 +515,7 @@ static void RecordedOpponentBufferExecCompleted(void)
static void RecordedOpponentHandleGetMonData(void) static void RecordedOpponentHandleGetMonData(void)
{ {
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;
+1 -1
View File
@@ -498,7 +498,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void RecordedPlayerHandleGetMonData(void) static void RecordedPlayerHandleGetMonData(void)
{ {
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;
+1 -1
View File
@@ -425,7 +425,7 @@ static void UNUSED CompleteOnFinishedStatusAnimation(void)
static void WallyHandleGetMonData(void) static void WallyHandleGetMonData(void)
{ {
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;
+8 -8
View File
@@ -2588,7 +2588,7 @@ static void CreateDomeOpponentMon(u8 monPartyId, u16 tournamentTrainerId, u8 tou
#ifdef BUGFIX #ifdef BUGFIX
u8 fixedIv = GetDomeTrainerMonIvs(DOME_TRAINERS[tournamentTrainerId].trainerId); u8 fixedIv = GetDomeTrainerMonIvs(DOME_TRAINERS[tournamentTrainerId].trainerId);
#else #else
u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // BUG: Using the wrong ID. As a result, all Pokemon have ivs of 3. u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // BUG: Using the wrong ID. As a result, all Pokémon have ivs of 3.
#endif #endif
u8 level = SetFacilityPtrsGetLevel(); u8 level = SetFacilityPtrsGetLevel();
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[monPartyId], CreateMonWithEVSpreadNatureOTID(&gEnemyParty[monPartyId],
@@ -2650,13 +2650,13 @@ static void CreateDomeOpponentMons(u16 tournamentTrainerId)
} }
} }
// Returns a bitmask representing which 2 of the trainer's 3 pokemon to select. // Returns a bitmask representing which 2 of the trainer's 3 Pokémon to select.
// The choice is calculated solely depending on the type effectiveness of their // The choice is calculated solely depending on the type effectiveness of their
// movesets against the player's pokemon. // movesets against the player's Pokémon.
// There is a 50% chance of either a "good" or "bad" selection mode being used. // There is a 50% chance of either a "good" or "bad" selection mode being used.
// In the good mode movesets are preferred which are more effective against the // In the good mode movesets are preferred which are more effective against the
// player, and in the bad mode the opposite is true. If all 3 pokemon tie, the // player, and in the bad mode the opposite is true. If all 3 Pokémon tie, the
// other mode will be tried. If they tie again, the pokemon selection is random. // other mode will be tried. If they tie again, the Pokémon selection is random.
int GetDomeTrainerSelectedMons(u16 tournamentTrainerId) int GetDomeTrainerSelectedMons(u16 tournamentTrainerId)
{ {
int selectedMonBits; int selectedMonBits;
@@ -4837,7 +4837,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
if (lost[1]) if (lost[1])
gSprites[sInfoCard->spriteIds[1 + arrId]].oam.paletteNum = 3; gSprites[sInfoCard->spriteIds[1 + arrId]].oam.paletteNum = 3;
// Draw left trainer's pokemon icons. // Draw left trainer's Pokémon icons.
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
if (trainerIds[0] == TRAINER_PLAYER) if (trainerIds[0] == TRAINER_PLAYER)
@@ -4877,7 +4877,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
} }
} }
// Draw right trainer's pokemon icons. // Draw right trainer's Pokémon icons.
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
if (trainerIds[1] == TRAINER_PLAYER) if (trainerIds[1] == TRAINER_PLAYER)
@@ -5228,7 +5228,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
int movePower = 0; int movePower = 0;
SetFacilityPtrsGetLevel(); SetFacilityPtrsGetLevel();
// Calc move points of all 4 moves for all 3 pokemon hitting all 3 target mons. // Calc move points of all 4 moves for all 3 Pokémon hitting all 3 target mons.
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
for (j = 0; j < MAX_MON_MOVES; j++) for (j = 0; j < MAX_MON_MOVES; j++)
+4 -4
View File
@@ -337,7 +337,7 @@ static void GenerateOpponentMons(void)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue; continue;
// Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player // Ensure none of the opponent's Pokémon are the same as the potential rental Pokémon for the player
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
{ {
if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
@@ -346,7 +346,7 @@ static void GenerateOpponentMons(void)
if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons)) if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons))
continue; continue;
// "High tier" pokemon are only allowed on open level mode // "High tier" Pokémon are only allowed on open level mode
if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER) if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER)
continue; continue;
@@ -554,7 +554,7 @@ static void GenerateInitialRentalMons(void)
i = 0; i = 0;
while (i != PARTY_SIZE) while (i != PARTY_SIZE)
{ {
if (i < rentalRank) // The more times the player has rented, the more initial rentals are generated from a better set of pokemon if (i < rentalRank) // The more times the player has rented, the more initial rentals are generated from a better set of Pokémon
monId = GetFactoryMonId(factoryLvlMode, challengeNum, TRUE); monId = GetFactoryMonId(factoryLvlMode, challengeNum, TRUE);
else else
monId = GetFactoryMonId(factoryLvlMode, challengeNum, FALSE); monId = GetFactoryMonId(factoryLvlMode, challengeNum, FALSE);
@@ -562,7 +562,7 @@ static void GenerateInitialRentalMons(void)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue; continue;
// Cannot have two pokemon of the same species. // Cannot have two Pokémon of the same species.
for (j = firstMonId; j < firstMonId + i; j++) for (j = firstMonId; j < firstMonId + i; j++)
{ {
u16 existingMonId = monIds[j]; u16 existingMonId = monIds[j];
+17 -17
View File
@@ -32,15 +32,15 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/rgb.h" #include "constants/rgb.h"
// Select_ refers to the first Pokemon selection screen where you choose your initial 3 rental Pokemon. // Select_ refers to the first Pokémon selection screen where you choose your initial 3 rental Pokémon.
// Swap_ refers to the subsequent selection screens where you can swap a Pokemon with one from the beaten trainer // Swap_ refers to the subsequent selection screens where you can swap a Pokémon with one from the beaten trainer
// Note that, generally, "Action" will refer to the immediate actions that can be taken on each screen, // Note that, generally, "Action" will refer to the immediate actions that can be taken on each screen,
// i.e. selecting a pokemon or selecting the Cancel button // i.e. selecting a Pokémon or selecting the Cancel button
// The "Options menu" will refer to the popup menu that shows when some actions have been selected // The "Options menu" will refer to the popup menu that shows when some actions have been selected
#define SWAP_PLAYER_SCREEN 0 // The screen where the player selects which of their pokemon to swap away #define SWAP_PLAYER_SCREEN 0 // The screen where the player selects which of their Pokémon to swap away
#define SWAP_ENEMY_SCREEN 1 // The screen where the player selects which new pokemon from the defeated party to swap for #define SWAP_ENEMY_SCREEN 1 // The screen where the player selects which new Pokémon from the defeated party to swap for
#define SELECTABLE_MONS_COUNT 6 #define SELECTABLE_MONS_COUNT 6
@@ -89,7 +89,7 @@ struct FactorySelectableMon
{ {
u16 monId; u16 monId;
u16 ballSpriteId; u16 ballSpriteId;
u8 selectedId; // 0 - not selected, 1 - first pokemon, 2 - second pokemon, 3 - third pokemon u8 selectedId; // 0 - not selected, 1 - first Pokémon, 2 - second Pokémon, 3 - third Pokémon
struct Pokemon monData; struct Pokemon monData;
}; };
@@ -1060,7 +1060,7 @@ static void SpriteCB_Pokeball(struct Sprite *sprite)
{ {
if (sprite->oam.paletteNum == IndexOfSpritePaletteTag(PALTAG_BALL_SELECTED)) if (sprite->oam.paletteNum == IndexOfSpritePaletteTag(PALTAG_BALL_SELECTED))
{ {
// Pokeball selected, do rocking animation // Poké Ball selected, do rocking animation
if (sprite->animEnded) if (sprite->animEnded)
{ {
if (sprite->data[0] != 0) if (sprite->data[0] != 0)
@@ -1084,7 +1084,7 @@ static void SpriteCB_Pokeball(struct Sprite *sprite)
} }
else else
{ {
// Pokeball not selected, remain still // Poké Ball not selected, remain still
StartSpriteAnimIfDifferent(sprite, 0); StartSpriteAnimIfDifferent(sprite, 0);
} }
} }
@@ -1521,7 +1521,7 @@ static void Select_Task_Exit(u8 taskId)
} }
} }
// Handles the Yes/No prompt when confirming the 3 selected rental pokemon // Handles the Yes/No prompt when confirming the 3 selected rental Pokémon
static void Select_Task_HandleYesNo(u8 taskId) static void Select_Task_HandleYesNo(u8 taskId)
{ {
if (sFactorySelectScreen->monPicAnimating == TRUE) if (sFactorySelectScreen->monPicAnimating == TRUE)
@@ -1543,14 +1543,14 @@ static void Select_Task_HandleYesNo(u8 taskId)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
if (sFactorySelectScreen->yesNoCursorPos == 0) if (sFactorySelectScreen->yesNoCursorPos == 0)
{ {
// Selected Yes, confirmed selected pokemon // Selected Yes, confirmed selected Pokémon
Select_HideChosenMons(); Select_HideChosenMons();
gTasks[taskId].tState = 0; gTasks[taskId].tState = 0;
gTasks[taskId].func = Select_Task_Exit; gTasks[taskId].func = Select_Task_Exit;
} }
else else
{ {
// Selected No, continue choosing pokemon // Selected No, continue choosing Pokémon
Select_ErasePopupMenu(SELECT_WIN_YES_NO); Select_ErasePopupMenu(SELECT_WIN_YES_NO);
Select_DeclineChosenMons(); Select_DeclineChosenMons();
sFactorySelectScreen->fadeSpeciesNameActive = TRUE; sFactorySelectScreen->fadeSpeciesNameActive = TRUE;
@@ -1560,7 +1560,7 @@ static void Select_Task_HandleYesNo(u8 taskId)
} }
else if (JOY_NEW(B_BUTTON)) else if (JOY_NEW(B_BUTTON))
{ {
// Pressed B, Continue choosing pokemon // Pressed B, Continue choosing Pokémon
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
Select_ErasePopupMenu(SELECT_WIN_YES_NO); Select_ErasePopupMenu(SELECT_WIN_YES_NO);
Select_DeclineChosenMons(); Select_DeclineChosenMons();
@@ -1582,7 +1582,7 @@ static void Select_Task_HandleYesNo(u8 taskId)
} }
} }
// Handles the popup menu that shows when a pokemon is selected // Handles the popup menu that shows when a Pokémon is selected
static void Select_Task_HandleMenu(u8 taskId) static void Select_Task_HandleMenu(u8 taskId)
{ {
switch (gTasks[taskId].tState) switch (gTasks[taskId].tState)
@@ -2415,7 +2415,7 @@ static void Swap_Task_Exit(u8 taskId)
{ {
case 0: case 0:
// Set return value for script // Set return value for script
// TRUE if player kept their current pokemon // TRUE if player kept their current Pokémon
if (sFactorySwapScreen->monSwapped == TRUE) if (sFactorySwapScreen->monSwapped == TRUE)
{ {
gTasks[taskId].tState++; gTasks[taskId].tState++;
@@ -2630,7 +2630,7 @@ static void Swap_Task_HandleMenu(u8 taskId)
} }
} }
// Handles input on the two main swap screens (choosing a current pokeon to get rid of, and choosing a new pokemon to receive) // Handles input on the two main swap screens (choosing a current pokeon to get rid of, and choosing a new Pokémon to receive)
static void Swap_Task_HandleChooseMons(u8 taskId) static void Swap_Task_HandleChooseMons(u8 taskId)
{ {
switch (gTasks[taskId].tState) switch (gTasks[taskId].tState)
@@ -2645,7 +2645,7 @@ static void Swap_Task_HandleChooseMons(u8 taskId)
case STATE_CHOOSE_MONS_HANDLE_INPUT: case STATE_CHOOSE_MONS_HANDLE_INPUT:
if (JOY_NEW(A_BUTTON)) if (JOY_NEW(A_BUTTON))
{ {
// Run whatever action is currently selected (a pokeball, the Cancel button, etc.) // Run whatever action is currently selected (a Poké Ball, the Cancel button, etc.)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
sFactorySwapScreen->fadeSpeciesNameActive = FALSE; sFactorySwapScreen->fadeSpeciesNameActive = FALSE;
Swap_PrintMonSpeciesAtFade(); Swap_PrintMonSpeciesAtFade();
@@ -3553,7 +3553,7 @@ static void Swap_HandleActionCursorChange(u8 cursorId)
{ {
if (cursorId < FRONTIER_PARTY_SIZE) if (cursorId < FRONTIER_PARTY_SIZE)
{ {
// Cursor is on one of the pokemon // Cursor is on one of the Pokémon
gSprites[sFactorySwapScreen->cursorSpriteId].invisible = FALSE; gSprites[sFactorySwapScreen->cursorSpriteId].invisible = FALSE;
Swap_HideActionButtonHighlights(); Swap_HideActionButtonHighlights();
gSprites[sFactorySwapScreen->cursorSpriteId].x = gSprites[sFactorySwapScreen->ballSpriteIds[cursorId]].x; gSprites[sFactorySwapScreen->cursorSpriteId].x = gSprites[sFactorySwapScreen->ballSpriteIds[cursorId]].x;
+4 -4
View File
@@ -105,7 +105,7 @@ void FreeBattleSpritesData(void)
FREE_AND_SET_NULL(gBattleSpritesDataPtr); FREE_AND_SET_NULL(gBattleSpritesDataPtr);
} }
// Pokemon chooses move to use in Battle Palace rather than player // Pokémon chooses move to use in Battle Palace rather than player
u16 ChooseMoveAndTargetInBattlePalace(void) u16 ChooseMoveAndTargetInBattlePalace(void)
{ {
s32 i, var1, var2; s32 i, var1, var2;
@@ -165,7 +165,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
chosenMoveId = BattleAI_ChooseMoveOrAction(); chosenMoveId = BattleAI_ChooseMoveOrAction();
} }
// If no moves matched the selected group, pick a new move from groups the pokemon has // If no moves matched the selected group, pick a new move from groups the Pokémon has
// In this case the AI is not checked again, so the choice may be worse // In this case the AI is not checked again, so the choice may be worse
// If a move is chosen this way, there's a 50% chance that it will be unable to use it anyway // If a move is chosen this way, there's a 50% chance that it will be unable to use it anyway
if (chosenMoveId == -1) if (chosenMoveId == -1)
@@ -264,7 +264,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
if (moveInfo->moves[chosenMoveId] == MOVE_CURSE) if (moveInfo->moves[chosenMoveId] == MOVE_CURSE)
{ {
if (moveInfo->monType1 != TYPE_GHOST && moveInfo->monType2 != TYPE_GHOST) if (moveInfo->monTypes[0] != TYPE_GHOST && moveInfo->monTypes[1] != TYPE_GHOST)
moveTarget = MOVE_TARGET_USER; moveTarget = MOVE_TARGET_USER;
else else
moveTarget = MOVE_TARGET_SELECTED; moveTarget = MOVE_TARGET_SELECTED;
@@ -357,7 +357,7 @@ static u16 GetBattlePalaceTarget(void)
return BATTLE_OPPOSITE(gActiveBattler) << 8; return BATTLE_OPPOSITE(gActiveBattler) << 8;
} }
// Wait for the pokemon to finish appearing out from the pokeball on send out // Wait for the Pokémon to finish appearing out from the Poké Ball on send out
void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite) void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
{ {
u8 spriteId = sprite->data[1]; u8 spriteId = sprite->data[1];
+2 -2
View File
@@ -196,12 +196,12 @@ static void BattleIntroSlide1(u8 taskId)
{ {
if (gTasks[taskId].tTerrain == BATTLE_TERRAIN_LONG_GRASS) if (gTasks[taskId].tTerrain == BATTLE_TERRAIN_LONG_GRASS)
{ {
if (gBattle_BG1_Y != 0xFFB0) if (gBattle_BG1_Y != (u16)(-80))
gBattle_BG1_Y -= 2; gBattle_BG1_Y -= 2;
} }
else else
{ {
if (gBattle_BG1_Y != 0xFFC8) if (gBattle_BG1_Y != (u16)(-56))
gBattle_BG1_Y -= 1; gBattle_BG1_Y -= 1;
} }
} }
+6 -6
View File
@@ -3343,8 +3343,8 @@ void FaintClearSetData(void)
gBattleResources->flags->flags[gActiveBattler] = 0; gBattleResources->flags->flags[gActiveBattler] = 0;
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0]; gBattleMons[gActiveBattler].types[0] = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1]; gBattleMons[gActiveBattler].types[1] = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
ClearBattlerMoveHistory(gActiveBattler); ClearBattlerMoveHistory(gActiveBattler);
ClearBattlerAbilityHistory(gActiveBattler); ClearBattlerAbilityHistory(gActiveBattler);
@@ -3411,8 +3411,8 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
for (i = 0; i < sizeof(struct BattlePokemon); i++) for (i = 0; i < sizeof(struct BattlePokemon); i++)
ptr[i] = gBattleBufferB[gActiveBattler][4 + i]; ptr[i] = gBattleBufferB[gActiveBattler][4 + i];
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0]; gBattleMons[gActiveBattler].types[0] = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1]; gBattleMons[gActiveBattler].types[1] = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum); gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(gActiveBattler)]; hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(gActiveBattler)];
*hpOnSwitchout = gBattleMons[gActiveBattler].hp; *hpOnSwitchout = gBattleMons[gActiveBattler].hp;
@@ -4173,8 +4173,8 @@ static void HandleTurnActionSelectionState(void)
struct ChooseMoveStruct moveInfo; struct ChooseMoveStruct moveInfo;
moveInfo.species = gBattleMons[gActiveBattler].species; moveInfo.species = gBattleMons[gActiveBattler].species;
moveInfo.monType1 = gBattleMons[gActiveBattler].type1; moveInfo.monTypes[0] = gBattleMons[gActiveBattler].types[0];
moveInfo.monType2 = gBattleMons[gActiveBattler].type2; moveInfo.monTypes[1] = gBattleMons[gActiveBattler].types[1];
for (i = 0; i < MAX_MON_MOVES; i++) for (i = 0; i < MAX_MON_MOVES; i++)
{ {
+2 -2
View File
@@ -2152,7 +2152,7 @@ void BufferStringBattle(u16 stringID)
} }
} }
break; break;
case STRINGID_USEDMOVE: // pokemon used a move msg case STRINGID_USEDMOVE: // Pokémon used a move msg
ChooseMoveUsedParticle(gBattleTextBuff1); // buff1 doesn't appear in the string, leftover from japanese move names ChooseMoveUsedParticle(gBattleTextBuff1); // buff1 doesn't appear in the string, leftover from japanese move names
if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT)
@@ -2313,7 +2313,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
{ {
u32 dstID = 0; // if they used dstID, why not use srcID as well? u32 dstID = 0; // if they used dstID, why not use srcID as well?
const u8 *toCpy = NULL; const u8 *toCpy = NULL;
// This buffer may hold either the name of a trainer, pokemon, or item. // This buffer may hold either the name of a trainer, Pokémon, or item.
u8 text[max(max(max(32, TRAINER_NAME_LENGTH + 1), POKEMON_NAME_LENGTH + 1), ITEM_NAME_LENGTH)]; u8 text[max(max(max(32, TRAINER_NAME_LENGTH + 1), POKEMON_NAME_LENGTH + 1), ITEM_NAME_LENGTH)];
u8 multiplayerId; u8 multiplayerId;
s32 i; s32 i;
+1 -1
View File
@@ -1267,7 +1267,7 @@ static void TryHealMons(u8 healCount)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
indices[i] = i; indices[i] = i;
// Only 'healCount' number of pokemon will be healed. // Only 'healCount' number of Pokémon will be healed.
// The order in which they're (attempted to be) healed is random, // The order in which they're (attempted to be) healed is random,
// and determined by performing 10 random swaps to this index array. // and determined by performing 10 random swaps to this index array.
for (k = 0; k < 10; k++) for (k = 0; k < 10; k++)
+54 -54
View File
@@ -1395,11 +1395,11 @@ static void Cmd_typecalc(void)
else if (TYPE_EFFECT_ATK_TYPE(i) == moveType) else if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
{ {
// check type1 // check type1
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1) if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0])
ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i)); ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i));
// check type2 // check type2
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 && if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1] &&
gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2) gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1])
ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i)); ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i));
} }
i += 3; i += 3;
@@ -1454,14 +1454,14 @@ static void CheckWonderGuardAndLevitate(void)
if (TYPE_EFFECT_ATK_TYPE(i) == moveType) if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
{ {
// check no effect // check no effect
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0]
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT) && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT)
{ {
gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE; gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE;
gProtectStructs[gBattlerAttacker].targetNotAffected = 1; gProtectStructs[gBattlerAttacker].targetNotAffected = 1;
} }
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 && if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1] &&
gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 && gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1] &&
TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT) TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT)
{ {
gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE; gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE;
@@ -1469,18 +1469,18 @@ static void CheckWonderGuardAndLevitate(void)
} }
// check super effective // check super effective
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 && TYPE_EFFECT_MULTIPLIER(i) == 20) if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0] && TYPE_EFFECT_MULTIPLIER(i) == 20)
flags |= 1; flags |= 1;
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1]
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 && gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE)
flags |= 1; flags |= 1;
// check not very effective // check not very effective
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 && TYPE_EFFECT_MULTIPLIER(i) == 5) if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0] && TYPE_EFFECT_MULTIPLIER(i) == 5)
flags |= 2; flags |= 2;
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1]
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 && gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE) && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE)
flags |= 2; flags |= 2;
} }
@@ -1570,11 +1570,11 @@ u8 TypeCalc(u16 move, u8 attacker, u8 defender)
else if (TYPE_EFFECT_ATK_TYPE(i) == moveType) else if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
{ {
// check type1 // check type1
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[defender].type1) if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[defender].types[0])
ModulateDmgByType2(TYPE_EFFECT_MULTIPLIER(i), move, &flags); ModulateDmgByType2(TYPE_EFFECT_MULTIPLIER(i), move, &flags);
// check type2 // check type2
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[defender].type2 && if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[defender].types[1] &&
gBattleMons[defender].type1 != gBattleMons[defender].type2) gBattleMons[defender].types[0] != gBattleMons[defender].types[1])
ModulateDmgByType2(TYPE_EFFECT_MULTIPLIER(i), move, &flags); ModulateDmgByType2(TYPE_EFFECT_MULTIPLIER(i), move, &flags);
} }
i += 3; i += 3;
@@ -2246,11 +2246,11 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattleScripting.battler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker;
} }
if (gBattleMons[gEffectBattler].ability == ABILITY_SHIELD_DUST && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gBattleMons[gEffectBattler].ability == ABILITY_SHIELD_DUST && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 9) && !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 9)
INCREMENT_RESET_RETURN INCREMENT_RESET_RETURN
if (gSideStatuses[GET_BATTLER_SIDE(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gSideStatuses[GET_BATTLER_SIDE(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 7) && !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 7)
INCREMENT_RESET_RETURN INCREMENT_RESET_RETURN
@@ -2300,10 +2300,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattlescriptCurrInstr = BattleScript_PSNPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@@ -2312,7 +2312,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN RESET_RETURN
} }
if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL))
&& (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{ {
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
@@ -2341,10 +2341,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_BRNPrevention; gBattlescriptCurrInstr = BattleScript_BRNPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@@ -2353,7 +2353,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN RESET_RETURN
} }
if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE) if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE)
&& (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{ {
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
@@ -2397,10 +2397,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PRLZPrevention; gBattlescriptCurrInstr = BattleScript_PRLZPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@@ -2425,10 +2425,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattlescriptCurrInstr = BattleScript_PSNPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@@ -2437,7 +2437,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN RESET_RETURN
} }
if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL))
&& (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{ {
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
@@ -2480,10 +2480,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].status1), &gBattleMons[gEffectBattler].status1); BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].status1), &gBattleMons[gEffectBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@@ -3366,7 +3366,7 @@ static void Cmd_getexp(void)
if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId])) if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId]))
{ {
// check if the pokemon doesn't belong to the player // check if the Pokémon doesn't belong to the player
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gBattleStruct->expGetterMonId >= 3) if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gBattleStruct->expGetterMonId >= 3)
{ {
i = STRINGID_EMPTYSTRING4; i = STRINGID_EMPTYSTRING4;
@@ -3971,7 +3971,7 @@ static void Cmd_jumpiftype2(void)
{ {
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
if (gBattlescriptCurrInstr[2] == gBattleMons[battlerId].type1 || gBattlescriptCurrInstr[2] == gBattleMons[battlerId].type2) if (gBattlescriptCurrInstr[2] == gBattleMons[battlerId].types[0] || gBattlescriptCurrInstr[2] == gBattleMons[battlerId].types[1])
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
else else
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
@@ -4448,7 +4448,7 @@ static void Cmd_moveend(void)
} }
gBattleScripting.moveendState++; gBattleScripting.moveendState++;
break; break;
case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokemon. case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokémon.
if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE
&& !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH && !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH
&& !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) && !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
@@ -4520,7 +4520,7 @@ static void Cmd_typecalc2(void)
if (TYPE_EFFECT_ATK_TYPE(i) == moveType) if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
{ {
// check type1 // check type1
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1) if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0])
{ {
if (TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT) if (TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT)
{ {
@@ -4537,22 +4537,22 @@ static void Cmd_typecalc2(void)
} }
} }
// check type2 // check type2
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2) if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1])
{ {
if (gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 if (gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT) && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT)
{ {
gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE; gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE;
break; break;
} }
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1]
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 && gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE) && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE)
{ {
flags |= MOVE_RESULT_NOT_VERY_EFFECTIVE; flags |= MOVE_RESULT_NOT_VERY_EFFECTIVE;
} }
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1]
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 && gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE)
{ {
flags |= MOVE_RESULT_SUPER_EFFECTIVE; flags |= MOVE_RESULT_SUPER_EFFECTIVE;
@@ -4623,8 +4623,8 @@ static void Cmd_switchindataupdate(void)
for (i = 0; i < sizeof(struct BattlePokemon); i++) for (i = 0; i < sizeof(struct BattlePokemon); i++)
monData[i] = gBattleBufferB[gActiveBattler][4 + i]; monData[i] = gBattleBufferB[gActiveBattler][4 + i];
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0]; gBattleMons[gActiveBattler].types[0] = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1]; gBattleMons[gActiveBattler].types[1] = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum); gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
// check knocked off item // check knocked off item
@@ -7270,7 +7270,7 @@ static void Cmd_forcerandomswitch(void)
lastMonId = PARTY_SIZE; lastMonId = PARTY_SIZE;
monsCount = PARTY_SIZE; monsCount = PARTY_SIZE;
minNeeded = 1; minNeeded = 1;
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one pokemon out in single battles battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one Pokémon out in single battles
battler1PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[gBattlerTarget];
} }
@@ -7354,8 +7354,8 @@ static void Cmd_tryconversiontypechange(void)
else else
moveType = TYPE_NORMAL; moveType = TYPE_NORMAL;
} }
if (moveType != gBattleMons[gBattlerAttacker].type1 if (moveType != gBattleMons[gBattlerAttacker].types[0]
&& moveType != gBattleMons[gBattlerAttacker].type2) && moveType != gBattleMons[gBattlerAttacker].types[1])
{ {
break; break;
} }
@@ -7381,7 +7381,7 @@ static void Cmd_tryconversiontypechange(void)
moveType = TYPE_NORMAL; moveType = TYPE_NORMAL;
} }
} }
while (moveType == gBattleMons[gBattlerAttacker].type1 || moveType == gBattleMons[gBattlerAttacker].type2); while (moveType == gBattleMons[gBattlerAttacker].types[0] || moveType == gBattleMons[gBattlerAttacker].types[1]);
SET_BATTLER_TYPE(gBattlerAttacker, moveType); SET_BATTLER_TYPE(gBattlerAttacker, moveType);
PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType);
@@ -7548,12 +7548,12 @@ static void Cmd_weatherdamage(void)
{ {
if (gBattleWeather & B_WEATHER_SANDSTORM) if (gBattleWeather & B_WEATHER_SANDSTORM)
{ {
if (gBattleMons[gBattlerAttacker].type1 != TYPE_ROCK if (gBattleMons[gBattlerAttacker].types[0] != TYPE_ROCK
&& gBattleMons[gBattlerAttacker].type1 != TYPE_STEEL && gBattleMons[gBattlerAttacker].types[0] != TYPE_STEEL
&& gBattleMons[gBattlerAttacker].type1 != TYPE_GROUND && gBattleMons[gBattlerAttacker].types[0] != TYPE_GROUND
&& gBattleMons[gBattlerAttacker].type2 != TYPE_ROCK && gBattleMons[gBattlerAttacker].types[1] != TYPE_ROCK
&& gBattleMons[gBattlerAttacker].type2 != TYPE_STEEL && gBattleMons[gBattlerAttacker].types[1] != TYPE_STEEL
&& gBattleMons[gBattlerAttacker].type2 != TYPE_GROUND && gBattleMons[gBattlerAttacker].types[1] != TYPE_GROUND
&& gBattleMons[gBattlerAttacker].ability != ABILITY_SAND_VEIL && gBattleMons[gBattlerAttacker].ability != ABILITY_SAND_VEIL
&& !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND) && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND)
&& !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER)) && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER))
@@ -7761,7 +7761,7 @@ static void Cmd_setsubstitute(void)
} }
else else
{ {
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; // one bit value will only work for pokemon which max hp can go to 1020(which is more than possible in games) gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; // one bit value will only work for Pokémon which max hp can go to 1020(which is more than possible in games)
if (gBattleMoveDamage == 0) if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
@@ -9142,7 +9142,7 @@ static void Cmd_tryswapitems(void)
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
// can't swap if two pokemon don't have an item // can't swap if two Pokémon don't have an item
// or if either of them is an enigma berry or a mail // or if either of them is an enigma berry or a mail
else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE) else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE)
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY || gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY
+5 -5
View File
@@ -108,7 +108,7 @@ EWRAM_DATA static u8 *sTrainerBBattleScriptRetAddr = NULL;
EWRAM_DATA static bool8 sShouldCheckTrainerBScript = FALSE; EWRAM_DATA static bool8 sShouldCheckTrainerBScript = FALSE;
EWRAM_DATA static u8 sNoOfPossibleTrainerRetScripts = 0; EWRAM_DATA static u8 sNoOfPossibleTrainerRetScripts = 0;
// The first transition is used if the enemy pokemon are lower level than our pokemon. // The first transition is used if the enemy Pokémon are lower level than our Pokémon.
// Otherwise, the second transition is used. // Otherwise, the second transition is used.
static const u8 sBattleTransitionTable_Wild[][2] = static const u8 sBattleTransitionTable_Wild[][2] =
{ {
@@ -845,7 +845,7 @@ static u8 GetTrainerBattleTransition(void)
return B_TRANSITION_AQUA; return B_TRANSITION_AQUA;
if (gTrainers[gTrainerBattleOpponent_A].doubleBattle == TRUE) if (gTrainers[gTrainerBattleOpponent_A].doubleBattle == TRUE)
minPartyCount = 2; // double battles always at least have 2 pokemon. minPartyCount = 2; // double battles always at least have 2 Pokémon.
else else
minPartyCount = 1; minPartyCount = 1;
@@ -859,7 +859,7 @@ static u8 GetTrainerBattleTransition(void)
return sBattleTransitionTable_Trainer[transitionType][1]; return sBattleTransitionTable_Trainer[transitionType][1];
} }
#define RANDOM_TRANSITION(table)(table[Random() % ARRAY_COUNT(table)]) #define RANDOM_TRANSITION(table) (table[Random() % ARRAY_COUNT(table)])
u8 GetSpecialBattleTransition(s32 id) u8 GetSpecialBattleTransition(s32 id)
{ {
u16 var; u16 var;
@@ -1615,7 +1615,7 @@ static bool32 UpdateRandomTrainerRematches(const struct RematchTrainer *table, u
// Trainer already wants a rematch. Don't bother updating it. // Trainer already wants a rematch. Don't bother updating it.
ret = TRUE; ret = TRUE;
} }
else if (FlagGet(FLAG_MATCH_CALL_REGISTERED + i) else if (FlagGet(TRAINER_REGISTERED_FLAGS_START + i)
&& (Random() % 100) <= 30) // 31% chance of getting a rematch. && (Random() % 100) <= 30) // 31% chance of getting a rematch.
{ {
SetRematchIdForTrainer(table, i); SetRematchIdForTrainer(table, i);
@@ -1744,7 +1744,7 @@ static u32 GetTrainerMatchCallFlag(u32 trainerId)
for (i = 0; i < REMATCH_TABLE_ENTRIES; i++) for (i = 0; i < REMATCH_TABLE_ENTRIES; i++)
{ {
if (gRematchTable[i].trainerIds[0] == trainerId) if (gRematchTable[i].trainerIds[0] == trainerId)
return FLAG_MATCH_CALL_REGISTERED + i; return TRAINER_REGISTERED_FLAGS_START + i;
} }
return 0xFFFF; return 0xFFFF;
+2 -2
View File
@@ -309,7 +309,7 @@ static void GenerateInitialRentalMons(void)
i = 0; i = 0;
while (i != PARTY_SIZE) while (i != PARTY_SIZE)
{ {
// Cannot have two pokemon of the same species. // Cannot have two Pokémon of the same species.
monSetId = Random() % NUM_SLATEPORT_TENT_MONS; monSetId = Random() % NUM_SLATEPORT_TENT_MONS;
for (j = firstMonId; j < firstMonId + i; j++) for (j = firstMonId; j < firstMonId + i; j++)
{ {
@@ -390,7 +390,7 @@ static void GenerateOpponentMons(void)
{ {
sRandMonId = monSet[Random() % numMons]; sRandMonId = monSet[Random() % numMons];
// Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player // Ensure none of the opponent's Pokémon are the same as the potential rental Pokémon for the player
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
{ {
if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
+18 -18
View File
@@ -1680,8 +1680,8 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
} }
// Regular battle frontier trainer. // Regular battle frontier trainer.
// Attempt to fill the trainer's party with random Pokemon until 3 have been // Attempt to fill the trainer's party with random Pokémon until 3 have been
// successfully chosen. The trainer's party may not have duplicate pokemon species // successfully chosen. The trainer's party may not have duplicate Pokémon species
// or duplicate held items. // or duplicate held items.
for (bfMonCount = 0; monSet[bfMonCount] != 0xFFFF; bfMonCount++) for (bfMonCount = 0; monSet[bfMonCount] != 0xFFFF; bfMonCount++)
; ;
@@ -1691,12 +1691,12 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
{ {
u16 monId = monSet[Random() % bfMonCount]; u16 monId = monSet[Random() % bfMonCount];
// "High tier" pokemon are only allowed on open level mode // "High tier" Pokémon are only allowed on open level mode
// 20 is not a possible value for level here // 20 is not a possible value for level here
if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER) if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER)
continue; continue;
// Ensure this pokemon species isn't a duplicate. // Ensure this Pokémon species isn't a duplicate.
for (j = 0; j < i + firstMonId; j++) for (j = 0; j < i + firstMonId; j++)
{ {
if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species) if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species)
@@ -1715,7 +1715,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
if (j != i + firstMonId) if (j != i + firstMonId)
continue; continue;
// Ensure this exact pokemon index isn't a duplicate. This check doesn't seem necessary // Ensure this exact Pokémon index isn't a duplicate. This check doesn't seem necessary
// because the species and held items were already checked directly above. // because the species and held items were already checked directly above.
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
{ {
@@ -1727,7 +1727,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
chosenMonIndices[i] = monId; chosenMonIndices[i] = monId;
// Place the chosen pokemon into the trainer's party. // Place the chosen Pokémon into the trainer's party.
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId], CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId],
gFacilityTrainerMons[monId].species, gFacilityTrainerMons[monId].species,
level, level,
@@ -1737,7 +1737,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
otID); otID);
friendship = MAX_FRIENDSHIP; friendship = MAX_FRIENDSHIP;
// Give the chosen pokemon its specified moves. // Give the chosen Pokémon its specified moves.
for (j = 0; j < MAX_MON_MOVES; j++) for (j = 0; j < MAX_MON_MOVES; j++)
{ {
SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], j); SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], j);
@@ -1748,7 +1748,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_FRIENDSHIP, &friendship); SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_FRIENDSHIP, &friendship);
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
// The pokemon was successfully added to the trainer's party, so it's safe to move on to // The Pokémon was successfully added to the trainer's party, so it's safe to move on to
// the next party slot. // the next party slot.
i++; i++;
} }
@@ -1804,7 +1804,7 @@ u16 GetRandomFrontierMonFromSet(u16 trainerId)
do do
{ {
// "High tier" pokemon are only allowed on open level mode // "High tier" Pokémon are only allowed on open level mode
// 20 is not a possible value for level here // 20 is not a possible value for level here
monId = monSet[Random() % numMons]; monId = monSet[Random() % numMons];
} while((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER); } while((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER);
@@ -2454,8 +2454,8 @@ static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId)
// These partners can be an NPC or a former/record-mixed Apprentice // These partners can be an NPC or a former/record-mixed Apprentice
// When talked to, their response consists of: // When talked to, their response consists of:
// PARTNER_MSGID_INTRO - A greeting // PARTNER_MSGID_INTRO - A greeting
// PARTNER_MSGID_MON1 - Naming one pokemon on their team, and a move it has // PARTNER_MSGID_MON1 - Naming one Pokémon on their team, and a move it has
// PARTNER_MSGID_MON2_ASK - Naming a second pokemon on their team, a move it has, and asking if they'd like to be their partner // PARTNER_MSGID_MON2_ASK - Naming a second Pokémon on their team, a move it has, and asking if they'd like to be their partner
// PARTNER_MSGID_ACCEPT - If the player agrees to be their partner // PARTNER_MSGID_ACCEPT - If the player agrees to be their partner
// PARTNER_MSGID_REJECT - If the player declines to be their partner // PARTNER_MSGID_REJECT - If the player declines to be their partner
static void ShowPartnerCandidateMessage(void) static void ShowPartnerCandidateMessage(void)
@@ -2773,7 +2773,7 @@ static void AwardBattleTowerRibbons(void)
#ifdef BUGFIX #ifdef BUGFIX
struct RibbonCounter ribbons[MAX_FRONTIER_PARTY_SIZE]; struct RibbonCounter ribbons[MAX_FRONTIER_PARTY_SIZE];
#else #else
struct RibbonCounter ribbons[3]; // BUG: 4 Pokemon can receive ribbons in a double battle mode. struct RibbonCounter ribbons[3]; // BUG: 4 Pokémon can receive ribbons in a double battle mode.
#endif #endif
u8 ribbonType = 0; u8 ribbonType = 0;
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
@@ -2982,7 +2982,7 @@ static void FillPartnerParty(u16 trainerId)
#ifdef BUGFIX #ifdef BUGFIX
j, j,
#else #else
i, // BUG: personality was stored in the 'j' variable. As a result, Steven's pokemon do not have the intended natures. i, // BUG: personality was stored in the 'j' variable. As a result, Steven's Pokémon do not have the intended natures.
#endif #endif
OT_ID_PRESET, STEVEN_OTID); OT_ID_PRESET, STEVEN_OTID);
for (j = 0; j < PARTY_SIZE; j++) for (j = 0; j < PARTY_SIZE; j++)
@@ -3409,7 +3409,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
{ {
u16 monId = monSet[Random() % bfMonCount]; u16 monId = monSet[Random() % bfMonCount];
// Ensure this pokemon species isn't a duplicate. // Ensure this Pokémon species isn't a duplicate.
for (j = 0; j < i + firstMonId; j++) for (j = 0; j < i + firstMonId; j++)
{ {
if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species) if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species)
@@ -3428,7 +3428,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
if (j != i + firstMonId) if (j != i + firstMonId)
continue; continue;
// Ensure this exact pokemon index isn't a duplicate. This check doesn't seem necessary // Ensure this exact Pokémon index isn't a duplicate. This check doesn't seem necessary
// because the species and held items were already checked directly above. // because the species and held items were already checked directly above.
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
{ {
@@ -3440,7 +3440,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
chosenMonIndices[i] = monId; chosenMonIndices[i] = monId;
// Place the chosen pokemon into the trainer's party. // Place the chosen Pokémon into the trainer's party.
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId], CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId],
gFacilityTrainerMons[monId].species, gFacilityTrainerMons[monId].species,
level, level,
@@ -3450,7 +3450,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
otID); otID);
friendship = MAX_FRIENDSHIP; friendship = MAX_FRIENDSHIP;
// Give the chosen pokemon its specified moves. // Give the chosen Pokémon its specified moves.
for (j = 0; j < MAX_MON_MOVES; j++) for (j = 0; j < MAX_MON_MOVES; j++)
{ {
SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], j); SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], j);
@@ -3461,7 +3461,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_FRIENDSHIP, &friendship); SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_FRIENDSHIP, &friendship);
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
// The pokemon was successfully added to the trainer's party, so it's safe to move on to // The Pokémon was successfully added to the trainer's party, so it's safe to move on to
// the next party slot. // the next party slot.
i++; i++;
} }
+4
View File
@@ -1907,7 +1907,11 @@ static bool8 ClockwiseWipe_TopRight(struct Task *task)
{ {
sTransitionData->VBlank_DMA = FALSE; sTransitionData->VBlank_DMA = FALSE;
#ifdef UBFIX
InitBlackWipe(sTransitionData->data, DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sTransitionData->tWipeEndX, 0, 1, 1);
#else
InitBlackWipe(sTransitionData->data, DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sTransitionData->tWipeEndX, -1, 1, 1); InitBlackWipe(sTransitionData->data, DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sTransitionData->tWipeEndX, -1, 1, 1);
#endif
do do
{ {
gScanlineEffectRegBuffers[0][sTransitionData->tWipeCurrY] = (sTransitionData->tWipeCurrX + 1) | ((DISPLAY_WIDTH / 2) << 8); gScanlineEffectRegBuffers[0][sTransitionData->tWipeCurrY] = (sTransitionData->tWipeCurrX + 1) | ((DISPLAY_WIDTH / 2) << 8);
+1 -1
View File
@@ -526,7 +526,7 @@ static const u16 *const sPointsArray[] =
}; };
// Points will always be calculated for these messages // Points will always be calculated for these messages
// even if current pokemon does not have corresponding move // even if current Pokémon does not have corresponding move
static const u16 sSpecialBattleStrings[] = static const u16 sSpecialBattleStrings[] =
{ {
STRINGID_PKMNPERISHCOUNTFELL, STRINGID_PKMNWISHCAMETRUE, STRINGID_PKMNLOSTPPGRUDGE, STRINGID_PKMNPERISHCOUNTFELL, STRINGID_PKMNWISHCAMETRUE, STRINGID_PKMNLOSTPPGRUDGE,
+13 -13
View File
@@ -649,7 +649,7 @@ void HandleAction_NothingIsFainted(void)
gCurrentTurnActionNumber++; gCurrentTurnActionNumber++;
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber]; gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR | HITMARKER_NO_PPDEDUCT | HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_IGNORE_ON_AIR
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT | HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_CHARGING | HITMARKER_NEVER_SET); | HITMARKER_CHARGING | HITMARKER_NEVER_SET);
@@ -662,7 +662,7 @@ void HandleAction_ActionFinished(void)
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber]; gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
SpecialStatusesClear(); SpecialStatusesClear();
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR | HITMARKER_NO_PPDEDUCT | HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_IGNORE_ON_AIR
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT | HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_CHARGING | HITMARKER_NEVER_SET); | HITMARKER_CHARGING | HITMARKER_NEVER_SET);
@@ -1545,7 +1545,7 @@ u8 DoBattlerEndTurnEffects(void)
if ((gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE) && gBattleMons[gActiveBattler].hp != 0) if ((gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE) && gBattleMons[gActiveBattler].hp != 0)
{ {
// R/S does not perform this sleep check, which causes the nightmare effect to // R/S does not perform this sleep check, which causes the nightmare effect to
// persist even after the affected Pokemon has been awakened by Shed Skin. // persist even after the affected Pokémon has been awakened by Shed Skin.
if (gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) if (gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)
{ {
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4; gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4;
@@ -1625,7 +1625,7 @@ u8 DoBattlerEndTurnEffects(void)
} }
if (gBattlerAttacker != gBattlersCount) if (gBattlerAttacker != gBattlersCount)
{ {
effect = 2; // a pokemon was awaken effect = 2; // a Pokémon was awaken
break; break;
} }
else else
@@ -1685,7 +1685,7 @@ u8 DoBattlerEndTurnEffects(void)
if (gDisableStructs[gActiveBattler].disabledMove == gBattleMons[gActiveBattler].moves[i]) if (gDisableStructs[gActiveBattler].disabledMove == gBattleMons[gActiveBattler].moves[i])
break; break;
} }
if (i == MAX_MON_MOVES) // pokemon does not have the disabled move anymore if (i == MAX_MON_MOVES) // Pokémon does not have the disabled move anymore
{ {
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE; gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
gDisableStructs[gActiveBattler].disableTimer = 0; gDisableStructs[gActiveBattler].disableTimer = 0;
@@ -1702,7 +1702,7 @@ u8 DoBattlerEndTurnEffects(void)
case ENDTURN_ENCORE: // encore case ENDTURN_ENCORE: // encore
if (gDisableStructs[gActiveBattler].encoreTimer != 0) if (gDisableStructs[gActiveBattler].encoreTimer != 0)
{ {
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // Pokémon does not have the encored move anymore
{ {
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE; gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
gDisableStructs[gActiveBattler].encoreTimer = 0; gDisableStructs[gActiveBattler].encoreTimer = 0;
@@ -2782,7 +2782,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleCommunication[MOVE_EFFECT_BYTE] += MOVE_EFFECT_AFFECTS_USER; gBattleCommunication[MOVE_EFFECT_BYTE] += MOVE_EFFECT_AFFECTS_USER;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; break;
@@ -2797,7 +2797,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_POISON; gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_POISON;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; break;
@@ -2812,7 +2812,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_PARALYSIS; gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_PARALYSIS;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; break;
@@ -2827,7 +2827,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_BURN; gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_BURN;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; break;
@@ -2963,7 +2963,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleScripting.battler = gBattlerTarget; gBattleScripting.battler = gBattlerTarget;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; break;
@@ -2979,7 +2979,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleScripting.battler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; break;
@@ -3003,7 +3003,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE)) if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE))
{ {
u8 target2; u8 target2;
side = BATTLE_OPPOSITE(GetBattlerPosition(i)) & BIT_SIDE; // side of the opposing pokemon side = BATTLE_OPPOSITE(GetBattlerPosition(i)) & BIT_SIDE; // side of the opposing Pokémon
target1 = GetBattlerAtPosition(side); target1 = GetBattlerAtPosition(side);
target2 = GetBattlerAtPosition(side + BIT_FLANK); target2 = GetBattlerAtPosition(side + BIT_FLANK);
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
+15 -23
View File
@@ -916,14 +916,14 @@ static const u8 sBlackPokeblockFlavorFlags[] = {
(1 << FLAVOR_SOUR) | (1 << FLAVOR_SWEET) | (1 << FLAVOR_SPICY), (1 << FLAVOR_SOUR) | (1 << FLAVOR_SWEET) | (1 << FLAVOR_SPICY),
}; };
static const u8 sUnused[] = static const u8 sJPText_GoodTvReady[] = _("\nいいTVができました "); // Unused
{ static const u8 sJPText_BadTvReady[] = _("\nダメTVができました "); // Unused
0xfe, 0x02, 0x02, 0xce, 0xd0, 0x37, 0x44, 0x07, 0x1f, 0x0c, 0x10, static const u8 sJPText_Flavors[][5] = {_("からい"), _("しぶい"), _("あまい"), _("にがい"), _("すっぱい")}; // Unused
0x00, 0xff, 0xfe, 0x91, 0x72, 0xce, 0xd0, 0x37, 0x44, 0x07, 0x1f,
0x0c, 0x10, 0x00, 0xff, 0x06, 0x27, 0x02, 0xff, 0x00, 0x0c, 0x48, static const u8 sUnused[] = {
0x02, 0xff, 0x00, 0x01, 0x1f, 0x02, 0xff, 0x00, 0x16, 0x37, 0x02, 6, 6, 6, 6, 5,
0xff, 0x00, 0x0d, 0x50, 0x4b, 0x02, 0xff, 0x06, 0x06, 0x06, 0x06, 3, 3, 3, 2, 2,
0x05, 0x03, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x02 3, 3, 3, 3, 2
}; };
static const struct WindowTemplate sBlenderRecordWindowTemplate = static const struct WindowTemplate sBlenderRecordWindowTemplate =
@@ -1908,7 +1908,7 @@ static void Task_HandleOpponent1(u8 taskId)
static void Task_HandleOpponent2(u8 taskId) static void Task_HandleOpponent2(u8 taskId)
{ {
u32 var1 = (sBerryBlender->arrowPos + 0x1800) & 0xFFFF; u32 var1 = (sBerryBlender->arrowPos + 0x1800) & 0xFFFF;
u32 arrowId = sBerryBlender->playerIdToArrowId[2] & 0xFF; u8 arrowId = sBerryBlender->playerIdToArrowId[2];
if ((var1 >> 8) > sArrowHitRangeStart[arrowId] + 20 && (var1 >> 8) < sArrowHitRangeStart[arrowId] + 40) if ((var1 >> 8) > sArrowHitRangeStart[arrowId] + 20 && (var1 >> 8) < sArrowHitRangeStart[arrowId] + 40)
{ {
if (!gTasks[taskId].tDidInput) if (!gTasks[taskId].tDidInput)
@@ -1925,11 +1925,9 @@ static void Task_HandleOpponent2(u8 taskId)
} }
else else
{ {
u8 value;
if (rand > 65) if (rand > 65)
gRecvCmds[2][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_BEST; gRecvCmds[2][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_BEST;
value = rand - 41; if (rand > 40 && rand <= 65)
if (value < 25)
gRecvCmds[2][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_GOOD; gRecvCmds[2][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_GOOD;
if (rand < 10) if (rand < 10)
CreateOpponentMissTask(2, 5); CreateOpponentMissTask(2, 5);
@@ -1953,7 +1951,7 @@ static void Task_HandleOpponent2(u8 taskId)
static void Task_HandleOpponent3(u8 taskId) static void Task_HandleOpponent3(u8 taskId)
{ {
u32 var1 = (sBerryBlender->arrowPos + 0x1800) & 0xFFFF; u32 var1 = (sBerryBlender->arrowPos + 0x1800) & 0xFFFF;
u32 arrowId = sBerryBlender->playerIdToArrowId[3] & 0xFF; u8 arrowId = sBerryBlender->playerIdToArrowId[3];
if ((var1 >> 8) > sArrowHitRangeStart[arrowId] + 20 && (var1 >> 8) < sArrowHitRangeStart[arrowId] + 40) if ((var1 >> 8) > sArrowHitRangeStart[arrowId] + 20 && (var1 >> 8) < sArrowHitRangeStart[arrowId] + 40)
{ {
if (gTasks[taskId].data[0] == 0) if (gTasks[taskId].data[0] == 0)
@@ -1971,16 +1969,9 @@ static void Task_HandleOpponent3(u8 taskId)
else else
{ {
if (rand > 60) if (rand > 60)
{
gRecvCmds[3][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_BEST; gRecvCmds[3][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_BEST;
} else if (rand > 55 && rand <= 60)
else gRecvCmds[3][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_GOOD;
{
s8 value = rand - 56; // makes me wonder what the original code was
u8 value2 = value;
if (value2 < 5)
gRecvCmds[3][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_GOOD;
}
if (rand < 5) if (rand < 5)
CreateOpponentMissTask(3, 5); CreateOpponentMissTask(3, 5);
} }
@@ -2050,7 +2041,8 @@ static void UpdateSpeedFromHit(u16 cmd)
switch (cmd) switch (cmd)
{ {
case LINKCMD_BLENDER_SCORE_BEST: case LINKCMD_BLENDER_SCORE_BEST:
if (sBerryBlender->speed < 1500) { if (sBerryBlender->speed < 1500)
{
sBerryBlender->speed += (384 / sNumPlayersToSpeedDivisor[sBerryBlender->numPlayers]); sBerryBlender->speed += (384 / sNumPlayersToSpeedDivisor[sBerryBlender->numPlayers]);
} }
else else
Executable → Regular
+1 -6
View File
@@ -1373,7 +1373,6 @@ static void CreateBerrySprites(struct BerryCrushGame *game, struct BerryCrushGam
u8 spriteId; u8 spriteId;
s16 distance, var1; s16 distance, var1;
s16 *data; s16 *data;
s32 amplitude;
s16 speed; s16 speed;
u32 var2; u32 var2;
@@ -1395,11 +1394,7 @@ static void CreateBerrySprites(struct BerryCrushGame *game, struct BerryCrushGam
sYAccel = 32; sYAccel = 32;
sBitfield = 112; // Setting bits in MASK_TARGET_Y sBitfield = 112; // Setting bits in MASK_TARGET_Y
distance = gfx->playerCoords[i]->berryXDest - gfx->playerCoords[i]->berryXOffset; distance = gfx->playerCoords[i]->berryXDest - gfx->playerCoords[i]->berryXOffset;
amplitude = distance; sAmplitude = distance / 4;
if (distance < 0)
amplitude += 3;
sAmplitude = amplitude >> 2;
distance *= 128; distance *= 128;
var2 = speed + 32; var2 = speed + 32;
var2 = var2 / 2; var2 = var2 / 2;
+1 -1
View File
@@ -20,7 +20,7 @@ bool16 ScriptGetPokedexInfo(void)
return IsNationalPokedexEnabled(); return IsNationalPokedexEnabled();
} }
// This shows your Hoenn Pokedex rating and not your National Dex. // This shows your Hoenn Pokédex rating and not your National Dex.
const u8 *GetPokedexRatingText(u16 count) const u8 *GetPokedexRatingText(u16 count)
{ {
if (count < 10) if (count < 10)
+5 -5
View File
@@ -194,7 +194,7 @@ static void SwapMoveDescAndContestTilemaps(void);
#define CONTESTANT_TEXT_COLOR_START 10 #define CONTESTANT_TEXT_COLOR_START 10
enum { enum {
// The "{Pokemon Name} / {Trainer Name}" windows. // The "{Pokémon Name} / {Trainer Name}" windows.
WIN_CONTESTANT0_NAME, WIN_CONTESTANT0_NAME,
WIN_CONTESTANT1_NAME, WIN_CONTESTANT1_NAME,
WIN_CONTESTANT2_NAME, WIN_CONTESTANT2_NAME,
@@ -3434,11 +3434,11 @@ static void RankContestants(void)
// For each contestant, find the best rank with their point total. // For each contestant, find the best rank with their point total.
// Normally, each point total is different, and this will output the // Normally, each point total is different, and this will output the
// rankings as expected. However, if two pokemon are tied, then they // rankings as expected. However, if two Pokémon are tied, then they
// both get the best rank for that point total. // both get the best rank for that point total.
// //
// For example if the point totals are [100, 80, 80, 50], the ranks will // For example if the point totals are [100, 80, 80, 50], the ranks will
// be [1, 2, 2, 4]. The pokemon with a point total of 80 stop looking // be [1, 2, 2, 4]. The Pokémon with a point total of 80 stop looking
// when they see the first 80 in the array, so they both share the '2' // when they see the first 80 in the array, so they both share the '2'
// rank. // rank.
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
@@ -4590,10 +4590,10 @@ void MakeContestantNervous(u8 p)
// ContestantStatus::nextTurnOrder field of each contestant. The remaining // ContestantStatus::nextTurnOrder field of each contestant. The remaining
// turns are assigned such that the turn order will reverse. // turns are assigned such that the turn order will reverse.
// //
// For example, if no pokemon have a defined nextTurnOrder, then the 4th // For example, if no Pokémon have a defined nextTurnOrder, then the 4th
// will become 1st, the 3rd will become 2nd, etc. // will become 1st, the 3rd will become 2nd, etc.
// //
// Note: This function assumes that multiple pokemon cannot have the same // Note: This function assumes that multiple Pokémon cannot have the same
// nextTurnOrder value. // nextTurnOrder value.
static void ApplyNextTurnOrder(void) static void ApplyNextTurnOrder(void)
{ {
+2 -1
View File
@@ -138,7 +138,8 @@ static void ContestEffect_StartleFrontMon(void)
u8 idx = 0; u8 idx = 0;
u8 a = eContestAppealResults.contestant; u8 a = eContestAppealResults.contestant;
if (eContestAppealResults.turnOrder[a] != 0) { if (eContestAppealResults.turnOrder[a] != 0)
{
int i; int i;
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
+11 -11
View File
@@ -63,12 +63,12 @@ enum {
struct CreditsData struct CreditsData
{ {
u16 monToShow[NUM_MON_SLIDES]; // List of Pokemon species ids that will show during the credits u16 monToShow[NUM_MON_SLIDES]; // List of Pokémon species ids that will show during the credits
u16 imgCounter; //how many mon images have been shown u16 imgCounter; //how many mon images have been shown
u16 nextImgPos; //if the next image spawns left/center/right u16 nextImgPos; //if the next image spawns left/center/right
u16 currShownMon; //index into monToShow u16 currShownMon; //index into monToShow
u16 numMonToShow; //number of pokemon to show, always NUM_MON_SLIDES after determine function u16 numMonToShow; //number of Pokémon to show, always NUM_MON_SLIDES after determine function
u16 caughtMonIds[NATIONAL_DEX_COUNT]; //temporary location to hold a condensed array of all caught pokemon u16 caughtMonIds[NATIONAL_DEX_COUNT]; //temporary location to hold a condensed array of all caught Pokémon
u16 numCaughtMon; //count of filled spaces in caughtMonIds u16 numCaughtMon; //count of filled spaces in caughtMonIds
u16 unused[7]; u16 unused[7];
}; };
@@ -1555,8 +1555,8 @@ static void DeterminePokemonToShow(void)
u16 dexNum; u16 dexNum;
u16 j; u16 j;
// Go through the Pokedex, and anything that has gotten caught we put into our massive array. // Go through the Pokédex, and anything that has gotten caught we put into our massive array.
// This basically packs all of the caught pokemon into the front of the array // This basically packs all of the caught Pokémon into the front of the array
for (dexNum = 1, j = 0; dexNum < NATIONAL_DEX_COUNT; dexNum++) for (dexNum = 1, j = 0; dexNum < NATIONAL_DEX_COUNT; dexNum++)
{ {
if (GetSetPokedexFlag(dexNum, FLAG_GET_CAUGHT)) if (GetSetPokedexFlag(dexNum, FLAG_GET_CAUGHT))
@@ -1570,14 +1570,14 @@ static void DeterminePokemonToShow(void)
for (dexNum = j; dexNum < NATIONAL_DEX_COUNT; dexNum++) for (dexNum = j; dexNum < NATIONAL_DEX_COUNT; dexNum++)
sCreditsData->caughtMonIds[dexNum] = NATIONAL_DEX_NONE; sCreditsData->caughtMonIds[dexNum] = NATIONAL_DEX_NONE;
// Cap the number of pokemon we care about to NUM_MON_SLIDES, the max we show in the credits scene (-1 for the starter) // Cap the number of Pokémon we care about to NUM_MON_SLIDES, the max we show in the credits scene (-1 for the starter)
sCreditsData->numCaughtMon = j; sCreditsData->numCaughtMon = j;
if (sCreditsData->numCaughtMon < NUM_MON_SLIDES) if (sCreditsData->numCaughtMon < NUM_MON_SLIDES)
sCreditsData->numMonToShow = j; sCreditsData->numMonToShow = j;
else else
sCreditsData->numMonToShow = NUM_MON_SLIDES; sCreditsData->numMonToShow = NUM_MON_SLIDES;
// Loop through our list of caught pokemon and select randomly from it to fill the images to show // Loop through our list of caught Pokémon and select randomly from it to fill the images to show
j = 0; j = 0;
do do
{ {
@@ -1598,7 +1598,7 @@ static void DeterminePokemonToShow(void)
} }
while (sCreditsData->numCaughtMon != 0 && j < NUM_MON_SLIDES); while (sCreditsData->numCaughtMon != 0 && j < NUM_MON_SLIDES);
// If we don't have enough pokemon in the dex to fill everything, copy the selected mon into the end of the array, so it loops // If we don't have enough Pokémon in the dex to fill everything, copy the selected mon into the end of the array, so it loops
if (sCreditsData->numMonToShow < NUM_MON_SLIDES) if (sCreditsData->numMonToShow < NUM_MON_SLIDES)
{ {
for (j = sCreditsData->numMonToShow, page = 0; j < NUM_MON_SLIDES; j++) for (j = sCreditsData->numMonToShow, page = 0; j < NUM_MON_SLIDES; j++)
@@ -1609,7 +1609,7 @@ static void DeterminePokemonToShow(void)
if (page == sCreditsData->numMonToShow) if (page == sCreditsData->numMonToShow)
page = 0; page = 0;
} }
// Ensure the last pokemon is our starter // Ensure the last Pokémon is our starter
sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter; sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
} }
else else
@@ -1617,7 +1617,7 @@ static void DeterminePokemonToShow(void)
// Check to see if our starter has already appeared in this list, break if it has // Check to see if our starter has already appeared in this list, break if it has
for (dexNum = 0; sCreditsData->monToShow[dexNum] != starter && dexNum < NUM_MON_SLIDES; dexNum++); for (dexNum = 0; sCreditsData->monToShow[dexNum] != starter && dexNum < NUM_MON_SLIDES; dexNum++);
// If it has, swap it with the last pokemon, to ensure our starter is the last image // If it has, swap it with the last Pokémon, to ensure our starter is the last image
if (dexNum < sCreditsData->numMonToShow - 1) if (dexNum < sCreditsData->numMonToShow - 1)
{ {
sCreditsData->monToShow[dexNum] = sCreditsData->monToShow[NUM_MON_SLIDES-1]; sCreditsData->monToShow[dexNum] = sCreditsData->monToShow[NUM_MON_SLIDES-1];
@@ -1625,7 +1625,7 @@ static void DeterminePokemonToShow(void)
} }
else else
{ {
// Ensure the last pokemon is our starter // Ensure the last Pokémon is our starter
sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter; sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
} }
} }
@@ -4172,7 +4172,7 @@
FRONTIER_MON_##lastmon##_10,\ FRONTIER_MON_##lastmon##_10,\
-1 -1
// The strong Psychic M/F trainers all use the below pokemon // The strong Psychic M/F trainers all use the below Pokémon
// Additionally they use 1 of 3 legendary trios, and Latios or Latias depending on gender // Additionally they use 1 of 3 legendary trios, and Latios or Latias depending on gender
#define FRONTIER_MONS_PSYCHIC_2(lati, legend1, legend2, legend3) \ #define FRONTIER_MONS_PSYCHIC_2(lati, legend1, legend2, legend3) \
FRONTIER_MON_WOBBUFFET_1, \ FRONTIER_MON_WOBBUFFET_1, \
+1 -1
View File
@@ -171,7 +171,7 @@ static const u8 sDecorTilemap_3x2_X[] = {
0x06, 0x07, 0x06, 0x07, 0x06, 0x07 0x06, 0x07, 0x06, 0x07, 0x06, 0x07
}; };
#define DECORSIZE(width, height)((width) * (height) * 4) #define DECORSIZE(width, height) ((width) * (height) * 4)
static const struct { static const struct {
const u8 *tiles; const u8 *tiles;
+2 -2
View File
@@ -64,7 +64,7 @@ static const struct PartyMenuBoxInfoRects sPartyBoxInfoRects[] =
// Each layout array has an array for each of the 6 party slots // Each layout array has an array for each of the 6 party slots
// The array for each slot has the sprite coords of its various sprites in the following order // The array for each slot has the sprite coords of its various sprites in the following order
// Pokemon icon (x, y), held item (x, y), status condition (x, y), menu pokeball (x, y) // Pokémon icon (x, y), held item (x, y), status condition (x, y), menu Poké Ball (x, y)
static const u8 sPartyMenuSpriteCoords[PARTY_LAYOUT_COUNT][PARTY_SIZE][4 * 2] = static const u8 sPartyMenuSpriteCoords[PARTY_LAYOUT_COUNT][PARTY_SIZE][4 * 2] =
{ {
[PARTY_LAYOUT_SINGLE] = [PARTY_LAYOUT_SINGLE] =
@@ -902,7 +902,7 @@ static const struct CompressedSpritePalette sSpritePalette_MenuPokeball =
gPartyMenuPokeball_Pal, TAG_POKEBALL gPartyMenuPokeball_Pal, TAG_POKEBALL
}; };
// Used for the pokeball sprite on each party slot / Cancel button // Used for the Poké Ball sprite on each party slot / Cancel button
static const struct SpriteTemplate sSpriteTemplate_MenuPokeball = static const struct SpriteTemplate sSpriteTemplate_MenuPokeball =
{ {
.tileTag = TAG_POKEBALL, .tileTag = TAG_POKEBALL,
+6 -6
View File
@@ -1,10 +1,10 @@
#define SQUARE(n)(n * n) #define SQUARE(n) ((n) * (n))
#define CUBE(n)(n * n * n) #define CUBE(n) ((n) * (n) * (n))
#define EXP_SLOW(n)((5 * CUBE(n)) / 4) // (5 * (n)^3) / 4 #define EXP_SLOW(n) ((5 * CUBE(n)) / 4) // (5 * (n)^3) / 4
#define EXP_FAST(n)((4 * CUBE(n)) / 5) // (4 * (n)^3) / 5 #define EXP_FAST(n) ((4 * CUBE(n)) / 5) // (4 * (n)^3) / 5
#define EXP_MEDIUM_FAST(n)(CUBE(n)) // (n)^3 #define EXP_MEDIUM_FAST(n) (CUBE(n)) // (n)^3
#define EXP_MEDIUM_SLOW(n)((6 * CUBE(n)) / 5 - (15 * SQUARE(n)) + (100 * n) - 140) // (6 * (n)^3) / 5 - (15 * (n)^2) + (100 * n) - 140 #define EXP_MEDIUM_SLOW(n) ((6 * CUBE(n)) / 5 - (15 * SQUARE(n)) + (100 * n) - 140) // (6 * (n)^3) / 5 - (15 * (n)^2) + (100 * n) - 140
#define EXP_ERRATIC(n) \ #define EXP_ERRATIC(n) \
(n <= 50) ? ((100 - n) * CUBE(n) / 50) \ (n <= 50) ? ((100 - n) * CUBE(n) / 50) \
:(n <= 68) ? ((150 - n) * CUBE(n) / 100) \ :(n <= 68) ? ((150 - n) * CUBE(n) / 100) \
+1 -1
View File
@@ -25,7 +25,7 @@ const u16 gPokedexOrder_Alphabetical[] =
NATIONAL_DEX_OLD_UNOWN_X, NATIONAL_DEX_OLD_UNOWN_X,
NATIONAL_DEX_OLD_UNOWN_Y, NATIONAL_DEX_OLD_UNOWN_Y,
NATIONAL_DEX_OLD_UNOWN_Z, NATIONAL_DEX_OLD_UNOWN_Z,
// Actual pokemon start here. // Actual Pokémon start here.
NATIONAL_DEX_ABRA, NATIONAL_DEX_ABRA,
NATIONAL_DEX_ABSOL, NATIONAL_DEX_ABSOL,
NATIONAL_DEX_AERODACTYL, NATIONAL_DEX_AERODACTYL,
+4 -4
View File
@@ -633,10 +633,10 @@ static const struct WindowTemplate sWindowTemplate_BButtonCancel = {
// Minimum and maximum number of players for a link group // Minimum and maximum number of players for a link group
// A minimum of 0 means the min and max are equal // A minimum of 0 means the min and max are equal
#define LINK_GROUP_CAPACITY(min, max)(((min) << 12) | ((max) << 8)) #define LINK_GROUP_CAPACITY(min, max) (((min) << 12) | ((max) << 8))
#define GROUP_MAX(capacity)(capacity & 0x0F) #define GROUP_MAX(capacity) (capacity & 0x0F)
#define GROUP_MIN(capacity)(capacity >> 4) #define GROUP_MIN(capacity) (capacity >> 4)
#define GROUP_MIN2(capacity)(capacity & 0xF0) // Unnecessary to have both, but needed to match #define GROUP_MIN2(capacity) (capacity & 0xF0) // Unnecessary to have both, but needed to match
static const u32 sLinkGroupToActivityAndCapacity[NUM_LINK_GROUP_TYPES] = { static const u32 sLinkGroupToActivityAndCapacity[NUM_LINK_GROUP_TYPES] = {
[LINK_GROUP_SINGLE_BATTLE] = ACTIVITY_BATTLE_SINGLE | LINK_GROUP_CAPACITY(0, 2), [LINK_GROUP_SINGLE_BATTLE] = ACTIVITY_BATTLE_SINGLE | LINK_GROUP_CAPACITY(0, 2),

Some files were not shown because too many files have changed in this diff Show More