Merge pull request #547 from cbt6/field-moves

Document field moves
This commit is contained in:
GriffinR
2022-09-04 10:52:05 -04:00
committed by GitHub
7 changed files with 48 additions and 49 deletions
+2 -2
View File
@@ -192,8 +192,8 @@ extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
extern const struct SpritePalette gSpritePalette_GeneralFieldEffect1;
extern const struct SpriteTemplate * const gFieldEffectObjectTemplatePointers[];
extern const struct OamData gObjectEventBaseOam_32x32;
extern const u16 gUnknown_8398648[];
extern const u16 gUnknown_8398688[];
extern const u16 gFieldEffectObjectPic_CutGrass[];
extern const u16 gFieldEffectPal_CutGrass[];
extern const u8 gReflectionEffectPaletteMap[];
u8 GetLedgeJumpDirection(s16 x, s16 y, u8 z);
u8 sub_8063FDC(u32 direction);
@@ -191,9 +191,9 @@ const u16 gFieldEffectObjectPic_ShadowMedium[] = INCBIN_U16("graphics/field_effe
const u16 gFieldEffectObjectPic_ShadowLarge[] = INCBIN_U16("graphics/field_effects/pics/shadow_large.4bpp");
const u16 gFieldEffectObjectPic_ShadowExtraLarge[] = INCBIN_U16("graphics/field_effects/pics/shadow_extra_large.4bpp");
const u16 filler_8398188[0x90] = {};
const u16 gUnknown_8398648[] = INCBIN_U16("graphics/field_effects/fldeff_cut.4bpp");
const u16 gUnknown_8398668[] = INCBIN_U16("graphics/field_effects/fldeff_cut.4bpp");
const u16 gUnknown_8398688[] = INCBIN_U16("graphics/field_effects/fldeff_cut.gbapal");
const u16 gFieldEffectObjectPic_CutGrass[] = INCBIN_U16("graphics/field_effects/fldeff_cut.4bpp");
UNUSED const u16 gFieldEffectObjectPic_CutGrass2[] = INCBIN_U16("graphics/field_effects/fldeff_cut.4bpp");
const u16 gFieldEffectPal_CutGrass[] = INCBIN_U16("graphics/field_effects/fldeff_cut.gbapal");
const u16 gFieldEffectObjectPic_Ripple[] = INCBIN_U16("graphics/field_effects/pics/ripple.4bpp");
const u16 gFieldEffectObjectPic_Ash[] = INCBIN_U16("graphics/field_effects/pics/ash.4bpp");
const u16 gFieldEffectObjectPic_Arrow[] = INCBIN_U16("graphics/field_effects/pics/arrow.4bpp");
+2 -2
View File
@@ -93,11 +93,11 @@ static const union AnimCmd *const sSpriteAnimTable_FldEff_CutGrass[] = {
};
static const struct SpriteFrameImage sSpriteFrameImages_FldEff_CutGrass[] = {
{gUnknown_8398648, 0x20}
{gFieldEffectObjectPic_CutGrass, 0x20}
};
const struct SpritePalette gFldEffPalette_CutGrass[] = {
gUnknown_8398688, 4096
gFieldEffectPal_CutGrass, 4096
};
static const struct SpriteTemplate sSpriteTemplate_FldEff_CutGrass = {
+3 -3
View File
@@ -7,7 +7,7 @@
#include "party_menu.h"
static void FieldCallback_Dig(void);
static void sub_80C9AFC(void);
static void StartDigFieldEffect(void);
bool8 SetUpFieldMove_Dig(void)
{
@@ -31,12 +31,12 @@ bool8 FldEff_UseDig(void)
{
u8 taskId = CreateFieldEffectShowMon();
FLDEFF_SET_FUNC_TO_DATA(sub_80C9AFC);
FLDEFF_SET_FUNC_TO_DATA(StartDigFieldEffect);
SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT);
return FALSE;
}
static void sub_80C9AFC(void)
static void StartDigFieldEffect(void)
{
u8 taskId;
+6 -6
View File
@@ -18,8 +18,8 @@ static void Task_FieldEffectShowMon_Init(u8 taskId);
static void Task_FieldEffectShowMon_WaitFldeff(u8 taskId);
static void Task_FieldEffectShowMon_WaitPlayerAnim(u8 taskId);
static void Task_FieldEffectShowMon_Cleanup(u8 taskId);
static void sub_80C9A10(void);
static void sub_80C9A60(void);
static void FieldCallback_UseRockSmash(void);
static void StartRockSmashFieldEffect(void);
EWRAM_DATA struct MapPosition gPlayerFacingPosition = {};
@@ -108,13 +108,13 @@ bool8 SetUpFieldMove_RockSmash(void)
if (CheckObjectGraphicsInFrontOfPlayer(OBJ_EVENT_GFX_ROCK_SMASH_ROCK) == TRUE)
{
gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu;
gPostMenuFieldCallback = sub_80C9A10;
gPostMenuFieldCallback = FieldCallback_UseRockSmash;
return TRUE;
}
return FALSE;
}
static void sub_80C9A10(void)
static void FieldCallback_UseRockSmash(void)
{
gFieldEffectArguments[0] = GetCursorSelectionMonId();
ScriptContext_SetupScript(EventScript_FldEffRockSmash);
@@ -124,12 +124,12 @@ bool8 FldEff_UseRockSmash(void)
{
u8 taskId = CreateFieldEffectShowMon();
FLDEFF_SET_FUNC_TO_DATA(sub_80C9A60);
FLDEFF_SET_FUNC_TO_DATA(StartRockSmashFieldEffect);
IncrementGameStat(GAME_STAT_USED_ROCK_SMASH);
return FALSE;
}
static void sub_80C9A60(void)
static void StartRockSmashFieldEffect(void)
{
PlaySE(SE_M_ROCK_THROW);
FieldEffectActiveListRemove(FLDEFF_USE_ROCK_SMASH);
+31 -32
View File
@@ -5,12 +5,12 @@
#include "new_menu_helpers.h"
#include "constants/songs.h"
static void sub_80E57E8(u8 taskId);
static void sub_80E583C(u8 taskId);
static void sub_80E58A0(u8 taskId);
static void sub_80E5934(u8 taskId);
static void Task_SoftboiledRestoreHealth(u8 taskId);
static void Task_DisplayHPRestoredMessage(u8 taskId);
static void Task_FinishSoftboiled(u8 taskId);
static void CantUseSoftboiledOnMon(u8 taskId);
extern const u8 gUnknown_84169F8[];
extern const u8 gText_CantBeUsedOnPkmn[];
extern const u8 gText_PkmnHPRestoredByVar2[];
bool8 SetUpFieldMove_SoftBoiled(void)
@@ -26,84 +26,83 @@ bool8 SetUpFieldMove_SoftBoiled(void)
void ChooseMonForSoftboiled(u8 taskId)
{
gPartyMenu.action = 10;
gPartyMenu.action = PARTY_ACTION_SOFTBOILED;
gPartyMenu.slotId2 = gPartyMenu.slotId;
AnimatePartySlot(GetCursorSelectionMonId(), 1);
DisplayPartyMenuStdMessage(5);
DisplayPartyMenuStdMessage(PARTY_MSG_USE_ON_WHICH_MON);
gTasks[taskId].func = Task_HandleChooseMonInput;
}
void Task_TryUseSoftboiledOnPartyMon(u8 taskId)
{
u8 r8 = gPartyMenu.slotId;
u8 r5 = gPartyMenu.slotId2;
u8 userPartyId = gPartyMenu.slotId;
u8 recipientPartyId = gPartyMenu.slotId2;
u16 curHp;
s16 delta;
if (r5 > 6)
if (recipientPartyId > PARTY_SIZE)
{
gPartyMenu.action = 0;
DisplayPartyMenuStdMessage(0);
gPartyMenu.action = PARTY_ACTION_CHOOSE_MON;
DisplayPartyMenuStdMessage(PARTY_MSG_CHOOSE_MON);
gTasks[taskId].func = Task_HandleChooseMonInput;
}
else
{
curHp = GetMonData(&gPlayerParty[r5], MON_DATA_HP);
if (curHp == 0 || r8 == r5 || GetMonData(&gPlayerParty[r5], MON_DATA_MAX_HP) == curHp)
{
sub_80E5934(taskId);
}
curHp = GetMonData(&gPlayerParty[recipientPartyId], MON_DATA_HP);
if (curHp == 0
|| userPartyId == recipientPartyId
|| GetMonData(&gPlayerParty[recipientPartyId], MON_DATA_MAX_HP) == curHp)
CantUseSoftboiledOnMon(taskId);
else
{
PlaySE(SE_USE_ITEM);
PartyMenuModifyHP(taskId, r8, -1, GetMonData(&gPlayerParty[r8], MON_DATA_MAX_HP) / 5, sub_80E57E8);
PartyMenuModifyHP(taskId, userPartyId, -1, GetMonData(&gPlayerParty[userPartyId], MON_DATA_MAX_HP) / 5, Task_SoftboiledRestoreHealth);
}
}
}
static void sub_80E57E8(u8 taskId)
static void Task_SoftboiledRestoreHealth(u8 taskId)
{
PlaySE(SE_USE_ITEM);
PartyMenuModifyHP(taskId, gPartyMenu.slotId2, 1, GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MAX_HP) / 5, sub_80E583C);
PartyMenuModifyHP(taskId, gPartyMenu.slotId2, 1, GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MAX_HP) / 5, Task_DisplayHPRestoredMessage);
}
static void sub_80E583C(u8 taskId)
static void Task_DisplayHPRestoredMessage(u8 taskId)
{
GetMonNickname(&gPlayerParty[gPartyMenu.slotId2], gStringVar1);
StringExpandPlaceholders(gStringVar4, gText_PkmnHPRestoredByVar2);
DisplayPartyMenuMessage(gStringVar4, 0);
DisplayPartyMenuMessage(gStringVar4, FALSE);
ScheduleBgCopyTilemapToVram(2);
gTasks[taskId].func = sub_80E58A0;
gTasks[taskId].func = Task_FinishSoftboiled;
}
static void sub_80E58A0(u8 taskId)
static void Task_FinishSoftboiled(u8 taskId)
{
if (IsPartyMenuTextPrinterActive() != TRUE)
{
gPartyMenu.action = 0;
gPartyMenu.action = PARTY_ACTION_CHOOSE_MON;
AnimatePartySlot(gPartyMenu.slotId, 0);
gPartyMenu.slotId = gPartyMenu.slotId2;
AnimatePartySlot(gPartyMenu.slotId2, 1);
ClearStdWindowAndFrameToTransparent(6, 0);
ClearWindowTilemap(6);
DisplayPartyMenuStdMessage(0);
DisplayPartyMenuStdMessage(PARTY_MSG_CHOOSE_MON);
gTasks[taskId].func = Task_HandleChooseMonInput;
}
}
static void sub_80E5900(u8 taskId)
static void Task_ChooseNewMonForSoftboiled(u8 taskId)
{
if (IsPartyMenuTextPrinterActive() != TRUE)
{
DisplayPartyMenuStdMessage(5);
DisplayPartyMenuStdMessage(PARTY_MSG_USE_ON_WHICH_MON);
gTasks[taskId].func = Task_HandleChooseMonInput;
}
}
static void sub_80E5934(u8 taskId)
static void CantUseSoftboiledOnMon(u8 taskId)
{
PlaySE(SE_SELECT);
DisplayPartyMenuMessage(gUnknown_84169F8, 0);
DisplayPartyMenuMessage(gText_CantBeUsedOnPkmn, FALSE);
ScheduleBgCopyTilemapToVram(2);
gTasks[taskId].func = sub_80E5900;
gTasks[taskId].func = Task_ChooseNewMonForSoftboiled;
}
+1 -1
View File
@@ -252,7 +252,7 @@ const u8 gMenuText_Confirm[] = _("OK");
const u8 gUnknown_84169D8[] = _("");
const u8 gText_PauseUntilPress[] = _("{PAUSE_UNTIL_PRESS}");
const u8 gText_WontHaveEffect[] = _("It won't have any effect.{PAUSE_UNTIL_PRESS}");
const u8 gUnknown_84169F8[] = _("This can't be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}");
const u8 gText_CantBeUsedOnPkmn[] = _("This can't be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}");
const u8 gText_PkmnCantSwitchOut[] = _("{STR_VAR_1} can't be switched\nout!{PAUSE_UNTIL_PRESS}");
const u8 gText_PkmnAlreadyInBattle[] = _("{STR_VAR_1} is already\nin battle!{PAUSE_UNTIL_PRESS}");
const u8 gText_PkmnAlreadySelected[] = _("{STR_VAR_1} has already been\nselected.{PAUSE_UNTIL_PRESS}");