party_menu data

This commit is contained in:
jiangzhengwenjz
2019-11-21 10:48:08 +08:00
committed by Evan
parent 622fcd2cb9
commit d89a2d791e
34 changed files with 4902 additions and 977 deletions
+1 -1
View File
@@ -364,7 +364,7 @@ static void WaitForMonSelection(void)
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{
if (gPartyMenuUseExitCallback == 1)
BtlController_EmitChosenMonReturnValue(1, gUnknown_203B0C1, gBattlePartyCurrentOrder);
BtlController_EmitChosenMonReturnValue(1, gSelectedMonPartyId, gBattlePartyCurrentOrder);
else
BtlController_EmitChosenMonReturnValue(1, 6, NULL);
OakOldManBufferExecCompleted();
+1 -1
View File
@@ -1314,7 +1314,7 @@ static void WaitForMonSelection(void)
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{
if (gPartyMenuUseExitCallback == 1)
BtlController_EmitChosenMonReturnValue(1, gUnknown_203B0C1, gBattlePartyCurrentOrder);
BtlController_EmitChosenMonReturnValue(1, gSelectedMonPartyId, gBattlePartyCurrentOrder);
else
BtlController_EmitChosenMonReturnValue(1, 6, NULL);
if ((gBattleBufferA[gActiveBattler][1] & 0xF) == 1)
+1 -1
View File
@@ -715,7 +715,7 @@ static void WaitForMonSelection(void)
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{
if (gPartyMenuUseExitCallback == 1)
BtlController_EmitChosenMonReturnValue(1, gUnknown_203B0C1, gBattlePartyCurrentOrder);
BtlController_EmitChosenMonReturnValue(1, gSelectedMonPartyId, gBattlePartyCurrentOrder);
else
BtlController_EmitChosenMonReturnValue(1, 6, NULL);
PokedudeBufferExecCompleted();
+5 -5
View File
@@ -3137,7 +3137,7 @@ static void HandleTurnActionSelectionState(void)
*(gBattleStruct->field_58 + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
if (gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION) || gStatuses3[gActiveBattler] & STATUS3_ROOTED)
{
BtlController_EmitChoosePokemon(0, PARTY_CANT_SWITCH, 6, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CANT_SWITCH, 6, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
}
else if ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_SHADOW_TAG))
|| ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_ARENA_TRAP))
@@ -3146,16 +3146,16 @@ static void HandleTurnActionSelectionState(void)
|| ((i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0))
&& IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_STEEL)))
{
BtlController_EmitChoosePokemon(0, ((i - 1) << 4) | PARTY_ABILITY_PREVENTS, 6, gLastUsedAbility, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, 6, gLastUsedAbility, gBattleStruct->field_60[gActiveBattler]);
}
else
{
if (gActiveBattler == 2 && gChosenActionByBattler[0] == B_ACTION_SWITCH)
BtlController_EmitChoosePokemon(0, PARTY_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
else if (gActiveBattler == 3 && gChosenActionByBattler[1] == B_ACTION_SWITCH)
BtlController_EmitChoosePokemon(0, PARTY_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
else
BtlController_EmitChoosePokemon(0, PARTY_CHOOSE_MON, 6, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, 6, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
}
MarkBattlerForControllerExec(gActiveBattler);
break;
+3 -3
View File
@@ -4504,7 +4504,7 @@ static void atk4F_jumpifcantswitch(void)
static void sub_8024398(u8 arg0)
{
*(gBattleStruct->field_58 + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
BtlController_EmitChoosePokemon(0, PARTY_MUST_CHOOSE_MON, arg0, 0, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_SEND_OUT, arg0, 0, gBattleStruct->field_60[gActiveBattler]);
MarkBattlerForControllerExec(gActiveBattler);
}
@@ -4739,9 +4739,9 @@ static void atk50_openpartyscreen(void)
else
{
if (gBattlescriptCurrInstr[1] & OPEN_PARTY_ALLOW_CANCEL)
hitmarkerFaintBits = PARTY_CHOOSE_MON; // Used here as the caseId for the EmitChoose function.
hitmarkerFaintBits = PARTY_ACTION_CHOOSE_MON; // Used here as the caseId for the EmitChoose function.
else
hitmarkerFaintBits = PARTY_MUST_CHOOSE_MON;
hitmarkerFaintBits = PARTY_ACTION_SEND_OUT;
battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(OPEN_PARTY_ALLOW_CANCEL));
if (gSpecialStatuses[battlerId].flag40)
{
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -15,7 +15,7 @@ static void sub_80E5934(u8 taskId);
extern const u8 gUnknown_84169F8[];
extern const u8 gText_PkmnHPRestoredByVar2[];
bool8 hm_prepare_dive_probably(void)
bool8 SetUpFieldMove_SoftBoiled(void)
{
u16 maxHp = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_MAX_HP);
u16 curHp = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_HP);
@@ -28,8 +28,8 @@ bool8 hm_prepare_dive_probably(void)
void ChooseMonForSoftboiled(u8 taskId)
{
gPartyMenu.unkB = 10;
gPartyMenu.unkA = gPartyMenu.unk9;
gPartyMenu.action = 10;
gPartyMenu.slotId2 = gPartyMenu.slotId;
AnimatePartySlot(GetCursorSelectionMonId(), 1);
DisplayPartyMenuStdMessage(5);
gTasks[taskId].func = Task_HandleChooseMonInput;
@@ -37,14 +37,14 @@ void ChooseMonForSoftboiled(u8 taskId)
void sub_80E5724(u8 taskId)
{
u8 r8 = gPartyMenu.unk9;
u8 r5 = gPartyMenu.unkA;
u8 r8 = gPartyMenu.slotId;
u8 r5 = gPartyMenu.slotId2;
u16 curHp;
s16 delta;
if (r5 > 6)
{
gPartyMenu.unkB = 0;
gPartyMenu.action = 0;
DisplayPartyMenuStdMessage(0);
gTasks[taskId].func = Task_HandleChooseMonInput;
}
@@ -66,12 +66,12 @@ void sub_80E5724(u8 taskId)
static void sub_80E57E8(u8 taskId)
{
PlaySE(SE_KAIFUKU);
PartyMenuModifyHP(taskId, gPartyMenu.unkA, 1, GetMonData(&gPlayerParty[gPartyMenu.unk9], MON_DATA_MAX_HP) / 5, sub_80E583C);
PartyMenuModifyHP(taskId, gPartyMenu.slotId2, 1, GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MAX_HP) / 5, sub_80E583C);
}
static void sub_80E583C(u8 taskId)
{
GetMonNickname(&gPlayerParty[gPartyMenu.unkA], gStringVar1);
GetMonNickname(&gPlayerParty[gPartyMenu.slotId2], gStringVar1);
StringExpandPlaceholders(gStringVar4, gText_PkmnHPRestoredByVar2);
DisplayPartyMenuMessage(gStringVar4, 0);
ScheduleBgCopyTilemapToVram(2);
@@ -82,10 +82,10 @@ static void sub_80E58A0(u8 taskId)
{
if (IsPartyMenuTextPrinterActive() != TRUE)
{
gPartyMenu.unkB = 0;
AnimatePartySlot(gPartyMenu.unk9, 0);
gPartyMenu.unk9 = gPartyMenu.unkA;
AnimatePartySlot(gPartyMenu.unkA, 1);
gPartyMenu.action = 0;
AnimatePartySlot(gPartyMenu.slotId, 0);
gPartyMenu.slotId = gPartyMenu.slotId2;
AnimatePartySlot(gPartyMenu.slotId2, 1);
ClearStdWindowAndFrameToTransparent(6, 0);
ClearWindowTilemap(6);
DisplayPartyMenuStdMessage(0);
+1 -1
View File
@@ -20,7 +20,7 @@ static void FailSweetScentEncounter(u8 taskId);
static void Unused_StartSweetscentFldeff(void)
{
gPartyMenu.unk9 = 0;
gPartyMenu.slotId = 0;
FieldCallback_SweetScent();
}
+1 -1
View File
@@ -1030,7 +1030,7 @@ static void Task_ItemPcGive(u8 taskId)
static void ItemPc_CB2_SwitchToPartyMenu(void)
{
InitPartyMenu(0, 0, 6, 0, 6, Task_HandleChooseMonInput, ItemPc_CB2_ReturnFromPartyMenu);
gPartyMenu.unkC = ItemPc_GetItemIdBySlotId(ItemPc_GetCursorPosition());
gPartyMenu.bagItem = ItemPc_GetItemIdBySlotId(ItemPc_GetCursorPosition());
}
static void ItemPc_CB2_ReturnFromPartyMenu(void)
+172
View File
@@ -0,0 +1,172 @@
#include "global.h"
#include "malloc.h"
#include "battle.h"
#include "battle_anim.h"
#include "battle_controllers.h"
#include "battle_gfx_sfx_util.h"
#include "battle_interface.h"
#include "bg.h"
#include "data.h"
#include "decompress.h"
#include "easy_chat.h"
#include "event_data.h"
#include "evolution_scene.h"
#include "field_control_avatar.h"
#include "field_effect.h"
#include "field_player_avatar.h"
#include "field_screen_effect.h"
#include "field_specials.h"
#include "field_weather.h"
#include "fieldmap.h"
#include "fldeff.h"
#include "gpu_regs.h"
#include "graphics.h"
#include "item.h"
#include "item_menu.h"
#include "item_use.h"
#include "link.h"
#include "link_rfu.h"
#include "mail.h"
#include "main.h"
#include "menu.h"
#include "menu_helpers.h"
#include "new_menu_helpers.h"
#include "metatile_behavior.h"
#include "overworld.h"
#include "palette.h"
#include "party_menu.h"
#include "player_pc.h"
#include "pokemon.h"
#include "pokemon_icon.h"
#include "pokemon_jump.h"
#include "pokemon_storage_system.h"
#include "pokemon_summary_screen.h"
#include "region_map.h"
#include "reshow_battle_screen.h"
#include "scanline_effect.h"
#include "script.h"
#include "sound.h"
#include "sprite.h"
#include "start_menu.h"
#include "string_util.h"
#include "strings.h"
#include "task.h"
#include "text.h"
#include "text_window.h"
#include "trade.h"
#include "union_room.h"
#include "window.h"
#include "constants/battle.h"
#include "constants/easy_chat.h"
#include "constants/field_effects.h"
#include "constants/flags.h"
#include "constants/item_effects.h"
#include "constants/items.h"
#include "constants/maps.h"
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/species.h"
#include "constants/vars.h"
#define PARTY_PAL_SELECTED (1 << 0)
#define PARTY_PAL_FAINTED (1 << 1)
#define PARTY_PAL_TO_SWITCH (1 << 2)
#define PARTY_PAL_MULTI_ALT (1 << 3)
#define PARTY_PAL_SWITCHING (1 << 4)
#define PARTY_PAL_TO_SOFTBOIL (1 << 5)
#define PARTY_PAL_NO_MON (1 << 6)
#define PARTY_PAL_UNUSED (1 << 7)
#define MENU_DIR_DOWN 1
#define MENU_DIR_UP -1
#define MENU_DIR_RIGHT 2
#define MENU_DIR_LEFT -2
enum
{
CAN_LEARN_MOVE,
CANNOT_LEARN_MOVE,
ALREADY_KNOWS_MOVE,
CANNOT_LEARN_MOVE_IS_EGG
};
struct PartyMenuBoxInfoRects
{
void (*blitFunc)(u8 windowId, u8 x, u8 y, u8 width, u8 height, bool8 isEgg);
u8 dimensions[24];
u8 descTextLeft;
u8 descTextTop;
u8 descTextWidth;
u8 descTextHeight;
};
struct PartyMenuInternal
{
TaskFunc task;
MainCallback exitCallback;
u32 chooseHalf:1;
u32 lastSelectedSlot:3; // Used to return to same slot when going left/right bewtween columns
u32 spriteIdConfirmPokeball:7;
u32 spriteIdCancelPokeball:7;
u32 messageId:14;
u8 windowId[3];
u8 actions[8];
u8 numActions;
u16 palBuffer[BG_PLTT_SIZE / sizeof(u16)];
s16 data[16];
};
struct PartyMenuBox
{
const struct PartyMenuBoxInfoRects *infoRects;
const u8 *spriteCoords;
u8 windowId;
u8 monSpriteId;
u8 itemSpriteId;
u8 pokeballSpriteId;
u8 statusSpriteId;
};
void BlitBitmapToPartyWindow_LeftColumn(u8 windowId, u8 x, u8 y, u8 width, u8 height, bool8 isEgg);
void BlitBitmapToPartyWindow_RightColumn(u8 windowId, u8 x, u8 y, u8 width, u8 height, bool8 isEgg);
void CursorCB_Summary(u8 taskId);
void CursorCB_Switch(u8 taskId);
void CursorCB_Cancel1(u8 taskId);
void CursorCB_Item(u8 taskId);
void CursorCB_Give(u8 taskId);
void CursorCB_TakeItem(u8 taskId);
void CursorCB_Mail(u8 taskId);
void CursorCB_Read(u8 taskId);
void CursorCB_TakeMail(u8 taskId);
void CursorCB_Cancel2(u8 taskId);
void CursorCB_SendMon(u8 taskId);
void CursorCB_Enter(u8 taskId);
void CursorCB_NoEntry(u8 taskId);
void CursorCB_Store(u8 taskId);
void CursorCB_Register(u8 taskId);
void CursorCB_Trade1(u8 taskId);
void CursorCB_Trade2(u8 taskId);
void CursorCB_FieldMove(u8 taskId);
bool8 SetUpFieldMove_Fly(void);
bool8 SetUpFieldMove_Waterfall(void);
bool8 SetUpFieldMove_Surf(void);
EWRAM_DATA struct PartyMenuInternal *sPartyMenuInternal = NULL;
EWRAM_DATA struct PartyMenu gPartyMenu = {0};
EWRAM_DATA struct PartyMenuBox *sPartyMenuBoxes = NULL;
EWRAM_DATA u8 *sPartyBgGfxTilemap = NULL;
EWRAM_DATA u8 *sPartyBgTilemapBuffer = NULL;
EWRAM_DATA bool8 gPartyMenuUseExitCallback = FALSE;
EWRAM_DATA u8 gSelectedMonPartyId = 0;
EWRAM_DATA MainCallback gPostMenuFieldCallback = NULL;
EWRAM_DATA u16 *sSlot1TilemapBuffer = NULL; // for switching party slots
EWRAM_DATA u16 *sSlot2TilemapBuffer = NULL;
EWRAM_DATA struct Pokemon *gUnknown_203B0D0 = NULL;
EWRAM_DATA u8 gSelectedOrderFromParty[4] = {0};
EWRAM_DATA u16 sPartyMenuItemId = ITEM_NONE;
ALIGNED(4) EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on
void (*gItemUseCB)(u8, TaskFunc);
#include "data/pokemon/tutor_learnsets.h"
#include "data/party_menu.h"
+3 -3
View File
@@ -459,9 +459,9 @@ static const u8 *const sTradeErrorOrStatusMessagePtrs[] = {
gUnknown_8417094, // That's your only POKéMON for battle
gUnknown_841E199, // Waiting for your friend to finish
gUnknown_841E1C5, // Your friend wants to trade POKéMON
gUnknown_84170BC, // That POKéMON can't be traded now
gUnknown_84170E0, // An EGG can't be traded now
gUnknown_84170FC // The other TRAINER's POKéMON can't be traded now
gText_PkmnCantBeTradedNow, // That POKéMON can't be traded now
gText_EggCantBeTradedNow, // An EGG can't be traded now
gText_OtherTrainersPkmnCantBeTraded // The other TRAINER's POKéMON can't be traded now
};
static const u8 gUnknown_8261F18[] = { 0, 1, 2 };