sync fldeff function names with pokeruby

This commit is contained in:
garak 2018-12-09 22:24:54 -05:00
parent b4312648e2
commit e1e2132a37
12 changed files with 169 additions and 254 deletions

View File

@ -535,7 +535,7 @@ EventScript_23B5F0:: @ 823B5F0
goto_eq EventScript_23B5A1 goto_eq EventScript_23B5A1
msgbox Text_2767D1, 3 msgbox Text_2767D1, 3
special sub_80E9C2C special sub_80E9C2C
special sub_80FA57C special DoSecretBasePCTurnOffEffect
releaseall releaseall
end end
@ -545,13 +545,13 @@ EventScript_23B62F:: @ 823B62F
goto_eq EventScript_23B5A1 goto_eq EventScript_23B5A1
msgbox Text_2767E9, 3 msgbox Text_2767E9, 3
special sub_80E9C2C special sub_80E9C2C
special sub_80FA57C special DoSecretBasePCTurnOffEffect
releaseall releaseall
end end
EventScript_23B652:: @ 823B652 EventScript_23B652:: @ 823B652
msgbox Text_27676F, 3 msgbox Text_27676F, 3
special sub_80FA57C special DoSecretBasePCTurnOffEffect
closemessage closemessage
releaseall releaseall
end end
@ -562,7 +562,7 @@ EventScript_23B660:: @ 823B660
end end
EventScript_23B66E:: @ 823B66E EventScript_23B66E:: @ 823B66E
special sub_80FA57C special DoSecretBasePCTurnOffEffect
closemessage closemessage
releaseall releaseall
end end
@ -590,7 +590,7 @@ EventScript_SecretBaseSandOrnament:: @ 823B684
end end
EventScript_SecretBaseShieldOrToyTV:: @ 823B68C EventScript_SecretBaseShieldOrToyTV:: @ 823B68C
special sub_80FAC78 special GetShieldToyTVDecorationInfo
compare VAR_RESULT, 0 compare VAR_RESULT, 0
goto_eq EventScript_23B6BC goto_eq EventScript_23B6BC
compare VAR_RESULT, 1 compare VAR_RESULT, 1

View File

@ -118,7 +118,7 @@ gFieldEffectScript_GroundImpactDust:: @ 82DBB28
field_eff_end field_eff_end
gFieldEffectScript_Unknown11:: @ 82DBB32 gFieldEffectScript_Unknown11:: @ 82DBB32
field_eff_callnative oei_sweet_scent field_eff_callnative FldEff_UseSecretPowerCave
field_eff_end field_eff_end
gFieldEffectScript_BikeHopTallGrass:: @ 82DBB38 gFieldEffectScript_BikeHopTallGrass:: @ 82DBB38
@ -179,11 +179,11 @@ gFieldEffectScript_Unknown25:: @ 82DBBB6
field_eff_end field_eff_end
gFieldEffectScript_Unknown26:: @ 82DBBC5 gFieldEffectScript_Unknown26:: @ 82DBBC5
field_eff_callnative sub_80FA208 field_eff_callnative FldEff_UseSecretPowerTree
field_eff_end field_eff_end
gFieldEffectScript_Unknown27:: @ 82DBBCB gFieldEffectScript_Unknown27:: @ 82DBBCB
field_eff_callnative sub_80FA36C field_eff_callnative FldEff_UseSecretPowerShrub
field_eff_end field_eff_end
gFieldEffectScript_TreeDisguise:: @ 82DBBD1 gFieldEffectScript_TreeDisguise:: @ 82DBBD1
@ -264,11 +264,11 @@ gFieldEffectScript_HeartIcon:: @ 82DBC56
field_eff_end field_eff_end
gFieldEffectScript_Unknown47:: @ 82DBC60 gFieldEffectScript_Unknown47:: @ 82DBC60
field_eff_callnative sub_80FA6FC field_eff_callnative FldEff_NopA6FC
field_eff_end field_eff_end
gFieldEffectScript_Unknown48:: @ 82DBC66 gFieldEffectScript_Unknown48:: @ 82DBC66
field_eff_callnative sub_80FA700 field_eff_callnative FldEff_NopA700
field_eff_end field_eff_end
gFieldEffectScript_JumpOutOfAsh:: @ 82DBC6C gFieldEffectScript_JumpOutOfAsh:: @ 82DBC6C
@ -284,7 +284,7 @@ gFieldEffectScript_Unknown51:: @ 82DBC80
field_eff_end field_eff_end
gFieldEffectScript_Unknown52:: @ 82DBC86 gFieldEffectScript_Unknown52:: @ 82DBC86
field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo9, sub_80FAA7C field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo9, FldEff_SandPillar
field_eff_end field_eff_end
gFieldEffectScript_Bubbles:: @ 82DBC90 gFieldEffectScript_Bubbles:: @ 82DBC90
@ -296,15 +296,15 @@ gFieldEffectScript_Unknown54:: @ 82DBC9A
field_eff_end field_eff_end
gFieldEffectScript_Unknown55:: @ 82DBCA4 gFieldEffectScript_Unknown55:: @ 82DBCA4
field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo7, sub_80FA13C field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo7, FldEff_SecretPowerCave
field_eff_end field_eff_end
gFieldEffectScript_Unknown56:: @ 82DBCAE gFieldEffectScript_Unknown56:: @ 82DBCAE
field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo8, sub_80FA248 field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo8, FldEff_SecretPowerTree
field_eff_end field_eff_end
gFieldEffectScript_Unknown57:: @ 82DBCB8 gFieldEffectScript_Unknown57:: @ 82DBCB8
field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo8, sub_80FA3AC field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo8, FldEff_SecretPowerShrub
field_eff_end field_eff_end
gFieldEffectScript_Unknown58:: @ 82DBCC2 gFieldEffectScript_Unknown58:: @ 82DBCC2
@ -320,7 +320,7 @@ gFieldEffectScript_Unknown60:: @ 82DBCD2
field_eff_end field_eff_end
gFieldEffectScript_Unknown61:: @ 82DBCD8 gFieldEffectScript_Unknown61:: @ 82DBCD8
field_eff_callnative sub_80FA458 field_eff_callnative FldEff_SecretBasePCTurnOn
field_eff_end field_eff_end
gFieldEffectScript_Unknown62:: @ 82DBCDE gFieldEffectScript_Unknown62:: @ 82DBCDE

View File

@ -117,7 +117,7 @@ BattleFrontier_OutsideEast_EventScript_242CEA:: @ 8242CEA
BattleFrontier_OutsideEast_EventScript_242CFC:: @ 8242CFC BattleFrontier_OutsideEast_EventScript_242CFC:: @ 8242CFC
lock lock
faceplayer faceplayer
special sub_80FAFF8 special DoWateringBerryTreeAnim
waitstate waitstate
waitse waitse
playse 269 playse 269

View File

@ -441,7 +441,7 @@ gUnknown_08615D9C:: @ 8615D9C
.4byte hm_prepare_waterfall, 0x0000000d .4byte hm_prepare_waterfall, 0x0000000d
.4byte SetUpFieldMove_Teleport, 0x0000000d .4byte SetUpFieldMove_Teleport, 0x0000000d
.4byte SetUpFieldMove_Dig, 0x0000000d .4byte SetUpFieldMove_Dig, 0x0000000d
.4byte sub_80FA004, 0x0000000d .4byte SetUpFieldMove_SecretPower, 0x0000000d
.4byte SetUpFieldMove_SoftBoiled, 0x00000010 .4byte SetUpFieldMove_SoftBoiled, 0x00000010
.4byte SetUpFieldMove_SoftBoiled, 0x00000010 .4byte SetUpFieldMove_SoftBoiled, 0x00000010
.4byte SetUpFieldMove_SweetScent, 0x0000000d .4byte SetUpFieldMove_SweetScent, 0x0000000d

View File

@ -174,7 +174,7 @@ Route102_EventScript_2744C4:: @ 82744C4
message Route102_Text_274710 message Route102_Text_274710
waitmessage waitmessage
special EventObjectInteractionWaterBerryTree special EventObjectInteractionWaterBerryTree
special sub_80FAFF8 special DoWateringBerryTreeAnim
waitstate waitstate
message Route102_Text_274723 message Route102_Text_274723
waitmessage waitmessage

View File

@ -34,7 +34,7 @@ gSpecials:: @ 81DBA64
def_special sub_8129708 def_special sub_8129708
def_special sub_80E91F8 def_special sub_80E91F8
def_special sub_80EA30C def_special sub_80EA30C
def_special sub_80FA57C def_special DoSecretBasePCTurnOffEffect
def_special sub_80E6BE8 def_special sub_80E6BE8
def_special sub_80B2DA4 def_special sub_80B2DA4
def_special sub_80B2E4C def_special sub_80B2E4C
@ -105,7 +105,7 @@ gSpecials:: @ 81DBA64
def_special GiveMonArtistRibbon def_special GiveMonArtistRibbon
def_special sub_80B3000 def_special sub_80B3000
def_special SaveGame def_special SaveGame
def_special sub_80FAFF8 def_special DoWateringBerryTreeAnim
def_special easy_chat_input_maybe def_special easy_chat_input_maybe
def_special sub_811EECC def_special sub_811EECC
def_special ScrSpecial_GetCurrentMauvilleMan def_special ScrSpecial_GetCurrentMauvilleMan
@ -317,7 +317,7 @@ gSpecials:: @ 81DBA64
def_special ScriptCheckFreePokemonStorageSpace def_special ScriptCheckFreePokemonStorageSpace
def_special DoSealedChamberShakingEffect1 def_special DoSealedChamberShakingEffect1
def_special sub_8139B60 def_special sub_8139B60
def_special sub_80FAC78 def_special GetShieldToyTVDecorationInfo
def_special IsPokerusInParty def_special IsPokerusInParty
def_special SetSootopolisGymCrackedIceMetatiles def_special SetSootopolisGymCrackedIceMetatiles
def_special sub_8139560 def_special sub_8139560

View File

@ -1,19 +1,13 @@
#ifndef GUARD_FLDEFF_80F9BCC_H #ifndef GUARD_FLDEFF_80F9BCC_H
#define GUARD_FLDEFF_80F9BCC_H #define GUARD_FLDEFF_80F9BCC_H
// Exported type declarations void PopSecretBaseBalloon(s16 id, s16 x, s16 y);
void ShatterSecretBaseBreakableDoor(s16 x, s16 y);
// Exported RAM declarations
// Exported ROM declarations
void sub_80FA5E4(s16 id, s16 x, s16 y);
void sub_80FA794(s16 x, s16 y);
void CreateRecordMixingSprite(void); void CreateRecordMixingSprite(void);
void DestroyRecordMixingSprite(void); void DestroyRecordMixingSprite(void);
void FldeffPoison_Start(void); void FldeffPoison_Start(void);
void sub_80FA970(s16); void PlaySecretBaseMusicNoteMatSound(s16 metatileId);
void sub_80FA9D0(void); void DoSecretBaseGlitterMatSparkle(void);
bool8 sub_80FADE4(u16, u8); bool8 sub_80FADE4(u16, u8);
#endif //GUARD_FLDEFF_80F9BCC_H #endif //GUARD_FLDEFF_80F9BCC_H

View File

@ -56,7 +56,7 @@ struct TrainerBattleParameter
}; };
extern bool32 InTrainerHill(void); extern bool32 InTrainerHill(void);
extern bool32 FieldPoisonEffectIsRunning(void); extern bool32 FldeffPoison_IsActive(void);
extern void RestartWildEncounterImmunitySteps(void); extern void RestartWildEncounterImmunitySteps(void);
extern void ClearPoisonStepCounter(void); extern void ClearPoisonStepCounter(void);
extern void sub_81BE72C(void); extern void sub_81BE72C(void);
@ -337,7 +337,7 @@ static void Task_BattleStart(u8 taskId)
switch (tState) switch (tState)
{ {
case 0: case 0:
if (!FieldPoisonEffectIsRunning()) // is poison not active? if (!FldeffPoison_IsActive()) // is poison not active?
{ {
BattleTransition_StartOnField(tTransition); BattleTransition_StartOnField(tTransition);
sub_81BE72C(); sub_81BE72C();

View File

@ -20,4 +20,4 @@ const u32 gBerryFixGbaTransferError_Tilemap[] = INCBIN_U32("graphics/berry_fix/g
const u16 gBerryFixWindow_Pal[] = INCBIN_U16("graphics/berry_fix/window.gbapal"); const u16 gBerryFixWindow_Pal[] = INCBIN_U16("graphics/berry_fix/window.gbapal");
const u32 gBerryFixWindow_Gfx[] = INCBIN_U32("graphics/berry_fix/window.4bpp.lz"); const u32 gBerryFixWindow_Gfx[] = INCBIN_U32("graphics/berry_fix/window.4bpp.lz");
const u32 gBerryFixWindow_Tilemap[] = INCBIN_U32("graphics/berry_fix/window.bin.lz"); const u32 gBerryFixWindow_Tilemap[] = INCBIN_U32("graphics/berry_fix/window.bin.lz");

View File

@ -522,13 +522,13 @@ static bool8 TryStartMiscWalkingScripts(u16 metatileBehavior)
} }
else if (MetatileBehavior_IsSecretBaseGlitterMat(metatileBehavior) == TRUE) else if (MetatileBehavior_IsSecretBaseGlitterMat(metatileBehavior) == TRUE)
{ {
sub_80FA9D0(); DoSecretBaseGlitterMatSparkle();
return FALSE; return FALSE;
} }
else if (MetatileBehavior_IsSecretBaseSoundMat(metatileBehavior) == TRUE) else if (MetatileBehavior_IsSecretBaseSoundMat(metatileBehavior) == TRUE)
{ {
PlayerGetDestCoords(&x, &y); PlayerGetDestCoords(&x, &y);
sub_80FA970(MapGridGetMetatileIdAt(x, y)); PlaySecretBaseMusicNoteMatSound(MapGridGetMetatileIdAt(x, y));
return FALSE; return FALSE;
} }
return FALSE; return FALSE;

View File

@ -1,25 +1,25 @@
#include "global.h" #include "global.h"
#include "gpu_regs.h"
#include "palette.h"
#include "script.h"
#include "sound.h"
#include "task.h"
#include "rom6.h"
#include "strings.h"
#include "party_menu.h"
#include "fieldmap.h" #include "fieldmap.h"
#include "field_effect.h" #include "field_effect.h"
#include "field_camera.h" #include "field_camera.h"
#include "constants/field_effects.h" #include "field_player_avatar.h"
#include "constants/songs.h"
#include "constants/vars.h"
#include "rom6.h"
#include "strings.h"
#include "secret_base.h" #include "secret_base.h"
#include "event_data.h" #include "event_data.h"
#include "field_player_avatar.h"
#include "party_menu.h"
#include "metatile_behavior.h"
#include "constants/metatile_behaviors.h"
#include "event_object_movement.h" #include "event_object_movement.h"
#include "task.h" #include "metatile_behavior.h"
#include "sound.h"
#include "script.h"
#include "palette.h"
#include "gpu_regs.h"
#include "string_util.h" #include "string_util.h"
#include "constants/field_effects.h"
#include "constants/metatile_behaviors.h"
#include "constants/songs.h"
#include "constants/vars.h"
extern struct MapPosition gPlayerFacingPosition; extern struct MapPosition gPlayerFacingPosition;
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
@ -34,43 +34,43 @@ extern u8 EventScript_275B38[];
extern const struct OamData gEventObjectBaseOam_32x8; extern const struct OamData gEventObjectBaseOam_32x8;
extern const u8 gSpriteImage_858E1D8[];
extern const u8 gSpriteImage_858E2D8[];
extern const u8 gSpriteImage_858E3D8[];
extern const u16 gTilesetPalettes_SecretBase[][16]; extern const u16 gTilesetPalettes_SecretBase[][16];
//
void sub_80F9C90(u8); void sub_80F9C90(u8);
void sub_80F9DFC(u8); void sub_80F9DFC(u8);
void sub_80FA4A0(u8);
void sub_80FA62C(u8);
void sub_80FA6AC(s16);
void sub_80FAEF0(u8); void Task_SecretBasePCTurnOn(u8);
void sub_80FAF64(u8);
void sub_80FAFD4(u8); void Task_PopSecretBaseBalloon(u8);
void DoBalloonSoundEffect(s16);
void Task_WateringBerryTreeAnim_1(u8);
void Task_WateringBerryTreeAnim_2(u8);
void Task_WateringBerryTreeAnim_3(u8);
void sub_80F9C44(TaskFunc, u16, u16, u8); void sub_80F9C44(TaskFunc, u16, u16, u8);
void sub_80FA0DC(void); void FieldCallback_SecretBaseCave(void);
void sub_80FA1E8(void); static void CaveEntranceSpriteCallback1(struct Sprite *);
void sub_80FA34C(void); static void CaveEntranceSpriteCallback2(struct Sprite *);
void sub_80FA128(void); static void CaveEntranceSpriteCallbackEnd(struct Sprite *);
void sub_80FA234(void); static void StartSecretBaseCaveFieldEffect(void);
void sub_80FA398(void);
void door_restore_tilemap(struct Sprite *); void FieldCallback_SecretBaseTree(void);
void sub_80FA1A8(struct Sprite *); static void TreeEntranceSpriteCallback1(struct Sprite *);
void sub_80FA1D8(struct Sprite *); static void TreeEntranceSpriteCallback2(struct Sprite *);
void sub_80FA304(struct Sprite *); static void TreeEntranceSpriteCallbackEnd(struct Sprite *);
void sub_80FA33C(struct Sprite *); static void StartSecretBaseTreeFieldEffect(void);
void sub_80FA418(struct Sprite *);
void sub_80FA448(struct Sprite *); void FieldCallback_SecretBaseShrub(void);
void sub_80FAC24(struct Sprite *); static void ShrubEntranceSpriteCallback1(struct Sprite *);
void sub_80FAC68(struct Sprite *); static void ShrubEntranceSpriteCallback2(struct Sprite *);
void sub_80FA18C(struct Sprite *); static void ShrubEntranceSpriteCallbackEnd(struct Sprite *);
void sub_80FA2D8(struct Sprite *); static void StartSecretBaseShrubFieldEffect(void);
void sub_80FA3FC(struct Sprite *);
void SpriteCB_SandPillar_0(struct Sprite *);
void SpriteCB_SandPillar_1(struct Sprite *);
void SpriteCB_SandPillar_2(struct Sprite *);
const u8 gSpriteImage_858D978[] = INCBIN_U8("graphics/unknown/858E588/0.4bpp"); const u8 gSpriteImage_858D978[] = INCBIN_U8("graphics/unknown/858E588/0.4bpp");
const u8 gSpriteImage_858D9F8[] = INCBIN_U8("graphics/unknown/858E588/1.4bpp"); const u8 gSpriteImage_858D9F8[] = INCBIN_U8("graphics/unknown/858E588/1.4bpp");
@ -222,7 +222,7 @@ const struct SpriteTemplate gUnknown_0858E600 =
.anims = gSpriteAnimTable_858E570, .anims = gSpriteAnimTable_858E570,
.images = gUnknown_858E588, .images = gUnknown_858E588,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80FA18C, .callback = CaveEntranceSpriteCallback1,
}; };
const struct SpriteTemplate gUnknown_0858E618 = const struct SpriteTemplate gUnknown_0858E618 =
@ -233,7 +233,7 @@ const struct SpriteTemplate gUnknown_0858E618 =
.anims = gSpriteAnimTable_858E574, .anims = gSpriteAnimTable_858E574,
.images = gUnknown_858E5B0, .images = gUnknown_858E5B0,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80FA2D8, .callback = TreeEntranceSpriteCallback1,
}; };
const struct SpriteTemplate gUnknown_0858E630 = const struct SpriteTemplate gUnknown_0858E630 =
@ -244,7 +244,7 @@ const struct SpriteTemplate gUnknown_0858E630 =
.anims = gSpriteAnimTable_858E584, .anims = gSpriteAnimTable_858E584,
.images = gUnknown_858E5D8, .images = gUnknown_858E5D8,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80FA3FC, .callback = ShrubEntranceSpriteCallback1,
}; };
const struct SpritePalette gFieldEffectObjectPaletteInfo7 = {gFieldEffectObjectPalette7, 0x1003}; const struct SpritePalette gFieldEffectObjectPaletteInfo7 = {gFieldEffectObjectPalette7, 0x1003};
@ -290,7 +290,7 @@ const struct SpriteTemplate gUnknown_0858E68C =
.anims = gSpriteAnimTable_858E670, .anims = gSpriteAnimTable_858E670,
.images = gUnknown_0858E674, .images = gUnknown_0858E674,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = door_restore_tilemap, .callback = SpriteCB_SandPillar_0,
}; };
// This uses one of the secret base palettes, so there is no "field_effect_object_palette_09.pal" file. // This uses one of the secret base palettes, so there is no "field_effect_object_palette_09.pal" file.
@ -355,11 +355,11 @@ bool8 sub_80F9C30(void)
return FuncIsActiveTask(sub_80F9DFC); return FuncIsActiveTask(sub_80F9DFC);
} }
void sub_80F9C44(void (*a0) (u8), u16 a1, u16 a2, u8 a3) void sub_80F9C44(void (*taskfunc) (u8), u16 a1, u16 a2, u8 a3)
{ {
u16 tempA, tempB; u16 tempA, tempB;
u8 taskId = CreateTask(a0, a3); u8 taskId = CreateTask(taskfunc, a3);
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;
@ -713,15 +713,13 @@ void sub_80F9DFC(u8 taskId)
//============================================================================= //=============================================================================
// fldeff_secretpower.c // fldeff_secretpower.c
// SetCurrentSecretBase(); void SetCurrentSecretBase(void)
void sub_80F9F5C(void)
{ {
sub_80E9608(&gPlayerFacingPosition, gMapHeader.events); sub_80E9608(&gPlayerFacingPosition, gMapHeader.events);
sub_80E8B6C(); sub_80E8B6C();
} }
// AdjustSecretPowerSpritePixelOffsets void AdjustSecretPowerSpritePixelOffsets(void)
void sub_80F9F78(void)
{ {
if (gPlayerAvatar.flags & 0x6) if (gPlayerAvatar.flags & 0x6)
{ {
@ -769,8 +767,7 @@ void sub_80F9F78(void)
} }
} }
// SetUpFieldMove_SecretPower bool8 SetUpFieldMove_SecretPower(void)
bool8 sub_80FA004(void)
{ {
u8 mb; u8 mb;
@ -784,59 +781,56 @@ bool8 sub_80FA004(void)
if (MetatileBehavior_IsSecretBaseCave(mb) == TRUE) if (MetatileBehavior_IsSecretBaseCave(mb) == TRUE)
{ {
sub_80F9F5C(); SetCurrentSecretBase();
gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu;
gPostMenuFieldCallback = sub_80FA0DC; gPostMenuFieldCallback = FieldCallback_SecretBaseCave;
return TRUE; return TRUE;
} }
if (MetatileBehavior_IsSecretBaseTree(mb) == TRUE) if (MetatileBehavior_IsSecretBaseTree(mb) == TRUE)
{ {
sub_80F9F5C(); SetCurrentSecretBase();
gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu;
gPostMenuFieldCallback = sub_80FA1E8; gPostMenuFieldCallback = FieldCallback_SecretBaseTree;
return TRUE; return TRUE;
} }
if (MetatileBehavior_IsSecretBaseShrub(mb) == TRUE) if (MetatileBehavior_IsSecretBaseShrub(mb) == TRUE)
{ {
sub_80F9F5C(); SetCurrentSecretBase();
gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu;
gPostMenuFieldCallback = sub_80FA34C; gPostMenuFieldCallback = FieldCallback_SecretBaseShrub;
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
// FieldCallback_SecretBaseCave void FieldCallback_SecretBaseCave(void)
void sub_80FA0DC(void)
{ {
gFieldEffectArguments[0] = GetCursorSelectionMonId(); gFieldEffectArguments[0] = GetCursorSelectionMonId();
ScriptContext1_SetupScript(EventScript_275A86); ScriptContext1_SetupScript(EventScript_275A86);
} }
bool8 oei_sweet_scent(void) bool8 FldEff_UseSecretPowerCave(void)
{ {
u8 taskId = oei_task_add(); u8 taskId = oei_task_add();
gTasks[taskId].data[8] = (u32)sub_80FA128 >> 16; gTasks[taskId].data[8] = (u32)StartSecretBaseCaveFieldEffect >> 16;
gTasks[taskId].data[9] = (u32)sub_80FA128; gTasks[taskId].data[9] = (u32)StartSecretBaseCaveFieldEffect;
return FALSE; return FALSE;
} }
// StartSecretBaseCaveFieldEffect static void StartSecretBaseCaveFieldEffect(void)
void sub_80FA128(void)
{ {
FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_CAVE); FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_CAVE);
FieldEffectStart(FLDEFF_SECRET_POWER_CAVE); FieldEffectStart(FLDEFF_SECRET_POWER_CAVE);
} }
// FldEff_SecretPowerCave bool8 FldEff_SecretPowerCave(void)
bool8 sub_80FA13C(void)
{ {
sub_80F9F78(); AdjustSecretPowerSpritePixelOffsets();
CreateSprite(&gUnknown_0858E600, CreateSprite(&gUnknown_0858E600,
gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5], gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5],
@ -846,17 +840,15 @@ bool8 sub_80FA13C(void)
return FALSE; return FALSE;
} }
// CaveEntranceSpriteCallback1 static void CaveEntranceSpriteCallback1(struct Sprite *sprite)
void sub_80FA18C(struct Sprite *sprite)
{ {
PlaySE(SE_W088); PlaySE(SE_W088);
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = sub_80FA1A8; sprite->callback = CaveEntranceSpriteCallback2;
} }
// CaveEntranceSpriteCallback2 static void CaveEntranceSpriteCallback2(struct Sprite *sprite)
void sub_80FA1A8(struct Sprite *sprite)
{ {
if (sprite->data[0] < 40) if (sprite->data[0] < 40)
{ {
@ -868,45 +860,39 @@ void sub_80FA1A8(struct Sprite *sprite)
else else
{ {
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = sub_80FA1D8; sprite->callback = CaveEntranceSpriteCallbackEnd;
} }
} }
// CaveEntranceSpriteCallbackEnd static void CaveEntranceSpriteCallbackEnd(struct Sprite *sprite)
void sub_80FA1D8(struct Sprite *sprite)
{ {
//
FieldEffectStop(sprite, FLDEFF_SECRET_POWER_CAVE); FieldEffectStop(sprite, FLDEFF_SECRET_POWER_CAVE);
EnableBothScriptContexts(); EnableBothScriptContexts();
} }
// FieldCallback_SecretBaseTree void FieldCallback_SecretBaseTree(void)
void sub_80FA1E8(void)
{ {
gFieldEffectArguments[0] = GetCursorSelectionMonId(); gFieldEffectArguments[0] = GetCursorSelectionMonId();
ScriptContext1_SetupScript(EventScript_275ADF); ScriptContext1_SetupScript(EventScript_275ADF);
} }
// FldEff_UseSecretPowerTree bool8 FldEff_UseSecretPowerTree(void)
bool8 sub_80FA208(void)
{ {
u8 taskId = oei_task_add(); u8 taskId = oei_task_add();
gTasks[taskId].data[8] = (u32)sub_80FA234 >> 16; gTasks[taskId].data[8] = (u32)StartSecretBaseTreeFieldEffect >> 16;
gTasks[taskId].data[9] = (u32)sub_80FA234; gTasks[taskId].data[9] = (u32)StartSecretBaseTreeFieldEffect;
return FALSE; return FALSE;
} }
// StartSecretBaseTreeFieldEffect static void StartSecretBaseTreeFieldEffect(void)
void sub_80FA234(void)
{ {
FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_TREE); FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_TREE);
FieldEffectStart(FLDEFF_SECRET_POWER_TREE); FieldEffectStart(FLDEFF_SECRET_POWER_TREE);
} }
// FldEff_SecretPowerTree bool8 FldEff_SecretPowerTree(void)
bool8 sub_80FA248(void)
{ {
s16 mb = MapGridGetMetatileBehaviorAt(gPlayerFacingPosition.x, gPlayerFacingPosition.y) & 0xFFF; s16 mb = MapGridGetMetatileBehaviorAt(gPlayerFacingPosition.x, gPlayerFacingPosition.y) & 0xFFF;
@ -916,7 +902,7 @@ bool8 sub_80FA248(void)
if (mb == MB_SECRET_BASE_SPOT_TREE_RIGHT) if (mb == MB_SECRET_BASE_SPOT_TREE_RIGHT)
gFieldEffectArguments[7] = 2; gFieldEffectArguments[7] = 2;
sub_80F9F78(); AdjustSecretPowerSpritePixelOffsets();
CreateSprite(&gUnknown_0858E618, CreateSprite(&gUnknown_0858E618,
gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5], gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5],
@ -929,18 +915,16 @@ bool8 sub_80FA248(void)
return FALSE; return FALSE;
} }
// TreeEntranceSpriteCallback1 static void TreeEntranceSpriteCallback1(struct Sprite *sprite)
void sub_80FA2D8(struct Sprite *sprite)
{ {
PlaySE(SE_W010); PlaySE(SE_W010);
sprite->animNum = gFieldEffectArguments[7]; sprite->animNum = gFieldEffectArguments[7];
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = sub_80FA304; sprite->callback = TreeEntranceSpriteCallback2;
} }
// TreeEntranceSpriteCallback2 static void TreeEntranceSpriteCallback2(struct Sprite *sprite)
void sub_80FA304(struct Sprite *sprite)
{ {
sprite->data[0]++; sprite->data[0]++;
@ -950,46 +934,41 @@ void sub_80FA304(struct Sprite *sprite)
sub_80E8D4C(); sub_80E8D4C();
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = sub_80FA33C; sprite->callback = TreeEntranceSpriteCallbackEnd;
} }
} }
// TreeEntranceSpriteCallbackEnd static void TreeEntranceSpriteCallbackEnd(struct Sprite *sprite)
void sub_80FA33C(struct Sprite *sprite)
{ {
FieldEffectStop(sprite, FLDEFF_SECRET_POWER_TREE); FieldEffectStop(sprite, FLDEFF_SECRET_POWER_TREE);
EnableBothScriptContexts(); EnableBothScriptContexts();
} }
// FieldCallback_SecretBaseShrub void FieldCallback_SecretBaseShrub(void)
void sub_80FA34C(void)
{ {
gFieldEffectArguments[0] = GetCursorSelectionMonId(); gFieldEffectArguments[0] = GetCursorSelectionMonId();
ScriptContext1_SetupScript(EventScript_275B38); ScriptContext1_SetupScript(EventScript_275B38);
} }
// FldEff_UseSecretPowerShrub bool8 FldEff_UseSecretPowerShrub(void)
bool8 sub_80FA36C(void)
{ {
u8 taskId = oei_task_add(); u8 taskId = oei_task_add();
gTasks[taskId].data[8] = (u32)sub_80FA398 >> 16; gTasks[taskId].data[8] = (u32)StartSecretBaseShrubFieldEffect >> 16;
gTasks[taskId].data[9] = (u32)sub_80FA398; gTasks[taskId].data[9] = (u32)StartSecretBaseShrubFieldEffect;
return FALSE; return FALSE;
} }
// StartSecretBaseShrubFieldEffect static void StartSecretBaseShrubFieldEffect(void)
void sub_80FA398(void)
{ {
FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_SHRUB); FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_SHRUB);
FieldEffectStart(FLDEFF_SECRET_POWER_SHRUB); FieldEffectStart(FLDEFF_SECRET_POWER_SHRUB);
} }
// FldEff_SecretPowerShrub bool8 FldEff_SecretPowerShrub(void)
bool8 sub_80FA3AC(void)
{ {
sub_80F9F78(); AdjustSecretPowerSpritePixelOffsets();
CreateSprite(&gUnknown_0858E630, CreateSprite(&gUnknown_0858E630,
gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5], gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5],
@ -999,17 +978,15 @@ bool8 sub_80FA3AC(void)
return FALSE; return FALSE;
} }
// ShrubEntranceSpriteCallback1 static void ShrubEntranceSpriteCallback1(struct Sprite *sprite)
void sub_80FA3FC(struct Sprite *sprite)
{ {
PlaySE(SE_W077); PlaySE(SE_W077);
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = sub_80FA418; sprite->callback = ShrubEntranceSpriteCallback2;
} }
// ShrubEntranceSpriteCallback2 static void ShrubEntranceSpriteCallback2(struct Sprite *sprite)
void sub_80FA418(struct Sprite *sprite)
{ {
if (sprite->data[0] < 40) if (sprite->data[0] < 40)
{ {
@ -1021,29 +998,24 @@ void sub_80FA418(struct Sprite *sprite)
else else
{ {
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = sub_80FA448; sprite->callback = ShrubEntranceSpriteCallbackEnd;
} }
} }
// ShrubEntranceSpriteCallbackEnd static void ShrubEntranceSpriteCallbackEnd(struct Sprite *sprite)
void sub_80FA448(struct Sprite *sprite)
{ {
FieldEffectStop(sprite, FLDEFF_SECRET_POWER_SHRUB); FieldEffectStop(sprite, FLDEFF_SECRET_POWER_SHRUB);
EnableBothScriptContexts(); EnableBothScriptContexts();
} }
//============================================================================= u32 FldEff_SecretBasePCTurnOn(void)
// fldeff_secretbase_pc.c
// FldEff_SecretBasePCTurnOn
u32 sub_80FA458(void)
{ {
s16 x, y; s16 x, y;
u8 taskId; u8 taskId;
GetXYCoordsOneStepInFrontOfPlayer(&x, &y); GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
taskId = CreateTask(sub_80FA4A0, 0); taskId = CreateTask(Task_SecretBasePCTurnOn, 0);
gTasks[taskId].data[0] = x; gTasks[taskId].data[0] = x;
gTasks[taskId].data[1] = y; gTasks[taskId].data[1] = y;
gTasks[taskId].data[2] = 0; gTasks[taskId].data[2] = 0;
@ -1051,8 +1023,7 @@ u32 sub_80FA458(void)
return 0; return 0;
} }
// Task_SecretBasePCTurnOn void Task_SecretBasePCTurnOn(u8 taskId)
void sub_80FA4A0(u8 taskId)
{ {
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
@ -1080,8 +1051,7 @@ void sub_80FA4A0(u8 taskId)
data[2]++; data[2]++;
} }
// DoSecretBasePCTurnOffEffect void DoSecretBasePCTurnOffEffect(void)
void sub_80FA57C(void)
{ {
s16 x, y; s16 x, y;
@ -1099,10 +1069,9 @@ void sub_80FA57C(void)
//============================================================================= //=============================================================================
// fldeff_decoration.c // fldeff_decoration.c
// PopSecretBaseBalloon void PopSecretBaseBalloon(s16 metatileId, s16 x, s16 y)
void sub_80FA5E4(s16 metatileId, s16 x, s16 y)
{ {
u8 taskId = CreateTask(sub_80FA62C, 0); u8 taskId = CreateTask(Task_PopSecretBaseBalloon, 0);
gTasks[taskId].data[0] = metatileId; gTasks[taskId].data[0] = metatileId;
gTasks[taskId].data[1] = x; gTasks[taskId].data[1] = x;
@ -1111,8 +1080,7 @@ void sub_80FA5E4(s16 metatileId, s16 x, s16 y)
gTasks[taskId].data[4] = 1; gTasks[taskId].data[4] = 1;
} }
// void Task_PopSecretBaseBalloon(u8 taskId)
void sub_80FA62C(u8 taskId)
{ {
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
@ -1124,7 +1092,7 @@ void sub_80FA62C(u8 taskId)
if (data[3] == 0) if (data[3] == 0)
{ {
if (data[4] == 2) if (data[4] == 2)
sub_80FA6AC(data[0]); DoBalloonSoundEffect(data[0]);
MapGridSetMetatileIdAt(data[1], data[2], data[0] + data[4]); MapGridSetMetatileIdAt(data[1], data[2], data[0] + data[4]);
CurrentMapDrawMetatileAt(data[1], data[2]); CurrentMapDrawMetatileAt(data[1], data[2]);
@ -1136,8 +1104,7 @@ void sub_80FA62C(u8 taskId)
} }
} }
// DoBalloonSoundEffect void DoBalloonSoundEffect(s16 metatileId)
void sub_80FA6AC(s16 metatileId)
{ {
switch (metatileId) switch (metatileId)
{ {
@ -1156,20 +1123,17 @@ void sub_80FA6AC(s16 metatileId)
} }
} }
// FldEff_Nop47 bool8 FldEff_NopA6FC(void)
bool8 sub_80FA6FC(void)
{ {
return FALSE; return FALSE;
} }
// FldEff_Nop48 bool8 FldEff_NopA700(void)
bool8 sub_80FA700(void)
{ {
return FALSE; return FALSE;
} }
// void DoSecretBaseBreakableDoorEffect(s16 x, s16 y)
void sub_80FA704(s16 x, s16 y)
{ {
PlaySE(SE_TOY_KABE); PlaySE(SE_TOY_KABE);
MapGridSetMetatileIdAt(x, y, 630); MapGridSetMetatileIdAt(x, y, 630);
@ -1178,12 +1142,11 @@ void sub_80FA704(s16 x, s16 y)
CurrentMapDrawMetatileAt(x, y - 1); CurrentMapDrawMetatileAt(x, y - 1);
} }
// void Task_ShatterSecretBaseBreakableDoor(u8 taskId)
void sub_80FA754(u8 taskId)
{ {
if (gTasks[taskId].data[0] == 7) if (gTasks[taskId].data[0] == 7)
{ {
sub_80FA704(gTasks[taskId].data[1], gTasks[taskId].data[2]); DoSecretBaseBreakableDoorEffect(gTasks[taskId].data[1], gTasks[taskId].data[2]);
DestroyTask(taskId); DestroyTask(taskId);
} }
else else
@ -1192,18 +1155,17 @@ void sub_80FA754(u8 taskId)
} }
} }
// ShatterSecretBaseBreakableDoor void ShatterSecretBaseBreakableDoor(s16 x, s16 y)
void sub_80FA794(s16 x, s16 y)
{ {
u8 dir = GetPlayerFacingDirection(); u8 dir = GetPlayerFacingDirection();
if (dir == DIR_SOUTH) if (dir == DIR_SOUTH)
{ {
sub_80FA704(x, y); DoSecretBaseBreakableDoorEffect(x, y);
} }
else if (dir == DIR_NORTH) else if (dir == DIR_NORTH)
{ {
u8 taskId = CreateTask(sub_80FA754, 5); u8 taskId = CreateTask(Task_ShatterSecretBaseBreakableDoor, 5);
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = x; gTasks[taskId].data[1] = x;
gTasks[taskId].data[2] = y; gTasks[taskId].data[2] = y;
@ -1211,12 +1173,11 @@ void sub_80FA794(s16 x, s16 y)
} }
#define tMetatileID data[0] #define tMetatileID data[0]
// Task_SecretBaseMusicNoteMatSound void Task_SecretBaseMusicNoteMatSound(u8 taskId)
void sub_80FA7EC(u8 taskId)
{ {
if (gTasks[taskId].data[1] == 7) if (gTasks[taskId].data[1] == 7)
{ {
switch (gTasks[taskId].tMetatileID) // metatileId switch (gTasks[taskId].tMetatileID)
{ {
case 632: case 632:
PlaySE(SE_TOY_C); PlaySE(SE_TOY_C);
@ -1252,18 +1213,16 @@ void sub_80FA7EC(u8 taskId)
} }
} }
// PlaySecretBaseMusicNoteMatSound void PlaySecretBaseMusicNoteMatSound(s16 metatileId)
void sub_80FA970(s16 metatileId)
{ {
u8 taskId = CreateTask(sub_80FA7EC, 5); u8 taskId = CreateTask(Task_SecretBaseMusicNoteMatSound, 5);
gTasks[taskId].tMetatileID = metatileId; gTasks[taskId].tMetatileID = metatileId;
gTasks[taskId].data[1] = 0; gTasks[taskId].data[1] = 0;
} }
#undef tMetatileID #undef tMetatileID
// SpriteCB_GlitterMatSparkle void SpriteCB_GlitterMatSparkle(struct Sprite *sprite)
void sub_80FA9A4(struct Sprite *sprite)
{ {
sprite->data[0]++; sprite->data[0]++;
@ -1274,8 +1233,7 @@ void sub_80FA9A4(struct Sprite *sprite)
DestroySprite(sprite); DestroySprite(sprite);
} }
// DoSecretBaseGlitterMatSparkle void DoSecretBaseGlitterMatSparkle(void)
void sub_80FA9D0(void)
{ {
s16 x = gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.x; s16 x = gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.x;
s16 y = gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.y; s16 y = gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.y;
@ -1289,13 +1247,12 @@ void sub_80FA9D0(void)
gSprites[spriteId].coordOffsetEnabled = TRUE; gSprites[spriteId].coordOffsetEnabled = TRUE;
gSprites[spriteId].oam.priority = 1; gSprites[spriteId].oam.priority = 1;
gSprites[spriteId].oam.paletteNum = 5; gSprites[spriteId].oam.paletteNum = 5;
gSprites[spriteId].callback = sub_80FA9A4; gSprites[spriteId].callback = SpriteCB_GlitterMatSparkle;
gSprites[spriteId].data[0] = 0; gSprites[spriteId].data[0] = 0;
} }
} }
// FldEff_SandPillar bool8 FldEff_SandPillar(void)
bool8 sub_80FAA7C(void)
{ {
s16 x, y; s16 x, y;
@ -1343,8 +1300,7 @@ bool8 sub_80FAA7C(void)
return FALSE; return FALSE;
} }
// SpriteCB_SandPillar_0 void SpriteCB_SandPillar_0(struct Sprite *sprite)
void door_restore_tilemap(struct Sprite *sprite)
{ {
PlaySE(SE_W088); PlaySE(SE_W088);
@ -1358,11 +1314,10 @@ void door_restore_tilemap(struct Sprite *sprite)
CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6]); CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6]);
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = sub_80FAC24; sprite->callback = SpriteCB_SandPillar_1;
} }
// SpriteCB_SandPillar_1 void SpriteCB_SandPillar_1(struct Sprite *sprite)
void sub_80FAC24(struct Sprite *sprite)
{ {
if (sprite->data[0] < 18) if (sprite->data[0] < 18)
{ {
@ -1373,19 +1328,17 @@ void sub_80FAC24(struct Sprite *sprite)
MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6], 3724); MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6], 3724);
CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6]); CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6]);
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = sub_80FAC68; sprite->callback = SpriteCB_SandPillar_2;
} }
} }
// SpriteCB_SandPillar_2 void SpriteCB_SandPillar_2(struct Sprite *sprite)
void sub_80FAC68(struct Sprite *sprite)
{ {
FieldEffectStop(sprite, FLDEFF_SAND_PILLAR); FieldEffectStop(sprite, FLDEFF_SAND_PILLAR);
EnableBothScriptContexts(); EnableBothScriptContexts();
} }
// GetShieldToyTVDecorationInfo void GetShieldToyTVDecorationInfo(void)
void sub_80FAC78(void)
{ {
s16 x, y; s16 x, y;
s32 metatileId; s32 metatileId;
@ -1458,7 +1411,6 @@ void sub_80FAC78(void)
// //
bool8 sub_80FADE4(u16 arg0, u8 arg1) bool8 sub_80FADE4(u16 arg0, u8 arg1)
{ {
/*
// //
if (CurrentMapIsSecretBase()) if (CurrentMapIsSecretBase())
{ {
@ -1480,28 +1432,6 @@ bool8 sub_80FADE4(u16 arg0, u8 arg1)
} }
} }
return FALSE; return FALSE;
*/
if (!CurrentMapIsSecretBase()) return FALSE;
else
{
// return TRUE;
if (arg1 == 0)
{
//
if ((u16)(arg0 + 0xfffffd7b) <= 1 || (arg0 == 0x237))
return TRUE;
//if (arg0 == 0x237)
//else return FALSE;
}
else
{
//
if (arg0 == 0x28d || arg0 == 0x23f)
return TRUE;
//return FALSE;
}
}
return FALSE;
} }
#else #else
NAKED NAKED
@ -1549,8 +1479,7 @@ bool8 sub_80FADE4(u16 arg0, u8 arg1)
} }
#endif #endif
// Task_FieldPoisonEffect void Task_FieldPoisonEffect(u8 taskId)
void task50_overworld_poison_effect(u8 taskId)
{ {
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
@ -1577,27 +1506,23 @@ void task50_overworld_poison_effect(u8 taskId)
SetGpuReg(REG_OFFSET_MOSAIC, (data[1] << 4) | data[1]); SetGpuReg(REG_OFFSET_MOSAIC, (data[1] << 4) | data[1]);
} }
// FldeffPoison_Start
void FldeffPoison_Start(void) void FldeffPoison_Start(void)
{ {
PlaySE(SE_DOKU); PlaySE(SE_DOKU);
CreateTask(task50_overworld_poison_effect, 80); CreateTask(Task_FieldPoisonEffect, 80);
} }
// FldeffPoison_IsActive bool32 FldeffPoison_IsActive(void)
bool32 FieldPoisonEffectIsRunning(void)
{ {
return FuncIsActiveTask(task50_overworld_poison_effect); return FuncIsActiveTask(Task_FieldPoisonEffect);
} }
// Task_WateringBerryTreeAnim_0 void Task_WateringBerryTreeAnim_0(u8 taskId)
void sub_80FAED4(u8 taskId)
{ {
gTasks[taskId].func = sub_80FAEF0; gTasks[taskId].func = Task_WateringBerryTreeAnim_1;
} }
// Task_WateringBerryTreeAnim_1 void Task_WateringBerryTreeAnim_1(u8 taskId)
void sub_80FAEF0(u8 taskId)
{ {
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
@ -1606,12 +1531,11 @@ void sub_80FAEF0(u8 taskId)
{ {
sub_808C228(GetPlayerFacingDirection()); sub_808C228(GetPlayerFacingDirection());
EventObjectSetHeldMovement(playerEventObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); EventObjectSetHeldMovement(playerEventObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection()));
gTasks[taskId].func = sub_80FAF64; gTasks[taskId].func = Task_WateringBerryTreeAnim_2;
} }
} }
// Task_WateringBerryTreeAnim_2 void Task_WateringBerryTreeAnim_2(u8 taskId)
void sub_80FAF64(u8 taskId)
{ {
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
@ -1623,25 +1547,22 @@ void sub_80FAF64(u8 taskId)
EventObjectSetHeldMovement(playerEventObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); EventObjectSetHeldMovement(playerEventObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection()));
else else
gTasks[taskId].func = sub_80FAFD4; gTasks[taskId].func = Task_WateringBerryTreeAnim_3;
} }
} }
// Task_WateringBerryTreeAnim_3 void Task_WateringBerryTreeAnim_3(u8 taskId)
void sub_80FAFD4(u8 taskId)
{ {
SetPlayerAvatarTransitionFlags(sub_808BCD0()); SetPlayerAvatarTransitionFlags(sub_808BCD0());
DestroyTask(taskId); DestroyTask(taskId);
EnableBothScriptContexts(); EnableBothScriptContexts();
} }
// DoWateringBerryTreeAnim void DoWateringBerryTreeAnim(void)
void sub_80FAFF8(void)
{ {
CreateTask(sub_80FAED4, 80); CreateTask(Task_WateringBerryTreeAnim_0, 80);
} }
//
u8 CreateRecordMixingSprite(void) u8 CreateRecordMixingSprite(void)
{ {
u8 spriteId; u8 spriteId;

View File

@ -1256,7 +1256,7 @@ void sub_80EA3E4(u8 taskId)
} }
else if (MetatileBehavior_IsSecretBaseBalloon(behavior) == TRUE) else if (MetatileBehavior_IsSecretBaseBalloon(behavior) == TRUE)
{ {
sub_80FA5E4(MapGridGetMetatileIdAt(x, y), x, y); PopSecretBaseBalloon(MapGridGetMetatileIdAt(x, y), x, y);
if (gUnknown_0203A01D == TRUE) if (gUnknown_0203A01D == TRUE)
{ {
switch ((int)MapGridGetMetatileIdAt(x, y)) switch ((int)MapGridGetMetatileIdAt(x, y))
@ -1278,7 +1278,7 @@ void sub_80EA3E4(u8 taskId)
{ {
VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x400); VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x400);
} }
sub_80FA794(x, y); ShatterSecretBaseBreakableDoor(x, y);
} }
else if (MetatileBehavior_IsSecretBaseSoundMat(behavior) == TRUE){ else if (MetatileBehavior_IsSecretBaseSoundMat(behavior) == TRUE){
if (gUnknown_0203A01D == TRUE) { if (gUnknown_0203A01D == TRUE) {