Documented mining museum scripts and messages (#773)

This commit is contained in:
Nathan 2025-09-20 18:26:46 -05:00 committed by GitHub
parent 932714728e
commit 43d0daca1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 293 additions and 289 deletions

View File

@ -2810,30 +2810,30 @@
.short \slot
.endm
.macro ScrCmd_1F1 arg0
.macro GetFossilCount destVar
.short 497
.short \arg0
.short \destVar
.endm
.macro ScrCmd_1F2
.macro ScrCmd_Dummy_1F2
.short 498
.endm
.macro ScrCmd_1F3
.macro ScrCmd_Dummy_1F3
.short 499
.endm
.macro ScrCmd_1F4 arg0, arg1
.macro GetSpeciesFromFossil speciesVar, itemVar
.short 500
.short \arg0
.short \arg1
.short \speciesVar
.short \itemVar
.endm
.macro ScrCmd_1F5 arg0, arg1, arg2
.macro FindFossilAtThreshold itemVar, thresholdVar, thresholdValue
.short 501
.short \arg0
.short \arg1
.short \arg2
.short \itemVar
.short \thresholdVar
.short \thresholdValue
.endm
.macro CountPartyMonsBelowLevelThreshold destVar, threshold

View File

@ -47,7 +47,7 @@ RECORD_UNK_045
RECORD_UNK_046
RECORD_SPHERES_BURIED
RECORD_UNK_048
RECORD_UNK_049
RECORD_POKEMON_NICKNAMED
RECORD_UNK_050
RECORD_UNK_051
RECORD_UNK_052
@ -113,7 +113,7 @@ RECORD_UNK_111
RECORD_UNK_112
RECORD_UNK_113
RECORD_UNK_114
RECORD_UNK_115
RECORD_POKEMON_RECEIVED_FROM_FOSSIL_REVIVAL
RECORD_CHECKED_FOOTPRINTS
RECORD_UNK_117
RECORD_UNK_118

View File

@ -119,7 +119,7 @@ FLAG_UNK_0x0075
FLAG_UNK_0x0076
FLAG_UNK_0x0077
FLAG_UNK_0x0078
FLAG_UNK_0x0079
FLAG_EXPLORER_KIT_RECEIVED
FLAG_UNK_0x007A
FLAG_UNK_0x007B
FLAG_UNK_0x007C
@ -4278,7 +4278,7 @@ VAR_UNK_0x40B0
VAR_UNK_0x40B1
VAR_UNK_0x40B2
VAR_UNK_0x40B3
VAR_UNK_0x40B4
VAR_REVIVED_POKEMON_SPECIES
VAR_UNK_0x40B5
VAR_UNK_0x40B6
VAR_UNK_0x40B7

12
include/scrcmd_fossil.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef POKEPLATINUM_SCRCMD_FOSSIL_H
#define POKEPLATINUM_SCRCMD_FOSSIL_H
#include "field_script_context.h"
BOOL ScrCmd_GetFossilCount(ScriptContext *ctx);
BOOL ScrCmd_GetSpeciesFromFossil(ScriptContext *ctx);
BOOL ScrCmd_FindFossilAtThreshold(ScriptContext *ctx);
BOOL ScrCmd_Dummy_1F2(ScriptContext *ctx);
BOOL ScrCmd_Dummy_1F3(ScriptContext *ctx);
#endif // POKEPLATINUM_SCRCMD_FOSSIL_H

View File

@ -1,12 +0,0 @@
#ifndef POKEPLATINUM_UNK_0204E240_H
#define POKEPLATINUM_UNK_0204E240_H
#include "field_script_context.h"
BOOL ScrCmd_1F1(ScriptContext *param0);
BOOL ScrCmd_1F4(ScriptContext *param0);
BOOL ScrCmd_1F5(ScriptContext *param0);
BOOL ScrCmd_1F2(ScriptContext *param0);
BOOL ScrCmd_1F3(ScriptContext *param0);
#endif // POKEPLATINUM_UNK_0204E240_H

View File

@ -203,7 +203,7 @@ Static main
Object main.nef.p/src_scrcmd_daycare.c.o
Object main.nef.p/src_scrcmd_amity_square.c.o
Object main.nef.p/src_scrcmd_party.c.o
Object main.nef.p/src_unk_0204E240.c.o
Object main.nef.p/src_scrcmd_fossil.c.o
Object main.nef.p/src_scrcmd_game_corner_prize.c.o
Object main.nef.p/src_scrcmd_system_flags.c.o
Object main.nef.p/src_scrcmd_item.c.o

View File

@ -439,7 +439,7 @@ _056E:
End
_057F:
GoToIfSet FLAG_UNK_0x0079, _059D
GoToIfSet FLAG_EXPLORER_KIT_RECEIVED, _059D
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer

View File

@ -75,7 +75,7 @@ _00D9:
WaitFadeScreen
GoToIfEq VAR_RESULT, 1, _0129
ScrCmd_2B8 VAR_0x8005
IncrementGameRecord RECORD_UNK_049
IncrementGameRecord RECORD_POKEMON_NICKNAMED
BufferPartyMonNickname 0, VAR_0x8005
Message 4
WaitABXPadPress

View File

@ -16,12 +16,12 @@ _001A:
FacePlayer
GoToIfGe VAR_UNK_0x40B6, 9, _00B2
GoToIfSet FLAG_UNK_0x0113, _0164
GoToIfSet FLAG_UNK_0x0079, _007E
GoToIfSet FLAG_EXPLORER_KIT_RECEIVED, _007E
Message 0
SetVar VAR_0x8004, ITEM_EXPLORER_KIT
SetVar VAR_0x8005, 1
CallCommonScript 0x7FC
SetFlag FLAG_UNK_0x0079
SetFlag FLAG_EXPLORER_KIT_RECEIVED
ClearFlag FLAG_UNK_0x0111
Message 1
ShowYesNoMenu VAR_RESULT

View File

@ -57,7 +57,7 @@ _00A8:
End
_00E3:
IncrementGameRecord RECORD_UNK_049
IncrementGameRecord RECORD_POKEMON_NICKNAMED
Return
_00E9:

View File

@ -2,48 +2,48 @@
#include "res/text/bank/mining_museum.h"
ScriptEntry _0042
ScriptEntry _0055
ScriptEntry _04C1
ScriptEntry _04D4
ScriptEntry _04E7
ScriptEntry _04FA
ScriptEntry _050B
ScriptEntry _051C
ScriptEntry _052D
ScriptEntry _053E
ScriptEntry _054F
ScriptEntry _0560
ScriptEntry _0571
ScriptEntry _0582
ScriptEntry _0595
ScriptEntry _05A8
ScriptEntry MiningMuseum_Welcome
ScriptEntry MiningMuseum_FossilResearcher
ScriptEntry MiningMuseum_CoalExhibit1
ScriptEntry MiningMuseum_CoalExhibit2
ScriptEntry MiningMuseum_MineUnderSea
ScriptEntry MiningMuseum_HowCoalIsMade1
ScriptEntry MiningMuseum_HowCoalIsMade2
ScriptEntry MiningMuseum_HowCoalIsMade3
ScriptEntry MiningMuseum_CoalSamplesDisplay
ScriptEntry MiningMuseum_CoalSamplesBox
ScriptEntry MiningMuseum_MiningLamps
ScriptEntry MiningMuseum_MiningTools
ScriptEntry MiningMuseum_MineWorkerItems
ScriptEntry MiningMuseum_UndergroundManInfo
ScriptEntry MiningMuseum_MiningRequiresStrongMind
ScriptEntry MiningMuseum_MineHistory
ScriptEntryEnd
_0042:
MiningMuseum_Welcome:
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer
Message 0
Message MiningMuseum_Text_Welcome
WaitABXPadPress
CloseMessage
ReleaseAll
End
_0055:
MiningMuseum_FossilResearcher:
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer
GoToIfSet FLAG_UNK_0x0001, _03D8
Message 1
GoToIfUnset FLAG_UNK_0x0079, _04B6
GoToIfNe VAR_UNK_0x40B4, 0, _03F2
ScrCmd_1F1 VAR_0x8000
GoToIfEq VAR_0x8000, 0, _04AB
Message 2
GoToIfSet FLAG_UNK_0x0001, MiningMuseum_ExtractingPokemon
Message MiningMuseum_Text_FossilResearcherGreeting
GoToIfUnset FLAG_EXPLORER_KIT_RECEIVED, MiningMuseum_NotYetReady
GoToIfNe VAR_REVIVED_POKEMON_SPECIES, 0, MiningMuseum_PokemonRevival
GetFossilCount VAR_0x8000
GoToIfEq VAR_0x8000, 0, MiningMuseum_NoFossils
Message MiningMuseum_Text_HaveFossilForMe
ShowYesNoMenu VAR_RESULT
GoToIfEq VAR_RESULT, MENU_NO, _03E7
GoToIfEq VAR_0x8000, 1, _03BC
GoToIfEq VAR_RESULT, MENU_NO, MiningMuseum_DeclinedRevival
GoToIfEq VAR_0x8000, 1, MiningMuseum_SingleFossilRevival
SetVar VAR_0x8001, 0
CheckItem ITEM_OLD_AMBER, 1, VAR_RESULT
AddVar VAR_0x8001, VAR_RESULT
@ -59,11 +59,11 @@ _0055:
AddVar VAR_0x8001, VAR_RESULT
CheckItem ITEM_SKULL_FOSSIL, 1, VAR_RESULT
AddVar VAR_0x8001, VAR_RESULT
GoToIfEq VAR_0x8001, 1, _03BC
GoToIfEq VAR_0x8001, 1, MiningMuseum_SingleFossilRevival
SetVar VAR_0x8004, 0
SetVar VAR_0x8005, 0
InitGlobalTextMenu 1, 1, 0, VAR_0x8003
_013E:
MiningMuseum_FossilMenuLoop:
CallIfEq VAR_0x8005, 0, MiningMuseum_CheckFossil_OldAmber
CallIfEq VAR_0x8005, 1, MiningMuseum_CheckFossil_HelixFossil
CallIfEq VAR_0x8005, 2, MiningMuseum_CheckFossil_DomeFossil
@ -71,42 +71,42 @@ _013E:
CallIfEq VAR_0x8005, 4, MiningMuseum_CheckFossil_ClawFossil
CallIfEq VAR_0x8005, 5, MiningMuseum_CheckFossil_ArmorFossil
CallIfEq VAR_0x8005, 6, MiningMuseum_CheckFossil_SkullFossil
GoToIfEq VAR_RESULT, FALSE, _0219
CallIfEq VAR_0x8004, 0, _034C
CallIfEq VAR_0x8004, 1, _0354
CallIfEq VAR_0x8004, 2, _035C
CallIfEq VAR_0x8004, 3, _0364
CallIfEq VAR_0x8004, 4, _036C
CallIfEq VAR_0x8004, 5, _0374
CallIfEq VAR_0x8004, 6, _037C
GoToIfEq VAR_RESULT, FALSE, MiningMuseum_FossilMenuNext
CallIfEq VAR_0x8004, 0, MiningMuseum_SetOldAmberVar
CallIfEq VAR_0x8004, 1, MiningMuseum_SetHelixFossilVar
CallIfEq VAR_0x8004, 2, MiningMuseum_SetDomeFossilVar
CallIfEq VAR_0x8004, 3, MiningMuseum_SetRootFossilVar
CallIfEq VAR_0x8004, 4, MiningMuseum_SetClawFossilVar
CallIfEq VAR_0x8004, 5, MiningMuseum_SetArmorFossilVar
CallIfEq VAR_0x8004, 6, MiningMuseum_SetSkullFossilVar
SetVar VAR_0x8006, VAR_0x8005
AddVar VAR_0x8006, 156
AddMenuEntry VAR_0x8006, VAR_0x8004
GoTo _0225
GoTo MiningMuseum_FossilMenuContinue
_0219:
MiningMuseum_FossilMenuNext:
AddVar VAR_0x8005, 1
GoTo _013E
GoTo MiningMuseum_FossilMenuLoop
_0225:
MiningMuseum_FossilMenuContinue:
AddVar VAR_0x8004, 1
AddVar VAR_0x8005, 1
GoToIfNe VAR_0x8004, VAR_0x8001, _013E
GoToIfNe VAR_0x8004, VAR_0x8001, MiningMuseum_FossilMenuLoop
AddMenuEntry 44, VAR_0x8004
ShowMenu
GoToIfEq VAR_0x8003, 0xFF, _03E7
GoToIfEq VAR_0x8003, VAR_MAP_LOCAL_0, _03E7
CallIfEq VAR_0x8003, 0, _0384
CallIfEq VAR_0x8003, 1, _038C
CallIfEq VAR_0x8003, 2, _0394
CallIfEq VAR_0x8003, 3, _039C
CallIfEq VAR_0x8003, 4, _03A4
CallIfEq VAR_0x8003, 5, _03AC
CallIfEq VAR_0x8003, 6, _03B4
ScrCmd_1F4 VAR_UNK_0x40B4, VAR_0x8002
GoToIfEq VAR_UNK_0x40B4, 0, _03E7
GoToIfEq VAR_0x8003, 0xFF, MiningMuseum_DeclinedRevival
GoToIfEq VAR_0x8003, VAR_MAP_LOCAL_0, MiningMuseum_DeclinedRevival
CallIfEq VAR_0x8003, 0, MiningMuseum_GetOldAmberVar
CallIfEq VAR_0x8003, 1, MiningMuseum_GetHelixFossilVar
CallIfEq VAR_0x8003, 2, MiningMuseum_GetDomeFossilVar
CallIfEq VAR_0x8003, 3, MiningMuseum_GetRootFossilVar
CallIfEq VAR_0x8003, 4, MiningMuseum_GetClawFossilVar
CallIfEq VAR_0x8003, 5, MiningMuseum_GetArmorFossilVar
CallIfEq VAR_0x8003, 6, MiningMuseum_GetSkullFossilVar
GetSpeciesFromFossil VAR_REVIVED_POKEMON_SPECIES, VAR_0x8002
GoToIfEq VAR_REVIVED_POKEMON_SPECIES, 0, MiningMuseum_DeclinedRevival
RemoveItem VAR_0x8002, 1, VAR_RESULT
GoTo _03D8
GoTo MiningMuseum_ExtractingPokemon
MiningMuseum_CheckFossil_OldAmber:
SetVar VAR_MAP_LOCAL_0, ITEM_OLD_AMBER
@ -143,272 +143,272 @@ MiningMuseum_CheckFossil_SkullFossil:
CheckItem VAR_MAP_LOCAL_0, 1, VAR_RESULT
Return
_034C:
MiningMuseum_SetOldAmberVar:
SetVar VAR_MAP_LOCAL_1, VAR_MAP_LOCAL_0
Return
_0354:
MiningMuseum_SetHelixFossilVar:
SetVar VAR_MAP_LOCAL_2, VAR_MAP_LOCAL_0
Return
_035C:
MiningMuseum_SetDomeFossilVar:
SetVar VAR_MAP_LOCAL_3, VAR_MAP_LOCAL_0
Return
_0364:
MiningMuseum_SetRootFossilVar:
SetVar VAR_MAP_LOCAL_4, VAR_MAP_LOCAL_0
Return
_036C:
MiningMuseum_SetClawFossilVar:
SetVar VAR_MAP_LOCAL_5, VAR_MAP_LOCAL_0
Return
_0374:
MiningMuseum_SetArmorFossilVar:
SetVar VAR_MAP_LOCAL_6, VAR_MAP_LOCAL_0
Return
_037C:
MiningMuseum_SetSkullFossilVar:
SetVar VAR_MAP_LOCAL_7, VAR_MAP_LOCAL_0
Return
_0384:
MiningMuseum_GetOldAmberVar:
SetVar VAR_0x8002, VAR_MAP_LOCAL_1
Return
_038C:
MiningMuseum_GetHelixFossilVar:
SetVar VAR_0x8002, VAR_MAP_LOCAL_2
Return
_0394:
MiningMuseum_GetDomeFossilVar:
SetVar VAR_0x8002, VAR_MAP_LOCAL_3
Return
_039C:
MiningMuseum_GetRootFossilVar:
SetVar VAR_0x8002, VAR_MAP_LOCAL_4
Return
_03A4:
MiningMuseum_GetClawFossilVar:
SetVar VAR_0x8002, VAR_MAP_LOCAL_5
Return
_03AC:
MiningMuseum_GetArmorFossilVar:
SetVar VAR_0x8002, VAR_MAP_LOCAL_6
Return
_03B4:
MiningMuseum_GetSkullFossilVar:
SetVar VAR_0x8002, VAR_MAP_LOCAL_7
Return
_03BC:
ScrCmd_1F5 VAR_0x8002, VAR_0x8004, 1
ScrCmd_1F4 VAR_UNK_0x40B4, VAR_0x8002
MiningMuseum_SingleFossilRevival:
FindFossilAtThreshold VAR_0x8002, VAR_0x8004, 1
GetSpeciesFromFossil VAR_REVIVED_POKEMON_SPECIES, VAR_0x8002
RemoveItem VAR_0x8002, 1, VAR_RESULT
GoTo _03D8
GoTo MiningMuseum_ExtractingPokemon
_03D8:
MiningMuseum_ExtractingPokemon:
SetFlag FLAG_UNK_0x0001
Message 6
Message MiningMuseum_Text_ExtractingPokemonLeave
WaitABXPadPress
CloseMessage
ReleaseAll
End
_03E7:
Message 5
MiningMuseum_DeclinedRevival:
Message MiningMuseum_Text_DeclinedFossilRevival
WaitABXPadPress
CloseMessage
ReleaseAll
End
_03F2:
BufferSpeciesNameFromVar 0, VAR_UNK_0x40B4, 0, 0
Message 7
MiningMuseum_PokemonRevival:
BufferSpeciesNameFromVar 0, VAR_REVIVED_POKEMON_SPECIES, 0, 0
Message MiningMuseum_Text_PokemonRevivedTooLong
GetPartyCount VAR_RESULT
GoToIfEq VAR_RESULT, 6, _04A0
BufferSpeciesNameFromVar 1, VAR_UNK_0x40B4, 0, 0
GoToIfEq VAR_RESULT, 6, MiningMuseum_PartyFull
BufferSpeciesNameFromVar 1, VAR_REVIVED_POKEMON_SPECIES, 0, 0
BufferPlayerName 0
PlaySound SEQ_FANFA4
Message 8
Message MiningMuseum_Text_PokemonReceived
WaitSound
GivePokemon VAR_UNK_0x40B4, 20, ITEM_NONE, VAR_RESULT
IncrementGameRecord RECORD_UNK_115
SetVar VAR_UNK_0x40B4, 0
Message 9
GivePokemon VAR_REVIVED_POKEMON_SPECIES, 20, ITEM_NONE, VAR_RESULT
IncrementGameRecord RECORD_POKEMON_RECEIVED_FROM_FOSSIL_REVIVAL
SetVar VAR_REVIVED_POKEMON_SPECIES, 0
Message MiningMuseum_Text_GiveNickname
ShowYesNoMenu VAR_RESULT
GoToIfEq VAR_RESULT, MENU_YES, _0459
GoToIfEq VAR_RESULT, MENU_NO, _049A
GoToIfEq VAR_RESULT, MENU_YES, MiningMuseum_NicknamePrompt
GoToIfEq VAR_RESULT, MENU_NO, MiningMuseum_NoNickname
End
_0459:
MiningMuseum_NicknamePrompt:
CloseMessage
GetPartyCount VAR_MAP_LOCAL_0
SubVar VAR_MAP_LOCAL_0, 1
FadeScreenOut
WaitFadeScreen
ScrCmd_0BB VAR_MAP_LOCAL_0, VAR_RESULT
CallIfNe VAR_RESULT, 1, _0494
CallIfNe VAR_RESULT, 1, MiningMuseum_RecordNickname
FadeScreenIn
WaitFadeScreen
ReleaseAll
End
_0494:
IncrementGameRecord RECORD_UNK_049
MiningMuseum_RecordNickname:
IncrementGameRecord RECORD_POKEMON_NICKNAMED
Return
_049A:
MiningMuseum_NoNickname:
CloseMessage
ReleaseAll
End
_04A0:
Message 10
MiningMuseum_PartyFull:
Message MiningMuseum_Text_PartyFull
WaitABXPadPress
CloseMessage
ReleaseAll
End
_04AB:
Message 11
MiningMuseum_NoFossils:
Message MiningMuseum_Text_BringFossilsToMe
WaitABXPadPress
CloseMessage
ReleaseAll
End
_04B6:
Message 12
MiningMuseum_NotYetReady:
Message MiningMuseum_Text_NotYetReady
WaitABXPadPress
CloseMessage
ReleaseAll
End
_04C1:
MiningMuseum_CoalExhibit1:
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer
Message 13
Message MiningMuseum_Text_CoalExhibit1
WaitABXPadPress
CloseMessage
ReleaseAll
End
_04D4:
MiningMuseum_CoalExhibit2:
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer
Message 14
Message MiningMuseum_Text_CoalExhibit2
WaitABXPadPress
CloseMessage
ReleaseAll
End
_04E7:
MiningMuseum_MineUnderSea:
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer
Message 15
Message MiningMuseum_Text_MineExtendsUnderSea
WaitABXPadPress
CloseMessage
ReleaseAll
End
_04FA:
MiningMuseum_HowCoalIsMade1:
PlayFanfare SEQ_SE_CONFIRM
LockAll
Message 19
Message MiningMuseum_Text_HowCoalIsMade1
WaitABXPadPress
CloseMessage
ReleaseAll
End
_050B:
MiningMuseum_HowCoalIsMade2:
PlayFanfare SEQ_SE_CONFIRM
LockAll
Message 20
Message MiningMuseum_Text_HowCoalIsMade2
WaitABXPadPress
CloseMessage
ReleaseAll
End
_051C:
MiningMuseum_HowCoalIsMade3:
PlayFanfare SEQ_SE_CONFIRM
LockAll
Message 21
Message MiningMuseum_Text_HowCoalIsMade3
WaitABXPadPress
CloseMessage
ReleaseAll
End
_052D:
MiningMuseum_CoalSamplesDisplay:
PlayFanfare SEQ_SE_CONFIRM
LockAll
Message 22
Message MiningMuseum_Text_CoalSamplesDisplay
WaitABXPadPress
CloseMessage
ReleaseAll
End
_053E:
MiningMuseum_CoalSamplesBox:
PlayFanfare SEQ_SE_CONFIRM
LockAll
Message 23
Message MiningMuseum_Text_CoalSamplesBox
WaitABXPadPress
CloseMessage
ReleaseAll
End
_054F:
MiningMuseum_MiningLamps:
PlayFanfare SEQ_SE_CONFIRM
LockAll
Message 24
Message MiningMuseum_Text_MiningLamps
WaitABXPadPress
CloseMessage
ReleaseAll
End
_0560:
MiningMuseum_MiningTools:
PlayFanfare SEQ_SE_CONFIRM
LockAll
Message 25
Message MiningMuseum_Text_MiningTools
WaitABXPadPress
CloseMessage
ReleaseAll
End
_0571:
MiningMuseum_MineWorkerItems:
PlayFanfare SEQ_SE_CONFIRM
LockAll
Message 26
Message MiningMuseum_Text_MineWorkerItems
WaitABXPadPress
CloseMessage
ReleaseAll
End
_0582:
MiningMuseum_UndergroundManInfo:
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer
Message 16
Message MiningMuseum_Text_UndergroundManInfo
WaitABXPadPress
CloseMessage
ReleaseAll
End
_0595:
MiningMuseum_MiningRequiresStrongMind:
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer
Message 17
Message MiningMuseum_Text_MiningRequiresStrongMind
WaitABXPadPress
CloseMessage
ReleaseAll
End
_05A8:
MiningMuseum_MineHistory:
PlayFanfare SEQ_SE_CONFIRM
LockAll
FacePlayer
Message 18
Message MiningMuseum_Text_MineHistory
WaitABXPadPress
CloseMessage
ReleaseAll

View File

@ -184,7 +184,7 @@ _0261:
End
_02B6:
IncrementGameRecord RECORD_UNK_049
IncrementGameRecord RECORD_POKEMON_NICKNAMED
Return
_02BC:

View File

@ -58,7 +58,7 @@ _00AC:
End
_00E7:
IncrementGameRecord RECORD_UNK_049
IncrementGameRecord RECORD_POKEMON_NICKNAMED
Return
_00ED:

View File

@ -2,14 +2,14 @@
"key": 25643,
"messages": [
{
"id": "pl_msg_00000079_00000",
"id": "MiningMuseum_Text_Welcome",
"en_US": [
"Hello! Welcome to the Oreburgh\n",
"Mining Museum!"
]
},
{
"id": "pl_msg_00000079_00001",
"id": "MiningMuseum_Text_FossilResearcherGreeting",
"en_US": [
"Hello, hello!\n",
"How are you?\r",
@ -18,35 +18,35 @@
]
},
{
"id": "pl_msg_00000079_00002",
"id": "MiningMuseum_Text_HaveFossilForMe",
"en_US": [
"You have a Fossil for me, yes?\n",
"Shall I turn it into a Pokémon?"
]
},
{
"id": "pl_msg_00000079_00003",
"id": "MiningMuseum_Text_WhichFossilToRevive",
"en_US": [
"Which Fossil should I turn back\n",
"into a Pokémon? Choose! Now!"
]
},
{
"id": "pl_msg_00000079_00004",
"id": "MiningMuseum_Text_WillReviveFossil",
"en_US": [
"OK, I will do that! Turn that Fossil\n",
"back into a Pokémon, surely I will!"
]
},
{
"id": "pl_msg_00000079_00005",
"id": "MiningMuseum_Text_DeclinedFossilRevival",
"en_US": [
"You dont wish that I extract any\n",
"Pokémon from a Fossil. Fine, then!"
]
},
{
"id": "pl_msg_00000079_00006",
"id": "MiningMuseum_Text_ExtractingPokemonLeave",
"en_US": [
"I am in the process of extracting\n",
"your Pokémon from a Fossil.\r",
@ -55,7 +55,7 @@
]
},
{
"id": "pl_msg_00000079_00007",
"id": "MiningMuseum_Text_PokemonRevivedTooLong",
"en_US": [
"You were gone too long!\n",
"You kept us waiting! Unacceptable!\r",
@ -64,21 +64,21 @@
]
},
{
"id": "pl_msg_00000079_00008",
"id": "MiningMuseum_Text_PokemonReceived",
"en_US": [
"{STRVAR_1 3, 0, 0} received\n",
"the {STRVAR_1 0, 1, 0}!\r"
]
},
{
"id": "pl_msg_00000079_00009",
"id": "MiningMuseum_Text_GiveNickname",
"en_US": [
"Give a nickname to the {STRVAR_1 0, 1, 0}\n",
"you received?"
]
},
{
"id": "pl_msg_00000079_00010",
"id": "MiningMuseum_Text_PartyFull",
"en_US": [
"But, no, I cannot do this!\n",
"You have too many Pokémon with you!\r",
@ -87,14 +87,14 @@
]
},
{
"id": "pl_msg_00000079_00011",
"id": "MiningMuseum_Text_BringFossilsToMe",
"en_US": [
"If it is a Fossil that you obtain,\n",
"bring it to me if you must."
]
},
{
"id": "pl_msg_00000079_00012",
"id": "MiningMuseum_Text_NotYetReady",
"en_US": [
"On the verge of a breakthrough, I am,\n",
"to achieve extraction from Fossils.\r",
@ -103,7 +103,7 @@
]
},
{
"id": "pl_msg_00000079_00013",
"id": "MiningMuseum_Text_CoalExhibit1",
"en_US": [
"Whoa! So this is coal?\n",
"I never expected something this big!\r",
@ -112,14 +112,14 @@
]
},
{
"id": "pl_msg_00000079_00014",
"id": "MiningMuseum_Text_CoalExhibit2",
"en_US": [
"Wow! The Pokémon that carried this\n",
"must be terribly strong!"
]
},
{
"id": "pl_msg_00000079_00015",
"id": "MiningMuseum_Text_MineExtendsUnderSea",
"en_US": [
"Well, how about that!\r",
"The Oreburgh Mine extends under\n",
@ -127,7 +127,7 @@
]
},
{
"id": "pl_msg_00000079_00016",
"id": "MiningMuseum_Text_UndergroundManInfo",
"en_US": [
"Its a little far from here, but there\n",
"is a city called Eterna City.\r",
@ -138,7 +138,7 @@
]
},
{
"id": "pl_msg_00000079_00017",
"id": "MiningMuseum_Text_MiningRequiresStrongMind",
"en_US": [
"Mining must take a strong mind, not\n",
"just a tough body.\r",
@ -147,7 +147,7 @@
]
},
{
"id": "pl_msg_00000079_00018",
"id": "MiningMuseum_Text_MineHistory",
"en_US": [
"The history of Oreburgh Mine...\r",
"You could call it a history of effort and\n",
@ -155,7 +155,7 @@
]
},
{
"id": "pl_msg_00000079_00019",
"id": "MiningMuseum_Text_HowCoalIsMade1",
"en_US": [
"How Coal Is Made 1\r",
"“In a time long before history,\n",
@ -165,7 +165,7 @@
]
},
{
"id": "pl_msg_00000079_00020",
"id": "MiningMuseum_Text_HowCoalIsMade2",
"en_US": [
"How Coal Is Made 2\r",
"“The buried plant matter was\n",
@ -175,7 +175,7 @@
]
},
{
"id": "pl_msg_00000079_00021",
"id": "MiningMuseum_Text_HowCoalIsMade3",
"en_US": [
"How Coal Is Made 3\r",
"“Deep under the ground, the\n",
@ -185,21 +185,21 @@
]
},
{
"id": "pl_msg_00000079_00022",
"id": "MiningMuseum_Text_CoalSamplesDisplay",
"en_US": [
"Samples of coal from different regions\n",
"are displayed."
]
},
{
"id": "pl_msg_00000079_00023",
"id": "MiningMuseum_Text_CoalSamplesBox",
"en_US": [
"The box contains categorized samples\n",
"of coal."
]
},
{
"id": "pl_msg_00000079_00024",
"id": "MiningMuseum_Text_MiningLamps",
"en_US": [
"Different kinds of lamps are\n",
"displayed.\r",
@ -208,7 +208,7 @@
]
},
{
"id": "pl_msg_00000079_00025",
"id": "MiningMuseum_Text_MiningTools",
"en_US": [
"Badly scarred wooden tools are\n",
"displayed.\r",
@ -217,7 +217,7 @@
]
},
{
"id": "pl_msg_00000079_00026",
"id": "MiningMuseum_Text_MineWorkerItems",
"en_US": [
"The everyday items and tools of\n",
"past mine workers are displayed."

View File

@ -136,7 +136,7 @@ static u8 sUsesHighLimit[MAX_RECORDS] = {
[RECORD_UNK_046] = FALSE,
[RECORD_SPHERES_BURIED] = FALSE,
[RECORD_UNK_048] = FALSE,
[RECORD_UNK_049] = FALSE,
[RECORD_POKEMON_NICKNAMED] = FALSE,
[RECORD_UNK_050] = FALSE,
[RECORD_UNK_051] = FALSE,
[RECORD_UNK_052] = FALSE,
@ -202,7 +202,7 @@ static u8 sUsesHighLimit[MAX_RECORDS] = {
[RECORD_UNK_112] = TRUE,
[RECORD_UNK_113] = FALSE,
[RECORD_UNK_114] = FALSE,
[RECORD_UNK_115] = FALSE,
[RECORD_POKEMON_RECEIVED_FROM_FOSSIL_REVIVAL] = FALSE,
[RECORD_CHECKED_FOOTPRINTS] = FALSE,
[RECORD_UNK_117] = FALSE,
[RECORD_UNK_118] = FALSE,

View File

@ -191,7 +191,7 @@ pokeplatinum_c = files(
'scrcmd_daycare.c',
'scrcmd_amity_square.c',
'scrcmd_party.c',
'unk_0204E240.c',
'scrcmd_fossil.c',
'scrcmd_game_corner_prize.c',
'scrcmd_system_flags.c',
'scrcmd_item.c',

View File

@ -149,6 +149,7 @@
#include "scrcmd_coins.h"
#include "scrcmd_daycare.h"
#include "scrcmd_dummy_23F_242.h"
#include "scrcmd_fossil.h"
#include "scrcmd_game_corner_prize.h"
#include "scrcmd_item.h"
#include "scrcmd_jubilife_lottery.h"
@ -193,7 +194,6 @@
#include "unk_02048DD8.h"
#include "unk_020494DC.h"
#include "unk_0204AEE8.h"
#include "unk_0204E240.h"
#include "unk_0204EDA4.h"
#include "unk_0204F04C.h"
#include "unk_0204F13C.h"
@ -1266,11 +1266,11 @@ const ScrCmdFunc Unk_020EAC58[] = {
ScrCmd_GetPartyMonHeldItem_Unused,
ScrCmd_Unused_1EF,
ScrCmd_DeletePartyMonHeldItem_Unused,
ScrCmd_1F1,
ScrCmd_1F2,
ScrCmd_1F3,
ScrCmd_1F4,
ScrCmd_1F5,
ScrCmd_GetFossilCount,
ScrCmd_Dummy_1F2,
ScrCmd_Dummy_1F3,
ScrCmd_GetSpeciesFromFossil,
ScrCmd_FindFossilAtThreshold,
ScrCmd_CountPartyMonsBelowLevelThreshold,
ScrCmd_SurvivePoison,
ScrCmd_1F8,

93
src/scrcmd_fossil.c Normal file
View File

@ -0,0 +1,93 @@
#include "scrcmd_fossil.h"
#include <nitro.h>
#include <string.h>
#include "constants/items.h"
#include "field/field_system.h"
#include "bag.h"
#include "field_script_context.h"
#include "inlines.h"
static const struct {
u16 item;
u16 species;
} sFossilItemToSpeciesMapping[7] = {
{ .item = ITEM_OLD_AMBER, .species = SPECIES_AERODACTYL },
{ .item = ITEM_HELIX_FOSSIL, .species = SPECIES_OMANYTE },
{ .item = ITEM_DOME_FOSSIL, .species = SPECIES_KABUTO },
{ .item = ITEM_ROOT_FOSSIL, .species = SPECIES_LILEEP },
{ .item = ITEM_CLAW_FOSSIL, .species = SPECIES_ANORITH },
{ .item = ITEM_ARMOR_FOSSIL, .species = SPECIES_SHIELDON },
{ .item = ITEM_SKULL_FOSSIL, .species = SPECIES_CRANIDOS },
};
BOOL ScrCmd_GetFossilCount(ScriptContext *ctx)
{
FieldSystem *fieldSystem = ctx->fieldSystem;
u8 i;
u16 totalCount;
u16 *destVar = ScriptContext_GetVarPointer(ctx);
for (i = 0, totalCount = 0; i < 7; i++) {
totalCount += Bag_GetItemQuantity(SaveData_GetBag(fieldSystem->saveData), sFossilItemToSpeciesMapping[i].item, HEAP_ID_FIELD1);
}
*destVar = totalCount;
return FALSE;
}
BOOL ScrCmd_GetSpeciesFromFossil(ScriptContext *ctx)
{
u16 i;
u16 *destVar = ScriptContext_GetVarPointer(ctx);
u16 inputItemID = ScriptContext_GetVar(ctx);
*destVar = 0;
for (i = 0; i < 7; i++) {
if (sFossilItemToSpeciesMapping[i].item == inputItemID) {
*destVar = sFossilItemToSpeciesMapping[i].species;
break;
}
}
return FALSE;
}
BOOL ScrCmd_FindFossilAtThreshold(ScriptContext *ctx)
{
FieldSystem *fieldSystem = ctx->fieldSystem;
u8 i;
u16 currentCount;
u16 *outItemID = ScriptContext_GetVarPointer(ctx);
u16 *outIndex = ScriptContext_GetVarPointer(ctx);
u16 threshold = ScriptContext_GetVar(ctx);
*outItemID = 0;
*outIndex = 0;
for (i = 0, currentCount = 0; i < 7; i++) {
currentCount += Bag_GetItemQuantity(SaveData_GetBag(fieldSystem->saveData), sFossilItemToSpeciesMapping[i].item, HEAP_ID_FIELD1);
if (currentCount >= threshold) {
*outItemID = sFossilItemToSpeciesMapping[i].item;
*outIndex = i;
break;
}
}
return FALSE;
}
BOOL ScrCmd_Dummy_1F2(ScriptContext *ctx)
{
return FALSE;
}
BOOL ScrCmd_Dummy_1F3(ScriptContext *ctx)
{
return FALSE;
}

View File

@ -1,89 +0,0 @@
#include "unk_0204E240.h"
#include <nitro.h>
#include <string.h>
#include "field/field_system.h"
#include "bag.h"
#include "field_script_context.h"
#include "inlines.h"
const u16 Unk_020EBFFC[7][2] = {
{ 0x67, 0x8E },
{ 0x65, 0x8A },
{ 0x66, 0x8C },
{ 0x63, 0x159 },
{ 0x64, 0x15B },
{ 0x68, 0x19A },
{ 0x69, 0x198 }
};
BOOL ScrCmd_1F1(ScriptContext *param0)
{
FieldSystem *fieldSystem = param0->fieldSystem;
u8 v1;
u16 v2, v3;
u16 *v4 = ScriptContext_GetVarPointer(param0);
for (v1 = 0, v3 = 0; v1 < 7; v1++) {
v3 += Bag_GetItemQuantity(SaveData_GetBag(fieldSystem->saveData), Unk_020EBFFC[v1][0], HEAP_ID_FIELD1);
}
*v4 = v3;
return 0;
}
BOOL ScrCmd_1F4(ScriptContext *param0)
{
u16 v0;
u16 *v1 = ScriptContext_GetVarPointer(param0);
u16 v2 = ScriptContext_GetVar(param0);
*v1 = 0;
for (v0 = 0; v0 < 7; v0++) {
if (Unk_020EBFFC[v0][0] == v2) {
*v1 = Unk_020EBFFC[v0][1];
break;
}
}
return 0;
}
BOOL ScrCmd_1F5(ScriptContext *param0)
{
FieldSystem *fieldSystem = param0->fieldSystem;
u8 v1;
u16 v2, v3;
u16 *v4 = ScriptContext_GetVarPointer(param0);
u16 *v5 = ScriptContext_GetVarPointer(param0);
u16 v6 = ScriptContext_GetVar(param0);
*v4 = 0;
*v5 = 0;
for (v1 = 0, v3 = 0; v1 < 7; v1++) {
v3 += Bag_GetItemQuantity(SaveData_GetBag(fieldSystem->saveData), Unk_020EBFFC[v1][0], HEAP_ID_FIELD1);
if (v3 >= v6) {
*v4 = Unk_020EBFFC[v1][0];
*v5 = v1;
break;
}
}
return 0;
}
BOOL ScrCmd_1F2(ScriptContext *param0)
{
return 0;
}
BOOL ScrCmd_1F3(ScriptContext *param0)
{
return 0;
}

View File

@ -249,7 +249,7 @@ static BOOL sub_0209843C(FieldTask *param0)
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
GameRecords *v11 = SaveData_GetGameRecords(FieldSystem_GetSaveData(fieldSystem));
GameRecords_IncrementRecordValue(v11, RECORD_UNK_049);
GameRecords_IncrementRecordValue(v11, RECORD_POKEMON_NICKNAMED);
}
}