Merge pull request #638 from GriffinRichards/doc-ql
Document some quest log
This commit is contained in:
@@ -1 +1 @@
|
||||
gInputToStoreInQuestLogMaybe
|
||||
gFieldInputRecord
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
gQuestLogPlaybackState
|
||||
sNumEventsInLogEntry
|
||||
sMaxActionsInScene
|
||||
gQuestLogFieldInput
|
||||
sCurQuestLogEntry
|
||||
sCurSceneActions
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "constants/easy_chat.h"
|
||||
#include "constants/trainer_card.h"
|
||||
#include "constants/help_system.h"
|
||||
#include "constants/trainer_fan_club.h"
|
||||
#include "constants/mystery_gift.h"
|
||||
.include "asm/macros.inc"
|
||||
.include "asm/macros/event.inc"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 142 B |
@@ -1 +0,0 @@
|
||||
换换烫烫��������������������������������������������������������������������������������烫烫换换
|
||||
+1
-1
@@ -449,7 +449,7 @@ struct BattleStruct
|
||||
u16 castformPalette[MAX_BATTLERS_COUNT][16];
|
||||
u8 wishPerishSongState;
|
||||
u8 wishPerishSongBattlerId;
|
||||
u8 field_182;
|
||||
u8 lastAttackerToFaintOpponent;
|
||||
// align 4
|
||||
union {
|
||||
struct LinkBattlerHeader linkBattlerHeader;
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
#define QL_STATE_PLAYBACK 2
|
||||
#define QL_STATE_PLAYBACK_LAST 3
|
||||
|
||||
#define QL_PLAYBACK_STATE_STOPPED 0
|
||||
#define QL_PLAYBACK_STATE_RUNNING 1
|
||||
#define QL_PLAYBACK_STATE_RECORDING 2
|
||||
#define QL_PLAYBACK_STATE_ACTION_END 3
|
||||
#define QL_PLAYBACK_STATE_RECORDING_NO_DELAY 4
|
||||
|
||||
#define QL_START_NORMAL 1
|
||||
#define QL_START_WARP 2
|
||||
|
||||
@@ -16,9 +22,9 @@
|
||||
|
||||
#define QL_IS_PLAYBACK_STATE (gQuestLogState == QL_STATE_PLAYBACK || gQuestLogState == QL_STATE_PLAYBACK_LAST)
|
||||
|
||||
#define QL_EVENT_0 0 // Null
|
||||
#define QL_EVENT_1 1 // Null
|
||||
#define QL_EVENT_2 2 // Null
|
||||
#define QL_EVENT_INPUT 0 // Null
|
||||
#define QL_EVENT_GFX_CHANGE 1 // Null
|
||||
#define QL_EVENT_MOVEMENT 2 // Null
|
||||
#define QL_EVENT_SWITCHED_PARTY_ORDER 3
|
||||
#define QL_EVENT_USED_ITEM 4
|
||||
#define QL_EVENT_GAVE_HELD_ITEM 5
|
||||
@@ -55,12 +61,12 @@
|
||||
#define QL_EVENT_USED_FIELD_MOVE 36
|
||||
#define QL_EVENT_BOUGHT_ITEM 37
|
||||
#define QL_EVENT_SOLD_ITEM 38
|
||||
#define QL_EVENT_39 39 // Null
|
||||
#define QL_EVENT_OBTAINED_ITEM 40
|
||||
#define QL_EVENT_41 41 // Null
|
||||
#define QL_EVENT_SCENE_END 39 // Null
|
||||
#define QL_EVENT_OBTAINED_STORY_ITEM 40
|
||||
#define QL_EVENT_WAIT 41 // Null
|
||||
#define QL_EVENT_ARRIVED 42
|
||||
|
||||
#define QL_EVENT_USED_POKEMART QL_EVENT_BOUGHT_ITEM - 1 // Used as a start pos for QL_EVENT_BOUGHT_ITEM / QL_EVENT_SOLD_ITEM
|
||||
#define QL_EVENT_USED_POKEMART (QL_EVENT_BOUGHT_ITEM - 1) // Used as a start pos for QL_EVENT_BOUGHT_ITEM / QL_EVENT_SOLD_ITEM
|
||||
|
||||
#define IS_LINK_QL_EVENT(event)((event) >= QL_EVENT_LINK_TRADED && (event) <= QL_EVENT_LINK_BATTLED_UNION)
|
||||
#define IS_VALID_QL_EVENT(event)((event) >= QL_EVENT_SWITCHED_PARTY_ORDER && (event) <= QL_EVENT_ARRIVED)
|
||||
@@ -128,28 +134,23 @@
|
||||
#define QL_DEPARTED_MISC_BUILDING_1 8
|
||||
#define QL_DEPARTED_MISC_BUILDING_2 9
|
||||
|
||||
#define QL_INPUT_OFF 0
|
||||
#define QL_INPUT_UP 1
|
||||
#define QL_INPUT_DOWN 2
|
||||
#define QL_INPUT_LEFT 3
|
||||
#define QL_INPUT_RIGHT 4
|
||||
#define QL_INPUT_L 5
|
||||
#define QL_INPUT_R 6
|
||||
#define QL_INPUT_START 7
|
||||
#define QL_INPUT_OFF 0
|
||||
#define QL_INPUT_UP 1
|
||||
#define QL_INPUT_DOWN 2
|
||||
#define QL_INPUT_LEFT 3
|
||||
#define QL_INPUT_RIGHT 4
|
||||
#define QL_INPUT_L 5
|
||||
#define QL_INPUT_R 6
|
||||
#define QL_INPUT_START 7
|
||||
#define QL_INPUT_SELECT 8
|
||||
#define QL_INPUT_A 9
|
||||
#define QL_INPUT_B 10
|
||||
#define QL_INPUT_A 9
|
||||
#define QL_INPUT_B 10
|
||||
|
||||
|
||||
#define FANCLUB_MEMBER1 0
|
||||
#define FANCLUB_MEMBER2 1
|
||||
#define FANCLUB_MEMBER3 2
|
||||
#define FANCLUB_MEMBER4 3
|
||||
#define FANCLUB_MEMBER5 4
|
||||
#define FANCLUB_MEMBER6 5
|
||||
#define FANCLUB_MEMBER7 6
|
||||
#define FANCLUB_MEMBER8 7
|
||||
|
||||
#define NUM_TRAINER_FAN_CLUB_MEMBERS 8
|
||||
#define QL_ACTION_MOVEMENT 0
|
||||
#define QL_ACTION_GFX_CHANGE 1
|
||||
#define QL_ACTION_INPUT 2
|
||||
#define QL_ACTION_EMPTY 3
|
||||
#define QL_ACTION_WAIT 254
|
||||
#define QL_ACTION_SCENE_END 255
|
||||
|
||||
#endif //GUARD_CONSTANTS_QUEST_LOG_H
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef GUARD_CONSTANTS_TRAINER_FAN_CLUB_H
|
||||
#define GUARD_CONSTANTS_TRAINER_FAN_CLUB_H
|
||||
|
||||
#define FANCLUB_MEMBER1 0
|
||||
#define FANCLUB_MEMBER2 1
|
||||
#define FANCLUB_MEMBER3 2
|
||||
#define FANCLUB_MEMBER4 3
|
||||
#define FANCLUB_MEMBER5 4
|
||||
#define FANCLUB_MEMBER6 5
|
||||
#define FANCLUB_MEMBER7 6
|
||||
#define FANCLUB_MEMBER8 7
|
||||
|
||||
#define NUM_TRAINER_FAN_CLUB_MEMBERS 8
|
||||
|
||||
#endif //GUARD_CONSTANTS_TRAINER_FAN_CLUB_H
|
||||
@@ -126,7 +126,7 @@ void MoveCoords(u8, s16 *, s16 *);
|
||||
bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *);
|
||||
u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *);
|
||||
u8 GetObjectEventIdByPosition(u16 x, u16 y, u8 elevation);
|
||||
void UpdateQuestLogObjectEventCurrentMovement(struct ObjectEvent *, struct Sprite *);
|
||||
void QL_UpdateObjectEventCurrentMovement(struct ObjectEvent *, struct Sprite *);
|
||||
bool8 ObjectEventSetHeldMovement(struct ObjectEvent *, u8);
|
||||
void ShiftStillObjectEventCoords(struct ObjectEvent *);
|
||||
void OverrideMovementTypeForObjectEvent(const struct ObjectEvent *, u8);
|
||||
|
||||
@@ -21,7 +21,7 @@ struct FieldInput
|
||||
u8 dpadDirection;
|
||||
};
|
||||
|
||||
extern struct FieldInput gInputToStoreInQuestLogMaybe;
|
||||
extern struct FieldInput gFieldInputRecord;
|
||||
|
||||
void RestartWildEncounterImmunitySteps(void);
|
||||
void ClearPoisonStepCounter(void);
|
||||
|
||||
+13
-14
@@ -550,7 +550,7 @@ struct RecordMixingDayCareMail
|
||||
bool16 holdsItem[DAYCARE_MON_COUNT];
|
||||
};
|
||||
|
||||
struct QuestLogNPCData
|
||||
struct QuestLogObjectEventTemplate
|
||||
{
|
||||
u32 x:8;
|
||||
u32 negx:1;
|
||||
@@ -579,12 +579,12 @@ struct QuestLogObjectEvent
|
||||
/*0x01*/ u8 spriteAffineAnimPausedBackup:1;
|
||||
/*0x01*/ u8 disableJumpLandingGroundEffect:1;
|
||||
/*0x02*/ u8 fixedPriority:1;
|
||||
/*0x02*/ u8 mapobj_unk_18:4;
|
||||
/*0x02*/ u8 unused_02_5:3;
|
||||
/*0x03*/ u8 mapobj_unk_0B_0:4;
|
||||
/*0x03*/ u8 elevation:4;
|
||||
/*0x02*/ u8 facingDirection:4;
|
||||
/*0x02*/ u8 unused:3;
|
||||
/*0x03*/ u8 currentElevation:4;
|
||||
/*0x03*/ u8 previousElevation:4;
|
||||
/*0x04*/ u8 graphicsId;
|
||||
/*0x05*/ u8 animPattern;
|
||||
/*0x05*/ u8 movementType;
|
||||
/*0x06*/ u8 trainerType;
|
||||
/*0x07*/ u8 localId;
|
||||
/*0x08*/ u8 mapNum;
|
||||
@@ -597,21 +597,20 @@ struct QuestLogObjectEvent
|
||||
/*0x11*/ u8 animId;
|
||||
};
|
||||
|
||||
struct QuestLog
|
||||
// This represents all the data needed to display a single scene for the "Quest Log" when the player resumes playing.
|
||||
//
|
||||
struct QuestLogScene
|
||||
{
|
||||
/*0x0000*/ u8 startType;
|
||||
/*0x0000*/ u8 startType; // QL_START_NORMAL / QL_START_WARP
|
||||
/*0x0001*/ u8 mapGroup;
|
||||
/*0x0002*/ u8 mapNum;
|
||||
/*0x0003*/ u8 warpId;
|
||||
/*0x0004*/ s16 x;
|
||||
/*0x0006*/ s16 y;
|
||||
/*0x0008*/ struct QuestLogObjectEvent unk_008[OBJECT_EVENTS_COUNT];
|
||||
|
||||
// These arrays hold the game state for
|
||||
// playing back the quest log
|
||||
/*0x0008*/ struct QuestLogObjectEvent objectEvents[OBJECT_EVENTS_COUNT];
|
||||
/*0x0148*/ u8 flags[NUM_FLAG_BYTES];
|
||||
/*0x02c8*/ u16 vars[VARS_COUNT];
|
||||
/*0x0468*/ struct QuestLogNPCData npcData[64];
|
||||
/*0x0468*/ struct QuestLogObjectEventTemplate objectEventTemplates[OBJECT_EVENT_TEMPLATES_COUNT];
|
||||
/*0x0568*/ u16 script[128];
|
||||
/*0x0668*/ u16 end[0];
|
||||
};
|
||||
@@ -780,7 +779,7 @@ struct SaveBlock1
|
||||
/*0x0EE0*/ u8 flags[NUM_FLAG_BYTES];
|
||||
/*0x1000*/ u16 vars[VARS_COUNT];
|
||||
/*0x1200*/ u32 gameStats[NUM_GAME_STATS];
|
||||
/*0x1300*/ struct QuestLog questLog[QUEST_LOG_SCENE_COUNT];
|
||||
/*0x1300*/ struct QuestLogScene questLog[QUEST_LOG_SCENE_COUNT];
|
||||
/*0x2CA0*/ u16 easyChatProfile[EASY_CHAT_BATTLE_WORDS_COUNT];
|
||||
/*0x2CAC*/ u16 easyChatBattleStart[EASY_CHAT_BATTLE_WORDS_COUNT];
|
||||
/*0x2CB8*/ u16 easyChatBattleWon[EASY_CHAT_BATTLE_WORDS_COUNT];
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "pokemon_storage_system.h"
|
||||
#include "mon_markings.h"
|
||||
#include "quest_log.h"
|
||||
|
||||
// The maximum number of Pokémon icons that can appear on-screen.
|
||||
// By default the limit is 40 (though in practice only 37 can be).
|
||||
@@ -273,14 +274,6 @@ struct PokeStorageItemIcon
|
||||
u8 active;
|
||||
};
|
||||
|
||||
struct PokeStorageQuestLogData
|
||||
{
|
||||
u16 species1;
|
||||
u16 species2;
|
||||
u8 box1;
|
||||
u8 box2;
|
||||
};
|
||||
|
||||
struct PokemonStorageSystemData
|
||||
{
|
||||
u8 state;
|
||||
@@ -426,7 +419,7 @@ struct PokemonStorageSystemData
|
||||
struct PokeStorageItemIcon itemIcons[MAX_ITEM_ICONS];
|
||||
u16 movingItemId;
|
||||
u16 itemInfoWindowOffset;
|
||||
struct PokeStorageQuestLogData pokeStorageQuestLogData;
|
||||
struct QuestLogEvent_MovedBoxMon questLogData;
|
||||
u16 unusedField2;
|
||||
u16 displayMonPalOffset;
|
||||
u16 *displayMonTilePtr;
|
||||
|
||||
+188
-49
@@ -3,63 +3,202 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "quest_log_battle.h"
|
||||
#include "constants/quest_log.h"
|
||||
#include "field_control_avatar.h"
|
||||
#include "constants/quest_log.h"
|
||||
#include "constants/battle.h"
|
||||
|
||||
// Layout of Quest Log script commands
|
||||
#define QL_CMD_EVENT_MASK 0x0FFF
|
||||
#define QL_CMD_COUNT_SHIFT 12
|
||||
#define QL_CMD_COUNT_MASK (0xF << QL_CMD_COUNT_SHIFT)
|
||||
|
||||
// Parameter to QuestLog_OnEscalatorWarp
|
||||
#define QL_ESCALATOR_OUT 1
|
||||
#define QL_ESCALATOR_IN 2
|
||||
|
||||
struct QuestLogEntry
|
||||
struct QuestLogAction
|
||||
{
|
||||
// When command == 2, these fields have different meanings
|
||||
u8 localId; // cmd == 2: Pressed A/B, checked wild, held direction, took step
|
||||
u8 mapNum; // cmd == 2: Always set to 0
|
||||
u8 mapGroup; // cmd == 2: Dpad direction
|
||||
u8 animId; // cmd == 2: Always set to 0
|
||||
union {
|
||||
struct {
|
||||
u8 localId;
|
||||
u8 mapNum;
|
||||
u8 mapGroup;
|
||||
u8 movementActionId;
|
||||
} a; // Data when type == 0
|
||||
struct {
|
||||
u8 localId;
|
||||
u8 mapNum;
|
||||
u8 mapGroup;
|
||||
u8 gfxState;
|
||||
} b; // Data when type == 1
|
||||
u8 fieldInput[4]; // Data when type == 2
|
||||
u8 raw[4];
|
||||
} data;
|
||||
u16 duration;
|
||||
u8 command;
|
||||
u8 type;
|
||||
};
|
||||
|
||||
struct UnkStruct_203B044
|
||||
struct QuestLogRepeatEventTracker
|
||||
{
|
||||
u8 id;
|
||||
u8 unk_1;
|
||||
u16 unk_2;
|
||||
u8 numRepeats;
|
||||
u16 counter;
|
||||
};
|
||||
|
||||
// Event data structs
|
||||
|
||||
// QL_EVENT_SWITCHED_PARTY_ORDER
|
||||
struct QuestLogEvent_SwitchedPartyOrder
|
||||
{
|
||||
u16 species1;
|
||||
u16 species2;
|
||||
};
|
||||
|
||||
// QL_EVENT_USED_ITEM
|
||||
// QL_EVENT_GAVE_HELD_ITEM
|
||||
// QL_EVENT_GAVE_HELD_ITEM_BAG
|
||||
// QL_EVENT_GAVE_HELD_ITEM_PC
|
||||
// QL_EVENT_TOOK_HELD_ITEM
|
||||
// QL_EVENT_DEPOSITED_ITEM_PC
|
||||
// QL_EVENT_WITHDREW_ITEM_PC
|
||||
struct QuestLogEvent_Item
|
||||
{
|
||||
u16 itemId;
|
||||
u16 unused;
|
||||
u16 species;
|
||||
u16 itemParam;
|
||||
};
|
||||
|
||||
// QL_EVENT_SWAPPED_HELD_ITEM
|
||||
// QL_EVENT_SWAPPED_HELD_ITEM_PC
|
||||
struct QuestLogEvent_SwappedHeldItem
|
||||
{
|
||||
u16 takenItemId;
|
||||
u16 givenItemId;
|
||||
u16 species;
|
||||
};
|
||||
|
||||
// QL_EVENT_LINK_TRADED
|
||||
// QL_EVENT_LINK_TRADED_UNION
|
||||
struct QuestLogEvent_Traded
|
||||
{
|
||||
u16 speciesSent;
|
||||
u16 speciesReceived;
|
||||
u8 partnerName[PLAYER_NAME_LENGTH];
|
||||
};
|
||||
|
||||
// QL_EVENT_LINK_BATTLED_SINGLE
|
||||
// QL_EVENT_LINK_BATTLED_DOUBLE
|
||||
// QL_EVENT_LINK_BATTLED_MULTI
|
||||
// QL_EVENT_LINK_BATTLED_UNION
|
||||
struct QuestLogEvent_LinkBattle
|
||||
{
|
||||
u8 outcome;
|
||||
u8 playerNames[MAX_BATTLERS_COUNT - 1][PLAYER_NAME_LENGTH];
|
||||
};
|
||||
|
||||
// QL_EVENT_SWITCHED_MONS_BETWEEN_BOXES
|
||||
// QL_EVENT_SWITCHED_MONS_WITHIN_BOX
|
||||
// QL_EVENT_SWITCHED_PARTY_MON_FOR_PC_MON
|
||||
// QL_EVENT_MOVED_MON_BETWEEN_BOXES
|
||||
// QL_EVENT_MOVED_MON_WITHIN_BOX
|
||||
// QL_EVENT_WITHDREW_MON_PC
|
||||
// QL_EVENT_DEPOSITED_MON_PC
|
||||
// QL_EVENT_SWITCHED_MULTIPLE_MONS
|
||||
struct QuestLogEvent_MovedBoxMon
|
||||
{
|
||||
u16 species1;
|
||||
u16 species2;
|
||||
u8 box1;
|
||||
u8 box2;
|
||||
};
|
||||
|
||||
// QL_EVENT_DEFEATED_TRAINER
|
||||
// QL_EVENT_DEFEATED_GYM_LEADER
|
||||
// QL_EVENT_DEFEATED_E4_MEMBER
|
||||
// QL_EVENT_DEFEATED_CHAMPION
|
||||
struct QuestLogEvent_TrainerBattle
|
||||
{
|
||||
u16 trainerId;
|
||||
u16 speciesOpponent;
|
||||
u16 speciesPlayer;
|
||||
u8 hpFractionId;
|
||||
u8 mapSec;
|
||||
};
|
||||
|
||||
// QL_EVENT_DEFEATED_WILD_MON
|
||||
struct QuestLogEvent_WildBattle
|
||||
{
|
||||
u16 defeatedSpecies;
|
||||
u16 caughtSpecies;
|
||||
u8 mapSec;
|
||||
};
|
||||
|
||||
// QL_EVENT_DEPARTED
|
||||
struct QuestLogEvent_Departed
|
||||
{
|
||||
u8 mapSec;
|
||||
u8 locationId;
|
||||
};
|
||||
|
||||
// QL_EVENT_USED_FIELD_MOVE
|
||||
struct QuestLogEvent_FieldMove
|
||||
{
|
||||
u16 species;
|
||||
u8 fieldMove;
|
||||
u8 mapSec;
|
||||
};
|
||||
|
||||
// QL_EVENT_BOUGHT_ITEM
|
||||
// QL_EVENT_SOLD_ITEM
|
||||
struct QuestLogEvent_Shop
|
||||
{
|
||||
u32 totalMoney; // Total amount of money spent buying or earned selling
|
||||
u16 lastItemId;
|
||||
u16 itemQuantity; // Total number of items bought or sold
|
||||
u8 mapSec;
|
||||
bool8 hasMultipleTransactions;
|
||||
u8 logEventId; // Either 0 (empty), 1 (bought) or 2 (sold)
|
||||
};
|
||||
|
||||
// QL_EVENT_OBTAINED_STORY_ITEM
|
||||
struct QuestLogEvent_StoryItem
|
||||
{
|
||||
u16 itemId;
|
||||
u8 mapSec;
|
||||
};
|
||||
|
||||
extern u8 gQuestLogState;
|
||||
extern u8 gQuestLogPlaybackState;
|
||||
extern struct FieldInput gQuestLogFieldInput;
|
||||
extern struct UnkStruct_203B044 gUnknown_203B044;
|
||||
extern u16 *gUnknown_203AE04;
|
||||
extern u16 *sEventRecordingPointer;
|
||||
extern u16 sQuestLogCursor;
|
||||
extern struct QuestLogRepeatEventTracker gQuestLogRepeatEventTracker;
|
||||
extern u16 *gQuestLogDefeatedWildMonRecord;
|
||||
extern u16 *gQuestLogRecordingPointer;
|
||||
extern u16 gQuestLogCurActionIdx;
|
||||
|
||||
void QuestLogRecordPlayerAvatarGfxTransition(u8);
|
||||
void SetQuestLogEvent(u16, const u16 *);
|
||||
void SetQLPlayedTheSlots(void);
|
||||
void QuestLog_RecordEnteredMap(u16);
|
||||
u8 sub_8112CAC(void);
|
||||
bool8 QuestLog_SchedulePlaybackCB(void (*func)(void));
|
||||
u8 QL_GetPlaybackState(void);
|
||||
bool8 QL_AvoidDisplay(void (*func)(void));
|
||||
void QuestLog_BackUpPalette(u16 offset, u16 size);
|
||||
void CommitQuestLogWindow1(void);
|
||||
void QuestLog_DrawPreviouslyOnQuestHeaderIfInPlaybackMode(void);
|
||||
void ResetQuestLog(void);
|
||||
void ResetTrainerFanClub(void);
|
||||
void TrySetUpQuestLogScenes_ElseContinueFromSave(u8 taskId);
|
||||
void TryStartQuestLogPlayback(u8 taskId);
|
||||
void SaveQuestLogData(void);
|
||||
void QuestLog_CutRecording(void);
|
||||
u8 sub_8112CAC(void);
|
||||
void ResetDeferredLinkEvent(void);
|
||||
void FinishRecordingQuestLogScene(void);
|
||||
void QL_FinishRecordingScene(void);
|
||||
void QuestLogEvents_HandleEndTrainerBattle(void);
|
||||
void *QuestLogGetFlagOrVarPtr(bool8 isFlag, u16 idx);
|
||||
void QuestLogSetFlagOrVar(bool8 isFlag, u16 idx, u16 value);
|
||||
void SetQuestLogRecordAndPlaybackPointers(void *oldSave);
|
||||
void sub_811246C(struct Sprite *sprite);
|
||||
void QL_AddASLROffset(void *oldSaveBlockPtr);
|
||||
void QL_UpdateObject(struct Sprite *sprite);
|
||||
void QuestLogRecordNPCStep(u8 a0, u8 a1, u8 a2, u8 a3);
|
||||
bool8 sub_8111C2C(void);
|
||||
bool8 QL_IsTrainerSightDisabled(void);
|
||||
void QuestLog_OnEscalatorWarp(u8 direction);
|
||||
void QuestLogRecordPlayerAvatarGfxTransitionWithDuration(u8 movementActionId, u8 duration);
|
||||
void Special_UpdateTrainerFansAfterLinkBattle(void);
|
||||
@@ -67,39 +206,39 @@ void QuestLogRecordPlayerStep(u8 movementActionId);
|
||||
void QuestLogRecordPlayerStepWithDuration(u8 movementActionId, u8 duration);
|
||||
void QuestLogRecordNPCStepWithDuration(u8 localId, u8 mapNum, u8 mapGroup, u8 movementActionId, u8 duration);
|
||||
void QL_AfterRecordFishActionSuccessful(void);
|
||||
void sub_8110920(void);
|
||||
void sub_8111708(void);
|
||||
void sub_81127F8(struct FieldInput * a0);
|
||||
void sub_8112B3C(void);
|
||||
void QL_ResetDefeatedWildMonRecord(void);
|
||||
void QL_RestoreMapLayoutId(void);
|
||||
void QL_RecordFieldInput(struct FieldInput * fieldInput);
|
||||
void QL_TryRunActions(void);
|
||||
void RunQuestLogCB(void);
|
||||
void sub_8111C68(void);
|
||||
void QL_HandleInput(void);
|
||||
bool8 QuestLogScenePlaybackIsEnding(void);
|
||||
void sub_8115798(void);
|
||||
void SetQuestLogEvent_Arrived(void);
|
||||
bool8 QuestLog_ShouldEndSceneOnMapChange(void);
|
||||
void QuestLog_AdvancePlayhead_(void);
|
||||
void QuestLog_InitPalettesBackup(void);
|
||||
void sub_8110FCC(void);
|
||||
void QL_InitSceneObjectsAndActions(void);
|
||||
u8 GetQuestLogStartType(void);
|
||||
void sub_81113E4(void);
|
||||
void sub_8111438(void);
|
||||
void StartRecordingQuestLogEntry(u16 eventId);
|
||||
bool8 WillCommandOfSizeFitInSav1Record(u16 *cursor, size_t size);
|
||||
bool8 sub_8110944(const void *a0, size_t cmdSize);
|
||||
void QL_CopySaveState(void);
|
||||
void QL_ResetPartyAndPC(void);
|
||||
void QL_StartRecordingAction(u16 eventId);
|
||||
bool8 QL_IsRoomToSaveAction(const void *cursor, size_t size);
|
||||
bool8 QL_IsRoomToSaveEvent(const void *cursor, size_t size);
|
||||
|
||||
void sub_8113BD8(void);
|
||||
void ResetUnk203B044(void);
|
||||
u16 *TryRecordEvent39_NoParams(u16 *);
|
||||
u16 *sub_8113C8C(u16 *, struct QuestLogEntry *);
|
||||
u16 *sub_8113CC8(u16 *, struct QuestLogEntry *);
|
||||
u16 *sub_8113D08(u16 *, struct QuestLogEntry *);
|
||||
u16 *sub_8113D48(u16 *, struct QuestLogEntry *);
|
||||
u16 *sub_8113D94(u16 *, struct QuestLogEntry *);
|
||||
void QL_ResetEventStates(void);
|
||||
void QL_ResetRepeatEventTracker(void);
|
||||
u16 *QL_RecordAction_SceneEnd(u16 *);
|
||||
u16 *QL_LoadAction_Wait(u16 *, struct QuestLogAction *);
|
||||
u16 *QL_RecordAction_Input(u16 *, struct QuestLogAction *);
|
||||
u16 *QL_LoadAction_Input(u16 *, struct QuestLogAction *);
|
||||
u16 *QL_RecordAction_MovementOrGfxChange(u16 *, struct QuestLogAction *);
|
||||
u16 *QL_LoadAction_MovementOrGfxChange(u16 *, struct QuestLogAction *);
|
||||
void QL_EnableRecordingSteps(void);
|
||||
u16 *QuestLog_SkipCommand(u16 *, u16 **);
|
||||
void sub_8113ABC(const u16 *);
|
||||
u16 *sub_8113C20(u16 *, struct QuestLogEntry *);
|
||||
bool8 sub_8113AE8(const u16 *);
|
||||
bool8 sub_8113B44(const u16 *);
|
||||
void TryRecordEvent41_IncCursor(u16);
|
||||
u16 *QL_SkipCommand(u16 *, u16 **);
|
||||
void QL_UpdateLastDepartedLocation(const u16 *);
|
||||
u16 *QL_LoadAction_SceneEnd(u16 *, struct QuestLogAction *);
|
||||
bool8 QL_LoadEvent(const u16 *);
|
||||
bool8 QL_TryRepeatEvent(const u16 *);
|
||||
void QL_RecordWait(u16);
|
||||
|
||||
#endif //GUARD_QUEST_LOG_H
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
void SetQuestLogObjectEventsData(struct QuestLog *);
|
||||
void SetSav1ObjectEventsFromQuestLog(struct QuestLog *, struct ObjectEventTemplate *);
|
||||
void sub_815A540(void);
|
||||
void QL_RecordObjects(struct QuestLogScene *);
|
||||
void QL_LoadObjects(struct QuestLogScene *, struct ObjectEventTemplate *);
|
||||
void QL_TryStopSurfing(void);
|
||||
|
||||
#endif //GUARD_QUEST_LOG_OBJECTS_H
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#define QL_PLAYER_GFX_NORMAL 0
|
||||
#define QL_PLAYER_GFX_BIKE 1
|
||||
#define QL_PLAYER_GFX_FISH 2
|
||||
#define QL_PLAYER_GFX_SURF 3
|
||||
#define QL_PLAYER_GFX_STOP_SURF_S 4
|
||||
#define QL_PLAYER_GFX_STOP_SURF_N 5
|
||||
#define QL_PLAYER_GFX_STOP_SURF_W 6
|
||||
#define QL_PLAYER_GFX_STOP_SURF_E 7
|
||||
#define QL_PLAYER_GFX_VSSEEKER 8
|
||||
enum {
|
||||
QL_PLAYER_GFX_NORMAL,
|
||||
QL_PLAYER_GFX_BIKE,
|
||||
QL_PLAYER_GFX_FISH,
|
||||
QL_PLAYER_GFX_SURF,
|
||||
QL_PLAYER_GFX_STOP_SURF_S,
|
||||
QL_PLAYER_GFX_STOP_SURF_N,
|
||||
QL_PLAYER_GFX_STOP_SURF_W,
|
||||
QL_PLAYER_GFX_STOP_SURF_E,
|
||||
QL_PLAYER_GFX_VSSEEKER,
|
||||
QL_PLAYER_GFX_NONE = 0xFF
|
||||
};
|
||||
|
||||
|
||||
void QuestLogUpdatePlayerSprite(u8 state);
|
||||
bool32 QuestLogTryRecordPlayerAvatarGfxTransition(u8 state);
|
||||
|
||||
@@ -14,7 +14,7 @@ bool8 CreatePCMenu(void);
|
||||
void ScriptMenu_DisplayPCStartupPrompt(void);
|
||||
|
||||
bool8 (*ScriptMenu_HidePokemonPic(void))(void);
|
||||
void QLPlaybackCB_DestroyScriptMenuMonPicSprites(void);
|
||||
void QL_DestroyAbortedDisplay(void);
|
||||
void PicboxCancel(void);
|
||||
|
||||
#endif //GUARD_SCRIPT_MENU_H
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ void CreatePokemartMenu(const u16 *itemsForSale);
|
||||
void CreateDecorationShop1Menu(const u16 *);
|
||||
void CreateDecorationShop2Menu(const u16 *);
|
||||
u8 GetMartFontId(void);
|
||||
void RecordItemPurchase(u16 a0, u16 a1, u8 a2);
|
||||
void RecordItemTransaction(u16 itemId, u16 quantity, u8 logEventId);
|
||||
|
||||
// buy_menu_helper
|
||||
void BuyMenuInitWindows(bool32 isSellingTM);
|
||||
|
||||
@@ -2882,7 +2882,7 @@ static void Cmd_tryfaintmon(void)
|
||||
if (gBattleResults.opponentFaintCounter < 255)
|
||||
gBattleResults.opponentFaintCounter++;
|
||||
gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES);
|
||||
*(u8 *)(&gBattleStruct->field_182) = gBattlerAttacker;
|
||||
*(u8 *)(&gBattleStruct->lastAttackerToFaintOpponent) = gBattlerAttacker;
|
||||
}
|
||||
if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0)
|
||||
{
|
||||
|
||||
+2
-2
@@ -807,13 +807,13 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data)
|
||||
SetMapVarsToTrainer();
|
||||
return EventScript_TryDoDoubleTrainerBattle;
|
||||
case TRAINER_BATTLE_REMATCH_DOUBLE:
|
||||
FinishRecordingQuestLogScene();
|
||||
QL_FinishRecordingScene();
|
||||
TrainerBattleLoadArgs(sDoubleBattleParams, data);
|
||||
SetMapVarsToTrainer();
|
||||
gTrainerBattleOpponent_A = GetRematchTrainerId(gTrainerBattleOpponent_A);
|
||||
return EventScript_TryDoDoubleRematchBattle;
|
||||
case TRAINER_BATTLE_REMATCH:
|
||||
FinishRecordingQuestLogScene();
|
||||
QL_FinishRecordingScene();
|
||||
TrainerBattleLoadArgs(sOrdinaryBattleParams, data);
|
||||
SetMapVarsToTrainer();
|
||||
gTrainerBattleOpponent_A = GetRematchTrainerId(gTrainerBattleOpponent_A);
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@
|
||||
#include "pokemon_storage_system.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/quest_log.h"
|
||||
|
||||
struct BerryPouchStruct_203F36C
|
||||
{
|
||||
@@ -1384,7 +1385,7 @@ static void Task_SellBerries_PlaySfxAndRemoveBerries(u8 taskId)
|
||||
PlaySE(SE_SHOP);
|
||||
RemoveBagItem(gSpecialVar_ItemId, data[8]);
|
||||
AddMoney(&gSaveBlock1Ptr->money, ItemId_GetPrice(gSpecialVar_ItemId) / 2 * data[8]);
|
||||
RecordItemPurchase(gSpecialVar_ItemId, data[8], 2);
|
||||
RecordItemTransaction(gSpecialVar_ItemId, data[8], QL_EVENT_SOLD_ITEM - QL_EVENT_USED_POKEMART);
|
||||
DestroyListMenuTask(data[0], &sStaticCnt.listMenuScrollOffset, &sStaticCnt.listMenuSelectedRow);
|
||||
SortAndCountBerries();
|
||||
SanitizeListMenuSelectionParams();
|
||||
|
||||
+9
-9
@@ -114,15 +114,15 @@ void DisplayBerryPowderVendorMenu(void)
|
||||
{
|
||||
struct WindowTemplate template;
|
||||
|
||||
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
|
||||
{
|
||||
template = SetWindowTemplateFields(0, 1, 1, 8, 3, 15, 32);
|
||||
sBerryPowderVendorWindowId = AddWindow(&template);
|
||||
FillWindowPixelBuffer(sBerryPowderVendorWindowId, 0);
|
||||
PutWindowTilemap(sBerryPowderVendorWindowId);
|
||||
LoadStdWindowGfx(sBerryPowderVendorWindowId, 0x21D, BG_PLTT_ID(13));
|
||||
DrawPlayerPowderAmount(sBerryPowderVendorWindowId, 0x21D, 13, GetBerryPowder());
|
||||
}
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay) == TRUE)
|
||||
return;
|
||||
|
||||
template = SetWindowTemplateFields(0, 1, 1, 8, 3, 15, 32);
|
||||
sBerryPowderVendorWindowId = AddWindow(&template);
|
||||
FillWindowPixelBuffer(sBerryPowderVendorWindowId, 0);
|
||||
PutWindowTilemap(sBerryPowderVendorWindowId);
|
||||
LoadStdWindowGfx(sBerryPowderVendorWindowId, 0x21D, BG_PLTT_ID(13));
|
||||
DrawPlayerPowderAmount(sBerryPowderVendorWindowId, 0x21D, 13, GetBerryPowder());
|
||||
}
|
||||
|
||||
void RemoveBerryPowderVendorMenu(void)
|
||||
|
||||
+7
-7
@@ -192,15 +192,15 @@ u16 *GetVarPointer(u16 idx)
|
||||
{
|
||||
switch (gQuestLogPlaybackState)
|
||||
{
|
||||
case 0:
|
||||
case QL_PLAYBACK_STATE_STOPPED:
|
||||
default:
|
||||
break;
|
||||
case 1:
|
||||
case QL_PLAYBACK_STATE_RUNNING:
|
||||
ptr = QuestLogGetFlagOrVarPtr(FALSE, idx);
|
||||
if (ptr != NULL)
|
||||
gSaveBlock1Ptr->vars[idx - VARS_START] = *ptr;
|
||||
break;
|
||||
case 2:
|
||||
case QL_PLAYBACK_STATE_RECORDING:
|
||||
if (IsFlagOrVarStoredInQuestLog(idx - VARS_START, TRUE) == TRUE)
|
||||
{
|
||||
gLastQuestLogStoredFlagOrVarIdx = idx - VARS_START;
|
||||
@@ -263,15 +263,15 @@ u8 *GetFlagAddr(u16 idx)
|
||||
{
|
||||
switch (gQuestLogPlaybackState)
|
||||
{
|
||||
case 0:
|
||||
case QL_PLAYBACK_STATE_STOPPED:
|
||||
default:
|
||||
break;
|
||||
case 1:
|
||||
case QL_PLAYBACK_STATE_RUNNING:
|
||||
ptr = QuestLogGetFlagOrVarPtr(TRUE, idx);
|
||||
if (ptr != NULL)
|
||||
gSaveBlock1Ptr->flags[idx >> 3] = *ptr;
|
||||
gSaveBlock1Ptr->flags[idx / 8] = *ptr;
|
||||
break;
|
||||
case 2:
|
||||
case QL_PLAYBACK_STATE_RECORDING:
|
||||
if (IsFlagOrVarStoredInQuestLog(idx, FALSE) == TRUE)
|
||||
{
|
||||
gLastQuestLogStoredFlagOrVarIdx = idx;
|
||||
|
||||
@@ -1677,8 +1677,8 @@ void CopyObjectGraphicsInfoToSpriteTemplate(u16 graphicsId, void (*callback)(str
|
||||
|
||||
do
|
||||
{
|
||||
if (ScriptContext_IsEnabled() != TRUE && sub_8112CAC() == 1)
|
||||
spriteTemplate->callback = sub_811246C;
|
||||
if (ScriptContext_IsEnabled() != TRUE && QL_GetPlaybackState() == QL_PLAYBACK_STATE_RUNNING)
|
||||
spriteTemplate->callback = QL_UpdateObject;
|
||||
else
|
||||
spriteTemplate->callback = callback;
|
||||
} while (0);
|
||||
@@ -5046,7 +5046,7 @@ bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *objectEvent)
|
||||
|
||||
bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementActionId)
|
||||
{
|
||||
if(sub_8112CAC() == TRUE)
|
||||
if (QL_GetPlaybackState() == QL_PLAYBACK_STATE_RUNNING)
|
||||
ObjectEventClearHeldMovementIfActive(objectEvent);
|
||||
else if (ObjectEventIsMovementOverridden(objectEvent))
|
||||
return TRUE;
|
||||
@@ -5122,7 +5122,7 @@ void UpdateObjectEventCurrentMovement(struct ObjectEvent *objectEvent, struct Sp
|
||||
ObjectEventUpdateSubpriority(objectEvent, sprite);
|
||||
}
|
||||
|
||||
void UpdateQuestLogObjectEventCurrentMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
void QL_UpdateObjectEventCurrentMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
{
|
||||
DoGroundEffects_OnSpawn(objectEvent, sprite);
|
||||
TryEnableObjectEventAnim(objectEvent, sprite);
|
||||
@@ -5262,15 +5262,13 @@ static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *objectEvent
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void ObjectEventSetSingleMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 animId)
|
||||
static void ObjectEventSetSingleMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 movementActionId)
|
||||
{
|
||||
objectEvent->movementActionId = animId;
|
||||
objectEvent->movementActionId = movementActionId;
|
||||
sprite->data[2] = 0;
|
||||
|
||||
if (gQuestLogPlaybackState == 2)
|
||||
{
|
||||
QuestLogRecordNPCStep(objectEvent->localId, objectEvent->mapNum, objectEvent->mapGroup, animId);
|
||||
}
|
||||
if (gQuestLogPlaybackState == QL_PLAYBACK_STATE_RECORDING)
|
||||
QuestLogRecordNPCStep(objectEvent->localId, objectEvent->mapNum, objectEvent->mapGroup, movementActionId);
|
||||
}
|
||||
|
||||
static void FaceDirection(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction)
|
||||
|
||||
+12
-12
@@ -71,7 +71,7 @@ static bool8 TryDoorWarp(struct MapPosition * position, u16 metatileBehavior, u8
|
||||
static s8 GetWarpEventAtPosition(struct MapHeader * mapHeader, u16 x, u16 y, u8 z);
|
||||
static const u8 *GetCoordEventScriptAtPosition(struct MapHeader * mapHeader, u16 x, u16 y, u8 z);
|
||||
|
||||
struct FieldInput gInputToStoreInQuestLogMaybe;
|
||||
struct FieldInput gFieldInputRecord;
|
||||
|
||||
void FieldClearPlayerInput(struct FieldInput *input)
|
||||
{
|
||||
@@ -203,8 +203,8 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
metatileAttributes = MapGridGetMetatileAttributeAt(position.x, position.y, METATILE_ATTRIBUTES_ALL);
|
||||
metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y);
|
||||
|
||||
FieldClearPlayerInput(&gInputToStoreInQuestLogMaybe);
|
||||
gInputToStoreInQuestLogMaybe.dpadDirection = input->dpadDirection;
|
||||
FieldClearPlayerInput(&gFieldInputRecord);
|
||||
gFieldInputRecord.dpadDirection = input->dpadDirection;
|
||||
|
||||
if (CheckForTrainersWantingBattle() == TRUE)
|
||||
return TRUE;
|
||||
@@ -222,7 +222,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
IncrementBirthIslandRockStepCount();
|
||||
if (TryStartStepBasedScript(&position, metatileBehavior, playerDirection) == TRUE)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.tookStep = TRUE;
|
||||
gFieldInputRecord.tookStep = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -234,7 +234,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y);
|
||||
if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.checkStandardWildEncounter = TRUE;
|
||||
gFieldInputRecord.checkStandardWildEncounter = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
GetPlayerPosition(&position);
|
||||
@@ -243,14 +243,14 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
}
|
||||
if (input->checkStandardWildEncounter && CheckStandardWildEncounter(metatileAttributes) == TRUE)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.checkStandardWildEncounter = TRUE;
|
||||
gFieldInputRecord.checkStandardWildEncounter = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
if (input->heldDirection && input->dpadDirection == playerDirection)
|
||||
{
|
||||
if (TryArrowWarp(&position, metatileBehavior, playerDirection) == TRUE)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.heldDirection = TRUE;
|
||||
gFieldInputRecord.heldDirection = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -261,14 +261,14 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
{
|
||||
if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.heldDirection = TRUE;
|
||||
gFieldInputRecord.heldDirection = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (input->pressedAButton && TryStartInteractionScript(&position, metatileBehavior, playerDirection) == TRUE)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.pressedAButton = TRUE;
|
||||
gFieldInputRecord.pressedAButton = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -276,14 +276,14 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
{
|
||||
if (TryDoorWarp(&position, metatileBehavior, playerDirection) == TRUE)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.heldDirection2 = TRUE;
|
||||
gFieldInputRecord.heldDirection2 = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (input->pressedStartButton)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.pressedStartButton = TRUE;
|
||||
gFieldInputRecord.pressedStartButton = TRUE;
|
||||
FlagSet(FLAG_OPENED_START_MENU);
|
||||
PlaySE(SE_WIN_OPEN);
|
||||
ShowStartMenu();
|
||||
@@ -291,7 +291,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
}
|
||||
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
|
||||
{
|
||||
gInputToStoreInQuestLogMaybe.pressedSelectButton = TRUE;
|
||||
gFieldInputRecord.pressedSelectButton = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1602,11 +1602,11 @@ void CreateStopSurfingTask_NoMusicChange(u8 direction)
|
||||
|
||||
void SeafoamIslandsB4F_CurrentDumpsPlayerOnLand(void)
|
||||
{
|
||||
if (gQuestLogPlaybackState != 1 && gQuestLogPlaybackState != 3)
|
||||
{
|
||||
QuestLogRecordPlayerAvatarGfxTransitionWithDuration(sQuestLogSurfDismountActionIds[DIR_NORTH], 16);
|
||||
CreateStopSurfingTask(DIR_NORTH);
|
||||
}
|
||||
if (gQuestLogPlaybackState == QL_PLAYBACK_STATE_RUNNING || gQuestLogPlaybackState == QL_PLAYBACK_STATE_ACTION_END)
|
||||
return;
|
||||
|
||||
QuestLogRecordPlayerAvatarGfxTransitionWithDuration(sQuestLogSurfDismountActionIds[DIR_NORTH], 16);
|
||||
CreateStopSurfingTask(DIR_NORTH);
|
||||
}
|
||||
|
||||
static void Task_StopSurfingInit(u8 taskId)
|
||||
|
||||
+129
-127
@@ -1095,18 +1095,19 @@ void DrawElevatorCurrentFloorWindow(void)
|
||||
{
|
||||
const u8 *floorname;
|
||||
u32 strwidth;
|
||||
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
|
||||
{
|
||||
sElevatorCurrentFloorWindowId = AddWindow(&sElevatorCurrentFloorWindowTemplate);
|
||||
LoadStdWindowGfx(sElevatorCurrentFloorWindowId, 0x21D, BG_PLTT_ID(13));
|
||||
DrawStdFrameWithCustomTileAndPalette(sElevatorCurrentFloorWindowId, FALSE, 0x21D, 13);
|
||||
AddTextPrinterParameterized(sElevatorCurrentFloorWindowId, FONT_NORMAL, gText_NowOn, 0, 2, 0xFF, NULL);
|
||||
floorname = sFloorNamePointers[gSpecialVar_0x8005];
|
||||
strwidth = GetStringWidth(FONT_NORMAL, floorname, 0);
|
||||
AddTextPrinterParameterized(sElevatorCurrentFloorWindowId, FONT_NORMAL, floorname, 56 - strwidth, 16, 0xFF, NULL);
|
||||
PutWindowTilemap(sElevatorCurrentFloorWindowId);
|
||||
CopyWindowToVram(sElevatorCurrentFloorWindowId, COPYWIN_FULL);
|
||||
}
|
||||
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay) == TRUE)
|
||||
return;
|
||||
|
||||
sElevatorCurrentFloorWindowId = AddWindow(&sElevatorCurrentFloorWindowTemplate);
|
||||
LoadStdWindowGfx(sElevatorCurrentFloorWindowId, 0x21D, BG_PLTT_ID(13));
|
||||
DrawStdFrameWithCustomTileAndPalette(sElevatorCurrentFloorWindowId, FALSE, 0x21D, 13);
|
||||
AddTextPrinterParameterized(sElevatorCurrentFloorWindowId, FONT_NORMAL, gText_NowOn, 0, 2, 0xFF, NULL);
|
||||
floorname = sFloorNamePointers[gSpecialVar_0x8005];
|
||||
strwidth = GetStringWidth(FONT_NORMAL, floorname, 0);
|
||||
AddTextPrinterParameterized(sElevatorCurrentFloorWindowId, FONT_NORMAL, floorname, 56 - strwidth, 16, 0xFF, NULL);
|
||||
PutWindowTilemap(sElevatorCurrentFloorWindowId);
|
||||
CopyWindowToVram(sElevatorCurrentFloorWindowId, COPYWIN_FULL);
|
||||
}
|
||||
|
||||
void CloseElevatorCurrentFloorWindow(void)
|
||||
@@ -1164,91 +1165,92 @@ void ListMenu(void)
|
||||
{
|
||||
u8 taskId;
|
||||
struct Task *task;
|
||||
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
|
||||
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay) == TRUE)
|
||||
return;
|
||||
|
||||
taskId = CreateTask(Task_CreateScriptListMenu, 8);
|
||||
task = &gTasks[taskId];
|
||||
switch (gSpecialVar_0x8004)
|
||||
{
|
||||
taskId = CreateTask(Task_CreateScriptListMenu, 8);
|
||||
task = &gTasks[taskId];
|
||||
switch (gSpecialVar_0x8004)
|
||||
{
|
||||
case LISTMENU_BADGES:
|
||||
task->data[0] = 4;
|
||||
task->data[1] = 9;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 12;
|
||||
task->data[5] = 7;
|
||||
task->data[6] = 1;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_SILPHCO_FLOORS:
|
||||
task->data[0] = 7;
|
||||
task->data[1] = 12;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 8;
|
||||
task->data[5] = 12;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
task->data[7] = sElevatorScroll;
|
||||
task->data[8] = sElevatorCursorPos;
|
||||
break;
|
||||
case LISTMENU_ROCKET_HIDEOUT_FLOORS: // Multichoice used instead
|
||||
task->data[0] = 4;
|
||||
task->data[1] = 4;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 8;
|
||||
task->data[5] = 8;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_DEPT_STORE_FLOORS: // Multichoice used instead
|
||||
task->data[0] = 4;
|
||||
task->data[1] = 6;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 8;
|
||||
task->data[5] = 8;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_WIRELESS_LECTURE_HEADERS: // Multichoice used instead
|
||||
task->data[0] = 4;
|
||||
task->data[1] = 4;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 17;
|
||||
task->data[5] = 8;
|
||||
task->data[6] = 1;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_BERRY_POWDER:
|
||||
task->data[0] = 7;
|
||||
task->data[1] = 12;
|
||||
task->data[2] = 16;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 17;
|
||||
task->data[5] = 12;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_TRAINER_TOWER_FLOORS: // Mulitchoice used instead
|
||||
task->data[0] = 3;
|
||||
task->data[1] = 3;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 8;
|
||||
task->data[5] = 6;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case 99:
|
||||
break;
|
||||
default:
|
||||
gSpecialVar_Result = 0x7F;
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
case LISTMENU_BADGES:
|
||||
task->data[0] = 4;
|
||||
task->data[1] = 9;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 12;
|
||||
task->data[5] = 7;
|
||||
task->data[6] = 1;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_SILPHCO_FLOORS:
|
||||
task->data[0] = 7;
|
||||
task->data[1] = 12;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 8;
|
||||
task->data[5] = 12;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
task->data[7] = sElevatorScroll;
|
||||
task->data[8] = sElevatorCursorPos;
|
||||
break;
|
||||
case LISTMENU_ROCKET_HIDEOUT_FLOORS: // Multichoice used instead
|
||||
task->data[0] = 4;
|
||||
task->data[1] = 4;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 8;
|
||||
task->data[5] = 8;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_DEPT_STORE_FLOORS: // Multichoice used instead
|
||||
task->data[0] = 4;
|
||||
task->data[1] = 6;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 8;
|
||||
task->data[5] = 8;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_WIRELESS_LECTURE_HEADERS: // Multichoice used instead
|
||||
task->data[0] = 4;
|
||||
task->data[1] = 4;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 17;
|
||||
task->data[5] = 8;
|
||||
task->data[6] = 1;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_BERRY_POWDER:
|
||||
task->data[0] = 7;
|
||||
task->data[1] = 12;
|
||||
task->data[2] = 16;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 17;
|
||||
task->data[5] = 12;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case LISTMENU_TRAINER_TOWER_FLOORS: // Mulitchoice used instead
|
||||
task->data[0] = 3;
|
||||
task->data[1] = 3;
|
||||
task->data[2] = 1;
|
||||
task->data[3] = 1;
|
||||
task->data[4] = 8;
|
||||
task->data[5] = 6;
|
||||
task->data[6] = 0;
|
||||
task->data[15] = taskId;
|
||||
break;
|
||||
case 99:
|
||||
break;
|
||||
default:
|
||||
gSpecialVar_Result = 0x7F;
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1810,7 +1812,7 @@ static const struct {
|
||||
u16 inside_num;
|
||||
u16 outside_grp;
|
||||
u16 outside_num;
|
||||
} sInsideOutsidePairs[51] = {
|
||||
} sInsideOutsidePairs[] = {
|
||||
[QL_LOCATION_HOME] = {MAP(PALLET_TOWN_PLAYERS_HOUSE_1F), MAP(PALLET_TOWN)},
|
||||
[QL_LOCATION_OAKS_LAB] = {MAP(PALLET_TOWN_PROFESSOR_OAKS_LAB), MAP(PALLET_TOWN)},
|
||||
[QL_LOCATION_VIRIDIAN_GYM] = {MAP(VIRIDIAN_CITY_GYM), MAP(VIRIDIAN_CITY)},
|
||||
@@ -1881,67 +1883,67 @@ void QuestLog_CheckDepartingIndoorsMap(void)
|
||||
}
|
||||
}
|
||||
|
||||
struct QuestLogDepartedData {
|
||||
u8 map_section_id;
|
||||
u8 entrance_id;
|
||||
};
|
||||
|
||||
void QuestLog_TryRecordDepartedLocation(void)
|
||||
{
|
||||
s16 x, y;
|
||||
struct QuestLogDepartedData event_buffer;
|
||||
u16 ql_entrance_id = VarGet(VAR_QL_ENTRANCE);
|
||||
event_buffer.map_section_id = 0;
|
||||
event_buffer.entrance_id = 0;
|
||||
struct QuestLogEvent_Departed data;
|
||||
u16 locationId = VarGet(VAR_QL_ENTRANCE);
|
||||
data.mapSec = 0;
|
||||
data.locationId = 0;
|
||||
if (FlagGet(FLAG_SYS_QL_DEPARTED))
|
||||
{
|
||||
if (ql_entrance_id == QL_LOCATION_VIRIDIAN_FOREST_1)
|
||||
if (locationId == QL_LOCATION_VIRIDIAN_FOREST_1)
|
||||
{
|
||||
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE2_VIRIDIAN_FOREST_SOUTH_ENTRANCE) && (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE2_VIRIDIAN_FOREST_SOUTH_ENTRANCE) || gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE2_VIRIDIAN_FOREST_NORTH_ENTRANCE)))
|
||||
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE2_VIRIDIAN_FOREST_SOUTH_ENTRANCE)
|
||||
&& (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE2_VIRIDIAN_FOREST_SOUTH_ENTRANCE)
|
||||
|| gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE2_VIRIDIAN_FOREST_NORTH_ENTRANCE)))
|
||||
{
|
||||
event_buffer.map_section_id = MAPSEC_ROUTE_2;
|
||||
data.mapSec = MAPSEC_ROUTE_2;
|
||||
if (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE2_VIRIDIAN_FOREST_SOUTH_ENTRANCE))
|
||||
event_buffer.entrance_id = ql_entrance_id;
|
||||
data.locationId = locationId;
|
||||
else
|
||||
event_buffer.entrance_id = ql_entrance_id + 1;
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&event_buffer);
|
||||
data.locationId = locationId + 1;
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (const u16 *)&data);
|
||||
FlagClear(FLAG_SYS_QL_DEPARTED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (ql_entrance_id == QL_LOCATION_LEAGUE_GATE_1)
|
||||
else if (locationId == QL_LOCATION_LEAGUE_GATE_1)
|
||||
{
|
||||
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE22) && (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE22) || gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE23)))
|
||||
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE22) &&
|
||||
(gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE22)
|
||||
|| gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE23)))
|
||||
{
|
||||
event_buffer.map_section_id = Overworld_GetMapHeaderByGroupAndId(sInsideOutsidePairs[ql_entrance_id].inside_grp, sInsideOutsidePairs[ql_entrance_id].inside_num)->regionMapSectionId;
|
||||
data.mapSec = Overworld_GetMapHeaderByGroupAndId(sInsideOutsidePairs[locationId].inside_grp, sInsideOutsidePairs[locationId].inside_num)->regionMapSectionId;
|
||||
if (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE22))
|
||||
event_buffer.entrance_id = ql_entrance_id;
|
||||
data.locationId = locationId;
|
||||
else
|
||||
event_buffer.entrance_id = ql_entrance_id + 1;
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&event_buffer);
|
||||
data.locationId = locationId + 1;
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (const u16 *)&data);
|
||||
FlagClear(FLAG_SYS_QL_DEPARTED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (gSaveBlock1Ptr->location.mapGroup == sInsideOutsidePairs[ql_entrance_id].outside_grp && gSaveBlock1Ptr->location.mapNum == sInsideOutsidePairs[ql_entrance_id].outside_num)
|
||||
if (gSaveBlock1Ptr->location.mapGroup == sInsideOutsidePairs[locationId].outside_grp
|
||||
&& gSaveBlock1Ptr->location.mapNum == sInsideOutsidePairs[locationId].outside_num)
|
||||
{
|
||||
event_buffer.map_section_id = Overworld_GetMapHeaderByGroupAndId(sInsideOutsidePairs[ql_entrance_id].inside_grp, sInsideOutsidePairs[ql_entrance_id].inside_num)->regionMapSectionId;
|
||||
event_buffer.entrance_id = ql_entrance_id;
|
||||
if (ql_entrance_id == QL_LOCATION_ROCK_TUNNEL_1)
|
||||
data.mapSec = Overworld_GetMapHeaderByGroupAndId(sInsideOutsidePairs[locationId].inside_grp, sInsideOutsidePairs[locationId].inside_num)->regionMapSectionId;
|
||||
data.locationId = locationId;
|
||||
if (locationId == QL_LOCATION_ROCK_TUNNEL_1)
|
||||
{
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (x != 15 || y != 26)
|
||||
event_buffer.entrance_id++;
|
||||
data.locationId++;
|
||||
}
|
||||
else if (ql_entrance_id == QL_LOCATION_SEAFOAM_ISLANDS_1)
|
||||
else if (locationId == QL_LOCATION_SEAFOAM_ISLANDS_1)
|
||||
{
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (x != 67 || y != 15)
|
||||
event_buffer.entrance_id++;
|
||||
data.locationId++;
|
||||
}
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&event_buffer);
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (const u16 *)&data);
|
||||
FlagClear(FLAG_SYS_QL_DEPARTED);
|
||||
if (ql_entrance_id == QL_LOCATION_ROCKET_HIDEOUT)
|
||||
if (locationId == QL_LOCATION_ROCKET_HIDEOUT)
|
||||
{
|
||||
VarSet(VAR_QL_ENTRANCE, QL_LOCATION_GAME_CORNER);
|
||||
FlagSet(FLAG_SYS_QL_DEPARTED);
|
||||
|
||||
+7
-16
@@ -567,16 +567,8 @@ u16 BagGetQuantityByItemId(u16 itemId)
|
||||
|
||||
void TrySetObtainedItemQuestLogEvent(u16 itemId)
|
||||
{
|
||||
struct QuestLogStruct_809A824
|
||||
{
|
||||
u16 itemId;
|
||||
u8 mapSectionId;
|
||||
} * ptr;
|
||||
|
||||
// Only some key items trigger this event
|
||||
if
|
||||
(
|
||||
itemId == ITEM_OAKS_PARCEL
|
||||
if (itemId == ITEM_OAKS_PARCEL
|
||||
|| itemId == ITEM_POKE_FLUTE
|
||||
|| itemId == ITEM_SECRET_KEY
|
||||
|| itemId == ITEM_BIKE_VOUCHER
|
||||
@@ -595,16 +587,15 @@ void TrySetObtainedItemQuestLogEvent(u16 itemId)
|
||||
|| itemId == ITEM_TEA
|
||||
|| itemId == ITEM_POWDER_JAR
|
||||
|| itemId == ITEM_RUBY
|
||||
|| itemId == ITEM_SAPPHIRE
|
||||
)
|
||||
|| itemId == ITEM_SAPPHIRE)
|
||||
{
|
||||
if (itemId != ITEM_TOWN_MAP || (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(PALLET_TOWN_RIVALS_HOUSE) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(PALLET_TOWN_RIVALS_HOUSE)))
|
||||
{
|
||||
ptr = malloc(sizeof(*ptr));
|
||||
ptr->itemId = itemId;
|
||||
ptr->mapSectionId = gMapHeader.regionMapSectionId;
|
||||
SetQuestLogEvent(QL_EVENT_OBTAINED_ITEM, (void *)ptr);
|
||||
free(ptr);
|
||||
struct QuestLogEvent_StoryItem * data = malloc(sizeof(*data));
|
||||
data->itemId = itemId;
|
||||
data->mapSec = gMapHeader.regionMapSectionId;
|
||||
SetQuestLogEvent(QL_EVENT_OBTAINED_STORY_ITEM, (const u16 *)data);
|
||||
free(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -33,6 +33,7 @@
|
||||
#include "tm_case.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/quest_log.h"
|
||||
|
||||
#define FREE_IF_SET(ptr) ({ if (ptr) Free(ptr); })
|
||||
|
||||
@@ -1930,7 +1931,7 @@ static void Task_FinalizeSaleToShop(u8 taskId)
|
||||
PlaySE(SE_SHOP);
|
||||
RemoveBagItem(gSpecialVar_ItemId, data[8]);
|
||||
AddMoney(&gSaveBlock1Ptr->money, ItemId_GetPrice(gSpecialVar_ItemId) / 2 * data[8]);
|
||||
RecordItemPurchase(gSpecialVar_ItemId, data[8], 2);
|
||||
RecordItemTransaction(gSpecialVar_ItemId, data[8], QL_EVENT_SOLD_ITEM - QL_EVENT_USED_POKEMART);
|
||||
DestroyListMenuTask(data[0], &gBagMenuState.cursorPos[gBagMenuState.pocket], &gBagMenuState.itemsAbove[gBagMenuState.pocket]);
|
||||
Pocket_CalculateNItemsAndMaxShowed(gBagMenuState.pocket);
|
||||
PocketCalculateInitialCursorPosAndItemsAbove(gBagMenuState.pocket);
|
||||
@@ -2005,7 +2006,7 @@ static void Task_TryDoItemDeposit(u8 taskId)
|
||||
s16 *data = gTasks[taskId].data;
|
||||
if (AddPCItem(gSpecialVar_ItemId, data[8]) == TRUE)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(28, 0, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_DEPOSITED_ITEM_PC, 0, gSpecialVar_ItemId, 0xFFFF);
|
||||
CopyItemName(gSpecialVar_ItemId, gStringVar1);
|
||||
ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
StringExpandPlaceholders(gStringVar4, gText_DepositedStrVar2StrVar1s);
|
||||
|
||||
+7
-13
@@ -912,20 +912,14 @@ void FieldUseFunc_OakStopsYou(u8 taskId)
|
||||
|
||||
void ItemUse_SetQuestLogEvent(u8 eventId, struct Pokemon *pokemon, u16 itemId, u16 param)
|
||||
{
|
||||
struct UnkStruct_ItemUseQuestLog
|
||||
{
|
||||
u16 itemId;
|
||||
u16 unk2;
|
||||
u16 species;
|
||||
u16 param;
|
||||
} *questLog = Alloc(sizeof(*questLog));
|
||||
struct QuestLogEvent_Item *data = Alloc(sizeof(*data));
|
||||
|
||||
questLog->itemId = itemId;
|
||||
questLog->param = param;
|
||||
data->itemId = itemId;
|
||||
data->itemParam = param;
|
||||
if (pokemon != NULL)
|
||||
questLog->species = GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
|
||||
data->species = GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
|
||||
else
|
||||
questLog->species = 0xFFFF;
|
||||
SetQuestLogEvent(eventId, (void *)questLog);
|
||||
Free(questLog);
|
||||
data->species = 0xFFFF;
|
||||
SetQuestLogEvent(eventId, (void *)data);
|
||||
Free(data);
|
||||
}
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ void SetSaveBlocksPointers(void)
|
||||
gPokemonStoragePtr = (void *)(&gPokemonStorage) + offset;
|
||||
|
||||
SetBagPocketsPointers();
|
||||
SetQuestLogRecordAndPlaybackPointers(oldSave);
|
||||
QL_AddASLROffset(oldSave);
|
||||
}
|
||||
|
||||
void MoveSaveBlocks_ResetHeap(void)
|
||||
|
||||
+1
-1
@@ -213,7 +213,7 @@ static void InitMainCallbacks(void)
|
||||
gSaveBlock2Ptr = &gSaveBlock2;
|
||||
gSaveBlock1Ptr = &gSaveBlock1;
|
||||
gSaveBlock2.encryptionKey = 0;
|
||||
gQuestLogPlaybackState = 0;
|
||||
gQuestLogPlaybackState = QL_PLAYBACK_STATE_STOPPED;
|
||||
}
|
||||
|
||||
static void CallCallbacks(void)
|
||||
|
||||
+1
-1
@@ -478,7 +478,7 @@ static void Task_ExecuteMainMenuSelection(u8 taskId)
|
||||
gPlttBufferFaded[0] = RGB_BLACK;
|
||||
gExitStairsMovementDisabled = FALSE;
|
||||
FreeAllWindowBuffers();
|
||||
TrySetUpQuestLogScenes_ElseContinueFromSave(taskId);
|
||||
TryStartQuestLogPlayback(taskId);
|
||||
break;
|
||||
case MAIN_MENU_MYSTERYGIFT:
|
||||
SetMainCallback2(CB2_InitMysteryGift);
|
||||
|
||||
+15
-15
@@ -772,7 +772,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
InitSecondaryTilesetAnimation();
|
||||
UpdateLocationHistoryForRoamer();
|
||||
RoamerMove();
|
||||
sub_8110920();
|
||||
QL_ResetDefeatedWildMonRecord();
|
||||
DoCurrentWeather();
|
||||
ResetFieldTasksArgs();
|
||||
RunOnResumeMapScript();
|
||||
@@ -803,7 +803,7 @@ static void LoadMapFromWarp(bool32 unused)
|
||||
TryRegenerateRenewableHiddenItems();
|
||||
UpdateLocationHistoryForRoamer();
|
||||
RoamerMoveToOtherLocationSet();
|
||||
sub_8110920();
|
||||
QL_ResetDefeatedWildMonRecord();
|
||||
InitMap();
|
||||
}
|
||||
|
||||
@@ -818,8 +818,8 @@ static void QL_LoadMapNormal(void)
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
SetDefaultFlashLevel();
|
||||
sub_8110920();
|
||||
sub_8111708();
|
||||
QL_ResetDefeatedWildMonRecord();
|
||||
QL_RestoreMapLayoutId();
|
||||
LoadSaveblockMapHeader();
|
||||
InitMap();
|
||||
}
|
||||
@@ -1390,7 +1390,7 @@ static void DoCB1_Overworld(u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
struct FieldInput fieldInput;
|
||||
|
||||
sub_8112B3C();
|
||||
QL_TryRunActions();
|
||||
UpdatePlayerAvatarTransitionState();
|
||||
FieldClearPlayerInput(&fieldInput);
|
||||
FieldGetPlayerInput(&fieldInput, newKeys, heldKeys);
|
||||
@@ -1399,8 +1399,8 @@ static void DoCB1_Overworld(u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
if (ProcessPlayerFieldInput(&fieldInput) == TRUE)
|
||||
{
|
||||
if (gQuestLogPlaybackState == 2)
|
||||
sub_81127F8(&gInputToStoreInQuestLogMaybe);
|
||||
if (gQuestLogPlaybackState == QL_PLAYBACK_STATE_RECORDING)
|
||||
QL_RecordFieldInput(&gFieldInputRecord);
|
||||
LockPlayerFieldControls();
|
||||
DismissMapNamePopup();
|
||||
}
|
||||
@@ -1416,9 +1416,9 @@ static void DoCB1_Overworld_QuestLogPlayback(void)
|
||||
{
|
||||
struct FieldInput fieldInput;
|
||||
|
||||
sub_8112B3C();
|
||||
QL_TryRunActions();
|
||||
UpdatePlayerAvatarTransitionState();
|
||||
sub_8111C68();
|
||||
QL_HandleInput();
|
||||
FieldClearPlayerInput(&fieldInput);
|
||||
fieldInput = gQuestLogFieldInput;
|
||||
FieldInput_HandleCancelSignpost(&fieldInput);
|
||||
@@ -1445,7 +1445,7 @@ void CB1_Overworld(void)
|
||||
{
|
||||
if (gMain.callback2 == CB2_Overworld)
|
||||
{
|
||||
if (sub_8112CAC() == 1 || gQuestLogState == QL_STATE_PLAYBACK)
|
||||
if (QL_GetPlaybackState() == QL_PLAYBACK_STATE_RUNNING || gQuestLogState == QL_STATE_PLAYBACK)
|
||||
DoCB1_Overworld_QuestLogPlayback();
|
||||
else
|
||||
DoCB1_Overworld(gMain.newKeys, gMain.heldKeys);
|
||||
@@ -1458,7 +1458,7 @@ static void OverworldBasic(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
CameraUpdate();
|
||||
sub_8115798();
|
||||
SetQuestLogEvent_Arrived();
|
||||
UpdateCameraPanning();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
@@ -2239,8 +2239,8 @@ static bool32 LoadMap_QLPlayback(u8 *state)
|
||||
InitOverworldBgs();
|
||||
FieldClearVBlankHBlankCallbacks();
|
||||
QuestLog_InitPalettesBackup();
|
||||
sub_81113E4();
|
||||
sub_8111438();
|
||||
QL_CopySaveState();
|
||||
QL_ResetPartyAndPC();
|
||||
if (GetQuestLogStartType() == QL_START_WARP)
|
||||
{
|
||||
gExitStairsMovementDisabled = FALSE;
|
||||
@@ -2254,7 +2254,7 @@ static bool32 LoadMap_QLPlayback(u8 *state)
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
sub_8110FCC();
|
||||
QL_InitSceneObjectsAndActions();
|
||||
(*state)++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -2296,7 +2296,7 @@ static bool32 LoadMap_QLPlayback(u8 *state)
|
||||
break;
|
||||
case 10:
|
||||
InitTilesetAnimations();
|
||||
sub_815A540();
|
||||
QL_TryStopSurfing();
|
||||
(*state)++;
|
||||
break;
|
||||
default:
|
||||
|
||||
+37
-43
@@ -3355,12 +3355,12 @@ static void SwitchPartyMon(void)
|
||||
|
||||
static void SetSwitchedPartyOrderQuestLogEvent(void)
|
||||
{
|
||||
u16 *buffer = Alloc(2 * sizeof(u16));
|
||||
struct QuestLogEvent_SwitchedPartyOrder * data = Alloc(sizeof(*data));
|
||||
|
||||
buffer[0] = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
|
||||
buffer[1] = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES_OR_EGG);
|
||||
SetQuestLogEvent(QL_EVENT_SWITCHED_PARTY_ORDER, buffer);
|
||||
Free(buffer);
|
||||
data->species1 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
|
||||
data->species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES_OR_EGG);
|
||||
SetQuestLogEvent(QL_EVENT_SWITCHED_PARTY_ORDER, (const u16 *)data);
|
||||
Free(data);
|
||||
}
|
||||
|
||||
// Finish switching mons or using Softboiled
|
||||
@@ -4131,67 +4131,61 @@ static bool8 SetUpFieldMove_Waterfall(void)
|
||||
|
||||
static void SetSwappedHeldItemQuestLogEvent(struct Pokemon *mon, u16 item, u16 item2)
|
||||
{
|
||||
u16 *ptr = Alloc(4 * sizeof(u16));
|
||||
struct QuestLogEvent_SwappedHeldItem *data = Alloc(sizeof(*data));
|
||||
|
||||
ptr[2] = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
|
||||
ptr[0] = item;
|
||||
ptr[1] = item2;
|
||||
data->species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
|
||||
data->takenItemId = item;
|
||||
data->givenItemId = item2;
|
||||
if (gPartyMenu.action == PARTY_ACTION_GIVE_PC_ITEM)
|
||||
SetQuestLogEvent(QL_EVENT_SWAPPED_HELD_ITEM_PC, ptr);
|
||||
SetQuestLogEvent(QL_EVENT_SWAPPED_HELD_ITEM_PC, (void *)data);
|
||||
else
|
||||
SetQuestLogEvent(QL_EVENT_SWAPPED_HELD_ITEM, ptr);
|
||||
Free(ptr);
|
||||
SetQuestLogEvent(QL_EVENT_SWAPPED_HELD_ITEM, (void *)data);
|
||||
Free(data);
|
||||
}
|
||||
|
||||
struct FieldMoveWarpParams
|
||||
{
|
||||
u16 species;
|
||||
u8 fieldMove;
|
||||
u8 regionMapSectionId;
|
||||
};
|
||||
|
||||
static void SetUsedFieldMoveQuestLogEvent(struct Pokemon *mon, u8 fieldMove)
|
||||
{
|
||||
struct FieldMoveWarpParams *ptr = Alloc(sizeof(*ptr));
|
||||
struct QuestLogEvent_FieldMove *data = Alloc(sizeof(*data));
|
||||
|
||||
ptr->species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
|
||||
ptr->fieldMove = fieldMove;
|
||||
switch (ptr->fieldMove)
|
||||
data->species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
|
||||
data->fieldMove = fieldMove;
|
||||
switch (data->fieldMove)
|
||||
{
|
||||
case FIELD_MOVE_TELEPORT:
|
||||
ptr->regionMapSectionId = Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->lastHealLocation.mapGroup, gSaveBlock1Ptr->lastHealLocation.mapNum)->regionMapSectionId;
|
||||
data->mapSec = Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->lastHealLocation.mapGroup, gSaveBlock1Ptr->lastHealLocation.mapNum)->regionMapSectionId;
|
||||
break;
|
||||
case FIELD_MOVE_DIG:
|
||||
ptr->regionMapSectionId = gMapHeader.regionMapSectionId;
|
||||
data->mapSec = gMapHeader.regionMapSectionId;
|
||||
break;
|
||||
default:
|
||||
ptr->regionMapSectionId = 0xFF;
|
||||
data->mapSec = 0xFF;
|
||||
}
|
||||
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (u16 *)ptr);
|
||||
Free(ptr);
|
||||
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (const u16 *)data);
|
||||
Free(data);
|
||||
}
|
||||
|
||||
void SetUsedFlyQuestLogEvent(const u8 *healLocCtrlData)
|
||||
{
|
||||
const struct MapHeader *mapHeader;
|
||||
struct FieldMoveWarpParams *ptr2;
|
||||
struct QuestLogEvent_FieldMove *data;
|
||||
struct
|
||||
{
|
||||
s8 mapGroup;
|
||||
s8 mapNum;
|
||||
u32 unk_4;
|
||||
} *ptr = Alloc(sizeof(*ptr));
|
||||
s8 group;
|
||||
s8 num;
|
||||
u32 unused;
|
||||
} *map = Alloc(sizeof(*map));
|
||||
|
||||
ptr->mapGroup = healLocCtrlData[0];
|
||||
ptr->mapNum = healLocCtrlData[1];
|
||||
mapHeader = Overworld_GetMapHeaderByGroupAndId(ptr->mapGroup, ptr->mapNum);
|
||||
Free(ptr);
|
||||
ptr2 = Alloc(4);
|
||||
ptr2->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES_OR_EGG);
|
||||
ptr2->fieldMove = FIELD_MOVE_FLY;
|
||||
ptr2->regionMapSectionId = mapHeader->regionMapSectionId;
|
||||
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (u16 *)ptr2);
|
||||
Free(ptr2);
|
||||
map->group = healLocCtrlData[0];
|
||||
map->num = healLocCtrlData[1];
|
||||
mapHeader = Overworld_GetMapHeaderByGroupAndId(map->group, map->num);
|
||||
Free(map);
|
||||
|
||||
data = Alloc(sizeof(*data));
|
||||
data->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES_OR_EGG);
|
||||
data->fieldMove = FIELD_MOVE_FLY;
|
||||
data->mapSec = mapHeader->regionMapSectionId;
|
||||
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (const u16 *)data);
|
||||
Free(data);
|
||||
}
|
||||
|
||||
void CB2_ShowPartyMenuForItemUse(void)
|
||||
|
||||
@@ -2672,7 +2672,7 @@ static void InitCursorItemIcon(void)
|
||||
static void SetPokeStorageQuestLogEvent(u8 action)
|
||||
{
|
||||
u16 event;
|
||||
struct PokeStorageQuestLogData *questLogData;
|
||||
struct QuestLogEvent_MovedBoxMon *questLogData;
|
||||
u8 box1 = GetMovingMonOriginalBoxId();
|
||||
u16 species1 = gStorage->displayMonSpecies;
|
||||
u16 species2;
|
||||
@@ -2687,7 +2687,7 @@ static void SetPokeStorageQuestLogEvent(u8 action)
|
||||
box2 = StorageGetCurrentBox();
|
||||
species2 = GetCurrentBoxMonData(GetBoxCursorPosition(), MON_DATA_SPECIES_OR_EGG);
|
||||
}
|
||||
questLogData = &gStorage->pokeStorageQuestLogData;
|
||||
questLogData = &gStorage->questLogData;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
||||
+667
-600
File diff suppressed because it is too large
Load Diff
+55
-71
@@ -7,30 +7,15 @@
|
||||
#include "quest_log.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
struct QuestLogStruct_TrainerBattleRecord
|
||||
{
|
||||
u16 v0;
|
||||
u16 v2;
|
||||
u16 v4;
|
||||
u8 v6;
|
||||
u8 v7;
|
||||
};
|
||||
|
||||
struct QuestLogStruct_WildBattleRecord
|
||||
{
|
||||
u16 defeatedSpecies;
|
||||
u16 caughtSpecies;
|
||||
u8 mapSec;
|
||||
};
|
||||
|
||||
static void sub_812C334(s32 *, s32 *);
|
||||
static void GetLinkMultiBattlePlayerIndexes(s32 *, s32 *);
|
||||
|
||||
void TrySetQuestLogBattleEvent(void)
|
||||
{
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_OLD_MAN_TUTORIAL | BATTLE_TYPE_POKEDUDE)) && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT))
|
||||
{
|
||||
struct QuestLogStruct_TrainerBattleRecord * questLogTrainerBattleRecord = Alloc(sizeof(struct QuestLogStruct_TrainerBattleRecord));
|
||||
struct QuestLogStruct_WildBattleRecord * questLogWildBattleRecord = Alloc(sizeof(struct QuestLogStruct_WildBattleRecord));
|
||||
// Why allocate both of these? Only one will ever be used at a time
|
||||
struct QuestLogEvent_TrainerBattle * trainerData = Alloc(sizeof(*trainerData));
|
||||
struct QuestLogEvent_WildBattle * wildData = Alloc(sizeof(*wildData));
|
||||
u16 eventId;
|
||||
u16 playerEndingHP;
|
||||
u16 playerMaxHP;
|
||||
@@ -52,81 +37,81 @@ void TrySetQuestLogBattleEvent(void)
|
||||
eventId = QL_EVENT_DEFEATED_TRAINER;
|
||||
break;
|
||||
}
|
||||
questLogTrainerBattleRecord->v0 = gTrainerBattleOpponent_A;
|
||||
trainerData->trainerId = gTrainerBattleOpponent_A;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
questLogTrainerBattleRecord->v2 = gBattleResults.lastOpponentSpecies;
|
||||
if (GetBattlerSide(gBattleStruct->field_182) == B_SIDE_PLAYER)
|
||||
questLogTrainerBattleRecord->v4 = gBattleMons[gBattleStruct->field_182].species;
|
||||
trainerData->speciesOpponent = gBattleResults.lastOpponentSpecies;
|
||||
|
||||
// Decide which of the pokemon on the player's side to mention as the victor
|
||||
if (GetBattlerSide(gBattleStruct->lastAttackerToFaintOpponent) == B_SIDE_PLAYER)
|
||||
trainerData->speciesPlayer = gBattleMons[gBattleStruct->lastAttackerToFaintOpponent].species;
|
||||
else if (gBattleMons[GetBattlerAtPosition(0)].hp != 0)
|
||||
questLogTrainerBattleRecord->v4 = gBattleMons[GetBattlerAtPosition(0)].species;
|
||||
trainerData->speciesPlayer = gBattleMons[GetBattlerAtPosition(0)].species;
|
||||
else
|
||||
questLogTrainerBattleRecord->v4 = gBattleMons[GetBattlerAtPosition(2)].species;
|
||||
trainerData->speciesPlayer = gBattleMons[GetBattlerAtPosition(2)].species;
|
||||
|
||||
playerEndingHP = gBattleMons[GetBattlerAtPosition(0)].hp + gBattleMons[GetBattlerAtPosition(2)].hp;
|
||||
playerMaxHP = gBattleMons[GetBattlerAtPosition(0)].maxHP + gBattleMons[GetBattlerAtPosition(2)].maxHP;
|
||||
}
|
||||
else
|
||||
{
|
||||
questLogTrainerBattleRecord->v2 = gBattleResults.lastOpponentSpecies;
|
||||
questLogTrainerBattleRecord->v4 = gBattleMons[GetBattlerAtPosition(0)].species;
|
||||
trainerData->speciesOpponent = gBattleResults.lastOpponentSpecies;
|
||||
trainerData->speciesPlayer = gBattleMons[GetBattlerAtPosition(0)].species;
|
||||
playerEndingHP = gBattleMons[GetBattlerAtPosition(0)].hp;
|
||||
playerMaxHP = gBattleMons[GetBattlerAtPosition(0)].maxHP;
|
||||
}
|
||||
questLogTrainerBattleRecord->v7 = GetCurrentRegionMapSectionId();
|
||||
questLogTrainerBattleRecord->v6 = 0;
|
||||
trainerData->mapSec = GetCurrentRegionMapSectionId();
|
||||
|
||||
// Calculate fractional HP loss (determines flavor text, e.g. "handily" vs "somehow" defeated trainer)
|
||||
trainerData->hpFractionId = 0;
|
||||
if (playerEndingHP < playerMaxHP / 3 * 2)
|
||||
questLogTrainerBattleRecord->v6 = 1;
|
||||
trainerData->hpFractionId++;
|
||||
if (playerEndingHP < playerMaxHP / 3)
|
||||
questLogTrainerBattleRecord->v6++;
|
||||
SetQuestLogEvent(eventId, (const u16 *)questLogTrainerBattleRecord);
|
||||
trainerData->hpFractionId++;
|
||||
|
||||
SetQuestLogEvent(eventId, (const u16 *)trainerData);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleOutcome == B_OUTCOME_WON)
|
||||
{
|
||||
questLogWildBattleRecord->defeatedSpecies = GetMonData(gEnemyParty, MON_DATA_SPECIES);
|
||||
questLogWildBattleRecord->caughtSpecies = SPECIES_NONE;
|
||||
wildData->defeatedSpecies = GetMonData(gEnemyParty, MON_DATA_SPECIES);
|
||||
wildData->caughtSpecies = SPECIES_NONE;
|
||||
}
|
||||
else // gBattleOutcome == B_OUTCOME_CAUGHT
|
||||
{
|
||||
questLogWildBattleRecord->defeatedSpecies = SPECIES_NONE;
|
||||
questLogWildBattleRecord->caughtSpecies = GetMonData(gEnemyParty, MON_DATA_SPECIES);
|
||||
wildData->defeatedSpecies = SPECIES_NONE;
|
||||
wildData->caughtSpecies = GetMonData(gEnemyParty, MON_DATA_SPECIES);
|
||||
}
|
||||
questLogWildBattleRecord->mapSec = GetCurrentRegionMapSectionId();
|
||||
SetQuestLogEvent(QL_EVENT_DEFEATED_WILD_MON, (const u16 *)questLogWildBattleRecord);
|
||||
wildData->mapSec = GetCurrentRegionMapSectionId();
|
||||
SetQuestLogEvent(QL_EVENT_DEFEATED_WILD_MON, (const u16 *)wildData);
|
||||
}
|
||||
Free(questLogTrainerBattleRecord);
|
||||
Free(questLogWildBattleRecord);
|
||||
Free(trainerData);
|
||||
Free(wildData);
|
||||
}
|
||||
}
|
||||
|
||||
struct QuestLogStruct_LinkBattleRecord
|
||||
{
|
||||
u8 v0;
|
||||
u8 v1[3][7];
|
||||
};
|
||||
|
||||
void TrySetQuestLogLinkBattleEvent(void)
|
||||
{
|
||||
s32 sp0;
|
||||
s32 sp4[2];
|
||||
s32 partnerIdx;
|
||||
s32 opponentIdxs[2];
|
||||
u16 eventId;
|
||||
s32 r3;
|
||||
s32 i;
|
||||
bool32 inUnionRoom;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
{
|
||||
struct QuestLogStruct_LinkBattleRecord * r5 = Alloc(sizeof(struct QuestLogStruct_LinkBattleRecord));
|
||||
r5->v0 = gBattleOutcome - 1; // 0 = won, 1 = lost, 2 = drew
|
||||
struct QuestLogEvent_LinkBattle * data = Alloc(sizeof(*data));
|
||||
data->outcome = gBattleOutcome - 1; // 0 = won, 1 = lost, 2 = drew
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
eventId = QL_EVENT_LINK_BATTLED_MULTI;
|
||||
sub_812C334(&sp0, sp4);
|
||||
for (r3 = 0; r3 < 7; r3++)
|
||||
GetLinkMultiBattlePlayerIndexes(&partnerIdx, opponentIdxs);
|
||||
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
|
||||
{
|
||||
r5->v1[0][r3] = gLinkPlayers[sp0].name[r3];
|
||||
r5->v1[1][r3] = gLinkPlayers[sp4[0]].name[r3];
|
||||
r5->v1[2][r3] = gLinkPlayers[sp4[1]].name[r3];
|
||||
data->playerNames[0][i] = gLinkPlayers[partnerIdx].name[i];
|
||||
data->playerNames[1][i] = gLinkPlayers[opponentIdxs[0]].name[i];
|
||||
data->playerNames[2][i] = gLinkPlayers[opponentIdxs[1]].name[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -141,26 +126,25 @@ void TrySetQuestLogLinkBattleEvent(void)
|
||||
if (inUnionRoom == TRUE)
|
||||
eventId = QL_EVENT_LINK_BATTLED_UNION;
|
||||
}
|
||||
for (r3 = 0; r3 < 7; r3++)
|
||||
{
|
||||
r5->v1[0][r3] = gLinkPlayers[gBattleStruct->multiplayerId ^ 1].name[r3];
|
||||
}
|
||||
|
||||
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
|
||||
data->playerNames[0][i] = gLinkPlayers[gBattleStruct->multiplayerId ^ 1].name[i];
|
||||
}
|
||||
SetQuestLogEvent(eventId, (const u16 *)r5);
|
||||
Free(r5);
|
||||
SetQuestLogEvent(eventId, (const u16 *)data);
|
||||
Free(data);
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_812C334(s32 * a0, s32 * a1)
|
||||
static void GetLinkMultiBattlePlayerIndexes(s32 * partnerIdx, s32 * opponentIdxs)
|
||||
{
|
||||
s32 r5;
|
||||
s32 _optimized_out = 0;
|
||||
u8 r2 = gLinkPlayers[gBattleStruct->multiplayerId].id ^ 2;
|
||||
for (r5 = 0; r5 < 4; r5++)
|
||||
s32 i;
|
||||
s32 numOpponentsFound = 0;
|
||||
u8 partnerId = gLinkPlayers[gBattleStruct->multiplayerId].id ^ 2;
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
{
|
||||
if (r2 == gLinkPlayers[r5].id)
|
||||
a0[0] = r5;
|
||||
else if (r5 != gBattleStruct->multiplayerId)
|
||||
a1[_optimized_out++] = r5;
|
||||
if (partnerId == gLinkPlayers[i].id)
|
||||
*partnerIdx = i;
|
||||
else if (i != gBattleStruct->multiplayerId)
|
||||
opponentIdxs[numOpponentsFound++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
+1131
-1035
File diff suppressed because it is too large
Load Diff
+70
-70
@@ -4,95 +4,95 @@
|
||||
#include "field_player_avatar.h"
|
||||
#include "metatile_behavior.h"
|
||||
|
||||
void SetQuestLogObjectEventsData(struct QuestLog * questLog)
|
||||
void QL_RecordObjects(struct QuestLogScene * questLog)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
|
||||
{
|
||||
questLog->unk_008[i].active = gObjectEvents[i].active;
|
||||
questLog->unk_008[i].triggerGroundEffectsOnStop = gObjectEvents[i].triggerGroundEffectsOnStop;
|
||||
questLog->unk_008[i].disableCoveringGroundEffects = gObjectEvents[i].disableCoveringGroundEffects;
|
||||
questLog->unk_008[i].landingJump = gObjectEvents[i].landingJump;
|
||||
questLog->unk_008[i].frozen = gObjectEvents[i].frozen;
|
||||
questLog->unk_008[i].facingDirectionLocked = gObjectEvents[i].facingDirectionLocked;
|
||||
questLog->unk_008[i].disableAnim = gObjectEvents[i].disableAnim;
|
||||
questLog->unk_008[i].enableAnim = gObjectEvents[i].enableAnim;
|
||||
questLog->unk_008[i].inanimate = gObjectEvents[i].inanimate;
|
||||
questLog->unk_008[i].invisible = gObjectEvents[i].invisible;
|
||||
questLog->unk_008[i].offScreen = gObjectEvents[i].offScreen;
|
||||
questLog->unk_008[i].trackedByCamera = gObjectEvents[i].trackedByCamera;
|
||||
questLog->unk_008[i].isPlayer = gObjectEvents[i].isPlayer;
|
||||
questLog->unk_008[i].spriteAnimPausedBackup = gObjectEvents[i].spriteAnimPausedBackup;
|
||||
questLog->unk_008[i].spriteAffineAnimPausedBackup = gObjectEvents[i].spriteAffineAnimPausedBackup;
|
||||
questLog->unk_008[i].disableJumpLandingGroundEffect = gObjectEvents[i].disableJumpLandingGroundEffect;
|
||||
questLog->unk_008[i].fixedPriority = gObjectEvents[i].fixedPriority;
|
||||
questLog->unk_008[i].mapobj_unk_18 = gObjectEvents[i].facingDirection;
|
||||
questLog->unk_008[i].mapobj_unk_0B_0 = gObjectEvents[i].currentElevation;
|
||||
questLog->unk_008[i].elevation = gObjectEvents[i].previousElevation;
|
||||
questLog->unk_008[i].graphicsId = gObjectEvents[i].graphicsId;
|
||||
questLog->unk_008[i].animPattern = gObjectEvents[i].movementType;
|
||||
questLog->unk_008[i].trainerType = gObjectEvents[i].trainerType;
|
||||
questLog->unk_008[i].localId = gObjectEvents[i].localId;
|
||||
questLog->unk_008[i].mapNum = gObjectEvents[i].mapNum;
|
||||
questLog->unk_008[i].mapGroup = gObjectEvents[i].mapGroup;
|
||||
questLog->unk_008[i].x = gObjectEvents[i].currentCoords.x;
|
||||
questLog->unk_008[i].y = gObjectEvents[i].currentCoords.y;
|
||||
questLog->unk_008[i].trainerRange_berryTreeId = gObjectEvents[i].trainerRange_berryTreeId;
|
||||
questLog->unk_008[i].previousMetatileBehavior = gObjectEvents[i].previousMetatileBehavior;
|
||||
questLog->unk_008[i].directionSequenceIndex = gObjectEvents[i].directionSequenceIndex;
|
||||
questLog->unk_008[i].animId = gObjectEvents[i].playerCopyableMovement;
|
||||
questLog->objectEvents[i].active = gObjectEvents[i].active;
|
||||
questLog->objectEvents[i].triggerGroundEffectsOnStop = gObjectEvents[i].triggerGroundEffectsOnStop;
|
||||
questLog->objectEvents[i].disableCoveringGroundEffects = gObjectEvents[i].disableCoveringGroundEffects;
|
||||
questLog->objectEvents[i].landingJump = gObjectEvents[i].landingJump;
|
||||
questLog->objectEvents[i].frozen = gObjectEvents[i].frozen;
|
||||
questLog->objectEvents[i].facingDirectionLocked = gObjectEvents[i].facingDirectionLocked;
|
||||
questLog->objectEvents[i].disableAnim = gObjectEvents[i].disableAnim;
|
||||
questLog->objectEvents[i].enableAnim = gObjectEvents[i].enableAnim;
|
||||
questLog->objectEvents[i].inanimate = gObjectEvents[i].inanimate;
|
||||
questLog->objectEvents[i].invisible = gObjectEvents[i].invisible;
|
||||
questLog->objectEvents[i].offScreen = gObjectEvents[i].offScreen;
|
||||
questLog->objectEvents[i].trackedByCamera = gObjectEvents[i].trackedByCamera;
|
||||
questLog->objectEvents[i].isPlayer = gObjectEvents[i].isPlayer;
|
||||
questLog->objectEvents[i].spriteAnimPausedBackup = gObjectEvents[i].spriteAnimPausedBackup;
|
||||
questLog->objectEvents[i].spriteAffineAnimPausedBackup = gObjectEvents[i].spriteAffineAnimPausedBackup;
|
||||
questLog->objectEvents[i].disableJumpLandingGroundEffect = gObjectEvents[i].disableJumpLandingGroundEffect;
|
||||
questLog->objectEvents[i].fixedPriority = gObjectEvents[i].fixedPriority;
|
||||
questLog->objectEvents[i].facingDirection = gObjectEvents[i].facingDirection;
|
||||
questLog->objectEvents[i].currentElevation = gObjectEvents[i].currentElevation;
|
||||
questLog->objectEvents[i].previousElevation = gObjectEvents[i].previousElevation;
|
||||
questLog->objectEvents[i].graphicsId = gObjectEvents[i].graphicsId;
|
||||
questLog->objectEvents[i].movementType = gObjectEvents[i].movementType;
|
||||
questLog->objectEvents[i].trainerType = gObjectEvents[i].trainerType;
|
||||
questLog->objectEvents[i].localId = gObjectEvents[i].localId;
|
||||
questLog->objectEvents[i].mapNum = gObjectEvents[i].mapNum;
|
||||
questLog->objectEvents[i].mapGroup = gObjectEvents[i].mapGroup;
|
||||
questLog->objectEvents[i].x = gObjectEvents[i].currentCoords.x;
|
||||
questLog->objectEvents[i].y = gObjectEvents[i].currentCoords.y;
|
||||
questLog->objectEvents[i].trainerRange_berryTreeId = gObjectEvents[i].trainerRange_berryTreeId;
|
||||
questLog->objectEvents[i].previousMetatileBehavior = gObjectEvents[i].previousMetatileBehavior;
|
||||
questLog->objectEvents[i].directionSequenceIndex = gObjectEvents[i].directionSequenceIndex;
|
||||
questLog->objectEvents[i].animId = gObjectEvents[i].playerCopyableMovement;
|
||||
}
|
||||
}
|
||||
|
||||
void SetSav1ObjectEventsFromQuestLog(const struct QuestLog * questLog, const struct ObjectEventTemplate * templates)
|
||||
void QL_LoadObjects(const struct QuestLogScene * questLog, const struct ObjectEventTemplate * templates)
|
||||
{
|
||||
u32 i, j;
|
||||
const struct QuestLogObjectEvent * questLogObjectEvents = questLog->unk_008;
|
||||
const struct QuestLogObjectEvent * questLogObjectEvents = questLog->objectEvents;
|
||||
|
||||
CpuFill16(0, gObjectEvents, sizeof(gObjectEvents));
|
||||
|
||||
for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
|
||||
{
|
||||
gObjectEvents[i].active = questLogObjectEvents[i].active;
|
||||
gObjectEvents[i].triggerGroundEffectsOnStop = questLogObjectEvents[i].triggerGroundEffectsOnStop;
|
||||
gObjectEvents[i].disableCoveringGroundEffects = questLogObjectEvents[i].disableCoveringGroundEffects;
|
||||
gObjectEvents[i].landingJump = questLogObjectEvents[i].landingJump;
|
||||
gObjectEvents[i].frozen = questLogObjectEvents[i].frozen;
|
||||
gObjectEvents[i].facingDirectionLocked = questLogObjectEvents[i].facingDirectionLocked;
|
||||
gObjectEvents[i].disableAnim = questLogObjectEvents[i].disableAnim;
|
||||
gObjectEvents[i].enableAnim = questLogObjectEvents[i].enableAnim;
|
||||
gObjectEvents[i].inanimate = questLogObjectEvents[i].inanimate;
|
||||
gObjectEvents[i].invisible = questLogObjectEvents[i].invisible;
|
||||
gObjectEvents[i].offScreen = questLogObjectEvents[i].offScreen;
|
||||
gObjectEvents[i].trackedByCamera = questLogObjectEvents[i].trackedByCamera;
|
||||
gObjectEvents[i].isPlayer = questLogObjectEvents[i].isPlayer;
|
||||
gObjectEvents[i].spriteAnimPausedBackup = questLogObjectEvents[i].spriteAnimPausedBackup;
|
||||
gObjectEvents[i].spriteAffineAnimPausedBackup = questLogObjectEvents[i].spriteAffineAnimPausedBackup;
|
||||
gObjectEvents[i].active = questLogObjectEvents[i].active;
|
||||
gObjectEvents[i].triggerGroundEffectsOnStop = questLogObjectEvents[i].triggerGroundEffectsOnStop;
|
||||
gObjectEvents[i].disableCoveringGroundEffects = questLogObjectEvents[i].disableCoveringGroundEffects;
|
||||
gObjectEvents[i].landingJump = questLogObjectEvents[i].landingJump;
|
||||
gObjectEvents[i].frozen = questLogObjectEvents[i].frozen;
|
||||
gObjectEvents[i].facingDirectionLocked = questLogObjectEvents[i].facingDirectionLocked;
|
||||
gObjectEvents[i].disableAnim = questLogObjectEvents[i].disableAnim;
|
||||
gObjectEvents[i].enableAnim = questLogObjectEvents[i].enableAnim;
|
||||
gObjectEvents[i].inanimate = questLogObjectEvents[i].inanimate;
|
||||
gObjectEvents[i].invisible = questLogObjectEvents[i].invisible;
|
||||
gObjectEvents[i].offScreen = questLogObjectEvents[i].offScreen;
|
||||
gObjectEvents[i].trackedByCamera = questLogObjectEvents[i].trackedByCamera;
|
||||
gObjectEvents[i].isPlayer = questLogObjectEvents[i].isPlayer;
|
||||
gObjectEvents[i].spriteAnimPausedBackup = questLogObjectEvents[i].spriteAnimPausedBackup;
|
||||
gObjectEvents[i].spriteAffineAnimPausedBackup = questLogObjectEvents[i].spriteAffineAnimPausedBackup;
|
||||
gObjectEvents[i].disableJumpLandingGroundEffect = questLogObjectEvents[i].disableJumpLandingGroundEffect;
|
||||
gObjectEvents[i].fixedPriority = questLogObjectEvents[i].fixedPriority;
|
||||
gObjectEvents[i].facingDirection = questLogObjectEvents[i].mapobj_unk_18;
|
||||
gObjectEvents[i].currentElevation = questLogObjectEvents[i].mapobj_unk_0B_0;
|
||||
gObjectEvents[i].previousElevation = questLogObjectEvents[i].elevation;
|
||||
gObjectEvents[i].graphicsId = questLogObjectEvents[i].graphicsId;
|
||||
gObjectEvents[i].movementType = questLogObjectEvents[i].animPattern;
|
||||
gObjectEvents[i].trainerType = questLogObjectEvents[i].trainerType;
|
||||
gObjectEvents[i].localId = questLogObjectEvents[i].localId;
|
||||
gObjectEvents[i].mapNum = questLogObjectEvents[i].mapNum;
|
||||
gObjectEvents[i].mapGroup = questLogObjectEvents[i].mapGroup;
|
||||
gObjectEvents[i].currentCoords.x = questLogObjectEvents[i].x;
|
||||
gObjectEvents[i].currentCoords.y = questLogObjectEvents[i].y;
|
||||
gObjectEvents[i].trainerRange_berryTreeId = questLogObjectEvents[i].trainerRange_berryTreeId;
|
||||
gObjectEvents[i].previousMetatileBehavior = questLogObjectEvents[i].previousMetatileBehavior;
|
||||
gObjectEvents[i].directionSequenceIndex = questLogObjectEvents[i].directionSequenceIndex;
|
||||
gObjectEvents[i].playerCopyableMovement = questLogObjectEvents[i].animId;
|
||||
gObjectEvents[i].fixedPriority = questLogObjectEvents[i].fixedPriority;
|
||||
gObjectEvents[i].facingDirection = questLogObjectEvents[i].facingDirection;
|
||||
gObjectEvents[i].currentElevation = questLogObjectEvents[i].currentElevation;
|
||||
gObjectEvents[i].previousElevation = questLogObjectEvents[i].previousElevation;
|
||||
gObjectEvents[i].graphicsId = questLogObjectEvents[i].graphicsId;
|
||||
gObjectEvents[i].movementType = questLogObjectEvents[i].movementType;
|
||||
gObjectEvents[i].trainerType = questLogObjectEvents[i].trainerType;
|
||||
gObjectEvents[i].localId = questLogObjectEvents[i].localId;
|
||||
gObjectEvents[i].mapNum = questLogObjectEvents[i].mapNum;
|
||||
gObjectEvents[i].mapGroup = questLogObjectEvents[i].mapGroup;
|
||||
gObjectEvents[i].currentCoords.x = questLogObjectEvents[i].x;
|
||||
gObjectEvents[i].currentCoords.y = questLogObjectEvents[i].y;
|
||||
gObjectEvents[i].trainerRange_berryTreeId = questLogObjectEvents[i].trainerRange_berryTreeId;
|
||||
gObjectEvents[i].previousMetatileBehavior = questLogObjectEvents[i].previousMetatileBehavior;
|
||||
gObjectEvents[i].directionSequenceIndex = questLogObjectEvents[i].directionSequenceIndex;
|
||||
gObjectEvents[i].playerCopyableMovement = questLogObjectEvents[i].animId;
|
||||
|
||||
for (j = 0; j < 0x40; j++)
|
||||
for (j = 0; j < OBJECT_EVENT_TEMPLATES_COUNT; j++)
|
||||
{
|
||||
if (gObjectEvents[i].localId == templates[j].localId)
|
||||
{
|
||||
gObjectEvents[i].initialCoords.x = templates[j].x + 7;
|
||||
gObjectEvents[i].initialCoords.y = templates[j].y + 7;
|
||||
gObjectEvents[i].initialCoords.x = templates[j].x + MAP_OFFSET;
|
||||
gObjectEvents[i].initialCoords.y = templates[j].y + MAP_OFFSET;
|
||||
gObjectEvents[i].rangeX = templates[j].objUnion.normal.movementRangeX;
|
||||
gObjectEvents[i].rangeY = templates[j].objUnion.normal.movementRangeY;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ void SetSav1ObjectEventsFromQuestLog(const struct QuestLog * questLog, const str
|
||||
CpuCopy16(gObjectEvents, gSaveBlock1Ptr->objectEvents, sizeof(gObjectEvents));
|
||||
}
|
||||
|
||||
void sub_815A540(void)
|
||||
void QL_TryStopSurfing(void)
|
||||
{
|
||||
if (gQuestLogState == QL_STATE_PLAYBACK)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ void QuestLogUpdatePlayerSprite(u8 state)
|
||||
|
||||
bool32 QuestLogTryRecordPlayerAvatarGfxTransition(u8 state)
|
||||
{
|
||||
if (gQuestLogPlaybackState == 2)
|
||||
if (gQuestLogPlaybackState == QL_PLAYBACK_STATE_RECORDING)
|
||||
{
|
||||
QuestLogRecordPlayerAvatarGfxTransition(state);
|
||||
return TRUE;
|
||||
@@ -77,7 +77,7 @@ static void QL_GfxTransition_Fish(void)
|
||||
struct ObjectEvent *objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct Sprite *sprite = &gSprites[objectEvent->spriteId];
|
||||
|
||||
if (gQuestLogPlaybackState == 1 || gQuestLogPlaybackState == 3)
|
||||
if (gQuestLogPlaybackState == QL_PLAYBACK_STATE_RUNNING || gQuestLogPlaybackState == QL_PLAYBACK_STATE_ACTION_END)
|
||||
{
|
||||
u8 taskId;
|
||||
LockPlayerFieldControls();
|
||||
|
||||
+4
-4
@@ -1336,7 +1336,7 @@ static bool8 WaitForAorBPress(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sub_8112CAC() == 1 || gQuestLogState == QL_STATE_PLAYBACK)
|
||||
if (QL_GetPlaybackState() == QL_PLAYBACK_STATE_RUNNING || gQuestLogState == QL_STATE_PLAYBACK)
|
||||
{
|
||||
if (sQuestLogWaitButtonPressTimer == 120)
|
||||
return TRUE;
|
||||
@@ -1401,7 +1401,7 @@ bool8 ScrCmd_waitbuttonpress(struct ScriptContext * ctx)
|
||||
{
|
||||
sQuestLogScriptContextPtr = ctx;
|
||||
|
||||
if (sub_8112CAC() == 1 || gQuestLogState == QL_STATE_PLAYBACK)
|
||||
if (QL_GetPlaybackState() == QL_PLAYBACK_STATE_RUNNING || gQuestLogState == QL_STATE_PLAYBACK)
|
||||
sQuestLogWaitButtonPressTimer = 0;
|
||||
SetupNativeScript(ctx, WaitForAorBPress);
|
||||
return TRUE;
|
||||
@@ -1818,7 +1818,7 @@ bool8 ScrCmd_showmoneybox(struct ScriptContext * ctx)
|
||||
u8 y = ScriptReadByte(ctx);
|
||||
u8 ignore = ScriptReadByte(ctx);
|
||||
|
||||
if (!ignore && QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
|
||||
if (!ignore && QL_AvoidDisplay(QL_DestroyAbortedDisplay) != TRUE)
|
||||
DrawMoneyBox(GetMoney(&gSaveBlock1Ptr->money), x, y);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1848,7 +1848,7 @@ bool8 ScrCmd_showcoinsbox(struct ScriptContext * ctx)
|
||||
u8 x = ScriptReadByte(ctx);
|
||||
u8 y = ScriptReadByte(ctx);
|
||||
|
||||
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay) != TRUE)
|
||||
ShowCoinsWindow(GetCoins(), x, y);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+67
-63
@@ -715,7 +715,7 @@ static void DrawVerticalMultichoiceMenu(u8 left, u8 top, u8 mcId, u8 ignoreBpres
|
||||
u8 windowId;
|
||||
const struct MenuAction * list;
|
||||
|
||||
if ((ignoreBpress & 2) || QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
|
||||
if ((ignoreBpress & 2) || QL_AvoidDisplay(QL_DestroyAbortedDisplay) != TRUE)
|
||||
{
|
||||
ignoreBpress &= 1;
|
||||
count = sMultichoiceLists[mcId].count;
|
||||
@@ -860,11 +860,12 @@ bool8 ScriptMenu_YesNo(u8 unused, u8 stuff)
|
||||
if (FuncIsActiveTask(Task_YesNoMenu_HandleInput) == TRUE)
|
||||
return FALSE;
|
||||
gSpecialVar_Result = SCR_MENU_UNSET;
|
||||
if (!QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites))
|
||||
{
|
||||
DisplayYesNoMenuDefaultYes();
|
||||
CreateTask(Task_YesNoMenu_HandleInput, 80);
|
||||
}
|
||||
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay))
|
||||
return TRUE;
|
||||
|
||||
DisplayYesNoMenuDefaultYes();
|
||||
CreateTask(Task_YesNoMenu_HandleInput, 80);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -915,20 +916,22 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, bool8 ignore
|
||||
if (FuncIsActiveTask(Hask_MultichoiceGridMenu_HandleInput) == TRUE)
|
||||
return FALSE;
|
||||
gSpecialVar_Result = SCR_MENU_UNSET;
|
||||
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
|
||||
{
|
||||
list = sMultichoiceLists[multichoiceId].list;
|
||||
count = sMultichoiceLists[multichoiceId].count;
|
||||
width = GetMenuWidthFromList(list, count) + 1;
|
||||
rowCount = count / columnCount;
|
||||
taskId = CreateTask(Hask_MultichoiceGridMenu_HandleInput, 80);
|
||||
gTasks[taskId].tIgnoreBPress = ignoreBpress;
|
||||
gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, width * columnCount, rowCount * 2);
|
||||
SetStdWindowBorderStyle(gTasks[taskId].tWindowId, FALSE);
|
||||
MultichoiceGrid_PrintItems(gTasks[taskId].tWindowId, FONT_NORMAL_COPY_1, width * 8, 16, columnCount, rowCount, list);
|
||||
MultichoiceGrid_InitCursor(gTasks[taskId].tWindowId, FONT_NORMAL_COPY_1, 0, 1, width * 8, columnCount, rowCount, 0);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
}
|
||||
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay) == TRUE)
|
||||
return TRUE;
|
||||
|
||||
list = sMultichoiceLists[multichoiceId].list;
|
||||
count = sMultichoiceLists[multichoiceId].count;
|
||||
width = GetMenuWidthFromList(list, count) + 1;
|
||||
rowCount = count / columnCount;
|
||||
taskId = CreateTask(Hask_MultichoiceGridMenu_HandleInput, 80);
|
||||
gTasks[taskId].tIgnoreBPress = ignoreBpress;
|
||||
gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, width * columnCount, rowCount * 2);
|
||||
SetStdWindowBorderStyle(gTasks[taskId].tWindowId, FALSE);
|
||||
MultichoiceGrid_PrintItems(gTasks[taskId].tWindowId, FONT_NORMAL_COPY_1, width * 8, 16, columnCount, rowCount, list);
|
||||
MultichoiceGrid_InitCursor(gTasks[taskId].tWindowId, FONT_NORMAL_COPY_1, 0, 1, width * 8, columnCount, rowCount, 0);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1057,7 +1060,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y)
|
||||
{
|
||||
u8 spriteId;
|
||||
u8 taskId;
|
||||
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) == TRUE)
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay) == TRUE)
|
||||
return TRUE;
|
||||
if (FindTaskIdByFunc(Task_ScriptShowMonPic) != TASK_NONE)
|
||||
return FALSE;
|
||||
@@ -1143,7 +1146,7 @@ bool8 OpenMuseumFossilPic(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
u8 taskId;
|
||||
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) == TRUE)
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay) == TRUE)
|
||||
return TRUE;
|
||||
if (FindTaskIdByFunc(Task_WaitMuseumFossilPic) != TASK_NONE)
|
||||
return FALSE;
|
||||
@@ -1196,7 +1199,7 @@ static void DestroyScriptMenuWindow(u8 windowId)
|
||||
RemoveWindow(windowId);
|
||||
}
|
||||
|
||||
void QLPlaybackCB_DestroyScriptMenuMonPicSprites(void)
|
||||
void QL_DestroyAbortedDisplay(void)
|
||||
{
|
||||
u8 taskId;
|
||||
s16 *data;
|
||||
@@ -1234,48 +1237,49 @@ void DrawSeagallopDestinationMenu(void)
|
||||
u8 windowId;
|
||||
u8 i;
|
||||
gSpecialVar_Result = SCR_MENU_UNSET;
|
||||
if (QuestLog_SchedulePlaybackCB(QLPlaybackCB_DestroyScriptMenuMonPicSprites) != TRUE)
|
||||
{
|
||||
if (gSpecialVar_0x8005 == 1)
|
||||
{
|
||||
if (gSpecialVar_0x8004 < SEAGALLOP_FIVE_ISLAND)
|
||||
destinationId = SEAGALLOP_FIVE_ISLAND;
|
||||
else
|
||||
destinationId = SEAGALLOP_FOUR_ISLAND;
|
||||
numItems = 5;
|
||||
top = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
destinationId = SEAGALLOP_VERMILION_CITY;
|
||||
numItems = 6;
|
||||
top = 0;
|
||||
}
|
||||
cursorWidth = GetMenuCursorDimensionByFont(FONT_NORMAL, 0);
|
||||
fontHeight = GetFontAttribute(FONT_NORMAL, FONTATTR_MAX_LETTER_HEIGHT);
|
||||
windowId = CreateWindowFromRect(17, top, 11, numItems * 2);
|
||||
SetStdWindowBorderStyle(windowId, FALSE);
|
||||
|
||||
// -2 excludes "Other" and "Exit", appended after the loop
|
||||
for (i = 0; i < numItems - 2; i++)
|
||||
{
|
||||
if (destinationId != gSpecialVar_0x8004)
|
||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, sSeagallopDestStrings[destinationId], cursorWidth, i * 16 + 2, TEXT_SKIP_DRAW, NULL);
|
||||
else
|
||||
i--;
|
||||
destinationId++;
|
||||
|
||||
// Wrap around
|
||||
if (destinationId == SEAGALLOP_SEVEN_ISLAND + 1)
|
||||
destinationId = SEAGALLOP_VERMILION_CITY;
|
||||
}
|
||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_Other, cursorWidth, i * 16 + 2, TEXT_SKIP_DRAW, NULL);
|
||||
i++;
|
||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, gOtherText_Exit, cursorWidth, i * 16 + 2, TEXT_SKIP_DRAW, NULL);
|
||||
Menu_InitCursor(windowId, FONT_NORMAL, 0, 2, 16, numItems, 0);
|
||||
CreateMCMenuInputHandlerTask(FALSE, numItems, windowId, MULTICHOICE_NONE);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
if (QL_AvoidDisplay(QL_DestroyAbortedDisplay) == TRUE)
|
||||
return;
|
||||
|
||||
if (gSpecialVar_0x8005 == 1)
|
||||
{
|
||||
if (gSpecialVar_0x8004 < SEAGALLOP_FIVE_ISLAND)
|
||||
destinationId = SEAGALLOP_FIVE_ISLAND;
|
||||
else
|
||||
destinationId = SEAGALLOP_FOUR_ISLAND;
|
||||
numItems = 5;
|
||||
top = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
destinationId = SEAGALLOP_VERMILION_CITY;
|
||||
numItems = 6;
|
||||
top = 0;
|
||||
}
|
||||
cursorWidth = GetMenuCursorDimensionByFont(FONT_NORMAL, 0);
|
||||
fontHeight = GetFontAttribute(FONT_NORMAL, FONTATTR_MAX_LETTER_HEIGHT);
|
||||
windowId = CreateWindowFromRect(17, top, 11, numItems * 2);
|
||||
SetStdWindowBorderStyle(windowId, FALSE);
|
||||
|
||||
// -2 excludes "Other" and "Exit", appended after the loop
|
||||
for (i = 0; i < numItems - 2; i++)
|
||||
{
|
||||
if (destinationId != gSpecialVar_0x8004)
|
||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, sSeagallopDestStrings[destinationId], cursorWidth, i * 16 + 2, TEXT_SKIP_DRAW, NULL);
|
||||
else
|
||||
i--;
|
||||
destinationId++;
|
||||
|
||||
// Wrap around
|
||||
if (destinationId == SEAGALLOP_SEVEN_ISLAND + 1)
|
||||
destinationId = SEAGALLOP_VERMILION_CITY;
|
||||
}
|
||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_Other, cursorWidth, i * 16 + 2, TEXT_SKIP_DRAW, NULL);
|
||||
i++;
|
||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, gOtherText_Exit, cursorWidth, i * 16 + 2, TEXT_SKIP_DRAW, NULL);
|
||||
Menu_InitCursor(windowId, FONT_NORMAL, 0, 2, 16, numItems, 0);
|
||||
CreateMCMenuInputHandlerTask(FALSE, numItems, windowId, MULTICHOICE_NONE);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
}
|
||||
|
||||
u16 GetSelectedSeagallopDestination(void)
|
||||
|
||||
+51
-54
@@ -69,17 +69,6 @@ struct ShopData
|
||||
/*0x18*/ u16 unk18;
|
||||
};
|
||||
|
||||
struct MartHistory
|
||||
{
|
||||
/*0x00*/ u32 unk0;
|
||||
/*0x04*/ u16 unk4;
|
||||
/*0x06*/ u16 unk6;
|
||||
/*0x08*/ u8 unk8;
|
||||
/*0x09*/ u8 unk9;
|
||||
/*0x0A*/ u8 unkA;
|
||||
/*0x0B*/ u8 unkB;
|
||||
}; /* size = 12 */
|
||||
|
||||
static EWRAM_DATA s16 sViewportObjectEvents[OBJECT_EVENTS_COUNT][4] = {0};
|
||||
EWRAM_DATA struct ShopData gShopData = {0};
|
||||
static EWRAM_DATA u8 sShopMenuWindowId = 0;
|
||||
@@ -89,7 +78,7 @@ EWRAM_DATA u16 (*gShopTilemapBuffer3)[0x400] = {0};
|
||||
EWRAM_DATA u16 (*gShopTilemapBuffer4)[0x400] = {0};
|
||||
EWRAM_DATA struct ListMenuItem *sShopMenuListMenu = {0};
|
||||
static EWRAM_DATA u8 (*sShopMenuItemStrings)[13] = {0};
|
||||
EWRAM_DATA struct MartHistory gShopMenuHistory[2] = {0};
|
||||
EWRAM_DATA struct QuestLogEvent_Shop sHistory[2] = {0};
|
||||
|
||||
//Function Declarations
|
||||
static u8 CreateShopMenu(u8 a0);
|
||||
@@ -146,7 +135,7 @@ static void ExitBuyMenu(u8 taskId);
|
||||
static void Task_ExitBuyMenu(u8 taskId);
|
||||
static void DebugFunc_PrintPurchaseDetails(u8 taskId);
|
||||
static void DebugFunc_PrintShopMenuHistoryBeforeClearMaybe(void);
|
||||
static void RecordQuestLogItemPurchase(void);
|
||||
static void RecordTransactionForQuestLog(void);
|
||||
|
||||
static const struct MenuAction sShopMenuActions_BuySellQuit[] =
|
||||
{
|
||||
@@ -305,7 +294,7 @@ static void CB2_GoToSellMenu(void)
|
||||
static void Task_HandleShopMenuQuit(u8 taskId)
|
||||
{
|
||||
ClearShopMenuWindow();
|
||||
RecordQuestLogItemPurchase();
|
||||
RecordTransactionForQuestLog();
|
||||
DestroyTask(taskId);
|
||||
if (gShopData.callback != NULL)
|
||||
gShopData.callback();
|
||||
@@ -995,7 +984,7 @@ static void BuyMenuTryMakePurchase(u8 taskId)
|
||||
{
|
||||
BuyMenuDisplayMessage(taskId, gText_HereYouGoThankYou, BuyMenuSubtractMoney);
|
||||
DebugFunc_PrintPurchaseDetails(taskId);
|
||||
RecordItemPurchase(tItemId, tItemCount, 1);
|
||||
RecordItemTransaction(tItemId, tItemCount, QL_EVENT_BOUGHT_ITEM - QL_EVENT_USED_POKEMART);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1066,59 +1055,67 @@ static void DebugFunc_PrintShopMenuHistoryBeforeClearMaybe(void)
|
||||
{
|
||||
}
|
||||
|
||||
void RecordItemPurchase(u16 item, u16 quantity, u8 a2)
|
||||
// Records a transaction during a single shopping session.
|
||||
// This is for the Quest Log to save information about the player's purchases/sales when they finish.
|
||||
void RecordItemTransaction(u16 itemId, u16 quantity, u8 logEventId)
|
||||
{
|
||||
struct MartHistory *history;
|
||||
struct QuestLogEvent_Shop *history;
|
||||
|
||||
if (gShopMenuHistory[0].unkA == a2)
|
||||
// There should only be a single entry for buying/selling respectively,
|
||||
// so if one has already been created then get it first.
|
||||
if (sHistory[0].logEventId == logEventId)
|
||||
{
|
||||
history = &gShopMenuHistory[0];
|
||||
history = &sHistory[0];
|
||||
}
|
||||
else if (gShopMenuHistory[1].unkA == a2)
|
||||
else if (sHistory[1].logEventId == logEventId)
|
||||
{
|
||||
history = &gShopMenuHistory[1];
|
||||
history = &sHistory[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gShopMenuHistory[0].unkA == 0)
|
||||
history = &gShopMenuHistory[0];
|
||||
// First transaction of this type, save it in an empty slot
|
||||
if (sHistory[0].logEventId == 0)
|
||||
history = &sHistory[0];
|
||||
else
|
||||
history = &gShopMenuHistory[1];
|
||||
history->unkA = a2;
|
||||
history = &sHistory[1];
|
||||
history->logEventId = logEventId;
|
||||
}
|
||||
|
||||
// Set flag if this isn't the first time we've bought/sold in this session
|
||||
if (history->lastItemId != ITEM_NONE)
|
||||
history->hasMultipleTransactions = TRUE;
|
||||
|
||||
history->lastItemId = itemId;
|
||||
|
||||
// Add to number of items bought/sold
|
||||
if (history->itemQuantity < 999)
|
||||
{
|
||||
history->itemQuantity += quantity;
|
||||
if (history->itemQuantity > 999)
|
||||
history->itemQuantity = 999;
|
||||
}
|
||||
|
||||
if (history->unk4 != 0)
|
||||
// Add to amount of money spent buying or earned selling
|
||||
if (history->totalMoney < 999999)
|
||||
{
|
||||
history->unk9 = 1;
|
||||
}
|
||||
|
||||
history->unk4 = item;
|
||||
if (history->unk6 < 999)
|
||||
{
|
||||
history->unk6 += quantity;
|
||||
if (history->unk6 > 999)
|
||||
history->unk6 = 999;
|
||||
}
|
||||
|
||||
if (history->unk0 < 999999)
|
||||
{
|
||||
history->unk0 += (ItemId_GetPrice(item) >> (a2 - 1)) * quantity;
|
||||
if (history->unk0 > 999999)
|
||||
history->unk0 = 999999;
|
||||
// logEventId will either be 1 (bought) or 2 (sold)
|
||||
// so for buying it will add the full price and selling will add half price
|
||||
history->totalMoney += (ItemId_GetPrice(itemId) >> (logEventId - 1)) * quantity;
|
||||
if (history->totalMoney > 999999)
|
||||
history->totalMoney = 999999;
|
||||
}
|
||||
}
|
||||
|
||||
static void RecordQuestLogItemPurchase(void)
|
||||
// Will record QL_EVENT_BOUGHT_ITEM and/or QL_EVENT_SOLD_ITEM, or nothing.
|
||||
static void RecordTransactionForQuestLog(void)
|
||||
{
|
||||
u16 v;
|
||||
|
||||
v = gShopMenuHistory[0].unkA;
|
||||
if (v != 0)
|
||||
SetQuestLogEvent(v + QL_EVENT_USED_POKEMART, (const u16 *)&gShopMenuHistory[0]);
|
||||
u16 eventId = sHistory[0].logEventId;
|
||||
if (eventId != 0)
|
||||
SetQuestLogEvent(eventId + QL_EVENT_USED_POKEMART, (const u16 *)&sHistory[0]);
|
||||
|
||||
v = gShopMenuHistory[1].unkA;
|
||||
if (v != 0)
|
||||
SetQuestLogEvent(v + QL_EVENT_USED_POKEMART, (const u16 *)&gShopMenuHistory[1]);
|
||||
eventId = sHistory[1].logEventId;
|
||||
if (eventId != 0)
|
||||
SetQuestLogEvent(eventId + QL_EVENT_USED_POKEMART, (const u16 *)&sHistory[1]);
|
||||
}
|
||||
|
||||
void CreatePokemartMenu(const u16 *itemsForSale)
|
||||
@@ -1127,9 +1124,9 @@ void CreatePokemartMenu(const u16 *itemsForSale)
|
||||
CreateShopMenu(MART_TYPE_REGULAR);
|
||||
SetShopMenuCallback(ScriptContext_Enable);
|
||||
DebugFunc_PrintShopMenuHistoryBeforeClearMaybe();
|
||||
memset(&gShopMenuHistory, 0, sizeof(gShopMenuHistory));
|
||||
gShopMenuHistory[0].unk8 = gMapHeader.regionMapSectionId;
|
||||
gShopMenuHistory[1].unk8 = gMapHeader.regionMapSectionId;
|
||||
memset(&sHistory, 0, sizeof(sHistory));
|
||||
sHistory[0].mapSec = gMapHeader.regionMapSectionId;
|
||||
sHistory[1].mapSec = gMapHeader.regionMapSectionId;
|
||||
}
|
||||
|
||||
void CreateDecorationShop1Menu(const u16 *itemsForSale)
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@
|
||||
#include "menu_indicators.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/quest_log.h"
|
||||
|
||||
// Any item in the TM Case with nonzero importance is considered an HM
|
||||
#define IS_HM(itemId) (ItemId_GetImportance(itemId) != 0)
|
||||
@@ -1292,7 +1293,7 @@ static void Task_DoSaleOfTMs(u8 taskId)
|
||||
PlaySE(SE_SHOP);
|
||||
RemoveBagItem(gSpecialVar_ItemId, tQuantitySelected);
|
||||
AddMoney(&gSaveBlock1Ptr->money, ItemId_GetPrice(gSpecialVar_ItemId) / 2 * tQuantitySelected);
|
||||
RecordItemPurchase(gSpecialVar_ItemId, tQuantitySelected, 2);
|
||||
RecordItemTransaction(gSpecialVar_ItemId, tQuantitySelected, QL_EVENT_SOLD_ITEM - QL_EVENT_USED_POKEMART);
|
||||
DestroyListMenuTask(tListTaskId, &sTMCaseStaticResources.scrollOffset, &sTMCaseStaticResources.selectedRow);
|
||||
TMCaseSetup_GetTMCount();
|
||||
TMCaseSetup_InitListMenuPositions();
|
||||
|
||||
+6
-8
@@ -107,9 +107,7 @@ struct {
|
||||
/*0xF0*/ u16 monSpecies[2];
|
||||
/*0xF4*/ u16 cachedMapMusic;
|
||||
/*0xF6*/ u8 unk_F6;
|
||||
/*0xF8*/ u16 questLogSpecies[2];
|
||||
/*0xFC*/ u8 linkPartnerName[7];
|
||||
/*0x103*/ u8 filler_103[1];
|
||||
/*0xF8*/ struct QuestLogEvent_Traded questLogData;
|
||||
/*0x104*/ u8 textColor[3];
|
||||
/*0x107*/ u8 filler_107[1];
|
||||
/*0x108*/ bool8 isCableTrade;
|
||||
@@ -883,9 +881,9 @@ void CB2_LinkTrade(void)
|
||||
case 10:
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
|
||||
ShowBg(0);
|
||||
sTradeAnim->questLogSpecies[TRADE_PLAYER] = GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_SPECIES_OR_EGG);
|
||||
sTradeAnim->questLogSpecies[TRADE_PARTNER] = GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_SPECIES_OR_EGG);
|
||||
memcpy(sTradeAnim->linkPartnerName, gLinkPlayers[GetMultiplayerId() ^ 1].name, PLAYER_NAME_LENGTH);
|
||||
sTradeAnim->questLogData.speciesSent = GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_SPECIES_OR_EGG);
|
||||
sTradeAnim->questLogData.speciesReceived = GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_SPECIES_OR_EGG);
|
||||
memcpy(sTradeAnim->questLogData.partnerName, gLinkPlayers[GetMultiplayerId() ^ 1].name, PLAYER_NAME_LENGTH);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 11:
|
||||
@@ -2599,11 +2597,11 @@ static void CB2_SaveAndEndTrade(void)
|
||||
case 50:
|
||||
if (InUnionRoom())
|
||||
{
|
||||
SetQuestLogEvent(QL_EVENT_LINK_TRADED_UNION, sTradeAnim->questLogSpecies);
|
||||
SetQuestLogEvent(QL_EVENT_LINK_TRADED_UNION, (void *)&sTradeAnim->questLogData);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetQuestLogEvent(QL_EVENT_LINK_TRADED, sTradeAnim->questLogSpecies);
|
||||
SetQuestLogEvent(QL_EVENT_LINK_TRADED, (void *)&sTradeAnim->questLogData);
|
||||
IncrementGameStat(GAME_STAT_POKEMON_TRADES);
|
||||
}
|
||||
if (gWirelessCommType)
|
||||
|
||||
+1
-11
@@ -4,6 +4,7 @@
|
||||
#include "event_data.h"
|
||||
#include "event_scripts.h"
|
||||
#include "random.h"
|
||||
#include "constants/trainer_fan_club.h"
|
||||
|
||||
struct TrainerFanClub
|
||||
{
|
||||
@@ -18,17 +19,6 @@ struct TrainerFanClub
|
||||
#define SET_TRAINER_FAN_CLUB_FLAG(flag) (fanClub->fanFlags |= 1 << (flag))
|
||||
#define FLIP_TRAINER_FAN_CLUB_FLAG(flag)(fanClub->fanFlags ^= 1 << (flag))
|
||||
|
||||
#define FANCLUB_MEMBER1 0
|
||||
#define FANCLUB_MEMBER2 1
|
||||
#define FANCLUB_MEMBER3 2
|
||||
#define FANCLUB_MEMBER4 3
|
||||
#define FANCLUB_MEMBER5 4
|
||||
#define FANCLUB_MEMBER6 5
|
||||
#define FANCLUB_MEMBER7 6
|
||||
#define FANCLUB_MEMBER8 7
|
||||
|
||||
#define NUM_TRAINER_FAN_CLUB_MEMBERS 8
|
||||
|
||||
static void TryLoseFansFromPlayTimeAfterLinkBattle(struct TrainerFanClub *);
|
||||
static void UpdateTrainerFanClubGameClear(struct TrainerFanClub *);
|
||||
static u8 PlayerGainRandomTrainerFan(struct TrainerFanClub *);
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ static const TrainerSeeFunc sTrainerSeeFuncList2[] = {
|
||||
bool8 CheckForTrainersWantingBattle(void)
|
||||
{
|
||||
u8 i;
|
||||
if (sub_8111C2C() == TRUE)
|
||||
if (QL_IsTrainerSightDisabled() == TRUE)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
|
||||
|
||||
+375
-372
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user