diff --git a/headers/data/overlay29.h b/headers/data/overlay29.h index c345aad2..cf8eddbc 100644 --- a/headers/data/overlay29.h +++ b/headers/data/overlay29.h @@ -108,6 +108,7 @@ extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_WEATHER_ATK_SPEED_BOO extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_WEATHER_MOVE_SPEED_BOOST[8]; extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_WEATHER_NO_STATUS[8]; extern uint32_t AI_THROWN_ITEM_ACTION_CHOICE_COUNT; +extern uint32_t EXPLOSION_FIXED_DAMAGES[3]; extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_EVASION_BOOST[8]; extern struct tile DEFAULT_TILE; extern bool HIDDEN_STAIRS_SPAWN_BLOCKED; diff --git a/headers/data/overlay31.h b/headers/data/overlay31.h index a7280a17..031ca5c6 100644 --- a/headers/data/overlay31.h +++ b/headers/data/overlay31.h @@ -7,7 +7,7 @@ extern struct window_params DUNGEON_WINDOW_PARAMS_3; extern struct window_params DUNGEON_WINDOW_PARAMS_4; extern struct simple_menu_id_item DUNGEON_MAIN_MENU_ITEMS[8]; extern char DUNGEON_MENU_SWITCH_STR1[12]; -extern struct window_params DUNGEON_WINDOW_PARAMS_5; +extern struct window_params STAIRS_INFO_WINDOW_PARAMS; extern struct window_params DUNGEON_WINDOW_PARAMS_6; extern struct window_params DUNGEON_WINDOW_PARAMS_7; extern struct simple_menu_id_item STAIRS_MENU_ITEMS_NORMAL[4]; diff --git a/headers/data/ram.h b/headers/data/ram.h index 11f44196..af3f26b7 100644 --- a/headers/data/ram.h +++ b/headers/data/ram.h @@ -67,6 +67,7 @@ extern uint32_t FRAMES_SINCE_LAUNCH_TIMES_THREE; extern uint32_t OSI_VRAM_EXCLUSIVE; extern uint16_t OSI_VRAM_LOCK_ID[9]; extern struct alarm_callback_info CALLBACK_TABLE[8]; +extern struct effect_control EFFECT_CONTROL; extern struct mem_arena* GROUND_MEMORY_ARENA_1_PTR; extern struct mem_arena* GROUND_MEMORY_ARENA_2_PTR; extern bool LOCK_NOTIFY_ARRAY[20]; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index e6970246..da8530fc 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -389,8 +389,8 @@ void LoadWazaP2(void); void UnloadCurrentWazaP(void); char* GetMoveName(enum move_id move_id); void FormatMoveString(char* string, struct move* move, undefined* type_print); -void FormatMoveStringMore(undefined* param_1, int param_2, struct move* move, - undefined* type_print); +void FormatMoveStringMore(struct preprocessor_args* preprocessor_args, uint8_t pos, + struct move* move, undefined* type_print); void InitMove(struct move* move, enum move_id move_id); void InitMoveCheckId(struct move* move, enum move_id move_id); void GetInfoMoveGround(struct ground_move* move, enum move_id move_id); diff --git a/headers/functions/overlay10.h b/headers/functions/overlay10.h index febb6d36..921e0fe8 100644 --- a/headers/functions/overlay10.h +++ b/headers/functions/overlay10.h @@ -15,7 +15,13 @@ bool IsInventoryMenuState3(int window_id); void CreateInventoryMenuOuter(int n_items, int param_2, int param_3, uint8_t* param_4, undefined* param_5, undefined* param_6, uint32_t param_7); void LoadPaletteBase(uint8_t sprite_index, bool is_4bpp, uint8_t start_4bpp); +void TerminateAllEffects(void); +void TerminateEffect(int unique_id, bool not_special_wan_file); +void TerminateEffectWrapper(int unique_id); enum wan_offset_type GetEffectAnimationWanOffset(int anim_id); +void PlayEffect(struct live_effect* effect, enum screen screen); +int GetLiveEffectIdx(int unique_id); +bool DisplayEffect(struct live_effect* effect, struct vec2_16* camera_pos); bool ScreenEffectActive(enum screen screen); bool BlockingAnimationInProgress(int unique_id); struct effect_animation* GetEffectAnimation(int anim_id); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index c3df1d08..487c33a6 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -58,12 +58,12 @@ bool ItemIsActive(struct entity* entity, enum item_id item_id); int GetVisibilityRange(void); void RevealWholeFloor(struct entity* entity); bool DungeonScreenEffectActive(void); -int PlayEffectAnimationEntity(struct entity* entity, int effect_id, bool blocking, +int PlayEffectAnimationEntity(struct entity* entity, int effect_id, bool wait, enum wan_offset_type wan_offset, uint8_t finish_cur_effects_first, bool play_if_two_turn_invisible, enum direction_id effect_dir, uint16_t* custom_oam_adjustment_info); -int PlayEffectAnimationPos(struct position* pos, int effect_id, bool blocking); -int PlayEffectAnimationPixelPos(struct pixel_position* pixel_pos, int effect_id, bool blocking); +int PlayEffectAnimationPos(struct position* pos, int effect_id, bool wait); +int PlayEffectAnimationPixelPos(struct pixel_position* pixel_pos, int effect_id, bool wait); void FinishPlayingEffectAnimations(bool wait_for_non_blocking); void CopyStatusIconFlags(struct status_icon_flags* dst, struct entity* src); void UpdateStatusIconFlags(struct entity* entity); @@ -89,6 +89,7 @@ void PlayDefensiveStatMultiplierDownEffect(struct entity* entity, int stat_index void PlayHitChanceUpEffect(struct entity* entity, int stat_index); void PlayHitChanceDownEffect(struct entity* entity, int stat_index); void PlaySeByIdIfShouldDisplayEntity(struct entity* entity, int se_id); +void PlayItemThrowSfx(struct entity* user, enum item_category category); void PlayMissSfx(struct entity* attacker, struct entity* defender); void PlayStairsSfx(void); bool ShouldDisplayEntityAdvanced(struct entity* entity); @@ -144,6 +145,7 @@ bool FindFarthestUnoccupiedTileWithin2(struct position* pos_out, struct position bool random_room); bool FindUnoccupiedTileWithin3(struct position* pos_out, struct position* origin, bool random_room); uint8_t TickStatusTurnCounter(uint8_t* counter); +void GetCurvedProjectileTargetPos(struct position* target_pos, struct entity* user); void AdvanceFrame(undefined param_1); void UnkMapRelatedFunc(int switch_case, undefined4 param_2); void AnimateWaterShadows(void); @@ -277,6 +279,11 @@ void UseThrowableItem(struct entity* user); void TalkToTeamMemberInFront(struct entity* entity); void PlayerUseMove(struct entity* entity); void UseRegularAttackOrStruggle(struct entity* entity); +struct entity* GetShopkeeperIfTalkable(struct entity* leader); +void HandleShopTransaction(bool always_transact); +void TrySellToShop(bool param_1); +uint8_t TryBuyFromShop(bool param_1); +void TriggerThiefAlert(void); void ResetDamageData(struct damage_data* damage); void FreeLoadedAttackSpriteAndMore(void); uint16_t SetAndLoadCurrentAttackAnimation(enum pack_file_id pack_id, uint16_t file_index); @@ -295,7 +302,7 @@ void SwapMonsterWanFileIndex(int src_id, int dst_id); void LoadMonsterSprite(enum monster_id monster_id, undefined param_2); void DeleteMonsterSpriteFile(enum monster_id monster_id); void DeleteAllMonsterSpriteFiles(void); -bool CanMonsterBeAddedToTeam(struct entity* entity); +bool MonsterCannotBeAddedToTeam(struct entity* entity); void EuFaintCheck(bool non_team_member_fainted, bool set_unk_byte); void HandleFaint(struct entity* fainted_entity, union damage_source damage_source, struct entity* killer); @@ -324,6 +331,7 @@ void RestorePpAllMovesSetFlags(struct entity* entity); bool CheckTeamMemberIdxVeneer(int member_idx); bool CheckMonsterTeamMemberIdx(struct entity* entity); bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id); +void ActivateTerrainEffects(struct entity* entity); void BoostIQ(struct entity* entity, int iq_boost, bool suppress_logs); void MakeMonsterIdleInDirection2(struct entity* entity, enum direction_id direction); bool ShouldMonsterHeadToStairs(struct entity* entity); @@ -389,9 +397,11 @@ enum mobility_type GetMobilityTypeCheckSlip(enum monster_id species, bool walk_o enum mobility_type GetMobilityTypeCheckSlipAndFloating(struct entity* monster, enum monster_id species); bool IsInvalidSpawnTile(enum monster_id monster_id, struct tile* tile); +bool CannotMoveToTile(struct entity* monster, struct position* tile_pos); enum mobility_type GetMobilityTypeAfterIqSkills(struct entity* monster, enum mobility_type mobility_type); bool CanMoveThroughWalls(struct entity* monster); +bool CannotStandOnTileNoMonsterCheck(struct entity* monster, struct position* tile_pos); bool CannotStandOnTile(struct entity* monster, struct position* tile_pos); int CalcSpeedStage(struct entity* entity, int counter_weight); int CalcSpeedStageWrapper(struct entity* entity); @@ -414,6 +424,7 @@ bool MonsterHasNegativeStatus(struct entity* monster, bool check_held_item); bool IsMonsterSleeping(struct entity* monster); bool MonsterHasQuarterHp(struct entity* monster); bool CheckVariousStatuses2(struct entity* entity, bool blind_check); +bool CanBeTalkedTo(struct entity* monster); bool HasStatusThatPreventsOutlawEscaping(struct entity* monster); bool CheckVariousConditions(struct entity* entity); bool CheckVariousStatuses(struct entity* entity); @@ -475,6 +486,7 @@ void DisplayMonster(struct entity* entity); void AnimateFlyingMoves(struct entity* entity); void ChangeMonsterAnimation(struct entity* monster, int8_t animation_id, enum direction_id direction); +void MakeMonsterIdleInDirectionIfValid(struct entity* monster, enum direction_id direction); void ChangeMonsterAnimationToIdle(struct entity* monster, enum direction_id direction); void ChangeMonsterAnimationToHurt(struct entity* monster, enum direction_id direction); uint8_t GetIdleAnimationId(struct entity* entity); @@ -515,9 +527,10 @@ struct entity* GetLeaderIfVisible(struct entity* monster); void RunMonsterAi(struct entity* monster, int unused); void ApplyDamageAndEffects(struct entity* attacker, struct entity* defender, struct damage_data* damage_data, bool false_swipe, bool exp_on_faint, - union damage_source damage_source, bool defender_response); + union damage_source damage_source, bool defender_response, bool fissure); bool ApplyDamage(struct entity* attacker, struct entity* defender, struct damage_data* damage_data, - bool false_swipe, bool exp_on_faint, union damage_source damage_source); + bool false_swipe, bool exp_on_faint, union damage_source damage_source, + bool fissure); bool AftermathCheck(struct entity* attacker, struct entity* defender, union damage_source damage_source); enum type_matchup GetTypeMatchupBothTypes(struct entity* attacker, struct entity* defender, @@ -537,25 +550,25 @@ void CalcDamage(struct entity* attacker, struct entity* defender, enum type_id a fx32_8 damage_mult_fp, enum move_id move_id, bool full_calc); void ApplyDamageAndEffectsWrapper(struct entity* monster, int damage, enum damage_message message, union damage_source damage_source); -void CalcRecoilDamageFixed(struct entity* attacker, int fixed_damage, undefined4 param_3, +void CalcRecoilDamageFixed(struct entity* attacker, int fixed_damage, bool exp_on_faint, struct damage_data* damage_out, enum move_id move_id, enum type_id attack_type, union damage_source damage_source, - enum damage_message damage_message, undefined4 param_9, - undefined4 param_10); + enum damage_message damage_message, bool defender_response, + bool fissure); void CalcDamageFixed(struct entity* attacker, struct entity* defender, int fixed_damage, bool exp_on_faint, struct damage_data* damage_out, enum type_id attack_type, enum move_category move_category, union damage_source damage_source, - enum damage_message damage_message, undefined4 param_10, undefined4 param_11); + enum damage_message damage_message, bool defender_response, bool fissure); void CalcDamageFixedNoCategory(struct entity* attacker, struct entity* defender, int fixed_damage, bool exp_on_faint, struct damage_data* damage_out, enum type_id attack_type, union damage_source damage_source, - enum damage_message damage_message, undefined4 param_9, - undefined4 param_10); + enum damage_message damage_message, bool defender_response, + bool fissure); void CalcDamageFixedWrapper(struct entity* attacker, struct entity* defender, int fixed_damage, bool exp_on_faint, struct damage_data* damage_out, enum type_id attack_type, enum move_category move_category, union damage_source damage_source, enum damage_message damage_message, - undefined4 param_10, undefined4 param_11); + bool defender_response, bool fissure); void UpdateShopkeeperModeAfterAttack(struct entity* attacker, struct entity* defender); void UpdateShopkeeperModeAfterTrap(struct entity* shopkeeper, bool non_team_member); void ResetDamageCalcDiagnostics(void); @@ -811,6 +824,11 @@ void TryExplosion(struct entity* user, struct entity* target, struct position* p enum type_id attack_type, union damage_source damage_source); void TryAftermathExplosion(struct entity* user, struct entity* target, struct position* pos, int radius, enum type_id attack_type, union damage_source damage_source); +void CalcExplosionDamage(struct entity* user, struct entity* target, enum type_id attack_type, + enum move_id move_id, uint32_t base_fixed_damage); +void CalcAftermathExplosionDamage(struct entity* user, struct entity* target, + enum type_id attack_type, enum move_id move_id, + uint32_t base_fixed_damage); void TryWarp(struct entity* user, struct entity* target, enum warp_type warp_type, struct position* position); void EnsureCanStandCurrentTile(struct entity* entity); diff --git a/headers/functions/overlay31.h b/headers/functions/overlay31.h index 8fff2654..706f7d19 100644 --- a/headers/functions/overlay31.h +++ b/headers/functions/overlay31.h @@ -10,6 +10,7 @@ void StairsMenu(struct entity* leader, bool leave_minimap_closed_after); void InitStairsMenu(struct entity* leader); void StairsSubheadingCallback(int window_id); int StairsMenuLoop(void); +void StairsDescriptionCallback(int window_id); void CloseMainStairsMenu(void); void FreeStairsMenu(void); bool EntityIsValidOverlay31(struct entity* entity); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 17caa06d..023156ff 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1671,14 +1671,14 @@ ASSERT_SIZE(struct alarm_callback_info, 12); struct effect_animation { enum effect_file_type file_type; // 0x0 - int file_index; // 0x4: File index in pack 3 (effect.bin) - int palette_num; // 0x8 + uint32_t file_index; // 0x4: File index in pack 3 (effect.bin) + uint32_t palette_num; // 0x8 // 0xC: Some sort of index into the file. Related animations are grouped together into the same // file and indexed with this. Is used as the animation_key parameter in // SetAnimationForAnimationControl. - int animation_index; + uint32_t animation_index; int se_id; // 0x10: Sound effect id, passed to PlaySeByIdVolume - int field_0x14; // 0x14: Seemingly always 0 + undefined4 field_0x14; // 0x14: Seemingly always 0 uint8_t is_screen_effect; // 0x18: Seems to always be 1 for screen effects, unused otherwise struct wan_offset_type_8 wan_offset; // 0x19 uint8_t is_non_blocking; // 0x1A @@ -1686,4 +1686,76 @@ struct effect_animation { }; ASSERT_SIZE(struct effect_animation, 28); +struct live_effect_unk_substruct { + undefined field_0x0[64]; +}; +ASSERT_SIZE(struct live_effect_unk_substruct, 64); + +// Represents an effect animation that is currently playing +struct live_effect { + enum screen screen; // 0x0 + undefined4 field_0x4; + enum effect_file_type file_type; // 0x8 + int unique_id; // 0xC: -1 if no effect playing + undefined4 field_0x10; + uint32_t effect_id; // 0x14 + undefined4 field_0x18; // Seemingly always 0 + undefined4 field_0x1c; + struct vec2_16 pos; // 0x20: Absolute pixel coordinates of effect + undefined4 field_0x24; + undefined4 field_0x28; + undefined4 field_0x2c; + uint16_t oam_adjustment_info[6]; // 0x30 + uint32_t some_bitfield; // 0x3C + enum effect_file_type file_type_copy; // 0x40: Seemingly a copy of file_type + int file_index; // 0x44: File index in pack 3 (effect.bin) + uint32_t palette_num; // 0x48 + undefined4 field_0x4c; + uint32_t animation_index; // 0x50: See struct effect_animation + undefined4 field_0x54; + int se_id; // 0x58 + undefined4 field_0x5c; // Seemingly always 0 + uint8_t is_non_blocking; // 0x60 + uint8_t repeat; // 0x61: If non-zero, makes the animation repeat a bunch of times + undefined2 field_0x62; + int16_t wan_id; // 0x64: Entry in wan_table + undefined2 field_0x66; + struct animation_control anim_ctrl; // 0x68 + undefined2 field_0xe4; + undefined field_0xe6; + undefined field_0xe7; + struct live_effect_unk_substruct field_0xe8; + undefined2 field_0x128; + undefined2 field_0x12a; + undefined2 field_0x12c; + undefined2 field_0x12e; + undefined2 field_0x130; + undefined2 field_0x132; + undefined2 field_0x134; + struct vec2_16 delta_pos; // 0x136: Values to add every frame to pos + undefined field_0x13a; + undefined field_0x13b; +}; +ASSERT_SIZE(struct live_effect, 316); + +// Contains information about how effects should be played, and the ones that are currently active. +struct effect_control { + struct live_effect live_effects[32]; // 0x0 + uint32_t next_unique_id; // 0x2780 + uint32_t is_ground_mode; // 0x2784 + // 0x2788: Entry in wan_table for file 1 if ground mode, file 292 if dungeon mode + uint16_t wan_entry; + undefined field_0x278a; + undefined field_0x278b; + undefined4 field_0x278c; + undefined2 field_0x2790; + undefined field_0x2792[12]; + bool screen_effect_active[2]; // 0x279E: Index 0 is for SCREEN_MAIN, 1 for SCREEN_SUB + undefined field_0x27a0; + undefined field_0x27a1; + undefined field_0x27a2; + undefined field_0x27a3; +}; +ASSERT_SIZE(struct effect_control, 10148); + #endif diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 5e33c268..a6a9ed93 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -4396,6 +4396,7 @@ enum wan_offset_type { WAN_OFFSET_HAND_LEFT = 1, WAN_OFFSET_HAND_RIGHT = 2, WAN_OFFSET_CENTER = 3, + WAN_OFFSET_NONE = 4, }; // This is sometimes stored as an 8-bit integer diff --git a/headers/types/dungeon_mode/dungeon_mode_common.h b/headers/types/dungeon_mode/dungeon_mode_common.h index 33d6b1c2..cee8e6ca 100644 --- a/headers/types/dungeon_mode/dungeon_mode_common.h +++ b/headers/types/dungeon_mode/dungeon_mode_common.h @@ -125,9 +125,9 @@ ASSERT_SIZE(struct monster_summary, 120); // Parameters used when throwing a projectile item. struct projectile_throw_info { - uint8_t field_0x0; + bool pierce; // 0x0 uint8_t field_0x1; - int16_t field_0x2; + int16_t max_range; // 0x2 }; ASSERT_SIZE(struct projectile_throw_info, 4); diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 0ab602b7..4d9481f4 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -108,7 +108,7 @@ ASSERT_SIZE(struct rescue_monster_tables, 2944); // by the selected mission_weighted_category, and GenerateMission converts the template into a // mission struct. 0x1560 in rescue.bin struct mission_templates_table { - struct mission_template[600]; + struct mission_template mission_templates[600]; // This is the perfect size for a mission_category, but not for a template... uint16_t unused[4]; }; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 7a2bacdf..ba72fb3b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3774,8 +3774,8 @@ arm9: description: |- Note: unverified, ported from Irdkwia's notes - r0: ??? - r1: ??? + r0: preprocessor_args pointer + r1: position in preprocessor_args id_vals array r2: move r3: type_print - name: InitMove diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 932680d3..d0ea5496 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -161,6 +161,28 @@ overlay10: r0: sprite index in wan_table to load from r1: 0 for 8bpp, 1 for 4bpp r2: starting palette number for 4bpp + - name: TerminateAllEffects + address: + EU: 0x22BE508 + description: |- + Terminates all currently playing live effects. + + No params. + - name: TerminateEffect + address: + EU: 0x22BE5FC + description: |- + Makes the live effect with the given unique id stop playing in the middle of execution. + + r0: unique id + r1: true if the effect does not have type WAN File 0/1 + - name: TerminateEffectWrapper + address: + EU: 0x22BE790 + description: |- + Wrapper for TerminateEffect. + + r0: unique id - name: GetEffectAnimationWanOffset address: EU: 0x22BE7F4 @@ -171,6 +193,33 @@ overlay10: r0: anim_id return: GetEffectAnimation(anim_id)->wan_offset + - name: PlayEffect + address: + EU: 0x22BE900 + description: |- + Fills a live_effect struct's fields with specific effect-related information to begin playback. + + Note that some initialization must be done first (see callsites). + + r0: live_effect + r1: screen + - name: GetLiveEffectIdx + address: + EU: 0x22BF2E0 + description: |- + Gets a live effect's index in EFFECT_CONTROL.live_effects from its unique id. + + r0: unique id + return: index, or -1 if it is not present + - name: DisplayEffect + address: + EU: 0x22BFE30 + description: |- + Displays the current frame of an effect animation, also handling playing the sound effect if necessary. + + r0: live_effect + r1: pixel position of camera + return: true if the effect's is_non_blocking field is 0, false otherwise - name: ScreenEffectActive address: EU: 0x22C0228 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 00f0fbe3..684052e1 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -786,7 +786,7 @@ overlay29: r0: entity pointer r1: Effect ID - r2: whether the effect is blocking or not (i.e. whether the function should wait until it is finished or 100 frames have passed to return) + r2: if the effect is blocking, whether the function should wait until it is finished or 100 frames have passed to return r3: WAN offset on entity sprite to use stack[0]: if 2, waits until any in-progress effects are finished before playing the given one; if 1, waits only for blocking effects stack[1]: whether to still play the effect even if the entity is using a non-flying two-turn move like Dig or Shadow Force @@ -803,7 +803,7 @@ overlay29: r0: Position where the effect should be played r1: Effect ID - r2: whether the effect is blocking or not (i.e. whether the function should wait until it is finished or 100 frames have passed to return) + r2: if the effect is blocking, whether the function should wait until it is finished or 100 frames have passed to return return: -1 if the animation is finished / exceeded 100 frames, or a unique id for the playing effect otherwise - name: PlayEffectAnimationPixelPos address: @@ -815,7 +815,7 @@ overlay29: r0: Pixel position where the effect should be played r1: Effect ID - r2: whether the effect is blocking or not (i.e. whether the function should wait until it is finished or 100 frames have passed to return) + r2: if the effect is blocking, whether the function should wait until it is finished or 100 frames have passed to return return: -1 if the animation is finished / exceeded 100 frames, or a unique id for the playing effect otherwise - name: FinishPlayingEffectAnimations aliases: @@ -827,7 +827,7 @@ overlay29: description: |- Waits until currently playing effect animations are finished, and returns only when they are done. Might have some other effects too. - r0: if 0, will only wait until effects with an is_non_blocking field equal to 0 finish; if 1, waits for all effects to finish + r0: if 0, will only wait for effects with an is_non_blocking field equal to 0; if 1, waits for all effects to finish - name: CopyStatusIconFlags address: EU: 0x22E43F0 @@ -1070,6 +1070,14 @@ overlay29: r0: entity pointer r1: Sound effect ID + - name: PlayItemThrowSfx + address: + EU: 0x22E60D8 + description: |- + Plays the appropriate sound effect for throwing an item based on its category. + + r0: user entity pointer (unused) + r1: item category - name: PlayMissSfx address: EU: @@ -1616,6 +1624,14 @@ overlay29: r0: pointer to the status turn counter return: new counter value + - name: GetCurvedProjectileTargetPos + address: + EU: 0x22EA44C + description: |- + Gets the position a curved projectile should land at when thrown by the user. + + r0: [output] position + r1: user entity pointer - name: AdvanceFrame address: EU: 0x22EA990 @@ -2878,6 +2894,43 @@ overlay29: Handles using the regular attack or Struggle by the entity. r0: entity pointer + - name: GetShopkeeperIfTalkable + address: + EU: 0x22F6BC8 + description: |- + Returns a pointer to the floor's shopkeeper, or an invalid entity pointer if there is none, they cannot be talked to, or they are not in the same room as the leader. + + r0: leader pointer + return: shopkeeper pointer + - name: HandleShopTransaction + address: + EU: 0x22F6C84 + description: |- + Checks if a Kecleon shop transaction should occur and initiates it if so. + + r0: whether to attempt a transaction even if the leader is still standing in the shop + - name: TrySellToShop + address: + EU: 0x22F7118 + description: |- + Handles selling to a Kecleon shop. + + r0: ? + - name: TryBuyFromShop + address: + EU: 0x22F73C4 + description: |- + Handles buying from a Kecleon shop. + + r0: ? + return: 0 if the purchase was successful, 1 or 2 if should be treated as a theft + - name: TriggerThiefAlert + address: + EU: 0x22F7664 + description: |- + Triggers the sequence for stealing from a Kecleon shop. + + No params. - name: ResetDamageData address: EU: 0x22F77D0 @@ -3056,15 +3109,18 @@ overlay29: Note: unverified, ported from Irdkwia's notes No params. - - name: CanMonsterBeAddedToTeam + - name: MonsterCannotBeAddedToTeam + aliases: + - CanMonsterBeAddedToTeam address: EU: 0x22F81EC NA: 0x22F7834 JP: 0x22F8DF4 description: |- - Returns false if there are already four members on the active team or if the total body size of the team would be greater than 6 if this monster was added. + Returns true if there are already four members on the active team or if the total body size of the team would be greater than 6 if this monster was added. r0: entity pointer + return: bool - name: EuFaintCheck address: EU: 0x22F88E8 @@ -3372,6 +3428,13 @@ overlay29: r0: monster ID return: bool + - name: ActivateTerrainEffects + address: + EU: 0x22FA680 + description: |- + Handles causing the burn from lava, healing a burn from water, and decreasing hunger in the walls. + + r0: monster entity pointer - name: BoostIQ address: EU: 0x22FAB50 @@ -4035,6 +4098,15 @@ overlay29: r0: monster ID r1: tile pointer return: true means the monster CANNOT spawn on this tile + - name: CannotMoveToTile + address: + EU: 0x2300190 + description: |- + Same as CannotStandOnTile, but also returns false if the monster is currently on the tile. + + r0: Entity pointer + r1: Tile position pointer + return: True if the monster cannot move to the specified tile, false if it can - name: GetMobilityTypeAfterIqSkills address: EU: 0x23002F4 @@ -4055,17 +4127,22 @@ overlay29: r0: Entity pointer return: True if the monster can move through walls. + - name: CannotStandOnTileNoMonsterCheck + address: + EU: 0x2300384 + NA: 0x22FF958 + JP: 0x2300D28 + description: |- + Same as CannotStandOnTile, but without the check for another monster on the tile. + + r0: Entity pointer + r1: Tile position pointer + return: True if the monster cannot stand on the specified tile, false if it can - name: CannotStandOnTile address: - EU: - - 0x2300384 - - 0x23006C8 - NA: - - 0x22FF958 - - 0x22FFC9C - JP: - - 0x2300D28 - - 0x23010AC + EU: 0x23006C8 + NA: 0x22FFC9C + JP: 0x23010AC description: |- Checks if a given monster cannot stand on the tile at the given position. @@ -4312,6 +4389,14 @@ overlay29: r0: Entity pointer r1: If true, return 1 if entity is blinded return: bool + - name: CanBeTalkedTo + address: + EU: 0x23013F8 + description: |- + Returns true if the monster doesn't have a status that prevents it from being talked to. + + r0: entity pointer + return: bool - name: HasStatusThatPreventsOutlawEscaping address: EU: 0x2301530 @@ -4927,6 +5012,14 @@ overlay29: r0: Entity pointer r1: ID of the animation to set r2: Direction to turn the monster in, or DIR_NONE to keep the current direction + - name: MakeMonsterIdleInDirectionIfValid + address: + EU: 0x230542C + description: |- + Makes the monster play their idle animation. Also makes them do so in the given direction and sets the direction field of their action struct if the direction parameter is between 0 and 7 (inclusive). + + r0: entity pointer + r1: direction - name: ChangeMonsterAnimationToIdle address: EU: 0x2305474 @@ -5331,6 +5424,7 @@ overlay29: stack[0]: experience flag (see ApplyDamage) stack[1]: Damage source (see HandleFaint) stack[2]: defender response flag. If true, the defender can respond to the attack with various effects. If false, the only post-damage effect that can happen is the Rage attack boost. + stack[3]: is fissure - name: ApplyDamage address: EU: 0x2309A0C @@ -5346,6 +5440,7 @@ overlay29: r3: False Swipe flag, causes the defender's HP to be set to 1 if it would otherwise have been 0 stack[0]: experience flag, controls whether or not experience will be granted upon a monster fainting, and whether enemy evolution might be triggered stack[1]: Damage source (see HandleFaint) + stack[2]: is fissure return: True if the target fainted (reviving does not count as fainting) - name: AftermathCheck address: @@ -5515,13 +5610,14 @@ overlay29: r0: entity pointer r1: fixed damage - r2: ? + r2: experience flag (see ApplyDamage) r3: [output] struct containing info about the damage calculation stack[0]: move ID (interestingly, this doesn't seem to be used by the function) stack[1]: attack type stack[2]: damage source stack[3]: damage message - others: ? + stack[4]: defender response flag (see ApplyDamageAndEffects) + stack[5]: is fissure (always 0) - name: CalcDamageFixed address: EU: 0x230DCB4 @@ -5539,7 +5635,8 @@ overlay29: stack[2]: move category stack[3]: damage source stack[4]: damage message - others: ? + stack[5]: defender response flag (see ApplyDamageAndEffects) + stack[6]: is fissure - name: CalcDamageFixedNoCategory address: EU: 0x230DE1C @@ -5556,7 +5653,8 @@ overlay29: stack[1]: attack type stack[2]: damage source stack[3]: damage message - others: ? + stack[4]: defender response flag (see ApplyDamageAndEffects) + stack[5]: is fissure (always 0) - name: CalcDamageFixedWrapper address: EU: 0x230DE68 @@ -5574,7 +5672,8 @@ overlay29: stack[2]: move category stack[3]: damage source stack[4]: damage message - others: ? + stack[5]: defender response flag (see ApplyDamageAndEffects) + stack[6]: is fissure - name: UpdateShopkeeperModeAfterAttack address: EU: 0x230DEB4 @@ -7908,6 +8007,28 @@ overlay29: r3: explosion radius (only works correctly with 1 and 2) stack[0]: damage type stack[1]: damage source (normally DAMAGE_SOURCE_EXPLOSION) + - name: CalcExplosionDamage + address: + EU: 0x232150C + description: |- + Calculates and inflicts damage from an explosion. + + r0: user entity pointer + r1: target entity pointer + r2: damage type + r3: move id + stack[0]: base fixed damage for non-teammates + - name: CalcAftermathExplosionDamage + address: + EU: 0x2321634 + description: |- + Calculates and inflicts damage from an aftermath explosion. + + r0: user entity pointer + r1: target entity pointer + r2: damage type + r3: move id + stack[0]: base fixed damage for non-teammates - name: TryWarp address: EU: 0x2321770 @@ -12499,6 +12620,12 @@ overlay29: length: EU: 0x4 description: "[Runtime] Used to store the number of positions output by GetPossibleAiArcItemTargets and the number of directions/probabilities output by GetPossibleAiThrownItemDirections." + - name: EXPLOSION_FIXED_DAMAGES + address: + EU: 0x2354300 + length: + EU: 0xC + description: "Array of damages indexed by radius for explosion damage (before reductions from exclusive items, etc)." - name: EXCL_ITEM_EFFECTS_EVASION_BOOST address: EU: 0x2354310 diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index d25186ab..fc4bc262 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -107,6 +107,13 @@ overlay31: Uses a switch statement based on the state field in stairs_menu to determine what actions to take. return: 4 if should close stairs menu entirely, 1 otherwise (including when switching between main/info menus) + - name: StairsDescriptionCallback + address: + EU: 0x2383E48 + description: |- + Callback function passed to CreateAdvancedTextBox for creating the description for the stairs in the info menu. + + r0: window_id - name: CloseMainStairsMenu address: EU: 0x2383E8C @@ -324,7 +331,9 @@ overlay31: NA: 0x10 JP: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - - name: DUNGEON_WINDOW_PARAMS_5 + - name: STAIRS_INFO_WINDOW_PARAMS + aliases: + - DUNGEON_WINDOW_PARAMS_5 address: EU: 0x238AA64 NA: 0x2389E40 @@ -333,7 +342,7 @@ overlay31: EU: 0x10 NA: 0x10 JP: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Parameters for the text box created after pressing Info in the stairs menu. - name: DUNGEON_WINDOW_PARAMS_6 address: EU: 0x238AA74 diff --git a/symbols/ram.yml b/symbols/ram.yml index 785d5376..ca1f6831 100644 --- a/symbols/ram.yml +++ b/symbols/ram.yml @@ -722,6 +722,12 @@ ram: EU: 0x22BBF54 NA: 0x22BB614 JP: 0x22BCDB4 + - name: EFFECT_CONTROL + address: + EU: 0x22DCB00 + length: + EU: 0x27A4 + description: The master struct containing information about how effects should be played and the ones that are currently active. - name: GROUND_MEMORY_ARENA_1_PTR address: NA: 0x2324CB4