mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-04-30 02:27:15 -05:00
Address PR feedback:
- `resultVar` -> `destVarID` - Clean up member names for `HiddenLocation` and `DistributionEvent` - `Set/Clear` -> `Enable/Disable` for HiddenLocation script macros - `ScrCmd_SetOrClearHiddenLocation` -> `ScrCmd_SetHiddenLocation` - `SYSTEM_VARS_BLOCK_SIZE` -> `NUM_SYSTEM_VARS` - Identify `scripts_unk_0412` -> `scripts_init_new_game` - Add `SCRIPT_ID_OFFSET_INIT_NEW_GAME` constant definition - Add `SCRIPT_ID` functional macro - Use `SCRIPT_ID(INIT_NEW_GAME, 0)` in `FieldSystem_InitNewGameState` - Promote `LCRNG_MULTIPLIER` in `math.c` from private to public - Use private `LCRNG_INCREMENT` in `system_vars.c` for lottery sync
This commit is contained in:
parent
5168755542
commit
1b03304755
|
|
@ -678,20 +678,20 @@
|
||||||
.short \arg0
|
.short \arg0
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
// If the player has no space left in the bag, resultVar will be set to FALSE
|
// If the player has no space left in the bag, destVarID will be set to FALSE
|
||||||
.macro AddItem item, count, resultVar
|
.macro AddItem item, count, destVarID
|
||||||
.short 123
|
.short 123
|
||||||
.short \item
|
.short \item
|
||||||
.short \count
|
.short \count
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
// resultVar will be set to TRUE if the player had at least 'count' items of the specified type in their bag
|
// destVarID will be set to TRUE if the player had at least 'count' items of the specified type in their bag
|
||||||
.macro RemoveItem item, count, resultVar
|
.macro RemoveItem item, count, destVarID
|
||||||
.short 124
|
.short 124
|
||||||
.short \item
|
.short \item
|
||||||
.short \count
|
.short \count
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_07D arg0, arg1, arg2
|
.macro ScrCmd_07D arg0, arg1, arg2
|
||||||
|
|
@ -701,12 +701,12 @@
|
||||||
.short \arg2
|
.short \arg2
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
// resultVar will be set to TRUE if the player has at least 'count' items of the specified type in their bag
|
// destVarID will be set to TRUE if the player has at least 'count' items of the specified type in their bag
|
||||||
.macro CheckItem item, count, resultVar
|
.macro CheckItem item, count, destVarID
|
||||||
.short 126
|
.short 126
|
||||||
.short \item
|
.short \item
|
||||||
.short \count
|
.short \count
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_07F arg0, arg1
|
.macro ScrCmd_07F arg0, arg1
|
||||||
|
|
@ -2878,18 +2878,18 @@
|
||||||
.short \arg1
|
.short \arg1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetSpiritombCounter resultVar
|
.macro GetSpiritombCounter destVarID
|
||||||
.short 532
|
.short 532
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ClearAmitySquareStepCount
|
.macro ClearAmitySquareStepCount
|
||||||
.short 533
|
.short 533
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetAmitySquareStepCount resultVar
|
.macro GetAmitySquareStepCount destVarID
|
||||||
.short 534
|
.short 534
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_217 arg0, arg1
|
.macro ScrCmd_217 arg0, arg1
|
||||||
|
|
@ -2908,9 +2908,9 @@
|
||||||
.short \deadlineInDays
|
.short \deadlineInDays
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetNewsPressDeadline resultVar
|
.macro GetNewsPressDeadline destVarID
|
||||||
.short 538
|
.short 538
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro EnableSwarms
|
.macro EnableSwarms
|
||||||
|
|
@ -3219,9 +3219,9 @@
|
||||||
.byte \arg0
|
.byte \arg0
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetJubilifeLotteryTrainerID resultVar
|
.macro GetJubilifeLotteryTrainerID destVarID
|
||||||
.short 590
|
.short 590
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_24F arg0, arg1, arg2, arg3
|
.macro ScrCmd_24F arg0, arg1, arg2, arg3
|
||||||
|
|
@ -3390,16 +3390,18 @@
|
||||||
.short 623
|
.short 623
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro SetHiddenLocation hiddenLocation
|
/* Enable a given hidden location */
|
||||||
.short 624 /* SetOrClearHiddenLocation */
|
.macro EnableHiddenLocation hiddenLocation
|
||||||
.short \hiddenLocation
|
.short 624 /* SetHiddenLocation */
|
||||||
.byte TRUE /* Toggle On */
|
.short \hiddenLocation /* Refer to generated/hidden_locations.txt */
|
||||||
|
.byte TRUE /* Enable */
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ClearHiddenLocation hiddenLocation
|
/* Disable a given hidden location */
|
||||||
.short 624 /* SetOrClearHiddenLocation */
|
.macro DisableHiddenLocation hiddenLocation
|
||||||
.short \hiddenLocation
|
.short 624 /* SetHiddenLocation */
|
||||||
.byte FALSE /* Toggle Off */
|
.short \hiddenLocation /* Refer to generated/hidden_locations.txt */
|
||||||
|
.byte FALSE /* Disable */
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_271 arg0
|
.macro ScrCmd_271 arg0
|
||||||
|
|
@ -3424,10 +3426,10 @@
|
||||||
.long \arg1
|
.long \arg1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
/* Returns TRUE in resultVar if the player has won at least 10 consecutive bonus rounds */
|
/* Returns TRUE in destVarID if the player has won at least 10 consecutive bonus rounds */
|
||||||
.macro CheckBonusRoundStreak resultVar
|
.macro CheckBonusRoundStreak destVarID
|
||||||
.short 629
|
.short 629
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_276 arg0, arg1
|
.macro ScrCmd_276 arg0, arg1
|
||||||
|
|
@ -3436,9 +3438,9 @@
|
||||||
.short \arg1
|
.short \arg1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetDailyRandomLevel resultVar
|
.macro GetDailyRandomLevel destVarID
|
||||||
.short 631
|
.short 631
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_278 arg0, arg1
|
.macro ScrCmd_278 arg0, arg1
|
||||||
|
|
@ -3473,10 +3475,10 @@
|
||||||
.short \arg1
|
.short \arg1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
/* Returns TRUE in resultVar if the player has bought at least 5 items at the Veilstone Department Store */
|
/* Returns TRUE in destVarID if the player has bought at least 5 items at the Veilstone Department Store */
|
||||||
.macro CheckIsDepartmentStoreRegular resultVar
|
.macro CheckIsDepartmentStoreRegular destVarID
|
||||||
.short 638
|
.short 638
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_27F arg0
|
.macro ScrCmd_27F arg0
|
||||||
|
|
@ -3521,19 +3523,19 @@
|
||||||
.short \arg1
|
.short \arg1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetUndergroundItemsGivenAway resultVar
|
.macro GetUndergroundItemsGivenAway destVarID
|
||||||
.short 646
|
.short 646
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetUndergroundFossilsUnearthed resultVar
|
.macro GetUndergroundFossilsUnearthed destVarID
|
||||||
.short 647
|
.short 647
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetUndergroundTrapsSet resultVar
|
.macro GetUndergroundTrapsSet destVarID
|
||||||
.short 648
|
.short 648
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_289 arg0, arg1, arg2, arg3, arg4, arg5, arg6
|
.macro ScrCmd_289 arg0, arg1, arg2, arg3, arg4, arg5, arg6
|
||||||
|
|
@ -3552,10 +3554,11 @@
|
||||||
.short \arg0
|
.short \arg0
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro CheckDistributionEvent eventID, resultVar
|
/* Check if a given distribution event has been enabled and return the boolean-state in destVarID. */
|
||||||
|
.macro CheckDistributionEvent eventID, destVarID
|
||||||
.short 651
|
.short 651
|
||||||
.byte \eventID
|
.byte \eventID /* Refer to generated/distrubtion_events.txt */
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_28C arg0
|
.macro ScrCmd_28C arg0
|
||||||
|
|
@ -3594,9 +3597,9 @@
|
||||||
.short \arg1
|
.short \arg1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro GetUndergroundTalkCounter resultVar
|
.macro GetUndergroundTalkCounter destVarID
|
||||||
.short 659
|
.short 659
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ScrCmd_294 arg0, arg1
|
.macro ScrCmd_294 arg0, arg1
|
||||||
|
|
@ -4040,12 +4043,12 @@
|
||||||
.short \arg2
|
.short \arg2
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
// resultVar will be set to TRUE if the pokemon has at least one move it can learn at the given location and doesn't know yet
|
// destVarID will be set to TRUE if the pokemon has at least one move it can learn at the given location and doesn't know yet
|
||||||
.macro CheckHasLearnableTutorMoves partySlot, location, resultVar
|
.macro CheckHasLearnableTutorMoves partySlot, location, destVarID
|
||||||
.short 741
|
.short 741
|
||||||
.short \partySlot
|
.short \partySlot
|
||||||
.short \location
|
.short \location
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ShowMoveTutorMoveSelectionMenu partySlot, location, outSelectedOption
|
.macro ShowMoveTutorMoveSelectionMenu partySlot, location, outSelectedOption
|
||||||
|
|
@ -4073,11 +4076,11 @@
|
||||||
.short \moveSlot
|
.short \moveSlot
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
// resultVar will be set to TRUE if the move is available at a shards move tutor and the player can afford it
|
// destVarID will be set to TRUE if the move is available at a shards move tutor and the player can afford it
|
||||||
.macro CheckCanAffordMove moveID, resultVar
|
.macro CheckCanAffordMove moveID, destVarID
|
||||||
.short 746
|
.short 746
|
||||||
.short \moveID
|
.short \moveID
|
||||||
.short \resultVar
|
.short \destVarID
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro PayShardsCost moveID
|
.macro PayShardsCost moveID
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
DISTEVENT_DARKRAI
|
DISTRIBUTION_EVENT_DARKRAI
|
||||||
DISTEVENT_SHAYMIN
|
DISTRIBUTION_EVENT_SHAYMIN
|
||||||
DISTEVENT_ARCEUS
|
DISTRIBUTION_EVENT_ARCEUS
|
||||||
DISTEVENT_ROTOM
|
DISTRIBUTION_EVENT_ROTOM
|
||||||
DISTEVENT_MAX
|
DISTRIBUTION_EVENT_MAX
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
HL_FULLMOONISLAND
|
HIDDEN_LOCATION_FULLMOON_ISLAND
|
||||||
HL_NEWMOONISLAND
|
HIDDEN_LOCATION_NEWMOON_ISLAND
|
||||||
HL_SPRINGPATH
|
HIDDEN_LOCATION_SPRING_PATH
|
||||||
HL_SEABREAKPATH
|
HIDDEN_LOCATION_SEABREAK_PATH
|
||||||
HL_MAX
|
HIDDEN_LOCATION_MAX
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
#define VARS_START 0x4000
|
#define VARS_START 0x4000
|
||||||
|
|
||||||
#define SYSTEM_VARS_START (VARS_START + 0x0030)
|
#define SYSTEM_VARS_START (VARS_START + 0x0030)
|
||||||
#define SYSTEM_VARS_BLOCK_SIZE 64
|
#define NUM_SYSTEM_VARS 64
|
||||||
#define VAR_PLAYER_STARTER (SYSTEM_VARS_START + 0)
|
#define VAR_PLAYER_STARTER (SYSTEM_VARS_START + 0)
|
||||||
#define VAR_UNUSED_0x4031 (SYSTEM_VARS_START + 1)
|
#define VAR_UNUSED_0x4031 (SYSTEM_VARS_START + 1)
|
||||||
#define VAR_UNK_0x4032 (SYSTEM_VARS_START + 2)
|
#define VAR_UNK_0x4032 (SYSTEM_VARS_START + 2)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#include "constants/heap.h"
|
#include "constants/heap.h"
|
||||||
|
|
||||||
|
#define LCRNG_MULTIPLIER 1103515245L
|
||||||
|
|
||||||
enum AffineTransformationMatrixMode {
|
enum AffineTransformationMatrixMode {
|
||||||
AFFINE_MODE_NORMAL = 0,
|
AFFINE_MODE_NORMAL = 0,
|
||||||
AFFINE_MODE_MAX_256,
|
AFFINE_MODE_MAX_256,
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,12 @@ enum ScriptContextType {
|
||||||
NUM_SCRIPT_CONTEXTS
|
NUM_SCRIPT_CONTEXTS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define SCRIPT_ID(chunk, id) ((SCRIPT_ID_OFFSET_##chunk) + id)
|
||||||
#define SCRIPT_ID_OFFSET_SINGLE_BATTLES 3000
|
#define SCRIPT_ID_OFFSET_SINGLE_BATTLES 3000
|
||||||
#define SCRIPT_ID_OFFSET_DOUBLE_BATTLES 5000
|
#define SCRIPT_ID_OFFSET_DOUBLE_BATTLES 5000
|
||||||
#define SCRIPT_ID_OFFSET_HIDDEN_ITEMS 8000
|
#define SCRIPT_ID_OFFSET_HIDDEN_ITEMS 8000
|
||||||
#define SCRIPT_ID_OFFSET_SAFARI_ZONE 8800
|
#define SCRIPT_ID_OFFSET_SAFARI_ZONE 8800
|
||||||
|
#define SCRIPT_ID_OFFSET_INIT_NEW_GAME 9600
|
||||||
#define SCRIPT_ID_POKEMON_CENTER_DAILY_TRAINERS 10400
|
#define SCRIPT_ID_POKEMON_CENTER_DAILY_TRAINERS 10400
|
||||||
|
|
||||||
#define FLAG_OFFSET_HIDDEN_ITEMS 730
|
#define FLAG_OFFSET_HIDDEN_ITEMS 730
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@
|
||||||
|
|
||||||
BOOL ScrCmd_GetJubilifeLotteryTrainerID(ScriptContext *ctx);
|
BOOL ScrCmd_GetJubilifeLotteryTrainerID(ScriptContext *ctx);
|
||||||
BOOL ScrCmd_24F(ScriptContext *param0);
|
BOOL ScrCmd_24F(ScriptContext *param0);
|
||||||
BOOL ScrCmd_RandomizeJubilifeLottery(ScriptContext *param0);
|
BOOL ScrCmd_RandomizeJubilifeLottery(ScriptContext *ctx);
|
||||||
|
|
||||||
#endif // POKEPLATINUM_UNK_020480A8_H
|
#endif // POKEPLATINUM_UNK_020480A8_H
|
||||||
|
|
|
||||||
|
|
@ -417,7 +417,7 @@ scr_seq_files = files(
|
||||||
'scripts_unk_0409.s',
|
'scripts_unk_0409.s',
|
||||||
'scripts_wifi_plaza_entrance.s',
|
'scripts_wifi_plaza_entrance.s',
|
||||||
'scripts_unk_0411.s',
|
'scripts_unk_0411.s',
|
||||||
'scripts_unk_0412.s',
|
'scripts_init_new_game.s',
|
||||||
'scripts_unk_0413.s',
|
'scripts_unk_0413.s',
|
||||||
'scripts_verity_lakefront.s',
|
'scripts_verity_lakefront.s',
|
||||||
'scripts_verity_lakefront_unknown_house.s',
|
'scripts_verity_lakefront_unknown_house.s',
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ scripts_unk_0408
|
||||||
scripts_unk_0409
|
scripts_unk_0409
|
||||||
scripts_wifi_plaza_entrance
|
scripts_wifi_plaza_entrance
|
||||||
scripts_unk_0411
|
scripts_unk_0411
|
||||||
scripts_unk_0412
|
scripts_init_new_game
|
||||||
scripts_unk_0413
|
scripts_unk_0413
|
||||||
scripts_verity_lakefront
|
scripts_verity_lakefront
|
||||||
scripts_verity_lakefront_unknown_house
|
scripts_verity_lakefront_unknown_house
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ _0168:
|
||||||
GoToIfEq 0x4000, 0, _01CA
|
GoToIfEq 0x4000, 0, _01CA
|
||||||
CheckItem ITEM_MEMBER_CARD, 1, 0x4000
|
CheckItem ITEM_MEMBER_CARD, 1, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _01CA
|
GoToIfEq 0x4000, FALSE, _01CA
|
||||||
CheckDistributionEvent DISTEVENT_DARKRAI, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_DARKRAI, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _01CA
|
GoToIfEq 0x4000, FALSE, _01CA
|
||||||
GoToIfUnset 0x12C, _01CA
|
GoToIfUnset 0x12C, _01CA
|
||||||
SetVar 0x4000, 1
|
SetVar 0x4000, 1
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ _0040:
|
||||||
End
|
End
|
||||||
|
|
||||||
_0057:
|
_0057:
|
||||||
CheckDistributionEvent DISTEVENT_DARKRAI, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_DARKRAI, 0x4000
|
||||||
GoToIfEq 0x4000, TRUE, _006B
|
GoToIfEq 0x4000, TRUE, _006B
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ _0061:
|
||||||
BufferPlayerName 0
|
BufferPlayerName 0
|
||||||
Message 14
|
Message 14
|
||||||
CloseMessage
|
CloseMessage
|
||||||
SetHiddenLocation HL_SPRINGPATH
|
EnableHiddenLocation HIDDEN_LOCATION_SPRING_PATH
|
||||||
SetVar 0x40AA, 1
|
SetVar 0x40AA, 1
|
||||||
PlayFanfare SEQ_SE_PL_SYUWA
|
PlayFanfare SEQ_SE_PL_SYUWA
|
||||||
FadeScreen 6, 1, 0, 0
|
FadeScreen 6, 1, 0, 0
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ _000E:
|
||||||
GoToIfEq 0x4000, 0, _005C
|
GoToIfEq 0x4000, 0, _005C
|
||||||
CheckItem ITEM_OAKS_LETTER, 1, 0x4000
|
CheckItem ITEM_OAKS_LETTER, 1, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _005C
|
GoToIfEq 0x4000, FALSE, _005C
|
||||||
CheckDistributionEvent DISTEVENT_SHAYMIN, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_SHAYMIN, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _005C
|
GoToIfEq 0x4000, FALSE, _005C
|
||||||
GoToIfSet 0x123, _005C
|
GoToIfSet 0x123, _005C
|
||||||
ClearFlag 0x251
|
ClearFlag 0x251
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
_000A:
|
_000A:
|
||||||
SetFlag 0x9D0
|
SetFlag 0x9D0
|
||||||
SetHiddenLocation HL_FULLMOONISLAND
|
EnableHiddenLocation HIDDEN_LOCATION_FULLMOON_ISLAND
|
||||||
End
|
End
|
||||||
|
|
||||||
_0015:
|
_0015:
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
ScriptEntryEnd
|
ScriptEntryEnd
|
||||||
|
|
||||||
_0012:
|
_0012:
|
||||||
CheckDistributionEvent DISTEVENT_ARCEUS, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_ARCEUS, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0035
|
GoToIfEq 0x4000, FALSE, _0035
|
||||||
GoToIfSet 0x11E, _0035
|
GoToIfSet 0x11E, _0035
|
||||||
ClearFlag 0x24E
|
ClearFlag 0x24E
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
_000A:
|
_000A:
|
||||||
SetFlag 0x9E4
|
SetFlag 0x9E4
|
||||||
SetHiddenLocation HL_NEWMOONISLAND
|
EnableHiddenLocation HIDDEN_LOCATION_NEWMOON_ISLAND
|
||||||
ClearFlag 0x279
|
ClearFlag 0x279
|
||||||
CallIfUnset 0x158, _0024
|
CallIfUnset 0x158, _0024
|
||||||
End
|
End
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ _000E:
|
||||||
GoToIfEq 0x4000, 0, _0058
|
GoToIfEq 0x4000, 0, _0058
|
||||||
CheckItem ITEM_MEMBER_CARD, 1, 0x4000
|
CheckItem ITEM_MEMBER_CARD, 1, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0058
|
GoToIfEq 0x4000, FALSE, _0058
|
||||||
CheckDistributionEvent DISTEVENT_DARKRAI, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_DARKRAI, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0058
|
GoToIfEq 0x4000, FALSE, _0058
|
||||||
GoToIfSet 0x158, _0058
|
GoToIfSet 0x158, _0058
|
||||||
ClearFlag 0x240
|
ClearFlag 0x240
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ _0102:
|
||||||
Return
|
Return
|
||||||
|
|
||||||
_010A:
|
_010A:
|
||||||
SetHiddenLocation HL_SPRINGPATH
|
EnableHiddenLocation HIDDEN_LOCATION_SPRING_PATH
|
||||||
Return
|
Return
|
||||||
|
|
||||||
_0111:
|
_0111:
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ _0030:
|
||||||
SetFlag 0x2BD
|
SetFlag 0x2BD
|
||||||
SetFlag 0x2BE
|
SetFlag 0x2BE
|
||||||
SetFlag 0x2BF
|
SetFlag 0x2BF
|
||||||
CheckDistributionEvent DISTEVENT_ROTOM, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_ROTOM, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _00A5
|
GoToIfEq 0x4000, FALSE, _00A5
|
||||||
ScrCmd_302 0x4000, 0x4001, 0x4002, 0x4003, 0x4004
|
ScrCmd_302 0x4000, 0x4001, 0x4002, 0x4003, 0x4004
|
||||||
CallIfEq 0x4000, 0, _00CF
|
CallIfEq 0x4000, 0, _00CF
|
||||||
|
|
@ -104,7 +104,7 @@ _0151:
|
||||||
GoToIfEq 0x800C, 0, _06DE
|
GoToIfEq 0x800C, 0, _06DE
|
||||||
CheckItem ITEM_SECRET_KEY, 1, 0x800C
|
CheckItem ITEM_SECRET_KEY, 1, 0x800C
|
||||||
GoToIfEq 0x800C, 0, _06DE
|
GoToIfEq 0x800C, 0, _06DE
|
||||||
CheckDistributionEvent DISTEVENT_ROTOM, 0x800C
|
CheckDistributionEvent DISTRIBUTION_EVENT_ROTOM, 0x800C
|
||||||
GoToIfEq 0x800C, FALSE, _06DE
|
GoToIfEq 0x800C, FALSE, _06DE
|
||||||
CallIfEq 0x8004, 1, _06C5
|
CallIfEq 0x8004, 1, _06C5
|
||||||
CallIfEq 0x8004, 3, _06CA
|
CallIfEq 0x8004, 3, _06CA
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ _001A:
|
||||||
GoToIfEq 0x4000, 0, _0080
|
GoToIfEq 0x4000, 0, _0080
|
||||||
CheckItem ITEM_OAKS_LETTER, 1, 0x4000
|
CheckItem ITEM_OAKS_LETTER, 1, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0080
|
GoToIfEq 0x4000, FALSE, _0080
|
||||||
CheckDistributionEvent DISTEVENT_SHAYMIN, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_SHAYMIN, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0080
|
GoToIfEq 0x4000, FALSE, _0080
|
||||||
ClearFlag 0x252
|
ClearFlag 0x252
|
||||||
_0080:
|
_0080:
|
||||||
|
|
@ -103,7 +103,7 @@ _0124:
|
||||||
FadeOutMusic 0, 10
|
FadeOutMusic 0, 10
|
||||||
FadeScreen 6, 6, 0, 0x7FFF
|
FadeScreen 6, 6, 0, 0x7FFF
|
||||||
WaitFadeScreen
|
WaitFadeScreen
|
||||||
SetHiddenLocation HL_SEABREAKPATH
|
EnableHiddenLocation HIDDEN_LOCATION_SEABREAK_PATH
|
||||||
ScrCmd_333 0
|
ScrCmd_333 0
|
||||||
Warp MAP_HEADER_ROUTE_224, 0, 0x38C, 0x1EC, 0
|
Warp MAP_HEADER_ROUTE_224, 0, 0x38C, 0x1EC, 0
|
||||||
WaitTime 15, 0x800C
|
WaitTime 15, 0x800C
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ _0062:
|
||||||
GoToIfEq 0x4000, 0, _00C5
|
GoToIfEq 0x4000, 0, _00C5
|
||||||
CheckItem ITEM_AZURE_FLUTE, 1, 0x4000
|
CheckItem ITEM_AZURE_FLUTE, 1, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _00C5
|
GoToIfEq 0x4000, FALSE, _00C5
|
||||||
CheckDistributionEvent DISTEVENT_ARCEUS, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_ARCEUS, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _00C5
|
GoToIfEq 0x4000, FALSE, _00C5
|
||||||
GoToIfSet 0x11E, _00C5
|
GoToIfSet 0x11E, _00C5
|
||||||
SetVar 0x4118, 1
|
SetVar 0x4118, 1
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ _0012:
|
||||||
GoToIfEq 0x4000, 0, _0075
|
GoToIfEq 0x4000, 0, _0075
|
||||||
CheckItem ITEM_AZURE_FLUTE, 1, 0x4000
|
CheckItem ITEM_AZURE_FLUTE, 1, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0075
|
GoToIfEq 0x4000, FALSE, _0075
|
||||||
CheckDistributionEvent DISTEVENT_ARCEUS, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_ARCEUS, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0075
|
GoToIfEq 0x4000, FALSE, _0075
|
||||||
GoToIfSet 0x11E, _0075
|
GoToIfSet 0x11E, _0075
|
||||||
SetVar 0x4118, 1
|
SetVar 0x4118, 1
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ _0012:
|
||||||
GoToIfEq 0x4000, 0, _0075
|
GoToIfEq 0x4000, 0, _0075
|
||||||
CheckItem ITEM_AZURE_FLUTE, 1, 0x4000
|
CheckItem ITEM_AZURE_FLUTE, 1, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0075
|
GoToIfEq 0x4000, FALSE, _0075
|
||||||
CheckDistributionEvent DISTEVENT_ARCEUS, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_ARCEUS, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _0075
|
GoToIfEq 0x4000, FALSE, _0075
|
||||||
GoToIfSet 0x11E, _0075
|
GoToIfSet 0x11E, _0075
|
||||||
SetVar 0x4118, 1
|
SetVar 0x4118, 1
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ _0110:
|
||||||
_0134:
|
_0134:
|
||||||
CheckItem ITEM_SECRET_KEY, 1, 0x800C
|
CheckItem ITEM_SECRET_KEY, 1, 0x800C
|
||||||
GoToIfEq 0x800C, FALSE, _01AA
|
GoToIfEq 0x800C, FALSE, _01AA
|
||||||
CheckDistributionEvent DISTEVENT_ROTOM, 0x800C
|
CheckDistributionEvent DISTRIBUTION_EVENT_ROTOM, 0x800C
|
||||||
GoToIfEq 0x800C, FALSE, _01AA
|
GoToIfEq 0x800C, FALSE, _01AA
|
||||||
GoToIfUnset 129, _01AA
|
GoToIfUnset 129, _01AA
|
||||||
PlayFanfare SEQ_SE_CONFIRM
|
PlayFanfare SEQ_SE_CONFIRM
|
||||||
|
|
|
||||||
|
|
@ -1570,7 +1570,7 @@ _14AC:
|
||||||
GoToIfEq 0x4000, FALSE, _1570
|
GoToIfEq 0x4000, FALSE, _1570
|
||||||
ScrCmd_22D 2, 0x4000
|
ScrCmd_22D 2, 0x4000
|
||||||
GoToIfEq 0x4000, 0, _1570
|
GoToIfEq 0x4000, 0, _1570
|
||||||
CheckDistributionEvent DISTEVENT_ARCEUS, 0x4000
|
CheckDistributionEvent DISTRIBUTION_EVENT_ARCEUS, 0x4000
|
||||||
GoToIfEq 0x4000, FALSE, _1570
|
GoToIfEq 0x4000, FALSE, _1570
|
||||||
GoToIfSet 0x11E, _1570
|
GoToIfSet 0x11E, _1570
|
||||||
BufferPlayerName 0
|
BufferPlayerName 0
|
||||||
|
|
|
||||||
|
|
@ -372,11 +372,11 @@ static void FieldMapChange_InitTerrainCollisionManager(FieldSystem *fieldSystem)
|
||||||
GF_ASSERT(fieldSystem->terrainCollisionMan == NULL);
|
GF_ASSERT(fieldSystem->terrainCollisionMan == NULL);
|
||||||
MapMatrix_Load(fieldSystem->location->mapId, fieldSystem->mapMatrix);
|
MapMatrix_Load(fieldSystem->location->mapId, fieldSystem->mapMatrix);
|
||||||
|
|
||||||
if (SystemVars_CheckHiddenLocation(SaveData_GetVarsFlags(fieldSystem->saveData), HL_SEABREAKPATH)) {
|
if (SystemVars_CheckHiddenLocation(SaveData_GetVarsFlags(fieldSystem->saveData), HIDDEN_LOCATION_SEABREAK_PATH)) {
|
||||||
MapMatrix_RevealSeabreakPath(fieldSystem->mapMatrix); // reveal Seabreak Path if Oak's Letter has been used
|
MapMatrix_RevealSeabreakPath(fieldSystem->mapMatrix); // reveal Seabreak Path if Oak's Letter has been used
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SystemVars_CheckHiddenLocation(SaveData_GetVarsFlags(fieldSystem->saveData), HL_SPRINGPATH)) {
|
if (!SystemVars_CheckHiddenLocation(SaveData_GetVarsFlags(fieldSystem->saveData), HIDDEN_LOCATION_SPRING_PATH)) {
|
||||||
MapMatrix_RevealSpringPath(fieldSystem->mapMatrix);
|
MapMatrix_RevealSpringPath(fieldSystem->mapMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -953,10 +953,10 @@ static BOOL FieldMenu_Pokedex(FieldTask *taskMan)
|
||||||
v2->pokedex = pokedex;
|
v2->pokedex = pokedex;
|
||||||
v2->trainerInfo = trainerInfo;
|
v2->trainerInfo = trainerInfo;
|
||||||
v2->timeOfDay = FieldSystem_GetTimeOfDay(fieldSystem);
|
v2->timeOfDay = FieldSystem_GetTimeOfDay(fieldSystem);
|
||||||
v2->fullmoonIslandVisible = SystemVars_CheckHiddenLocation(varsFlags, HL_FULLMOONISLAND);
|
v2->fullmoonIslandVisible = SystemVars_CheckHiddenLocation(varsFlags, HIDDEN_LOCATION_FULLMOON_ISLAND);
|
||||||
v2->newmoonIslandVisible = SystemVars_CheckHiddenLocation(varsFlags, HL_NEWMOONISLAND);
|
v2->newmoonIslandVisible = SystemVars_CheckHiddenLocation(varsFlags, HIDDEN_LOCATION_NEWMOON_ISLAND);
|
||||||
v2->springPathVisible = SystemVars_CheckHiddenLocation(varsFlags, HL_SPRINGPATH);
|
v2->springPathVisible = SystemVars_CheckHiddenLocation(varsFlags, HIDDEN_LOCATION_SPRING_PATH);
|
||||||
v2->seabreakPathVisible = SystemVars_CheckHiddenLocation(varsFlags, HL_SEABREAKPATH);
|
v2->seabreakPathVisible = SystemVars_CheckHiddenLocation(varsFlags, HIDDEN_LOCATION_SEABREAK_PATH);
|
||||||
v2->unk_1C = fieldSystem->unk_B4;
|
v2->unk_1C = fieldSystem->unk_B4;
|
||||||
|
|
||||||
sub_0203E0AC(fieldSystem, v2);
|
sub_0203E0AC(fieldSystem, v2);
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,7 @@ fx32 CalcCosineDegrees_FX32(fx32 degrees)
|
||||||
return CalcCosineDegrees_Wraparound(degreesUnshifted);
|
return CalcCosineDegrees_Wraparound(degreesUnshifted);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LCRNG_MULTIPLIER 1103515245L
|
#define LCRNG_INCREMENT 24691
|
||||||
#define LCRNG_INCREMENT 24691
|
|
||||||
|
|
||||||
static u32 sLCRNGState;
|
static u32 sLCRNGState;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ static BOOL ov47_0225621C(UnkStruct_ov47_0225621C *param0, PoketchSystem *poketc
|
||||||
{
|
{
|
||||||
VarsFlags *v1 = SaveData_GetVarsFlags(PoketchSystem_GetSaveData(poketchSys));
|
VarsFlags *v1 = SaveData_GetVarsFlags(PoketchSystem_GetSaveData(poketchSys));
|
||||||
|
|
||||||
for (v0 = 0; v0 < HL_MAX; v0++) {
|
for (v0 = 0; v0 < HIDDEN_LOCATION_MAX; v0++) {
|
||||||
param0->unk_04.unk_2C[v0] = SystemVars_CheckHiddenLocation(v1, v0);
|
param0->unk_04.unk_2C[v0] = SystemVars_CheckHiddenLocation(v1, v0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -354,7 +354,7 @@ static void ov48_022564E0(UnkStruct_ov48_0225621C *param0, PoketchSystem *poketc
|
||||||
VarsFlags *v0 = SaveData_GetVarsFlags(PoketchSystem_GetSaveData(poketchSys));
|
VarsFlags *v0 = SaveData_GetVarsFlags(PoketchSystem_GetSaveData(poketchSys));
|
||||||
int v1;
|
int v1;
|
||||||
|
|
||||||
for (v1 = 0; v1 < HL_MAX; v1++) {
|
for (v1 = 0; v1 < HIDDEN_LOCATION_MAX; v1++) {
|
||||||
param0->unk_04.unk_94[v1] = SystemVars_CheckHiddenLocation(v0, v1);
|
param0->unk_04.unk_94[v1] = SystemVars_CheckHiddenLocation(v0, v1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
58
src/scrcmd.c
58
src/scrcmd.c
|
|
@ -647,7 +647,7 @@ static BOOL ScrCmd_26A(ScriptContext *ctx);
|
||||||
static BOOL ScrCmd_26B(ScriptContext *ctx);
|
static BOOL ScrCmd_26B(ScriptContext *ctx);
|
||||||
static BOOL ScrCmd_26C(ScriptContext *ctx);
|
static BOOL ScrCmd_26C(ScriptContext *ctx);
|
||||||
static BOOL ScrCmd_GetGBACartridgeVersion(ScriptContext *ctx);
|
static BOOL ScrCmd_GetGBACartridgeVersion(ScriptContext *ctx);
|
||||||
static BOOL ScrCmd_SetOrClearHiddenLocation(ScriptContext *ctx);
|
static BOOL ScrCmd_SetHiddenLocation(ScriptContext *ctx);
|
||||||
static BOOL ScrCmd_273(ScriptContext *ctx);
|
static BOOL ScrCmd_273(ScriptContext *ctx);
|
||||||
static BOOL ScrCmd_CheckBonusRoundStreak(ScriptContext *ctx);
|
static BOOL ScrCmd_CheckBonusRoundStreak(ScriptContext *ctx);
|
||||||
static BOOL ScrCmd_GetDailyRandomLevel(ScriptContext *ctx);
|
static BOOL ScrCmd_GetDailyRandomLevel(ScriptContext *ctx);
|
||||||
|
|
@ -1387,7 +1387,7 @@ const ScrCmdFunc Unk_020EAC58[] = {
|
||||||
ScrCmd_26D,
|
ScrCmd_26D,
|
||||||
ScrCmd_GetGBACartridgeVersion,
|
ScrCmd_GetGBACartridgeVersion,
|
||||||
ScrCmd_ClearSpiritombCounter,
|
ScrCmd_ClearSpiritombCounter,
|
||||||
ScrCmd_SetOrClearHiddenLocation,
|
ScrCmd_SetHiddenLocation,
|
||||||
ScrCmd_271,
|
ScrCmd_271,
|
||||||
ScrCmd_272,
|
ScrCmd_272,
|
||||||
ScrCmd_273,
|
ScrCmd_273,
|
||||||
|
|
@ -6453,8 +6453,8 @@ static BOOL ScrCmd_211(ScriptContext *ctx)
|
||||||
static BOOL ScrCmd_GetSpiritombCounter(ScriptContext *ctx)
|
static BOOL ScrCmd_GetSpiritombCounter(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
*resultVar = SystemVars_GetSpiritombCounter(varsFlags);
|
*destVar = SystemVars_GetSpiritombCounter(varsFlags);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6486,13 +6486,13 @@ static BOOL ScrCmd_SetNewsPressDeadline(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
u16 deadlineInDays = ScriptContext_GetVar(ctx);
|
u16 deadlineInDays = ScriptContext_GetVar(ctx);
|
||||||
SystemVars_SetNewsPressDeadline(SaveData_GetVarsFlags(ctx->fieldSystem->saveData), deadlineInDays);
|
SystemVars_SetNewsPressDeadline(SaveData_GetVarsFlags(ctx->fieldSystem->saveData), deadlineInDays);
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL ScrCmd_GetNewsPressDeadline(ScriptContext *ctx)
|
static BOOL ScrCmd_GetNewsPressDeadline(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
*resultVar = SystemVars_GetNewsPressDeadline(SaveData_GetVarsFlags(ctx->fieldSystem->saveData));
|
*destVar = SystemVars_GetNewsPressDeadline(SaveData_GetVarsFlags(ctx->fieldSystem->saveData));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7060,13 +7060,13 @@ static BOOL ScrCmd_ClearSpiritombCounter(ScriptContext *ctx)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL ScrCmd_SetOrClearHiddenLocation(ScriptContext *ctx)
|
static BOOL ScrCmd_SetHiddenLocation(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
u16 hiddenLocation = ScriptContext_GetVar(ctx);
|
u16 hiddenLocation = ScriptContext_GetVar(ctx);
|
||||||
u8 toggleOn = ScriptContext_ReadByte(ctx);
|
u8 enable = ScriptContext_ReadByte(ctx);
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
|
|
||||||
if (toggleOn) {
|
if (enable) {
|
||||||
SystemVars_SetHiddenLocationMagic(varsFlags, hiddenLocation);
|
SystemVars_SetHiddenLocationMagic(varsFlags, hiddenLocation);
|
||||||
} else {
|
} else {
|
||||||
SystemVars_ClearHiddenLocation(varsFlags, hiddenLocation);
|
SystemVars_ClearHiddenLocation(varsFlags, hiddenLocation);
|
||||||
|
|
@ -7088,12 +7088,12 @@ static BOOL ScrCmd_273(ScriptContext *ctx)
|
||||||
static BOOL ScrCmd_CheckBonusRoundStreak(ScriptContext *ctx)
|
static BOOL ScrCmd_CheckBonusRoundStreak(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
|
|
||||||
if (SystemVars_GetConsecutiveBonusRoundWins(varsFlags) >= 10) {
|
if (SystemVars_GetConsecutiveBonusRoundWins(varsFlags) >= 10) {
|
||||||
*resultVar = TRUE;
|
*destVar = TRUE;
|
||||||
} else {
|
} else {
|
||||||
*resultVar = FALSE;
|
*destVar = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -7101,8 +7101,8 @@ static BOOL ScrCmd_CheckBonusRoundStreak(ScriptContext *ctx)
|
||||||
|
|
||||||
static BOOL ScrCmd_GetDailyRandomLevel(ScriptContext *ctx)
|
static BOOL ScrCmd_GetDailyRandomLevel(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
*resultVar = SystemVars_GetDailyRandomLevel(SaveData_GetVarsFlags(ctx->fieldSystem->saveData));
|
*destVar = SystemVars_GetDailyRandomLevel(SaveData_GetVarsFlags(ctx->fieldSystem->saveData));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7181,12 +7181,12 @@ static BOOL ScrCmd_27F(ScriptContext *ctx)
|
||||||
static BOOL ScrCmd_CheckIsDepartmentStoreRegular(ScriptContext *ctx)
|
static BOOL ScrCmd_CheckIsDepartmentStoreRegular(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
|
|
||||||
if (SystemVars_GetDepartmentStoreBuyCount(varsFlags) >= 5) {
|
if (SystemVars_GetDepartmentStoreBuyCount(varsFlags) >= 5) {
|
||||||
*resultVar = TRUE;
|
*destVar = TRUE;
|
||||||
} else {
|
} else {
|
||||||
*resultVar = FALSE;
|
*destVar = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -7312,24 +7312,24 @@ static BOOL ScrCmd_285(ScriptContext *ctx)
|
||||||
static BOOL ScrCmd_GetUndergroundItemsGivenAway(ScriptContext *ctx)
|
static BOOL ScrCmd_GetUndergroundItemsGivenAway(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
*resultVar = SystemVars_GetUndergroundItemsGivenAway(varsFlags);
|
*destVar = SystemVars_GetUndergroundItemsGivenAway(varsFlags);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL ScrCmd_GetUndergroundFossilsUnearthed(ScriptContext *ctx)
|
static BOOL ScrCmd_GetUndergroundFossilsUnearthed(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
*resultVar = SystemVars_GetUndergroundFossilsUnearthed(varsFlags);
|
*destVar = SystemVars_GetUndergroundFossilsUnearthed(varsFlags);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL ScrCmd_GetUndergroundTrapsSet(ScriptContext *ctx)
|
static BOOL ScrCmd_GetUndergroundTrapsSet(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
*resultVar = SystemVars_GetUndergroundTrapsSet(varsFlags);
|
*destVar = SystemVars_GetUndergroundTrapsSet(varsFlags);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7399,11 +7399,11 @@ static BOOL ScrCmd_307(ScriptContext *ctx)
|
||||||
static BOOL ScrCmd_CheckDistributionEvent(ScriptContext *ctx)
|
static BOOL ScrCmd_CheckDistributionEvent(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
u8 eventID = ScriptContext_ReadByte(ctx);
|
u8 eventID = ScriptContext_ReadByte(ctx);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
|
|
||||||
GF_ASSERT(eventID <= DISTEVENT_MAX);
|
GF_ASSERT(eventID <= DISTRIBUTION_EVENT_MAX);
|
||||||
*resultVar = SystemVars_CheckDistributionEvent(varsFlags, eventID);
|
*destVar = SystemVars_CheckDistributionEvent(varsFlags, eventID);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7524,8 +7524,8 @@ static BOOL ScrCmd_29E(ScriptContext *ctx)
|
||||||
static BOOL ScrCmd_GetUndergroundTalkCounter(ScriptContext *ctx)
|
static BOOL ScrCmd_GetUndergroundTalkCounter(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
*resultVar = SystemVars_GetUndergroundTalkCounter(varsFlags);
|
*destVar = SystemVars_GetUndergroundTalkCounter(varsFlags);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ static u16 ScriptContext_LoadAndOffsetID(FieldSystem *fieldSystem, ScriptContext
|
||||||
retScriptID -= 10450;
|
retScriptID -= 10450;
|
||||||
} else if (retScriptID >= SCRIPT_ID_POKEMON_CENTER_DAILY_TRAINERS) {
|
} else if (retScriptID >= SCRIPT_ID_POKEMON_CENTER_DAILY_TRAINERS) {
|
||||||
ScriptContext_Load(fieldSystem, ctx, scripts_pokemon_center_daily_trainers, TEXT_BANK_POKEMON_CENTER_DAILY_TRAINERS);
|
ScriptContext_Load(fieldSystem, ctx, scripts_pokemon_center_daily_trainers, TEXT_BANK_POKEMON_CENTER_DAILY_TRAINERS);
|
||||||
retScriptID -= 10400;
|
retScriptID -= SCRIPT_ID_POKEMON_CENTER_DAILY_TRAINERS;
|
||||||
} else if (retScriptID >= 10300) {
|
} else if (retScriptID >= 10300) {
|
||||||
ScriptContext_Load(fieldSystem, ctx, scripts_unk_1051, TEXT_BANK_UNK_0552);
|
ScriptContext_Load(fieldSystem, ctx, scripts_unk_1051, TEXT_BANK_UNK_0552);
|
||||||
retScriptID -= 10300;
|
retScriptID -= 10300;
|
||||||
|
|
@ -231,9 +231,9 @@ static u16 ScriptContext_LoadAndOffsetID(FieldSystem *fieldSystem, ScriptContext
|
||||||
} else if (retScriptID >= 9700) {
|
} else if (retScriptID >= 9700) {
|
||||||
ScriptContext_Load(fieldSystem, ctx, scripts_unk_0422, TEXT_BANK_UNK_0429);
|
ScriptContext_Load(fieldSystem, ctx, scripts_unk_0422, TEXT_BANK_UNK_0429);
|
||||||
retScriptID -= 9700;
|
retScriptID -= 9700;
|
||||||
} else if (retScriptID >= 9600) {
|
} else if (retScriptID >= SCRIPT_ID_OFFSET_INIT_NEW_GAME) {
|
||||||
ScriptContext_Load(fieldSystem, ctx, scripts_unk_0412, TEXT_BANK_COMMON_STRINGS);
|
ScriptContext_Load(fieldSystem, ctx, scripts_init_new_game, TEXT_BANK_COMMON_STRINGS);
|
||||||
retScriptID -= 9600;
|
retScriptID -= SCRIPT_ID_OFFSET_INIT_NEW_GAME;
|
||||||
} else if (retScriptID >= 9500) {
|
} else if (retScriptID >= 9500) {
|
||||||
ScriptContext_Load(fieldSystem, ctx, scripts_unk_0501, TEXT_BANK_UNK_0547);
|
ScriptContext_Load(fieldSystem, ctx, scripts_unk_0501, TEXT_BANK_UNK_0547);
|
||||||
retScriptID -= 9500;
|
retScriptID -= 9500;
|
||||||
|
|
@ -732,7 +732,7 @@ UnkStruct_0203F478 *sub_0203F478(FieldSystem *fieldSystem, int param1)
|
||||||
|
|
||||||
void FieldSystem_InitNewGameState(FieldSystem *fieldSystem)
|
void FieldSystem_InitNewGameState(FieldSystem *fieldSystem)
|
||||||
{
|
{
|
||||||
FieldSystem_RunScript(fieldSystem, 9600);
|
FieldSystem_RunScript(fieldSystem, SCRIPT_ID(INIT_NEW_GAME, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FieldSystem_RunScript(FieldSystem *fieldSystem, u16 scriptID)
|
void FieldSystem_RunScript(FieldSystem *fieldSystem, u16 scriptID)
|
||||||
|
|
|
||||||
|
|
@ -141,10 +141,10 @@ BOOL SystemVars_SetVsSeekerStepCount(VarsFlags *varsFlags, u16 stepCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u16 sDistributionEventMagicNumbers[] = {
|
static const u16 sDistributionEventMagicNumbers[] = {
|
||||||
[DISTEVENT_DARKRAI] = 0x1209,
|
[DISTRIBUTION_EVENT_DARKRAI] = 0x1209,
|
||||||
[DISTEVENT_SHAYMIN] = 0x1112,
|
[DISTRIBUTION_EVENT_SHAYMIN] = 0x1112,
|
||||||
[DISTEVENT_ARCEUS] = 0x1123,
|
[DISTRIBUTION_EVENT_ARCEUS] = 0x1123,
|
||||||
[DISTEVENT_ROTOM] = 0x1103,
|
[DISTRIBUTION_EVENT_ROTOM] = 0x1103,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int GetDistributionEventMagicNumber(enum DistributionEvent eventID)
|
static int GetDistributionEventMagicNumber(enum DistributionEvent eventID)
|
||||||
|
|
@ -164,15 +164,15 @@ BOOL SystemVars_CheckDistributionEvent(VarsFlags *varsFlags, enum DistributionEv
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u16 sHiddenLocationMagicNumbers[] = {
|
static const u16 sHiddenLocationMagicNumbers[] = {
|
||||||
[HL_FULLMOONISLAND] = 0x0208,
|
[HIDDEN_LOCATION_FULLMOON_ISLAND] = 0x0208,
|
||||||
[HL_NEWMOONISLAND] = 0x0229,
|
[HIDDEN_LOCATION_NEWMOON_ISLAND] = 0x0229,
|
||||||
[HL_SPRINGPATH] = 0x0312,
|
[HIDDEN_LOCATION_SPRING_PATH] = 0x0312,
|
||||||
[HL_SEABREAKPATH] = 0x1028,
|
[HIDDEN_LOCATION_SEABREAK_PATH] = 0x1028,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int GetHiddenLocationMagicNumber(enum HiddenLocation hiddenLocation)
|
static int GetHiddenLocationMagicNumber(enum HiddenLocation hiddenLocation)
|
||||||
{
|
{
|
||||||
GF_ASSERT(0 <= hiddenLocation && hiddenLocation < HL_MAX);
|
GF_ASSERT(0 <= hiddenLocation && hiddenLocation < HIDDEN_LOCATION_MAX);
|
||||||
return sHiddenLocationMagicNumbers[hiddenLocation];
|
return sHiddenLocationMagicNumbers[hiddenLocation];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -245,10 +245,12 @@ void SystemVars_RandomizeJubilifeLotteryTrainerID(VarsFlags *varsFlags)
|
||||||
SetJubilifeLotteryTrainerID(varsFlags, HI_AND_LO(hiRand, loRand));
|
SetJubilifeLotteryTrainerID(varsFlags, HI_AND_LO(hiRand, loRand));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define LCRNG_INCREMENT 12345
|
||||||
|
|
||||||
void SystemVars_SynchronizeJubilifeLotteryTrainerID(SaveData *saveData, u16 trainerID)
|
void SystemVars_SynchronizeJubilifeLotteryTrainerID(SaveData *saveData, u16 trainerID)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(saveData);
|
||||||
u32 recordMixedRand = RecordMixedRNG_GetRand(SaveData_GetRecordMixedRNG(saveData)) * 1103515245L + 12345;
|
u32 recordMixedRand = RecordMixedRNG_GetRand(SaveData_GetRecordMixedRNG(saveData)) * LCRNG_MULTIPLIER + LCRNG_INCREMENT;
|
||||||
SetJubilifeLotteryTrainerID(varsFlags, recordMixedRand);
|
SetJubilifeLotteryTrainerID(varsFlags, recordMixedRand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ static u8 sub_02048268(u16 param0, u16 param1);
|
||||||
BOOL ScrCmd_GetJubilifeLotteryTrainerID(ScriptContext *ctx)
|
BOOL ScrCmd_GetJubilifeLotteryTrainerID(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
u32 trainerID = SystemVars_GetJubilifeLotteryTrainerID(varsFlags);
|
u32 trainerID = SystemVars_GetJubilifeLotteryTrainerID(varsFlags);
|
||||||
*resultVar = LO_HALF(trainerID);
|
*destVar = LO_HALF(trainerID);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -538,14 +538,14 @@ static BOOL sub_0204C138(FieldSystem *fieldSystem, void *param1)
|
||||||
return Bag_CanFitItem(v0, 454, 1, 32);
|
return Bag_CanFitItem(v0, 454, 1, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitDarkraiEvent(FieldSystem *fieldSystem, void *param1)
|
static void InitDarkraiEvent(FieldSystem *fieldSystem, void *dummy)
|
||||||
{
|
{
|
||||||
Bag *bag = SaveData_GetBag(fieldSystem->saveData);
|
Bag *bag = SaveData_GetBag(fieldSystem->saveData);
|
||||||
UnkUnion_0204C4D0 *unused = sub_0204B844(fieldSystem);
|
UnkUnion_0204C4D0 *unused = sub_0204B844(fieldSystem);
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
|
||||||
|
|
||||||
Bag_TryAddItem(bag, ITEM_MEMBER_CARD, 1, HEAP_ID_FIELD_TASK);
|
Bag_TryAddItem(bag, ITEM_MEMBER_CARD, 1, HEAP_ID_FIELD_TASK);
|
||||||
SystemVars_SetDistributionEventMagic(varsFlags, DISTEVENT_DARKRAI);
|
SystemVars_SetDistributionEventMagic(varsFlags, DISTRIBUTION_EVENT_DARKRAI);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_0204C190(UnkStruct_0204B830 *param0, u16 *param1, u16 *param2)
|
static void sub_0204C190(UnkStruct_0204B830 *param0, u16 *param1, u16 *param2)
|
||||||
|
|
@ -580,14 +580,14 @@ static BOOL sub_0204C1FC(FieldSystem *fieldSystem, void *param1)
|
||||||
return Bag_CanFitItem(v0, 452, 1, 32);
|
return Bag_CanFitItem(v0, 452, 1, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitShayminEvent(FieldSystem *fieldSystem, void *param1)
|
static void InitShayminEvent(FieldSystem *fieldSystem, void *dummy)
|
||||||
{
|
{
|
||||||
Bag *bag = SaveData_GetBag(fieldSystem->saveData);
|
Bag *bag = SaveData_GetBag(fieldSystem->saveData);
|
||||||
UnkUnion_0204C4D0 *unused = sub_0204B844(fieldSystem);
|
UnkUnion_0204C4D0 *unused = sub_0204B844(fieldSystem);
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
|
||||||
|
|
||||||
Bag_TryAddItem(bag, ITEM_OAKS_LETTER, 1, HEAP_ID_FIELD_TASK);
|
Bag_TryAddItem(bag, ITEM_OAKS_LETTER, 1, HEAP_ID_FIELD_TASK);
|
||||||
SystemVars_SetDistributionEventMagic(varsFlags, DISTEVENT_SHAYMIN);
|
SystemVars_SetDistributionEventMagic(varsFlags, DISTRIBUTION_EVENT_SHAYMIN);
|
||||||
|
|
||||||
if (SystemVars_GetShayminEventState(varsFlags) == 0) {
|
if (SystemVars_GetShayminEventState(varsFlags) == 0) {
|
||||||
SystemVars_SetShayminEventState(varsFlags, 1);
|
SystemVars_SetShayminEventState(varsFlags, 1);
|
||||||
|
|
@ -626,14 +626,14 @@ static BOOL sub_0204C2D0(FieldSystem *fieldSystem, void *param1)
|
||||||
return Bag_CanFitItem(v0, 467, 1, 32);
|
return Bag_CanFitItem(v0, 467, 1, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitRotomEvent(FieldSystem *fieldSystem, void *param1)
|
static void InitRotomEvent(FieldSystem *fieldSystem, void *dummy)
|
||||||
{
|
{
|
||||||
Bag *bag = SaveData_GetBag(fieldSystem->saveData);
|
Bag *bag = SaveData_GetBag(fieldSystem->saveData);
|
||||||
UnkUnion_0204C4D0 *unused = sub_0204B844(fieldSystem);
|
UnkUnion_0204C4D0 *unused = sub_0204B844(fieldSystem);
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
|
||||||
|
|
||||||
Bag_TryAddItem(bag, ITEM_SECRET_KEY, 1, HEAP_ID_FIELD_TASK);
|
Bag_TryAddItem(bag, ITEM_SECRET_KEY, 1, HEAP_ID_FIELD_TASK);
|
||||||
SystemVars_SetDistributionEventMagic(varsFlags, DISTEVENT_ROTOM);
|
SystemVars_SetDistributionEventMagic(varsFlags, DISTRIBUTION_EVENT_ROTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_0204C328(UnkStruct_0204B830 *param0, u16 *param1, u16 *param2)
|
static void sub_0204C328(UnkStruct_0204B830 *param0, u16 *param1, u16 *param2)
|
||||||
|
|
@ -668,14 +668,14 @@ static BOOL sub_0204C394(FieldSystem *fieldSystem, void *param1)
|
||||||
return Bag_CanFitItem(v0, 455, 1, 32);
|
return Bag_CanFitItem(v0, 455, 1, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitArceusEvent(FieldSystem *fieldSystem, void *param1)
|
static void InitArceusEvent(FieldSystem *fieldSystem, void *dummy)
|
||||||
{
|
{
|
||||||
Bag *bag = SaveData_GetBag(fieldSystem->saveData);
|
Bag *bag = SaveData_GetBag(fieldSystem->saveData);
|
||||||
UnkUnion_0204C4D0 *unused = sub_0204B844(fieldSystem);
|
UnkUnion_0204C4D0 *unused = sub_0204B844(fieldSystem);
|
||||||
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
|
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
|
||||||
|
|
||||||
Bag_TryAddItem(bag, ITEM_AZURE_FLUTE, 1, HEAP_ID_FIELD_TASK);
|
Bag_TryAddItem(bag, ITEM_AZURE_FLUTE, 1, HEAP_ID_FIELD_TASK);
|
||||||
SystemVars_SetDistributionEventMagic(varsFlags, DISTEVENT_ARCEUS);
|
SystemVars_SetDistributionEventMagic(varsFlags, DISTRIBUTION_EVENT_ARCEUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_0204C3EC(UnkStruct_0204B830 *param0, u16 *param1, u16 *param2)
|
static void sub_0204C3EC(UnkStruct_0204B830 *param0, u16 *param1, u16 *param2)
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ BOOL ScrCmd_ClearAmitySquareStepCount(ScriptContext *ctx)
|
||||||
|
|
||||||
BOOL ScrCmd_GetAmitySquareStepCount(ScriptContext *ctx)
|
BOOL ScrCmd_GetAmitySquareStepCount(ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
*resultVar = SystemVars_GetAmitySquareStepCount(SaveData_GetVarsFlags(ctx->fieldSystem->saveData));
|
*destVar = SystemVars_GetAmitySquareStepCount(SaveData_GetVarsFlags(ctx->fieldSystem->saveData));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ BOOL ScrCmd_AddItem(ScriptContext *ctx)
|
||||||
FieldSystem *fieldSystem = ctx->fieldSystem;
|
FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||||
u16 item = ScriptContext_GetVar(ctx);
|
u16 item = ScriptContext_GetVar(ctx);
|
||||||
u16 count = ScriptContext_GetVar(ctx);
|
u16 count = ScriptContext_GetVar(ctx);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
|
|
||||||
*resultVar = Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), item, count, HEAP_ID_FIELD);
|
*destVar = Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), item, count, HEAP_ID_FIELD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -27,9 +27,9 @@ BOOL ScrCmd_RemoveItem(ScriptContext *ctx)
|
||||||
FieldSystem *fieldSystem = ctx->fieldSystem;
|
FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||||
u16 item = ScriptContext_GetVar(ctx);
|
u16 item = ScriptContext_GetVar(ctx);
|
||||||
u16 count = ScriptContext_GetVar(ctx);
|
u16 count = ScriptContext_GetVar(ctx);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
|
|
||||||
*resultVar = Bag_TryRemoveItem(SaveData_GetBag(fieldSystem->saveData), item, count, HEAP_ID_FIELD);
|
*destVar = Bag_TryRemoveItem(SaveData_GetBag(fieldSystem->saveData), item, count, HEAP_ID_FIELD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,9 +49,9 @@ BOOL ScrCmd_CheckItem(ScriptContext *ctx)
|
||||||
FieldSystem *fieldSystem = ctx->fieldSystem;
|
FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||||
u16 item = ScriptContext_GetVar(ctx);
|
u16 item = ScriptContext_GetVar(ctx);
|
||||||
u16 count = ScriptContext_GetVar(ctx);
|
u16 count = ScriptContext_GetVar(ctx);
|
||||||
u16 *resultVar = ScriptContext_GetVarPointer(ctx);
|
u16 *destVar = ScriptContext_GetVarPointer(ctx);
|
||||||
|
|
||||||
*resultVar = Bag_CanRemoveItem(SaveData_GetBag(fieldSystem->saveData), item, count, 11);
|
*destVar = Bag_CanRemoveItem(SaveData_GetBag(fieldSystem->saveData), item, count, 11);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1061,7 +1061,7 @@ static u32 sub_02069130(const UnkStruct_020684D0 *param0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SystemVars_CheckDistributionEvent(v0, DISTEVENT_ARCEUS) == FALSE) {
|
if (SystemVars_CheckDistributionEvent(v0, DISTRIBUTION_EVENT_ARCEUS) == FALSE) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ void sub_0206B70C(FieldSystem *fieldSystem, UnkStruct_0203D8AC *param1, int para
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (v1 = 0; v1 < HL_MAX; v1++) {
|
for (v1 = 0; v1 < HIDDEN_LOCATION_MAX; v1++) {
|
||||||
if (SystemVars_CheckHiddenLocation(v8, v1)) {
|
if (SystemVars_CheckHiddenLocation(v8, v1)) {
|
||||||
param1->unk_13C |= (0x1 << v1);
|
param1->unk_13C |= (0x1 << v1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user