Skip to content

Commit

Permalink
Merrp merge (12th of October) (#5514)
Browse files Browse the repository at this point in the history
Co-authored-by: Ariel A <[email protected]>
Fixes #5482
  • Loading branch information
pkmnsnfrn authored Oct 12, 2024
2 parents 743dc4d + 8dba272 commit c82ff7b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
17 changes: 17 additions & 0 deletions data/scripts/field_move_scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,23 @@ EventScript_EndSurface::
releaseall
end

EventScript_DigCommon:
isfollowerfieldmoveuser VAR_0x8004
setfieldeffectargument 3, VAR_0x8004 @ skip pose if true
dofieldeffect FLDEFF_USE_DIG
waitstate
EventScript_DigSealedChamber:: @ fallthrough
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
call_if_eq VAR_0x8004, TRUE, EventScript_FollowerFieldMove
callnative DoBrailleDigEffect
releaseall
end

@ Use Dig from party menu
EventScript_UseDig::
lockall
goto EventScript_DigCommon

Text_CantDive:
.string "The sea is deep here. A POKéMON\n"
.string "may be able to go underwater.$"
Expand Down
1 change: 1 addition & 0 deletions include/event_scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ extern const u8 EventScript_FailSweetScent[];
extern const u8 EventScript_UseFlash[];
extern const u8 EventScript_UseCut[];
extern const u8 EventScript_UseRockSmash[];
extern const u8 EventScript_UseDig[];

//player pc
extern const u8 LittlerootTown_BrendansHouse_2F_EventScript_TurnOffPlayerPC[];
Expand Down
1 change: 0 additions & 1 deletion src/braille_puzzles.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void DoBrailleDigEffect(void)
DrawWholeMapView();
PlaySE(SE_BANG);
FlagSet(FLAG_SYS_BRAILLE_DIG);
UnlockPlayerFieldControls();
}

bool8 CheckRelicanthWailord(void)
Expand Down
7 changes: 5 additions & 2 deletions src/fldeff_dig.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#include "global.h"
#include "braille_puzzles.h"
#include "event_scripts.h"
#include "field_effect.h"
#include "field_player_avatar.h"
#include "fldeff.h"
#include "item_use.h"
#include "overworld.h"
#include "party_menu.h"
#include "script.h"
#include "sprite.h"
#include "constants/field_effects.h"

Expand All @@ -31,8 +33,8 @@ bool8 SetUpFieldMove_Dig(void)
static void FieldCallback_Dig(void)
{
Overworld_ResetStateAfterDigEscRope();
FieldEffectStart(FLDEFF_USE_DIG);
gFieldEffectArguments[0] = GetCursorSelectionMonId();
ScriptContext_SetupScript(EventScript_UseDig);
}

bool8 FldEff_UseDig(void)
Expand All @@ -53,7 +55,8 @@ static void StartDigFieldEffect(void)
FieldEffectActiveListRemove(FLDEFF_USE_DIG);
if (ShouldDoBrailleDigEffect())
{
DoBrailleDigEffect();
// EventScript_DigSealedChamber handles DoBrailleDigEffect call
ScriptContext_Enable();
}
else
{
Expand Down

0 comments on commit c82ff7b

Please sign in to comment.