pret sync 2023/03/03 (#2801)

This commit is contained in:
Eduardo Quezada D'Ottone authored and GitHub committed 2023-03-03 16:29:30 -03:00
commit 33dc7cb13a
78 files changed
+608 -457

No files matched your search

+1
View File
@@ -142,6 +142,7 @@ ROMTESTHYDRA := tools/mgba-rom-test-hydra/mgba-rom-test-hydra$(EXE)
PERL := perl
# Inclusive list. If you don't want a tool to be built, don't add it here.
TOOLDIRS := tools/aif2pcm tools/bin2c tools/gbafix tools/gbagfx tools/jsonproc tools/mapjson tools/mid2agb tools/preproc tools/ramscrgen tools/rsfont tools/scaninc
CHECKTOOLDIRS = tools/patchelf tools/mgba-rom-test-hydra
TOOLBASE = $(TOOLDIRS:tools/%=%)
+6 -6
View File
@@ -1582,15 +1582,15 @@
.4byte \value
.endm
@ Sets the eventLegal bit for the Pokemon in the specified slot of the player's party.
.macro setmoneventlegal slot:req
@ Sets the modernFatefulEncounter bit for the Pokemon in the specified slot of the player's party.
.macro setmodernfatefulencounter slot:req
.byte 0xcd
.2byte \slot
.endm
@ Checks if the eventLegal bit is set for the Pokemon in the specified slot of the player's party. If it isn't set,
@ Checks if the modernFatefulEncounter bit is set for the Pokemon in the specified slot of the player's party. If it isn't set,
@ VAR_RESULT is TRUE. If the bit is set (or if the specified slot is empty or invalid), VAR_RESULT is FALSE.
.macro checkmoneventlegal slot:req
.macro checkmodernfatefulencounter slot:req
.byte 0xce
.2byte \slot
.endm
@@ -1938,12 +1938,12 @@
closebraillemessage
.endm
@ Creates an "event legal" Pokémon for an encounter
@ Creates a Pokémon with the modernFatefulEncounter bit set for an encounter
.macro seteventmon species:req, level:req, item=ITEM_NONE
setvar VAR_0x8004, \species
setvar VAR_0x8005, \level
setvar VAR_0x8006, \item
special CreateEventLegalEnemyMon
special CreateEnemyEventMon
.endm
@ Set up a totem boost for the next battle.
+22 -6
View File
@@ -19,11 +19,11 @@
.4byte \script
.endm
@ Defines an object event template for map data. Mirrors the struct layout of ObjectEventTemplate in include/global.fieldmap.h
.macro object_event index:req, gfx:req, inConnection:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req
@ Defines an object event template for map data, to be used by a normal object. Mirrors the struct layout of ObjectEventTemplate in include/global.fieldmap.h
.macro object_event index:req, gfx:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req
.byte \index
.byte \gfx
.byte \inConnection
.byte OBJ_KIND_NORMAL
.space 1 @ Padding
.2byte \x, \y
.byte \elevation
@@ -38,6 +38,22 @@
inc _num_npcs
.endm
@ Defines an object event template for map data, to be used by a clone object. Mirrors the struct layout of ObjectEventTemplate in include/global.fieldmap.h
@ NOTE: The handling for this type of event does not exist in Emerald by default; it is exclusive to FRLG.
.macro clone_event index:req, gfx:req, x:req, y:req, target_local_id:req, target_map_id:req
.byte \index
.byte \gfx
.byte OBJ_KIND_CLONE
.space 1 @ Padding
.2byte \x, \y
.byte \target_local_id
.space 3 @ Padding
.2byte \target_map_id & 0xFF @ map num
.2byte \target_map_id >> 8 @ map group
.space 8 @ Padding
inc _num_npcs
.endm
@ Defines a warp event for map data. Mirrors the struct layout of WarpEvent in include/global.fieldmap.h
.macro warp_def x:req, y:req, elevation:req, warpId:req, map_id:req
.2byte \x, \y
@@ -49,12 +65,12 @@
.endm
@ Defines a coord event for map data. Mirrors the struct layout of CoordEvent in include/global.fieldmap.h
.macro coord_event x:req, y:req, elevation:req, trigger:req, index:req, script:req
.macro coord_event x:req, y:req, elevation:req, var:req, varValue:req, script:req
.2byte \x, \y
.byte \elevation
.space 1 @ Padding
.2byte \trigger
.2byte \index
.2byte \var
.2byte \varValue
.space 2 @ Padding
.4byte \script
inc _num_traps
+1 -1
View File
@@ -168,7 +168,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "PetalburgWoods_EventScript_ItemParalyzeHeal",
"flag": "FLAG_ITEM_PETALBURD_WOODS_PARALYZE_HEAL"
"flag": "FLAG_ITEM_PETALBURG_WOODS_PARALYZE_HEAL"
},
{
"graphics_id": "OBJ_EVENT_GFX_GIRL_2",
+1 -1
View File
@@ -288,7 +288,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "Route110_EventScript_ItemRareCandy",
"flag": "FLAG_ITEM_ROUTE_109_RARE_CANDY"
"flag": "FLAG_ITEM_ROUTE_110_RARE_CANDY"
},
{
"graphics_id": "OBJ_EVENT_GFX_CYCLING_TRIATHLETE_M",
+1 -1
View File
@@ -503,7 +503,7 @@
"y": 30,
"elevation": 3,
"item": "ITEM_REVIVE",
"flag": "FLAG_HIDDEN_ITEM_ROUTE_113_REVIVE"
"flag": "FLAG_HIDDEN_ITEM_ROUTE_114_REVIVE"
}
]
}
+2 -2
View File
@@ -205,8 +205,8 @@ gScriptCmdTable::
.4byte ScrCmd_nop1 @ 0xca
.4byte ScrCmd_nop1 @ 0xcb
.4byte ScrCmd_nop1 @ 0xcc
.4byte ScrCmd_setmoneventlegal @ 0xcd
.4byte ScrCmd_checkmoneventlegal @ 0xce
.4byte ScrCmd_setmonmodernfatefulencounter @ 0xcd
.4byte ScrCmd_checkmonmodernfatefulencounter @ 0xce
.4byte ScrCmd_trywondercardscript @ 0xcf
.4byte ScrCmd_nop1 @ 0xd0
.4byte ScrCmd_warpspinenter @ 0xd1
+1 -1
View File
@@ -29,7 +29,7 @@ SurfPichu_FullParty:
SurfPichu_GiveEgg:
giveegg SPECIES_PICHU
setmoneventlegal VAR_GIFT_PICHU_SLOT
setmodernfatefulencounter VAR_GIFT_PICHU_SLOT
setmonmetlocation VAR_GIFT_PICHU_SLOT, METLOC_FATEFUL_ENCOUNTER
vgoto_if_eq VAR_GIFT_PICHU_SLOT, 1, SurfPichu_Slot1
vgoto_if_eq VAR_GIFT_PICHU_SLOT, 2, SurfPichu_Slot2
+1 -1
View File
@@ -489,7 +489,7 @@ gSpecials::
def_special ScrollableMultichoice_ClosePersistentMenu
def_special DoDeoxysRockInteraction
def_special SetDeoxysRockPalette
def_special CreateEventLegalEnemyMon
def_special CreateEnemyEventMon
def_special StartMirageTowerDisintegration
def_special StartMirageTowerShake
def_special StartMirageTowerFossilFallAndSink
Binary file not shown.
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
156 205 98
156 205 98
156 205 98
131 205 131
156 205 0
24 0 106
156 8 98
0 213 131
24 197 0
164 8 106
156 8 98
164 8 106
156 205 131
24 213 98
156 8 106
164 205 98
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
0 0 255
0 255 255
148 255 255
148 205 255
148 156 255
0 0 0
0 0 0
0 0 0
255 0 8
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
255 255 255
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 177 B

-19
View File
@@ -1,19 +0,0 @@
JASC-PAL
0100
16
156 197 98
41 131 222
0 82 172
197 255 106
172 230 49
246 246 213
255 49 49
255 148 148
131 164 213
238 238 90
65 65 65
115 115 115
172 172 172
230 230 255
0 0 0
255 255 255
+1 -1
View File
@@ -853,7 +853,7 @@ struct MonSpritesGfx
u8 *byte[MAX_BATTLERS_COUNT];
} sprites;
struct SpriteTemplate templates[MAX_BATTLERS_COUNT];
struct SpriteFrameImage frameImages[MAX_BATTLERS_COUNT][4];
struct SpriteFrameImage frameImages[MAX_BATTLERS_COUNT][MAX_MON_PIC_FRAMES];
u8 unusedArr[0x80];
u8 *barFontGfx;
void *unusedPtr;
+3
View File
@@ -288,6 +288,9 @@
#define FIRST_DECORATION_SPRITE_GFX OBJ_EVENT_GFX_PICHU_DOLL
#define OBJ_KIND_NORMAL 0
#define OBJ_KIND_CLONE 255 // Exclusive to FRLG
// Special object event local ids
#define OBJ_EVENT_ID_PLAYER 0xFF
#define OBJ_EVENT_ID_CAMERA 0x7F
+3 -3
View File
@@ -580,7 +580,7 @@
#define FLAG_HIDDEN_ITEM_ROUTE_121_HP_UP (FLAG_HIDDEN_ITEMS_START + 0x27)
#define FLAG_HIDDEN_ITEM_ROUTE_121_NUGGET (FLAG_HIDDEN_ITEMS_START + 0x28)
#define FLAG_HIDDEN_ITEM_ROUTE_123_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x29)
#define FLAG_HIDDEN_ITEM_ROUTE_113_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x2A)
#define FLAG_HIDDEN_ITEM_ROUTE_114_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x2A)
#define FLAG_HIDDEN_ITEM_LILYCOVE_CITY_PP_UP (FLAG_HIDDEN_ITEMS_START + 0x2B)
#define FLAG_HIDDEN_ITEM_ROUTE_104_SUPER_POTION (FLAG_HIDDEN_ITEMS_START + 0x2C)
#define FLAG_HIDDEN_ITEM_ROUTE_116_SUPER_POTION (FLAG_HIDDEN_ITEMS_START + 0x2D)
@@ -1051,7 +1051,7 @@
#define FLAG_ITEM_ROUTE_105_IRON 0x3EB
#define FLAG_ITEM_ROUTE_106_PROTEIN 0x3EC
#define FLAG_ITEM_ROUTE_109_PP_UP 0x3ED
#define FLAG_ITEM_ROUTE_109_RARE_CANDY 0x3EE
#define FLAG_ITEM_ROUTE_110_RARE_CANDY 0x3EE
#define FLAG_ITEM_ROUTE_110_DIRE_HIT 0x3EF
#define FLAG_ITEM_ROUTE_111_TM37 0x3F0
#define FLAG_ITEM_ROUTE_111_STARDUST 0x3F1
@@ -1162,7 +1162,7 @@
#define FLAG_ITEM_ROUTE_103_GUARD_SPEC 0x45A
#define FLAG_ITEM_ROUTE_104_X_ACCURACY 0x45B
#define FLAG_ITEM_MAUVILLE_CITY_X_SPEED 0x45C
#define FLAG_ITEM_PETALBURD_WOODS_PARALYZE_HEAL 0x45D
#define FLAG_ITEM_PETALBURG_WOODS_PARALYZE_HEAL 0x45D
#define FLAG_ITEM_ROUTE_115_GREAT_BALL 0x45E
#define FLAG_ITEM_SAFARI_ZONE_NORTH_CALCIUM 0x45F
#define FLAG_ITEM_MT_PYRE_3F_SUPER_REPEL 0x460
+8
View File
@@ -331,6 +331,14 @@
#define MON_PIC_HEIGHT 64
#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2)
// Most pokemon have 2 frames (a default and an alternate for their animation).
// There are 4 exceptions:
// - Castform has 4 frames, 1 for each form
// - Deoxys has 2 frames, 1 for each form
// - Spinda has 1 frame, presumably to avoid the work of animating its spots
// - Unown has 1 frame, presumably to avoid the work of animating all 28 of its forms
#define MAX_MON_PIC_FRAMES 4
#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
#define BATTLE_ALIVE_ATK_SIDE 1
#define BATTLE_ALIVE_DEF_SIDE 2
+7
View File
@@ -7,6 +7,13 @@
#define MAX_TRAINER_ITEMS 4
#define TRAINER_PIC_WIDTH 64
#define TRAINER_PIC_HEIGHT 64
#define TRAINER_PIC_SIZE (TRAINER_PIC_WIDTH * TRAINER_PIC_HEIGHT / 2)
// Red and Leaf's back pics have 5 frames, but this is presumably irrelevant in the places this is used.
#define MAX_TRAINER_PIC_FRAMES 4
enum {
BATTLER_AFFINE_NORMAL,
BATTLER_AFFINE_EMERGE,
+1 -1
View File
@@ -67,7 +67,7 @@ struct ObjectEventTemplate
{
/*0x00*/ u8 localId;
/*0x01*/ u8 graphicsId;
/*0x02*/ u8 inConnection; // Leftover from FRLG
/*0x02*/ u8 kind; // Always OBJ_KIND_NORMAL in Emerald.
/*0x03*/ //u8 padding1;
/*0x04*/ s16 x;
/*0x06*/ s16 y;
+4 -4
View File
@@ -10359,10 +10359,10 @@ extern const u32 gUsePokeblockCondition_Gfx[];
extern const u16 gUnionRoomChat_Background_Pal[];
extern const u32 gUnionRoomChat_Background_Gfx[];
extern const u32 gUnionRoomChat_Background_Tilemap[];
extern const u16 gUnionRoomChat_Window_Pal1[];
extern const u16 gUnionRoomChat_Window_Pal2[];
extern const u32 gUnionRoomChat_Border_Gfx[];
extern const u32 gUnionRoomChat_Border_Tilemap[];
extern const u16 gUnionRoomChat_InputText_Pal[];
extern const u16 gUnionRoomChat_Keyboard_Pal[];
extern const u32 gUnionRoomChat_Keyboard_Gfx[];
extern const u32 gUnionRoomChat_Keyboard_Tilemap[];
extern const u32 gUnionRoomChat_RButtonLabels[];
// Use Pokeblock
+30 -24
View File
@@ -75,7 +75,7 @@ enum {
MON_DATA_SPATK,
MON_DATA_SPDEF,
MON_DATA_MAIL,
MON_DATA_SPECIES2,
MON_DATA_SPECIES_OR_EGG,
MON_DATA_IVS,
MON_DATA_CHAMPION_RIBBON,
MON_DATA_WINNING_RIBBON,
@@ -90,7 +90,7 @@ enum {
MON_DATA_EARTH_RIBBON,
MON_DATA_WORLD_RIBBON,
MON_DATA_UNUSED_RIBBONS,
MON_DATA_EVENT_LEGAL,
MON_DATA_MODERN_FATEFUL_ENCOUNTER,
MON_DATA_KNOWN_MOVES,
MON_DATA_RIBBON_COUNT,
MON_DATA_RIBBONS,
@@ -153,27 +153,34 @@ struct PokemonSubstruct3
/* 0x07 */ u32 isEgg:1;
/* 0x07 */ u32 unused2:1;
/* 0x08 */ u32 coolRibbon:3;
/* 0x08 */ u32 beautyRibbon:3;
/* 0x08 */ u32 cuteRibbon:3;
/* 0x09 */ u32 smartRibbon:3;
/* 0x09 */ u32 toughRibbon:3;
/* 0x09 */ u32 championRibbon:1;
/* 0x0A */ u32 winningRibbon:1;
/* 0x0A */ u32 victoryRibbon:1;
/* 0x0A */ u32 artistRibbon:1;
/* 0x0A */ u32 effortRibbon:1;
/* 0x0A */ u32 marineRibbon:1; // never distributed
/* 0x0A */ u32 landRibbon:1; // never distributed
/* 0x0A */ u32 skyRibbon:1; // never distributed
/* 0x0A */ u32 countryRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners
/* 0x0B */ u32 nationalRibbon:1;
/* 0x0B */ u32 earthRibbon:1;
/* 0x0B */ u32 worldRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners
/* 0x0B */ u32 unusedRibbons:2; // discarded in Gen 4
/* 0x08 */ u32 coolRibbon:3; // Stores the highest contest rank achieved in the Cool category.
/* 0x08 */ u32 beautyRibbon:3; // Stores the highest contest rank achieved in the Beauty category.
/* 0x08 */ u32 cuteRibbon:3; // Stores the highest contest rank achieved in the Cute category.
/* 0x09 */ u32 smartRibbon:3; // Stores the highest contest rank achieved in the Smart category.
/* 0x09 */ u32 toughRibbon:3; // Stores the highest contest rank achieved in the Tough category.
/* 0x09 */ u32 championRibbon:1; // Given when defeating the Champion. Because both RSE and FRLG use it, later generations don't specify from which region it comes from.
/* 0x0A */ u32 winningRibbon:1; // Given at the Battle Tower's Level 50 challenge by winning a set of seven battles that extends the current streak to 56 or more.
/* 0x0A */ u32 victoryRibbon:1; // Given at the Battle Tower's Level 100 challenge by winning a set of seven battles that extends the current streak to 56 or more.
/* 0x0A */ u32 artistRibbon:1; // Given at the Contest Hall by winning a Master Rank contest with at least 800 points, and agreeing to have the Pokémon's portrait placed in the museum after being offered.
/* 0x0A */ u32 effortRibbon:1; // Given at Slateport's market to Pokémon with maximum EVs.
/* 0x0A */ u32 marineRibbon:1; // Never distributed.
/* 0x0A */ u32 landRibbon:1; // Never distributed.
/* 0x0A */ u32 skyRibbon:1; // Never distributed.
/* 0x0A */ u32 countryRibbon:1; // Distributed during Pokémon Festa '04 and '05 to tournament winners.
/* 0x0B */ u32 nationalRibbon:1; // Given to purified Shadow Pokémon in Colosseum/XD.
/* 0x0B */ u32 earthRibbon:1; // Given to teams that have beaten Mt. Battle's 100-battle challenge in Colosseum/XD.
/* 0x0B */ u32 worldRibbon:1; // Distributed during Pokémon Festa '04 and '05 to tournament winners.
/* 0x0B */ u32 unusedRibbons:2; // Discarded in Gen 4.
/* 0x0B */ u32 abilityNum:2;
/* 0x0B */ u32 eventLegal:1; // controls Mew & Deoxys obedience; if set, Pokémon is a fateful encounter in Gen 4+; set for in-game event island legendaries, some distributed events, and Pokémon from XD: Gale of Darkness.
}; /* size = 12 */
// The functionality of this bit changed in FRLG:
// In RS, this bit does nothing, is never set, & is accidentally unset when hatching Eggs.
// In FRLG & Emerald, this controls Mew & Deoxys obedience and whether they can be traded.
// If set, a Pokémon is a fateful encounter in FRLG's summary screen if hatched & for all Pokémon in Gen 4+ summary screens.
// Set for in-game event island legendaries, events distributed after a certain date, & Pokémon from XD: Gale of Darkness.
// Not to be confused with METLOC_FATEFUL_ENCOUNTER.
/* 0x0B */ u32 modernFatefulEncounter:1;
};
// Number of bytes in the largest Pokémon substruct.
// They are assumed to be the same size, and will be padded to
@@ -425,11 +432,10 @@ void CreateBattleTowerMon_HandleLevel(struct Pokemon *mon, struct BattleTowerPok
void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId);
void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId);
void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest);
void CreateEventLegalMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId);
u16 GetUnionRoomTrainerPic(void);
u16 GetUnionRoomTrainerClass(void);
void CreateEventLegalEnemyMon(void);
void CreateEnemyEventMon(void);
void CalculateMonStats(struct Pokemon *mon);
void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest);
u8 GetLevelFromMonExp(struct Pokemon *mon);
+2 -2
View File
@@ -12,8 +12,8 @@ extern const struct WindowTemplate gTradeEvolutionSceneYesNoWindowTemplate;
s32 GetGameProgressForLinkTrade(void);
void CB2_StartCreateTradeMenu(void);
void CB2_LinkTrade(void);
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal);
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal);
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isModernFatefulEncounter);
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isModernFatefulEncounter);
int CanSpinTradeMon(struct Pokemon *, u16);
void InitTradeSequenceBgGpuRegs(void);
void LinkTradeDrawWindow(void);
+1
View File
@@ -1,5 +1,6 @@
MAKEFLAGS += --no-print-directory
# Inclusive list. If you don't want a tool to be built, don't add it here.
TOOLDIRS := tools/aif2pcm tools/bin2c tools/gbafix tools/gbagfx tools/jsonproc tools/mapjson tools/mid2agb tools/preproc tools/ramscrgen tools/rsfont tools/scaninc
.PHONY: all $(TOOLDIRS)
+12 -12
View File
@@ -112,9 +112,9 @@ static bool8 ShouldSwitchIfWonderGuard(void)
{
if (GetMonData(&party[i], MON_DATA_HP) == 0)
continue;
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
continue;
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
continue;
if (i == gBattlerPartyIndexes[gActiveBattler])
continue;
@@ -198,9 +198,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
if (GetMonData(&party[i], MON_DATA_HP) == 0)
continue;
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
continue;
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
continue;
if (i == gBattlerPartyIndexes[battlerIn1])
continue;
@@ -295,8 +295,8 @@ static bool8 ShouldSwitchIfGameStatePrompt(void)
//Look for mon in party that is able to be switched into and has ability that sets terrain
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& i != gBattlerPartyIndexes[gActiveBattler]
&& i != gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]
&& IsBattlerGrounded(gActiveBattler)
@@ -570,9 +570,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent)
if (GetMonData(&party[i], MON_DATA_HP) == 0)
continue;
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
continue;
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
continue;
if (i == gBattlerPartyIndexes[battlerIn1])
continue;
@@ -662,9 +662,9 @@ bool32 ShouldSwitch(void)
{
if (GetMonData(&party[i], MON_DATA_HP) == 0)
continue;
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
continue;
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
continue;
if (i == gBattlerPartyIndexes[battlerIn1])
continue;
@@ -1066,8 +1066,8 @@ static bool8 ShouldUseItem(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
{
validMons++;
}
+4 -4
View File
@@ -3375,8 +3375,8 @@ s32 CountUsablePartyMons(u8 battlerId)
{
if (i != battlerOnField1 && i != battlerOnField2
&& GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
{
ret++;
}
@@ -3399,8 +3399,8 @@ bool32 IsPartyFullyHealedExceptBattler(u8 battlerId)
{
if (i != gBattlerPartyIndexes[battlerId]
&& GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& GetMonData(&party[i], MON_DATA_HP) < GetMonData(&party[i], MON_DATA_MAX_HP))
return FALSE;
}
+1 -1
View File
@@ -3059,7 +3059,7 @@ void AnimTask_LoadMusicNotesPals(u8 taskId)
for (i = 1; i < NUM_MUSIC_NOTE_PAL_TAGS; i++)
paletteNums[i] = AllocSpritePalette(ANIM_SPRITES_START - i);
gMonSpritesGfxPtr->buffer = AllocZeroed(0x2000);
gMonSpritesGfxPtr->buffer = AllocZeroed(MON_PIC_SIZE * MAX_MON_PIC_FRAMES);
LZDecompressWram(gBattleAnimSpritePal_MusicNotes2, gMonSpritesGfxPtr->buffer);
for (i = 0; i < NUM_MUSIC_NOTE_PAL_TAGS; i++)
LoadPalette(&gMonSpritesGfxPtr->buffer[i * 32], (u16)(OBJ_PLTT_ID(paletteNums[i])), PLTT_SIZE_4BPP);
+1 -1
View File
@@ -2138,7 +2138,7 @@ u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16
u16 palette = AllocSpritePalette(sSpriteTemplates_MoveEffectMons[id].paletteTag);
if (gMonSpritesGfxPtr != NULL && gMonSpritesGfxPtr->buffer == NULL)
gMonSpritesGfxPtr->buffer = AllocZeroed(0x2000);
gMonSpritesGfxPtr->buffer = AllocZeroed(MON_PIC_SIZE * MAX_MON_PIC_FRAMES);
if (!isBackpic)
{
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), OBJ_PLTT_ID(palette), PLTT_SIZE_4BPP);
+1 -1
View File
@@ -906,7 +906,7 @@ void AnimTask_GetFieldTerrain(u8 taskId)
void AnimTask_AllocBackupPalBuffer(u8 taskId)
{
gMonSpritesGfxPtr->buffer = AllocZeroed(0x2000);
gMonSpritesGfxPtr->buffer = AllocZeroed(MON_PIC_SIZE * MAX_MON_PIC_FRAMES);
DestroyAnimVisualTask(taskId);
}
+2 -2
View File
@@ -589,10 +589,10 @@ static void InitLinkBtlControllers(void)
bool32 IsValidForBattle(struct Pokemon *mon)
{
u32 species = GetMonData(mon, MON_DATA_SPECIES2);
u32 species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
return (species != SPECIES_NONE && species != SPECIES_EGG
&& GetMonData(mon, MON_DATA_HP) != 0
&& GetMonData(mon, MON_DATA_IS_EGG) == 0);
&& GetMonData(mon, MON_DATA_IS_EGG) == FALSE);
}
static void SetBattlePartyIds(void)
+7 -7
View File
@@ -626,7 +626,7 @@ static void CB2_InitBattleInternal(void)
#define BUFFER_PARTY_VS_SCREEN_STATUS(party, flags, i) \
for ((i) = 0; (i) < PARTY_SIZE; (i)++) \
{ \
u16 species = GetMonData(&(party)[(i)], MON_DATA_SPECIES2); \
u16 species = GetMonData(&(party)[(i)], MON_DATA_SPECIES_OR_EGG); \
u16 hp = GetMonData(&(party)[(i)], MON_DATA_HP); \
u32 status = GetMonData(&(party)[(i)], MON_DATA_STATUS); \
\
@@ -3443,8 +3443,8 @@ static void DoBattleIntro(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatus[i].hp = HP_EMPTY_SLOT;
hpStatus[i].status = 0;
@@ -3462,8 +3462,8 @@ static void DoBattleIntro(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatus[i].hp = HP_EMPTY_SLOT;
hpStatus[i].status = 0;
@@ -5257,8 +5257,8 @@ static void HandleEndTurn_FinishBattle(void)
// Recalculate the stats of every party member before the end
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
{
CalculateMonStats(&gPlayerParty[i]);
}
+1 -1
View File
@@ -3895,7 +3895,7 @@ static u32 GetEnemyMonCount(u32 firstId, u32 lastId, bool32 onlyAlive)
for (i = firstId; i < lastId; i++)
{
u32 species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2, NULL);
u32 species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG, NULL);
if (species != SPECIES_NONE
&& species != SPECIES_EGG
&& (!onlyAlive || GetMonData(&gEnemyParty[i], MON_DATA_HP, NULL)))
+11 -11
View File
@@ -7511,8 +7511,8 @@ static void Cmd_getmoneyreward(void)
s32 i, count;
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) > sPartyLevel)
sPartyLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
@@ -7607,8 +7607,8 @@ static void Cmd_drawpartystatussummary(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatuses[i].hp = 0xFFFF;
hpStatuses[i].status = 0;
@@ -8650,7 +8650,7 @@ static bool32 CanTeleport(u8 battlerId)
for (i = 0; i < PARTY_SIZE; i++)
{
species = GetMonData(&party[i], MON_DATA_SPECIES2);
species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE && species != SPECIES_EGG && GetMonData(&party[i], MON_DATA_HP) != 0)
count++;
}
@@ -13463,7 +13463,7 @@ static void Cmd_healpartystatus(void)
for (i = 0; i < PARTY_SIZE; i++)
{
u16 species = GetMonData(&party[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG);
u8 abilityNum = GetMonData(&party[i], MON_DATA_ABILITY_NUM);
if (species != SPECIES_NONE && species != SPECIES_EGG)
@@ -14075,8 +14075,8 @@ static void Cmd_trydobeatup(void)
for (;gBattleCommunication[0] < PARTY_SIZE; gBattleCommunication[0]++)
{
if (GetMonData(&party[gBattleCommunication[0]], MON_DATA_HP)
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2)
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&party[gBattleCommunication[0]], MON_DATA_STATUS))
break;
}
@@ -14764,9 +14764,9 @@ static void Cmd_assistattackselect(void)
{
if (monId == gBattlerPartyIndexes[gBattlerAttacker])
continue;
if (GetMonData(&party[monId], MON_DATA_SPECIES2) == SPECIES_NONE)
if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
continue;
if (GetMonData(&party[monId], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
continue;
for (moveId = 0; moveId < MAX_MON_MOVES; moveId++)
@@ -14997,7 +14997,7 @@ static void Cmd_pickup(void)
bool32 isInPyramid = InBattlePyramid_();
for (i = 0; i < PARTY_SIZE; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
lvlDivBy10 = (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL)-1) / 10; //Moving this here makes it easier to add in abilities like Honey Gather.
if (lvlDivBy10 > 9)
+1 -1
View File
@@ -741,7 +741,7 @@ static u16 GetSumOfPlayerPartyLevel(u8 numMons)
for (i = 0; i < PARTY_SIZE; i++)
{
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_EGG && species != SPECIES_NONE && GetMonData(&gPlayerParty[i], MON_DATA_HP) != 0)
{
+1 -1
View File
@@ -3381,7 +3381,7 @@ s32 GetHighestLevelInPlayerParty(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_EGG)
{
s32 level = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL, NULL);
if (level > highestLevel)
+13 -13
View File
@@ -3929,8 +3929,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& i != partyIdBattlerOn1 && i != partyIdBattlerOn2
&& i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId])
break;
@@ -3948,8 +3948,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
break;
}
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
@@ -3988,8 +3988,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
break;
}
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
@@ -4006,8 +4006,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = playerId; i < playerId + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
break;
}
return (i == playerId + 3);
@@ -4035,8 +4035,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& i != partyIdBattlerOn1 && i != partyIdBattlerOn2
&& i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId])
break;
@@ -8029,14 +8029,14 @@ u32 GetMoveTarget(u16 move, u8 setTarget)
return targetBattler;
}
static bool32 IsMonEventLegal(u8 battlerId)
static bool32 IsBattlerModernFatefulEncounter(u8 battlerId)
{
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)
return TRUE;
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS
&& GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_MEW)
return TRUE;
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_EVENT_LEGAL, NULL);
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_MODERN_FATEFUL_ENCOUNTER, NULL);
}
u8 IsMonDisobedient(void)
@@ -8051,7 +8051,7 @@ u8 IsMonDisobedient(void)
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT)
return 0;
if (IsMonEventLegal(gBattlerAttacker)) // only false if illegal Mew or Deoxys
if (IsBattlerModernFatefulEncounter(gBattlerAttacker)) // only false if illegal Mew or Deoxys
{
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gBattlerAttacker) == 2)
return 0;
+6 -6
View File
@@ -863,23 +863,23 @@ static u8 Bike_DPadToDirection(u16 heldKeys)
static u8 GetBikeCollision(u8 direction)
{
u8 metatitleBehavior;
u8 metatileBehavior;
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
s16 x = playerObjEvent->currentCoords.x;
s16 y = playerObjEvent->currentCoords.y;
MoveCoords(direction, &x, &y);
metatitleBehavior = MapGridGetMetatileBehaviorAt(x, y);
return GetBikeCollisionAt(playerObjEvent, x, y, direction, metatitleBehavior);
metatileBehavior = MapGridGetMetatileBehaviorAt(x, y);
return GetBikeCollisionAt(playerObjEvent, x, y, direction, metatileBehavior);
}
static u8 GetBikeCollisionAt(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatitleBehavior)
static u8 GetBikeCollisionAt(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior)
{
u8 collision = CheckForObjectEventCollision(objectEvent, x, y, direction, metatitleBehavior);
u8 collision = CheckForObjectEventCollision(objectEvent, x, y, direction, metatileBehavior);
if (collision > COLLISION_OBJECT_EVENT)
return collision;
if (collision == COLLISION_NONE && IsRunningDisallowedByMetatile(metatitleBehavior))
if (collision == COLLISION_NONE && IsRunningDisallowedByMetatile(metatileBehavior))
collision = COLLISION_IMPASSABLE;
if (collision)
+2 -2
View File
@@ -93,11 +93,11 @@ bool8 CheckRelicanthWailord(void)
{
// Emerald change: why did they flip it?
// First comes Wailord
if (GetMonData(&gPlayerParty[0], MON_DATA_SPECIES2, 0) == SPECIES_WAILORD)
if (GetMonData(&gPlayerParty[0], MON_DATA_SPECIES_OR_EGG, 0) == SPECIES_WAILORD)
{
CalculatePlayerPartyCount();
// Last comes Relicanth
if (GetMonData(&gPlayerParty[gPlayerPartyCount - 1], MON_DATA_SPECIES2, 0) == SPECIES_RELICANTH)
if (GetMonData(&gPlayerParty[gPlayerPartyCount - 1], MON_DATA_SPECIES_OR_EGG, 0) == SPECIES_RELICANTH)
return TRUE;
}
return FALSE;
+35 -35
View File
@@ -48,68 +48,68 @@ const struct SpriteFrameImage gBattlerPicTable_OpponentRight[] =
const struct SpriteFrameImage gTrainerBackPicTable_Brendan[] =
{
gTrainerBackPic_Brendan, 0x0800,
gTrainerBackPic_Brendan + 0x0800, 0x0800,
gTrainerBackPic_Brendan + 0x1000, 0x0800,
gTrainerBackPic_Brendan + 0x1800, 0x0800,
gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
};
const struct SpriteFrameImage gTrainerBackPicTable_May[] =
{
gTrainerBackPic_May, 0x0800,
gTrainerBackPic_May + 0x0800, 0x0800,
gTrainerBackPic_May + 0x1000, 0x0800,
gTrainerBackPic_May + 0x1800, 0x0800,
gTrainerBackPic_May + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
gTrainerBackPic_May + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
gTrainerBackPic_May + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
gTrainerBackPic_May + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
};
const struct SpriteFrameImage gTrainerBackPicTable_Red[] =
{
gTrainerBackPic_Red, 0x0800,
gTrainerBackPic_Red + 0x0800, 0x0800,
gTrainerBackPic_Red + 0x1000, 0x0800,
gTrainerBackPic_Red + 0x1800, 0x0800,
gTrainerBackPic_Red + 0x2000, 0x0800,
gTrainerBackPic_Red + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
gTrainerBackPic_Red + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
gTrainerBackPic_Red + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
gTrainerBackPic_Red + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
gTrainerBackPic_Red + TRAINER_PIC_SIZE * 4, TRAINER_PIC_SIZE,
};
const struct SpriteFrameImage gTrainerBackPicTable_Leaf[] =
{
gTrainerBackPic_Leaf, 0x0800,
gTrainerBackPic_Leaf + 0x0800, 0x0800,
gTrainerBackPic_Leaf + 0x1000, 0x0800,
gTrainerBackPic_Leaf + 0x1800, 0x0800,
gTrainerBackPic_Leaf + 0x2000, 0x0800,
gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 4, TRAINER_PIC_SIZE,
};
const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireBrendan[] =
{
gTrainerBackPic_RubySapphireBrendan, 0x0800,
gTrainerBackPic_RubySapphireBrendan + 0x0800, 0x0800,
gTrainerBackPic_RubySapphireBrendan + 0x1000, 0x0800,
gTrainerBackPic_RubySapphireBrendan + 0x1800, 0x0800,
gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
};
const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireMay[] =
{
gTrainerBackPic_RubySapphireMay, 0x0800,
gTrainerBackPic_RubySapphireMay + 0x0800, 0x0800,
gTrainerBackPic_RubySapphireMay + 0x1000, 0x0800,
gTrainerBackPic_RubySapphireMay + 0x1800, 0x0800,
gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
};
const struct SpriteFrameImage gTrainerBackPicTable_Wally[] =
{
gTrainerBackPic_Wally, 0x0800,
gTrainerBackPic_Wally + 0x0800, 0x0800,
gTrainerBackPic_Wally + 0x1000, 0x0800,
gTrainerBackPic_Wally + 0x1800, 0x0800,
gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
};
const struct SpriteFrameImage gTrainerBackPicTable_Steven[] =
{
gTrainerBackPic_Steven, 0x0800,
gTrainerBackPic_Steven + 0x0800, 0x0800,
gTrainerBackPic_Steven + 0x1000, 0x0800,
gTrainerBackPic_Steven + 0x1800, 0x0800,
gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
};
static const union AnimCmd sAnim_GeneralFrame0[] =
@@ -290,7 +290,7 @@ static const union AnimCmd sAnim_MonPic_3[] =
ANIMCMD_END,
};
const union AnimCmd *const gAnims_MonPic[] =
const union AnimCmd *const gAnims_MonPic[MAX_MON_PIC_FRAMES] =
{
sAnim_MonPic_0,
sAnim_MonPic_1,
+40 -10
View File
@@ -13,18 +13,48 @@ const struct MonCoords gTrainerBackPicCoords[] =
// this table goes functionally unused, since none of these pics are compressed
// and the place they would get extracted to gets overwritten later anyway
// the casts are so they'll play nice with the strict struct definition
#define TRAINER_BACK_SPRITE(trainerPic, sprite, size) [TRAINER_BACK_PIC_##trainerPic] = {(const u32 *)sprite, size, TRAINER_BACK_PIC_##trainerPic}
const struct CompressedSpriteSheet gTrainerBackPicTable[] =
{
TRAINER_BACK_SPRITE(BRENDAN, gTrainerBackPic_Brendan, 0x2000),
TRAINER_BACK_SPRITE(MAY, gTrainerBackPic_May, 0x2000),
TRAINER_BACK_SPRITE(RED, gTrainerBackPic_Red, 0x2800),
TRAINER_BACK_SPRITE(LEAF, gTrainerBackPic_Leaf, 0x2800),
TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_BRENDAN, gTrainerBackPic_RubySapphireBrendan, 0x2000),
TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_MAY, gTrainerBackPic_RubySapphireMay, 0x2000),
TRAINER_BACK_SPRITE(WALLY, gTrainerBackPic_Wally, 0x2000),
TRAINER_BACK_SPRITE(STEVEN, gTrainerBackPic_Steven, 0x2000),
[TRAINER_BACK_PIC_BRENDAN] = {
.data = (const u32 *)gTrainerBackPic_Brendan,
.size = TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_Brendan),
.tag = TRAINER_BACK_PIC_BRENDAN,
},
[TRAINER_BACK_PIC_MAY] = {
.data = (const u32 *)gTrainerBackPic_May,
.size = TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_May),
.tag = TRAINER_BACK_PIC_MAY,
},
[TRAINER_BACK_PIC_RED] = {
.data = (const u32 *)gTrainerBackPic_Red,
.size = TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_Red),
.tag = TRAINER_BACK_PIC_RED,
},
[TRAINER_BACK_PIC_LEAF] = {
.data = (const u32 *)gTrainerBackPic_Leaf,
.size = TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_Leaf),
.tag = TRAINER_BACK_PIC_LEAF,
},
[TRAINER_BACK_PIC_RUBY_SAPPHIRE_BRENDAN] = {
.data = (const u32 *)gTrainerBackPic_RubySapphireBrendan,
.size = TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_RubySapphireBrendan),
.tag = TRAINER_BACK_PIC_RUBY_SAPPHIRE_BRENDAN,
},
[TRAINER_BACK_PIC_RUBY_SAPPHIRE_MAY] = {
.data = (const u32 *)gTrainerBackPic_RubySapphireMay,
.size = TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_RubySapphireMay),
.tag = TRAINER_BACK_PIC_RUBY_SAPPHIRE_MAY,
},
[TRAINER_BACK_PIC_WALLY] = {
.data = (const u32 *)gTrainerBackPic_Wally,
.size = TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_Wally),
.tag = TRAINER_BACK_PIC_WALLY,
},
[TRAINER_BACK_PIC_STEVEN] = {
.data = (const u32 *)gTrainerBackPic_Steven,
.size = TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_Steven),
.tag = TRAINER_BACK_PIC_STEVEN,
},
};
#define TRAINER_BACK_PAL(trainerPic, pal) [TRAINER_BACK_PIC_##trainerPic] = {pal, TRAINER_BACK_PIC_##trainerPic}
+93 -93
View File
@@ -99,99 +99,99 @@ const struct MonCoords gTrainerFrontPicCoords[] =
const struct CompressedSpriteSheet gTrainerFrontPicTable[] =
{
TRAINER_SPRITE(HIKER, gTrainerFrontPic_Hiker, 0x800),
TRAINER_SPRITE(AQUA_GRUNT_M, gTrainerFrontPic_AquaGruntM, 0x800),
TRAINER_SPRITE(POKEMON_BREEDER_F, gTrainerFrontPic_PokemonBreederF, 0x800),
TRAINER_SPRITE(COOLTRAINER_M, gTrainerFrontPic_CoolTrainerM, 0x800),
TRAINER_SPRITE(BIRD_KEEPER, gTrainerFrontPic_BirdKeeper, 0x800),
TRAINER_SPRITE(COLLECTOR, gTrainerFrontPic_Collector, 0x800),
TRAINER_SPRITE(AQUA_GRUNT_F, gTrainerFrontPic_AquaGruntF, 0x800),
TRAINER_SPRITE(SWIMMER_M, gTrainerFrontPic_SwimmerM, 0x800),
TRAINER_SPRITE(MAGMA_GRUNT_M, gTrainerFrontPic_MagmaGruntM, 0x800),
TRAINER_SPRITE(EXPERT_M, gTrainerFrontPic_ExpertM, 0x800),
TRAINER_SPRITE(AQUA_ADMIN_M, gTrainerFrontPic_AquaAdminM, 0x800),
TRAINER_SPRITE(BLACK_BELT, gTrainerFrontPic_BlackBelt, 0x800),
TRAINER_SPRITE(AQUA_ADMIN_F, gTrainerFrontPic_AquaAdminF, 0x800),
TRAINER_SPRITE(AQUA_LEADER_ARCHIE, gTrainerFrontPic_AquaLeaderArchie, 0x800),
TRAINER_SPRITE(HEX_MANIAC, gTrainerFrontPic_HexManiac, 0x800),
TRAINER_SPRITE(AROMA_LADY, gTrainerFrontPic_AromaLady, 0x800),
TRAINER_SPRITE(RUIN_MANIAC, gTrainerFrontPic_RuinManiac, 0x800),
TRAINER_SPRITE(INTERVIEWER, gTrainerFrontPic_Interviewer, 0x800),
TRAINER_SPRITE(TUBER_F, gTrainerFrontPic_TuberF, 0x800),
TRAINER_SPRITE(TUBER_M, gTrainerFrontPic_TuberM, 0x800),
TRAINER_SPRITE(COOLTRAINER_F, gTrainerFrontPic_CoolTrainerF, 0x800),
TRAINER_SPRITE(LADY, gTrainerFrontPic_Lady, 0x800),
TRAINER_SPRITE(BEAUTY, gTrainerFrontPic_Beauty, 0x800),
TRAINER_SPRITE(RICH_BOY, gTrainerFrontPic_RichBoy, 0x800),
TRAINER_SPRITE(EXPERT_F, gTrainerFrontPic_ExpertF, 0x800),
TRAINER_SPRITE(POKEMANIAC, gTrainerFrontPic_Pokemaniac, 0x800),
TRAINER_SPRITE(MAGMA_GRUNT_F, gTrainerFrontPic_MagmaGruntF, 0x800),
TRAINER_SPRITE(GUITARIST, gTrainerFrontPic_Guitarist, 0x800),
TRAINER_SPRITE(KINDLER, gTrainerFrontPic_Kindler, 0x800),
TRAINER_SPRITE(CAMPER, gTrainerFrontPic_Camper, 0x800),
TRAINER_SPRITE(PICNICKER, gTrainerFrontPic_Picnicker, 0x800),
TRAINER_SPRITE(BUG_MANIAC, gTrainerFrontPic_BugManiac, 0x800),
TRAINER_SPRITE(POKEMON_BREEDER_M, gTrainerFrontPic_PokemonBreederM, 0x800),
TRAINER_SPRITE(PSYCHIC_M, gTrainerFrontPic_PsychicM, 0x800),
TRAINER_SPRITE(PSYCHIC_F, gTrainerFrontPic_PsychicF, 0x800),
TRAINER_SPRITE(GENTLEMAN, gTrainerFrontPic_Gentleman, 0x800),
TRAINER_SPRITE(ELITE_FOUR_SIDNEY, gTrainerFrontPic_EliteFourSidney, 0x800),
TRAINER_SPRITE(ELITE_FOUR_PHOEBE, gTrainerFrontPic_EliteFourPhoebe, 0x800),
TRAINER_SPRITE(ELITE_FOUR_GLACIA, gTrainerFrontPic_EliteFourGlacia, 0x800),
TRAINER_SPRITE(ELITE_FOUR_DRAKE, gTrainerFrontPic_EliteFourDrake, 0x800),
TRAINER_SPRITE(LEADER_ROXANNE, gTrainerFrontPic_LeaderRoxanne, 0x800),
TRAINER_SPRITE(LEADER_BRAWLY, gTrainerFrontPic_LeaderBrawly, 0x800),
TRAINER_SPRITE(LEADER_WATTSON, gTrainerFrontPic_LeaderWattson, 0x800),
TRAINER_SPRITE(LEADER_FLANNERY, gTrainerFrontPic_LeaderFlannery, 0x800),
TRAINER_SPRITE(LEADER_NORMAN, gTrainerFrontPic_LeaderNorman, 0x800),
TRAINER_SPRITE(LEADER_WINONA, gTrainerFrontPic_LeaderWinona, 0x800),
TRAINER_SPRITE(LEADER_TATE_AND_LIZA, gTrainerFrontPic_LeaderTateAndLiza, 0x800),
TRAINER_SPRITE(LEADER_JUAN, gTrainerFrontPic_LeaderJuan, 0x800),
TRAINER_SPRITE(SCHOOL_KID_M, gTrainerFrontPic_SchoolKidM, 0x800),
TRAINER_SPRITE(SCHOOL_KID_F, gTrainerFrontPic_SchoolKidF, 0x800),
TRAINER_SPRITE(SR_AND_JR, gTrainerFrontPic_SrAndJr, 0x1000),
TRAINER_SPRITE(POKEFAN_M, gTrainerFrontPic_PokefanM, 0x1000),
TRAINER_SPRITE(POKEFAN_F, gTrainerFrontPic_PokefanF, 0x800),
TRAINER_SPRITE(YOUNGSTER, gTrainerFrontPic_Youngster, 0x800),
TRAINER_SPRITE(CHAMPION_WALLACE, gTrainerFrontPic_ChampionWallace, 0x1000),
TRAINER_SPRITE(FISHERMAN, gTrainerFrontPic_Fisherman, 0x800),
TRAINER_SPRITE(CYCLING_TRIATHLETE_M, gTrainerFrontPic_CyclingTriathleteM, 0x1000),
TRAINER_SPRITE(CYCLING_TRIATHLETE_F, gTrainerFrontPic_CyclingTriathleteF, 0x800),
TRAINER_SPRITE(RUNNING_TRIATHLETE_M, gTrainerFrontPic_RunningTriathleteM, 0x800),
TRAINER_SPRITE(RUNNING_TRIATHLETE_F, gTrainerFrontPic_RunningTriathleteF, 0x800),
TRAINER_SPRITE(SWIMMING_TRIATHLETE_M, gTrainerFrontPic_SwimmingTriathleteM, 0x800),
TRAINER_SPRITE(SWIMMING_TRIATHLETE_F, gTrainerFrontPic_SwimmingTriathleteF, 0x800),
TRAINER_SPRITE(DRAGON_TAMER, gTrainerFrontPic_DragonTamer, 0x800),
TRAINER_SPRITE(NINJA_BOY, gTrainerFrontPic_NinjaBoy, 0x800),
TRAINER_SPRITE(BATTLE_GIRL, gTrainerFrontPic_BattleGirl, 0x1000),
TRAINER_SPRITE(PARASOL_LADY, gTrainerFrontPic_ParasolLady, 0x800),
TRAINER_SPRITE(SWIMMER_F, gTrainerFrontPic_SwimmerF, 0x800),
TRAINER_SPRITE(TWINS, gTrainerFrontPic_Twins, 0x800),
TRAINER_SPRITE(SAILOR, gTrainerFrontPic_Sailor, 0x800),
TRAINER_SPRITE(MAGMA_ADMIN, gTrainerFrontPic_MagmaAdmin, 0x800),
TRAINER_SPRITE(WALLY, gTrainerFrontPic_Wally, 0x800),
TRAINER_SPRITE(BRENDAN, gTrainerFrontPic_Brendan, 0x800),
TRAINER_SPRITE(MAY, gTrainerFrontPic_May, 0x800),
TRAINER_SPRITE(BUG_CATCHER, gTrainerFrontPic_BugCatcher, 0x800),
TRAINER_SPRITE(POKEMON_RANGER_M, gTrainerFrontPic_PokemonRangerM, 0x800),
TRAINER_SPRITE(POKEMON_RANGER_F, gTrainerFrontPic_PokemonRangerF, 0x800),
TRAINER_SPRITE(MAGMA_LEADER_MAXIE, gTrainerFrontPic_MagmaLeaderMaxie, 0x800),
TRAINER_SPRITE(LASS, gTrainerFrontPic_Lass, 0x800),
TRAINER_SPRITE(YOUNG_COUPLE, gTrainerFrontPic_YoungCouple, 0x800),
TRAINER_SPRITE(OLD_COUPLE, gTrainerFrontPic_OldCouple, 0x800),
TRAINER_SPRITE(SIS_AND_BRO, gTrainerFrontPic_SisAndBro, 0x800),
TRAINER_SPRITE(STEVEN, gTrainerFrontPic_Steven, 0x800),
TRAINER_SPRITE(SALON_MAIDEN_ANABEL, gTrainerFrontPic_SalonMaidenAnabel, 0x800),
TRAINER_SPRITE(DOME_ACE_TUCKER, gTrainerFrontPic_DomeAceTucker, 0x800),
TRAINER_SPRITE(PALACE_MAVEN_SPENSER, gTrainerFrontPic_PalaceMavenSpenser, 0x800),
TRAINER_SPRITE(ARENA_TYCOON_GRETA, gTrainerFrontPic_ArenaTycoonGreta, 0x1000),
TRAINER_SPRITE(FACTORY_HEAD_NOLAND, gTrainerFrontPic_FactoryHeadNoland, 0x800),
TRAINER_SPRITE(PIKE_QUEEN_LUCY, gTrainerFrontPic_PikeQueenLucy, 0x800),
TRAINER_SPRITE(PYRAMID_KING_BRANDON, gTrainerFrontPic_PyramidKingBrandon, 0x800),
TRAINER_SPRITE(RED, gTrainerFrontPic_Red, 0x800),
TRAINER_SPRITE(LEAF, gTrainerFrontPic_Leaf, 0x800),
TRAINER_SPRITE(RS_BRENDAN, gTrainerFrontPic_RubySapphireBrendan, 0x800),
TRAINER_SPRITE(RS_MAY, gTrainerFrontPic_RubySapphireMay, 0x800),
TRAINER_SPRITE(HIKER, gTrainerFrontPic_Hiker, TRAINER_PIC_SIZE),
TRAINER_SPRITE(AQUA_GRUNT_M, gTrainerFrontPic_AquaGruntM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(POKEMON_BREEDER_F, gTrainerFrontPic_PokemonBreederF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(COOLTRAINER_M, gTrainerFrontPic_CoolTrainerM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(BIRD_KEEPER, gTrainerFrontPic_BirdKeeper, TRAINER_PIC_SIZE),
TRAINER_SPRITE(COLLECTOR, gTrainerFrontPic_Collector, TRAINER_PIC_SIZE),
TRAINER_SPRITE(AQUA_GRUNT_F, gTrainerFrontPic_AquaGruntF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SWIMMER_M, gTrainerFrontPic_SwimmerM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(MAGMA_GRUNT_M, gTrainerFrontPic_MagmaGruntM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(EXPERT_M, gTrainerFrontPic_ExpertM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(AQUA_ADMIN_M, gTrainerFrontPic_AquaAdminM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(BLACK_BELT, gTrainerFrontPic_BlackBelt, TRAINER_PIC_SIZE),
TRAINER_SPRITE(AQUA_ADMIN_F, gTrainerFrontPic_AquaAdminF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(AQUA_LEADER_ARCHIE, gTrainerFrontPic_AquaLeaderArchie, TRAINER_PIC_SIZE),
TRAINER_SPRITE(HEX_MANIAC, gTrainerFrontPic_HexManiac, TRAINER_PIC_SIZE),
TRAINER_SPRITE(AROMA_LADY, gTrainerFrontPic_AromaLady, TRAINER_PIC_SIZE),
TRAINER_SPRITE(RUIN_MANIAC, gTrainerFrontPic_RuinManiac, TRAINER_PIC_SIZE),
TRAINER_SPRITE(INTERVIEWER, gTrainerFrontPic_Interviewer, TRAINER_PIC_SIZE),
TRAINER_SPRITE(TUBER_F, gTrainerFrontPic_TuberF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(TUBER_M, gTrainerFrontPic_TuberM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(COOLTRAINER_F, gTrainerFrontPic_CoolTrainerF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LADY, gTrainerFrontPic_Lady, TRAINER_PIC_SIZE),
TRAINER_SPRITE(BEAUTY, gTrainerFrontPic_Beauty, TRAINER_PIC_SIZE),
TRAINER_SPRITE(RICH_BOY, gTrainerFrontPic_RichBoy, TRAINER_PIC_SIZE),
TRAINER_SPRITE(EXPERT_F, gTrainerFrontPic_ExpertF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(POKEMANIAC, gTrainerFrontPic_Pokemaniac, TRAINER_PIC_SIZE),
TRAINER_SPRITE(MAGMA_GRUNT_F, gTrainerFrontPic_MagmaGruntF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(GUITARIST, gTrainerFrontPic_Guitarist, TRAINER_PIC_SIZE),
TRAINER_SPRITE(KINDLER, gTrainerFrontPic_Kindler, TRAINER_PIC_SIZE),
TRAINER_SPRITE(CAMPER, gTrainerFrontPic_Camper, TRAINER_PIC_SIZE),
TRAINER_SPRITE(PICNICKER, gTrainerFrontPic_Picnicker, TRAINER_PIC_SIZE),
TRAINER_SPRITE(BUG_MANIAC, gTrainerFrontPic_BugManiac, TRAINER_PIC_SIZE),
TRAINER_SPRITE(POKEMON_BREEDER_M, gTrainerFrontPic_PokemonBreederM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(PSYCHIC_M, gTrainerFrontPic_PsychicM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(PSYCHIC_F, gTrainerFrontPic_PsychicF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(GENTLEMAN, gTrainerFrontPic_Gentleman, TRAINER_PIC_SIZE),
TRAINER_SPRITE(ELITE_FOUR_SIDNEY, gTrainerFrontPic_EliteFourSidney, TRAINER_PIC_SIZE),
TRAINER_SPRITE(ELITE_FOUR_PHOEBE, gTrainerFrontPic_EliteFourPhoebe, TRAINER_PIC_SIZE),
TRAINER_SPRITE(ELITE_FOUR_GLACIA, gTrainerFrontPic_EliteFourGlacia, TRAINER_PIC_SIZE),
TRAINER_SPRITE(ELITE_FOUR_DRAKE, gTrainerFrontPic_EliteFourDrake, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEADER_ROXANNE, gTrainerFrontPic_LeaderRoxanne, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEADER_BRAWLY, gTrainerFrontPic_LeaderBrawly, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEADER_WATTSON, gTrainerFrontPic_LeaderWattson, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEADER_FLANNERY, gTrainerFrontPic_LeaderFlannery, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEADER_NORMAN, gTrainerFrontPic_LeaderNorman, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEADER_WINONA, gTrainerFrontPic_LeaderWinona, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEADER_TATE_AND_LIZA, gTrainerFrontPic_LeaderTateAndLiza, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEADER_JUAN, gTrainerFrontPic_LeaderJuan, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SCHOOL_KID_M, gTrainerFrontPic_SchoolKidM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SCHOOL_KID_F, gTrainerFrontPic_SchoolKidF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SR_AND_JR, gTrainerFrontPic_SrAndJr, TRAINER_PIC_SIZE * 2),
TRAINER_SPRITE(POKEFAN_M, gTrainerFrontPic_PokefanM, TRAINER_PIC_SIZE * 2),
TRAINER_SPRITE(POKEFAN_F, gTrainerFrontPic_PokefanF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(YOUNGSTER, gTrainerFrontPic_Youngster, TRAINER_PIC_SIZE),
TRAINER_SPRITE(CHAMPION_WALLACE, gTrainerFrontPic_ChampionWallace, TRAINER_PIC_SIZE * 2),
TRAINER_SPRITE(FISHERMAN, gTrainerFrontPic_Fisherman, TRAINER_PIC_SIZE),
TRAINER_SPRITE(CYCLING_TRIATHLETE_M, gTrainerFrontPic_CyclingTriathleteM, TRAINER_PIC_SIZE * 2),
TRAINER_SPRITE(CYCLING_TRIATHLETE_F, gTrainerFrontPic_CyclingTriathleteF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(RUNNING_TRIATHLETE_M, gTrainerFrontPic_RunningTriathleteM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(RUNNING_TRIATHLETE_F, gTrainerFrontPic_RunningTriathleteF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SWIMMING_TRIATHLETE_M, gTrainerFrontPic_SwimmingTriathleteM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SWIMMING_TRIATHLETE_F, gTrainerFrontPic_SwimmingTriathleteF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(DRAGON_TAMER, gTrainerFrontPic_DragonTamer, TRAINER_PIC_SIZE),
TRAINER_SPRITE(NINJA_BOY, gTrainerFrontPic_NinjaBoy, TRAINER_PIC_SIZE),
TRAINER_SPRITE(BATTLE_GIRL, gTrainerFrontPic_BattleGirl, TRAINER_PIC_SIZE * 2),
TRAINER_SPRITE(PARASOL_LADY, gTrainerFrontPic_ParasolLady, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SWIMMER_F, gTrainerFrontPic_SwimmerF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(TWINS, gTrainerFrontPic_Twins, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SAILOR, gTrainerFrontPic_Sailor, TRAINER_PIC_SIZE),
TRAINER_SPRITE(MAGMA_ADMIN, gTrainerFrontPic_MagmaAdmin, TRAINER_PIC_SIZE),
TRAINER_SPRITE(WALLY, gTrainerFrontPic_Wally, TRAINER_PIC_SIZE),
TRAINER_SPRITE(BRENDAN, gTrainerFrontPic_Brendan, TRAINER_PIC_SIZE),
TRAINER_SPRITE(MAY, gTrainerFrontPic_May, TRAINER_PIC_SIZE),
TRAINER_SPRITE(BUG_CATCHER, gTrainerFrontPic_BugCatcher, TRAINER_PIC_SIZE),
TRAINER_SPRITE(POKEMON_RANGER_M, gTrainerFrontPic_PokemonRangerM, TRAINER_PIC_SIZE),
TRAINER_SPRITE(POKEMON_RANGER_F, gTrainerFrontPic_PokemonRangerF, TRAINER_PIC_SIZE),
TRAINER_SPRITE(MAGMA_LEADER_MAXIE, gTrainerFrontPic_MagmaLeaderMaxie, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LASS, gTrainerFrontPic_Lass, TRAINER_PIC_SIZE),
TRAINER_SPRITE(YOUNG_COUPLE, gTrainerFrontPic_YoungCouple, TRAINER_PIC_SIZE),
TRAINER_SPRITE(OLD_COUPLE, gTrainerFrontPic_OldCouple, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SIS_AND_BRO, gTrainerFrontPic_SisAndBro, TRAINER_PIC_SIZE),
TRAINER_SPRITE(STEVEN, gTrainerFrontPic_Steven, TRAINER_PIC_SIZE),
TRAINER_SPRITE(SALON_MAIDEN_ANABEL, gTrainerFrontPic_SalonMaidenAnabel, TRAINER_PIC_SIZE),
TRAINER_SPRITE(DOME_ACE_TUCKER, gTrainerFrontPic_DomeAceTucker, TRAINER_PIC_SIZE),
TRAINER_SPRITE(PALACE_MAVEN_SPENSER, gTrainerFrontPic_PalaceMavenSpenser, TRAINER_PIC_SIZE),
TRAINER_SPRITE(ARENA_TYCOON_GRETA, gTrainerFrontPic_ArenaTycoonGreta, TRAINER_PIC_SIZE * 2),
TRAINER_SPRITE(FACTORY_HEAD_NOLAND, gTrainerFrontPic_FactoryHeadNoland, TRAINER_PIC_SIZE),
TRAINER_SPRITE(PIKE_QUEEN_LUCY, gTrainerFrontPic_PikeQueenLucy, TRAINER_PIC_SIZE),
TRAINER_SPRITE(PYRAMID_KING_BRANDON, gTrainerFrontPic_PyramidKingBrandon, TRAINER_PIC_SIZE),
TRAINER_SPRITE(RED, gTrainerFrontPic_Red, TRAINER_PIC_SIZE),
TRAINER_SPRITE(LEAF, gTrainerFrontPic_Leaf, TRAINER_PIC_SIZE),
TRAINER_SPRITE(RS_BRENDAN, gTrainerFrontPic_RubySapphireBrendan, TRAINER_PIC_SIZE),
TRAINER_SPRITE(RS_MAY, gTrainerFrontPic_RubySapphireMay, TRAINER_PIC_SIZE),
};
#define TRAINER_PAL(trainerPic, pal) [TRAINER_PIC_##trainerPic] = {pal, TRAINER_PIC_##trainerPic}
+1 -1
View File
@@ -729,7 +729,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
for (j = 0; j < NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES; j++)
{
u16 moveId = ItemIdToBattleMoveId(ITEM_TM01 + j);
if (sHatchedEggFatherMoves[i] == moveId && CanLearnTeachableMove(GetMonData(egg, MON_DATA_SPECIES2), moveId))
if (sHatchedEggFatherMoves[i] == moveId && CanLearnTeachableMove(GetMonData(egg, MON_DATA_SPECIES_OR_EGG), moveId))
{
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFatherMoves[i]);
+2 -2
View File
@@ -1149,8 +1149,8 @@ static void DebugAction_Util_PoisonMons(u8 taskId)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, 0)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
{
u32 curStatus = STATUS1_POISON;
SetMonData(&gPlayerParty[i], MON_DATA_STATUS, &curStatus);
+1 -1
View File
@@ -2906,7 +2906,7 @@ void IsDodrioInParty(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_DODRIO)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_DODRIO)
{
gSpecialVar_Result = TRUE;
return;
+3 -3
View File
@@ -313,7 +313,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
{
u16 species;
u32 personality, pokerus;
u8 i, friendship, language, gameMet, markings, isEventLegal;
u8 i, friendship, language, gameMet, markings, isModernFatefulEncounter;
u16 moves[MAX_MON_MOVES];
u32 ivs[NUM_STATS];
@@ -332,7 +332,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
gameMet = GetMonData(egg, MON_DATA_MET_GAME);
markings = GetMonData(egg, MON_DATA_MARKINGS);
pokerus = GetMonData(egg, MON_DATA_POKERUS);
isEventLegal = GetMonData(egg, MON_DATA_EVENT_LEGAL);
isModernFatefulEncounter = GetMonData(egg, MON_DATA_MODERN_FATEFUL_ENCOUNTER);
CreateMon(temp, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
@@ -350,7 +350,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
friendship = 120;
SetMonData(temp, MON_DATA_FRIENDSHIP, &friendship);
SetMonData(temp, MON_DATA_POKERUS, &pokerus);
SetMonData(temp, MON_DATA_EVENT_LEGAL, &isEventLegal);
SetMonData(temp, MON_DATA_MODERN_FATEFUL_ENCOUNTER, &isModernFatefulEncounter);
*egg = *temp;
}
+1 -1
View File
@@ -1499,7 +1499,7 @@ u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 l
y -= MAP_OFFSET;
objectEventTemplate.localId = localId;
objectEventTemplate.graphicsId = graphicsId;
objectEventTemplate.inConnection = 0;
objectEventTemplate.kind = OBJ_KIND_NORMAL;
objectEventTemplate.x = x;
objectEventTemplate.y = y;
objectEventTemplate.elevation = elevation;
+1 -1
View File
@@ -19,7 +19,7 @@
static bool32 IsMonValidSpecies(struct Pokemon *pokemon)
{
u16 species = GetMonData(pokemon, MON_DATA_SPECIES2);
u16 species = GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_NONE || species == SPECIES_EGG)
return FALSE;
+4 -4
View File
@@ -1448,7 +1448,7 @@ bool8 IsStarterInParty(void)
u8 partyCount = CalculatePlayerPartyCount();
for (i = 0; i < partyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) == starter)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) == starter)
return TRUE;
}
return FALSE;
@@ -1541,8 +1541,8 @@ u8 GetLeadMonIndex(void)
u8 partyCount = CalculatePlayerPartyCount();
for (i = 0; i < partyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_NONE)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_EGG
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_NONE)
return i;
}
return 0;
@@ -1550,7 +1550,7 @@ u8 GetLeadMonIndex(void)
u16 ScriptGetPartyMonSpecies(void)
{
return GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES2, NULL);
return GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES_OR_EGG, NULL);
}
// Removed for Emerald
+1 -1
View File
@@ -1990,7 +1990,7 @@ static void CheckPartyIneligibility(void)
numEligibleMons = 0;
do
{
u16 species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES_OR_EGG);
u16 heldItem = GetMonData(&gPlayerParty[monId], MON_DATA_HELD_ITEM);
u8 level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
u16 hp = GetMonData(&gPlayerParty[monId], MON_DATA_HP);
+6 -6
View File
@@ -340,7 +340,7 @@ const u32 gBattleAnimSpriteGfx_BlackSmoke[] = INCBIN_U32("graphics/battle_anims/
const u32 gBattleAnimSpritePal_BlackSmoke[] = INCBIN_U32("graphics/battle_anims/sprites/black_smoke.gbapal.lz");
const u32 gBattleAnimSpriteGfx_BlackBall[] = INCBIN_U32("graphics/battle_anims/sprites/black_ball.4bpp.lz");
const u32 gBattleAnimSpritePal_BlackBall[] = INCBIN_U32("graphics/battle_anims/sprites/black_ball.bin");
const u32 gBattleAnimSpritePal_BlackBall[] = INCBIN_U32("graphics/battle_anims/sprites/black_ball.gbapal.lz");
const u32 gBattleAnimSpritePal_Glass[] = INCBIN_U32("graphics/battle_anims/sprites/glass.gbapal.lz");
const u32 gBattleAnimSpriteGfx_Glass[] = INCBIN_U32("graphics/battle_anims/sprites/glass.4bpp.lz");
@@ -576,7 +576,7 @@ const u16 gBattleAnimUnused_Unknown2[] = INCBIN_U16("graphics/battle_anims/unuse
const u16 gBattleAnimUnused_Unknown3[] = INCBIN_U16("graphics/battle_anims/unused/unknown_3.bin");
const u32 gBattleAnimUnusedGfx_LineSketch2[] = INCBIN_U32("graphics/battle_anims/unused/line_sketch_2.8bpp.lz");
const u16 gBattleAnimUnusedPal_LineSketch2[] = INCBIN_U16("graphics/battle_anims/unused/line_sketch_2_pal.bin");
const u16 gBattleAnimUnusedPal_LineSketch2[] = INCBIN_U16("graphics/battle_anims/unused/line_sketch_2.gbapal.lz");
const u32 gBattleAnimUnusedTilemap_LineSketch2[] = INCBIN_U32("graphics/battle_anims/unused/line_sketch_2.bin.lz");
const u32 gBattleAnimSpriteGfx_BlueLines[] = INCBIN_U32("graphics/battle_anims/sprites/blue_lines.4bpp.lz");
@@ -1917,10 +1917,10 @@ const u32 gNamingScreenKeyboardSymbols_Tilemap[] = INCBIN_U32("graphics/naming_s
const u16 gUnionRoomChat_Background_Pal[] = INCBIN_U16("graphics/union_room_chat/background.gbapal");
const u32 gUnionRoomChat_Background_Gfx[] = INCBIN_U32("graphics/union_room_chat/background.4bpp.lz");
const u32 gUnionRoomChat_Background_Tilemap[] = INCBIN_U32("graphics/union_room_chat/background.bin.lz");
const u16 gUnionRoomChat_Window_Pal1[] = INCBIN_U16("graphics/union_room_chat/window_1.gbapal");
const u16 gUnionRoomChat_Window_Pal2[] = INCBIN_U16("graphics/union_room_chat/window_2.gbapal");
const u32 gUnionRoomChat_Border_Gfx[] = INCBIN_U32("graphics/union_room_chat/border.4bpp.lz");
const u32 gUnionRoomChat_Border_Tilemap[] = INCBIN_U32("graphics/union_room_chat/border.bin.lz");
const u16 gUnionRoomChat_InputText_Pal[] = INCBIN_U16("graphics/union_room_chat/input_text.gbapal");
const u16 gUnionRoomChat_Keyboard_Pal[] = INCBIN_U16("graphics/union_room_chat/keyboard.gbapal");
const u32 gUnionRoomChat_Keyboard_Gfx[] = INCBIN_U32("graphics/union_room_chat/keyboard.4bpp.lz");
const u32 gUnionRoomChat_Keyboard_Tilemap[] = INCBIN_U32("graphics/union_room_chat/keyboard.bin.lz");
const u32 gUnionRoomChat_RButtonLabels[] = INCBIN_U32("graphics/union_room_chat/r_button_labels.4bpp.lz");
const u16 gTilesetPalettes_General[][16] =
+1 -1
View File
@@ -445,7 +445,7 @@ static void Task_Hof_InitMonData(u8 taskId)
u8 nick[POKEMON_NAME_LENGTH + 2];
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES))
{
sHofMonPtr->mon[i].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
sHofMonPtr->mon[i].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
sHofMonPtr->mon[i].tid = GetMonData(&gPlayerParty[i], MON_DATA_OT_ID);
sHofMonPtr->mon[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
sHofMonPtr->mon[i].lvl = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
+1 -1
View File
@@ -1077,7 +1077,7 @@ void GetConditionMenuMonGfx(void *tilesDst, void *palDst, u16 boxId, u16 monId,
if (partyId != numMons)
{
u16 species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES2, NULL);
u16 species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES_OR_EGG, NULL);
u32 trainerId = GetBoxOrPartyMonData(boxId, monId, MON_DATA_OT_ID, NULL);
u32 personality = GetBoxOrPartyMonData(boxId, monId, MON_DATA_PERSONALITY, NULL);
+1 -1
View File
@@ -319,7 +319,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx)
void *mailPtr = (void *)(data + sizeof(struct Pokemon));
pokemon = *(struct Pokemon *)pokemonPtr;
species = GetMonData(&pokemon, MON_DATA_SPECIES2);
species = GetMonData(&pokemon, MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_EGG)
StringCopyN(gStringVar1, gText_EggNickname, POKEMON_NAME_LENGTH + 1);
+8 -8
View File
@@ -2035,7 +2035,7 @@ static u8 CanTeachMove(struct Pokemon *mon, u16 move)
{
if (GetMonData(mon, MON_DATA_IS_EGG))
return CANNOT_LEARN_MOVE_IS_EGG;
else if (!CanLearnTeachableMove(GetMonData(mon, MON_DATA_SPECIES2), move))
else if (!CanLearnTeachableMove(GetMonData(mon, MON_DATA_SPECIES_OR_EGG), move))
return CANNOT_LEARN_MOVE;
else if (MonKnowsMove(mon, move) == TRUE)
return ALREADY_KNOWS_MOVE;
@@ -3584,11 +3584,11 @@ static void CursorCb_Store(u8 taskId)
// Register mon for the Trading Board in Union Room
static void CursorCb_Register(u8 taskId)
{
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
u8 isModernFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MODERN_FATEFUL_ENCOUNTER);
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isEventLegal))
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isModernFatefulEncounter))
{
case CANT_REGISTER_MON_NOW:
StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow);
@@ -3614,10 +3614,10 @@ static void CursorCb_Register(u8 taskId)
static void CursorCb_Trade1(u8 taskId)
{
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
u8 isModernFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MODERN_FATEFUL_ENCOUNTER);
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isModernFatefulEncounter);
if (stringId != UR_TRADE_MSG_NONE)
{
@@ -3923,7 +3923,7 @@ static void CreatePartyMonIconSprite(struct Pokemon *mon, struct PartyMenuBox *m
{
u16 species2;
species2 = GetMonData(mon, MON_DATA_SPECIES2);
species2 = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
CreatePartyMonIconSpriteParameterized(species2, GetMonData(mon, MON_DATA_PERSONALITY), menuBox, 1);
UpdatePartyMonHPBar(menuBox->monSpriteId, mon);
}
+3 -3
View File
@@ -725,14 +725,14 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon)
{
case 0:
// Load mon gfx
species = GetMonData(mon, MON_DATA_SPECIES2);
species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(mon, MON_DATA_PERSONALITY);
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], species, personality);
sPokeblockFeed->loadGfxState++;
break;
case 1:
// Load mon palette
species = GetMonData(mon, MON_DATA_SPECIES2);
species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(mon, MON_DATA_PERSONALITY);
trainerId = GetMonData(mon, MON_DATA_OT_ID);
palette = GetMonSpritePalStructFromOtIdPersonality(species, trainerId, personality);
@@ -907,7 +907,7 @@ static void Task_FadeOutPokeblockFeed(u8 taskId)
static u8 CreateMonSprite(struct Pokemon *mon)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES2);
u16 species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
u8 spriteId = CreateSprite(&gMultiuseSpriteTemplate, MON_X, MON_Y, 2);
sPokeblockFeed->species = species;
+22 -24
View File
@@ -3938,12 +3938,12 @@ void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerP
GetMonData(mon, MON_DATA_NICKNAME, dest->nickname);
}
void CreateEventLegalMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
static void CreateEventMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
{
bool32 isEventLegal = TRUE;
bool32 isModernFatefulEncounter = TRUE;
CreateMon(mon, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId);
SetMonData(mon, MON_DATA_EVENT_LEGAL, &isEventLegal);
SetMonData(mon, MON_DATA_MODERN_FATEFUL_ENCOUNTER, &isModernFatefulEncounter);
}
// If FALSE, should load this game's Deoxys form. If TRUE, should load normal Deoxys form
@@ -4033,14 +4033,14 @@ u16 GetUnionRoomTrainerClass(void)
return gFacilityClassToTrainerClass[gUnionRoomFacilityClasses[arrId]];
}
void CreateEventLegalEnemyMon(void)
void CreateEnemyEventMon(void)
{
s32 species = gSpecialVar_0x8004;
s32 level = gSpecialVar_0x8005;
s32 itemId = gSpecialVar_0x8006;
ZeroEnemyPartyMons();
CreateEventLegalMon(&gEnemyParty[0], species, level, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
CreateEventMon(&gEnemyParty[0], species, level, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
if (itemId)
{
u8 heldItem[2];
@@ -4939,10 +4939,10 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
case MON_DATA_UNUSED_RIBBONS:
retVal = substruct3->unusedRibbons;
break;
case MON_DATA_EVENT_LEGAL:
retVal = substruct3->eventLegal;
case MON_DATA_MODERN_FATEFUL_ENCOUNTER:
retVal = substruct3->modernFatefulEncounter;
break;
case MON_DATA_SPECIES2:
case MON_DATA_SPECIES_OR_EGG:
retVal = substruct0->species;
if (substruct0->species && (substruct3->isEgg || boxMon->isBadEgg))
retVal = SPECIES_EGG;
@@ -5069,7 +5069,7 @@ void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg)
case MON_DATA_MAIL:
SET8(mon->mail);
break;
case MON_DATA_SPECIES2:
case MON_DATA_SPECIES_OR_EGG:
break;
default:
SetBoxMonData(&mon->box, field, data);
@@ -5323,8 +5323,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
case MON_DATA_UNUSED_RIBBONS:
SET8(substruct3->unusedRibbons);
break;
case MON_DATA_EVENT_LEGAL:
SET8(substruct3->eventLegal);
case MON_DATA_MODERN_FATEFUL_ENCOUNTER:
SET8(substruct3->modernFatefulEncounter);
break;
case MON_DATA_IVS:
{
@@ -5446,9 +5446,9 @@ u8 GetMonsStateToDoubles(void)
for (i = 0; i < gPlayerPartyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_EGG
&& GetMonData(&gPlayerParty[i], MON_DATA_HP, NULL) != 0
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_NONE)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_NONE)
aliveCount++;
}
@@ -5462,7 +5462,7 @@ u8 GetMonsStateToDoubles_2(void)
for (i = 0; i < PARTY_SIZE; i++)
{
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL);
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL);
if (species != SPECIES_EGG && species != SPECIES_NONE
&& GetMonData(&gPlayerParty[i], MON_DATA_HP, NULL) != 0)
aliveCount++;
@@ -7153,7 +7153,7 @@ void AdjustFriendship(struct Pokemon *mon, u8 event)
if (ShouldSkipFriendshipChange())
return;
species = GetMonData(mon, MON_DATA_SPECIES2, 0);
species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG, 0);
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
if (heldItem == ITEM_ENIGMA_BERRY_E_READER)
@@ -7590,7 +7590,7 @@ u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
u16 learnedMoves[MAX_MON_MOVES];
u16 moves[MAX_LEVEL_UP_MOVES];
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
u16 species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG, 0);
u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
int i, j, k;
@@ -7759,7 +7759,7 @@ static void Task_PlayMapChosenOrBattleBGM(u8 taskId)
const u32 *GetMonFrontSpritePal(struct Pokemon *mon)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
u16 species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG, 0);
u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
return GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality);
@@ -7791,7 +7791,7 @@ const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 p
const struct CompressedSpritePalette *GetMonSpritePalStruct(struct Pokemon *mon)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
u16 species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG, 0);
u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
return GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
@@ -8281,8 +8281,6 @@ static bool8 ShouldSkipFriendshipChange(void)
#define ALLOC_FAIL_BUFFER (1 << 0)
#define ALLOC_FAIL_STRUCT (1 << 1)
#define GFX_MANAGER_ACTIVE 0xA3 // Arbitrary value
#define GFX_MANAGER_SPR_SIZE (MON_PIC_SIZE * 4) // Only Castform uses more than MON_PIC_SIZE, despite not displaying its forms.
#define GFX_MANAGER_NUM_FRAMES 4 // Only 2 frames are needed
static void InitMonSpritesGfx_Battle(struct MonSpritesGfxManager* gfx)
{
@@ -8329,7 +8327,7 @@ struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 managerId, u8 mode)
case MON_SPR_GFX_MODE_FULL_PARTY:
gfx->numSprites = PARTY_SIZE + 1;
gfx->numSprites2 = PARTY_SIZE + 1;
gfx->numFrames = GFX_MANAGER_NUM_FRAMES;
gfx->numFrames = MAX_MON_PIC_FRAMES;
gfx->dataSize = 1;
gfx->mode = MON_SPR_GFX_MODE_FULL_PARTY;
break;
@@ -8338,14 +8336,14 @@ struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 managerId, u8 mode)
default:
gfx->numSprites = MAX_BATTLERS_COUNT;
gfx->numSprites2 = MAX_BATTLERS_COUNT;
gfx->numFrames = GFX_MANAGER_NUM_FRAMES;
gfx->numFrames = MAX_MON_PIC_FRAMES;
gfx->dataSize = 1;
gfx->mode = MON_SPR_GFX_MODE_NORMAL;
break;
}
// Set up sprite / sprite pointer buffers
gfx->spriteBuffer = AllocZeroed(gfx->dataSize * GFX_MANAGER_SPR_SIZE * gfx->numSprites);
gfx->spriteBuffer = AllocZeroed(gfx->dataSize * MON_PIC_SIZE * MAX_MON_PIC_FRAMES * gfx->numSprites);
gfx->spritePointers = AllocZeroed(gfx->numSprites * 32); // ? Only * 4 is necessary, perhaps they were thinking bits.
if (gfx->spriteBuffer == NULL || gfx->spritePointers == NULL)
{
@@ -8354,7 +8352,7 @@ struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 managerId, u8 mode)
else
{
for (i = 0; i < gfx->numSprites; i++)
gfx->spritePointers[i] = gfx->spriteBuffer + (gfx->dataSize * GFX_MANAGER_SPR_SIZE * i);
gfx->spritePointers[i] = gfx->spriteBuffer + (gfx->dataSize * MON_PIC_SIZE * MAX_MON_PIC_FRAMES * i);
}
// Set up sprite structs
+2 -2
View File
@@ -2536,7 +2536,7 @@ void IsPokemonJumpSpeciesInParty(void)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES))
{
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (IsSpeciesAllowedInPokemonJump(species))
{
gSpecialVar_Result = TRUE;
@@ -2896,7 +2896,7 @@ static void CreateJumpMonSprite(struct PokemonJumpGfx *jumpGfx, struct PokemonJu
u8 spriteId;
spriteTemplate = sSpriteTemplate_JumpMon;
buffer = Alloc(0x2000);
buffer = Alloc(MON_PIC_SIZE * MAX_MON_PIC_FRAMES);
unusedBuffer = Alloc(MON_PIC_SIZE);
if (multiplayerId == GetPokeJumpMultiplayerId())
subpriority = 3;
+11 -11
View File
@@ -551,7 +551,7 @@ struct PokemonStorageSystemData
u16 *displayMonTilePtr;
struct Sprite *displayMonSprite;
u16 displayMonPalBuffer[0x40];
u8 tileBuffer[MON_PIC_SIZE * 4]; // 4x the size of a 'Mon sprite to account for Castform
u8 tileBuffer[MON_PIC_SIZE * MAX_MON_PIC_FRAMES];
u8 itemIconBuffer[0x800];
u8 wallpaperBgTilemapBuffer[0x1000];
u8 displayMenuTilemapBuffer[0x800];
@@ -4444,7 +4444,7 @@ static u8 GetMonIconPriorityByCursorPos(void)
static void CreateMovingMonIcon(void)
{
u32 personality = GetMonData(&sStorage->movingMon, MON_DATA_PERSONALITY);
u16 species = GetMonData(&sStorage->movingMon, MON_DATA_SPECIES2);
u16 species = GetMonData(&sStorage->movingMon, MON_DATA_SPECIES_OR_EGG);
u8 priority = GetMonIconPriorityByCursorPos();
sStorage->movingMonSprite = CreateMonIconSprite(species, personality, 0, 0, priority, 7);
@@ -4466,7 +4466,7 @@ static void InitBoxMonSprites(u8 boxId)
{
for (j = 0; j < IN_BOX_COLUMNS; j++)
{
species = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2);
species = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
personality = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY);
@@ -4494,7 +4494,7 @@ static void InitBoxMonSprites(u8 boxId)
static void CreateBoxMonIconAtPos(u8 boxPosition)
{
u16 species = GetCurrentBoxMonData(boxPosition, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(boxPosition, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
@@ -4728,7 +4728,7 @@ static void GetIncomingBoxMonData(u8 boxId)
{
for (j = 0; j < IN_BOX_COLUMNS; j++)
{
sStorage->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2);
sStorage->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES_OR_EGG);
if (sStorage->boxSpecies[boxPosition] != SPECIES_NONE)
sStorage->boxPersonalities[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY);
boxPosition++;
@@ -4756,14 +4756,14 @@ static void SetBoxMonIconObjMode(u8 boxPosition, u8 objMode)
static void CreatePartyMonsSprites(bool8 visible)
{
u16 i, count;
u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES_OR_EGG);
u32 personality = GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY);
sStorage->partySprites[0] = CreateMonIconSprite(species, personality, 104, 64, 1, 12);
count = 1;
for (i = 1; i < PARTY_SIZE; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
@@ -6914,7 +6914,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
{
struct Pokemon *mon = (struct Pokemon *)pokemon;
sStorage->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES2);
sStorage->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
if (sStorage->displayMonSpecies != SPECIES_NONE)
{
sanityIsBadEgg = GetMonData(mon, MON_DATA_SANITY_IS_BAD_EGG);
@@ -6937,7 +6937,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
{
struct BoxPokemon *boxMon = (struct BoxPokemon *)pokemon;
sStorage->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES2);
sStorage->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
if (sStorage->displayMonSpecies != SPECIES_NONE)
{
u32 otId = GetBoxMonData(boxMon, MON_DATA_OT_ID);
@@ -8485,7 +8485,7 @@ static void MultiMove_DeselectRow(u8 row, u8 minColumn, u8 maxColumn)
static void MultiMove_SetIconToBg(u8 x, u8 y)
{
u8 position = x + (IN_BOX_COLUMNS * y);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES_OR_EGG);
u32 personality = GetCurrentBoxMonData(position, MON_DATA_PERSONALITY);
if (species != SPECIES_NONE)
@@ -8510,7 +8510,7 @@ static void MultiMove_SetIconToBg(u8 x, u8 y)
static void MultiMove_ClearIconFromBg(u8 x, u8 y)
{
u8 position = x + (IN_BOX_COLUMNS * y);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
+1 -1
View File
@@ -1474,7 +1474,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *mon)
{
case 0:
sum->species = GetMonData(mon, MON_DATA_SPECIES);
sum->species2 = GetMonData(mon, MON_DATA_SPECIES2);
sum->species2 = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
sum->exp = GetMonData(mon, MON_DATA_EXP);
sum->level = GetMonData(mon, MON_DATA_LEVEL);
sum->abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM);
+1 -1
View File
@@ -531,7 +531,7 @@ static void ConditionGraphDrawMonPic(s16 listId, u8 loadId)
boxId = monListPtr->monData[listId].boxId;
monId = monListPtr->monData[listId].monId;
species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES2, NULL);
species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES_OR_EGG, NULL);
tid = GetBoxOrPartyMonData(boxId, monId, MON_DATA_OT_ID, NULL);
personality = GetBoxOrPartyMonData(boxId, monId, MON_DATA_PERSONALITY, NULL);
LoadSpecialPokePic(menu->monPicGfx[loadId], species, personality, TRUE);
+1 -1
View File
@@ -49,7 +49,7 @@ struct Pokenav_MatchCallGfx
u8 unusedTilemapBuffer[BG_SCREEN_SIZE];
u8 bgTilemapBuffer2[BG_SCREEN_SIZE];
u8 *trainerPicGfxPtr;
u8 trainerPicGfx[0x800];
u8 trainerPicGfx[TRAINER_PIC_SIZE];
u8 trainerPicPal[0x20];
};
+1 -1
View File
@@ -1144,7 +1144,7 @@ static void InitRouletteTableData(void)
for (i = 0; i < PARTY_SIZE; i++)
{
switch (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2))
switch (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG))
{
case SPECIES_SHROOMISH:
sRoulette->partySpeciesFlags |= HAS_SHROOMISH;
+6 -6
View File
@@ -2225,21 +2225,21 @@ bool8 ScrCmd_lockfortrainer(struct ScriptContext *ctx)
}
}
// This command will set a Pokémon's eventLegal bit; there is no similar command to clear it.
bool8 ScrCmd_setmoneventlegal(struct ScriptContext *ctx)
// This command will set a Pokémon's modernFatefulEncounter bit; there is no similar command to clear it.
bool8 ScrCmd_setmonmodernfatefulencounter(struct ScriptContext *ctx)
{
bool8 isEventLegal = TRUE;
bool8 isModernFatefulEncounter = TRUE;
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
SetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, &isEventLegal);
SetMonData(&gPlayerParty[partyIndex], MON_DATA_MODERN_FATEFUL_ENCOUNTER, &isModernFatefulEncounter);
return FALSE;
}
bool8 ScrCmd_checkmoneventlegal(struct ScriptContext *ctx)
bool8 ScrCmd_checkmonmodernfatefulencounter(struct ScriptContext *ctx)
{
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, NULL);
gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MODERN_FATEFUL_ENCOUNTER, NULL);
return FALSE;
}
+1 -1
View File
@@ -128,7 +128,7 @@ static bool8 CheckPartyMonHasHeldItem(u16 item)
for(i = 0; i < PARTY_SIZE; i++)
{
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE && species != SPECIES_EGG && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == item)
return TRUE;
}
+16 -16
View File
@@ -564,7 +564,7 @@ static void CB2_CreateTradeMenu(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++)
{
struct Pokemon *mon = &gPlayerParty[i];
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2),
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES_OR_EGG),
SpriteCB_MonIcon,
(sTradeMonSpriteCoords[i][0] * 8) + 14,
(sTradeMonSpriteCoords[i][1] * 8) - 12,
@@ -575,7 +575,7 @@ static void CB2_CreateTradeMenu(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++)
{
struct Pokemon *mon = &gEnemyParty[i];
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL),
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
(sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14,
(sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12,
@@ -753,7 +753,7 @@ static void CB2_ReturnToTradeMenu(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++)
{
struct Pokemon *mon = &gPlayerParty[i];
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL),
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
(sTradeMonSpriteCoords[i][0] * 8) + 14,
(sTradeMonSpriteCoords[i][1] * 8) - 12,
@@ -764,7 +764,7 @@ static void CB2_ReturnToTradeMenu(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++)
{
struct Pokemon *mon = &gEnemyParty[i];
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL),
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
(sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14,
(sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12,
@@ -1573,7 +1573,7 @@ static u8 CheckValidityOfTradeMons(u8 *aliveMons, u8 playerPartyCount, u8 player
// Partner cant trade illegitimate Deoxys or Mew
if (partnerSpecies == SPECIES_DEOXYS || partnerSpecies == SPECIES_MEW)
{
if (!GetMonData(&gEnemyParty[partnerMonIdx], MON_DATA_EVENT_LEGAL))
if (!GetMonData(&gEnemyParty[partnerMonIdx], MON_DATA_MODERN_FATEFUL_ENCOUNTER))
return PARTNER_MON_INVALID;
}
@@ -2380,7 +2380,7 @@ static void SaveTradeGiftRibbons(void)
{
if (gSaveBlock1Ptr->giftRibbons[i] == 0 && sTradeMenu->giftRibbons[i] != 0)
{
if (sTradeMenu->giftRibbons[i] < 64)
if (sTradeMenu->giftRibbons[i] < MAX_GIFT_RIBBON)
gSaveBlock1Ptr->giftRibbons[i] = sTradeMenu->giftRibbons[i];
}
}
@@ -2395,7 +2395,7 @@ static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int
for (i = 0; i < partyCount; i++)
{
species2[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES2);
species2[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES_OR_EGG);
species[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES);
}
@@ -2426,7 +2426,7 @@ static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int
if (species[monIdx] == SPECIES_DEOXYS || species[monIdx] == SPECIES_MEW)
{
if (!GetMonData(&playerParty[monIdx], MON_DATA_EVENT_LEGAL))
if (!GetMonData(&playerParty[monIdx], MON_DATA_MODERN_FATEFUL_ENCOUNTER))
return CANT_TRADE_INVALID_MON;
}
@@ -2495,17 +2495,17 @@ s32 GetGameProgressForLinkTrade(void)
return TRADE_BOTH_PLAYERS_READY;
}
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal)
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isModernFatefulEncounter)
{
if (species == SPECIES_DEOXYS || species == SPECIES_MEW)
{
if (!isEventLegal)
if (!isModernFatefulEncounter)
return TRUE;
}
return FALSE;
}
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal)
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isModernFatefulEncounter)
{
bool8 playerHasNationalDex = player.hasNationalDex;
bool8 playerCanLinkNationally = player.canLinkNationally;
@@ -2524,7 +2524,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
}
// Cannot trade illegitimate Deoxys/Mew
if (IsDeoxysOrMewUntradable(playerSpecies, isEventLegal))
if (IsDeoxysOrMewUntradable(playerSpecies, isModernFatefulEncounter))
return UR_TRADE_MSG_MON_CANT_BE_TRADED;
// Can't trade specific species
@@ -2571,11 +2571,11 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
return UR_TRADE_MSG_NONE;
}
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal)
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isModernFatefulEncounter)
{
bool8 hasNationalDex = player.hasNationalDex;
if (IsDeoxysOrMewUntradable(species, isEventLegal))
if (IsDeoxysOrMewUntradable(species, isModernFatefulEncounter))
return CANT_REGISTER_MON_NOW;
// Can't trade specific species
@@ -2605,7 +2605,7 @@ int CanSpinTradeMon(struct Pokemon *mon, u16 monIdx)
// Make Eggs not count for numMonsLeft
for (i = 0; i < gPlayerPartyCount; i++)
{
speciesArray[i] = GetMonData(&mon[i], MON_DATA_SPECIES2);
speciesArray[i] = GetMonData(&mon[i], MON_DATA_SPECIES_OR_EGG);
if (speciesArray[i] == SPECIES_EGG)
speciesArray[i] = SPECIES_NONE;
}
@@ -2815,7 +2815,7 @@ static void LoadTradeMonPic(u8 whichParty, u8 state)
switch (state)
{
case 0:
species = GetMonData(mon, MON_DATA_SPECIES2);
species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(mon, MON_DATA_PERSONALITY);
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[whichParty * 2 + B_POSITION_OPPONENT_LEFT], species, personality);
+16 -12
View File
@@ -9,6 +9,12 @@
#include "pokemon.h"
#include "constants/trainers.h"
#define PICS_COUNT 8
// Needs to be large enough to store either a decompressed pokemon pic or trainer pic
#define PIC_SPRITE_SIZE max(MON_PIC_SIZE, TRAINER_PIC_SIZE)
#define MAX_PIC_FRAMES max(MAX_MON_PIC_FRAMES, MAX_TRAINER_PIC_FRAMES)
struct PicData
{
u8 *frames;
@@ -18,8 +24,6 @@ struct PicData
u8 active;
};
#define PICS_COUNT 8
static EWRAM_DATA struct SpriteTemplate sCreatingSpriteTemplate = {};
static EWRAM_DATA struct PicData sSpritePics[PICS_COUNT] = {};
@@ -138,11 +142,11 @@ static u16 CreatePicSprite(u16 species, u32 otId, u32 personality, bool8 isFront
if (i == PICS_COUNT)
return 0xFFFF;
framePics = Alloc(4 * 0x800);
framePics = Alloc(PIC_SPRITE_SIZE * MAX_PIC_FRAMES);
if (!framePics)
return 0xFFFF;
images = Alloc(4 * sizeof(struct SpriteFrameImage));
images = Alloc(sizeof(struct SpriteFrameImage) * MAX_PIC_FRAMES);
if (!images)
{
Free(framePics);
@@ -153,10 +157,10 @@ static u16 CreatePicSprite(u16 species, u32 otId, u32 personality, bool8 isFront
// debug trap?
return 0xFFFF;
}
for (j = 0; j < 4; j ++)
for (j = 0; j < MAX_PIC_FRAMES; j ++)
{
images[j].data = framePics + 0x800 * j;
images[j].size = 0x800;
images[j].data = framePics + PIC_SPRITE_SIZE * j;
images[j].size = PIC_SPRITE_SIZE;
}
sCreatingSpriteTemplate.tileTag = TAG_NONE;
sCreatingSpriteTemplate.oam = &sOamData_Normal;
@@ -193,7 +197,7 @@ u16 CreateMonPicSprite_Affine(u16 species, u32 otId, u32 personality, u8 flags,
if (i == PICS_COUNT)
return 0xFFFF;
framePics = Alloc(4 * MON_PIC_SIZE);
framePics = Alloc(MON_PIC_SIZE * MAX_MON_PIC_FRAMES);
if (!framePics)
return 0xFFFF;
@@ -206,7 +210,7 @@ u16 CreateMonPicSprite_Affine(u16 species, u32 otId, u32 personality, u8 flags,
{
type = flags;
}
images = Alloc(4 * sizeof(struct SpriteFrameImage));
images = Alloc(sizeof(struct SpriteFrameImage) * MAX_MON_PIC_FRAMES);
if (!images)
{
Free(framePics);
@@ -217,7 +221,7 @@ u16 CreateMonPicSprite_Affine(u16 species, u32 otId, u32 personality, u8 flags,
// debug trap?
return 0xFFFF;
}
for (j = 0; j < 4; j ++)
for (j = 0; j < MAX_MON_PIC_FRAMES; j ++)
{
images[j].data = framePics + MON_PIC_SIZE * j;
images[j].size = MON_PIC_SIZE;
@@ -291,10 +295,10 @@ static u16 CreateTrainerCardSprite(u16 species, u32 otId, u32 personality, bool8
{
u8 *framePics;
framePics = Alloc(4 * 0x800);
framePics = Alloc(TRAINER_PIC_SIZE * MAX_TRAINER_PIC_FRAMES);
if (framePics && !DecompressPic(species, personality, isFrontPic, framePics, isTrainer))
{
BlitBitmapRectToWindow(windowId, framePics, 0, 0, 0x40, 0x40, destX, destY, 0x40, 0x40);
BlitBitmapRectToWindow(windowId, framePics, 0, 0, TRAINER_PIC_WIDTH, TRAINER_PIC_HEIGHT, destX, destY, TRAINER_PIC_WIDTH, TRAINER_PIC_HEIGHT);
LoadPicPaletteBySlot(species, otId, personality, paletteSlot, isTrainer);
Free(framePics);
return 0;
+6 -6
View File
@@ -4176,7 +4176,7 @@ static s32 IsRequestedTradeInPlayerParty(u32 type, u32 species)
{
for (i = 0; i < gPlayerPartyCount; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_EGG)
return UR_TRADE_MATCH;
}
@@ -4186,7 +4186,7 @@ static s32 IsRequestedTradeInPlayerParty(u32 type, u32 species)
{
for (i = 0; i < gPlayerPartyCount; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (gSpeciesInfo[species].types[0] == type || gSpeciesInfo[species].types[1] == type)
return UR_TRADE_MATCH;
}
@@ -4319,7 +4319,7 @@ static bool32 HasAtLeastTwoMonsOfLevel30OrLower(void)
for (i = 0; i < gPlayerPartyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= UNION_ROOM_MAX_LEVEL
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
count++;
}
@@ -4348,7 +4348,7 @@ void Script_ResetUnionRoomTrade(void)
static bool32 RegisterTradeMonAndGetIsEgg(u32 monId, struct UnionRoomTrade *trade)
{
trade->playerSpecies = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
trade->playerSpecies = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES_OR_EGG);
trade->playerLevel = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
trade->playerPersonality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY);
if (trade->playerSpecies == SPECIES_EGG)
@@ -4359,7 +4359,7 @@ static bool32 RegisterTradeMonAndGetIsEgg(u32 monId, struct UnionRoomTrade *trad
static void RegisterTradeMon(u32 monId, struct UnionRoomTrade *trade)
{
trade->species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
trade->species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES_OR_EGG);
trade->level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
trade->personality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY);
}
@@ -4390,7 +4390,7 @@ static u32 GetPartyPositionOfRegisteredMon(struct UnionRoomTrade *trade, u8 mult
cur_personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
if (cur_personality != personality)
continue;
cur_species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
cur_species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (cur_species != species)
continue;
response = i;
Executable → Regular
+34 -30
View File
@@ -173,8 +173,7 @@ struct UnionRoomChatDisplay
u8 bg1Buffer[BG_SCREEN_SIZE];
u8 bg3Buffer[BG_SCREEN_SIZE];
u8 bg2Buffer[BG_SCREEN_SIZE];
u8 unk2128[0x20];
u8 unk2148[0x20];
u8 textEntryTiles[TILE_SIZE_4BPP * 2];
};
struct UnionRoomChatSprites
@@ -254,11 +253,11 @@ static void FreeSprites(void);
static void ResetGpuBgState(void);
static void SetBgTilemapBuffers(void);
static void ClearBg0(void);
static void LoadChatWindowBorderGfx(void);
static void LoadKeyboardWindowGfx(void);
static void LoadChatWindowGfx(void);
static void LoadChatUnkPalette(void);
static void LoadChatMessagesWindow(void);
static void LoadKeyboardWindow(void);
static void DrawKeyboardWindow(void);
static void LoadKeyboardSwapWindow(void);
static void LoadTextEntryWindow(void);
static void CreateKeyboardCursorSprite(void);
@@ -527,8 +526,8 @@ static const u8 *const sUnionRoomKeyboardText[UNION_ROOM_KB_PAGE_COUNT - 1][UNIO
}
};
static const u16 sUnk_Palette1[] = INCBIN_U16("graphics/union_room_chat/unk_palette1.gbapal");
static const u16 sUnk_Palette2[] = INCBIN_U16("graphics/union_room_chat/unk_palette2.gbapal");
static const u16 sUnusedPalette[] = INCBIN_U16("graphics/union_room_chat/unused.gbapal"); // Loaded but never apparently used
static const u16 sChatMessagesWindow_Pal[] = INCBIN_U16("graphics/union_room_chat/chat_messages_window.gbapal");
static const struct BgTemplate sBgTemplates[] = {
{
@@ -759,15 +758,15 @@ static const u32 sTextEntryArrowTiles[] = INCBIN_U32("graphics/union_room_chat/t
static const u32 sRButtonGfxTiles[] = INCBIN_U32("graphics/union_room_chat/r_button.4bpp.lz");
static const struct CompressedSpriteSheet sSpriteSheets[] = {
{sKeyboardCursorTiles, 0x1000, 0},
{sTextEntryArrowTiles, 0x0040, 1},
{sTextEntryCursorTiles, 0x0040, 2},
{sRButtonGfxTiles, 0x0080, 3},
{gUnionRoomChat_RButtonLabels, 0x0400, 4}
{.data = sKeyboardCursorTiles, .size = 0x1000, .tag = GFXTAG_KEYBOARD_CURSOR},
{.data = sTextEntryArrowTiles, .size = 0x0040, .tag = GFXTAG_TEXT_ENTRY_ARROW},
{.data = sTextEntryCursorTiles, .size = 0x0040, .tag = GFXTAG_TEXT_ENTRY_CURSOR},
{.data = sRButtonGfxTiles, .size = 0x0080, .tag = GFXTAG_RBUTTON_ICON},
{.data = gUnionRoomChat_RButtonLabels, .size = 0x0400, .tag = GFXTAG_RBUTTON_LABELS}
};
static const struct SpritePalette sSpritePalette = {
sUnionRoomChatInterfacePal, 0
.data = sUnionRoomChatInterfacePal, .tag = PALTAG_INTERFACE
};
static const struct OamData sOam_KeyboardCursor = {
@@ -970,7 +969,7 @@ static void CB2_LoadInterface(void)
sChat->handleInputTask = CreateTask(Task_HandlePlayerInput, 8);
sChat->receiveMessagesTask = CreateTask(Task_ReceiveChatMessage, 7);
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(232, 150);
CreateWirelessStatusIndicatorSprite(DISPLAY_WIDTH - 8, DISPLAY_HEIGHT - 10);
}
break;
}
@@ -1759,7 +1758,7 @@ static void RegisterTextAtRow(void)
static void ResetMessageEntryBuffer(void)
{
sChat->messageEntryBuffer[0] = EOS;
sChat->lastBufferCursorPos = 15;
sChat->lastBufferCursorPos = MAX_MESSAGE_LENGTH;
sChat->bufferCursorPos = 0;
}
@@ -2063,10 +2062,10 @@ static void Task_ReceiveChatMessage(u8 taskId)
tState = 3;
// fall through
case 3:
for (; tI < 5 && ((tBlockReceivedStatus >> tI) & 1) == 0; tI++)
for (; tI < MAX_RFU_PLAYERS && ((tBlockReceivedStatus >> tI) & 1) == 0; tI++)
;
if (tI == 5)
if (tI == MAX_RFU_PLAYERS)
{
tState = 1;
return;
@@ -2254,7 +2253,7 @@ static bool32 Display_LoadGfx(u8 *state)
ClearBg0();
break;
case 2:
LoadChatWindowBorderGfx();
LoadKeyboardWindowGfx();
break;
case 3:
LoadChatWindowGfx();
@@ -2264,7 +2263,7 @@ static bool32 Display_LoadGfx(u8 *state)
break;
case 5:
LoadChatMessagesWindow();
LoadKeyboardWindow();
DrawKeyboardWindow();
LoadKeyboardSwapWindow();
LoadTextEntryWindow();
break;
@@ -3063,12 +3062,12 @@ static void ClearBg0(void)
CopyBgTilemapBufferToVram(0);
}
static void LoadChatWindowBorderGfx(void)
static void LoadKeyboardWindowGfx(void)
{
LoadPalette(gUnionRoomChat_Window_Pal2, BG_PLTT_ID(7), PLTT_SIZE_4BPP);
LoadPalette(gUnionRoomChat_Window_Pal1, BG_PLTT_ID(12), PLTT_SIZE_4BPP);
DecompressAndCopyTileDataToVram(1, gUnionRoomChat_Border_Gfx, 0, 0, 0);
CopyToBgTilemapBuffer(1, gUnionRoomChat_Border_Tilemap, 0, 0);
LoadPalette(gUnionRoomChat_Keyboard_Pal, BG_PLTT_ID(7), PLTT_SIZE_4BPP);
LoadPalette(gUnionRoomChat_InputText_Pal, BG_PLTT_ID(12), PLTT_SIZE_4BPP);
DecompressAndCopyTileDataToVram(1, gUnionRoomChat_Keyboard_Gfx, 0, 0, 0);
CopyToBgTilemapBuffer(1, gUnionRoomChat_Keyboard_Tilemap, 0, 0);
CopyBgTilemapBufferToVram(1);
}
@@ -3080,8 +3079,12 @@ static void LoadChatWindowGfx(void)
ptr = DecompressAndCopyTileDataToVram(2, gUnionRoomChat_Background_Gfx, 0, 0, 0);
if (ptr)
{
CpuFastCopy(&ptr[0x220], sDisplay->unk2128, sizeof(sDisplay->unk2128));
CpuFastCopy(&ptr[0x420], sDisplay->unk2148, sizeof(sDisplay->unk2148));
// The below is nonsense. Tiles 0x11 and 0x21 of the background tileset are
// the second half of "OK" and the "T" in "START" in the instructions header.
// They're later blitted onto the text entry window, then immediately cleared.
// The window has a different palette as well, so the tiles would appear mostly black anyway.
CpuFastCopy(&ptr[0x11 * TILE_SIZE_4BPP], &sDisplay->textEntryTiles[TILE_SIZE_4BPP * 0], TILE_SIZE_4BPP);
CpuFastCopy(&ptr[0x21 * TILE_SIZE_4BPP], &sDisplay->textEntryTiles[TILE_SIZE_4BPP * 1], TILE_SIZE_4BPP);
}
CopyToBgTilemapBuffer(2, gUnionRoomChat_Background_Tilemap, 0, 0);
@@ -3090,19 +3093,19 @@ static void LoadChatWindowGfx(void)
static void LoadChatUnkPalette(void)
{
LoadPalette(sUnk_Palette1, BG_PLTT_ID(8), sizeof(sUnk_Palette1));
RequestDma3Fill(0, (void *)BG_CHAR_ADDR(1) + 0x20, 0x20, 1);
LoadPalette(sUnusedPalette, BG_PLTT_ID(8), sizeof(sUnusedPalette));
RequestDma3Fill(0, (void *)BG_CHAR_ADDR(1) + TILE_SIZE_4BPP, TILE_SIZE_4BPP, 1);
}
static void LoadChatMessagesWindow(void)
{
LoadPalette(sUnk_Palette2, BG_PLTT_ID(15), sizeof(sUnk_Palette2));
LoadPalette(sChatMessagesWindow_Pal, BG_PLTT_ID(15), sizeof(sChatMessagesWindow_Pal));
PutWindowTilemap(WIN_CHAT_HISTORY);
FillWindowPixelBuffer(WIN_CHAT_HISTORY, PIXEL_FILL(1));
CopyWindowToVram(WIN_CHAT_HISTORY, COPYWIN_FULL);
}
static void LoadKeyboardWindow(void)
static void DrawKeyboardWindow(void)
{
PutWindowTilemap(WIN_KEYBOARD);
PrintCurrentKeyboardPage();
@@ -3116,8 +3119,9 @@ static void LoadTextEntryWindow(void)
unused[0] = 0;
unused[1] = 0xFF;
// Pointless, cleared below. The tiles are nonsense anyway, see LoadChatWindowGfx.
for (i = 0; i < MAX_MESSAGE_LENGTH; i++)
BlitBitmapToWindow(WIN_TEXT_ENTRY, sDisplay->unk2128, i * 8, 0, 8, 16);
BlitBitmapToWindow(WIN_TEXT_ENTRY, sDisplay->textEntryTiles, i * 8, 0, 8, 16);
FillWindowPixelBuffer(WIN_TEXT_ENTRY, PIXEL_FILL(0));
PutWindowTilemap(WIN_TEXT_ENTRY);
+1 -1
View File
@@ -88,7 +88,7 @@ struct UsePokeblockMenu
{
u32 unused;
u16 partyPalettes[PARTY_SIZE][0x40];
u8 partySheets[NUM_SELECTIONS_LOADED][0x2000];
u8 partySheets[NUM_SELECTIONS_LOADED][MON_PIC_SIZE * MAX_MON_PIC_FRAMES];
u8 unusedBuffer[0x1000];
u8 tilemapBuffer[BG_SCREEN_SIZE + 2];
u8 selectionIconSpriteIds[PARTY_SIZE + 1];
+81 -34
View File
@@ -29,6 +29,7 @@ using json11::Json;
#include "mapjson.h"
string version;
string read_text_file(string filepath) {
ifstream in_file(filepath);
@@ -61,7 +62,7 @@ void write_text_file(string filepath, string text) {
}
string json_to_string(const Json &data, const string &field = "") {
string json_to_string(const Json &data, const string &field = "", bool silent = false) {
const Json value = !field.empty() ? data[field] : data;
string output = "";
switch (value.type()) {
@@ -75,12 +76,14 @@ string json_to_string(const Json &data, const string &field = "") {
output = value.bool_value() ? "TRUE" : "FALSE";
break;
default:{
if (!silent) {
string s = !field.empty() ? ("Value for '" + field + "'") : "JSON field";
FATAL_ERROR("%s is unexpected type; expected string, number, or bool.\n", s.c_str());
}
}
}
if (output.empty()){
if (!silent && output.empty()) {
string s = !field.empty() ? ("Value for '" + field + "'") : "JSON field";
FATAL_ERROR("%s cannot be empty.\n", s.c_str());
}
@@ -88,14 +91,14 @@ string json_to_string(const Json &data, const string &field = "") {
return output;
}
string generate_map_header_text(Json map_data, Json layouts_data, string version) {
string generate_map_header_text(Json map_data, Json layouts_data) {
string map_layout_id = json_to_string(map_data, "layout");
vector<Json> matched;
for (auto &field : layouts_data["layouts"].array_items()) {
if (map_layout_id == json_to_string(field, "id"))
matched.push_back(field);
for (auto &layout : layouts_data["layouts"].array_items()) {
if (map_layout_id == json_to_string(layout, "id", true))
matched.push_back(layout);
}
if (matched.size() != 1)
@@ -123,28 +126,33 @@ string generate_map_header_text(Json map_data, Json layouts_data, string version
text << "\t.4byte " << mapName << "_MapScripts\n";
if (map_data.object_items().find("connections") != map_data.object_items().end()
&& map_data["connections"].array_items().size() > 0)
&& map_data["connections"].array_items().size() > 0 && json_to_string(map_data, "connections_no_include", true) != "TRUE")
text << "\t.4byte " << mapName << "_MapConnections\n";
else
text << "\t.4byte 0x0\n";
text << "\t.4byte NULL\n";
text << "\t.2byte " << json_to_string(map_data, "music") << "\n"
<< "\t.2byte " << json_to_string(layout, "id") << "\n"
<< "\t.byte " << json_to_string(map_data, "region_map_section") << "\n"
<< "\t.byte " << json_to_string(map_data, "requires_flash") << "\n"
<< "\t.byte " << json_to_string(map_data, "weather") << "\n"
<< "\t.byte " << json_to_string(map_data, "map_type") << "\n"
<< "\t.2byte 0\n";
<< "\t.byte " << json_to_string(map_data, "map_type") << "\n";
if (version != "firered")
text << "\t.2byte 0\n";
if (version == "ruby")
text << "\t.byte " << json_to_string(map_data, "show_map_name") << "\n";
else if (version == "emerald")
else if (version == "emerald" || version == "firered")
text << "\tmap_header_flags "
<< "allow_cycling=" << json_to_string(map_data, "allow_cycling") << ", "
<< "allow_escaping=" << json_to_string(map_data, "allow_escaping") << ", "
<< "allow_running=" << json_to_string(map_data, "allow_running") << ", "
<< "show_map_name=" << json_to_string(map_data, "show_map_name") << "\n";
if (version == "firered")
text << "\t.byte " << json_to_string(map_data, "floor_number") << "\n";
text << "\t.byte " << json_to_string(map_data, "battle_scene") << "\n\n";
return text.str();
@@ -193,8 +201,12 @@ string generate_map_events_text(Json map_data) {
text << objects_label << ":\n";
for (unsigned int i = 0; i < map_data["object_events"].array_items().size(); i++) {
auto obj_event = map_data["object_events"].array_items()[i];
string type = json_to_string(obj_event, "type", true);
// If no type field is present, assume it's a regular object event.
if (type == "" || type == "object") {
text << "\tobject_event " << i + 1 << ", "
<< json_to_string(obj_event, "graphics_id") << ", 0, "
<< json_to_string(obj_event, "graphics_id") << ", "
<< json_to_string(obj_event, "x") << ", "
<< json_to_string(obj_event, "y") << ", "
<< json_to_string(obj_event, "elevation") << ", "
@@ -205,10 +217,20 @@ string generate_map_events_text(Json map_data) {
<< json_to_string(obj_event, "trainer_sight_or_berry_tree_id") << ", "
<< json_to_string(obj_event, "script") << ", "
<< json_to_string(obj_event, "flag") << "\n";
} else if (type == "clone") {
text << "\tclone_event " << i + 1 << ", "
<< json_to_string(obj_event, "graphics_id") << ", "
<< json_to_string(obj_event, "x") << ", "
<< json_to_string(obj_event, "y") << ", "
<< json_to_string(obj_event, "target_local_id") << ", "
<< json_to_string(obj_event, "target_map") << "\n";
} else {
FATAL_ERROR("Unknown object event type '%s'. Expected 'object' or 'clone'.\n", type.c_str());
}
}
text << "\n";
} else {
objects_label = "0x0";
objects_label = "NULL";
}
if (map_data["warp_events"].array_items().size() > 0) {
@@ -224,14 +246,15 @@ string generate_map_events_text(Json map_data) {
}
text << "\n";
} else {
warps_label = "0x0";
warps_label = "NULL";
}
if (map_data["coord_events"].array_items().size() > 0) {
coords_label = mapName + "_MapCoordEvents";
text << coords_label << ":\n";
for (auto &coord_event : map_data["coord_events"].array_items()) {
if (json_to_string(coord_event, "type") == "trigger") {
string type = json_to_string(coord_event, "type");
if (type == "trigger") {
text << "\tcoord_event "
<< json_to_string(coord_event, "x") << ", "
<< json_to_string(coord_event, "y") << ", "
@@ -240,24 +263,27 @@ string generate_map_events_text(Json map_data) {
<< json_to_string(coord_event, "var_value") << ", "
<< json_to_string(coord_event, "script") << "\n";
}
else if (coord_event["type"] == "weather") {
else if (type == "weather") {
text << "\tcoord_weather_event "
<< json_to_string(coord_event, "x") << ", "
<< json_to_string(coord_event, "y") << ", "
<< json_to_string(coord_event, "elevation") << ", "
<< json_to_string(coord_event, "weather") << "\n";
} else {
FATAL_ERROR("Unknown coord event type '%s'. Expected 'trigger' or 'weather'.\n", type.c_str());
}
}
text << "\n";
} else {
coords_label = "0x0";
coords_label = "NULL";
}
if (map_data["bg_events"].array_items().size() > 0) {
bgs_label = mapName + "_MapBGEvents";
text << bgs_label << ":\n";
for (auto &bg_event : map_data["bg_events"].array_items()) {
if (bg_event["type"] == "sign") {
string type = json_to_string(bg_event, "type");
if (type == "sign") {
text << "\tbg_sign_event "
<< json_to_string(bg_event, "x") << ", "
<< json_to_string(bg_event, "y") << ", "
@@ -265,25 +291,33 @@ string generate_map_events_text(Json map_data) {
<< json_to_string(bg_event, "player_facing_dir") << ", "
<< json_to_string(bg_event, "script") << "\n";
}
else if (bg_event["type"] == "hidden_item") {
else if (type == "hidden_item") {
text << "\tbg_hidden_item_event "
<< json_to_string(bg_event, "x") << ", "
<< json_to_string(bg_event, "y") << ", "
<< json_to_string(bg_event, "elevation") << ", "
<< json_to_string(bg_event, "item") << ", "
<< json_to_string(bg_event, "flag") << "\n";
<< json_to_string(bg_event, "flag");
if (version == "firered") {
text << ", "
<< json_to_string(bg_event, "quantity") << ", "
<< json_to_string(bg_event, "underfoot");
}
else if (bg_event["type"] == "secret_base") {
text << "\n";
}
else if (type == "secret_base") {
text << "\tbg_secret_base_event "
<< json_to_string(bg_event, "x") << ", "
<< json_to_string(bg_event, "y") << ", "
<< json_to_string(bg_event, "elevation") << ", "
<< json_to_string(bg_event, "secret_base_id") << "\n";
} else {
FATAL_ERROR("Unknown bg event type '%s'. Expected 'sign', 'hidden_item', or 'secret_base'.\n", type.c_str());
}
}
text << "\n";
} else {
bgs_label = "0x0";
bgs_label = "NULL";
}
text << mapName << "_MapEvents::\n"
@@ -299,7 +333,7 @@ string get_directory_name(string filename) {
return filename.substr(0, dir_pos + 1);
}
void process_map(string map_filepath, string layouts_filepath, string version) {
void process_map(string map_filepath, string layouts_filepath) {
string mapdata_err, layouts_err;
string mapdata_json_text = read_text_file(map_filepath);
@@ -313,7 +347,7 @@ void process_map(string map_filepath, string layouts_filepath, string version) {
if (layouts_data == Json())
FATAL_ERROR("%s\n", layouts_err.c_str());
string header_text = generate_map_header_text(map_data, layouts_data, version);
string header_text = generate_map_header_text(map_data, layouts_data);
string events_text = generate_map_events_text(map_data);
string connections_text = generate_map_connections_text(map_data);
@@ -498,6 +532,7 @@ string generate_layout_headers_text(Json layouts_data) {
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/layouts/layouts.json\n@\n\n";
for (auto &layout : layouts_data["layouts"].array_items()) {
if (layout == Json::object()) continue;
string layoutName = json_to_string(layout, "name");
string border_label = layoutName + "_Border";
string blockdata_label = layoutName + "_Blockdata";
@@ -512,7 +547,13 @@ string generate_layout_headers_text(Json layouts_data) {
<< "\t.4byte " << border_label << "\n"
<< "\t.4byte " << blockdata_label << "\n"
<< "\t.4byte " << json_to_string(layout, "primary_tileset") << "\n"
<< "\t.4byte " << json_to_string(layout, "secondary_tileset") << "\n\n";
<< "\t.4byte " << json_to_string(layout, "secondary_tileset") << "\n";
if (version == "firered") {
text << "\t.byte " << json_to_string(layout, "border_width") << "\n"
<< "\t.byte " << json_to_string(layout, "border_height") << "\n"
<< "\t.2byte 0\n";
}
text << "\n";
}
return text.str();
@@ -526,8 +567,11 @@ string generate_layouts_table_text(Json layouts_data) {
text << "\t.align 2\n"
<< json_to_string(layouts_data, "layouts_table_label") << "::\n";
for (auto &layout : layouts_data["layouts"].array_items())
text << "\t.4byte " << json_to_string(layout, "name") << "\n";
for (auto &layout : layouts_data["layouts"].array_items()) {
string layout_name = json_to_string(layout, "name", true);
if (layout_name.empty()) layout_name = "NULL";
text << "\t.4byte " << layout_name << "\n";
}
return text.str();
}
@@ -540,9 +584,12 @@ string generate_layouts_constants_text(Json layouts_data) {
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/layouts/layouts.json\n//\n\n";
int i = 0;
for (auto &layout : layouts_data["layouts"].array_items())
text << "#define " << json_to_string(layout, "id") << " " << ++i << "\n";
int i = 1;
for (auto &layout : layouts_data["layouts"].array_items()) {
if (layout != Json::object())
text << "#define " << json_to_string(layout, "id") << " " << i << "\n";
i++;
}
text << "\n#endif // GUARD_CONSTANTS_LAYOUTS_H\n";
@@ -573,9 +620,9 @@ int main(int argc, char *argv[]) {
FATAL_ERROR("USAGE: mapjson <mode> <game-version> [options]\n");
char *version_arg = argv[2];
string version(version_arg);
if (version != "emerald" && version != "ruby")
FATAL_ERROR("ERROR: <game-version> must be 'emerald' or 'ruby'.\n");
version = string(version_arg);
if (version != "emerald" && version != "ruby" && version != "firered")
FATAL_ERROR("ERROR: <game-version> must be 'emerald', 'firered', or 'ruby'.\n");
char *mode_arg = argv[1];
string mode(mode_arg);
@@ -589,7 +636,7 @@ int main(int argc, char *argv[]) {
string filepath(argv[3]);
string layouts_filepath(argv[4]);
process_map(filepath, layouts_filepath, version);
process_map(filepath, layouts_filepath);
}
else if (mode == "groups") {
if (argc != 4)
+3 -1
View File
@@ -41,6 +41,8 @@ AsmFile::AsmFile(std::string filename) : m_filename(filename)
if (m_size < 0)
FATAL_ERROR("File size of \"%s\" is less than zero.\n", filename.c_str());
else if (m_size == 0)
return; // Empty file
m_buffer = new char[m_size + 1];
@@ -73,7 +75,7 @@ AsmFile::AsmFile(AsmFile&& other) : m_filename(std::move(other.m_filename))
AsmFile::~AsmFile()
{
delete[] m_buffer;
if (m_size > 0) delete[] m_buffer;
}
// Removes comments to simplify further processing.
+6 -1
View File
@@ -36,6 +36,11 @@ AsmFile::AsmFile(std::string path)
m_size = std::ftell(fp);
if (m_size < 0)
FATAL_ERROR("File size of \"%s\" is less than zero.\n", path.c_str());
else if (m_size == 0)
return; // Empty file
m_buffer = new char[m_size];
std::rewind(fp);
@@ -51,7 +56,7 @@ AsmFile::AsmFile(std::string path)
AsmFile::~AsmFile()
{
delete[] m_buffer;
if (m_size > 0) delete[] m_buffer;
}
IncDirectiveType AsmFile::ReadUntilIncDirective(std::string &path)