Document secret base

This commit is contained in:
Marcus Huderle 2019-04-05 16:11:24 -05:00 committed by huderlem
parent 9a11764b52
commit 033580da96
38 changed files with 1139 additions and 1262 deletions

View File

@ -454,7 +454,7 @@ EventScript_SecretBasePC:: @ 823B4BB
EventScript_SecretBasePCShowMainMenu:: @ 823B4D3
message Text_SecretBasePCStartMenu
waitmessage
goto_if_set FLAG_DECORATION_16, EventScript_SecretBasePCMainMenuChoice
goto_if_set FLAG_SECRET_BASE_REGISTRY_ENABLED, EventScript_SecretBasePCMainMenuChoice
goto EventScript_23B531
end
@ -487,16 +487,16 @@ EventScript_23B568:: @ 823B568
compare VAR_RESULT, 0
goto_if_eq EventScript_SecretBasePCShowMainMenu
closemessage
special sub_80E9AC0
special MoveOutOfSecretBase
releaseall
end
EventScript_23B581:: @ 823B581
special sub_80E9C74
special ShowSecretBaseDecorationMenu
end
EventScript_23B585:: @ 823B585
special sub_80E9C88
special ShowSecretBaseRegistryMenu
end
EventScript_RecordMixingSecretBasePC:: @ 823B589
@ -529,17 +529,17 @@ gUnknown_0823B5E9:: @ 823B5E9
end
EventScript_23B5F0:: @ 823B5F0
special sub_80E9BDC
special GetCurSecretBaseRegistrationValidity
compare VAR_RESULT, 1
goto_if_eq EventScript_23B62F
compare VAR_RESULT, 2
goto_if_eq EventScript_CantRegisterTooManyBases
special sub_80E980C
msgbox Text_276707, MSGBOX_YESNO
special CopyCurSecretBaseOwnerName_StrVar1
msgbox Text_WantToRegisterSecretBase, MSGBOX_YESNO
compare VAR_RESULT, 0
goto_if_eq EventScript_23B5A1
msgbox Text_2767D1, MSGBOX_SIGN
special sub_80E9C2C
special ToggleCurSecretBaseRegistry
special DoSecretBasePCTurnOffEffect
releaseall
end
@ -549,7 +549,7 @@ EventScript_23B62F:: @ 823B62F
compare VAR_RESULT, 0
goto_if_eq EventScript_23B5A1
msgbox Text_2767E9, MSGBOX_SIGN
special sub_80E9C2C
special ToggleCurSecretBaseRegistry
special DoSecretBasePCTurnOffEffect
releaseall
end
@ -573,23 +573,23 @@ EventScript_23B66E:: @ 823B66E
end
EventScript_23B674:: @ 823B674
special sub_80EB498
special SetSecretBaseSecretsTvFlags_Poster
end
EventScript_23B678:: @ 823B678
special sub_80EB56C
special SetSecretBaseSecretsTvFlags_MiscFurnature
end
EventScript_23B67C:: @ 823B67C
special sub_80EB9E0
special SetSecretBaseSecretsTvFlags_LargeDecorationSpot
end
EventScript_23B680:: @ 823B680
special sub_80EBB28
special SetSecretBaseSecretsTvFlags_SmallDecorationSpot
end
EventScript_SecretBaseSandOrnament:: @ 823B684
special sub_80EBE7C
special SetSecretBaseSecretsTvFlags_SandOrnament
dofieldeffect FLDEFF_SAND_PILLAR
waitstate
end

View File

@ -17,7 +17,7 @@ MossdeepCity_House4_EventScript_222DED:: @ 8222DED
MossdeepCity_House4_EventScript_222DF7:: @ 8222DF7
lock
faceplayer
special sub_80E8BC8
special CheckPlayerHasSecretBase
compare VAR_RESULT, 0
goto_if_eq MossdeepCity_House4_EventScript_222E14
special GetSecretBaseNearbyMapName

View File

@ -11,7 +11,7 @@ SecretBase_RedCave1_MapScript2_23B498: @ 823B498
SecretBase_RedCave1_MapScript1_23B4A2: @ 823B4A2
call SecretBase_RedCave1_EventScript_275CE1
special sub_80E95D4
special SetSecretBaseOwnerGfxId
special sub_80EB1AC
end

View File

@ -310,8 +310,8 @@ SecretBase_RedCave1_Text_275944: @ 8275944
.string "Are you speechless?$"
EventScript_2759F1:: @ 82759F1
special sub_80E8C98
special sub_80E8BC8
special GetSecretBaseTypeInFrontOfPlayer
special CheckPlayerHasSecretBase
compare VAR_RESULT, 1
goto_if_eq EventScript_275BE8
checkpartymove MOVE_SECRET_POWER
@ -432,11 +432,11 @@ EventScript_275B5B:: @ 8275B5B
playse SE_KAIDAN
setvar VAR_INIT_SECRET_BASE, 0
setflag FLAG_DECORATION_0
special sub_80E8E18
special sub_80E9068
special SetPlayerSecretBase
special EnterSecretBase
setvar VAR_0x8004, 0
setvar VAR_0x8005, 0
special sub_80E933C
special InitSecretBaseDecorationSprites
setvar VAR_SECRET_BASE_INITIALIZED, 1
waitstate
end
@ -450,13 +450,13 @@ SecretBase_RedCave1_EventScript_275B81:: @ 8275B81
goto_if_eq SecretBase_RedCave1_EventScript_275BAB
closemessage
playse SE_KAIDAN
special sub_80E9A90
special ClearAndLeaveSecretBase
end
SecretBase_RedCave1_EventScript_275BAB:: @ 8275BAB
closemessage
setflag FLAG_RECEIVED_SECRET_POWER
special sub_80E91F8
special EnterNewlyCreatedSecretBase
waitstate
end
@ -469,18 +469,18 @@ EventScript_275BB7:: @ 8275BB7
lockall
setvar VAR_INIT_SECRET_BASE, 1
playse SE_KAIDAN
special sub_80E9744
special IsCurSecretBaseOwnedByAnotherPlayer
compare VAR_RESULT, 0
goto_if_eq EventScript_275BDB
clearflag FLAG_DECORATION_0
special sub_80E9068
special EnterSecretBase
setvar VAR_SECRET_BASE_INITIALIZED, 0
waitstate
end
EventScript_275BDB:: @ 8275BDB
setflag FLAG_DECORATION_0
special sub_80E9068
special EnterSecretBase
setvar VAR_SECRET_BASE_INITIALIZED, 0
waitstate
end
@ -500,7 +500,7 @@ EventScript_275BE8:: @ 8275BE8
compare VAR_RESULT, 0
goto_if_eq EventScript_275CDE
fadescreenswapbuffers 1
special sub_80E9B70
special MoveOutOfSecretBaseFromOutside
closemessage
fadescreenswapbuffers 0
msgbox Text_276A95, MSGBOX_YESNO
@ -569,7 +569,7 @@ SecretBase_RedCave1_EventScript_275CE1:: @ 8275CE1
EventScript_275D0C:: @ 8275D0C
setvar VAR_0x8004, 0
setvar VAR_0x8005, 0
special sub_80E933C
special InitSecretBaseDecorationSprites
setvar VAR_SECRET_BASE_INITIALIZED, 1
end
@ -626,7 +626,7 @@ SecretBase_YellowCave1_EventScript_275D64:: @ 8275D64
SecretBase_YellowCave2_EventScript_275D64:: @ 8275D64
SecretBase_YellowCave3_EventScript_275D64:: @ 8275D64
SecretBase_YellowCave4_EventScript_275D64:: @ 8275D64
special sub_80EA354
special GetSecretBaseOwnerInteractionState
compare VAR_0x8004, 0
goto_if_eq SecretBase_RedCave1_EventScript_275DD6
compare VAR_0x8004, 1
@ -1010,7 +1010,7 @@ SecretBase_RedCave1_EventScript_27627C:: @ 827627C
end
SecretBase_RedCave1_EventScript_276286:: @ 8276286
special sub_80EA2E4
special PrepSecretBaseBattleFlags
setvar VAR_0x8004, SPECIAL_BATTLE_SECRET_BASE
setvar VAR_0x8005, 0
special DoSpecialTrainerBattle
@ -1039,12 +1039,20 @@ SecretBase_RedCave1_EventScript_2762C5:: @ 82762C5
.include "data/scripts/secret_power_tm.inc"
SecretBase_EventScript_DollInteract:: @ 82766A2
special sub_80EB290
end
SecretBase_EventScript_CushionInteract:: @ 82766A6
special sub_80EB2C8
end
Text_2766AA: @ 82766AA
.string "All decorations and furniture in your\n"
.string "SECRET BASE will be returned to your PC.\p"
.string "Is that okay?$"
Text_276707: @ 8276707
Text_WantToRegisterSecretBase: @ 8276707
.string "Do you want to register\n"
.string "{STR_VAR_1}'s SECRET BASE?$"

View File

@ -103,11 +103,3 @@ Route111_Movement_276696: @ 8276696
walk_down
walk_down
step_end
EventScript_SecretPower1:: @ 82766A2
special sub_80EB290
end
EventScript_SecretPower2:: @ 82766A6
special sub_80EB2C8
end

View File

@ -14,25 +14,25 @@ gSpecials:: @ 81DBA64
def_special sub_80AF9F8
def_special CleanupLinkRoomState
def_special ExitLinkRoom
def_special sub_80E8E18
def_special sub_80E8BC8
def_special sub_80E9068
def_special sub_80E9A90
def_special sub_80E9AC0
def_special sub_80E9744
def_special sub_80E9BDC
def_special sub_80E9C2C
def_special sub_80E9C74
def_special sub_80E9C88
def_special sub_80EA2E4
def_special sub_80EA354
def_special sub_80E933C
def_special SetPlayerSecretBase
def_special CheckPlayerHasSecretBase
def_special EnterSecretBase
def_special ClearAndLeaveSecretBase
def_special MoveOutOfSecretBase
def_special IsCurSecretBaseOwnedByAnotherPlayer
def_special GetCurSecretBaseRegistrationValidity
def_special ToggleCurSecretBaseRegistry
def_special ShowSecretBaseDecorationMenu
def_special ShowSecretBaseRegistryMenu
def_special PrepSecretBaseBattleFlags
def_special GetSecretBaseOwnerInteractionState
def_special InitSecretBaseDecorationSprites
def_special sub_8127E18
def_special sub_81297AC
def_special sub_80E8C98
def_special sub_80E95D4
def_special GetSecretBaseTypeInFrontOfPlayer
def_special SetSecretBaseOwnerGfxId
def_special sub_8129708
def_special sub_80E91F8
def_special EnterNewlyCreatedSecretBase
def_special sub_80EA30C
def_special DoSecretBasePCTurnOffEffect
def_special RecordMixingPlayerSpotTriggered
@ -313,7 +313,7 @@ gSpecials:: @ 81DBA64
def_special sub_80AFC60
def_special PutZigzagoonInPlayerParty
def_special IsStarterInParty
def_special sub_80E980C
def_special CopyCurSecretBaseOwnerName_StrVar1
def_special ScriptCheckFreePokemonStorageSpace
def_special DoSealedChamberShakingEffect1
def_special sub_8139B60
@ -340,7 +340,7 @@ gSpecials:: @ 81DBA64
def_special ScriptGetPartyMonSpecies
def_special sub_81B98DC
def_special nullsub_54
def_special sub_80E9B70
def_special MoveOutOfSecretBaseFromOutside
def_special LoadPlayerBag
def_special sub_80B05B4
def_special SetPacifidlogTMReceivedDay
@ -361,17 +361,17 @@ gSpecials:: @ 81DBA64
def_special sub_80EED10
def_special sub_80EED34
def_special sub_80EB1AC
def_special sub_80EBE7C
def_special SetSecretBaseSecretsTvFlags_SandOrnament
def_special sub_80EB300
def_special sub_80EB438
def_special sub_80EB368
def_special sub_80EB3D0
def_special sub_80EB290
def_special sub_80EB2C8
def_special sub_80EB56C
def_special sub_80EB9E0
def_special sub_80EBB28
def_special sub_80EB498
def_special SetSecretBaseSecretsTvFlags_MiscFurnature
def_special SetSecretBaseSecretsTvFlags_LargeDecorationSpot
def_special SetSecretBaseSecretsTvFlags_SmallDecorationSpot
def_special SetSecretBaseSecretsTvFlags_Poster
def_special sub_818D9C0
def_special sub_818DAEC
def_special sub_818DBE8

View File

@ -223,7 +223,7 @@ struct StatsArray
struct BattleResources
{
struct SecretBaseRecord* secretBase;
struct SecretBase* secretBase;
struct ResourceFlags *flags;
struct BattleScriptsStack* battleScriptsStack;
struct BattleCallbacksStack* battleCallbackStack;

View File

@ -274,6 +274,8 @@
#define TRACKS_FOOT 1
#define TRACKS_BIKE_TIRE 2
#define FIRST_DECORATION_SPRITE_GFX EVENT_OBJ_GFX_PICHU_DOLL
#define EVENT_OBJ_ID_PLAYER 0xFF
#define EVENT_OBJ_ID_CAMERA 0x7F

View File

@ -287,7 +287,7 @@
#define FLAG_RECEIVED_TM41 0x109
#define FLAG_RECEIVED_LAVARIDGE_EGG 0x10A
#define FLAG_RECEIVED_REVIVED_FOSSIL_MON 0x10B
#define FLAG_DECORATION_16 0x10C
#define FLAG_SECRET_BASE_REGISTRY_ENABLED 0x10C
#define FLAG_RECEIVED_TM46 0x10D
#define FLAG_CONTEST_SKETCH_CREATED 0x10E
#define FLAG_EVIL_TEAM_ESCAPED_STERN_SPOKE 0x10F

View File

@ -182,7 +182,7 @@
#define MB_SECRET_BASE_UNUSED 0xB2
#define MB_BLOCK_DECORATION 0xB3
#define MB_SECRET_BASE_DECORATION 0xB4
#define MB_SECRET_BASE_LARGE_MAT_EDGE 0xB5
#define MB_HOLDS_SMALL_DECORATION 0xB5
#define MB_UNUSED_B6 0xB6
#define MB_SECRET_BASE_NORTH_WALL 0xB7
#define MB_SECRET_BASE_BALLOON 0xB8
@ -196,7 +196,7 @@
#define MB_IMPASSABLE_SOUTH_AND_NORTH 0xC0
#define MB_IMPASSABLE_WEST_AND_EAST 0xC1
#define MB_SECRET_BASE_HOLE 0xC2
#define MB_LARGE_MAT_CENTER 0xC3
#define MB_HOLDS_LARGE_DECORATION 0xC3
#define MB_SECRET_BASE_TV_SHIELD 0xC4
#define MB_PLAYER_ROOM_PC_ON 0xC5
#define MB_C6 0xC6

View File

@ -1,8 +1,6 @@
#ifndef GUARD_CONSTANTS_VARS_H
#define GUARD_CONSTANTS_VARS_H
#define UNKNOWN_VAR_OFFSET_3F20 0x3F20
#define VARS_START 0x4000
// temporary vars

View File

@ -9,7 +9,7 @@ enum DecorPerm {
DECORPERM_PASS_FLOOR,
DECORPERM_BEHIND_FLOOR,
DECORPERM_NA_WALL,
DECORPERM_SOLID_MAT
DECORPERM_SPRITE
};
enum DecorShape {
@ -68,7 +68,7 @@ extern EWRAM_DATA u8 gCurDecorationIndex;
void sub_8126968(void);
void sub_8126AD8(u8 taskId);
void sub_8127D38(u16 mapX, u16 mapY, u16 decor);
void ShowDecorationOnMap(u16 mapX, u16 mapY, u16 decor);
void sub_8126B2C(u8 taskId);
void sub_8127208(u8 taskId);
void sub_8127250(u8 *dest, u8 decorCat);

View File

@ -74,10 +74,10 @@ u8 GetFirstInactiveEventObjectId(void);
void RemoveEventObjectByLocalIdAndMap(u8, u8, u8);
void LoadPlayerObjectReflectionPalette(u16, u8);
void LoadSpecialObjectReflectionPalette(u16, u8);
void sub_808EBA8(u8, u8, u8, s16, s16);
void TryMoveEventObjectToMapCoords(u8, u8, u8, s16, s16);
void PatchObjectPalette(u16, u8);
void sub_808E16C(s16, s16);
void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat);
void OverrideSecretBaseDecorationSpriteScript(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat);
void sub_8092FF0(s16, s16, s16 *, s16 *);
u8 GetFaceDirectionAnimNum(u8);
void sub_80930E0(s16 *, s16 *, s16, s16);
@ -86,7 +86,7 @@ void EventObjectClearHeldMovementIfActive(struct EventObject *);
void TrySpawnEventObjects(s16, s16);
u8 sprite_new(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction);
u8 AddPseudoEventObject(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority);
u8 show_sprite(u8, u8, u8);
u8 TrySpawnEventObject(u8, u8, u8);
u8 SpawnSpecialEventObjectParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 z);
u8 SpawnSpecialEventObject(struct EventObjectTemplate *);
void SetSpritePosToMapCoords(s16, s16, s16 *, s16 *);
@ -103,8 +103,8 @@ void sub_808E78C(u8, u8, u8, u8);
void sub_808E75C(s16, s16);
void EventObjectGetLocalIdAndMap(struct EventObject *eventObject, void *localId, void *mapNum, void *mapGroup);
void ShiftEventObjectCoords(struct EventObject *, s16, s16);
void sub_808EB08(struct EventObject *, s16, s16);
void sub_808F254(u8, u8, u8);
void MoveEventObjectToMapCoords(struct EventObject *, s16, s16);
void TryOverrideEventObjectTemplateCoords(u8, u8, u8);
void InitEventObjectPalettes(u8 palSlot);
void UpdateEventObjectCurrentMovement(struct EventObject *, struct Sprite *, bool8(struct EventObject *, struct Sprite *));
u8 EventObjectFaceOppositeDirection(struct EventObject *, u8);

View File

@ -15,8 +15,8 @@ extern const u8 EventScript_TryDoDoubleTrainerBattle[];
extern const u8 EventScript_TryDoNormalTrainerBattle[];
extern const u8 EventScript_TryDoDoubleRematchBattle[];
extern const u8 EventScript_TryDoRematchBattle[];
extern const u8 EventScript_SecretPower1[];
extern const u8 EventScript_SecretPower2[];
extern const u8 SecretBase_EventScript_DollInteract[];
extern const u8 SecretBase_EventScript_CushionInteract[];
extern const u8 gTVBravoTrainerText00[];
@ -528,8 +528,6 @@ extern const u8 EventScript_PlayerPCMale[];
extern const u8 EventScript_PlayerPCFemale[];
extern const u8 EventScript_SecretBasePC[];
extern const u8 EventScript_RecordMixingSecretBasePC[];
extern const u8 EventScript_SecretPower1[];
extern const u8 EventScript_SecretPower2[];
extern const u8 EventScript_PC[];
extern const u8 EventScript_TestSignpostMsg[];
extern const u8 EventScript_HiddenItemScript[];

View File

@ -471,21 +471,21 @@ struct SecretBaseParty
u8 EVs[PARTY_SIZE];
};
struct SecretBaseRecord
struct SecretBase
{
/*0x1A9C*/ u8 secretBaseId;
/*0x1A9D*/ u8 sbr_field_1_0:4;
/*0x1A9D*/ u8 gender:1;
/*0x1A9D*/ u8 sbr_field_1_5:1;
/*0x1A9D*/ u8 sbr_field_1_6:2;
/*0x1A9D*/ u8 battledOwnerToday:1;
/*0x1A9D*/ u8 registryStatus:2;
/*0x1A9E*/ u8 trainerName[PLAYER_NAME_LENGTH];
/*0x1AA5*/ u8 trainerId[4]; // byte 0 is used for determining trainer class
/*0x1AA9*/ u8 language;
/*0x1AAA*/ u16 sbr_field_e;
/*0x1AAC*/ u8 sbr_field_10;
/*0x1AAA*/ u16 numSecretBasesReceived;
/*0x1AAC*/ u8 numTimesEntered;
/*0x1AAD*/ u8 sbr_field_11;
/*0x1AAE*/ u8 decorations[16];
/*0x1ABE*/ u8 decorationPos[16];
/*0x1ABE*/ u8 decorationPositions[16];
/*0x1AD0*/ struct SecretBaseParty party;
};
@ -915,7 +915,7 @@ struct SaveBlock1
/*0x139C*/ u16 vars[VARS_COUNT];
/*0x159C*/ u32 gameStats[NUM_GAME_STATS];
/*0x169C*/ struct BerryTree berryTrees[BERRY_TREES_COUNT];
/*0x1A9C*/ struct SecretBaseRecord secretBases[SECRET_BASES_COUNT];
/*0x1A9C*/ struct SecretBase secretBases[SECRET_BASES_COUNT];
/*0x271C*/ u8 playerRoomDecor[12];
/*0x2728*/ u8 playerRoomDecorPos[12];
/*0x2734*/ u8 decorDesk[10];

View File

@ -59,8 +59,8 @@ bool8 MetatileBehavior_IsSecretBasePoster(u8);
bool8 MetatileBehavior_IsNormal(u8);
bool8 MetatileBehavior_IsSecretBaseNorthWall(u8);
bool8 MetatileBehavior_IsMB_B2_Duplicate(u8);
bool8 MetatileBehavior_IsSecretBaseLargeMatEdge(u8);
bool8 MetatileBehavior_IsLargeMatCenter(u8);
bool8 MetatileBehavior_HoldsSmallDecoration(u8);
bool8 MetatileBehavior_HoldsLargeDecoration(u8);
bool8 MetatileBehavior_IsSecretBaseHole(u8);
bool8 MetatileBehavior_IsSecretBaseBalloon(u8);
bool8 MetatileBehavior_IsSecretBaseBreakableDoor(u8);

View File

@ -509,7 +509,7 @@ u8 GetMonsStateToDoubles(void);
u8 GetMonsStateToDoubles_2(void);
u8 GetAbilityBySpecies(u16 species, bool8 altAbility);
u8 GetMonAbility(struct Pokemon *mon);
void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord);
void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord);
u8 GetSecretBaseTrainerPicIndex(void);
u8 GetSecretBaseTrainerClass(void);
bool8 IsPlayerPartyAndPokemonStorageFull(void);

View File

@ -1,40 +1,30 @@
#ifndef GUARD_SECRET_BASE_H
#define GUARD_SECRET_BASE_H
// Exported type declarations
// Exported RAM declarations
// Exported ROM declarations
void sub_80E9578(void);
void sub_80E980C(void);
void sub_80EB18C(struct SecretBaseRecord *dest);
void sub_80E9914(void);
void HideSecretBaseDecorationSprites(void);
void CopyCurSecretBaseOwnerName_StrVar1(void);
void ClearJapaneseSecretBases(struct SecretBase *dest);
void SetPlayerSecretBaseParty(void);
u8 *GetSecretBaseMapName(u8 *dest);
const u8 *GetSecretBaseTrainerLoseText(void);
void sub_80E8EE0(struct MapEvents const *events);
void sub_80E9238(u8 flagIn);
bool8 CurrentMapIsSecretBase(void);
void SetOccupiedSecretBaseEntranceMetatiles(struct MapEvents const *events);
void InitSecretBaseAppearance(bool8 hidePC);
bool8 CurMapIsSecretBase(void);
void SecretBasePerStepCallback(u8 taskId);
bool8 sub_80E9680(void);
void sub_80EB498(void);
void sub_80EB56C(void);
void sub_80EB9E0(void);
void sub_80EBB28(void);
bool8 TrySetCurSecretBase(void);
void SetSecretBaseSecretsTvFlags_Poster(void);
void SetSecretBaseSecretsTvFlags_MiscFurnature(void);
void SetSecretBaseSecretsTvFlags_LargeDecorationSpot(void);
void SetSecretBaseSecretsTvFlags_SmallDecorationSpot(void);
void WarpIntoSecretBase(const struct MapPosition *position, const struct MapEvents *events);
bool8 sub_80E909C(void);
bool8 SecretBaseMapPopupEnabled(void);
void sub_80EB218(void);
void ResetSecretBases(void);
// SetCurrentSecretBaseFromPosition
void sub_80E9608(const struct MapPosition *position, const struct MapEvents *events);
// SetCurrentSecretBaseVar
void sub_80E8B6C(void);
void sub_80E8BC8(void);
void sub_80E8D4C(void);
void ClearSecretBases(void);
void SetCurSecretBaseIdFromPosition(const struct MapPosition *position, const struct MapEvents *events);
void TrySetCurSecretBaseIndex(void);
void CheckPlayerHasSecretBase(void);
void ToggleSecretBaseEntranceMetatile(void);
void EnableBothScriptContexts(void);
void ReceiveSecretBasesData(void *records, size_t recordSize, u8 linkIdx);
#endif //GUARD_SECRET_BASE_H

View File

@ -132,7 +132,7 @@ extern const u8 gText_ApostropheSBase[];
extern const u8 gText_NoRegistry[];
extern const u8 gText_OkayToDeleteFromRegistry[];
extern const u8 gText_RegisteredDataDeleted[];
extern const u8 gUnknown_085EA79D[];
extern const u8 gText_DelRegist[];
extern const u8 gText_CommErrorEllipsis[];
extern const u8 gText_MoveCloserToLinkPartner[];
extern const u8 gText_CommErrorCheckConnections[];

View File

@ -686,7 +686,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_PICHU_DOLL,
_("PICHU DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -695,7 +695,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_PIKACHU_DOLL,
_("PIKACHU DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -704,7 +704,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_MARILL_DOLL,
_("MARILL DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -713,7 +713,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_TOGEPI_DOLL,
_("TOGEPI DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -722,7 +722,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_CYNDAQUIL_DOLL,
_("CYNDAQUIL DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -731,7 +731,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_CHIKORITA_DOLL,
_("CHIKORITA DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -740,7 +740,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_TOTODILE_DOLL,
_("TOTODILE DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -749,7 +749,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_JIGGLYPUFF_DOLL,
_("JIGGLYPUFF DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -758,7 +758,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_MEOWTH_DOLL,
_("MEOWTH DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -767,7 +767,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_CLEFAIRY_DOLL,
_("CLEFAIRY DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -776,7 +776,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_DITTO_DOLL,
_("DITTO DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -785,7 +785,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_SMOOCHUM_DOLL,
_("SMOOCHUM DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -794,7 +794,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_TREECKO_DOLL,
_("TREECKO DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -803,7 +803,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_TORCHIC_DOLL,
_("TORCHIC DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -812,7 +812,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_MUDKIP_DOLL,
_("MUDKIP DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -821,7 +821,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_DUSKULL_DOLL,
_("DUSKULL DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -830,7 +830,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_WYNAUT_DOLL,
_("WYNAUT DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -839,7 +839,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_BALTOY_DOLL,
_("BALTOY DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -848,7 +848,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_KECLEON_DOLL,
_("KECLEON DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -857,7 +857,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_AZURILL_DOLL,
_("AZURILL DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -866,7 +866,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_SKITTY_DOLL,
_("SKITTY DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -875,7 +875,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_SWABLU_DOLL,
_("SWABLU DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -884,7 +884,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_GULPIN_DOLL,
_("GULPIN DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -893,7 +893,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_LOTAD_DOLL,
_("LOTAD DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -902,7 +902,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_SEEDOT_DOLL,
_("SEEDOT DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_DOLL,
3000,
@ -911,7 +911,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_PIKA_CUSHION,
_("PIKA CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -920,7 +920,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_ROUND_CUSHION,
_("ROUND CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -929,7 +929,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_KISS_CUSHION,
_("KISS CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -938,7 +938,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_ZIGZAG_CUSHION,
_("ZIGZAG CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -947,7 +947,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_SPIN_CUSHION,
_("SPIN CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -956,7 +956,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_DIAMOND_CUSHION,
_("DIAMOND CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -965,7 +965,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_BALL_CUSHION,
_("BALL CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -974,7 +974,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_GRASS_CUSHION,
_("GRASS CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -983,7 +983,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_FIRE_CUSHION,
_("FIRE CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -992,7 +992,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_WATER_CUSHION,
_("WATER CUSHION"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x1,
DECORCAT_CUSHION,
2000,
@ -1001,7 +1001,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_SNORLAX_DOLL,
_("SNORLAX DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1010,7 +1010,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_RHYDON_DOLL,
_("RHYDON DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1019,7 +1019,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_LAPRAS_DOLL,
_("LAPRAS DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1028,7 +1028,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_VENUSAUR_DOLL,
_("VENUSAUR DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1037,7 +1037,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_CHARIZARD_DOLL,
_("CHARIZARD DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1046,7 +1046,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_BLASTOISE_DOLL,
_("BLASTOISE DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1055,7 +1055,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_WAILMER_DOLL,
_("WAILMER DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1064,7 +1064,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_REGIROCK_DOLL,
_("REGIROCK DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1073,7 +1073,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_REGICE_DOLL,
_("REGICE DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,
@ -1082,7 +1082,7 @@ const struct Decoration gDecorations[] = {
}, {
DECOR_REGISTEEL_DOLL,
_("REGISTEEL DOLL"),
DECORPERM_SOLID_MAT,
DECORPERM_SPRITE,
DECORSHAPE_1x2,
DECORCAT_DOLL,
10000,

View File

@ -444,7 +444,7 @@ void sub_8126968(void)
if (gUnknown_0203A17C.isPlayerRoom == FALSE)
{
gUnknown_0203A17C.items = gSaveBlock1Ptr->secretBases[0].decorations;
gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPos;
gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPositions;
}
if (gUnknown_0203A17C.isPlayerRoom == TRUE)
{
@ -507,7 +507,7 @@ void sub_8126AD8(u8 taskId)
{
sub_8126ABC();
gUnknown_0203A17C.items = gSaveBlock1Ptr->secretBases[0].decorations;
gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPos;
gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPositions;
gUnknown_0203A17C.size = sizeof(gSaveBlock1Ptr->secretBases[0].decorations);
gUnknown_0203A17C.isPlayerRoom = FALSE;
gTasks[taskId].func = sub_8126B80;
@ -1165,52 +1165,40 @@ u16 sub_8127B54(u8 decor, u8 a1)
void sub_8127B90(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decor)
{
u16 i;
u16 j;
u16 i, j;
s16 x, y;
u16 behavior;
u16 impassableFlag;
u16 v0;
u16 v1;
s16 decLeft;
s16 decBottom;
u16 posterSide;
u16 elevation;
for (i = 0; i < decHeight; i ++)
for (j = 0; j < decHeight; j++)
{
decBottom = mapY - decHeight + 1 + i;
for (j = 0; j < decWidth; j ++)
y = mapY - decHeight + 1 + j;
for (i = 0; i < decWidth; i++)
{
decLeft = mapX + j;
behavior = GetBehaviorByMetatileId(0x200 + gDecorations[decor].tiles[i * decWidth + j]);
x = mapX + i;
behavior = GetBehaviorByMetatileId(0x200 + gDecorations[decor].tiles[j * decWidth + i]);
if (MetatileBehavior_IsSecretBaseImpassable(behavior) == TRUE || (gDecorations[decor].permission != DECORPERM_PASS_FLOOR && (behavior >> 12)))
{
impassableFlag = METATILE_COLLISION_MASK;
}
else
{
impassableFlag = 0x000;
}
if (gDecorations[decor].permission != DECORPERM_NA_WALL && MetatileBehavior_IsSecretBaseNorthWall(MapGridGetMetatileBehaviorAt(decLeft, decBottom)) == TRUE)
{
v0 = 1;
}
impassableFlag = 0;
if (gDecorations[decor].permission != DECORPERM_NA_WALL && MetatileBehavior_IsSecretBaseNorthWall(MapGridGetMetatileBehaviorAt(x, y)) == TRUE)
posterSide = 1;
else
{
v0 = 0;
}
v1 = sub_8127B54(gDecorations[decor].id, i * decWidth + j);
if (v1 != 0xFFFF)
{
MapGridSetMetatileEntryAt(decLeft, decBottom, (gDecorations[decor].tiles[i * decWidth + j] + (0x200 | v0)) | impassableFlag | v1);
}
posterSide = 0;
elevation = sub_8127B54(gDecorations[decor].id, j * decWidth + i);
if (elevation != 0xFFFF)
MapGridSetMetatileEntryAt(x, y, (gDecorations[decor].tiles[j * decWidth + i] + (0x200 | posterSide)) | impassableFlag | elevation);
else
{
MapGridSetMetatileIdAt(decLeft, decBottom, (gDecorations[decor].tiles[i * decWidth + j] + (0x200 | v0)) | impassableFlag);
}
MapGridSetMetatileIdAt(x, y, (gDecorations[decor].tiles[j * decWidth + i] + (0x200 | posterSide)) | impassableFlag);
}
}
}
void sub_8127D38(u16 mapX, u16 mapY, u16 decor)
void ShowDecorationOnMap(u16 mapX, u16 mapY, u16 decor)
{
switch (gDecorations[decor].shape)
{
@ -1264,13 +1252,15 @@ void sub_8127E18(void)
break;
}
}
VarSet(UNKNOWN_VAR_OFFSET_3F20 + gMapHeader.events->eventObjects[j].graphicsId, sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0]);
VarSet(
VAR_OBJ_GFX_ID_0 + (gMapHeader.events->eventObjects[j].graphicsId - EVENT_OBJ_GFX_VAR_0),
sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0]);
gSpecialVar_0x8005 = gMapHeader.events->eventObjects[j].localId;
gSpecialVar_0x8006 = sCurDecorMapX;
gSpecialVar_0x8007 = sCurDecorMapY;
show_sprite(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
sub_808EBA8(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gSpecialVar_0x8006, gSpecialVar_0x8007);
sub_808F254(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
TrySpawnEventObject(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
TryMoveEventObjectToMapCoords(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gSpecialVar_0x8006, gSpecialVar_0x8007);
TryOverrideEventObjectTemplateCoords(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
break;
}
}
@ -1591,7 +1581,7 @@ bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
}
}
break;
case DECORPERM_SOLID_MAT:
case DECORPERM_SPRITE:
curY = gTasks[taskId].data[1];
for (j=0; j<mapX; j++)
{
@ -1599,14 +1589,14 @@ bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
behaviorAt = MapGridGetMetatileBehaviorAt(curX, curY);
if (decoration->shape == DECORSHAPE_1x2)
{
if (!MetatileBehavior_IsLargeMatCenter(behaviorAt))
if (!MetatileBehavior_HoldsLargeDecoration(behaviorAt))
{
return FALSE;
}
}
else if (!MetatileBehavior_IsSecretBaseLargeMatEdge(behaviorAt))
else if (!MetatileBehavior_HoldsSmallDecoration(behaviorAt))
{
if (!MetatileBehavior_IsLargeMatCenter(behaviorAt))
if (!MetatileBehavior_HoldsLargeDecoration(behaviorAt))
{
return FALSE;
}
@ -1646,9 +1636,9 @@ void sub_81289F0(u8 taskId)
{
ClearDialogWindowAndFrame(0, 0);
sub_8128AAC(taskId);
if (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].permission != DECORPERM_SOLID_MAT)
if (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].permission != DECORPERM_SPRITE)
{
sub_8127D38(gTasks[taskId].data[0], gTasks[taskId].data[1], gCurDecorInventoryItems[gCurDecorationIndex]);
ShowDecorationOnMap(gTasks[taskId].data[0], gTasks[taskId].data[1], gCurDecorInventoryItems[gCurDecorationIndex]);
}
else
{
@ -1750,7 +1740,7 @@ void sub_8128C64(u8 taskId)
switch (data[2])
{
case 0:
sub_80E9578();
HideSecretBaseDecorationSprites();
data[2] ++;
break;
case 1:
@ -2043,7 +2033,7 @@ u8 gpu_pal_decompress_alloc_tag_and_upload(struct PlaceDecorationGraphicsDataBuf
{
sub_8129048(data);
data->decoration = &gDecorations[decor];
if (data->decoration->permission == DECORPERM_SOLID_MAT)
if (data->decoration->permission == DECORPERM_SPRITE)
{
return AddPseudoEventObject(data->decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1);
}
@ -2104,7 +2094,7 @@ u8 AddDecorationIconObjectFromEventObject(u16 tilesTag, u16 paletteTag, u8 decor
sub_8129048(&sPlaceDecorationGraphicsDataBuffer);
sPlaceDecorationGraphicsDataBuffer.decoration = &gDecorations[decor];
if (sPlaceDecorationGraphicsDataBuffer.decoration->permission != DECORPERM_SOLID_MAT)
if (sPlaceDecorationGraphicsDataBuffer.decoration->permission != DECORPERM_SPRITE)
{
sub_81291E8(&sPlaceDecorationGraphicsDataBuffer);
SetDecorSelectionBoxOamAttributes(sPlaceDecorationGraphicsDataBuffer.decoration->shape);
@ -2192,7 +2182,7 @@ void sub_8129708(void)
{
gSpecialVar_Result = 1;
}
else if (gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx]].permission == DECORPERM_SOLID_MAT)
else if (gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx]].permission == DECORPERM_SPRITE)
{
gSpecialVar_0x8005 = sDecorRearrangementDataBuffer[gSpecialVar_0x8004].flagId;
sub_81296EC(sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx);
@ -2235,7 +2225,7 @@ void sub_81297F8(void)
perm = gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[i].idx]].permission;
posX = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[i].idx] >> 4;
posY = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[i].idx] & 0x0F;
if (perm != DECORPERM_SOLID_MAT)
if (perm != DECORPERM_SPRITE)
{
for (y = 0; y < sDecorRearrangementDataBuffer[i].height; y ++)
{
@ -2522,7 +2512,7 @@ bool8 sub_8129FC8(u8 taskId)
{
if (gUnknown_0203A17C.items[i] != 0)
{
if (gDecorations[gUnknown_0203A17C.items[i]].permission == DECORPERM_SOLID_MAT)
if (gDecorations[gUnknown_0203A17C.items[i]].permission == DECORPERM_SPRITE)
{
sub_8129D8C(gUnknown_0203A17C.items[i], sDecorRearrangementDataBuffer);
if (sub_8129E74(taskId, i, sDecorRearrangementDataBuffer) == TRUE)
@ -2550,7 +2540,7 @@ void sub_812A040(u8 left, u8 top, u8 right, u8 bottom)
decorIdx = gUnknown_0203A17C.items[i];
xOff = gUnknown_0203A17C.pos[i] >> 4;
yOff = gUnknown_0203A17C.pos[i] & 0x0F;
if (decorIdx != 0 && gDecorations[decorIdx].permission == DECORPERM_SOLID_MAT && left <= xOff && top <= yOff && right >= xOff && bottom >= yOff)
if (decorIdx != 0 && gDecorations[decorIdx].permission == DECORPERM_SPRITE && left <= xOff && top <= yOff && right >= xOff && bottom >= yOff)
{
sDecorRearrangementDataBuffer[sCurDecorSelectedInRearrangement].idx = i;
sub_8129F20();
@ -2656,7 +2646,7 @@ void sub_812A2C4(u8 taskId)
switch (data[2])
{
case 0:
sub_80E9578();
HideSecretBaseDecorationSprites();
data[2] ++;
break;
case 1:

View File

@ -1534,10 +1534,10 @@ static u8 TrySetupEventObjectSprite(struct EventObjectTemplate *eventObjectTempl
paletteSlot -= 16;
sub_808EAB0(graphicsInfo->paletteTag1, paletteSlot);
}
if (eventObject->movementType == MOVEMENT_TYPE_INVISIBLE)
{
eventObject->invisible = TRUE;
}
*(u16 *)&spriteTemplate->paletteTag = 0xFFFF;
spriteId = CreateSprite(spriteTemplate, 0, 0, 0);
if (spriteId == MAX_SPRITES)
@ -1545,6 +1545,7 @@ static u8 TrySetupEventObjectSprite(struct EventObjectTemplate *eventObjectTempl
gEventObjects[eventObjectId].active = FALSE;
return EVENT_OBJECTS_COUNT;
}
sprite = &gSprites[spriteId];
sub_8092FF0(eventObject->currentCoords.x + cameraX, eventObject->currentCoords.y + cameraY, &sprite->pos1.x, &sprite->pos1.y);
sprite->centerToCornerVecX = -(graphicsInfo->width >> 1);
@ -1557,15 +1558,14 @@ static u8 TrySetupEventObjectSprite(struct EventObjectTemplate *eventObjectTempl
eventObject->spriteId = spriteId;
eventObject->inanimate = graphicsInfo->inanimate;
if (!eventObject->inanimate)
{
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(eventObject->facingDirection));
}
SetObjectSubpriorityByZCoord(eventObject->previousElevation, sprite, 1);
UpdateEventObjectVisibility(eventObject, sprite);
return eventObjectId;
}
static u8 TrySpawnEventObject(struct EventObjectTemplate *eventObjectTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY)
static u8 TrySpawnEventObjectTemplate(struct EventObjectTemplate *eventObjectTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY)
{
u8 eventObjectId;
struct SpriteTemplate spriteTemplate;
@ -1579,14 +1579,12 @@ static u8 TrySpawnEventObject(struct EventObjectTemplate *eventObjectTemplate, u
spriteTemplate.images = &spriteFrameImage;
eventObjectId = TrySetupEventObjectSprite(eventObjectTemplate, &spriteTemplate, mapNum, mapGroup, cameraX, cameraY);
if (eventObjectId == EVENT_OBJECTS_COUNT)
{
return EVENT_OBJECTS_COUNT;
}
gSprites[gEventObjects[eventObjectId].spriteId].images = graphicsInfo->images;
if (subspriteTables != NULL)
{
if (subspriteTables)
SetSubspriteTables(&gSprites[gEventObjects[eventObjectId].spriteId], subspriteTables);
}
return eventObjectId;
}
@ -1596,7 +1594,7 @@ u8 SpawnSpecialEventObject(struct EventObjectTemplate *eventObjectTemplate)
s16 cameraY;
GetEventObjectMovingCameraOffset(&cameraX, &cameraY);
return TrySpawnEventObject(eventObjectTemplate, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
return TrySpawnEventObjectTemplate(eventObjectTemplate, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
}
u8 SpawnSpecialEventObjectParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 z)
@ -1619,19 +1617,17 @@ u8 SpawnSpecialEventObjectParameterized(u8 graphicsId, u8 movementBehavior, u8 l
return SpawnSpecialEventObject(&eventObjectTemplate);
}
u8 show_sprite(u8 localId, u8 mapNum, u8 mapGroup)
u8 TrySpawnEventObject(u8 localId, u8 mapNum, u8 mapGroup)
{
struct EventObjectTemplate *eventObjectTemplate;
s16 cameraX;
s16 cameraY;
s16 cameraX, cameraY;
eventObjectTemplate = GetEventObjectTemplateByLocalIdAndMap(localId, mapNum, mapGroup);
if (eventObjectTemplate == NULL)
{
if (!eventObjectTemplate)
return EVENT_OBJECTS_COUNT;
}
GetEventObjectMovingCameraOffset(&cameraX, &cameraY);
return TrySpawnEventObject(eventObjectTemplate, mapNum, mapGroup, cameraX, cameraY);
return TrySpawnEventObjectTemplate(eventObjectTemplate, mapNum, mapGroup, cameraX, cameraY);
}
static void MakeObjectTemplateFromEventObjectGraphicsInfo(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables)
@ -1765,7 +1761,7 @@ void TrySpawnEventObjects(s16 cameraX, s16 cameraY)
if (top <= npcY && bottom >= npcY && left <= npcX && right >= npcX
&& !FlagGet(template->flagId))
TrySpawnEventObject(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
TrySpawnEventObjectTemplate(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
}
}
}
@ -2245,7 +2241,7 @@ static void SetEventObjectCoords(struct EventObject *eventObject, s16 x, s16 y)
eventObject->currentCoords.y = y;
}
void sub_808EB08(struct EventObject *eventObject, s16 x, s16 y)
void MoveEventObjectToMapCoords(struct EventObject *eventObject, s16 x, s16 y)
{
struct Sprite *sprite;
const struct EventObjectGraphicsInfo *graphicsInfo;
@ -2260,20 +2256,17 @@ void sub_808EB08(struct EventObject *eventObject, s16 x, s16 y)
sprite->pos1.y += 16 + sprite->centerToCornerVecY;
sub_808E38C(eventObject);
if (eventObject->trackedByCamera)
{
CameraObjectReset1();
}
}
void sub_808EBA8(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y)
void TryMoveEventObjectToMapCoords(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y)
{
u8 eventObjectId;
if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId))
{
x += 7;
y += 7;
sub_808EB08(&gEventObjects[eventObjectId], x, y);
MoveEventObjectToMapCoords(&gEventObjects[eventObjectId], x, y);
}
}
@ -2604,15 +2597,13 @@ void OverrideTemplateCoordsForEventObject(const struct EventObject *eventObject)
}
}
void OverrideMovementTypeForEventObject(const struct EventObject *eventObject, const u8 *script)
static void OverrideEventObjectTemplateScript(const struct EventObject *eventObject, const u8 *script)
{
struct EventObjectTemplate *eventObjectTemplate;
eventObjectTemplate = GetBaseTemplateForEventObject(eventObject);
if (eventObjectTemplate != NULL)
{
if (eventObjectTemplate)
eventObjectTemplate->script = script;
}
}
void TryOverrideTemplateCoordsForEventObject(const struct EventObject *eventObject, u8 movementType)
@ -2626,30 +2617,26 @@ void TryOverrideTemplateCoordsForEventObject(const struct EventObject *eventObje
}
}
void sub_808F254(u8 localId, u8 mapNum, u8 mapGroup)
void TryOverrideEventObjectTemplateCoords(u8 localId, u8 mapNum, u8 mapGroup)
{
u8 eventObjectId;
if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId))
{
OverrideTemplateCoordsForEventObject(&gEventObjects[eventObjectId]);
}
}
void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat)
void OverrideSecretBaseDecorationSpriteScript(u8 localId, u8 mapNum, u8 mapGroup, u8 decorationCategory)
{
u8 eventObjectId;
if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId))
{
switch (decorCat)
switch (decorationCategory)
{
case DECORCAT_DOLL:
OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_SecretPower1);
break;
case DECORCAT_CUSHION:
OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_SecretPower2);
break;
case DECORCAT_DOLL:
OverrideEventObjectTemplateScript(&gEventObjects[eventObjectId], SecretBase_EventScript_DollInteract);
break;
case DECORCAT_CUSHION:
OverrideEventObjectTemplateScript(&gEventObjects[eventObjectId], SecretBase_EventScript_CushionInteract);
break;
}
}
}

View File

@ -16,6 +16,7 @@
#include "fldeff_misc.h"
#include "item_menu.h"
#include "link.h"
#include "match_call.h"
#include "metatile_behavior.h"
#include "overworld.h"
#include "pokemon.h"
@ -32,7 +33,6 @@
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/songs.h"
#include "match_call.h"
static EWRAM_DATA u8 sWildEncounterImmunitySteps = 0;
static EWRAM_DATA u16 sPreviousPlayerMetatileBehavior = 0;
@ -227,8 +227,8 @@ static bool8 TryStartInteractionScript(struct MapPosition *position, u16 metatil
&& script != EventScript_PlayerPCFemale
&& script != EventScript_SecretBasePC
&& script != EventScript_RecordMixingSecretBasePC
&& script != EventScript_SecretPower1
&& script != EventScript_SecretPower2
&& script != SecretBase_EventScript_DollInteract
&& script != SecretBase_EventScript_CushionInteract
&& script != EventScript_PC)
PlaySE(SE_SELECT);
@ -354,7 +354,7 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position
if (direction == DIR_NORTH)
{
gSpecialVar_0x8004 = bgEvent->bgUnion.secretBaseId;
if (sub_80E9680())
if (TrySetCurSecretBase())
return EventScript_2759F1;
}
return NULL;
@ -421,23 +421,23 @@ static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 me
return EventScript_SecretBaseShieldOrToyTV;
if (MetatileBehavior_IsMB_C6(metatileBehavior) == TRUE)
{
sub_80EB56C();
SetSecretBaseSecretsTvFlags_MiscFurnature();
return NULL;
}
if (MetatileBehavior_IsLargeMatCenter(metatileBehavior) == TRUE)
if (MetatileBehavior_HoldsLargeDecoration(metatileBehavior) == TRUE)
{
sub_80EB9E0();
SetSecretBaseSecretsTvFlags_LargeDecorationSpot();
return NULL;
}
if (MetatileBehavior_IsSecretBaseLargeMatEdge(metatileBehavior) == TRUE)
if (MetatileBehavior_HoldsSmallDecoration(metatileBehavior) == TRUE)
{
sub_80EBB28();
SetSecretBaseSecretsTvFlags_SmallDecorationSpot();
return NULL;
}
}
else if (MetatileBehavior_IsSecretBasePoster(metatileBehavior) == TRUE)
{
sub_80EB498();
SetSecretBaseSecretsTvFlags_Poster();
return NULL;
}

View File

@ -3485,7 +3485,7 @@ static void sub_80B9978(struct Task *task)
eventObject = &gEventObjects[gPlayerAvatar.eventObjectId];
sprite = &gSprites[eventObject->spriteId];
eventObject->inanimate = 0;
sub_808EB08(eventObject, eventObject->currentCoords.x, eventObject->currentCoords.y);
MoveEventObjectToMapCoords(eventObject, eventObject->currentCoords.x, eventObject->currentCoords.y);
sprite->pos2.x = 0;
sprite->pos2.y = 0;
sprite->coordOffsetEnabled = 1;

View File

@ -1188,9 +1188,9 @@ u8 PlayerGetZCoord(void)
return gEventObjects[gPlayerAvatar.eventObjectId].previousElevation;
}
void sub_808BC90(s16 a, s16 b)
void sub_808BC90(s16 x, s16 y)
{
sub_808EB08(&gEventObjects[gPlayerAvatar.eventObjectId], a, b);
MoveEventObjectToMapCoords(&gEventObjects[gPlayerAvatar.eventObjectId], x, y);
}
u8 TestPlayerAvatarFlags(u8 a)

View File

@ -52,15 +52,15 @@ struct MapHeader const *const mapconnection_get_mapheader(struct MapConnection *
void InitMap(void)
{
InitMapLayoutData(&gMapHeader);
sub_80E8EE0(gMapHeader.events);
SetOccupiedSecretBaseEntranceMetatiles(gMapHeader.events);
RunOnLoadMapScript();
}
void InitMapFromSavedGame(void)
{
InitMapLayoutData(&gMapHeader);
sub_80E9238(0);
sub_80E8EE0(gMapHeader.events);
InitSecretBaseAppearance(FALSE);
SetOccupiedSecretBaseEntranceMetatiles(gMapHeader.events);
LoadSavedMapView();
RunOnLoadMapScript();
UpdateTVScreensOnMap(gBackupMapLayout.width, gBackupMapLayout.height);

View File

@ -488,8 +488,8 @@ static void sub_80F9DFC(u8 taskId)
static void SetCurrentSecretBase(void)
{
sub_80E9608(&gPlayerFacingPosition, gMapHeader.events);
sub_80E8B6C();
SetCurSecretBaseIdFromPosition(&gPlayerFacingPosition, gMapHeader.events);
TrySetCurSecretBaseIndex();
}
static void AdjustSecretPowerSpritePixelOffsets(void)
@ -544,7 +544,7 @@ bool8 SetUpFieldMove_SecretPower(void)
{
u8 mb;
sub_80E8BC8();
CheckPlayerHasSecretBase();
if (gSpecialVar_Result == 1 || GetPlayerFacingDirection() != DIR_NORTH)
return FALSE;
@ -623,10 +623,8 @@ static void CaveEntranceSpriteCallback2(struct Sprite *sprite)
{
if (sprite->data[0] < 40)
{
sprite->data[0]++;
if (sprite->data[0] == 20)
sub_80E8D4C();
if (++sprite->data[0] == 20)
ToggleSecretBaseEntranceMetatile();
}
else
{
@ -681,7 +679,7 @@ bool8 FldEff_SecretPowerTree(void)
148);
if (gFieldEffectArguments[7] == 1 || gFieldEffectArguments[7] == 3)
sub_80E8D4C();
ToggleSecretBaseEntranceMetatile();
return FALSE;
}
@ -702,7 +700,7 @@ static void TreeEntranceSpriteCallback2(struct Sprite *sprite)
if (sprite->data[0] >= 40)
{
if (gFieldEffectArguments[7] == 0 || gFieldEffectArguments[7] == 2)
sub_80E8D4C();
ToggleSecretBaseEntranceMetatile();
sprite->data[0] = 0;
sprite->callback = TreeEntranceSpriteCallbackEnd;
@ -764,7 +762,7 @@ static void ShrubEntranceSpriteCallback2(struct Sprite *sprite)
sprite->data[0]++;
if (sprite->data[0] == 20)
sub_80E8D4C();
ToggleSecretBaseEntranceMetatile();
}
else
{
@ -1168,7 +1166,7 @@ void GetShieldToyTVDecorationInfo(void)
bool8 sub_80FADE4(u16 metatileId, u8 arg1)
{
if (!CurrentMapIsSecretBase())
if (!CurMapIsSecretBase())
return FALSE;
if (!arg1)

View File

@ -537,7 +537,7 @@ bool8 RemoveBagItem(u16 itemId, u16 count)
if (totalQuantity < count)
return FALSE; // We don't have enough of the item
if (CurrentMapIsSecretBase() == TRUE)
if (CurMapIsSecretBase() == TRUE)
{
VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | 0x200);
VarSet(VAR_SECRET_BASE_LAST_ITEM_USED, itemId);

View File

@ -191,7 +191,7 @@ static const u8 sTileBitAttributes[] =
[MB_SECRET_BASE_UNUSED] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BLOCK_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_DECORATION] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_LARGE_MAT_EDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_HOLDS_SMALL_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_B6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_NORTH_WALL] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_BALLOON] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
@ -205,7 +205,7 @@ static const u8 sTileBitAttributes[] =
[MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_WEST_AND_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_HOLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_LARGE_MAT_CENTER] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_HOLDS_LARGE_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_TV_SHIELD] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PLAYER_ROOM_PC_ON] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_C6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
@ -751,17 +751,17 @@ bool8 Unref_MetatileBehavior_IsSecretBaseUnused_B2_2(u8 metatileBehavior)
return FALSE;
}
bool8 MetatileBehavior_IsSecretBaseLargeMatEdge(u8 metatileBehavior)
bool8 MetatileBehavior_HoldsSmallDecoration(u8 metatileBehavior)
{
if (metatileBehavior == MB_SECRET_BASE_LARGE_MAT_EDGE)
if (metatileBehavior == MB_HOLDS_SMALL_DECORATION)
return TRUE;
else
return FALSE;
}
bool8 MetatileBehavior_IsLargeMatCenter(u8 metatileBehavior)
bool8 MetatileBehavior_HoldsLargeDecoration(u8 metatileBehavior)
{
if (metatileBehavior == MB_LARGE_MAT_CENTER)
if (metatileBehavior == MB_HOLDS_LARGE_DECORATION)
return TRUE;
else
return FALSE;

View File

@ -170,7 +170,7 @@ void NewGameInitData(void)
InitEventData();
ClearTVShowData();
ResetGabbyAndTy();
ResetSecretBases();
ClearSecretBases();
ClearBerryTrees();
SetMoney(&gSaveBlock1Ptr->money, 3000);
SetCoins(0);

View File

@ -889,7 +889,7 @@ static void mli0_load_map(u32 a1)
if (a1 != 1 && isIndoors)
{
UpdateTVScreensOnMap(gBackupMapLayout.width, gBackupMapLayout.height);
sub_80E9238(1);
InitSecretBaseAppearance(TRUE);
}
}
@ -1508,7 +1508,7 @@ void SetUnusedCallback(void *func)
static bool8 map_post_load_hook_exec(void)
{
if (gFieldCallback2 != NULL)
if (gFieldCallback2)
{
if (!gFieldCallback2())
{
@ -1522,7 +1522,7 @@ static bool8 map_post_load_hook_exec(void)
}
else
{
if (gFieldCallback != NULL)
if (gFieldCallback)
gFieldCallback();
else
mapldr_default();
@ -1701,7 +1701,7 @@ void sub_80861E8(void)
static void sub_8086204(void)
{
if ((gMapHeader.flags & 0xF8) == 8 && sub_80E909C() == TRUE)
if ((gMapHeader.flags & 0xF8) == 8 && SecretBaseMapPopupEnabled() == TRUE)
ShowMapNamePopup();
sub_80AF3C8();
}
@ -1947,7 +1947,7 @@ static bool32 load_map_stuff(u8 *state, u32 a2)
(*state)++;
break;
case 11:
if ((gMapHeader.flags & 0xF8) == 8 && sub_80E909C() == 1)
if ((gMapHeader.flags & 0xF8) == 8 && SecretBaseMapPopupEnabled() == TRUE)
ShowMapNamePopup();
(*state)++;
break;

View File

@ -4444,7 +4444,7 @@ u8 GetMonAbility(struct Pokemon *mon)
return GetAbilityBySpecies(species, altAbility);
}
void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord)
void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord)
{
s32 i, j;

View File

@ -47,7 +47,7 @@ struct RecordMixingHallRecords
struct PlayerRecordsRS
{
struct SecretBaseRecord secretBases[SECRET_BASES_COUNT];
struct SecretBase secretBases[SECRET_BASES_COUNT];
TVShow tvShows[TV_SHOWS_COUNT];
PokeNews pokeNews[POKE_NEWS_COUNT];
OldMan oldMan;
@ -60,7 +60,7 @@ struct PlayerRecordsRS
struct PlayerRecordsEmerald
{
/* 0x0000 */ struct SecretBaseRecord secretBases[SECRET_BASES_COUNT];
/* 0x0000 */ struct SecretBase secretBases[SECRET_BASES_COUNT];
/* 0x0c80 */ TVShow tvShows[TV_SHOWS_COUNT];
/* 0x1004 */ PokeNews pokeNews[POKE_NEWS_COUNT];
/* 0x1044 */ OldMan oldMan;
@ -83,7 +83,7 @@ union PlayerRecords
// Static RAM declarations
static IWRAM_DATA bool8 gUnknown_03001130;
static IWRAM_DATA struct SecretBaseRecord *sSecretBasesSave;
static IWRAM_DATA struct SecretBase *sSecretBasesSave;
static IWRAM_DATA TVShow *sTvShowsSave;
static IWRAM_DATA PokeNews *sPokeNewsSave;
static IWRAM_DATA OldMan *sOldManSave;
@ -208,7 +208,7 @@ static void PrepareUnknownExchangePacket(struct PlayerRecordsRS *dest)
static void PrepareExchangePacketForRubySapphire(struct PlayerRecordsRS *dest)
{
memcpy(dest->secretBases, sSecretBasesSave, sizeof(dest->secretBases));
sub_80EB18C(dest->secretBases);
ClearJapaneseSecretBases(dest->secretBases);
memcpy(dest->tvShows, sTvShowsSave, sizeof(dest->tvShows));
sub_80F1208(dest->tvShows);
memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews));
@ -226,7 +226,7 @@ static void PrepareExchangePacketForRubySapphire(struct PlayerRecordsRS *dest)
static void PrepareExchangePacket(void)
{
sub_80E9914();
SetPlayerSecretBaseParty();
sub_80F0BB8();
SetSrcLookupPointers();

View File

@ -1068,7 +1068,7 @@ bool8 ScrCmd_addobject(struct ScriptContext *ctx)
{
u16 objectId = VarGet(ScriptReadHalfword(ctx));
show_sprite(objectId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
TrySpawnEventObject(objectId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
return FALSE;
}
@ -1078,7 +1078,7 @@ bool8 ScrCmd_addobject_at(struct ScriptContext *ctx)
u8 mapGroup = ScriptReadByte(ctx);
u8 mapNum = ScriptReadByte(ctx);
show_sprite(objectId, mapNum, mapGroup);
TrySpawnEventObject(objectId, mapNum, mapGroup);
return FALSE;
}
@ -1088,7 +1088,7 @@ bool8 ScrCmd_setobjectxy(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
sub_808EBA8(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, x, y);
TryMoveEventObjectToMapCoords(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, x, y);
return FALSE;
}
@ -1106,7 +1106,7 @@ bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext *ctx)
{
u16 localId = VarGet(ScriptReadHalfword(ctx));
sub_808F254(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
TryOverrideEventObjectTemplateCoords(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
return FALSE;
}

File diff suppressed because it is too large Load Diff

View File

@ -529,7 +529,7 @@ const u8 gText_ApostropheSBase[] = _("'s BASE");
const u8 gText_OkayToDeleteFromRegistry[] = _("Is it okay to delete {STR_VAR_1}\nfrom the REGISTRY?");
const u8 gText_RegisteredDataDeleted[] = _("The registered data was deleted.{PAUSE_UNTIL_PRESS}");
const u8 gText_NoRegistry[] = _("There is no REGISTRY.{PAUSE_UNTIL_PRESS}");
const u8 gUnknown_085EA79D[] = _("DEL REGIST.");
const u8 gText_DelRegist[] = _("DEL REGIST.");
const u8 gUnknown_085EA7A9[] = _("{STR_VAR_3}{STR_VAR_1}/{STR_VAR_2}");
const u8 gText_Decorate[] = _("DECORATE");
const u8 gText_PutAway[] = _("PUT AWAY");

View File

@ -2567,7 +2567,7 @@ void sub_80EEA70(void)
show->secretBaseSecrets.active = FALSE;
StringCopy(show->secretBaseSecrets.playerName, gSaveBlock2Ptr->playerName);
show->secretBaseSecrets.stepsInBase = VarGet(VAR_SECRET_BASE_STEP_COUNTER);
sub_80E980C();
CopyCurSecretBaseOwnerName_StrVar1();
StringCopy(strbuf, gStringVar1);
StripExtCtrlCodes(strbuf);
StringCopy(show->secretBaseSecrets.baseOwnersName, strbuf);
@ -7366,7 +7366,7 @@ u8 TVShowGetFlagCount(TVShow *show)
return tot;
}
u8 TVShowGetStateForFlagNumber(TVShow *show, u8 a1)
static u8 SecretBaseSecrets_GetStateForFlagNumber(TVShow *show, u8 a1)
{
u8 i;
u8 tot;
@ -7409,7 +7409,7 @@ static void DoTVShowSecretBaseSecrets(void)
{
show->secretBaseSecrets.savedState = 1;
sTVSecretBaseSecretsRandomValues[0] = Random() % bitCount;
sTVShowState = TVShowGetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[0]);
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[0]);
}
break;
case 1:
@ -7424,11 +7424,11 @@ static void DoTVShowSecretBaseSecrets(void)
show->secretBaseSecrets.savedState = 2;
if (sTVSecretBaseSecretsRandomValues[0] == 0)
{
sTVShowState = TVShowGetStateForFlagNumber(show, 1);
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, 1);
}
else
{
sTVShowState = TVShowGetStateForFlagNumber(show, 0);
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, 0);
}
break;
default:
@ -7441,7 +7441,7 @@ static void DoTVShowSecretBaseSecrets(void)
}
}
show->secretBaseSecrets.savedState = 2;
sTVShowState = TVShowGetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[1]);
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[1]);
break;
}
break;
@ -7463,7 +7463,7 @@ static void DoTVShowSecretBaseSecrets(void)
}
}
show->secretBaseSecrets.savedState = 3;
sTVShowState = TVShowGetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[2]);
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[2]);
}
break;
case 3:

View File

@ -125,7 +125,7 @@ static void SetUnionRoomPlayerGfx(u32 playerIdx, u32 gfxId)
static void CreateUnionRoomPlayerEventObject(u32 playerIdx)
{
show_sprite(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
TrySpawnEventObject(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
}
static void RemoveUnionRoomPlayerEventObject(u32 playerIdx)