This commit is contained in:
W1serV1ser committed 2023-03-10 15:41:32 -08:00
commit c07686871b
130 files changed
+4691 -4441

No files matched your search

+2 -1
View File
@@ -134,7 +134,8 @@ JSONPROC := tools/jsonproc/jsonproc$(EXE)
PERL := perl
TOOLDIRS := $(filter-out tools/agbcc tools/binutils,$(wildcard tools/*))
# 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
TOOLBASE = $(TOOLDIRS:tools/%=%)
TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE))
+6 -6
View File
@@ -1576,15 +1576,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
@@ -1932,10 +1932,10 @@
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
+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
@@ -795,7 +795,7 @@ MUS_LITTLEROOT = 95 01
MUS_MT_CHIMNEY = 96 01
MUS_ENCOUNTER_FEMALE = 97 01
MUS_LILYCOVE = 98 01
MUS_ROUTE111 = 99 01
MUS_DESERT = 99 01
MUS_HELP = 9A 01
MUS_UNDERWATER = 9B 01
MUS_VICTORY_TRAINER = 9C 01
-3
View File
@@ -1,5 +1,2 @@
gUnusedWindowVar1
gUnusedWindowVar2
gTransparentTileNumber
gUnusedWindowVar3
gWindowBgTilemapBuffers
+6 -3
View File
@@ -1099,15 +1099,18 @@ AI_CV_AttackDown3:
score -2
AI_CV_AttackDown4:
get_target_type1
if_in_bytes AI_CV_AttackDown_UnknownTypeList, AI_CV_AttackDown_End
if_in_bytes AI_CV_AttackDown_PhysicalTypeList, AI_CV_AttackDown_End
get_target_type2
if_in_bytes AI_CV_AttackDown_UnknownTypeList, AI_CV_AttackDown_End
if_in_bytes AI_CV_AttackDown_PhysicalTypeList, AI_CV_AttackDown_End
if_random_less_than 50, AI_CV_AttackDown_End
score -2
AI_CV_AttackDown_End:
end
AI_CV_AttackDown_UnknownTypeList:
@ If the target is not of any type in this list then using the move may be discouraged.
@ It seems likely this was meant to be "discourage reducing the target's attack if they're
@ not a physical type", but they've left out Flying, Poison, and Ghost.
AI_CV_AttackDown_PhysicalTypeList:
.byte TYPE_NORMAL
.byte TYPE_FIGHTING
.byte TYPE_GROUND
+2 -2
View File
@@ -65,7 +65,7 @@ BattleScript_SuccessBallThrow::
jumpifhalfword CMP_EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_PrintCaughtMonInfo
incrementgamestat GAME_STAT_POKEMON_CAPTURES
BattleScript_PrintCaughtMonInfo::
printstring STRINGID_GOTCHAPKMNCAUGHT
printstring STRINGID_GOTCHAPKMNCAUGHTPLAYER
trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
printstring STRINGID_PKMNDATAADDEDTODEX
waitstate
@@ -87,7 +87,7 @@ BattleScript_SuccessBallThrowEnd::
finishturn
BattleScript_WallyBallThrow::
printstring STRINGID_GOTCHAPKMNCAUGHT2
printstring STRINGID_GOTCHAPKMNCAUGHTWALLY
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn
+10 -7
View File
@@ -48,21 +48,24 @@ BirthIsland_Exterior_EventScript_Triangle::
special DoDeoxysRockInteraction
waitstate
switch VAR_RESULT
case 0, BirthIsland_Exterior_EventScript_NotSolved1
case 1, BirthIsland_Exterior_EventScript_NotSolved2
case 2, BirthIsland_Exterior_EventScript_Deoxys
case 3, BirthIsland_Exterior_EventScript_NotSolved3
case DEOXYS_ROCK_FAILED, BirthIsland_Exterior_EventScript_Failed
case DEOXYS_ROCK_PROGRESSED, BirthIsland_Exterior_EventScript_Progressed
case DEOXYS_ROCK_SOLVED, BirthIsland_Exterior_EventScript_Deoxys
case DEOXYS_ROCK_COMPLETE, BirthIsland_Exterior_EventScript_Complete
end
BirthIsland_Exterior_EventScript_NotSolved1::
@ The actual rock triangle movement is handled by DoDeoxysRockInteraction.
@ Unless the player has solved the puzzle and needs to encounter Deoxys,
@ there's nothing else the script needs to do.
BirthIsland_Exterior_EventScript_Failed::
release
end
BirthIsland_Exterior_EventScript_NotSolved2::
BirthIsland_Exterior_EventScript_Progressed::
release
end
BirthIsland_Exterior_EventScript_NotSolved3::
BirthIsland_Exterior_EventScript_Complete::
release
end
+24 -24
View File
@@ -26,26 +26,26 @@ MossdeepCity_Gym_EventScript_CheckSwitch4::
@ All the below set metatile scripts are leftover from RS and are functionally unused
MossdeepCity_Gym_EventScript_SetSwitch1Metatiles::
setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 5, 5, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 2, 7, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_CheckSwitch2
end
MossdeepCity_Gym_EventScript_SetSwitch2Metatiles::
setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 8, 14, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 8, 10, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_CheckSwitch3
end
MossdeepCity_Gym_EventScript_SetSwitch3Metatiles::
setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE
setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 15, 17, METATILE_RSMossdeepGym_RedArrow_Left, FALSE
setmetatile 17, 15, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_CheckSwitch4
end
MossdeepCity_Gym_EventScript_SetSwitch4Metatiles::
setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Up, FALSE
setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 1, 23, METATILE_RSMossdeepGym_RedArrow_Up, FALSE
setmetatile 5, 24, METATILE_RSMossdeepGym_Switch_Down, TRUE
end
MossdeepCity_Gym_EventScript_TateAndLiza::
@@ -116,8 +116,8 @@ MossdeepCity_Gym_EventScript_Switch1::
setflag FLAG_MOSSDEEP_GYM_SWITCH_1
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 5, 5, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 2, 7, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@@ -131,8 +131,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch1::
clearflag FLAG_MOSSDEEP_GYM_SWITCH_1
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE
setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Up, TRUE
setmetatile 5, 5, METATILE_RSMossdeepGym_RedArrow_Left, FALSE
setmetatile 2, 7, METATILE_RSMossdeepGym_Switch_Up, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@@ -142,8 +142,8 @@ MossdeepCity_Gym_EventScript_Switch2::
setflag FLAG_MOSSDEEP_GYM_SWITCH_2
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 8, 14, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 8, 10, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@@ -151,8 +151,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch2::
clearflag FLAG_MOSSDEEP_GYM_SWITCH_2
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Down, FALSE
setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Up, TRUE
setmetatile 8, 14, METATILE_RSMossdeepGym_RedArrow_Down, FALSE
setmetatile 8, 10, METATILE_RSMossdeepGym_Switch_Up, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@@ -162,8 +162,8 @@ MossdeepCity_Gym_EventScript_Switch3::
setflag FLAG_MOSSDEEP_GYM_SWITCH_3
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE
setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 15, 17, METATILE_RSMossdeepGym_RedArrow_Left, FALSE
setmetatile 17, 15, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@@ -171,8 +171,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch3::
clearflag FLAG_MOSSDEEP_GYM_SWITCH_3
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Up, TRUE
setmetatile 15, 17, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 17, 15, METATILE_RSMossdeepGym_Switch_Up, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@@ -182,8 +182,8 @@ MossdeepCity_Gym_EventScript_Switch4::
setflag FLAG_MOSSDEEP_GYM_SWITCH_4
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Up, FALSE
setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Down, TRUE
setmetatile 1, 23, METATILE_RSMossdeepGym_RedArrow_Up, FALSE
setmetatile 5, 24, METATILE_RSMossdeepGym_Switch_Down, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
@@ -191,8 +191,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch4::
clearflag FLAG_MOSSDEEP_GYM_SWITCH_4
applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse
waitmovement 0
setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE
setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Up, TRUE
setmetatile 1, 23, METATILE_RSMossdeepGym_RedArrow_Right, FALSE
setmetatile 5, 24, METATILE_RSMossdeepGym_Switch_Up, TRUE
goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed
end
+1 -1
View File
@@ -38,7 +38,7 @@ PetalburgCity_OnFrame:
PetalburgCity_EventScript_WallyTutorial::
lockall
special SavePlayerParty
special PutZigzagoonInPlayerParty
special LoadWallyZigzagoon
applymovement LOCALID_WALLY, PetalburgCity_Movement_WallyTutorialWally
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_WallyTutorialPlayer
waitmovement 0
+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
@@ -260,7 +260,7 @@ Route111_EventScript_SunTrigger::
Route111_EventScript_SandstormTrigger::
setweather WEATHER_SANDSTORM
fadenewbgm MUS_ROUTE111
fadenewbgm MUS_DESERT
doweather
end
+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"
}
]
}
+227 -227
View File
@@ -1,232 +1,232 @@
.align 2
gScriptCmdTable::
.4byte ScrCmd_nop @ 0x00
.4byte ScrCmd_nop1 @ 0x01
.4byte ScrCmd_end @ 0x02
.4byte ScrCmd_return @ 0x03
.4byte ScrCmd_call @ 0x04
.4byte ScrCmd_goto @ 0x05
.4byte ScrCmd_goto_if @ 0x06
.4byte ScrCmd_call_if @ 0x07
.4byte ScrCmd_gotostd @ 0x08
.4byte ScrCmd_callstd @ 0x09
.4byte ScrCmd_gotostd_if @ 0x0a
.4byte ScrCmd_callstd_if @ 0x0b
.4byte ScrCmd_returnram @ 0x0c
.4byte ScrCmd_endram @ 0x0d
.4byte ScrCmd_setmysteryeventstatus @ 0x0e
.4byte ScrCmd_loadword @ 0x0f
.4byte ScrCmd_loadbyte @ 0x10
.4byte ScrCmd_setptr @ 0x11
.4byte ScrCmd_loadbytefromptr @ 0x12
.4byte ScrCmd_setptrbyte @ 0x13
.4byte ScrCmd_copylocal @ 0x14
.4byte ScrCmd_copybyte @ 0x15
.4byte ScrCmd_setvar @ 0x16
.4byte ScrCmd_addvar @ 0x17
.4byte ScrCmd_subvar @ 0x18
.4byte ScrCmd_copyvar @ 0x19
.4byte ScrCmd_setorcopyvar @ 0x1a
.4byte ScrCmd_compare_local_to_local @ 0x1b
.4byte ScrCmd_compare_local_to_value @ 0x1c
.4byte ScrCmd_compare_local_to_ptr @ 0x1d
.4byte ScrCmd_compare_ptr_to_local @ 0x1e
.4byte ScrCmd_compare_ptr_to_value @ 0x1f
.4byte ScrCmd_compare_ptr_to_ptr @ 0x20
.4byte ScrCmd_compare_var_to_value @ 0x21
.4byte ScrCmd_compare_var_to_var @ 0x22
.4byte ScrCmd_callnative @ 0x23
.4byte ScrCmd_gotonative @ 0x24
.4byte ScrCmd_special @ 0x25
.4byte ScrCmd_specialvar @ 0x26
.4byte ScrCmd_waitstate @ 0x27
.4byte ScrCmd_delay @ 0x28
.4byte ScrCmd_setflag @ 0x29
.4byte ScrCmd_clearflag @ 0x2a
.4byte ScrCmd_checkflag @ 0x2b
.4byte ScrCmd_initclock @ 0x2c
.4byte ScrCmd_dotimebasedevents @ 0x2d
.4byte ScrCmd_gettime @ 0x2e
.4byte ScrCmd_playse @ 0x2f
.4byte ScrCmd_waitse @ 0x30
.4byte ScrCmd_playfanfare @ 0x31
.4byte ScrCmd_waitfanfare @ 0x32
.4byte ScrCmd_playbgm @ 0x33
.4byte ScrCmd_savebgm @ 0x34
.4byte ScrCmd_fadedefaultbgm @ 0x35
.4byte ScrCmd_fadenewbgm @ 0x36
.4byte ScrCmd_fadeoutbgm @ 0x37
.4byte ScrCmd_fadeinbgm @ 0x38
.4byte ScrCmd_warp @ 0x39
.4byte ScrCmd_warpsilent @ 0x3a
.4byte ScrCmd_warpdoor @ 0x3b
.4byte ScrCmd_warphole @ 0x3c
.4byte ScrCmd_warpteleport @ 0x3d
.4byte ScrCmd_setwarp @ 0x3e
.4byte ScrCmd_setdynamicwarp @ 0x3f
.4byte ScrCmd_setdivewarp @ 0x40
.4byte ScrCmd_setholewarp @ 0x41
.4byte ScrCmd_getplayerxy @ 0x42
.4byte ScrCmd_getpartysize @ 0x43
.4byte ScrCmd_additem @ 0x44
.4byte ScrCmd_removeitem @ 0x45
.4byte ScrCmd_checkitemspace @ 0x46
.4byte ScrCmd_checkitem @ 0x47
.4byte ScrCmd_checkitemtype @ 0x48
.4byte ScrCmd_addpcitem @ 0x49
.4byte ScrCmd_checkpcitem @ 0x4a
.4byte ScrCmd_adddecoration @ 0x4b
.4byte ScrCmd_removedecoration @ 0x4c
.4byte ScrCmd_checkdecor @ 0x4d
.4byte ScrCmd_checkdecorspace @ 0x4e
.4byte ScrCmd_applymovement @ 0x4f
.4byte ScrCmd_applymovementat @ 0x50
.4byte ScrCmd_waitmovement @ 0x51
.4byte ScrCmd_waitmovementat @ 0x52
.4byte ScrCmd_removeobject @ 0x53
.4byte ScrCmd_removeobjectat @ 0x54
.4byte ScrCmd_addobject @ 0x55
.4byte ScrCmd_addobjectat @ 0x56
.4byte ScrCmd_setobjectxy @ 0x57
.4byte ScrCmd_showobjectat @ 0x58
.4byte ScrCmd_hideobjectat @ 0x59
.4byte ScrCmd_faceplayer @ 0x5a
.4byte ScrCmd_turnobject @ 0x5b
.4byte ScrCmd_trainerbattle @ 0x5c
.4byte ScrCmd_dotrainerbattle @ 0x5d
.4byte ScrCmd_gotopostbattlescript @ 0x5e
.4byte ScrCmd_gotobeatenscript @ 0x5f
.4byte ScrCmd_checktrainerflag @ 0x60
.4byte ScrCmd_settrainerflag @ 0x61
.4byte ScrCmd_cleartrainerflag @ 0x62
.4byte ScrCmd_setobjectxyperm @ 0x63
.4byte ScrCmd_copyobjectxytoperm @ 0x64
.4byte ScrCmd_setobjectmovementtype @ 0x65
.4byte ScrCmd_waitmessage @ 0x66
.4byte ScrCmd_message @ 0x67
.4byte ScrCmd_closemessage @ 0x68
.4byte ScrCmd_lockall @ 0x69
.4byte ScrCmd_lock @ 0x6a
.4byte ScrCmd_releaseall @ 0x6b
.4byte ScrCmd_release @ 0x6c
.4byte ScrCmd_waitbuttonpress @ 0x6d
.4byte ScrCmd_yesnobox @ 0x6e
.4byte ScrCmd_multichoice @ 0x6f
.4byte ScrCmd_multichoicedefault @ 0x70
.4byte ScrCmd_multichoicegrid @ 0x71
.4byte ScrCmd_drawbox @ 0x72
.4byte ScrCmd_erasebox @ 0x73
.4byte ScrCmd_drawboxtext @ 0x74
.4byte ScrCmd_showmonpic @ 0x75
.4byte ScrCmd_hidemonpic @ 0x76
.4byte ScrCmd_showcontestpainting @ 0x77
.4byte ScrCmd_braillemessage @ 0x78
.4byte ScrCmd_givemon @ 0x79
.4byte ScrCmd_giveegg @ 0x7a
.4byte ScrCmd_setmonmove @ 0x7b
.4byte ScrCmd_checkpartymove @ 0x7c
.4byte ScrCmd_bufferspeciesname @ 0x7d
.4byte ScrCmd_bufferleadmonspeciesname @ 0x7e
.4byte ScrCmd_bufferpartymonnick @ 0x7f
.4byte ScrCmd_bufferitemname @ 0x80
.4byte ScrCmd_bufferdecorationname @ 0x81
.4byte ScrCmd_buffermovename @ 0x82
.4byte ScrCmd_buffernumberstring @ 0x83
.4byte ScrCmd_bufferstdstring @ 0x84
.4byte ScrCmd_bufferstring @ 0x85
.4byte ScrCmd_pokemart @ 0x86
.4byte ScrCmd_pokemartdecoration @ 0x87
.4byte ScrCmd_pokemartdecoration2 @ 0x88
.4byte ScrCmd_playslotmachine @ 0x89
.4byte ScrCmd_setberrytree @ 0x8a
.4byte ScrCmd_choosecontestmon @ 0x8b
.4byte ScrCmd_startcontest @ 0x8c
.4byte ScrCmd_showcontestresults @ 0x8d
.4byte ScrCmd_contestlinktransfer @ 0x8e
.4byte ScrCmd_random @ 0x8f
.4byte ScrCmd_addmoney @ 0x90
.4byte ScrCmd_removemoney @ 0x91
.4byte ScrCmd_checkmoney @ 0x92
.4byte ScrCmd_showmoneybox @ 0x93
.4byte ScrCmd_hidemoneybox @ 0x94
.4byte ScrCmd_updatemoneybox @ 0x95
.4byte ScrCmd_getpokenewsactive @ 0x96
.4byte ScrCmd_fadescreen @ 0x97
.4byte ScrCmd_fadescreenspeed @ 0x98
.4byte ScrCmd_setflashlevel @ 0x99
.4byte ScrCmd_animateflash @ 0x9a
.4byte ScrCmd_messageautoscroll @ 0x9b
.4byte ScrCmd_dofieldeffect @ 0x9c
.4byte ScrCmd_setfieldeffectargument @ 0x9d
.4byte ScrCmd_waitfieldeffect @ 0x9e
.4byte ScrCmd_setrespawn @ 0x9f
.4byte ScrCmd_checkplayergender @ 0xa0
.4byte ScrCmd_playmoncry @ 0xa1
.4byte ScrCmd_setmetatile @ 0xa2
.4byte ScrCmd_resetweather @ 0xa3
.4byte ScrCmd_setweather @ 0xa4
.4byte ScrCmd_doweather @ 0xa5
.4byte ScrCmd_setstepcallback @ 0xa6
.4byte ScrCmd_setmaplayoutindex @ 0xa7
.4byte ScrCmd_setobjectsubpriority @ 0xa8
.4byte ScrCmd_resetobjectsubpriority @ 0xa9
.4byte ScrCmd_createvobject @ 0xaa
.4byte ScrCmd_turnvobject @ 0xab
.4byte ScrCmd_opendoor @ 0xac
.4byte ScrCmd_closedoor @ 0xad
.4byte ScrCmd_waitdooranim @ 0xae
.4byte ScrCmd_setdooropen @ 0xaf
.4byte ScrCmd_setdoorclosed @ 0xb0
.4byte ScrCmd_addelevmenuitem @ 0xb1
.4byte ScrCmd_showelevmenu @ 0xb2
.4byte ScrCmd_checkcoins @ 0xb3
.4byte ScrCmd_addcoins @ 0xb4
.4byte ScrCmd_removecoins @ 0xb5
.4byte ScrCmd_setwildbattle @ 0xb6
.4byte ScrCmd_dowildbattle @ 0xb7
.4byte ScrCmd_setvaddress @ 0xb8
.4byte ScrCmd_vgoto @ 0xb9
.4byte ScrCmd_vcall @ 0xba
.4byte ScrCmd_vgoto_if @ 0xbb
.4byte ScrCmd_vcall_if @ 0xbc
.4byte ScrCmd_vmessage @ 0xbd
.4byte ScrCmd_vbuffermessage @ 0xbe
.4byte ScrCmd_vbufferstring @ 0xbf
.4byte ScrCmd_showcoinsbox @ 0xc0
.4byte ScrCmd_hidecoinsbox @ 0xc1
.4byte ScrCmd_updatecoinsbox @ 0xc2
.4byte ScrCmd_incrementgamestat @ 0xc3
.4byte ScrCmd_setescapewarp @ 0xc4
.4byte ScrCmd_waitmoncry @ 0xc5
.4byte ScrCmd_bufferboxname @ 0xc6
.4byte ScrCmd_nop1 @ 0xc7
.4byte ScrCmd_nop1 @ 0xc8
.4byte ScrCmd_nop1 @ 0xc9
.4byte ScrCmd_nop1 @ 0xca
.4byte ScrCmd_nop1 @ 0xcb
.4byte ScrCmd_nop1 @ 0xcc
.4byte ScrCmd_setmoneventlegal @ 0xcd
.4byte ScrCmd_checkmoneventlegal @ 0xce
.4byte ScrCmd_trywondercardscript @ 0xcf
.4byte ScrCmd_nop1 @ 0xd0
.4byte ScrCmd_warpspinenter @ 0xd1
.4byte ScrCmd_setmonmetlocation @ 0xd2
.4byte ScrCmd_moverotatingtileobjects @ 0xd3
.4byte ScrCmd_turnrotatingtileobjects @ 0xd4
.4byte ScrCmd_initrotatingtilepuzzle @ 0xd5
.4byte ScrCmd_freerotatingtilepuzzle @ 0xd6
.4byte ScrCmd_warpmossdeepgym @ 0xd7
.4byte ScrCmd_selectapproachingtrainer @ 0xd8
.4byte ScrCmd_lockfortrainer @ 0xd9
.4byte ScrCmd_closebraillemessage @ 0xda
.4byte ScrCmd_messageinstant @ 0xdb
.4byte ScrCmd_fadescreenswapbuffers @ 0xdc
.4byte ScrCmd_buffertrainerclassname @ 0xdd
.4byte ScrCmd_buffertrainername @ 0xde
.4byte ScrCmd_pokenavcall @ 0xdf
.4byte ScrCmd_warpwhitefade @ 0xe0
.4byte ScrCmd_buffercontestname @ 0xe1
.4byte ScrCmd_bufferitemnameplural @ 0xe2
.4byte ScrCmd_nop @ 0x00
.4byte ScrCmd_nop1 @ 0x01
.4byte ScrCmd_end @ 0x02
.4byte ScrCmd_return @ 0x03
.4byte ScrCmd_call @ 0x04
.4byte ScrCmd_goto @ 0x05
.4byte ScrCmd_goto_if @ 0x06
.4byte ScrCmd_call_if @ 0x07
.4byte ScrCmd_gotostd @ 0x08
.4byte ScrCmd_callstd @ 0x09
.4byte ScrCmd_gotostd_if @ 0x0a
.4byte ScrCmd_callstd_if @ 0x0b
.4byte ScrCmd_returnram @ 0x0c
.4byte ScrCmd_endram @ 0x0d
.4byte ScrCmd_setmysteryeventstatus @ 0x0e
.4byte ScrCmd_loadword @ 0x0f
.4byte ScrCmd_loadbyte @ 0x10
.4byte ScrCmd_setptr @ 0x11
.4byte ScrCmd_loadbytefromptr @ 0x12
.4byte ScrCmd_setptrbyte @ 0x13
.4byte ScrCmd_copylocal @ 0x14
.4byte ScrCmd_copybyte @ 0x15
.4byte ScrCmd_setvar @ 0x16
.4byte ScrCmd_addvar @ 0x17
.4byte ScrCmd_subvar @ 0x18
.4byte ScrCmd_copyvar @ 0x19
.4byte ScrCmd_setorcopyvar @ 0x1a
.4byte ScrCmd_compare_local_to_local @ 0x1b
.4byte ScrCmd_compare_local_to_value @ 0x1c
.4byte ScrCmd_compare_local_to_ptr @ 0x1d
.4byte ScrCmd_compare_ptr_to_local @ 0x1e
.4byte ScrCmd_compare_ptr_to_value @ 0x1f
.4byte ScrCmd_compare_ptr_to_ptr @ 0x20
.4byte ScrCmd_compare_var_to_value @ 0x21
.4byte ScrCmd_compare_var_to_var @ 0x22
.4byte ScrCmd_callnative @ 0x23
.4byte ScrCmd_gotonative @ 0x24
.4byte ScrCmd_special @ 0x25
.4byte ScrCmd_specialvar @ 0x26
.4byte ScrCmd_waitstate @ 0x27
.4byte ScrCmd_delay @ 0x28
.4byte ScrCmd_setflag @ 0x29
.4byte ScrCmd_clearflag @ 0x2a
.4byte ScrCmd_checkflag @ 0x2b
.4byte ScrCmd_initclock @ 0x2c
.4byte ScrCmd_dotimebasedevents @ 0x2d
.4byte ScrCmd_gettime @ 0x2e
.4byte ScrCmd_playse @ 0x2f
.4byte ScrCmd_waitse @ 0x30
.4byte ScrCmd_playfanfare @ 0x31
.4byte ScrCmd_waitfanfare @ 0x32
.4byte ScrCmd_playbgm @ 0x33
.4byte ScrCmd_savebgm @ 0x34
.4byte ScrCmd_fadedefaultbgm @ 0x35
.4byte ScrCmd_fadenewbgm @ 0x36
.4byte ScrCmd_fadeoutbgm @ 0x37
.4byte ScrCmd_fadeinbgm @ 0x38
.4byte ScrCmd_warp @ 0x39
.4byte ScrCmd_warpsilent @ 0x3a
.4byte ScrCmd_warpdoor @ 0x3b
.4byte ScrCmd_warphole @ 0x3c
.4byte ScrCmd_warpteleport @ 0x3d
.4byte ScrCmd_setwarp @ 0x3e
.4byte ScrCmd_setdynamicwarp @ 0x3f
.4byte ScrCmd_setdivewarp @ 0x40
.4byte ScrCmd_setholewarp @ 0x41
.4byte ScrCmd_getplayerxy @ 0x42
.4byte ScrCmd_getpartysize @ 0x43
.4byte ScrCmd_additem @ 0x44
.4byte ScrCmd_removeitem @ 0x45
.4byte ScrCmd_checkitemspace @ 0x46
.4byte ScrCmd_checkitem @ 0x47
.4byte ScrCmd_checkitemtype @ 0x48
.4byte ScrCmd_addpcitem @ 0x49
.4byte ScrCmd_checkpcitem @ 0x4a
.4byte ScrCmd_adddecoration @ 0x4b
.4byte ScrCmd_removedecoration @ 0x4c
.4byte ScrCmd_checkdecor @ 0x4d
.4byte ScrCmd_checkdecorspace @ 0x4e
.4byte ScrCmd_applymovement @ 0x4f
.4byte ScrCmd_applymovementat @ 0x50
.4byte ScrCmd_waitmovement @ 0x51
.4byte ScrCmd_waitmovementat @ 0x52
.4byte ScrCmd_removeobject @ 0x53
.4byte ScrCmd_removeobjectat @ 0x54
.4byte ScrCmd_addobject @ 0x55
.4byte ScrCmd_addobjectat @ 0x56
.4byte ScrCmd_setobjectxy @ 0x57
.4byte ScrCmd_showobjectat @ 0x58
.4byte ScrCmd_hideobjectat @ 0x59
.4byte ScrCmd_faceplayer @ 0x5a
.4byte ScrCmd_turnobject @ 0x5b
.4byte ScrCmd_trainerbattle @ 0x5c
.4byte ScrCmd_dotrainerbattle @ 0x5d
.4byte ScrCmd_gotopostbattlescript @ 0x5e
.4byte ScrCmd_gotobeatenscript @ 0x5f
.4byte ScrCmd_checktrainerflag @ 0x60
.4byte ScrCmd_settrainerflag @ 0x61
.4byte ScrCmd_cleartrainerflag @ 0x62
.4byte ScrCmd_setobjectxyperm @ 0x63
.4byte ScrCmd_copyobjectxytoperm @ 0x64
.4byte ScrCmd_setobjectmovementtype @ 0x65
.4byte ScrCmd_waitmessage @ 0x66
.4byte ScrCmd_message @ 0x67
.4byte ScrCmd_closemessage @ 0x68
.4byte ScrCmd_lockall @ 0x69
.4byte ScrCmd_lock @ 0x6a
.4byte ScrCmd_releaseall @ 0x6b
.4byte ScrCmd_release @ 0x6c
.4byte ScrCmd_waitbuttonpress @ 0x6d
.4byte ScrCmd_yesnobox @ 0x6e
.4byte ScrCmd_multichoice @ 0x6f
.4byte ScrCmd_multichoicedefault @ 0x70
.4byte ScrCmd_multichoicegrid @ 0x71
.4byte ScrCmd_drawbox @ 0x72
.4byte ScrCmd_erasebox @ 0x73
.4byte ScrCmd_drawboxtext @ 0x74
.4byte ScrCmd_showmonpic @ 0x75
.4byte ScrCmd_hidemonpic @ 0x76
.4byte ScrCmd_showcontestpainting @ 0x77
.4byte ScrCmd_braillemessage @ 0x78
.4byte ScrCmd_givemon @ 0x79
.4byte ScrCmd_giveegg @ 0x7a
.4byte ScrCmd_setmonmove @ 0x7b
.4byte ScrCmd_checkpartymove @ 0x7c
.4byte ScrCmd_bufferspeciesname @ 0x7d
.4byte ScrCmd_bufferleadmonspeciesname @ 0x7e
.4byte ScrCmd_bufferpartymonnick @ 0x7f
.4byte ScrCmd_bufferitemname @ 0x80
.4byte ScrCmd_bufferdecorationname @ 0x81
.4byte ScrCmd_buffermovename @ 0x82
.4byte ScrCmd_buffernumberstring @ 0x83
.4byte ScrCmd_bufferstdstring @ 0x84
.4byte ScrCmd_bufferstring @ 0x85
.4byte ScrCmd_pokemart @ 0x86
.4byte ScrCmd_pokemartdecoration @ 0x87
.4byte ScrCmd_pokemartdecoration2 @ 0x88
.4byte ScrCmd_playslotmachine @ 0x89
.4byte ScrCmd_setberrytree @ 0x8a
.4byte ScrCmd_choosecontestmon @ 0x8b
.4byte ScrCmd_startcontest @ 0x8c
.4byte ScrCmd_showcontestresults @ 0x8d
.4byte ScrCmd_contestlinktransfer @ 0x8e
.4byte ScrCmd_random @ 0x8f
.4byte ScrCmd_addmoney @ 0x90
.4byte ScrCmd_removemoney @ 0x91
.4byte ScrCmd_checkmoney @ 0x92
.4byte ScrCmd_showmoneybox @ 0x93
.4byte ScrCmd_hidemoneybox @ 0x94
.4byte ScrCmd_updatemoneybox @ 0x95
.4byte ScrCmd_getpokenewsactive @ 0x96
.4byte ScrCmd_fadescreen @ 0x97
.4byte ScrCmd_fadescreenspeed @ 0x98
.4byte ScrCmd_setflashlevel @ 0x99
.4byte ScrCmd_animateflash @ 0x9a
.4byte ScrCmd_messageautoscroll @ 0x9b
.4byte ScrCmd_dofieldeffect @ 0x9c
.4byte ScrCmd_setfieldeffectargument @ 0x9d
.4byte ScrCmd_waitfieldeffect @ 0x9e
.4byte ScrCmd_setrespawn @ 0x9f
.4byte ScrCmd_checkplayergender @ 0xa0
.4byte ScrCmd_playmoncry @ 0xa1
.4byte ScrCmd_setmetatile @ 0xa2
.4byte ScrCmd_resetweather @ 0xa3
.4byte ScrCmd_setweather @ 0xa4
.4byte ScrCmd_doweather @ 0xa5
.4byte ScrCmd_setstepcallback @ 0xa6
.4byte ScrCmd_setmaplayoutindex @ 0xa7
.4byte ScrCmd_setobjectsubpriority @ 0xa8
.4byte ScrCmd_resetobjectsubpriority @ 0xa9
.4byte ScrCmd_createvobject @ 0xaa
.4byte ScrCmd_turnvobject @ 0xab
.4byte ScrCmd_opendoor @ 0xac
.4byte ScrCmd_closedoor @ 0xad
.4byte ScrCmd_waitdooranim @ 0xae
.4byte ScrCmd_setdooropen @ 0xaf
.4byte ScrCmd_setdoorclosed @ 0xb0
.4byte ScrCmd_addelevmenuitem @ 0xb1
.4byte ScrCmd_showelevmenu @ 0xb2
.4byte ScrCmd_checkcoins @ 0xb3
.4byte ScrCmd_addcoins @ 0xb4
.4byte ScrCmd_removecoins @ 0xb5
.4byte ScrCmd_setwildbattle @ 0xb6
.4byte ScrCmd_dowildbattle @ 0xb7
.4byte ScrCmd_setvaddress @ 0xb8
.4byte ScrCmd_vgoto @ 0xb9
.4byte ScrCmd_vcall @ 0xba
.4byte ScrCmd_vgoto_if @ 0xbb
.4byte ScrCmd_vcall_if @ 0xbc
.4byte ScrCmd_vmessage @ 0xbd
.4byte ScrCmd_vbuffermessage @ 0xbe
.4byte ScrCmd_vbufferstring @ 0xbf
.4byte ScrCmd_showcoinsbox @ 0xc0
.4byte ScrCmd_hidecoinsbox @ 0xc1
.4byte ScrCmd_updatecoinsbox @ 0xc2
.4byte ScrCmd_incrementgamestat @ 0xc3
.4byte ScrCmd_setescapewarp @ 0xc4
.4byte ScrCmd_waitmoncry @ 0xc5
.4byte ScrCmd_bufferboxname @ 0xc6
.4byte ScrCmd_nop1 @ 0xc7
.4byte ScrCmd_nop1 @ 0xc8
.4byte ScrCmd_nop1 @ 0xc9
.4byte ScrCmd_nop1 @ 0xca
.4byte ScrCmd_nop1 @ 0xcb
.4byte ScrCmd_nop1 @ 0xcc
.4byte ScrCmd_setmonmodernfatefulencounter @ 0xcd
.4byte ScrCmd_checkmonmodernfatefulencounter @ 0xce
.4byte ScrCmd_trywondercardscript @ 0xcf
.4byte ScrCmd_nop1 @ 0xd0
.4byte ScrCmd_warpspinenter @ 0xd1
.4byte ScrCmd_setmonmetlocation @ 0xd2
.4byte ScrCmd_moverotatingtileobjects @ 0xd3
.4byte ScrCmd_turnrotatingtileobjects @ 0xd4
.4byte ScrCmd_initrotatingtilepuzzle @ 0xd5
.4byte ScrCmd_freerotatingtilepuzzle @ 0xd6
.4byte ScrCmd_warpmossdeepgym @ 0xd7
.4byte ScrCmd_selectapproachingtrainer @ 0xd8
.4byte ScrCmd_lockfortrainer @ 0xd9
.4byte ScrCmd_closebraillemessage @ 0xda
.4byte ScrCmd_messageinstant @ 0xdb
.4byte ScrCmd_fadescreenswapbuffers @ 0xdc
.4byte ScrCmd_buffertrainerclassname @ 0xdd
.4byte ScrCmd_buffertrainername @ 0xde
.4byte ScrCmd_pokenavcall @ 0xdf
.4byte ScrCmd_warpwhitefade @ 0xe0
.4byte ScrCmd_buffercontestname @ 0xe1
.4byte ScrCmd_bufferitemnameplural @ 0xe2
gScriptCmdTableEnd::
.4byte ScrCmd_nop
+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
+2 -2
View File
@@ -311,7 +311,7 @@ gSpecials::
def_special TryUpdateRusturfTunnelState
def_special IsGrassTypeInParty
def_special DoContestHallWarp
def_special PutZigzagoonInPlayerParty
def_special LoadWallyZigzagoon
def_special IsStarterInParty
def_special CopyCurSecretBaseOwnerName_StrVar1
def_special ScriptCheckFreePokemonStorageSpace
@@ -490,7 +490,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
-3
View File
@@ -4,11 +4,8 @@
#include "bg.h"
#include "blit.h"
u32 gUnusedWindowVar1;
u32 gUnusedWindowVar2;
// This global is set to 0 and never changed.
u8 gTransparentTileNumber;
u32 gUnusedWindowVar3;
void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS];
extern u32 gWindowTileAutoAllocEnabled;
-3
View File
@@ -74,8 +74,5 @@ void CopyWindowToVram8Bit(u8 windowId, u8 mode);
extern struct Window gWindows[];
extern void *gWindowBgTilemapBuffers[];
extern u32 gUnusedWindowVar1;
extern u32 gUnusedWindowVar2;
extern u32 gUnusedWindowVar3;
#endif // GUARD_WINDOW_H
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
@@ -593,7 +593,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;
+1 -1
View File
@@ -148,7 +148,7 @@ void AnimThrowProjectile(struct Sprite *sprite);
void GetBgDataForTransform(struct BattleAnimBgData *dest, u8 battlerId);
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm);
void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite);
void TradeMenuBouncePartySprites(struct Sprite *sprite);
void Trade_MoveSelectedMonToTarget(struct Sprite *sprite);
void DestroyAnimVisualTaskAndDisableBlend(u8 taskId);
void DestroySpriteAndFreeResources_(struct Sprite *sprite);
void SetBattlerSpriteYOffsetFromOtherYScale(u8 spriteId, u8 otherSpriteId);
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_BATTLE_PYRAMID_H
#define GUARD_CONSTANTS_BATTLE_PYRAMID_H
#define TOTAL_ROUNDS 20
#define TOTAL_PYRAMID_ROUNDS 20
#define PICKUP_ITEMS_PER_ROUND 10
#define HINT_EXIT_DIRECTION 0
+2 -2
View File
@@ -264,8 +264,8 @@
#define STRINGID_ITAPPEAREDCAUGHT 264
#define STRINGID_AARGHALMOSTHADIT 265
#define STRINGID_SHOOTSOCLOSE 266
#define STRINGID_GOTCHAPKMNCAUGHT 267
#define STRINGID_GOTCHAPKMNCAUGHT2 268
#define STRINGID_GOTCHAPKMNCAUGHTPLAYER 267
#define STRINGID_GOTCHAPKMNCAUGHTWALLY 268
#define STRINGID_GIVENICKNAMECAPTURED 269
#define STRINGID_PKMNSENTTOPC 270
#define STRINGID_PKMNDATAADDEDTODEX 271
+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
+6
View File
@@ -80,4 +80,10 @@
#define FANCOUNTER_FINISHED_CONTEST 2
#define FANCOUNTER_USED_BATTLE_TOWER 3
// Return values for DoDeoxysRockInteraction
#define DEOXYS_ROCK_FAILED 0
#define DEOXYS_ROCK_PROGRESSED 1
#define DEOXYS_ROCK_SOLVED 2
#define DEOXYS_ROCK_COMPLETE 3
#endif // GUARD_CONSTANTS_FIELD_SPECIALS_H
+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
File diff suppressed because it is too large. Load diff
+8
View File
@@ -260,6 +260,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
+49 -49
View File
@@ -278,47 +278,47 @@
#define SE_SUDOWOODO_SHAKE 269 // SE_USSOKI
// Music
#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI
#define MUS_GSC_ROUTE38 351 // MUS_FIELD13
#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI // Unused, likely a test track.
#define MUS_GSC_ROUTE38 351 // MUS_FIELD13 // Unused, likely a test track.
#define MUS_CAUGHT 352 // MUS_KACHI22
#define MUS_VICTORY_WILD 353 // MUS_KACHI2
#define MUS_VICTORY_GYM_LEADER 354 // MUS_KACHI3
#define MUS_VICTORY_GYM_LEADER 354 // MUS_KACHI3 // Also used in Frontier Brain victories.
#define MUS_VICTORY_LEAGUE 355 // MUS_KACHI5
#define MUS_C_COMM_CENTER 356 // MUS_PCC
#define MUS_GSC_PEWTER 357 // MUS_NIBI
#define MUS_C_VS_LEGEND_BEAST 358 // MUS_SUIKUN
#define MUS_ROUTE101 359 // MUS_DOORO1
#define MUS_ROUTE110 360 // MUS_DOORO_X1
#define MUS_ROUTE120 361 // MUS_DOORO_X3
#define MUS_PETALBURG 362 // MUS_MACHI_S2
#define MUS_OLDALE 363 // MUS_MACHI_S4
#define MUS_C_COMM_CENTER 356 // MUS_PCC // Unused, likely a test track.
#define MUS_GSC_PEWTER 357 // MUS_NIBI // Used in unused Contest Halls.
#define MUS_C_VS_LEGEND_BEAST 358 // MUS_SUIKUN // Unused, likely a test track.
#define MUS_ROUTE101 359 // MUS_DOORO1 // Also used in Routes 102 and 103.
#define MUS_ROUTE110 360 // MUS_DOORO_X1 // Also used in Routes 112, 114, 117, 111's non-desert section and 118's west half.
#define MUS_ROUTE120 361 // MUS_DOORO_X3 // Also used in Routes 121, 124, 125, 126, 127 and 128.
#define MUS_PETALBURG 362 // MUS_MACHI_S2 // Also used in Mr. Briney's House and Pretty Petal Flower Shop.
#define MUS_OLDALE 363 // MUS_MACHI_S4 // Also used in Lavaridge Town.
#define MUS_GYM 364 // MUS_GIM
#define MUS_SURF 365 // MUS_NAMINORI
#define MUS_PETALBURG_WOODS 366 // MUS_DAN01
#define MUS_PETALBURG_WOODS 366 // MUS_DAN01 // Also used in Artisan Cave, Fiery Path, Granite Cave, Jagged Pass, Marine Cave, Rusturf Tunnel, Scorched Slab and Terra Cave.
#define MUS_LEVEL_UP 367 // MUS_FANFA1
#define MUS_HEAL 368 // MUS_ME_ASA
#define MUS_OBTAIN_BADGE 369 // MUS_ME_BACHI
#define MUS_OBTAIN_ITEM 370 // MUS_FANFA4
#define MUS_EVOLVED 371 // MUS_FANFA5
#define MUS_EVOLVED 371 // MUS_FANFA5 // Also used in egg hatching, trades and upon catching.
#define MUS_OBTAIN_TMHM 372 // MUS_ME_WAZA
#define MUS_LILYCOVE_MUSEUM 373 // MUS_BIJYUTU
#define MUS_ROUTE122 374 // MUS_DOORO_X4
#define MUS_LILYCOVE_MUSEUM 373 // MUS_BIJYUTU // Also used in the Battle Frontier's Ranking Hall.
#define MUS_ROUTE122 374 // MUS_DOORO_X4 // Also used in Route 123 and Birch's intro speech.
#define MUS_OCEANIC_MUSEUM 375 // MUS_FUNE_KAN
#define MUS_EVOLUTION_INTRO 376 // MUS_ME_SHINKA
#define MUS_EVOLUTION 377 // MUS_SHINKA
#define MUS_EVOLUTION_INTRO 376 // MUS_ME_SHINKA // Also used in egg hatching.
#define MUS_EVOLUTION 377 // MUS_SHINKA // Also used in egg hatching and trades.
#define MUS_MOVE_DELETED 378 // MUS_ME_WASURE
#define MUS_ENCOUNTER_GIRL 379 // MUS_SYOUJOEYE
#define MUS_ENCOUNTER_MALE 380 // MUS_BOYEYE
#define MUS_ABANDONED_SHIP 381 // MUS_DAN02
#define MUS_FORTREE 382 // MUS_MACHI_S3
#define MUS_ABANDONED_SHIP 381 // MUS_DAN02 // Also used in Faraway and Southern Islands.
#define MUS_FORTREE 382 // MUS_MACHI_S3 // Also used in Secret Bases and the Safari Zone's entrance.
#define MUS_BIRCH_LAB 383 // MUS_ODAMAKI
#define MUS_B_TOWER_RS 384 // MUS_B_TOWER
#define MUS_B_TOWER_RS 384 // MUS_B_TOWER // Used in Battle Tents, Trainer Hill and Battle Frontier's lounges and Exchange Service Corner.
#define MUS_ENCOUNTER_SWIMMER 385 // MUS_SWIMEYE
#define MUS_CAVE_OF_ORIGIN 386 // MUS_DAN03
#define MUS_CAVE_OF_ORIGIN 386 // MUS_DAN03 // Also used in Meteor Falls.
#define MUS_OBTAIN_BERRY 387 // MUS_ME_KINOMI
#define MUS_AWAKEN_LEGEND 388 // MUS_ME_TAMA
#define MUS_SLOTS_JACKPOT 389 // MUS_ME_B_BIG
#define MUS_SLOTS_WIN 390 // MUS_ME_B_SMALL
#define MUS_SLOTS_JACKPOT 389 // MUS_ME_B_BIG // Also used in the Roulette.
#define MUS_SLOTS_WIN 390 // MUS_ME_B_SMALL // Also used in the Roulette.
#define MUS_TOO_BAD 391 // MUS_ME_ZANNEN
#define MUS_ROULETTE 392 // MUS_BD_TIME
#define MUS_LINK_CONTEST_P1 393 // MUS_TEST1
@@ -327,17 +327,17 @@
#define MUS_LINK_CONTEST_P4 396 // MUS_TEST4
#define MUS_ENCOUNTER_RICH 397 // MUS_TEST
#define MUS_VERDANTURF 398 // MUS_GOMACHI0
#define MUS_RUSTBORO 399 // MUS_GOTOWN
#define MUS_POKE_CENTER 400 // MUS_POKECEN
#define MUS_ROUTE104 401 // MUS_NEXTROAD
#define MUS_ROUTE119 402 // MUS_GRANROAD
#define MUS_RUSTBORO 399 // MUS_GOTOWN // Also used in Mauville City, Mossdeep City, Daycare, Weather Institute and several Route houses.
#define MUS_POKE_CENTER 400 // MUS_POKECEN // Also used in the Pokémon League's lobby.
#define MUS_ROUTE104 401 // MUS_NEXTROAD // Also used in Routes 105, 106, 107, 108, 109, 115 and 116.
#define MUS_ROUTE119 402 // MUS_GRANROAD // Also used in Routes 129, 130, 131, 132, 133, 134 and 118's east half.
#define MUS_CYCLING 403 // MUS_CYCLING
#define MUS_POKE_MART 404 // MUS_FRIENDLY
#define MUS_POKE_MART 404 // MUS_FRIENDLY // Also used in Lilycove's Department Store.
#define MUS_LITTLEROOT 405 // MUS_MISHIRO
#define MUS_MT_CHIMNEY 406 // MUS_TOZAN
#define MUS_MT_CHIMNEY 406 // MUS_TOZAN // Also used in Desert Underpass, Mirage Tower, Seafloor Cavern and Sky Pillar.
#define MUS_ENCOUNTER_FEMALE 407 // MUS_GIRLEYE
#define MUS_LILYCOVE 408 // MUS_MINAMO
#define MUS_ROUTE111 409 // MUS_ASHROAD
#define MUS_LILYCOVE 408 // MUS_MINAMO // Also used in Pacifidlog Town and the Diving Treasure Hunter's house.
#define MUS_DESERT 409 // MUS_ASHROAD
#define MUS_HELP 410 // MUS_EVENT0
#define MUS_UNDERWATER 411 // MUS_DEEPDEEP
#define MUS_VICTORY_TRAINER 412 // MUS_KACHI1
@@ -350,29 +350,29 @@
#define MUS_ENCOUNTER_AQUA 419 // MUS_AQA_0
#define MUS_FOLLOW_ME 420 // MUS_TSURETEK
#define MUS_ENCOUNTER_BRENDAN 421 // MUS_BOY_SUP
#define MUS_EVER_GRANDE 422 // MUS_RAINBOW
#define MUS_EVER_GRANDE 422 // MUS_RAINBOW // Also used in link rooms.
#define MUS_ENCOUNTER_SUSPICIOUS 423 // MUS_AYASII
#define MUS_VICTORY_AQUA_MAGMA 424 // MUS_KACHI4
#define MUS_CABLE_CAR 425 // MUS_ROPEWAY
#define MUS_GAME_CORNER 426 // MUS_CASINO
#define MUS_DEWFORD 427 // MUS_HIGHTOWN
#define MUS_DEWFORD 427 // MUS_HIGHTOWN // Also used in Route 109's Seashore house.
#define MUS_SAFARI_ZONE 428 // MUS_SAFARI
#define MUS_VICTORY_ROAD 429 // MUS_C_ROAD
#define MUS_VICTORY_ROAD 429 // MUS_C_ROAD // Also used in Pokémon League's E4/Champion rooms and halls.
#define MUS_AQUA_MAGMA_HIDEOUT 430 // MUS_AJITO
#define MUS_SAILING 431 // MUS_M_BOAT
#define MUS_MT_PYRE 432 // MUS_M_DUNGON
#define MUS_SLATEPORT 433 // MUS_FINECITY
#define MUS_MT_PYRE 432 // MUS_M_DUNGON // Also used in New Mauville and Shoal Cave.
#define MUS_SLATEPORT 433 // MUS_FINECITY // Also used in Cycling Road's entrances.
#define MUS_MT_PYRE_EXTERIOR 434 // MUS_MACHUPI
#define MUS_SCHOOL 435 // MUS_P_SCHOOL
#define MUS_HALL_OF_FAME 436 // MUS_DENDOU
#define MUS_FALLARBOR 437 // MUS_TONEKUSA
#define MUS_SEALED_CHAMBER 438 // MUS_MABOROSI
#define MUS_FALLARBOR 437 // MUS_TONEKUSA // Also used in Route 114's houses.
#define MUS_SEALED_CHAMBER 438 // MUS_MABOROSI // Also used in Ancient Tomb, Desert Ruins and Island Cave.
#define MUS_CONTEST_WINNER 439 // MUS_CON_FAN
#define MUS_CONTEST 440 // MUS_CONTEST0
#define MUS_ENCOUNTER_MAGMA 441 // MUS_MGM0
#define MUS_INTRO_BATTLE 442 // MUS_T_BATTLE
#define MUS_ABNORMAL_WEATHER 443 // MUS_OOAME (Replaces MUS_WEATHER_KYOGRE from R/S)
#define MUS_WEATHER_GROUDON 444 // MUS_HIDERI (Unused, from R/S)
#define MUS_ABNORMAL_WEATHER 443 // MUS_OOAME // Replaces MUS_WEATHER_KYOGRE from R/S.
#define MUS_WEATHER_GROUDON 444 // MUS_HIDERI // Unused, from R/S.
#define MUS_SOOTOPOLIS 445 // MUS_RUNECITY
#define MUS_CONTEST_RESULTS 446 // MUS_CON_K
#define MUS_HALL_OF_FAME_ROOM 447 // MUS_EIKOU_R
@@ -381,7 +381,7 @@
#define MUS_ENCOUNTER_ELITE_FOUR 450 // MUS_SITENNOU
#define MUS_ENCOUNTER_HIKER 451 // MUS_YAMA_EYE
#define MUS_CONTEST_LOBBY 452 // MUS_CONLOBBY
#define MUS_ENCOUNTER_INTERVIEWER 453 // MUS_INTER_V
#define MUS_ENCOUNTER_INTERVIEWER 453 // MUS_INTER_V // Also used during Petalburg City report at the beginning of the game.
#define MUS_ENCOUNTER_CHAMPION 454 // MUS_DAIGO
#define MUS_CREDITS 455 // MUS_THANKFOR
#define MUS_END 456 // MUS_END
@@ -398,7 +398,7 @@
#define MUS_B_DOME 467 // MUS_B_DOME
#define MUS_B_PIKE 468 // MUS_B_TUBE
#define MUS_B_FACTORY 469 // MUS_B_FACTORY
#define MUS_VS_RAYQUAZA 470 // MUS_VS_REKKU (Identical to MUS_VS_KYOGRE_GROUDON)
#define MUS_VS_RAYQUAZA 470 // MUS_VS_REKKU // Identical to MUS_VS_KYOGRE_GROUDON.
#define MUS_VS_FRONTIER_BRAIN 471 // MUS_VS_FRONT
#define MUS_VS_MEW 472 // MUS_VS_MEW
#define MUS_B_DOME_LOBBY 473 // MUS_B_DOME1
@@ -451,9 +451,9 @@
#define MUS_RG_SILPH 519 // MUS_RG_SHIRUHU
#define MUS_RG_FUCHSIA 520 // MUS_RG_HANADA
#define MUS_RG_CELADON 521 // MUS_RG_TAMAMUSI
#define MUS_RG_VICTORY_TRAINER 522 // MUS_RG_WIN_TRE (Identical to MUS_VICTORY_TRAINER)
#define MUS_RG_VICTORY_WILD 523 // MUS_RG_WIN_YASEI (Identical to MUS_VICTORY_WILD)
#define MUS_RG_VICTORY_GYM_LEADER 524 // MUS_RG_WIN_GYM (Identical to MUS_VICTORY_GYM_LEADER)
#define MUS_RG_VICTORY_TRAINER 522 // MUS_RG_WIN_TRE // Identical to MUS_VICTORY_TRAINER.
#define MUS_RG_VICTORY_WILD 523 // MUS_RG_WIN_YASEI // Identical to MUS_VICTORY_WILD.
#define MUS_RG_VICTORY_GYM_LEADER 524 // MUS_RG_WIN_GYM // Identical to MUS_VICTORY_GYM_LEADER.
#define MUS_RG_VERMILLION 525 // MUS_RG_KUCHIBA
#define MUS_RG_PEWTER 526 // MUS_RG_NIBI
#define MUS_RG_ENCOUNTER_RIVAL 527 // MUS_RG_RIVAL1
@@ -472,11 +472,11 @@
#define MUS_RG_NET_CENTER 540 // MUS_RG_NETWORK
#define MUS_RG_MYSTERY_GIFT 541 // MUS_RG_OKURIMONO
#define MUS_RG_BERRY_PICK 542 // MUS_RG_KINOMIKUI
#define MUS_RG_SEVII_CAVE 543 // MUS_RG_NANADUNGEON (Identical to MUS_RG_MT_MOON)
#define MUS_RG_TEACHY_TV_SHOW 544 // MUS_RG_OSHIE_TV (Identical to MUS_RG_FOLLOW_ME)
#define MUS_RG_SEVII_CAVE 543 // MUS_RG_NANADUNGEON // Identical to MUS_RG_MT_MOON.
#define MUS_RG_TEACHY_TV_SHOW 544 // MUS_RG_OSHIE_TV // Identical to MUS_RG_FOLLOW_ME.
#define MUS_RG_SEVII_ROUTE 545 // MUS_RG_NANASHIMA
#define MUS_RG_SEVII_DUNGEON 546 // MUS_RG_NANAISEKI (Identical to MUS_RG_VIRIDIAN_FOREST)
#define MUS_RG_SEVII_123 547 // MUS_RG_NANA123 (Identical to MUS_RG_PEWTER)
#define MUS_RG_SEVII_DUNGEON 546 // MUS_RG_NANAISEKI // Identical to MUS_RG_VIRIDIAN_FOREST.
#define MUS_RG_SEVII_123 547 // MUS_RG_NANA123 // Identical to MUS_RG_PEWTER
#define MUS_RG_SEVII_45 548 // MUS_RG_NANA45
#define MUS_RG_SEVII_67 549 // MUS_RG_NANA67
#define MUS_RG_POKE_FLUTE 550 // MUS_RG_POKEFUE
+6 -73
View File
@@ -4,29 +4,19 @@
#define TRADE_PLAYER 0
#define TRADE_PARTNER 1
#define LINK_TRADE_TIMEOUT 300
// In-game Trade IDs
#define INGAME_TRADE_SEEDOT 0
#define INGAME_TRADE_PLUSLE 1
#define INGAME_TRADE_HORSEA 2
#define INGAME_TRADE_MEOWTH 3
// Flag IDs for sending link data
#define INITIATE_TRADE 1
#define CANCEL_TRADE 2
#define WANTS_TO_TRADE 1
#define WANTS_TO_CANCEL 2
#define READY_FINISH_TRADE 1
#define FINISH_TRADE 2
// Return values for CanTradeSelectedMon and CanSpinTradeMon
#define CAN_TRADE_MON 0
#define CANT_TRADE_LAST_MON 1
#define CANT_TRADE_NATIONAL 2
#define CANT_TRADE_EGG_YET 3
#define CANT_TRADE_INVALID_MON 4
#define CANT_TRADE_EGG_YET2 5
#define CAN_TRADE_MON 0
#define CANT_TRADE_LAST_MON 1
#define CANT_TRADE_NATIONAL 2
#define CANT_TRADE_EGG_YET 3
#define CANT_TRADE_INVALID_MON 4
#define CANT_TRADE_PARTNER_EGG_YET 5
// Return values for CheckValidityOfTradeMons
#define PLAYER_MON_INVALID 0
@@ -38,63 +28,6 @@
#define TRADE_PLAYER_NOT_READY 1
#define TRADE_PARTNER_NOT_READY 2
// Indexes for sTradeActionTexts
#define TRADE_TEXT_CANCEL 0
#define TRADE_TEXT_CHOOSE_MON 1
#define TRADE_TEXT_SUMMARY 2
#define TRADE_TEXT_TRADE 3
#define TRADE_TEXT_CANCEL_TRADE 4
#define TRADE_TEXT_JP_QUIT 5
// Checked to confirm DrawTradeMenuParty has reached final state
#define DRAW_PARTY_FINISH 5
// Message indexes for sTradeMessages
#define TRADE_MSG_STANDBY 0
#define TRADE_MSG_CANCELED 1
#define TRADE_MSG_ONLY_MON1 2
#define TRADE_MSG_ONLY_MON2 3
#define TRADE_MSG_WAITING_FOR_FRIEND 4
#define TRADE_MSG_FRIEND_WANTS_TO_TRADE 5
#define TRADE_MSG_MON_CANT_BE_TRADED 6
#define TRADE_MSG_EGG_CANT_BE_TRADED 7
#define TRADE_MSG_FRIENDS_MON_CANT_BE_TRADED 8
// IDs for QueueAction
#define QUEUE_SEND_DATA 0
#define QUEUE_STANDBY 1
#define QUEUE_ONLY_MON1 2
#define QUEUE_ONLY_MON2 3
#define QUEUE_UNUSED1 4
#define QUEUE_UNUSED2 5
#define QUEUE_MON_CANT_BE_TRADED 6
#define QUEUE_EGG_CANT_BE_TRADED 7
#define QUEUE_FRIENDS_MON_CANT_BE_TRADED 8
#define QUEUE_DELAY_MSG 3
#define QUEUE_DELAY_DATA 5
// IDs for CallTradeMenuFunc
#define TRADEMENUFUNC_MAIN_MENU 0
#define TRADEMENUFUNC_SELECTED_MON 1
#define TRADEMENUFUNC_SHOW_MON_SUMMARY 2
#define TRADEMENUFUNC_CONFIRM_OR_CANCEL_TRADE 3
#define TRADEMENUFUNC_CANCEL_TRADE_PROMPT 4
#define TRADEMENUFUNC_UNUSED_5 5
#define TRADEMENUFUNC_BOTH_MONS_SELECTED 6
#define TRADEMENUFUNC_CONFIRM_TRADE_PROMPT 7
#define TRADEMENUFUNC_REDRAW_MAIN_MENU 8
#define TRADEMENUFUNC_LINK_TRADE_FADE_OUT 9
#define TRADEMENUFUNC_LINK_TRADE_WAIT_FADE 10
#define TRADEMENUFUNC_CANCEL_TRADE_1 11
#define TRADEMENUFUNC_CANCEL_TRADE_2 12
#define TRADEMENUFUNC_START_LINK_TRADE 13
#define TRADEMENUFUNC_DELAY_TRADE_CONFIRM 14
#define TRADEMENUFUNC_UNUSED_15 15
#define TRADEMENUFUNC_LINK_TRADE_WAIT_QUEUE 16
#define TRADEMENUFUNC_PARTNER_MON_INVALID 17
#define TRADEMENUFUNC_STANDBY 100
// Message indexes for sUnionRoomTradeMessages
#define UR_TRADE_MSG_NONE 0
#define UR_TRADE_MSG_NOT_MON_PARTNER_WANTS 1
+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
@@ -4992,10 +4992,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
+1 -1
View File
@@ -83,7 +83,7 @@ struct RfuGameCompatibilityData
u16 hasNews:1;
u16 hasCard:1;
u16 unknown:1; // Never read
u16 isChampion:1;
u16 canLinkNationally:1;
u16 hasNationalDex:1;
u16 gameClear:1;
u16 version:4;
+11 -2
View File
@@ -15,6 +15,15 @@ enum {
MAILBOXWIN_COUNT
};
// Window IDs for the move relearner
enum {
RELEARNERWIN_DESC_BATTLE,
RELEARNERWIN_DESC_CONTEST,
RELEARNERWIN_MOVE_LIST,
RELEARNERWIN_MSG,
RELEARNERWIN_YESNO,
};
enum {
TAG_CONDITION_MON = 100,
TAG_CONDITION_BALL,
@@ -117,11 +126,11 @@ void DestroyConditionSparkleSprites(struct Sprite **sprites);
void FreeConditionSparkles(struct Sprite **sprites);
// Move relearner
void MoveRelearnerPrintText(u8 *str);
void MoveRelearnerPrintMessage(u8 *str);
bool16 MoveRelearnerRunTextPrinters(void);
void MoveRelearnerCreateYesNoMenu(void);
u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices);
void InitMoveRelearnerWindows(bool8 useContextWindow);
void InitMoveRelearnerWindows(bool8 useContestWindow);
// Level up window
void DrawLevelUpWindowPg1(u16 windowId, u16 *statsBefore, u16 *statsAfter, u8 bgClr, u8 fgClr, u8 shadowClr);
+2 -2
View File
@@ -5,11 +5,11 @@ extern bool8 gGiftIsFromEReader;
u16 GetMysteryGiftBaseBlock(void);
void CB2_MysteryGiftEReader(void);
void PrintMysteryGiftOrEReaderTopMenu(bool8 isJapanese, bool32 usePickOkCancel);
void PrintMysteryGiftOrEReaderHeader(bool8 isJapanese, bool32 usePickOkCancel);
void MG_DrawCheckerboardPattern(u32 bg);
void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void);
bool32 PrintMysteryGiftMenuMessage(u8 *textState, const u8 *str);
void AddTextPrinterToWindow1(const u8 *src);
void MG_AddMessageTextPrinter(const u8 *src);
void CB2_InitEReader(void);
void CB2_InitMysteryGift(void);
void MG_DrawTextBorder(u8 windowId);
+29 -23
View File
@@ -70,7 +70,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,
@@ -85,7 +85,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,
@@ -147,25 +147,32 @@ struct PokemonSubstruct3
/* 0x07 */ u32 isEgg:1;
/* 0x07 */ u32 abilityNum: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:4; // discarded in Gen 4
/* 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.
/* 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:4; // Discarded in Gen 4.
// 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.
@@ -401,12 +408,11 @@ 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);
void SetDeoxysStats(void);
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 -1
View File
@@ -21,7 +21,8 @@ enum {
MAPSECTYPE_ROUTE,
MAPSECTYPE_CITY_CANFLY,
MAPSECTYPE_CITY_CANTFLY,
MAPSECTYPE_BATTLE_FRONTIER
MAPSECTYPE_BATTLE_FRONTIER,
NUM_MAPSEC_TYPES
};
struct RegionMap {
+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);
+2 -1
View File
@@ -1,7 +1,8 @@
MAKEFLAGS += --no-print-directory
TOOLDIRS := $(filter-out tools/agbcc tools/binutils,$(wildcard tools/*))
# 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)
+2 -2
View File
@@ -1329,8 +1329,8 @@ static void Cmd_count_usable_party_mons(void)
{
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)
{
AI_THINKING_STRUCT->funcResult++;
}
+10 -10
View File
@@ -86,9 +86,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;
@@ -184,9 +184,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;
@@ -382,9 +382,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 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;
@@ -488,9 +488,9 @@ static bool8 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;
@@ -823,8 +823,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++;
}
+1 -1
View File
@@ -3023,7 +3023,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);
+2 -2
View File
@@ -1047,7 +1047,7 @@ void UpdateAnimBg3ScreenSize(bool8 largeScreenSize)
}
}
void TradeMenuBouncePartySprites(struct Sprite *sprite)
void Trade_MoveSelectedMonToTarget(struct Sprite *sprite)
{
sprite->data[1] = sprite->x;
sprite->data[3] = sprite->y;
@@ -2101,7 +2101,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
@@ -899,7 +899,7 @@ void AnimTask_GetBattleTerrain(u8 taskId)
void AnimTask_AllocBackupPalBuffer(u8 taskId)
{
gMonSpritesGfxPtr->buffer = AllocZeroed(0x2000);
gMonSpritesGfxPtr->buffer = AllocZeroed(MON_PIC_SIZE * MAX_MON_PIC_FRAMES);
DestroyAnimVisualTask(taskId);
}
+7 -7
View File
@@ -592,8 +592,8 @@ static void SetBattlePartyIds(void)
if (GET_BATTLER_SIDE2(i) == B_SIDE_PLAYER)
{
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG))
{
gBattlerPartyIndexes[i] = j;
@@ -603,8 +603,8 @@ static void SetBattlePartyIds(void)
else
{
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG))
{
gBattlerPartyIndexes[i] = j;
@@ -618,7 +618,7 @@ static void SetBattlePartyIds(void)
{
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES) != SPECIES_NONE // Probably a typo by Game Freak. The rest use SPECIES2.
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG)
&& gBattlerPartyIndexes[i - 2] != j)
{
@@ -629,8 +629,8 @@ static void SetBattlePartyIds(void)
else
{
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG)
&& gBattlerPartyIndexes[i - 2] != j)
{
+102 -75
View File
@@ -73,9 +73,33 @@ struct TourneyTreeLineSection
#define tMode data[2]
#define tPrevTaskId data[3]
#define EFFECTIVENESS_MODE_GOOD 0
#define EFFECTIVENESS_MODE_BAD 1
#define EFFECTIVENESS_MODE_AI_VS_AI 2
enum {
EFFECTIVENESS_MODE_GOOD,
EFFECTIVENESS_MODE_BAD,
EFFECTIVENESS_MODE_AI_VS_AI,
};
// Window IDs for the tourney tree
enum {
TOURNEYWIN_NAMES_LEFT,
TOURNEYWIN_NAMES_RIGHT,
TOURNEYWIN_TITLE,
};
// Window IDs for the trainer (WIN_TRAINER_*) and match (WIN_MATCH_*) info cards.
// All 9 have a duplicate window at WIN + NUM_INFO_CARD_WINDOWS used by the alternate info card
enum {
WIN_TRAINER_NAME,
WIN_TRAINER_MON1_NAME,
WIN_TRAINER_MON2_NAME, // Used implicitly
WIN_TRAINER_MON3_NAME, // Used implicitly
WIN_TRAINER_FLAVOR_TEXT = WIN_TRAINER_MON1_NAME + FRONTIER_PARTY_SIZE, // Trainer's potential, battle style, and stat texts
WIN_MATCH_NUMBER,
WIN_MATCH_TRAINER_NAME_LEFT,
WIN_MATCH_TRAINER_NAME_RIGHT,
WIN_MATCH_WIN_TEXT,
NUM_INFO_CARD_WINDOWS
};
static u8 GetDomeTrainerMonIvs(u16);
static void SwapDomeTrainers(int, int, u16 *);
@@ -670,7 +694,7 @@ static const struct BgTemplate sInfoCardBgTemplates[4] =
static const struct WindowTemplate sTourneyTreeWindowTemplates[] =
{
{
[TOURNEYWIN_NAMES_LEFT] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 3,
@@ -679,7 +703,7 @@ static const struct WindowTemplate sTourneyTreeWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 16,
},
{
[TOURNEYWIN_NAMES_RIGHT] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 3,
@@ -688,7 +712,7 @@ static const struct WindowTemplate sTourneyTreeWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 144,
},
{
[TOURNEYWIN_TITLE] = {
.bg = 0,
.tilemapLeft = 8,
.tilemapTop = 1,
@@ -702,7 +726,7 @@ static const struct WindowTemplate sTourneyTreeWindowTemplates[] =
static const struct WindowTemplate sInfoCardWindowTemplates[] =
{
{
[WIN_TRAINER_NAME] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 2,
@@ -711,7 +735,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 1,
},
{
[WIN_TRAINER_MON1_NAME] = {
.bg = 0,
.tilemapLeft = 16,
.tilemapTop = 5,
@@ -720,7 +744,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 53,
},
{
[WIN_TRAINER_MON2_NAME] = {
.bg = 0,
.tilemapLeft = 19,
.tilemapTop = 7,
@@ -729,7 +753,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 69,
},
{
[WIN_TRAINER_MON3_NAME] = {
.bg = 0,
.tilemapLeft = 16,
.tilemapTop = 10,
@@ -738,7 +762,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 96,
},
{
[WIN_TRAINER_FLAVOR_TEXT] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 12,
@@ -747,7 +771,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 112,
},
{
[WIN_MATCH_NUMBER] = {
.bg = 0,
.tilemapLeft = 5,
.tilemapTop = 2,
@@ -756,7 +780,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 294,
},
{
[WIN_MATCH_TRAINER_NAME_LEFT] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 5,
@@ -765,7 +789,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 340,
},
{
[WIN_MATCH_TRAINER_NAME_RIGHT] = {
.bg = 0,
.tilemapLeft = 20,
.tilemapTop = 5,
@@ -774,7 +798,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 356,
},
{
[WIN_MATCH_WIN_TEXT] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 16,
@@ -783,7 +807,9 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 372,
},
{
// Duplicate windows used by the alternate info card
// Same as above but on bg 1 instead of bg 0
[WIN_TRAINER_NAME + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 2,
.tilemapTop = 2,
@@ -792,7 +818,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 1,
},
{
[WIN_TRAINER_MON1_NAME + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 16,
.tilemapTop = 5,
@@ -801,7 +827,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 53,
},
{
[WIN_TRAINER_MON2_NAME + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 19,
.tilemapTop = 7,
@@ -810,7 +836,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 69,
},
{
[WIN_TRAINER_MON3_NAME + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 16,
.tilemapTop = 10,
@@ -819,7 +845,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 96,
},
{
[WIN_TRAINER_FLAVOR_TEXT + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 2,
.tilemapTop = 12,
@@ -828,7 +854,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 112,
},
{
[WIN_MATCH_NUMBER + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 5,
.tilemapTop = 2,
@@ -837,7 +863,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 294,
},
{
[WIN_MATCH_TRAINER_NAME_LEFT + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 2,
.tilemapTop = 5,
@@ -846,7 +872,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 340,
},
{
[WIN_MATCH_TRAINER_NAME_RIGHT + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 20,
.tilemapTop = 5,
@@ -855,7 +881,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 356,
},
{
[WIN_MATCH_WIN_TEXT + NUM_INFO_CARD_WINDOWS] = {
.bg = 1,
.tilemapLeft = 2,
.tilemapTop = 16,
@@ -1397,26 +1423,27 @@ static const u8 sCompetitorRangeByMatch[DOME_TOURNAMENT_MATCHES_COUNT][3] =
{ NUM_POSSIBLE_MATCH_TRAINERS(DOME_FINAL) * 0, NUM_POSSIBLE_MATCH_TRAINERS(DOME_FINAL), DOME_FINAL},
};
// 1st value is the windowId (0 for left column, 1 for right column)
// 2nd value is the y coord
#define NAME_ROW_HEIGHT 16
// 1st value is the windowId, 2nd value is the y coord
static const u8 sTrainerNamePositions[DOME_TOURNAMENT_TRAINERS_COUNT][2] =
{
{ 0, 0},
{ 1, 112},
{ 1, 0},
{ 0, 112},
{ 0, 48},
{ 1, 64},
{ 1, 48},
{ 0, 64},
{ 0, 16},
{ 1, 96},
{ 1, 16},
{ 0, 96},
{ 0, 32},
{ 1, 80},
{ 1, 32},
{ 0, 80},
{ TOURNEYWIN_NAMES_LEFT, 0 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_RIGHT, 7 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_RIGHT, 0 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_LEFT, 7 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_LEFT, 3 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_RIGHT, 4 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_RIGHT, 3 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_LEFT, 4 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_LEFT, 1 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_RIGHT, 6 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_RIGHT, 1 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_LEFT, 6 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_LEFT, 2 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_RIGHT, 5 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_RIGHT, 2 * NAME_ROW_HEIGHT},
{ TOURNEYWIN_NAMES_LEFT, 5 * NAME_ROW_HEIGHT},
};
// Coords for the pokeballs on the tourney tree that act as buttons to view trainer/match info
@@ -2427,7 +2454,7 @@ static void InitDomeTrainers(void)
break;
}
if (sTrainerNamePositions[i][0] != 0)
if (sTrainerNamePositions[i][0] != TOURNEYWIN_NAMES_LEFT)
{
j = 0;
DOME_TRAINERS[j].trainerId = TRAINER_FRONTIER_BRAIN;
@@ -3437,11 +3464,11 @@ static void Task_HandleInfoCardInput(u8 taskId)
case MATCHCARD_INPUT_UP ... MATCHCARD_INPUT_RIGHT:
gTasks[taskId].data[5] = i;
if (gTasks[taskId].tUsingAlternateSlot)
windowId = 9;
windowId = NUM_INFO_CARD_WINDOWS;
else
windowId = 0;
for (i = windowId; i < windowId + 9; i++)
for (i = windowId; i < windowId + NUM_INFO_CARD_WINDOWS; i++)
{
CopyWindowToVram(i, COPYWIN_GFX);
FillWindowPixelBuffer(i, PIXEL_FILL(0));
@@ -4263,14 +4290,14 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
int trainerId = 0;
u8 nature = 0;
int arrId = 0;
int windowId = 0;
int windowId = WIN_TRAINER_NAME;
int x = 0, y = 0;
u8 palSlot = 0;
s16 *allocatedArray = AllocZeroed(sizeof(s16) * ALLOC_ARRAY_SIZE);
trainerId = DOME_TRAINERS[trainerTourneyId].trainerId;
if (flags & CARD_ALTERNATE_SLOT)
arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = 9, palSlot = 2;
arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = WIN_TRAINER_NAME + NUM_INFO_CARD_WINDOWS, palSlot = 2;
if (flags & MOVE_CARD_RIGHT)
x = DISPLAY_WIDTH + 16;
if (flags & MOVE_CARD_DOWN)
@@ -4388,19 +4415,19 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
else
textPrinter.currentChar = gSpeciesNames[gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species];
textPrinter.windowId = 1 + i + windowId;
textPrinter.windowId = WIN_TRAINER_MON1_NAME + i + windowId;
if (i == 1)
textPrinter.currentX = 7;
else
textPrinter.currentX = 0;
PutWindowTilemap(1 + i + windowId);
CopyWindowToVram(1 + i + windowId, COPYWIN_FULL);
PutWindowTilemap(WIN_TRAINER_MON1_NAME + i + windowId);
CopyWindowToVram(WIN_TRAINER_MON1_NAME + i + windowId, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL);
}
PutWindowTilemap(windowId + 4);
CopyWindowToVram(windowId + 4, COPYWIN_FULL);
PutWindowTilemap(windowId + WIN_TRAINER_FLAVOR_TEXT);
CopyWindowToVram(windowId + WIN_TRAINER_FLAVOR_TEXT, COPYWIN_FULL);
// Print text about trainers potential in the tourney
if (trainerId == TRAINER_FRONTIER_BRAIN)
@@ -4409,7 +4436,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
textPrinter.currentChar = sBattleDomePotentialTexts[trainerTourneyId];
textPrinter.fontId = FONT_NORMAL;
textPrinter.windowId = windowId + 4;
textPrinter.windowId = windowId + WIN_TRAINER_FLAVOR_TEXT;
textPrinter.currentX = 0;
textPrinter.y = 4;
textPrinter.currentY = 4;
@@ -4731,7 +4758,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
u8 palSlot = 0;
if (flags & CARD_ALTERNATE_SLOT)
arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = 9, palSlot = 2;
arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = NUM_INFO_CARD_WINDOWS, palSlot = 2;
if (flags & MOVE_CARD_RIGHT)
x = DISPLAY_WIDTH + 16;
if (flags & MOVE_CARD_DOWN)
@@ -4873,10 +4900,10 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
textPrinter.shadowColor = TEXT_DYNAMIC_COLOR_4;
StringExpandPlaceholders(gStringVar4, sBattleDomeWinTexts[winStringId]);
textPrinter.currentChar = gStringVar4;
textPrinter.windowId = windowId + 8;
textPrinter.windowId = windowId + WIN_MATCH_WIN_TEXT;
textPrinter.fontId = FONT_NORMAL;
PutWindowTilemap(windowId + 8);
CopyWindowToVram(windowId + 8, COPYWIN_FULL);
PutWindowTilemap(windowId + WIN_MATCH_WIN_TEXT);
CopyWindowToVram(windowId + WIN_MATCH_WIN_TEXT, COPYWIN_FULL);
textPrinter.currentX = 0;
textPrinter.currentY = textPrinter.y = 0;
AddTextPrinter(&textPrinter, 0, NULL);
@@ -4892,11 +4919,11 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
textPrinter.fontId = FONT_SHORT;
textPrinter.letterSpacing = 2;
textPrinter.currentChar = gStringVar1;
textPrinter.windowId = windowId + 6;
textPrinter.windowId = windowId + WIN_MATCH_TRAINER_NAME_LEFT;
textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing);
textPrinter.currentY = textPrinter.y = 2;
PutWindowTilemap(windowId + 6);
CopyWindowToVram(windowId + 6, COPYWIN_FULL);
PutWindowTilemap(windowId + WIN_MATCH_TRAINER_NAME_LEFT);
CopyWindowToVram(windowId + WIN_MATCH_TRAINER_NAME_LEFT, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL);
// Print right trainer's name.
@@ -4908,21 +4935,21 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
CopyDomeTrainerName(gStringVar1, trainerIds[1]);
textPrinter.currentChar = gStringVar1;
textPrinter.windowId = windowId + 7;
textPrinter.windowId = windowId + WIN_MATCH_TRAINER_NAME_RIGHT;
textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing);
textPrinter.currentY = textPrinter.y = 2;
PutWindowTilemap(windowId + 7);
CopyWindowToVram(windowId + 7, COPYWIN_FULL);
PutWindowTilemap(windowId + WIN_MATCH_TRAINER_NAME_RIGHT);
CopyWindowToVram(windowId + WIN_MATCH_TRAINER_NAME_RIGHT, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL);
// Print match number.
textPrinter.letterSpacing = 0;
textPrinter.currentChar = sBattleDomeMatchNumberTexts[matchNo];
textPrinter.windowId = windowId + 5;
textPrinter.windowId = windowId + WIN_MATCH_NUMBER;
textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0xA0, textPrinter.letterSpacing);
textPrinter.currentY = textPrinter.y = 2;
PutWindowTilemap(windowId + 5);
CopyWindowToVram(windowId + 5, COPYWIN_FULL);
PutWindowTilemap(windowId + WIN_MATCH_NUMBER);
CopyWindowToVram(windowId + WIN_MATCH_NUMBER, COPYWIN_FULL);
AddTextPrinter(&textPrinter, 0, NULL);
}
@@ -5356,7 +5383,7 @@ static void Task_ShowTourneyTree(u8 taskId)
case 4:
textPrinter.fontId = FONT_SHORT;
textPrinter.currentChar = gText_BattleTourney;
textPrinter.windowId = 2;
textPrinter.windowId = TOURNEYWIN_TITLE;
textPrinter.x = 0;
textPrinter.y = 0;
textPrinter.letterSpacing = 2;
@@ -5442,7 +5469,7 @@ static void Task_ShowTourneyTree(u8 taskId)
}
}
if (sTrainerNamePositions[i][0] == 0)
if (sTrainerNamePositions[i][0] == TOURNEYWIN_NAMES_LEFT)
textPrinter.currentX = GetStringWidthDifference(textPrinter.fontId, gDisplayedStringBattle, 0x3D, textPrinter.letterSpacing);
else
textPrinter.currentX = 3;
@@ -5454,12 +5481,12 @@ static void Task_ShowTourneyTree(u8 taskId)
gTasks[taskId].tState++;
break;
case 5:
PutWindowTilemap(0);
PutWindowTilemap(1);
PutWindowTilemap(2);
CopyWindowToVram(0, COPYWIN_FULL);
CopyWindowToVram(1, COPYWIN_FULL);
CopyWindowToVram(2, COPYWIN_FULL);
PutWindowTilemap(TOURNEYWIN_NAMES_LEFT);
PutWindowTilemap(TOURNEYWIN_NAMES_RIGHT);
PutWindowTilemap(TOURNEYWIN_TITLE);
CopyWindowToVram(TOURNEYWIN_NAMES_LEFT, COPYWIN_FULL);
CopyWindowToVram(TOURNEYWIN_NAMES_RIGHT, COPYWIN_FULL);
CopyWindowToVram(TOURNEYWIN_TITLE, COPYWIN_FULL);
SetHBlankCallback(HblankCb_TourneyTree);
SetVBlankCallback(VblankCb_TourneyTree);
if (r4 == 2)
@@ -5556,7 +5583,7 @@ static void Task_HandleStaticTourneyTreeInput(u8 taskId)
if (DOME_TRAINERS[i].eliminatedAt == gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1
&& DOME_TRAINERS[i].isEliminated)
{
if (sTrainerNamePositions[i][0] == 0)
if (sTrainerNamePositions[i][0] == TOURNEYWIN_NAMES_LEFT)
textPrinter.currentX = GetStringWidthDifference(textPrinter.fontId, gDisplayedStringBattle, 0x3D, textPrinter.letterSpacing);
else
textPrinter.currentX = 3;
+55 -38
View File
@@ -301,11 +301,28 @@ const struct OamData gOamData_BattleSpritePlayerSide =
.affineParam = 0,
};
// Unknown and unused data. Feel free to remove.
static const u16 sUnused1[] = {0, 5, 0xfffe, 0};
static const u16 *const sUnused1Ptr = sUnused1;
static const u16 sUnused2[] = {0xfff0, 0, 0x0400, 0, 0, 0, 0x3c00, 0, 0x7ffe, 1, 0, 0};
static const u16 *const sUnused2Ptr = sUnused2;
static const union AnimCmd sAnim_Unused[] =
{
ANIMCMD_FRAME(0, 5),
ANIMCMD_JUMP(0),
};
static const union AnimCmd *const sAnims_Unused[] =
{
sAnim_Unused,
};
static const union AffineAnimCmd sAffineAnim_Unused[] =
{
AFFINEANIMCMD_FRAME(-0x10, 0x0, 0, 4),
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 0x3C),
AFFINEANIMCMD_JUMP(1),
};
static const union AffineAnimCmd *const sAffineAnims_Unused[] =
{
sAffineAnim_Unused,
};
static const s8 sCenterToCornerVecXs[8] ={-32, -16, -16, -32, -32};
@@ -695,33 +712,33 @@ static void CB2_InitBattleInternal(void)
gBattleCommunication[MULTIUSE_STATE] = 0;
}
#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 hp = GetMonData(&(party)[(i)], MON_DATA_HP); \
u32 status = GetMonData(&(party)[(i)], MON_DATA_STATUS); \
\
if (species == SPECIES_NONE) \
continue; \
\
/* Is healthy mon? */ \
if (species != SPECIES_EGG && hp != 0 && status == 0) \
(flags) |= 1 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is Egg or statused? */ \
if (hp != 0 && (species == SPECIES_EGG || status != 0)) \
(flags) |= 2 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is fainted? */ \
if (species != SPECIES_EGG && hp == 0) \
(flags) |= 3 << (i) * 2; \
#define BUFFER_PARTY_VS_SCREEN_STATUS(party, flags, i) \
for ((i) = 0; (i) < PARTY_SIZE; (i)++) \
{ \
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); \
\
if (species == SPECIES_NONE) \
continue; \
\
/* Is healthy mon? */ \
if (species != SPECIES_EGG && hp != 0 && status == 0) \
(flags) |= 1 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is Egg or statused? */ \
if (hp != 0 && (species == SPECIES_EGG || status != 0)) \
(flags) |= 2 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is fainted? */ \
if (species != SPECIES_EGG && hp == 0) \
(flags) |= 3 << (i) * 2; \
}
// For Vs Screen at link battle start
@@ -3485,8 +3502,8 @@ static void BattleIntroDrawPartySummaryScreens(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;
@@ -3503,8 +3520,8 @@ static void BattleIntroDrawPartySummaryScreens(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;
@@ -3529,8 +3546,8 @@ static void BattleIntroDrawPartySummaryScreens(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;
+140 -239
View File
@@ -469,8 +469,8 @@ static const u8 sText_PkmnBrokeFree[] = _("Oh, no!\nThe POKéMON broke free!");
static const u8 sText_ItAppearedCaught[] = _("Aww!\nIt appeared to be caught!");
static const u8 sText_AarghAlmostHadIt[] = _("Aargh!\nAlmost had it!");
static const u8 sText_ShootSoClose[] = _("Shoot!\nIt was so close, too!");
static const u8 sText_GotchaPkmnCaught[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}\p");
static const u8 sText_GotchaPkmnCaught2[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}{PAUSE 127}");
static const u8 sText_GotchaPkmnCaughtPlayer[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}\p");
static const u8 sText_GotchaPkmnCaughtWally[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}{PAUSE 127}");
static const u8 sText_GiveNicknameCaptured[] = _("Give a nickname to the\ncaptured {B_OPPONENT_MON1_NAME}?");
static const u8 sText_PkmnSentToPC[] = _("{B_OPPONENT_MON1_NAME} was sent to\n{B_PC_CREATOR_NAME} PC.");
static const u8 sText_Someones[] = _("someone's");
@@ -771,8 +771,8 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT - BATTLESTRINGS_TABLE_S
[STRINGID_ITAPPEAREDCAUGHT - BATTLESTRINGS_TABLE_START] = sText_ItAppearedCaught,
[STRINGID_AARGHALMOSTHADIT - BATTLESTRINGS_TABLE_START] = sText_AarghAlmostHadIt,
[STRINGID_SHOOTSOCLOSE - BATTLESTRINGS_TABLE_START] = sText_ShootSoClose,
[STRINGID_GOTCHAPKMNCAUGHT - BATTLESTRINGS_TABLE_START] = sText_GotchaPkmnCaught,
[STRINGID_GOTCHAPKMNCAUGHT2 - BATTLESTRINGS_TABLE_START] = sText_GotchaPkmnCaught2,
[STRINGID_GOTCHAPKMNCAUGHTPLAYER - BATTLESTRINGS_TABLE_START] = sText_GotchaPkmnCaughtPlayer,
[STRINGID_GOTCHAPKMNCAUGHTWALLY - BATTLESTRINGS_TABLE_START] = sText_GotchaPkmnCaughtWally,
[STRINGID_GIVENICKNAMECAPTURED - BATTLESTRINGS_TABLE_START] = sText_GiveNicknameCaptured,
[STRINGID_PKMNSENTTOPC - BATTLESTRINGS_TABLE_START] = sText_PkmnSentToPC,
[STRINGID_PKMNDATAADDEDTODEX - BATTLESTRINGS_TABLE_START] = sText_PkmnDataAddedToDex,
@@ -1481,288 +1481,236 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 1,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_6,
.shadowColor = TEXT_COLOR_GREEN,
.fgColor = 1,
.bgColor = 15,
.shadowColor = 6,
},
[B_WIN_ACTION_PROMPT] = {
.fillValue = PIXEL_FILL(0xF),
.fontId = FONT_NORMAL,
.x = 1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_6,
.shadowColor = TEXT_COLOR_GREEN,
.fgColor = 1,
.bgColor = 15,
.shadowColor = 6,
},
[B_WIN_ACTION_MENU] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_MOVE_NAME_1] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_MOVE_NAME_2] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_MOVE_NAME_3] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_MOVE_NAME_4] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_PP] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_3,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_2,
.fgColor = 12,
.bgColor = 14,
.shadowColor = 11,
},
[B_WIN_DUMMY] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_PP_REMAINING] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 2,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_3,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_2,
.fgColor = 12,
.bgColor = 14,
.shadowColor = 11,
},
[B_WIN_MOVE_TYPE] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_SWITCH_PROMPT] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_YESNO] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_LEVEL_UP_BOX] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_LEVEL_UP_BANNER] = {
.fillValue = PIXEL_FILL(0),
.fontId = FONT_NORMAL,
.x = 32,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_DARK_GRAY,
.fgColor = 1,
.shadowColor = 2,
},
[B_WIN_VS_PLAYER] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_VS_OPPONENT] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_VS_MULTI_PLAYER_1] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_VS_MULTI_PLAYER_2] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_VS_MULTI_PLAYER_3] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_VS_MULTI_PLAYER_4] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_VS_OUTCOME_DRAW] = {
.fillValue = PIXEL_FILL(0),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_GREEN,
.fgColor = 1,
.shadowColor = 6,
},
[B_WIN_VS_OUTCOME_LEFT] = {
.fillValue = PIXEL_FILL(0),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_GREEN,
.fgColor = 1,
.shadowColor = 6,
},
[B_WIN_VS_OUTCOME_RIGHT] = {
.fillValue = PIXEL_FILL(0x0),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_GREEN,
.fgColor = 1,
.shadowColor = 6,
},
};
@@ -1773,276 +1721,229 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 1,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_6,
.shadowColor = TEXT_COLOR_GREEN,
.fgColor = 1,
.bgColor = 15,
.shadowColor = 6,
},
[B_WIN_ACTION_PROMPT] = {
.fillValue = PIXEL_FILL(0xF),
.fontId = FONT_NORMAL,
.x = 1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_6,
.shadowColor = TEXT_COLOR_GREEN,
.fgColor = 1,
.bgColor = 15,
.shadowColor = 6,
},
[B_WIN_ACTION_MENU] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_MOVE_NAME_1] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_MOVE_NAME_2] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_MOVE_NAME_3] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_MOVE_NAME_4] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_PP] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_3,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_2,
.fgColor = 12,
.bgColor = 14,
.shadowColor = 11,
},
[B_WIN_DUMMY] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_PP_REMAINING] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 2,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_3,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_2,
.fgColor = 12,
.bgColor = 14,
.shadowColor = 11,
},
[B_WIN_MOVE_TYPE] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_SWITCH_PROMPT] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NARROW,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_YESNO] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_LEVEL_UP_BOX] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[B_WIN_LEVEL_UP_BANNER] = {
.fillValue = PIXEL_FILL(0),
.fontId = FONT_NORMAL,
.x = 32,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_DARK_GRAY,
.fgColor = 1,
.shadowColor = 2,
},
[ARENA_WIN_PLAYER_NAME] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 1,
.bgColor = 14,
.shadowColor = 15,
},
[ARENA_WIN_VS] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[ARENA_WIN_OPPONENT_NAME] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[ARENA_WIN_MIND] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[ARENA_WIN_SKILL] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[ARENA_WIN_BODY] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[ARENA_WIN_JUDGMENT_TITLE] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = FONT_NORMAL,
.x = -1,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
},
[ARENA_WIN_JUDGMENT_TEXT] = {
.fillValue = PIXEL_FILL(0x1),
.fontId = FONT_NORMAL,
.x = 0,
.y = 1,
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 1,
.fgColor = TEXT_COLOR_DARK_GRAY,
.bgColor = TEXT_COLOR_WHITE,
.shadowColor = TEXT_COLOR_LIGHT_GRAY,
.fgColor = 2,
.bgColor = 1,
.shadowColor = 3,
},
};
+10 -10
View File
@@ -284,7 +284,7 @@ static const u8 sFloorTemplateOffsets[FRONTIER_STAGES_PER_CHALLENGE] =
0, 4, 9, 14, 19, 24, 29
};
static const u16 sPickupItemsLvl50[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] =
static const u16 sPickupItemsLvl50[TOTAL_PYRAMID_ROUNDS][PICKUP_ITEMS_PER_ROUND] =
{
{ITEM_HYPER_POTION, ITEM_FLUFFY_TAIL, ITEM_CHERI_BERRY, ITEM_ETHER, ITEM_LUM_BERRY, ITEM_REVIVE, ITEM_BRIGHT_POWDER, ITEM_SHELL_BELL, ITEM_MAX_REVIVE, ITEM_SACRED_ASH},
{ITEM_HYPER_POTION, ITEM_DIRE_HIT, ITEM_PECHA_BERRY, ITEM_ETHER, ITEM_LEPPA_BERRY, ITEM_REVIVE, ITEM_LEFTOVERS, ITEM_CHOICE_BAND, ITEM_FULL_RESTORE, ITEM_MAX_ELIXIR},
@@ -308,7 +308,7 @@ static const u16 sPickupItemsLvl50[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] =
{ITEM_HYPER_POTION, ITEM_X_DEFEND, ITEM_LUM_BERRY, ITEM_ETHER, ITEM_LEPPA_BERRY, ITEM_REVIVE, ITEM_QUICK_CLAW, ITEM_KINGS_ROCK, ITEM_FULL_RESTORE, ITEM_MAX_ELIXIR},
};
static const u16 sPickupItemsLvlOpen[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] =
static const u16 sPickupItemsLvlOpen[TOTAL_PYRAMID_ROUNDS][PICKUP_ITEMS_PER_ROUND] =
{
{ITEM_HYPER_POTION, ITEM_FLUFFY_TAIL, ITEM_CHERI_BERRY, ITEM_ETHER, ITEM_LUM_BERRY, ITEM_REVIVE, ITEM_BRIGHT_POWDER, ITEM_SHELL_BELL, ITEM_MAX_REVIVE, ITEM_SACRED_ASH},
{ITEM_HYPER_POTION, ITEM_DIRE_HIT, ITEM_PECHA_BERRY, ITEM_ETHER, ITEM_LEPPA_BERRY, ITEM_REVIVE, ITEM_LEFTOVERS, ITEM_CHOICE_BAND, ITEM_FULL_RESTORE, ITEM_MAX_ELIXIR},
@@ -977,10 +977,10 @@ static void SetPickupItem(void)
u8 id;
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u32 floor = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS;
u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_PYRAMID_ROUNDS;
if (round >= TOTAL_ROUNDS)
round = TOTAL_ROUNDS - 1;
if (round >= TOTAL_PYRAMID_ROUNDS)
round = TOTAL_PYRAMID_ROUNDS - 1;
id = GetPyramidFloorTemplateId();
itemIndex = (gSpecialVar_LastTalked - sPyramidFloorTemplates[id].numTrainers) - 1;
@@ -1345,10 +1345,10 @@ void GenerateBattlePyramidWildMon(void)
const struct PyramidWildMon *wildMons;
u32 id;
u32 lvl = gSaveBlock2Ptr->frontier.lvlMode;
u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS;
u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_PYRAMID_ROUNDS;
if (round >= TOTAL_ROUNDS)
round = TOTAL_ROUNDS - 1;
if (round >= TOTAL_PYRAMID_ROUNDS)
round = TOTAL_PYRAMID_ROUNDS - 1;
if (lvl != FRONTIER_LVL_50)
wildMons = sOpenLevelWildMonPointers[round];
@@ -1961,8 +1961,8 @@ u16 GetBattlePyramidPickupItemId(void)
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
int round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE);
if (round >= TOTAL_ROUNDS)
round = TOTAL_ROUNDS - 1;
if (round >= TOTAL_PYRAMID_ROUNDS)
round = TOTAL_PYRAMID_ROUNDS - 1;
rand = Random() % 100;
+9 -9
View File
@@ -5682,8 +5682,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;
@@ -8331,7 +8331,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)
@@ -8877,8 +8877,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;
}
@@ -9396,9 +9396,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++)
@@ -9564,7 +9564,7 @@ static void Cmd_pickup(void)
{
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);
if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM))
@@ -9587,7 +9587,7 @@ static void Cmd_pickup(void)
{
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);
if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM))
+1 -1
View File
@@ -724,7 +724,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
@@ -3271,7 +3271,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)
+11 -11
View File
@@ -2278,8 +2278,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);
@@ -2318,8 +2318,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);
@@ -2336,8 +2336,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);
@@ -2365,8 +2365,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;
@@ -3885,14 +3885,14 @@ u8 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)
@@ -3906,7 +3906,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;
+48 -43
View File
@@ -106,6 +106,13 @@ enum {
// Last berry that an NPC can put in
#define NUM_NPC_BERRIES ITEM_TO_BERRY(ITEM_ASPEAR_BERRY)
enum {
// Windows 0-3 are used implicitly in several loops over BLENDER_MAX_PLAYERS
// i.e. window 0 is for player 1, window 1 for player 2, etc.
WIN_MSG = BLENDER_MAX_PLAYERS,
WIN_RESULTS,
};
struct BlenderBerry
{
u16 itemId;
@@ -200,7 +207,7 @@ static void SpriteCB_ScoreSymbolBest(struct Sprite *);
static void InitLocalPlayers(u8);
static void CB2_LoadBerryBlender(void);
static void UpdateBlenderCenter(void);
static bool32 Blender_PrintText(s16 *, const u8 *, s32 );
static bool32 PrintMessage(s16 *, const u8 *, s32 );
static void StartBlender(void);
static void CB2_StartBlenderLink(void);
static void CB2_StartBlenderLocal(void);
@@ -332,7 +339,7 @@ static const struct BgTemplate sBgTemplates[3] =
static const struct WindowTemplate sWindowTemplates[] =
{
{
{ // Player 1
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 6,
@@ -341,7 +348,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 14,
.baseBlock = 0x28,
},
{
{ // Player 2
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 6,
@@ -350,7 +357,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 14,
.baseBlock = 0x36,
},
{
{ // Player 3
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 12,
@@ -359,7 +366,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 14,
.baseBlock = 0x44,
},
{
{ // Player 4
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 12,
@@ -368,7 +375,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 14,
.baseBlock = 0x52,
},
{
[WIN_MSG] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 15,
@@ -377,7 +384,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 14,
.baseBlock = 0x60,
},
{
[WIN_RESULTS] = {
.bg = 0,
.tilemapLeft = 5,
.tilemapTop = 3,
@@ -1107,7 +1114,7 @@ static void CB2_LoadBerryBlender(void)
sBerryBlender->mainState++;
break;
case 4:
if (Blender_PrintText(&sBerryBlender->textState, sText_BerryBlenderStart, GetPlayerTextSpeedDelay()))
if (PrintMessage(&sBerryBlender->textState, sText_BerryBlenderStart, GetPlayerTextSpeedDelay()))
sBerryBlender->mainState++;
break;
case 5:
@@ -1337,7 +1344,7 @@ static void CB2_StartBlenderLink(void)
}
break;
case 5:
Blender_PrintText(&sBerryBlender->textState, sText_CommunicationStandby, 0);
PrintMessage(&sBerryBlender->textState, sText_CommunicationStandby, 0);
sBerryBlender->mainState = 8;
sBerryBlender->framesToWait = 0;
break;
@@ -1363,7 +1370,7 @@ static void CB2_StartBlenderLink(void)
if (++sBerryBlender->framesToWait > 20)
{
// Wait for partners' berries
ClearDialogWindowAndFrameToTransparent(4, TRUE);
ClearDialogWindowAndFrameToTransparent(WIN_MSG, TRUE);
if (GetBlockReceivedStatus() == GetLinkPlayerCountAsBitFlags())
{
for (i = 0; i < GetLinkPlayerCount(); i++)
@@ -2276,9 +2283,9 @@ static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16 *_flavors,
j++;
}
// If all flavors are 0, or at least 3 were negative/0
// If all 5 flavors are 0, or if 4-5 flavors were negative,
// or if players used the same berry, color is black
if (j == 5 || negativeFlavors > 3)
if (j == FLAVOR_COUNT || negativeFlavors > 3)
return PBLOCK_CLR_BLACK;
for (i = 0; i < numPlayers; i++)
@@ -2664,7 +2671,7 @@ static void CB2_EndBlenderGame(void)
}
break;
case 7:
if (Blender_PrintText(&sBerryBlender->textState, sText_WouldLikeToBlendAnotherBerry, GetPlayerTextSpeedDelay()))
if (PrintMessage(&sBerryBlender->textState, sText_WouldLikeToBlendAnotherBerry, GetPlayerTextSpeedDelay()))
sBerryBlender->gameEndState++;
break;
case 9:
@@ -2748,7 +2755,7 @@ static void CB2_EndBlenderGame(void)
sBerryBlender->gameEndState++;
break;
case 13:
if (Blender_PrintText(&sBerryBlender->textState, sText_CommunicationStandby, GetPlayerTextSpeedDelay()))
if (PrintMessage(&sBerryBlender->textState, sText_CommunicationStandby, GetPlayerTextSpeedDelay()))
{
SetMainCallback2(CB2_CheckPlayAgainLink);
sBerryBlender->gameEndState = 0;
@@ -2858,7 +2865,7 @@ static void CB2_CheckPlayAgainLink(void)
StringAppend(gStringVar4, sText_HasNoBerriesToPut);
break;
case 3:
if (Blender_PrintText(&sBerryBlender->textState, gStringVar4, GetPlayerTextSpeedDelay()))
if (PrintMessage(&sBerryBlender->textState, gStringVar4, GetPlayerTextSpeedDelay()))
{
sBerryBlender->framesToWait = 0;
sBerryBlender->gameEndState++;
@@ -2869,7 +2876,7 @@ static void CB2_CheckPlayAgainLink(void)
sBerryBlender->gameEndState = 5;
break;
case 5:
Blender_PrintText(&sBerryBlender->textState, gText_SavingDontTurnOff2, 0);
PrintMessage(&sBerryBlender->textState, gText_SavingDontTurnOff2, 0);
SetLinkStandbyCallback();
sBerryBlender->gameEndState++;
break;
@@ -2965,7 +2972,7 @@ static void CB2_CheckPlayAgainLocal(void)
StringCopy(gStringVar4, sText_RunOutOfBerriesForBlending);
break;
case 3:
if (Blender_PrintText(&sBerryBlender->textState, gStringVar4, GetPlayerTextSpeedDelay()))
if (PrintMessage(&sBerryBlender->textState, gStringVar4, GetPlayerTextSpeedDelay()))
sBerryBlender->gameEndState = 9;
break;
case 9:
@@ -3495,7 +3502,7 @@ static bool8 PrintBlendingResults(void)
u8 *txtPtr;
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_BlendingResults, 0xA8);
Blender_AddTextPrinter(5, sText_BlendingResults, xPos, 1, TEXT_SKIP_DRAW, 0);
Blender_AddTextPrinter(WIN_RESULTS, sText_BlendingResults, xPos, 1, TEXT_SKIP_DRAW, 0);
if (sBerryBlender->numPlayers == BLENDER_MAX_PLAYERS)
yPos = 17;
@@ -3510,15 +3517,15 @@ static bool8 PrintBlendingResults(void)
StringAppend(sBerryBlender->stringVar, sText_Dot);
StringAppend(sBerryBlender->stringVar, gText_Space);
StringAppend(sBerryBlender->stringVar, gLinkPlayers[place].name);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 8, yPos, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 8, yPos, TEXT_SKIP_DRAW, 3);
StringCopy(sBerryBlender->stringVar, sBerryBlender->blendedBerries[place].name);
ConvertInternationalString(sBerryBlender->stringVar, gLinkPlayers[place].language);
StringAppend(sBerryBlender->stringVar, sText_SpaceBerry);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 0x54, yPos, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 0x54, yPos, TEXT_SKIP_DRAW, 3);
}
Blender_AddTextPrinter(5, sText_MaximumSpeed, 0, 0x51, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sText_MaximumSpeed, 0, 0x51, TEXT_SKIP_DRAW, 3);
ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->maxRPM / 100, STR_CONV_MODE_RIGHT_ALIGN, 3);
StringAppend(sBerryBlender->stringVar, sText_Dot);
@@ -3527,8 +3534,8 @@ static bool8 PrintBlendingResults(void)
StringAppend(sBerryBlender->stringVar, sText_RPM);
xPos = GetStringRightAlignXOffset(FONT_NORMAL, sBerryBlender->stringVar, 0xA8);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, xPos, 0x51, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(5, sText_Time, 0, 0x61, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, xPos, 0x51, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sText_Time, 0, 0x61, TEXT_SKIP_DRAW, 3);
seconds = (sBerryBlender->gameFrameTime / 60) % 60;
minutes = (sBerryBlender->gameFrameTime / (60 * 60));
@@ -3540,12 +3547,12 @@ static bool8 PrintBlendingResults(void)
StringAppend(sBerryBlender->stringVar, sText_Sec);
xPos = GetStringRightAlignXOffset(FONT_NORMAL, sBerryBlender->stringVar, 0xA8);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, xPos, 0x61, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, xPos, 0x61, TEXT_SKIP_DRAW, 3);
sBerryBlender->framesToWait = 0;
sBerryBlender->mainState++;
CopyWindowToVram(5, COPYWIN_GFX);
CopyWindowToVram(WIN_RESULTS, COPYWIN_GFX);
}
break;
case 4:
@@ -3553,7 +3560,7 @@ static bool8 PrintBlendingResults(void)
sBerryBlender->mainState++;
break;
case 5:
ClearStdWindowAndFrameToTransparent(5, TRUE);
ClearStdWindowAndFrameToTransparent(WIN_RESULTS, TRUE);
for (i = 0; i < BLENDER_MAX_PLAYERS; i++)
{
@@ -3581,7 +3588,7 @@ static bool8 PrintBlendingResults(void)
sBerryBlender->mainState++;
break;
case 6:
if (Blender_PrintText(&sBerryBlender->textState, sBerryBlender->stringVar, GetPlayerTextSpeedDelay()))
if (PrintMessage(&sBerryBlender->textState, sBerryBlender->stringVar, GetPlayerTextSpeedDelay()))
{
TryUpdateBerryBlenderRecord();
return TRUE;
@@ -3692,9 +3699,9 @@ static bool8 PrintBlendingRanking(void)
}
break;
case 3:
DrawStdFrameWithCustomTileAndPalette(5, FALSE, 1, 0xD);
DrawStdFrameWithCustomTileAndPalette(WIN_RESULTS, FALSE, 1, 0xD);
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_Ranking, 168);
Blender_AddTextPrinter(5, sText_Ranking, xPos, 1, TEXT_SKIP_DRAW, 0);
Blender_AddTextPrinter(WIN_RESULTS, sText_Ranking, xPos, 1, TEXT_SKIP_DRAW, 0);
sBerryBlender->scoreIconIds[SCORE_BEST] = CreateSprite(&sSpriteTemplate_ScoreSymbols, 128, 52, 0);
StartSpriteAnim(&gSprites[sBerryBlender->scoreIconIds[SCORE_BEST]], SCOREANIM_BEST_STATIC);
@@ -3718,20 +3725,20 @@ static bool8 PrintBlendingRanking(void)
StringAppend(sBerryBlender->stringVar, sText_Dot);
StringAppend(sBerryBlender->stringVar, gText_Space);
StringAppend(sBerryBlender->stringVar, gLinkPlayers[place].name);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 0, yPos, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 0, yPos, TEXT_SKIP_DRAW, 3);
ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_BEST], STR_CONV_MODE_RIGHT_ALIGN, 3);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78, yPos, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 78, yPos, TEXT_SKIP_DRAW, 3);
ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_GOOD], STR_CONV_MODE_RIGHT_ALIGN, 3);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78 + 32, yPos, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 78 + 32, yPos, TEXT_SKIP_DRAW, 3);
ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_MISS], STR_CONV_MODE_RIGHT_ALIGN, 3);
Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78 + 64, yPos, TEXT_SKIP_DRAW, 3);
Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 78 + 64, yPos, TEXT_SKIP_DRAW, 3);
}
PutWindowTilemap(5);
CopyWindowToVram(5, COPYWIN_FULL);
PutWindowTilemap(WIN_RESULTS);
CopyWindowToVram(WIN_RESULTS, COPYWIN_FULL);
sBerryBlender->framesToWait = 0;
sBerryBlender->mainState++;
@@ -3875,26 +3882,24 @@ static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s3
}
if (caseId != 3)
{
FillWindowPixelBuffer(windowId, PIXEL_FILL(txtColor[0]));
}
AddTextPrinterParameterized4(windowId, FONT_NORMAL, x, y, letterSpacing, 1, txtColor, speed, string);
}
static bool32 Blender_PrintText(s16 *textState, const u8 *string, s32 textSpeed)
static bool32 PrintMessage(s16 *textState, const u8 *string, s32 textSpeed)
{
switch (*textState)
{
case 0:
DrawDialogFrameWithCustomTileAndPalette(4, FALSE, 0x14, 0xF);
Blender_AddTextPrinter(4, string, 0, 1, textSpeed, 0);
PutWindowTilemap(4);
CopyWindowToVram(4, COPYWIN_FULL);
DrawDialogFrameWithCustomTileAndPalette(WIN_MSG, FALSE, 0x14, 0xF);
Blender_AddTextPrinter(WIN_MSG, string, 0, 1, textSpeed, 0);
PutWindowTilemap(WIN_MSG);
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
(*textState)++;
break;
case 1:
if (!IsTextPrinterActive(4))
if (!IsTextPrinterActive(WIN_MSG))
{
*textState = 0;
return TRUE;
+30 -23
View File
@@ -14,6 +14,13 @@
#include "m4a.h"
#include "constants/rgb.h"
enum {
WIN_TITLE, // "Berry Program Update" header on the first screen
WIN_MSG_BODY,
WIN_GAME_NAMES, // The labels under the GBA graphics on the link screen
WIN_TURN_OFF_TITLE, // "Ruby/Sapphire" at the top of the "turn off the power" screen
};
struct {
u8 state;
u8 curScene;
@@ -71,7 +78,7 @@ static const struct BgTemplate sBerryFixBgTemplates[] = {
};
static const struct WindowTemplate sBerryFixWindowTemplates[] = {
{
[WIN_TITLE] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 4,
@@ -80,7 +87,7 @@ static const struct WindowTemplate sBerryFixWindowTemplates[] = {
.paletteNum = 15,
.baseBlock = 1
},
{
[WIN_MSG_BODY] = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 11,
@@ -89,7 +96,7 @@ static const struct WindowTemplate sBerryFixWindowTemplates[] = {
.paletteNum = 15,
.baseBlock = 53
},
{
[WIN_GAME_NAMES] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 8,
@@ -98,7 +105,7 @@ static const struct WindowTemplate sBerryFixWindowTemplates[] = {
.paletteNum = 15,
.baseBlock = 277
},
{
[WIN_TURN_OFF_TITLE] = {
.bg = 0,
.tilemapLeft = 8,
.tilemapTop = 0,
@@ -217,11 +224,11 @@ static void BerryFix_Main(void)
sBerryFix->state = MAINSTATE_BEGIN;
break;
case MAINSTATE_BEGIN:
if (TryScene(SCENE_BEGIN) && (JOY_NEW(A_BUTTON)))
if (TryScene(SCENE_BEGIN) && JOY_NEW(A_BUTTON))
sBerryFix->state = MAINSTATE_CONNECT;
break;
case MAINSTATE_CONNECT:
if (TryScene(SCENE_ENSURE_CONNECT) && (JOY_NEW(A_BUTTON)))
if (TryScene(SCENE_ENSURE_CONNECT) && JOY_NEW(A_BUTTON))
sBerryFix->state = MAINSTATE_INIT_MULTIBOOT;
break;
case MAINSTATE_INIT_MULTIBOOT:
@@ -299,29 +306,29 @@ static void BerryFix_GpuSet(void)
DmaCopy32(3, sBerryFixPalColors, BG_PLTT + 0x1E0, sizeof(sBerryFixPalColors));
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP);
FillWindowPixelBuffer(2, PIXEL_FILL(0));
FillWindowPixelBuffer(3, PIXEL_FILL(0));
FillWindowPixelBuffer(0, PIXEL_FILL(10));
FillWindowPixelBuffer(WIN_GAME_NAMES, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_TURN_OFF_TITLE, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_TITLE, PIXEL_FILL(10));
width = GetStringWidth(FONT_SMALL, sText_Emerald, 0);
left = (120 - width) / 2;
AddTextPrinterParameterized3(2, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_Emerald);
AddTextPrinterParameterized3(WIN_GAME_NAMES, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_Emerald);
width = GetStringWidth(FONT_SMALL, sText_RubySapphire, 0);
left = (120 - width) / 2 + 120;
AddTextPrinterParameterized3(2, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire);
AddTextPrinterParameterized3(WIN_GAME_NAMES, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire);
width = GetStringWidth(FONT_SMALL, sText_RubySapphire, 0);
left = (112 - width) / 2;
AddTextPrinterParameterized3(3, FONT_SMALL, left, 0, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire);
AddTextPrinterParameterized3(WIN_TURN_OFF_TITLE, FONT_SMALL, left, 0, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire);
width = GetStringWidth(FONT_NORMAL, sText_BerryProgramUpdate, 0);
left = (208 - width) / 2;
AddTextPrinterParameterized3(0, FONT_NORMAL, left, 2, sBerryProgramTextColors, TEXT_SKIP_DRAW, sText_BerryProgramUpdate);
AddTextPrinterParameterized3(WIN_TITLE, FONT_NORMAL, left, 2, sBerryProgramTextColors, TEXT_SKIP_DRAW, sText_BerryProgramUpdate);
CopyWindowToVram(2, COPYWIN_GFX);
CopyWindowToVram(3, COPYWIN_GFX);
CopyWindowToVram(0, COPYWIN_GFX);
CopyWindowToVram(WIN_GAME_NAMES, COPYWIN_GFX);
CopyWindowToVram(WIN_TURN_OFF_TITLE, COPYWIN_GFX);
CopyWindowToVram(WIN_TITLE, COPYWIN_GFX);
}
static int BerryFix_TrySetScene(int scene)
@@ -345,23 +352,23 @@ static int BerryFix_TrySetScene(int scene)
static void BerryFix_SetScene(int scene)
{
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
FillWindowPixelBuffer(1, PIXEL_FILL(10));
AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0, sBerryProgramTextColors, TEXT_SKIP_DRAW, sBerryProgramTexts[scene]);
PutWindowTilemap(1);
CopyWindowToVram(1, COPYWIN_GFX);
FillWindowPixelBuffer(WIN_MSG_BODY, PIXEL_FILL(10));
AddTextPrinterParameterized3(WIN_MSG_BODY, FONT_NORMAL, 0, 0, sBerryProgramTextColors, TEXT_SKIP_DRAW, sBerryProgramTexts[scene]);
PutWindowTilemap(WIN_MSG_BODY);
CopyWindowToVram(WIN_MSG_BODY, COPYWIN_GFX);
switch (scene)
{
case SCENE_ENSURE_CONNECT:
case SCENE_TRANSMITTING:
case SCENE_FOLLOW_INSTRUCT:
case SCENE_TRANSMIT_FAILED:
PutWindowTilemap(2);
PutWindowTilemap(WIN_GAME_NAMES);
break;
case SCENE_TURN_OFF_POWER:
PutWindowTilemap(3);
PutWindowTilemap(WIN_TURN_OFF_TITLE);
break;
case SCENE_BEGIN:
PutWindowTilemap(0);
PutWindowTilemap(WIN_TITLE);
break;
}
CopyBgTilemapBufferToVram(0);
+10 -10
View File
@@ -102,7 +102,7 @@ static const u8 sTextColors[2][3] =
static const struct WindowTemplate sWindowTemplates[] =
{
{ // WIN_BERRY_NAME
[WIN_BERRY_NAME] = {
.bg = 1,
.tilemapLeft = 11,
.tilemapTop = 4,
@@ -111,7 +111,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 69,
},
{ // WIN_SIZE_FIRM
[WIN_SIZE_FIRM] = {
.bg = 1,
.tilemapLeft = 11,
.tilemapTop = 7,
@@ -120,7 +120,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 85,
},
{ // WIN_DESC
[WIN_DESC] = {
.bg = 1,
.tilemapLeft = 4,
.tilemapTop = 14,
@@ -129,7 +129,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 157,
},
{ // WIN_BERRY_TAG
[WIN_BERRY_TAG] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 0,
@@ -599,7 +599,7 @@ static void Task_DisplayAnotherBerry(u8 taskId)
switch (data[0])
{
case 0x30:
FillWindowPixelBuffer(0, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_BERRY_NAME, PIXEL_FILL(0));
break;
case 0x40:
PrintBerryNumberAndName();
@@ -609,7 +609,7 @@ static void Task_DisplayAnotherBerry(u8 taskId)
CreateBerrySprite();
break;
case 0x60:
FillWindowPixelBuffer(1, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_SIZE_FIRM, PIXEL_FILL(0));
break;
case 0x70:
PrintBerrySize();
@@ -621,7 +621,7 @@ static void Task_DisplayAnotherBerry(u8 taskId)
SetFlavorCirclesVisiblity();
break;
case 0xA0:
FillWindowPixelBuffer(2, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_DESC, PIXEL_FILL(0));
break;
case 0xB0:
PrintBerryDescription1();
@@ -636,7 +636,7 @@ static void Task_DisplayAnotherBerry(u8 taskId)
switch (data[0])
{
case 0x30:
FillWindowPixelBuffer(2, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_DESC, PIXEL_FILL(0));
break;
case 0x40:
PrintBerryDescription2();
@@ -648,7 +648,7 @@ static void Task_DisplayAnotherBerry(u8 taskId)
SetFlavorCirclesVisiblity();
break;
case 0x70:
FillWindowPixelBuffer(1, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_SIZE_FIRM, PIXEL_FILL(0));
break;
case 0x80:
PrintBerryFirmness();
@@ -661,7 +661,7 @@ static void Task_DisplayAnotherBerry(u8 taskId)
CreateBerrySprite();
break;
case 0xB0:
FillWindowPixelBuffer(0, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_BERRY_NAME, PIXEL_FILL(0));
break;
case 0xC0:
PrintBerryNumberAndName();
+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;
+2 -2
View File
@@ -5459,7 +5459,7 @@ static void Contest_StartTextPrinter(const u8 *currChar, bool32 b)
u8 speed;
printerTemplate.currentChar = currChar;
printerTemplate.windowId = 4;
printerTemplate.windowId = WIN_GENERAL_TEXT;
printerTemplate.fontId = FONT_NORMAL;
printerTemplate.x = 0;
printerTemplate.y = 1;
@@ -5485,7 +5485,7 @@ static void Contest_StartTextPrinter(const u8 *currChar, bool32 b)
AddTextPrinter(&printerTemplate, speed, 0);
}
PutWindowTilemap(4);
PutWindowTilemap(WIN_GENERAL_TEXT);
Contest_SetBgCopyFlags(0);
}
+7 -6
View File
@@ -319,9 +319,10 @@ static const struct BgTemplate sBgTemplates[] =
}
};
static const struct WindowTemplate sWindowTemplates[] =
// Window IDs are implicitly shared with contestant IDs in LoadContestMonName
static const struct WindowTemplate sWindowTemplates[CONTESTANT_COUNT + 1] =
{
{
{ // Contestant 1
.bg = 1,
.tilemapLeft = 7,
.tilemapTop = 4,
@@ -330,7 +331,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 770
},
{
{ // Contestant 2
.bg = 1,
.tilemapLeft = 7,
.tilemapTop = 7,
@@ -339,7 +340,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 794
},
{
{ // Contestant 3
.bg = 1,
.tilemapLeft = 7,
.tilemapTop = 10,
@@ -348,7 +349,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 818
},
{
{ // Contestant 4
.bg = 1,
.tilemapLeft = 7,
.tilemapTop = 13,
@@ -357,7 +358,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 842
},
DUMMY_WIN_TEMPLATE,
DUMMY_WIN_TEMPLATE
};
static const struct OamData sOamData_WirelessIndicatorWindow =
+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,
@@ -1038,7 +1038,7 @@ static const struct PyramidWildMon sOpenLevelWildMons_Round20[] =
}
};
static const struct PyramidWildMon *const sOpenLevelWildMonPointers[TOTAL_ROUNDS] =
static const struct PyramidWildMon *const sOpenLevelWildMonPointers[TOTAL_PYRAMID_ROUNDS] =
{
sOpenLevelWildMons_Round1,
sOpenLevelWildMons_Round2,
+98 -96
View File
@@ -2,102 +2,104 @@
#include "global.h"
#include "contest.h"
#define CONTEST_OPPONENT_JIMMY 0
#define CONTEST_OPPONENT_EDITH 1
#define CONTEST_OPPONENT_EVAN 2
#define CONTEST_OPPONENT_KELSEY 3
#define CONTEST_OPPONENT_MADISON 4
#define CONTEST_OPPONENT_RAYMOND 5
#define CONTEST_OPPONENT_GRANT 6
#define CONTEST_OPPONENT_PAIGE 7
#define CONTEST_OPPONENT_ALEC 8
#define CONTEST_OPPONENT_SYDNEY 9
#define CONTEST_OPPONENT_MORRIS 10
#define CONTEST_OPPONENT_MARIAH 11
#define CONTEST_OPPONENT_RUSSELL 12
#define CONTEST_OPPONENT_MELANIE 13
#define CONTEST_OPPONENT_CHANCE 14
#define CONTEST_OPPONENT_AGATHA 15
#define CONTEST_OPPONENT_BEAU 16
#define CONTEST_OPPONENT_KAY 17
#define CONTEST_OPPONENT_CALE 18
#define CONTEST_OPPONENT_CAITLIN 19
#define CONTEST_OPPONENT_COLBY 20
#define CONTEST_OPPONENT_KYLIE 21
#define CONTEST_OPPONENT_LIAM 22
#define CONTEST_OPPONENT_MILO 23
#define CONTEST_OPPONENT_KARINA 24
#define CONTEST_OPPONENT_BOBBY 25
#define CONTEST_OPPONENT_CLAIRE 26
#define CONTEST_OPPONENT_WILLIE 27
#define CONTEST_OPPONENT_CASSIDY 28
#define CONTEST_OPPONENT_MORGAN 29
#define CONTEST_OPPONENT_SUMMER 30
#define CONTEST_OPPONENT_MILES 31
#define CONTEST_OPPONENT_AUDREY 32
#define CONTEST_OPPONENT_AVERY 33
#define CONTEST_OPPONENT_ARIANA 34
#define CONTEST_OPPONENT_ASHTON 35
#define CONTEST_OPPONENT_SANDRA 36
#define CONTEST_OPPONENT_CARSON 37
#define CONTEST_OPPONENT_KATRINA 38
#define CONTEST_OPPONENT_LUKE 39
#define CONTEST_OPPONENT_RAUL 40
#define CONTEST_OPPONENT_JADA 41
#define CONTEST_OPPONENT_ZEEK 42
#define CONTEST_OPPONENT_DIEGO 43
#define CONTEST_OPPONENT_ALIYAH 44
#define CONTEST_OPPONENT_NATALIA 45
#define CONTEST_OPPONENT_DEVIN 46
#define CONTEST_OPPONENT_TYLOR 47
#define CONTEST_OPPONENT_RONNIE 48
#define CONTEST_OPPONENT_CLAUDIA 49
#define CONTEST_OPPONENT_ELIAS 50
#define CONTEST_OPPONENT_JADE 51
#define CONTEST_OPPONENT_FRANCIS 52
#define CONTEST_OPPONENT_ALISHA 53
#define CONTEST_OPPONENT_SAUL 54
#define CONTEST_OPPONENT_FELICIA 55
#define CONTEST_OPPONENT_EMILIO 56
#define CONTEST_OPPONENT_KARLA 57
#define CONTEST_OPPONENT_DARRYL 58
#define CONTEST_OPPONENT_SELENA 59
#define CONTEST_OPPONENT_NOEL 60
#define CONTEST_OPPONENT_LACEY 61
#define CONTEST_OPPONENT_CORBIN 62
#define CONTEST_OPPONENT_GRACIE 63
#define CONTEST_OPPONENT_COLTIN 64
#define CONTEST_OPPONENT_ELLIE 65
#define CONTEST_OPPONENT_MARCUS 66
#define CONTEST_OPPONENT_KIARA 67
#define CONTEST_OPPONENT_BRYCE 68
#define CONTEST_OPPONENT_JAMIE 69
#define CONTEST_OPPONENT_JORGE 70
#define CONTEST_OPPONENT_DEVON 71
#define CONTEST_OPPONENT_JUSTINA 72
#define CONTEST_OPPONENT_RALPH 73
#define CONTEST_OPPONENT_ROSA 74
#define CONTEST_OPPONENT_KEATON 75
#define CONTEST_OPPONENT_MAYRA 76
#define CONTEST_OPPONENT_LAMAR 77
#define CONTEST_OPPONENT_AUBREY 78
#define CONTEST_OPPONENT_NIGEL 79
#define CONTEST_OPPONENT_CAMILLE 80
#define CONTEST_OPPONENT_DEON 81
#define CONTEST_OPPONENT_JANELLE 82
#define CONTEST_OPPONENT_HEATH 83
#define CONTEST_OPPONENT_SASHA 84
#define CONTEST_OPPONENT_FRANKIE 85
#define CONTEST_OPPONENT_HELEN 86
#define CONTEST_OPPONENT_CAMILE 87
#define CONTEST_OPPONENT_MARTIN 88
#define CONTEST_OPPONENT_SERGIO 89
#define CONTEST_OPPONENT_KAILEY 90
#define CONTEST_OPPONENT_PERLA 91
#define CONTEST_OPPONENT_CLARA 92
#define CONTEST_OPPONENT_JAKOB 93
#define CONTEST_OPPONENT_TREY 94
#define CONTEST_OPPONENT_LANE 95
enum {
CONTEST_OPPONENT_JIMMY,
CONTEST_OPPONENT_EDITH,
CONTEST_OPPONENT_EVAN,
CONTEST_OPPONENT_KELSEY,
CONTEST_OPPONENT_MADISON,
CONTEST_OPPONENT_RAYMOND,
CONTEST_OPPONENT_GRANT,
CONTEST_OPPONENT_PAIGE,
CONTEST_OPPONENT_ALEC,
CONTEST_OPPONENT_SYDNEY,
CONTEST_OPPONENT_MORRIS,
CONTEST_OPPONENT_MARIAH,
CONTEST_OPPONENT_RUSSELL,
CONTEST_OPPONENT_MELANIE,
CONTEST_OPPONENT_CHANCE,
CONTEST_OPPONENT_AGATHA,
CONTEST_OPPONENT_BEAU,
CONTEST_OPPONENT_KAY,
CONTEST_OPPONENT_CALE,
CONTEST_OPPONENT_CAITLIN,
CONTEST_OPPONENT_COLBY,
CONTEST_OPPONENT_KYLIE,
CONTEST_OPPONENT_LIAM,
CONTEST_OPPONENT_MILO,
CONTEST_OPPONENT_KARINA,
CONTEST_OPPONENT_BOBBY,
CONTEST_OPPONENT_CLAIRE,
CONTEST_OPPONENT_WILLIE,
CONTEST_OPPONENT_CASSIDY,
CONTEST_OPPONENT_MORGAN,
CONTEST_OPPONENT_SUMMER,
CONTEST_OPPONENT_MILES,
CONTEST_OPPONENT_AUDREY,
CONTEST_OPPONENT_AVERY,
CONTEST_OPPONENT_ARIANA,
CONTEST_OPPONENT_ASHTON,
CONTEST_OPPONENT_SANDRA,
CONTEST_OPPONENT_CARSON,
CONTEST_OPPONENT_KATRINA,
CONTEST_OPPONENT_LUKE,
CONTEST_OPPONENT_RAUL,
CONTEST_OPPONENT_JADA,
CONTEST_OPPONENT_ZEEK,
CONTEST_OPPONENT_DIEGO,
CONTEST_OPPONENT_ALIYAH,
CONTEST_OPPONENT_NATALIA,
CONTEST_OPPONENT_DEVIN,
CONTEST_OPPONENT_TYLOR,
CONTEST_OPPONENT_RONNIE,
CONTEST_OPPONENT_CLAUDIA,
CONTEST_OPPONENT_ELIAS,
CONTEST_OPPONENT_JADE,
CONTEST_OPPONENT_FRANCIS,
CONTEST_OPPONENT_ALISHA,
CONTEST_OPPONENT_SAUL,
CONTEST_OPPONENT_FELICIA,
CONTEST_OPPONENT_EMILIO,
CONTEST_OPPONENT_KARLA,
CONTEST_OPPONENT_DARRYL,
CONTEST_OPPONENT_SELENA,
CONTEST_OPPONENT_NOEL,
CONTEST_OPPONENT_LACEY,
CONTEST_OPPONENT_CORBIN,
CONTEST_OPPONENT_GRACIE,
CONTEST_OPPONENT_COLTIN,
CONTEST_OPPONENT_ELLIE,
CONTEST_OPPONENT_MARCUS,
CONTEST_OPPONENT_KIARA,
CONTEST_OPPONENT_BRYCE,
CONTEST_OPPONENT_JAMIE,
CONTEST_OPPONENT_JORGE,
CONTEST_OPPONENT_DEVON,
CONTEST_OPPONENT_JUSTINA,
CONTEST_OPPONENT_RALPH,
CONTEST_OPPONENT_ROSA,
CONTEST_OPPONENT_KEATON,
CONTEST_OPPONENT_MAYRA,
CONTEST_OPPONENT_LAMAR,
CONTEST_OPPONENT_AUBREY,
CONTEST_OPPONENT_NIGEL,
CONTEST_OPPONENT_CAMILLE,
CONTEST_OPPONENT_DEON,
CONTEST_OPPONENT_JANELLE,
CONTEST_OPPONENT_HEATH,
CONTEST_OPPONENT_SASHA,
CONTEST_OPPONENT_FRANKIE,
CONTEST_OPPONENT_HELEN,
CONTEST_OPPONENT_CAMILE,
CONTEST_OPPONENT_MARTIN,
CONTEST_OPPONENT_SERGIO,
CONTEST_OPPONENT_KAILEY,
CONTEST_OPPONENT_PERLA,
CONTEST_OPPONENT_CLARA,
CONTEST_OPPONENT_JAKOB,
CONTEST_OPPONENT_TREY,
CONTEST_OPPONENT_LANE
};
// All contest opponents have a common set of AI flags (which contains all of the actually
// useful AI scripts, as well as some dummys) and a random combination of 2-3 dummy flags.
+27 -27
View File
@@ -122,7 +122,7 @@ static const u8 sFontColorTable[][3] =
static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] =
{
{
{ // Party mon 1
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 3,
@@ -131,7 +131,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] =
.paletteNum = 3,
.baseBlock = 0x63,
},
{
{ // Party mon 2
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 1,
@@ -140,7 +140,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] =
.paletteNum = 4,
.baseBlock = 0xA9,
},
{
{ // Party mon 3
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 4,
@@ -149,7 +149,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] =
.paletteNum = 5,
.baseBlock = 0xDF,
},
{
{ // Party mon 4
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 7,
@@ -158,7 +158,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] =
.paletteNum = 6,
.baseBlock = 0x115,
},
{
{ // Party mon 5
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 10,
@@ -167,7 +167,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] =
.paletteNum = 7,
.baseBlock = 0x14B,
},
{
{ // Party mon 6
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 13,
@@ -176,7 +176,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] =
.paletteNum = 8,
.baseBlock = 0x181,
},
{
[WIN_MSG] = {
.bg = 2,
.tilemapLeft = 1,
.tilemapTop = 15,
@@ -190,7 +190,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] =
static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] =
{
{
{ // Party mon 1
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 1,
@@ -199,7 +199,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] =
.paletteNum = 3,
.baseBlock = 0x63,
},
{
{ // Party mon 2
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 8,
@@ -208,7 +208,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] =
.paletteNum = 4,
.baseBlock = 0xA9,
},
{
{ // Party mon 3
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 1,
@@ -217,7 +217,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] =
.paletteNum = 5,
.baseBlock = 0xEF,
},
{
{ // Party mon 4
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 5,
@@ -226,7 +226,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] =
.paletteNum = 6,
.baseBlock = 0x125,
},
{
{ // Party mon 5
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 9,
@@ -235,7 +235,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] =
.paletteNum = 7,
.baseBlock = 0x15B,
},
{
{ // Party mon 6
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 13,
@@ -244,7 +244,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] =
.paletteNum = 8,
.baseBlock = 0x191,
},
{
[WIN_MSG] = {
.bg = 2,
.tilemapLeft = 1,
.tilemapTop = 15,
@@ -258,7 +258,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] =
static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] =
{
{
{ // Party mon 1
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 1,
@@ -267,7 +267,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] =
.paletteNum = 3,
.baseBlock = 0x63,
},
{
{ // Party mon 2
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 8,
@@ -276,7 +276,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] =
.paletteNum = 4,
.baseBlock = 0xA9,
},
{
{ // Party mon 3
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 2,
@@ -285,7 +285,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] =
.paletteNum = 5,
.baseBlock = 0xEF,
},
{
{ // Party mon 4
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 5,
@@ -294,7 +294,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] =
.paletteNum = 6,
.baseBlock = 0x125,
},
{
{ // Party mon 5
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 9,
@@ -303,7 +303,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] =
.paletteNum = 7,
.baseBlock = 0x15B,
},
{
{ // Party mon 6
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 12,
@@ -312,7 +312,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] =
.paletteNum = 8,
.baseBlock = 0x191,
},
{
[WIN_MSG] = {
.bg = 2,
.tilemapLeft = 1,
.tilemapTop = 15,
@@ -326,7 +326,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] =
static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] =
{
{
{ // Party mon 1
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 2,
@@ -335,7 +335,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] =
.paletteNum = 3,
.baseBlock = 0x63,
},
{
{ // Party mon 2
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 3,
@@ -344,7 +344,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] =
.paletteNum = 5,
.baseBlock = 0xA9,
},
{
{ // Party mon 3
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 6,
@@ -353,7 +353,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] =
.paletteNum = 6,
.baseBlock = 0xDF,
},
{
{ // Party mon 4
.bg = 2,
.tilemapLeft = 1,
.tilemapTop = 11,
@@ -362,7 +362,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] =
.paletteNum = 4,
.baseBlock = 0x115,
},
{
{ // Party mon 5
.bg = 2,
.tilemapLeft = 12,
.tilemapTop = 12,
@@ -371,7 +371,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] =
.paletteNum = 7,
.baseBlock = 0x16B,
},
{
{ // Party mon 6
.bg = 2,
.tilemapLeft = 12,
.tilemapTop = 15,
+88 -107
View File
@@ -55,7 +55,7 @@ static const u8 sText_OnlyPkmnForBattle[] = _("That's your only\nPOKéMON for ba
static const u8 sText_WaitingForYourFriend[] = _("{COLOR DARK_GRAY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GRAY}Waiting for your friend\nto finish…");
static const u8 sText_YourFriendWantsToTrade[] = _("Your friend wants\nto trade POKéMON.");
static const struct OamData sTradeOamData_32x16 =
static const struct OamData sOamData_MenuText =
{
.shape = SPRITE_SHAPE(32x16),
.size = SPRITE_SIZE(32x16),
@@ -167,17 +167,17 @@ static const struct SpriteTemplate sSpriteTemplate_MenuText =
{
.tileTag = GFXTAG_MENU_TEXT,
.paletteTag = PALTAG_MENU_TEXT,
.oam = &sTradeOamData_32x16,
.oam = &sOamData_MenuText,
.anims = sAnims_MenuText,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
};
static const u16 sTradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal");
static const struct SpritePalette sSpritePalette_TradeScreenText =
static const u16 sMenuText_Pal[] = INCBIN_U16("graphics/trade/text.gbapal");
static const struct SpritePalette sSpritePalette_MenuText =
{
.data = sTradeScreenTextPalette,
.data = sMenuText_Pal,
.tag = PALTAG_MENU_TEXT
};
@@ -193,7 +193,7 @@ static const struct SpritePalette sSpritePalette_TradeScreenText =
// 1st array is the current positions
// 2nd array is directions of input
// 3rd array is the next positions to go to (unoccupied spaces are skipped over)
static const u8 sTradeNextSelectedMonTable[(PARTY_SIZE * 2) + 1][4][PARTY_SIZE] =
static const u8 sCursorMoveDestinations[(PARTY_SIZE * 2) + 1][4][PARTY_SIZE] =
{
{
{4, 2, 12, 12, 0, 0}, // UP
@@ -275,86 +275,67 @@ static const u8 sTradeNextSelectedMonTable[(PARTY_SIZE * 2) + 1][4][PARTY_SIZE]
}
};
#define COL0_X 1
#define COL1_X 8
#define COL2_X 16
#define COL3_X 23
#define ROW0_Y 5
#define ROW1_Y 10
#define ROW2_Y 15
#define ROW3_Y 18
static const u8 sTradeMonSpriteCoords[(PARTY_SIZE * 2) + 1][2] =
{
// Your party
{1, 5 },
{8, 5 },
{1, 10},
{8, 10},
{1, 15},
{8, 15},
// Friend's party
{16, 5 },
{23, 5 },
{16, 10},
{23, 10},
{16, 15},
{23, 15},
{23, 18} // CANCEL
// Player's party
{COL0_X, ROW0_Y},
{COL1_X, ROW0_Y},
{COL0_X, ROW1_Y},
{COL1_X, ROW1_Y},
{COL0_X, ROW2_Y},
{COL1_X, ROW2_Y},
// Partners's party
{COL2_X, ROW0_Y},
{COL3_X, ROW0_Y},
{COL2_X, ROW1_Y},
{COL3_X, ROW1_Y},
{COL2_X, ROW2_Y},
{COL3_X, ROW2_Y},
// Cancel
{COL3_X, ROW3_Y}
};
static const u8 sTradeMonLevelCoords[][2][2] =
{
// Your party
{
{5, 4},
{12, 4},
},
{
{5, 9},
{12, 9},
},
{
{5, 14},
static const u8 sTradeMonLevelCoords[PARTY_SIZE * 2][2] = {
[TRADE_PLAYER] =
{ 5, 4},
{12, 4},
{ 5, 9},
{12, 9},
{ 5, 14},
{12, 14},
},
// Friend's party
{
{20, 4},
{27, 4},
},
{
{20, 9},
{27, 9},
},
{
[TRADE_PARTNER * PARTY_SIZE] =
{20, 4},
{27, 4},
{20, 9},
{27, 9},
{20, 14},
{27, 14},
},
};
static const u8 sTradeMonBoxCoords[][2][2] =
{
// Your party
{
{1, 3},
{8, 3},
},
{
{1, 8},
{8, 8},
},
{
{1, 13},
{8, 13},
},
// Friend's party
{
{16, 3},
{23, 3},
},
{
{16, 8},
{23, 8},
},
{
static const u8 sTradeMonBoxCoords[PARTY_SIZE * 2][2] = {
[TRADE_PLAYER] =
{ 1, 3},
{ 8, 3},
{ 1, 8},
{ 8, 8},
{ 1, 13},
{ 8, 13},
[TRADE_PARTNER * PARTY_SIZE] =
{16, 3},
{23, 3},
{16, 8},
{23, 8},
{16, 13},
{23, 13},
},
};
static const u8 sUnusedCoords[][2] =
@@ -379,14 +360,14 @@ static const u8 sUnusedCoords[][2] =
{23, 12}
};
static const u8 *const sTradeActionTexts[] =
static const u8 *const sActionTexts[] =
{
[TRADE_TEXT_CANCEL] = sText_Cancel,
[TRADE_TEXT_CHOOSE_MON] = sText_ChooseAPkmn,
[TRADE_TEXT_SUMMARY] = sText_Summary,
[TRADE_TEXT_TRADE] = sText_Trade,
[TRADE_TEXT_CANCEL_TRADE] = sText_CancelTrade,
[TRADE_TEXT_JP_QUIT] = sJPText_PressBButtonToQuit
[TEXT_CANCEL] = sText_Cancel,
[TEXT_CHOOSE_MON] = sText_ChooseAPkmn,
[TEXT_SUMMARY] = sText_Summary,
[TEXT_TRADE] = sText_Trade,
[TEXT_CANCEL_TRADE] = sText_CancelTrade,
[TEXT_JP_QUIT] = sJPText_PressBButtonToQuit
};
static const struct MenuAction sSelectTradeMonActions[] =
@@ -395,17 +376,17 @@ static const struct MenuAction sSelectTradeMonActions[] =
{sText_Trade2, Task_DrawSelectionTrade}
};
static const u8 *const sTradeMessages[] =
static const u8 *const sMessages[] =
{
[TRADE_MSG_STANDBY] = sText_CommunicationStandby,
[TRADE_MSG_CANCELED] = sText_TheTradeHasBeenCanceled,
[TRADE_MSG_ONLY_MON1] = sText_OnlyPkmnForBattle,
[TRADE_MSG_ONLY_MON2] = gText_OnlyPkmnForBattle, //identical text to above
[TRADE_MSG_WAITING_FOR_FRIEND] = sText_WaitingForYourFriend,
[TRADE_MSG_FRIEND_WANTS_TO_TRADE] = sText_YourFriendWantsToTrade,
[TRADE_MSG_MON_CANT_BE_TRADED] = gText_PkmnCantBeTradedNow,
[TRADE_MSG_EGG_CANT_BE_TRADED] = gText_EggCantBeTradedNow,
[TRADE_MSG_FRIENDS_MON_CANT_BE_TRADED] = gText_OtherTrainersPkmnCantBeTraded
[MSG_STANDBY] = sText_CommunicationStandby,
[MSG_CANCELED] = sText_TheTradeHasBeenCanceled,
[MSG_ONLY_MON1] = sText_OnlyPkmnForBattle,
[MSG_ONLY_MON2] = gText_OnlyPkmnForBattle, //identical text to above
[MSG_WAITING_FOR_FRIEND] = sText_WaitingForYourFriend,
[MSG_FRIEND_WANTS_TO_TRADE] = sText_YourFriendWantsToTrade,
[MSG_MON_CANT_BE_TRADED] = gText_PkmnCantBeTradedNow,
[MSG_EGG_CANT_BE_TRADED] = gText_EggCantBeTradedNow,
[MSG_FRIENDS_MON_CANT_BE_TRADED] = gText_OtherTrainersPkmnCantBeTraded
};
static const u8 sTradeTextColors[] =
@@ -415,7 +396,7 @@ static const u8 sTradeTextColors[] =
TEXT_COLOR_DARK_GRAY //shadow color
};
static const struct BgTemplate sTradeMenuBgTemplates[] =
static const struct BgTemplate sBgTemplates[] =
{
{
.bg = 0,
@@ -455,7 +436,7 @@ static const struct BgTemplate sTradeMenuBgTemplates[] =
},
};
static const struct WindowTemplate sTradeMenuWindowTemplates[] =
static const struct WindowTemplate sWindowTemplates[] =
{
{
.bg = 0,
@@ -633,8 +614,8 @@ static const struct WindowTemplate sTradeYesNoWindowTemplate =
.baseBlock = 582
};
static const u8 sJPText_Shedinja[] = _("ヌケニン");
static const u8 sTradeMenuPartyMonBoxDimensions[3][2] =
static const u8 sText_ShedinjaJP[] = _("ヌケニン");
static const u8 sSelectedMonLevelGenderCoords[3][2] =
{
[TRADE_PLAYER] = {4, 3},
[TRADE_PARTNER] = {19, 3}
@@ -643,8 +624,8 @@ static const u8 sTradeMenuPartyMonBoxDimensions[3][2] =
static const u16 sPokeball_Pal[] = INCBIN_U16("graphics/trade/pokeball.gbapal");
static const u8 sPokeball_Gfx[] = INCBIN_U8("graphics/trade/pokeball.4bpp");
static const u8 sPokeballSymbol_Gfx[] = INCBIN_U8("graphics/trade/pokeball_symbol.8bpp"); // unused
static const u16 sCrossingHighlightCable_Tilemap[] = INCBIN_U16("graphics/trade/crossing_highlight_cable.bin");
static const u16 sTradeTilemap_PokeBallSymbol[] = INCBIN_U16("graphics/trade/pokeball_symbol_map.bin"); // unused?
static const u16 sCableCloseup_Map[] = INCBIN_U16("graphics/trade/crossing_highlight_cable.bin");
static const u16 sPokeballSymbol_Map[] = INCBIN_U16("graphics/trade/pokeball_symbol_map.bin"); // unused?
static const u16 sUnusedPal1[] = INCBIN_U16("graphics/trade/unused1.gbapal");
static const u16 sGba_Pal[] = INCBIN_U16("graphics/trade/gba.gbapal");
static const u16 sUnusedPal2[] = INCBIN_U16("graphics/trade/unused2.gbapal");
@@ -657,11 +638,11 @@ static const u8 sGbaScreen_Gfx[] = INCBIN_U8("graphics/trade/gba_screen.4bpp");
const u16 gTradePlatform_Tilemap[] = INCBIN_U16("graphics/trade/platform.bin");
static const u8 sGbaAffine_Gfx[] = INCBIN_U8("graphics/trade/gba_affine.8bpp"); // Only the gfx for when the GBA is zooming in/out
static const u8 sEmptyGfx[64] = {};
static const u8 sGbaCable_AffineTilemap[] = INCBIN_U8("graphics/trade/gba_affine_map_cable.bin");
static const u8 sGbaWireless_AffineTilemap[] = INCBIN_U8("graphics/trade/gba_affine_map_wireless.bin");
static const u16 sGbaWireless_Tilemap[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin");
static const u16 sGbaCable_Tilemap[] = INCBIN_U16("graphics/trade/gba_map_cable.bin");
static const u32 sCrossingHighlightWireless_Tilemap[] = INCBIN_U32("graphics/trade/crossing_highlight_wireless.bin.lz");
static const u8 sGbaAffineMapCable[] = INCBIN_U8("graphics/trade/gba_affine_map_cable.bin");
static const u8 sGbaAffineMapWireless[] = INCBIN_U8("graphics/trade/gba_affine_map_wireless.bin");
static const u16 sGbaMapWireless[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin");
static const u16 sGbaMapCable[] = INCBIN_U16("graphics/trade/gba_map_cable.bin");
static const u32 sWirelessCloseup_Map[] = INCBIN_U32("graphics/trade/crossing_highlight_wireless.bin.lz");
static const u16 sWirelessSignalSend_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_send.gbapal");
static const u16 sWirelessSignalRecv_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_receive.gbapal");
static const u16 sWirelessSignalNone_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_none.gbapal");
@@ -749,7 +730,7 @@ static const union AffineAnimCmd *const sAffineAnims_Pokeball[] =
static const struct SpriteSheet sPokeBallSpriteSheet =
{
.data = sPokeball_Gfx,
.size = 0x600,
.size = sizeof(sPokeball_Gfx),
.tag = GFXTAG_POKEBALL
};
@@ -805,7 +786,7 @@ static const union AffineAnimCmd *const sAffineAnims_LinkMonGlow[] =
static const struct SpriteSheet sSpriteSheet_LinkMonGlow =
{
.data = sLinkMonGlow_Gfx,
.size = 0x200,
.size = sizeof(sLinkMonGlow_Gfx),
.tag = GFXTAG_LINK_MON_GLOW
};
@@ -962,7 +943,7 @@ static const union AnimCmd *const sAnims_GbaScreen_Short[] =
static const struct SpriteSheet sSpriteSheet_GbaScreen =
{
.data = sGbaScreen_Gfx,
.size = 0x1000,
.size = sizeof(sGbaScreen_Gfx),
.tag = GFXTAG_GBA_SCREEN
};
@@ -1185,7 +1166,7 @@ static const s8 sTradeBallVerticalVelocityTable[] =
0, 0, 0, 1, 0, 1, 1, 2, 3
};
static const u8 sWirelessSignalTiming[][2] =
static const u8 sWirelessSignalAnimParams[][2] =
{
{ 0, 1},
{ 1, 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
@@ -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;
+50 -38
View File
@@ -226,18 +226,23 @@ static void DoQuizQuestionEasyChatScreen(void);
static void DoQuizSetAnswerEasyChatScreen(void);
static void DoQuizSetQuestionEasyChatScreen(void);
#define PALTAG_TRIANGLE_CURSOR 0
#define PALTAG_RECTANGLE_CURSOR 1
#define PALTAG_MISC_UI 2
#define PALTAG_RS_INTERVIEW_FRAME 3
enum {
PALTAG_TRIANGLE_CURSOR,
PALTAG_RECTANGLE_CURSOR,
PALTAG_MISC_UI,
PALTAG_RS_INTERVIEW_FRAME,
};
enum {
GFXTAG_TRIANGLE_CURSOR,
GFXTAG_RECTANGLE_CURSOR,
GFXTAG_SCROLL_INDICATOR,
GFXTAG_START_SELECT_BUTTONS,
GFXTAG_MODE_WINDOW,
GFXTAG_RS_INTERVIEW_FRAME,
GFXTAG_BUTTON_WINDOW,
};
#define GFXTAG_TRIANGLE_CURSOR 0
#define GFXTAG_RECTANGLE_CURSOR 1
#define GFXTAG_SCROLL_INDICATOR 2
#define GFXTAG_START_SELECT_BUTTONS 3
#define GFXTAG_MODE_WINDOW 4
#define GFXTAG_RS_INTERVIEW_FRAME 5
#define GFXTAG_BUTTON_WINDOW 6
// State values for sEasyChatScreen->inputState
// Control which input handler to use in HandleEasyChatInput
@@ -376,6 +381,13 @@ enum {
WINANIM_KEYBOARD_SWITCH_IN,
};
// Window IDs
enum {
WIN_TITLE,
WIN_MSG,
WIN_INPUT_SELECT, // Word groups, word list, and keyboard
};
// Values for text frame tilemap
#define FRAME_OFFSET_ORANGE 0x1000 // Orange frame, for phrase text
#define FRAME_OFFSET_GREEN 0x4000 // Green frame, for keyboard/word select
@@ -814,7 +826,7 @@ static const struct BgTemplate sEasyChatBgTemplates[] = {
};
static const struct WindowTemplate sEasyChatWindowTemplates[] = {
{
[WIN_TITLE] = {
.bg = 1,
.tilemapLeft = 6,
.tilemapTop = 0,
@@ -823,7 +835,7 @@ static const struct WindowTemplate sEasyChatWindowTemplates[] = {
.paletteNum = 10,
.baseBlock = 0x10,
},
{
[WIN_MSG] = {
.bg = 0,
.tilemapLeft = 3,
.tilemapTop = 15,
@@ -832,7 +844,7 @@ static const struct WindowTemplate sEasyChatWindowTemplates[] = {
.paletteNum = 15,
.baseBlock = 0xA,
},
{
[WIN_INPUT_SELECT] = {
.bg = 2,
.tilemapLeft = 1,
.tilemapTop = 0,
@@ -3934,10 +3946,10 @@ static void PrintTitle(void)
return;
xOffset = GetStringCenterAlignXOffset(FONT_NORMAL, titleText, 144);
FillWindowPixelBuffer(0, PIXEL_FILL(0));
PrintEasyChatTextWithColors(0, FONT_NORMAL, titleText, xOffset, 1, TEXT_SKIP_DRAW, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
PutWindowTilemap(0);
CopyWindowToVram(0, COPYWIN_FULL);
FillWindowPixelBuffer(WIN_TITLE, PIXEL_FILL(0));
PrintEasyChatTextWithColors(WIN_TITLE, FONT_NORMAL, titleText, xOffset, 1, TEXT_SKIP_DRAW, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
PutWindowTilemap(WIN_TITLE);
CopyWindowToVram(WIN_TITLE, COPYWIN_FULL);
}
static void PrintEasyChatText(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
@@ -3957,10 +3969,10 @@ static void PrintEasyChatTextWithColors(u8 windowId, u8 fontId, const u8 *str, u
static void PrintInitialInstructions(void)
{
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17);
LoadUserWindowBorderGfx(1, 1, BG_PLTT_ID(14));
DrawTextBorderOuter(1, 1, 14);
LoadUserWindowBorderGfx(WIN_MSG, 1, BG_PLTT_ID(14));
DrawTextBorderOuter(WIN_MSG, 1, 14);
PrintEasyChatStdMessage(MSG_INSTRUCTIONS);
PutWindowTilemap(1);
PutWindowTilemap(WIN_MSG);
CopyBgTilemapBufferToVram(0);
}
@@ -4004,14 +4016,14 @@ static void PrintEasyChatStdMessage(u8 msgId)
break;
}
FillWindowPixelBuffer(1, PIXEL_FILL(1));
FillWindowPixelBuffer(WIN_MSG, PIXEL_FILL(1));
if (text1)
PrintEasyChatText(1, FONT_NORMAL, text1, 0, 1, TEXT_SKIP_DRAW, 0);
PrintEasyChatText(WIN_MSG, FONT_NORMAL, text1, 0, 1, TEXT_SKIP_DRAW, 0);
if (text2)
PrintEasyChatText(1, FONT_NORMAL, text2, 0, 17, TEXT_SKIP_DRAW, 0);
PrintEasyChatText(WIN_MSG, FONT_NORMAL, text2, 0, 17, TEXT_SKIP_DRAW, 0);
CopyWindowToVram(1, COPYWIN_FULL);
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
}
static void CreateEasyChatYesNoMenu(u8 initialCursorPos)
@@ -4198,14 +4210,14 @@ static void AdjustBgTilemapForFooter(void)
static void DrawLowerWindow(void)
{
PutWindowTilemap(2);
CopyBgTilemapBufferToVram(2);
PutWindowTilemap(WIN_INPUT_SELECT);
CopyBgTilemapBufferToVram(WIN_INPUT_SELECT);
}
static void InitLowerWindowText(u32 whichText)
{
ResetLowerWindowScroll();
FillWindowPixelBuffer(2, PIXEL_FILL(1));
FillWindowPixelBuffer(WIN_INPUT_SELECT, PIXEL_FILL(1));
switch (whichText)
{
case TEXT_GROUPS:
@@ -4219,7 +4231,7 @@ static void InitLowerWindowText(u32 whichText)
break;
}
CopyWindowToVram(2, COPYWIN_GFX);
CopyWindowToVram(WIN_INPUT_SELECT, COPYWIN_GFX);
}
static void PrintKeyboardText(void)
@@ -4248,7 +4260,7 @@ static void PrintKeyboardGroupNames(void)
return;
}
PrintEasyChatText(2, FONT_NORMAL, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, TEXT_SKIP_DRAW, NULL);
PrintEasyChatText(WIN_INPUT_SELECT, FONT_NORMAL, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, TEXT_SKIP_DRAW, NULL);
}
y += 16;
@@ -4260,7 +4272,7 @@ static void PrintKeyboardAlphabet(void)
u32 i;
for (i = 0; i < ARRAY_COUNT(sEasyChatKeyboardAlphabet); i++)
PrintEasyChatText(2, FONT_NORMAL, sEasyChatKeyboardAlphabet[i], 10, 97 + i * 16, TEXT_SKIP_DRAW, NULL);
PrintEasyChatText(WIN_INPUT_SELECT, FONT_NORMAL, sEasyChatKeyboardAlphabet[i], 10, 97 + i * 16, TEXT_SKIP_DRAW, NULL);
}
static void PrintInitialWordSelectText(void)
@@ -4331,16 +4343,16 @@ static void PrintWordSelectText(u8 scrollOffset, u8 numRows)
{
CopyEasyChatWordPadded(sScreenControl->wordSelectPrintBuffer, easyChatWord, 0);
if (!DummyWordCheck(easyChatWord))
PrintEasyChatText(2, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, NULL);
PrintEasyChatText(WIN_INPUT_SELECT, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, NULL);
else // Never reached
PrintEasyChatTextWithColors(2, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GRAY);
PrintEasyChatTextWithColors(WIN_INPUT_SELECT, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GRAY);
}
}
y += 16;
}
CopyWindowToVram(2, COPYWIN_GFX);
CopyWindowToVram(WIN_INPUT_SELECT, COPYWIN_GFX);
}
static void EraseWordSelectRows(u8 scrollOffset, u8 numRows)
@@ -4364,15 +4376,15 @@ static void EraseWordSelectRows(u8 scrollOffset, u8 numRows)
var1 = 0;
}
FillWindowPixelRect(2, PIXEL_FILL(1), 0, y, 224, var2);
FillWindowPixelRect(WIN_INPUT_SELECT, PIXEL_FILL(1), 0, y, 224, var2);
if (var1)
FillWindowPixelRect(2, PIXEL_FILL(1), 0, 0, 224, var1);
FillWindowPixelRect(WIN_INPUT_SELECT, PIXEL_FILL(1), 0, 0, 224, var1);
}
static void ClearWordSelectWindow(void)
{
FillWindowPixelBuffer(2, PIXEL_FILL(1));
CopyWindowToVram(2, COPYWIN_GFX);
FillWindowPixelBuffer(WIN_INPUT_SELECT, PIXEL_FILL(1));
CopyWindowToVram(WIN_INPUT_SELECT, COPYWIN_GFX);
}
static void InitLowerWindowAnim(int winAnimType)
+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;
}
+7 -7
View File
@@ -343,7 +343,7 @@ static void Task_EReader(u8 taskId)
case ER_STATE_MSG_SELECT_CONNECT:
if (PrintMysteryGiftMenuMessage(&data->textState, gJPText_SelectConnectFromEReaderMenu))
{
AddTextPrinterToWindow1(gJPText_SelectConnectWithGBA);
MG_AddMessageTextPrinter(gJPText_SelectConnectWithGBA);
ResetTimer(&data->timer);
data->state = ER_STATE_MSG_SELECT_CONNECT_WAIT;
}
@@ -397,7 +397,7 @@ static void Task_EReader(u8 taskId)
data->state = ER_STATE_MSG_SELECT_CONNECT;
break;
case ER_STATE_CONNECTING:
AddTextPrinterToWindow1(gJPText_Connecting);
MG_AddMessageTextPrinter(gJPText_Connecting);
// XXX: This (u32 *) cast is discarding the const qualifier from gMultiBootProgram_EReader_Start
EReader_Load(&gEReaderData, gMultiBootProgram_EReader_End - gMultiBootProgram_EReader_Start, (u32 *)gMultiBootProgram_EReader_Start);
data->state = ER_STATE_TRANSFER;
@@ -416,7 +416,7 @@ static void Task_EReader(u8 taskId)
else if (data->status == TRANSFER_SUCCESS)
{
ResetTimer(&data->timer);
AddTextPrinterToWindow1(gJPText_PleaseWaitAMoment);
MG_AddMessageTextPrinter(gJPText_PleaseWaitAMoment);
data->state = ER_STATE_TRANSFER_SUCCESS;
}
else // TRANSFER_CANCELED
@@ -430,7 +430,7 @@ static void Task_EReader(u8 taskId)
break;
case ER_STATE_LOAD_CARD_START:
OpenEReaderLink();
AddTextPrinterToWindow1(gJPText_AllowEReaderToLoadCard);
MG_AddMessageTextPrinter(gJPText_AllowEReaderToLoadCard);
data->state = ER_STATE_LOAD_CARD;
break;
case ER_STATE_LOAD_CARD:
@@ -439,7 +439,7 @@ static void Task_EReader(u8 taskId)
case RECV_ACTIVE:
break;
case RECV_SUCCESS:
AddTextPrinterToWindow1(gJPText_Connecting);
MG_AddMessageTextPrinter(gJPText_Connecting);
data->state = ER_STATE_WAIT_RECV_CARD;
break;
case RECV_CANCELED:
@@ -487,7 +487,7 @@ static void Task_EReader(u8 taskId)
case ER_STATE_SAVE:
if (TryWriteTrainerHill((struct EReaderTrainerHillSet *)&gDecompressionBuffer))
{
AddTextPrinterToWindow1(gJPText_ConnectionComplete);
MG_AddMessageTextPrinter(gJPText_ConnectionComplete);
ResetTimer(&data->timer);
data->state = ER_STATE_SUCCESS_MSG;
}
@@ -499,7 +499,7 @@ static void Task_EReader(u8 taskId)
case ER_STATE_SUCCESS_MSG:
if (UpdateTimer(&data->timer, 120))
{
AddTextPrinterToWindow1(gJPText_NewTrainerHasComeToHoenn);
MG_AddMessageTextPrinter(gJPText_NewTrainerHasComeToHoenn);
PlayFanfare(MUS_OBTAIN_ITEM);
data->state = ER_STATE_SUCCESS_END;
}
+1 -1
View File
@@ -1498,7 +1498,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;
+47 -24
View File
@@ -3831,26 +3831,38 @@ static void SpriteCB_DeoxysRockFragment(struct Sprite *sprite)
DestroySprite(sprite);
}
// Task data for Task_MoveDeoxysRock
#define tState data[0]
#define tSpriteId data[1]
#define tTargetX data[2]
#define tTargetY data[3]
#define tCurX data[4]
#define tCurY data[5]
#define tVelocityX data[6]
#define tVelocityY data[7]
#define tMoveSteps data[8]
#define tObjEventId data[9]
bool8 FldEff_MoveDeoxysRock(struct Sprite *sprite)
{
u8 objectEventIdBuffer;
if (!TryGetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2], &objectEventIdBuffer))
u8 objectEventId;
if (!TryGetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2], &objectEventId))
{
struct ObjectEvent *object;
int xPos, yPos;
u8 taskId;
object = &gObjectEvents[objectEventIdBuffer];
object = &gObjectEvents[objectEventId];
xPos = object->currentCoords.x - MAP_OFFSET;
yPos = object->currentCoords.y - MAP_OFFSET;
xPos = (gFieldEffectArguments[3] - xPos) * 16;
yPos = (gFieldEffectArguments[4] - yPos) * 16;
ShiftObjectEventCoords(object, gFieldEffectArguments[3] + MAP_OFFSET, gFieldEffectArguments[4] + MAP_OFFSET);
taskId = CreateTask(Task_MoveDeoxysRock, 80);
gTasks[taskId].data[1] = object->spriteId;
gTasks[taskId].data[2] = gSprites[object->spriteId].x + xPos;
gTasks[taskId].data[3] = gSprites[object->spriteId].y + yPos;
gTasks[taskId].data[8] = gFieldEffectArguments[5];
gTasks[taskId].data[9] = objectEventIdBuffer;
gTasks[taskId].tSpriteId = object->spriteId;
gTasks[taskId].tTargetX = gSprites[object->spriteId].x + xPos;
gTasks[taskId].tTargetY = gSprites[object->spriteId].y + yPos;
gTasks[taskId].tMoveSteps = gFieldEffectArguments[5];
gTasks[taskId].tObjEventId = objectEventId;
}
return FALSE;
}
@@ -3858,29 +3870,30 @@ bool8 FldEff_MoveDeoxysRock(struct Sprite *sprite)
static void Task_MoveDeoxysRock(u8 taskId)
{
s16 *data = gTasks[taskId].data;
struct Sprite *sprite = &gSprites[data[1]];
switch (data[0])
struct Sprite *sprite = &gSprites[tSpriteId];
switch (tState)
{
case 0:
data[4] = sprite->x << 4;
data[5] = sprite->y << 4;
data[6] = SAFE_DIV(data[2] * 16 - data[4], data[8]);
data[7] = SAFE_DIV(data[3] * 16 - data[5], data[8]);
data[0]++;
tCurX = sprite->x << 4;
tCurY = sprite->y << 4;
tVelocityX = SAFE_DIV(tTargetX * 16 - tCurX, tMoveSteps);
tVelocityY = SAFE_DIV(tTargetY * 16 - tCurY, tMoveSteps);
tState++;
// fallthrough
case 1:
if (data[8] != 0)
if (tMoveSteps != 0)
{
data[8]--;
data[4] += data[6];
data[5] += data[7];
sprite->x = data[4] >> 4;
sprite->y = data[5] >> 4;
tMoveSteps--;
tCurX += tVelocityX;
tCurY += tVelocityY;
sprite->x = tCurX >> 4;
sprite->y = tCurY >> 4;
}
else
{
struct ObjectEvent *object = &gObjectEvents[data[9]];
sprite->x = data[2];
sprite->y = data[3];
struct ObjectEvent *object = &gObjectEvents[tObjEventId];
sprite->x = tTargetX;
sprite->y = tTargetY;
ShiftStillObjectEventCoords(object);
object->triggerGroundEffectsOnStop = TRUE;
FieldEffectActiveListRemove(FLDEFF_MOVE_DEOXYS_ROCK);
@@ -3890,3 +3903,13 @@ static void Task_MoveDeoxysRock(u8 taskId)
}
}
#undef tState
#undef tSpriteId
#undef tTargetX
#undef tTargetY
#undef tCurX
#undef tCurY
#undef tVelocityX
#undef tVelocityY
#undef tMoveSteps
#undef tObjEventId
+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;
+20 -20
View File
@@ -23,9 +23,15 @@
* For the fly map, and utility functions all of the maps use, see region_map.c
*/
// Static type declarations
enum {
WIN_MAPSEC_NAME,
WIN_TITLE,
};
// Static RAM declarations
enum {
TAG_PLAYER_ICON,
TAG_CURSOR,
};
static EWRAM_DATA struct {
MainCallback callback;
@@ -34,16 +40,12 @@ static EWRAM_DATA struct {
u16 state;
} *sFieldRegionMapHandler = NULL;
// Static ROM declarations
static void MCB2_InitRegionMapRegisters(void);
static void VBCB_FieldUpdateRegionMap(void);
static void MCB2_FieldUpdateRegionMap(void);
static void FieldUpdateRegionMap(void);
static void PrintRegionMapSecName(void);
// .rodata
static const struct BgTemplate sFieldRegionMapBgTemplates[] = {
{
.bg = 0,
@@ -66,7 +68,7 @@ static const struct BgTemplate sFieldRegionMapBgTemplates[] = {
static const struct WindowTemplate sFieldRegionMapWindowTemplates[] =
{
{
[WIN_MAPSEC_NAME] = {
.bg = 0,
.tilemapLeft = 17,
.tilemapTop = 17,
@@ -75,7 +77,7 @@ static const struct WindowTemplate sFieldRegionMapWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 1
},
{
[WIN_TITLE] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 1,
@@ -87,8 +89,6 @@ static const struct WindowTemplate sFieldRegionMapWindowTemplates[] =
DUMMY_WIN_TEMPLATE
};
// .text
void FieldInitRegionMap(MainCallback callback)
{
SetVBlankCallback(NULL);
@@ -145,16 +145,16 @@ static void FieldUpdateRegionMap(void)
{
case 0:
InitRegionMap(&sFieldRegionMapHandler->regionMap, FALSE);
CreateRegionMapPlayerIcon(0, 0);
CreateRegionMapCursor(1, 1);
CreateRegionMapPlayerIcon(TAG_PLAYER_ICON, TAG_PLAYER_ICON);
CreateRegionMapCursor(TAG_CURSOR, TAG_CURSOR);
sFieldRegionMapHandler->state++;
break;
case 1:
DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x27, 0xd);
DrawStdFrameWithCustomTileAndPalette(WIN_TITLE, FALSE, 0x27, 0xd);
offset = GetStringCenterAlignXOffset(FONT_NORMAL, gText_Hoenn, 0x38);
AddTextPrinterParameterized(1, FONT_NORMAL, gText_Hoenn, offset, 1, 0, NULL);
AddTextPrinterParameterized(WIN_TITLE, FONT_NORMAL, gText_Hoenn, offset, 1, 0, NULL);
ScheduleBgCopyTilemapToVram(0);
DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x27, 0xd);
DrawStdFrameWithCustomTileAndPalette(WIN_MAPSEC_NAME, FALSE, 0x27, 0xd);
PrintRegionMapSecName();
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
sFieldRegionMapHandler->state++;
@@ -203,13 +203,13 @@ static void PrintRegionMapSecName(void)
{
if (sFieldRegionMapHandler->regionMap.mapSecType != MAPSECTYPE_NONE)
{
FillWindowPixelBuffer(0, PIXEL_FILL(1));
AddTextPrinterParameterized(0, FONT_NORMAL, sFieldRegionMapHandler->regionMap.mapSecName, 0, 1, 0, NULL);
ScheduleBgCopyTilemapToVram(0);
FillWindowPixelBuffer(WIN_MAPSEC_NAME, PIXEL_FILL(1));
AddTextPrinterParameterized(WIN_MAPSEC_NAME, FONT_NORMAL, sFieldRegionMapHandler->regionMap.mapSecName, 0, 1, 0, NULL);
ScheduleBgCopyTilemapToVram(WIN_MAPSEC_NAME);
}
else
{
FillWindowPixelBuffer(0, PIXEL_FILL(1));
CopyWindowToVram(0, COPYWIN_FULL);
FillWindowPixelBuffer(WIN_MAPSEC_NAME, PIXEL_FILL(1));
CopyWindowToVram(WIN_MAPSEC_NAME, COPYWIN_FULL);
}
}
+219 -143
View File
@@ -46,6 +46,7 @@
#include "wallclock.h"
#include "window.h"
#include "constants/battle_frontier.h"
#include "constants/battle_pyramid.h"
#include "constants/battle_tower.h"
#include "constants/decorations.h"
#include "constants/event_objects.h"
@@ -66,6 +67,15 @@
#include "constants/metatile_labels.h"
#include "palette.h"
#define TAG_ITEM_ICON 5500
#define GFXTAG_MULTICHOICE_SCROLL_ARROWS 2000
#define PALTAG_MULTICHOICE_SCROLL_ARROWS 100
#define ELEVATOR_WINDOW_WIDTH 3
#define ELEVATOR_WINDOW_HEIGHT 3
#define ELEVATOR_LIGHT_STAGES 3
EWRAM_DATA bool8 gBikeCyclingChallenge = FALSE;
EWRAM_DATA u8 gBikeCollisions = 0;
static EWRAM_DATA u32 sBikeCyclingTimer = 0;
@@ -94,8 +104,8 @@ static void LoadLinkPartnerObjectEventSpritePalette(u8, u8, u8);
static void Task_PetalburgGymSlideOpenRoomDoors(u8);
static void PetalburgGymSetDoorMetatiles(u8, u16);
static void Task_PCTurnOnEffect(u8);
static void PCTurnOnEffect_0(struct Task *);
static void PCTurnOnEffect_1(s16, s8, s8);
static void PCTurnOnEffect(struct Task *);
static void PCTurnOnEffect_SetMetatile(s16, s8, s8);
static void PCTurnOffEffect(void);
static void Task_LotteryCornerComputerEffect(u8);
static void LotteryCornerComputerEffect(struct Task *);
@@ -966,34 +976,44 @@ void FieldShowRegionMap(void)
SetMainCallback2(CB2_FieldShowRegionMap);
}
// Task data for Task_PCTurnOnEffect and Task_LotteryCornerComputerEffect
#define tPaused data[0] // Never set
#define tTaskId data[1]
#define tFlickerCount data[2]
#define tTimer data[3]
#define tIsScreenOn data[4]
// For this special, gSpecialVar_0x8004 is expected to be some PC_LOCATION_* value.
void DoPCTurnOnEffect(void)
{
if (FuncIsActiveTask(Task_PCTurnOnEffect) != TRUE)
{
u8 taskId = CreateTask(Task_PCTurnOnEffect, 8);
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = taskId;
gTasks[taskId].data[2] = 0;
gTasks[taskId].data[3] = 0;
gTasks[taskId].data[4] = 0;
gTasks[taskId].tPaused = FALSE;
gTasks[taskId].tTaskId = taskId;
gTasks[taskId].tFlickerCount = 0;
gTasks[taskId].tTimer = 0;
gTasks[taskId].tIsScreenOn = FALSE;
}
}
static void Task_PCTurnOnEffect(u8 taskId)
{
struct Task *task = &gTasks[taskId];
if (task->data[0] == 0)
PCTurnOnEffect_0(task);
if (!task->tPaused)
PCTurnOnEffect(task);
}
static void PCTurnOnEffect_0(struct Task *task)
static void PCTurnOnEffect(struct Task *task)
{
u8 playerDirection;
s8 dx = 0;
s8 dy = 0;
if (task->data[3] == 6)
if (task->tTimer == 6)
{
task->data[3] = 0;
task->tTimer = 0;
// Get where the PC should be, depending on where the player is looking.
playerDirection = GetPlayerFacingDirection();
switch (playerDirection)
{
@@ -1010,39 +1030,47 @@ static void PCTurnOnEffect_0(struct Task *task)
dy = -1;
break;
}
PCTurnOnEffect_1(task->data[4], dx, dy);
// Update map
PCTurnOnEffect_SetMetatile(task->tIsScreenOn, dx, dy);
DrawWholeMapView();
task->data[4] ^= 1;
if ((++task->data[2]) == 5)
DestroyTask(task->data[1]);
// Screen flickers 5 times. Odd number and starting with the
// screen off means the animation ends with the screen on.
task->tIsScreenOn ^= 1;
if (++task->tFlickerCount == 5)
DestroyTask(task->tTaskId);
}
task->data[3]++;
task->tTimer++;
}
static void PCTurnOnEffect_1(s16 isPcTurnedOn, s8 dx, s8 dy)
static void PCTurnOnEffect_SetMetatile(s16 isScreenOn, s8 dx, s8 dy)
{
u16 tileId = 0;
if (isPcTurnedOn)
u16 metatileId = 0;
if (isScreenOn)
{
// Screen is on, set it off
if (gSpecialVar_0x8004 == PC_LOCATION_OTHER)
tileId = METATILE_Building_PC_Off;
metatileId = METATILE_Building_PC_Off;
else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE)
tileId = METATILE_BrendansMaysHouse_BrendanPC_Off;
metatileId = METATILE_BrendansMaysHouse_BrendanPC_Off;
else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE)
tileId = METATILE_BrendansMaysHouse_MayPC_Off;
metatileId = METATILE_BrendansMaysHouse_MayPC_Off;
}
else
{
// Screen is off, set it on
if (gSpecialVar_0x8004 == PC_LOCATION_OTHER)
tileId = METATILE_Building_PC_On;
metatileId = METATILE_Building_PC_On;
else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE)
tileId = METATILE_BrendansMaysHouse_BrendanPC_On;
metatileId = METATILE_BrendansMaysHouse_BrendanPC_On;
else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE)
tileId = METATILE_BrendansMaysHouse_MayPC_On;
metatileId = METATILE_BrendansMaysHouse_MayPC_On;
}
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, tileId | MAPGRID_COLLISION_MASK);
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, metatileId | MAPGRID_COLLISION_MASK);
}
// For this special, gSpecialVar_0x8004 is expected to be some PC_LOCATION_* value.
void DoPCTurnOffEffect(void)
{
PCTurnOffEffect();
@@ -1052,7 +1080,9 @@ static void PCTurnOffEffect(void)
{
s8 dx = 0;
s8 dy = 0;
u16 tileId = 0;
u16 metatileId = 0;
// Get where the PC should be, depending on where the player is looking.
u8 playerDirection = GetPlayerFacingDirection();
switch (playerDirection)
{
@@ -1069,13 +1099,15 @@ static void PCTurnOffEffect(void)
dy = -1;
break;
}
if (gSpecialVar_0x8004 == PC_LOCATION_OTHER)
tileId = METATILE_Building_PC_Off;
metatileId = METATILE_Building_PC_Off;
else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE)
tileId = METATILE_BrendansMaysHouse_BrendanPC_Off;
metatileId = METATILE_BrendansMaysHouse_BrendanPC_Off;
else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE)
tileId = METATILE_BrendansMaysHouse_MayPC_Off;
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, tileId | MAPGRID_COLLISION_MASK);
metatileId = METATILE_BrendansMaysHouse_MayPC_Off;
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, metatileId | MAPGRID_COLLISION_MASK);
DrawWholeMapView();
}
@@ -1084,42 +1116,47 @@ void DoLotteryCornerComputerEffect(void)
if (FuncIsActiveTask(Task_LotteryCornerComputerEffect) != TRUE)
{
u8 taskId = CreateTask(Task_LotteryCornerComputerEffect, 8);
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = taskId;
gTasks[taskId].data[2] = 0;
gTasks[taskId].data[3] = 0;
gTasks[taskId].data[4] = 0;
gTasks[taskId].tPaused = FALSE;
gTasks[taskId].tTaskId = taskId;
gTasks[taskId].tFlickerCount = 0;
gTasks[taskId].tTimer = 0;
gTasks[taskId].tIsScreenOn = FALSE;
}
}
static void Task_LotteryCornerComputerEffect(u8 taskId)
{
struct Task *task = &gTasks[taskId];
if (task->data[0] == 0)
if (!task->tPaused)
LotteryCornerComputerEffect(task);
}
static void LotteryCornerComputerEffect(struct Task *task)
{
if (task->data[3] == 6)
if (task->tTimer == 6)
{
task->data[3] = 0;
if (task->data[4] != 0)
task->tTimer = 0;
if (task->tIsScreenOn)
{
// Screen is on, set it off
MapGridSetMetatileIdAt(11 + MAP_OFFSET, 1 + MAP_OFFSET, METATILE_Shop_Laptop1_Normal | MAPGRID_COLLISION_MASK);
MapGridSetMetatileIdAt(11 + MAP_OFFSET, 2 + MAP_OFFSET, METATILE_Shop_Laptop2_Normal | MAPGRID_COLLISION_MASK);
}
else
{
// Screen is off, set it on
MapGridSetMetatileIdAt(11 + MAP_OFFSET, 1 + MAP_OFFSET, METATILE_Shop_Laptop1_Flash | MAPGRID_COLLISION_MASK);
MapGridSetMetatileIdAt(11 + MAP_OFFSET, 2 + MAP_OFFSET, METATILE_Shop_Laptop2_Flash | MAPGRID_COLLISION_MASK);
}
DrawWholeMapView();
task->data[4] ^= 1;
if ((++task->data[2]) == 5)
DestroyTask(task->data[1]);
// Screen flickers 5 times. Odd number and starting with the
// screen off means the animation ends with the screen on.
task->tIsScreenOn ^= 1;
if (++task->tFlickerCount == 5)
DestroyTask(task->tTaskId);
}
task->data[3]++;
task->tTimer++;
}
void EndLotteryCornerComputerEffect(void)
@@ -1129,6 +1166,12 @@ void EndLotteryCornerComputerEffect(void)
DrawWholeMapView();
}
#undef tPaused
#undef tTaskId
#undef tFlickerCount
#undef tTimer
#undef tIsScreenOn
void SetTrickHouseNuggetFlag(void)
{
u16 *specVar = &gSpecialVar_0x8004;
@@ -1213,7 +1256,7 @@ void SpawnCameraObject(void)
OBJ_EVENT_ID_CAMERA,
gSaveBlock1Ptr->pos.x + MAP_OFFSET,
gSaveBlock1Ptr->pos.y + MAP_OFFSET,
3);
3); // elevation
gObjectEvents[obj].invisible = TRUE;
CameraObjectSetFollowedSpriteId(gObjectEvents[obj].spriteId);
}
@@ -1378,7 +1421,7 @@ void SetShoalItemFlag(u16 unused)
FlagSet(FLAG_SYS_SHOAL_ITEM);
}
void PutZigzagoonInPlayerParty(void)
void LoadWallyZigzagoon(void)
{
u16 monData;
CreateMon(&gPlayerParty[0], SPECIES_ZIGZAGOON, 7, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
@@ -1399,7 +1442,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;
@@ -1418,20 +1461,21 @@ bool8 IsPokerusInParty(void)
return TRUE;
}
#define horizontalPan data[0]
#define delayCounter data[1]
#define numShakes data[2]
#define delay data[3]
#define verticalPan data[4]
// Task data for Task_ShakeCamera
#define tHorizontalPan data[0]
#define tDelayCounter data[1]
#define tNumShakes data[2]
#define tDelay data[3]
#define tVerticalPan data[4]
void ShakeCamera(void)
{
u8 taskId = CreateTask(Task_ShakeCamera, 9);
gTasks[taskId].horizontalPan = gSpecialVar_0x8005;
gTasks[taskId].delayCounter = 0;
gTasks[taskId].numShakes = gSpecialVar_0x8006;
gTasks[taskId].delay = gSpecialVar_0x8007;
gTasks[taskId].verticalPan = gSpecialVar_0x8004;
gTasks[taskId].tHorizontalPan = gSpecialVar_0x8005;
gTasks[taskId].tDelayCounter = 0;
gTasks[taskId].tNumShakes = gSpecialVar_0x8006;
gTasks[taskId].tDelay = gSpecialVar_0x8007;
gTasks[taskId].tVerticalPan = gSpecialVar_0x8004;
SetCameraPanningCallback(NULL);
PlaySE(SE_M_STRENGTH);
}
@@ -1440,15 +1484,15 @@ static void Task_ShakeCamera(u8 taskId)
{
s16 *data = gTasks[taskId].data;
delayCounter++;
if (delayCounter % delay == 0)
tDelayCounter++;
if (tDelayCounter % tDelay == 0)
{
delayCounter = 0;
numShakes--;
horizontalPan = -horizontalPan;
verticalPan = -verticalPan;
SetCameraPanning(horizontalPan, verticalPan);
if (numShakes == 0)
tDelayCounter = 0;
tNumShakes--;
tHorizontalPan = -tHorizontalPan;
tVerticalPan = -tVerticalPan;
SetCameraPanning(tHorizontalPan, tVerticalPan);
if (tNumShakes == 0)
{
StopCameraShake(taskId);
InstallCameraPanAheadCallback();
@@ -1462,11 +1506,11 @@ static void StopCameraShake(u8 taskId)
ScriptContext_Enable();
}
#undef horizontalPan
#undef delayCounter
#undef numShakes
#undef delay
#undef verticalPan
#undef tHorizontalPan
#undef tDelayCounter
#undef tNumShakes
#undef tDelay
#undef tVerticalPan
bool8 FoundBlackGlasses(void)
{
@@ -1491,7 +1535,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) != 0)
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;
@@ -1499,7 +1544,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
@@ -1631,7 +1676,7 @@ void OffsetCameraForBattle(void)
SetCameraPanning(8, 0);
}
const struct WindowTemplate gElevatorFloor_WindowTemplate =
static const struct WindowTemplate sWindowTemplate_ElevatorFloor =
{
.bg = 0,
.tilemapLeft = 21,
@@ -1642,7 +1687,7 @@ const struct WindowTemplate gElevatorFloor_WindowTemplate =
.baseBlock = 8,
};
const u8 *const gDeptStoreFloorNames[] =
static const u8 *const sDeptStoreFloorNames[] =
{
[DEPT_STORE_FLOORNUM_B4F] = gText_B4F,
[DEPT_STORE_FLOORNUM_B3F] = gText_B3F,
@@ -1662,7 +1707,7 @@ const u8 *const gDeptStoreFloorNames[] =
[DEPT_STORE_FLOORNUM_ROOFTOP] = gText_Rooftop
};
static const u16 sElevatorWindowTiles_Ascending[][3] =
static const u16 sElevatorWindowTiles_Ascending[ELEVATOR_WINDOW_HEIGHT][ELEVATOR_LIGHT_STAGES] =
{
{
METATILE_BattleFrontier_Elevator_Top0,
@@ -1681,7 +1726,7 @@ static const u16 sElevatorWindowTiles_Ascending[][3] =
},
};
static const u16 sElevatorWindowTiles_Descending[][3] =
static const u16 sElevatorWindowTiles_Descending[ELEVATOR_WINDOW_HEIGHT][ELEVATOR_LIGHT_STAGES] =
{
{
METATILE_BattleFrontier_Elevator_Top0,
@@ -1765,53 +1810,66 @@ u16 GetDeptStoreDefaultFloorChoice(void)
return sLilycoveDeptStore_DefaultFloorChoice;
}
// Task data for Task_MoveElevator
#define tTimer data[1]
#define tMoveCounter data[2]
#define tVerticalPan data[4]
#define tTotalMoves data[5]
#define tDescending data[6]
// The maximum considered difference between floors.
// Elevator trips with a larger difference are treated the same
// (i.e. traveling 9 floors and 200 floors would take the same amount of time).
#define MAX_ELEVATOR_TRIP 9
// gSpecialVar_0x8005 here is expected to be the current floor number, and
// gSpecialVar_0x8006 is expected to be the destination floor number.
void MoveElevator(void)
{
static const u8 sElevatorTripLength[] = { 8, 16, 24, 32, 38, 46, 52, 56, 57 };
static const u8 sElevatorTripLength[MAX_ELEVATOR_TRIP] = { 8, 16, 24, 32, 38, 46, 52, 56, 57 };
s16 *data = gTasks[CreateTask(Task_MoveElevator, 9)].data;
u16 floorDelta;
data[1] = 0;
data[2] = 0;
data[4] = 1;
tTimer = 0;
tMoveCounter = 0;
tVerticalPan = 1;
// descending
if (gSpecialVar_0x8005 > gSpecialVar_0x8006)
{
floorDelta = gSpecialVar_0x8005 - gSpecialVar_0x8006;
data[6] = TRUE;
tDescending = TRUE;
}
else
{
floorDelta = gSpecialVar_0x8006 - gSpecialVar_0x8005;
data[6] = FALSE;
tDescending = FALSE;
}
if (floorDelta > 8)
floorDelta = 8;
if (floorDelta > MAX_ELEVATOR_TRIP - 1)
floorDelta = MAX_ELEVATOR_TRIP - 1;
data[5] = sElevatorTripLength[floorDelta];
tTotalMoves = sElevatorTripLength[floorDelta];
SetCameraPanningCallback(NULL);
MoveElevatorWindowLights(floorDelta, data[6]);
MoveElevatorWindowLights(floorDelta, tDescending);
PlaySE(SE_ELEVATOR);
}
static void Task_MoveElevator(u8 taskId)
{
s16 *data = gTasks[taskId].data;
data[1]++;
if (data[1] % 3 == 0)
tTimer++;
if (tTimer % 3 == 0)
{
data[1] = 0;
data[2]++;
data[4] = -data[4];
SetCameraPanning(0, data[4]);
tTimer = 0;
tMoveCounter++;
tVerticalPan = -tVerticalPan;
SetCameraPanning(0, tVerticalPan);
// arrived at floor
if (data[2] == data[5])
if (tMoveCounter == tTotalMoves)
{
// Arrived at floor
PlaySE(SE_DING_DONG);
DestroyTask(taskId);
ScriptContext_Enable();
@@ -1820,18 +1878,24 @@ static void Task_MoveElevator(u8 taskId)
}
}
#undef tTimer
#undef tMoveCounter
#undef tVerticalPan
#undef tTotalMoves
#undef tDescending
void ShowDeptStoreElevatorFloorSelect(void)
{
int xPos;
sTutorMoveAndElevatorWindowId = AddWindow(&gElevatorFloor_WindowTemplate);
sTutorMoveAndElevatorWindowId = AddWindow(&sWindowTemplate_ElevatorFloor);
SetStandardWindowBorderStyle(sTutorMoveAndElevatorWindowId, FALSE);
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gText_ElevatorNowOn, 64);
AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gText_ElevatorNowOn, xPos, 1, TEXT_SKIP_DRAW, NULL);
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], 64);
AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], xPos, 17, TEXT_SKIP_DRAW, NULL);
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sDeptStoreFloorNames[gSpecialVar_0x8005], 64);
AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, sDeptStoreFloorNames[gSpecialVar_0x8005], xPos, 17, TEXT_SKIP_DRAW, NULL);
PutWindowTilemap(sTutorMoveAndElevatorWindowId);
CopyWindowToVram(sTutorMoveAndElevatorWindowId, COPYWIN_FULL);
@@ -1843,17 +1907,23 @@ void CloseDeptStoreElevatorWindow(void)
RemoveWindow(sTutorMoveAndElevatorWindowId);
}
// Task data for Task_MoveElevatorWindowLights
#define tMoveCounter data[0]
#define tTimer data[1]
#define tDescending data[2]
#define tTotalMoves data[3]
static void MoveElevatorWindowLights(u16 floorDelta, bool8 descending)
{
static const u8 sElevatorLightCycles[] = { 3, 6, 9, 12, 15, 18, 21, 24, 27 };
static const u8 sElevatorLightCycles[MAX_ELEVATOR_TRIP] = { 3, 6, 9, 12, 15, 18, 21, 24, 27 };
if (FuncIsActiveTask(Task_MoveElevatorWindowLights) != TRUE)
{
u8 taskId = CreateTask(Task_MoveElevatorWindowLights, 8);
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = 0;
gTasks[taskId].data[2] = descending;
gTasks[taskId].data[3] = sElevatorLightCycles[floorDelta];
gTasks[taskId].tMoveCounter = 0;
gTasks[taskId].tTimer = 0;
gTasks[taskId].tDescending = descending;
gTasks[taskId].tTotalMoves = sElevatorLightCycles[floorDelta];
}
}
@@ -1862,36 +1932,41 @@ static void Task_MoveElevatorWindowLights(u8 taskId)
u8 x, y;
s16 *data = gTasks[taskId].data;
if (data[1] == 6)
if (tTimer == 6)
{
data[0]++;
tMoveCounter++;
// ascending
if (data[2] == FALSE)
if (!tDescending)
{
for (y = 0; y < 3; y++)
// Ascending
for (y = 0; y < ELEVATOR_WINDOW_HEIGHT; y++)
{
for (x = 0; x < 3; x++)
MapGridSetMetatileIdAt(x + MAP_OFFSET + 1, y + MAP_OFFSET, sElevatorWindowTiles_Ascending[y][data[0] % 3] | MAPGRID_COLLISION_MASK);
for (x = 0; x < ELEVATOR_WINDOW_WIDTH; x++)
MapGridSetMetatileIdAt(x + MAP_OFFSET + 1, y + MAP_OFFSET, sElevatorWindowTiles_Ascending[y][tMoveCounter % ELEVATOR_LIGHT_STAGES] | MAPGRID_COLLISION_MASK);
}
}
// descending
else
{
for (y = 0; y < 3; y++)
// Descending
for (y = 0; y < ELEVATOR_WINDOW_HEIGHT; y++)
{
for (x = 0; x < 3; x++)
MapGridSetMetatileIdAt(x + MAP_OFFSET + 1, y + MAP_OFFSET, sElevatorWindowTiles_Descending[y][data[0] % 3] | MAPGRID_COLLISION_MASK);
for (x = 0; x < ELEVATOR_WINDOW_WIDTH; x++)
MapGridSetMetatileIdAt(x + MAP_OFFSET + 1, y + MAP_OFFSET, sElevatorWindowTiles_Descending[y][tMoveCounter % ELEVATOR_LIGHT_STAGES] | MAPGRID_COLLISION_MASK);
}
}
DrawWholeMapView();
data[1] = 0;
if (data[0] == data[3])
tTimer = 0;
if (tMoveCounter == tTotalMoves)
DestroyTask(taskId);
}
data[1]++;
tTimer++;
}
#undef tMoveCounter
#undef tTimer
#undef tDescending
#undef tTotalMoves
void BufferVarsForIVRater(void)
{
u8 i;
@@ -1953,13 +2028,13 @@ bool8 UsedPokemonCenterWarp(void)
MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_1F,
MAP_BATTLE_FRONTIER_POKEMON_CENTER_1F,
MAP_UNION_ROOM,
0xFFFF
MAP_UNDEFINED
};
int i;
u16 map = (gLastUsedWarp.mapGroup << 8) + gLastUsedWarp.mapNum;
for (i = 0; sPokemonCenters[i] != 0xFFFF; i++)
for (i = 0; sPokemonCenters[i] != MAP_UNDEFINED; i++)
{
if (sPokemonCenters[i] == map)
return TRUE;
@@ -2657,21 +2732,21 @@ static void ScrollableMultichoice_UpdateScrollArrows(u8 taskId)
.secondY = 0,
.fullyUpThreshold = 0,
.fullyDownThreshold = 0,
.tileTag = 2000,
.palTag = 100,
.tileTag = GFXTAG_MULTICHOICE_SCROLL_ARROWS,
.palTag = PALTAG_MULTICHOICE_SCROLL_ARROWS,
.palNum = 0
};
struct Task *task = &gTasks[taskId];
struct ScrollArrowsTemplate template = sScrollableMultichoice_ScrollArrowsTemplate;
if (task->tMaxItemsOnScreen != task->data[1])
if (task->tMaxItemsOnScreen != task->tNumItems)
{
template.firstX = (task->tWidth / 2) * 8 + 12 + (task->tLeft - 1) * 8;
template.firstY = 8;
template.secondX = (task->tWidth / 2) * 8 + 12 + (task->tLeft - 1) * 8;
template.secondY = task->tHeight * 8 + 10;
template.fullyUpThreshold = 0;
template.fullyDownThreshold = task->data[1] - task->tMaxItemsOnScreen;
template.fullyDownThreshold = task->tNumItems - task->tMaxItemsOnScreen;
task->tScrollArrowId = AddScrollIndicatorArrowPair(&template, &sScrollableMultichoice_ScrollOffset);
}
}
@@ -2679,10 +2754,8 @@ static void ScrollableMultichoice_UpdateScrollArrows(u8 taskId)
static void ScrollableMultichoice_RemoveScrollArrows(u8 taskId)
{
struct Task *task = &gTasks[taskId];
if (task->tMaxItemsOnScreen != task->data[1])
{
if (task->tMaxItemsOnScreen != task->tNumItems)
RemoveScrollIndicatorArrowPair(task->tScrollArrowId);
}
}
// Removed for Emerald (replaced by ShowScrollableMultichoice)
@@ -2906,8 +2979,6 @@ void CloseFrontierExchangeCornerItemIconWindow(void)
RemoveWindow(sFrontierExchangeCorner_ItemIconWindowId);
}
#define TAG_ITEM_ICON 5500
static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection)
{
#include "data/battle_frontier/battle_frontier_exchange_corner.h"
@@ -3188,12 +3259,14 @@ void ScrollableMultichoice_ClosePersistentMenu(void)
#undef tListTaskId
#undef tTaskId
#define DEOXYS_ROCK_LEVELS 11
void DoDeoxysRockInteraction(void)
{
CreateTask(Task_DeoxysRockInteraction, 8);
}
static const u16 sDeoxysRockPalettes[][16] = {
static const u16 sDeoxysRockPalettes[DEOXYS_ROCK_LEVELS][16] = {
INCBIN_U16("graphics/field_effects/palettes/deoxys_rock_1.gbapal"),
INCBIN_U16("graphics/field_effects/palettes/deoxys_rock_2.gbapal"),
INCBIN_U16("graphics/field_effects/palettes/deoxys_rock_3.gbapal"),
@@ -3207,7 +3280,7 @@ static const u16 sDeoxysRockPalettes[][16] = {
INCBIN_U16("graphics/field_effects/palettes/deoxys_rock_11.gbapal"),
};
static const u8 sDeoxysRockCoords[][2] = {
static const u8 sDeoxysRockCoords[DEOXYS_ROCK_LEVELS][2] = {
{ 15, 12 },
{ 11, 14 },
{ 15, 8 },
@@ -3223,11 +3296,11 @@ static const u8 sDeoxysRockCoords[][2] = {
static void Task_DeoxysRockInteraction(u8 taskId)
{
static const u8 sStoneMaxStepCounts[] = { 4, 8, 8, 8, 4, 4, 4, 6, 3, 3 };
static const u8 sStoneMaxStepCounts[DEOXYS_ROCK_LEVELS - 1] = { 4, 8, 8, 8, 4, 4, 4, 6, 3, 3 };
if (FlagGet(FLAG_DEOXYS_ROCK_COMPLETE) == TRUE)
{
gSpecialVar_Result = 3;
gSpecialVar_Result = DEOXYS_ROCK_COMPLETE;
ScriptContext_Enable();
DestroyTask(taskId);
}
@@ -3242,13 +3315,13 @@ static void Task_DeoxysRockInteraction(u8 taskId)
// Player failed to take the shortest path to the stone, so it resets.
ChangeDeoxysRockLevel(0);
VarSet(VAR_DEOXYS_ROCK_LEVEL, 0);
gSpecialVar_Result = 0;
gSpecialVar_Result = DEOXYS_ROCK_FAILED;
DestroyTask(taskId);
}
else if (rockLevel == 10)
else if (rockLevel == DEOXYS_ROCK_LEVELS - 1)
{
FlagSet(FLAG_DEOXYS_ROCK_COMPLETE);
gSpecialVar_Result = 2;
gSpecialVar_Result = DEOXYS_ROCK_SOLVED;
ScriptContext_Enable();
DestroyTask(taskId);
}
@@ -3257,7 +3330,7 @@ static void Task_DeoxysRockInteraction(u8 taskId)
rockLevel++;
ChangeDeoxysRockLevel(rockLevel);
VarSet(VAR_DEOXYS_ROCK_LEVEL, rockLevel);
gSpecialVar_Result = 1;
gSpecialVar_Result = DEOXYS_ROCK_PROGRESSED;
DestroyTask(taskId);
}
}
@@ -3270,9 +3343,9 @@ static void ChangeDeoxysRockLevel(u8 rockLevel)
TryGetObjectEventIdByLocalIdAndMap(LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
if (rockLevel == 0)
PlaySE(SE_M_CONFUSE_RAY);
PlaySE(SE_M_CONFUSE_RAY); // Failure sound
else
PlaySE(SE_RG_DEOXYS_MOVE);
PlaySE(SE_RG_DEOXYS_MOVE); // Success sound
CreateTask(WaitForDeoxysRockMovement, 8);
gFieldEffectArguments[0] = LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK;
@@ -3281,6 +3354,8 @@ static void ChangeDeoxysRockLevel(u8 rockLevel)
gFieldEffectArguments[3] = sDeoxysRockCoords[rockLevel][0];
gFieldEffectArguments[4] = sDeoxysRockCoords[rockLevel][1];
// Set number of movement steps.
// Resetting for failure is slow, successful movement is fast.
if (rockLevel == 0)
gFieldEffectArguments[5] = 60;
else
@@ -3798,8 +3873,9 @@ static void Task_CloseBattlePikeCurtain(u8 taskId)
void GetBattlePyramidHint(void)
{
gSpecialVar_Result = gSpecialVar_0x8004 / 7;
gSpecialVar_Result -= (gSpecialVar_Result / 20) * 20;
// gSpecialVar_0x8004 here is expected to be the current Battle Pyramid win streak.
gSpecialVar_Result = gSpecialVar_0x8004 / FRONTIER_STAGES_PER_CHALLENGE;
gSpecialVar_Result -= (gSpecialVar_Result / TOTAL_PYRAMID_ROUNDS) * TOTAL_PYRAMID_ROUNDS;
}
// Used to avoid a potential softlock if the player respawns on Dewford with no way off
@@ -3834,13 +3910,13 @@ bool8 InPokemonCenter(void)
MAP_TRADE_CENTER,
MAP_RECORD_CORNER,
MAP_BATTLE_COLOSSEUM_4P,
0xFFFF
MAP_UNDEFINED
};
int i;
u16 map = (gSaveBlock1Ptr->location.mapGroup << 8) + gSaveBlock1Ptr->location.mapNum;
for (i = 0; sPokemonCenters[i] != 0xFFFF; i++)
for (i = 0; sPokemonCenters[i] != MAP_UNDEFINED; i++)
{
if (sPokemonCenters[i] == map)
return TRUE;
+13 -2
View File
@@ -30,6 +30,17 @@
#include "constants/region_map_sections.h"
#include "constants/songs.h"
// gFrontierPassBg_Pal has 8*16 colors, but they attempt to load 13*16 colors.
// As a result it goes out of bounds and interprets 160 bytes of whatever comes
// after gFrontierPassBg_Pal (by default, gFrontierPassBg_Gfx) as a palette.
// Nothing uses these colors (except the Trainer Card, which correctly writes them)
// so in practice this bug has no effect on the game.
#ifdef BUGFIX
#define NUM_BG_PAL_SLOTS 8
#else
#define NUM_BG_PAL_SLOTS 13
#endif
// All windows displayed in the frontier pass.
enum
{
@@ -768,7 +779,7 @@ static bool32 InitFrontierPass(void)
CopyBgTilemapBufferToVram(2);
break;
case 8:
LoadPalette(gFrontierPassBg_Pal[0], 0, 13 * PLTT_SIZE_4BPP);
LoadPalette(gFrontierPassBg_Pal, 0, NUM_BG_PAL_SLOTS * PLTT_SIZE_4BPP);
LoadPalette(gFrontierPassBg_Pal[1 + sPassData->trainerStars], BG_PLTT_ID(1), PLTT_SIZE_4BPP);
LoadPalette(GetTextWindowPalette(0), BG_PLTT_ID(15), PLTT_SIZE_4BPP);
DrawFrontierPassBg();
@@ -1412,7 +1423,7 @@ static bool32 InitFrontierMap(void)
case 5:
if (FreeTempTileDataBuffersIfPossible())
return FALSE;
LoadPalette(gFrontierPassBg_Pal[0], BG_PLTT_ID(0), 13 * PLTT_SIZE_4BPP);
LoadPalette(gFrontierPassBg_Pal, BG_PLTT_ID(0), NUM_BG_PAL_SLOTS * PLTT_SIZE_4BPP);
LoadPalette(GetTextWindowPalette(0), BG_PLTT_ID(15), PLTT_SIZE_4BPP);
CopyToBgTilemapBuffer(2, sMapScreen_Tilemap, 0, 0);
CopyBgTilemapBufferToVram(2);
+1 -1
View File
@@ -2044,7 +2044,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 -7
View File
@@ -69,7 +69,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");
@@ -257,7 +257,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");
@@ -1427,10 +1427,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] =
@@ -1520,7 +1520,6 @@ const u16 gTitleScreenPressStartPal[] = INCBIN_U16("graphics/title_screen/p
const u32 gTitleScreenPressStartGfx[] = INCBIN_U32("graphics/title_screen/press_start.4bpp.lz");
const u32 gTitleScreenPokemonLogoTilemap[] = INCBIN_U32("graphics/title_screen/pokemon_logo.bin.lz");
// size in LoadPalette calls is reported as 0xD0 << 1, which is 0x1A0, but palette is only 0x100 bytes long so it loads garbage as well
const u16 gFrontierPassBg_Pal[][16] = INCBIN_U16("graphics/frontier_pass/bg.gbapal");
const u32 gFrontierPassBg_Gfx[] = INCBIN_U32("graphics/frontier_pass/bg.4bpp.lz");
const u32 gFrontierPassMapAndCard_Gfx[] = INCBIN_U32("graphics/frontier_pass/map_and_card.8bpp.lz");
+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);
-4
View File
@@ -15,18 +15,14 @@
#include "constants/items.h"
#include "constants/hold_effects.h"
// this file's functions
static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count);
static bool8 CheckPyramidBagHasSpace(u16 itemId, u16 count);
// EWRAM variables
EWRAM_DATA struct BagPocket gBagPockets[POCKETS_COUNT] = {0};
// rodata
#include "data/text/item_descriptions.h"
#include "data/items.h"
// code
static u16 GetBagItemQuantity(u16 *quantity)
{
return gSaveBlock2Ptr->encryptionKey ^ *quantity;
+30 -20
View File
@@ -28,6 +28,13 @@
#include "constants/rgb.h"
#include "constants/trade.h"
// Window IDs for the link error screens
enum {
WIN_LINK_ERROR_TOP,
WIN_LINK_ERROR_MID,
WIN_LINK_ERROR_BOTTOM,
};
struct BlockTransfer
{
u16 pos;
@@ -193,8 +200,9 @@ static const struct BgTemplate sLinkErrorBgTemplates[] = {
.priority = 1
}
};
static const struct WindowTemplate sLinkErrorWindowTemplates[] = {
{
[WIN_LINK_ERROR_TOP] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 0,
@@ -202,7 +210,8 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = {
.height = 5,
.paletteNum = 15,
.baseBlock = 0x002
}, {
},
[WIN_LINK_ERROR_MID] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 6,
@@ -210,7 +219,8 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = {
.height = 7,
.paletteNum = 15,
.baseBlock = 0x098
}, {
},
[WIN_LINK_ERROR_BOTTOM] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 13,
@@ -1641,26 +1651,26 @@ static void ErrorMsg_MoveCloserToPartner(void)
CopyToBgTilemapBuffer(1, sWirelessLinkDisplayTilemap, 0, 0);
CopyBgTilemapBufferToVram(1);
LoadPalette(sWirelessLinkDisplayPal, 0, 0x20);
FillWindowPixelBuffer(0, PIXEL_FILL(0));
FillWindowPixelBuffer(2, PIXEL_FILL(0));
AddTextPrinterParameterized3(0, FONT_SHORT_COPY_1, 2, 6, sTextColors, 0, gText_CommErrorEllipsis);
AddTextPrinterParameterized3(2, FONT_SHORT_COPY_1, 2, 1, sTextColors, 0, gText_MoveCloserToLinkPartner);
PutWindowTilemap(0);
PutWindowTilemap(2);
CopyWindowToVram(0, COPYWIN_NONE); // Does nothing
CopyWindowToVram(2, COPYWIN_FULL);
FillWindowPixelBuffer(WIN_LINK_ERROR_TOP, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_LINK_ERROR_BOTTOM, PIXEL_FILL(0));
AddTextPrinterParameterized3(WIN_LINK_ERROR_TOP, FONT_SHORT_COPY_1, 2, 6, sTextColors, 0, gText_CommErrorEllipsis);
AddTextPrinterParameterized3(WIN_LINK_ERROR_BOTTOM, FONT_SHORT_COPY_1, 2, 1, sTextColors, 0, gText_MoveCloserToLinkPartner);
PutWindowTilemap(WIN_LINK_ERROR_TOP);
PutWindowTilemap(WIN_LINK_ERROR_BOTTOM);
CopyWindowToVram(WIN_LINK_ERROR_TOP, COPYWIN_NONE); // Does nothing
CopyWindowToVram(WIN_LINK_ERROR_BOTTOM, COPYWIN_FULL);
}
static void ErrorMsg_CheckConnections(void)
{
LoadBgTiles(0, sCommErrorBg_Gfx, 0x20, 0);
FillWindowPixelBuffer(1, PIXEL_FILL(0));
FillWindowPixelBuffer(2, PIXEL_FILL(0));
AddTextPrinterParameterized3(1, FONT_SHORT_COPY_1, 2, 0, sTextColors, 0, gText_CommErrorCheckConnections);
PutWindowTilemap(1);
PutWindowTilemap(2);
CopyWindowToVram(1, COPYWIN_NONE); // Does nothing
CopyWindowToVram(2, COPYWIN_FULL);
FillWindowPixelBuffer(WIN_LINK_ERROR_MID, PIXEL_FILL(0));
FillWindowPixelBuffer(WIN_LINK_ERROR_BOTTOM, PIXEL_FILL(0));
AddTextPrinterParameterized3(WIN_LINK_ERROR_MID, FONT_SHORT_COPY_1, 2, 0, sTextColors, 0, gText_CommErrorCheckConnections);
PutWindowTilemap(WIN_LINK_ERROR_MID);
PutWindowTilemap(WIN_LINK_ERROR_BOTTOM);
CopyWindowToVram(WIN_LINK_ERROR_MID, COPYWIN_NONE); // Does nothing
CopyWindowToVram(WIN_LINK_ERROR_BOTTOM, COPYWIN_FULL);
}
static void CB2_PrintErrorMessage(void)
@@ -1691,9 +1701,9 @@ static void CB2_PrintErrorMessage(void)
break;
case 130:
if (gWirelessCommType == 2)
AddTextPrinterParameterized3(0, FONT_SHORT_COPY_1, 2, 20, sTextColors, 0, gText_ABtnTitleScreen);
AddTextPrinterParameterized3(WIN_LINK_ERROR_TOP, FONT_SHORT_COPY_1, 2, 20, sTextColors, 0, gText_ABtnTitleScreen);
else if (gWirelessCommType == 1)
AddTextPrinterParameterized3(0, FONT_SHORT_COPY_1, 2, 20, sTextColors, 0, gText_ABtnRegistrationCounter);
AddTextPrinterParameterized3(WIN_LINK_ERROR_TOP, FONT_SHORT_COPY_1, 2, 20, sTextColors, 0, gText_ABtnRegistrationCounter);
break;
}
if (gMain.state == 160)
+1 -1
View File
@@ -677,7 +677,7 @@ void InitHostRfuGameData(struct RfuGameData *data, u8 activity, bool32 startedAc
data->compatibility.hasNews = FALSE;
data->compatibility.hasCard = FALSE;
data->compatibility.unknown = FALSE;
data->compatibility.isChampion = FlagGet(FLAG_IS_CHAMPION);
data->compatibility.canLinkNationally = FlagGet(FLAG_IS_CHAMPION);
data->compatibility.hasNationalDex = IsNationalPokedexEnabled();
data->compatibility.gameClear = FlagGet(FLAG_SYS_GAME_CLEAR);
}
+4 -2
View File
@@ -503,7 +503,9 @@ static const u8 *const sFemalePresetNames[] = {
gText_DefaultNameHalie
};
// .text
// The number of male vs. female names is assumed to be the same.
// If they aren't, the smaller of the two sizes will be used and any extra names will be ignored.
#define NUM_PRESET_NAMES min(ARRAY_COUNT(sMalePresetNames), ARRAY_COUNT(sFemalePresetNames))
enum
{
@@ -1597,7 +1599,7 @@ static void Task_NewGameBirchSpeech_StartNamingScreen(u8 taskId)
{
FreeAllWindowBuffers();
FreeAndDestroyMonPicSprite(gTasks[taskId].tLotadSpriteId);
NewGameBirchSpeech_SetDefaultPlayerName(Random() % 20);
NewGameBirchSpeech_SetDefaultPlayerName(Random() % NUM_PRESET_NAMES);
DestroyTask(taskId);
DoNamingScreen(NAMING_SCREEN_PLAYER, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_NewGameBirchSpeech_ReturnFromNamingScreen);
}
+48 -47
View File
@@ -105,10 +105,9 @@ static const u8 sConditionToLineLength[MAX_CONDITION + 1] =
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35
};
static const struct WindowTemplate sMoveRelearnerWindowTemplates[] =
{
{
[RELEARNERWIN_DESC_BATTLE] = {
.bg = 1,
.tilemapLeft = 1,
.tilemapTop = 1,
@@ -117,7 +116,7 @@ static const struct WindowTemplate sMoveRelearnerWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 0xA
},
{
[RELEARNERWIN_DESC_CONTEST] = {
.bg = 1,
.tilemapLeft = 1,
.tilemapTop = 1,
@@ -126,7 +125,7 @@ static const struct WindowTemplate sMoveRelearnerWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 0xCA
},
{
[RELEARNERWIN_MOVE_LIST] = {
.bg = 1,
.tilemapLeft = 19,
.tilemapTop = 1,
@@ -135,7 +134,7 @@ static const struct WindowTemplate sMoveRelearnerWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 0x18A
},
{
[RELEARNERWIN_MSG] = {
.bg = 1,
.tilemapLeft = 4,
.tilemapTop = 15,
@@ -144,7 +143,8 @@ static const struct WindowTemplate sMoveRelearnerWindowTemplates[] =
.paletteNum = 15,
.baseBlock = 0x202
},
{
// Unused. Identical to sMoveRelearnerYesNoMenuTemplate
[RELEARNERWIN_YESNO] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 8,
@@ -175,7 +175,7 @@ static const struct ListMenuTemplate sMoveRelearnerMovesListTemplate =
.itemPrintFunc = NULL,
.totalItems = 0,
.maxShowed = 0,
.windowId = 2,
.windowId = RELEARNERWIN_MOVE_LIST,
.header_X = 0,
.item_X = 8,
.cursor_X = 0,
@@ -701,7 +701,7 @@ void ConditionGraph_CalcPositions(u8 *conditions, struct UCoords16 *positions)
// Move relearner
//----------------
void InitMoveRelearnerWindows(bool8 useContextWindow)
void InitMoveRelearnerWindows(bool8 useContestWindow)
{
u8 i;
@@ -713,20 +713,20 @@ void InitMoveRelearnerWindows(bool8 useContextWindow)
for (i = 0; i < ARRAY_COUNT(sMoveRelearnerWindowTemplates) - 1; i++)
FillWindowPixelBuffer(i, PIXEL_FILL(1));
if (!useContextWindow)
if (!useContestWindow)
{
PutWindowTilemap(0);
DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x1, 0xE);
PutWindowTilemap(RELEARNERWIN_DESC_BATTLE);
DrawStdFrameWithCustomTileAndPalette(RELEARNERWIN_DESC_BATTLE, FALSE, 0x1, 0xE);
}
else
{
PutWindowTilemap(1);
DrawStdFrameWithCustomTileAndPalette(1, FALSE, 1, 0xE);
PutWindowTilemap(RELEARNERWIN_DESC_CONTEST);
DrawStdFrameWithCustomTileAndPalette(RELEARNERWIN_DESC_CONTEST, FALSE, 1, 0xE);
}
PutWindowTilemap(2);
PutWindowTilemap(3);
DrawStdFrameWithCustomTileAndPalette(2, FALSE, 1, 0xE);
DrawStdFrameWithCustomTileAndPalette(3, FALSE, 1, 0xE);
PutWindowTilemap(RELEARNERWIN_MOVE_LIST);
PutWindowTilemap(RELEARNERWIN_MSG);
DrawStdFrameWithCustomTileAndPalette(RELEARNERWIN_MOVE_LIST, FALSE, 1, 0xE);
DrawStdFrameWithCustomTileAndPalette(RELEARNERWIN_MSG, FALSE, 1, 0xE);
MoveRelearnerDummy();
ScheduleBgCopyTilemapToVram(1);
}
@@ -757,33 +757,34 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
u8 buffer[32];
const u8 *str;
FillWindowPixelBuffer(0, PIXEL_FILL(1));
FillWindowPixelBuffer(RELEARNERWIN_DESC_BATTLE, PIXEL_FILL(1));
str = gText_MoveRelearnerBattleMoves;
x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 0x80);
AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL);
x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 128);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerPP;
AddTextPrinterParameterized(0, FONT_NORMAL, str, 4, 0x29, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 4, 41, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerPower;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x6A);
AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x19, TEXT_SKIP_DRAW, NULL);
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 106);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, x, 25, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerAccuracy;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x6A);
AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x29, TEXT_SKIP_DRAW, NULL);
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 106);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, x, 41, TEXT_SKIP_DRAW, NULL);
if (chosenMove == LIST_CANCEL)
{
CopyWindowToVram(0, COPYWIN_GFX);
// On "Cancel", skip printing move data
CopyWindowToVram(RELEARNERWIN_DESC_BATTLE, COPYWIN_GFX);
return;
}
move = &gBattleMoves[chosenMove];
str = gTypeNames[move->type];
AddTextPrinterParameterized(0, FONT_NORMAL, str, 4, 0x19, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 4, 25, TEXT_SKIP_DRAW, NULL);
x = 4 + GetStringWidth(FONT_NORMAL, gText_MoveRelearnerPP, 0);
ConvertIntToDecimalStringN(buffer, move->pp, STR_CONV_MODE_LEFT_ALIGN, 2);
AddTextPrinterParameterized(0, FONT_NORMAL, buffer, x, 0x29, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, buffer, x, 41, TEXT_SKIP_DRAW, NULL);
if (move->power < 2)
{
@@ -794,7 +795,7 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
ConvertIntToDecimalStringN(buffer, move->power, STR_CONV_MODE_LEFT_ALIGN, 3);
str = buffer;
}
AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x19, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 106, 25, TEXT_SKIP_DRAW, NULL);
if (move->accuracy == 0)
{
@@ -805,10 +806,10 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
ConvertIntToDecimalStringN(buffer, move->accuracy, STR_CONV_MODE_LEFT_ALIGN, 3);
str = buffer;
}
AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x29, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 106, 41, TEXT_SKIP_DRAW, NULL);
str = gMoveDescriptionPointers[chosenMove - 1];
AddTextPrinterParameterized(0, FONT_NARROW, str, 0, 0x41, 0, NULL);
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NARROW, str, 0, 65, 0, NULL);
}
static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove)
@@ -818,33 +819,33 @@ static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove)
const struct ContestMove *move;
MoveRelearnerShowHideHearts(chosenMove);
FillWindowPixelBuffer(1, PIXEL_FILL(1));
FillWindowPixelBuffer(RELEARNERWIN_DESC_CONTEST, PIXEL_FILL(1));
str = gText_MoveRelearnerContestMovesTitle;
x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 0x80);
AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL);
x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 128);
AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerAppeal;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x5C);
AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 0x19, TEXT_SKIP_DRAW, NULL);
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 92);
AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, x, 25, TEXT_SKIP_DRAW, NULL);
str = gText_MoveRelearnerJam;
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x5C);
AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 0x29, TEXT_SKIP_DRAW, NULL);
x = GetStringRightAlignXOffset(FONT_NORMAL, str, 92);
AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, x, 41, TEXT_SKIP_DRAW, NULL);
if (chosenMove == MENU_NOTHING_CHOSEN)
{
CopyWindowToVram(1, COPYWIN_GFX);
CopyWindowToVram(RELEARNERWIN_DESC_CONTEST, COPYWIN_GFX);
return;
}
move = &gContestMoves[chosenMove];
str = gContestMoveTypeTextPointers[move->contestCategory];
AddTextPrinterParameterized(1, FONT_NORMAL, str, 4, 0x19, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, 4, 25, TEXT_SKIP_DRAW, NULL);
str = gContestEffectDescriptionPointers[move->effect];
AddTextPrinterParameterized(1, FONT_NARROW, str, 0, 0x41, TEXT_SKIP_DRAW, NULL);
AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NARROW, str, 0, 65, TEXT_SKIP_DRAW, NULL);
CopyWindowToVram(1, COPYWIN_GFX);
CopyWindowToVram(RELEARNERWIN_DESC_CONTEST, COPYWIN_GFX);
}
static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list)
@@ -855,20 +856,20 @@ static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct List
MoveRelearnerMenuLoadContestMoveDescription(itemIndex);
}
void MoveRelearnerPrintText(u8 *str)
void MoveRelearnerPrintMessage(u8 *str)
{
u8 speed;
FillWindowPixelBuffer(3, PIXEL_FILL(1));
FillWindowPixelBuffer(RELEARNERWIN_MSG, PIXEL_FILL(1));
gTextFlags.canABSpeedUpPrint = TRUE;
speed = GetPlayerTextSpeedDelay();
AddTextPrinterParameterized2(3, FONT_NORMAL, str, speed, NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, 3);
AddTextPrinterParameterized2(RELEARNERWIN_MSG, FONT_NORMAL, str, speed, NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, 3);
}
bool16 MoveRelearnerRunTextPrinters(void)
{
RunTextPrinters();
return IsTextPrinterActive(3);
return IsTextPrinterActive(RELEARNERWIN_MSG);
}
void MoveRelearnerCreateYesNoMenu(void)
@@ -1071,7 +1072,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
@@ -142,7 +142,7 @@ static s32 mini_strlen(const char *s)
return len;
}
static s32 mini_itoa(u32 value, u32 radix, s32 uppercase, bool32 unsig, char *buffer)
static s32 mini_itoa(s32 value, u32 radix, s32 uppercase, bool32 unsig, char *buffer)
{
char *pbuffer = buffer;
s32 negative = 0;
+18 -42
View File
@@ -465,10 +465,10 @@ static void CB2_MoveRelearnerMain(void)
UpdatePaletteFade();
}
static void FormatAndPrintText(const u8 *src)
static void PrintMessageWithPlaceholders(const u8 *src)
{
StringExpandPlaceholders(gStringVar4, src);
MoveRelearnerPrintText(gStringVar4);
MoveRelearnerPrintMessage(gStringVar4);
}
// See the state machine doc at the top of the file.
@@ -522,7 +522,7 @@ static void DoMoveRelearnerMain(void)
{
if (GiveMoveToMon(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove()) != MON_HAS_MAX_MOVES)
{
FormatAndPrintText(gText_MoveRelearnerPkmnLearnedMove);
PrintMessageWithPlaceholders(gText_MoveRelearnerPkmnLearnedMove);
gSpecialVar_0x8004 = TRUE;
sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEXT_THEN_FANFARE;
}
@@ -574,7 +574,7 @@ static void DoMoveRelearnerMain(void)
}
break;
case MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT:
FormatAndPrintText(gText_MoveRelearnerPkmnTryingToLearnMove);
PrintMessageWithPlaceholders(gText_MoveRelearnerPkmnTryingToLearnMove);
sMoveRelearnerStruct->state++;
break;
case MENU_STATE_WAIT_FOR_TRYING_TO_LEARN:
@@ -590,7 +590,7 @@ static void DoMoveRelearnerMain(void)
if (selection == 0)
{
FormatAndPrintText(gText_MoveRelearnerWhichMoveToForget);
PrintMessageWithPlaceholders(gText_MoveRelearnerWhichMoveToForget);
sMoveRelearnerStruct->state = MENU_STATE_PRINT_WHICH_MOVE_PROMPT;
}
else if (selection == MENU_B_PRESSED || selection == 1)
@@ -601,7 +601,7 @@ static void DoMoveRelearnerMain(void)
break;
case MENU_STATE_PRINT_STOP_TEACHING:
StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]);
FormatAndPrintText(gText_MoveRelearnerStopTryingToTeachMove);
PrintMessageWithPlaceholders(gText_MoveRelearnerStopTryingToTeachMove);
sMoveRelearnerStruct->state++;
break;
case MENU_STATE_WAIT_FOR_STOP_TEACHING:
@@ -637,7 +637,7 @@ static void DoMoveRelearnerMain(void)
case MENU_STATE_CHOOSE_SETUP_STATE:
if (!MoveRelearnerRunTextPrinters())
{
FillWindowPixelBuffer(3, 0x11);
FillWindowPixelBuffer(RELEARNERWIN_MSG, 0x11);
if (sMoveRelearnerMenuSate.showContestInfo == FALSE)
{
sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE;
@@ -694,7 +694,7 @@ static void DoMoveRelearnerMain(void)
ShowTeachMoveText(TRUE);
}
RemoveScrollArrows();
CopyWindowToVram(3, COPYWIN_GFX);
CopyWindowToVram(RELEARNERWIN_MSG, COPYWIN_GFX);
break;
case MENU_STATE_TRY_OVERWRITE_MOVE:
if (!gPaletteFade.active)
@@ -711,7 +711,7 @@ static void DoMoveRelearnerMain(void)
RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot);
SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot);
StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]);
FormatAndPrintText(gText_MoveRelearnerAndPoof);
PrintMessageWithPlaceholders(gText_MoveRelearnerAndPoof);
sMoveRelearnerStruct->state = MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE;
gSpecialVar_0x8004 = TRUE;
}
@@ -720,7 +720,7 @@ static void DoMoveRelearnerMain(void)
case MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE:
if (!MoveRelearnerRunTextPrinters())
{
FormatAndPrintText(gText_MoveRelearnerPkmnForgotMoveAndLearnedNew);
PrintMessageWithPlaceholders(gText_MoveRelearnerPkmnForgotMoveAndLearnedNew);
sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEXT_THEN_FANFARE;
PlayFanfare(MUS_LEVEL_UP);
}
@@ -765,15 +765,13 @@ static void HideHeartSpritesAndShowTeachMoveText(bool8 onlyHideSprites)
s32 i;
for (i = 0; i < 16; i++)
{
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE;
}
if (!onlyHideSprites)
{
StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn);
FillWindowPixelBuffer(3, 0x11);
AddTextPrinterParameterized(3, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL);
FillWindowPixelBuffer(RELEARNERWIN_MSG, 0x11);
AddTextPrinterParameterized(RELEARNERWIN_MSG, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL);
}
}
@@ -786,21 +784,19 @@ static void HandleInput(bool8 showContest)
{
case LIST_NOTHING_CHOSEN:
if (!(JOY_NEW(DPAD_LEFT | DPAD_RIGHT)) && !GetLRKeysPressed())
{
break;
}
PlaySE(SE_SELECT);
if (showContest == FALSE)
{
PutWindowTilemap(1);
PutWindowTilemap(RELEARNERWIN_DESC_CONTEST);
sMoveRelearnerStruct->state = MENU_STATE_SETUP_CONTEST_MODE;
sMoveRelearnerMenuSate.showContestInfo = TRUE;
}
else
{
PutWindowTilemap(0);
PutWindowTilemap(RELEARNERWIN_DESC_BATTLE);
sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE;
sMoveRelearnerMenuSate.showContestInfo = FALSE;
}
@@ -813,7 +809,7 @@ static void HandleInput(bool8 showContest)
RemoveScrollArrows();
sMoveRelearnerStruct->state = MENU_STATE_PRINT_GIVE_UP_PROMPT;
StringExpandPlaceholders(gStringVar4, gText_MoveRelearnerGiveUp);
MoveRelearnerPrintText(gStringVar4);
MoveRelearnerPrintMessage(gStringVar4);
break;
default:
PlaySE(SE_SELECT);
@@ -821,7 +817,7 @@ static void HandleInput(bool8 showContest)
sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEACH_MOVE_PROMPT;
StringCopy(gStringVar2, gMoveNames[itemId]);
StringExpandPlaceholders(gStringVar4, gText_MoveRelearnerTeachMoveConfirm);
MoveRelearnerPrintText(gStringVar4);
MoveRelearnerPrintMessage(gStringVar4);
break;
}
}
@@ -842,8 +838,8 @@ static void ShowTeachMoveText(bool8 shouldDoNothingInstead)
if (shouldDoNothingInstead == FALSE)
{
StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn);
FillWindowPixelBuffer(3, 0x11);
AddTextPrinterParameterized(3, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL);
FillWindowPixelBuffer(RELEARNERWIN_MSG, 0x11);
AddTextPrinterParameterized(RELEARNERWIN_MSG, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL);
}
}
@@ -857,9 +853,7 @@ static void CreateUISprites(void)
// These are the appeal hearts.
for (i = 0; i < 8; i++)
{
sMoveRelearnerStruct->heartSpriteIds[i] = CreateSprite(&sConstestMoveHeartSprite, (i - (i / 4) * 4) * 8 + 104, (i / 4) * 8 + 36, 0);
}
// These are the jam harts.
// The animation is used to toggle between full/empty heart sprites.
@@ -870,17 +864,13 @@ static void CreateUISprites(void)
}
for (i = 0; i < 16; i++)
{
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE;
}
}
static void AddScrollArrows(void)
{
if (sMoveRelearnerStruct->moveDisplayArrowTask == TASK_NONE)
{
sMoveRelearnerStruct->moveDisplayArrowTask = AddScrollIndicatorArrowPair(&sDisplayModeArrowsTemplate, &sMoveRelearnerStruct->scrollOffset);
}
if (sMoveRelearnerStruct->moveListScrollArrowTask == TASK_NONE)
{
@@ -934,49 +924,35 @@ void MoveRelearnerShowHideHearts(s32 moveId)
if (!sMoveRelearnerMenuSate.showContestInfo || moveId == LIST_CANCEL)
{
for (i = 0; i < 16; i++)
{
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE;
}
}
else
{
numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].appeal / 10);
if (numHearts == 0xFF)
{
numHearts = 0;
}
for (i = 0; i < 8; i++)
{
if (i < numHearts)
{
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i]], 1);
}
else
{
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i]], 0);
}
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = FALSE;
}
numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].jam / 10);
if (numHearts == 0xFF)
{
numHearts = 0;
}
for (i = 0; i < 8; i++)
{
if (i < numHearts)
{
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]], 3);
}
else
{
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]], 2);
}
gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]].invisible = FALSE;
}
}
+29 -24
View File
@@ -20,6 +20,11 @@
#include "decompress.h"
#include "constants/rgb.h"
enum {
WIN_MSG,
WIN_LOADING,
};
static void CB2_MysteryEventMenu(void);
static void PrintMysteryMenuText(u8 windowId, const u8 *text, u8 x, u8 y, s32 speed);
@@ -40,7 +45,7 @@ static const struct BgTemplate sBgTemplates[] =
static const struct WindowTemplate sWindowTemplates[] =
{
{
[WIN_MSG] = {
.bg = 0,
.tilemapLeft = 4,
.tilemapTop = 15,
@@ -49,7 +54,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.paletteNum = 14,
.baseBlock = 20
},
{
[WIN_LOADING] = {
.bg = 0,
.tilemapLeft = 7,
.tilemapTop = 6,
@@ -87,7 +92,7 @@ void CB2_InitMysteryEventMenu(void)
s32 i;
DeactivateAllTextPrinters();
for (i = 0; i < 2; i++)
for (i = 0; i < (int)ARRAY_COUNT(sWindowTemplates) - 1; i++)
FillWindowPixelBuffer(i, PIXEL_FILL(0));
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT);
@@ -131,9 +136,9 @@ static void CB2_MysteryEventMenu(void)
switch (gMain.state)
{
case 0:
DrawStdFrameWithCustomTileAndPalette(0, TRUE, 1, 0xD);
PutWindowTilemap(0);
CopyWindowToVram(0, COPYWIN_FULL);
DrawStdFrameWithCustomTileAndPalette(WIN_MSG, TRUE, 1, 0xD);
PutWindowTilemap(WIN_MSG);
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
ShowBg(0);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
gMain.state++;
@@ -141,12 +146,12 @@ static void CB2_MysteryEventMenu(void)
case 1:
if (!gPaletteFade.active)
{
PrintMysteryMenuText(0, gText_LinkStandby2, 1, 2, 1);
PrintMysteryMenuText(WIN_MSG, gText_LinkStandby2, 1, 2, 1);
gMain.state++;
}
break;
case 2:
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(WIN_MSG))
{
gMain.state++;
gLinkType = LINKTYPE_MYSTERY_EVENT;
@@ -154,10 +159,10 @@ static void CB2_MysteryEventMenu(void)
}
break;
case 3:
if ((gLinkStatus & 0x20) && (gLinkStatus & 0x1C) > 4)
if ((gLinkStatus & LINK_STAT_MASTER) && (gLinkStatus & LINK_STAT_PLAYER_COUNT) > 4)
{
PlaySE(SE_PIN);
PrintMysteryMenuText(0, gText_PressAToLoadEvent, 1, 2, 1);
PrintMysteryMenuText(WIN_MSG, gText_PressAToLoadEvent, 1, 2, 1);
gMain.state++;
}
if (JOY_NEW(B_BUTTON))
@@ -168,7 +173,7 @@ static void CB2_MysteryEventMenu(void)
}
break;
case 4:
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(WIN_MSG))
gMain.state++;
break;
case 5:
@@ -178,10 +183,10 @@ static void CB2_MysteryEventMenu(void)
{
PlaySE(SE_SELECT);
CheckShouldAdvanceLinkState();
DrawStdFrameWithCustomTileAndPalette(1, TRUE, 1, 0xD);
PrintMysteryMenuText(1, gText_LoadingEvent, 1, 2, 0);
PutWindowTilemap(1);
CopyWindowToVram(1, COPYWIN_FULL);
DrawStdFrameWithCustomTileAndPalette(WIN_LOADING, TRUE, 1, 0xD);
PrintMysteryMenuText(WIN_LOADING, gText_LoadingEvent, 1, 2, 0);
PutWindowTilemap(WIN_LOADING);
CopyWindowToVram(WIN_LOADING, COPYWIN_FULL);
gMain.state++;
}
else if (JOY_NEW(B_BUTTON))
@@ -194,7 +199,7 @@ static void CB2_MysteryEventMenu(void)
else
{
GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR);
PrintMysteryMenuText(0, gStringVar4, 1, 2, 1);
PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1);
gMain.state = 13;
}
break;
@@ -207,19 +212,19 @@ static void CB2_MysteryEventMenu(void)
{
SetCloseLinkCallback();
GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR);
PrintMysteryMenuText(0, gStringVar4, 1, 2, 1);
PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1);
gMain.state = 13;
}
else if (CheckLanguageMatch())
{
PrintMysteryMenuText(0, gText_DontRemoveCableTurnOff, 1, 2, 1);
PrintMysteryMenuText(WIN_MSG, gText_DontRemoveCableTurnOff, 1, 2, 1);
gMain.state++;
}
else
{
CloseLink();
GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR);
PrintMysteryMenuText(0, gStringVar4, 1, 2, 1);
PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1);
gMain.state = 13;
}
}
@@ -232,7 +237,7 @@ static void CB2_MysteryEventMenu(void)
}
break;
case 7:
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(WIN_MSG))
gMain.state++;
break;
case 8:
@@ -260,11 +265,11 @@ static void CB2_MysteryEventMenu(void)
}
break;
case 12:
PrintMysteryMenuText(0, gStringVar4, 1, 2, 1);
PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1);
gMain.state++;
break;
case 13:
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(WIN_MSG))
{
gMain.state++;
sUnused = 0;
@@ -287,11 +292,11 @@ static void CB2_MysteryEventMenu(void)
break;
}
if (gLinkStatus & 0x40 && !IsLinkMaster())
if (gLinkStatus & LINK_STAT_CONN_ESTABLISHED && !IsLinkMaster())
{
CloseLink();
GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR);
PrintMysteryMenuText(0, gStringVar4, 1, 2, 1);
PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1);
gMain.state = 13;
}
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff. Show more