From 9bed55e61efe3f44ae9038731fbf85d4a528e469 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sun, 1 Dec 2024 18:04:12 -0600 Subject: [PATCH 1/5] Decomped IsMonster --- asm/include/overlay_29_022F7388.inc | 90 +- asm/include/overlay_29_022F9744.inc | 121 + asm/include/overlay_29_023016A8.inc | 8 +- asm/include/overlay_29_02301A84.inc | 13 + asm/include/overlay_29_02308FE0.inc | 232 +- asm/include/overlay_29_0230A9B8.inc | 210 ++ asm/include/overlay_29_0230F02C.inc | 94 +- asm/include/overlay_29_0230F9A4.inc | 93 + asm/include/overlay_29_0231513C.inc | 38 +- asm/include/overlay_29_02318AD4.inc | 12 + asm/include/overlay_29_02319FB0.inc | 39 +- asm/include/overlay_29_0231A9F8.inc | 39 + asm/include/overlay_29_0231B1B8.inc | 116 +- asm/include/overlay_29_0231B33C.inc | 117 + asm/include/overlay_29_0232145C.inc | 141 +- asm/include/overlay_29_02322DDC.inc | 110 + asm/include/overlay_29_023498A0.inc | 64 +- asm/include/overlay_29_0234D484.inc | 39 + asm/overlay_29_022F7388.s | 3028 ----------------- asm/overlay_29_022F9744.s | 3019 +++++++++++++++++ asm/overlay_29_023016A8.s | 224 -- asm/overlay_29_02301A84.s | 215 ++ asm/overlay_29_02308FE0.s | 4634 --------------------------- asm/overlay_29_0230A9B8.s | 4625 ++++++++++++++++++++++++++ asm/overlay_29_0230F02C.s | 1562 --------- asm/overlay_29_0230F9A4.s | 1553 +++++++++ asm/overlay_29_0231513C.s | 225 -- asm/overlay_29_02318AD4.s | 216 ++ asm/overlay_29_02319FB0.s | 637 ---- asm/overlay_29_0231A9F8.s | 628 ++++ asm/overlay_29_0231B1B8.s | 1807 ----------- asm/overlay_29_0231B33C.s | 1798 +++++++++++ asm/overlay_29_0232145C.s | 3000 ----------------- asm/overlay_29_02322DDC.s | 2991 +++++++++++++++++ asm/overlay_29_023498A0.s | 755 ----- asm/overlay_29_0234D484.s | 746 +++++ include/overlay_29_022F9720.h | 8 + include/overlay_29_02301A60.h | 8 + include/overlay_29_0230A994.h | 8 + include/overlay_29_0230F980.h | 8 + include/overlay_29_02318AB0.h | 8 + include/overlay_29_0231A9D4.h | 8 + include/overlay_29_0231B318.h | 8 + include/overlay_29_02322DB8.h | 8 + include/overlay_29_0234D460.h | 8 + main.lsf | 18 + src/dungeon_pokemon_attributes.c | 2 +- src/overlay_29_022F9720.c | 9 + src/overlay_29_02301A60.c | 9 + src/overlay_29_0230A994.c | 9 + src/overlay_29_0230F980.c | 9 + src/overlay_29_02318AB0.c | 9 + src/overlay_29_0231A9D4.c | 9 + src/overlay_29_0231B318.c | 9 + src/overlay_29_02322DB8.c | 9 + src/overlay_29_0234D460.c | 9 + 56 files changed, 16840 insertions(+), 16572 deletions(-) create mode 100644 asm/include/overlay_29_022F9744.inc create mode 100644 asm/include/overlay_29_02301A84.inc create mode 100644 asm/include/overlay_29_0230A9B8.inc create mode 100644 asm/include/overlay_29_0230F9A4.inc create mode 100644 asm/include/overlay_29_02318AD4.inc create mode 100644 asm/include/overlay_29_0231A9F8.inc create mode 100644 asm/include/overlay_29_0231B33C.inc create mode 100644 asm/include/overlay_29_02322DDC.inc create mode 100644 asm/include/overlay_29_0234D484.inc create mode 100644 asm/overlay_29_022F9744.s create mode 100644 asm/overlay_29_02301A84.s create mode 100644 asm/overlay_29_0230A9B8.s create mode 100644 asm/overlay_29_0230F9A4.s create mode 100644 asm/overlay_29_02318AD4.s create mode 100644 asm/overlay_29_0231A9F8.s create mode 100644 asm/overlay_29_0231B33C.s create mode 100644 asm/overlay_29_02322DDC.s create mode 100644 asm/overlay_29_0234D484.s create mode 100644 include/overlay_29_022F9720.h create mode 100644 include/overlay_29_02301A60.h create mode 100644 include/overlay_29_0230A994.h create mode 100644 include/overlay_29_0230F980.h create mode 100644 include/overlay_29_02318AB0.h create mode 100644 include/overlay_29_0231A9D4.h create mode 100644 include/overlay_29_0231B318.h create mode 100644 include/overlay_29_02322DB8.h create mode 100644 include/overlay_29_0234D460.h create mode 100644 src/overlay_29_022F9720.c create mode 100644 src/overlay_29_02301A60.c create mode 100644 src/overlay_29_0230A994.c create mode 100644 src/overlay_29_0230F980.c create mode 100644 src/overlay_29_02318AB0.c create mode 100644 src/overlay_29_0231A9D4.c create mode 100644 src/overlay_29_0231B318.c create mode 100644 src/overlay_29_02322DB8.c create mode 100644 src/overlay_29_0234D460.c diff --git a/asm/include/overlay_29_022F7388.inc b/asm/include/overlay_29_022F7388.inc index f0723b47..9a2fb7ce 100644 --- a/asm/include/overlay_29_022F7388.inc +++ b/asm/include/overlay_29_022F7388.inc @@ -1,94 +1,47 @@ #pragma once .public AbilityIsActiveVeneer -.public AdvanceFrame -.public AiMovement -.public AnimationDelayOrSomething -.public ApplyItemEffect -.public BAG_ITEMS_PTR_MIRROR -.public BELLY_DRAIN_IN_WALLS_INT .public CASTFORM_WEATHER_ATTRIBUTE_TABLE .public CanAttackInDirection -.public CanMonsterSpawn -.public CanMonsterUseItem -.public CanSeeTarget .public CeilFixedPoint -.public ChangeMonsterAnimation .public CheckTeamMemberIdx -.public CheckVariousStatuses -.public CheckVariousStatuses2 -.public Conversion2IsActive .public DIRECTIONS_XY .public DUNGEON_PTR .public DeleteWanTableEntryVeneer .public DetermineMonsterShadow .public DirectoryFileMngr_GetDirectoryFileSize .public DiscoverMinimap -.public DisplayAnimatedNumbers .public DisplayMessage .public DisplayMessage2 .public DrawMinimapTile .public DungeonRandInt .public EnableAllLearnableIqSkills -.public EnableIqSkill -.public EndBurnClassStatus -.public EndCringeClassStatus .public EndFrozenClassStatus -.public EndReflectClassStatus -.public EndSleepClassStatus .public EntityIsValid__022F7364 -.public ExclusiveItemEffectFlagTest .public FreeOtherWrappedMonsters .public GendersEqualNotGenderless .public GetAbility .public GetActiveTeamMember .public GetApparentWeather .public GetBodySize -.public GetChebyshevDistance -.public GetConversion2ConvertToType -.public GetDirectionTowardsPosition -.public GetExclusiveItemWithEffectFromBag -.public GetFloorType .public GetForcedLossReason -.public GetIdleAnimationId .public GetLeader -.public GetLearnableIqSkills .public GetLvlUpEntry -.public GetMaxPp -.public GetMaxPpWrapper .public GetMinimapDataE447 -.public GetMobilityType -.public GetMonsterEvoStatus .public GetMonsterGender .public GetMonsterName -.public GetMoveBasePp -.public GetMoveType .public GetMoveTypeForMonster -.public GetNbItemsInBag .public GetNumberOfAttacks -.public GetScenarioBalance -.public GetScenarioBalanceVeneer -.public GetSpawnThreshold .public GetSpriteFileSize .public GetSpriteIndex__020526EC -.public GetStairsRoom -.public GetStairsSpawnPosition .public GetStatBoostsForMonsterSummary .public GetTile .public GetTileAtEntity .public GetTileSafe -.public GetTreatmentBetweenMonsters .public GetType -.public GetTypeMatchupBothTypes -.public HasHeldItem -.public HasMaxGinsengBoost99 .public IQ_SKILLS -.public IqSkillIsEnabled -.public IsCurrentFixedRoomBossFight -.public IsFullFloorFixedRoom .public IsLevelResetDungeon .public IsMonsterIdInNormalRange -.public IsMonsterSleeping -.public IsOneHitKoMove +.public IsMonster__022F9720 .public IsOutlawOrChallengeRequestFloor .public IsRecruitingAllowed .public IsSecretBazaarNpcBehavior @@ -100,7 +53,6 @@ .public LEADER_PTR .public LoadWanTableEntryFromPack .public LoadWanTableEntryFromPackUseProvidedMemory -.public LogMessageByIdWithPopup .public LogMessageByIdWithPopupCheckUser .public LogMessageByIdWithPopupCheckUserTarget .public LowerSpeed @@ -108,88 +60,52 @@ .public MemFree .public MonsterIsType .public OpenMessageLog -.public PointCameraToMonster .public PopulateActiveMonsterPtrs -.public RandInt -.public RemoveEquivItem .public RemoveHolderForItemInBag .public ReplaceWanFromBinFile -.public RestoreAllMovePP -.public SECONDARY_TERRAIN_TYPES -.public SetActionPassTurnOrWalk .public SetForcedLossReason .public SetMissionTargetEnemyDefeated -.public ShouldDisplayEntityWrapper .public ShouldMonsterRunAway -.public ShouldTryEatItem -.public ShowPpRestoreEffect .public StoryRestrictionsEnabled -.public SubFixedPoint .public SubstitutePlaceholderStringTags .public TEAM_MEMBER_TABLE_PTR -.public TryIncreaseHp -.public TryInflictBurnStatus -.public TryInflictPausedStatus -.public UpdateCamera +.public TryEndStatusWithAbility .public UpdateMapSurveyorFlag .public UpdateMinimap -.public UpdateStatusIconFlags .public WAN_TABLE .public WEATHER_BALL_TYPE_TABLE .public YesNoMenu -.public _020A1870 .public ov10_022C4C6E .public ov10_022C4C70 .public ov29_022DDB68 -.public ov29_022E0A04 .public ov29_022E1C0C .public ov29_022E2470 .public ov29_022E2A78 -.public ov29_022E4160 -.public ov29_022E576C .public ov29_022E6260 .public ov29_022E647C .public ov29_022E68BC -.public ov29_022E68D8 -.public ov29_022E6928 .public ov29_022E8104 .public ov29_022E81F8 .public ov29_022EA370 .public ov29_022ECDE4 .public ov29_022EF7C4 -.public ov29_022EF938 .public ov29_022EFAE8 +.public ov29_022F9B8C .public ov29_022FE048 .public ov29_022FFB90 -.public ov29_0230040C -.public ov29_023018AC -.public ov29_023021F0 -.public ov29_02304A48 -.public ov29_02307CE0 -.public ov29_02307DD0 -.public ov29_0230F9A4 .public ov29_023159D4 .public ov29_02337EC0 .public ov29_02338F24 .public ov29_02339F88 -.public ov29_02344B44 -.public ov29_02348100 .public ov29_02349688 .public ov29_0234B010 -.public ov29_0234B034 .public ov29_0234B06C .public ov29_0234B084 -.public ov29_0234B09C .public ov29_0234B0B4 .public ov29_0234B1A4 .public ov29_0234EF24 .public ov29_0235171E .public ov29_0237C9B0 -.public sub_0201405C -.public sub_02017C50 -.public sub_0204AEF0 -.public sub_02050FF8 -.public sub_02052E2C .public sub_02053250 .public sub_0205349C .public sub_02056228 diff --git a/asm/include/overlay_29_022F9744.inc b/asm/include/overlay_29_022F9744.inc new file mode 100644 index 00000000..1c07bb38 --- /dev/null +++ b/asm/include/overlay_29_022F9744.inc @@ -0,0 +1,121 @@ +#pragma once +.public AbilityIsActiveVeneer +.public AdvanceFrame +.public AiMovement +.public AnimationDelayOrSomething +.public ApplyItemEffect +.public BAG_ITEMS_PTR_MIRROR +.public BELLY_DRAIN_IN_WALLS_INT +.public CanMonsterSpawn +.public CanMonsterUseItem +.public CanSeeTarget +.public CeilFixedPoint +.public ChangeMonsterAnimation +.public CheckTeamMemberIdx +.public CheckVariousStatuses +.public CheckVariousStatuses2 +.public Conversion2IsActive +.public DIRECTIONS_XY +.public DUNGEON_PTR +.public DefenderAbilityIsActive__022F96CC +.public DiscoverMinimap +.public DisplayAnimatedNumbers +.public DungeonRandInt +.public EnableIqSkill +.public EndBurnClassStatus +.public EndCringeClassStatus +.public EndFrozenClassStatus +.public EndReflectClassStatus +.public EndSleepClassStatus +.public EntityIsValid__022F7364 +.public ExclusiveItemEffectFlagTest +.public GetActiveTeamMember +.public GetChebyshevDistance +.public GetConversion2ConvertToType +.public GetDirectionTowardsPosition +.public GetExclusiveItemWithEffectFromBag +.public GetFloorType +.public GetIdleAnimationId +.public GetLeader +.public GetLearnableIqSkills +.public GetMaxPp +.public GetMaxPpWrapper +.public GetMobilityType +.public GetMonsterEvoStatus +.public GetMoveBasePp +.public GetMoveType +.public GetMoveTypeForMonster +.public GetNbItemsInBag +.public GetScenarioBalance +.public GetScenarioBalanceVeneer +.public GetSpawnThreshold +.public GetStairsRoom +.public GetStairsSpawnPosition +.public GetTile +.public GetTileAtEntity +.public GetTileSafe +.public GetTreatmentBetweenMonsters +.public GetTypeMatchupBothTypes +.public HasHeldItem +.public HasMaxGinsengBoost99 +.public IqSkillIsEnabled +.public IsCurrentFixedRoomBossFight +.public IsFullFloorFixedRoom +.public IsMonsterIdInNormalRange +.public IsMonsterSleeping +.public IsMonster__022F9720 +.public IsOneHitKoMove +.public IsSecretBazaarNpcBehavior +.public ItemZInit +.public LogMessageByIdWithPopup +.public LogMessageByIdWithPopupCheckUser +.public LogMessageByIdWithPopupCheckUserTarget +.public PointCameraToMonster +.public RandInt +.public RemoveEquivItem +.public RestoreAllMovePP +.public SECONDARY_TERRAIN_TYPES +.public SetActionPassTurnOrWalk +.public ShouldDisplayEntityWrapper +.public ShouldTryEatItem +.public ShowPpRestoreEffect +.public SubFixedPoint +.public SubstitutePlaceholderStringTags +.public TryIncreaseHp +.public TryInflictBurnStatus +.public TryInflictPausedStatus +.public UpdateCamera +.public UpdateMapSurveyorFlag +.public UpdateMinimap +.public UpdateStatusIconFlags +.public _020A1870 +.public ov29_022E0A04 +.public ov29_022E4160 +.public ov29_022E576C +.public ov29_022E68BC +.public ov29_022E68D8 +.public ov29_022E6928 +.public ov29_022E8104 +.public ov29_022E81F8 +.public ov29_022EA370 +.public ov29_022EF938 +.public ov29_022F87C0 +.public ov29_0230040C +.public ov29_023018AC +.public ov29_023021F0 +.public ov29_02304A48 +.public ov29_02307CE0 +.public ov29_02307DD0 +.public ov29_0230F9A4 +.public ov29_02344B44 +.public ov29_02348100 +.public ov29_0234B034 +.public ov29_0234B084 +.public ov29_0234B09C +.public ov29_0235171E +.public sub_0201405C +.public sub_02017C50 +.public sub_0204AEF0 +.public sub_02050FF8 +.public sub_02052E2C +.public sub_02056228 diff --git a/asm/include/overlay_29_023016A8.inc b/asm/include/overlay_29_023016A8.inc index 40b7b97b..897c4c3d 100644 --- a/asm/include/overlay_29_023016A8.inc +++ b/asm/include/overlay_29_023016A8.inc @@ -1,18 +1,12 @@ #pragma once .public AbilityIsActive .public CanSeeInvisibleMonsters -.public EXCL_ITEM_EFFECTS_WEATHER_NO_STATUS -.public ExclusiveItemEffectIsActive__022FFF28 .public GetApparentWeather -.public GetExclusiveItemWithEffectFromBag .public IsExperienceLocked +.public IsMonster__02301A60 .public LogMessageByIdWithPopupCheckUserTarget -.public MistIsActive .public ShouldMonsterRunAway .public SubstitutePlaceholderStringTags .public UpdateStateFlags .public ov29_022E62A8 -.public ov29_02314DC4 -.public ov29_02324BE8 -.public ov29_02344B44 .public ov29_023527A0 diff --git a/asm/include/overlay_29_02301A84.inc b/asm/include/overlay_29_02301A84.inc new file mode 100644 index 00000000..e801fec7 --- /dev/null +++ b/asm/include/overlay_29_02301A84.inc @@ -0,0 +1,13 @@ +#pragma once +.public DefenderAbilityIsActive__02301A0C +.public EXCL_ITEM_EFFECTS_WEATHER_NO_STATUS +.public ExclusiveItemEffectIsActive__022FFF28 +.public GetApparentWeather +.public GetExclusiveItemWithEffectFromBag +.public IsMonster__02301A60 +.public LogMessageByIdWithPopupCheckUserTarget +.public MistIsActive +.public SubstitutePlaceholderStringTags +.public ov29_02314DC4 +.public ov29_02324BE8 +.public ov29_02344B44 diff --git a/asm/include/overlay_29_02308FE0.inc b/asm/include/overlay_29_02308FE0.inc index 65c44239..98dc52ea 100644 --- a/asm/include/overlay_29_02308FE0.inc +++ b/asm/include/overlay_29_02308FE0.inc @@ -1,171 +1,82 @@ #pragma once -.public _s32_div_f .public AbilityIsActiveVeneer -.public abs .public ActivateMotorDrive .public AddExpSpecial -.public AddFixedPoint64 .public AdvanceFrame -.public AFTERMATH_CHANCE -.public AIR_BLADE_DAMAGE_MULTIPLIER -.public AllocateTemp1024ByteBufferFromPool -.public ApplyDamageAndEffects -.public AURA_BOW_STAT_BOOST -.public AuraBowIsActive +.public AftermathCheck .public BAG_ITEMS_PTR_MIRROR -.public BURN_DAMAGE_MULTIPLIER .public CanEnemyEvolve .public CanSeeTarget -.public CeilFixedPoint .public ChangeDungeonMusic .public ChangeMonsterAnimation -.public ClampedLn -.public CLOUDY_DAMAGE_MULTIPLIER -.public DAMAGE_FORMULA_AT_PREFACTOR -.public DAMAGE_FORMULA_CONSTANT_SHIFT -.public DAMAGE_FORMULA_DEF_PREFACTOR -.public DAMAGE_FORMULA_FLV_DEFICIT_DIVISOR -.public DAMAGE_FORMULA_FLV_SHIFT -.public DAMAGE_FORMULA_LN_ARG_PREFACTOR -.public DAMAGE_FORMULA_LN_PREFACTOR -.public DAMAGE_FORMULA_MAX_BASE -.public DAMAGE_FORMULA_MIN_BASE -.public DAMAGE_FORMULA_NON_TEAM_MEMBER_MODIFIER -.public DAMAGE_MULTIPLIER_0_5 -.public DAMAGE_MULTIPLIER_1_5 -.public DAMAGE_MULTIPLIER_2 .public DAMAGE_STRING_IDS -.public Debug_Print0 -.public DebugRecruitingEnabled -.public DEF_SCARF_STAT_BOOST -.public DEFENSIVE_STAT_STAGE_MULTIPLIERS -.public DisplayAnimatedNumbers -.public DivideFixedPoint64 .public DUNGEON_PTR -.public DungeonRandInt +.public DisplayAnimatedNumbers .public DungeonRandOutcome__022EAB20 -.public EnableAllLearnableIqSkills .public EndCurseClassStatus .public EndInvisibleClassStatus -.public EnsureCanStandCurrentTile .public EntityIsValid__02308FBC -.public EntityIsValid__0230E8F0 -.public ExclusiveItemDefenseBoost -.public ExclusiveItemEffectFlagTest .public ExclusiveItemEffectIsActiveWithLogging -.public ExclusiveItemOffenseBoost -.public FixedPoint32To64 -.public FixedPoint64CmpLt -.public FixedPoint64IsZero -.public FixedPoint64ToInt -.public FixedRoomIsSubstituteRoom -.public FlashFireShouldActivate +.public ExclusiveItemEffectIsActive__0230A9B8 .public FreeOtherWrappedMonsters -.public GendersEqualNotGenderless -.public GendersNotEqualNotGenderless -.public GenerateStandardItem .public GetActiveTeamMember -.public GetApparentWeather .public GetDirectionTowardsPosition -.public GetEquivItemIndex .public GetExp -.public GetFirstEmptyMemberIdx .public GetIdleAnimationId -.public GetItemAtIdx -.public GetKecleonIdToSpawnByFloor -.public GetMonsterGenderVeneer -.public GetMonsterIdToSpawn -.public GetMonsterLevelToSpawn -.public GetMoveCategory -.public GetNameString -.public GetRandomMovementChance -.public GetRecruitRate1 -.public GetRecruitRate2 -.public GetTile .public GetTileAtEntity -.public GravityIsActive .public HandleFaint -.public HasHeldItem -.public HasPlayedOldGame -.public InitTeamMember -.public IntToFixedPoint64 .public IqSkillIsEnabled .public IsBlinded .public IsCurrentMissionType -.public IsCurrentMissionTypeExact .public IsExperienceLocked -.public IsFloating -.public IsFullFloorFixedRoom -.public IsLegendaryChallengeFloor .public IsMonsterIdInNormalRangeVeneer -.public IsMonsterOnTeam -.public IsPunchMove -.public IsRecoilMove -.public IsRecruitingAllowed -.public IsRegularAttackOrProjectile +.public IsMonster__0230A994 .public IsSecretBazaarNpcBehavior .public IsSpecialStoryAlly +.public ItemIsActive__0230A9DC .public ItemZInit .public JoinedAtRangeCheck2Veneer -.public LevitateIsActive .public LogMessageByIdWithPopup -.public LogMessageByIdWithPopupCheckParticipants .public LogMessageByIdWithPopupCheckUser .public LogMessageByIdWithPopupCheckUserTarget -.public MATCHUP_IMMUNE_MULTIPLIER -.public MATCHUP_IMMUNE_MULTIPLIER_ERRATIC_PLAYER -.public MATCHUP_NEUTRAL_MULTIPLIER -.public MATCHUP_NEUTRAL_MULTIPLIER_ERRATIC_PLAYER -.public MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER -.public MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER -.public MATCHUP_SUPER_EFFECTIVE_MULTIPLIER -.public MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER -.public ME_FIRST_MULTIPLIER -.public MemZero -.public MewSpawnCheck -.public MonsterHasNegativeStatus -.public MonsterIsType -.public MoveIsNotPhysical .public MoveMonsterToPos -.public MultiplyByFixedPoint -.public MultiplyFixedPoint64 -.public MUNCH_BELT_STAT_BOOST .public MusicTableIdxToMusicId -.public NearbyAllyIqSkillIsEnabled -.public OFFENSIVE_STAT_STAGE_MULTIPLIERS -.public OtherMonsterAbilityIsActive +.public PlayEffectAnimationEntity +.public RecruitCheck +.public RemoveHolderForItemInBag +.public RestorePpAllMovesSetFlags +.public RestoreRandomMovePP +.public SET_DAMAGE_STATUS_DAMAGE +.public SetMonsterFlag2 +.public SetPokemonBattled +.public ShouldDisplayEntityWrapper +.public SpawnDroppedItemWrapper +.public SubInitMonster +.public SubstitutePlaceholderStringTags +.public TYPE_DAMAGE_NEGATING_EXCLUSIVE_ITEM_EFFECTS +.public TryIncreaseHp +.public TryRecruit +.public TrySpawnEnemyItemDrop +.public UpdateAiTargetPos +.public UpdateEntityPixelPos +.public UpdateShopkeeperModeAfterAttack +.public UpdateStatusIconFlags +.public UpdateTrapsVisibility +.public abs .public ov10_022BDC68 .public ov10_022BDE50 .public ov10_022BF964 -.public ov10_022C4410 -.public ov10_022C441C -.public ov10_022C443C -.public ov10_022C447C -.public ov10_022C44FC -.public ov10_022C45B4 .public ov10_022C45C4 .public ov10_022C45FC -.public ov10_022C46FC -.public ov10_022C4700 -.public ov10_022C4704 -.public ov10_022C4708 -.public ov10_022C470C .public ov10_022C4834 .public ov10_022C593C -.public ov29_022E1B28 -.public ov29_022E2470 .public ov29_022E5478 .public ov29_022E550C .public ov29_022E576C .public ov29_022E57A0 -.public ov29_022E62F0 .public ov29_022E66D8 -.public ov29_022E68BC -.public ov29_022E8104 .public ov29_022E81F8 -.public ov29_022E9628 .public ov29_022EA370 -.public ov29_022EACAC .public ov29_022EAF20 .public ov29_022EAF34 .public ov29_022ECD84 @@ -179,43 +90,24 @@ .public ov29_022F9058 .public ov29_022F9AF4 .public ov29_022FB98C -.public ov29_022FBC94 .public ov29_022FBD24 .public ov29_022FBDE0 -.public ov29_022FD318 -.public ov29_0230040C .public ov29_02303E0C .public ov29_02304830 .public ov29_02304A48 -.public ov29_02305F60 .public ov29_02307BDC .public ov29_02307C48 .public ov29_02307DC0 +.public ov29_0230D628 +.public ov29_0230D688 +.public ov29_0230D7D4 .public ov29_023159D4 -.public ov29_02337EC0 .public ov29_0233847C .public ov29_02344B9C .public ov29_0234969C -.public ov29_0234B034 -.public ov29_0234B084 .public ov29_0234B09C -.public ov29_0234B0B4 .public ov29_0234B1A4 .public ov29_0234BA54 -.public ov29_0234BB50 -.public ov29_0234D630 -.public ov29_0234D6C8 -.public ov29_0234D7C0 -.public ov29_0234D838 -.public ov29_0234D8A0 -.public ov29_0234EE10 -.public ov29_0234F008 -.public ov29_02352838 -.public ov29_02352884 -.public ov29_02352894 -.public ov29_02352984 -.public ov29_02352990 -.public ov29_0235299C .public ov29_02353218 .public ov29_0235321C .public ov29_02353220 @@ -226,68 +118,4 @@ .public ov29_02353234 .public ov29_023535D4 .public ov29_0237CA6C -.public PlayEffectAnimation0x171 -.public PlayEffectAnimation0x171Full -.public PlayEffectAnimation0x18E -.public PlayEffectAnimation0x1A9__022E6130 -.public PlayEffectAnimation0x1A9__022E617C -.public PlayEffectAnimation0x1A9__022E61C8 -.public PlayEffectAnimation0x1A9__022E6214 -.public PlayEffectAnimation0x1A9__022E64C4 -.public PlayEffectAnimation0x1A9__022E6510 -.public PlayEffectAnimationEntity -.public PointCameraToMonster -.public POWER_BAND_STAT_BOOST -.public POWER_PITCHER_DAMAGE_MULTIPLIER -.public PreprocessString -.public RECRUITMENT_LEVEL_BOOST_TABLE -.public RemoveHolderForItemInBag -.public ResetDamageData -.public RestorePpAllMovesSetFlags -.public RestoreRandomMovePP -.public RoundUpDiv256 -.public SCOPE_LENS_CRIT_RATE_BOOST -.public SET_DAMAGE_STATUS_DAMAGE -.public SetItemAcquired -.public SetMonsterFlag2 -.public SetPokemonBattled -.public SetPokemonJoined -.public ShouldDisplayEntityWrapper -.public SOLID_ROCK_MULTIPLIER -.public SPAWN_CAP_NO_MONSTER_HOUSE -.public SPAWN_CAP_WITH_MONSTER_HOUSE -.public SPAWN_COOLDOWN -.public SPAWN_COOLDOWN_THIEF_ALERT -.public SpawnDroppedItemWrapper -.public SpawnMonster -.public SPECIAL_BAND_STAT_BOOST -.public StrcpySimple -.public StringFromId -.public StrncpyName -.public StrncpySimpleNoPad .public sub_0204AF00 -.public sub_020534BC -.public sub_02055CCC -.public sub_02055D7C -.public sub_02056698 -.public sub_02056830 -.public sub_020584FC -.public sub_020585B4 -.public SubInitMonster -.public SubstitutePlaceholderStringTags -.public SUPER_LUCK_CRIT_RATE_BOOST -.public TECHNICIAN_MOVE_POWER_THRESHOLD -.public TINTED_LENS_MULTIPLIER -.public TryAftermathExplosion -.public TryIncreaseHp -.public TrySpawnEnemyItemDrop -.public TYPE_ADVANTAGE_MASTER_CRIT_RATE -.public TYPE_DAMAGE_NEGATING_EXCLUSIVE_ITEM_EFFECTS -.public TYPE_MATCHUP_COMBINATOR_TABLE -.public TYPE_MATCHUP_TABLE -.public UpdateAiTargetPos -.public UpdateEntityPixelPos -.public UpdateStateFlags -.public UpdateStatusIconFlags -.public UpdateTrapsVisibility -.public ZINC_BAND_STAT_BOOST diff --git a/asm/include/overlay_29_0230A9B8.inc b/asm/include/overlay_29_0230A9B8.inc new file mode 100644 index 00000000..3b89f7aa --- /dev/null +++ b/asm/include/overlay_29_0230A9B8.inc @@ -0,0 +1,210 @@ +#pragma once +.public AFTERMATH_CHANCE +.public AIR_BLADE_DAMAGE_MULTIPLIER +.public AURA_BOW_STAT_BOOST +.public AbilityIsActiveVeneer +.public AddFixedPoint64 +.public AdvanceFrame +.public AllocateTemp1024ByteBufferFromPool +.public ApplyDamageAndEffects +.public AuraBowIsActive +.public BURN_DAMAGE_MULTIPLIER +.public CLOUDY_DAMAGE_MULTIPLIER +.public CanSeeTarget +.public CeilFixedPoint +.public ClampedLn +.public DAMAGE_FORMULA_AT_PREFACTOR +.public DAMAGE_FORMULA_CONSTANT_SHIFT +.public DAMAGE_FORMULA_DEF_PREFACTOR +.public DAMAGE_FORMULA_FLV_DEFICIT_DIVISOR +.public DAMAGE_FORMULA_FLV_SHIFT +.public DAMAGE_FORMULA_LN_ARG_PREFACTOR +.public DAMAGE_FORMULA_LN_PREFACTOR +.public DAMAGE_FORMULA_MAX_BASE +.public DAMAGE_FORMULA_MIN_BASE +.public DAMAGE_FORMULA_NON_TEAM_MEMBER_MODIFIER +.public DAMAGE_MULTIPLIER_0_5 +.public DAMAGE_MULTIPLIER_1_5 +.public DAMAGE_MULTIPLIER_2 +.public DEFENSIVE_STAT_STAGE_MULTIPLIERS +.public DEF_SCARF_STAT_BOOST +.public DUNGEON_PTR +.public DebugRecruitingEnabled +.public Debug_Print0 +.public DefenderAbilityIsActive__0230A940 +.public DivideFixedPoint64 +.public DungeonRandInt +.public DungeonRandOutcome__022EAB20 +.public EnableAllLearnableIqSkills +.public EnsureCanStandCurrentTile +.public EntityIsValid__02308FBC +.public EntityIsValid__0230E8F0 +.public ExclusiveItemDefenseBoost +.public ExclusiveItemEffectFlagTest +.public ExclusiveItemEffectIsActiveWithLogging +.public ExclusiveItemOffenseBoost +.public FixedPoint32To64 +.public FixedPoint64CmpLt +.public FixedPoint64IsZero +.public FixedPoint64ToInt +.public FixedRoomIsSubstituteRoom +.public FlashFireShouldActivate +.public GendersEqualNotGenderless +.public GendersNotEqualNotGenderless +.public GenerateStandardItem +.public GetActiveTeamMember +.public GetApparentWeather +.public GetDirectionTowardsPosition +.public GetEquivItemIndex +.public GetFirstEmptyMemberIdx +.public GetItemAtIdx +.public GetKecleonIdToSpawnByFloor +.public GetMonsterGenderVeneer +.public GetMonsterIdToSpawn +.public GetMonsterLevelToSpawn +.public GetMoveCategory +.public GetNameString +.public GetRandomMovementChance +.public GetRecruitRate1 +.public GetRecruitRate2 +.public GetTile +.public GravityIsActive +.public HandleFaint +.public HasHeldItem +.public HasPlayedOldGame +.public InitTeamMember +.public IntToFixedPoint64 +.public IqSkillIsEnabled +.public IsCurrentMissionTypeExact +.public IsFloating +.public IsFullFloorFixedRoom +.public IsLegendaryChallengeFloor +.public IsMonsterOnTeam +.public IsMonster__0230A994 +.public IsPunchMove +.public IsRecoilMove +.public IsRecruitingAllowed +.public IsRegularAttackOrProjectile +.public LevitateIsActive +.public LogMessageByIdWithPopup +.public LogMessageByIdWithPopupCheckParticipants +.public LogMessageByIdWithPopupCheckUser +.public LogMessageByIdWithPopupCheckUserTarget +.public MATCHUP_IMMUNE_MULTIPLIER +.public MATCHUP_IMMUNE_MULTIPLIER_ERRATIC_PLAYER +.public MATCHUP_NEUTRAL_MULTIPLIER +.public MATCHUP_NEUTRAL_MULTIPLIER_ERRATIC_PLAYER +.public MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER +.public MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER +.public MATCHUP_SUPER_EFFECTIVE_MULTIPLIER +.public MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER +.public ME_FIRST_MULTIPLIER +.public MUNCH_BELT_STAT_BOOST +.public MemZero +.public MewSpawnCheck +.public MonsterHasNegativeStatus +.public MonsterIsType +.public MoveIsNotPhysical +.public MultiplyByFixedPoint +.public MultiplyFixedPoint64 +.public NearbyAllyIqSkillIsEnabled +.public OFFENSIVE_STAT_STAGE_MULTIPLIERS +.public OtherMonsterAbilityIsActive +.public POWER_BAND_STAT_BOOST +.public POWER_PITCHER_DAMAGE_MULTIPLIER +.public PlayEffectAnimation0x171 +.public PlayEffectAnimation0x171Full +.public PlayEffectAnimation0x18E +.public PlayEffectAnimation0x1A9__022E6130 +.public PlayEffectAnimation0x1A9__022E617C +.public PlayEffectAnimation0x1A9__022E61C8 +.public PlayEffectAnimation0x1A9__022E6214 +.public PlayEffectAnimation0x1A9__022E64C4 +.public PlayEffectAnimation0x1A9__022E6510 +.public PlayEffectAnimationEntity +.public PointCameraToMonster +.public PreprocessString +.public RECRUITMENT_LEVEL_BOOST_TABLE +.public ResetDamageData +.public RoundUpDiv256 +.public SCOPE_LENS_CRIT_RATE_BOOST +.public SOLID_ROCK_MULTIPLIER +.public SPAWN_CAP_NO_MONSTER_HOUSE +.public SPAWN_CAP_WITH_MONSTER_HOUSE +.public SPAWN_COOLDOWN +.public SPAWN_COOLDOWN_THIEF_ALERT +.public SPECIAL_BAND_STAT_BOOST +.public SUPER_LUCK_CRIT_RATE_BOOST +.public SetItemAcquired +.public SetPokemonJoined +.public SpawnMonster +.public StrcpySimple +.public StringFromId +.public StrncpyName +.public StrncpySimpleNoPad +.public SubstitutePlaceholderStringTags +.public TECHNICIAN_MOVE_POWER_THRESHOLD +.public TINTED_LENS_MULTIPLIER +.public TYPE_ADVANTAGE_MASTER_CRIT_RATE +.public TYPE_MATCHUP_COMBINATOR_TABLE +.public TYPE_MATCHUP_TABLE +.public TryAftermathExplosion +.public UpdateStateFlags +.public ZINC_BAND_STAT_BOOST +.public _s32_div_f +.public abs +.public ov10_022BDE50 +.public ov10_022BF964 +.public ov10_022C4410 +.public ov10_022C441C +.public ov10_022C443C +.public ov10_022C447C +.public ov10_022C44FC +.public ov10_022C45B4 +.public ov10_022C46FC +.public ov10_022C4700 +.public ov10_022C4704 +.public ov10_022C4708 +.public ov10_022C470C +.public ov29_022E1B28 +.public ov29_022E2470 +.public ov29_022E62F0 +.public ov29_022E68BC +.public ov29_022E8104 +.public ov29_022E81F8 +.public ov29_022E9628 +.public ov29_022EACAC +.public ov29_022FBC94 +.public ov29_022FBDE0 +.public ov29_022FD318 +.public ov29_0230040C +.public ov29_02304A48 +.public ov29_02305F60 +.public ov29_02337EC0 +.public ov29_0234B034 +.public ov29_0234B084 +.public ov29_0234B0B4 +.public ov29_0234B1A4 +.public ov29_0234BA54 +.public ov29_0234BB50 +.public ov29_0234D630 +.public ov29_0234D6C8 +.public ov29_0234D7C0 +.public ov29_0234D838 +.public ov29_0234D8A0 +.public ov29_0234EE10 +.public ov29_0234F008 +.public ov29_02352838 +.public ov29_02352884 +.public ov29_02352894 +.public ov29_02352984 +.public ov29_02352990 +.public ov29_0235299C +.public ov29_023535D4 +.public sub_020534BC +.public sub_02055CCC +.public sub_02055D7C +.public sub_02056698 +.public sub_02056830 +.public sub_020584FC +.public sub_020585B4 diff --git a/asm/include/overlay_29_0230F02C.inc b/asm/include/overlay_29_0230F02C.inc index 856c2461..1e59b2d4 100644 --- a/asm/include/overlay_29_0230F02C.inc +++ b/asm/include/overlay_29_0230F02C.inc @@ -1,38 +1,15 @@ #pragma once +.public AI_THROWN_ITEM_ACTION_CHOICE_COUNT .public AbilityIsActiveVeneer -.public abs .public AddMoneyCarried -.public AI_THROWN_ITEM_ACTION_CHOICE_COUNT -.public ApplyDamageAndEffectsWrapper -.public BAD_POISON_DAMAGE_COOLDOWN -.public BAD_POISON_DAMAGE_TABLE .public BAG_ITEMS_PTR_MIRROR -.public BinToDecFixedPoint -.public BoostSpeedOneStage -.public BURN_DAMAGE -.public BURN_DAMAGE_COOLDOWN .public CanSeeTarget -.public CeilFixedPoint -.public CheckVariousStatuses -.public CheckVariousStatuses2 .public DIRECTIONS_XY -.public DisplayActions .public DUNGEON_PTR -.public DungeonRandInt .public DungeonRandOutcome__022EAB20 -.public EndBurnClassStatus -.public EndMagnetRiseStatus -.public EndNegativeStatusCondition -.public EndNegativeStatusConditionWrapper -.public EnsureCanStandCurrentTile .public EntityIsValid__0230F008 -.public EntityIsValid__02311010 .public ExclusiveItemEffectFlagTest -.public ExclusiveItemEffectIsActive__02311064 -.public ExclusiveItemEffectIsActiveWithLogging -.public GenerateStandardItem .public GetAiUseItemProbability -.public GetApparentWeather .public GetCurrentBagCapacity .public GetExclusiveItemForMonsterFromBag .public GetItemCategoryVeneer @@ -40,83 +17,26 @@ .public GetTile .public GetTileAtEntity .public GetTreatmentBetweenMonsters -.public GravityIsActive .public HasHeldItem -.public InitMove .public IqSkillIsEnabled .public IsAuraBow .public IsExperienceLocked -.public IsFloating .public IsFloorOver -.public ItemIsActive__02311034 -.public LEECH_SEED_DAMAGE_COOLDOWN -.public LEECH_SEED_HP_DRAIN +.public IsMonster__0230F980 .public LogMessageByIdWithPopup -.public LogMessageByIdWithPopupCheckUser -.public MonsterHasNegativeStatus -.public MonsterIsType -.public MultiplyFixedPoint64 -.public ov10_022C4454 -.public ov10_022C446C -.public ov10_022C44BC -.public ov10_022C4590 -.public ov10_022C45D0 -.public ov10_022C45E8 -.public ov10_022C45F0 -.public ov10_022C464C -.public ov10_022C4650 -.public ov10_022C4664 -.public ov10_022C46A0 -.public ov10_022C46EC -.public ov10_022C4A5C -.public ov10_022C4BBC -.public ov10_022C4BE4 -.public ov10_022C4FC4 -.public ov29_022E34A8_EU -.public ov29_022E42E8 -.public ov29_022E53F0 -.public ov29_022E543C -.public ov29_022EA370 +.public RemoveGroundItem +.public ShouldMonsterRunAwayVariation +.public SubstitutePlaceholderStringTags +.public UseThrowableItem +.public abs .public ov29_022EACCC -.public ov29_022EC62C -.public ov29_022F2FE4 -.public ov29_022F42F8 .public ov29_022F52BC .public ov29_022F9EA0 -.public ov29_022FB718 -.public ov29_02300DCC -.public ov29_02307BDC -.public ov29_02322374 -.public ov29_02337E2C .public ov29_02344B44 -.public ov29_02344B9C .public ov29_02345004 -.public ov29_023460DC .public ov29_02347040 -.public ov29_02347184 .public ov29_02348D00 .public ov29_02348D3C .public ov29_02348DD8 .public ov29_02348ECC -.public ov29_0234908C -.public ov29_0234B084 -.public ov29_0234B294 -.public ov29_023529A8 -.public POISON_DAMAGE -.public POISON_DAMAGE_COOLDOWN -.public RemoveGroundItem -.public ShouldMonsterRunAwayVariation -.public SpawnDroppedItemWrapper -.public SPEED_BOOST_TURNS .public sub_0200D8AC -.public sub_02050FF8 -.public SubFixedPoint -.public SubstitutePlaceholderStringTags -.public TickStatusTurnCounter -.public TreasureBoxDropsEnabled -.public TryActivateBadDreams -.public TryGenerateUnownStoneDrop -.public TryIncreaseHp -.public TryWarp -.public TryWeatherFormChange -.public UseThrowableItem diff --git a/asm/include/overlay_29_0230F9A4.inc b/asm/include/overlay_29_0230F9A4.inc new file mode 100644 index 00000000..e05255e2 --- /dev/null +++ b/asm/include/overlay_29_0230F9A4.inc @@ -0,0 +1,93 @@ +#pragma once +.public AbilityIsActiveVeneer +.public ApplyDamageAndEffectsWrapper +.public BAD_POISON_DAMAGE_COOLDOWN +.public BAD_POISON_DAMAGE_TABLE +.public BURN_DAMAGE +.public BURN_DAMAGE_COOLDOWN +.public BinToDecFixedPoint +.public BoostSpeedOneStage +.public CeilFixedPoint +.public CheckVariousStatuses +.public CheckVariousStatuses2 +.public DUNGEON_PTR +.public DisplayActions +.public DungeonRandInt +.public DungeonRandOutcome__022EAB20 +.public EndBurnClassStatus +.public EndMagnetRiseStatus +.public EndNegativeStatusCondition +.public EndNegativeStatusConditionWrapper +.public EnsureCanStandCurrentTile +.public EntityIsValid__02311010 +.public ExclusiveItemEffectIsActiveWithLogging +.public ExclusiveItemEffectIsActive__0230F8AC +.public ExclusiveItemEffectIsActive__02311064 +.public GenerateStandardItem +.public GetApparentWeather +.public GetTileAtEntity +.public GravityIsActive +.public HasHeldItem +.public InitMove +.public IqSkillIsEnabled +.public IsFloating +.public IsFloorOver +.public IsMonster__0230F980 +.public ItemIsActive__02311034 +.public LEECH_SEED_DAMAGE_COOLDOWN +.public LEECH_SEED_HP_DRAIN +.public LogMessageByIdWithPopupCheckUser +.public MonsterHasNegativeStatus +.public MonsterIsType +.public MultiplyFixedPoint64 +.public POISON_DAMAGE +.public POISON_DAMAGE_COOLDOWN +.public SPEED_BOOST_TURNS +.public SpawnDroppedItemWrapper +.public SubFixedPoint +.public SubstitutePlaceholderStringTags +.public TickStatusTurnCounter +.public TreasureBoxDropsEnabled +.public TryActivateBadDreams +.public TryGenerateUnownStoneDrop +.public TryIncreaseHp +.public TryWarp +.public TryWeatherFormChange +.public ov10_022C4454 +.public ov10_022C446C +.public ov10_022C44BC +.public ov10_022C4590 +.public ov10_022C45D0 +.public ov10_022C45E8 +.public ov10_022C45F0 +.public ov10_022C464C +.public ov10_022C4650 +.public ov10_022C4664 +.public ov10_022C46A0 +.public ov10_022C46EC +.public ov10_022C4A5C +.public ov10_022C4BBC +.public ov10_022C4BE4 +.public ov10_022C4FC4 +.public ov29_022E34A8_EU +.public ov29_022E42E8 +.public ov29_022E53F0 +.public ov29_022E543C +.public ov29_022EA370 +.public ov29_022EACCC +.public ov29_022EC62C +.public ov29_022F2FE4 +.public ov29_022F42F8 +.public ov29_022FB718 +.public ov29_02300DCC +.public ov29_02307BDC +.public ov29_02322374 +.public ov29_02337E2C +.public ov29_02344B9C +.public ov29_023460DC +.public ov29_02347184 +.public ov29_0234908C +.public ov29_0234B084 +.public ov29_0234B294 +.public ov29_023529A8 +.public sub_02050FF8 diff --git a/asm/include/overlay_29_0231513C.inc b/asm/include/overlay_29_0231513C.inc index f5157e43..f9b4027f 100644 --- a/asm/include/overlay_29_0231513C.inc +++ b/asm/include/overlay_29_0231513C.inc @@ -1,23 +1,21 @@ #pragma once -.public _s32_div_f +.public ATK_STAT_IDX .public AbilityIsActiveVeneer .public AdvanceFrame .public AiMovement .public AnimationDelayOrSomething -.public ATK_STAT_IDX .public BoostDefensiveStat .public BoostOffensiveStat .public CalcStatusDuration .public CeilFixedPoint +.public DUNGEON_PTR .public DetermineMonsterShadow .public DisplayAnimatedNumbers -.public DUNGEON_PTR .public DungeonGetSpriteIndex .public DungeonRandInt .public EndCurseClassStatus .public EndInvisibleClassStatus .public EntityIsValid__02315118 -.public EntityIsValid__02318D34 .public ExclusiveItemEffectIsActiveWithLogging .public GetFloorType .public GetIdleAnimationId @@ -32,21 +30,33 @@ .public HasTypeAffectedByGravity .public HiddenStairsTrigger .public IqSkillIsEnabled +.public IsMonster__02318AB0 .public IsProtectedFromNegativeStatus .public LogMessageByIdWithPopupCheckUser .public LogMessageByIdWithPopupCheckUserTarget -.public LogMessageWithPopupCheckUserTarget .public LowerSpeed .public MewSpawnCheck .public MonsterIsType .public MonsterSpawnListPartialCopy .public MultiplyByFixedPoint +.public PERISH_SONG_TURN_RANGE +.public SafeguardIsActive +.public ShouldDisplayEntityWrapper +.public ShowPpRestoreEffect +.public SubFixedPoint +.public SubstitutePlaceholderStringTags +.public TryActivateQuickFeet +.public TryActivateSteadfast +.public TryRemoveSnatchedMonsterFromDungeonStruct +.public UpdateCamera +.public UpdateMinimap +.public UpdateStatusIconFlags +.public UpdateTrapsVisibility +.public _s32_div_f .public ov10_022C4470 .public ov10_022C44B0 .public ov10_022C4620 .public ov10_022C4628 -.public ov10_022C4754 -.public ov10_022C475C .public ov10_022C4764 .public ov10_022C4768 .public ov10_022C476C @@ -73,7 +83,6 @@ .public ov10_022C4848 .public ov10_022C486C .public ov10_022C487C -.public ov29_022E41B0 .public ov29_022E41DC .public ov29_022E442C .public ov29_022E4430 @@ -118,10 +127,6 @@ .public ov29_02304830 .public ov29_0234B09C .public ov29_0234B0B4 -.public PERISH_SONG_TURN_RANGE -.public SafeguardIsActive -.public ShouldDisplayEntityWrapper -.public ShowPpRestoreEffect .public strcpy .public sub_01FFB62C .public sub_02001888 @@ -129,12 +134,3 @@ .public sub_02050EBC .public sub_02050F78 .public sub_02050FF8 -.public SubFixedPoint -.public SubstitutePlaceholderStringTags -.public TryActivateQuickFeet -.public TryActivateSteadfast -.public TryRemoveSnatchedMonsterFromDungeonStruct -.public UpdateCamera -.public UpdateMinimap -.public UpdateStatusIconFlags -.public UpdateTrapsVisibility diff --git a/asm/include/overlay_29_02318AD4.inc b/asm/include/overlay_29_02318AD4.inc new file mode 100644 index 00000000..b64608e8 --- /dev/null +++ b/asm/include/overlay_29_02318AD4.inc @@ -0,0 +1,12 @@ +#pragma once +.public AdvanceFrame +.public CalcStatusDuration +.public EntityIsValid__02318D34 +.public IsMonster__02318AB0 +.public LogMessageByIdWithPopupCheckUserTarget +.public LogMessageWithPopupCheckUserTarget +.public SubstitutePlaceholderStringTags +.public UpdateStatusIconFlags +.public ov10_022C4754 +.public ov10_022C475C +.public ov29_022E41B0 diff --git a/asm/include/overlay_29_02319FB0.inc b/asm/include/overlay_29_02319FB0.inc index c780db00..2ff72d0c 100644 --- a/asm/include/overlay_29_02319FB0.inc +++ b/asm/include/overlay_29_02319FB0.inc @@ -1,69 +1,42 @@ #pragma once -.public _s32_div_f .public AbilityIsActiveVeneer -.public abs -.public AiConsiderMove .public AreMovesEnabled -.public AreOrbsAllowed -.public BoostSpeedOneStage .public CanAttackInDirection .public DIRECTIONS_XY .public DUNGEON_PTR .public DungeonRandInt .public DungeonRandOutcome__022EAB20 -.public EnemyEvolution .public EntityIsValid__02319F8C -.public EntityIsValid__0231B194 .public ExclusiveItemEffectFlagTest -.public GetApparentWeather .public GetDirectionTowardsPosition -.public GetItemMoveId16 -.public GetItemToUse .public GetMoveAccuracyOrAiChance -.public GetMoveTargetAndRange .public GetMoveTypeForMonster .public GetNumberOfAttacks .public GetTile -.public GetTreasureBoxChances .public GetTreatmentBetweenMonsters .public HasHeldItem -.public InitMove .public IqSkillIsEnabled .public IsBlinded .public IsFloorOver .public IsMonsterSleeping -.public IsMoveRangeString19 -.public LogMessageByIdWithPopupCheckParticipants +.public IsMonster__0231A9D4 .public LogMessageByIdWithPopupCheckUser -.public LogMessageByIdWithPopupCheckUserTarget .public MonsterHasNegativeStatus -.public MonsterIsType -.public NATURAL_GIFT_ITEM_TABLE +.public SubstitutePlaceholderStringTags +.public TryActivateTruant +.public UpdateMovePp +.public _s32_div_f +.public abs .public ov10_022C459C .public ov29_022E3ED0 -.public ov29_022E4110 -.public ov29_022EB4E8 .public ov29_022FA574 -.public ov29_022FB9E0 -.public ov29_022FBAB4 .public ov29_023007DC .public ov29_0230B7D4 .public ov29_0230F8D0 -.public ov29_02321274 .public ov29_0232145C -.public ov29_02322374 -.public ov29_0232E80C .public ov29_02333FD0 -.public ov29_02344B44 .public ov29_0235171E .public ov29_0237CA18 .public ov29_0237CA20 .public ov29_0237CA28 .public ov29_0237CA48 -.public RemoveUsedItem -.public SetActionUseMoveAi -.public SubstitutePlaceholderStringTags -.public TryActivateTruant -.public UpdateAiTargetPos -.public UpdateMovePp -.public WEATHER_BALL_TYPE_TABLE diff --git a/asm/include/overlay_29_0231A9F8.inc b/asm/include/overlay_29_0231A9F8.inc new file mode 100644 index 00000000..e1f1518d --- /dev/null +++ b/asm/include/overlay_29_0231A9F8.inc @@ -0,0 +1,39 @@ +#pragma once +.public AiConsiderMove +.public AreOrbsAllowed +.public BoostSpeedOneStage +.public DUNGEON_PTR +.public DungeonRandInt +.public EnemyEvolution +.public EntityIsValid__02319F8C +.public EntityIsValid__0231B194 +.public ExclusiveItemEffectIsActive__0231A87C +.public GetApparentWeather +.public GetItemMoveId16 +.public GetItemToUse +.public GetMoveTargetAndRange +.public GetTreasureBoxChances +.public InitMove +.public IsFloorOver +.public IsMonster__0231A9D4 +.public IsMoveRangeString19 +.public LogMessageByIdWithPopupCheckParticipants +.public LogMessageByIdWithPopupCheckUser +.public LogMessageByIdWithPopupCheckUserTarget +.public MonsterIsType +.public NATURAL_GIFT_ITEM_TABLE +.public RemoveUsedItem +.public SetActionUseMoveAi +.public SubstitutePlaceholderStringTags +.public TryActivateTruant +.public UpdateAiTargetPos +.public WEATHER_BALL_TYPE_TABLE +.public ov29_022E4110 +.public ov29_022EB4E8 +.public ov29_022FB9E0 +.public ov29_022FBAB4 +.public ov29_02321274 +.public ov29_0232145C +.public ov29_02322374 +.public ov29_0232E80C +.public ov29_02344B44 diff --git a/asm/include/overlay_29_0231B1B8.inc b/asm/include/overlay_29_0231B1B8.inc index f6ccca78..5c4bb826 100644 --- a/asm/include/overlay_29_0231B1B8.inc +++ b/asm/include/overlay_29_0231B1B8.inc @@ -1,124 +1,10 @@ #pragma once -.public AbilityIsActiveVeneer -.public AddHeldItemToBag -.public AnimationDelayOrSomething -.public APPLES_AND_BERRIES_ITEM_IDS -.public ApplyBlastSeedEffect -.public ApplyCalciumEffect -.public ApplyCheriBerryEffect .public ApplyDamageAndEffectsWrapper -.public ApplyDoughSeedEffect -.public ApplyGinsengEffect -.public ApplyGonePebbleEffect -.public ApplyGracideaEffect -.public ApplyGravelyrockEffect -.public ApplyGrimyFoodEffect -.public ApplyGummiBoostsDungeonMode -.public ApplyHungerSeedEffect -.public ApplyIronEffect -.public ApplyKeyEffect -.public ApplyMixElixirEffect -.public ApplyPechaBerryEffect -.public ApplyProteinEffect -.public ApplyRawstBerryEffect -.public ApplyViaSeedEffect -.public ApplyVileSeedEffect -.public ApplyViolentSeedEffect -.public ApplyZincEffect -.public BoostIQ -.public BoostSpeedOneStage -.public CACNEA_SPIKE_POWER -.public CalcDamageFixedNoCategory -.public CALCIUM_STAT_BOOST -.public CalcStatusDuration -.public CheckVariousConditions -.public CORSOLA_TWIG_POWER -.public DealDamageProjectile -.public DetermineMonsterShadow .public DUNGEON_PTR -.public DungeonGetSpriteIndex -.public EndNegativeStatusConditionWrapper -.public EnemyEvolution .public EntityIsValid__0231B194 -.public EntityIsValid__0231CBC8 -.public ExclusiveItemEffectFlagTest -.public FemaleToMaleForm -.public GEO_PEBBLE_DAMAGE -.public GetActiveTeamMember -.public GetIdleAnimationId -.public GetItemCategoryVeneer -.public GOLD_FANG_POWER -.public GOLD_THORN_POWER -.public GRAVELEROCK_DAMAGE -.public GUMMI_STAT_BOOST -.public InitMove -.public IqSkillIsEnabled -.public IRON_STAT_BOOST -.public IRON_THORN_POWER -.public IsBagFull .public IsMonsterSleeping -.public IsShaymin -.public IsSkyExclusiveDungeon -.public LevelUpItemEffect -.public LIFE_SEED_HP_BOOST -.public LogMessageByIdWithPopupCheckUserTarget -.public ORAN_BERRY_FULL_HP_BOOST -.public ORAN_BERRY_HP_RESTORATION -.public OREN_BERRY_DAMAGE -.public ov10_022C44EC +.public IsMonster__0231B318 .public ov10_022C4530 -.public ov10_022C4558 -.public ov10_022C4574 -.public ov10_022C457C -.public ov10_022C4864 .public ov29_022E28D4 -.public ov29_022E3590 -.public ov29_022E5A00 -.public ov29_022E5AE4 -.public ov29_022E60E4 -.public ov29_022E81F8 -.public ov29_022E9FD0 -.public ov29_022EA370 -.public ov29_022EACCC -.public ov29_022F04F0 -.public ov29_022F0518 -.public ov29_022F9EA0 -.public ov29_022FB920 -.public ov29_022FB9BC -.public ov29_02304830 .public ov29_02307BDC -.public ov29_0230F9A4 -.public ov29_02344B44 .public ov29_0234B084 -.public ov29_0234BA54 -.public PROTEIN_STAT_BOOST -.public RARE_FOSSIL_DAMAGE -.public RestoreAllMovePP -.public SetMonsterTypeAndAbility -.public SILVER_SPIKE_POWER -.public SITRUS_BERRY_FULL_HP_BOOST -.public SITRUS_BERRY_HP_RESTORATION -.public SLEEP_TURN_RANGE -.public SpawnDroppedItemWrapper -.public STICK_POWER -.public sub_020017EC -.public sub_0201CF80 -.public SubstitutePlaceholderStringTags -.public SwapMonsterWanFileIndex -.public TryDecreaseLevel -.public TryIncreaseBelly -.public TryIncreaseHp -.public TryInflictBlinkerStatus -.public TryInflictConfusedStatus -.public TryInflictCrossEyedStatus -.public TryInflictDropeyeStatus -.public TryInflictEyedropStatus -.public TryInflictInvisibleStatus -.public TryInflictPetrifiedStatus -.public TryInflictSleeplessStatus -.public TryInflictSleepStatus -.public TryInflictSlipStatus -.public TryWarp -.public UpdateShopkeeperModeAfterAttack -.public WONDER_GUMMI_STAT_BOOST -.public ZINC_STAT_BOOST diff --git a/asm/include/overlay_29_0231B33C.inc b/asm/include/overlay_29_0231B33C.inc new file mode 100644 index 00000000..1c48d524 --- /dev/null +++ b/asm/include/overlay_29_0231B33C.inc @@ -0,0 +1,117 @@ +#pragma once +.public APPLES_AND_BERRIES_ITEM_IDS +.public AbilityIsActiveVeneer +.public AddHeldItemToBag +.public AnimationDelayOrSomething +.public ApplyBlastSeedEffect +.public ApplyCalciumEffect +.public ApplyCheriBerryEffect +.public ApplyDoughSeedEffect +.public ApplyGinsengEffect +.public ApplyGonePebbleEffect +.public ApplyGracideaEffect +.public ApplyGravelyrockEffect +.public ApplyGrimyFoodEffect +.public ApplyGummiBoostsDungeonMode +.public ApplyHungerSeedEffect +.public ApplyIronEffect +.public ApplyKeyEffect +.public ApplyMixElixirEffect +.public ApplyPechaBerryEffect +.public ApplyProteinEffect +.public ApplyRawstBerryEffect +.public ApplyViaSeedEffect +.public ApplyVileSeedEffect +.public ApplyViolentSeedEffect +.public ApplyZincEffect +.public BoostIQ +.public BoostSpeedOneStage +.public CACNEA_SPIKE_POWER +.public CALCIUM_STAT_BOOST +.public CORSOLA_TWIG_POWER +.public CalcDamageFixedNoCategory +.public CalcStatusDuration +.public CheckVariousConditions +.public DUNGEON_PTR +.public DealDamageProjectile +.public DetermineMonsterShadow +.public DungeonGetSpriteIndex +.public EndNegativeStatusConditionWrapper +.public EnemyEvolution +.public EntityIsValid__0231CBC8 +.public ExclusiveItemEffectFlagTest +.public FemaleToMaleForm +.public GEO_PEBBLE_DAMAGE +.public GOLD_FANG_POWER +.public GOLD_THORN_POWER +.public GRAVELEROCK_DAMAGE +.public GUMMI_STAT_BOOST +.public GetActiveTeamMember +.public GetIdleAnimationId +.public GetItemCategoryVeneer +.public IRON_STAT_BOOST +.public IRON_THORN_POWER +.public InitMove +.public IqSkillIsEnabled +.public IsBagFull +.public IsShaymin +.public IsSkyExclusiveDungeon +.public LIFE_SEED_HP_BOOST +.public LevelUpItemEffect +.public LogMessageByIdWithPopupCheckUserTarget +.public ORAN_BERRY_FULL_HP_BOOST +.public ORAN_BERRY_HP_RESTORATION +.public OREN_BERRY_DAMAGE +.public PROTEIN_STAT_BOOST +.public RARE_FOSSIL_DAMAGE +.public RestoreAllMovePP +.public SILVER_SPIKE_POWER +.public SITRUS_BERRY_FULL_HP_BOOST +.public SITRUS_BERRY_HP_RESTORATION +.public SLEEP_TURN_RANGE +.public STICK_POWER +.public SetMonsterTypeAndAbility +.public SpawnDroppedItemWrapper +.public SubstitutePlaceholderStringTags +.public SwapMonsterWanFileIndex +.public TryDecreaseLevel +.public TryIncreaseBelly +.public TryIncreaseHp +.public TryInflictBlinkerStatus +.public TryInflictConfusedStatus +.public TryInflictCrossEyedStatus +.public TryInflictDropeyeStatus +.public TryInflictEyedropStatus +.public TryInflictInvisibleStatus +.public TryInflictPetrifiedStatus +.public TryInflictSleepStatus +.public TryInflictSleeplessStatus +.public TryInflictSlipStatus +.public TryWarp +.public UpdateShopkeeperModeAfterAttack +.public WONDER_GUMMI_STAT_BOOST +.public ZINC_STAT_BOOST +.public ov10_022C44EC +.public ov10_022C4558 +.public ov10_022C4574 +.public ov10_022C457C +.public ov10_022C4864 +.public ov29_022E3590 +.public ov29_022E5A00 +.public ov29_022E5AE4 +.public ov29_022E60E4 +.public ov29_022E81F8 +.public ov29_022E9FD0 +.public ov29_022EA370 +.public ov29_022EACCC +.public ov29_022F04F0 +.public ov29_022F0518 +.public ov29_022F9EA0 +.public ov29_022FB920 +.public ov29_022FB9BC +.public ov29_02304830 +.public ov29_0230F9A4 +.public ov29_02344B44 +.public ov29_0234BA54 +.public sub_020017EC +.public sub_0201CF80 diff --git a/asm/include/overlay_29_0232145C.inc b/asm/include/overlay_29_0232145C.inc index c18bc307..73c06f3e 100644 --- a/asm/include/overlay_29_0232145C.inc +++ b/asm/include/overlay_29_0232145C.inc @@ -1,148 +1,45 @@ #pragma once -.public _s32_div_f .public AbilityIsActiveVeneer .public ActivateStench .public AdvanceFrame .public AnimationDelayOrSomething -.public AnimationHasMoreFrames .public AreEntitiesAdjacent .public AreLateGameTrapsEnabledWrapper .public BoostSpeedOneStage .public CalcStatusDuration -.public ChangeMonsterAnimation -.public DETECT_BAND_MOVE_ACCURACY_DROP -.public DIRECTIONS_XY -.public DUNGEON_PTR +.public CanMonsterUseMove .public DungeonRandInt -.public DungeonRandOutcome__022EAB50 -.public DungeonRandRange .public EndFrozenClassStatus .public EndLeechSeedClassStatus .public EnemyEvolution .public EntityIsValid__02321438 -.public EntityIsValid__02325620 -.public EXCL_ITEM_EFFECTS_EVASION_BOOST -.public ExclusiveItemEffectFlagTest .public ExecuteMoveEffect .public FailsWhileMuzzled .public FormatMoveStringMore .public GetApparentWeather -.public GetBodySize -.public GetDamageSource .public GetEntityMoveTargetAndRange -.public GetMonsterGenderVeneer -.public GetMoveAccuracyOrAiChance -.public GetMoveAnimation -.public GetMoveAnimationId -.public GetMoveAnimationSpeed -.public GetMoveMaxGinsengBoost .public GetMoveMessageFromId .public GetMoveNbStrikes .public GetNaturePowerVariant -.public GetSpriteIndex__02052708 -.public GetTile -.public GetTreatmentBetweenMonsters .public GravityIsActive -.public HasHeldItem +.public INTIMIDATOR_ACTIVATION_CHANCE .public InitMove .public InitMoveCheckId -.public INTIMIDATOR_ACTIVATION_CHANCE .public IqSkillIsEnabled .public Is2TurnsMove -.public IsAffectedByTaunt -.public IsCopyingMove +.public IsChargingTwoTurnMove .public IsFloorOver .public IsMonsterSleeping +.public IsMonster__02322DB8 .public IsTrappingMove .public LogMessageByIdWithPopupCheckUser -.public LogMessageQuiet -.public LogMessageWithPopup .public LogMessageWithPopupCheckUser .public LowerSpeed -.public MALE_ACCURACY_STAGE_MULTIPLIERS -.public MALE_EVASION_STAGE_MULTIPLIERS .public METRONOME_TABLE -.public MoveIsNotPhysical .public NATURE_POWER_TABLE .public NIGHTMARE_TURN_RANGE -.public ov10_022BDE50 -.public ov10_022BE9E8 -.public ov10_022BEB2C -.public ov10_022BF01C -.public ov10_022BF0F4 -.public ov10_022BF1FC -.public ov10_022BFA3C -.public ov10_022BFAA8 -.public ov10_022BFD58 -.public ov10_022BFD6C -.public ov10_022BFD8C -.public ov10_022BFDAC -.public ov10_022BFDCC -.public ov10_022BFDEC -.public ov10_022C4584 -.public ov10_022C4714 -.public ov29_022DE5D8 -.public ov29_022DE5F0 -.public ov29_022E28D4 -.public ov29_022E2CA0 -.public ov29_022E3560 -.public ov29_022E56A0 -.public ov29_022E5864 -.public ov29_022E65A8 -.public ov29_022E6D68 -.public ov29_022EA370 -.public ov29_022EACCC -.public ov29_022ED0C4 -.public ov29_022ED0D4 -.public ov29_022F87C0 -.public ov29_022F8830 -.public ov29_022F88C0 -.public ov29_022F9840 -.public ov29_022FAA04 -.public ov29_022FAFD4 -.public ov29_022FBAB4 -.public ov29_0230040C -.public ov29_02300DCC -.public ov29_023024E0 -.public ov29_02304A48 -.public ov29_02304B14 -.public ov29_02318D58 -.public ov29_02321288 -.public ov29_02325644 -.public ov29_02325D20 -.public ov29_02325D7C -.public ov29_023383A8 -.public ov29_02344B9C -.public ov29_0234B034 -.public ov29_0234B084 -.public ov29_0234B09C -.public ov29_0234B4CC -.public ov29_0235171E -.public ov29_0235175C -.public ov29_02352A54 -.public ov29_02352A60 -.public ov29_02352A6C -.public ov29_02352A8C -.public ov29_02352AD8 -.public ov29_02352B1C -.public ov29_0235370C -.public ov29_0237CA68 -.public ov29_0237CA84 -.public ov29_0237CA88 -.public PlayMoveAnimation -.public PositionHasMonster -.public QUICK_DODGER_MOVE_ACCURACY_DROP -.public SetAndLoadCurrentAttackAnimation -.public ShouldDisplayEntityAdvanced -.public ShouldDisplayEntityWrapper -.public ShouldMovePlayAlternativeAnimation .public SLEEP_TURN_RANGE .public StringFromId -.public sub_020018D0 -.public sub_02001980 -.public sub_0201CF90 -.public sub_0201D1B0 -.public sub_0201D1D4 .public SubstitutePlaceholderStringTags .public TryInflictBlinkerStatus .public TryInflictBurnStatus @@ -161,6 +58,32 @@ .public TryInflictSleepStatus .public TrySealMove .public TryWarp -.public TWO_TURN_MOVES_AND_STATUSES .public UpdateAiTargetPos -.public WanTableSpriteHasAnimationGroup +.public ov10_022BFD6C +.public ov10_022C4584 +.public ov10_022C4714 +.public ov29_022E5864 +.public ov29_022EA370 +.public ov29_022F9840 +.public ov29_022FAA04 +.public ov29_022FBAB4 +.public ov29_0230040C +.public ov29_02300DCC +.public ov29_02304B14 +.public ov29_02318D58 +.public ov29_02321288 +.public ov29_02322DDC +.public ov29_023230FC +.public ov29_02324030 +.public ov29_02324514 +.public ov29_02324698 +.public ov29_02324BE8 +.public ov29_02324C9C +.public ov29_023383A8 +.public ov29_02344B9C +.public ov29_0234B034 +.public ov29_0234B084 +.public ov29_0235370C +.public ov29_0237CA68 +.public ov29_0237CA88 +.public sub_0201D1B0 diff --git a/asm/include/overlay_29_02322DDC.inc b/asm/include/overlay_29_02322DDC.inc new file mode 100644 index 00000000..170c2f0b --- /dev/null +++ b/asm/include/overlay_29_02322DDC.inc @@ -0,0 +1,110 @@ +#pragma once +.public AbilityIsActiveVeneer +.public AdvanceFrame +.public AnimationDelayOrSomething +.public AnimationHasMoreFrames +.public ChangeMonsterAnimation +.public DETECT_BAND_MOVE_ACCURACY_DROP +.public DIRECTIONS_XY +.public DUNGEON_PTR +.public DefenderAbilityIsActive__02322D64 +.public DungeonRandInt +.public DungeonRandOutcome__022EAB50 +.public DungeonRandRange +.public EXCL_ITEM_EFFECTS_EVASION_BOOST +.public EntityIsValid__02321438 +.public EntityIsValid__02325620 +.public ExclusiveItemEffectFlagTest +.public ExecuteMoveEffect +.public FormatMoveStringMore +.public GetApparentWeather +.public GetBodySize +.public GetDamageSource +.public GetEntityMoveTargetAndRange +.public GetMonsterGenderVeneer +.public GetMoveAccuracyOrAiChance +.public GetMoveAnimation +.public GetMoveAnimationId +.public GetMoveAnimationSpeed +.public GetMoveMaxGinsengBoost +.public GetMoveNbStrikes +.public GetNaturePowerVariant +.public GetSpriteIndex__02052708 +.public GetTile +.public GetTreatmentBetweenMonsters +.public HasHeldItem +.public IqSkillIsEnabled +.public Is2TurnsMove +.public IsAffectedByTaunt +.public IsCopyingMove +.public IsFloorOver +.public LogMessageByIdWithPopupCheckUser +.public LogMessageQuiet +.public LogMessageWithPopup +.public MALE_ACCURACY_STAGE_MULTIPLIERS +.public MALE_EVASION_STAGE_MULTIPLIERS +.public MoveIsNotPhysical +.public NATURE_POWER_TABLE +.public PlayMoveAnimation +.public PositionHasMonster +.public QUICK_DODGER_MOVE_ACCURACY_DROP +.public SetAndLoadCurrentAttackAnimation +.public ShouldDisplayEntityAdvanced +.public ShouldDisplayEntityWrapper +.public ShouldMovePlayAlternativeAnimation +.public TWO_TURN_MOVES_AND_STATUSES +.public WanTableSpriteHasAnimationGroup +.public _s32_div_f +.public ov10_022BDE50 +.public ov10_022BE9E8 +.public ov10_022BEB2C +.public ov10_022BF01C +.public ov10_022BF0F4 +.public ov10_022BF1FC +.public ov10_022BFA3C +.public ov10_022BFAA8 +.public ov10_022BFD58 +.public ov10_022BFD8C +.public ov10_022BFDAC +.public ov10_022BFDCC +.public ov10_022BFDEC +.public ov29_022DE5D8 +.public ov29_022DE5F0 +.public ov29_022E28D4 +.public ov29_022E2CA0 +.public ov29_022E3560 +.public ov29_022E56A0 +.public ov29_022E65A8 +.public ov29_022E6D68 +.public ov29_022EA370 +.public ov29_022EACCC +.public ov29_022ED0C4 +.public ov29_022ED0D4 +.public ov29_022F87C0 +.public ov29_022F8830 +.public ov29_022F88C0 +.public ov29_022FAFD4 +.public ov29_0230040C +.public ov29_023024E0 +.public ov29_02304A48 +.public ov29_02325644 +.public ov29_02325D20 +.public ov29_02325D7C +.public ov29_0234B034 +.public ov29_0234B084 +.public ov29_0234B09C +.public ov29_0234B4CC +.public ov29_0235171E +.public ov29_0235175C +.public ov29_02352A54 +.public ov29_02352A60 +.public ov29_02352A6C +.public ov29_02352A8C +.public ov29_02352AD8 +.public ov29_02352B1C +.public ov29_0235370C +.public ov29_0237CA84 +.public sub_020018D0 +.public sub_02001980 +.public sub_0201CF90 +.public sub_0201D1D4 diff --git a/asm/include/overlay_29_023498A0.inc b/asm/include/overlay_29_023498A0.inc index d135a284..dad46e39 100644 --- a/asm/include/overlay_29_023498A0.inc +++ b/asm/include/overlay_29_023498A0.inc @@ -6,16 +6,11 @@ .public CanSeeTarget .public ChangeDungeonMusic .public CloseAlertBox -.public CloseDialogueBox -.public CloseParentMenu -.public ClosePortraitBox .public CreateAlertBox -.public CreateDialogueBox -.public CreateParentMenuFromStringIds -.public CreatePortraitBox -.public Debug_Print0 .public DUNGEON_FADES_PTR .public DUNGEON_PTR +.public Debug_Print0 +.public DisplayMessageInternal .public DungeonAlloc .public DungeonFree .public DungeonRandInt @@ -47,7 +42,6 @@ .public GetSpecialTargetItem .public GetTargetMonsterNotFoundFlag .public HandleFaint -.public HidePortraitBox .public InitPortraitParams .public InitPreprocessorArgs .public InitRender3dElement64 @@ -59,11 +53,11 @@ .public IsDestinationFloor .public IsDestinationFloorWithFleeingOutlaw .public IsDestinationFloorWithHiddenOutlaw -.public IsDialogueBoxActive .public IsExperienceLocked .public IsFullFloorFixedRoom .public IsFutureDungeon .public IsJirachiChallengeFloor +.public IsMonster__0234D460 .public IsSecretFloor .public ItemZInit .public LoadOverlay @@ -72,6 +66,23 @@ .public MemFree .public MemZero .public MusicTableIdxToMusicId +.public OverlayIsLoaded +.public PositionIsOnStairs +.public PreprocessString +.public RemoveEmptyItemsInBagWrapper +.public RemoveGroundItem +.public RunDungeon +.public SetAdventureLogDungeonFloor +.public SetBothScreensWindowsColor +.public SetDungeonTipShown +.public SetPortraitLayout +.public ShouldDisplayEntityWrapper +.public ShouldMonsterHeadToStairs +.public StringFromId +.public SubstitutePlaceholderStringTags +.public UnloadOverlay +.public WriteQuicksaveData +.public YesNoMenu .public ov10_022BF764 .public ov10_022BF7D4 .public ov10_022BFD20 @@ -97,7 +108,6 @@ .public ov29_022DEBB0 .public ov29_022E09E8 .public ov29_022E0A64 -.public ov29_022E0B44 .public ov29_022E0B60 .public ov29_022E0CFC .public ov29_022E0E8C @@ -110,7 +120,6 @@ .public ov29_022E9F9C .public ov29_022E9FC0 .public ov29_022EA008 -.public ov29_022EA370 .public ov29_022EA428 .public ov29_022EAC8C .public ov29_022EACBC @@ -129,7 +138,6 @@ .public ov29_0231AF24 .public ov29_02337EE8 .public ov29_0233804C -.public ov29_02339148 .public ov29_0233992C .public ov29_0233A248 .public ov29_02344B44 @@ -138,6 +146,12 @@ .public ov29_02348A18 .public ov29_023491B8 .public ov29_023496B0 +.public ov29_0234D558 +.public ov29_0234D5D0 +.public ov29_0234D630 +.public ov29_0234D70C +.public ov29_0234D838 +.public ov29_0234D8A0 .public ov29_02353214 .public ov29_02353238 .public ov29_02353240 @@ -168,7 +182,6 @@ .public ov29_02353310 .public ov29_02353368 .public ov29_02353380 -.public ov29_02353398 .public ov29_0235352C .public ov29_02353563 .public ov29_023537C8 @@ -178,7 +191,6 @@ .public ov29_023537E8 .public ov29_0237C694 .public ov29_0237D000 -.public ov29_02382800 .public ov30_02382820 .public ov30_02382874 .public ov30_0238298C @@ -187,21 +199,6 @@ .public ov30_02382A34 .public ov30_02382C30 .public ov30_023842F4 -.public OverlayIsLoaded -.public PositionIsOnStairs -.public PreprocessString -.public RemoveEmptyItemsInBagWrapper -.public RemoveGroundItem -.public RunDungeon -.public SetAdventureLogDungeonFloor -.public SetBothScreensWindowsColor -.public SetDungeonTipShown -.public SetPortraitLayout -.public ShouldDisplayEntityWrapper -.public ShouldMonsterHeadToStairs -.public ShowPortraitInPortraitBox -.public ShowStringInDialogueBox -.public StringFromId .public strlen .public strncmp .public strncpy @@ -212,7 +209,6 @@ .public sub_02003990 .public sub_020039E4 .public sub_02003A40 -.public sub_02006B70 .public sub_02006EC4 .public sub_02008ED0 .public sub_02008F3C @@ -247,17 +243,12 @@ .public sub_02025784 .public sub_02027148 .public sub_0202715C -.public sub_020282F4 .public sub_0202836C .public sub_02028848 .public sub_02028A64 .public sub_02028E2C .public sub_02028E40 .public sub_02028E88 -.public sub_0202AB94 -.public sub_0202ABB0 -.public sub_0202F334 -.public sub_0202F474 .public sub_0203010C .public sub_02030214 .public sub_02034710 @@ -276,6 +267,3 @@ .public sub_02051DD0 .public sub_02051E60 .public sub_0205BAB0 -.public SubstitutePlaceholderStringTags -.public UnloadOverlay -.public WriteQuicksaveData diff --git a/asm/include/overlay_29_0234D484.inc b/asm/include/overlay_29_0234D484.inc new file mode 100644 index 00000000..a843c6fd --- /dev/null +++ b/asm/include/overlay_29_0234D484.inc @@ -0,0 +1,39 @@ +#pragma once +.public AdvanceFrame +.public CloseDialogueBox +.public CloseParentMenu +.public ClosePortraitBox +.public CreateDialogueBox +.public CreateParentMenuFromStringIds +.public CreatePortraitBox +.public HidePortraitBox +.public InitPreprocessorArgs +.public IsDialogueBoxActive +.public LoadOverlay +.public LogMessageQuiet +.public MemAlloc +.public MemFree +.public MemZero +.public OverlayIsLoaded +.public ShowPortraitInPortraitBox +.public ShowStringInDialogueBox +.public StringFromId +.public UnloadOverlay +.public ov29_022E0B44 +.public ov29_022EA370 +.public ov29_022EA428 +.public ov29_022F2FE4 +.public ov29_02339148 +.public ov29_0234B034 +.public ov29_0234B1A4 +.public ov29_0234B4CC +.public ov29_0234B73C +.public ov29_0234D304 +.public ov29_02353398 +.public ov29_02382800 +.public sub_02006B70 +.public sub_020282F4 +.public sub_0202AB94 +.public sub_0202ABB0 +.public sub_0202F334 +.public sub_0202F474 diff --git a/asm/overlay_29_022F7388.s b/asm/overlay_29_022F7388.s index ad8cb100..802db1d0 100644 --- a/asm/overlay_29_022F7388.s +++ b/asm/overlay_29_022F7388.s @@ -2947,3031 +2947,3 @@ _022F9710: ldmia sp!, {r3, r4, r5, r6, r7, pc} #endif arm_func_end DefenderAbilityIsActive__022F96CC - - arm_func_start IsMonster__022F9720 -IsMonster__022F9720: ; 0x022F9720 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__022F9720 - - arm_func_start TryActivateConversion2 -TryActivateConversion2: ; 0x022F9744 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r0 - mov r6, r1 - mov r4, r2 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r6 - bl EntityIsValid__022F7364 - cmp r0, #0 - cmpne r7, r6 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - ldr r5, [r6, #0xb4] - mov r0, r6 - bl Conversion2IsActive - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r7 - mov r1, r4 - bl GetMoveTypeForMonster - bl GetConversion2ConvertToType - movs r4, r0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r6 - bl ov29_02307CE0 - mov r0, r6 - strb r4, [r5, #0x5e] - mov r1, #0 - strb r1, [r5, #0x5f] - bl ov29_022E4160 - mov r0, #0 - mov r1, r6 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, r4 - mov r0, #0 - bl ov29_0234B084 - mov r0, r7 - mov r1, r6 - ldr r2, _022F97EC ; =0x00000C16 - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -#ifdef JAPAN -_022F97EC: .word 0x00000955 -#else -_022F97EC: .word 0x00000C16 -#endif - arm_func_end TryActivateConversion2 - - arm_func_start TryActivateTruant -TryActivateTruant: ; 0x022F97F0 - stmdb sp!, {r4, lr} - sub sp, sp, #8 - mov r4, r0 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022F9838 - mov r0, r4 - mov r1, #0x2a - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _022F9838 - mov r2, #0 - str r2, [sp] - mov r0, r4 - mov r1, r4 - mov r3, #1 - str r2, [sp, #4] - bl TryInflictPausedStatus -_022F9838: - add sp, sp, #8 - ldmia sp!, {r4, pc} - arm_func_end TryActivateTruant - - arm_func_start ov29_022F9840 -ov29_022F9840: ; 0x022F9840 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, #0 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldr r0, [r5] - cmp r0, #1 - bne _022F987C - ldr r0, [r5, #0xb4] - ldrb r0, [r0, #6] - cmp r0, #0 - moveq r0, #1 - movne r0, r4 - and r4, r0, #0xff -_022F987C: - bl sub_0204AEF0 - cmp r0, #0 - moveq r4, #0 - cmp r4, #0 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, r5 - bl ShouldDisplayEntityWrapper - cmp r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - mov r1, #1 - mov r0, r5 - mov r2, r1 - bl TryPointCameraToMonster - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_022F9840 - - arm_func_start TryPointCameraToMonster -TryPointCameraToMonster: ; 0x022F98B4 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r6, r0 - mov r5, r1 - mov r4, r2 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - ldr r0, [r6] - cmp r0, #1 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - ldr r0, _022F9968 ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, #0x1a000 -#ifdef JAPAN - ldr r0, [r0, #0x188] -#else - ldr r0, [r0, #0x22c] -#endif - cmp r0, r6 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - cmp r5, #0 - beq _022F9928 - mov r0, #1 - bl AnimationDelayOrSomething - mov r7, #0x34 - ldr r5, _022F9968 ; =DUNGEON_PTR - b _022F9918 -_022F9910: - mov r0, r7 - bl AdvanceFrame -_022F9918: - ldr r0, [r5] - ldrsh r0, [r0, #0x1c] - cmp r0, #0x3c - blt _022F9910 -_022F9928: - mov r0, #4 - mov r1, #0x44 - bl ov29_022EA370 - mov r0, r6 - mov r1, r4 - bl PointCameraToMonster - cmp r4, #0 - beq _022F9950 - add r0, r6, #4 - bl DiscoverMinimap -_022F9950: - ldr r0, _022F9968 ; =DUNGEON_PTR - mov r1, #0 - ldr r0, [r0] - strh r1, [r0, #0x1c] - bl ov29_022E81F8 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_022F9968: .word DUNGEON_PTR - arm_func_end TryPointCameraToMonster - - arm_func_start ov29_022F996C -ov29_022F996C: ; 0x022F996C - bx lr - arm_func_end ov29_022F996C - - arm_func_start ReevaluateSnatchMonster -ReevaluateSnatchMonster: ; 0x022F9970 -#ifdef JAPAN -#define OV29_022F9970_OFFSET -0xA4 -#else -#define OV29_022F9970_OFFSET 0 -#endif - stmdb sp!, {r4, r5, r6, lr} - mov r4, #0 - ldr r6, _022F99E8 ; =DUNGEON_PTR - b _022F99DC -_022F9980: - ldr r0, [r6] - add r0, r0, r4, lsl #2 - add r0, r0, #0x12000 - ldr r5, [r0, #0xb78 + OV29_022F9970_OFFSET] - mov r0, r5 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022F99D8 - ldr r0, [r5, #0xb4] - ldrb r0, [r0, #0xd8] - cmp r0, #3 - bne _022F99D8 - ldr r1, _022F99E8 ; =DUNGEON_PTR - ldr r0, [r1] - add r0, r0, #0x19000 - str r5, [r0, #0x904 + OV29_022F9970_OFFSET] - ldr r2, [r5, #0xb4] - ldr r0, [r1] - ldr r1, [r2, #0xb0] - add r0, r0, #0x19000 - str r1, [r0, #0x90c + OV29_022F9970_OFFSET] - ldmia sp!, {r4, r5, r6, pc} -_022F99D8: - add r4, r4, #1 -_022F99DC: - cmp r4, #0x14 - blt _022F9980 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_022F99E8: .word DUNGEON_PTR - arm_func_end ReevaluateSnatchMonster - - arm_func_start GetRandomExplorerMazeMonster -GetRandomExplorerMazeMonster: ; 0x022F99EC - stmdb sp!, {r4, r5, r6, r7, r8, lr} - sub sp, sp, #0x40 - mov r4, #0 - ldr r6, _022F9A70 ; =DUNGEON_PTR - mov r5, r4 - add r7, sp, #0 -_022F9A04: - ldr r0, [r6] - add r0, r0, r5, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr r8, [r0, #0xa94] -#else - ldr r8, [r0, #0xb38] -#endif - mov r0, r8 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022F9A40 - ldr r0, [r8, #0xb4] - ldrb r0, [r0, #0xbc] - cmp r0, #0xb - blo _022F9A40 - cmp r0, #0xe - strls r8, [r7, r4, lsl #2] - addls r4, r4, #1 -_022F9A40: - add r5, r5, #1 - cmp r5, #0x10 - blt _022F9A04 - cmp r4, #0 - movle r0, #0 - ble _022F9A68 - mov r0, r4 - bl DungeonRandInt - add r1, sp, #0 - ldr r0, [r1, r0, lsl #2] -_022F9A68: - add sp, sp, #0x40 - ldmia sp!, {r4, r5, r6, r7, r8, pc} - .align 2, 0 -_022F9A70: .word DUNGEON_PTR - arm_func_end GetRandomExplorerMazeMonster - - arm_func_start RestorePpAllMovesSetFlags -RestorePpAllMovesSetFlags: ; 0x022F9A74 - stmdb sp!, {r4, r5, r6, r7, r8, lr} - ldr r0, [r0, #0xb4] - mov r7, #0 -#ifdef JAPAN - add r6, r0, #0x120 -#else - add r6, r0, #0x124 -#endif - mov r4, r7 - mov r5, #1 -_022F9A8C: - ldrb r0, [r6, r7, lsl #3] - add r8, r6, r7, lsl #3 - tst r0, #1 - movne r0, r5 - moveq r0, r4 - tst r0, #0xff - beq _022F9AE4 - ldrh r1, [r8, #2] - mov r0, r8 - bic r1, r1, #8 - strh r1, [r8, #2] - ldrh r1, [r8, #2] - bic r1, r1, #0x10 - strh r1, [r8, #2] - ldrh r1, [r8, #2] - bic r1, r1, #0x40 - strh r1, [r8, #2] - ldrh r1, [r8, #2] - orr r1, r1, #4 - strh r1, [r8, #2] - bl GetMaxPpWrapper - strb r0, [r8, #6] -_022F9AE4: - add r7, r7, #1 - cmp r7, #4 - blt _022F9A8C - ldmia sp!, {r4, r5, r6, r7, r8, pc} - arm_func_end RestorePpAllMovesSetFlags - - arm_func_start ov29_022F9AF4 -ov29_022F9AF4: ; 0x022F9AF4 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - mov sb, r0 - ldr r1, [sb, #0xb4] - mov r5, #0 - ldrb r8, [r1, #6] - bl ov29_022F87C0 - cmp r0, #0 - moveq r0, r5 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mvn r7, #0 - mov r4, r7 -_022F9B20: - mov r6, r4 -_022F9B24: - ldrsh r0, [sb, #4] - ldrsh r1, [sb, #6] - add r0, r0, r6 - add r1, r1, r7 - bl GetTileSafe - ldr r1, [r0, #0xc] - cmp r1, #0 - beq _022F9B60 - ldr r0, [r1] - cmp r0, #1 - bne _022F9B60 - ldr r0, [r1, #0xb4] - ldrb r0, [r0, #6] - cmp r8, r0 - addne r5, r5, #1 -_022F9B60: - add r6, r6, #1 - cmp r6, #1 - ble _022F9B24 - add r7, r7, #1 - cmp r7, #1 - ble _022F9B20 - cmp r5, #2 - movge r0, #1 - movlt r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - arm_func_end ov29_022F9AF4 - - arm_func_start ov29_022F9B8C -ov29_022F9B8C: ; 0x022F9B8C - stmdb sp!, {r3, r4, lr} - sub sp, sp, #0x4c - mov r2, #0 - mov r1, #1 - mov r4, r0 - strb r2, [sp, #4] - strb r1, [sp, #5] - str r2, [sp] - ldrsh r1, [r4, #2] - add r0, sp, #8 - add r3, sp, #4 - bl sub_02052E2C - ldrsh r0, [r4, #2] - mov r1, #0 - mov r2, #6 - strh r0, [sp, #0xc] - ldrb r0, [r4, #0xa] - strb r0, [sp, #9] - ldrsh r0, [r4, #0xe] - strh r0, [sp, #0x10] - ldrb r0, [r4, #0x1a] - strb r0, [sp, #0x14] - ldrb r0, [r4, #0x1c] - strb r0, [sp, #0x16] - ldrb r0, [r4, #0x48] - strb r0, [sp, #0xa] - ldrb r0, [r4, #0x49] - strb r0, [sp, #0xb] - add r0, sp, #8 -_022F9C00: - mla lr, r1, r2, r0 - add r3, r4, r1, lsl #3 -#ifdef JAPAN - ldrb ip, [r3, #0x120] -#else - ldrb ip, [r3, #0x124] -#endif - add r3, r3, #0x100 - add r1, r1, #1 - strb ip, [lr, #0x22] -#ifdef JAPAN - ldrh r3, [r3, #0x24] -#else - ldrh r3, [r3, #0x28] -#endif - cmp r1, #4 - strh r3, [lr, #0x24] - blt _022F9C00 - bl GetMonsterEvoStatus - add sp, sp, #0x4c - ldmia sp!, {r3, r4, pc} - arm_func_end ov29_022F9B8C - - arm_func_start ov29_022F9C34 -ov29_022F9C34: ; 0x022F9C34 - ldr ip, _022F9C3C ; =sub_02056228 - bx ip - .align 2, 0 -_022F9C3C: .word sub_02056228 - arm_func_end ov29_022F9C34 - - arm_func_start CheckTeamMemberIdxVeneer -CheckTeamMemberIdxVeneer: ; 0x022F9C40 - ldr ip, _022F9C48 ; =CheckTeamMemberIdx - bx ip - .align 2, 0 -_022F9C48: .word CheckTeamMemberIdx - arm_func_end CheckTeamMemberIdxVeneer - - arm_func_start ov29_022F9C4C -ov29_022F9C4C: ; 0x022F9C4C - stmdb sp!, {r3, lr} - ldr r0, [r0, #0xb4] - ldrsh r0, [r0, #0xc] - bl GetActiveTeamMember - ldrsh r0, [r0, #8] - bl CheckTeamMemberIdx - ldmia sp!, {r3, pc} - arm_func_end ov29_022F9C4C - - arm_func_start IsMonsterIdInNormalRangeVeneer -IsMonsterIdInNormalRangeVeneer: ; 0x022F9C68 - ldr ip, _022F9C70 ; =IsMonsterIdInNormalRange - bx ip - .align 2, 0 -_022F9C70: .word IsMonsterIdInNormalRange - arm_func_end IsMonsterIdInNormalRangeVeneer - - arm_func_start ov29_022F9C74 -ov29_022F9C74: ; 0x022F9C74 -#ifdef JAPAN -#define OV29_022F9C74_OFFSET -4 -#else -#define OV29_022F9C74_OFFSET 0 -#endif - stmdb sp!, {r3, r4, r5, r6, lr} - sub sp, sp, #0xc - mov r6, r0 - bl EntityIsValid__022F7364 -#ifndef JAPAN - cmp r0, #0 - beq _022F9E80 - ldr r5, [r6, #0xb4] - ldrb r0, [r5, #0x103] -#endif - cmp r0, #0 - beq _022F9E78 - mov r0, r6 - bl GetTileAtEntity - ldrh r0, [r0] - and r0, r0, #3 - cmp r0, #2 - bne _022F9D50 - ldr r0, _022F9E88 ; =DUNGEON_PTR - ldr r1, _022F9E8C ; =SECONDARY_TERRAIN_TYPES - ldr r0, [r0] -#ifdef JAPAN - ldr r4, [r6, #0xb4] - add r0, r0, #0x4000 - ldrsh r0, [r0, #0x30] -#else - add r0, r0, #0x4000 - ldrsh r0, [r0, #0xd4] -#endif - ldrb r0, [r1, r0] - cmp r0, #1 - bne _022F9D34 -#ifdef JAPAN - ldrb r0, [r4, #0xc4] -#else - ldrb r0, [r5, #0xc4] -#endif - cmp r0, #1 - bne _022F9CF0 - mov r0, r6 - mov r1, r6 - mov r2, #1 - bl EndFrozenClassStatus -_022F9CF0: -#ifdef JAPAN - ldrsh r0, [r4, #2] - bl GetMobilityType - cmp r0, #4 - ldrnesh r1, [r4, #2] -#else - ldrsh r0, [r5, #2] - bl GetMobilityType - cmp r0, #4 - ldrnesh r1, [r5, #2] -#endif - ldrne r0, _022F9E90 ; =0x00000115 - cmpne r1, r0 - cmpne r1, #0x92 -#ifdef JAPAN - ldrneb r0, [r4, #0xbf] -#else - ldrneb r0, [r5, #0xbf] -#endif - cmpne r0, #1 - beq _022F9E78 - mov r3, #0 - mov r0, r6 - mov r1, r6 - mov r2, #1 - str r3, [sp] - bl TryInflictBurnStatus - b _022F9E78 -_022F9D34: -#ifdef JAPAN - ldrb r0, [r4, #0xbf] -#else - ldrb r0, [r5, #0xbf] -#endif - cmp r0, #1 - bne _022F9E78 - mov r0, r6 - mov r1, r6 - bl EndBurnClassStatus - b _022F9E78 -_022F9D50: - cmp r0, #0 - bne _022F9E78 -#ifdef JAPAN - ldr r5, [r6, #0xb4] -#endif - ldrb r0, [r5, #7] - cmp r0, #0 - beq _022F9E78 - add r0, r5, #0x100 - ldrh r1, [r0, #0x48 + OV29_022F9C74_OFFSET] - ldrh r4, [r0, #0x46 + OV29_022F9C74_OFFSET] - sub r3, sp, #4 - strh r1, [sp, #0xa] - mov r0, r1 - strh r4, [r3] - strh r0, [r3, #2] - ldr r1, _022F9E94 ; =BELLY_DRAIN_IN_WALLS_INT - ldr r0, [r3] - ldrh r2, [r1] - strh r4, [sp, #8] - strh r2, [r3] - ldrh r1, [r1, #2] - strh r1, [r3, #2] - ldr r1, [r3] - bl SubFixedPoint - strh r0, [sp, #4] - mov r0, r0, lsr #0x10 - strh r0, [sp, #6] - ldrh r1, [sp, #4] - add r0, r5, #0x100 - ldrh r3, [sp, #6] - strh r1, [r0, #0x46 + OV29_022F9C74_OFFSET] - ldrh r2, [sp, #8] - strh r3, [r0, #0x48 + OV29_022F9C74_OFFSET] - sub r0, sp, #4 - ldrh r1, [sp, #0xa] - strh r2, [r0] - mov r4, #0 - strh r1, [r0, #2] - ldr r0, [r0] - bl CeilFixedPoint - cmp r0, #0x14 - blt _022F9E18 - add r0, r5, #0x100 - ldrh r1, [r0, #0x46 + OV29_022F9C74_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + OV29_022F9C74_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0x14 - ldrlt r4, _022F9E98 ; =0x00000C1A -_022F9E18: - ldrh r1, [sp, #8] - ldrh r0, [sp, #0xa] - sub r2, sp, #4 - strh r1, [r2] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0xa - blt _022F9E64 - add r0, r5, #0x100 - ldrh r1, [r0, #0x46 + OV29_022F9C74_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + OV29_022F9C74_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0xa - ldrlt r4, _022F9E9C ; =0x00000C1B -_022F9E64: - cmp r4, #0 - beq _022F9E78 - mov r0, r6 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUser -_022F9E78: -#ifndef JAPAN - mov r0, #0 - strb r0, [r5, #0x103] -_022F9E80: -#endif - add sp, sp, #0xc - ldmia sp!, {r3, r4, r5, r6, pc} - .align 2, 0 -_022F9E88: .word DUNGEON_PTR -_022F9E8C: .word SECONDARY_TERRAIN_TYPES -_022F9E90: .word 0x00000115 -_022F9E94: .word BELLY_DRAIN_IN_WALLS_INT -#ifdef JAPAN -_022F9E98: .word 0x00000959 -_022F9E9C: .word 0x0000095A -#else -_022F9E98: .word 0x00000C1A -_022F9E9C: .word 0x00000C1B -#endif - arm_func_end ov29_022F9C74 - - arm_func_start ov29_022F9EA0 -ov29_022F9EA0: ; 0x022F9EA0 -#ifdef JAPAN -#define OV29_022F9EA0_OFFSET -4 -#else -#define OV29_022F9EA0_OFFSET 0 -#endif - stmdb sp!, {r4, r5, lr} - sub sp, sp, #0xc - mov r5, r0 - mov r1, #0x6f - ldr r4, [r5, #0xb4] - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _022F9FEC - ldrb r0, [r4, #7] - cmp r0, #0 - bne _022F9FBC - mov r0, r5 - mov r1, #0x11 - bl HasHeldItem - cmp r0, #0 - bne _022F9EF4 - mov r0, r5 - mov r1, #0x32 - bl HasHeldItem - cmp r0, #0 - beq _022F9F60 -_022F9EF4: - mov r0, #0xa - bl sub_02050FF8 - add r1, r4, #0x100 - ldrh r2, [r1, #0x46 + OV29_022F9EA0_OFFSET] - sub r3, sp, #4 - strh r0, [sp, #8] - strh r2, [r3] - ldrh r1, [r1, #0x48 + OV29_022F9EA0_OFFSET] - mov r0, r0, lsr #0x10 - strh r0, [sp, #0xa] - strh r1, [r3, #2] - ldrh r2, [sp, #8] - ldr r0, [r3] - ldrh r1, [sp, #0xa] - strh r2, [r3] - strh r1, [r3, #2] - ldr r1, [r3] - bl SubFixedPoint - strh r0, [sp, #4] - mov r0, r0, lsr #0x10 - strh r0, [sp, #6] - ldrh r2, [sp, #4] - add r0, r4, #0x100 - ldrh r1, [sp, #6] - strh r2, [r0, #0x46 + OV29_022F9EA0_OFFSET] - strh r1, [r0, #0x48 + OV29_022F9EA0_OFFSET] - b _022F9F9C -_022F9F60: - mov r0, r5 - mov r1, #0x22 - bl HasHeldItem - cmp r0, #0 - beq _022F9F9C - mov r0, #0 - bl sub_02050FF8 - strh r0, [sp] - mov r0, r0, lsr #0x10 - strh r0, [sp, #2] - ldrh r2, [sp] - add r0, r4, #0x100 - ldrh r1, [sp, #2] - strh r2, [r0, #0x46 + OV29_022F9EA0_OFFSET] - strh r1, [r0, #0x48 + OV29_022F9EA0_OFFSET] -_022F9F9C: - ldr r0, _022FA028 ; =DUNGEON_PTR - ldr r0, [r0] - ldrb r0, [r0, #0x78d] - cmp r0, #0 - beq _022F9FEC - mov r0, r5 - bl UpdateStatusIconFlags - b _022F9FEC -_022F9FBC: - ldrsh r1, [r4, #0x66] - ldrsh r0, [r4, #0x68] - cmp r0, r1 - beq _022F9FEC - cmp r1, #0x18 - cmpne r0, #0x18 - cmpne r1, #0xe - cmpne r0, #0xe - bne _022F9FEC - mov r0, #1 - bl UpdateCamera - bl UpdateMinimap -_022F9FEC: - ldrsh r1, [r4, #0x68] - ldrsh r0, [r4, #0x66] - cmp r1, r0 - beq _022FA000 - bl ov29_02307DD0 -_022FA000: - ldrb r0, [r4, #0x62] - tst r0, #1 - movne r0, #1 - moveq r0, #0 - tst r0, #0xff - ldrnesh r0, [r4, #0x66] - moveq r0, #0 - strh r0, [r4, #0x68] - add sp, sp, #0xc - ldmia sp!, {r4, r5, pc} - .align 2, 0 -_022FA028: .word DUNGEON_PTR - arm_func_end ov29_022F9EA0 - - arm_func_start ov29_022FA02C -ov29_022FA02C: ; 0x022FA02C - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x90 - mov sl, r0 - mov r3, r1 - ldrsh r1, [sl, #2] - mov sb, r2 - add r0, sp, #4 - mov r2, r3 - bl GetLearnableIqSkills - mov r6, r0 - ldrsh r1, [sl, #2] - ldrsh r2, [sl, #0xe] - add r0, sp, #0x49 - bl GetLearnableIqSkills - mov r7, r0 - bl ov29_0234B034 - mov r1, #0 - mov r2, sl - mov r3, r1 - str r1, [sp] - bl ov29_0230040C - mov r8, #1 - add r5, sp, #4 - mov r4, r8 - mov fp, #0 -_022FA090: - mov r1, #0 - mov r2, r1 - mov r3, r1 - b _022FA0B4 -_022FA0A0: - ldrb r0, [r5, r3] - cmp r0, r8 - moveq r1, r4 - beq _022FA0BC - add r3, r3, #1 -_022FA0B4: - cmp r3, r6 - blt _022FA0A0 -_022FA0BC: - mov r3, fp - b _022FA0DC -_022FA0C4: - add r0, r5, r3 - ldrb r0, [r0, #0x45] - cmp r8, r0 - moveq r2, #1 - beq _022FA0E4 - add r3, r3, #1 -_022FA0DC: - cmp r3, r7 - blt _022FA0C4 -_022FA0E4: - cmp r1, r2 - beq _022FA12C - add r0, sl, #0x90 - and r1, r8, #0xff - bl EnableIqSkill - add r0, sl, #0x9c - and r1, r8, #0xff - bl EnableIqSkill - cmp sb, #0 - bne _022FA12C - mov r0, #4 - bl sub_02017C50 - mov r0, #0 - and r1, r8, #0xff - bl ov29_0234B084 - ldr r1, _022FA140 ; =0x00000C1C - mov r0, #0 - bl LogMessageByIdWithPopup -_022FA12C: - add r8, r8, #1 - cmp r8, #0x45 - blt _022FA090 - add sp, sp, #0x90 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -#ifdef JAPAN -_022FA140: .word 0x0000095B -#else -_022FA140: .word 0x00000C1C -#endif - arm_func_end ov29_022FA02C - - arm_func_start BoostIQ -BoostIQ: ; 0x022FA144 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r0 - ldr r5, [r7, #0xb4] - ldr r0, _022FA1CC ; =0x000003E7 - ldrsh r4, [r5, #0xe] - mov r6, r2 - add r1, r4, r1 - strh r1, [r5, #0xe] - ldrsh r1, [r5, #0xe] - cmp r1, r0 - strgth r0, [r5, #0xe] - cmp r6, #0 - bne _022FA1B0 - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrsh r0, [r5, #0xe] - cmp r4, r0 - bne _022FA1A4 - ldr r1, _022FA1D0 ; =0x00000C27 - mov r0, r7 - bl LogMessageByIdWithPopupCheckUser - b _022FA1B0 -_022FA1A4: - ldr r1, _022FA1D4 ; =0x00000C26 - mov r0, r7 - bl LogMessageByIdWithPopupCheckUser -_022FA1B0: - mov r0, r5 - mov r1, r4 - mov r2, r6 - bl ov29_022FA02C - mov r0, r7 - bl ov29_023021F0 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_022FA1CC: .word 0x000003E7 -#ifdef JAPAN -_022FA1D0: .word 0x00000966 -_022FA1D4: .word 0x00000965 -#else -_022FA1D0: .word 0x00000C27 -_022FA1D4: .word 0x00000C26 -#endif - arm_func_end BoostIQ - - arm_func_start ov29_022FA1D8 -ov29_022FA1D8: ; 0x022FA1D8 -#ifdef JAPAN -#define OV29_022FA1D8_OFFSET -4 -#else -#define OV29_022FA1D8_OFFSET 0 -#endif - stmdb sp!, {r4, r5, r6, lr} - mov r6, r0 - ldr r4, [r6, #0xb4] - mov r5, r1 - ldrb r1, [r4, #7] - cmp r1, #0 - beq _022FA210 - ldrsh r1, [r6, #4] - add r0, r4, #0x100 - strh r1, [r0, #0x7e + OV29_022FA1D8_OFFSET] - ldrsh r1, [r6, #6] - add r1, r1, #1 - strh r1, [r0, #0x80 + OV29_022FA1D8_OFFSET] - b _022FA27C -_022FA210: - ldrb r1, [r4, #0x16a + OV29_022FA1D8_OFFSET] - cmp r1, #0xff - beq _022FA274 - ldrsh r1, [r4, #2] - add r0, r4, #0x4a - bl SetActionPassTurnOrWalk - ldrb r2, [r4, #0x16a + OV29_022FA1D8_OFFSET] - ldr r1, _022FA2E8 ; =DIRECTIONS_XY - add r0, r4, #0x100 - strb r2, [r4, #0x4c] - mov r2, r2, lsl #2 - ldrsh r3, [r1, r2] - ldrsh ip, [r6, #4] - ldr r2, _022FA2EC ; =ov29_0235171E - mov r1, #0xff - add r3, ip, r3 - strh r3, [r0, #0x7e + OV29_022FA1D8_OFFSET] - ldrb r3, [r4, #0x4c] - ldrsh ip, [r6, #6] - mov r3, r3, lsl #2 - ldrsh r2, [r2, r3] - add r2, ip, r2 - strh r2, [r0, #0x80 + OV29_022FA1D8_OFFSET] - strb r1, [r4, #0x16a + OV29_022FA1D8_OFFSET] - b _022FA27C -_022FA274: - mov r1, r2 - bl AiMovement -_022FA27C: - add r0, r4, #0x100 - ldrsh r1, [r0, #0x7e + OV29_022FA1D8_OFFSET] - cmp r1, #0 - ldreqsh r0, [r0, #0x80 + OV29_022FA1D8_OFFSET] - cmpeq r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, r6 - mov r1, #1 - bl CheckVariousStatuses2 - cmp r0, #0 - beq _022FA2B8 - mov r0, r6 - bl CheckVariousStatuses - cmp r0, #0 - ldmneia sp!, {r4, r5, r6, pc} -_022FA2B8: - add r1, r4, #0x7e + OV29_022FA1D8_OFFSET - add r0, r6, #4 - add r1, r1, #0x100 - bl GetDirectionTowardsPosition - mov r1, r0 - and r0, r1, #7 - strb r0, [r4, #0x4c] - cmp r5, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, r6 - bl ov29_02304A48 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_022FA2E8: .word DIRECTIONS_XY -_022FA2EC: .word ov29_0235171E - arm_func_end ov29_022FA1D8 - - arm_func_start ov29_022FA2F0 -ov29_022FA2F0: ; 0x022FA2F0 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - ldr sb, _022FA35C ; =DUNGEON_PTR - mov r8, r0 - mov r7, r1 - mov r6, r2 - mov r5, #0 -_022FA308: - ldr r0, [sb] - add r0, r0, r5, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr r4, [r0, #0xad4] -#else - ldr r4, [r0, #0xb78] -#endif - mov r0, r4 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FA34C - cmp r7, #0 - ldrne r0, [r4, #0xb4] - ldrneb r0, [r0, #0xbc] - cmpne r0, #7 - bne _022FA34C - mov r0, r4 - mov r1, r8 - mov r2, r6 - bl ov29_022FA1D8 -_022FA34C: - add r5, r5, #1 - cmp r5, #0x14 - blt _022FA308 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - .align 2, 0 -_022FA35C: .word DUNGEON_PTR - arm_func_end ov29_022FA2F0 - - arm_func_start ov29_022FA360 -ov29_022FA360: ; 0x022FA360 - stmdb sp!, {r4, r5, r6, lr} - mov r6, r0 - mov r5, r1 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - ldr r4, [r6, #0xb4] - and r1, r5, #7 - mov r0, r6 - strb r1, [r4, #0x4c] - bl GetIdleAnimationId - mov r1, r0 - ldrb r2, [r4, #0x4c] - mov r0, r6 - bl ChangeMonsterAnimation - ldmia sp!, {r4, r5, r6, pc} - arm_func_end ov29_022FA360 - - arm_func_start ov29_022FA3A0 -ov29_022FA3A0: ; 0x022FA3A0 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - mov r1, r4 - add r0, r5, #4 - bl GetDirectionTowardsPosition - and r1, r0, #0xff - mov r0, r5 - bl ov29_022FA360 - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_022FA3A0 - - arm_func_start ov29_022FA3D4 -ov29_022FA3D4: ; 0x022FA3D4 - stmdb sp!, {r4, r5, r6, lr} - ldr r1, _022FA414 ; =DUNGEON_PTR - mov r4, r0 - ldr r0, [r1] - mov r6, #0 -#ifdef JAPAN - add r0, r0, #0x284 -#else - add r0, r0, #0x328 -#endif - add r5, r0, #0x12800 -_022FA3F0: - ldr r0, [r5, r6, lsl #2] - mov r1, r4 - bl ov29_022FA3A0 - add r0, r6, #1 - mov r0, r0, lsl #0x10 - mov r6, r0, asr #0x10 - cmp r6, #4 - blt _022FA3F0 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_022FA414: .word DUNGEON_PTR - arm_func_end ov29_022FA3D4 - - arm_func_start ov29_022FA418 -ov29_022FA418: ; 0x022FA418 - stmdb sp!, {r3, lr} - bl IsFullFloorFixedRoom - cmp r0, #0 - ldmeqia sp!, {r3, pc} - bl ov29_022EF938 - ldmia sp!, {r3, pc} - arm_func_end ov29_022FA418 - - arm_func_start ShouldMonsterHeadToStairs -ShouldMonsterHeadToStairs: ; 0x022FA430 - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, lr} - mov sl, r0 - bl GetStairsRoom - mov r5, r0 - ldrsh r0, [sl, #4] - ldrsh r1, [sl, #6] - bl GetTile - ldrb r0, [r0, #7] - cmp r5, r0 - bne _022FA514 - ldr r1, _022FA51C ; =DUNGEON_PTR - add r0, sl, #4 - ldr r1, [r1] -#ifdef JAPAN - add r1, r1, #0xc40 - add r1, r1, #0xc000 -#else - add r1, r1, #0xe4 - add r1, r1, #0xcc00 -#endif - bl GetChebyshevDistance - ldr r7, _022FA520 ; =0x00002710 - ldr r4, _022FA51C ; =DUNGEON_PTR - mov r6, r0 - mov r8, #0 -_022FA480: - ldr r0, [r4] - add r0, r0, r8, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr sb, [r0, #0xad4] -#else - ldr sb, [r0, #0xb78] -#endif - mov r0, sb - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FA4E8 - mov r0, sl - mov r1, sb - bl ov29_023018AC - cmp r0, #1 - bne _022FA4E8 - ldrsh r0, [sb, #4] - ldrsh r1, [sb, #6] - bl GetTile - ldrb r0, [r0, #7] - cmp r5, r0 - bne _022FA4E8 - ldr r1, [r4] - add r0, sb, #4 -#ifdef JAPAN - add r1, r1, #0xc40 - add r1, r1, #0xc000 -#else - add r1, r1, #0xe4 - add r1, r1, #0xcc00 -#endif - bl GetChebyshevDistance - cmp r0, r7 - movlt r7, r0 -_022FA4E8: - add r8, r8, #1 - cmp r8, #0x14 - blt _022FA480 - ldr r0, _022FA520 ; =0x00002710 - cmp r7, r0 - beq _022FA50C - beq _022FA514 - cmp r7, r6 - ble _022FA514 -_022FA50C: - mov r0, #1 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} -_022FA514: - mov r0, #0 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} - .align 2, 0 -_022FA51C: .word DUNGEON_PTR -_022FA520: .word 0x00002710 - arm_func_end ShouldMonsterHeadToStairs - - arm_func_start ov29_022FA524 -ov29_022FA524: ; 0x022FA524 - stmdb sp!, {r4, r5, r6, lr} - ldr r4, _022FA570 ; =DUNGEON_PTR - mov r5, #0 -_022FA530: - ldr r0, [r4] - add r0, r0, r5, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr r6, [r0, #0xad4] -#else - ldr r6, [r0, #0xb78] -#endif - mov r0, r6 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FA560 - ldr r1, [r6, #0xb4] - mov r0, r6 - ldrb r1, [r1, #0x4c] - bl ov29_02304A48 -_022FA560: - add r5, r5, #1 - cmp r5, #0x14 - blt _022FA530 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_022FA570: .word DUNGEON_PTR - arm_func_end ov29_022FA524 - - arm_func_start ov29_022FA574 -ov29_022FA574: ; 0x022FA574 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldr r0, [r5, #0xb4] - mov r1, r4 -#ifdef JAPAN - add r0, r0, #0x120 -#else - add r0, r0, #0x124 -#endif - bl sub_0201405C - cmp r0, #0 - bne _022FA5B4 - ldr r1, _022FA5E4 ; =0x00000C1D - mov r0, r5 - bl LogMessageByIdWithPopupCheckUser - ldmia sp!, {r3, r4, r5, pc} -_022FA5B4: - cmp r0, #1 - bne _022FA5CC - ldr r1, _022FA5E8 ; =0x00000C1E - mov r0, r5 - bl LogMessageByIdWithPopupCheckUser - ldmia sp!, {r3, r4, r5, pc} -_022FA5CC: - cmp r0, #2 - ldmneia sp!, {r3, r4, r5, pc} - ldr r1, _022FA5EC ; =0x00000C1F - mov r0, r5 - bl LogMessageByIdWithPopupCheckUser - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -#ifdef JAPAN -_022FA5E4: .word 0x0000095C -_022FA5E8: .word 0x0000095D -_022FA5EC: .word 0x0000095E -#else -_022FA5E4: .word 0x00000C1D -_022FA5E8: .word 0x00000C1E -_022FA5EC: .word 0x00000C1F -#endif - arm_func_end ov29_022FA574 - - arm_func_start MewSpawnCheck -MewSpawnCheck: ; 0x022FA5F0 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl CanMonsterSpawn - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r5, #0x97 - bne _022FA63C - ldr r0, _022FA644 ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, #0x3000 -#ifdef JAPAN - ldrb r0, [r0, #0xd95] -#else - ldrb r0, [r0, #0xe39] -#endif - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - cmp r4, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} -_022FA63C: - mov r0, #1 - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_022FA644: .word DUNGEON_PTR - arm_func_end MewSpawnCheck - - arm_func_start ov29_022FA648 -ov29_022FA648: ; 0x022FA648 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - mov r7, #0 - mov r6, #1 - mov fp, r6 - mov r5, r7 -_022FA65C: - ldr r0, _022FA74C ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, r7, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr r8, [r0, #0xa84] -#else - ldr r8, [r0, #0xb28] -#endif - mov r0, r8 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FA730 - ldr sl, [r8, #0xb4] - ldrb r1, [sl, #7] - ldrsh r0, [sl, #0xc] - cmp r1, #0 - beq _022FA6C4 -#ifdef JAPAN - strb r6, [sl, #0x161] -#else - strb r6, [sl, #0x165] -#endif - bl ov29_022E8104 - bl ov29_022E81F8 - bl ov29_022E0A04 - cmp r0, #1 - mov r0, r8 - bne _022FA6B8 - bl ov29_022E68D8 - b _022FA6BC -_022FA6B8: - bl ov29_022E68BC -_022FA6BC: - strb r5, [r8, #0x20] - b _022FA730 -_022FA6C4: - cmp r0, #0 - blt _022FA730 - mov sb, #0 - bl GetActiveTeamMember - mov r4, r0 - bl ov29_022E0A04 - cmp r0, #0 - movne sb, #1 - bne _022FA70C - ldrsh r0, [r4, #8] - bl CheckTeamMemberIdx - cmp r0, #0 - movne sb, #1 - bne _022FA70C - ldrsh r0, [r4, #8] - bl IsMonsterIdInNormalRange - cmp r0, #0 - movne sb, #1 -_022FA70C: - cmp sb, #0 - beq _022FA730 -#ifdef JAPAN - strb fp, [sl, #0x161] -#else - strb fp, [sl, #0x165] -#endif - bl ov29_022E8104 - bl ov29_022E81F8 - mov r0, r8 - bl ov29_022E68BC - mov r0, #0 - strb r0, [r8, #0x20] -_022FA730: - add r7, r7, #1 - cmp r7, #4 - blt _022FA65C - mov r0, #0x1e - mov r1, #0x4a - bl ov29_022EA370 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_022FA74C: .word DUNGEON_PTR - arm_func_end ov29_022FA648 - - arm_func_start ov29_022FA750 -ov29_022FA750: ; 0x022FA750 - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, lr} - mov r6, #0 - ldr r4, _022FA7D8 ; =DUNGEON_PTR - mov r5, r6 -_022FA760: - ldr r0, [r4] - add r0, r0, r6, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr r8, [r0, #0xad4] -#else - ldr r8, [r0, #0xb78] -#endif - mov r0, r8 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FA7C8 - ldr sb, [r8, #0xb4] - mov r7, r5 -_022FA788: - ldr r0, [r4] - add r0, r0, r7, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr sl, [r0, #0xad4] -#else - ldr sl, [r0, #0xb78] -#endif - mov r0, sl - bl EntityIsValid__022F7364 - cmp r0, #0 - cmpne r8, sl - beq _022FA7BC - ldrh r1, [sb, #0x80] - ldrh r0, [sl, #0x26] - cmp r1, r0 - streq sl, [sb, #0x84] -_022FA7BC: - add r7, r7, #1 - cmp r7, #0x14 - blt _022FA788 -_022FA7C8: - add r6, r6, #1 - cmp r6, #0x14 - blt _022FA760 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} - .align 2, 0 -_022FA7D8: .word DUNGEON_PTR - arm_func_end ov29_022FA750 - - arm_func_start TryEndStatusWithAbility -TryEndStatusWithAbility: ; 0x022FA7DC - stmdb sp!, {r3, r4, r5, r6, lr} - sub sp, sp, #4 - mov r5, r1 - mov r2, #0x16 -#ifndef JAPAN - mov r3, #1 -#endif - mov r6, r0 - ldr r4, [r5, #0xb4] - bl DefenderAbilityIsActive__022F96CC - cmp r0, #0 - beq _022FA81C - ldrb r0, [r4, #0xbf] - cmp r0, #4 - bne _022FA81C - mov r0, r6 - mov r1, r5 - bl EndBurnClassStatus -_022FA81C: - mov r0, r6 - mov r1, r5 - mov r2, #0x40 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__022F96CC - cmp r0, #0 - beq _022FA850 - ldrb r0, [r4, #0xd0] - cmp r0, #2 - bne _022FA850 - mov r0, r6 - mov r1, r5 - bl EndCringeClassStatus -_022FA850: - mov r0, r6 - mov r1, r5 - mov r2, #0x42 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__022F96CC - cmp r0, #0 - beq _022FA884 - ldrb r0, [r4, #0xbf] - cmp r0, #1 - bne _022FA884 - mov r0, r6 - mov r1, r5 - bl EndBurnClassStatus -_022FA884: - mov r0, r6 - mov r1, r5 - mov r2, #0x29 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__022F96CC - cmp r0, #0 - beq _022FA8B8 - ldrb r0, [r4, #0xd0] - cmp r0, #7 - bne _022FA8B8 - mov r0, r6 - mov r1, r5 - bl EndCringeClassStatus -_022FA8B8: - mov r0, r6 - mov r1, r5 - mov r2, #0x36 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__022F96CC - cmp r0, #0 - bne _022FA8F0 - mov r0, r6 - mov r1, r5 - mov r2, #0x49 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__022F96CC - cmp r0, #0 - beq _022FA924 -_022FA8F0: - mov r0, r5 - bl IsMonsterSleeping - cmp r0, #0 - bne _022FA90C - ldrb r0, [r4, #0xbd] - cmp r0, #4 - bne _022FA924 -_022FA90C: - mov r3, #1 - mov r0, r6 - mov r1, r5 - mov r2, #0 - str r3, [sp] - bl EndSleepClassStatus -_022FA924: - mov r0, r6 - mov r1, r5 - mov r2, #0x41 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__022F96CC - cmp r0, #0 - beq _022FA95C - ldrb r0, [r4, #0xc4] - cmp r0, #1 - bne _022FA95C - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl EndFrozenClassStatus -_022FA95C: - mov r0, r6 - mov r1, r5 - mov r2, #0x45 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__022F96CC - cmp r0, #0 - beq _022FA998 - ldrb r0, [r4, #0xbf] - add r0, r0, #0xfe - and r0, r0, #0xff - cmp r0, #1 - bhi _022FA998 - mov r0, r6 - mov r1, r5 - bl EndBurnClassStatus -_022FA998: - mov r0, r5 - mov r1, #0x25 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _022FA9CC - mov r0, #0 - strb r0, [r4, #0xff] - ldrb r0, [r4, #0xd5] - cmp r0, #0xc - bne _022FA9CC - mov r0, r6 - mov r1, r5 - bl EndReflectClassStatus -_022FA9CC: - mov r0, r5 - mov r1, #0x2b - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _022FA9FC - ldrb r0, [r4, #0xc4] - cmp r0, #2 - bne _022FA9FC - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl EndFrozenClassStatus -_022FA9FC: - add sp, sp, #4 - ldmia sp!, {r3, r4, r5, r6, pc} - arm_func_end TryEndStatusWithAbility - - arm_func_start ov29_022FAA04 -ov29_022FAA04: ; 0x022FAA04 -#ifdef JAPAN -#define OV29_022FAA04_OFFSET -4 -#else -#define OV29_022FAA04_OFFSET 0 -#endif - ldr ip, [r0, #0xb4] - mov r3, #0 -_022FAA0C: - add r2, ip, r3, lsl #3 - ldrb r0, [r2, #0x124 + OV29_022FAA04_OFFSET] - add r3, r3, #1 - cmp r3, #4 - bic r0, r0, #0x10 - strb r0, [r2, #0x124 + OV29_022FAA04_OFFSET] - blt _022FAA0C - ldrb r0, [ip, #0x144 + OV29_022FAA04_OFFSET] - bic r0, r0, #0x10 - strb r0, [ip, #0x144 + OV29_022FAA04_OFFSET] - ldrh r0, [r1, #4] - cmp r0, #0x160 - ldreqb r0, [ip, #0x144 + OV29_022FAA04_OFFSET] - orreq r0, r0, #0x10 - streqb r0, [ip, #0x144 + OV29_022FAA04_OFFSET] - ldrneb r0, [r1] - orrne r0, r0, #0x10 - strneb r0, [r1] - bx lr - arm_func_end ov29_022FAA04 - - arm_func_start ov29_022FAA58 -ov29_022FAA58: ; 0x022FAA58 -#ifdef JAPAN -#define OV29_022FAA58_OFFSET -4 -#else -#define OV29_022FAA58_OFFSET 0 -#endif - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x14 - ldr r1, _022FAC90 ; =DUNGEON_PTR - mov sl, r0 - ldr r0, [r1] - mov r6, #0 -#ifdef JAPAN - add r0, r0, #0x284 -#else - add r0, r0, #0x328 -#endif - add r4, r0, #0x12800 -_022FAA78: - ldr r5, [r4, r6, lsl #2] - mov r0, r5 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FAB98 - mov r0, r5 - mov r1, #0x37 - bl IqSkillIsEnabled - cmp r0, #0 - beq _022FAB98 - ldr sb, [r5, #0xb4] - mov r8, #0 - mov r7, r8 - add fp, sb, #0x124 + OV29_022FAA58_OFFSET -_022FAAB0: - ldrb r1, [fp, r7, lsl #3] - add r0, fp, r7, lsl #3 - str r0, [sp] - tst r1, #1 - movne r0, #1 - moveq r0, #0 - tst r0, #0xff - beq _022FAB00 - ldr r0, [sp] - bl GetMaxPpWrapper - ldr r1, [sp] - ldrb r1, [r1, #6] - cmp r1, r0 - beq _022FAB00 - add r0, r8, #1 - mov r1, r0, lsl #0x10 - mov r2, r8, lsl #1 - add r0, sp, #4 - strh r7, [r0, r2] - mov r8, r1, asr #0x10 -_022FAB00: - add r0, r7, #1 - mov r0, r0, lsl #0x10 - mov r7, r0, asr #0x10 - cmp r7, #4 - blt _022FAAB0 - cmp r8, #0 - ble _022FAB4C - mov r0, r8 - bl DungeonRandInt - mov r0, r0, lsl #0x10 - add r1, sp, #4 - mov r0, r0, asr #0xf - ldrsh r0, [r1, r0] - add r1, sb, #0x124 + OV29_022FAA58_OFFSET - add r1, r1, r0, lsl #3 - ldrb r0, [r1, #6] - add r0, r0, #1 - strb r0, [r1, #6] - b _022FAB54 -_022FAB4C: - mov r0, #0 - b _022FAB58 -_022FAB54: - mov r0, #1 -_022FAB58: - cmp r0, #0 - beq _022FAB98 - mov r0, r5 - bl ShowPpRestoreEffect - cmp sl, #0 - bne _022FAB98 - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r0, #1 - mov r1, #0x37 - bl ov29_0234B084 -#ifdef JAPAN - ldr r1, _022FC21C ; =0x0000095F - mov r0, r5 -#else - mov r0, r5 - mov r1, #0xc20 -#endif - bl LogMessageByIdWithPopupCheckUser -_022FAB98: - add r0, r6, #1 - mov r0, r0, lsl #0x10 - mov r6, r0, asr #0x10 - cmp r6, #4 - blt _022FAA78 - mov r8, #0 - mov fp, r8 -_022FABB4: - ldr sb, [r4, r8, lsl #2] - mov r0, sb - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FAC74 - ldr r6, [sb, #0xb4] - mov r7, fp - add r5, r6, #0x124 + OV29_022FAA58_OFFSET - b _022FABFC -_022FABD8: - add r0, r5, r7, lsl #3 - bl GetMaxPp - add r1, r6, r7, lsl #3 - ldrb r1, [r1, #0x12a + OV29_022FAA58_OFFSET] - cmp r1, r0 - blt _022FAC04 - add r0, r7, #1 - mov r0, r0, lsl #0x10 - mov r7, r0, asr #0x10 -_022FABFC: - cmp r7, #4 - blt _022FABD8 -_022FAC04: - cmp r7, #4 - beq _022FAC74 - mov r0, sb - mov r1, #0x47 - bl ExclusiveItemEffectIsActive__022FAC98 - cmp r0, #0 - beq _022FAC74 - mov r0, #0 - mov r1, sb - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r0, sb - mov r1, #0x47 - add r2, sp, #0xc - bl GetExclusiveItemWithEffectFromBag - mov r0, #1 - add r1, sp, #0xc - bl ov29_02344B44 - cmp sl, #0 - bne _022FAC60 - ldr r1, _022FAC94 ; =0x00000C23 - mov r0, sb - bl LogMessageByIdWithPopupCheckUser -_022FAC60: - mov r0, sb - mov r1, sb - mov r2, #1 - mov r3, sl - bl RestoreAllMovePP -_022FAC74: - add r0, r8, #1 - mov r0, r0, lsl #0x10 - mov r8, r0, asr #0x10 - cmp r8, #4 - blt _022FABB4 - add sp, sp, #0x14 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_022FAC90: .word DUNGEON_PTR -#ifdef JAPAN -_022FC21C: .word 0x0000095F -_022FAC94: .word 0x00000962 -#else -_022FAC94: .word 0x00000C23 -#endif - arm_func_end ov29_022FAA58 - - arm_func_start ExclusiveItemEffectIsActive__022FAC98 -ExclusiveItemEffectIsActive__022FAC98: ; 0x022FAC98 - stmdb sp!, {r3, lr} - ldr r2, [r0, #0xb4] - ldrb r0, [r2, #6] - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, pc} -#ifdef JAPAN - add r0, r2, #0x224 -#else - add r0, r2, #0x228 -#endif - bl ExclusiveItemEffectFlagTest - ldmia sp!, {r3, pc} - arm_func_end ExclusiveItemEffectIsActive__022FAC98 - - arm_func_start ov29_022FACBC -ov29_022FACBC: ; 0x022FACBC - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, lr} - sub sp, sp, #4 - ldr r1, _022FAD44 ; =DUNGEON_PTR - mov sb, r0 - ldr r0, [r1] - mov r8, #0 -#ifdef JAPAN - add r0, r0, #0x284 -#else - add r0, r0, #0x328 -#endif - ldr r5, _022FAD48 ; =0x000003E7 - add r7, r0, #0x12800 - mov r4, r8 - mov r6, #0x48 -_022FACE8: - ldr sl, [r7, r8, lsl #2] - mov r0, sl - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FAD28 - mov r0, sl - mov r1, r6 - bl ExclusiveItemEffectIsActive__022FAC98 - cmp r0, #0 - beq _022FAD28 - mov r0, sl - mov r1, sl - mov r2, r5 - mov r3, r4 - str sb, [sp] - bl TryIncreaseHp -_022FAD28: - add r0, r8, #1 - mov r0, r0, lsl #0x10 - mov r8, r0, asr #0x10 - cmp r8, #4 - blt _022FACE8 - add sp, sp, #4 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, pc} - .align 2, 0 -_022FAD44: .word DUNGEON_PTR -_022FAD48: .word 0x000003E7 - arm_func_end ov29_022FACBC - - arm_func_start ov29_022FAD4C -ov29_022FAD4C: ; 0x022FAD4C -#ifdef JAPAN -#define OV29_022FAD4C_OFFSET -0xA4 -#else -#define OV29_022FAD4C_OFFSET 0 -#endif - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - ldr r1, _022FAF00 ; =DUNGEON_PTR - mov r8, #0 - ldr r1, [r1] - sub r3, r8, #1 - add r2, r1, #0xcc00 - ldrsh r4, [r2, #0xe4 + OV29_022FAD4C_OFFSET] - add r1, r1, #0x328 + OV29_022FAD4C_OFFSET - add r5, r1, #0x12800 - cmp r4, r3 - ldreqsh r1, [r2, #0xe6 + OV29_022FAD4C_OFFSET] - mov sb, r0 - moveq r0, r3 - cmpeq r1, r0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov r7, #0 - mov r4, #0x1a - b _022FADE4 -_022FAD94: - ldr r6, [r5, r7, lsl #2] - mov r0, r6 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FADD8 - ldr r0, [r6, #0xb4] - ldrb r0, [r0, #0x48] - cmp r0, #0xd9 - blo _022FADC0 - cmp r0, #0xe4 - blo _022FADD8 -_022FADC0: - mov r0, r6 - mov r1, r4 - bl IqSkillIsEnabled - cmp r0, #0 - movne r8, #1 - bne _022FADEC -_022FADD8: - add r0, r7, #1 - mov r0, r0, lsl #0x10 - mov r7, r0, asr #0x10 -_022FADE4: - cmp r7, #4 - blt _022FAD94 -_022FADEC: - cmp r8, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - bl GetFloorType - cmp r0, #0 - bne _022FAEEC - cmp sb, #0 - bne _022FAE14 -#ifdef JAPAN - mov r0, r6 - mov r1, #0x960 -#else - ldr r1, _022FAF04 ; =0x00000C21 - mov r0, r6 -#endif - bl LogMessageByIdWithPopupCheckUser -_022FAE14: - bl GetLeader - mov r5, r0 - add r0, sp, #0 - add r1, sp, #2 - mov r4, #0 - bl GetStairsSpawnPosition - ldrsh r1, [sp] - ldrsh r3, [r5, #4] - ldrsh r2, [sp, #2] - cmp r3, r1 - ldreqsh r0, [r5, #6] - cmpeq r0, r2 - cmp r3, r1 - bne _022FAE58 - ldrsh r0, [r5, #6] - cmp r0, r2 - movlt r4, #0 -_022FAE58: - cmp r3, r1 - ldrltsh r0, [r5, #6] - cmplt r0, r2 - movlt r4, #1 - cmp r3, r1 - bge _022FAE7C - ldrsh r0, [r5, #6] - cmp r0, r2 - moveq r4, #2 -_022FAE7C: - cmp r3, r1 - bge _022FAE90 - ldrsh r0, [r5, #6] - cmp r0, r2 - movgt r4, #3 -_022FAE90: - cmp r3, r1 - bne _022FAEA4 - ldrsh r0, [r5, #6] - cmp r0, r2 - movgt r4, #4 -_022FAEA4: - cmp r3, r1 - ldrgtsh r0, [r5, #6] - cmpgt r0, r2 - movgt r4, #5 - cmp r3, r1 - ble _022FAEC8 - ldrsh r0, [r5, #6] - cmp r0, r2 - moveq r4, #6 -_022FAEC8: - cmp r3, r1 - ble _022FAEDC - ldrsh r0, [r5, #6] - cmp r0, r2 - movlt r4, #7 -_022FAEDC: - mov r0, r5 - mov r1, r4 - bl ov29_022E6928 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} -_022FAEEC: - bl GetFloorType - cmp r0, #1 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - bl GetFloorType - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - .align 2, 0 -_022FAF00: .word DUNGEON_PTR -#ifndef JAPAN -_022FAF04: .word 0x00000C21 -#endif - arm_func_end ov29_022FAD4C - - arm_func_start ov29_022FAF08 -ov29_022FAF08: ; 0x022FAF08 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - ldr r1, _022FAFC8 ; =DUNGEON_PTR - mov r6, r0 - ldr r0, [r1] - mov r5, #0 -#ifdef JAPAN - add r0, r0, #0x284 -#else - add r0, r0, #0x328 -#endif - add r8, r0, #0x12800 - bl IsCurrentFixedRoomBossFight - cmp r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov sb, r5 - mov r7, #0x36 - b _022FAF74 -_022FAF3C: - ldr r4, [r8, sb, lsl #2] - mov r0, r4 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FAF68 - mov r0, r4 - mov r1, r7 - bl IqSkillIsEnabled - cmp r0, #0 - movne r5, #1 - bne _022FAF7C -_022FAF68: - add r0, sb, #1 - mov r0, r0, lsl #0x10 - mov sb, r0, asr #0x10 -_022FAF74: - cmp sb, #4 - blt _022FAF3C -_022FAF7C: - cmp r5, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - ldr r1, _022FAFC8 ; =DUNGEON_PTR - ldr r0, _022FAFCC ; =0x00012AF8 - ldr r1, [r1] - ldrsh r1, [r1, r0] - cmp r1, #0 - ldmleia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - cmp r6, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov r0, #0 - bl ov29_0234B09C - ldr r1, _022FAFD0 ; =0x00000C22 - mov r0, r4 - bl LogMessageByIdWithPopupCheckUser - mov r0, #0x78 - mov r1, #0xa - bl ov29_022EA370 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - .align 2, 0 -_022FAFC8: .word DUNGEON_PTR -#ifdef JAPAN -_022FAFCC: .word 0x00012A54 -_022FAFD0: .word 0x00000961 -#else -_022FAFCC: .word 0x00012AF8 -_022FAFD0: .word 0x00000C22 -#endif - arm_func_end ov29_022FAF08 - - arm_func_start ov29_022FAFD4 -ov29_022FAFD4: ; 0x022FAFD4 - stmdb sp!, {r3, lr} - mov r2, #1 - mov r3, #0 - bl GetTreatmentBetweenMonsters - cmp r0, #0 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} - arm_func_end ov29_022FAFD4 - - arm_func_start GetTeamMemberWithIqSkill -GetTeamMemberWithIqSkill: ; 0x022FAFF8 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - ldr r1, _022FB060 ; =DUNGEON_PTR - mov r4, #0 - ldr r1, [r1] - mov r5, r0 -#ifdef JAPAN - add r0, r1, #0x284 -#else - add r0, r1, #0x328 -#endif - mov r7, r4 - add r6, r0, #0x12800 - b _022FB050 -_022FB01C: - ldr r0, [r6, r7, lsl #2] - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FB044 - ldr r0, [r6, r7, lsl #2] - mov r1, r5 - bl IqSkillIsEnabled - cmp r0, #0 - ldrne r4, [r6, r7, lsl #2] - bne _022FB058 -_022FB044: - add r0, r7, #1 - mov r0, r0, lsl #0x10 - mov r7, r0, asr #0x10 -_022FB050: - cmp r7, #4 - blt _022FB01C -_022FB058: - mov r0, r4 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_022FB060: .word DUNGEON_PTR - arm_func_end GetTeamMemberWithIqSkill - - arm_func_start TeamMemberHasEnabledIqSkill -TeamMemberHasEnabledIqSkill: ; 0x022FB064 - stmdb sp!, {r3, lr} - bl GetTeamMemberWithIqSkill - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} - arm_func_end TeamMemberHasEnabledIqSkill - - arm_func_start TeamLeaderIqSkillIsEnabled -TeamLeaderIqSkillIsEnabled: ; 0x022FB080 - stmdb sp!, {r4, lr} - mov r4, r0 - bl GetLeader - mov r1, r4 - bl IqSkillIsEnabled - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - arm_func_end TeamLeaderIqSkillIsEnabled - - arm_func_start CountMovesOutOfPp -CountMovesOutOfPp: ; 0x022FB0A8 - stmdb sp!, {r3, lr} - ldr ip, [r0, #0xb4] - mov r0, #0 - mov lr, r0 - mov r2, r0 - mov r3, #1 -_022FB0C0: - add r1, ip, lr, lsl #3 -#ifdef JAPAN - ldrb r1, [r1, #0x120] -#else - ldrb r1, [r1, #0x124] -#endif - tst r1, #1 - movne r1, r3 - moveq r1, r2 - tst r1, #0xff - beq _022FB0F4 - add r1, ip, lr, lsl #3 -#ifdef JAPAN - ldrb r1, [r1, #0x126] -#else - ldrb r1, [r1, #0x12a] -#endif - cmp r1, #0 - addeq r0, r0, #1 - moveq r0, r0, lsl #0x10 - moveq r0, r0, asr #0x10 -_022FB0F4: - add r1, lr, #1 - mov r1, r1, lsl #0x10 - mov lr, r1, asr #0x10 - cmp lr, #4 - blt _022FB0C0 - ldmia sp!, {r3, pc} - arm_func_end CountMovesOutOfPp - - arm_func_start HasSuperEffectiveMoveAgainstUser -HasSuperEffectiveMoveAgainstUser: ; 0x022FB10C - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - mov sb, r1 - ldr r6, [sb, #0xb4] - mov r7, #0 - mov sl, r0 - mov r8, r2 -#ifdef JAPAN - add r4, r6, #0x120 -#else - add r4, r6, #0x124 -#endif - mov fp, r7 - mov r5, #1 - b _022FB198 -_022FB134: - add r0, r6, r7, lsl #3 -#ifdef JAPAN - ldrb r0, [r0, #0x120] -#else - ldrb r0, [r0, #0x124] -#endif - tst r0, #1 - movne r0, r5 - moveq r0, fp - tst r0, #0xff - beq _022FB18C - cmp r8, #0 - beq _022FB168 - add r0, r4, r7, lsl #3 - bl HasMaxGinsengBoost99 - cmp r0, #0 - beq _022FB18C -_022FB168: - add r0, r4, r7, lsl #3 - bl GetMoveType - mov r2, r0 - mov r0, sb - mov r1, sl - bl GetTypeMatchupBothTypes - cmp r0, #3 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} -_022FB18C: - add r0, r7, #1 - mov r0, r0, lsl #0x10 - mov r7, r0, asr #0x10 -_022FB198: - cmp r7, #4 - blt _022FB134 - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - arm_func_end HasSuperEffectiveMoveAgainstUser - - arm_func_start ov29_022FB1A8 -ov29_022FB1A8: ; 0x022FB1A8 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, #0 - ldr r6, [r0, #0xb4] - mov r4, r7 - mov r5, #1 - b _022FB204 -_022FB1C0: - add r0, r6, r7, lsl #3 -#ifdef JAPAN - ldrb r0, [r0, #0x120] -#else - ldrb r0, [r0, #0x124] -#endif - tst r0, #1 - movne r0, r5 - moveq r0, r4 - tst r0, #0xff - beq _022FB1F8 - add r0, r6, r7, lsl #3 - add r0, r0, #0x100 -#ifdef JAPAN - ldrh r0, [r0, #0x24] -#else - ldrh r0, [r0, #0x28] -#endif - bl IsOneHitKoMove - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} -_022FB1F8: - add r0, r7, #1 - mov r0, r0, lsl #0x10 - mov r7, r0, asr #0x10 -_022FB204: - cmp r7, #4 - blt _022FB1C0 - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - arm_func_end ov29_022FB1A8 - - arm_func_start TryEatItem -TryEatItem: ; 0x022FB214 - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x74 - mov sl, r0 - mov sb, r1 - mov r5, #0 - bl EntityIsValid__022F7364 - cmp r0, #0 - beq _022FB244 - mov r0, sb - bl EntityIsValid__022F7364 - cmp r0, #0 - bne _022FB24C -_022FB244: - mov r0, #0 - b _022FB508 -_022FB24C: - ldr r4, [sb, #0xb4] - ldrb r0, [r4, #6] - cmp r0, #0 - ldrsh r0, [r4, #0x66] - beq _022FB31C - cmp r0, #0 - beq _022FB504 - ldrsh r0, [r4, #0x66] - bl ShouldTryEatItem - cmp r0, #0 - beq _022FB504 - mov r0, sl - add r1, r4, #0x62 - bl CanMonsterUseItem - cmp r0, #0 - beq _022FB504 - mov r0, r5 - mov r1, sl - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, sb - mov r0, #1 - mov r2, r5 - bl SubstitutePlaceholderStringTags - add r1, r4, #0x62 - mov r0, #1 - bl ov29_02344B44 - ldr r2, _022FB510 ; =0x00000C24 - mov r0, sl - mov r1, sb - bl LogMessageByIdWithPopupCheckUserTarget - ldrh r2, [r4, #0x62] - mov r0, sl - add r1, r4, #0x62 - strh r2, [sp, #8] - ldrh r2, [r4, #0x64] - strh r2, [sp, #0xa] - ldrh r2, [r4, #0x66] - strh r2, [sp, #0xc] - bl ov29_0230F9A4 - add r0, r4, #0x62 - bl ItemZInit - mov r0, r5 - str sl, [sp] - add r1, sp, #8 - str r1, [sp, #4] - mov r3, sb - mov r1, r0 - mov r2, r0 - bl ApplyItemEffect - mov r5, #1 - b _022FB504 -_022FB31C: - bl ShouldTryEatItem - cmp r0, #0 - beq _022FB3D4 - mov r0, sl - add r1, r4, #0x62 - bl CanMonsterUseItem - cmp r0, #0 - beq _022FB504 - mov r0, r5 - mov r1, sl - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, sb - mov r0, #1 - mov r2, r5 - bl SubstitutePlaceholderStringTags - add r1, r4, #0x62 - mov r0, #1 - bl ov29_02344B44 - ldr r2, _022FB510 ; =0x00000C24 - mov r0, sl - mov r1, sb - bl LogMessageByIdWithPopupCheckUserTarget - ldrh r2, [r4, #0x62] - mov r0, sl - add r1, r4, #0x62 - strh r2, [sp, #8] - ldrh r2, [r4, #0x64] - strh r2, [sp, #0xa] - ldrh r2, [r4, #0x66] - strh r2, [sp, #0xc] - bl ov29_0230F9A4 - add r0, r4, #0x62 - bl RemoveEquivItem - add r0, r4, #0x62 - bl ItemZInit - mov r0, r5 - str sl, [sp] - add r1, sp, #8 - str r1, [sp, #4] - mov r3, sb - mov r1, r0 - mov r2, r0 - bl ApplyItemEffect - mov r5, #1 - b _022FB504 -_022FB3D4: - bl GetNbItemsInBag - mov r7, r0 - mov r6, r5 - add r4, sp, #0xe - b _022FB3F8 -_022FB3E8: - mov r0, r7 - bl RandInt - strb r0, [r4, r6] - add r6, r6, #1 -_022FB3F8: - cmp r6, r7 - blt _022FB3E8 - add r0, sp, #0xe - mov r1, #0 - add r0, r0, r7 - b _022FB418 -_022FB410: - strb r1, [r0, r1] - add r1, r1, #1 -_022FB418: - cmp r1, r7 - blt _022FB410 - mov r8, #0 - add r4, sp, #0xe - ldr fp, _022FB514 ; =BAG_ITEMS_PTR_MIRROR - b _022FB4FC -_022FB430: - ldrb r1, [r4, r8] - ldr r3, [fp] - mov r0, #6 - smulbb r2, r1, r0 - ldr r1, [r3, #0x384] - ldrb r0, [r1, r2] - add r6, r1, r2 - tst r0, #1 - movne r0, #1 - moveq r0, #0 - tst r0, #0xff - beq _022FB4F8 - ldrb r0, [r6, #1] - cmp r0, #0 - bne _022FB4F8 - ldrsh r0, [r6, #4] - bl ShouldTryEatItem - cmp r0, #0 - beq _022FB4F8 - mov r0, sl - mov r1, r6 - bl CanMonsterUseItem - cmp r0, #0 - beq _022FB504 - mov r0, #0 - mov r1, sl - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, sb - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - mov r1, r6 - mov r0, #1 - bl ov29_02344B44 - mov r0, sl - mov r1, sb - ldr r2, _022FB518 ; =0x00000C25 - bl LogMessageByIdWithPopupCheckUserTarget - str sl, [sp] - mov r3, sb - str r6, [sp, #4] - mov r0, #0 - mov r1, r0 - mov r2, r0 - bl ApplyItemEffect - mov r0, r6 - bl RemoveEquivItem - mov r5, #1 - b _022FB504 -_022FB4F8: - add r8, r8, #1 -_022FB4FC: - cmp r8, r7, lsl #1 - blt _022FB430 -_022FB504: - mov r0, r5 -_022FB508: - add sp, sp, #0x74 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -#ifdef JAPAN -_022FB510: .word 0x00000963 -_022FB514: .word BAG_ITEMS_PTR_MIRROR -_022FB518: .word 0x00000964 -#else -_022FB510: .word 0x00000C24 -_022FB514: .word BAG_ITEMS_PTR_MIRROR -_022FB518: .word 0x00000C25 -#endif - arm_func_end TryEatItem - - arm_func_start ov29_022FB51C -ov29_022FB51C: ; 0x022FB51C - stmdb sp!, {r3, lr} - bl GetScenarioBalance - cmp r0, #2 - movhs r0, #1 - movlo r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} - arm_func_end ov29_022FB51C - -#ifndef JAPAN - arm_func_start SetDecoyAiTracker -SetDecoyAiTracker: ; 0x022FB538 - stmdb sp!, {r4, r5, r6, r7, r8, lr} - mov r6, r0 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, r7, r8, pc} - ldr r5, [r6, #0xb4] - mov r4, #0 - ldr r7, _022FB5E8 ; =DUNGEON_PTR - strb r4, [r5, #0x10c] - ldr r0, [r7] - add r0, r0, #0x3000 - ldrb r0, [r0, #0xe38] - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, r7, r8, pc} - b _022FB5DC -_022FB574: - ldr r0, [r7] - add r0, r0, r4, lsl #2 - add r0, r0, #0x12000 - ldr r8, [r0, #0xb78] - mov r0, r8 - bl EntityIsValid__022F7364 - cmp r0, #0 - cmpne r8, r6 - beq _022FB5D8 - ldr r0, [r8, #0xb4] - ldrb r0, [r0, #0xd8] - cmp r0, #2 - bne _022FB5D8 - mov r0, r6 - mov r1, r8 - bl CanSeeTarget - cmp r0, #0 - beq _022FB5D8 - ldr r0, [r8, #0xb4] - ldrb r0, [r0, #0xd9] - cmp r0, #0 - movne r0, #2 - moveq r0, #1 - strb r0, [r5, #0x10c] - ldmia sp!, {r4, r5, r6, r7, r8, pc} -_022FB5D8: - add r4, r4, #1 -_022FB5DC: - cmp r4, #0x14 - blt _022FB574 - ldmia sp!, {r4, r5, r6, r7, r8, pc} - .align 2, 0 -_022FB5E8: .word DUNGEON_PTR - arm_func_end SetDecoyAiTracker -#endif - - arm_func_start CheckSpawnThreshold -CheckSpawnThreshold: ; 0x022FB5EC - stmdb sp!, {r4, lr} - bl GetSpawnThreshold - mov r4, r0 - bl GetScenarioBalanceVeneer - cmp r4, r0 - movls r0, #1 - movhi r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - arm_func_end CheckSpawnThreshold - - arm_func_start HasLowHealth -HasLowHealth: ; 0x022FB610 - stmdb sp!, {r4, lr} - mov r4, r0 - bl EntityIsValid__022F7364 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - ldr r0, [r4] - cmp r0, #1 - movne r0, #0 - ldmneia sp!, {r4, pc} - ldr r3, [r4, #0xb4] - ldr r0, _022FB674 ; =0x000003E7 - ldrsh r2, [r3, #0x12] - ldrsh r1, [r3, #0x16] - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r3, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movlt r0, #1 - movge r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - .align 2, 0 -_022FB674: .word 0x000003E7 - arm_func_end HasLowHealth - - arm_func_start AreEntitiesAdjacent -AreEntitiesAdjacent: ; 0x022FB678 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r0 - mov r6, r1 - mov r5, #0 - ldr r4, _022FB6E0 ; =DIRECTIONS_XY - b _022FB6D0 -_022FB690: - mov r1, r5, lsl #2 - add r0, r4, r5, lsl #2 - ldrsh r3, [r4, r1] - ldrsh ip, [r7, #4] - ldrsh r1, [r0, #2] - ldrsh r2, [r7, #6] - add r0, ip, r3 - add r1, r2, r1 - bl GetTile - ldr r0, [r0, #0xc] - cmp r0, r6 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - add r0, r5, #1 - mov r0, r0, lsl #0x10 - mov r5, r0, asr #0x10 -_022FB6D0: - cmp r5, #8 - blt _022FB690 - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_022FB6E0: .word DIRECTIONS_XY - arm_func_end AreEntitiesAdjacent - - arm_func_start ov29_022FB6E4 -ov29_022FB6E4: ; 0x022FB6E4 - stmdb sp!, {r4, lr} - mov r4, r0 - bl IsMonster__022F9720 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #0x48] - cmp r0, #0xd6 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - arm_func_end ov29_022FB6E4 - - arm_func_start ov29_022FB718 -ov29_022FB718: ; 0x022FB718 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - mov sl, r0 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - ldr sb, [sl, #0xb4] - mov r1, #0 - mov r0, sl - strh r1, [sb, #0x16] - bl Conversion2IsActive - mov r6, r0 - mov r0, sl - mov r1, #0x38 - ldr r4, [sl, #0xb4] - bl IqSkillIsEnabled - cmp r0, #0 - ldrne r0, _022FB834 ; =_020A1870 - mov r8, #0 - ldrnesh r1, [r4, #0x16] - ldrnesh r0, [r0] -#ifdef JAPAN - add r5, r4, #0x120 -#else - add r5, r4, #0x124 -#endif - mov fp, r8 - addne r0, r1, r0 - strneh r0, [r4, #0x16] - mov r4, #1 -_022FB77C: - ldrb r0, [r5, r8, lsl #3] - add r7, r5, r8, lsl #3 - tst r0, #1 - movne r0, r4 - moveq r0, fp - tst r0, #0xff - beq _022FB7C0 - ldrh r2, [r7, #2] - mov r0, sl - mov r1, #0x39 - bic r2, r2, #0x100 - strh r2, [r7, #2] - bl IqSkillIsEnabled - cmp r0, #0 - ldrneh r0, [r7, #2] - orrne r0, r0, #0x100 - strneh r0, [r7, #2] -_022FB7C0: - add r0, r8, #1 - mov r0, r0, lsl #0x10 - mov r8, r0, asr #0x10 - cmp r8, #4 - blt _022FB77C - mov r0, sl - bl ov29_02348100 - cmp r6, #2 - bne _022FB7FC - mov r0, sl - bl Conversion2IsActive - cmp r0, #0 - bne _022FB7FC - mov r0, sl - bl ov29_02307CE0 -_022FB7FC: - ldrsh r1, [sb, #0x12] - ldrsh r0, [sb, #0x16] - ldr r2, _022FB838 ; =0x000003E7 - add r1, r1, r0 - cmp r1, r2 - ldrsh r0, [sb, #0x10] - movle r2, r1 - cmp r0, r2 - ldmleia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - ldr r0, _022FB838 ; =0x000003E7 - cmp r1, r0 - movgt r1, r0 - strh r1, [sb, #0x10] - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_022FB834: .word _020A1870 -_022FB838: .word 0x000003E7 - arm_func_end ov29_022FB718 - - arm_func_start ov29_022FB83C -ov29_022FB83C: ; 0x022FB83C - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, lr} - mov sl, r0 - mov sb, r1 - bl EntityIsValid__022F7364 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} - ldr r8, [sl, #0xb4] - mov r7, #0 -#ifdef JAPAN - add r6, r8, #0x120 -#else - add r6, r8, #0x124 -#endif - mov r4, r7 - mov r5, #1 -_022FB868: - ldrb r0, [r6, r7, lsl #3] - mov r1, r7, lsl #3 - tst r0, #1 - movne r0, r5 - moveq r0, r4 - tst r0, #0xff - beq _022FB88C - add r0, r6, r1 - bl GetMoveBasePp -_022FB88C: - add r0, r7, #1 - mov r0, r0, lsl #0x10 - mov r7, r0, asr #0x10 - cmp r7, #4 - blt _022FB868 - mov r0, sl - bl ov29_022FB718 - cmp sb, #0 - ldmeqia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} - ldrsh r2, [r8, #0x12] - ldrsh r1, [r8, #0x16] - ldr r0, _022FB91C ; =0x000003E7 - mov sb, #0 - add r1, r2, r1 - cmp r1, r0 - movgt r1, r0 - strh r1, [r8, #0x10] -#ifdef JAPAN - add r6, r8, #0x120 -#else - add r6, r8, #0x124 -#endif - mov r4, sb - mov r5, #1 -_022FB8DC: - ldrb r0, [r6, sb, lsl #3] - add r7, r6, sb, lsl #3 - tst r0, #1 - movne r0, r5 - moveq r0, r4 - tst r0, #0xff - beq _022FB904 - mov r0, r7 - bl GetMaxPp - strb r0, [r7, #6] -_022FB904: - add r0, sb, #1 - mov r0, r0, lsl #0x10 - mov sb, r0, asr #0x10 - cmp sb, #4 - blt _022FB8DC - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} - .align 2, 0 -_022FB91C: .word 0x000003E7 - arm_func_end ov29_022FB83C - - arm_func_start ov29_022FB920 -ov29_022FB920: ; 0x022FB920 -#ifdef EUROPE - stmdb sp!, {r4, r5, r6, lr} - ldr r5, _022FB980 ; =DUNGEON_PTR - mov r4, r0 - mov r6, #0 -_022FC33C_EU: - ldr r0, [r5] - add r0, r0, r6, lsl #2 - add r0, r0, #0x12000 - ldr r0, [r0, #0xb28] - bl ov29_022FB718 - add r0, r6, #1 - mov r0, r0, lsl #0x10 - mov r6, r0, asr #0x10 - cmp r6, #4 - blt _022FC33C_EU - bl UpdateMapSurveyorFlag - cmp r0, #0 - cmpne r4, #0 - ldmeqia sp!, {r4, r5, r6, pc} - bl UpdateMinimap - ldmia sp!, {r4, r5, r6, pc} -#else - stmdb sp!, {r3, r4, r5, lr} - ldr r4, _022FB980 ; =DUNGEON_PTR - mov r5, #0 -_022FB92C: - ldr r0, [r4] - add r0, r0, r5, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr r0, [r0, #0xa84] -#else - ldr r0, [r0, #0xb28] -#endif - bl ov29_022FB718 - add r0, r5, #1 - mov r0, r0, lsl #0x10 - mov r5, r0, asr #0x10 - cmp r5, #4 - blt _022FB92C - mov r0, #0x41 - bl TeamMemberHasEnabledIqSkill - cmp r0, #0 - ldrne r0, _022FB980 ; =DUNGEON_PTR - movne r1, #1 - ldreq r0, _022FB980 ; =DUNGEON_PTR - moveq r1, #0 - ldr r0, [r0] - add r0, r0, #0x1a000 -#ifdef JAPAN - strb r1, [r0, #0x19d] -#else - strb r1, [r0, #0x241] -#endif - ldmia sp!, {r3, r4, r5, pc} -#endif - .align 2, 0 -_022FB980: .word DUNGEON_PTR - arm_func_end ov29_022FB920 - - arm_func_start ov29_022FB984 -ov29_022FB984: ; 0x022FB984 - mov r0, #0 - bx lr - arm_func_end ov29_022FB984 - - arm_func_start ov29_022FB98C -ov29_022FB98C: ; 0x022FB98C - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r2, #1 - ldr r0, _022FB9B8 ; =0x0000270F - mov r4, r1 - sub r3, r2, #2 - bl DisplayAnimatedNumbers - mov r0, r5 - mov r1, r4 - bl ov29_022E576C - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_022FB9B8: .word 0x0000270F - arm_func_end ov29_022FB98C - - arm_func_start ov29_022FB9BC -ov29_022FB9BC: ; 0x022FB9BC - stmdb sp!, {r3, lr} - ldr r0, [r0, #0xb4] - ldrb r0, [r0, #0xbc] - bl IsSecretBazaarNpcBehavior - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} - arm_func_end ov29_022FB9BC - - arm_func_start ov29_022FB9E0 -ov29_022FB9E0: ; 0x022FB9E0 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl IsMonster__022F9720 - cmp r0, #0 - beq _022FBA4C - ldr r1, [r5, #0xb4] - mov r0, #0 -#ifdef JAPAN - add ip, r1, #0x120 -#else - add ip, r1, #0x124 -#endif - mov r2, r0 - mov r3, #1 - b _022FBA44 -_022FBA10: - ldrb r1, [ip, r0, lsl #3] - add lr, ip, r0, lsl #3 - tst r1, #1 - movne r1, r3 - moveq r1, r2 - tst r1, #0xff - beq _022FBA38 - ldrh r1, [lr, #4] - cmp r1, r4 - ldmeqia sp!, {r3, r4, r5, pc} -_022FBA38: - add r0, r0, #1 - mov r0, r0, lsl #0x10 - mov r0, r0, asr #0x10 -_022FBA44: - cmp r0, #4 - blt _022FBA10 -_022FBA4C: - mvn r0, #0 - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_022FB9E0 - - arm_func_start ov29_022FBA54 -ov29_022FBA54: ; 0x022FBA54 - stmdb sp!, {r3, lr} - bl ov29_022FB9E0 - cmp r0, #0 - movge r0, #1 - movlt r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} - arm_func_end ov29_022FBA54 - - arm_func_start ov29_022FBA70 -ov29_022FBA70: ; 0x022FBA70 - stmdb sp!, {r4, lr} - mov r4, r0 - bl IsMonster__022F9720 - cmp r0, #0 - beq _022FBAAC - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #0x48] - cmp r0, #0xfa - moveq r0, #1 - ldmeqia sp!, {r4, pc} - cmp r0, #0xd9 - blo _022FBAAC - cmp r0, #0xe4 - movlo r0, #1 - ldmloia sp!, {r4, pc} -_022FBAAC: - mov r0, #0 - ldmia sp!, {r4, pc} - arm_func_end ov29_022FBA70 - - arm_func_start ov29_022FBAB4 -ov29_022FBAB4: ; 0x022FBAB4 - ldr r2, [r0, #0xb4] - cmp r2, #0 - addne r0, r2, #0x100 - movne r1, #0 -#ifdef JAPAN - strneh r1, [r0, #0x8e] - strne r1, [r2, #0x188] -#else - strneh r1, [r0, #0x92] - strne r1, [r2, #0x18c] -#endif - bx lr - arm_func_end ov29_022FBAB4 diff --git a/asm/overlay_29_022F9744.s b/asm/overlay_29_022F9744.s new file mode 100644 index 00000000..201c7ab7 --- /dev/null +++ b/asm/overlay_29_022F9744.s @@ -0,0 +1,3019 @@ + .include "asm/macros.inc" + .include "overlay_29_022F9744.inc" + + .text + + arm_func_start TryActivateConversion2 +TryActivateConversion2: ; 0x022F9744 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r0 + mov r6, r1 + mov r4, r2 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r6 + bl EntityIsValid__022F7364 + cmp r0, #0 + cmpne r7, r6 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + ldr r5, [r6, #0xb4] + mov r0, r6 + bl Conversion2IsActive + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r7 + mov r1, r4 + bl GetMoveTypeForMonster + bl GetConversion2ConvertToType + movs r4, r0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r6 + bl ov29_02307CE0 + mov r0, r6 + strb r4, [r5, #0x5e] + mov r1, #0 + strb r1, [r5, #0x5f] + bl ov29_022E4160 + mov r0, #0 + mov r1, r6 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, r4 + mov r0, #0 + bl ov29_0234B084 + mov r0, r7 + mov r1, r6 + ldr r2, _022F97EC ; =0x00000C16 + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +#ifdef JAPAN +_022F97EC: .word 0x00000955 +#else +_022F97EC: .word 0x00000C16 +#endif + arm_func_end TryActivateConversion2 + + arm_func_start TryActivateTruant +TryActivateTruant: ; 0x022F97F0 + stmdb sp!, {r4, lr} + sub sp, sp, #8 + mov r4, r0 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022F9838 + mov r0, r4 + mov r1, #0x2a + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _022F9838 + mov r2, #0 + str r2, [sp] + mov r0, r4 + mov r1, r4 + mov r3, #1 + str r2, [sp, #4] + bl TryInflictPausedStatus +_022F9838: + add sp, sp, #8 + ldmia sp!, {r4, pc} + arm_func_end TryActivateTruant + + arm_func_start ov29_022F9840 +ov29_022F9840: ; 0x022F9840 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, #0 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldr r0, [r5] + cmp r0, #1 + bne _022F987C + ldr r0, [r5, #0xb4] + ldrb r0, [r0, #6] + cmp r0, #0 + moveq r0, #1 + movne r0, r4 + and r4, r0, #0xff +_022F987C: + bl sub_0204AEF0 + cmp r0, #0 + moveq r4, #0 + cmp r4, #0 + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, r5 + bl ShouldDisplayEntityWrapper + cmp r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + mov r1, #1 + mov r0, r5 + mov r2, r1 + bl TryPointCameraToMonster + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_022F9840 + + arm_func_start TryPointCameraToMonster +TryPointCameraToMonster: ; 0x022F98B4 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r6, r0 + mov r5, r1 + mov r4, r2 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + ldr r0, [r6] + cmp r0, #1 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + ldr r0, _022F9968 ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, #0x1a000 +#ifdef JAPAN + ldr r0, [r0, #0x188] +#else + ldr r0, [r0, #0x22c] +#endif + cmp r0, r6 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + cmp r5, #0 + beq _022F9928 + mov r0, #1 + bl AnimationDelayOrSomething + mov r7, #0x34 + ldr r5, _022F9968 ; =DUNGEON_PTR + b _022F9918 +_022F9910: + mov r0, r7 + bl AdvanceFrame +_022F9918: + ldr r0, [r5] + ldrsh r0, [r0, #0x1c] + cmp r0, #0x3c + blt _022F9910 +_022F9928: + mov r0, #4 + mov r1, #0x44 + bl ov29_022EA370 + mov r0, r6 + mov r1, r4 + bl PointCameraToMonster + cmp r4, #0 + beq _022F9950 + add r0, r6, #4 + bl DiscoverMinimap +_022F9950: + ldr r0, _022F9968 ; =DUNGEON_PTR + mov r1, #0 + ldr r0, [r0] + strh r1, [r0, #0x1c] + bl ov29_022E81F8 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_022F9968: .word DUNGEON_PTR + arm_func_end TryPointCameraToMonster + + arm_func_start ov29_022F996C +ov29_022F996C: ; 0x022F996C + bx lr + arm_func_end ov29_022F996C + + arm_func_start ReevaluateSnatchMonster +ReevaluateSnatchMonster: ; 0x022F9970 +#ifdef JAPAN +#define OV29_022F9970_OFFSET -0xA4 +#else +#define OV29_022F9970_OFFSET 0 +#endif + stmdb sp!, {r4, r5, r6, lr} + mov r4, #0 + ldr r6, _022F99E8 ; =DUNGEON_PTR + b _022F99DC +_022F9980: + ldr r0, [r6] + add r0, r0, r4, lsl #2 + add r0, r0, #0x12000 + ldr r5, [r0, #0xb78 + OV29_022F9970_OFFSET] + mov r0, r5 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022F99D8 + ldr r0, [r5, #0xb4] + ldrb r0, [r0, #0xd8] + cmp r0, #3 + bne _022F99D8 + ldr r1, _022F99E8 ; =DUNGEON_PTR + ldr r0, [r1] + add r0, r0, #0x19000 + str r5, [r0, #0x904 + OV29_022F9970_OFFSET] + ldr r2, [r5, #0xb4] + ldr r0, [r1] + ldr r1, [r2, #0xb0] + add r0, r0, #0x19000 + str r1, [r0, #0x90c + OV29_022F9970_OFFSET] + ldmia sp!, {r4, r5, r6, pc} +_022F99D8: + add r4, r4, #1 +_022F99DC: + cmp r4, #0x14 + blt _022F9980 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_022F99E8: .word DUNGEON_PTR + arm_func_end ReevaluateSnatchMonster + + arm_func_start GetRandomExplorerMazeMonster +GetRandomExplorerMazeMonster: ; 0x022F99EC + stmdb sp!, {r4, r5, r6, r7, r8, lr} + sub sp, sp, #0x40 + mov r4, #0 + ldr r6, _022F9A70 ; =DUNGEON_PTR + mov r5, r4 + add r7, sp, #0 +_022F9A04: + ldr r0, [r6] + add r0, r0, r5, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr r8, [r0, #0xa94] +#else + ldr r8, [r0, #0xb38] +#endif + mov r0, r8 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022F9A40 + ldr r0, [r8, #0xb4] + ldrb r0, [r0, #0xbc] + cmp r0, #0xb + blo _022F9A40 + cmp r0, #0xe + strls r8, [r7, r4, lsl #2] + addls r4, r4, #1 +_022F9A40: + add r5, r5, #1 + cmp r5, #0x10 + blt _022F9A04 + cmp r4, #0 + movle r0, #0 + ble _022F9A68 + mov r0, r4 + bl DungeonRandInt + add r1, sp, #0 + ldr r0, [r1, r0, lsl #2] +_022F9A68: + add sp, sp, #0x40 + ldmia sp!, {r4, r5, r6, r7, r8, pc} + .align 2, 0 +_022F9A70: .word DUNGEON_PTR + arm_func_end GetRandomExplorerMazeMonster + + arm_func_start RestorePpAllMovesSetFlags +RestorePpAllMovesSetFlags: ; 0x022F9A74 + stmdb sp!, {r4, r5, r6, r7, r8, lr} + ldr r0, [r0, #0xb4] + mov r7, #0 +#ifdef JAPAN + add r6, r0, #0x120 +#else + add r6, r0, #0x124 +#endif + mov r4, r7 + mov r5, #1 +_022F9A8C: + ldrb r0, [r6, r7, lsl #3] + add r8, r6, r7, lsl #3 + tst r0, #1 + movne r0, r5 + moveq r0, r4 + tst r0, #0xff + beq _022F9AE4 + ldrh r1, [r8, #2] + mov r0, r8 + bic r1, r1, #8 + strh r1, [r8, #2] + ldrh r1, [r8, #2] + bic r1, r1, #0x10 + strh r1, [r8, #2] + ldrh r1, [r8, #2] + bic r1, r1, #0x40 + strh r1, [r8, #2] + ldrh r1, [r8, #2] + orr r1, r1, #4 + strh r1, [r8, #2] + bl GetMaxPpWrapper + strb r0, [r8, #6] +_022F9AE4: + add r7, r7, #1 + cmp r7, #4 + blt _022F9A8C + ldmia sp!, {r4, r5, r6, r7, r8, pc} + arm_func_end RestorePpAllMovesSetFlags + + arm_func_start ov29_022F9AF4 +ov29_022F9AF4: ; 0x022F9AF4 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + mov sb, r0 + ldr r1, [sb, #0xb4] + mov r5, #0 + ldrb r8, [r1, #6] + bl ov29_022F87C0 + cmp r0, #0 + moveq r0, r5 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mvn r7, #0 + mov r4, r7 +_022F9B20: + mov r6, r4 +_022F9B24: + ldrsh r0, [sb, #4] + ldrsh r1, [sb, #6] + add r0, r0, r6 + add r1, r1, r7 + bl GetTileSafe + ldr r1, [r0, #0xc] + cmp r1, #0 + beq _022F9B60 + ldr r0, [r1] + cmp r0, #1 + bne _022F9B60 + ldr r0, [r1, #0xb4] + ldrb r0, [r0, #6] + cmp r8, r0 + addne r5, r5, #1 +_022F9B60: + add r6, r6, #1 + cmp r6, #1 + ble _022F9B24 + add r7, r7, #1 + cmp r7, #1 + ble _022F9B20 + cmp r5, #2 + movge r0, #1 + movlt r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + arm_func_end ov29_022F9AF4 + + arm_func_start ov29_022F9B8C +ov29_022F9B8C: ; 0x022F9B8C + stmdb sp!, {r3, r4, lr} + sub sp, sp, #0x4c + mov r2, #0 + mov r1, #1 + mov r4, r0 + strb r2, [sp, #4] + strb r1, [sp, #5] + str r2, [sp] + ldrsh r1, [r4, #2] + add r0, sp, #8 + add r3, sp, #4 + bl sub_02052E2C + ldrsh r0, [r4, #2] + mov r1, #0 + mov r2, #6 + strh r0, [sp, #0xc] + ldrb r0, [r4, #0xa] + strb r0, [sp, #9] + ldrsh r0, [r4, #0xe] + strh r0, [sp, #0x10] + ldrb r0, [r4, #0x1a] + strb r0, [sp, #0x14] + ldrb r0, [r4, #0x1c] + strb r0, [sp, #0x16] + ldrb r0, [r4, #0x48] + strb r0, [sp, #0xa] + ldrb r0, [r4, #0x49] + strb r0, [sp, #0xb] + add r0, sp, #8 +_022F9C00: + mla lr, r1, r2, r0 + add r3, r4, r1, lsl #3 +#ifdef JAPAN + ldrb ip, [r3, #0x120] +#else + ldrb ip, [r3, #0x124] +#endif + add r3, r3, #0x100 + add r1, r1, #1 + strb ip, [lr, #0x22] +#ifdef JAPAN + ldrh r3, [r3, #0x24] +#else + ldrh r3, [r3, #0x28] +#endif + cmp r1, #4 + strh r3, [lr, #0x24] + blt _022F9C00 + bl GetMonsterEvoStatus + add sp, sp, #0x4c + ldmia sp!, {r3, r4, pc} + arm_func_end ov29_022F9B8C + + arm_func_start ov29_022F9C34 +ov29_022F9C34: ; 0x022F9C34 + ldr ip, _022F9C3C ; =sub_02056228 + bx ip + .align 2, 0 +_022F9C3C: .word sub_02056228 + arm_func_end ov29_022F9C34 + + arm_func_start CheckTeamMemberIdxVeneer +CheckTeamMemberIdxVeneer: ; 0x022F9C40 + ldr ip, _022F9C48 ; =CheckTeamMemberIdx + bx ip + .align 2, 0 +_022F9C48: .word CheckTeamMemberIdx + arm_func_end CheckTeamMemberIdxVeneer + + arm_func_start ov29_022F9C4C +ov29_022F9C4C: ; 0x022F9C4C + stmdb sp!, {r3, lr} + ldr r0, [r0, #0xb4] + ldrsh r0, [r0, #0xc] + bl GetActiveTeamMember + ldrsh r0, [r0, #8] + bl CheckTeamMemberIdx + ldmia sp!, {r3, pc} + arm_func_end ov29_022F9C4C + + arm_func_start IsMonsterIdInNormalRangeVeneer +IsMonsterIdInNormalRangeVeneer: ; 0x022F9C68 + ldr ip, _022F9C70 ; =IsMonsterIdInNormalRange + bx ip + .align 2, 0 +_022F9C70: .word IsMonsterIdInNormalRange + arm_func_end IsMonsterIdInNormalRangeVeneer + + arm_func_start ov29_022F9C74 +ov29_022F9C74: ; 0x022F9C74 +#ifdef JAPAN +#define OV29_022F9C74_OFFSET -4 +#else +#define OV29_022F9C74_OFFSET 0 +#endif + stmdb sp!, {r3, r4, r5, r6, lr} + sub sp, sp, #0xc + mov r6, r0 + bl EntityIsValid__022F7364 +#ifndef JAPAN + cmp r0, #0 + beq _022F9E80 + ldr r5, [r6, #0xb4] + ldrb r0, [r5, #0x103] +#endif + cmp r0, #0 + beq _022F9E78 + mov r0, r6 + bl GetTileAtEntity + ldrh r0, [r0] + and r0, r0, #3 + cmp r0, #2 + bne _022F9D50 + ldr r0, _022F9E88 ; =DUNGEON_PTR + ldr r1, _022F9E8C ; =SECONDARY_TERRAIN_TYPES + ldr r0, [r0] +#ifdef JAPAN + ldr r4, [r6, #0xb4] + add r0, r0, #0x4000 + ldrsh r0, [r0, #0x30] +#else + add r0, r0, #0x4000 + ldrsh r0, [r0, #0xd4] +#endif + ldrb r0, [r1, r0] + cmp r0, #1 + bne _022F9D34 +#ifdef JAPAN + ldrb r0, [r4, #0xc4] +#else + ldrb r0, [r5, #0xc4] +#endif + cmp r0, #1 + bne _022F9CF0 + mov r0, r6 + mov r1, r6 + mov r2, #1 + bl EndFrozenClassStatus +_022F9CF0: +#ifdef JAPAN + ldrsh r0, [r4, #2] + bl GetMobilityType + cmp r0, #4 + ldrnesh r1, [r4, #2] +#else + ldrsh r0, [r5, #2] + bl GetMobilityType + cmp r0, #4 + ldrnesh r1, [r5, #2] +#endif + ldrne r0, _022F9E90 ; =0x00000115 + cmpne r1, r0 + cmpne r1, #0x92 +#ifdef JAPAN + ldrneb r0, [r4, #0xbf] +#else + ldrneb r0, [r5, #0xbf] +#endif + cmpne r0, #1 + beq _022F9E78 + mov r3, #0 + mov r0, r6 + mov r1, r6 + mov r2, #1 + str r3, [sp] + bl TryInflictBurnStatus + b _022F9E78 +_022F9D34: +#ifdef JAPAN + ldrb r0, [r4, #0xbf] +#else + ldrb r0, [r5, #0xbf] +#endif + cmp r0, #1 + bne _022F9E78 + mov r0, r6 + mov r1, r6 + bl EndBurnClassStatus + b _022F9E78 +_022F9D50: + cmp r0, #0 + bne _022F9E78 +#ifdef JAPAN + ldr r5, [r6, #0xb4] +#endif + ldrb r0, [r5, #7] + cmp r0, #0 + beq _022F9E78 + add r0, r5, #0x100 + ldrh r1, [r0, #0x48 + OV29_022F9C74_OFFSET] + ldrh r4, [r0, #0x46 + OV29_022F9C74_OFFSET] + sub r3, sp, #4 + strh r1, [sp, #0xa] + mov r0, r1 + strh r4, [r3] + strh r0, [r3, #2] + ldr r1, _022F9E94 ; =BELLY_DRAIN_IN_WALLS_INT + ldr r0, [r3] + ldrh r2, [r1] + strh r4, [sp, #8] + strh r2, [r3] + ldrh r1, [r1, #2] + strh r1, [r3, #2] + ldr r1, [r3] + bl SubFixedPoint + strh r0, [sp, #4] + mov r0, r0, lsr #0x10 + strh r0, [sp, #6] + ldrh r1, [sp, #4] + add r0, r5, #0x100 + ldrh r3, [sp, #6] + strh r1, [r0, #0x46 + OV29_022F9C74_OFFSET] + ldrh r2, [sp, #8] + strh r3, [r0, #0x48 + OV29_022F9C74_OFFSET] + sub r0, sp, #4 + ldrh r1, [sp, #0xa] + strh r2, [r0] + mov r4, #0 + strh r1, [r0, #2] + ldr r0, [r0] + bl CeilFixedPoint + cmp r0, #0x14 + blt _022F9E18 + add r0, r5, #0x100 + ldrh r1, [r0, #0x46 + OV29_022F9C74_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + OV29_022F9C74_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0x14 + ldrlt r4, _022F9E98 ; =0x00000C1A +_022F9E18: + ldrh r1, [sp, #8] + ldrh r0, [sp, #0xa] + sub r2, sp, #4 + strh r1, [r2] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0xa + blt _022F9E64 + add r0, r5, #0x100 + ldrh r1, [r0, #0x46 + OV29_022F9C74_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + OV29_022F9C74_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0xa + ldrlt r4, _022F9E9C ; =0x00000C1B +_022F9E64: + cmp r4, #0 + beq _022F9E78 + mov r0, r6 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUser +_022F9E78: +#ifndef JAPAN + mov r0, #0 + strb r0, [r5, #0x103] +_022F9E80: +#endif + add sp, sp, #0xc + ldmia sp!, {r3, r4, r5, r6, pc} + .align 2, 0 +_022F9E88: .word DUNGEON_PTR +_022F9E8C: .word SECONDARY_TERRAIN_TYPES +_022F9E90: .word 0x00000115 +_022F9E94: .word BELLY_DRAIN_IN_WALLS_INT +#ifdef JAPAN +_022F9E98: .word 0x00000959 +_022F9E9C: .word 0x0000095A +#else +_022F9E98: .word 0x00000C1A +_022F9E9C: .word 0x00000C1B +#endif + arm_func_end ov29_022F9C74 + + arm_func_start ov29_022F9EA0 +ov29_022F9EA0: ; 0x022F9EA0 +#ifdef JAPAN +#define OV29_022F9EA0_OFFSET -4 +#else +#define OV29_022F9EA0_OFFSET 0 +#endif + stmdb sp!, {r4, r5, lr} + sub sp, sp, #0xc + mov r5, r0 + mov r1, #0x6f + ldr r4, [r5, #0xb4] + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _022F9FEC + ldrb r0, [r4, #7] + cmp r0, #0 + bne _022F9FBC + mov r0, r5 + mov r1, #0x11 + bl HasHeldItem + cmp r0, #0 + bne _022F9EF4 + mov r0, r5 + mov r1, #0x32 + bl HasHeldItem + cmp r0, #0 + beq _022F9F60 +_022F9EF4: + mov r0, #0xa + bl sub_02050FF8 + add r1, r4, #0x100 + ldrh r2, [r1, #0x46 + OV29_022F9EA0_OFFSET] + sub r3, sp, #4 + strh r0, [sp, #8] + strh r2, [r3] + ldrh r1, [r1, #0x48 + OV29_022F9EA0_OFFSET] + mov r0, r0, lsr #0x10 + strh r0, [sp, #0xa] + strh r1, [r3, #2] + ldrh r2, [sp, #8] + ldr r0, [r3] + ldrh r1, [sp, #0xa] + strh r2, [r3] + strh r1, [r3, #2] + ldr r1, [r3] + bl SubFixedPoint + strh r0, [sp, #4] + mov r0, r0, lsr #0x10 + strh r0, [sp, #6] + ldrh r2, [sp, #4] + add r0, r4, #0x100 + ldrh r1, [sp, #6] + strh r2, [r0, #0x46 + OV29_022F9EA0_OFFSET] + strh r1, [r0, #0x48 + OV29_022F9EA0_OFFSET] + b _022F9F9C +_022F9F60: + mov r0, r5 + mov r1, #0x22 + bl HasHeldItem + cmp r0, #0 + beq _022F9F9C + mov r0, #0 + bl sub_02050FF8 + strh r0, [sp] + mov r0, r0, lsr #0x10 + strh r0, [sp, #2] + ldrh r2, [sp] + add r0, r4, #0x100 + ldrh r1, [sp, #2] + strh r2, [r0, #0x46 + OV29_022F9EA0_OFFSET] + strh r1, [r0, #0x48 + OV29_022F9EA0_OFFSET] +_022F9F9C: + ldr r0, _022FA028 ; =DUNGEON_PTR + ldr r0, [r0] + ldrb r0, [r0, #0x78d] + cmp r0, #0 + beq _022F9FEC + mov r0, r5 + bl UpdateStatusIconFlags + b _022F9FEC +_022F9FBC: + ldrsh r1, [r4, #0x66] + ldrsh r0, [r4, #0x68] + cmp r0, r1 + beq _022F9FEC + cmp r1, #0x18 + cmpne r0, #0x18 + cmpne r1, #0xe + cmpne r0, #0xe + bne _022F9FEC + mov r0, #1 + bl UpdateCamera + bl UpdateMinimap +_022F9FEC: + ldrsh r1, [r4, #0x68] + ldrsh r0, [r4, #0x66] + cmp r1, r0 + beq _022FA000 + bl ov29_02307DD0 +_022FA000: + ldrb r0, [r4, #0x62] + tst r0, #1 + movne r0, #1 + moveq r0, #0 + tst r0, #0xff + ldrnesh r0, [r4, #0x66] + moveq r0, #0 + strh r0, [r4, #0x68] + add sp, sp, #0xc + ldmia sp!, {r4, r5, pc} + .align 2, 0 +_022FA028: .word DUNGEON_PTR + arm_func_end ov29_022F9EA0 + + arm_func_start ov29_022FA02C +ov29_022FA02C: ; 0x022FA02C + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x90 + mov sl, r0 + mov r3, r1 + ldrsh r1, [sl, #2] + mov sb, r2 + add r0, sp, #4 + mov r2, r3 + bl GetLearnableIqSkills + mov r6, r0 + ldrsh r1, [sl, #2] + ldrsh r2, [sl, #0xe] + add r0, sp, #0x49 + bl GetLearnableIqSkills + mov r7, r0 + bl ov29_0234B034 + mov r1, #0 + mov r2, sl + mov r3, r1 + str r1, [sp] + bl ov29_0230040C + mov r8, #1 + add r5, sp, #4 + mov r4, r8 + mov fp, #0 +_022FA090: + mov r1, #0 + mov r2, r1 + mov r3, r1 + b _022FA0B4 +_022FA0A0: + ldrb r0, [r5, r3] + cmp r0, r8 + moveq r1, r4 + beq _022FA0BC + add r3, r3, #1 +_022FA0B4: + cmp r3, r6 + blt _022FA0A0 +_022FA0BC: + mov r3, fp + b _022FA0DC +_022FA0C4: + add r0, r5, r3 + ldrb r0, [r0, #0x45] + cmp r8, r0 + moveq r2, #1 + beq _022FA0E4 + add r3, r3, #1 +_022FA0DC: + cmp r3, r7 + blt _022FA0C4 +_022FA0E4: + cmp r1, r2 + beq _022FA12C + add r0, sl, #0x90 + and r1, r8, #0xff + bl EnableIqSkill + add r0, sl, #0x9c + and r1, r8, #0xff + bl EnableIqSkill + cmp sb, #0 + bne _022FA12C + mov r0, #4 + bl sub_02017C50 + mov r0, #0 + and r1, r8, #0xff + bl ov29_0234B084 + ldr r1, _022FA140 ; =0x00000C1C + mov r0, #0 + bl LogMessageByIdWithPopup +_022FA12C: + add r8, r8, #1 + cmp r8, #0x45 + blt _022FA090 + add sp, sp, #0x90 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +#ifdef JAPAN +_022FA140: .word 0x0000095B +#else +_022FA140: .word 0x00000C1C +#endif + arm_func_end ov29_022FA02C + + arm_func_start BoostIQ +BoostIQ: ; 0x022FA144 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r0 + ldr r5, [r7, #0xb4] + ldr r0, _022FA1CC ; =0x000003E7 + ldrsh r4, [r5, #0xe] + mov r6, r2 + add r1, r4, r1 + strh r1, [r5, #0xe] + ldrsh r1, [r5, #0xe] + cmp r1, r0 + strgth r0, [r5, #0xe] + cmp r6, #0 + bne _022FA1B0 + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrsh r0, [r5, #0xe] + cmp r4, r0 + bne _022FA1A4 + ldr r1, _022FA1D0 ; =0x00000C27 + mov r0, r7 + bl LogMessageByIdWithPopupCheckUser + b _022FA1B0 +_022FA1A4: + ldr r1, _022FA1D4 ; =0x00000C26 + mov r0, r7 + bl LogMessageByIdWithPopupCheckUser +_022FA1B0: + mov r0, r5 + mov r1, r4 + mov r2, r6 + bl ov29_022FA02C + mov r0, r7 + bl ov29_023021F0 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_022FA1CC: .word 0x000003E7 +#ifdef JAPAN +_022FA1D0: .word 0x00000966 +_022FA1D4: .word 0x00000965 +#else +_022FA1D0: .word 0x00000C27 +_022FA1D4: .word 0x00000C26 +#endif + arm_func_end BoostIQ + + arm_func_start ov29_022FA1D8 +ov29_022FA1D8: ; 0x022FA1D8 +#ifdef JAPAN +#define OV29_022FA1D8_OFFSET -4 +#else +#define OV29_022FA1D8_OFFSET 0 +#endif + stmdb sp!, {r4, r5, r6, lr} + mov r6, r0 + ldr r4, [r6, #0xb4] + mov r5, r1 + ldrb r1, [r4, #7] + cmp r1, #0 + beq _022FA210 + ldrsh r1, [r6, #4] + add r0, r4, #0x100 + strh r1, [r0, #0x7e + OV29_022FA1D8_OFFSET] + ldrsh r1, [r6, #6] + add r1, r1, #1 + strh r1, [r0, #0x80 + OV29_022FA1D8_OFFSET] + b _022FA27C +_022FA210: + ldrb r1, [r4, #0x16a + OV29_022FA1D8_OFFSET] + cmp r1, #0xff + beq _022FA274 + ldrsh r1, [r4, #2] + add r0, r4, #0x4a + bl SetActionPassTurnOrWalk + ldrb r2, [r4, #0x16a + OV29_022FA1D8_OFFSET] + ldr r1, _022FA2E8 ; =DIRECTIONS_XY + add r0, r4, #0x100 + strb r2, [r4, #0x4c] + mov r2, r2, lsl #2 + ldrsh r3, [r1, r2] + ldrsh ip, [r6, #4] + ldr r2, _022FA2EC ; =ov29_0235171E + mov r1, #0xff + add r3, ip, r3 + strh r3, [r0, #0x7e + OV29_022FA1D8_OFFSET] + ldrb r3, [r4, #0x4c] + ldrsh ip, [r6, #6] + mov r3, r3, lsl #2 + ldrsh r2, [r2, r3] + add r2, ip, r2 + strh r2, [r0, #0x80 + OV29_022FA1D8_OFFSET] + strb r1, [r4, #0x16a + OV29_022FA1D8_OFFSET] + b _022FA27C +_022FA274: + mov r1, r2 + bl AiMovement +_022FA27C: + add r0, r4, #0x100 + ldrsh r1, [r0, #0x7e + OV29_022FA1D8_OFFSET] + cmp r1, #0 + ldreqsh r0, [r0, #0x80 + OV29_022FA1D8_OFFSET] + cmpeq r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, r6 + mov r1, #1 + bl CheckVariousStatuses2 + cmp r0, #0 + beq _022FA2B8 + mov r0, r6 + bl CheckVariousStatuses + cmp r0, #0 + ldmneia sp!, {r4, r5, r6, pc} +_022FA2B8: + add r1, r4, #0x7e + OV29_022FA1D8_OFFSET + add r0, r6, #4 + add r1, r1, #0x100 + bl GetDirectionTowardsPosition + mov r1, r0 + and r0, r1, #7 + strb r0, [r4, #0x4c] + cmp r5, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, r6 + bl ov29_02304A48 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_022FA2E8: .word DIRECTIONS_XY +_022FA2EC: .word ov29_0235171E + arm_func_end ov29_022FA1D8 + + arm_func_start ov29_022FA2F0 +ov29_022FA2F0: ; 0x022FA2F0 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + ldr sb, _022FA35C ; =DUNGEON_PTR + mov r8, r0 + mov r7, r1 + mov r6, r2 + mov r5, #0 +_022FA308: + ldr r0, [sb] + add r0, r0, r5, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr r4, [r0, #0xad4] +#else + ldr r4, [r0, #0xb78] +#endif + mov r0, r4 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FA34C + cmp r7, #0 + ldrne r0, [r4, #0xb4] + ldrneb r0, [r0, #0xbc] + cmpne r0, #7 + bne _022FA34C + mov r0, r4 + mov r1, r8 + mov r2, r6 + bl ov29_022FA1D8 +_022FA34C: + add r5, r5, #1 + cmp r5, #0x14 + blt _022FA308 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + .align 2, 0 +_022FA35C: .word DUNGEON_PTR + arm_func_end ov29_022FA2F0 + + arm_func_start ov29_022FA360 +ov29_022FA360: ; 0x022FA360 + stmdb sp!, {r4, r5, r6, lr} + mov r6, r0 + mov r5, r1 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + ldr r4, [r6, #0xb4] + and r1, r5, #7 + mov r0, r6 + strb r1, [r4, #0x4c] + bl GetIdleAnimationId + mov r1, r0 + ldrb r2, [r4, #0x4c] + mov r0, r6 + bl ChangeMonsterAnimation + ldmia sp!, {r4, r5, r6, pc} + arm_func_end ov29_022FA360 + + arm_func_start ov29_022FA3A0 +ov29_022FA3A0: ; 0x022FA3A0 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + mov r1, r4 + add r0, r5, #4 + bl GetDirectionTowardsPosition + and r1, r0, #0xff + mov r0, r5 + bl ov29_022FA360 + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_022FA3A0 + + arm_func_start ov29_022FA3D4 +ov29_022FA3D4: ; 0x022FA3D4 + stmdb sp!, {r4, r5, r6, lr} + ldr r1, _022FA414 ; =DUNGEON_PTR + mov r4, r0 + ldr r0, [r1] + mov r6, #0 +#ifdef JAPAN + add r0, r0, #0x284 +#else + add r0, r0, #0x328 +#endif + add r5, r0, #0x12800 +_022FA3F0: + ldr r0, [r5, r6, lsl #2] + mov r1, r4 + bl ov29_022FA3A0 + add r0, r6, #1 + mov r0, r0, lsl #0x10 + mov r6, r0, asr #0x10 + cmp r6, #4 + blt _022FA3F0 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_022FA414: .word DUNGEON_PTR + arm_func_end ov29_022FA3D4 + + arm_func_start ov29_022FA418 +ov29_022FA418: ; 0x022FA418 + stmdb sp!, {r3, lr} + bl IsFullFloorFixedRoom + cmp r0, #0 + ldmeqia sp!, {r3, pc} + bl ov29_022EF938 + ldmia sp!, {r3, pc} + arm_func_end ov29_022FA418 + + arm_func_start ShouldMonsterHeadToStairs +ShouldMonsterHeadToStairs: ; 0x022FA430 + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, lr} + mov sl, r0 + bl GetStairsRoom + mov r5, r0 + ldrsh r0, [sl, #4] + ldrsh r1, [sl, #6] + bl GetTile + ldrb r0, [r0, #7] + cmp r5, r0 + bne _022FA514 + ldr r1, _022FA51C ; =DUNGEON_PTR + add r0, sl, #4 + ldr r1, [r1] +#ifdef JAPAN + add r1, r1, #0xc40 + add r1, r1, #0xc000 +#else + add r1, r1, #0xe4 + add r1, r1, #0xcc00 +#endif + bl GetChebyshevDistance + ldr r7, _022FA520 ; =0x00002710 + ldr r4, _022FA51C ; =DUNGEON_PTR + mov r6, r0 + mov r8, #0 +_022FA480: + ldr r0, [r4] + add r0, r0, r8, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr sb, [r0, #0xad4] +#else + ldr sb, [r0, #0xb78] +#endif + mov r0, sb + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FA4E8 + mov r0, sl + mov r1, sb + bl ov29_023018AC + cmp r0, #1 + bne _022FA4E8 + ldrsh r0, [sb, #4] + ldrsh r1, [sb, #6] + bl GetTile + ldrb r0, [r0, #7] + cmp r5, r0 + bne _022FA4E8 + ldr r1, [r4] + add r0, sb, #4 +#ifdef JAPAN + add r1, r1, #0xc40 + add r1, r1, #0xc000 +#else + add r1, r1, #0xe4 + add r1, r1, #0xcc00 +#endif + bl GetChebyshevDistance + cmp r0, r7 + movlt r7, r0 +_022FA4E8: + add r8, r8, #1 + cmp r8, #0x14 + blt _022FA480 + ldr r0, _022FA520 ; =0x00002710 + cmp r7, r0 + beq _022FA50C + beq _022FA514 + cmp r7, r6 + ble _022FA514 +_022FA50C: + mov r0, #1 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} +_022FA514: + mov r0, #0 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} + .align 2, 0 +_022FA51C: .word DUNGEON_PTR +_022FA520: .word 0x00002710 + arm_func_end ShouldMonsterHeadToStairs + + arm_func_start ov29_022FA524 +ov29_022FA524: ; 0x022FA524 + stmdb sp!, {r4, r5, r6, lr} + ldr r4, _022FA570 ; =DUNGEON_PTR + mov r5, #0 +_022FA530: + ldr r0, [r4] + add r0, r0, r5, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr r6, [r0, #0xad4] +#else + ldr r6, [r0, #0xb78] +#endif + mov r0, r6 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FA560 + ldr r1, [r6, #0xb4] + mov r0, r6 + ldrb r1, [r1, #0x4c] + bl ov29_02304A48 +_022FA560: + add r5, r5, #1 + cmp r5, #0x14 + blt _022FA530 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_022FA570: .word DUNGEON_PTR + arm_func_end ov29_022FA524 + + arm_func_start ov29_022FA574 +ov29_022FA574: ; 0x022FA574 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldr r0, [r5, #0xb4] + mov r1, r4 +#ifdef JAPAN + add r0, r0, #0x120 +#else + add r0, r0, #0x124 +#endif + bl sub_0201405C + cmp r0, #0 + bne _022FA5B4 + ldr r1, _022FA5E4 ; =0x00000C1D + mov r0, r5 + bl LogMessageByIdWithPopupCheckUser + ldmia sp!, {r3, r4, r5, pc} +_022FA5B4: + cmp r0, #1 + bne _022FA5CC + ldr r1, _022FA5E8 ; =0x00000C1E + mov r0, r5 + bl LogMessageByIdWithPopupCheckUser + ldmia sp!, {r3, r4, r5, pc} +_022FA5CC: + cmp r0, #2 + ldmneia sp!, {r3, r4, r5, pc} + ldr r1, _022FA5EC ; =0x00000C1F + mov r0, r5 + bl LogMessageByIdWithPopupCheckUser + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +#ifdef JAPAN +_022FA5E4: .word 0x0000095C +_022FA5E8: .word 0x0000095D +_022FA5EC: .word 0x0000095E +#else +_022FA5E4: .word 0x00000C1D +_022FA5E8: .word 0x00000C1E +_022FA5EC: .word 0x00000C1F +#endif + arm_func_end ov29_022FA574 + + arm_func_start MewSpawnCheck +MewSpawnCheck: ; 0x022FA5F0 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl CanMonsterSpawn + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r5, #0x97 + bne _022FA63C + ldr r0, _022FA644 ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, #0x3000 +#ifdef JAPAN + ldrb r0, [r0, #0xd95] +#else + ldrb r0, [r0, #0xe39] +#endif + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + cmp r4, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} +_022FA63C: + mov r0, #1 + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_022FA644: .word DUNGEON_PTR + arm_func_end MewSpawnCheck + + arm_func_start ov29_022FA648 +ov29_022FA648: ; 0x022FA648 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + mov r7, #0 + mov r6, #1 + mov fp, r6 + mov r5, r7 +_022FA65C: + ldr r0, _022FA74C ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, r7, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr r8, [r0, #0xa84] +#else + ldr r8, [r0, #0xb28] +#endif + mov r0, r8 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FA730 + ldr sl, [r8, #0xb4] + ldrb r1, [sl, #7] + ldrsh r0, [sl, #0xc] + cmp r1, #0 + beq _022FA6C4 +#ifdef JAPAN + strb r6, [sl, #0x161] +#else + strb r6, [sl, #0x165] +#endif + bl ov29_022E8104 + bl ov29_022E81F8 + bl ov29_022E0A04 + cmp r0, #1 + mov r0, r8 + bne _022FA6B8 + bl ov29_022E68D8 + b _022FA6BC +_022FA6B8: + bl ov29_022E68BC +_022FA6BC: + strb r5, [r8, #0x20] + b _022FA730 +_022FA6C4: + cmp r0, #0 + blt _022FA730 + mov sb, #0 + bl GetActiveTeamMember + mov r4, r0 + bl ov29_022E0A04 + cmp r0, #0 + movne sb, #1 + bne _022FA70C + ldrsh r0, [r4, #8] + bl CheckTeamMemberIdx + cmp r0, #0 + movne sb, #1 + bne _022FA70C + ldrsh r0, [r4, #8] + bl IsMonsterIdInNormalRange + cmp r0, #0 + movne sb, #1 +_022FA70C: + cmp sb, #0 + beq _022FA730 +#ifdef JAPAN + strb fp, [sl, #0x161] +#else + strb fp, [sl, #0x165] +#endif + bl ov29_022E8104 + bl ov29_022E81F8 + mov r0, r8 + bl ov29_022E68BC + mov r0, #0 + strb r0, [r8, #0x20] +_022FA730: + add r7, r7, #1 + cmp r7, #4 + blt _022FA65C + mov r0, #0x1e + mov r1, #0x4a + bl ov29_022EA370 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_022FA74C: .word DUNGEON_PTR + arm_func_end ov29_022FA648 + + arm_func_start ov29_022FA750 +ov29_022FA750: ; 0x022FA750 + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, lr} + mov r6, #0 + ldr r4, _022FA7D8 ; =DUNGEON_PTR + mov r5, r6 +_022FA760: + ldr r0, [r4] + add r0, r0, r6, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr r8, [r0, #0xad4] +#else + ldr r8, [r0, #0xb78] +#endif + mov r0, r8 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FA7C8 + ldr sb, [r8, #0xb4] + mov r7, r5 +_022FA788: + ldr r0, [r4] + add r0, r0, r7, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr sl, [r0, #0xad4] +#else + ldr sl, [r0, #0xb78] +#endif + mov r0, sl + bl EntityIsValid__022F7364 + cmp r0, #0 + cmpne r8, sl + beq _022FA7BC + ldrh r1, [sb, #0x80] + ldrh r0, [sl, #0x26] + cmp r1, r0 + streq sl, [sb, #0x84] +_022FA7BC: + add r7, r7, #1 + cmp r7, #0x14 + blt _022FA788 +_022FA7C8: + add r6, r6, #1 + cmp r6, #0x14 + blt _022FA760 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} + .align 2, 0 +_022FA7D8: .word DUNGEON_PTR + arm_func_end ov29_022FA750 + + arm_func_start TryEndStatusWithAbility +TryEndStatusWithAbility: ; 0x022FA7DC + stmdb sp!, {r3, r4, r5, r6, lr} + sub sp, sp, #4 + mov r5, r1 + mov r2, #0x16 +#ifndef JAPAN + mov r3, #1 +#endif + mov r6, r0 + ldr r4, [r5, #0xb4] + bl DefenderAbilityIsActive__022F96CC + cmp r0, #0 + beq _022FA81C + ldrb r0, [r4, #0xbf] + cmp r0, #4 + bne _022FA81C + mov r0, r6 + mov r1, r5 + bl EndBurnClassStatus +_022FA81C: + mov r0, r6 + mov r1, r5 + mov r2, #0x40 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__022F96CC + cmp r0, #0 + beq _022FA850 + ldrb r0, [r4, #0xd0] + cmp r0, #2 + bne _022FA850 + mov r0, r6 + mov r1, r5 + bl EndCringeClassStatus +_022FA850: + mov r0, r6 + mov r1, r5 + mov r2, #0x42 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__022F96CC + cmp r0, #0 + beq _022FA884 + ldrb r0, [r4, #0xbf] + cmp r0, #1 + bne _022FA884 + mov r0, r6 + mov r1, r5 + bl EndBurnClassStatus +_022FA884: + mov r0, r6 + mov r1, r5 + mov r2, #0x29 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__022F96CC + cmp r0, #0 + beq _022FA8B8 + ldrb r0, [r4, #0xd0] + cmp r0, #7 + bne _022FA8B8 + mov r0, r6 + mov r1, r5 + bl EndCringeClassStatus +_022FA8B8: + mov r0, r6 + mov r1, r5 + mov r2, #0x36 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__022F96CC + cmp r0, #0 + bne _022FA8F0 + mov r0, r6 + mov r1, r5 + mov r2, #0x49 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__022F96CC + cmp r0, #0 + beq _022FA924 +_022FA8F0: + mov r0, r5 + bl IsMonsterSleeping + cmp r0, #0 + bne _022FA90C + ldrb r0, [r4, #0xbd] + cmp r0, #4 + bne _022FA924 +_022FA90C: + mov r3, #1 + mov r0, r6 + mov r1, r5 + mov r2, #0 + str r3, [sp] + bl EndSleepClassStatus +_022FA924: + mov r0, r6 + mov r1, r5 + mov r2, #0x41 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__022F96CC + cmp r0, #0 + beq _022FA95C + ldrb r0, [r4, #0xc4] + cmp r0, #1 + bne _022FA95C + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl EndFrozenClassStatus +_022FA95C: + mov r0, r6 + mov r1, r5 + mov r2, #0x45 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__022F96CC + cmp r0, #0 + beq _022FA998 + ldrb r0, [r4, #0xbf] + add r0, r0, #0xfe + and r0, r0, #0xff + cmp r0, #1 + bhi _022FA998 + mov r0, r6 + mov r1, r5 + bl EndBurnClassStatus +_022FA998: + mov r0, r5 + mov r1, #0x25 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _022FA9CC + mov r0, #0 + strb r0, [r4, #0xff] + ldrb r0, [r4, #0xd5] + cmp r0, #0xc + bne _022FA9CC + mov r0, r6 + mov r1, r5 + bl EndReflectClassStatus +_022FA9CC: + mov r0, r5 + mov r1, #0x2b + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _022FA9FC + ldrb r0, [r4, #0xc4] + cmp r0, #2 + bne _022FA9FC + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl EndFrozenClassStatus +_022FA9FC: + add sp, sp, #4 + ldmia sp!, {r3, r4, r5, r6, pc} + arm_func_end TryEndStatusWithAbility + + arm_func_start ov29_022FAA04 +ov29_022FAA04: ; 0x022FAA04 +#ifdef JAPAN +#define OV29_022FAA04_OFFSET -4 +#else +#define OV29_022FAA04_OFFSET 0 +#endif + ldr ip, [r0, #0xb4] + mov r3, #0 +_022FAA0C: + add r2, ip, r3, lsl #3 + ldrb r0, [r2, #0x124 + OV29_022FAA04_OFFSET] + add r3, r3, #1 + cmp r3, #4 + bic r0, r0, #0x10 + strb r0, [r2, #0x124 + OV29_022FAA04_OFFSET] + blt _022FAA0C + ldrb r0, [ip, #0x144 + OV29_022FAA04_OFFSET] + bic r0, r0, #0x10 + strb r0, [ip, #0x144 + OV29_022FAA04_OFFSET] + ldrh r0, [r1, #4] + cmp r0, #0x160 + ldreqb r0, [ip, #0x144 + OV29_022FAA04_OFFSET] + orreq r0, r0, #0x10 + streqb r0, [ip, #0x144 + OV29_022FAA04_OFFSET] + ldrneb r0, [r1] + orrne r0, r0, #0x10 + strneb r0, [r1] + bx lr + arm_func_end ov29_022FAA04 + + arm_func_start ov29_022FAA58 +ov29_022FAA58: ; 0x022FAA58 +#ifdef JAPAN +#define OV29_022FAA58_OFFSET -4 +#else +#define OV29_022FAA58_OFFSET 0 +#endif + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x14 + ldr r1, _022FAC90 ; =DUNGEON_PTR + mov sl, r0 + ldr r0, [r1] + mov r6, #0 +#ifdef JAPAN + add r0, r0, #0x284 +#else + add r0, r0, #0x328 +#endif + add r4, r0, #0x12800 +_022FAA78: + ldr r5, [r4, r6, lsl #2] + mov r0, r5 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FAB98 + mov r0, r5 + mov r1, #0x37 + bl IqSkillIsEnabled + cmp r0, #0 + beq _022FAB98 + ldr sb, [r5, #0xb4] + mov r8, #0 + mov r7, r8 + add fp, sb, #0x124 + OV29_022FAA58_OFFSET +_022FAAB0: + ldrb r1, [fp, r7, lsl #3] + add r0, fp, r7, lsl #3 + str r0, [sp] + tst r1, #1 + movne r0, #1 + moveq r0, #0 + tst r0, #0xff + beq _022FAB00 + ldr r0, [sp] + bl GetMaxPpWrapper + ldr r1, [sp] + ldrb r1, [r1, #6] + cmp r1, r0 + beq _022FAB00 + add r0, r8, #1 + mov r1, r0, lsl #0x10 + mov r2, r8, lsl #1 + add r0, sp, #4 + strh r7, [r0, r2] + mov r8, r1, asr #0x10 +_022FAB00: + add r0, r7, #1 + mov r0, r0, lsl #0x10 + mov r7, r0, asr #0x10 + cmp r7, #4 + blt _022FAAB0 + cmp r8, #0 + ble _022FAB4C + mov r0, r8 + bl DungeonRandInt + mov r0, r0, lsl #0x10 + add r1, sp, #4 + mov r0, r0, asr #0xf + ldrsh r0, [r1, r0] + add r1, sb, #0x124 + OV29_022FAA58_OFFSET + add r1, r1, r0, lsl #3 + ldrb r0, [r1, #6] + add r0, r0, #1 + strb r0, [r1, #6] + b _022FAB54 +_022FAB4C: + mov r0, #0 + b _022FAB58 +_022FAB54: + mov r0, #1 +_022FAB58: + cmp r0, #0 + beq _022FAB98 + mov r0, r5 + bl ShowPpRestoreEffect + cmp sl, #0 + bne _022FAB98 + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r0, #1 + mov r1, #0x37 + bl ov29_0234B084 +#ifdef JAPAN + ldr r1, _022FC21C ; =0x0000095F + mov r0, r5 +#else + mov r0, r5 + mov r1, #0xc20 +#endif + bl LogMessageByIdWithPopupCheckUser +_022FAB98: + add r0, r6, #1 + mov r0, r0, lsl #0x10 + mov r6, r0, asr #0x10 + cmp r6, #4 + blt _022FAA78 + mov r8, #0 + mov fp, r8 +_022FABB4: + ldr sb, [r4, r8, lsl #2] + mov r0, sb + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FAC74 + ldr r6, [sb, #0xb4] + mov r7, fp + add r5, r6, #0x124 + OV29_022FAA58_OFFSET + b _022FABFC +_022FABD8: + add r0, r5, r7, lsl #3 + bl GetMaxPp + add r1, r6, r7, lsl #3 + ldrb r1, [r1, #0x12a + OV29_022FAA58_OFFSET] + cmp r1, r0 + blt _022FAC04 + add r0, r7, #1 + mov r0, r0, lsl #0x10 + mov r7, r0, asr #0x10 +_022FABFC: + cmp r7, #4 + blt _022FABD8 +_022FAC04: + cmp r7, #4 + beq _022FAC74 + mov r0, sb + mov r1, #0x47 + bl ExclusiveItemEffectIsActive__022FAC98 + cmp r0, #0 + beq _022FAC74 + mov r0, #0 + mov r1, sb + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r0, sb + mov r1, #0x47 + add r2, sp, #0xc + bl GetExclusiveItemWithEffectFromBag + mov r0, #1 + add r1, sp, #0xc + bl ov29_02344B44 + cmp sl, #0 + bne _022FAC60 + ldr r1, _022FAC94 ; =0x00000C23 + mov r0, sb + bl LogMessageByIdWithPopupCheckUser +_022FAC60: + mov r0, sb + mov r1, sb + mov r2, #1 + mov r3, sl + bl RestoreAllMovePP +_022FAC74: + add r0, r8, #1 + mov r0, r0, lsl #0x10 + mov r8, r0, asr #0x10 + cmp r8, #4 + blt _022FABB4 + add sp, sp, #0x14 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_022FAC90: .word DUNGEON_PTR +#ifdef JAPAN +_022FC21C: .word 0x0000095F +_022FAC94: .word 0x00000962 +#else +_022FAC94: .word 0x00000C23 +#endif + arm_func_end ov29_022FAA58 + + arm_func_start ExclusiveItemEffectIsActive__022FAC98 +ExclusiveItemEffectIsActive__022FAC98: ; 0x022FAC98 + stmdb sp!, {r3, lr} + ldr r2, [r0, #0xb4] + ldrb r0, [r2, #6] + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, pc} +#ifdef JAPAN + add r0, r2, #0x224 +#else + add r0, r2, #0x228 +#endif + bl ExclusiveItemEffectFlagTest + ldmia sp!, {r3, pc} + arm_func_end ExclusiveItemEffectIsActive__022FAC98 + + arm_func_start ov29_022FACBC +ov29_022FACBC: ; 0x022FACBC + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, lr} + sub sp, sp, #4 + ldr r1, _022FAD44 ; =DUNGEON_PTR + mov sb, r0 + ldr r0, [r1] + mov r8, #0 +#ifdef JAPAN + add r0, r0, #0x284 +#else + add r0, r0, #0x328 +#endif + ldr r5, _022FAD48 ; =0x000003E7 + add r7, r0, #0x12800 + mov r4, r8 + mov r6, #0x48 +_022FACE8: + ldr sl, [r7, r8, lsl #2] + mov r0, sl + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FAD28 + mov r0, sl + mov r1, r6 + bl ExclusiveItemEffectIsActive__022FAC98 + cmp r0, #0 + beq _022FAD28 + mov r0, sl + mov r1, sl + mov r2, r5 + mov r3, r4 + str sb, [sp] + bl TryIncreaseHp +_022FAD28: + add r0, r8, #1 + mov r0, r0, lsl #0x10 + mov r8, r0, asr #0x10 + cmp r8, #4 + blt _022FACE8 + add sp, sp, #4 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, pc} + .align 2, 0 +_022FAD44: .word DUNGEON_PTR +_022FAD48: .word 0x000003E7 + arm_func_end ov29_022FACBC + + arm_func_start ov29_022FAD4C +ov29_022FAD4C: ; 0x022FAD4C +#ifdef JAPAN +#define OV29_022FAD4C_OFFSET -0xA4 +#else +#define OV29_022FAD4C_OFFSET 0 +#endif + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + ldr r1, _022FAF00 ; =DUNGEON_PTR + mov r8, #0 + ldr r1, [r1] + sub r3, r8, #1 + add r2, r1, #0xcc00 + ldrsh r4, [r2, #0xe4 + OV29_022FAD4C_OFFSET] + add r1, r1, #0x328 + OV29_022FAD4C_OFFSET + add r5, r1, #0x12800 + cmp r4, r3 + ldreqsh r1, [r2, #0xe6 + OV29_022FAD4C_OFFSET] + mov sb, r0 + moveq r0, r3 + cmpeq r1, r0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov r7, #0 + mov r4, #0x1a + b _022FADE4 +_022FAD94: + ldr r6, [r5, r7, lsl #2] + mov r0, r6 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FADD8 + ldr r0, [r6, #0xb4] + ldrb r0, [r0, #0x48] + cmp r0, #0xd9 + blo _022FADC0 + cmp r0, #0xe4 + blo _022FADD8 +_022FADC0: + mov r0, r6 + mov r1, r4 + bl IqSkillIsEnabled + cmp r0, #0 + movne r8, #1 + bne _022FADEC +_022FADD8: + add r0, r7, #1 + mov r0, r0, lsl #0x10 + mov r7, r0, asr #0x10 +_022FADE4: + cmp r7, #4 + blt _022FAD94 +_022FADEC: + cmp r8, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + bl GetFloorType + cmp r0, #0 + bne _022FAEEC + cmp sb, #0 + bne _022FAE14 +#ifdef JAPAN + mov r0, r6 + mov r1, #0x960 +#else + ldr r1, _022FAF04 ; =0x00000C21 + mov r0, r6 +#endif + bl LogMessageByIdWithPopupCheckUser +_022FAE14: + bl GetLeader + mov r5, r0 + add r0, sp, #0 + add r1, sp, #2 + mov r4, #0 + bl GetStairsSpawnPosition + ldrsh r1, [sp] + ldrsh r3, [r5, #4] + ldrsh r2, [sp, #2] + cmp r3, r1 + ldreqsh r0, [r5, #6] + cmpeq r0, r2 + cmp r3, r1 + bne _022FAE58 + ldrsh r0, [r5, #6] + cmp r0, r2 + movlt r4, #0 +_022FAE58: + cmp r3, r1 + ldrltsh r0, [r5, #6] + cmplt r0, r2 + movlt r4, #1 + cmp r3, r1 + bge _022FAE7C + ldrsh r0, [r5, #6] + cmp r0, r2 + moveq r4, #2 +_022FAE7C: + cmp r3, r1 + bge _022FAE90 + ldrsh r0, [r5, #6] + cmp r0, r2 + movgt r4, #3 +_022FAE90: + cmp r3, r1 + bne _022FAEA4 + ldrsh r0, [r5, #6] + cmp r0, r2 + movgt r4, #4 +_022FAEA4: + cmp r3, r1 + ldrgtsh r0, [r5, #6] + cmpgt r0, r2 + movgt r4, #5 + cmp r3, r1 + ble _022FAEC8 + ldrsh r0, [r5, #6] + cmp r0, r2 + moveq r4, #6 +_022FAEC8: + cmp r3, r1 + ble _022FAEDC + ldrsh r0, [r5, #6] + cmp r0, r2 + movlt r4, #7 +_022FAEDC: + mov r0, r5 + mov r1, r4 + bl ov29_022E6928 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} +_022FAEEC: + bl GetFloorType + cmp r0, #1 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + bl GetFloorType + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + .align 2, 0 +_022FAF00: .word DUNGEON_PTR +#ifndef JAPAN +_022FAF04: .word 0x00000C21 +#endif + arm_func_end ov29_022FAD4C + + arm_func_start ov29_022FAF08 +ov29_022FAF08: ; 0x022FAF08 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + ldr r1, _022FAFC8 ; =DUNGEON_PTR + mov r6, r0 + ldr r0, [r1] + mov r5, #0 +#ifdef JAPAN + add r0, r0, #0x284 +#else + add r0, r0, #0x328 +#endif + add r8, r0, #0x12800 + bl IsCurrentFixedRoomBossFight + cmp r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov sb, r5 + mov r7, #0x36 + b _022FAF74 +_022FAF3C: + ldr r4, [r8, sb, lsl #2] + mov r0, r4 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FAF68 + mov r0, r4 + mov r1, r7 + bl IqSkillIsEnabled + cmp r0, #0 + movne r5, #1 + bne _022FAF7C +_022FAF68: + add r0, sb, #1 + mov r0, r0, lsl #0x10 + mov sb, r0, asr #0x10 +_022FAF74: + cmp sb, #4 + blt _022FAF3C +_022FAF7C: + cmp r5, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + ldr r1, _022FAFC8 ; =DUNGEON_PTR + ldr r0, _022FAFCC ; =0x00012AF8 + ldr r1, [r1] + ldrsh r1, [r1, r0] + cmp r1, #0 + ldmleia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + cmp r6, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov r0, #0 + bl ov29_0234B09C + ldr r1, _022FAFD0 ; =0x00000C22 + mov r0, r4 + bl LogMessageByIdWithPopupCheckUser + mov r0, #0x78 + mov r1, #0xa + bl ov29_022EA370 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + .align 2, 0 +_022FAFC8: .word DUNGEON_PTR +#ifdef JAPAN +_022FAFCC: .word 0x00012A54 +_022FAFD0: .word 0x00000961 +#else +_022FAFCC: .word 0x00012AF8 +_022FAFD0: .word 0x00000C22 +#endif + arm_func_end ov29_022FAF08 + + arm_func_start ov29_022FAFD4 +ov29_022FAFD4: ; 0x022FAFD4 + stmdb sp!, {r3, lr} + mov r2, #1 + mov r3, #0 + bl GetTreatmentBetweenMonsters + cmp r0, #0 + moveq r0, #1 + movne r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} + arm_func_end ov29_022FAFD4 + + arm_func_start GetTeamMemberWithIqSkill +GetTeamMemberWithIqSkill: ; 0x022FAFF8 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + ldr r1, _022FB060 ; =DUNGEON_PTR + mov r4, #0 + ldr r1, [r1] + mov r5, r0 +#ifdef JAPAN + add r0, r1, #0x284 +#else + add r0, r1, #0x328 +#endif + mov r7, r4 + add r6, r0, #0x12800 + b _022FB050 +_022FB01C: + ldr r0, [r6, r7, lsl #2] + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FB044 + ldr r0, [r6, r7, lsl #2] + mov r1, r5 + bl IqSkillIsEnabled + cmp r0, #0 + ldrne r4, [r6, r7, lsl #2] + bne _022FB058 +_022FB044: + add r0, r7, #1 + mov r0, r0, lsl #0x10 + mov r7, r0, asr #0x10 +_022FB050: + cmp r7, #4 + blt _022FB01C +_022FB058: + mov r0, r4 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_022FB060: .word DUNGEON_PTR + arm_func_end GetTeamMemberWithIqSkill + + arm_func_start TeamMemberHasEnabledIqSkill +TeamMemberHasEnabledIqSkill: ; 0x022FB064 + stmdb sp!, {r3, lr} + bl GetTeamMemberWithIqSkill + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} + arm_func_end TeamMemberHasEnabledIqSkill + + arm_func_start TeamLeaderIqSkillIsEnabled +TeamLeaderIqSkillIsEnabled: ; 0x022FB080 + stmdb sp!, {r4, lr} + mov r4, r0 + bl GetLeader + mov r1, r4 + bl IqSkillIsEnabled + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + arm_func_end TeamLeaderIqSkillIsEnabled + + arm_func_start CountMovesOutOfPp +CountMovesOutOfPp: ; 0x022FB0A8 + stmdb sp!, {r3, lr} + ldr ip, [r0, #0xb4] + mov r0, #0 + mov lr, r0 + mov r2, r0 + mov r3, #1 +_022FB0C0: + add r1, ip, lr, lsl #3 +#ifdef JAPAN + ldrb r1, [r1, #0x120] +#else + ldrb r1, [r1, #0x124] +#endif + tst r1, #1 + movne r1, r3 + moveq r1, r2 + tst r1, #0xff + beq _022FB0F4 + add r1, ip, lr, lsl #3 +#ifdef JAPAN + ldrb r1, [r1, #0x126] +#else + ldrb r1, [r1, #0x12a] +#endif + cmp r1, #0 + addeq r0, r0, #1 + moveq r0, r0, lsl #0x10 + moveq r0, r0, asr #0x10 +_022FB0F4: + add r1, lr, #1 + mov r1, r1, lsl #0x10 + mov lr, r1, asr #0x10 + cmp lr, #4 + blt _022FB0C0 + ldmia sp!, {r3, pc} + arm_func_end CountMovesOutOfPp + + arm_func_start HasSuperEffectiveMoveAgainstUser +HasSuperEffectiveMoveAgainstUser: ; 0x022FB10C + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + mov sb, r1 + ldr r6, [sb, #0xb4] + mov r7, #0 + mov sl, r0 + mov r8, r2 +#ifdef JAPAN + add r4, r6, #0x120 +#else + add r4, r6, #0x124 +#endif + mov fp, r7 + mov r5, #1 + b _022FB198 +_022FB134: + add r0, r6, r7, lsl #3 +#ifdef JAPAN + ldrb r0, [r0, #0x120] +#else + ldrb r0, [r0, #0x124] +#endif + tst r0, #1 + movne r0, r5 + moveq r0, fp + tst r0, #0xff + beq _022FB18C + cmp r8, #0 + beq _022FB168 + add r0, r4, r7, lsl #3 + bl HasMaxGinsengBoost99 + cmp r0, #0 + beq _022FB18C +_022FB168: + add r0, r4, r7, lsl #3 + bl GetMoveType + mov r2, r0 + mov r0, sb + mov r1, sl + bl GetTypeMatchupBothTypes + cmp r0, #3 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} +_022FB18C: + add r0, r7, #1 + mov r0, r0, lsl #0x10 + mov r7, r0, asr #0x10 +_022FB198: + cmp r7, #4 + blt _022FB134 + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + arm_func_end HasSuperEffectiveMoveAgainstUser + + arm_func_start ov29_022FB1A8 +ov29_022FB1A8: ; 0x022FB1A8 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, #0 + ldr r6, [r0, #0xb4] + mov r4, r7 + mov r5, #1 + b _022FB204 +_022FB1C0: + add r0, r6, r7, lsl #3 +#ifdef JAPAN + ldrb r0, [r0, #0x120] +#else + ldrb r0, [r0, #0x124] +#endif + tst r0, #1 + movne r0, r5 + moveq r0, r4 + tst r0, #0xff + beq _022FB1F8 + add r0, r6, r7, lsl #3 + add r0, r0, #0x100 +#ifdef JAPAN + ldrh r0, [r0, #0x24] +#else + ldrh r0, [r0, #0x28] +#endif + bl IsOneHitKoMove + cmp r0, #0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} +_022FB1F8: + add r0, r7, #1 + mov r0, r0, lsl #0x10 + mov r7, r0, asr #0x10 +_022FB204: + cmp r7, #4 + blt _022FB1C0 + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + arm_func_end ov29_022FB1A8 + + arm_func_start TryEatItem +TryEatItem: ; 0x022FB214 + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x74 + mov sl, r0 + mov sb, r1 + mov r5, #0 + bl EntityIsValid__022F7364 + cmp r0, #0 + beq _022FB244 + mov r0, sb + bl EntityIsValid__022F7364 + cmp r0, #0 + bne _022FB24C +_022FB244: + mov r0, #0 + b _022FB508 +_022FB24C: + ldr r4, [sb, #0xb4] + ldrb r0, [r4, #6] + cmp r0, #0 + ldrsh r0, [r4, #0x66] + beq _022FB31C + cmp r0, #0 + beq _022FB504 + ldrsh r0, [r4, #0x66] + bl ShouldTryEatItem + cmp r0, #0 + beq _022FB504 + mov r0, sl + add r1, r4, #0x62 + bl CanMonsterUseItem + cmp r0, #0 + beq _022FB504 + mov r0, r5 + mov r1, sl + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, sb + mov r0, #1 + mov r2, r5 + bl SubstitutePlaceholderStringTags + add r1, r4, #0x62 + mov r0, #1 + bl ov29_02344B44 + ldr r2, _022FB510 ; =0x00000C24 + mov r0, sl + mov r1, sb + bl LogMessageByIdWithPopupCheckUserTarget + ldrh r2, [r4, #0x62] + mov r0, sl + add r1, r4, #0x62 + strh r2, [sp, #8] + ldrh r2, [r4, #0x64] + strh r2, [sp, #0xa] + ldrh r2, [r4, #0x66] + strh r2, [sp, #0xc] + bl ov29_0230F9A4 + add r0, r4, #0x62 + bl ItemZInit + mov r0, r5 + str sl, [sp] + add r1, sp, #8 + str r1, [sp, #4] + mov r3, sb + mov r1, r0 + mov r2, r0 + bl ApplyItemEffect + mov r5, #1 + b _022FB504 +_022FB31C: + bl ShouldTryEatItem + cmp r0, #0 + beq _022FB3D4 + mov r0, sl + add r1, r4, #0x62 + bl CanMonsterUseItem + cmp r0, #0 + beq _022FB504 + mov r0, r5 + mov r1, sl + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, sb + mov r0, #1 + mov r2, r5 + bl SubstitutePlaceholderStringTags + add r1, r4, #0x62 + mov r0, #1 + bl ov29_02344B44 + ldr r2, _022FB510 ; =0x00000C24 + mov r0, sl + mov r1, sb + bl LogMessageByIdWithPopupCheckUserTarget + ldrh r2, [r4, #0x62] + mov r0, sl + add r1, r4, #0x62 + strh r2, [sp, #8] + ldrh r2, [r4, #0x64] + strh r2, [sp, #0xa] + ldrh r2, [r4, #0x66] + strh r2, [sp, #0xc] + bl ov29_0230F9A4 + add r0, r4, #0x62 + bl RemoveEquivItem + add r0, r4, #0x62 + bl ItemZInit + mov r0, r5 + str sl, [sp] + add r1, sp, #8 + str r1, [sp, #4] + mov r3, sb + mov r1, r0 + mov r2, r0 + bl ApplyItemEffect + mov r5, #1 + b _022FB504 +_022FB3D4: + bl GetNbItemsInBag + mov r7, r0 + mov r6, r5 + add r4, sp, #0xe + b _022FB3F8 +_022FB3E8: + mov r0, r7 + bl RandInt + strb r0, [r4, r6] + add r6, r6, #1 +_022FB3F8: + cmp r6, r7 + blt _022FB3E8 + add r0, sp, #0xe + mov r1, #0 + add r0, r0, r7 + b _022FB418 +_022FB410: + strb r1, [r0, r1] + add r1, r1, #1 +_022FB418: + cmp r1, r7 + blt _022FB410 + mov r8, #0 + add r4, sp, #0xe + ldr fp, _022FB514 ; =BAG_ITEMS_PTR_MIRROR + b _022FB4FC +_022FB430: + ldrb r1, [r4, r8] + ldr r3, [fp] + mov r0, #6 + smulbb r2, r1, r0 + ldr r1, [r3, #0x384] + ldrb r0, [r1, r2] + add r6, r1, r2 + tst r0, #1 + movne r0, #1 + moveq r0, #0 + tst r0, #0xff + beq _022FB4F8 + ldrb r0, [r6, #1] + cmp r0, #0 + bne _022FB4F8 + ldrsh r0, [r6, #4] + bl ShouldTryEatItem + cmp r0, #0 + beq _022FB4F8 + mov r0, sl + mov r1, r6 + bl CanMonsterUseItem + cmp r0, #0 + beq _022FB504 + mov r0, #0 + mov r1, sl + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, sb + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + mov r1, r6 + mov r0, #1 + bl ov29_02344B44 + mov r0, sl + mov r1, sb + ldr r2, _022FB518 ; =0x00000C25 + bl LogMessageByIdWithPopupCheckUserTarget + str sl, [sp] + mov r3, sb + str r6, [sp, #4] + mov r0, #0 + mov r1, r0 + mov r2, r0 + bl ApplyItemEffect + mov r0, r6 + bl RemoveEquivItem + mov r5, #1 + b _022FB504 +_022FB4F8: + add r8, r8, #1 +_022FB4FC: + cmp r8, r7, lsl #1 + blt _022FB430 +_022FB504: + mov r0, r5 +_022FB508: + add sp, sp, #0x74 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +#ifdef JAPAN +_022FB510: .word 0x00000963 +_022FB514: .word BAG_ITEMS_PTR_MIRROR +_022FB518: .word 0x00000964 +#else +_022FB510: .word 0x00000C24 +_022FB514: .word BAG_ITEMS_PTR_MIRROR +_022FB518: .word 0x00000C25 +#endif + arm_func_end TryEatItem + + arm_func_start ov29_022FB51C +ov29_022FB51C: ; 0x022FB51C + stmdb sp!, {r3, lr} + bl GetScenarioBalance + cmp r0, #2 + movhs r0, #1 + movlo r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} + arm_func_end ov29_022FB51C + +#ifndef JAPAN + arm_func_start SetDecoyAiTracker +SetDecoyAiTracker: ; 0x022FB538 + stmdb sp!, {r4, r5, r6, r7, r8, lr} + mov r6, r0 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, r7, r8, pc} + ldr r5, [r6, #0xb4] + mov r4, #0 + ldr r7, _022FB5E8 ; =DUNGEON_PTR + strb r4, [r5, #0x10c] + ldr r0, [r7] + add r0, r0, #0x3000 + ldrb r0, [r0, #0xe38] + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, r7, r8, pc} + b _022FB5DC +_022FB574: + ldr r0, [r7] + add r0, r0, r4, lsl #2 + add r0, r0, #0x12000 + ldr r8, [r0, #0xb78] + mov r0, r8 + bl EntityIsValid__022F7364 + cmp r0, #0 + cmpne r8, r6 + beq _022FB5D8 + ldr r0, [r8, #0xb4] + ldrb r0, [r0, #0xd8] + cmp r0, #2 + bne _022FB5D8 + mov r0, r6 + mov r1, r8 + bl CanSeeTarget + cmp r0, #0 + beq _022FB5D8 + ldr r0, [r8, #0xb4] + ldrb r0, [r0, #0xd9] + cmp r0, #0 + movne r0, #2 + moveq r0, #1 + strb r0, [r5, #0x10c] + ldmia sp!, {r4, r5, r6, r7, r8, pc} +_022FB5D8: + add r4, r4, #1 +_022FB5DC: + cmp r4, #0x14 + blt _022FB574 + ldmia sp!, {r4, r5, r6, r7, r8, pc} + .align 2, 0 +_022FB5E8: .word DUNGEON_PTR + arm_func_end SetDecoyAiTracker +#endif + + arm_func_start CheckSpawnThreshold +CheckSpawnThreshold: ; 0x022FB5EC + stmdb sp!, {r4, lr} + bl GetSpawnThreshold + mov r4, r0 + bl GetScenarioBalanceVeneer + cmp r4, r0 + movls r0, #1 + movhi r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + arm_func_end CheckSpawnThreshold + + arm_func_start HasLowHealth +HasLowHealth: ; 0x022FB610 + stmdb sp!, {r4, lr} + mov r4, r0 + bl EntityIsValid__022F7364 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + ldr r0, [r4] + cmp r0, #1 + movne r0, #0 + ldmneia sp!, {r4, pc} + ldr r3, [r4, #0xb4] + ldr r0, _022FB674 ; =0x000003E7 + ldrsh r2, [r3, #0x12] + ldrsh r1, [r3, #0x16] + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r3, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movlt r0, #1 + movge r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + .align 2, 0 +_022FB674: .word 0x000003E7 + arm_func_end HasLowHealth + + arm_func_start AreEntitiesAdjacent +AreEntitiesAdjacent: ; 0x022FB678 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r0 + mov r6, r1 + mov r5, #0 + ldr r4, _022FB6E0 ; =DIRECTIONS_XY + b _022FB6D0 +_022FB690: + mov r1, r5, lsl #2 + add r0, r4, r5, lsl #2 + ldrsh r3, [r4, r1] + ldrsh ip, [r7, #4] + ldrsh r1, [r0, #2] + ldrsh r2, [r7, #6] + add r0, ip, r3 + add r1, r2, r1 + bl GetTile + ldr r0, [r0, #0xc] + cmp r0, r6 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + add r0, r5, #1 + mov r0, r0, lsl #0x10 + mov r5, r0, asr #0x10 +_022FB6D0: + cmp r5, #8 + blt _022FB690 + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_022FB6E0: .word DIRECTIONS_XY + arm_func_end AreEntitiesAdjacent + + arm_func_start ov29_022FB6E4 +ov29_022FB6E4: ; 0x022FB6E4 + stmdb sp!, {r4, lr} + mov r4, r0 + bl IsMonster__022F9720 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + ldr r0, [r4, #0xb4] + ldrb r0, [r0, #0x48] + cmp r0, #0xd6 + moveq r0, #1 + movne r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + arm_func_end ov29_022FB6E4 + + arm_func_start ov29_022FB718 +ov29_022FB718: ; 0x022FB718 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + mov sl, r0 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + ldr sb, [sl, #0xb4] + mov r1, #0 + mov r0, sl + strh r1, [sb, #0x16] + bl Conversion2IsActive + mov r6, r0 + mov r0, sl + mov r1, #0x38 + ldr r4, [sl, #0xb4] + bl IqSkillIsEnabled + cmp r0, #0 + ldrne r0, _022FB834 ; =_020A1870 + mov r8, #0 + ldrnesh r1, [r4, #0x16] + ldrnesh r0, [r0] +#ifdef JAPAN + add r5, r4, #0x120 +#else + add r5, r4, #0x124 +#endif + mov fp, r8 + addne r0, r1, r0 + strneh r0, [r4, #0x16] + mov r4, #1 +_022FB77C: + ldrb r0, [r5, r8, lsl #3] + add r7, r5, r8, lsl #3 + tst r0, #1 + movne r0, r4 + moveq r0, fp + tst r0, #0xff + beq _022FB7C0 + ldrh r2, [r7, #2] + mov r0, sl + mov r1, #0x39 + bic r2, r2, #0x100 + strh r2, [r7, #2] + bl IqSkillIsEnabled + cmp r0, #0 + ldrneh r0, [r7, #2] + orrne r0, r0, #0x100 + strneh r0, [r7, #2] +_022FB7C0: + add r0, r8, #1 + mov r0, r0, lsl #0x10 + mov r8, r0, asr #0x10 + cmp r8, #4 + blt _022FB77C + mov r0, sl + bl ov29_02348100 + cmp r6, #2 + bne _022FB7FC + mov r0, sl + bl Conversion2IsActive + cmp r0, #0 + bne _022FB7FC + mov r0, sl + bl ov29_02307CE0 +_022FB7FC: + ldrsh r1, [sb, #0x12] + ldrsh r0, [sb, #0x16] + ldr r2, _022FB838 ; =0x000003E7 + add r1, r1, r0 + cmp r1, r2 + ldrsh r0, [sb, #0x10] + movle r2, r1 + cmp r0, r2 + ldmleia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + ldr r0, _022FB838 ; =0x000003E7 + cmp r1, r0 + movgt r1, r0 + strh r1, [sb, #0x10] + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_022FB834: .word _020A1870 +_022FB838: .word 0x000003E7 + arm_func_end ov29_022FB718 + + arm_func_start ov29_022FB83C +ov29_022FB83C: ; 0x022FB83C + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, lr} + mov sl, r0 + mov sb, r1 + bl EntityIsValid__022F7364 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} + ldr r8, [sl, #0xb4] + mov r7, #0 +#ifdef JAPAN + add r6, r8, #0x120 +#else + add r6, r8, #0x124 +#endif + mov r4, r7 + mov r5, #1 +_022FB868: + ldrb r0, [r6, r7, lsl #3] + mov r1, r7, lsl #3 + tst r0, #1 + movne r0, r5 + moveq r0, r4 + tst r0, #0xff + beq _022FB88C + add r0, r6, r1 + bl GetMoveBasePp +_022FB88C: + add r0, r7, #1 + mov r0, r0, lsl #0x10 + mov r7, r0, asr #0x10 + cmp r7, #4 + blt _022FB868 + mov r0, sl + bl ov29_022FB718 + cmp sb, #0 + ldmeqia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} + ldrsh r2, [r8, #0x12] + ldrsh r1, [r8, #0x16] + ldr r0, _022FB91C ; =0x000003E7 + mov sb, #0 + add r1, r2, r1 + cmp r1, r0 + movgt r1, r0 + strh r1, [r8, #0x10] +#ifdef JAPAN + add r6, r8, #0x120 +#else + add r6, r8, #0x124 +#endif + mov r4, sb + mov r5, #1 +_022FB8DC: + ldrb r0, [r6, sb, lsl #3] + add r7, r6, sb, lsl #3 + tst r0, #1 + movne r0, r5 + moveq r0, r4 + tst r0, #0xff + beq _022FB904 + mov r0, r7 + bl GetMaxPp + strb r0, [r7, #6] +_022FB904: + add r0, sb, #1 + mov r0, r0, lsl #0x10 + mov sb, r0, asr #0x10 + cmp sb, #4 + blt _022FB8DC + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc} + .align 2, 0 +_022FB91C: .word 0x000003E7 + arm_func_end ov29_022FB83C + + arm_func_start ov29_022FB920 +ov29_022FB920: ; 0x022FB920 +#ifdef EUROPE + stmdb sp!, {r4, r5, r6, lr} + ldr r5, _022FB980 ; =DUNGEON_PTR + mov r4, r0 + mov r6, #0 +_022FC33C_EU: + ldr r0, [r5] + add r0, r0, r6, lsl #2 + add r0, r0, #0x12000 + ldr r0, [r0, #0xb28] + bl ov29_022FB718 + add r0, r6, #1 + mov r0, r0, lsl #0x10 + mov r6, r0, asr #0x10 + cmp r6, #4 + blt _022FC33C_EU + bl UpdateMapSurveyorFlag + cmp r0, #0 + cmpne r4, #0 + ldmeqia sp!, {r4, r5, r6, pc} + bl UpdateMinimap + ldmia sp!, {r4, r5, r6, pc} +#else + stmdb sp!, {r3, r4, r5, lr} + ldr r4, _022FB980 ; =DUNGEON_PTR + mov r5, #0 +_022FB92C: + ldr r0, [r4] + add r0, r0, r5, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr r0, [r0, #0xa84] +#else + ldr r0, [r0, #0xb28] +#endif + bl ov29_022FB718 + add r0, r5, #1 + mov r0, r0, lsl #0x10 + mov r5, r0, asr #0x10 + cmp r5, #4 + blt _022FB92C + mov r0, #0x41 + bl TeamMemberHasEnabledIqSkill + cmp r0, #0 + ldrne r0, _022FB980 ; =DUNGEON_PTR + movne r1, #1 + ldreq r0, _022FB980 ; =DUNGEON_PTR + moveq r1, #0 + ldr r0, [r0] + add r0, r0, #0x1a000 +#ifdef JAPAN + strb r1, [r0, #0x19d] +#else + strb r1, [r0, #0x241] +#endif + ldmia sp!, {r3, r4, r5, pc} +#endif + .align 2, 0 +_022FB980: .word DUNGEON_PTR + arm_func_end ov29_022FB920 + + arm_func_start ov29_022FB984 +ov29_022FB984: ; 0x022FB984 + mov r0, #0 + bx lr + arm_func_end ov29_022FB984 + + arm_func_start ov29_022FB98C +ov29_022FB98C: ; 0x022FB98C + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r2, #1 + ldr r0, _022FB9B8 ; =0x0000270F + mov r4, r1 + sub r3, r2, #2 + bl DisplayAnimatedNumbers + mov r0, r5 + mov r1, r4 + bl ov29_022E576C + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_022FB9B8: .word 0x0000270F + arm_func_end ov29_022FB98C + + arm_func_start ov29_022FB9BC +ov29_022FB9BC: ; 0x022FB9BC + stmdb sp!, {r3, lr} + ldr r0, [r0, #0xb4] + ldrb r0, [r0, #0xbc] + bl IsSecretBazaarNpcBehavior + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} + arm_func_end ov29_022FB9BC + + arm_func_start ov29_022FB9E0 +ov29_022FB9E0: ; 0x022FB9E0 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl IsMonster__022F9720 + cmp r0, #0 + beq _022FBA4C + ldr r1, [r5, #0xb4] + mov r0, #0 +#ifdef JAPAN + add ip, r1, #0x120 +#else + add ip, r1, #0x124 +#endif + mov r2, r0 + mov r3, #1 + b _022FBA44 +_022FBA10: + ldrb r1, [ip, r0, lsl #3] + add lr, ip, r0, lsl #3 + tst r1, #1 + movne r1, r3 + moveq r1, r2 + tst r1, #0xff + beq _022FBA38 + ldrh r1, [lr, #4] + cmp r1, r4 + ldmeqia sp!, {r3, r4, r5, pc} +_022FBA38: + add r0, r0, #1 + mov r0, r0, lsl #0x10 + mov r0, r0, asr #0x10 +_022FBA44: + cmp r0, #4 + blt _022FBA10 +_022FBA4C: + mvn r0, #0 + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_022FB9E0 + + arm_func_start ov29_022FBA54 +ov29_022FBA54: ; 0x022FBA54 + stmdb sp!, {r3, lr} + bl ov29_022FB9E0 + cmp r0, #0 + movge r0, #1 + movlt r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} + arm_func_end ov29_022FBA54 + + arm_func_start ov29_022FBA70 +ov29_022FBA70: ; 0x022FBA70 + stmdb sp!, {r4, lr} + mov r4, r0 + bl IsMonster__022F9720 + cmp r0, #0 + beq _022FBAAC + ldr r0, [r4, #0xb4] + ldrb r0, [r0, #0x48] + cmp r0, #0xfa + moveq r0, #1 + ldmeqia sp!, {r4, pc} + cmp r0, #0xd9 + blo _022FBAAC + cmp r0, #0xe4 + movlo r0, #1 + ldmloia sp!, {r4, pc} +_022FBAAC: + mov r0, #0 + ldmia sp!, {r4, pc} + arm_func_end ov29_022FBA70 + + arm_func_start ov29_022FBAB4 +ov29_022FBAB4: ; 0x022FBAB4 + ldr r2, [r0, #0xb4] + cmp r2, #0 + addne r0, r2, #0x100 + movne r1, #0 +#ifdef JAPAN + strneh r1, [r0, #0x8e] + strne r1, [r2, #0x188] +#else + strneh r1, [r0, #0x92] + strne r1, [r2, #0x18c] +#endif + bx lr + arm_func_end ov29_022FBAB4 diff --git a/asm/overlay_29_023016A8.s b/asm/overlay_29_023016A8.s index 1ea05c9e..cabc1e0d 100644 --- a/asm/overlay_29_023016A8.s +++ b/asm/overlay_29_023016A8.s @@ -328,227 +328,3 @@ _02301A50: ldmia sp!, {r3, r4, r5, r6, r7, pc} #endif arm_func_end DefenderAbilityIsActive__02301A0C - - arm_func_start IsMonster__02301A60 -IsMonster__02301A60: ; 0x02301A60 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__02301A60 - - arm_func_start ov29_02301A84 -ov29_02301A84: ; 0x02301A84 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - sub sp, sp, #8 - mov r4, r1 - mov r5, r0 - mov r0, r4 - mov sb, r2 - bl GetApparentWeather - ldr r6, _02301B24 ; =EXCL_ITEM_EFFECTS_WEATHER_NO_STATUS - mov r7, r0 - ldrb r0, [r6, r7] - mov r8, #0 - cmp r0, #0 - beq _02301B18 - ldrb r1, [r6, r7] - mov r0, r4 - bl ExclusiveItemEffectIsActive__022FFF28 - cmp r0, #0 - beq _02301B18 - cmp sb, #0 - ldrb r6, [r6, r7] - beq _02301B14 - mov r0, r8 - mov r1, r4 - mov r2, r0 - bl SubstitutePlaceholderStringTags - add r2, sp, #0 - mov r0, r4 - mov r1, r6 - bl GetExclusiveItemWithEffectFromBag - add r1, sp, #0 - mov r0, #1 - bl ov29_02344B44 - ldr r2, _02301B28 ; =0x00000C39 - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget -_02301B14: - mov r8, #1 -_02301B18: - mov r0, r8 - add sp, sp, #8 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - .align 2, 0 -_02301B24: .word EXCL_ITEM_EFFECTS_WEATHER_NO_STATUS -#ifdef JAPAN -_02301B28: .word 0x00000978 -#else -_02301B28: .word 0x00000C39 -#endif - arm_func_end ov29_02301A84 - - arm_func_start IsProtectedFromStatDrops -IsProtectedFromStatDrops: ; 0x02301B2C - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r0 - mov r0, #0 - mov r5, r2 - mov r6, r1 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r0, r6 - bl MistIsActive - movs r4, r0 - beq _02301BB0 - cmp r5, #0 - beq _02301BA8 - mov r0, #0 - mov r1, r6 - mov r2, r0 - bl SubstitutePlaceholderStringTags - cmp r4, #1 - bne _02301B8C - ldr r2, _02301C20 ; =0x00000C38 - mov r0, r7 - mov r1, r6 - bl LogMessageByIdWithPopupCheckUserTarget - b _02301BA8 -_02301B8C: - cmp r4, #2 - bne _02301BA8 - ldr r2, _02301C24 ; =0x00000C39 - mov r0, r7 - mov r1, r6 - mov r3, #0x26 - bl ov29_02314DC4 -_02301BA8: - mov r0, #1 - ldmia sp!, {r3, r4, r5, r6, r7, pc} -_02301BB0: - mov r0, r7 - mov r1, r6 - mov r2, #0xf -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__02301A0C - cmp r0, #0 - bne _02301BE8 - mov r0, r7 - mov r1, r6 - mov r2, #0x18 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__02301A0C - cmp r0, #0 - beq _02301C18 -_02301BE8: - cmp r5, #0 - beq _02301C10 - mov r0, #0 - mov r1, r6 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _02301C28 ; =0x00000C3A - mov r0, r7 - mov r1, r6 - bl LogMessageByIdWithPopupCheckUserTarget -_02301C10: - mov r0, #1 - ldmia sp!, {r3, r4, r5, r6, r7, pc} -_02301C18: - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -#ifdef JAPAN -_02301C20: .word 0x00000977 -_02301C24: .word 0x00000978 -_02301C28: .word 0x00000979 -#else -_02301C20: .word 0x00000C38 -_02301C24: .word 0x00000C39 -_02301C28: .word 0x00000C3A -#endif - arm_func_end IsProtectedFromStatDrops - - arm_func_start ov29_02301C2C -ov29_02301C2C: ; 0x02301C2C - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - mov sl, r0 - ldr r8, [sl, #0xb4] - mov sb, r1 - ldrb r0, [r8, #0xbd] - cmp r0, #1 - cmpne r0, #5 - cmpne r0, #3 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - mov r6, #0 -#ifdef JAPAN - add r5, r8, #0x120 -#else - add r5, r8, #0x124 -#endif - mov fp, r6 - mov r4, #1 - b _02301CCC -_02301C68: - ldrb r1, [r5, r6, lsl #3] - add r7, r5, r6, lsl #3 - tst r1, #1 - movne r0, r4 - moveq r0, fp - tst r0, #0xff - beq _02301CC8 - ldrb r0, [r8, #7] - cmp r0, #0 - bne _02301C98 - tst r1, #4 - beq _02301CC8 -_02301C98: - mov r0, sl - mov r1, r7 - mov r2, #1 - bl ov29_02324BE8 - cmp r0, #0 - ldrneb r0, [r7, #6] - cmpne r0, #0 - beq _02301CC8 - ldrh r0, [r7, #4] - cmp r0, sb - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} -_02301CC8: - add r6, r6, #1 -_02301CCC: - cmp r6, #4 - blt _02301C68 - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - arm_func_end ov29_02301C2C - - arm_func_start NoGastroAcidStatus -NoGastroAcidStatus: ; 0x02301CDC - stmdb sp!, {r4, lr} - mov r4, r0 - bl IsMonster__02301A60 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #0xd8] - cmp r0, #4 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - arm_func_end NoGastroAcidStatus diff --git a/asm/overlay_29_02301A84.s b/asm/overlay_29_02301A84.s new file mode 100644 index 00000000..3354c7c2 --- /dev/null +++ b/asm/overlay_29_02301A84.s @@ -0,0 +1,215 @@ + .include "asm/macros.inc" + .include "overlay_29_02301A84.inc" + + .text + + arm_func_start ov29_02301A84 +ov29_02301A84: ; 0x02301A84 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + sub sp, sp, #8 + mov r4, r1 + mov r5, r0 + mov r0, r4 + mov sb, r2 + bl GetApparentWeather + ldr r6, _02301B24 ; =EXCL_ITEM_EFFECTS_WEATHER_NO_STATUS + mov r7, r0 + ldrb r0, [r6, r7] + mov r8, #0 + cmp r0, #0 + beq _02301B18 + ldrb r1, [r6, r7] + mov r0, r4 + bl ExclusiveItemEffectIsActive__022FFF28 + cmp r0, #0 + beq _02301B18 + cmp sb, #0 + ldrb r6, [r6, r7] + beq _02301B14 + mov r0, r8 + mov r1, r4 + mov r2, r0 + bl SubstitutePlaceholderStringTags + add r2, sp, #0 + mov r0, r4 + mov r1, r6 + bl GetExclusiveItemWithEffectFromBag + add r1, sp, #0 + mov r0, #1 + bl ov29_02344B44 + ldr r2, _02301B28 ; =0x00000C39 + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget +_02301B14: + mov r8, #1 +_02301B18: + mov r0, r8 + add sp, sp, #8 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + .align 2, 0 +_02301B24: .word EXCL_ITEM_EFFECTS_WEATHER_NO_STATUS +#ifdef JAPAN +_02301B28: .word 0x00000978 +#else +_02301B28: .word 0x00000C39 +#endif + arm_func_end ov29_02301A84 + + arm_func_start IsProtectedFromStatDrops +IsProtectedFromStatDrops: ; 0x02301B2C + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r0 + mov r0, #0 + mov r5, r2 + mov r6, r1 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r0, r6 + bl MistIsActive + movs r4, r0 + beq _02301BB0 + cmp r5, #0 + beq _02301BA8 + mov r0, #0 + mov r1, r6 + mov r2, r0 + bl SubstitutePlaceholderStringTags + cmp r4, #1 + bne _02301B8C + ldr r2, _02301C20 ; =0x00000C38 + mov r0, r7 + mov r1, r6 + bl LogMessageByIdWithPopupCheckUserTarget + b _02301BA8 +_02301B8C: + cmp r4, #2 + bne _02301BA8 + ldr r2, _02301C24 ; =0x00000C39 + mov r0, r7 + mov r1, r6 + mov r3, #0x26 + bl ov29_02314DC4 +_02301BA8: + mov r0, #1 + ldmia sp!, {r3, r4, r5, r6, r7, pc} +_02301BB0: + mov r0, r7 + mov r1, r6 + mov r2, #0xf +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__02301A0C + cmp r0, #0 + bne _02301BE8 + mov r0, r7 + mov r1, r6 + mov r2, #0x18 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__02301A0C + cmp r0, #0 + beq _02301C18 +_02301BE8: + cmp r5, #0 + beq _02301C10 + mov r0, #0 + mov r1, r6 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _02301C28 ; =0x00000C3A + mov r0, r7 + mov r1, r6 + bl LogMessageByIdWithPopupCheckUserTarget +_02301C10: + mov r0, #1 + ldmia sp!, {r3, r4, r5, r6, r7, pc} +_02301C18: + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +#ifdef JAPAN +_02301C20: .word 0x00000977 +_02301C24: .word 0x00000978 +_02301C28: .word 0x00000979 +#else +_02301C20: .word 0x00000C38 +_02301C24: .word 0x00000C39 +_02301C28: .word 0x00000C3A +#endif + arm_func_end IsProtectedFromStatDrops + + arm_func_start ov29_02301C2C +ov29_02301C2C: ; 0x02301C2C + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + mov sl, r0 + ldr r8, [sl, #0xb4] + mov sb, r1 + ldrb r0, [r8, #0xbd] + cmp r0, #1 + cmpne r0, #5 + cmpne r0, #3 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + mov r6, #0 +#ifdef JAPAN + add r5, r8, #0x120 +#else + add r5, r8, #0x124 +#endif + mov fp, r6 + mov r4, #1 + b _02301CCC +_02301C68: + ldrb r1, [r5, r6, lsl #3] + add r7, r5, r6, lsl #3 + tst r1, #1 + movne r0, r4 + moveq r0, fp + tst r0, #0xff + beq _02301CC8 + ldrb r0, [r8, #7] + cmp r0, #0 + bne _02301C98 + tst r1, #4 + beq _02301CC8 +_02301C98: + mov r0, sl + mov r1, r7 + mov r2, #1 + bl ov29_02324BE8 + cmp r0, #0 + ldrneb r0, [r7, #6] + cmpne r0, #0 + beq _02301CC8 + ldrh r0, [r7, #4] + cmp r0, sb + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} +_02301CC8: + add r6, r6, #1 +_02301CCC: + cmp r6, #4 + blt _02301C68 + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + arm_func_end ov29_02301C2C + + arm_func_start NoGastroAcidStatus +NoGastroAcidStatus: ; 0x02301CDC + stmdb sp!, {r4, lr} + mov r4, r0 + bl IsMonster__02301A60 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + ldr r0, [r4, #0xb4] + ldrb r0, [r0, #0xd8] + cmp r0, #4 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + arm_func_end NoGastroAcidStatus diff --git a/asm/overlay_29_02308FE0.s b/asm/overlay_29_02308FE0.s index afce23aa..130ec9e0 100644 --- a/asm/overlay_29_02308FE0.s +++ b/asm/overlay_29_02308FE0.s @@ -3562,4637 +3562,3 @@ _0230A984: ldmia sp!, {r3, r4, r5, r6, r7, pc} #endif arm_func_end DefenderAbilityIsActive__0230A940 - - arm_func_start IsMonster__0230A994 -IsMonster__0230A994: ; 0x0230A994 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__0230A994 - - arm_func_start ExclusiveItemEffectIsActive__0230A9B8 -ExclusiveItemEffectIsActive__0230A9B8: ; 0x0230A9B8 - stmdb sp!, {r3, lr} - ldr r2, [r0, #0xb4] - ldrb r0, [r2, #6] - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, pc} -#ifdef JAPAN - add r0, r2, #0x224 -#else - add r0, r2, #0x228 -#endif - bl ExclusiveItemEffectFlagTest - ldmia sp!, {r3, pc} - arm_func_end ExclusiveItemEffectIsActive__0230A9B8 - - arm_func_start ItemIsActive__0230A9DC -ItemIsActive__0230A9DC: ; 0x0230A9DC - stmdb sp!, {r3, r4, r5, lr} - mov r4, r1 - mov r1, #0x6f - mov r5, r0 - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - mov r0, r5 - mov r1, r4 - bl HasHeldItem - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ItemIsActive__0230A9DC - - arm_func_start AftermathCheck -AftermathCheck: ; 0x0230AA0C - stmdb sp!, {r4, r5, r6, lr} - sub sp, sp, #8 - mov r4, r2 - mov r2, #0x76 -#ifndef JAPAN - mov r3, #1 -#endif - mov r6, r0 - mov r5, r1 - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230AA78 - ldr r0, _0230AA84 ; =AFTERMATH_CHANCE - ldrsh r0, [r0] - bl DungeonRandOutcome__022EAB20 - cmp r0, #0 - ldrne ip, _0230AA88 ; =0x0000026F - cmpne r4, ip - beq _0230AA78 - mov r0, #0 - str r0, [sp] - mov r0, r6 - mov r1, r5 - add r2, r5, #4 - mov r3, #1 - str ip, [sp, #4] - bl TryAftermathExplosion - mov r0, #1 - b _0230AA7C -_0230AA78: - mov r0, #0 -_0230AA7C: - add sp, sp, #8 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_0230AA84: .word AFTERMATH_CHANCE -_0230AA88: .word 0x0000026F - arm_func_end AftermathCheck - - arm_func_start GetTypeMatchupBothTypes -GetTypeMatchupBothTypes: ; 0x0230AA8C - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - ldr r3, _0230AB4C ; =ov29_02352838 - mov sl, r0 - ldrh r4, [r3] - ldrh r3, [r3, #2] - mov sb, r1 - mov r8, r2 - strh r4, [sp] - strh r3, [sp, #2] - bl ScrappyShouldActivate - ldr fp, _0230AB50 ; =DUNGEON_PTR - mov r7, r0 - mov r6, #0 - mov r5, #1 - add r4, sp, #0 -_0230AAC8: - cmp r7, #0 - bne _0230AB04 - mov r0, r8 - bl IsTypeIneffectiveAgainstGhost - cmp r0, #0 - beq _0230AB04 - mov r0, sl - mov r1, sb - mov r2, r6 - bl GhostImmunityIsActive - cmp r0, #0 - ldrne r1, [fp] - movne r0, #0 - strneb r5, [r1, #0x1d4] - bne _0230AB18 -_0230AB04: - mov r0, sl - mov r1, sb - mov r2, r6 - mov r3, r8 - bl GetTypeMatchup -_0230AB18: - add r1, r6, #1 - mov r1, r1, lsl #0x10 - mov r2, r6, lsl #1 - mov r6, r1, asr #0x10 - strh r0, [r4, r2] - cmp r6, #2 - blt _0230AAC8 - ldrsh r2, [sp] - ldr r0, _0230AB54 ; =TYPE_MATCHUP_COMBINATOR_TABLE - ldrsh r1, [sp, #2] - add r0, r0, r2, lsl #4 - ldr r0, [r0, r1, lsl #2] - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_0230AB4C: .word ov29_02352838 -_0230AB50: .word DUNGEON_PTR -_0230AB54: .word TYPE_MATCHUP_COMBINATOR_TABLE - arm_func_end GetTypeMatchupBothTypes - - arm_func_start ScrappyShouldActivate -ScrappyShouldActivate: ; 0x0230AB58 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - mov r6, #0 - mov sl, r0 - mov sb, r1 - mov r8, r2 - mov r5, #0x57 - mov fp, r6 - mov r4, #1 - b _0230ABDC -_0230AB7C: - mov r0, sl - mov r1, r5 - ldr r7, [sb, #0xb4] - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230ABB4 - add r0, r7, r6 - ldrb r0, [r0, #0x5e] - cmp r0, #0xe - bne _0230ABB4 - cmp r8, #1 - cmpne r8, #7 - moveq r0, r4 - beq _0230ABB8 -_0230ABB4: - mov r0, fp -_0230ABB8: - cmp r0, #0 - ldrne r1, _0230ABEC ; =DUNGEON_PTR - movne r0, #1 - ldrne r1, [r1] - strneb r0, [r1, #0x1cc] - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - add r0, r6, #1 - mov r0, r0, lsl #0x10 - mov r6, r0, asr #0x10 -_0230ABDC: - cmp r6, #2 - blt _0230AB7C - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_0230ABEC: .word DUNGEON_PTR - arm_func_end ScrappyShouldActivate - - arm_func_start IsTypeIneffectiveAgainstGhost -IsTypeIneffectiveAgainstGhost: ; 0x0230ABF0 - cmp r0, #1 - cmpne r0, #7 - moveq r0, #1 - movne r0, #0 - bx lr - arm_func_end IsTypeIneffectiveAgainstGhost - - arm_func_start GhostImmunityIsActive -GhostImmunityIsActive: ; 0x0230AC04 - stmdb sp!, {r3, lr} - ldr r3, [r1, #0xb4] - add r1, r3, r2 - ldrb r1, [r1, #0x5e] - cmp r1, #0xe - bne _0230AC50 - ldrb r1, [r3, #0xfe] - cmp r1, #0 - bne _0230AC38 - mov r1, #0x45 - bl ExclusiveItemEffectIsActive__0230A9B8 - cmp r0, #0 - beq _0230AC40 -_0230AC38: - mov r0, #1 - b _0230AC44 -_0230AC40: - mov r0, #0 -_0230AC44: - cmp r0, #0 - moveq r0, #1 - ldmeqia sp!, {r3, pc} -_0230AC50: - mov r0, #0 - ldmia sp!, {r3, pc} - arm_func_end GhostImmunityIsActive - - arm_func_start GetTypeMatchup -GetTypeMatchup: ; 0x0230AC58 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r1 - ldr r4, [r7, #0xb4] - mov r6, r2 - ldrb r1, [r4, #0xf5] - mov r5, r3 - cmp r1, #1 - beq _0230AC88 - mov r1, #0x46 - bl ExclusiveItemEffectIsActive__0230A9B8 - cmp r0, #0 - beq _0230ACA0 -_0230AC88: - cmp r5, #0xb - addeq r0, r4, r6 - ldreqb r0, [r0, #0x5e] - cmpeq r0, #0x10 - moveq r0, #2 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} -_0230ACA0: - cmp r5, #9 - bne _0230ACE0 - bl GravityIsActive - cmp r0, #0 - beq _0230ACCC - add r0, r4, r6 - ldrb r0, [r0, #0x5e] - cmp r0, #0xa - bne _0230ACE0 - mov r0, #2 - ldmia sp!, {r3, r4, r5, r6, r7, pc} -_0230ACCC: - mov r0, r7 - bl IsFloating - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} -_0230ACE0: - ldr r1, _0230AD00 ; =TYPE_MATCHUP_TABLE - mov r0, #0x24 - mla r0, r5, r0, r1 - add r1, r4, r6 - ldrb r1, [r1, #0x5e] - mov r1, r1, lsl #1 - ldrsh r0, [r1, r0] - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_0230AD00: .word TYPE_MATCHUP_TABLE - arm_func_end GetTypeMatchup - - arm_func_start CalcTypeBasedDamageEffects -CalcTypeBasedDamageEffects: ; 0x0230AD04 - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x64 - ldr r5, _0230B774 ; =ov29_02352838 - mov sl, r1 - ldr r4, [r5, #0x1c] - ldr r5, [r5, #0x20] - ldr r8, [sp, #0x88] - ldr r1, [sp, #0x90] - ldr r7, [sp, #0x8c] - str r1, [sp, #0x90] - ldr r6, [sl, #0xb4] - mov r1, #1 - mov fp, r0 - mov sb, r2 - str r3, [sp, #4] - str r4, [sp, #0x34] - str r5, [sp, #0x38] - bl IntToFixedPoint64 - mov r0, #0 - str r0, [sp, #0x30] - strb r0, [r7, #0xe] - ldr r1, [sp, #0x30] - mov r0, sb - strb r1, [r7, #0xf] - bl EntityIsValid__02308FBC - cmp r0, #0 - moveq r0, #1 - beq _0230B76C - mov r0, r8 - bl IsTypeIneffectiveAgainstGhost - str r0, [sp, #0x2c] - mov r0, sl - mov r1, sb - mov r2, #0x35 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - cmpne r8, #0 - movne r0, #1 - strne r0, [sp, #0x30] - mov r3, #2 - mov r0, sl - mov r1, sb - mov r2, r8 - str r3, [r7, #8] - bl ScrappyShouldActivate - ldr r3, _0230B778 ; =MATCHUP_IMMUNE_MULTIPLIER_ERRATIC_PLAYER - str r0, [sp, #0x28] - ldr r0, [r3] - ldr r2, _0230B77C ; =MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER - str r0, [sp, #0x24] - ldr r0, [r2] - ldr r1, _0230B780 ; =MATCHUP_NEUTRAL_MULTIPLIER_ERRATIC_PLAYER - str r0, [sp, #0x20] - ldr r0, [r1] - ldr r1, _0230B784 ; =MATCHUP_IMMUNE_MULTIPLIER - str r0, [sp, #0x1c] - ldr r0, _0230B788 ; =MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER - mov r4, #0 - ldr r0, [r0] - str r0, [sp, #0x18] - ldr r0, [r1] - ldr r1, _0230B78C ; =MATCHUP_NEUTRAL_MULTIPLIER - str r0, [sp, #0x14] - ldr r0, _0230B790 ; =MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER - ldr r0, [r0] - str r0, [sp, #0x10] - ldr r0, [r1] - str r0, [sp, #0xc] - ldr r0, _0230B794 ; =MATCHUP_SUPER_EFFECTIVE_MULTIPLIER - ldr r0, [r0] - str r0, [sp, #8] - b _0230AF8C -_0230AE28: - ldr r0, [sp, #0x90] - cmp r0, #0 - bne _0230AE90 - mov r0, sl - mov r1, #0x3b - bl IqSkillIsEnabled - cmp r0, #0 - bne _0230AE5C - mov r0, sb - mov r1, #0x3b - bl IqSkillIsEnabled - cmp r0, #0 - beq _0230AE90 -_0230AE5C: - ldr r1, [sp, #0x24] - add r0, sp, #0x44 - bl FixedPoint32To64 - ldr r1, [sp, #0x20] - add r0, sp, #0x4c - bl FixedPoint32To64 - ldr r1, [sp, #0x1c] - add r0, sp, #0x54 - bl FixedPoint32To64 - ldr r1, [sp, #0x18] - add r0, sp, #0x5c - bl FixedPoint32To64 - b _0230AEC0 -_0230AE90: - ldr r1, [sp, #0x14] - add r0, sp, #0x44 - bl FixedPoint32To64 - ldr r1, [sp, #0x10] - add r0, sp, #0x4c - bl FixedPoint32To64 - ldr r1, [sp, #0xc] - add r0, sp, #0x54 - bl FixedPoint32To64 - ldr r1, [sp, #8] - add r0, sp, #0x5c - bl FixedPoint32To64 -_0230AEC0: - mov r0, fp - bl FixedPoint64IsZero - cmp r0, #0 - bne _0230AF94 - ldr r0, [sp, #0x28] - cmp r0, #0 - bne _0230AF1C - ldr r0, [sp, #0x2c] - cmp r0, #0 - beq _0230AF1C - mov r0, sl - mov r1, sb - mov r2, r4, lsl #0x10 - mov r2, r2, asr #0x10 - bl GhostImmunityIsActive - cmp r0, #0 - beq _0230AF1C - ldr r0, _0230B798 ; =DUNGEON_PTR - mov r5, #0 - ldr r1, [r0] - mov r0, #1 - strb r0, [r1, #0x1d4] - b _0230AF38 -_0230AF1C: - mov r0, sl - mov r1, sb - mov r2, r4, lsl #0x10 - mov r2, r2, asr #0x10 - mov r3, r8 - bl GetTypeMatchup - mov r5, r0 -_0230AF38: - mov r0, sl - mov r1, #0x3b - bl IqSkillIsEnabled - cmp r0, #0 - beq _0230AF64 - add r2, sp, #0x44 - mov r0, fp - mov r1, fp - add r2, r2, r5, lsl #3 - bl MultiplyFixedPoint64 - b _0230AF80 -_0230AF64: - cmp r5, #2 - beq _0230AF80 - add r2, sp, #0x44 - mov r0, fp - mov r1, fp - add r2, r2, r5, lsl #3 - bl MultiplyFixedPoint64 -_0230AF80: - add r0, sp, #0x34 - str r5, [r0, r4, lsl #2] - add r4, r4, #1 -_0230AF8C: - cmp r4, #2 - blt _0230AE28 -_0230AF94: - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r4, [sp, #0x34] - ldr r2, [r0] - ldr r1, _0230B79C ; =TYPE_MATCHUP_COMBINATOR_TABLE - strb r4, [r2, #0x18c] - ldr r3, [sp, #0x38] - ldr r2, [r0] - add r1, r1, r4, lsl #4 - ldr r0, [r1, r3, lsl #2] - strb r3, [r2, #0x18d] - cmp r0, #3 - str r0, [r7, #8] - moveq r4, #1 - beq _0230AFEC - ldr r0, [sp, #0x30] - mov r4, #0 - cmp r0, #0 - ldrne r0, _0230B774 ; =ov29_02352838 - ldrne r1, [r0, #0x3c] - ldrne r0, [r0, #0x40] - strne r1, [fp] - strne r0, [fp, #4] -_0230AFEC: - mov r0, sl - mov r1, #0x50 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230B02C - ldr r0, [r7, #8] - cmp r0, #1 - bne _0230B02C - ldr r1, _0230B7A0 ; =TINTED_LENS_MULTIPLIER - add r0, sp, #0x3c - ldr r1, [r1] - bl FixedPoint32To64 - add r2, sp, #0x3c - mov r0, fp - mov r1, fp - bl MultiplyFixedPoint64 -_0230B02C: - mov r0, sl - mov r1, sb - mov r2, #0x6c -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - bne _0230B064 - mov r0, sl - mov r1, sb - mov r2, #0x6e -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230B080 -_0230B064: - ldr r0, [r7, #8] - cmp r0, #3 - bne _0230B080 - ldr r2, _0230B7A4 ; =SOLID_ROCK_MULTIPLIER - mov r0, fp - mov r1, fp - bl MultiplyFixedPoint64 -_0230B080: - mov r0, sb - mov r1, #0x5a - bl ExclusiveItemEffectIsActive__0230A9B8 - cmp r0, #0 - beq _0230B0A4 - ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 - mov r0, fp - mov r1, fp - bl MultiplyFixedPoint64 -_0230B0A4: - ldr r0, [sp, #0x90] - cmp r0, #0 - bne _0230B104 - mov r0, sl - mov r1, #0x64 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230B104 - ldr r0, _0230B7AC ; =TECHNICIAN_MOVE_POWER_THRESHOLD - ldrsh r1, [r0] - ldr r0, [sp, #4] - cmp r0, r1 - bgt _0230B104 - ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 - mov r0, fp - mov r1, fp - bl MultiplyFixedPoint64 - mov r1, #0x64 - ldr r2, _0230B7B4 ; =0x00000C3E - mov r0, sl - str r1, [sp] - mov r1, sb - mov r3, #2 - bl LogMessageByIdWithPopupCheckParticipants -_0230B104: - cmp r8, #2 - cmpne r8, #6 - bne _0230B14C - mov r0, sl - mov r1, sb - mov r2, #2 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230B14C - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 - ldr r3, [r0] - mov r5, #1 - mov r0, fp - mov r1, fp - strb r5, [r3, #0x1c5] - bl MultiplyFixedPoint64 -_0230B14C: - cmp r8, #2 - bne _0230B198 - mov r0, sl - mov r1, sb - bl FlashFireShouldActivate - cmp r0, #0 - beq _0230B198 - ldr r1, _0230B798 ; =DUNGEON_PTR - mov r0, fp - ldr r2, [r1] - mov r3, #1 - mov r1, #0 - strb r3, [r2, #0x1c6] - bl IntToFixedPoint64 - mov r4, #0 - str r4, [r7, #8] - strb r4, [r7, #0xe] - mov r0, #1 - strb r0, [r7, #0xf] -_0230B198: - cmp r8, #2 - bne _0230B1DC - mov r0, sl - mov r1, sb - mov r2, #0x5f -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230B1DC - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 - ldr r3, [r0] - mov r5, #1 - mov r0, fp - mov r1, fp - strb r5, [r3, #0x1c5] - bl MultiplyFixedPoint64 -_0230B1DC: - cmp r8, #9 - bne _0230B248 - mov r0, sl - mov r1, #0x53 - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _0230B208 - mov r0, sb - bl LevitateIsActive - cmp r0, #0 - bne _0230B218 -_0230B208: - mov r0, sb - bl IsFloating - cmp r0, #0 - beq _0230B248 -_0230B218: - ldr r1, _0230B798 ; =DUNGEON_PTR - mov r0, fp - ldr r2, [r1] - mov r3, #1 - mov r1, #0 - strb r3, [r2, #0x1c7] - bl IntToFixedPoint64 - mov r4, #0 - str r4, [r7, #8] - strb r4, [r7, #0xe] - mov r0, #1 - strb r0, [r7, #0xf] -_0230B248: - cmp r8, #3 - bne _0230B2F4 - mov r0, sl - mov r1, #0x10 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230B2F4 - ldrsh r2, [r6, #0x12] - ldrsh r1, [r6, #0x16] - ldr r0, _0230B7B8 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r6, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movle r0, #1 - movgt r0, #0 - and r7, r0, #0xff - mov r0, r6 - mov r2, r7 - mov r1, #0x80 - bl UpdateStateFlags - mov r5, r0 - cmp r7, #0 - beq _0230B2D4 - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 - ldr r3, [r0] - mov r7, #1 - mov r0, fp - mov r1, fp - strb r7, [r3, #0x1c8] - bl MultiplyFixedPoint64 -_0230B2D4: - cmp r5, #0 - beq _0230B2F4 - mov r0, sl - bl PlayEffectAnimation0x1A9__022E6214 - ldr r2, _0230B7C0 ; =0x00000C4F - mov r0, sl - mov r1, sb - bl LogMessageByIdWithPopupCheckUserTarget -_0230B2F4: - cmp r8, #4 - bne _0230B3A0 - mov r0, sl - mov r1, #0x1a - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230B3A0 - ldrsh r2, [r6, #0x12] - ldrsh r1, [r6, #0x16] - ldr r0, _0230B7B8 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r6, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movle r0, #1 - movgt r0, #0 - and r7, r0, #0xff - mov r0, r6 - mov r2, r7 - mov r1, #2 - bl UpdateStateFlags - mov r5, r0 - cmp r7, #0 - beq _0230B380 - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 - ldr r3, [r0] - mov r7, #1 - mov r0, fp - mov r1, fp - strb r7, [r3, #0x1c9] - bl MultiplyFixedPoint64 -_0230B380: - cmp r5, #0 - beq _0230B3A0 - mov r0, sl - bl PlayEffectAnimation0x1A9__022E61C8 -#ifdef JAPAN - ldr r2, _0230CD24 ; =0x0000098F - mov r0, sl - mov r1, sb -#else - mov r0, sl - mov r1, sb - mov r2, #0xc50 -#endif - bl LogMessageByIdWithPopupCheckUserTarget -_0230B3A0: - cmp r8, #0xc - bne _0230B44C - mov r0, sl - mov r1, #0x43 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230B44C - ldrsh r2, [r6, #0x12] - ldrsh r1, [r6, #0x16] - ldr r0, _0230B7B8 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r6, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movle r0, #1 - movgt r0, #0 - and r7, r0, #0xff - mov r0, r6 - mov r2, r7 - mov r1, #0x10 - bl UpdateStateFlags - mov r5, r0 - cmp r7, #0 - beq _0230B42C - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 - ldr r3, [r0] - mov r7, #1 - mov r0, fp - mov r1, fp - strb r7, [r3, #0x1ca] - bl MultiplyFixedPoint64 -_0230B42C: - cmp r5, #0 - beq _0230B44C - mov r0, sl - bl PlayEffectAnimation0x1A9__022E64C4 -#ifdef JAPAN - mov r0, sl - mov r1, sb - mov r2, #0x990 -#else - ldr r2, _0230B7C4 ; =0x00000C51 - mov r0, sl - mov r1, sb -#endif - bl LogMessageByIdWithPopupCheckUserTarget -_0230B44C: - cmp r8, #2 - bne _0230B534 - mov r0, sl - mov r1, #0x46 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230B4F8 - ldrsh r2, [r6, #0x12] - ldrsh r1, [r6, #0x16] - ldr r0, _0230B7B8 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r6, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movle r0, #1 - movgt r0, #0 - and r7, r0, #0xff - mov r0, r6 - mov r2, r7 - mov r1, #0x20 - bl UpdateStateFlags - mov r5, r0 - cmp r7, #0 - beq _0230B4D8 - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 - ldr r3, [r0] - mov r7, #1 - mov r0, fp - mov r1, fp - strb r7, [r3, #0x1cb] - bl MultiplyFixedPoint64 -_0230B4D8: - cmp r5, #0 - beq _0230B4F8 - mov r0, sl - bl PlayEffectAnimation0x1A9__022E6510 - ldr r2, _0230B7C8 ; =0x00000C52 - mov r0, sl - mov r1, sb - bl LogMessageByIdWithPopupCheckUserTarget -_0230B4F8: - mov r0, sl - mov r1, sb - mov r2, #0x55 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230B534 - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 - ldr r3, [r0] - mov r5, #1 - mov r0, fp - mov r1, fp - strb r5, [r3, #0x1cb] - bl MultiplyFixedPoint64 -_0230B534: - ldrb r0, [r6, #0xbf] - cmp r0, #1 - bne _0230B560 - ldr r1, _0230B7CC ; =BURN_DAMAGE_MULTIPLIER - add r0, sp, #0x3c - ldr r1, [r1] - bl FixedPoint32To64 - add r2, sp, #0x3c - mov r0, fp - mov r1, fp - bl MultiplyFixedPoint64 -_0230B560: - mov r0, fp - bl FixedPoint64IsZero - cmp r0, #0 - bne _0230B5CC - mov r0, sl - mov r1, r8 - bl MonsterIsType - cmp r0, #0 - beq _0230B5CC - ldr r1, _0230B798 ; =DUNGEON_PTR - mov r0, sl - ldr r2, [r1] - mov r3, #1 - mov r1, #0x63 - strb r3, [r2, #0x1cf] - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230B5BC - ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 - mov r0, fp - mov r1, fp - bl MultiplyFixedPoint64 - b _0230B5CC -_0230B5BC: - ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 - mov r0, fp - mov r1, fp - bl MultiplyFixedPoint64 -_0230B5CC: - mov r0, sl - bl GetApparentWeather - mov r5, r0 - cmp r5, #1 - bne _0230B634 - cmp r8, #2 - bne _0230B60C - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 - ldr r3, [r0] - mov r7, #1 - mov r0, fp - mov r1, fp - strb r7, [r3, #0x1c4] - bl MultiplyFixedPoint64 - b _0230B634 -_0230B60C: - cmp r8, #3 - bne _0230B634 - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 - ldr r3, [r0] - mov r7, #1 - mov r0, fp - mov r1, fp - strb r7, [r3, #0x1c4] - bl MultiplyFixedPoint64 -_0230B634: - cmp r5, #4 - bne _0230B690 - cmp r8, #2 - bne _0230B668 - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 - ldr r3, [r0] - mov r7, #1 - mov r0, fp - mov r1, fp - strb r7, [r3, #0x1c3] - bl MultiplyFixedPoint64 - b _0230B690 -_0230B668: - cmp r8, #3 - bne _0230B690 - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 - ldr r3, [r0] - mov r7, #1 - mov r0, fp - mov r1, fp - strb r7, [r3, #0x1c3] - bl MultiplyFixedPoint64 -_0230B690: - cmp r5, #3 - bne _0230B6C0 - cmp r8, #1 - beq _0230B6C0 - ldr r2, _0230B7D0 ; =CLOUDY_DAMAGE_MULTIPLIER - mov r0, fp - mov r1, fp - bl MultiplyFixedPoint64 - ldr r0, _0230B798 ; =DUNGEON_PTR - mov r1, #1 - ldr r0, [r0] - strb r1, [r0, #0x1c2] -_0230B6C0: - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r7, [r0] - add r0, r7, #0xc000 -#ifdef JAPAN - ldrb r0, [r0, #0xcb7] -#else - ldrb r0, [r0, #0xd5b] -#endif - cmp r0, #0 - bne _0230B6E0 - cmp r5, #6 - bne _0230B700 -_0230B6E0: - cmp r8, #5 - bne _0230B700 - ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 - mov r3, #1 - mov r0, fp - mov r1, fp - strb r3, [r7, #0x1d0] - bl MultiplyFixedPoint64 -_0230B700: - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r5, [r0] - add r0, r5, #0xc000 -#ifdef JAPAN - ldrb r0, [r0, #0xcb8] -#else - ldrb r0, [r0, #0xd5c] -#endif - cmp r0, #0 - beq _0230B738 - cmp r8, #2 - bne _0230B738 - ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 - mov r3, #1 - mov r0, fp - mov r1, fp - strb r3, [r5, #0x1d1] - bl MultiplyFixedPoint64 -_0230B738: - cmp r8, #5 - ldreqb r0, [r6, #0xd2] - cmpeq r0, #0xb - bne _0230B768 - ldr r0, _0230B798 ; =DUNGEON_PTR - ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 - ldr r3, [r0] - mov r5, #1 - mov r0, fp - mov r1, fp - strb r5, [r3, #0x1d2] - bl MultiplyFixedPoint64 -_0230B768: - mov r0, r4 -_0230B76C: - add sp, sp, #0x64 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -#ifdef JAPAN -#define CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET -0x2C1 -#else -#define CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET 0 -#endif -_0230B774: .word ov29_02352838 -_0230B778: .word MATCHUP_IMMUNE_MULTIPLIER_ERRATIC_PLAYER -_0230B77C: .word MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER -_0230B780: .word MATCHUP_NEUTRAL_MULTIPLIER_ERRATIC_PLAYER -_0230B784: .word MATCHUP_IMMUNE_MULTIPLIER -_0230B788: .word MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER -_0230B78C: .word MATCHUP_NEUTRAL_MULTIPLIER -_0230B790: .word MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER -_0230B794: .word MATCHUP_SUPER_EFFECTIVE_MULTIPLIER -_0230B798: .word DUNGEON_PTR -_0230B79C: .word TYPE_MATCHUP_COMBINATOR_TABLE -_0230B7A0: .word TINTED_LENS_MULTIPLIER -_0230B7A4: .word SOLID_ROCK_MULTIPLIER -_0230B7A8: .word DAMAGE_MULTIPLIER_0_5 -_0230B7AC: .word TECHNICIAN_MOVE_POWER_THRESHOLD -_0230B7B0: .word DAMAGE_MULTIPLIER_1_5 -_0230B7B4: .word 0x00000C3E + CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET -_0230B7B8: .word 0x000003E7 -_0230B7BC: .word DAMAGE_MULTIPLIER_2 -_0230B7C0: .word 0x00000C4F + CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET -#ifdef JAPAN -_0230CD24: .word 0x0000098F -#else -_0230B7C4: .word 0x00000C51 -#endif -_0230B7C8: .word 0x00000C52 + CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET -_0230B7CC: .word BURN_DAMAGE_MULTIPLIER -_0230B7D0: .word CLOUDY_DAMAGE_MULTIPLIER - arm_func_end CalcTypeBasedDamageEffects - - arm_func_start ov29_0230B7D4 -ov29_0230B7D4: ; 0x0230B7D4 - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x24 - mov sb, r1 - mov sl, r0 - mov r0, sb - mov r4, #1 - mov r8, r2 - mov fp, #0 - bl EntityIsValid__02308FBC - cmp r0, #0 - moveq r0, r4 - beq _0230BB98 - mov r0, sl - mov r1, #0x6b - ldr r7, [sl, #0xb4] - ldr r6, [sb, #0xb4] - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r8, r4 - cmp r8, #1 - cmpne r8, #7 - moveq fp, #1 - cmp r8, #2 - bne _0230B84C - mov r0, sl - mov r1, sb - bl FlashFireShouldActivate - cmp r0, #0 - movne r0, #0 - bne _0230BB98 -_0230B84C: - cmp r8, #5 - bne _0230B874 - mov r0, sl - mov r1, sb - mov r2, #0x23 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - movne r0, #0 - bne _0230BB98 -_0230B874: - cmp r8, #3 - bne _0230B89C - mov r0, sl - mov r1, sb - mov r2, #0x24 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - movne r0, #0 - bne _0230BB98 -_0230B89C: - cmp r8, #9 - bne _0230B8E0 - mov r0, sl - mov r1, #0x53 - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _0230B8C8 - mov r0, sb - bl LevitateIsActive - cmp r0, #0 - bne _0230B8D8 -_0230B8C8: - mov r0, sb - bl IsFloating - cmp r0, #0 - beq _0230B8E0 -_0230B8D8: - mov r0, #1 - b _0230BB98 -_0230B8E0: - mov r0, sl - mov r1, sb - mov r2, r8 - bl ScrappyShouldActivate - ldr r1, _0230BBA0 ; =ov29_02352884 - str r0, [sp] - add ip, sp, #4 - ldmia r1, {r0, r1, r2, r3} - stmia ip, {r0, r1, r2, r3} - mov r5, #0 - b _0230B9A0 -_0230B90C: - ldr r0, [sp] - add ip, sp, #0x14 - cmp r0, #0 - add r0, sp, #4 - ldmia r0, {r0, r1, r2, r3} - stmia ip, {r0, r1, r2, r3} - bne _0230B960 - cmp fp, #0 - beq _0230B960 - add r0, r6, r5 - ldrb r0, [r0, #0x5e] - cmp r0, #0xe - ldreqb r0, [r6, #0xfe] - cmpeq r0, #0 - bne _0230B960 - ldr r1, _0230BBA4 ; =DUNGEON_PTR - mov r0, #0 - ldr r2, [r1] - mov r1, #1 - strb r1, [r2, #0x1d4] - b _0230B978 -_0230B960: - mov r0, sl - mov r1, sb - mov r2, r5, lsl #0x10 - mov r2, r2, asr #0x10 - mov r3, r8 - bl GetTypeMatchup -_0230B978: - cmp r4, #0 - beq _0230B9A8 - add r1, sp, #0x14 - ldr r0, [r1, r0, lsl #2] - mul r0, r4, r0 - add r0, r0, r0, lsr #31 - movs r4, r0, asr #1 - moveq r0, #2 - beq _0230BB98 - add r5, r5, #1 -_0230B9A0: - cmp r5, #2 - blt _0230B90C -_0230B9A8: - cmp r8, #2 - cmpne r8, #6 - bne _0230B9D4 - mov r0, sl - mov r1, sb - mov r2, #2 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - movne r0, #2 - bne _0230BB98 -_0230B9D4: - cmp r8, #3 - bne _0230BA1C - mov r0, sl - mov r1, #0x10 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BA1C - ldrsh r2, [r7, #0x12] - ldrsh r1, [r7, #0x16] - ldr r0, _0230BBA8 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r7, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movle r4, r4, lsl #1 -_0230BA1C: - cmp r8, #4 - bne _0230BA64 - mov r0, sl - mov r1, #0x1a - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BA64 - ldrsh r2, [r7, #0x12] - ldrsh r1, [r7, #0x16] - ldr r0, _0230BBA8 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r7, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movle r4, r4, lsl #1 -_0230BA64: - cmp r8, #0xc - bne _0230BAAC - mov r0, sl - mov r1, #0x43 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BAAC - ldrsh r2, [r7, #0x12] - ldrsh r1, [r7, #0x16] - ldr r0, _0230BBA8 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r7, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movle r4, r4, lsl #1 -_0230BAAC: - cmp r8, #2 - bne _0230BAF4 - mov r0, sl - mov r1, #0x46 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BAF4 - ldrsh r2, [r7, #0x12] - ldrsh r1, [r7, #0x16] - ldr r0, _0230BBA8 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r7, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - movle r4, r4, lsl #1 -_0230BAF4: - cmp r4, #0 - moveq r0, #2 - beq _0230BB98 - mov r0, sl - mov r1, r8 - bl MonsterIsType - cmp r0, #0 - mov r0, sl - movne r4, r4, lsl #1 - bl GetApparentWeather - cmp r0, #1 - bne _0230BB3C - cmp r8, #2 - moveq r4, r4, lsl #1 - beq _0230BB3C - cmp r8, #3 - moveq r0, #2 - beq _0230BB98 -_0230BB3C: - ldr r0, _0230BBA4 ; =DUNGEON_PTR - ldr r1, [r0] - add r0, r1, #0xc000 -#ifdef JAPAN - ldrb r0, [r0, #0xcb7] -#else - ldrb r0, [r0, #0xd5b] -#endif - cmp r0, #0 - beq _0230BB60 - cmp r8, #5 - moveq r0, #2 - beq _0230BB98 -_0230BB60: - add r0, r1, #0xc000 -#ifdef JAPAN - ldrb r0, [r0, #0xcb8] -#else - ldrb r0, [r0, #0xd5c] -#endif - cmp r0, #0 - beq _0230BB7C - cmp r8, #2 - moveq r0, #2 - beq _0230BB98 -_0230BB7C: - cmp r8, #5 - ldreqb r0, [r7, #0xd2] - cmpeq r0, #0xb - moveq r4, r4, lsl #1 - cmp r4, #3 - movge r4, #3 - add r0, r4, #2 -_0230BB98: - add sp, sp, #0x24 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_0230BBA0: .word ov29_02352884 -_0230BBA4: .word DUNGEON_PTR -_0230BBA8: .word 0x000003E7 - arm_func_end ov29_0230B7D4 - - arm_func_start CalcDamage -CalcDamage: ; 0x0230BBAC -#ifdef JAPAN -#define CALC_DAMAGE_OFFSET -4 -#else -#define CALC_DAMAGE_OFFSET 0 -#endif - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0xc0 - ldr r4, _0230C450 ; =DUNGEON_PTR - mov sl, r0 - ldr r4, [r4] - ldr r6, [sl, #0xb4] - ldr r8, [sp, #0xec] - str r2, [sp, #0xc] - mov sb, r1 - ldr r1, [sp, #0xf4] - mov r0, r8 - str r1, [sp, #0xf4] - ldr r1, [sp, #0xf8] - str r3, [sp, #0x10] - str r1, [sp, #0xf8] - ldr r1, [sp, #0xf0] - add r5, r4, #0x184 - ldr r7, [sb, #0xb4] - str r1, [sp, #0x1c] - bl ResetDamageData - ldrb r0, [r6, #0x221 + CALC_DAMAGE_OFFSET] - cmp r0, #0 - beq _0230BC1C - ldr r1, _0230C454 ; =ME_FIRST_MULTIPLIER - ldr r0, [sp, #0x1c] - ldr r1, [r1] - bl MultiplyByFixedPoint - str r0, [sp, #0x1c] -_0230BC1C: - mov r0, sl - mov r1, #0x5c - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BC50 - ldr r0, [sp, #0xf4] - bl IsRecoilMove - cmp r0, #0 - ldrne r0, [sp, #0x1c] - addne r0, r0, r0, lsl #1 - addne r0, r0, r0, lsr #31 - movne r0, r0, asr #1 - strne r0, [sp, #0x1c] -_0230BC50: - mov r0, sl - mov r1, #0x65 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BC84 - ldr r0, [sp, #0xf4] - bl IsPunchMove - cmp r0, #0 - beq _0230BC84 - ldr r0, [sp, #0x1c] - mov r1, #0x180 - bl MultiplyByFixedPoint - str r0, [sp, #0x1c] -_0230BC84: - mov r0, sl - mov r1, #0x6b - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #1 - strne r0, [sp, #0xc] - ldr r1, _0230C458 ; =0x000001D3 - ldr r0, [sp, #0xf4] - cmp r0, r1 - ldreqb r0, [r6, #0x5e] - streq r0, [sp, #0xc] - ldr r0, [sp, #0xf4] - bl MoveIsNotPhysical - str r0, [sp, #0x18] - bl ResetDamageCalcDiagnostics - ldrb r0, [r6, #7] - cmp r0, #0 - bne _0230BD34 - add r0, r6, #0x100 - ldrh r1, [r0, #0x46 + CALC_DAMAGE_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + CALC_DAMAGE_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0 - bne _0230BD34 - mov r0, #1 - str r0, [r8] - mov r0, #0 - str r0, [r8, #4] - mov r0, #2 - str r0, [r8, #8] - ldr r0, [sp, #0xf4] - ldr r1, [sp, #0xc] - strb r1, [r8, #0xc] - bl GetMoveCategory - strb r0, [r8, #0xd] - mov r0, #0 - strb r0, [r8, #0xe] - strb r0, [r8, #0xf] - strb r0, [r8, #0x10] - b _0230D054 -_0230BD34: - ldr r1, _0230C45C ; =0x00000163 - ldr r0, [sp, #0xf4] - cmp r0, r1 - bne _0230BDA0 - mov r0, sl - mov r1, sb - mov r2, #0x35 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230BDA0 - mov r0, #1 - str r0, [r8] - mov r0, #0 - str r0, [r8, #4] - mov r0, #2 - str r0, [r8, #8] - ldr r0, [sp, #0xf4] - ldr r1, [sp, #0xc] - strb r1, [r8, #0xc] - bl GetMoveCategory - strb r0, [r8, #0xd] - mov r0, #0 - strb r0, [r8, #0xe] - strb r0, [r8, #0xf] - strb r0, [r8, #0x10] - b _0230D054 -_0230BDA0: - ldr r0, [sp, #0xf4] - ldr r1, [sp, #0xc] - strb r1, [r8, #0xc] - bl GetMoveCategory - strb r0, [r8, #0xd] - ldr r0, [sp, #0xc] - mov r4, #0 - strb r0, [r5] - ldr r0, [sp, #0x18] - mov r1, #0x60 - str r0, [r5, #4] - add r0, r6, r0, lsl #2 - ldr r0, [r0, #0x34] - mov fp, r4 - str r0, [sp, #0x3c] - ldr r0, [sp, #0x18] - add r0, r7, r0, lsl #2 - ldr r0, [r0, #0x3c] - str r0, [sp, #0x38] - mov r0, sl - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BE40 - ldrb r1, [r7, #0x1c] - ldrb r0, [r7, #0x1d] - cmp r1, r0 - blo _0230BE28 - ldr r0, [sp, #0x18] - cmp r0, #1 - ldreqb r0, [r5, #0x32] - addeq r4, r4, #1 - addeq r0, r0, #1 - streqb r0, [r5, #0x32] - b _0230BE40 -_0230BE28: - ldr r0, [sp, #0x18] - cmp r0, #0 - ldreqb r0, [r5, #0x32] - addeq r4, r4, #1 - addeq r0, r0, #1 - streqb r0, [r5, #0x32] -_0230BE40: - ldr r0, [sp, #0xf8] - cmp r0, #0 - ldr r0, [sp, #0x18] - add r0, r6, r0, lsl #1 - ldrsh r0, [r0, #0x24] - str r0, [sp, #0x44] - beq _0230BE70 - ldr r0, [sp, #0xc] - cmp r0, #2 - ldreqsh r0, [r6, #0x30] - streqh r0, [r5, #0x10] - addeq r4, r4, r0 -_0230BE70: - mov r0, sl - mov r1, #0x22 - bl IqSkillIsEnabled - cmp r0, #0 - ldrneb r0, [r5, #0x34] - mov r1, #0x23 - addne r4, r4, #1 - addne r0, r0, #1 - strneb r0, [r5, #0x34] - mov r0, sl - bl IqSkillIsEnabled - cmp r0, #0 - ldrneb r0, [r5, #0x34] - mov r1, #0x3c - subne r4, r4, #1 - subne r0, r0, #1 - strneb r0, [r5, #0x34] - mov r0, sl - bl IqSkillIsEnabled - cmp r0, #0 - ldrneb r0, [r6, #0x166 + CALC_DAMAGE_OFFSET] - mov r1, #0x32 - cmpne r0, #0 - ldrneb r0, [r5, #0x34] - addne r4, r4, #1 - addne r0, r0, #1 - strneb r0, [r5, #0x34] - mov r0, sl - bl NearbyAllyIqSkillIsEnabled - cmp r0, #0 - ldr r0, [sp, #0x18] - addne r4, r4, #1 - cmp r0, #0 - mov r0, sl - bne _0230BFA8 - mov r1, #0x68 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BF5C - ldrsh r0, [r6, #4] - ldrsh r1, [r7, #4] - bl GendersEqualNotGenderless - cmp r0, #0 - ldrneb r0, [r5, #0x32] - addne r4, r4, #1 - addne r0, r0, #1 - strneb r0, [r5, #0x32] - bne _0230BF5C - ldrsh r0, [r6, #4] - bl GetMonsterGenderVeneer - cmp r0, #3 - beq _0230BF5C - ldrsh r0, [r7, #4] - bl GetMonsterGenderVeneer - cmp r0, #3 - ldrneb r0, [r5, #0x32] - subne r4, r4, #1 - subne r0, r0, #1 - strneb r0, [r5, #0x32] -_0230BF5C: - mov r0, sl - bl GetApparentWeather - cmp r0, #1 - bne _0230C040 - mov r0, sl - mov r1, #0x71 - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _0230BF94 - mov r0, sl - mov r1, #0x71 - bl OtherMonsterAbilityIsActive - cmp r0, #0 - beq _0230C040 -_0230BF94: - add r4, r4, #1 - ldrb r0, [r5, #0x32] - add r0, r0, #1 - strb r0, [r5, #0x32] - b _0230C040 -_0230BFA8: - mov r1, #0x5a - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230BFD4 - mov r0, sl - bl GetApparentWeather - cmp r0, #1 - ldreqb r0, [r5, #0x32] - addeq r4, r4, #2 - addeq r0, r0, #2 - streqb r0, [r5, #0x32] -_0230BFD4: - mov r0, sb - bl GetApparentWeather - cmp r0, #1 - bne _0230C01C - mov r0, sb - mov r1, #0x71 - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _0230C00C - mov r0, sb - mov r1, #0x71 - bl OtherMonsterAbilityIsActive - cmp r0, #0 - beq _0230C01C -_0230C00C: - add fp, fp, #1 - ldrb r0, [r5, #0x33] - add r0, r0, #1 - strb r0, [r5, #0x33] -_0230C01C: - mov r0, sb - bl GetApparentWeather - cmp r0, #2 - bne _0230C040 - ldrb r0, [r7, #0x5e] - cmp r0, #0xd - ldrneb r0, [r7, #0x5f] - cmpne r0, #0xd - addeq fp, fp, #2 -_0230C040: - ldrsh r1, [r6, #4] - ldr r0, _0230C460 ; =0x000001A3 - cmp r1, r0 - addeq r4, r4, #2 - cmp r1, #0x1a4 - ldr r0, _0230C464 ; =0x000001A5 - subeq r4, r4, #2 - cmp r1, r0 - ldr r0, _0230C468 ; =0x00000211 - subeq r4, r4, #2 - cmp r1, r0 - subeq r4, r4, #2 - beq _0230C07C - cmp r1, #0x218 - addeq r4, r4, #2 -_0230C07C: - ldr r0, [sp, #0x44] - add r0, r0, r4 - str r0, [sp, #0x44] - ldrb r0, [r6, #0x167 + CALC_DAMAGE_OFFSET] - cmp r0, #0 - beq _0230C0AC - mov r0, sl - mov r1, #0x4f - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #0x14 - strne r0, [sp, #0x44] -_0230C0AC: - ldr r0, [sp, #0x18] - cmp r0, #0 - add r0, r7, r0, lsl #1 - ldrsh r4, [r0, #0x28] - bne _0230C0F4 - ldrb r0, [r7, #0xd2] - mov r1, #0x31 - cmp r0, #6 - moveq r0, #1 - streqb r0, [r5, #0x51] - mov r0, sb - addeq fp, fp, #1 - bl IqSkillIsEnabled - cmp r0, #0 - ldrneb r0, [r5, #0x35] - subne fp, fp, #1 - subne r0, r0, #1 - strneb r0, [r5, #0x35] -_0230C0F4: - mov r0, sb - mov r1, #0x22 - bl IqSkillIsEnabled - cmp r0, #0 - ldrneb r0, [r5, #0x35] - mov r1, #0x23 - subne fp, fp, #1 - subne r0, r0, #1 - strneb r0, [r5, #0x35] - mov r0, sb - bl IqSkillIsEnabled - cmp r0, #0 - ldrneb r0, [r5, #0x35] - addne fp, fp, #1 - addne r0, r0, #1 - strneb r0, [r5, #0x35] - ldrsh r1, [r7, #4] - ldr r0, _0230C460 ; =0x000001A3 - cmp r1, r0 - subeq fp, fp, #2 - cmp r1, #0x1a4 - ldr r0, _0230C464 ; =0x000001A5 - addeq fp, fp, #2 - cmp r1, r0 -#ifdef JAPAN - ldrsh r1, [r6, #4] -#endif - ldr r0, _0230C468 ; =0x00000211 - subeq fp, fp, #2 - cmp r1, r0 - addeq fp, fp, #2 - beq _0230C170 - cmp r1, #0x218 - subeq fp, fp, #2 -_0230C170: - ldr r1, _0230C46C ; =0x000001BD - ldr r0, [sp, #0xf4] - add r4, r4, fp - cmp r0, r1 - bne _0230C1F4 - ldrsh r1, [r7, #0x24] - mov r0, #0 - cmp r1, #0xa - subgt r1, r1, #0xa - addgt r0, r0, r1 - movgt r0, r0, lsl #0x10 - ldrsh r1, [r7, #0x28] - movgt r0, r0, asr #0x10 - cmp r1, #0xa - subgt r1, r1, #0xa - addgt r0, r0, r1 - movgt r0, r0, lsl #0x10 - ldrsh r1, [r7, #0x26] - movgt r0, r0, asr #0x10 - cmp r1, #0xa - subgt r1, r1, #0xa - addgt r0, r0, r1 - movgt r0, r0, lsl #0x10 - ldrsh r1, [r7, #0x2a] - movgt r0, r0, asr #0x10 - cmp r1, #0xa - subgt r1, r1, #0xa - addgt r0, r0, r1 - movgt r0, r0, lsl #0x10 - ldr r1, [sp, #0x44] - movgt r0, r0, asr #0x10 - add r0, r1, r0 - str r0, [sp, #0x44] -_0230C1F4: - mov r0, sl - mov r1, #0x67 - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #0x100 - movne r4, #0xa - strne r0, [sp, #0x38] - bne _0230C23C - mov r0, sl - mov r1, sb - mov r2, #0x67 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - movne r0, #0xa - strne r0, [sp, #0x44] - movne r0, #0x100 - strne r0, [sp, #0x3c] -_0230C23C: - ldr r0, [sp, #0x44] - ldr r1, [sp, #0x18] - cmp r0, #0 - movlt r0, #0 - strlt r0, [sp, #0x44] - ldr r0, [sp, #0x44] - ldr r2, _0230C470 ; =OFFENSIVE_STAT_STAGE_MULTIPLIERS - cmp r0, #0x14 - movgt r0, #0x14 - strgt r0, [sp, #0x44] - ldr r0, [sp, #0x44] - strb r0, [r5, #0xa] - add r0, r6, #0x1a - ldrb r3, [r0, r1] - ldr r1, [sp, #0x44] - ldr fp, [r2, r1, lsl #2] - ldr r1, [sp, #0x18] - strh r3, [r5, #0xc] - ldrb r0, [r0, r1] - mov r1, fp - mov r0, r0, lsl #8 - bl MultiplyByFixedPoint - ldr r1, [sp, #0x3c] - bl MultiplyByFixedPoint - mov r0, r0, asr #8 - cmp r4, #0 - movlt r4, #0 - str r0, [sp, #0x90] - cmp r4, #0x14 - movgt r4, #0x14 - ldr r1, [sp, #0x18] - strb r4, [r5, #0xb] - add r0, r7, #0x1c - ldrb r2, [r0, r1] - ldr r1, _0230C474 ; =DEFENSIVE_STAT_STAGE_MULTIPLIERS - strh r2, [r5, #0xe] - ldr r2, [sp, #0x18] - ldr r1, [r1, r4, lsl #2] - ldrb r0, [r0, r2] - mov r0, r0, lsl #8 - bl MultiplyByFixedPoint - ldr r1, [sp, #0x38] - bl MultiplyByFixedPoint - mov r0, r0, asr #8 - str r0, [sp, #0x94] - ldrb r0, [r6, #6] - cmp r0, #0 - bne _0230C314 - ldr r1, [sp, #0x18] - mov r0, sl - bl ExclusiveItemOffenseBoost - ldr r1, [sp, #0x90] - add r0, r1, r0 - str r0, [sp, #0x90] -_0230C314: - ldrb r0, [r7, #6] - cmp r0, #0 - bne _0230C338 - ldr r1, [sp, #0x18] - mov r0, sb - bl ExclusiveItemDefenseBoost - ldr r1, [sp, #0x94] - add r0, r1, r0 - str r0, [sp, #0x94] -_0230C338: - ldr r0, [sp, #0x18] - cmp r0, #0 - bne _0230C4D8 - mov r0, sl - mov r1, #0x1a - bl ItemIsActive__0230A9DC - cmp r0, #0 - beq _0230C378 - ldr r0, _0230C478 ; =POWER_BAND_STAT_BOOST - ldr r1, [sp, #0x90] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x90] - ldrb r0, [r5, #0x30] - add r0, r0, r2 - strb r0, [r5, #0x30] -_0230C378: - mov r0, sl - mov r1, #0x32 - bl ItemIsActive__0230A9DC - cmp r0, #0 - beq _0230C3AC - ldr r0, _0230C47C ; =MUNCH_BELT_STAT_BOOST - ldr r1, [sp, #0x90] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x90] - ldrb r0, [r5, #0x30] - add r0, r0, r2 - strb r0, [r5, #0x30] -_0230C3AC: - mov r0, sl - bl AuraBowIsActive - cmp r0, #0 - beq _0230C3DC - ldr r0, _0230C480 ; =AURA_BOW_STAT_BOOST - ldr r1, [sp, #0x90] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x90] - ldrb r0, [r5, #0x31] - add r0, r0, r2 - strb r0, [r5, #0x31] -_0230C3DC: - ldr r0, [sp, #0xf8] - cmp r0, #0 - beq _0230C5E0 - mov r0, sb - mov r1, #0x25 - bl ItemIsActive__0230A9DC - cmp r0, #0 - beq _0230C41C - ldr r0, _0230C484 ; =DEF_SCARF_STAT_BOOST - ldr r1, [sp, #0x94] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x94] - ldrb r0, [r5, #0x36] - add r0, r0, r2 - strb r0, [r5, #0x36] -_0230C41C: - mov r0, sb - bl AuraBowIsActive - cmp r0, #0 - beq _0230C5E0 - ldr r0, _0230C480 ; =AURA_BOW_STAT_BOOST - ldr r1, [sp, #0x94] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x94] - ldrb r0, [r5, #0x36] - add r0, r0, r2 - strb r0, [r5, #0x36] - b _0230C5E0 - .align 2, 0 -#ifdef JAPAN -#define CALC_DAMAGE_DATA_OFFSET -0x2C1 -#else -#define CALC_DAMAGE_DATA_OFFSET 0 -#endif -_0230C450: .word DUNGEON_PTR -_0230C454: .word ME_FIRST_MULTIPLIER -_0230C458: .word 0x000001D3 -_0230C45C: .word 0x00000163 -_0230C460: .word 0x000001A3 -_0230C464: .word 0x000001A5 -_0230C468: .word 0x00000211 -_0230C46C: .word 0x000001BD -_0230C470: .word OFFENSIVE_STAT_STAGE_MULTIPLIERS -_0230C474: .word DEFENSIVE_STAT_STAGE_MULTIPLIERS -_0230C478: .word POWER_BAND_STAT_BOOST -_0230C47C: .word MUNCH_BELT_STAT_BOOST -_0230C480: .word AURA_BOW_STAT_BOOST -_0230C484: .word DEF_SCARF_STAT_BOOST -_0230C488: .word ZINC_BAND_STAT_BOOST -_0230C48C: .word SPECIAL_BAND_STAT_BOOST -_0230C490: .word 0x00000C53 + CALC_DAMAGE_DATA_OFFSET -_0230C494: .word 0x00000C54 + CALC_DAMAGE_DATA_OFFSET -_0230C498: .word 0x00000C55 + CALC_DAMAGE_DATA_OFFSET -_0230C49C: .word 0x000003E7 -_0230C4A0: .word DAMAGE_FORMULA_FLV_DEFICIT_DIVISOR -_0230C4A4: .word ov29_02352984 -_0230C4A8: .word ov29_02352990 -_0230C4AC: .word ov29_0235299C -_0230C4B0: .word DAMAGE_FORMULA_AT_PREFACTOR -_0230C4B4: .word DAMAGE_FORMULA_DEF_PREFACTOR -_0230C4B8: .word DAMAGE_FORMULA_FLV_SHIFT -_0230C4BC: .word DAMAGE_FORMULA_LN_ARG_PREFACTOR -_0230C4C0: .word DAMAGE_FORMULA_LN_PREFACTOR -_0230C4C4: .word DAMAGE_FORMULA_CONSTANT_SHIFT -_0230C4C8: .word DAMAGE_FORMULA_NON_TEAM_MEMBER_MODIFIER -_0230C4CC: .word DAMAGE_FORMULA_MAX_BASE -_0230C4D0: .word ov29_02352838 -_0230C4D4: .word DAMAGE_FORMULA_MIN_BASE -_0230C4D8: - ldr r0, [sp, #0xf8] - cmp r0, #0 - beq _0230C548 - mov r0, sb - mov r1, #0x29 - bl ItemIsActive__0230A9DC - cmp r0, #0 - beq _0230C518 - ldr r0, _0230C488 ; =ZINC_BAND_STAT_BOOST - ldr r1, [sp, #0x94] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x94] - ldrb r0, [r5, #0x37] - add r0, r0, r2 - strb r0, [r5, #0x37] -_0230C518: - mov r0, sb - bl AuraBowIsActive - cmp r0, #0 - beq _0230C548 - ldr r0, _0230C480 ; =AURA_BOW_STAT_BOOST - ldr r1, [sp, #0x94] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x94] - ldrb r0, [r5, #0x36] - add r0, r0, r2 - strb r0, [r5, #0x36] -_0230C548: - mov r0, sl - mov r1, #0x28 - bl ItemIsActive__0230A9DC - cmp r0, #0 - beq _0230C57C - ldr r0, _0230C48C ; =SPECIAL_BAND_STAT_BOOST - ldr r1, [sp, #0x90] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x90] - ldrb r0, [r5, #0x31] - add r0, r0, r2 - strb r0, [r5, #0x31] -_0230C57C: - mov r0, sl - mov r1, #0x32 - bl ItemIsActive__0230A9DC - cmp r0, #0 - beq _0230C5B0 - ldr r0, _0230C47C ; =MUNCH_BELT_STAT_BOOST - ldr r1, [sp, #0x90] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x90] - ldrb r0, [r5, #0x31] - add r0, r0, r2 - strb r0, [r5, #0x31] -_0230C5B0: - mov r0, sb - bl AuraBowIsActive - cmp r0, #0 - beq _0230C5E0 - ldr r0, _0230C480 ; =AURA_BOW_STAT_BOOST - ldr r1, [sp, #0x90] - ldrsh r2, [r0] - add r0, r1, r2 - str r0, [sp, #0x90] - ldrb r0, [r5, #0x31] - add r0, r0, r2 - strb r0, [r5, #0x31] -_0230C5E0: - ldr r0, [sp, #0x10] - mov r1, fp - mov r0, r0, lsl #8 - bl MultiplyByFixedPoint - ldr r1, [sp, #0x3c] - bl MultiplyByFixedPoint - mov r1, r0 - add r0, sp, #0xa0 - bl FixedPoint32To64 - mov r0, #0x64 - bl DungeonRandInt - mov r4, #1 - str r0, [sp, #0x40] - add r0, r6, #0x100 - ldrh r1, [r0, #0x5a + CALC_DAMAGE_OFFSET] - mov fp, r4 - str r4, [sp, #0x28] - bic r1, r1, #0x100 - strh r1, [r0, #0x5a + CALC_DAMAGE_OFFSET] - ldrh r1, [r0, #0x58 + CALC_DAMAGE_OFFSET] - str r4, [sp, #0x2c] - bic r1, r1, #0x100 - strh r1, [r0, #0x58 + CALC_DAMAGE_OFFSET] - ldr r0, [sp, #0xf4] - bl MoveIsNotPhysical - str r0, [sp, #0x30] - cmp r0, #0 - bne _0230C6B8 - mov r0, sl - mov r1, #0x11 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230C6B8 - ldr r0, [sl, #0xb4] - mov r1, r4 - str r0, [sp, #0x24] - mov r0, sl - bl MonsterHasNegativeStatus - str r0, [sp, #0x48] - ldr r0, [sp, #0x24] - ldr r2, [sp, #0x48] - mov r1, r4 - bl UpdateStateFlags - ldr r1, [sp, #0x48] - cmp r1, #0 - movne r4, r4, lsl #1 - cmp r0, #0 - beq _0230C6B8 - mov r0, sl - bl PlayEffectAnimation0x1A9__022E6130 - mov r0, sl - mov r1, sb - ldr r2, _0230C490 ; =0x00000C53 - bl LogMessageByIdWithPopupCheckUserTarget -_0230C6B8: - mov r0, sl - mov r1, #0x22 - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _0230C6E0 - mov r0, sl - mov r1, #0x4b - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230C748 -_0230C6E0: - ldr r0, [sp, #0x40] - cmp r0, #0x21 - ldr r0, [sl, #0xb4] - bge _0230C700 - ldr r1, [sp, #0x30] - cmp r1, #0 - moveq r1, #1 - beq _0230C704 -_0230C700: - mov r1, #0 -_0230C704: - and r1, r1, #0xff - str r1, [sp, #0x34] - ldr r2, [sp, #0x34] - mov r1, #0x100 - bl UpdateStateFlags - ldr r1, [sp, #0x34] - cmp r1, #0 - addne r4, r4, r4, lsl #1 - movne fp, fp, lsl #1 - cmp r0, #0 - beq _0230C748 - mov r0, sl - bl PlayEffectAnimation0x1A9__022E617C - mov r0, sl - mov r1, sb - ldr r2, _0230C494 ; =0x00000C54 - bl LogMessageByIdWithPopupCheckUserTarget -_0230C748: - mov r0, sl - mov r1, #0x30 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230C76C - ldr r0, [sp, #0x30] - cmp r0, #0 - addeq r4, r4, r4, lsl #1 - moveq fp, fp, lsl #1 -_0230C76C: - ldr r0, [sl, #0xb4] - mov r1, #0x38 - ldrb r0, [r0, #6] - cmp r0, #0 - moveq r0, #1 - streq r0, [sp, #0x14] - movne r0, #0 - strne r0, [sp, #0x14] - mov r0, sl - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230C7D4 - ldr r0, [sp, #0x30] - cmp r0, #1 - bne _0230C7D4 - ldr r0, _0230C450 ; =DUNGEON_PTR - ldr r1, [r0] - ldr r0, [sp, #0x14] - add r0, r1, r0 - add r0, r0, #0x3000 -#ifdef JAPAN - ldrb r0, [r0, #0xd92] -#else - ldrb r0, [r0, #0xe36] -#endif - cmp r0, #0 - movne r0, #0xa - mulne r0, fp, r0 - rsbne r4, r4, r4, lsl #4 - movne fp, r0 -_0230C7D4: - mov r0, sl - mov r1, #0x3f - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230C820 - ldr r0, [sp, #0x30] - cmp r0, #1 - bne _0230C820 - ldr r0, _0230C450 ; =DUNGEON_PTR - ldr r1, [r0] - ldr r0, [sp, #0x14] - add r0, r1, r0 - add r0, r0, #0x3000 -#ifdef JAPAN - ldrb r0, [r0, #0xd90] -#else - ldrb r0, [r0, #0xe34] -#endif - cmp r0, #0 - movne r0, #0xa - mulne r0, fp, r0 - rsbne r4, r4, r4, lsl #4 - movne fp, r0 -_0230C820: - mov r0, sl - mov r1, sb - mov r2, #6 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230C84C - ldr r0, [sp, #0x30] - cmp r0, #0 - moveq r4, r4, lsl #2 - addeq fp, fp, fp, lsl #2 -_0230C84C: - mov r0, sl - mov r1, sb - mov r2, #0x34 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230C8E0 - ldr r0, [sp, #0x30] - cmp r0, #0 - bne _0230C8E0 - ldr r0, [sb, #0xb4] - mov r1, #1 - str r0, [sp, #0x20] - mov r0, sb - bl MonsterHasNegativeStatus - str r0, [sp, #0x4c] - ldr r0, [sp, #0x20] - ldr r2, [sp, #0x4c] - mov r1, #8 - bl UpdateStateFlags - ldr r1, [sp, #0x4c] - cmp r1, #0 - beq _0230C8C0 - ldr r1, [sp, #0x28] - add r1, r1, r1, lsl #1 - str r1, [sp, #0x28] - ldr r1, [sp, #0x2c] - mov r1, r1, lsl #1 - str r1, [sp, #0x2c] -_0230C8C0: - cmp r0, #0 - beq _0230C8E0 - mov r0, sb - bl PlayEffectAnimation0x18E - mov r0, sl - mov r1, sb - ldr r2, _0230C498 ; =0x00000C55 - bl LogMessageByIdWithPopupCheckUserTarget -_0230C8E0: - add r0, sp, #0x90 - ldr r2, [r0] - add r1, sp, #0x94 - mul r0, r2, r4 - ldr r3, [r1] - ldr r2, [sp, #0x28] - cmp fp, #1 - mul r2, r3, r2 - str r2, [r1] - add r1, sp, #0x90 - str r0, [r1] - beq _0230C920 - mov r1, fp - bl _s32_div_f - add r1, sp, #0x90 - str r0, [r1] -_0230C920: - ldr r0, [sp, #0x2c] - cmp r0, #1 - beq _0230C940 - add r4, sp, #0x94 - mov r1, r0 - ldr r0, [r4] - bl _s32_div_f - str r0, [r4] -_0230C940: - ldr r0, [sp, #0x90] - strh r0, [r5, #0x12] - ldr r0, [sp, #0x94] - strh r0, [r5, #0x14] - ldr r0, [sp, #0x90] - cmp r0, #0 - movlt r0, #0 - strlt r0, [sp, #0x90] - ldr r1, [sp, #0x90] - ldr r0, _0230C49C ; =0x000003E7 - cmp r1, r0 - strge r0, [sp, #0x90] - ldr r1, [sp, #0x94] - add r0, sp, #0x98 - strh r1, [r5, #0x1a] - ldr r1, [sp, #0x94] - bl IntToFixedPoint64 - ldr r2, [sp, #0x90] - ldr r1, [sp, #0x94] - add r0, sp, #0x88 - sub r1, r2, r1 - bl IntToFixedPoint64 - ldr r1, _0230C4A0 ; =DAMAGE_FORMULA_FLV_DEFICIT_DIVISOR - add r0, sp, #0x80 - ldr r1, [r1] - bl FixedPoint32To64 - add r0, sp, #0x88 - add r2, sp, #0x80 - mov r1, r0 - bl DivideFixedPoint64 - ldrb r1, [r6, #0xa] - add r0, sp, #0x80 - bl IntToFixedPoint64 - add r0, sp, #0xa8 - add r1, sp, #0x80 - add r2, sp, #0x88 - bl AddFixedPoint64 - ldr r1, [sp, #0x90] - add r0, sp, #0x80 - bl IntToFixedPoint64 - add r0, sp, #0xa0 - add r2, sp, #0x80 - mov r1, r0 - bl AddFixedPoint64 - add r0, sp, #0xa0 - bl FixedPoint64ToInt - strh r0, [r5, #0x18] - ldrb r1, [r6, #0xa] - add r0, sp, #0xa8 - strh r1, [r5, #0x16] - bl FixedPoint64ToInt - strh r0, [r5, #0x1c] - add r0, sp, #0xa8 - bl FixedPoint64ToInt - mov r1, r0 - ldr r0, _0230C4A4 ; =ov29_02352984 - bl Debug_Print0 - add r0, sp, #0xa0 - bl FixedPoint64ToInt - mov r1, r0 - ldr r0, _0230C4A8 ; =ov29_02352990 - bl Debug_Print0 - add r0, sp, #0x98 - bl FixedPoint64ToInt - mov r1, r0 - ldr r0, _0230C4AC ; =ov29_0235299C - bl Debug_Print0 - ldr r1, _0230C4B0 ; =DAMAGE_FORMULA_AT_PREFACTOR - add r0, sp, #0x70 - ldr r1, [r1] - bl FixedPoint32To64 - add r0, sp, #0x70 - add r1, sp, #0xa0 - mov r2, r0 - bl MultiplyFixedPoint64 - ldr r1, _0230C4B4 ; =DAMAGE_FORMULA_DEF_PREFACTOR - add r0, sp, #0x68 - ldr r1, [r1] - bl FixedPoint32To64 - add r0, sp, #0x68 - add r1, sp, #0x98 - mov r2, r0 - bl MultiplyFixedPoint64 - ldr r1, _0230C4B8 ; =DAMAGE_FORMULA_FLV_SHIFT - add r0, sp, #0x78 - ldr r1, [r1] - bl FixedPoint32To64 - add r0, sp, #0x60 - add r1, sp, #0xa8 - add r2, sp, #0x78 - bl AddFixedPoint64 - ldr r1, _0230C4BC ; =DAMAGE_FORMULA_LN_ARG_PREFACTOR - add r0, sp, #0x78 - ldr r1, [r1] - bl FixedPoint32To64 - add r0, sp, #0x60 - add r2, sp, #0x78 - mov r1, r0 - bl MultiplyFixedPoint64 - add r0, sp, #0x60 - bl FixedPoint64ToInt - mov r1, r0 - add r0, sp, #0x60 - bl ClampedLn - ldr r1, _0230C4C0 ; =DAMAGE_FORMULA_LN_PREFACTOR - add r0, sp, #0x78 - ldr r1, [r1] - bl FixedPoint32To64 - add r0, sp, #0x60 - add r2, sp, #0x78 - mov r1, r0 - bl MultiplyFixedPoint64 - add r0, sp, #0xb0 - add r1, sp, #0x68 - add r2, sp, #0x70 - bl AddFixedPoint64 - add r0, sp, #0xb0 - add r2, sp, #0x60 - mov r1, r0 - bl AddFixedPoint64 - ldr r1, _0230C4C4 ; =DAMAGE_FORMULA_CONSTANT_SHIFT - add r0, sp, #0x78 - ldr r1, [r1] - bl FixedPoint32To64 - add r0, sp, #0xb0 - add r2, sp, #0x78 - mov r1, r0 - bl AddFixedPoint64 - bl FixedRoomIsSubstituteRoom - cmp r0, #0 - bne _0230CB78 - ldrb r0, [r6, #6] - cmp r0, #0 - beq _0230CB78 - ldr r1, _0230C4C8 ; =DAMAGE_FORMULA_NON_TEAM_MEMBER_MODIFIER - add r0, sp, #0x78 - ldr r1, [r1] - bl FixedPoint32To64 - add r0, sp, #0xb0 - add r2, sp, #0x78 - mov r1, r0 - bl DivideFixedPoint64 -_0230CB78: - ldr r0, _0230C4CC ; =DAMAGE_FORMULA_MAX_BASE - add r1, sp, #0xb0 - bl FixedPoint64CmpLt - cmp r0, #0 - ldrne r0, _0230C4D0 ; =ov29_02352838 - ldrne r1, [r0, #0x38] - ldrne r0, [r0, #0x34] - strne r1, [sp, #0xb4] - strne r0, [sp, #0xb0] - ldr r1, _0230C4D4 ; =DAMAGE_FORMULA_MIN_BASE - add r0, sp, #0xb0 - bl FixedPoint64CmpLt - cmp r0, #0 - ldrne r0, _0230C4D0 ; =ov29_02352838 - ldrne r1, [r0, #0x48] - ldrne r0, [r0, #0x44] - strne r1, [sp, #0xb4] - strne r0, [sp, #0xb0] - ldr r0, [sp, #0xf4] - bl IsRegularAttackOrProjectile - cmp r0, #0 - ldr r0, [sp, #0xc] - movne r1, #1 - str r0, [sp] - moveq r1, #0 - and r1, r1, #0xff - str r8, [sp, #4] - str r1, [sp, #8] - ldr r3, [sp, #0x10] - add r0, sp, #0xb8 - mov r1, sl - mov r2, sb - bl CalcTypeBasedDamageEffects - mov fp, r0 - ldr r0, [sp, #0xc] - cmp r0, #2 - bne _0230CC78 - mov r0, sl - mov r1, sb - bl FlashFireShouldActivate - movs r4, r0 - beq _0230CC78 - ldrb r0, [r7, #0x15c + CALC_DAMAGE_OFFSET] - cmp r0, #0 - bne _0230CC78 - ldr r0, [sp, #0xf8] - cmp r0, #0 - beq _0230CC78 - mov r0, #1 - mov r1, sb - strb r0, [r7, #0x15c + CALC_DAMAGE_OFFSET] - mov r2, #0 - bl SubstitutePlaceholderStringTags - cmp r4, #1 - bne _0230CC68 - ldr r2, _0230D05C ; =0x00000C58 - mov r0, sl - mov r1, sb - bl LogMessageByIdWithPopupCheckUserTarget - b _0230CC78 -_0230CC68: - ldr r2, _0230D060 ; =0x00000C57 - mov r0, sl - mov r1, sb - bl LogMessageByIdWithPopupCheckUserTarget -_0230CC78: - ldr r0, [sp, #0xf8] - cmp r0, #0 - beq _0230CD3C - mov r0, sl - mov r1, #0x44 - bl ExclusiveItemEffectIsActive__0230A9B8 - cmp r0, #0 - bne _0230CD3C - ldr r0, [sp, #0x18] - cmp r0, #0 - bne _0230CCF0 - ldr r0, [sp, #0xf4] - cmp r0, #0x48 - beq _0230CCBC - ldrb r0, [r7, #0xd5] - cmp r0, #1 - beq _0230CCD0 -_0230CCBC: - mov r0, sb - mov r1, #0x1e - bl ExclusiveItemEffectIsActive__0230A9B8 - cmp r0, #0 - beq _0230CCF0 -_0230CCD0: - mov r0, sb - bl PlayEffectAnimation0x171 - add r0, sp, #0xb8 - ldr r2, _0230D064 ; =DAMAGE_MULTIPLIER_0_5 - mov r1, r0 - bl MultiplyFixedPoint64 - mov r0, #1 - strb r0, [r5, #0x3a] -_0230CCF0: - ldr r0, [sp, #0x18] - cmp r0, #1 - bne _0230CD3C - ldrb r0, [r7, #0xd5] - cmp r0, #3 - beq _0230CD1C - mov r0, sb - mov r1, #0x1f - bl ExclusiveItemEffectIsActive__0230A9B8 - cmp r0, #0 - beq _0230CD3C -_0230CD1C: - mov r0, sb - bl PlayEffectAnimation0x171Full - add r0, sp, #0xb8 - ldr r2, _0230D064 ; =DAMAGE_MULTIPLIER_0_5 - mov r1, r0 - bl MultiplyFixedPoint64 - mov r0, #1 - strb r0, [r5, #0x3b] -_0230CD3C: - ldrb r0, [r7, #0xd5] - cmp r0, #0x11 - beq _0230CEEC - mov r0, sl - mov r1, sb - mov r2, #0xc -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - bne _0230CEEC - mov r0, sl - mov r1, sb - mov r2, #0x13 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - bne _0230CEEC - mov r0, sb - mov r1, #0x40 - bl IqSkillIsEnabled - cmp r0, #0 - bne _0230CEEC - ldrsh r0, [r6, #2] - bl GetMonsterGenderVeneer - cmp r0, #2 - ldrne r1, [sp, #0xe8] - ldreq r4, [sp, #0xe8] - addne r0, r1, r1, lsr #31 - addne r4, r1, r0, asr #1 - ldrb r0, [r6, #0xec] - cmp r0, #4 - moveq r0, #1 - streqb r0, [r5, #0x3c] - ldreq r4, _0230C49C ; =0x000003E7 - beq _0230CE74 - mov r0, sl - mov r1, #0x13 - bl ItemIsActive__0230A9DC - cmp r0, #0 - bne _0230CDF0 - mov r0, sl - mov r1, #0x1d - bl IqSkillIsEnabled - cmp r0, #0 - beq _0230CE04 -_0230CDF0: - ldr r0, _0230D068 ; =SCOPE_LENS_CRIT_RATE_BOOST - mov r1, #1 - ldrsh r0, [r0] - strb r1, [r5, #0x38] - add r4, r4, r0 -_0230CE04: - mov r0, sl - mov r1, #0x58 - bl AbilityIsActiveVeneer - cmp r0, #0 - ldrne r0, _0230D06C ; =SUPER_LUCK_CRIT_RATE_BOOST - movne r1, #1 - ldrnesh r0, [r0] - strneb r1, [r5, #0x49] - mov r1, #0x14 - addne r4, r4, r0 - mov r0, sb - bl ItemIsActive__0230A9DC - cmp r0, #0 - ldrne r0, _0230D068 ; =SCOPE_LENS_CRIT_RATE_BOOST - movne r1, #1 - ldrnesh r0, [r0] - strneb r1, [r5, #0x39] - addne r4, r4, r0 - cmp fp, #0 - beq _0230CE74 - mov r0, sl - mov r1, #1 - bl IqSkillIsEnabled - cmp r0, #0 - ldrne r0, _0230D070 ; =TYPE_ADVANTAGE_MASTER_CRIT_RATE - movne r1, #1 - ldrnesh r4, [r0] - strneb r1, [r5, #0x3d] -_0230CE74: - mov r0, #0x64 - bl DungeonRandInt - cmp r0, r4 - bge _0230CEEC - mov r2, #1 - mov r4, #5 - mov r0, sl - mov r1, sb -#ifdef JAPAN - add r3, r2, #0xb00 -#else - add r3, r2, #0xdc0 -#endif - str r4, [sp] - bl ExclusiveItemEffectIsActiveWithLogging - cmp r0, #0 - bne _0230CEEC - mov r2, #1 - mov r0, sl - mov r1, #0x5d - strb r2, [r8, #0xe] - bl AbilityIsActiveVeneer - cmp r0, #0 - add r0, sp, #0xb8 - beq _0230CEE0 - ldr r2, _0230D074 ; =DAMAGE_MULTIPLIER_2 - mov r1, r0 - bl MultiplyFixedPoint64 - mov r0, #1 - strb r0, [r5, #0x4a] - b _0230CEEC -_0230CEE0: - ldr r2, _0230D078 ; =DAMAGE_MULTIPLIER_1_5 - mov r1, r0 - bl MultiplyFixedPoint64 -_0230CEEC: - add r0, sp, #0xb0 - bl FixedPoint64ToInt - str r0, [r5, #0x24] - add r0, sp, #0xb0 - add r2, sp, #0xb8 - mov r1, r0 - bl MultiplyFixedPoint64 - ldr r1, [sp, #0x1c] - add r0, sp, #0x58 - mov r2, r1 - str r2, [r5, #0x2c] - bl FixedPoint32To64 - add r0, sp, #0xb0 - add r2, sp, #0x58 - mov r1, r0 - bl MultiplyFixedPoint64 - add r0, sp, #0xb0 - bl FixedPoint64ToInt - str r0, [r5, #0x20] - mov r0, #0x4000 - bl DungeonRandInt - add r0, r0, #0xe000 - mov r1, #0 - str r0, [sp, #0xbc] - add r0, sp, #0xb0 - str r1, [sp, #0xb8] - add r2, sp, #0xb8 - mov r1, r0 - bl MultiplyFixedPoint64 - add r0, sp, #0x50 - mov r1, #0x64 - bl IntToFixedPoint64 - add r0, sp, #0xb8 - add r1, sp, #0x50 - mov r2, r0 - bl MultiplyFixedPoint64 - add r0, sp, #0xb8 - bl FixedPoint64ToInt - str r0, [r5, #0x28] - add r0, sp, #0xb0 - bl FixedPoint64ToInt - str r0, [r8] - ldr r1, _0230D07C ; =0x00000195 - ldr r0, [sp, #0xf4] - cmp r0, r1 - bne _0230CFBC - ldr r0, [r8] - mov r1, #0x80 - mov r0, r0, lsl #8 - bl MultiplyByFixedPoint - bl RoundUpDiv256 - str r0, [r8] -_0230CFBC: - ldr r1, _0230D07C ; =0x00000195 - ldr r0, [sp, #0xf4] - cmp r0, r1 - bne _0230CFFC - mov r0, sl - mov r1, #0x2f - bl IqSkillIsEnabled - cmp r0, #0 - beq _0230CFFC - ldr r0, _0230D080 ; =POWER_PITCHER_DAMAGE_MULTIPLIER - ldr r2, [r8] - ldr r1, [r0] - mov r0, r2, lsl #8 - bl MultiplyByFixedPoint - bl RoundUpDiv256 - str r0, [r8] -_0230CFFC: - ldr r0, [r8] - cmp r0, #0 - ble _0230D038 - mov r0, sl - mov r1, #0x5b - bl ExclusiveItemEffectIsActive__0230A9B8 - cmp r0, #0 - beq _0230D038 - ldr r0, _0230D084 ; =AIR_BLADE_DAMAGE_MULTIPLIER - ldr r2, [r8] - ldr r1, [r0] - mov r0, r2, lsl #8 - bl MultiplyByFixedPoint - bl RoundUpDiv256 - str r0, [r8] -_0230D038: - mov r1, #0 - str r1, [r8, #4] - ldr r0, [r8] - cmp r0, #0 - streqb r1, [r8, #0xe] - ldrb r0, [r8, #0xe] - strb r0, [r7, #0x167 + CALC_DAMAGE_OFFSET] -_0230D054: - add sp, sp, #0xc0 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_0230D05C: .word 0x00000C58 + CALC_DAMAGE_DATA_OFFSET -_0230D060: .word 0x00000C57 + CALC_DAMAGE_DATA_OFFSET -_0230D064: .word DAMAGE_MULTIPLIER_0_5 -_0230D068: .word SCOPE_LENS_CRIT_RATE_BOOST -_0230D06C: .word SUPER_LUCK_CRIT_RATE_BOOST -_0230D070: .word TYPE_ADVANTAGE_MASTER_CRIT_RATE -_0230D074: .word DAMAGE_MULTIPLIER_2 -_0230D078: .word DAMAGE_MULTIPLIER_1_5 -_0230D07C: .word 0x00000195 -_0230D080: .word POWER_PITCHER_DAMAGE_MULTIPLIER -_0230D084: .word AIR_BLADE_DAMAGE_MULTIPLIER - arm_func_end CalcDamage - - arm_func_start ov29_0230D088 -ov29_0230D088: ; 0x0230D088 - stmdb sp!, {r4, r5, lr} - sub sp, sp, #0x1c - ldr r5, [sp, #0x2c] - ldr r4, [sp, #0x28] - mov lr, r0 - strb r2, [r5, #0xc] - cmp r4, #1 - strb r3, [r5, #0xd] - mov ip, r1 - str r2, [sp] - mov r2, ip - ldr r0, _0230D118 ; =0x000003E7 - movlt r4, #1 - cmp r4, r0 - movgt r4, r0 - add r0, sp, #0x14 - mov r1, lr - mov r3, r4 - str r5, [sp, #4] - mov ip, #0 - str ip, [sp, #8] - bl CalcTypeBasedDamageEffects - add r0, sp, #0xc - mov r1, r4 - bl IntToFixedPoint64 - add r0, sp, #0xc - add r2, sp, #0x14 - mov r1, r0 - bl MultiplyFixedPoint64 - add r0, sp, #0xc - bl FixedPoint64ToInt - str r0, [r5] - mov r0, #0 - str r0, [r5, #4] - add sp, sp, #0x1c - ldmia sp!, {r4, r5, pc} - .align 2, 0 -_0230D118: .word 0x000003E7 - arm_func_end ov29_0230D088 - - arm_func_start ApplyDamageAndEffectsWrapper -ApplyDamageAndEffectsWrapper: ; 0x0230D11C - stmdb sp!, {r4, r5, r6, r7, lr} - sub sp, sp, #0xdc - mov r7, r0 - add r0, sp, #0x10 - mov r6, r1 - mov r5, r2 - mov r4, r3 - bl ResetDamageData - add r0, sp, #0x24 - bl ov29_022E2470 - mov r3, #0 - mov r0, #2 - str r0, [sp, #0x18] - str r6, [sp, #0x10] - str r5, [sp, #0x14] - strb r3, [sp, #0x1c] - strb r3, [sp, #0x1e] - strb r3, [sp, #0x1f] - strb r3, [sp, #0x20] - stmia sp, {r3, r4} - str r3, [sp, #8] - mov r1, r7 - add r0, sp, #0x24 - add r2, sp, #0x10 - str r3, [sp, #0xc] - bl ApplyDamageAndEffects - add sp, sp, #0xdc - ldmia sp!, {r4, r5, r6, r7, pc} - arm_func_end ApplyDamageAndEffectsWrapper - - arm_func_start CalcRecoilDamageFixed -CalcRecoilDamageFixed: ; 0x0230D18C - stmdb sp!, {r4, r5, r6, r7, lr} - sub sp, sp, #0x1c - mov r7, r0 - mov r6, r1 - mov r5, r2 - mov r4, r3 - bl EntityIsValid__02308FBC - cmp r0, #0 - beq _0230D238 - ldr r0, [r7] - cmp r0, #1 - bne _0230D1F0 - ldr r0, [r7, #0xb4] - ldrsh r0, [r0, #0x10] - cmp r0, #0 - beq _0230D238 - mov r0, r7 - mov r1, #0x5c - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _0230D1F0 - mov r0, r6, lsl #8 - mov r1, #0x180 - bl MultiplyByFixedPoint - mov r6, r0, asr #8 -_0230D1F0: - ldrb r1, [sp, #0x34] - str r4, [sp] - ldrsh r0, [sp, #0x38] - str r1, [sp, #4] - mov r1, #3 - str r1, [sp, #8] - ldr r1, [sp, #0x3c] - str r0, [sp, #0xc] - ldr r0, [sp, #0x40] - str r1, [sp, #0x10] - ldr r4, [sp, #0x44] - str r0, [sp, #0x14] - mov r0, r7 - mov r1, r7 - mov r2, r6 - mov r3, r5 - str r4, [sp, #0x18] - bl CalcDamageFixed -_0230D238: - add sp, sp, #0x1c - ldmia sp!, {r4, r5, r6, r7, pc} - arm_func_end CalcRecoilDamageFixed - - arm_func_start CalcDamageFixed -CalcDamageFixed: ; 0x0230D240 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, lr} - sub sp, sp, #0x2c - mov sl, r0 - add r0, sp, #0x18 - mov sb, r1 - mov r8, r2 - mov r7, r3 - ldr r6, [sp, #0x54] - bl ResetDamageData - mov r5, #0 - ldrb r0, [sp, #0x58] - ldr r1, [sp, #0x60] - mov r2, #2 - str r2, [sp, #0x20] - str r1, [sp, #0x1c] - strb r6, [sp, #0x24] - strb r5, [sp, #0x26] - strb r5, [sp, #0x27] - strb r0, [sp, #0x25] - cmp r6, #0 - beq _0230D2F8 - add r4, sp, #0x10 -_0230D298: - mov r2, r5, lsl #0x10 - mov r0, sl - mov r1, sb - mov r3, r6 - mov r2, r2, asr #0x10 - bl GetTypeMatchup - str r0, [r4, r5, lsl #2] - add r5, r5, #1 - cmp r5, #2 - blt _0230D298 - mov r0, sl - mov r1, sb - mov r2, #0x35 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__0230A940 - cmp r0, #0 - beq _0230D2F8 - ldr r2, [sp, #0x10] - ldr r0, _0230D39C ; =TYPE_MATCHUP_COMBINATOR_TABLE - ldr r1, [sp, #0x14] - add r0, r0, r2, lsl #4 - ldr r0, [r0, r1, lsl #2] - cmp r0, #3 - movne r8, #0 -_0230D2F8: - ldrsh r1, [sp, #0x5c] - ldr r0, _0230D3A0 ; =0x00000256 - mov r8, r8, lsl #8 - cmp r1, r0 - bne _0230D334 - mov r0, sl - mov r1, #0x2f - bl IqSkillIsEnabled - cmp r0, #0 - beq _0230D334 - ldr r1, _0230D3A4 ; =POWER_PITCHER_DAMAGE_MULTIPLIER - mov r0, r8 - ldr r1, [r1] - bl MultiplyByFixedPoint - mov r8, r0 -_0230D334: - mov r0, r8 - bl RoundUpDiv256 - str r0, [sp, #0x18] - cmp r8, #0 - moveq r0, #1 - streqb r0, [sp, #0x28] - movne r0, #0 - strneb r0, [sp, #0x28] - ldrsh r1, [sp, #0x5c] - str r7, [sp] - ldr r0, [sp, #0x64] - str r1, [sp, #4] - str r0, [sp, #8] - ldr r4, [sp, #0x68] - add r2, sp, #0x18 - mov r0, sl - mov r1, sb - mov r3, #0 - str r4, [sp, #0xc] - bl ApplyDamageAndEffects - ldr r1, [sp, #0x50] - cmp r1, #0 - ldrneb r0, [sp, #0x28] - strneb r0, [r1] - add sp, sp, #0x2c - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, pc} - .align 2, 0 -_0230D39C: .word TYPE_MATCHUP_COMBINATOR_TABLE -_0230D3A0: .word 0x00000256 -_0230D3A4: .word POWER_PITCHER_DAMAGE_MULTIPLIER - arm_func_end CalcDamageFixed - - arm_func_start CalcDamageFixedNoCategory -CalcDamageFixedNoCategory: ; 0x0230D3A8 - stmdb sp!, {lr} - sub sp, sp, #0x1c - ldr lr, [sp, #0x20] - ldrb ip, [sp, #0x24] - str lr, [sp] - ldrsh lr, [sp, #0x28] - str ip, [sp, #4] - mov ip, #3 - str ip, [sp, #8] - ldr ip, [sp, #0x2c] - str lr, [sp, #0xc] - ldr lr, [sp, #0x30] - str ip, [sp, #0x10] - ldr ip, [sp, #0x34] - str lr, [sp, #0x14] - str ip, [sp, #0x18] - bl CalcDamageFixed - add sp, sp, #0x1c - ldmia sp!, {pc} - arm_func_end CalcDamageFixedNoCategory - - arm_func_start CalcDamageFixedWrapper -CalcDamageFixedWrapper: ; 0x0230D3F4 - stmdb sp!, {lr} - sub sp, sp, #0x1c - ldr ip, [sp, #0x20] - ldrb lr, [sp, #0x24] - str ip, [sp] - ldrb ip, [sp, #0x28] - str lr, [sp, #4] - ldrsh lr, [sp, #0x2c] - str ip, [sp, #8] - ldr ip, [sp, #0x30] - str lr, [sp, #0xc] - ldr lr, [sp, #0x34] - str ip, [sp, #0x10] - ldr ip, [sp, #0x38] - str lr, [sp, #0x14] - str ip, [sp, #0x18] - bl CalcDamageFixed - add sp, sp, #0x1c - ldmia sp!, {pc} - arm_func_end CalcDamageFixedWrapper - - arm_func_start UpdateShopkeeperModeAfterAttack -UpdateShopkeeperModeAfterAttack: ; 0x0230D440 - ldr r2, [r1, #0xb4] - ldrb r1, [r2, #9] - cmp r1, #0 - bxeq lr - ldr r1, [r0] - cmp r1, #1 - bxne lr - ldr r0, [r0, #0xb4] - ldrb r0, [r0, #6] - cmp r0, #0 - movne r0, #2 - strneb r0, [r2, #9] - moveq r0, #3 - streqb r0, [r2, #9] - bx lr - arm_func_end UpdateShopkeeperModeAfterAttack - - arm_func_start UpdateShopkeeperModeAfterTrap -UpdateShopkeeperModeAfterTrap: ; 0x0230D47C - ldr r2, [r0, #0xb4] - ldrb r0, [r2, #9] - cmp r0, #0 - bxeq lr - cmp r1, #0 - movne r0, #2 - strneb r0, [r2, #9] - moveq r0, #3 - streqb r0, [r2, #9] - bx lr - arm_func_end UpdateShopkeeperModeAfterTrap - - arm_func_start ov29_0230D4A4 -ov29_0230D4A4: ; 0x0230D4A4 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r6, r1 - mov r7, r0 - mov r0, r6 - mov r1, #0xe - mov r5, r2 - ldr r4, [r6, #0xb4] - bl MonsterIsType - cmp r0, #0 - beq _0230D4E8 - cmp r5, #1 - cmpne r5, #7 - bne _0230D4E8 - ldrb r0, [r4, #0xfe] - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} -_0230D4E8: - mov r4, #0 - b _0230D518 -_0230D4F0: - mov r2, r4, lsl #0x10 - mov r0, r7 - mov r1, r6 - mov r3, r5 - mov r2, r2, asr #0x10 - bl GetTypeMatchup - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - add r4, r4, #1 -_0230D518: - cmp r4, #2 - blt _0230D4F0 - mov r0, #1 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - arm_func_end ov29_0230D4A4 - - arm_func_start ResetDamageCalcDiagnostics -ResetDamageCalcDiagnostics: ; 0x0230D528 - stmdb sp!, {r3, r4, r5, lr} - ldr r0, _0230D614 ; =DUNGEON_PTR - mov r1, #0x54 - ldr r4, [r0] - add r5, r4, #0x184 - mov r0, r5 - bl MemZero - mov r1, #0 - strb r1, [r4, #0x184] - str r1, [r5, #4] - strb r1, [r5, #8] - strb r1, [r5, #9] - mov r0, #0xa - strb r0, [r5, #0xa] - strb r0, [r5, #0xb] - mov r0, #1 - strh r0, [r5, #0xc] - strh r0, [r5, #0xe] - strh r1, [r5, #0x10] - strh r1, [r5, #0x14] - strh r1, [r5, #0x12] - strh r1, [r5, #0x16] - strh r1, [r5, #0x1c] - str r1, [r5, #0x20] - str r1, [r5, #0x28] - str r1, [r5, #0x2c] - strb r1, [r5, #0x30] - strb r1, [r5, #0x31] - strb r1, [r5, #0x36] - strb r1, [r5, #0x37] - strb r1, [r5, #0x34] - strb r1, [r5, #0x35] - strb r1, [r5, #0x38] - strb r1, [r5, #0x39] - strb r1, [r5, #0x3a] - strb r1, [r5, #0x3b] - strb r1, [r5, #0x3c] - strb r1, [r5, #0x3d] - strb r1, [r5, #0x3e] - strb r1, [r5, #0x40] - strb r1, [r5, #0x3f] - strb r1, [r5, #0x41] - strb r1, [r5, #0x42] - strb r1, [r5, #0x43] - strb r1, [r5, #0x44] - strb r1, [r5, #0x45] - strb r1, [r5, #0x46] - strb r1, [r5, #0x47] - strb r1, [r5, #0x48] - strb r1, [r5, #0x4b] - strb r1, [r5, #0x4c] - strb r1, [r5, #0x4d] - strb r1, [r5, #0x4e] - strb r1, [r5, #0x4f] - strb r1, [r5, #0x50] - strb r1, [r5, #0x51] - strb r1, [r5, #0x32] - strb r1, [r5, #0x33] - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_0230D614: .word DUNGEON_PTR - arm_func_end ResetDamageCalcDiagnostics - - arm_func_start ov29_0230D618 -ov29_0230D618: ; 0x0230D618 - ldr r1, _0230D624 ; =ov29_02352894 - ldr r0, [r1, r0, lsl #2] - bx lr - .align 2, 0 -_0230D624: .word ov29_02352894 - arm_func_end ov29_0230D618 - - arm_func_start ov29_0230D628 -ov29_0230D628: ; 0x0230D628 - stmdb sp!, {r3, lr} - ldr r1, _0230D650 ; =DUNGEON_PTR - ldr r1, [r1] - add r1, r1, #0x1a000 -#ifdef JAPAN - ldr r1, [r1, #0x188] -#else - ldr r1, [r1, #0x22c] -#endif - cmp r1, r0 - ldmneia sp!, {r3, pc} - mov r1, #1 - bl PointCameraToMonster - ldmia sp!, {r3, pc} - .align 2, 0 -_0230D650: .word DUNGEON_PTR - arm_func_end ov29_0230D628 - - arm_func_start ov29_0230D654 -ov29_0230D654: ; 0x0230D654 - stmdb sp!, {r4, lr} - mov r4, r1 - bl EntityIsValid__02308FBC - cmp r0, #0 - beq _0230D678 - mov r0, r4 - bl EntityIsValid__02308FBC - cmp r0, #0 - bne _0230D680 -_0230D678: - mov r0, #1 - ldmia sp!, {r4, pc} -_0230D680: - mov r0, #0 - ldmia sp!, {r4, pc} - arm_func_end ov29_0230D654 - - arm_func_start ov29_0230D688 -ov29_0230D688: ; 0x0230D688 - stmdb sp!, {r4, lr} - sub sp, sp, #8 - mov r4, r0 - ldrh r3, [r4] - mov r1, #0x55 - mov r2, #2 - strh r3, [sp] - ldrh r3, [r4, #2] - strh r3, [sp, #2] - ldrh r3, [r4, #4] - strh r3, [sp, #4] - bl GenerateStandardItem - mov r0, r4 - bl SetItemAcquired - ldrb r0, [sp, #1] - strb r0, [r4, #1] - cmp r0, #0 - beq _0230D6FC - add r0, sp, #0 - bl GetEquivItemIndex - cmp r0, #0 - blt _0230D6FC - bl GetItemAtIdx - ldrh r1, [r4] - strh r1, [r0] - ldrh r1, [r4, #2] - strh r1, [r0, #2] - ldrh r1, [r4, #4] - strh r1, [r0, #4] -_0230D6FC: - add sp, sp, #8 - ldmia sp!, {r4, pc} - arm_func_end ov29_0230D688 - - arm_func_start ov29_0230D704 -ov29_0230D704: ; 0x0230D704 - mov r0, #0 - bx lr - arm_func_end ov29_0230D704 - - arm_func_start ov29_0230D70C -ov29_0230D70C: ; 0x0230D70C - stmdb sp!, {r3, lr} - mov r0, #0x64 - bl DungeonRandInt - ldr r1, _0230D734 ; =ov10_022C45B4 - ldrsh r1, [r1] - cmp r0, r1 - movlt r0, #1 - movge r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} - .align 2, 0 -_0230D734: .word ov10_022C45B4 - arm_func_end ov29_0230D70C - - arm_func_start ov29_0230D738 -ov29_0230D738: ; 0x0230D738 - stmdb sp!, {r3, lr} - cmp r2, #0 - bne _0230D760 - mov r0, #0x64 - bl DungeonRandInt - ldr r1, _0230D768 ; =ov10_022C45B4 - ldrsh r1, [r1] - cmp r0, r1 - movlt r0, #1 - ldmltia sp!, {r3, pc} -_0230D760: - mov r0, #0 - ldmia sp!, {r3, pc} - .align 2, 0 -_0230D768: .word ov10_022C45B4 - arm_func_end ov29_0230D738 - - arm_func_start ov29_0230D76C -ov29_0230D76C: ; 0x0230D76C - stmdb sp!, {r4, r5, r6, lr} - mov r6, r0 - mov r5, r1 - mov r4, r2 - bl IsMonster__0230A994 - cmp r0, #0 - beq _0230D798 - mov r0, r5 - bl IsMonster__0230A994 - cmp r0, #0 - bne _0230D7A0 -_0230D798: - mov r0, #0 - ldmia sp!, {r4, r5, r6, pc} -_0230D7A0: - ldr r0, [r6, #0xb4] - ldr r1, [r5, #0xb4] - ldrsh r0, [r0, #2] - ldrsh r1, [r1, #2] - bl GendersNotEqualNotGenderless - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, r6 - mov r1, r5 - mov r2, r4 - bl ov29_0230D738 - ldmia sp!, {r4, r5, r6, pc} - arm_func_end ov29_0230D76C - - arm_func_start ov29_0230D7D4 -ov29_0230D7D4: ; 0x0230D7D4 - stmdb sp!, {r3, r4, r5, lr} - sub sp, sp, #0x10 - ldr r2, _0230D870 ; =ov29_023535D4 - mvn r1, #0 - ldrsh r3, [r2] - mov r4, r0 - cmp r3, r1 - beq _0230D808 - ldrsh r0, [r2] - bl ov10_022BDE50 - ldr r0, _0230D870 ; =ov29_023535D4 - mvn r1, #0 - strh r1, [r0] -_0230D808: - mov r2, #0 - mov r1, #1 - str r2, [sp] - stmib sp, {r1, r2} - mov r0, r4 - rsb r1, r1, #0x2b8 - mov r3, #3 - str r2, [sp, #0xc] - bl PlayEffectAnimationEntity - mov r0, r0, lsl #0x10 - mov r5, r0, asr #0x10 - mvn r0, #0 - cmp r5, r0 - beq _0230D868 - mov r4, #0x18 - b _0230D850 -_0230D848: - mov r0, r4 - bl AdvanceFrame -_0230D850: - mov r0, r5 - bl ov10_022BF964 - cmp r0, #0 - bne _0230D848 - mov r0, r5 - bl ov10_022BDE50 -_0230D868: - add sp, sp, #0x10 - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_0230D870: .word ov29_023535D4 - arm_func_end ov29_0230D7D4 - - arm_func_start ov29_0230D874 -ov29_0230D874: ; 0x0230D874 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - ldr lr, [r5, #0xb4] - ldr ip, [r4, #0xb4] - ldrsh r3, [lr, #0x28] - ldrsh r1, [lr, #0x2a] - ldrsh r0, [ip, #0x28] - cmp r2, #0 - strh r0, [lr, #0x28] - ldrsh r0, [ip, #0x2a] - strh r0, [lr, #0x2a] - strh r3, [ip, #0x28] - strh r1, [ip, #0x2a] - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, r4 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldr r2, _0230D8E4 ; =0x00000F2D - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -#ifdef JAPAN -_0230D8E4: .word 0x00002494 -#else -_0230D8E4: .word 0x00000F2D -#endif - arm_func_end ov29_0230D874 - - arm_func_start ov29_0230D8E8 -ov29_0230D8E8: ; 0x0230D8E8 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - ldr lr, [r5, #0xb4] - ldr ip, [r4, #0xb4] - ldr r3, [lr, #0x3c] - ldr r1, [lr, #0x40] - ldr r0, [ip, #0x3c] - cmp r2, #0 - str r0, [lr, #0x3c] - ldr r0, [ip, #0x40] - str r0, [lr, #0x40] - str r3, [ip, #0x3c] - str r1, [ip, #0x40] - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, r4 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldr r2, _0230D958 ; =0x00000F2E - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -#ifdef JAPAN -_0230D958: .word 0x00002495 -#else -_0230D958: .word 0x00000F2E -#endif - arm_func_end ov29_0230D8E8 - - arm_func_start ov29_0230D95C -ov29_0230D95C: ; 0x0230D95C - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - ldr lr, [r5, #0xb4] - ldr ip, [r4, #0xb4] - ldrsh r3, [lr, #0x24] - ldrsh r1, [lr, #0x26] - ldrsh r0, [ip, #0x24] - cmp r2, #0 - strh r0, [lr, #0x24] - ldrsh r0, [ip, #0x26] - strh r0, [lr, #0x26] - strh r3, [ip, #0x24] - strh r1, [ip, #0x26] - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, r4 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldr r2, _0230D9CC ; =0x00000F2B - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -#ifdef JAPAN -_0230D9CC: .word 0x00002492 -#else -_0230D9CC: .word 0x00000F2B -#endif - arm_func_end ov29_0230D95C - - arm_func_start ov29_0230D9D0 -ov29_0230D9D0: ; 0x0230D9D0 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - ldr lr, [r5, #0xb4] - ldr ip, [r4, #0xb4] - ldr r3, [lr, #0x34] - ldr r1, [lr, #0x38] - ldr r0, [ip, #0x34] - cmp r2, #0 - str r0, [lr, #0x34] - ldr r0, [ip, #0x38] - str r0, [lr, #0x38] - str r3, [ip, #0x34] - str r1, [ip, #0x38] - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, r4 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldr r2, _0230DA40 ; =0x00000F2C - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -#ifdef JAPAN -_0230DA40: .word 0x00002493 -#else -_0230DA40: .word 0x00000F2C -#endif - arm_func_end ov29_0230D9D0 - - arm_func_start ov29_0230DA44 -ov29_0230DA44: ; 0x0230DA44 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - ldr lr, [r5, #0xb4] - ldr ip, [r4, #0xb4] - ldrsh r3, [lr, #0x2c] - ldrsh r1, [lr, #0x2e] - ldrsh r0, [ip, #0x2c] - cmp r2, #0 - strh r0, [lr, #0x2c] - ldrsh r0, [ip, #0x2e] - strh r0, [lr, #0x2e] - strh r3, [ip, #0x2c] - strh r1, [ip, #0x2e] - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, r4 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldr r2, _0230DAB4 ; =0x00000F2F - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -#ifdef JAPAN -_0230DAB4: .word 0x00002496 -#else -_0230DAB4: .word 0x00000F2F -#endif - arm_func_end ov29_0230DA44 - - arm_func_start ov29_0230DAB8 -ov29_0230DAB8: ; 0x0230DAB8 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - ldr ip, [r5, #0xb4] - mov r4, r1 - ldrsh r1, [ip, #0x24] - ldr r3, [ip, #0x34] - ldr r0, [ip, #0x3c] - cmp r2, #0 - str r0, [ip, #0x34] - ldrsh r0, [ip, #0x28] - strh r0, [ip, #0x24] - str r3, [ip, #0x3c] - strh r1, [ip, #0x28] - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags -#ifdef JAPAN - ldr r2, _0230F050 ; =0x00002497 - mov r0, r5 - mov r1, r4 -#else - mov r0, r5 - mov r1, r4 - mov r2, #0xf30 -#endif - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r3, r4, r5, pc} -#ifdef JAPAN -_0230F050: .word 0x00002497 -#endif - arm_func_end ov29_0230DAB8 - - arm_func_start SpecificRecruitCheck -SpecificRecruitCheck: ; 0x0230DB14 - stmdb sp!, {r4, lr} - ldr r1, _0230DBC8 ; =DUNGEON_PTR - mov r4, r0 - ldr r1, [r1] - ldrb r1, [r1, #0x759] - cmp r1, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - bl DebugRecruitingEnabled - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - cmp r4, #0x97 - ldreq r0, _0230DBC8 ; =DUNGEON_PTR - ldreq r0, [r0] - addeq r0, r0, #0x700 - ldreqsb r0, [r0, #0x98] - cmpeq r0, #2 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - ldr r1, _0230DBCC ; =0x000001A3 - cmp r4, r1 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - cmp r4, #0x1a4 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - add r0, r1, #2 - cmp r4, r0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - sub r0, r1, #0xa - cmp r4, r0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - sub r0, r1, #9 - cmp r4, r0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - sub r0, r1, #8 - cmp r4, r0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - .align 2, 0 -_0230DBC8: .word DUNGEON_PTR -_0230DBCC: .word 0x000001A3 - arm_func_end SpecificRecruitCheck - - arm_func_start RecruitCheck -RecruitCheck: ; 0x0230DBD0 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - ldr r2, _0230E024 ; =DUNGEON_PTR - mov r8, r0 - ldr r0, [r2] - mov r7, r1 - ldrb r0, [r0, #0x748] - ldr r5, [r8, #0xb4] - ldr r6, [r7, #0xb4] - bl IsRecruitingAllowed - cmp r0, #0 - beq _0230DC28 - bl IsFullFloorFixedRoom - cmp r0, #0 - bne _0230DC28 - bl IsLegendaryChallengeFloor - cmp r0, #0 - bne _0230DC28 - mov r0, #0xa - mov r1, #6 - bl IsCurrentMissionTypeExact - cmp r0, #0 - beq _0230DC30 -_0230DC28: - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} -_0230DC30: - ldr r0, _0230E024 ; =DUNGEON_PTR - ldr r1, [r0] - ldrb r0, [r1, #0x75d] - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - ldrb r0, [r1, #0x748] - cmp r0, #0x5b - bne _0230DC70 - ldrsh r1, [r6, #2] - ldr r0, _0230E028 ; =0x000001E6 - cmp r1, r0 - addne r0, r0, #0x258 - cmpne r1, r0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} -_0230DC70: - ldrsh r0, [r6, #2] - cmp r0, #0x91 - cmpne r0, #0x90 - cmpne r0, #0x92 - ldrne r2, _0230E02C ; =0x0000010F - cmpne r0, r2 - subne r1, r2, #1 - cmpne r0, r1 - cmpne r0, #0x110 - cmpne r0, #0x19c - addne r1, r2, #0x8e - cmpne r0, r1 - addne r1, r2, #0x92 - cmpne r0, r1 - cmpne r0, #0x1a0 - addne r1, r2, #0x93 - cmpne r0, r1 - addne r1, r2, #0x8a - cmpne r0, r1 - addne r1, r2, #0x8b - cmpne r0, r1 - addne r1, r2, #0x8c - cmpne r0, r1 - beq _0230DCF0 - ldr r1, _0230E030 ; =0xFFFFFDEA - add r1, r0, r1 - mov r1, r1, lsl #0x10 - mov r1, r1, asr #0x10 - mov r1, r1, lsl #0x10 - mov r1, r1, lsr #0x10 - cmp r1, #1 - bhi _0230DD04 -_0230DCF0: - mov r1, #1 - bl IsMonsterOnTeam - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} -_0230DD04: - mov r0, r6 - bl ov29_022FBDE0 - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - ldrsh r0, [r6, #2] - bl SpecificRecruitCheck - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - ldrsh r1, [r8, #4] - ldrsh r0, [r7, #4] - sub r0, r1, r0 - bl abs - cmp r0, #1 - bgt _0230DD5C - ldrsh r1, [r8, #6] - ldrsh r0, [r7, #6] - sub r0, r1, r0 - bl abs - cmp r0, #1 - ble _0230DD64 -_0230DD5C: - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} -_0230DD64: - ldrb r0, [r6, #0x48] - cmp r0, #0xfa - ldrneb r0, [r6, #0xbc] - cmpne r0, #7 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov r0, r7 - mov r1, r8 - bl CanSeeTarget - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov r0, #1 - bl ov29_022E1B28 - bl ov29_022E81F8 - ldrsh r0, [r6, #2] - mov r1, #1 - bl IsMonsterOnTeam - mov sb, r0 - mov r0, #0x3e8 - bl DungeonRandInt - mov r4, r0 - bl HasPlayedOldGame - cmp r0, #0 - beq _0230DDE0 - cmp sb, #0 - bne _0230DDE0 - ldrsh r0, [r6, #2] - bl GetRecruitRate2 - mov r6, r0 - b _0230DDEC -_0230DDE0: - ldrsh r0, [r6, #2] - bl GetRecruitRate1 - mov r6, r0 -_0230DDEC: - cmp r6, #0 - ble _0230DDFC - cmp sb, #0 - movne r6, r6, asr #1 -_0230DDFC: - ldr r0, _0230E034 ; =0xFFFFFC19 - cmp r6, r0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov r0, r8 - mov r1, #0x35 - bl ItemIsActive__0230E578 - cmp r0, #0 - ldrne r0, _0230E038 ; =ov10_022C44FC - ldrnesh r0, [r0] - addne r6, r6, r0 - bne _0230DFD4 - mov r0, r8 - mov r1, #0x39 - bl ItemIsActive__0230E578 - cmp r0, #0 - ldrne r0, _0230E03C ; =ov10_022C443C - ldrnesh r0, [r0] - addne r6, r6, r0 - bne _0230DFD4 - mov r0, r8 - mov r1, #0x3a - bl ItemIsActive__0230E578 - cmp r0, #0 - ldrne r0, _0230E040 ; =ov10_022C447C - ldrnesh r0, [r0] - addne r6, r6, r0 - bne _0230DFD4 - mov r0, r8 - mov r1, #0x3b - bl ItemIsActive__0230E578 - cmp r0, #0 - beq _0230DEA0 - mov r0, r7 - mov r1, #6 - bl MonsterIsType - cmp r0, #0 - ldrne r0, _0230E044 ; =ov10_022C441C - ldrnesh r0, [r0] - addne r6, r6, r0 - b _0230DFD4 -_0230DEA0: - mov r0, r8 - mov r1, #0x3c - bl ItemIsActive__0230E578 - cmp r0, #0 - beq _0230DED4 - mov r0, r7 - mov r1, #2 - bl MonsterIsType - cmp r0, #0 - ldrne r0, _0230E048 ; =ov10_022C4410 - ldrnesh r0, [r0] - addne r6, r6, r0 - b _0230DFD4 -_0230DED4: - mov r0, r8 - mov r1, #0x3d - bl ItemIsActive__0230E578 - cmp r0, #0 - beq _0230DF08 - mov r0, r7 - mov r1, #9 - bl MonsterIsType - cmp r0, #0 - ldrne r0, _0230E04C ; =ov10_022C470C - ldrnesh r0, [r0] - addne r6, r6, r0 - b _0230DFD4 -_0230DF08: - mov r0, r8 - mov r1, #0x3e - bl ItemIsActive__0230E578 - cmp r0, #0 - beq _0230DF3C - mov r0, r7 - mov r1, #3 - bl MonsterIsType - cmp r0, #0 - ldrne r0, _0230E050 ; =ov10_022C4708 - ldrnesh r0, [r0] - addne r6, r6, r0 - b _0230DFD4 -_0230DF3C: - mov r0, r8 - mov r1, #0x3f - bl ItemIsActive__0230E578 - cmp r0, #0 - beq _0230DF70 - mov r0, r7 - mov r1, #0xd - bl MonsterIsType - cmp r0, #0 - ldrne r0, _0230E054 ; =ov10_022C4704 - ldrnesh r0, [r0] - addne r6, r6, r0 - b _0230DFD4 -_0230DF70: - mov r0, r8 - mov r1, #0x40 - bl ItemIsActive__0230E578 - cmp r0, #0 - beq _0230DFA4 - mov r0, r7 - mov r1, #4 - bl MonsterIsType - cmp r0, #0 - ldrne r0, _0230E058 ; =ov10_022C4700 - ldrnesh r0, [r0] - addne r6, r6, r0 - b _0230DFD4 -_0230DFA4: - mov r0, r8 - mov r1, #0x41 - bl ItemIsActive__0230E578 - cmp r0, #0 - beq _0230DFD4 - mov r0, r7 - mov r1, #0xa - bl MonsterIsType - cmp r0, #0 - ldrne r0, _0230E05C ; =ov10_022C46FC - ldrnesh r0, [r0] - addne r6, r6, r0 -_0230DFD4: - mov r0, r8 - mov r1, #0x1e - bl IqSkillIsEnabled - cmp r0, #0 - ldrne r0, _0230E038 ; =ov10_022C44FC - ldrb r1, [r5, #0xa] - ldrnesh r0, [r0] - mov r1, r1, lsl #1 - addne r6, r6, r0 - ldr r0, _0230E060 ; =RECRUITMENT_LEVEL_BOOST_TABLE - ldrsh r0, [r0, r1] - add r0, r6, r0 - cmp r4, r0 - mov r0, #0 - ldmgeia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - bl GetFirstEmptyMemberIdx - cmp r0, #0 - movlt r0, #0 - movge r0, #1 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - .align 2, 0 -_0230E024: .word DUNGEON_PTR -_0230E028: .word 0x000001E6 -_0230E02C: .word 0x0000010F -_0230E030: .word 0xFFFFFDEA -_0230E034: .word 0xFFFFFC19 -_0230E038: .word ov10_022C44FC -_0230E03C: .word ov10_022C443C -_0230E040: .word ov10_022C447C -_0230E044: .word ov10_022C441C -_0230E048: .word ov10_022C4410 -_0230E04C: .word ov10_022C470C -_0230E050: .word ov10_022C4708 -_0230E054: .word ov10_022C4704 -_0230E058: .word ov10_022C4700 -_0230E05C: .word ov10_022C46FC -_0230E060: .word RECRUITMENT_LEVEL_BOOST_TABLE - arm_func_end RecruitCheck - - arm_func_start TryRecruit -TryRecruit: ; 0x0230E064 -#ifdef JAPAN -#define TRY_RECRUIT_OFFSET -4 -#define TRY_RECRUIT_OFFSET_2 -0x2C0 -#else -#define TRY_RECRUIT_OFFSET 0 -#define TRY_RECRUIT_OFFSET_2 0 -#endif -#ifdef JAPAN - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} -#else - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} -#endif - sub sp, sp, #0x114 + TRY_RECRUIT_OFFSET - mov sl, r0 - mov r0, #0xa - mov r5, #0 - mov sb, r1 - mov r8, r2 - bl ov29_0234BA54 - mov r0, r5 - bl ov29_0234B1A4 - bl ov29_0234D630 - add r0, sb, #4 - add r1, sl, #4 - mvn r7, #0 - bl GetDirectionTowardsPosition - mov r6, r0 - ldr r4, [sb, #0xb4] - mov r0, r5 - strb r0, [sb, #0x22] - mov r0, sl - mov r1, sb - bl ov29_02305F60 - mov r1, r6 - mov r0, sb - bl ov29_02304A48 - ldrsh r0, [r4, #2] - mov r1, #1 - bl IsMonsterOnTeam - cmp r0, #0 - beq _0230E0FC - bl ov29_0234B034 - mov r1, #1 - str r1, [sp] - mov r1, r5 - ldr r2, [sb, #0xb4] - mov r3, r1 - bl ov29_0230040C - b _0230E114 -_0230E0FC: - bl ov29_0234B034 - mov r1, r5 - str r1, [sp] - ldr r2, [sb, #0xb4] - mov r3, r1 - bl ov29_0230040C -_0230E114: - bl ov29_0234B034 - mov r1, r0 - mov r3, #1 - mov r2, #0 - str r3, [sp] - ldr r0, _0230E55C ; =0x00000C77 - mov r3, r2 - bl ov29_0234D7C0 - cmp r0, #2 - moveq r4, #0 - beq _0230E524 - mov r4, #1 - mov r0, #0 - orr r1, r4, #2 - strb r1, [sp, #0xac + TRY_RECRUIT_OFFSET] - strb r0, [sp, #0xad + TRY_RECRUIT_OFFSET] - ldrsh r2, [r8, #0xc] - ldr r1, _0230E560 ; =DUNGEON_PTR - sub r3, r0, #1 - strb r2, [sp, #0xae + TRY_RECRUIT_OFFSET] - strh r4, [sp, #0xb2 + TRY_RECRUIT_OFFSET] - ldr r2, [r1] - ldrh r4, [r8, #0x44] - add r1, sp, #0x14 - strh r4, [r1, #0xf2 + TRY_RECRUIT_OFFSET] - ldrh r4, [r8, #0x46] - strh r4, [r1, #0xf4 + TRY_RECRUIT_OFFSET] - strb r0, [sp, #0x104 + TRY_RECRUIT_OFFSET] - strh r3, [sp, #0xb4 + TRY_RECRUIT_OFFSET] - strh r3, [sp, #0xb6 + TRY_RECRUIT_OFFSET] - ldrsh r1, [r8] - strh r1, [sp, #0xb8 + TRY_RECRUIT_OFFSET] - ldrb r1, [r2, #0x748] - strb r1, [sp, #0xaf + TRY_RECRUIT_OFFSET] - ldrb r1, [r2, #0x749] - add r2, sp, #0xac + TRY_RECRUIT_OFFSET - strb r1, [sp, #0xb0 + TRY_RECRUIT_OFFSET] - ldrsh r1, [r8, #6] - strh r1, [sp, #0xba + TRY_RECRUIT_OFFSET] - ldrsh r1, [r8, #6] - strh r1, [sp, #0xbc + TRY_RECRUIT_OFFSET] - ldrh r1, [r8, #0x14] - strh r1, [sp, #0xf0 + TRY_RECRUIT_OFFSET] - ldrh r1, [r8, #0x16] - strh r1, [sp, #0xf2 + TRY_RECRUIT_OFFSET] - ldrh r1, [r8, #0x18] - strh r1, [sp, #0xf4 + TRY_RECRUIT_OFFSET] - ldrh r1, [r8, #0x1a] - strh r1, [sp, #0xf6 + TRY_RECRUIT_OFFSET] -_0230E1D8: - add r4, r8, r0 - ldrb r1, [r4, #8] - add r3, r2, r0 - add r0, r0, #1 - strb r1, [r3, #0x12] - ldrb r1, [r4, #0xa] - mov r0, r0, lsl #0x10 - mov r0, r0, asr #0x10 - strb r1, [r3, #0x14] - cmp r0, #2 - blt _0230E1D8 - ldr r0, [r8, #0x10] - add r2, sp, #0xc8 + TRY_RECRUIT_OFFSET - str r0, [sp, #0xc4 + TRY_RECRUIT_OFFSET] - add r3, r8, #0x22 - mov r1, #0x11 -_0230E218: - ldrh r0, [r3], #2 - subs r1, r1, #1 - strh r0, [r2], #2 - bne _0230E218 - ldrh r0, [r8, #0x1c] - strh r0, [sp, #0xea + TRY_RECRUIT_OFFSET] - ldrh r0, [r8, #0x1e] - strh r0, [sp, #0xec + TRY_RECRUIT_OFFSET] - ldrh r0, [r8, #0x20] - strh r0, [sp, #0xee + TRY_RECRUIT_OFFSET] - ldrsh r0, [r8] - bl GetNameString - mov r1, r0 - add r0, sp, #0x100 - add r0, r0, #0xa + TRY_RECRUIT_OFFSET - mov r2, #0xa - bl StrncpyName - ldrsh r1, [sp, #0xb8 + TRY_RECRUIT_OFFSET] - ldrsh r2, [sp, #0xb2 + TRY_RECRUIT_OFFSET] - add r0, sp, #0xf8 + TRY_RECRUIT_OFFSET - bl EnableAllLearnableIqSkills - add r1, sp, #0x100 - add r0, sp, #0x98 - add r1, r1, #0xa + TRY_RECRUIT_OFFSET -#ifdef JAPAN - add r4, sp, #0x18 - bl StrcpySimple -#else - mov r2, #0xa - add r4, sp, #0x18 - bl StrncpySimpleNoPad -#endif - bl ov29_022EACAC - bl ov29_0234B034 - mov r1, r0 - mov r0, #1 - str r0, [sp] - mov r2, #0 - ldr r0, _0230E564 ; =0x00000C7B - mov r3, r2 - bl ov29_0234D7C0 - cmp r0, #1 - bne _0230E2D4 - bl ov29_0234D838 - add r6, sp, #0x100 - add r6, r6, #0xa + TRY_RECRUIT_OFFSET -_0230E2BC: - mov r0, r6 - add r1, sp, #0x98 - mov r2, #0 - bl ov29_0234F008 - cmp r0, #0 - beq _0230E2BC -_0230E2D4: - add r1, sp, #0xac + TRY_RECRUIT_OFFSET - mov r0, r4 - bl sub_020585B4 - mov r1, r4 - mov r0, #0 - bl ov29_0234B0B4 - mov r0, #1 - mov r1, #0 - bl ov29_0234B084 - ldr r0, _0230E568 ; =0x00000C7E - bl ov29_0230E658 - ldrsh r1, [r8, #2] - ldrsh r2, [r8, #4] - mov r0, sb - bl ov29_02337EC0 - ldrsh r2, [r8, #2] - ldrsh r3, [r8, #4] - mov r0, sl - mov r1, sb - bl ov29_0230E5A8 - cmp r0, #0 - bne _0230E42C - add r0, sp, #0xac + TRY_RECRUIT_OFFSET - mvn r1, #0 - bl ov29_0230E5FC - mov r7, r0 - b _0230E410 -_0230E340: - ldr r0, _0230E56C ; =0x00000C7F - bl ov29_0230E658 - mvn r4, #0 -_0230E34C: - bl ov29_0234D838 - add r1, sp, #0x100 - mov r0, sb - add r1, r1, #0xa + TRY_RECRUIT_OFFSET - bl ov29_0234EE10 - movs r6, r0 - beq _0230E3D4 - cmp r6, sb - add r0, sp, #0x58 - bne _0230E380 - add r1, sp, #0xac + TRY_RECRUIT_OFFSET - bl sub_020585B4 - b _0230E38C -_0230E380: - ldr r1, [r6, #0xb4] - ldrsh r1, [r1, #0xc] - bl sub_020584FC -_0230E38C: - mov r0, #0 - add r1, sp, #0x58 - bl ov29_0234B0B4 - mov r0, #1 - mov r1, sl - mov r2, #0 - bl SubstitutePlaceholderStringTags - bl ov29_0234B034 - mov r1, #1 - mov r2, #0 - str r1, [sp] - mov r1, r0 - mov r0, #0xc80 + TRY_RECRUIT_OFFSET_2 - mov r3, r2 - bl ov29_0234D7C0 - mov fp, r0 - cmp fp, r4 - beq _0230E34C -_0230E3D4: - cmp fp, #2 - cmpne r6, #0 - beq _0230E410 - ldr r0, _0230E56C ; =0x00000C7F - add r0, r0, #2 - bl ov29_0230E658 - mov r0, r6 - bl ov29_022E68BC - ldr r1, _0230E570 ; =0x00000233 - mov r0, r6 - mov r2, sl - bl HandleFaint - cmp r6, sb - moveq r4, #1 - beq _0230E524 -_0230E410: - mov r0, sl - mov r1, sb - ldrsh r2, [r8, #2] - ldrsh r3, [r8, #4] - bl ov29_0230E5A8 - cmp r0, #0 - beq _0230E340 -_0230E42C: - mov r6, #0 - mov r4, r6 - mov r5, #1 - b _0230E468 -_0230E43C: - mov r0, r6 - bl GetActiveTeamMember - ldrb r0, [r0] - tst r0, #1 - movne r0, r5 - moveq r0, r4 - tst r0, #0xff - beq _0230E470 - add r0, r6, #1 - mov r0, r0, lsl #0x10 - mov r6, r0, asr #0x10 -_0230E468: - cmp r6, #4 - blt _0230E43C -_0230E470: - add r0, sp, #0xac + TRY_RECRUIT_OFFSET - mov r1, r7 - strh r6, [sp, #0xb6 + TRY_RECRUIT_OFFSET] - bl ov29_0230E5FC - strh r0, [sp, #0xb4 + TRY_RECRUIT_OFFSET] - ldrsh r1, [sp, #0xb4 + TRY_RECRUIT_OFFSET] - mov r0, r6 - bl sub_02056698 - ldr r1, _0230E570 ; =0x00000233 - mov r0, sb - mov r2, sl - bl HandleFaint - mov r0, r6 - bl GetActiveTeamMember - mov r4, r0 - add r7, sp, #0xac + TRY_RECRUIT_OFFSET - mov r6, r4 - mov r5, #6 -_0230E4B8: - ldmia r7!, {r0, r1, r2, r3} - stmia r6!, {r0, r1, r2, r3} - subs r5, r5, #1 - bne _0230E4B8 - ldmia r7, {r0, r1} - stmia r6, {r0, r1} - bl ov29_022E8104 - bl ov29_022E81F8 - add r1, sp, #0x14 - mov r0, #0 - str r1, [sp] - str r0, [sp, #4] - mov r0, #1 - str r0, [sp, #8] - str r0, [sp, #0xc] - str r0, [sp, #0x10] - ldrsh r0, [r8] - ldrsh r1, [r8, #2] - ldrsh r2, [r8, #4] - mov r3, r4 - bl InitTeamMember - ldrsh r0, [r4, #0xc] - bl SetPokemonJoined - bl ov29_022E8104 - bl ov29_022E81F8 - ldr r5, [sp, #0x14] - mov r4, #1 -_0230E524: - mov r0, #1 - bl ov29_0234D8A0 - cmp r4, #0 - bne _0230E540 - ldr r1, _0230E574 ; =0x00000C78 - mov r0, sl - bl LogMessageByIdWithPopupCheckUser -_0230E540: - cmp r5, #0 - beq _0230E550 - mov r0, r5 - bl EnsureCanStandCurrentTile -_0230E550: - mov r0, r4 - add sp, sp, #0x114 + TRY_RECRUIT_OFFSET -#ifdef JAPAN - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} -#else - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} -#endif - .align 2, 0 -_0230E55C: .word 0x00000C77 + TRY_RECRUIT_OFFSET_2 -_0230E560: .word DUNGEON_PTR -_0230E564: .word 0x00000C7B + TRY_RECRUIT_OFFSET_2 -_0230E568: .word 0x00000C7E + TRY_RECRUIT_OFFSET_2 -_0230E56C: .word 0x00000C7F + TRY_RECRUIT_OFFSET_2 -_0230E570: .word 0x00000233 -_0230E574: .word 0x00000C78 + TRY_RECRUIT_OFFSET_2 - arm_func_end TryRecruit - - arm_func_start ItemIsActive__0230E578 -ItemIsActive__0230E578: ; 0x0230E578 - stmdb sp!, {r3, r4, r5, lr} - mov r4, r1 - mov r1, #0x6f - mov r5, r0 - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - mov r0, r5 - mov r1, r4 - bl HasHeldItem - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ItemIsActive__0230E578 - - arm_func_start ov29_0230E5A8 -ov29_0230E5A8: ; 0x0230E5A8 - stmdb sp!, {r4, lr} - ldr r4, [r1, #0xb4] - mov r1, r2 - ldrsh r0, [r4, #2] - mov r2, r3 - mov r3, #1 - bl ov29_022FD318 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - ldrsh r0, [r4, #2] - bl ov29_022FBC94 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - bl sub_02056830 - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - arm_func_end ov29_0230E5A8 - - arm_func_start ov29_0230E5FC -ov29_0230E5FC: ; 0x0230E5FC - stmdb sp!, {r4, r5, lr} - sub sp, sp, #0x44 - mov r5, r0 - mov r4, r1 - add r0, sp, #0 - mov r1, r5 - bl sub_020534BC - mov r1, #0 - sub r0, r1, #1 - strb r1, [sp, #6] - strb r1, [sp, #7] - cmp r4, r0 - bne _0230E640 - add r0, sp, #0 - bl sub_02055CCC - mov r4, r0 - b _0230E64C -_0230E640: - ldrsh r0, [r5, #8] - add r1, sp, #0 - bl sub_02055D7C -_0230E64C: - mov r0, r4 - add sp, sp, #0x44 - ldmia sp!, {r4, r5, pc} - arm_func_end ov29_0230E5FC - - arm_func_start ov29_0230E658 -ov29_0230E658: ; 0x0230E658 - stmdb sp!, {r3, r4, r5, lr} - mov r4, r0 - bl AllocateTemp1024ByteBufferFromPool - mov r5, r0 - mov r0, r4 - bl StringFromId - mov r4, r0 - bl ov29_0234B034 - mov r2, r4 - str r0, [sp] - mov r0, r5 - mov r1, #0x400 - mov r3, r1 - bl PreprocessString - mov r0, r5 - bl ov29_0234BB50 - bl ov29_0234B034 - mov r1, r0 - mov r0, r5 - mov r2, #1 - str r2, [sp] - mov r2, #0 - mov r3, r2 - bl ov29_0234D6C8 - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_0230E658 - - arm_func_start TrySpawnMonsterAndTickSpawnCounter -TrySpawnMonsterAndTickSpawnCounter: ; 0x0230E6BC -#ifdef JAPAN -#define TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET -0xA4 -#else -#define TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET 0 -#endif - stmdb sp!, {r4, r5, r6, r7, r8, lr} - sub sp, sp, #0x10 - ldr r0, _0230E8D8 ; =DUNGEON_PTR - mov r6, #0 - ldr r7, [r0] - add r0, r7, #0x700 - ldrsh r1, [r0, #0x86] - cmp r1, #0 - beq _0230E8D0 - ldrsh r1, [r0, #0x82] - add r1, r1, #1 - strh r1, [r0, #0x82] - ldrb r1, [r7, #0x790] - cmp r1, #0 - bne _0230E710 - ldr r1, _0230E8DC ; =SPAWN_COOLDOWN - ldrsh r2, [r0, #0x82] - ldrsh r0, [r1] - cmp r2, r0 - bge _0230E724 - b _0230E8D0 -_0230E710: - ldr r1, _0230E8E0 ; =SPAWN_COOLDOWN_THIEF_ALERT - ldrsh r2, [r0, #0x82] - ldrsh r0, [r1] - cmp r2, r0 - blt _0230E8D0 -_0230E724: - cmp r2, #0x384 - ble _0230E76C - add r0, r7, #0x19000 - ldr r4, [r0, #0x908 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] - mov r0, r4 - bl EntityIsValid__0230E8F0 - cmp r0, #0 - beq _0230E76C - add r0, r7, #0x19000 - ldrh r1, [r4, #0x26] - ldr r0, [r0, #0x910 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] - cmp r1, r0 - bne _0230E76C - mov r0, #0 - mov r1, r4 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r6, r4 -_0230E76C: - mov r5, #0 - add r0, r7, #0x700 - strh r5, [r0, #0x82] - add r0, r7, #0x19000 - mov r4, r5 - str r5, [r0, #0x908 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] -_0230E784: - add r0, r7, r4, lsl #2 - add r0, r0, #0x12000 - ldr r8, [r0, #0xb38 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] - mov r0, r8 - bl EntityIsValid__0230E8F0 - cmp r0, #0 - beq _0230E7B8 - ldrsh r0, [r8, #4] - ldrsh r1, [r8, #6] - bl GetTile - ldrh r0, [r0] - tst r0, #0x100 - addeq r5, r5, #1 -_0230E7B8: - add r4, r4, #1 - cmp r4, #0x10 - blt _0230E784 - ldrb r0, [r7, #0x790] - cmp r0, #0 - bne _0230E80C - ldr r0, _0230E8D8 ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, #0x4000 - ldrb r0, [r0, #0xc9 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] - cmp r0, #0xff - bne _0230E7FC - ldr r0, _0230E8E4 ; =SPAWN_CAP_NO_MONSTER_HOUSE - ldrsh r0, [r0] - cmp r5, r0 - blt _0230E80C - b _0230E8D0 -_0230E7FC: - ldr r0, _0230E8E8 ; =SPAWN_CAP_WITH_MONSTER_HOUSE - ldrsh r0, [r0] - cmp r5, r0 - bge _0230E8D0 -_0230E80C: - cmp r6, #0 - beq _0230E828 - ldr r1, _0230E8EC ; =0x00000C5D - mov r0, #0 - bl LogMessageByIdWithPopup - mov r0, r6 - bl ov29_022E62F0 -_0230E828: - ldrb r0, [r7, #0x790] - cmp r0, #0 - beq _0230E83C - bl GetKecleonIdToSpawnByFloor - b _0230E844 -_0230E83C: - mov r0, #0 - bl GetMonsterIdToSpawn -_0230E844: - mov r5, r0 - mov r0, r5 - bl GetMonsterLevelToSpawn - movs r4, r0 - mov r0, r5 - mov r1, #0 - moveq r4, #1 - bl MewSpawnCheck - cmp r0, #0 - beq _0230E8D0 - add r0, sp, #0xa - mov r1, #0 - bl ov29_022E9628 - cmp r0, #0 - beq _0230E8D0 - mov r1, #0 - mov r0, #0x64 - strh r5, [sp] - strh r4, [sp, #8] - strb r1, [sp, #2] - bl DungeonRandInt - ldr r1, _0230E8D8 ; =DUNGEON_PTR - mov r4, r0 - ldr r0, [r1] - ldrb r0, [r0, #0x748] - bl GetRandomMovementChance - cmp r4, r0 - movlt r0, #1 - strlt r0, [sp, #4] - movge r0, #0 - strge r0, [sp, #4] - mov r1, #0 - add r0, sp, #0 - strb r1, [sp, #0xe] - bl SpawnMonster -_0230E8D0: - add sp, sp, #0x10 - ldmia sp!, {r4, r5, r6, r7, r8, pc} - .align 2, 0 -_0230E8D8: .word DUNGEON_PTR -_0230E8DC: .word SPAWN_COOLDOWN -_0230E8E0: .word SPAWN_COOLDOWN_THIEF_ALERT -_0230E8E4: .word SPAWN_CAP_NO_MONSTER_HOUSE -_0230E8E8: .word SPAWN_CAP_WITH_MONSTER_HOUSE -#ifdef JAPAN -_0230E8EC: .word 0x0000099C -#else -_0230E8EC: .word 0x00000C5D -#endif - arm_func_end TrySpawnMonsterAndTickSpawnCounter diff --git a/asm/overlay_29_0230A9B8.s b/asm/overlay_29_0230A9B8.s new file mode 100644 index 00000000..fa5599c7 --- /dev/null +++ b/asm/overlay_29_0230A9B8.s @@ -0,0 +1,4625 @@ + .include "asm/macros.inc" + .include "overlay_29_0230A9B8.inc" + + .text + + arm_func_start ExclusiveItemEffectIsActive__0230A9B8 +ExclusiveItemEffectIsActive__0230A9B8: ; 0x0230A9B8 + stmdb sp!, {r3, lr} + ldr r2, [r0, #0xb4] + ldrb r0, [r2, #6] + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, pc} +#ifdef JAPAN + add r0, r2, #0x224 +#else + add r0, r2, #0x228 +#endif + bl ExclusiveItemEffectFlagTest + ldmia sp!, {r3, pc} + arm_func_end ExclusiveItemEffectIsActive__0230A9B8 + + arm_func_start ItemIsActive__0230A9DC +ItemIsActive__0230A9DC: ; 0x0230A9DC + stmdb sp!, {r3, r4, r5, lr} + mov r4, r1 + mov r1, #0x6f + mov r5, r0 + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + mov r0, r5 + mov r1, r4 + bl HasHeldItem + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ItemIsActive__0230A9DC + + arm_func_start AftermathCheck +AftermathCheck: ; 0x0230AA0C + stmdb sp!, {r4, r5, r6, lr} + sub sp, sp, #8 + mov r4, r2 + mov r2, #0x76 +#ifndef JAPAN + mov r3, #1 +#endif + mov r6, r0 + mov r5, r1 + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230AA78 + ldr r0, _0230AA84 ; =AFTERMATH_CHANCE + ldrsh r0, [r0] + bl DungeonRandOutcome__022EAB20 + cmp r0, #0 + ldrne ip, _0230AA88 ; =0x0000026F + cmpne r4, ip + beq _0230AA78 + mov r0, #0 + str r0, [sp] + mov r0, r6 + mov r1, r5 + add r2, r5, #4 + mov r3, #1 + str ip, [sp, #4] + bl TryAftermathExplosion + mov r0, #1 + b _0230AA7C +_0230AA78: + mov r0, #0 +_0230AA7C: + add sp, sp, #8 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_0230AA84: .word AFTERMATH_CHANCE +_0230AA88: .word 0x0000026F + arm_func_end AftermathCheck + + arm_func_start GetTypeMatchupBothTypes +GetTypeMatchupBothTypes: ; 0x0230AA8C + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + ldr r3, _0230AB4C ; =ov29_02352838 + mov sl, r0 + ldrh r4, [r3] + ldrh r3, [r3, #2] + mov sb, r1 + mov r8, r2 + strh r4, [sp] + strh r3, [sp, #2] + bl ScrappyShouldActivate + ldr fp, _0230AB50 ; =DUNGEON_PTR + mov r7, r0 + mov r6, #0 + mov r5, #1 + add r4, sp, #0 +_0230AAC8: + cmp r7, #0 + bne _0230AB04 + mov r0, r8 + bl IsTypeIneffectiveAgainstGhost + cmp r0, #0 + beq _0230AB04 + mov r0, sl + mov r1, sb + mov r2, r6 + bl GhostImmunityIsActive + cmp r0, #0 + ldrne r1, [fp] + movne r0, #0 + strneb r5, [r1, #0x1d4] + bne _0230AB18 +_0230AB04: + mov r0, sl + mov r1, sb + mov r2, r6 + mov r3, r8 + bl GetTypeMatchup +_0230AB18: + add r1, r6, #1 + mov r1, r1, lsl #0x10 + mov r2, r6, lsl #1 + mov r6, r1, asr #0x10 + strh r0, [r4, r2] + cmp r6, #2 + blt _0230AAC8 + ldrsh r2, [sp] + ldr r0, _0230AB54 ; =TYPE_MATCHUP_COMBINATOR_TABLE + ldrsh r1, [sp, #2] + add r0, r0, r2, lsl #4 + ldr r0, [r0, r1, lsl #2] + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_0230AB4C: .word ov29_02352838 +_0230AB50: .word DUNGEON_PTR +_0230AB54: .word TYPE_MATCHUP_COMBINATOR_TABLE + arm_func_end GetTypeMatchupBothTypes + + arm_func_start ScrappyShouldActivate +ScrappyShouldActivate: ; 0x0230AB58 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + mov r6, #0 + mov sl, r0 + mov sb, r1 + mov r8, r2 + mov r5, #0x57 + mov fp, r6 + mov r4, #1 + b _0230ABDC +_0230AB7C: + mov r0, sl + mov r1, r5 + ldr r7, [sb, #0xb4] + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230ABB4 + add r0, r7, r6 + ldrb r0, [r0, #0x5e] + cmp r0, #0xe + bne _0230ABB4 + cmp r8, #1 + cmpne r8, #7 + moveq r0, r4 + beq _0230ABB8 +_0230ABB4: + mov r0, fp +_0230ABB8: + cmp r0, #0 + ldrne r1, _0230ABEC ; =DUNGEON_PTR + movne r0, #1 + ldrne r1, [r1] + strneb r0, [r1, #0x1cc] + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + add r0, r6, #1 + mov r0, r0, lsl #0x10 + mov r6, r0, asr #0x10 +_0230ABDC: + cmp r6, #2 + blt _0230AB7C + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_0230ABEC: .word DUNGEON_PTR + arm_func_end ScrappyShouldActivate + + arm_func_start IsTypeIneffectiveAgainstGhost +IsTypeIneffectiveAgainstGhost: ; 0x0230ABF0 + cmp r0, #1 + cmpne r0, #7 + moveq r0, #1 + movne r0, #0 + bx lr + arm_func_end IsTypeIneffectiveAgainstGhost + + arm_func_start GhostImmunityIsActive +GhostImmunityIsActive: ; 0x0230AC04 + stmdb sp!, {r3, lr} + ldr r3, [r1, #0xb4] + add r1, r3, r2 + ldrb r1, [r1, #0x5e] + cmp r1, #0xe + bne _0230AC50 + ldrb r1, [r3, #0xfe] + cmp r1, #0 + bne _0230AC38 + mov r1, #0x45 + bl ExclusiveItemEffectIsActive__0230A9B8 + cmp r0, #0 + beq _0230AC40 +_0230AC38: + mov r0, #1 + b _0230AC44 +_0230AC40: + mov r0, #0 +_0230AC44: + cmp r0, #0 + moveq r0, #1 + ldmeqia sp!, {r3, pc} +_0230AC50: + mov r0, #0 + ldmia sp!, {r3, pc} + arm_func_end GhostImmunityIsActive + + arm_func_start GetTypeMatchup +GetTypeMatchup: ; 0x0230AC58 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r1 + ldr r4, [r7, #0xb4] + mov r6, r2 + ldrb r1, [r4, #0xf5] + mov r5, r3 + cmp r1, #1 + beq _0230AC88 + mov r1, #0x46 + bl ExclusiveItemEffectIsActive__0230A9B8 + cmp r0, #0 + beq _0230ACA0 +_0230AC88: + cmp r5, #0xb + addeq r0, r4, r6 + ldreqb r0, [r0, #0x5e] + cmpeq r0, #0x10 + moveq r0, #2 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} +_0230ACA0: + cmp r5, #9 + bne _0230ACE0 + bl GravityIsActive + cmp r0, #0 + beq _0230ACCC + add r0, r4, r6 + ldrb r0, [r0, #0x5e] + cmp r0, #0xa + bne _0230ACE0 + mov r0, #2 + ldmia sp!, {r3, r4, r5, r6, r7, pc} +_0230ACCC: + mov r0, r7 + bl IsFloating + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} +_0230ACE0: + ldr r1, _0230AD00 ; =TYPE_MATCHUP_TABLE + mov r0, #0x24 + mla r0, r5, r0, r1 + add r1, r4, r6 + ldrb r1, [r1, #0x5e] + mov r1, r1, lsl #1 + ldrsh r0, [r1, r0] + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_0230AD00: .word TYPE_MATCHUP_TABLE + arm_func_end GetTypeMatchup + + arm_func_start CalcTypeBasedDamageEffects +CalcTypeBasedDamageEffects: ; 0x0230AD04 + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x64 + ldr r5, _0230B774 ; =ov29_02352838 + mov sl, r1 + ldr r4, [r5, #0x1c] + ldr r5, [r5, #0x20] + ldr r8, [sp, #0x88] + ldr r1, [sp, #0x90] + ldr r7, [sp, #0x8c] + str r1, [sp, #0x90] + ldr r6, [sl, #0xb4] + mov r1, #1 + mov fp, r0 + mov sb, r2 + str r3, [sp, #4] + str r4, [sp, #0x34] + str r5, [sp, #0x38] + bl IntToFixedPoint64 + mov r0, #0 + str r0, [sp, #0x30] + strb r0, [r7, #0xe] + ldr r1, [sp, #0x30] + mov r0, sb + strb r1, [r7, #0xf] + bl EntityIsValid__02308FBC + cmp r0, #0 + moveq r0, #1 + beq _0230B76C + mov r0, r8 + bl IsTypeIneffectiveAgainstGhost + str r0, [sp, #0x2c] + mov r0, sl + mov r1, sb + mov r2, #0x35 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + cmpne r8, #0 + movne r0, #1 + strne r0, [sp, #0x30] + mov r3, #2 + mov r0, sl + mov r1, sb + mov r2, r8 + str r3, [r7, #8] + bl ScrappyShouldActivate + ldr r3, _0230B778 ; =MATCHUP_IMMUNE_MULTIPLIER_ERRATIC_PLAYER + str r0, [sp, #0x28] + ldr r0, [r3] + ldr r2, _0230B77C ; =MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER + str r0, [sp, #0x24] + ldr r0, [r2] + ldr r1, _0230B780 ; =MATCHUP_NEUTRAL_MULTIPLIER_ERRATIC_PLAYER + str r0, [sp, #0x20] + ldr r0, [r1] + ldr r1, _0230B784 ; =MATCHUP_IMMUNE_MULTIPLIER + str r0, [sp, #0x1c] + ldr r0, _0230B788 ; =MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER + mov r4, #0 + ldr r0, [r0] + str r0, [sp, #0x18] + ldr r0, [r1] + ldr r1, _0230B78C ; =MATCHUP_NEUTRAL_MULTIPLIER + str r0, [sp, #0x14] + ldr r0, _0230B790 ; =MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER + ldr r0, [r0] + str r0, [sp, #0x10] + ldr r0, [r1] + str r0, [sp, #0xc] + ldr r0, _0230B794 ; =MATCHUP_SUPER_EFFECTIVE_MULTIPLIER + ldr r0, [r0] + str r0, [sp, #8] + b _0230AF8C +_0230AE28: + ldr r0, [sp, #0x90] + cmp r0, #0 + bne _0230AE90 + mov r0, sl + mov r1, #0x3b + bl IqSkillIsEnabled + cmp r0, #0 + bne _0230AE5C + mov r0, sb + mov r1, #0x3b + bl IqSkillIsEnabled + cmp r0, #0 + beq _0230AE90 +_0230AE5C: + ldr r1, [sp, #0x24] + add r0, sp, #0x44 + bl FixedPoint32To64 + ldr r1, [sp, #0x20] + add r0, sp, #0x4c + bl FixedPoint32To64 + ldr r1, [sp, #0x1c] + add r0, sp, #0x54 + bl FixedPoint32To64 + ldr r1, [sp, #0x18] + add r0, sp, #0x5c + bl FixedPoint32To64 + b _0230AEC0 +_0230AE90: + ldr r1, [sp, #0x14] + add r0, sp, #0x44 + bl FixedPoint32To64 + ldr r1, [sp, #0x10] + add r0, sp, #0x4c + bl FixedPoint32To64 + ldr r1, [sp, #0xc] + add r0, sp, #0x54 + bl FixedPoint32To64 + ldr r1, [sp, #8] + add r0, sp, #0x5c + bl FixedPoint32To64 +_0230AEC0: + mov r0, fp + bl FixedPoint64IsZero + cmp r0, #0 + bne _0230AF94 + ldr r0, [sp, #0x28] + cmp r0, #0 + bne _0230AF1C + ldr r0, [sp, #0x2c] + cmp r0, #0 + beq _0230AF1C + mov r0, sl + mov r1, sb + mov r2, r4, lsl #0x10 + mov r2, r2, asr #0x10 + bl GhostImmunityIsActive + cmp r0, #0 + beq _0230AF1C + ldr r0, _0230B798 ; =DUNGEON_PTR + mov r5, #0 + ldr r1, [r0] + mov r0, #1 + strb r0, [r1, #0x1d4] + b _0230AF38 +_0230AF1C: + mov r0, sl + mov r1, sb + mov r2, r4, lsl #0x10 + mov r2, r2, asr #0x10 + mov r3, r8 + bl GetTypeMatchup + mov r5, r0 +_0230AF38: + mov r0, sl + mov r1, #0x3b + bl IqSkillIsEnabled + cmp r0, #0 + beq _0230AF64 + add r2, sp, #0x44 + mov r0, fp + mov r1, fp + add r2, r2, r5, lsl #3 + bl MultiplyFixedPoint64 + b _0230AF80 +_0230AF64: + cmp r5, #2 + beq _0230AF80 + add r2, sp, #0x44 + mov r0, fp + mov r1, fp + add r2, r2, r5, lsl #3 + bl MultiplyFixedPoint64 +_0230AF80: + add r0, sp, #0x34 + str r5, [r0, r4, lsl #2] + add r4, r4, #1 +_0230AF8C: + cmp r4, #2 + blt _0230AE28 +_0230AF94: + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r4, [sp, #0x34] + ldr r2, [r0] + ldr r1, _0230B79C ; =TYPE_MATCHUP_COMBINATOR_TABLE + strb r4, [r2, #0x18c] + ldr r3, [sp, #0x38] + ldr r2, [r0] + add r1, r1, r4, lsl #4 + ldr r0, [r1, r3, lsl #2] + strb r3, [r2, #0x18d] + cmp r0, #3 + str r0, [r7, #8] + moveq r4, #1 + beq _0230AFEC + ldr r0, [sp, #0x30] + mov r4, #0 + cmp r0, #0 + ldrne r0, _0230B774 ; =ov29_02352838 + ldrne r1, [r0, #0x3c] + ldrne r0, [r0, #0x40] + strne r1, [fp] + strne r0, [fp, #4] +_0230AFEC: + mov r0, sl + mov r1, #0x50 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230B02C + ldr r0, [r7, #8] + cmp r0, #1 + bne _0230B02C + ldr r1, _0230B7A0 ; =TINTED_LENS_MULTIPLIER + add r0, sp, #0x3c + ldr r1, [r1] + bl FixedPoint32To64 + add r2, sp, #0x3c + mov r0, fp + mov r1, fp + bl MultiplyFixedPoint64 +_0230B02C: + mov r0, sl + mov r1, sb + mov r2, #0x6c +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + bne _0230B064 + mov r0, sl + mov r1, sb + mov r2, #0x6e +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230B080 +_0230B064: + ldr r0, [r7, #8] + cmp r0, #3 + bne _0230B080 + ldr r2, _0230B7A4 ; =SOLID_ROCK_MULTIPLIER + mov r0, fp + mov r1, fp + bl MultiplyFixedPoint64 +_0230B080: + mov r0, sb + mov r1, #0x5a + bl ExclusiveItemEffectIsActive__0230A9B8 + cmp r0, #0 + beq _0230B0A4 + ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 + mov r0, fp + mov r1, fp + bl MultiplyFixedPoint64 +_0230B0A4: + ldr r0, [sp, #0x90] + cmp r0, #0 + bne _0230B104 + mov r0, sl + mov r1, #0x64 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230B104 + ldr r0, _0230B7AC ; =TECHNICIAN_MOVE_POWER_THRESHOLD + ldrsh r1, [r0] + ldr r0, [sp, #4] + cmp r0, r1 + bgt _0230B104 + ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 + mov r0, fp + mov r1, fp + bl MultiplyFixedPoint64 + mov r1, #0x64 + ldr r2, _0230B7B4 ; =0x00000C3E + mov r0, sl + str r1, [sp] + mov r1, sb + mov r3, #2 + bl LogMessageByIdWithPopupCheckParticipants +_0230B104: + cmp r8, #2 + cmpne r8, #6 + bne _0230B14C + mov r0, sl + mov r1, sb + mov r2, #2 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230B14C + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 + ldr r3, [r0] + mov r5, #1 + mov r0, fp + mov r1, fp + strb r5, [r3, #0x1c5] + bl MultiplyFixedPoint64 +_0230B14C: + cmp r8, #2 + bne _0230B198 + mov r0, sl + mov r1, sb + bl FlashFireShouldActivate + cmp r0, #0 + beq _0230B198 + ldr r1, _0230B798 ; =DUNGEON_PTR + mov r0, fp + ldr r2, [r1] + mov r3, #1 + mov r1, #0 + strb r3, [r2, #0x1c6] + bl IntToFixedPoint64 + mov r4, #0 + str r4, [r7, #8] + strb r4, [r7, #0xe] + mov r0, #1 + strb r0, [r7, #0xf] +_0230B198: + cmp r8, #2 + bne _0230B1DC + mov r0, sl + mov r1, sb + mov r2, #0x5f +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230B1DC + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 + ldr r3, [r0] + mov r5, #1 + mov r0, fp + mov r1, fp + strb r5, [r3, #0x1c5] + bl MultiplyFixedPoint64 +_0230B1DC: + cmp r8, #9 + bne _0230B248 + mov r0, sl + mov r1, #0x53 + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _0230B208 + mov r0, sb + bl LevitateIsActive + cmp r0, #0 + bne _0230B218 +_0230B208: + mov r0, sb + bl IsFloating + cmp r0, #0 + beq _0230B248 +_0230B218: + ldr r1, _0230B798 ; =DUNGEON_PTR + mov r0, fp + ldr r2, [r1] + mov r3, #1 + mov r1, #0 + strb r3, [r2, #0x1c7] + bl IntToFixedPoint64 + mov r4, #0 + str r4, [r7, #8] + strb r4, [r7, #0xe] + mov r0, #1 + strb r0, [r7, #0xf] +_0230B248: + cmp r8, #3 + bne _0230B2F4 + mov r0, sl + mov r1, #0x10 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230B2F4 + ldrsh r2, [r6, #0x12] + ldrsh r1, [r6, #0x16] + ldr r0, _0230B7B8 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r6, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movle r0, #1 + movgt r0, #0 + and r7, r0, #0xff + mov r0, r6 + mov r2, r7 + mov r1, #0x80 + bl UpdateStateFlags + mov r5, r0 + cmp r7, #0 + beq _0230B2D4 + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 + ldr r3, [r0] + mov r7, #1 + mov r0, fp + mov r1, fp + strb r7, [r3, #0x1c8] + bl MultiplyFixedPoint64 +_0230B2D4: + cmp r5, #0 + beq _0230B2F4 + mov r0, sl + bl PlayEffectAnimation0x1A9__022E6214 + ldr r2, _0230B7C0 ; =0x00000C4F + mov r0, sl + mov r1, sb + bl LogMessageByIdWithPopupCheckUserTarget +_0230B2F4: + cmp r8, #4 + bne _0230B3A0 + mov r0, sl + mov r1, #0x1a + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230B3A0 + ldrsh r2, [r6, #0x12] + ldrsh r1, [r6, #0x16] + ldr r0, _0230B7B8 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r6, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movle r0, #1 + movgt r0, #0 + and r7, r0, #0xff + mov r0, r6 + mov r2, r7 + mov r1, #2 + bl UpdateStateFlags + mov r5, r0 + cmp r7, #0 + beq _0230B380 + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 + ldr r3, [r0] + mov r7, #1 + mov r0, fp + mov r1, fp + strb r7, [r3, #0x1c9] + bl MultiplyFixedPoint64 +_0230B380: + cmp r5, #0 + beq _0230B3A0 + mov r0, sl + bl PlayEffectAnimation0x1A9__022E61C8 +#ifdef JAPAN + ldr r2, _0230CD24 ; =0x0000098F + mov r0, sl + mov r1, sb +#else + mov r0, sl + mov r1, sb + mov r2, #0xc50 +#endif + bl LogMessageByIdWithPopupCheckUserTarget +_0230B3A0: + cmp r8, #0xc + bne _0230B44C + mov r0, sl + mov r1, #0x43 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230B44C + ldrsh r2, [r6, #0x12] + ldrsh r1, [r6, #0x16] + ldr r0, _0230B7B8 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r6, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movle r0, #1 + movgt r0, #0 + and r7, r0, #0xff + mov r0, r6 + mov r2, r7 + mov r1, #0x10 + bl UpdateStateFlags + mov r5, r0 + cmp r7, #0 + beq _0230B42C + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 + ldr r3, [r0] + mov r7, #1 + mov r0, fp + mov r1, fp + strb r7, [r3, #0x1ca] + bl MultiplyFixedPoint64 +_0230B42C: + cmp r5, #0 + beq _0230B44C + mov r0, sl + bl PlayEffectAnimation0x1A9__022E64C4 +#ifdef JAPAN + mov r0, sl + mov r1, sb + mov r2, #0x990 +#else + ldr r2, _0230B7C4 ; =0x00000C51 + mov r0, sl + mov r1, sb +#endif + bl LogMessageByIdWithPopupCheckUserTarget +_0230B44C: + cmp r8, #2 + bne _0230B534 + mov r0, sl + mov r1, #0x46 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230B4F8 + ldrsh r2, [r6, #0x12] + ldrsh r1, [r6, #0x16] + ldr r0, _0230B7B8 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r6, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movle r0, #1 + movgt r0, #0 + and r7, r0, #0xff + mov r0, r6 + mov r2, r7 + mov r1, #0x20 + bl UpdateStateFlags + mov r5, r0 + cmp r7, #0 + beq _0230B4D8 + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 + ldr r3, [r0] + mov r7, #1 + mov r0, fp + mov r1, fp + strb r7, [r3, #0x1cb] + bl MultiplyFixedPoint64 +_0230B4D8: + cmp r5, #0 + beq _0230B4F8 + mov r0, sl + bl PlayEffectAnimation0x1A9__022E6510 + ldr r2, _0230B7C8 ; =0x00000C52 + mov r0, sl + mov r1, sb + bl LogMessageByIdWithPopupCheckUserTarget +_0230B4F8: + mov r0, sl + mov r1, sb + mov r2, #0x55 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230B534 + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 + ldr r3, [r0] + mov r5, #1 + mov r0, fp + mov r1, fp + strb r5, [r3, #0x1cb] + bl MultiplyFixedPoint64 +_0230B534: + ldrb r0, [r6, #0xbf] + cmp r0, #1 + bne _0230B560 + ldr r1, _0230B7CC ; =BURN_DAMAGE_MULTIPLIER + add r0, sp, #0x3c + ldr r1, [r1] + bl FixedPoint32To64 + add r2, sp, #0x3c + mov r0, fp + mov r1, fp + bl MultiplyFixedPoint64 +_0230B560: + mov r0, fp + bl FixedPoint64IsZero + cmp r0, #0 + bne _0230B5CC + mov r0, sl + mov r1, r8 + bl MonsterIsType + cmp r0, #0 + beq _0230B5CC + ldr r1, _0230B798 ; =DUNGEON_PTR + mov r0, sl + ldr r2, [r1] + mov r3, #1 + mov r1, #0x63 + strb r3, [r2, #0x1cf] + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230B5BC + ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 + mov r0, fp + mov r1, fp + bl MultiplyFixedPoint64 + b _0230B5CC +_0230B5BC: + ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 + mov r0, fp + mov r1, fp + bl MultiplyFixedPoint64 +_0230B5CC: + mov r0, sl + bl GetApparentWeather + mov r5, r0 + cmp r5, #1 + bne _0230B634 + cmp r8, #2 + bne _0230B60C + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 + ldr r3, [r0] + mov r7, #1 + mov r0, fp + mov r1, fp + strb r7, [r3, #0x1c4] + bl MultiplyFixedPoint64 + b _0230B634 +_0230B60C: + cmp r8, #3 + bne _0230B634 + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 + ldr r3, [r0] + mov r7, #1 + mov r0, fp + mov r1, fp + strb r7, [r3, #0x1c4] + bl MultiplyFixedPoint64 +_0230B634: + cmp r5, #4 + bne _0230B690 + cmp r8, #2 + bne _0230B668 + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 + ldr r3, [r0] + mov r7, #1 + mov r0, fp + mov r1, fp + strb r7, [r3, #0x1c3] + bl MultiplyFixedPoint64 + b _0230B690 +_0230B668: + cmp r8, #3 + bne _0230B690 + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7B0 ; =DAMAGE_MULTIPLIER_1_5 + ldr r3, [r0] + mov r7, #1 + mov r0, fp + mov r1, fp + strb r7, [r3, #0x1c3] + bl MultiplyFixedPoint64 +_0230B690: + cmp r5, #3 + bne _0230B6C0 + cmp r8, #1 + beq _0230B6C0 + ldr r2, _0230B7D0 ; =CLOUDY_DAMAGE_MULTIPLIER + mov r0, fp + mov r1, fp + bl MultiplyFixedPoint64 + ldr r0, _0230B798 ; =DUNGEON_PTR + mov r1, #1 + ldr r0, [r0] + strb r1, [r0, #0x1c2] +_0230B6C0: + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r7, [r0] + add r0, r7, #0xc000 +#ifdef JAPAN + ldrb r0, [r0, #0xcb7] +#else + ldrb r0, [r0, #0xd5b] +#endif + cmp r0, #0 + bne _0230B6E0 + cmp r5, #6 + bne _0230B700 +_0230B6E0: + cmp r8, #5 + bne _0230B700 + ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 + mov r3, #1 + mov r0, fp + mov r1, fp + strb r3, [r7, #0x1d0] + bl MultiplyFixedPoint64 +_0230B700: + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r5, [r0] + add r0, r5, #0xc000 +#ifdef JAPAN + ldrb r0, [r0, #0xcb8] +#else + ldrb r0, [r0, #0xd5c] +#endif + cmp r0, #0 + beq _0230B738 + cmp r8, #2 + bne _0230B738 + ldr r2, _0230B7A8 ; =DAMAGE_MULTIPLIER_0_5 + mov r3, #1 + mov r0, fp + mov r1, fp + strb r3, [r5, #0x1d1] + bl MultiplyFixedPoint64 +_0230B738: + cmp r8, #5 + ldreqb r0, [r6, #0xd2] + cmpeq r0, #0xb + bne _0230B768 + ldr r0, _0230B798 ; =DUNGEON_PTR + ldr r2, _0230B7BC ; =DAMAGE_MULTIPLIER_2 + ldr r3, [r0] + mov r5, #1 + mov r0, fp + mov r1, fp + strb r5, [r3, #0x1d2] + bl MultiplyFixedPoint64 +_0230B768: + mov r0, r4 +_0230B76C: + add sp, sp, #0x64 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +#ifdef JAPAN +#define CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET -0x2C1 +#else +#define CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET 0 +#endif +_0230B774: .word ov29_02352838 +_0230B778: .word MATCHUP_IMMUNE_MULTIPLIER_ERRATIC_PLAYER +_0230B77C: .word MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER +_0230B780: .word MATCHUP_NEUTRAL_MULTIPLIER_ERRATIC_PLAYER +_0230B784: .word MATCHUP_IMMUNE_MULTIPLIER +_0230B788: .word MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER +_0230B78C: .word MATCHUP_NEUTRAL_MULTIPLIER +_0230B790: .word MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER +_0230B794: .word MATCHUP_SUPER_EFFECTIVE_MULTIPLIER +_0230B798: .word DUNGEON_PTR +_0230B79C: .word TYPE_MATCHUP_COMBINATOR_TABLE +_0230B7A0: .word TINTED_LENS_MULTIPLIER +_0230B7A4: .word SOLID_ROCK_MULTIPLIER +_0230B7A8: .word DAMAGE_MULTIPLIER_0_5 +_0230B7AC: .word TECHNICIAN_MOVE_POWER_THRESHOLD +_0230B7B0: .word DAMAGE_MULTIPLIER_1_5 +_0230B7B4: .word 0x00000C3E + CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET +_0230B7B8: .word 0x000003E7 +_0230B7BC: .word DAMAGE_MULTIPLIER_2 +_0230B7C0: .word 0x00000C4F + CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET +#ifdef JAPAN +_0230CD24: .word 0x0000098F +#else +_0230B7C4: .word 0x00000C51 +#endif +_0230B7C8: .word 0x00000C52 + CALC_TYPE_BASED_DAMAGE_EFFECTS_OFFSET +_0230B7CC: .word BURN_DAMAGE_MULTIPLIER +_0230B7D0: .word CLOUDY_DAMAGE_MULTIPLIER + arm_func_end CalcTypeBasedDamageEffects + + arm_func_start ov29_0230B7D4 +ov29_0230B7D4: ; 0x0230B7D4 + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x24 + mov sb, r1 + mov sl, r0 + mov r0, sb + mov r4, #1 + mov r8, r2 + mov fp, #0 + bl EntityIsValid__02308FBC + cmp r0, #0 + moveq r0, r4 + beq _0230BB98 + mov r0, sl + mov r1, #0x6b + ldr r7, [sl, #0xb4] + ldr r6, [sb, #0xb4] + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r8, r4 + cmp r8, #1 + cmpne r8, #7 + moveq fp, #1 + cmp r8, #2 + bne _0230B84C + mov r0, sl + mov r1, sb + bl FlashFireShouldActivate + cmp r0, #0 + movne r0, #0 + bne _0230BB98 +_0230B84C: + cmp r8, #5 + bne _0230B874 + mov r0, sl + mov r1, sb + mov r2, #0x23 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + movne r0, #0 + bne _0230BB98 +_0230B874: + cmp r8, #3 + bne _0230B89C + mov r0, sl + mov r1, sb + mov r2, #0x24 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + movne r0, #0 + bne _0230BB98 +_0230B89C: + cmp r8, #9 + bne _0230B8E0 + mov r0, sl + mov r1, #0x53 + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _0230B8C8 + mov r0, sb + bl LevitateIsActive + cmp r0, #0 + bne _0230B8D8 +_0230B8C8: + mov r0, sb + bl IsFloating + cmp r0, #0 + beq _0230B8E0 +_0230B8D8: + mov r0, #1 + b _0230BB98 +_0230B8E0: + mov r0, sl + mov r1, sb + mov r2, r8 + bl ScrappyShouldActivate + ldr r1, _0230BBA0 ; =ov29_02352884 + str r0, [sp] + add ip, sp, #4 + ldmia r1, {r0, r1, r2, r3} + stmia ip, {r0, r1, r2, r3} + mov r5, #0 + b _0230B9A0 +_0230B90C: + ldr r0, [sp] + add ip, sp, #0x14 + cmp r0, #0 + add r0, sp, #4 + ldmia r0, {r0, r1, r2, r3} + stmia ip, {r0, r1, r2, r3} + bne _0230B960 + cmp fp, #0 + beq _0230B960 + add r0, r6, r5 + ldrb r0, [r0, #0x5e] + cmp r0, #0xe + ldreqb r0, [r6, #0xfe] + cmpeq r0, #0 + bne _0230B960 + ldr r1, _0230BBA4 ; =DUNGEON_PTR + mov r0, #0 + ldr r2, [r1] + mov r1, #1 + strb r1, [r2, #0x1d4] + b _0230B978 +_0230B960: + mov r0, sl + mov r1, sb + mov r2, r5, lsl #0x10 + mov r2, r2, asr #0x10 + mov r3, r8 + bl GetTypeMatchup +_0230B978: + cmp r4, #0 + beq _0230B9A8 + add r1, sp, #0x14 + ldr r0, [r1, r0, lsl #2] + mul r0, r4, r0 + add r0, r0, r0, lsr #31 + movs r4, r0, asr #1 + moveq r0, #2 + beq _0230BB98 + add r5, r5, #1 +_0230B9A0: + cmp r5, #2 + blt _0230B90C +_0230B9A8: + cmp r8, #2 + cmpne r8, #6 + bne _0230B9D4 + mov r0, sl + mov r1, sb + mov r2, #2 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + movne r0, #2 + bne _0230BB98 +_0230B9D4: + cmp r8, #3 + bne _0230BA1C + mov r0, sl + mov r1, #0x10 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BA1C + ldrsh r2, [r7, #0x12] + ldrsh r1, [r7, #0x16] + ldr r0, _0230BBA8 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r7, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movle r4, r4, lsl #1 +_0230BA1C: + cmp r8, #4 + bne _0230BA64 + mov r0, sl + mov r1, #0x1a + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BA64 + ldrsh r2, [r7, #0x12] + ldrsh r1, [r7, #0x16] + ldr r0, _0230BBA8 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r7, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movle r4, r4, lsl #1 +_0230BA64: + cmp r8, #0xc + bne _0230BAAC + mov r0, sl + mov r1, #0x43 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BAAC + ldrsh r2, [r7, #0x12] + ldrsh r1, [r7, #0x16] + ldr r0, _0230BBA8 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r7, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movle r4, r4, lsl #1 +_0230BAAC: + cmp r8, #2 + bne _0230BAF4 + mov r0, sl + mov r1, #0x46 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BAF4 + ldrsh r2, [r7, #0x12] + ldrsh r1, [r7, #0x16] + ldr r0, _0230BBA8 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r7, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + movle r4, r4, lsl #1 +_0230BAF4: + cmp r4, #0 + moveq r0, #2 + beq _0230BB98 + mov r0, sl + mov r1, r8 + bl MonsterIsType + cmp r0, #0 + mov r0, sl + movne r4, r4, lsl #1 + bl GetApparentWeather + cmp r0, #1 + bne _0230BB3C + cmp r8, #2 + moveq r4, r4, lsl #1 + beq _0230BB3C + cmp r8, #3 + moveq r0, #2 + beq _0230BB98 +_0230BB3C: + ldr r0, _0230BBA4 ; =DUNGEON_PTR + ldr r1, [r0] + add r0, r1, #0xc000 +#ifdef JAPAN + ldrb r0, [r0, #0xcb7] +#else + ldrb r0, [r0, #0xd5b] +#endif + cmp r0, #0 + beq _0230BB60 + cmp r8, #5 + moveq r0, #2 + beq _0230BB98 +_0230BB60: + add r0, r1, #0xc000 +#ifdef JAPAN + ldrb r0, [r0, #0xcb8] +#else + ldrb r0, [r0, #0xd5c] +#endif + cmp r0, #0 + beq _0230BB7C + cmp r8, #2 + moveq r0, #2 + beq _0230BB98 +_0230BB7C: + cmp r8, #5 + ldreqb r0, [r7, #0xd2] + cmpeq r0, #0xb + moveq r4, r4, lsl #1 + cmp r4, #3 + movge r4, #3 + add r0, r4, #2 +_0230BB98: + add sp, sp, #0x24 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_0230BBA0: .word ov29_02352884 +_0230BBA4: .word DUNGEON_PTR +_0230BBA8: .word 0x000003E7 + arm_func_end ov29_0230B7D4 + + arm_func_start CalcDamage +CalcDamage: ; 0x0230BBAC +#ifdef JAPAN +#define CALC_DAMAGE_OFFSET -4 +#else +#define CALC_DAMAGE_OFFSET 0 +#endif + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0xc0 + ldr r4, _0230C450 ; =DUNGEON_PTR + mov sl, r0 + ldr r4, [r4] + ldr r6, [sl, #0xb4] + ldr r8, [sp, #0xec] + str r2, [sp, #0xc] + mov sb, r1 + ldr r1, [sp, #0xf4] + mov r0, r8 + str r1, [sp, #0xf4] + ldr r1, [sp, #0xf8] + str r3, [sp, #0x10] + str r1, [sp, #0xf8] + ldr r1, [sp, #0xf0] + add r5, r4, #0x184 + ldr r7, [sb, #0xb4] + str r1, [sp, #0x1c] + bl ResetDamageData + ldrb r0, [r6, #0x221 + CALC_DAMAGE_OFFSET] + cmp r0, #0 + beq _0230BC1C + ldr r1, _0230C454 ; =ME_FIRST_MULTIPLIER + ldr r0, [sp, #0x1c] + ldr r1, [r1] + bl MultiplyByFixedPoint + str r0, [sp, #0x1c] +_0230BC1C: + mov r0, sl + mov r1, #0x5c + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BC50 + ldr r0, [sp, #0xf4] + bl IsRecoilMove + cmp r0, #0 + ldrne r0, [sp, #0x1c] + addne r0, r0, r0, lsl #1 + addne r0, r0, r0, lsr #31 + movne r0, r0, asr #1 + strne r0, [sp, #0x1c] +_0230BC50: + mov r0, sl + mov r1, #0x65 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BC84 + ldr r0, [sp, #0xf4] + bl IsPunchMove + cmp r0, #0 + beq _0230BC84 + ldr r0, [sp, #0x1c] + mov r1, #0x180 + bl MultiplyByFixedPoint + str r0, [sp, #0x1c] +_0230BC84: + mov r0, sl + mov r1, #0x6b + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #1 + strne r0, [sp, #0xc] + ldr r1, _0230C458 ; =0x000001D3 + ldr r0, [sp, #0xf4] + cmp r0, r1 + ldreqb r0, [r6, #0x5e] + streq r0, [sp, #0xc] + ldr r0, [sp, #0xf4] + bl MoveIsNotPhysical + str r0, [sp, #0x18] + bl ResetDamageCalcDiagnostics + ldrb r0, [r6, #7] + cmp r0, #0 + bne _0230BD34 + add r0, r6, #0x100 + ldrh r1, [r0, #0x46 + CALC_DAMAGE_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + CALC_DAMAGE_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0 + bne _0230BD34 + mov r0, #1 + str r0, [r8] + mov r0, #0 + str r0, [r8, #4] + mov r0, #2 + str r0, [r8, #8] + ldr r0, [sp, #0xf4] + ldr r1, [sp, #0xc] + strb r1, [r8, #0xc] + bl GetMoveCategory + strb r0, [r8, #0xd] + mov r0, #0 + strb r0, [r8, #0xe] + strb r0, [r8, #0xf] + strb r0, [r8, #0x10] + b _0230D054 +_0230BD34: + ldr r1, _0230C45C ; =0x00000163 + ldr r0, [sp, #0xf4] + cmp r0, r1 + bne _0230BDA0 + mov r0, sl + mov r1, sb + mov r2, #0x35 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230BDA0 + mov r0, #1 + str r0, [r8] + mov r0, #0 + str r0, [r8, #4] + mov r0, #2 + str r0, [r8, #8] + ldr r0, [sp, #0xf4] + ldr r1, [sp, #0xc] + strb r1, [r8, #0xc] + bl GetMoveCategory + strb r0, [r8, #0xd] + mov r0, #0 + strb r0, [r8, #0xe] + strb r0, [r8, #0xf] + strb r0, [r8, #0x10] + b _0230D054 +_0230BDA0: + ldr r0, [sp, #0xf4] + ldr r1, [sp, #0xc] + strb r1, [r8, #0xc] + bl GetMoveCategory + strb r0, [r8, #0xd] + ldr r0, [sp, #0xc] + mov r4, #0 + strb r0, [r5] + ldr r0, [sp, #0x18] + mov r1, #0x60 + str r0, [r5, #4] + add r0, r6, r0, lsl #2 + ldr r0, [r0, #0x34] + mov fp, r4 + str r0, [sp, #0x3c] + ldr r0, [sp, #0x18] + add r0, r7, r0, lsl #2 + ldr r0, [r0, #0x3c] + str r0, [sp, #0x38] + mov r0, sl + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BE40 + ldrb r1, [r7, #0x1c] + ldrb r0, [r7, #0x1d] + cmp r1, r0 + blo _0230BE28 + ldr r0, [sp, #0x18] + cmp r0, #1 + ldreqb r0, [r5, #0x32] + addeq r4, r4, #1 + addeq r0, r0, #1 + streqb r0, [r5, #0x32] + b _0230BE40 +_0230BE28: + ldr r0, [sp, #0x18] + cmp r0, #0 + ldreqb r0, [r5, #0x32] + addeq r4, r4, #1 + addeq r0, r0, #1 + streqb r0, [r5, #0x32] +_0230BE40: + ldr r0, [sp, #0xf8] + cmp r0, #0 + ldr r0, [sp, #0x18] + add r0, r6, r0, lsl #1 + ldrsh r0, [r0, #0x24] + str r0, [sp, #0x44] + beq _0230BE70 + ldr r0, [sp, #0xc] + cmp r0, #2 + ldreqsh r0, [r6, #0x30] + streqh r0, [r5, #0x10] + addeq r4, r4, r0 +_0230BE70: + mov r0, sl + mov r1, #0x22 + bl IqSkillIsEnabled + cmp r0, #0 + ldrneb r0, [r5, #0x34] + mov r1, #0x23 + addne r4, r4, #1 + addne r0, r0, #1 + strneb r0, [r5, #0x34] + mov r0, sl + bl IqSkillIsEnabled + cmp r0, #0 + ldrneb r0, [r5, #0x34] + mov r1, #0x3c + subne r4, r4, #1 + subne r0, r0, #1 + strneb r0, [r5, #0x34] + mov r0, sl + bl IqSkillIsEnabled + cmp r0, #0 + ldrneb r0, [r6, #0x166 + CALC_DAMAGE_OFFSET] + mov r1, #0x32 + cmpne r0, #0 + ldrneb r0, [r5, #0x34] + addne r4, r4, #1 + addne r0, r0, #1 + strneb r0, [r5, #0x34] + mov r0, sl + bl NearbyAllyIqSkillIsEnabled + cmp r0, #0 + ldr r0, [sp, #0x18] + addne r4, r4, #1 + cmp r0, #0 + mov r0, sl + bne _0230BFA8 + mov r1, #0x68 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BF5C + ldrsh r0, [r6, #4] + ldrsh r1, [r7, #4] + bl GendersEqualNotGenderless + cmp r0, #0 + ldrneb r0, [r5, #0x32] + addne r4, r4, #1 + addne r0, r0, #1 + strneb r0, [r5, #0x32] + bne _0230BF5C + ldrsh r0, [r6, #4] + bl GetMonsterGenderVeneer + cmp r0, #3 + beq _0230BF5C + ldrsh r0, [r7, #4] + bl GetMonsterGenderVeneer + cmp r0, #3 + ldrneb r0, [r5, #0x32] + subne r4, r4, #1 + subne r0, r0, #1 + strneb r0, [r5, #0x32] +_0230BF5C: + mov r0, sl + bl GetApparentWeather + cmp r0, #1 + bne _0230C040 + mov r0, sl + mov r1, #0x71 + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _0230BF94 + mov r0, sl + mov r1, #0x71 + bl OtherMonsterAbilityIsActive + cmp r0, #0 + beq _0230C040 +_0230BF94: + add r4, r4, #1 + ldrb r0, [r5, #0x32] + add r0, r0, #1 + strb r0, [r5, #0x32] + b _0230C040 +_0230BFA8: + mov r1, #0x5a + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230BFD4 + mov r0, sl + bl GetApparentWeather + cmp r0, #1 + ldreqb r0, [r5, #0x32] + addeq r4, r4, #2 + addeq r0, r0, #2 + streqb r0, [r5, #0x32] +_0230BFD4: + mov r0, sb + bl GetApparentWeather + cmp r0, #1 + bne _0230C01C + mov r0, sb + mov r1, #0x71 + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _0230C00C + mov r0, sb + mov r1, #0x71 + bl OtherMonsterAbilityIsActive + cmp r0, #0 + beq _0230C01C +_0230C00C: + add fp, fp, #1 + ldrb r0, [r5, #0x33] + add r0, r0, #1 + strb r0, [r5, #0x33] +_0230C01C: + mov r0, sb + bl GetApparentWeather + cmp r0, #2 + bne _0230C040 + ldrb r0, [r7, #0x5e] + cmp r0, #0xd + ldrneb r0, [r7, #0x5f] + cmpne r0, #0xd + addeq fp, fp, #2 +_0230C040: + ldrsh r1, [r6, #4] + ldr r0, _0230C460 ; =0x000001A3 + cmp r1, r0 + addeq r4, r4, #2 + cmp r1, #0x1a4 + ldr r0, _0230C464 ; =0x000001A5 + subeq r4, r4, #2 + cmp r1, r0 + ldr r0, _0230C468 ; =0x00000211 + subeq r4, r4, #2 + cmp r1, r0 + subeq r4, r4, #2 + beq _0230C07C + cmp r1, #0x218 + addeq r4, r4, #2 +_0230C07C: + ldr r0, [sp, #0x44] + add r0, r0, r4 + str r0, [sp, #0x44] + ldrb r0, [r6, #0x167 + CALC_DAMAGE_OFFSET] + cmp r0, #0 + beq _0230C0AC + mov r0, sl + mov r1, #0x4f + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #0x14 + strne r0, [sp, #0x44] +_0230C0AC: + ldr r0, [sp, #0x18] + cmp r0, #0 + add r0, r7, r0, lsl #1 + ldrsh r4, [r0, #0x28] + bne _0230C0F4 + ldrb r0, [r7, #0xd2] + mov r1, #0x31 + cmp r0, #6 + moveq r0, #1 + streqb r0, [r5, #0x51] + mov r0, sb + addeq fp, fp, #1 + bl IqSkillIsEnabled + cmp r0, #0 + ldrneb r0, [r5, #0x35] + subne fp, fp, #1 + subne r0, r0, #1 + strneb r0, [r5, #0x35] +_0230C0F4: + mov r0, sb + mov r1, #0x22 + bl IqSkillIsEnabled + cmp r0, #0 + ldrneb r0, [r5, #0x35] + mov r1, #0x23 + subne fp, fp, #1 + subne r0, r0, #1 + strneb r0, [r5, #0x35] + mov r0, sb + bl IqSkillIsEnabled + cmp r0, #0 + ldrneb r0, [r5, #0x35] + addne fp, fp, #1 + addne r0, r0, #1 + strneb r0, [r5, #0x35] + ldrsh r1, [r7, #4] + ldr r0, _0230C460 ; =0x000001A3 + cmp r1, r0 + subeq fp, fp, #2 + cmp r1, #0x1a4 + ldr r0, _0230C464 ; =0x000001A5 + addeq fp, fp, #2 + cmp r1, r0 +#ifdef JAPAN + ldrsh r1, [r6, #4] +#endif + ldr r0, _0230C468 ; =0x00000211 + subeq fp, fp, #2 + cmp r1, r0 + addeq fp, fp, #2 + beq _0230C170 + cmp r1, #0x218 + subeq fp, fp, #2 +_0230C170: + ldr r1, _0230C46C ; =0x000001BD + ldr r0, [sp, #0xf4] + add r4, r4, fp + cmp r0, r1 + bne _0230C1F4 + ldrsh r1, [r7, #0x24] + mov r0, #0 + cmp r1, #0xa + subgt r1, r1, #0xa + addgt r0, r0, r1 + movgt r0, r0, lsl #0x10 + ldrsh r1, [r7, #0x28] + movgt r0, r0, asr #0x10 + cmp r1, #0xa + subgt r1, r1, #0xa + addgt r0, r0, r1 + movgt r0, r0, lsl #0x10 + ldrsh r1, [r7, #0x26] + movgt r0, r0, asr #0x10 + cmp r1, #0xa + subgt r1, r1, #0xa + addgt r0, r0, r1 + movgt r0, r0, lsl #0x10 + ldrsh r1, [r7, #0x2a] + movgt r0, r0, asr #0x10 + cmp r1, #0xa + subgt r1, r1, #0xa + addgt r0, r0, r1 + movgt r0, r0, lsl #0x10 + ldr r1, [sp, #0x44] + movgt r0, r0, asr #0x10 + add r0, r1, r0 + str r0, [sp, #0x44] +_0230C1F4: + mov r0, sl + mov r1, #0x67 + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #0x100 + movne r4, #0xa + strne r0, [sp, #0x38] + bne _0230C23C + mov r0, sl + mov r1, sb + mov r2, #0x67 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + movne r0, #0xa + strne r0, [sp, #0x44] + movne r0, #0x100 + strne r0, [sp, #0x3c] +_0230C23C: + ldr r0, [sp, #0x44] + ldr r1, [sp, #0x18] + cmp r0, #0 + movlt r0, #0 + strlt r0, [sp, #0x44] + ldr r0, [sp, #0x44] + ldr r2, _0230C470 ; =OFFENSIVE_STAT_STAGE_MULTIPLIERS + cmp r0, #0x14 + movgt r0, #0x14 + strgt r0, [sp, #0x44] + ldr r0, [sp, #0x44] + strb r0, [r5, #0xa] + add r0, r6, #0x1a + ldrb r3, [r0, r1] + ldr r1, [sp, #0x44] + ldr fp, [r2, r1, lsl #2] + ldr r1, [sp, #0x18] + strh r3, [r5, #0xc] + ldrb r0, [r0, r1] + mov r1, fp + mov r0, r0, lsl #8 + bl MultiplyByFixedPoint + ldr r1, [sp, #0x3c] + bl MultiplyByFixedPoint + mov r0, r0, asr #8 + cmp r4, #0 + movlt r4, #0 + str r0, [sp, #0x90] + cmp r4, #0x14 + movgt r4, #0x14 + ldr r1, [sp, #0x18] + strb r4, [r5, #0xb] + add r0, r7, #0x1c + ldrb r2, [r0, r1] + ldr r1, _0230C474 ; =DEFENSIVE_STAT_STAGE_MULTIPLIERS + strh r2, [r5, #0xe] + ldr r2, [sp, #0x18] + ldr r1, [r1, r4, lsl #2] + ldrb r0, [r0, r2] + mov r0, r0, lsl #8 + bl MultiplyByFixedPoint + ldr r1, [sp, #0x38] + bl MultiplyByFixedPoint + mov r0, r0, asr #8 + str r0, [sp, #0x94] + ldrb r0, [r6, #6] + cmp r0, #0 + bne _0230C314 + ldr r1, [sp, #0x18] + mov r0, sl + bl ExclusiveItemOffenseBoost + ldr r1, [sp, #0x90] + add r0, r1, r0 + str r0, [sp, #0x90] +_0230C314: + ldrb r0, [r7, #6] + cmp r0, #0 + bne _0230C338 + ldr r1, [sp, #0x18] + mov r0, sb + bl ExclusiveItemDefenseBoost + ldr r1, [sp, #0x94] + add r0, r1, r0 + str r0, [sp, #0x94] +_0230C338: + ldr r0, [sp, #0x18] + cmp r0, #0 + bne _0230C4D8 + mov r0, sl + mov r1, #0x1a + bl ItemIsActive__0230A9DC + cmp r0, #0 + beq _0230C378 + ldr r0, _0230C478 ; =POWER_BAND_STAT_BOOST + ldr r1, [sp, #0x90] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x90] + ldrb r0, [r5, #0x30] + add r0, r0, r2 + strb r0, [r5, #0x30] +_0230C378: + mov r0, sl + mov r1, #0x32 + bl ItemIsActive__0230A9DC + cmp r0, #0 + beq _0230C3AC + ldr r0, _0230C47C ; =MUNCH_BELT_STAT_BOOST + ldr r1, [sp, #0x90] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x90] + ldrb r0, [r5, #0x30] + add r0, r0, r2 + strb r0, [r5, #0x30] +_0230C3AC: + mov r0, sl + bl AuraBowIsActive + cmp r0, #0 + beq _0230C3DC + ldr r0, _0230C480 ; =AURA_BOW_STAT_BOOST + ldr r1, [sp, #0x90] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x90] + ldrb r0, [r5, #0x31] + add r0, r0, r2 + strb r0, [r5, #0x31] +_0230C3DC: + ldr r0, [sp, #0xf8] + cmp r0, #0 + beq _0230C5E0 + mov r0, sb + mov r1, #0x25 + bl ItemIsActive__0230A9DC + cmp r0, #0 + beq _0230C41C + ldr r0, _0230C484 ; =DEF_SCARF_STAT_BOOST + ldr r1, [sp, #0x94] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x94] + ldrb r0, [r5, #0x36] + add r0, r0, r2 + strb r0, [r5, #0x36] +_0230C41C: + mov r0, sb + bl AuraBowIsActive + cmp r0, #0 + beq _0230C5E0 + ldr r0, _0230C480 ; =AURA_BOW_STAT_BOOST + ldr r1, [sp, #0x94] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x94] + ldrb r0, [r5, #0x36] + add r0, r0, r2 + strb r0, [r5, #0x36] + b _0230C5E0 + .align 2, 0 +#ifdef JAPAN +#define CALC_DAMAGE_DATA_OFFSET -0x2C1 +#else +#define CALC_DAMAGE_DATA_OFFSET 0 +#endif +_0230C450: .word DUNGEON_PTR +_0230C454: .word ME_FIRST_MULTIPLIER +_0230C458: .word 0x000001D3 +_0230C45C: .word 0x00000163 +_0230C460: .word 0x000001A3 +_0230C464: .word 0x000001A5 +_0230C468: .word 0x00000211 +_0230C46C: .word 0x000001BD +_0230C470: .word OFFENSIVE_STAT_STAGE_MULTIPLIERS +_0230C474: .word DEFENSIVE_STAT_STAGE_MULTIPLIERS +_0230C478: .word POWER_BAND_STAT_BOOST +_0230C47C: .word MUNCH_BELT_STAT_BOOST +_0230C480: .word AURA_BOW_STAT_BOOST +_0230C484: .word DEF_SCARF_STAT_BOOST +_0230C488: .word ZINC_BAND_STAT_BOOST +_0230C48C: .word SPECIAL_BAND_STAT_BOOST +_0230C490: .word 0x00000C53 + CALC_DAMAGE_DATA_OFFSET +_0230C494: .word 0x00000C54 + CALC_DAMAGE_DATA_OFFSET +_0230C498: .word 0x00000C55 + CALC_DAMAGE_DATA_OFFSET +_0230C49C: .word 0x000003E7 +_0230C4A0: .word DAMAGE_FORMULA_FLV_DEFICIT_DIVISOR +_0230C4A4: .word ov29_02352984 +_0230C4A8: .word ov29_02352990 +_0230C4AC: .word ov29_0235299C +_0230C4B0: .word DAMAGE_FORMULA_AT_PREFACTOR +_0230C4B4: .word DAMAGE_FORMULA_DEF_PREFACTOR +_0230C4B8: .word DAMAGE_FORMULA_FLV_SHIFT +_0230C4BC: .word DAMAGE_FORMULA_LN_ARG_PREFACTOR +_0230C4C0: .word DAMAGE_FORMULA_LN_PREFACTOR +_0230C4C4: .word DAMAGE_FORMULA_CONSTANT_SHIFT +_0230C4C8: .word DAMAGE_FORMULA_NON_TEAM_MEMBER_MODIFIER +_0230C4CC: .word DAMAGE_FORMULA_MAX_BASE +_0230C4D0: .word ov29_02352838 +_0230C4D4: .word DAMAGE_FORMULA_MIN_BASE +_0230C4D8: + ldr r0, [sp, #0xf8] + cmp r0, #0 + beq _0230C548 + mov r0, sb + mov r1, #0x29 + bl ItemIsActive__0230A9DC + cmp r0, #0 + beq _0230C518 + ldr r0, _0230C488 ; =ZINC_BAND_STAT_BOOST + ldr r1, [sp, #0x94] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x94] + ldrb r0, [r5, #0x37] + add r0, r0, r2 + strb r0, [r5, #0x37] +_0230C518: + mov r0, sb + bl AuraBowIsActive + cmp r0, #0 + beq _0230C548 + ldr r0, _0230C480 ; =AURA_BOW_STAT_BOOST + ldr r1, [sp, #0x94] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x94] + ldrb r0, [r5, #0x36] + add r0, r0, r2 + strb r0, [r5, #0x36] +_0230C548: + mov r0, sl + mov r1, #0x28 + bl ItemIsActive__0230A9DC + cmp r0, #0 + beq _0230C57C + ldr r0, _0230C48C ; =SPECIAL_BAND_STAT_BOOST + ldr r1, [sp, #0x90] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x90] + ldrb r0, [r5, #0x31] + add r0, r0, r2 + strb r0, [r5, #0x31] +_0230C57C: + mov r0, sl + mov r1, #0x32 + bl ItemIsActive__0230A9DC + cmp r0, #0 + beq _0230C5B0 + ldr r0, _0230C47C ; =MUNCH_BELT_STAT_BOOST + ldr r1, [sp, #0x90] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x90] + ldrb r0, [r5, #0x31] + add r0, r0, r2 + strb r0, [r5, #0x31] +_0230C5B0: + mov r0, sb + bl AuraBowIsActive + cmp r0, #0 + beq _0230C5E0 + ldr r0, _0230C480 ; =AURA_BOW_STAT_BOOST + ldr r1, [sp, #0x90] + ldrsh r2, [r0] + add r0, r1, r2 + str r0, [sp, #0x90] + ldrb r0, [r5, #0x31] + add r0, r0, r2 + strb r0, [r5, #0x31] +_0230C5E0: + ldr r0, [sp, #0x10] + mov r1, fp + mov r0, r0, lsl #8 + bl MultiplyByFixedPoint + ldr r1, [sp, #0x3c] + bl MultiplyByFixedPoint + mov r1, r0 + add r0, sp, #0xa0 + bl FixedPoint32To64 + mov r0, #0x64 + bl DungeonRandInt + mov r4, #1 + str r0, [sp, #0x40] + add r0, r6, #0x100 + ldrh r1, [r0, #0x5a + CALC_DAMAGE_OFFSET] + mov fp, r4 + str r4, [sp, #0x28] + bic r1, r1, #0x100 + strh r1, [r0, #0x5a + CALC_DAMAGE_OFFSET] + ldrh r1, [r0, #0x58 + CALC_DAMAGE_OFFSET] + str r4, [sp, #0x2c] + bic r1, r1, #0x100 + strh r1, [r0, #0x58 + CALC_DAMAGE_OFFSET] + ldr r0, [sp, #0xf4] + bl MoveIsNotPhysical + str r0, [sp, #0x30] + cmp r0, #0 + bne _0230C6B8 + mov r0, sl + mov r1, #0x11 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230C6B8 + ldr r0, [sl, #0xb4] + mov r1, r4 + str r0, [sp, #0x24] + mov r0, sl + bl MonsterHasNegativeStatus + str r0, [sp, #0x48] + ldr r0, [sp, #0x24] + ldr r2, [sp, #0x48] + mov r1, r4 + bl UpdateStateFlags + ldr r1, [sp, #0x48] + cmp r1, #0 + movne r4, r4, lsl #1 + cmp r0, #0 + beq _0230C6B8 + mov r0, sl + bl PlayEffectAnimation0x1A9__022E6130 + mov r0, sl + mov r1, sb + ldr r2, _0230C490 ; =0x00000C53 + bl LogMessageByIdWithPopupCheckUserTarget +_0230C6B8: + mov r0, sl + mov r1, #0x22 + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _0230C6E0 + mov r0, sl + mov r1, #0x4b + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230C748 +_0230C6E0: + ldr r0, [sp, #0x40] + cmp r0, #0x21 + ldr r0, [sl, #0xb4] + bge _0230C700 + ldr r1, [sp, #0x30] + cmp r1, #0 + moveq r1, #1 + beq _0230C704 +_0230C700: + mov r1, #0 +_0230C704: + and r1, r1, #0xff + str r1, [sp, #0x34] + ldr r2, [sp, #0x34] + mov r1, #0x100 + bl UpdateStateFlags + ldr r1, [sp, #0x34] + cmp r1, #0 + addne r4, r4, r4, lsl #1 + movne fp, fp, lsl #1 + cmp r0, #0 + beq _0230C748 + mov r0, sl + bl PlayEffectAnimation0x1A9__022E617C + mov r0, sl + mov r1, sb + ldr r2, _0230C494 ; =0x00000C54 + bl LogMessageByIdWithPopupCheckUserTarget +_0230C748: + mov r0, sl + mov r1, #0x30 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230C76C + ldr r0, [sp, #0x30] + cmp r0, #0 + addeq r4, r4, r4, lsl #1 + moveq fp, fp, lsl #1 +_0230C76C: + ldr r0, [sl, #0xb4] + mov r1, #0x38 + ldrb r0, [r0, #6] + cmp r0, #0 + moveq r0, #1 + streq r0, [sp, #0x14] + movne r0, #0 + strne r0, [sp, #0x14] + mov r0, sl + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230C7D4 + ldr r0, [sp, #0x30] + cmp r0, #1 + bne _0230C7D4 + ldr r0, _0230C450 ; =DUNGEON_PTR + ldr r1, [r0] + ldr r0, [sp, #0x14] + add r0, r1, r0 + add r0, r0, #0x3000 +#ifdef JAPAN + ldrb r0, [r0, #0xd92] +#else + ldrb r0, [r0, #0xe36] +#endif + cmp r0, #0 + movne r0, #0xa + mulne r0, fp, r0 + rsbne r4, r4, r4, lsl #4 + movne fp, r0 +_0230C7D4: + mov r0, sl + mov r1, #0x3f + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230C820 + ldr r0, [sp, #0x30] + cmp r0, #1 + bne _0230C820 + ldr r0, _0230C450 ; =DUNGEON_PTR + ldr r1, [r0] + ldr r0, [sp, #0x14] + add r0, r1, r0 + add r0, r0, #0x3000 +#ifdef JAPAN + ldrb r0, [r0, #0xd90] +#else + ldrb r0, [r0, #0xe34] +#endif + cmp r0, #0 + movne r0, #0xa + mulne r0, fp, r0 + rsbne r4, r4, r4, lsl #4 + movne fp, r0 +_0230C820: + mov r0, sl + mov r1, sb + mov r2, #6 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230C84C + ldr r0, [sp, #0x30] + cmp r0, #0 + moveq r4, r4, lsl #2 + addeq fp, fp, fp, lsl #2 +_0230C84C: + mov r0, sl + mov r1, sb + mov r2, #0x34 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230C8E0 + ldr r0, [sp, #0x30] + cmp r0, #0 + bne _0230C8E0 + ldr r0, [sb, #0xb4] + mov r1, #1 + str r0, [sp, #0x20] + mov r0, sb + bl MonsterHasNegativeStatus + str r0, [sp, #0x4c] + ldr r0, [sp, #0x20] + ldr r2, [sp, #0x4c] + mov r1, #8 + bl UpdateStateFlags + ldr r1, [sp, #0x4c] + cmp r1, #0 + beq _0230C8C0 + ldr r1, [sp, #0x28] + add r1, r1, r1, lsl #1 + str r1, [sp, #0x28] + ldr r1, [sp, #0x2c] + mov r1, r1, lsl #1 + str r1, [sp, #0x2c] +_0230C8C0: + cmp r0, #0 + beq _0230C8E0 + mov r0, sb + bl PlayEffectAnimation0x18E + mov r0, sl + mov r1, sb + ldr r2, _0230C498 ; =0x00000C55 + bl LogMessageByIdWithPopupCheckUserTarget +_0230C8E0: + add r0, sp, #0x90 + ldr r2, [r0] + add r1, sp, #0x94 + mul r0, r2, r4 + ldr r3, [r1] + ldr r2, [sp, #0x28] + cmp fp, #1 + mul r2, r3, r2 + str r2, [r1] + add r1, sp, #0x90 + str r0, [r1] + beq _0230C920 + mov r1, fp + bl _s32_div_f + add r1, sp, #0x90 + str r0, [r1] +_0230C920: + ldr r0, [sp, #0x2c] + cmp r0, #1 + beq _0230C940 + add r4, sp, #0x94 + mov r1, r0 + ldr r0, [r4] + bl _s32_div_f + str r0, [r4] +_0230C940: + ldr r0, [sp, #0x90] + strh r0, [r5, #0x12] + ldr r0, [sp, #0x94] + strh r0, [r5, #0x14] + ldr r0, [sp, #0x90] + cmp r0, #0 + movlt r0, #0 + strlt r0, [sp, #0x90] + ldr r1, [sp, #0x90] + ldr r0, _0230C49C ; =0x000003E7 + cmp r1, r0 + strge r0, [sp, #0x90] + ldr r1, [sp, #0x94] + add r0, sp, #0x98 + strh r1, [r5, #0x1a] + ldr r1, [sp, #0x94] + bl IntToFixedPoint64 + ldr r2, [sp, #0x90] + ldr r1, [sp, #0x94] + add r0, sp, #0x88 + sub r1, r2, r1 + bl IntToFixedPoint64 + ldr r1, _0230C4A0 ; =DAMAGE_FORMULA_FLV_DEFICIT_DIVISOR + add r0, sp, #0x80 + ldr r1, [r1] + bl FixedPoint32To64 + add r0, sp, #0x88 + add r2, sp, #0x80 + mov r1, r0 + bl DivideFixedPoint64 + ldrb r1, [r6, #0xa] + add r0, sp, #0x80 + bl IntToFixedPoint64 + add r0, sp, #0xa8 + add r1, sp, #0x80 + add r2, sp, #0x88 + bl AddFixedPoint64 + ldr r1, [sp, #0x90] + add r0, sp, #0x80 + bl IntToFixedPoint64 + add r0, sp, #0xa0 + add r2, sp, #0x80 + mov r1, r0 + bl AddFixedPoint64 + add r0, sp, #0xa0 + bl FixedPoint64ToInt + strh r0, [r5, #0x18] + ldrb r1, [r6, #0xa] + add r0, sp, #0xa8 + strh r1, [r5, #0x16] + bl FixedPoint64ToInt + strh r0, [r5, #0x1c] + add r0, sp, #0xa8 + bl FixedPoint64ToInt + mov r1, r0 + ldr r0, _0230C4A4 ; =ov29_02352984 + bl Debug_Print0 + add r0, sp, #0xa0 + bl FixedPoint64ToInt + mov r1, r0 + ldr r0, _0230C4A8 ; =ov29_02352990 + bl Debug_Print0 + add r0, sp, #0x98 + bl FixedPoint64ToInt + mov r1, r0 + ldr r0, _0230C4AC ; =ov29_0235299C + bl Debug_Print0 + ldr r1, _0230C4B0 ; =DAMAGE_FORMULA_AT_PREFACTOR + add r0, sp, #0x70 + ldr r1, [r1] + bl FixedPoint32To64 + add r0, sp, #0x70 + add r1, sp, #0xa0 + mov r2, r0 + bl MultiplyFixedPoint64 + ldr r1, _0230C4B4 ; =DAMAGE_FORMULA_DEF_PREFACTOR + add r0, sp, #0x68 + ldr r1, [r1] + bl FixedPoint32To64 + add r0, sp, #0x68 + add r1, sp, #0x98 + mov r2, r0 + bl MultiplyFixedPoint64 + ldr r1, _0230C4B8 ; =DAMAGE_FORMULA_FLV_SHIFT + add r0, sp, #0x78 + ldr r1, [r1] + bl FixedPoint32To64 + add r0, sp, #0x60 + add r1, sp, #0xa8 + add r2, sp, #0x78 + bl AddFixedPoint64 + ldr r1, _0230C4BC ; =DAMAGE_FORMULA_LN_ARG_PREFACTOR + add r0, sp, #0x78 + ldr r1, [r1] + bl FixedPoint32To64 + add r0, sp, #0x60 + add r2, sp, #0x78 + mov r1, r0 + bl MultiplyFixedPoint64 + add r0, sp, #0x60 + bl FixedPoint64ToInt + mov r1, r0 + add r0, sp, #0x60 + bl ClampedLn + ldr r1, _0230C4C0 ; =DAMAGE_FORMULA_LN_PREFACTOR + add r0, sp, #0x78 + ldr r1, [r1] + bl FixedPoint32To64 + add r0, sp, #0x60 + add r2, sp, #0x78 + mov r1, r0 + bl MultiplyFixedPoint64 + add r0, sp, #0xb0 + add r1, sp, #0x68 + add r2, sp, #0x70 + bl AddFixedPoint64 + add r0, sp, #0xb0 + add r2, sp, #0x60 + mov r1, r0 + bl AddFixedPoint64 + ldr r1, _0230C4C4 ; =DAMAGE_FORMULA_CONSTANT_SHIFT + add r0, sp, #0x78 + ldr r1, [r1] + bl FixedPoint32To64 + add r0, sp, #0xb0 + add r2, sp, #0x78 + mov r1, r0 + bl AddFixedPoint64 + bl FixedRoomIsSubstituteRoom + cmp r0, #0 + bne _0230CB78 + ldrb r0, [r6, #6] + cmp r0, #0 + beq _0230CB78 + ldr r1, _0230C4C8 ; =DAMAGE_FORMULA_NON_TEAM_MEMBER_MODIFIER + add r0, sp, #0x78 + ldr r1, [r1] + bl FixedPoint32To64 + add r0, sp, #0xb0 + add r2, sp, #0x78 + mov r1, r0 + bl DivideFixedPoint64 +_0230CB78: + ldr r0, _0230C4CC ; =DAMAGE_FORMULA_MAX_BASE + add r1, sp, #0xb0 + bl FixedPoint64CmpLt + cmp r0, #0 + ldrne r0, _0230C4D0 ; =ov29_02352838 + ldrne r1, [r0, #0x38] + ldrne r0, [r0, #0x34] + strne r1, [sp, #0xb4] + strne r0, [sp, #0xb0] + ldr r1, _0230C4D4 ; =DAMAGE_FORMULA_MIN_BASE + add r0, sp, #0xb0 + bl FixedPoint64CmpLt + cmp r0, #0 + ldrne r0, _0230C4D0 ; =ov29_02352838 + ldrne r1, [r0, #0x48] + ldrne r0, [r0, #0x44] + strne r1, [sp, #0xb4] + strne r0, [sp, #0xb0] + ldr r0, [sp, #0xf4] + bl IsRegularAttackOrProjectile + cmp r0, #0 + ldr r0, [sp, #0xc] + movne r1, #1 + str r0, [sp] + moveq r1, #0 + and r1, r1, #0xff + str r8, [sp, #4] + str r1, [sp, #8] + ldr r3, [sp, #0x10] + add r0, sp, #0xb8 + mov r1, sl + mov r2, sb + bl CalcTypeBasedDamageEffects + mov fp, r0 + ldr r0, [sp, #0xc] + cmp r0, #2 + bne _0230CC78 + mov r0, sl + mov r1, sb + bl FlashFireShouldActivate + movs r4, r0 + beq _0230CC78 + ldrb r0, [r7, #0x15c + CALC_DAMAGE_OFFSET] + cmp r0, #0 + bne _0230CC78 + ldr r0, [sp, #0xf8] + cmp r0, #0 + beq _0230CC78 + mov r0, #1 + mov r1, sb + strb r0, [r7, #0x15c + CALC_DAMAGE_OFFSET] + mov r2, #0 + bl SubstitutePlaceholderStringTags + cmp r4, #1 + bne _0230CC68 + ldr r2, _0230D05C ; =0x00000C58 + mov r0, sl + mov r1, sb + bl LogMessageByIdWithPopupCheckUserTarget + b _0230CC78 +_0230CC68: + ldr r2, _0230D060 ; =0x00000C57 + mov r0, sl + mov r1, sb + bl LogMessageByIdWithPopupCheckUserTarget +_0230CC78: + ldr r0, [sp, #0xf8] + cmp r0, #0 + beq _0230CD3C + mov r0, sl + mov r1, #0x44 + bl ExclusiveItemEffectIsActive__0230A9B8 + cmp r0, #0 + bne _0230CD3C + ldr r0, [sp, #0x18] + cmp r0, #0 + bne _0230CCF0 + ldr r0, [sp, #0xf4] + cmp r0, #0x48 + beq _0230CCBC + ldrb r0, [r7, #0xd5] + cmp r0, #1 + beq _0230CCD0 +_0230CCBC: + mov r0, sb + mov r1, #0x1e + bl ExclusiveItemEffectIsActive__0230A9B8 + cmp r0, #0 + beq _0230CCF0 +_0230CCD0: + mov r0, sb + bl PlayEffectAnimation0x171 + add r0, sp, #0xb8 + ldr r2, _0230D064 ; =DAMAGE_MULTIPLIER_0_5 + mov r1, r0 + bl MultiplyFixedPoint64 + mov r0, #1 + strb r0, [r5, #0x3a] +_0230CCF0: + ldr r0, [sp, #0x18] + cmp r0, #1 + bne _0230CD3C + ldrb r0, [r7, #0xd5] + cmp r0, #3 + beq _0230CD1C + mov r0, sb + mov r1, #0x1f + bl ExclusiveItemEffectIsActive__0230A9B8 + cmp r0, #0 + beq _0230CD3C +_0230CD1C: + mov r0, sb + bl PlayEffectAnimation0x171Full + add r0, sp, #0xb8 + ldr r2, _0230D064 ; =DAMAGE_MULTIPLIER_0_5 + mov r1, r0 + bl MultiplyFixedPoint64 + mov r0, #1 + strb r0, [r5, #0x3b] +_0230CD3C: + ldrb r0, [r7, #0xd5] + cmp r0, #0x11 + beq _0230CEEC + mov r0, sl + mov r1, sb + mov r2, #0xc +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + bne _0230CEEC + mov r0, sl + mov r1, sb + mov r2, #0x13 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + bne _0230CEEC + mov r0, sb + mov r1, #0x40 + bl IqSkillIsEnabled + cmp r0, #0 + bne _0230CEEC + ldrsh r0, [r6, #2] + bl GetMonsterGenderVeneer + cmp r0, #2 + ldrne r1, [sp, #0xe8] + ldreq r4, [sp, #0xe8] + addne r0, r1, r1, lsr #31 + addne r4, r1, r0, asr #1 + ldrb r0, [r6, #0xec] + cmp r0, #4 + moveq r0, #1 + streqb r0, [r5, #0x3c] + ldreq r4, _0230C49C ; =0x000003E7 + beq _0230CE74 + mov r0, sl + mov r1, #0x13 + bl ItemIsActive__0230A9DC + cmp r0, #0 + bne _0230CDF0 + mov r0, sl + mov r1, #0x1d + bl IqSkillIsEnabled + cmp r0, #0 + beq _0230CE04 +_0230CDF0: + ldr r0, _0230D068 ; =SCOPE_LENS_CRIT_RATE_BOOST + mov r1, #1 + ldrsh r0, [r0] + strb r1, [r5, #0x38] + add r4, r4, r0 +_0230CE04: + mov r0, sl + mov r1, #0x58 + bl AbilityIsActiveVeneer + cmp r0, #0 + ldrne r0, _0230D06C ; =SUPER_LUCK_CRIT_RATE_BOOST + movne r1, #1 + ldrnesh r0, [r0] + strneb r1, [r5, #0x49] + mov r1, #0x14 + addne r4, r4, r0 + mov r0, sb + bl ItemIsActive__0230A9DC + cmp r0, #0 + ldrne r0, _0230D068 ; =SCOPE_LENS_CRIT_RATE_BOOST + movne r1, #1 + ldrnesh r0, [r0] + strneb r1, [r5, #0x39] + addne r4, r4, r0 + cmp fp, #0 + beq _0230CE74 + mov r0, sl + mov r1, #1 + bl IqSkillIsEnabled + cmp r0, #0 + ldrne r0, _0230D070 ; =TYPE_ADVANTAGE_MASTER_CRIT_RATE + movne r1, #1 + ldrnesh r4, [r0] + strneb r1, [r5, #0x3d] +_0230CE74: + mov r0, #0x64 + bl DungeonRandInt + cmp r0, r4 + bge _0230CEEC + mov r2, #1 + mov r4, #5 + mov r0, sl + mov r1, sb +#ifdef JAPAN + add r3, r2, #0xb00 +#else + add r3, r2, #0xdc0 +#endif + str r4, [sp] + bl ExclusiveItemEffectIsActiveWithLogging + cmp r0, #0 + bne _0230CEEC + mov r2, #1 + mov r0, sl + mov r1, #0x5d + strb r2, [r8, #0xe] + bl AbilityIsActiveVeneer + cmp r0, #0 + add r0, sp, #0xb8 + beq _0230CEE0 + ldr r2, _0230D074 ; =DAMAGE_MULTIPLIER_2 + mov r1, r0 + bl MultiplyFixedPoint64 + mov r0, #1 + strb r0, [r5, #0x4a] + b _0230CEEC +_0230CEE0: + ldr r2, _0230D078 ; =DAMAGE_MULTIPLIER_1_5 + mov r1, r0 + bl MultiplyFixedPoint64 +_0230CEEC: + add r0, sp, #0xb0 + bl FixedPoint64ToInt + str r0, [r5, #0x24] + add r0, sp, #0xb0 + add r2, sp, #0xb8 + mov r1, r0 + bl MultiplyFixedPoint64 + ldr r1, [sp, #0x1c] + add r0, sp, #0x58 + mov r2, r1 + str r2, [r5, #0x2c] + bl FixedPoint32To64 + add r0, sp, #0xb0 + add r2, sp, #0x58 + mov r1, r0 + bl MultiplyFixedPoint64 + add r0, sp, #0xb0 + bl FixedPoint64ToInt + str r0, [r5, #0x20] + mov r0, #0x4000 + bl DungeonRandInt + add r0, r0, #0xe000 + mov r1, #0 + str r0, [sp, #0xbc] + add r0, sp, #0xb0 + str r1, [sp, #0xb8] + add r2, sp, #0xb8 + mov r1, r0 + bl MultiplyFixedPoint64 + add r0, sp, #0x50 + mov r1, #0x64 + bl IntToFixedPoint64 + add r0, sp, #0xb8 + add r1, sp, #0x50 + mov r2, r0 + bl MultiplyFixedPoint64 + add r0, sp, #0xb8 + bl FixedPoint64ToInt + str r0, [r5, #0x28] + add r0, sp, #0xb0 + bl FixedPoint64ToInt + str r0, [r8] + ldr r1, _0230D07C ; =0x00000195 + ldr r0, [sp, #0xf4] + cmp r0, r1 + bne _0230CFBC + ldr r0, [r8] + mov r1, #0x80 + mov r0, r0, lsl #8 + bl MultiplyByFixedPoint + bl RoundUpDiv256 + str r0, [r8] +_0230CFBC: + ldr r1, _0230D07C ; =0x00000195 + ldr r0, [sp, #0xf4] + cmp r0, r1 + bne _0230CFFC + mov r0, sl + mov r1, #0x2f + bl IqSkillIsEnabled + cmp r0, #0 + beq _0230CFFC + ldr r0, _0230D080 ; =POWER_PITCHER_DAMAGE_MULTIPLIER + ldr r2, [r8] + ldr r1, [r0] + mov r0, r2, lsl #8 + bl MultiplyByFixedPoint + bl RoundUpDiv256 + str r0, [r8] +_0230CFFC: + ldr r0, [r8] + cmp r0, #0 + ble _0230D038 + mov r0, sl + mov r1, #0x5b + bl ExclusiveItemEffectIsActive__0230A9B8 + cmp r0, #0 + beq _0230D038 + ldr r0, _0230D084 ; =AIR_BLADE_DAMAGE_MULTIPLIER + ldr r2, [r8] + ldr r1, [r0] + mov r0, r2, lsl #8 + bl MultiplyByFixedPoint + bl RoundUpDiv256 + str r0, [r8] +_0230D038: + mov r1, #0 + str r1, [r8, #4] + ldr r0, [r8] + cmp r0, #0 + streqb r1, [r8, #0xe] + ldrb r0, [r8, #0xe] + strb r0, [r7, #0x167 + CALC_DAMAGE_OFFSET] +_0230D054: + add sp, sp, #0xc0 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_0230D05C: .word 0x00000C58 + CALC_DAMAGE_DATA_OFFSET +_0230D060: .word 0x00000C57 + CALC_DAMAGE_DATA_OFFSET +_0230D064: .word DAMAGE_MULTIPLIER_0_5 +_0230D068: .word SCOPE_LENS_CRIT_RATE_BOOST +_0230D06C: .word SUPER_LUCK_CRIT_RATE_BOOST +_0230D070: .word TYPE_ADVANTAGE_MASTER_CRIT_RATE +_0230D074: .word DAMAGE_MULTIPLIER_2 +_0230D078: .word DAMAGE_MULTIPLIER_1_5 +_0230D07C: .word 0x00000195 +_0230D080: .word POWER_PITCHER_DAMAGE_MULTIPLIER +_0230D084: .word AIR_BLADE_DAMAGE_MULTIPLIER + arm_func_end CalcDamage + + arm_func_start ov29_0230D088 +ov29_0230D088: ; 0x0230D088 + stmdb sp!, {r4, r5, lr} + sub sp, sp, #0x1c + ldr r5, [sp, #0x2c] + ldr r4, [sp, #0x28] + mov lr, r0 + strb r2, [r5, #0xc] + cmp r4, #1 + strb r3, [r5, #0xd] + mov ip, r1 + str r2, [sp] + mov r2, ip + ldr r0, _0230D118 ; =0x000003E7 + movlt r4, #1 + cmp r4, r0 + movgt r4, r0 + add r0, sp, #0x14 + mov r1, lr + mov r3, r4 + str r5, [sp, #4] + mov ip, #0 + str ip, [sp, #8] + bl CalcTypeBasedDamageEffects + add r0, sp, #0xc + mov r1, r4 + bl IntToFixedPoint64 + add r0, sp, #0xc + add r2, sp, #0x14 + mov r1, r0 + bl MultiplyFixedPoint64 + add r0, sp, #0xc + bl FixedPoint64ToInt + str r0, [r5] + mov r0, #0 + str r0, [r5, #4] + add sp, sp, #0x1c + ldmia sp!, {r4, r5, pc} + .align 2, 0 +_0230D118: .word 0x000003E7 + arm_func_end ov29_0230D088 + + arm_func_start ApplyDamageAndEffectsWrapper +ApplyDamageAndEffectsWrapper: ; 0x0230D11C + stmdb sp!, {r4, r5, r6, r7, lr} + sub sp, sp, #0xdc + mov r7, r0 + add r0, sp, #0x10 + mov r6, r1 + mov r5, r2 + mov r4, r3 + bl ResetDamageData + add r0, sp, #0x24 + bl ov29_022E2470 + mov r3, #0 + mov r0, #2 + str r0, [sp, #0x18] + str r6, [sp, #0x10] + str r5, [sp, #0x14] + strb r3, [sp, #0x1c] + strb r3, [sp, #0x1e] + strb r3, [sp, #0x1f] + strb r3, [sp, #0x20] + stmia sp, {r3, r4} + str r3, [sp, #8] + mov r1, r7 + add r0, sp, #0x24 + add r2, sp, #0x10 + str r3, [sp, #0xc] + bl ApplyDamageAndEffects + add sp, sp, #0xdc + ldmia sp!, {r4, r5, r6, r7, pc} + arm_func_end ApplyDamageAndEffectsWrapper + + arm_func_start CalcRecoilDamageFixed +CalcRecoilDamageFixed: ; 0x0230D18C + stmdb sp!, {r4, r5, r6, r7, lr} + sub sp, sp, #0x1c + mov r7, r0 + mov r6, r1 + mov r5, r2 + mov r4, r3 + bl EntityIsValid__02308FBC + cmp r0, #0 + beq _0230D238 + ldr r0, [r7] + cmp r0, #1 + bne _0230D1F0 + ldr r0, [r7, #0xb4] + ldrsh r0, [r0, #0x10] + cmp r0, #0 + beq _0230D238 + mov r0, r7 + mov r1, #0x5c + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _0230D1F0 + mov r0, r6, lsl #8 + mov r1, #0x180 + bl MultiplyByFixedPoint + mov r6, r0, asr #8 +_0230D1F0: + ldrb r1, [sp, #0x34] + str r4, [sp] + ldrsh r0, [sp, #0x38] + str r1, [sp, #4] + mov r1, #3 + str r1, [sp, #8] + ldr r1, [sp, #0x3c] + str r0, [sp, #0xc] + ldr r0, [sp, #0x40] + str r1, [sp, #0x10] + ldr r4, [sp, #0x44] + str r0, [sp, #0x14] + mov r0, r7 + mov r1, r7 + mov r2, r6 + mov r3, r5 + str r4, [sp, #0x18] + bl CalcDamageFixed +_0230D238: + add sp, sp, #0x1c + ldmia sp!, {r4, r5, r6, r7, pc} + arm_func_end CalcRecoilDamageFixed + + arm_func_start CalcDamageFixed +CalcDamageFixed: ; 0x0230D240 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, lr} + sub sp, sp, #0x2c + mov sl, r0 + add r0, sp, #0x18 + mov sb, r1 + mov r8, r2 + mov r7, r3 + ldr r6, [sp, #0x54] + bl ResetDamageData + mov r5, #0 + ldrb r0, [sp, #0x58] + ldr r1, [sp, #0x60] + mov r2, #2 + str r2, [sp, #0x20] + str r1, [sp, #0x1c] + strb r6, [sp, #0x24] + strb r5, [sp, #0x26] + strb r5, [sp, #0x27] + strb r0, [sp, #0x25] + cmp r6, #0 + beq _0230D2F8 + add r4, sp, #0x10 +_0230D298: + mov r2, r5, lsl #0x10 + mov r0, sl + mov r1, sb + mov r3, r6 + mov r2, r2, asr #0x10 + bl GetTypeMatchup + str r0, [r4, r5, lsl #2] + add r5, r5, #1 + cmp r5, #2 + blt _0230D298 + mov r0, sl + mov r1, sb + mov r2, #0x35 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__0230A940 + cmp r0, #0 + beq _0230D2F8 + ldr r2, [sp, #0x10] + ldr r0, _0230D39C ; =TYPE_MATCHUP_COMBINATOR_TABLE + ldr r1, [sp, #0x14] + add r0, r0, r2, lsl #4 + ldr r0, [r0, r1, lsl #2] + cmp r0, #3 + movne r8, #0 +_0230D2F8: + ldrsh r1, [sp, #0x5c] + ldr r0, _0230D3A0 ; =0x00000256 + mov r8, r8, lsl #8 + cmp r1, r0 + bne _0230D334 + mov r0, sl + mov r1, #0x2f + bl IqSkillIsEnabled + cmp r0, #0 + beq _0230D334 + ldr r1, _0230D3A4 ; =POWER_PITCHER_DAMAGE_MULTIPLIER + mov r0, r8 + ldr r1, [r1] + bl MultiplyByFixedPoint + mov r8, r0 +_0230D334: + mov r0, r8 + bl RoundUpDiv256 + str r0, [sp, #0x18] + cmp r8, #0 + moveq r0, #1 + streqb r0, [sp, #0x28] + movne r0, #0 + strneb r0, [sp, #0x28] + ldrsh r1, [sp, #0x5c] + str r7, [sp] + ldr r0, [sp, #0x64] + str r1, [sp, #4] + str r0, [sp, #8] + ldr r4, [sp, #0x68] + add r2, sp, #0x18 + mov r0, sl + mov r1, sb + mov r3, #0 + str r4, [sp, #0xc] + bl ApplyDamageAndEffects + ldr r1, [sp, #0x50] + cmp r1, #0 + ldrneb r0, [sp, #0x28] + strneb r0, [r1] + add sp, sp, #0x2c + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, pc} + .align 2, 0 +_0230D39C: .word TYPE_MATCHUP_COMBINATOR_TABLE +_0230D3A0: .word 0x00000256 +_0230D3A4: .word POWER_PITCHER_DAMAGE_MULTIPLIER + arm_func_end CalcDamageFixed + + arm_func_start CalcDamageFixedNoCategory +CalcDamageFixedNoCategory: ; 0x0230D3A8 + stmdb sp!, {lr} + sub sp, sp, #0x1c + ldr lr, [sp, #0x20] + ldrb ip, [sp, #0x24] + str lr, [sp] + ldrsh lr, [sp, #0x28] + str ip, [sp, #4] + mov ip, #3 + str ip, [sp, #8] + ldr ip, [sp, #0x2c] + str lr, [sp, #0xc] + ldr lr, [sp, #0x30] + str ip, [sp, #0x10] + ldr ip, [sp, #0x34] + str lr, [sp, #0x14] + str ip, [sp, #0x18] + bl CalcDamageFixed + add sp, sp, #0x1c + ldmia sp!, {pc} + arm_func_end CalcDamageFixedNoCategory + + arm_func_start CalcDamageFixedWrapper +CalcDamageFixedWrapper: ; 0x0230D3F4 + stmdb sp!, {lr} + sub sp, sp, #0x1c + ldr ip, [sp, #0x20] + ldrb lr, [sp, #0x24] + str ip, [sp] + ldrb ip, [sp, #0x28] + str lr, [sp, #4] + ldrsh lr, [sp, #0x2c] + str ip, [sp, #8] + ldr ip, [sp, #0x30] + str lr, [sp, #0xc] + ldr lr, [sp, #0x34] + str ip, [sp, #0x10] + ldr ip, [sp, #0x38] + str lr, [sp, #0x14] + str ip, [sp, #0x18] + bl CalcDamageFixed + add sp, sp, #0x1c + ldmia sp!, {pc} + arm_func_end CalcDamageFixedWrapper + + arm_func_start UpdateShopkeeperModeAfterAttack +UpdateShopkeeperModeAfterAttack: ; 0x0230D440 + ldr r2, [r1, #0xb4] + ldrb r1, [r2, #9] + cmp r1, #0 + bxeq lr + ldr r1, [r0] + cmp r1, #1 + bxne lr + ldr r0, [r0, #0xb4] + ldrb r0, [r0, #6] + cmp r0, #0 + movne r0, #2 + strneb r0, [r2, #9] + moveq r0, #3 + streqb r0, [r2, #9] + bx lr + arm_func_end UpdateShopkeeperModeAfterAttack + + arm_func_start UpdateShopkeeperModeAfterTrap +UpdateShopkeeperModeAfterTrap: ; 0x0230D47C + ldr r2, [r0, #0xb4] + ldrb r0, [r2, #9] + cmp r0, #0 + bxeq lr + cmp r1, #0 + movne r0, #2 + strneb r0, [r2, #9] + moveq r0, #3 + streqb r0, [r2, #9] + bx lr + arm_func_end UpdateShopkeeperModeAfterTrap + + arm_func_start ov29_0230D4A4 +ov29_0230D4A4: ; 0x0230D4A4 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r6, r1 + mov r7, r0 + mov r0, r6 + mov r1, #0xe + mov r5, r2 + ldr r4, [r6, #0xb4] + bl MonsterIsType + cmp r0, #0 + beq _0230D4E8 + cmp r5, #1 + cmpne r5, #7 + bne _0230D4E8 + ldrb r0, [r4, #0xfe] + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} +_0230D4E8: + mov r4, #0 + b _0230D518 +_0230D4F0: + mov r2, r4, lsl #0x10 + mov r0, r7 + mov r1, r6 + mov r3, r5 + mov r2, r2, asr #0x10 + bl GetTypeMatchup + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + add r4, r4, #1 +_0230D518: + cmp r4, #2 + blt _0230D4F0 + mov r0, #1 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + arm_func_end ov29_0230D4A4 + + arm_func_start ResetDamageCalcDiagnostics +ResetDamageCalcDiagnostics: ; 0x0230D528 + stmdb sp!, {r3, r4, r5, lr} + ldr r0, _0230D614 ; =DUNGEON_PTR + mov r1, #0x54 + ldr r4, [r0] + add r5, r4, #0x184 + mov r0, r5 + bl MemZero + mov r1, #0 + strb r1, [r4, #0x184] + str r1, [r5, #4] + strb r1, [r5, #8] + strb r1, [r5, #9] + mov r0, #0xa + strb r0, [r5, #0xa] + strb r0, [r5, #0xb] + mov r0, #1 + strh r0, [r5, #0xc] + strh r0, [r5, #0xe] + strh r1, [r5, #0x10] + strh r1, [r5, #0x14] + strh r1, [r5, #0x12] + strh r1, [r5, #0x16] + strh r1, [r5, #0x1c] + str r1, [r5, #0x20] + str r1, [r5, #0x28] + str r1, [r5, #0x2c] + strb r1, [r5, #0x30] + strb r1, [r5, #0x31] + strb r1, [r5, #0x36] + strb r1, [r5, #0x37] + strb r1, [r5, #0x34] + strb r1, [r5, #0x35] + strb r1, [r5, #0x38] + strb r1, [r5, #0x39] + strb r1, [r5, #0x3a] + strb r1, [r5, #0x3b] + strb r1, [r5, #0x3c] + strb r1, [r5, #0x3d] + strb r1, [r5, #0x3e] + strb r1, [r5, #0x40] + strb r1, [r5, #0x3f] + strb r1, [r5, #0x41] + strb r1, [r5, #0x42] + strb r1, [r5, #0x43] + strb r1, [r5, #0x44] + strb r1, [r5, #0x45] + strb r1, [r5, #0x46] + strb r1, [r5, #0x47] + strb r1, [r5, #0x48] + strb r1, [r5, #0x4b] + strb r1, [r5, #0x4c] + strb r1, [r5, #0x4d] + strb r1, [r5, #0x4e] + strb r1, [r5, #0x4f] + strb r1, [r5, #0x50] + strb r1, [r5, #0x51] + strb r1, [r5, #0x32] + strb r1, [r5, #0x33] + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_0230D614: .word DUNGEON_PTR + arm_func_end ResetDamageCalcDiagnostics + + arm_func_start ov29_0230D618 +ov29_0230D618: ; 0x0230D618 + ldr r1, _0230D624 ; =ov29_02352894 + ldr r0, [r1, r0, lsl #2] + bx lr + .align 2, 0 +_0230D624: .word ov29_02352894 + arm_func_end ov29_0230D618 + + arm_func_start ov29_0230D628 +ov29_0230D628: ; 0x0230D628 + stmdb sp!, {r3, lr} + ldr r1, _0230D650 ; =DUNGEON_PTR + ldr r1, [r1] + add r1, r1, #0x1a000 +#ifdef JAPAN + ldr r1, [r1, #0x188] +#else + ldr r1, [r1, #0x22c] +#endif + cmp r1, r0 + ldmneia sp!, {r3, pc} + mov r1, #1 + bl PointCameraToMonster + ldmia sp!, {r3, pc} + .align 2, 0 +_0230D650: .word DUNGEON_PTR + arm_func_end ov29_0230D628 + + arm_func_start ov29_0230D654 +ov29_0230D654: ; 0x0230D654 + stmdb sp!, {r4, lr} + mov r4, r1 + bl EntityIsValid__02308FBC + cmp r0, #0 + beq _0230D678 + mov r0, r4 + bl EntityIsValid__02308FBC + cmp r0, #0 + bne _0230D680 +_0230D678: + mov r0, #1 + ldmia sp!, {r4, pc} +_0230D680: + mov r0, #0 + ldmia sp!, {r4, pc} + arm_func_end ov29_0230D654 + + arm_func_start ov29_0230D688 +ov29_0230D688: ; 0x0230D688 + stmdb sp!, {r4, lr} + sub sp, sp, #8 + mov r4, r0 + ldrh r3, [r4] + mov r1, #0x55 + mov r2, #2 + strh r3, [sp] + ldrh r3, [r4, #2] + strh r3, [sp, #2] + ldrh r3, [r4, #4] + strh r3, [sp, #4] + bl GenerateStandardItem + mov r0, r4 + bl SetItemAcquired + ldrb r0, [sp, #1] + strb r0, [r4, #1] + cmp r0, #0 + beq _0230D6FC + add r0, sp, #0 + bl GetEquivItemIndex + cmp r0, #0 + blt _0230D6FC + bl GetItemAtIdx + ldrh r1, [r4] + strh r1, [r0] + ldrh r1, [r4, #2] + strh r1, [r0, #2] + ldrh r1, [r4, #4] + strh r1, [r0, #4] +_0230D6FC: + add sp, sp, #8 + ldmia sp!, {r4, pc} + arm_func_end ov29_0230D688 + + arm_func_start ov29_0230D704 +ov29_0230D704: ; 0x0230D704 + mov r0, #0 + bx lr + arm_func_end ov29_0230D704 + + arm_func_start ov29_0230D70C +ov29_0230D70C: ; 0x0230D70C + stmdb sp!, {r3, lr} + mov r0, #0x64 + bl DungeonRandInt + ldr r1, _0230D734 ; =ov10_022C45B4 + ldrsh r1, [r1] + cmp r0, r1 + movlt r0, #1 + movge r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} + .align 2, 0 +_0230D734: .word ov10_022C45B4 + arm_func_end ov29_0230D70C + + arm_func_start ov29_0230D738 +ov29_0230D738: ; 0x0230D738 + stmdb sp!, {r3, lr} + cmp r2, #0 + bne _0230D760 + mov r0, #0x64 + bl DungeonRandInt + ldr r1, _0230D768 ; =ov10_022C45B4 + ldrsh r1, [r1] + cmp r0, r1 + movlt r0, #1 + ldmltia sp!, {r3, pc} +_0230D760: + mov r0, #0 + ldmia sp!, {r3, pc} + .align 2, 0 +_0230D768: .word ov10_022C45B4 + arm_func_end ov29_0230D738 + + arm_func_start ov29_0230D76C +ov29_0230D76C: ; 0x0230D76C + stmdb sp!, {r4, r5, r6, lr} + mov r6, r0 + mov r5, r1 + mov r4, r2 + bl IsMonster__0230A994 + cmp r0, #0 + beq _0230D798 + mov r0, r5 + bl IsMonster__0230A994 + cmp r0, #0 + bne _0230D7A0 +_0230D798: + mov r0, #0 + ldmia sp!, {r4, r5, r6, pc} +_0230D7A0: + ldr r0, [r6, #0xb4] + ldr r1, [r5, #0xb4] + ldrsh r0, [r0, #2] + ldrsh r1, [r1, #2] + bl GendersNotEqualNotGenderless + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, r6 + mov r1, r5 + mov r2, r4 + bl ov29_0230D738 + ldmia sp!, {r4, r5, r6, pc} + arm_func_end ov29_0230D76C + + arm_func_start ov29_0230D7D4 +ov29_0230D7D4: ; 0x0230D7D4 + stmdb sp!, {r3, r4, r5, lr} + sub sp, sp, #0x10 + ldr r2, _0230D870 ; =ov29_023535D4 + mvn r1, #0 + ldrsh r3, [r2] + mov r4, r0 + cmp r3, r1 + beq _0230D808 + ldrsh r0, [r2] + bl ov10_022BDE50 + ldr r0, _0230D870 ; =ov29_023535D4 + mvn r1, #0 + strh r1, [r0] +_0230D808: + mov r2, #0 + mov r1, #1 + str r2, [sp] + stmib sp, {r1, r2} + mov r0, r4 + rsb r1, r1, #0x2b8 + mov r3, #3 + str r2, [sp, #0xc] + bl PlayEffectAnimationEntity + mov r0, r0, lsl #0x10 + mov r5, r0, asr #0x10 + mvn r0, #0 + cmp r5, r0 + beq _0230D868 + mov r4, #0x18 + b _0230D850 +_0230D848: + mov r0, r4 + bl AdvanceFrame +_0230D850: + mov r0, r5 + bl ov10_022BF964 + cmp r0, #0 + bne _0230D848 + mov r0, r5 + bl ov10_022BDE50 +_0230D868: + add sp, sp, #0x10 + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_0230D870: .word ov29_023535D4 + arm_func_end ov29_0230D7D4 + + arm_func_start ov29_0230D874 +ov29_0230D874: ; 0x0230D874 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + ldr lr, [r5, #0xb4] + ldr ip, [r4, #0xb4] + ldrsh r3, [lr, #0x28] + ldrsh r1, [lr, #0x2a] + ldrsh r0, [ip, #0x28] + cmp r2, #0 + strh r0, [lr, #0x28] + ldrsh r0, [ip, #0x2a] + strh r0, [lr, #0x2a] + strh r3, [ip, #0x28] + strh r1, [ip, #0x2a] + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, r4 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldr r2, _0230D8E4 ; =0x00000F2D + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +#ifdef JAPAN +_0230D8E4: .word 0x00002494 +#else +_0230D8E4: .word 0x00000F2D +#endif + arm_func_end ov29_0230D874 + + arm_func_start ov29_0230D8E8 +ov29_0230D8E8: ; 0x0230D8E8 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + ldr lr, [r5, #0xb4] + ldr ip, [r4, #0xb4] + ldr r3, [lr, #0x3c] + ldr r1, [lr, #0x40] + ldr r0, [ip, #0x3c] + cmp r2, #0 + str r0, [lr, #0x3c] + ldr r0, [ip, #0x40] + str r0, [lr, #0x40] + str r3, [ip, #0x3c] + str r1, [ip, #0x40] + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, r4 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldr r2, _0230D958 ; =0x00000F2E + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +#ifdef JAPAN +_0230D958: .word 0x00002495 +#else +_0230D958: .word 0x00000F2E +#endif + arm_func_end ov29_0230D8E8 + + arm_func_start ov29_0230D95C +ov29_0230D95C: ; 0x0230D95C + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + ldr lr, [r5, #0xb4] + ldr ip, [r4, #0xb4] + ldrsh r3, [lr, #0x24] + ldrsh r1, [lr, #0x26] + ldrsh r0, [ip, #0x24] + cmp r2, #0 + strh r0, [lr, #0x24] + ldrsh r0, [ip, #0x26] + strh r0, [lr, #0x26] + strh r3, [ip, #0x24] + strh r1, [ip, #0x26] + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, r4 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldr r2, _0230D9CC ; =0x00000F2B + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +#ifdef JAPAN +_0230D9CC: .word 0x00002492 +#else +_0230D9CC: .word 0x00000F2B +#endif + arm_func_end ov29_0230D95C + + arm_func_start ov29_0230D9D0 +ov29_0230D9D0: ; 0x0230D9D0 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + ldr lr, [r5, #0xb4] + ldr ip, [r4, #0xb4] + ldr r3, [lr, #0x34] + ldr r1, [lr, #0x38] + ldr r0, [ip, #0x34] + cmp r2, #0 + str r0, [lr, #0x34] + ldr r0, [ip, #0x38] + str r0, [lr, #0x38] + str r3, [ip, #0x34] + str r1, [ip, #0x38] + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, r4 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldr r2, _0230DA40 ; =0x00000F2C + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +#ifdef JAPAN +_0230DA40: .word 0x00002493 +#else +_0230DA40: .word 0x00000F2C +#endif + arm_func_end ov29_0230D9D0 + + arm_func_start ov29_0230DA44 +ov29_0230DA44: ; 0x0230DA44 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + ldr lr, [r5, #0xb4] + ldr ip, [r4, #0xb4] + ldrsh r3, [lr, #0x2c] + ldrsh r1, [lr, #0x2e] + ldrsh r0, [ip, #0x2c] + cmp r2, #0 + strh r0, [lr, #0x2c] + ldrsh r0, [ip, #0x2e] + strh r0, [lr, #0x2e] + strh r3, [ip, #0x2c] + strh r1, [ip, #0x2e] + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, r4 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldr r2, _0230DAB4 ; =0x00000F2F + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +#ifdef JAPAN +_0230DAB4: .word 0x00002496 +#else +_0230DAB4: .word 0x00000F2F +#endif + arm_func_end ov29_0230DA44 + + arm_func_start ov29_0230DAB8 +ov29_0230DAB8: ; 0x0230DAB8 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + ldr ip, [r5, #0xb4] + mov r4, r1 + ldrsh r1, [ip, #0x24] + ldr r3, [ip, #0x34] + ldr r0, [ip, #0x3c] + cmp r2, #0 + str r0, [ip, #0x34] + ldrsh r0, [ip, #0x28] + strh r0, [ip, #0x24] + str r3, [ip, #0x3c] + strh r1, [ip, #0x28] + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags +#ifdef JAPAN + ldr r2, _0230F050 ; =0x00002497 + mov r0, r5 + mov r1, r4 +#else + mov r0, r5 + mov r1, r4 + mov r2, #0xf30 +#endif + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r3, r4, r5, pc} +#ifdef JAPAN +_0230F050: .word 0x00002497 +#endif + arm_func_end ov29_0230DAB8 + + arm_func_start SpecificRecruitCheck +SpecificRecruitCheck: ; 0x0230DB14 + stmdb sp!, {r4, lr} + ldr r1, _0230DBC8 ; =DUNGEON_PTR + mov r4, r0 + ldr r1, [r1] + ldrb r1, [r1, #0x759] + cmp r1, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + bl DebugRecruitingEnabled + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + cmp r4, #0x97 + ldreq r0, _0230DBC8 ; =DUNGEON_PTR + ldreq r0, [r0] + addeq r0, r0, #0x700 + ldreqsb r0, [r0, #0x98] + cmpeq r0, #2 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + ldr r1, _0230DBCC ; =0x000001A3 + cmp r4, r1 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + cmp r4, #0x1a4 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + add r0, r1, #2 + cmp r4, r0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + sub r0, r1, #0xa + cmp r4, r0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + sub r0, r1, #9 + cmp r4, r0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + sub r0, r1, #8 + cmp r4, r0 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + .align 2, 0 +_0230DBC8: .word DUNGEON_PTR +_0230DBCC: .word 0x000001A3 + arm_func_end SpecificRecruitCheck + + arm_func_start RecruitCheck +RecruitCheck: ; 0x0230DBD0 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + ldr r2, _0230E024 ; =DUNGEON_PTR + mov r8, r0 + ldr r0, [r2] + mov r7, r1 + ldrb r0, [r0, #0x748] + ldr r5, [r8, #0xb4] + ldr r6, [r7, #0xb4] + bl IsRecruitingAllowed + cmp r0, #0 + beq _0230DC28 + bl IsFullFloorFixedRoom + cmp r0, #0 + bne _0230DC28 + bl IsLegendaryChallengeFloor + cmp r0, #0 + bne _0230DC28 + mov r0, #0xa + mov r1, #6 + bl IsCurrentMissionTypeExact + cmp r0, #0 + beq _0230DC30 +_0230DC28: + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} +_0230DC30: + ldr r0, _0230E024 ; =DUNGEON_PTR + ldr r1, [r0] + ldrb r0, [r1, #0x75d] + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + ldrb r0, [r1, #0x748] + cmp r0, #0x5b + bne _0230DC70 + ldrsh r1, [r6, #2] + ldr r0, _0230E028 ; =0x000001E6 + cmp r1, r0 + addne r0, r0, #0x258 + cmpne r1, r0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} +_0230DC70: + ldrsh r0, [r6, #2] + cmp r0, #0x91 + cmpne r0, #0x90 + cmpne r0, #0x92 + ldrne r2, _0230E02C ; =0x0000010F + cmpne r0, r2 + subne r1, r2, #1 + cmpne r0, r1 + cmpne r0, #0x110 + cmpne r0, #0x19c + addne r1, r2, #0x8e + cmpne r0, r1 + addne r1, r2, #0x92 + cmpne r0, r1 + cmpne r0, #0x1a0 + addne r1, r2, #0x93 + cmpne r0, r1 + addne r1, r2, #0x8a + cmpne r0, r1 + addne r1, r2, #0x8b + cmpne r0, r1 + addne r1, r2, #0x8c + cmpne r0, r1 + beq _0230DCF0 + ldr r1, _0230E030 ; =0xFFFFFDEA + add r1, r0, r1 + mov r1, r1, lsl #0x10 + mov r1, r1, asr #0x10 + mov r1, r1, lsl #0x10 + mov r1, r1, lsr #0x10 + cmp r1, #1 + bhi _0230DD04 +_0230DCF0: + mov r1, #1 + bl IsMonsterOnTeam + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} +_0230DD04: + mov r0, r6 + bl ov29_022FBDE0 + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + ldrsh r0, [r6, #2] + bl SpecificRecruitCheck + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + ldrsh r1, [r8, #4] + ldrsh r0, [r7, #4] + sub r0, r1, r0 + bl abs + cmp r0, #1 + bgt _0230DD5C + ldrsh r1, [r8, #6] + ldrsh r0, [r7, #6] + sub r0, r1, r0 + bl abs + cmp r0, #1 + ble _0230DD64 +_0230DD5C: + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} +_0230DD64: + ldrb r0, [r6, #0x48] + cmp r0, #0xfa + ldrneb r0, [r6, #0xbc] + cmpne r0, #7 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov r0, r7 + mov r1, r8 + bl CanSeeTarget + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov r0, #1 + bl ov29_022E1B28 + bl ov29_022E81F8 + ldrsh r0, [r6, #2] + mov r1, #1 + bl IsMonsterOnTeam + mov sb, r0 + mov r0, #0x3e8 + bl DungeonRandInt + mov r4, r0 + bl HasPlayedOldGame + cmp r0, #0 + beq _0230DDE0 + cmp sb, #0 + bne _0230DDE0 + ldrsh r0, [r6, #2] + bl GetRecruitRate2 + mov r6, r0 + b _0230DDEC +_0230DDE0: + ldrsh r0, [r6, #2] + bl GetRecruitRate1 + mov r6, r0 +_0230DDEC: + cmp r6, #0 + ble _0230DDFC + cmp sb, #0 + movne r6, r6, asr #1 +_0230DDFC: + ldr r0, _0230E034 ; =0xFFFFFC19 + cmp r6, r0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov r0, r8 + mov r1, #0x35 + bl ItemIsActive__0230E578 + cmp r0, #0 + ldrne r0, _0230E038 ; =ov10_022C44FC + ldrnesh r0, [r0] + addne r6, r6, r0 + bne _0230DFD4 + mov r0, r8 + mov r1, #0x39 + bl ItemIsActive__0230E578 + cmp r0, #0 + ldrne r0, _0230E03C ; =ov10_022C443C + ldrnesh r0, [r0] + addne r6, r6, r0 + bne _0230DFD4 + mov r0, r8 + mov r1, #0x3a + bl ItemIsActive__0230E578 + cmp r0, #0 + ldrne r0, _0230E040 ; =ov10_022C447C + ldrnesh r0, [r0] + addne r6, r6, r0 + bne _0230DFD4 + mov r0, r8 + mov r1, #0x3b + bl ItemIsActive__0230E578 + cmp r0, #0 + beq _0230DEA0 + mov r0, r7 + mov r1, #6 + bl MonsterIsType + cmp r0, #0 + ldrne r0, _0230E044 ; =ov10_022C441C + ldrnesh r0, [r0] + addne r6, r6, r0 + b _0230DFD4 +_0230DEA0: + mov r0, r8 + mov r1, #0x3c + bl ItemIsActive__0230E578 + cmp r0, #0 + beq _0230DED4 + mov r0, r7 + mov r1, #2 + bl MonsterIsType + cmp r0, #0 + ldrne r0, _0230E048 ; =ov10_022C4410 + ldrnesh r0, [r0] + addne r6, r6, r0 + b _0230DFD4 +_0230DED4: + mov r0, r8 + mov r1, #0x3d + bl ItemIsActive__0230E578 + cmp r0, #0 + beq _0230DF08 + mov r0, r7 + mov r1, #9 + bl MonsterIsType + cmp r0, #0 + ldrne r0, _0230E04C ; =ov10_022C470C + ldrnesh r0, [r0] + addne r6, r6, r0 + b _0230DFD4 +_0230DF08: + mov r0, r8 + mov r1, #0x3e + bl ItemIsActive__0230E578 + cmp r0, #0 + beq _0230DF3C + mov r0, r7 + mov r1, #3 + bl MonsterIsType + cmp r0, #0 + ldrne r0, _0230E050 ; =ov10_022C4708 + ldrnesh r0, [r0] + addne r6, r6, r0 + b _0230DFD4 +_0230DF3C: + mov r0, r8 + mov r1, #0x3f + bl ItemIsActive__0230E578 + cmp r0, #0 + beq _0230DF70 + mov r0, r7 + mov r1, #0xd + bl MonsterIsType + cmp r0, #0 + ldrne r0, _0230E054 ; =ov10_022C4704 + ldrnesh r0, [r0] + addne r6, r6, r0 + b _0230DFD4 +_0230DF70: + mov r0, r8 + mov r1, #0x40 + bl ItemIsActive__0230E578 + cmp r0, #0 + beq _0230DFA4 + mov r0, r7 + mov r1, #4 + bl MonsterIsType + cmp r0, #0 + ldrne r0, _0230E058 ; =ov10_022C4700 + ldrnesh r0, [r0] + addne r6, r6, r0 + b _0230DFD4 +_0230DFA4: + mov r0, r8 + mov r1, #0x41 + bl ItemIsActive__0230E578 + cmp r0, #0 + beq _0230DFD4 + mov r0, r7 + mov r1, #0xa + bl MonsterIsType + cmp r0, #0 + ldrne r0, _0230E05C ; =ov10_022C46FC + ldrnesh r0, [r0] + addne r6, r6, r0 +_0230DFD4: + mov r0, r8 + mov r1, #0x1e + bl IqSkillIsEnabled + cmp r0, #0 + ldrne r0, _0230E038 ; =ov10_022C44FC + ldrb r1, [r5, #0xa] + ldrnesh r0, [r0] + mov r1, r1, lsl #1 + addne r6, r6, r0 + ldr r0, _0230E060 ; =RECRUITMENT_LEVEL_BOOST_TABLE + ldrsh r0, [r0, r1] + add r0, r6, r0 + cmp r4, r0 + mov r0, #0 + ldmgeia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + bl GetFirstEmptyMemberIdx + cmp r0, #0 + movlt r0, #0 + movge r0, #1 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + .align 2, 0 +_0230E024: .word DUNGEON_PTR +_0230E028: .word 0x000001E6 +_0230E02C: .word 0x0000010F +_0230E030: .word 0xFFFFFDEA +_0230E034: .word 0xFFFFFC19 +_0230E038: .word ov10_022C44FC +_0230E03C: .word ov10_022C443C +_0230E040: .word ov10_022C447C +_0230E044: .word ov10_022C441C +_0230E048: .word ov10_022C4410 +_0230E04C: .word ov10_022C470C +_0230E050: .word ov10_022C4708 +_0230E054: .word ov10_022C4704 +_0230E058: .word ov10_022C4700 +_0230E05C: .word ov10_022C46FC +_0230E060: .word RECRUITMENT_LEVEL_BOOST_TABLE + arm_func_end RecruitCheck + + arm_func_start TryRecruit +TryRecruit: ; 0x0230E064 +#ifdef JAPAN +#define TRY_RECRUIT_OFFSET -4 +#define TRY_RECRUIT_OFFSET_2 -0x2C0 +#else +#define TRY_RECRUIT_OFFSET 0 +#define TRY_RECRUIT_OFFSET_2 0 +#endif +#ifdef JAPAN + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} +#else + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} +#endif + sub sp, sp, #0x114 + TRY_RECRUIT_OFFSET + mov sl, r0 + mov r0, #0xa + mov r5, #0 + mov sb, r1 + mov r8, r2 + bl ov29_0234BA54 + mov r0, r5 + bl ov29_0234B1A4 + bl ov29_0234D630 + add r0, sb, #4 + add r1, sl, #4 + mvn r7, #0 + bl GetDirectionTowardsPosition + mov r6, r0 + ldr r4, [sb, #0xb4] + mov r0, r5 + strb r0, [sb, #0x22] + mov r0, sl + mov r1, sb + bl ov29_02305F60 + mov r1, r6 + mov r0, sb + bl ov29_02304A48 + ldrsh r0, [r4, #2] + mov r1, #1 + bl IsMonsterOnTeam + cmp r0, #0 + beq _0230E0FC + bl ov29_0234B034 + mov r1, #1 + str r1, [sp] + mov r1, r5 + ldr r2, [sb, #0xb4] + mov r3, r1 + bl ov29_0230040C + b _0230E114 +_0230E0FC: + bl ov29_0234B034 + mov r1, r5 + str r1, [sp] + ldr r2, [sb, #0xb4] + mov r3, r1 + bl ov29_0230040C +_0230E114: + bl ov29_0234B034 + mov r1, r0 + mov r3, #1 + mov r2, #0 + str r3, [sp] + ldr r0, _0230E55C ; =0x00000C77 + mov r3, r2 + bl ov29_0234D7C0 + cmp r0, #2 + moveq r4, #0 + beq _0230E524 + mov r4, #1 + mov r0, #0 + orr r1, r4, #2 + strb r1, [sp, #0xac + TRY_RECRUIT_OFFSET] + strb r0, [sp, #0xad + TRY_RECRUIT_OFFSET] + ldrsh r2, [r8, #0xc] + ldr r1, _0230E560 ; =DUNGEON_PTR + sub r3, r0, #1 + strb r2, [sp, #0xae + TRY_RECRUIT_OFFSET] + strh r4, [sp, #0xb2 + TRY_RECRUIT_OFFSET] + ldr r2, [r1] + ldrh r4, [r8, #0x44] + add r1, sp, #0x14 + strh r4, [r1, #0xf2 + TRY_RECRUIT_OFFSET] + ldrh r4, [r8, #0x46] + strh r4, [r1, #0xf4 + TRY_RECRUIT_OFFSET] + strb r0, [sp, #0x104 + TRY_RECRUIT_OFFSET] + strh r3, [sp, #0xb4 + TRY_RECRUIT_OFFSET] + strh r3, [sp, #0xb6 + TRY_RECRUIT_OFFSET] + ldrsh r1, [r8] + strh r1, [sp, #0xb8 + TRY_RECRUIT_OFFSET] + ldrb r1, [r2, #0x748] + strb r1, [sp, #0xaf + TRY_RECRUIT_OFFSET] + ldrb r1, [r2, #0x749] + add r2, sp, #0xac + TRY_RECRUIT_OFFSET + strb r1, [sp, #0xb0 + TRY_RECRUIT_OFFSET] + ldrsh r1, [r8, #6] + strh r1, [sp, #0xba + TRY_RECRUIT_OFFSET] + ldrsh r1, [r8, #6] + strh r1, [sp, #0xbc + TRY_RECRUIT_OFFSET] + ldrh r1, [r8, #0x14] + strh r1, [sp, #0xf0 + TRY_RECRUIT_OFFSET] + ldrh r1, [r8, #0x16] + strh r1, [sp, #0xf2 + TRY_RECRUIT_OFFSET] + ldrh r1, [r8, #0x18] + strh r1, [sp, #0xf4 + TRY_RECRUIT_OFFSET] + ldrh r1, [r8, #0x1a] + strh r1, [sp, #0xf6 + TRY_RECRUIT_OFFSET] +_0230E1D8: + add r4, r8, r0 + ldrb r1, [r4, #8] + add r3, r2, r0 + add r0, r0, #1 + strb r1, [r3, #0x12] + ldrb r1, [r4, #0xa] + mov r0, r0, lsl #0x10 + mov r0, r0, asr #0x10 + strb r1, [r3, #0x14] + cmp r0, #2 + blt _0230E1D8 + ldr r0, [r8, #0x10] + add r2, sp, #0xc8 + TRY_RECRUIT_OFFSET + str r0, [sp, #0xc4 + TRY_RECRUIT_OFFSET] + add r3, r8, #0x22 + mov r1, #0x11 +_0230E218: + ldrh r0, [r3], #2 + subs r1, r1, #1 + strh r0, [r2], #2 + bne _0230E218 + ldrh r0, [r8, #0x1c] + strh r0, [sp, #0xea + TRY_RECRUIT_OFFSET] + ldrh r0, [r8, #0x1e] + strh r0, [sp, #0xec + TRY_RECRUIT_OFFSET] + ldrh r0, [r8, #0x20] + strh r0, [sp, #0xee + TRY_RECRUIT_OFFSET] + ldrsh r0, [r8] + bl GetNameString + mov r1, r0 + add r0, sp, #0x100 + add r0, r0, #0xa + TRY_RECRUIT_OFFSET + mov r2, #0xa + bl StrncpyName + ldrsh r1, [sp, #0xb8 + TRY_RECRUIT_OFFSET] + ldrsh r2, [sp, #0xb2 + TRY_RECRUIT_OFFSET] + add r0, sp, #0xf8 + TRY_RECRUIT_OFFSET + bl EnableAllLearnableIqSkills + add r1, sp, #0x100 + add r0, sp, #0x98 + add r1, r1, #0xa + TRY_RECRUIT_OFFSET +#ifdef JAPAN + add r4, sp, #0x18 + bl StrcpySimple +#else + mov r2, #0xa + add r4, sp, #0x18 + bl StrncpySimpleNoPad +#endif + bl ov29_022EACAC + bl ov29_0234B034 + mov r1, r0 + mov r0, #1 + str r0, [sp] + mov r2, #0 + ldr r0, _0230E564 ; =0x00000C7B + mov r3, r2 + bl ov29_0234D7C0 + cmp r0, #1 + bne _0230E2D4 + bl ov29_0234D838 + add r6, sp, #0x100 + add r6, r6, #0xa + TRY_RECRUIT_OFFSET +_0230E2BC: + mov r0, r6 + add r1, sp, #0x98 + mov r2, #0 + bl ov29_0234F008 + cmp r0, #0 + beq _0230E2BC +_0230E2D4: + add r1, sp, #0xac + TRY_RECRUIT_OFFSET + mov r0, r4 + bl sub_020585B4 + mov r1, r4 + mov r0, #0 + bl ov29_0234B0B4 + mov r0, #1 + mov r1, #0 + bl ov29_0234B084 + ldr r0, _0230E568 ; =0x00000C7E + bl ov29_0230E658 + ldrsh r1, [r8, #2] + ldrsh r2, [r8, #4] + mov r0, sb + bl ov29_02337EC0 + ldrsh r2, [r8, #2] + ldrsh r3, [r8, #4] + mov r0, sl + mov r1, sb + bl ov29_0230E5A8 + cmp r0, #0 + bne _0230E42C + add r0, sp, #0xac + TRY_RECRUIT_OFFSET + mvn r1, #0 + bl ov29_0230E5FC + mov r7, r0 + b _0230E410 +_0230E340: + ldr r0, _0230E56C ; =0x00000C7F + bl ov29_0230E658 + mvn r4, #0 +_0230E34C: + bl ov29_0234D838 + add r1, sp, #0x100 + mov r0, sb + add r1, r1, #0xa + TRY_RECRUIT_OFFSET + bl ov29_0234EE10 + movs r6, r0 + beq _0230E3D4 + cmp r6, sb + add r0, sp, #0x58 + bne _0230E380 + add r1, sp, #0xac + TRY_RECRUIT_OFFSET + bl sub_020585B4 + b _0230E38C +_0230E380: + ldr r1, [r6, #0xb4] + ldrsh r1, [r1, #0xc] + bl sub_020584FC +_0230E38C: + mov r0, #0 + add r1, sp, #0x58 + bl ov29_0234B0B4 + mov r0, #1 + mov r1, sl + mov r2, #0 + bl SubstitutePlaceholderStringTags + bl ov29_0234B034 + mov r1, #1 + mov r2, #0 + str r1, [sp] + mov r1, r0 + mov r0, #0xc80 + TRY_RECRUIT_OFFSET_2 + mov r3, r2 + bl ov29_0234D7C0 + mov fp, r0 + cmp fp, r4 + beq _0230E34C +_0230E3D4: + cmp fp, #2 + cmpne r6, #0 + beq _0230E410 + ldr r0, _0230E56C ; =0x00000C7F + add r0, r0, #2 + bl ov29_0230E658 + mov r0, r6 + bl ov29_022E68BC + ldr r1, _0230E570 ; =0x00000233 + mov r0, r6 + mov r2, sl + bl HandleFaint + cmp r6, sb + moveq r4, #1 + beq _0230E524 +_0230E410: + mov r0, sl + mov r1, sb + ldrsh r2, [r8, #2] + ldrsh r3, [r8, #4] + bl ov29_0230E5A8 + cmp r0, #0 + beq _0230E340 +_0230E42C: + mov r6, #0 + mov r4, r6 + mov r5, #1 + b _0230E468 +_0230E43C: + mov r0, r6 + bl GetActiveTeamMember + ldrb r0, [r0] + tst r0, #1 + movne r0, r5 + moveq r0, r4 + tst r0, #0xff + beq _0230E470 + add r0, r6, #1 + mov r0, r0, lsl #0x10 + mov r6, r0, asr #0x10 +_0230E468: + cmp r6, #4 + blt _0230E43C +_0230E470: + add r0, sp, #0xac + TRY_RECRUIT_OFFSET + mov r1, r7 + strh r6, [sp, #0xb6 + TRY_RECRUIT_OFFSET] + bl ov29_0230E5FC + strh r0, [sp, #0xb4 + TRY_RECRUIT_OFFSET] + ldrsh r1, [sp, #0xb4 + TRY_RECRUIT_OFFSET] + mov r0, r6 + bl sub_02056698 + ldr r1, _0230E570 ; =0x00000233 + mov r0, sb + mov r2, sl + bl HandleFaint + mov r0, r6 + bl GetActiveTeamMember + mov r4, r0 + add r7, sp, #0xac + TRY_RECRUIT_OFFSET + mov r6, r4 + mov r5, #6 +_0230E4B8: + ldmia r7!, {r0, r1, r2, r3} + stmia r6!, {r0, r1, r2, r3} + subs r5, r5, #1 + bne _0230E4B8 + ldmia r7, {r0, r1} + stmia r6, {r0, r1} + bl ov29_022E8104 + bl ov29_022E81F8 + add r1, sp, #0x14 + mov r0, #0 + str r1, [sp] + str r0, [sp, #4] + mov r0, #1 + str r0, [sp, #8] + str r0, [sp, #0xc] + str r0, [sp, #0x10] + ldrsh r0, [r8] + ldrsh r1, [r8, #2] + ldrsh r2, [r8, #4] + mov r3, r4 + bl InitTeamMember + ldrsh r0, [r4, #0xc] + bl SetPokemonJoined + bl ov29_022E8104 + bl ov29_022E81F8 + ldr r5, [sp, #0x14] + mov r4, #1 +_0230E524: + mov r0, #1 + bl ov29_0234D8A0 + cmp r4, #0 + bne _0230E540 + ldr r1, _0230E574 ; =0x00000C78 + mov r0, sl + bl LogMessageByIdWithPopupCheckUser +_0230E540: + cmp r5, #0 + beq _0230E550 + mov r0, r5 + bl EnsureCanStandCurrentTile +_0230E550: + mov r0, r4 + add sp, sp, #0x114 + TRY_RECRUIT_OFFSET +#ifdef JAPAN + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} +#else + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} +#endif + .align 2, 0 +_0230E55C: .word 0x00000C77 + TRY_RECRUIT_OFFSET_2 +_0230E560: .word DUNGEON_PTR +_0230E564: .word 0x00000C7B + TRY_RECRUIT_OFFSET_2 +_0230E568: .word 0x00000C7E + TRY_RECRUIT_OFFSET_2 +_0230E56C: .word 0x00000C7F + TRY_RECRUIT_OFFSET_2 +_0230E570: .word 0x00000233 +_0230E574: .word 0x00000C78 + TRY_RECRUIT_OFFSET_2 + arm_func_end TryRecruit + + arm_func_start ItemIsActive__0230E578 +ItemIsActive__0230E578: ; 0x0230E578 + stmdb sp!, {r3, r4, r5, lr} + mov r4, r1 + mov r1, #0x6f + mov r5, r0 + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + mov r0, r5 + mov r1, r4 + bl HasHeldItem + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ItemIsActive__0230E578 + + arm_func_start ov29_0230E5A8 +ov29_0230E5A8: ; 0x0230E5A8 + stmdb sp!, {r4, lr} + ldr r4, [r1, #0xb4] + mov r1, r2 + ldrsh r0, [r4, #2] + mov r2, r3 + mov r3, #1 + bl ov29_022FD318 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + ldrsh r0, [r4, #2] + bl ov29_022FBC94 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + bl sub_02056830 + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + arm_func_end ov29_0230E5A8 + + arm_func_start ov29_0230E5FC +ov29_0230E5FC: ; 0x0230E5FC + stmdb sp!, {r4, r5, lr} + sub sp, sp, #0x44 + mov r5, r0 + mov r4, r1 + add r0, sp, #0 + mov r1, r5 + bl sub_020534BC + mov r1, #0 + sub r0, r1, #1 + strb r1, [sp, #6] + strb r1, [sp, #7] + cmp r4, r0 + bne _0230E640 + add r0, sp, #0 + bl sub_02055CCC + mov r4, r0 + b _0230E64C +_0230E640: + ldrsh r0, [r5, #8] + add r1, sp, #0 + bl sub_02055D7C +_0230E64C: + mov r0, r4 + add sp, sp, #0x44 + ldmia sp!, {r4, r5, pc} + arm_func_end ov29_0230E5FC + + arm_func_start ov29_0230E658 +ov29_0230E658: ; 0x0230E658 + stmdb sp!, {r3, r4, r5, lr} + mov r4, r0 + bl AllocateTemp1024ByteBufferFromPool + mov r5, r0 + mov r0, r4 + bl StringFromId + mov r4, r0 + bl ov29_0234B034 + mov r2, r4 + str r0, [sp] + mov r0, r5 + mov r1, #0x400 + mov r3, r1 + bl PreprocessString + mov r0, r5 + bl ov29_0234BB50 + bl ov29_0234B034 + mov r1, r0 + mov r0, r5 + mov r2, #1 + str r2, [sp] + mov r2, #0 + mov r3, r2 + bl ov29_0234D6C8 + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_0230E658 + + arm_func_start TrySpawnMonsterAndTickSpawnCounter +TrySpawnMonsterAndTickSpawnCounter: ; 0x0230E6BC +#ifdef JAPAN +#define TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET -0xA4 +#else +#define TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET 0 +#endif + stmdb sp!, {r4, r5, r6, r7, r8, lr} + sub sp, sp, #0x10 + ldr r0, _0230E8D8 ; =DUNGEON_PTR + mov r6, #0 + ldr r7, [r0] + add r0, r7, #0x700 + ldrsh r1, [r0, #0x86] + cmp r1, #0 + beq _0230E8D0 + ldrsh r1, [r0, #0x82] + add r1, r1, #1 + strh r1, [r0, #0x82] + ldrb r1, [r7, #0x790] + cmp r1, #0 + bne _0230E710 + ldr r1, _0230E8DC ; =SPAWN_COOLDOWN + ldrsh r2, [r0, #0x82] + ldrsh r0, [r1] + cmp r2, r0 + bge _0230E724 + b _0230E8D0 +_0230E710: + ldr r1, _0230E8E0 ; =SPAWN_COOLDOWN_THIEF_ALERT + ldrsh r2, [r0, #0x82] + ldrsh r0, [r1] + cmp r2, r0 + blt _0230E8D0 +_0230E724: + cmp r2, #0x384 + ble _0230E76C + add r0, r7, #0x19000 + ldr r4, [r0, #0x908 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] + mov r0, r4 + bl EntityIsValid__0230E8F0 + cmp r0, #0 + beq _0230E76C + add r0, r7, #0x19000 + ldrh r1, [r4, #0x26] + ldr r0, [r0, #0x910 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] + cmp r1, r0 + bne _0230E76C + mov r0, #0 + mov r1, r4 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r6, r4 +_0230E76C: + mov r5, #0 + add r0, r7, #0x700 + strh r5, [r0, #0x82] + add r0, r7, #0x19000 + mov r4, r5 + str r5, [r0, #0x908 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] +_0230E784: + add r0, r7, r4, lsl #2 + add r0, r0, #0x12000 + ldr r8, [r0, #0xb38 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] + mov r0, r8 + bl EntityIsValid__0230E8F0 + cmp r0, #0 + beq _0230E7B8 + ldrsh r0, [r8, #4] + ldrsh r1, [r8, #6] + bl GetTile + ldrh r0, [r0] + tst r0, #0x100 + addeq r5, r5, #1 +_0230E7B8: + add r4, r4, #1 + cmp r4, #0x10 + blt _0230E784 + ldrb r0, [r7, #0x790] + cmp r0, #0 + bne _0230E80C + ldr r0, _0230E8D8 ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, #0x4000 + ldrb r0, [r0, #0xc9 + TRY_SPAWN_MONSTER_AND_TICK_SPAWN_COUNTER_OFFSET] + cmp r0, #0xff + bne _0230E7FC + ldr r0, _0230E8E4 ; =SPAWN_CAP_NO_MONSTER_HOUSE + ldrsh r0, [r0] + cmp r5, r0 + blt _0230E80C + b _0230E8D0 +_0230E7FC: + ldr r0, _0230E8E8 ; =SPAWN_CAP_WITH_MONSTER_HOUSE + ldrsh r0, [r0] + cmp r5, r0 + bge _0230E8D0 +_0230E80C: + cmp r6, #0 + beq _0230E828 + ldr r1, _0230E8EC ; =0x00000C5D + mov r0, #0 + bl LogMessageByIdWithPopup + mov r0, r6 + bl ov29_022E62F0 +_0230E828: + ldrb r0, [r7, #0x790] + cmp r0, #0 + beq _0230E83C + bl GetKecleonIdToSpawnByFloor + b _0230E844 +_0230E83C: + mov r0, #0 + bl GetMonsterIdToSpawn +_0230E844: + mov r5, r0 + mov r0, r5 + bl GetMonsterLevelToSpawn + movs r4, r0 + mov r0, r5 + mov r1, #0 + moveq r4, #1 + bl MewSpawnCheck + cmp r0, #0 + beq _0230E8D0 + add r0, sp, #0xa + mov r1, #0 + bl ov29_022E9628 + cmp r0, #0 + beq _0230E8D0 + mov r1, #0 + mov r0, #0x64 + strh r5, [sp] + strh r4, [sp, #8] + strb r1, [sp, #2] + bl DungeonRandInt + ldr r1, _0230E8D8 ; =DUNGEON_PTR + mov r4, r0 + ldr r0, [r1] + ldrb r0, [r0, #0x748] + bl GetRandomMovementChance + cmp r4, r0 + movlt r0, #1 + strlt r0, [sp, #4] + movge r0, #0 + strge r0, [sp, #4] + mov r1, #0 + add r0, sp, #0 + strb r1, [sp, #0xe] + bl SpawnMonster +_0230E8D0: + add sp, sp, #0x10 + ldmia sp!, {r4, r5, r6, r7, r8, pc} + .align 2, 0 +_0230E8D8: .word DUNGEON_PTR +_0230E8DC: .word SPAWN_COOLDOWN +_0230E8E0: .word SPAWN_COOLDOWN_THIEF_ALERT +_0230E8E4: .word SPAWN_CAP_NO_MONSTER_HOUSE +_0230E8E8: .word SPAWN_CAP_WITH_MONSTER_HOUSE +#ifdef JAPAN +_0230E8EC: .word 0x0000099C +#else +_0230E8EC: .word 0x00000C5D +#endif + arm_func_end TrySpawnMonsterAndTickSpawnCounter diff --git a/asm/overlay_29_0230F02C.s b/asm/overlay_29_0230F02C.s index 1ae9086c..7930cc3c 100644 --- a/asm/overlay_29_0230F02C.s +++ b/asm/overlay_29_0230F02C.s @@ -764,1565 +764,3 @@ _0230F96C: .align 2, 0 _0230F97C: .word DIRECTIONS_XY arm_func_end ov29_0230F8D0 - - arm_func_start IsMonster__0230F980 -IsMonster__0230F980: ; 0x0230F980 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__0230F980 - - arm_func_start ov29_0230F9A4 -ov29_0230F9A4: ; 0x0230F9A4 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl IsMonster__0230F980 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldr r0, [r5, #0xb4] - ldrb r0, [r0, #6] - cmp r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - mov r0, r4 - bl ov29_0234908C - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_0230F9A4 - - arm_func_start TrySpawnEnemyItemDrop -TrySpawnEnemyItemDrop: ; 0x0230F9D8 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - sub sp, sp, #8 - ldr r2, _0230FB28 ; =DUNGEON_PTR - mov r6, r0 - ldr r0, [r2] - mov r5, r1 - ldrb r0, [r0, #0x748] - bl TreasureBoxDropsEnabled - cmp r0, #0 - ldrne r4, [r5, #0xb4] - ldrneb r0, [r4, #6] - cmpne r0, #0 - beq _0230FB20 - ldr r0, [r6] - mov r7, #0 - cmp r0, #1 - bne _0230FA54 - mov r0, r6 - mov r1, #0x43 - bl IqSkillIsEnabled - cmp r0, #0 - addne r0, r7, #1 - movne r0, r0, lsl #0x10 - movne r7, r0, asr #0x10 - mov r0, r6 - mov r1, #0x56 - bl ExclusiveItemEffectIsActive__0230F8AC - cmp r0, #0 - addne r0, r7, #1 - movne r0, r0, lsl #0x10 - movne r7, r0, asr #0x10 -_0230FA54: - ldrsh r1, [r4, #2] - add r0, sp, #0 - mov r2, r7 - bl TryGenerateUnownStoneDrop - cmp r0, #0 - beq _0230FA84 - add r2, sp, #0 - mov r0, r5 - add r1, r5, #4 - mov r3, #1 - bl SpawnDroppedItemWrapper - b _0230FB20 -_0230FA84: - mov r0, r6 - mov r1, #0x75 - bl AbilityIsActiveVeneer - mov r2, r0 - add r0, sp, #0 - mov r1, r5 - mov r3, r7 - bl ov29_023460DC - cmp r0, #0 - beq _0230FAC4 - add r2, sp, #0 - mov r0, r5 - add r1, r5, #4 - mov r3, #1 - bl SpawnDroppedItemWrapper - b _0230FB20 -_0230FAC4: - mov r0, r6 - bl IsMonster__0230F980 - cmp r0, #0 - beq _0230FB20 - mov r0, r6 - mov r1, #0x62 - bl ExclusiveItemEffectIsActive__0230F8AC - cmp r0, #0 - beq _0230FB20 - ldr r0, _0230FB2C ; =ov10_022C4650 - ldrsh r0, [r0] - bl DungeonRandOutcome__022EAB20 - cmp r0, #0 - beq _0230FB20 - add r0, sp, #0 - mov r1, #0xb7 - mov r2, #2 - bl GenerateStandardItem - add r2, sp, #0 - mov r0, r5 - add r1, r5, #4 - mov r3, #1 - bl SpawnDroppedItemWrapper -_0230FB20: - add sp, sp, #8 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_0230FB28: .word DUNGEON_PTR -_0230FB2C: .word ov10_022C4650 - arm_func_end TrySpawnEnemyItemDrop - - arm_func_start ov29_0230FB30 -ov29_0230FB30: ; 0x0230FB30 - stmdb sp!, {r3, r4, r5, lr} - ldr r1, _0230FB88 ; =ov29_023529A8 - mov r5, r0 - ldrh r2, [r1] - add r0, sp, #0 - strh r2, [sp] - ldrh r1, [r1, #2] - strh r1, [sp, #2] - bl ov29_02347184 - movs r4, r0 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - mov r1, r4 - mov r0, #0 - bl ov29_02344B9C - ldr r1, _0230FB8C ; =0x00000F62 - mov r0, r5 - bl LogMessageByIdWithPopupCheckUser - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_0230FB88: .word ov29_023529A8 -#ifdef JAPAN -_0230FB8C: .word 0x000009B6 -#else -_0230FB8C: .word 0x00000F62 -#endif - arm_func_end ov29_0230FB30 - - arm_func_start TickNoSlipCap -TickNoSlipCap: ; 0x0230FB90 -#ifdef JAPAN -#define TICK_NO_SLIP_CAP_OFFSET -1 -#else -#define TICK_NO_SLIP_CAP_OFFSET 0 -#endif - stmdb sp!, {r3, r4, r5, lr} - mov r1, #0x6f - mov r5, r0 - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #0 - bne _0230FBB8 - mov r0, r5 - mov r1, #0xd - bl HasHeldItem -_0230FBB8: - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldr r4, [r5, #0xb4] - ldrb r0, [r4, #6] - cmp r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] - add r1, r0, #1 - and r0, r1, #0xff - cmp r0, #0x14 - strb r1, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] - movhs r0, #0x13 - strhsb r0, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] - mov r0, #0x64 - bl DungeonRandInt - ldrb r2, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] - ldr r1, _0230FC20 ; =ov10_022C4BE4 - mov r2, r2, lsl #1 - ldrsh r1, [r1, r2] - cmp r0, r1 - ldmgeia sp!, {r3, r4, r5, pc} - mov r0, r5 - bl ov29_0230FB30 - mov r0, #0 - strb r0, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_0230FC20: .word ov10_022C4BE4 - arm_func_end TickNoSlipCap - - arm_func_start ov29_0230FC24 -ov29_0230FC24: ; 0x0230FC24 -#ifdef JAPAN -#define OV29_0230FC24_OFFSET -4 -#define OV29_0230FC24_OFFSET_2 -0xA4 -#define OV29_0230FC24_OFFSET_3 -1 -#else -#define OV29_0230FC24_OFFSET 0 -#define OV29_0230FC24_OFFSET_2 0 -#define OV29_0230FC24_OFFSET_3 0 -#endif - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, lr} - sub sp, sp, #0x34 - movs r5, r0 - beq _02310FF4 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldr r4, [r5, #0xb4] - mov r1, #0 - mov r0, r5 - strb r1, [r4, #0x150 + OV29_0230FC24_OFFSET] - bl ov29_022FB718 - bl ov29_0234B294 - mov r0, r5 - bl TryWeatherFormChange - mov r0, r5 - mov r1, #0x1d - bl ItemIsActive__02311034 - cmp r0, #0 - beq _0230FD0C - ldrb r0, [r4, #0x17c + OV29_0230FC24_OFFSET] - add r1, r0, #1 - and r0, r1, #0xff - cmp r0, #0x14 - strb r1, [r4, #0x17c + OV29_0230FC24_OFFSET] - movhs r0, #0x13 - strhsb r0, [r4, #0x17c + OV29_0230FC24_OFFSET] - mov r0, #0x64 - bl DungeonRandInt - ldrb r2, [r4, #0x17c + OV29_0230FC24_OFFSET] - ldr r1, _02310A6C ; =ov10_022C4BBC - mov r2, r2, lsl #1 - ldrsh r1, [r1, r2] - cmp r0, r1 - bge _0230FD0C - mov r1, #0 - mov r0, r5 - strb r1, [r4, #0x17c + OV29_0230FC24_OFFSET] - bl ov29_022EC62C - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - mov r2, #0 - mov r0, r5 - mov r1, r5 - mov r3, r2 - bl TryWarp - mov r0, r5 - bl ov29_022F42F8 -_0230FD0C: - ldrb r0, [r4, #7] - cmp r0, #0 - beq _0231013C - mov r0, r5 - mov r1, #0x1e - mov r7, #0xa - bl ItemIsActive__02311034 - cmp r0, #0 - movne r2, r7 - moveq r2, #0 - mov r0, r5 - mov r1, #0x26 - sub r7, r7, r2 - bl ItemIsActive__02311034 - cmp r0, #0 - movne r2, #1 - moveq r2, #0 - mov r0, r5 - mov r1, #0x10 - sub r7, r7, r2 - bl IqSkillIsEnabled - cmp r0, #0 - mov r0, r5 - mov r1, #0x22 - subne r7, r7, #1 - bl ItemIsActive__02311034 - cmp r0, #0 - movne r2, #1 - moveq r2, #0 - mov r0, r5 - mov r1, #0x11 - add r7, r7, r2 - bl ItemIsActive__02311034 - cmp r0, #0 - movne r2, #1 - moveq r2, #0 - mov r0, r5 - mov r1, #0x32 - add r7, r7, r2 - bl ItemIsActive__02311034 - cmp r0, #0 - movne r2, #1 - moveq r2, #0 - mov r0, r5 - mov r1, #0x59 - add r7, r7, r2 - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - adds r7, r7, r0 - movmi r7, #0 - ldr r3, _02310A70 ; =0x0000199A - cmp r7, #0x13 - mov r6, #0 - ldr r2, _02310A74 ; =ov10_022C4FC4 - movgt r7, #0x13 - add r0, sp, #0x2c - add r1, sp, #0x24 - str r6, [sp, #0x24] - str r3, [sp, #0x28] - add r2, r2, r7, lsl #3 - bl MultiplyFixedPoint64 - ldrb r2, [r4, #0x15d + OV29_0230FC24_OFFSET] - cmp r2, #1 - ldrhi r0, _02310A78 ; =ov10_022C4A5C - ldrhi r1, [sp, #0x30] - ldrhi r0, [r0, r2, lsl #2] - addhi r0, r1, r0, lsl #16 - strhi r0, [sp, #0x30] - mov r0, #0 - strb r0, [r4, #0x15d + OV29_0230FC24_OFFSET] - add r0, r4, #0x100 - ldrh r2, [r0, #0x46 + OV29_0230FC24_OFFSET] - ldrh r1, [r0, #0x48 + OV29_0230FC24_OFFSET] - add r0, sp, #0x2c - strh r2, [sp, #0x20] - strh r1, [sp, #0x22] - bl BinToDecFixedPoint - strh r0, [sp, #0x14] - mov r0, r0, lsr #0x10 - add r1, r4, #0x100 - strh r0, [sp, #0x16] - ldrh r0, [r1, #0x46 + OV29_0230FC24_OFFSET] - sub r3, sp, #4 - ldrh r2, [sp, #0x14] - strh r0, [r3] - ldrh r0, [r1, #0x48 + OV29_0230FC24_OFFSET] - ldrh r1, [sp, #0x16] - strh r0, [r3, #2] - ldr r0, [r3] - strh r2, [r3] - strh r1, [r3, #2] - ldr r1, [r3] - bl SubFixedPoint - strh r0, [sp, #0x10] - mov r0, r0, lsr #0x10 - strh r0, [sp, #0x12] - ldrh r1, [sp, #0x10] - add r0, r4, #0x100 - ldrh r3, [sp, #0x12] - strh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] - ldrh r2, [sp, #0x20] - strh r3, [r0, #0x48 + OV29_0230FC24_OFFSET] - sub r0, sp, #4 - ldrh r1, [sp, #0x22] - strh r2, [r0] - mov r6, #0 - strh r1, [r0, #2] - ldr r0, [r0] - mov r7, #1 - bl CeilFixedPoint - cmp r0, #0x14 - blt _0230FEFC - add r0, r4, #0x100 - ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0x14 - ldrlt r6, _02310A7C ; =0x00000DE6 -_0230FEFC: - ldrh r1, [sp, #0x20] - ldrh r0, [sp, #0x22] - sub r2, sp, #4 - strh r1, [r2] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0xa - blt _0230FF48 - add r0, r4, #0x100 - ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0xa - ldrlt r6, _02310A80 ; =0x00000DE7 -_0230FF48: - add r0, r4, #0x100 - ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0 - bne _0230FF98 - mov r0, #0 - bl sub_02050FF8 - strh r0, [sp, #0xc] - mov r0, r0, lsr #0x10 - strh r0, [sp, #0xe] - ldrh r2, [sp, #0xc] - add r0, r4, #0x100 - ldrh r1, [sp, #0xe] - strh r2, [r0, #0x46 + OV29_0230FC24_OFFSET] - strh r1, [r0, #0x48 + OV29_0230FC24_OFFSET] -_0230FF98: - add r0, r4, #0x100 - ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0 - bge _0230FFE8 - mov r0, #0 - bl sub_02050FF8 - strh r0, [sp, #8] - mov r0, r0, lsr #0x10 - strh r0, [sp, #0xa] - ldrh r2, [sp, #8] - add r0, r4, #0x100 - ldrh r1, [sp, #0xa] - strh r2, [r0, #0x46 + OV29_0230FC24_OFFSET] - strh r1, [r0, #0x48 + OV29_0230FC24_OFFSET] -_0230FFE8: - add r0, r4, #0x100 - ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0 - bne _023100D8 - bl ov29_022F2FE4 - mov r0, r5 - bl ov29_022EC62C - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldr r0, _02310A84 ; =DUNGEON_PTR - ldr r1, [r0] - ldrb r0, [r1, #0x799] - cmp r0, #0xa - addlo r0, r0, #1 - strlob r0, [r1, #0x799] - ldr r0, _02310A84 ; =DUNGEON_PTR - mov r1, r5 - ldr r0, [r0] - ldrb r0, [r0, #0x799] - cmp r0, #1 - ldreq r6, _02310A88 ; =0x00000DE8 - cmp r0, #2 - ldreq r6, _02310A8C ; =0x00000DE9 - moveq r7, #0 - cmp r0, #3 - mov r0, r5 - ldreq r6, _02310A90 ; =0x00000DEA - moveq r7, #0 - bl ov29_02307BDC - mov r0, r5 - mov r1, #1 - mov r2, #0xe - mov r3, #0x250 - bl ApplyDamageAndEffectsWrapper - mov r0, #1 - strb r0, [r4, #0x150 + OV29_0230FC24_OFFSET] - add r0, r4, #0x100 - ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] - sub r2, sp, #4 - strh r1, [r2] - ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] - strh r0, [r2, #2] - ldr r0, [r2] - bl CeilFixedPoint - cmp r0, #0 - movne r6, #0 - b _023100E8 -_023100D8: - ldr r0, _02310A84 ; =DUNGEON_PTR - mov r1, #0 - ldr r0, [r0] - strb r1, [r0, #0x799] -_023100E8: - cmp r6, #0 - beq _0231013C - cmp r7, #0 - beq _02310124 -#if defined(EUROPE) - mov r0, r5 - bl ov29_022E34A8_EU -#elif defined(JAPAN) - mov r0, r5 - bl EntityIsValid__02311010 -#else - ldr r0, _02310A84 ; =DUNGEON_PTR - ldr r0, [r0] - ldrb r0, [r0, #8] - cmp r0, #0 - bne _02310124 - mov r0, r5 - bl EntityIsValid__02311010 -#endif - cmp r0, #0 - beq _02310124 - ldr r0, _02310A94 ; =0x00001303 - bl ov29_022EACCC -_02310124: - mov r0, r5 - mov r1, r6 - bl LogMessageByIdWithPopupCheckUser - mov r0, #0x1e - mov r1, #0x32 - bl ov29_022EA370 -_0231013C: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldr r0, _02310A84 ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, #0xc000 - ldrb r0, [r0, #0xd5a + OV29_0230FC24_OFFSET_2] - cmp r0, #0 - bne _0231037C - mov r0, r5 - bl GetApparentWeather - cmp r0, #5 - mov r0, r5 - bne _023101FC - mov r1, #0x77 - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _02310360 - mov r0, r5 - mov r1, #0x4d - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _02310360 - mov r0, r5 - mov r1, #6 - bl MonsterIsType - cmp r0, #0 - bne _02310360 - ldr r3, _02310A98 ; =0x00000DBD - mov r6, #9 - mov r0, r5 - mov r1, r5 - mov r2, #1 - str r6, [sp] - bl ExclusiveItemEffectIsActiveWithLogging - cmp r0, #0 - bne _02310360 - ldr r0, _02310A9C ; =ov10_022C46EC - ldr r3, _02310AA0 ; =0x0000025F - ldrsh r1, [r0] - mov r0, r5 - mov r2, #0x12 - bl ApplyDamageAndEffectsWrapper - b _02310360 -_023101FC: - bl GetApparentWeather - cmp r0, #2 - mov r0, r5 - bne _02310298 - mov r1, #0x1d - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _02310360 - mov r0, r5 - mov r1, #9 - bl MonsterIsType - cmp r0, #0 - bne _02310360 - mov r0, r5 - mov r1, #0xd - bl MonsterIsType - cmp r0, #0 - bne _02310360 - mov r0, r5 - mov r1, #0x11 - bl MonsterIsType - cmp r0, #0 - bne _02310360 - ldr r3, _02310A98 ; =0x00000DBD - mov r6, #9 - mov r0, r5 - mov r1, r5 - mov r2, #1 - str r6, [sp] - bl ExclusiveItemEffectIsActiveWithLogging - cmp r0, #0 - bne _02310360 - ldr r0, _02310A9C ; =ov10_022C46EC - ldr r3, _02310AA0 ; =0x0000025F - ldrsh r1, [r0] - mov r0, r5 - mov r2, #0x12 - bl ApplyDamageAndEffectsWrapper - b _02310360 -_02310298: - bl GetApparentWeather - cmp r0, #1 - bne _02310360 - mov r0, r5 - mov r1, #0x5a - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _02310304 - ldr r3, _02310A98 ; =0x00000DBD - mov r6, #9 - mov r0, r5 - mov r1, r5 - mov r2, #1 - str r6, [sp] - bl ExclusiveItemEffectIsActiveWithLogging - cmp r0, #0 - bne _02310360 - mov r0, #2 - mov r1, #0x5a - bl ov29_0234B084 - ldr r0, _02310A9C ; =ov10_022C46EC - mov r2, #0x19 - ldrsh r1, [r0] - mov r0, r5 - rsb r3, r2, #0x278 - bl ApplyDamageAndEffectsWrapper - b _02310360 -_02310304: - mov r0, r5 - mov r1, #0x55 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _02310360 - ldr r3, _02310A98 ; =0x00000DBD - mov r6, #9 - mov r0, r5 - mov r1, r5 - mov r2, #1 - str r6, [sp] - bl ExclusiveItemEffectIsActiveWithLogging - cmp r0, #0 - bne _02310360 - mov r0, #2 - mov r1, #0x55 - bl ov29_0234B084 - ldr r0, _02310A9C ; =ov10_022C46EC - ldr r3, _02310AA0 ; =0x0000025F - ldrsh r1, [r0] - mov r0, r5 - mov r2, #0x1a - bl ApplyDamageAndEffectsWrapper -_02310360: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 -_0231037C: - mov r0, #0x64 - bl DungeonRandInt - mov r6, r0 - mov r0, r5 - mov r1, #0x21 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _023103F8 - ldr r0, _02310AA4 ; =ov10_022C46A0 - ldrsh r0, [r0] - cmp r6, r0 - bge _023103F8 - mov r0, r5 - mov r1, #0 - bl MonsterHasNegativeStatus - cmp r0, #0 - beq _023103F8 - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - mov r0, r5 - mov r1, r5 - mov r2, #1 - mov r3, #0 - bl EndNegativeStatusConditionWrapper -_023103F8: - mov r0, r5 - mov r1, #0x51 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _02310474 - mov r0, r5 - bl GetApparentWeather - cmp r0, #4 - bne _02310474 - mov r0, r5 - mov r1, #0 - bl MonsterHasNegativeStatus - cmp r0, #0 - ldrneb r0, [r4, #0xc4] - cmpne r0, #3 - beq _02310474 - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - mov r3, #0 - mov r0, r5 - mov r1, r5 - mov r2, #1 - str r3, [sp] - bl EndNegativeStatusCondition -_02310474: - mov r0, r5 - mov r1, #0xb - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _023104C0 - ldrb r1, [r4, #0x11f + OV29_0230FC24_OFFSET] - ldr r0, _02310AA8 ; =SPEED_BOOST_TURNS - add r2, r1, #1 - ldrsh r0, [r0] - and r1, r2, #0xff - strb r2, [r4, #0x11f + OV29_0230FC24_OFFSET] - cmp r1, r0 - blt _023104C0 - mov r3, #0 - mov r0, r5 - mov r1, r5 - mov r2, #0x7f - strb r3, [r4, #0x11f + OV29_0230FC24_OFFSET] - bl BoostSpeedOneStage -_023104C0: - ldrb r0, [r4, #0xbd] - cmp r0, #4 - bne _023104F8 - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - mov r0, r5 - bl ov29_022E53F0 -_023104F8: - ldrb r0, [r4, #0xbf] - cmp r0, #1 - bne _02310590 - ldrb r0, [r4, #0xc1] - cmp r0, #0 - subne r0, r0, #1 - strneb r0, [r4, #0xc1] - ldrb r0, [r4, #0xc1] - cmp r0, #0 - bne _02310574 - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldr r1, _02310AAC ; =BURN_DAMAGE_COOLDOWN - mov r0, r5 - ldrsh r2, [r1] - mov r1, r5 - strb r2, [r4, #0xc1] - bl ov29_02307BDC - ldr r0, _02310AB0 ; =BURN_DAMAGE - mov r2, #1 - ldrsh r1, [r0] - mov r0, r5 - rsb r3, r2, #0x248 - bl ApplyDamageAndEffectsWrapper -_02310574: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 -_02310590: - bl GravityIsActive - cmp r0, #0 - beq _023105DC - mov r0, r5 - bl IsFloating - cmp r0, #0 - beq _023105C0 - mov r0, r5 - mov r1, r5 - bl EndMagnetRiseStatus - mov r0, r5 - bl EnsureCanStandCurrentTile -_023105C0: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 -_023105DC: - mov r0, r5 - mov r1, #0x69 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _02310614 - mov r0, r5 - bl TryActivateBadDreams - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 -_02310614: - mov r0, r5 - bl GetTileAtEntity - bl ov29_02337E2C - cmp r0, #0 - bne _023106A4 - ldrsh r2, [r4, #0x12] - ldrsh r1, [r4, #0x16] - ldr r0, _02310AB4 ; =0x000003E7 - add r1, r2, r1 - cmp r1, r0 - movgt r1, r0 - ldrsh r0, [r4, #0x10] - cmp r0, r1 - bge _0231067C - mov r0, r5 - mov r1, #0x64 - bl ExclusiveItemEffectIsActive__02311064 - cmp r0, #0 - beq _0231067C - ldr r0, _02310AB8 ; =ov10_022C4664 - mov r3, #0 - ldrsh r2, [r0] - mov r0, r5 - mov r1, r5 - str r3, [sp] - bl TryIncreaseHp -_0231067C: - mov r0, r5 - mov r1, #0x65 - bl ExclusiveItemEffectIsActive__02311064 - cmp r0, #0 - beq _023106A4 - mov r2, #1 - mov r0, r5 - mov r1, r5 - mov r3, r2 - bl EndNegativeStatusConditionWrapper -_023106A4: - mov r0, r5 - mov r1, #0x5c - bl ExclusiveItemEffectIsActive__02311064 - cmp r0, #0 - beq _02310754 - mov sl, #0 - ldr r6, _02310A84 ; =DUNGEON_PTR - mov sb, sl - mov r7, #1 -_023106C8: - ldr r0, [r6] - add r0, r0, sb, lsl #2 - add r0, r0, #0x12000 - ldr r8, [r0, #0xb28 + OV29_0230FC24_OFFSET_2] - mov r0, r8 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310718 - ldr r0, [r8, #0xb4] - ldrb r0, [r0, #0xbf] - add r0, r0, #0xfe - and r0, r0, #0xff - cmp r0, #1 - bhi _02310718 - mov r0, r8 - bl ov29_022E543C - mov r0, r8 - mov r1, r8 - bl EndBurnClassStatus - mov sl, r7 -_02310718: - add r0, sb, #1 - mov r0, r0, lsl #0x10 - mov sb, r0, asr #0x10 - cmp sb, #4 - blt _023106C8 - cmp sl, #0 - beq _02310754 - ldr r0, _02310ABC ; =ov10_022C464C - mov r6, #1 - ldrsh r2, [r0] - mov r0, r5 - mov r1, r5 - mov r3, #0 - str r6, [sp] - bl TryIncreaseHp -_02310754: - ldrb r0, [r4, #0xbf] - cmp r0, #2 - bne _02310830 - ldrb r0, [r4, #0xc1] - cmp r0, #0 - subne r0, r0, #1 - strneb r0, [r4, #0xc1] - ldrb r0, [r4, #0xc1] - cmp r0, #0 - bne _02310810 - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - ldreqb r0, [r4, #0xbf] - cmpeq r0, #2 - bne _02310FF4 - ldr r1, _02310AC0 ; =POISON_DAMAGE_COOLDOWN - mov r0, r5 - ldrsh r2, [r1] - mov r1, r5 - strb r2, [r4, #0xc1] - bl ov29_02307BDC - mov r0, r5 - mov r1, #0x72 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _023107F8 - ldr r0, _02310AC4 ; =POISON_DAMAGE - mov r6, #1 - ldrsh r2, [r0] - mov r0, r5 - mov r1, r5 - mov r3, #0 - str r6, [sp] - bl TryIncreaseHp - b _02310810 -_023107F8: - ldr r0, _02310AC4 ; =POISON_DAMAGE - mov r2, #3 - ldrsh r1, [r0] - mov r0, r5 - rsb r3, r2, #0x24c - bl ApplyDamageAndEffectsWrapper -_02310810: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - beq _0231092C - b _02310FF4 -_02310830: - cmp r0, #3 - bne _0231092C - ldrb r0, [r4, #0xc1] - cmp r0, #0 - subne r0, r0, #1 - strneb r0, [r4, #0xc1] - ldrb r0, [r4, #0xc1] - cmp r0, #0 - bne _02310910 - ldrb r6, [r4, #0xc2] - cmp r6, #0x1d - addlo r0, r6, #1 - strlob r0, [r4, #0xc2] - ldr r0, _02310AC8 ; =BAD_POISON_DAMAGE_COOLDOWN - cmp r6, #0x1d - ldrsh r0, [r0] - movge r6, #0x1d - cmp r6, #0 - strb r0, [r4, #0xc1] - mov r0, #0 - movlt r6, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - ldreqb r0, [r4, #0xbf] - cmpeq r0, #3 - bne _02310FF4 - mov r0, r5 - mov r1, r5 - bl ov29_02307BDC - mov r0, r5 - mov r1, #0x72 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _023108F4 - ldr r0, _02310ACC ; =BAD_POISON_DAMAGE_TABLE - mov r1, r6, lsl #1 - ldrsh r2, [r0, r1] - mov r6, #1 - mov r0, r5 - mov r1, r5 - mov r3, #0 - str r6, [sp] - bl TryIncreaseHp - b _02310910 -_023108F4: - ldr r0, _02310ACC ; =BAD_POISON_DAMAGE_TABLE - mov r1, r6, lsl #1 - ldrsh r1, [r0, r1] - mov r2, #3 - mov r0, r5 - rsb r3, r2, #0x24c - bl ApplyDamageAndEffectsWrapper -_02310910: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 -_0231092C: - ldrb r0, [r4, #0xc4] - cmp r0, #7 - bne _023109D4 - ldrb r0, [r4, #0xcd] - cmp r0, #0 - subne r0, r0, #1 - strneb r0, [r4, #0xcd] - ldrb r0, [r4, #0xcd] - cmp r0, #0 - bne _023109B4 - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldr r1, _02310AD0 ; =ov10_022C4454 - mov r0, r5 - ldrsh r2, [r1] - mov r1, r5 - strb r2, [r4, #0xcd] - bl ov29_02307BDC - ldr r1, [r4, #0xc8] - mov r0, r5 - bl ov29_022E42E8 - ldr r1, _02310AD4 ; =ov10_022C446C - mov r0, r5 - ldrsh r1, [r1] - mov r2, #2 - mov r3, #0x248 - bl ApplyDamageAndEffectsWrapper -_023109B4: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - beq _02310B6C - b _02310FF4 -_023109D4: - cmp r0, #4 - bne _02310AF8 - ldrb r0, [r4, #0xcd] - cmp r0, #0 - subne r0, r0, #1 - strneb r0, [r4, #0xcd] - ldrb r0, [r4, #0xcd] - cmp r0, #0 - bne _02310A4C - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldr r1, _02310AD8 ; =ov10_022C45F0 - mov r0, r5 - ldrsh r2, [r1] - mov r1, r5 - strb r2, [r4, #0xcd] - bl ov29_02307BDC - ldr r0, _02310ADC ; =ov10_022C45D0 - ldr r3, _02310AE0 ; =0x0000024A - ldrsh r1, [r0] - mov r0, r5 - mov r2, #5 - bl ApplyDamageAndEffectsWrapper -_02310A4C: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - beq _02310B6C - b _02310FF4 - .align 2, 0 -#ifdef JAPAN -#define OV29_0230FC24_DATA_OFFSET -0x2C0 -#else -#define OV29_0230FC24_DATA_OFFSET 0 -#endif -_02310A6C: .word ov10_022C4BBC -_02310A70: .word 0x0000199A -_02310A74: .word ov10_022C4FC4 -_02310A78: .word ov10_022C4A5C -_02310A7C: .word 0x00000DE6 + OV29_0230FC24_DATA_OFFSET -_02310A80: .word 0x00000DE7 + OV29_0230FC24_DATA_OFFSET -_02310A84: .word DUNGEON_PTR -_02310A88: .word 0x00000DE8 + OV29_0230FC24_DATA_OFFSET -_02310A8C: .word 0x00000DE9 + OV29_0230FC24_DATA_OFFSET -_02310A90: .word 0x00000DEA + OV29_0230FC24_DATA_OFFSET -_02310A94: .word 0x00001303 -_02310A98: .word 0x00000DBD + OV29_0230FC24_DATA_OFFSET -_02310A9C: .word ov10_022C46EC -_02310AA0: .word 0x0000025F -_02310AA4: .word ov10_022C46A0 -_02310AA8: .word SPEED_BOOST_TURNS -_02310AAC: .word BURN_DAMAGE_COOLDOWN -_02310AB0: .word BURN_DAMAGE -_02310AB4: .word 0x000003E7 -_02310AB8: .word ov10_022C4664 -_02310ABC: .word ov10_022C464C -_02310AC0: .word POISON_DAMAGE_COOLDOWN -_02310AC4: .word POISON_DAMAGE -_02310AC8: .word BAD_POISON_DAMAGE_COOLDOWN -_02310ACC: .word BAD_POISON_DAMAGE_TABLE -_02310AD0: .word ov10_022C4454 -_02310AD4: .word ov10_022C446C -_02310AD8: .word ov10_022C45F0 -_02310ADC: .word ov10_022C45D0 -_02310AE0: .word 0x0000024A -_02310AE4: .word ov10_022C45E8 -_02310AE8: .word ov10_022C4590 -_02310AEC: .word ov10_022C44BC -_02310AF0: .word LEECH_SEED_DAMAGE_COOLDOWN -_02310AF4: .word LEECH_SEED_HP_DRAIN -_02310AF8: - cmp r0, #5 - bne _02310B6C - ldrb r0, [r4, #0xcd] - cmp r0, #0 - subne r0, r0, #1 - strneb r0, [r4, #0xcd] - ldrb r0, [r4, #0xcd] - cmp r0, #0 - bne _02310B6C - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldr r1, _02310AE4 ; =ov10_022C45E8 - ldr r0, _02310AE8 ; =ov10_022C4590 - ldrsh r3, [r1] - ldrsh r2, [r0] - mov r0, r5 - mov r1, r5 - strb r3, [r4, #0xcd] - mov r6, #1 - mov r3, #0 - str r6, [sp] - bl TryIncreaseHp -_02310B6C: - ldrb r0, [r4, #0xd8] - cmp r0, #1 - bne _02310C28 - ldrb r0, [r4, #0xdc] - cmp r0, #0 - subne r0, r0, #1 - strneb r0, [r4, #0xdc] - ldrb r0, [r4, #0xdc] - cmp r0, #0 - bne _02310C0C - ldrsh r2, [r4, #0x12] - ldrsh r1, [r4, #0x16] - ldr r0, _02310AB4 ; =0x000003E7 - add r1, r2, r1 - cmp r1, r0 - movgt r1, r0 - mov r0, r1, asr #1 - add r0, r1, r0, lsr #30 - ldr r1, _02310AEC ; =ov10_022C44BC - movs r6, r0, asr #2 - ldrsh r1, [r1] - mov r0, #0 - addeq r6, r6, #1 - strb r1, [r4, #0xdc] - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - mov r0, r5 - mov r1, r5 - bl ov29_02307BDC - mov r2, #7 - mov r0, r5 - mov r1, r6 - add r3, r2, #0x244 - bl ApplyDamageAndEffectsWrapper -_02310C0C: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 -_02310C28: - ldrb r0, [r4, #0xe0] - cmp r0, #1 - bne _02310DE0 - ldrb r0, [r4, #0xea] - cmp r0, #0 - subne r0, r0, #1 - strneb r0, [r4, #0xea] - ldrb r0, [r4, #0xea] - cmp r0, #0 - bne _02310DC4 - ldr r0, _02310A84 ; =DUNGEON_PTR - ldrb r2, [r4, #0xe8] - ldr r0, [r0] - ldr r1, _02310AF0 ; =LEECH_SEED_DAMAGE_COOLDOWN - add r0, r0, r2, lsl #2 - add r0, r0, #0x12000 - ldr r7, [r0, #0xb78 + OV29_0230FC24_OFFSET_2] - ldrsh r1, [r1] - ldr r0, _02310AF4 ; =LEECH_SEED_HP_DRAIN - cmp r7, #0 - ldrsh r6, [r0] - strb r1, [r4, #0xea] - moveq r0, #0 - streqb r0, [r4, #0xe0] - beq _02310DC4 - ldr r0, [r7, #0xb4] - ldr r1, [r4, #0xe4] - ldr r0, [r0, #0xb0] - cmp r1, r0 - movne r0, #0 - strneb r0, [r4, #0xe0] - bne _02310DC4 - cmp r7, r5 - beq _02310CF0 - cmp r7, #0 - moveq r0, #0 - beq _02310CD0 - ldr r0, [r7] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff -_02310CD0: - cmp r0, #0 - beq _02310CF0 - mov r0, r7 - mov r1, #0x53 - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r8, #0 - bne _02310D00 -_02310CF0: - mov r0, r5 - mov r1, #0x3a - bl AbilityIsActiveVeneer - mov r8, r0 -_02310D00: - mov r0, r5 - bl ov29_022EC62C - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - mov r0, r7 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldrb r0, [r4, #0xc4] - cmp r0, #1 - beq _02310DC4 - mov r0, r5 - mov r1, r5 - bl ov29_02307BDC - mov r0, r5 - mov r1, r6 - mov r2, #9 - mov r3, #0x24c - bl ApplyDamageAndEffectsWrapper - cmp r8, #0 - beq _02310D94 - mov r0, r7 - mov r1, r7 - bl ov29_02307BDC - mov r2, #0xd - mov r0, r7 - mov r1, r6 - add r3, r2, #0x22c - bl ApplyDamageAndEffectsWrapper - b _02310DC4 -_02310D94: - mov r0, r5 - mov r1, #0x73 - bl AbilityIsActiveVeneer - cmp r0, #0 - bne _02310DC4 - mov r8, #1 - mov r0, r7 - mov r1, r7 - mov r2, r6 - mov r3, #0 - str r8, [sp] - bl TryIncreaseHp -_02310DC4: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 -_02310DE0: - ldrb r0, [r4, #0x106 + OV29_0230FC24_OFFSET_3] - cmp r0, #0 - beq _02310E9C - add r0, r4, #6 + OV29_0230FC24_OFFSET_3 - add r0, r0, #0x100 - bl TickStatusTurnCounter - ldrb r0, [r4, #0x106 + OV29_0230FC24_OFFSET_3] - cmp r0, #0 - bne _02310E9C - mov r0, #0 - bl DisplayActions - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - mov r1, r5 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldr r1, _02310FFC ; =0x00000DEB - mov r0, r5 - bl LogMessageByIdWithPopupCheckUser - mov r0, r5 - mov r1, r5 - bl ov29_02307BDC - ldrb r0, [r4, #0xd5] - cmp r0, #7 - bne _02310E6C - ldr r1, _02311000 ; =0x00000DEC - mov r0, r5 - bl LogMessageByIdWithPopupCheckUser - b _02310E80 -_02310E6C: - mov r2, #0xb - ldr r1, _02311004 ; =0x0000270F - mov r0, r5 - rsb r3, r2, #0x258 - bl ApplyDamageAndEffectsWrapper -_02310E80: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 -_02310E9C: - ldrb r0, [r4, #0xd2] - cmp r0, #1 - bne _02310F70 - add r0, r4, #0xd3 - bl TickStatusTurnCounter - ldrb r0, [r4, #0xd3] - cmp r0, #0 - bne _02310F70 - mov r1, #0 - mov r0, r5 - strb r1, [r4, #0xd2] - bl CheckVariousStatuses2 - cmp r0, #0 - bne _02310F70 - mov r0, r5 - mov r1, #0 - bl ov29_02300DCC - cmp r0, #0 - bne _02310F70 - mov r0, r5 - bl CheckVariousStatuses - cmp r0, #0 - bne _02310F70 - mov r0, #0 - bl DisplayActions - ldrh r0, [r4, #0xac] - cmp r0, #0 - ldreq r0, _02311008 ; =0x00000165 - streqh r0, [r4, #0xac] - ldrh r1, [r4, #0xac] - add r0, sp, #0x18 - bl InitMove - mov r1, #0 - ldrb r0, [sp, #0x18] - add r6, sp, #0x18 - mov r2, r1 - orr r0, r0, #0x10 - strb r0, [sp, #0x18] - mov r0, r5 - mov r3, r1 - stmia sp, {r1, r6} - bl ov29_02322374 - mov r1, #0 - mov r0, r5 - strh r1, [r4, #0xac] - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - mov r0, #0 - str r0, [r4, #0xb8] -_02310F70: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - ldrb r0, [r4, #0xd2] - cmp r0, #0xc - bne _02310FD0 - add r0, r4, #0xd3 - bl TickStatusTurnCounter - ldrb r0, [r4, #0xd3] - cmp r0, #0 - bne _02310FD0 - mov r0, #0 - strb r0, [r4, #0xd2] - mov r1, r5 - mov r2, r0 - strb r0, [r4, #0x154 + OV29_0230FC24_OFFSET] - bl SubstitutePlaceholderStringTags - ldr r1, _0231100C ; =0x00000CBA - mov r0, r5 - bl LogMessageByIdWithPopupCheckUser -_02310FD0: - mov r0, r5 - bl EntityIsValid__02311010 - cmp r0, #0 - beq _02310FF4 - bl IsFloorOver - cmp r0, #0 - bne _02310FF4 - mov r0, r5 - bl TickNoSlipCap -_02310FF4: - add sp, sp, #0x34 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, pc} - .align 2, 0 -_02310FFC: .word 0x00000DEB + OV29_0230FC24_DATA_OFFSET -_02311000: .word 0x00000DEC + OV29_0230FC24_DATA_OFFSET -_02311004: .word 0x0000270F -_02311008: .word 0x00000165 -_0231100C: .word 0x00000CBA + OV29_0230FC24_DATA_OFFSET - arm_func_end ov29_0230FC24 diff --git a/asm/overlay_29_0230F9A4.s b/asm/overlay_29_0230F9A4.s new file mode 100644 index 00000000..2e81daf9 --- /dev/null +++ b/asm/overlay_29_0230F9A4.s @@ -0,0 +1,1553 @@ + .include "asm/macros.inc" + .include "overlay_29_0230F9A4.inc" + + .text + + arm_func_start ov29_0230F9A4 +ov29_0230F9A4: ; 0x0230F9A4 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl IsMonster__0230F980 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldr r0, [r5, #0xb4] + ldrb r0, [r0, #6] + cmp r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + mov r0, r4 + bl ov29_0234908C + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_0230F9A4 + + arm_func_start TrySpawnEnemyItemDrop +TrySpawnEnemyItemDrop: ; 0x0230F9D8 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + sub sp, sp, #8 + ldr r2, _0230FB28 ; =DUNGEON_PTR + mov r6, r0 + ldr r0, [r2] + mov r5, r1 + ldrb r0, [r0, #0x748] + bl TreasureBoxDropsEnabled + cmp r0, #0 + ldrne r4, [r5, #0xb4] + ldrneb r0, [r4, #6] + cmpne r0, #0 + beq _0230FB20 + ldr r0, [r6] + mov r7, #0 + cmp r0, #1 + bne _0230FA54 + mov r0, r6 + mov r1, #0x43 + bl IqSkillIsEnabled + cmp r0, #0 + addne r0, r7, #1 + movne r0, r0, lsl #0x10 + movne r7, r0, asr #0x10 + mov r0, r6 + mov r1, #0x56 + bl ExclusiveItemEffectIsActive__0230F8AC + cmp r0, #0 + addne r0, r7, #1 + movne r0, r0, lsl #0x10 + movne r7, r0, asr #0x10 +_0230FA54: + ldrsh r1, [r4, #2] + add r0, sp, #0 + mov r2, r7 + bl TryGenerateUnownStoneDrop + cmp r0, #0 + beq _0230FA84 + add r2, sp, #0 + mov r0, r5 + add r1, r5, #4 + mov r3, #1 + bl SpawnDroppedItemWrapper + b _0230FB20 +_0230FA84: + mov r0, r6 + mov r1, #0x75 + bl AbilityIsActiveVeneer + mov r2, r0 + add r0, sp, #0 + mov r1, r5 + mov r3, r7 + bl ov29_023460DC + cmp r0, #0 + beq _0230FAC4 + add r2, sp, #0 + mov r0, r5 + add r1, r5, #4 + mov r3, #1 + bl SpawnDroppedItemWrapper + b _0230FB20 +_0230FAC4: + mov r0, r6 + bl IsMonster__0230F980 + cmp r0, #0 + beq _0230FB20 + mov r0, r6 + mov r1, #0x62 + bl ExclusiveItemEffectIsActive__0230F8AC + cmp r0, #0 + beq _0230FB20 + ldr r0, _0230FB2C ; =ov10_022C4650 + ldrsh r0, [r0] + bl DungeonRandOutcome__022EAB20 + cmp r0, #0 + beq _0230FB20 + add r0, sp, #0 + mov r1, #0xb7 + mov r2, #2 + bl GenerateStandardItem + add r2, sp, #0 + mov r0, r5 + add r1, r5, #4 + mov r3, #1 + bl SpawnDroppedItemWrapper +_0230FB20: + add sp, sp, #8 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_0230FB28: .word DUNGEON_PTR +_0230FB2C: .word ov10_022C4650 + arm_func_end TrySpawnEnemyItemDrop + + arm_func_start ov29_0230FB30 +ov29_0230FB30: ; 0x0230FB30 + stmdb sp!, {r3, r4, r5, lr} + ldr r1, _0230FB88 ; =ov29_023529A8 + mov r5, r0 + ldrh r2, [r1] + add r0, sp, #0 + strh r2, [sp] + ldrh r1, [r1, #2] + strh r1, [sp, #2] + bl ov29_02347184 + movs r4, r0 + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + mov r1, r4 + mov r0, #0 + bl ov29_02344B9C + ldr r1, _0230FB8C ; =0x00000F62 + mov r0, r5 + bl LogMessageByIdWithPopupCheckUser + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_0230FB88: .word ov29_023529A8 +#ifdef JAPAN +_0230FB8C: .word 0x000009B6 +#else +_0230FB8C: .word 0x00000F62 +#endif + arm_func_end ov29_0230FB30 + + arm_func_start TickNoSlipCap +TickNoSlipCap: ; 0x0230FB90 +#ifdef JAPAN +#define TICK_NO_SLIP_CAP_OFFSET -1 +#else +#define TICK_NO_SLIP_CAP_OFFSET 0 +#endif + stmdb sp!, {r3, r4, r5, lr} + mov r1, #0x6f + mov r5, r0 + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #0 + bne _0230FBB8 + mov r0, r5 + mov r1, #0xd + bl HasHeldItem +_0230FBB8: + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldr r4, [r5, #0xb4] + ldrb r0, [r4, #6] + cmp r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] + add r1, r0, #1 + and r0, r1, #0xff + cmp r0, #0x14 + strb r1, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] + movhs r0, #0x13 + strhsb r0, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] + mov r0, #0x64 + bl DungeonRandInt + ldrb r2, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] + ldr r1, _0230FC20 ; =ov10_022C4BE4 + mov r2, r2, lsl #1 + ldrsh r1, [r1, r2] + cmp r0, r1 + ldmgeia sp!, {r3, r4, r5, pc} + mov r0, r5 + bl ov29_0230FB30 + mov r0, #0 + strb r0, [r4, #0x107 + TICK_NO_SLIP_CAP_OFFSET] + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_0230FC20: .word ov10_022C4BE4 + arm_func_end TickNoSlipCap + + arm_func_start ov29_0230FC24 +ov29_0230FC24: ; 0x0230FC24 +#ifdef JAPAN +#define OV29_0230FC24_OFFSET -4 +#define OV29_0230FC24_OFFSET_2 -0xA4 +#define OV29_0230FC24_OFFSET_3 -1 +#else +#define OV29_0230FC24_OFFSET 0 +#define OV29_0230FC24_OFFSET_2 0 +#define OV29_0230FC24_OFFSET_3 0 +#endif + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, lr} + sub sp, sp, #0x34 + movs r5, r0 + beq _02310FF4 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldr r4, [r5, #0xb4] + mov r1, #0 + mov r0, r5 + strb r1, [r4, #0x150 + OV29_0230FC24_OFFSET] + bl ov29_022FB718 + bl ov29_0234B294 + mov r0, r5 + bl TryWeatherFormChange + mov r0, r5 + mov r1, #0x1d + bl ItemIsActive__02311034 + cmp r0, #0 + beq _0230FD0C + ldrb r0, [r4, #0x17c + OV29_0230FC24_OFFSET] + add r1, r0, #1 + and r0, r1, #0xff + cmp r0, #0x14 + strb r1, [r4, #0x17c + OV29_0230FC24_OFFSET] + movhs r0, #0x13 + strhsb r0, [r4, #0x17c + OV29_0230FC24_OFFSET] + mov r0, #0x64 + bl DungeonRandInt + ldrb r2, [r4, #0x17c + OV29_0230FC24_OFFSET] + ldr r1, _02310A6C ; =ov10_022C4BBC + mov r2, r2, lsl #1 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0230FD0C + mov r1, #0 + mov r0, r5 + strb r1, [r4, #0x17c + OV29_0230FC24_OFFSET] + bl ov29_022EC62C + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + mov r2, #0 + mov r0, r5 + mov r1, r5 + mov r3, r2 + bl TryWarp + mov r0, r5 + bl ov29_022F42F8 +_0230FD0C: + ldrb r0, [r4, #7] + cmp r0, #0 + beq _0231013C + mov r0, r5 + mov r1, #0x1e + mov r7, #0xa + bl ItemIsActive__02311034 + cmp r0, #0 + movne r2, r7 + moveq r2, #0 + mov r0, r5 + mov r1, #0x26 + sub r7, r7, r2 + bl ItemIsActive__02311034 + cmp r0, #0 + movne r2, #1 + moveq r2, #0 + mov r0, r5 + mov r1, #0x10 + sub r7, r7, r2 + bl IqSkillIsEnabled + cmp r0, #0 + mov r0, r5 + mov r1, #0x22 + subne r7, r7, #1 + bl ItemIsActive__02311034 + cmp r0, #0 + movne r2, #1 + moveq r2, #0 + mov r0, r5 + mov r1, #0x11 + add r7, r7, r2 + bl ItemIsActive__02311034 + cmp r0, #0 + movne r2, #1 + moveq r2, #0 + mov r0, r5 + mov r1, #0x32 + add r7, r7, r2 + bl ItemIsActive__02311034 + cmp r0, #0 + movne r2, #1 + moveq r2, #0 + mov r0, r5 + mov r1, #0x59 + add r7, r7, r2 + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + adds r7, r7, r0 + movmi r7, #0 + ldr r3, _02310A70 ; =0x0000199A + cmp r7, #0x13 + mov r6, #0 + ldr r2, _02310A74 ; =ov10_022C4FC4 + movgt r7, #0x13 + add r0, sp, #0x2c + add r1, sp, #0x24 + str r6, [sp, #0x24] + str r3, [sp, #0x28] + add r2, r2, r7, lsl #3 + bl MultiplyFixedPoint64 + ldrb r2, [r4, #0x15d + OV29_0230FC24_OFFSET] + cmp r2, #1 + ldrhi r0, _02310A78 ; =ov10_022C4A5C + ldrhi r1, [sp, #0x30] + ldrhi r0, [r0, r2, lsl #2] + addhi r0, r1, r0, lsl #16 + strhi r0, [sp, #0x30] + mov r0, #0 + strb r0, [r4, #0x15d + OV29_0230FC24_OFFSET] + add r0, r4, #0x100 + ldrh r2, [r0, #0x46 + OV29_0230FC24_OFFSET] + ldrh r1, [r0, #0x48 + OV29_0230FC24_OFFSET] + add r0, sp, #0x2c + strh r2, [sp, #0x20] + strh r1, [sp, #0x22] + bl BinToDecFixedPoint + strh r0, [sp, #0x14] + mov r0, r0, lsr #0x10 + add r1, r4, #0x100 + strh r0, [sp, #0x16] + ldrh r0, [r1, #0x46 + OV29_0230FC24_OFFSET] + sub r3, sp, #4 + ldrh r2, [sp, #0x14] + strh r0, [r3] + ldrh r0, [r1, #0x48 + OV29_0230FC24_OFFSET] + ldrh r1, [sp, #0x16] + strh r0, [r3, #2] + ldr r0, [r3] + strh r2, [r3] + strh r1, [r3, #2] + ldr r1, [r3] + bl SubFixedPoint + strh r0, [sp, #0x10] + mov r0, r0, lsr #0x10 + strh r0, [sp, #0x12] + ldrh r1, [sp, #0x10] + add r0, r4, #0x100 + ldrh r3, [sp, #0x12] + strh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] + ldrh r2, [sp, #0x20] + strh r3, [r0, #0x48 + OV29_0230FC24_OFFSET] + sub r0, sp, #4 + ldrh r1, [sp, #0x22] + strh r2, [r0] + mov r6, #0 + strh r1, [r0, #2] + ldr r0, [r0] + mov r7, #1 + bl CeilFixedPoint + cmp r0, #0x14 + blt _0230FEFC + add r0, r4, #0x100 + ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0x14 + ldrlt r6, _02310A7C ; =0x00000DE6 +_0230FEFC: + ldrh r1, [sp, #0x20] + ldrh r0, [sp, #0x22] + sub r2, sp, #4 + strh r1, [r2] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0xa + blt _0230FF48 + add r0, r4, #0x100 + ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0xa + ldrlt r6, _02310A80 ; =0x00000DE7 +_0230FF48: + add r0, r4, #0x100 + ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0 + bne _0230FF98 + mov r0, #0 + bl sub_02050FF8 + strh r0, [sp, #0xc] + mov r0, r0, lsr #0x10 + strh r0, [sp, #0xe] + ldrh r2, [sp, #0xc] + add r0, r4, #0x100 + ldrh r1, [sp, #0xe] + strh r2, [r0, #0x46 + OV29_0230FC24_OFFSET] + strh r1, [r0, #0x48 + OV29_0230FC24_OFFSET] +_0230FF98: + add r0, r4, #0x100 + ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0 + bge _0230FFE8 + mov r0, #0 + bl sub_02050FF8 + strh r0, [sp, #8] + mov r0, r0, lsr #0x10 + strh r0, [sp, #0xa] + ldrh r2, [sp, #8] + add r0, r4, #0x100 + ldrh r1, [sp, #0xa] + strh r2, [r0, #0x46 + OV29_0230FC24_OFFSET] + strh r1, [r0, #0x48 + OV29_0230FC24_OFFSET] +_0230FFE8: + add r0, r4, #0x100 + ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0 + bne _023100D8 + bl ov29_022F2FE4 + mov r0, r5 + bl ov29_022EC62C + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldr r0, _02310A84 ; =DUNGEON_PTR + ldr r1, [r0] + ldrb r0, [r1, #0x799] + cmp r0, #0xa + addlo r0, r0, #1 + strlob r0, [r1, #0x799] + ldr r0, _02310A84 ; =DUNGEON_PTR + mov r1, r5 + ldr r0, [r0] + ldrb r0, [r0, #0x799] + cmp r0, #1 + ldreq r6, _02310A88 ; =0x00000DE8 + cmp r0, #2 + ldreq r6, _02310A8C ; =0x00000DE9 + moveq r7, #0 + cmp r0, #3 + mov r0, r5 + ldreq r6, _02310A90 ; =0x00000DEA + moveq r7, #0 + bl ov29_02307BDC + mov r0, r5 + mov r1, #1 + mov r2, #0xe + mov r3, #0x250 + bl ApplyDamageAndEffectsWrapper + mov r0, #1 + strb r0, [r4, #0x150 + OV29_0230FC24_OFFSET] + add r0, r4, #0x100 + ldrh r1, [r0, #0x46 + OV29_0230FC24_OFFSET] + sub r2, sp, #4 + strh r1, [r2] + ldrh r0, [r0, #0x48 + OV29_0230FC24_OFFSET] + strh r0, [r2, #2] + ldr r0, [r2] + bl CeilFixedPoint + cmp r0, #0 + movne r6, #0 + b _023100E8 +_023100D8: + ldr r0, _02310A84 ; =DUNGEON_PTR + mov r1, #0 + ldr r0, [r0] + strb r1, [r0, #0x799] +_023100E8: + cmp r6, #0 + beq _0231013C + cmp r7, #0 + beq _02310124 +#if defined(EUROPE) + mov r0, r5 + bl ov29_022E34A8_EU +#elif defined(JAPAN) + mov r0, r5 + bl EntityIsValid__02311010 +#else + ldr r0, _02310A84 ; =DUNGEON_PTR + ldr r0, [r0] + ldrb r0, [r0, #8] + cmp r0, #0 + bne _02310124 + mov r0, r5 + bl EntityIsValid__02311010 +#endif + cmp r0, #0 + beq _02310124 + ldr r0, _02310A94 ; =0x00001303 + bl ov29_022EACCC +_02310124: + mov r0, r5 + mov r1, r6 + bl LogMessageByIdWithPopupCheckUser + mov r0, #0x1e + mov r1, #0x32 + bl ov29_022EA370 +_0231013C: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldr r0, _02310A84 ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, #0xc000 + ldrb r0, [r0, #0xd5a + OV29_0230FC24_OFFSET_2] + cmp r0, #0 + bne _0231037C + mov r0, r5 + bl GetApparentWeather + cmp r0, #5 + mov r0, r5 + bne _023101FC + mov r1, #0x77 + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _02310360 + mov r0, r5 + mov r1, #0x4d + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _02310360 + mov r0, r5 + mov r1, #6 + bl MonsterIsType + cmp r0, #0 + bne _02310360 + ldr r3, _02310A98 ; =0x00000DBD + mov r6, #9 + mov r0, r5 + mov r1, r5 + mov r2, #1 + str r6, [sp] + bl ExclusiveItemEffectIsActiveWithLogging + cmp r0, #0 + bne _02310360 + ldr r0, _02310A9C ; =ov10_022C46EC + ldr r3, _02310AA0 ; =0x0000025F + ldrsh r1, [r0] + mov r0, r5 + mov r2, #0x12 + bl ApplyDamageAndEffectsWrapper + b _02310360 +_023101FC: + bl GetApparentWeather + cmp r0, #2 + mov r0, r5 + bne _02310298 + mov r1, #0x1d + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _02310360 + mov r0, r5 + mov r1, #9 + bl MonsterIsType + cmp r0, #0 + bne _02310360 + mov r0, r5 + mov r1, #0xd + bl MonsterIsType + cmp r0, #0 + bne _02310360 + mov r0, r5 + mov r1, #0x11 + bl MonsterIsType + cmp r0, #0 + bne _02310360 + ldr r3, _02310A98 ; =0x00000DBD + mov r6, #9 + mov r0, r5 + mov r1, r5 + mov r2, #1 + str r6, [sp] + bl ExclusiveItemEffectIsActiveWithLogging + cmp r0, #0 + bne _02310360 + ldr r0, _02310A9C ; =ov10_022C46EC + ldr r3, _02310AA0 ; =0x0000025F + ldrsh r1, [r0] + mov r0, r5 + mov r2, #0x12 + bl ApplyDamageAndEffectsWrapper + b _02310360 +_02310298: + bl GetApparentWeather + cmp r0, #1 + bne _02310360 + mov r0, r5 + mov r1, #0x5a + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _02310304 + ldr r3, _02310A98 ; =0x00000DBD + mov r6, #9 + mov r0, r5 + mov r1, r5 + mov r2, #1 + str r6, [sp] + bl ExclusiveItemEffectIsActiveWithLogging + cmp r0, #0 + bne _02310360 + mov r0, #2 + mov r1, #0x5a + bl ov29_0234B084 + ldr r0, _02310A9C ; =ov10_022C46EC + mov r2, #0x19 + ldrsh r1, [r0] + mov r0, r5 + rsb r3, r2, #0x278 + bl ApplyDamageAndEffectsWrapper + b _02310360 +_02310304: + mov r0, r5 + mov r1, #0x55 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _02310360 + ldr r3, _02310A98 ; =0x00000DBD + mov r6, #9 + mov r0, r5 + mov r1, r5 + mov r2, #1 + str r6, [sp] + bl ExclusiveItemEffectIsActiveWithLogging + cmp r0, #0 + bne _02310360 + mov r0, #2 + mov r1, #0x55 + bl ov29_0234B084 + ldr r0, _02310A9C ; =ov10_022C46EC + ldr r3, _02310AA0 ; =0x0000025F + ldrsh r1, [r0] + mov r0, r5 + mov r2, #0x1a + bl ApplyDamageAndEffectsWrapper +_02310360: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 +_0231037C: + mov r0, #0x64 + bl DungeonRandInt + mov r6, r0 + mov r0, r5 + mov r1, #0x21 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _023103F8 + ldr r0, _02310AA4 ; =ov10_022C46A0 + ldrsh r0, [r0] + cmp r6, r0 + bge _023103F8 + mov r0, r5 + mov r1, #0 + bl MonsterHasNegativeStatus + cmp r0, #0 + beq _023103F8 + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + mov r0, r5 + mov r1, r5 + mov r2, #1 + mov r3, #0 + bl EndNegativeStatusConditionWrapper +_023103F8: + mov r0, r5 + mov r1, #0x51 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _02310474 + mov r0, r5 + bl GetApparentWeather + cmp r0, #4 + bne _02310474 + mov r0, r5 + mov r1, #0 + bl MonsterHasNegativeStatus + cmp r0, #0 + ldrneb r0, [r4, #0xc4] + cmpne r0, #3 + beq _02310474 + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + mov r3, #0 + mov r0, r5 + mov r1, r5 + mov r2, #1 + str r3, [sp] + bl EndNegativeStatusCondition +_02310474: + mov r0, r5 + mov r1, #0xb + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _023104C0 + ldrb r1, [r4, #0x11f + OV29_0230FC24_OFFSET] + ldr r0, _02310AA8 ; =SPEED_BOOST_TURNS + add r2, r1, #1 + ldrsh r0, [r0] + and r1, r2, #0xff + strb r2, [r4, #0x11f + OV29_0230FC24_OFFSET] + cmp r1, r0 + blt _023104C0 + mov r3, #0 + mov r0, r5 + mov r1, r5 + mov r2, #0x7f + strb r3, [r4, #0x11f + OV29_0230FC24_OFFSET] + bl BoostSpeedOneStage +_023104C0: + ldrb r0, [r4, #0xbd] + cmp r0, #4 + bne _023104F8 + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + mov r0, r5 + bl ov29_022E53F0 +_023104F8: + ldrb r0, [r4, #0xbf] + cmp r0, #1 + bne _02310590 + ldrb r0, [r4, #0xc1] + cmp r0, #0 + subne r0, r0, #1 + strneb r0, [r4, #0xc1] + ldrb r0, [r4, #0xc1] + cmp r0, #0 + bne _02310574 + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldr r1, _02310AAC ; =BURN_DAMAGE_COOLDOWN + mov r0, r5 + ldrsh r2, [r1] + mov r1, r5 + strb r2, [r4, #0xc1] + bl ov29_02307BDC + ldr r0, _02310AB0 ; =BURN_DAMAGE + mov r2, #1 + ldrsh r1, [r0] + mov r0, r5 + rsb r3, r2, #0x248 + bl ApplyDamageAndEffectsWrapper +_02310574: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 +_02310590: + bl GravityIsActive + cmp r0, #0 + beq _023105DC + mov r0, r5 + bl IsFloating + cmp r0, #0 + beq _023105C0 + mov r0, r5 + mov r1, r5 + bl EndMagnetRiseStatus + mov r0, r5 + bl EnsureCanStandCurrentTile +_023105C0: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 +_023105DC: + mov r0, r5 + mov r1, #0x69 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _02310614 + mov r0, r5 + bl TryActivateBadDreams + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 +_02310614: + mov r0, r5 + bl GetTileAtEntity + bl ov29_02337E2C + cmp r0, #0 + bne _023106A4 + ldrsh r2, [r4, #0x12] + ldrsh r1, [r4, #0x16] + ldr r0, _02310AB4 ; =0x000003E7 + add r1, r2, r1 + cmp r1, r0 + movgt r1, r0 + ldrsh r0, [r4, #0x10] + cmp r0, r1 + bge _0231067C + mov r0, r5 + mov r1, #0x64 + bl ExclusiveItemEffectIsActive__02311064 + cmp r0, #0 + beq _0231067C + ldr r0, _02310AB8 ; =ov10_022C4664 + mov r3, #0 + ldrsh r2, [r0] + mov r0, r5 + mov r1, r5 + str r3, [sp] + bl TryIncreaseHp +_0231067C: + mov r0, r5 + mov r1, #0x65 + bl ExclusiveItemEffectIsActive__02311064 + cmp r0, #0 + beq _023106A4 + mov r2, #1 + mov r0, r5 + mov r1, r5 + mov r3, r2 + bl EndNegativeStatusConditionWrapper +_023106A4: + mov r0, r5 + mov r1, #0x5c + bl ExclusiveItemEffectIsActive__02311064 + cmp r0, #0 + beq _02310754 + mov sl, #0 + ldr r6, _02310A84 ; =DUNGEON_PTR + mov sb, sl + mov r7, #1 +_023106C8: + ldr r0, [r6] + add r0, r0, sb, lsl #2 + add r0, r0, #0x12000 + ldr r8, [r0, #0xb28 + OV29_0230FC24_OFFSET_2] + mov r0, r8 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310718 + ldr r0, [r8, #0xb4] + ldrb r0, [r0, #0xbf] + add r0, r0, #0xfe + and r0, r0, #0xff + cmp r0, #1 + bhi _02310718 + mov r0, r8 + bl ov29_022E543C + mov r0, r8 + mov r1, r8 + bl EndBurnClassStatus + mov sl, r7 +_02310718: + add r0, sb, #1 + mov r0, r0, lsl #0x10 + mov sb, r0, asr #0x10 + cmp sb, #4 + blt _023106C8 + cmp sl, #0 + beq _02310754 + ldr r0, _02310ABC ; =ov10_022C464C + mov r6, #1 + ldrsh r2, [r0] + mov r0, r5 + mov r1, r5 + mov r3, #0 + str r6, [sp] + bl TryIncreaseHp +_02310754: + ldrb r0, [r4, #0xbf] + cmp r0, #2 + bne _02310830 + ldrb r0, [r4, #0xc1] + cmp r0, #0 + subne r0, r0, #1 + strneb r0, [r4, #0xc1] + ldrb r0, [r4, #0xc1] + cmp r0, #0 + bne _02310810 + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + ldreqb r0, [r4, #0xbf] + cmpeq r0, #2 + bne _02310FF4 + ldr r1, _02310AC0 ; =POISON_DAMAGE_COOLDOWN + mov r0, r5 + ldrsh r2, [r1] + mov r1, r5 + strb r2, [r4, #0xc1] + bl ov29_02307BDC + mov r0, r5 + mov r1, #0x72 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _023107F8 + ldr r0, _02310AC4 ; =POISON_DAMAGE + mov r6, #1 + ldrsh r2, [r0] + mov r0, r5 + mov r1, r5 + mov r3, #0 + str r6, [sp] + bl TryIncreaseHp + b _02310810 +_023107F8: + ldr r0, _02310AC4 ; =POISON_DAMAGE + mov r2, #3 + ldrsh r1, [r0] + mov r0, r5 + rsb r3, r2, #0x24c + bl ApplyDamageAndEffectsWrapper +_02310810: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + beq _0231092C + b _02310FF4 +_02310830: + cmp r0, #3 + bne _0231092C + ldrb r0, [r4, #0xc1] + cmp r0, #0 + subne r0, r0, #1 + strneb r0, [r4, #0xc1] + ldrb r0, [r4, #0xc1] + cmp r0, #0 + bne _02310910 + ldrb r6, [r4, #0xc2] + cmp r6, #0x1d + addlo r0, r6, #1 + strlob r0, [r4, #0xc2] + ldr r0, _02310AC8 ; =BAD_POISON_DAMAGE_COOLDOWN + cmp r6, #0x1d + ldrsh r0, [r0] + movge r6, #0x1d + cmp r6, #0 + strb r0, [r4, #0xc1] + mov r0, #0 + movlt r6, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + ldreqb r0, [r4, #0xbf] + cmpeq r0, #3 + bne _02310FF4 + mov r0, r5 + mov r1, r5 + bl ov29_02307BDC + mov r0, r5 + mov r1, #0x72 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _023108F4 + ldr r0, _02310ACC ; =BAD_POISON_DAMAGE_TABLE + mov r1, r6, lsl #1 + ldrsh r2, [r0, r1] + mov r6, #1 + mov r0, r5 + mov r1, r5 + mov r3, #0 + str r6, [sp] + bl TryIncreaseHp + b _02310910 +_023108F4: + ldr r0, _02310ACC ; =BAD_POISON_DAMAGE_TABLE + mov r1, r6, lsl #1 + ldrsh r1, [r0, r1] + mov r2, #3 + mov r0, r5 + rsb r3, r2, #0x24c + bl ApplyDamageAndEffectsWrapper +_02310910: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 +_0231092C: + ldrb r0, [r4, #0xc4] + cmp r0, #7 + bne _023109D4 + ldrb r0, [r4, #0xcd] + cmp r0, #0 + subne r0, r0, #1 + strneb r0, [r4, #0xcd] + ldrb r0, [r4, #0xcd] + cmp r0, #0 + bne _023109B4 + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldr r1, _02310AD0 ; =ov10_022C4454 + mov r0, r5 + ldrsh r2, [r1] + mov r1, r5 + strb r2, [r4, #0xcd] + bl ov29_02307BDC + ldr r1, [r4, #0xc8] + mov r0, r5 + bl ov29_022E42E8 + ldr r1, _02310AD4 ; =ov10_022C446C + mov r0, r5 + ldrsh r1, [r1] + mov r2, #2 + mov r3, #0x248 + bl ApplyDamageAndEffectsWrapper +_023109B4: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + beq _02310B6C + b _02310FF4 +_023109D4: + cmp r0, #4 + bne _02310AF8 + ldrb r0, [r4, #0xcd] + cmp r0, #0 + subne r0, r0, #1 + strneb r0, [r4, #0xcd] + ldrb r0, [r4, #0xcd] + cmp r0, #0 + bne _02310A4C + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldr r1, _02310AD8 ; =ov10_022C45F0 + mov r0, r5 + ldrsh r2, [r1] + mov r1, r5 + strb r2, [r4, #0xcd] + bl ov29_02307BDC + ldr r0, _02310ADC ; =ov10_022C45D0 + ldr r3, _02310AE0 ; =0x0000024A + ldrsh r1, [r0] + mov r0, r5 + mov r2, #5 + bl ApplyDamageAndEffectsWrapper +_02310A4C: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + beq _02310B6C + b _02310FF4 + .align 2, 0 +#ifdef JAPAN +#define OV29_0230FC24_DATA_OFFSET -0x2C0 +#else +#define OV29_0230FC24_DATA_OFFSET 0 +#endif +_02310A6C: .word ov10_022C4BBC +_02310A70: .word 0x0000199A +_02310A74: .word ov10_022C4FC4 +_02310A78: .word ov10_022C4A5C +_02310A7C: .word 0x00000DE6 + OV29_0230FC24_DATA_OFFSET +_02310A80: .word 0x00000DE7 + OV29_0230FC24_DATA_OFFSET +_02310A84: .word DUNGEON_PTR +_02310A88: .word 0x00000DE8 + OV29_0230FC24_DATA_OFFSET +_02310A8C: .word 0x00000DE9 + OV29_0230FC24_DATA_OFFSET +_02310A90: .word 0x00000DEA + OV29_0230FC24_DATA_OFFSET +_02310A94: .word 0x00001303 +_02310A98: .word 0x00000DBD + OV29_0230FC24_DATA_OFFSET +_02310A9C: .word ov10_022C46EC +_02310AA0: .word 0x0000025F +_02310AA4: .word ov10_022C46A0 +_02310AA8: .word SPEED_BOOST_TURNS +_02310AAC: .word BURN_DAMAGE_COOLDOWN +_02310AB0: .word BURN_DAMAGE +_02310AB4: .word 0x000003E7 +_02310AB8: .word ov10_022C4664 +_02310ABC: .word ov10_022C464C +_02310AC0: .word POISON_DAMAGE_COOLDOWN +_02310AC4: .word POISON_DAMAGE +_02310AC8: .word BAD_POISON_DAMAGE_COOLDOWN +_02310ACC: .word BAD_POISON_DAMAGE_TABLE +_02310AD0: .word ov10_022C4454 +_02310AD4: .word ov10_022C446C +_02310AD8: .word ov10_022C45F0 +_02310ADC: .word ov10_022C45D0 +_02310AE0: .word 0x0000024A +_02310AE4: .word ov10_022C45E8 +_02310AE8: .word ov10_022C4590 +_02310AEC: .word ov10_022C44BC +_02310AF0: .word LEECH_SEED_DAMAGE_COOLDOWN +_02310AF4: .word LEECH_SEED_HP_DRAIN +_02310AF8: + cmp r0, #5 + bne _02310B6C + ldrb r0, [r4, #0xcd] + cmp r0, #0 + subne r0, r0, #1 + strneb r0, [r4, #0xcd] + ldrb r0, [r4, #0xcd] + cmp r0, #0 + bne _02310B6C + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldr r1, _02310AE4 ; =ov10_022C45E8 + ldr r0, _02310AE8 ; =ov10_022C4590 + ldrsh r3, [r1] + ldrsh r2, [r0] + mov r0, r5 + mov r1, r5 + strb r3, [r4, #0xcd] + mov r6, #1 + mov r3, #0 + str r6, [sp] + bl TryIncreaseHp +_02310B6C: + ldrb r0, [r4, #0xd8] + cmp r0, #1 + bne _02310C28 + ldrb r0, [r4, #0xdc] + cmp r0, #0 + subne r0, r0, #1 + strneb r0, [r4, #0xdc] + ldrb r0, [r4, #0xdc] + cmp r0, #0 + bne _02310C0C + ldrsh r2, [r4, #0x12] + ldrsh r1, [r4, #0x16] + ldr r0, _02310AB4 ; =0x000003E7 + add r1, r2, r1 + cmp r1, r0 + movgt r1, r0 + mov r0, r1, asr #1 + add r0, r1, r0, lsr #30 + ldr r1, _02310AEC ; =ov10_022C44BC + movs r6, r0, asr #2 + ldrsh r1, [r1] + mov r0, #0 + addeq r6, r6, #1 + strb r1, [r4, #0xdc] + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + mov r0, r5 + mov r1, r5 + bl ov29_02307BDC + mov r2, #7 + mov r0, r5 + mov r1, r6 + add r3, r2, #0x244 + bl ApplyDamageAndEffectsWrapper +_02310C0C: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 +_02310C28: + ldrb r0, [r4, #0xe0] + cmp r0, #1 + bne _02310DE0 + ldrb r0, [r4, #0xea] + cmp r0, #0 + subne r0, r0, #1 + strneb r0, [r4, #0xea] + ldrb r0, [r4, #0xea] + cmp r0, #0 + bne _02310DC4 + ldr r0, _02310A84 ; =DUNGEON_PTR + ldrb r2, [r4, #0xe8] + ldr r0, [r0] + ldr r1, _02310AF0 ; =LEECH_SEED_DAMAGE_COOLDOWN + add r0, r0, r2, lsl #2 + add r0, r0, #0x12000 + ldr r7, [r0, #0xb78 + OV29_0230FC24_OFFSET_2] + ldrsh r1, [r1] + ldr r0, _02310AF4 ; =LEECH_SEED_HP_DRAIN + cmp r7, #0 + ldrsh r6, [r0] + strb r1, [r4, #0xea] + moveq r0, #0 + streqb r0, [r4, #0xe0] + beq _02310DC4 + ldr r0, [r7, #0xb4] + ldr r1, [r4, #0xe4] + ldr r0, [r0, #0xb0] + cmp r1, r0 + movne r0, #0 + strneb r0, [r4, #0xe0] + bne _02310DC4 + cmp r7, r5 + beq _02310CF0 + cmp r7, #0 + moveq r0, #0 + beq _02310CD0 + ldr r0, [r7] + cmp r0, #1 + moveq r0, #1 + movne r0, #0 + and r0, r0, #0xff +_02310CD0: + cmp r0, #0 + beq _02310CF0 + mov r0, r7 + mov r1, #0x53 + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r8, #0 + bne _02310D00 +_02310CF0: + mov r0, r5 + mov r1, #0x3a + bl AbilityIsActiveVeneer + mov r8, r0 +_02310D00: + mov r0, r5 + bl ov29_022EC62C + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + mov r0, r7 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldrb r0, [r4, #0xc4] + cmp r0, #1 + beq _02310DC4 + mov r0, r5 + mov r1, r5 + bl ov29_02307BDC + mov r0, r5 + mov r1, r6 + mov r2, #9 + mov r3, #0x24c + bl ApplyDamageAndEffectsWrapper + cmp r8, #0 + beq _02310D94 + mov r0, r7 + mov r1, r7 + bl ov29_02307BDC + mov r2, #0xd + mov r0, r7 + mov r1, r6 + add r3, r2, #0x22c + bl ApplyDamageAndEffectsWrapper + b _02310DC4 +_02310D94: + mov r0, r5 + mov r1, #0x73 + bl AbilityIsActiveVeneer + cmp r0, #0 + bne _02310DC4 + mov r8, #1 + mov r0, r7 + mov r1, r7 + mov r2, r6 + mov r3, #0 + str r8, [sp] + bl TryIncreaseHp +_02310DC4: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 +_02310DE0: + ldrb r0, [r4, #0x106 + OV29_0230FC24_OFFSET_3] + cmp r0, #0 + beq _02310E9C + add r0, r4, #6 + OV29_0230FC24_OFFSET_3 + add r0, r0, #0x100 + bl TickStatusTurnCounter + ldrb r0, [r4, #0x106 + OV29_0230FC24_OFFSET_3] + cmp r0, #0 + bne _02310E9C + mov r0, #0 + bl DisplayActions + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + mov r1, r5 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldr r1, _02310FFC ; =0x00000DEB + mov r0, r5 + bl LogMessageByIdWithPopupCheckUser + mov r0, r5 + mov r1, r5 + bl ov29_02307BDC + ldrb r0, [r4, #0xd5] + cmp r0, #7 + bne _02310E6C + ldr r1, _02311000 ; =0x00000DEC + mov r0, r5 + bl LogMessageByIdWithPopupCheckUser + b _02310E80 +_02310E6C: + mov r2, #0xb + ldr r1, _02311004 ; =0x0000270F + mov r0, r5 + rsb r3, r2, #0x258 + bl ApplyDamageAndEffectsWrapper +_02310E80: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 +_02310E9C: + ldrb r0, [r4, #0xd2] + cmp r0, #1 + bne _02310F70 + add r0, r4, #0xd3 + bl TickStatusTurnCounter + ldrb r0, [r4, #0xd3] + cmp r0, #0 + bne _02310F70 + mov r1, #0 + mov r0, r5 + strb r1, [r4, #0xd2] + bl CheckVariousStatuses2 + cmp r0, #0 + bne _02310F70 + mov r0, r5 + mov r1, #0 + bl ov29_02300DCC + cmp r0, #0 + bne _02310F70 + mov r0, r5 + bl CheckVariousStatuses + cmp r0, #0 + bne _02310F70 + mov r0, #0 + bl DisplayActions + ldrh r0, [r4, #0xac] + cmp r0, #0 + ldreq r0, _02311008 ; =0x00000165 + streqh r0, [r4, #0xac] + ldrh r1, [r4, #0xac] + add r0, sp, #0x18 + bl InitMove + mov r1, #0 + ldrb r0, [sp, #0x18] + add r6, sp, #0x18 + mov r2, r1 + orr r0, r0, #0x10 + strb r0, [sp, #0x18] + mov r0, r5 + mov r3, r1 + stmia sp, {r1, r6} + bl ov29_02322374 + mov r1, #0 + mov r0, r5 + strh r1, [r4, #0xac] + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + mov r0, #0 + str r0, [r4, #0xb8] +_02310F70: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + ldrb r0, [r4, #0xd2] + cmp r0, #0xc + bne _02310FD0 + add r0, r4, #0xd3 + bl TickStatusTurnCounter + ldrb r0, [r4, #0xd3] + cmp r0, #0 + bne _02310FD0 + mov r0, #0 + strb r0, [r4, #0xd2] + mov r1, r5 + mov r2, r0 + strb r0, [r4, #0x154 + OV29_0230FC24_OFFSET] + bl SubstitutePlaceholderStringTags + ldr r1, _0231100C ; =0x00000CBA + mov r0, r5 + bl LogMessageByIdWithPopupCheckUser +_02310FD0: + mov r0, r5 + bl EntityIsValid__02311010 + cmp r0, #0 + beq _02310FF4 + bl IsFloorOver + cmp r0, #0 + bne _02310FF4 + mov r0, r5 + bl TickNoSlipCap +_02310FF4: + add sp, sp, #0x34 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, pc} + .align 2, 0 +_02310FFC: .word 0x00000DEB + OV29_0230FC24_DATA_OFFSET +_02311000: .word 0x00000DEC + OV29_0230FC24_DATA_OFFSET +_02311004: .word 0x0000270F +_02311008: .word 0x00000165 +_0231100C: .word 0x00000CBA + OV29_0230FC24_DATA_OFFSET + arm_func_end ov29_0230FC24 diff --git a/asm/overlay_29_0231513C.s b/asm/overlay_29_0231513C.s index dad157ed..24b53be2 100644 --- a/asm/overlay_29_0231513C.s +++ b/asm/overlay_29_0231513C.s @@ -4476,228 +4476,3 @@ ov29_02318A90: ; 0x02318A90 #endif ldmia sp!, {r3, r4, r5, pc} arm_func_end ov29_02318A90 - - arm_func_start IsMonster__02318AB0 -IsMonster__02318AB0: ; 0x02318AB0 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__02318AB0 - - arm_func_start ov29_02318AD4 -ov29_02318AD4: ; 0x02318AD4 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - mov r4, r0 - mov r8, #1 - bl IsMonster__02318AB0 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov sb, #0 - ldr r7, [r4, #0xb4] - mov r5, sb - mov r6, r8 - mov r4, #0x53 - b _02318B3C -_02318B04: -#ifdef JAPAN - ldrb r0, [r7, #0x10a] - cmp r0, #1 - bne _02318B20 - ldr r0, [r7, #0x184] -#else - ldrb r0, [r7, #0x10b] - cmp r0, #1 - bne _02318B20 - ldr r0, [r7, #0x188] -#endif - cmp r0, #0xc800 - movge r8, r6 - movlt r8, r5 -_02318B20: - cmp r8, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov r0, r4 - bl AdvanceFrame - add r0, sb, #1 - mov r0, r0, lsl #0x10 - mov sb, r0, asr #0x10 -_02318B3C: - cmp sb, #0x190 - blt _02318B04 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - arm_func_end ov29_02318AD4 - - arm_func_start ov29_02318B48 -ov29_02318B48: ; 0x02318B48 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - mov r4, r0 - mov r8, #1 - bl IsMonster__02318AB0 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov sb, #0 - ldr r7, [r4, #0xb4] - mov r5, sb - mov r6, r8 - mov r4, #0x53 - b _02318BB0 -_02318B78: -#ifdef JAPAN - ldrb r0, [r7, #0x10a] - cmp r0, #0 - bne _02318B94 - ldr r0, [r7, #0x184] -#else - ldrb r0, [r7, #0x10b] - cmp r0, #0 - bne _02318B94 - ldr r0, [r7, #0x188] -#endif - cmp r0, #0 - movle r8, r6 - movgt r8, r5 -_02318B94: - cmp r8, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov r0, r4 - bl AdvanceFrame - add r0, sb, #1 - mov r0, r0, lsl #0x10 - mov sb, r0, asr #0x10 -_02318BB0: - cmp sb, #0x190 - blt _02318B78 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - arm_func_end ov29_02318B48 - - arm_func_start ov29_02318BBC -ov29_02318BBC: ; 0x02318BBC - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - mov r8, r1 - mov sb, r0 - mov r0, r8 - mov r7, r2 - mov r6, r3 - bl EntityIsValid__02318D34 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - mov r0, #0 - ldr r5, [r8, #0xb4] - mov r1, r8 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r5, #0xd2] - cmp r0, r7 - cmpeq r7, #0xc - bne _02318C18 - ldr r2, _02318D20 ; =0x00000D7A - mov r0, sb - mov r1, r8 - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} -_02318C18: - strb r7, [r5, #0xd2] - mov r2, #0 -#ifdef JAPAN - add r0, r5, #0x120 -#else - add r0, r5, #0x124 -#endif - b _02318C3C -_02318C28: - add r1, r0, r2, lsl #3 - cmp r1, r6 - streqb r2, [r5, #0xd4] - beq _02318C44 - add r2, r2, #1 -_02318C3C: - cmp r2, #4 - blt _02318C28 -_02318C44: - add r0, r7, #0xf9 - mov r1, #1 - and r0, r0, #0xff -#ifdef JAPAN - strb r1, [r5, #0x150] -#else - strb r1, [r5, #0x154] -#endif - cmp r0, #1 - mov r4, #0 - movls r4, r1 -#ifdef JAPAN - strlsb r1, [r5, #0x10a] -#else - strlsb r1, [r5, #0x10b] -#endif - bls _02318C7C - cmp r7, #9 - cmpne r7, #0xa - cmpne r7, #0xd - moveq r0, #2 -#ifdef JAPAN - streqb r0, [r5, #0x10a] -#else - streqb r0, [r5, #0x10b] -#endif -_02318C7C: - cmp r7, #1 - bne _02318CD0 - ldr r1, _02318D24 ; =ov10_022C4754 - mov r0, r8 - mov r2, #0 - bl CalcStatusDuration - add r0, r0, #1 - strb r0, [r5, #0xd3] - mov r0, #0 - str r0, [r5, #0xb8] - ldrh r1, [r6, #4] - cmp r1, #0x154 - ldreq r0, _02318D28 ; =0x00000166 - streqh r0, [r5, #0xac] - beq _02318CD0 - ldr r0, _02318D2C ; =0x00000217 - cmp r1, r0 - subeq r0, r0, #0xb0 - streqh r0, [r5, #0xac] - subne r0, r0, #0xb2 - strneh r0, [r5, #0xac] -_02318CD0: - cmp r7, #0xc - bne _02318CF0 - ldr r1, _02318D30 ; =ov10_022C475C - mov r0, r8 - mov r2, #0 - bl CalcStatusDuration - add r0, r0, #1 - strb r0, [r5, #0xd3] -_02318CF0: - mov r0, r8 - mov r1, r4 - bl ov29_022E41B0 - ldr r2, [sp, #0x20] - mov r0, sb - mov r1, r8 - bl LogMessageWithPopupCheckUserTarget - mov r0, r8 - bl UpdateStatusIconFlags - mov r0, r8 - bl ov29_02318AD4 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - .align 2, 0 -#ifdef JAPAN -_02318D20: .word 0x00000ABA -#else -_02318D20: .word 0x00000D7A -#endif -_02318D24: .word ov10_022C4754 -_02318D28: .word 0x00000166 -_02318D2C: .word 0x00000217 -_02318D30: .word ov10_022C475C - arm_func_end ov29_02318BBC diff --git a/asm/overlay_29_02318AD4.s b/asm/overlay_29_02318AD4.s new file mode 100644 index 00000000..56eb01bd --- /dev/null +++ b/asm/overlay_29_02318AD4.s @@ -0,0 +1,216 @@ + .include "asm/macros.inc" + .include "overlay_29_02318AD4.inc" + + .text + + arm_func_start ov29_02318AD4 +ov29_02318AD4: ; 0x02318AD4 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + mov r4, r0 + mov r8, #1 + bl IsMonster__02318AB0 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov sb, #0 + ldr r7, [r4, #0xb4] + mov r5, sb + mov r6, r8 + mov r4, #0x53 + b _02318B3C +_02318B04: +#ifdef JAPAN + ldrb r0, [r7, #0x10a] + cmp r0, #1 + bne _02318B20 + ldr r0, [r7, #0x184] +#else + ldrb r0, [r7, #0x10b] + cmp r0, #1 + bne _02318B20 + ldr r0, [r7, #0x188] +#endif + cmp r0, #0xc800 + movge r8, r6 + movlt r8, r5 +_02318B20: + cmp r8, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov r0, r4 + bl AdvanceFrame + add r0, sb, #1 + mov r0, r0, lsl #0x10 + mov sb, r0, asr #0x10 +_02318B3C: + cmp sb, #0x190 + blt _02318B04 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + arm_func_end ov29_02318AD4 + + arm_func_start ov29_02318B48 +ov29_02318B48: ; 0x02318B48 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + mov r4, r0 + mov r8, #1 + bl IsMonster__02318AB0 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov sb, #0 + ldr r7, [r4, #0xb4] + mov r5, sb + mov r6, r8 + mov r4, #0x53 + b _02318BB0 +_02318B78: +#ifdef JAPAN + ldrb r0, [r7, #0x10a] + cmp r0, #0 + bne _02318B94 + ldr r0, [r7, #0x184] +#else + ldrb r0, [r7, #0x10b] + cmp r0, #0 + bne _02318B94 + ldr r0, [r7, #0x188] +#endif + cmp r0, #0 + movle r8, r6 + movgt r8, r5 +_02318B94: + cmp r8, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov r0, r4 + bl AdvanceFrame + add r0, sb, #1 + mov r0, r0, lsl #0x10 + mov sb, r0, asr #0x10 +_02318BB0: + cmp sb, #0x190 + blt _02318B78 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + arm_func_end ov29_02318B48 + + arm_func_start ov29_02318BBC +ov29_02318BBC: ; 0x02318BBC + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + mov r8, r1 + mov sb, r0 + mov r0, r8 + mov r7, r2 + mov r6, r3 + bl EntityIsValid__02318D34 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + mov r0, #0 + ldr r5, [r8, #0xb4] + mov r1, r8 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r5, #0xd2] + cmp r0, r7 + cmpeq r7, #0xc + bne _02318C18 + ldr r2, _02318D20 ; =0x00000D7A + mov r0, sb + mov r1, r8 + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} +_02318C18: + strb r7, [r5, #0xd2] + mov r2, #0 +#ifdef JAPAN + add r0, r5, #0x120 +#else + add r0, r5, #0x124 +#endif + b _02318C3C +_02318C28: + add r1, r0, r2, lsl #3 + cmp r1, r6 + streqb r2, [r5, #0xd4] + beq _02318C44 + add r2, r2, #1 +_02318C3C: + cmp r2, #4 + blt _02318C28 +_02318C44: + add r0, r7, #0xf9 + mov r1, #1 + and r0, r0, #0xff +#ifdef JAPAN + strb r1, [r5, #0x150] +#else + strb r1, [r5, #0x154] +#endif + cmp r0, #1 + mov r4, #0 + movls r4, r1 +#ifdef JAPAN + strlsb r1, [r5, #0x10a] +#else + strlsb r1, [r5, #0x10b] +#endif + bls _02318C7C + cmp r7, #9 + cmpne r7, #0xa + cmpne r7, #0xd + moveq r0, #2 +#ifdef JAPAN + streqb r0, [r5, #0x10a] +#else + streqb r0, [r5, #0x10b] +#endif +_02318C7C: + cmp r7, #1 + bne _02318CD0 + ldr r1, _02318D24 ; =ov10_022C4754 + mov r0, r8 + mov r2, #0 + bl CalcStatusDuration + add r0, r0, #1 + strb r0, [r5, #0xd3] + mov r0, #0 + str r0, [r5, #0xb8] + ldrh r1, [r6, #4] + cmp r1, #0x154 + ldreq r0, _02318D28 ; =0x00000166 + streqh r0, [r5, #0xac] + beq _02318CD0 + ldr r0, _02318D2C ; =0x00000217 + cmp r1, r0 + subeq r0, r0, #0xb0 + streqh r0, [r5, #0xac] + subne r0, r0, #0xb2 + strneh r0, [r5, #0xac] +_02318CD0: + cmp r7, #0xc + bne _02318CF0 + ldr r1, _02318D30 ; =ov10_022C475C + mov r0, r8 + mov r2, #0 + bl CalcStatusDuration + add r0, r0, #1 + strb r0, [r5, #0xd3] +_02318CF0: + mov r0, r8 + mov r1, r4 + bl ov29_022E41B0 + ldr r2, [sp, #0x20] + mov r0, sb + mov r1, r8 + bl LogMessageWithPopupCheckUserTarget + mov r0, r8 + bl UpdateStatusIconFlags + mov r0, r8 + bl ov29_02318AD4 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + .align 2, 0 +#ifdef JAPAN +_02318D20: .word 0x00000ABA +#else +_02318D20: .word 0x00000D7A +#endif +_02318D24: .word ov10_022C4754 +_02318D28: .word 0x00000166 +_02318D2C: .word 0x00000217 +_02318D30: .word ov10_022C475C + arm_func_end ov29_02318BBC diff --git a/asm/overlay_29_02319FB0.s b/asm/overlay_29_02319FB0.s index eb4c1cd3..498ddf8d 100644 --- a/asm/overlay_29_02319FB0.s +++ b/asm/overlay_29_02319FB0.s @@ -767,640 +767,3 @@ _0231A9D0: .word 0x00000B3D _0231A9D0: .word 0x00000DFD #endif arm_func_end ov29_0231A8A0 - - arm_func_start IsMonster__0231A9D4 -IsMonster__0231A9D4: ; 0x0231A9D4 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__0231A9D4 - - arm_func_start ov29_0231A9F8 -ov29_0231A9F8: ; 0x0231A9F8 - stmdb sp!, {r4, r5, r6, r7, lr} - sub sp, sp, #0x34 - mov r7, r0 - mov r1, #0 - mov r2, #0x15 - ldr r5, [r7, #0xb4] - bl GetItemToUse - mov r1, r0 - ldrb r0, [r1] - ldrh r4, [r1] - ldrh r3, [r1, #2] - ldrh r2, [r1, #4] - tst r0, #8 - movne r0, #1 - moveq r0, #0 - strh r4, [sp, #0x18] - strh r3, [sp, #0x1a] - strh r2, [sp, #0x1c] - tst r0, #0xff - beq _0231AA60 - mov r0, #0 - bl ov29_02344B44 - ldr r1, _0231AC90 ; =0x00000DF8 - mov r0, r7 - bl LogMessageByIdWithPopupCheckUser - b _0231AC88 -_0231AA60: - mov r0, r7 - bl ov29_022FBAB4 - add r2, sp, #0x1e - add r3, r5, #0x4a - mov r1, #0xa -_0231AA74: - ldrh r0, [r3], #2 - subs r1, r1, #1 - strh r0, [r2], #2 - bne _0231AA74 - ldr r0, _0231AC94 ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, #0x4000 -#ifdef JAPAN - ldrb r0, [r0, #0x36] -#else - ldrb r0, [r0, #0xda] -#endif - bl AreOrbsAllowed - cmp r0, #0 - mov r4, #1 - bne _0231AAB4 - ldr r1, _0231AC98 ; =0x00000DF9 - mov r0, r7 - bl LogMessageByIdWithPopupCheckUser - b _0231AC24 -_0231AAB4: - ldrsh r6, [sp, #0x1c] - mov r0, r6 - bl GetItemMoveId16 - mov r1, r0 - add r0, sp, #0x10 - bl InitMove - ldrb r0, [r5, #7] - cmp r0, #0 - bne _0231AB18 - mov r2, r4 - mov r3, #0xa - strb r2, [sp, #8] - add r0, sp, #8 - mov r1, r7 -#ifdef JAPAN - add r2, r5, #0x120 -#else - add r2, r5, #0x124 -#endif - str r3, [sp, #0xc] - bl AiConsiderMove - ldrb r0, [sp, #8] - cmp r0, #0 - beq _0231AB18 - ldrb r1, [sp, #9] - mov r0, r7 - and r1, r1, #7 - strb r1, [r5, #0x4c] - bl UpdateAiTargetPos -_0231AB18: - ldrb r0, [r5, #0xd0] - cmp r0, #1 - bne _0231AB48 - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r1, _0231AC9C ; =0x00000DFA - mov r0, r7 - bl LogMessageByIdWithPopupCheckUser - mov r4, #0 - b _0231ABA0 -_0231AB48: - cmp r0, #7 - bne _0231AB74 - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r1, _0231ACA0 ; =0x00000DFB - mov r0, r7 - bl LogMessageByIdWithPopupCheckUser - mov r4, #0 - b _0231ABA0 -_0231AB74: - ldrb r0, [r5, #0xbf] - cmp r0, #4 - bne _0231ABA0 - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r1, _0231ACA4 ; =0x00000DFC - mov r0, r7 - bl LogMessageByIdWithPopupCheckUser - mov r4, #0 -_0231ABA0: - cmp r4, #0 - beq _0231AC20 - cmp r6, #0x138 - ldrne r0, _0231ACA8 ; =0x00000141 - mov r1, #0 - cmpne r6, r0 - bne _0231AC00 - mov r0, r7 - mov r2, #0x7a - bl RemoveUsedItem - ldrb r2, [sp, #0x10] - mov r0, #0xa - mov r1, #0 - orr r2, r2, #0xc - strb r2, [sp, #0x10] - strb r0, [sp, #0x16] - add r4, sp, #0x10 - mov r0, r7 - mov r2, r6 - mov r3, r1 - stmia sp, {r1, r4} - bl ov29_02322374 - mov r4, #0 - b _0231AC24 -_0231AC00: - add r4, sp, #0x10 - mov r0, r7 - mov r2, r6 - mov r3, r1 - stmia sp, {r1, r4} - bl ov29_02322374 - mov r4, r0 - b _0231AC24 -_0231AC20: - mov r4, #0 -_0231AC24: - mov r0, r7 - bl EntityIsValid__02319F8C - cmp r0, #0 - beq _0231AC60 - cmp r4, #0 - beq _0231AC4C - mov r0, r7 - mov r1, #0 - mov r2, #0x7a - bl RemoveUsedItem -_0231AC4C: - mov r0, r7 - bl EnemyEvolution - mov r0, r7 - bl ov29_02321274 - b _0231AC74 -_0231AC60: - cmp r4, #0 - beq _0231AC74 - add r0, sp, #0x1e - mov r1, #0 - bl ov29_022EB4E8 -_0231AC74: - bl IsFloorOver - cmp r0, #0 - bne _0231AC88 - mov r0, r7 - bl TryActivateTruant -_0231AC88: - add sp, sp, #0x34 - ldmia sp!, {r4, r5, r6, r7, pc} - .align 2, 0 -#ifdef JAPAN -#define OV29_0231A9F8_OFFSET -0x2C0 -#else -#define OV29_0231A9F8_OFFSET 0 -#endif -_0231AC90: .word 0x00000DF8 + OV29_0231A9F8_OFFSET -_0231AC94: .word DUNGEON_PTR -_0231AC98: .word 0x00000DF9 + OV29_0231A9F8_OFFSET -_0231AC9C: .word 0x00000DFA + OV29_0231A9F8_OFFSET -_0231ACA0: .word 0x00000DFB + OV29_0231A9F8_OFFSET -_0231ACA4: .word 0x00000DFC + OV29_0231A9F8_OFFSET -_0231ACA8: .word 0x00000141 - arm_func_end ov29_0231A9F8 - - arm_func_start GetEntityMoveTargetAndRange -GetEntityMoveTargetAndRange: ; 0x0231ACAC - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - ldrh r1, [r5, #4] - mov r4, r2 - mov r6, r0 - cmp r1, #0xed - cmpeq r4, #0 - bne _0231ACE0 - mov r1, #0xe - bl MonsterIsType - cmp r0, #0 - moveq r0, #0x73 - ldmeqia sp!, {r4, r5, r6, pc} -_0231ACE0: - mov r0, r5 - mov r1, r4 - bl GetMoveTargetAndRange - mov r4, r0 - mov r0, r5 - bl IsMoveRangeString19 - cmp r0, #0 - beq _0231AD2C - mov r0, r6 - mov r1, #0x55 - bl ExclusiveItemEffectIsActive__0231A87C - cmp r0, #0 - beq _0231AD2C - ldr r0, _0231AD34 ; =0x00000273 - cmp r4, r0 - subeq r4, r0, #0x12 - beq _0231AD2C - cmp r4, #0x73 - moveq r4, #0x61 -_0231AD2C: - mov r0, r4 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_0231AD34: .word 0x00000273 - arm_func_end GetEntityMoveTargetAndRange - - arm_func_start ov29_0231AD38 -ov29_0231AD38: ; 0x0231AD38 - stmdb sp!, {r4, r5, r6, lr} - mov r6, r0 - mov r5, r1 - mov r2, #1 - bl GetEntityMoveTargetAndRange - and r4, r0, #0xf - mov r0, r6 - mov r1, r5 - mov r2, #0 - bl GetEntityMoveTargetAndRange - cmp r4, #3 - and r0, r0, #0xf - cmpne r4, #1 - cmpne r0, #4 - cmpne r0, #3 - cmpne r0, #1 - cmpne r0, #6 - beq _0231ADA0 - mov r0, r6 - mov r1, r5 - mov r2, #0 - bl GetEntityMoveTargetAndRange - and r0, r0, #0xf0 - cmp r0, #0x70 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, pc} -_0231ADA0: - mov r0, #1 - ldmia sp!, {r4, r5, r6, pc} - arm_func_end ov29_0231AD38 - - arm_func_start ov29_0231ADA8 -ov29_0231ADA8: ; 0x0231ADA8 - stmdb sp!, {r3, r4, r5, lr} - sub sp, sp, #8 - ldr r1, [r0, #0xb4] - mov r0, #0 - mov r5, r0 -#ifdef JAPAN - add r4, r1, #0x120 -#else - add r4, r1, #0x124 -#endif - mov ip, r0 - mov lr, #1 - add r2, sp, #0 -_0231ADCC: - ldrb r1, [r4, r5, lsl #3] - add r3, r4, r5, lsl #3 - tst r1, #1 - movne r1, lr - moveq r1, ip - tst r1, #0xff - beq _0231AE00 - ldrh r3, [r3, #4] - add r1, r0, #1 - mov r0, r0, lsl #1 - mov r1, r1, lsl #0x10 - strh r3, [r2, r0] - mov r0, r1, lsr #0x10 -_0231AE00: - add r1, r5, #1 - mov r1, r1, lsl #0x10 - mov r5, r1, lsr #0x10 - cmp r5, #4 - blo _0231ADCC - cmp r0, #0 - moveq r0, #0 - beq _0231AE34 - bl DungeonRandInt - mov r0, r0, lsl #0x10 - add r1, sp, #0 - mov r0, r0, lsr #0xf - ldrh r0, [r1, r0] -_0231AE34: - add sp, sp, #8 - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_0231ADA8 - - arm_func_start ov29_0231AE3C -ov29_0231AE3C: ; 0x0231AE3C - stmdb sp!, {r3, lr} - ldr ip, [r0, #0xb4] - mov r0, #0 - mov lr, r0 - mov r2, r0 - mov r3, #1 -_0231AE54: - add r1, ip, lr, lsl #3 -#ifdef JAPAN - ldrb r1, [r1, #0x120] -#else - ldrb r1, [r1, #0x124] -#endif - tst r1, #1 - movne r1, r3 - moveq r1, r2 - tst r1, #0xff - add r1, lr, #1 - addne r0, r0, #1 - mov r1, r1, lsl #0x10 - movne r0, r0, lsl #0x10 - mov lr, r1, lsr #0x10 - movne r0, r0, lsr #0x10 - cmp lr, #4 - blo _0231AE54 - ldmia sp!, {r3, pc} - arm_func_end ov29_0231AE3C - - arm_func_start GetEntityNaturalGiftInfo -GetEntityNaturalGiftInfo: ; 0x0231AE90 - stmdb sp!, {r3, r4, r5, lr} - mov r4, r0 - bl IsMonster__0231A9D4 - cmp r0, #0 - ldrne r4, [r4, #0xb4] - ldrnesh r0, [r4, #0x66] - cmpne r0, #0 - beq _0231AF00 - mov ip, #0 - ldr r3, _0231AF08 ; =NATURAL_GIFT_ITEM_TABLE - mov lr, ip - mov r1, #6 -_0231AEC0: - smulbb r5, lr, r1 - ldrsh r2, [r3, r5] - cmp r2, #0 - beq _0231AEF0 - ldrsh r0, [r4, #0x66] - cmp r0, r2 - moveq ip, #1 - beq _0231AEF0 - add r0, lr, #1 - mov r0, r0, lsl #0x10 - mov lr, r0, asr #0x10 - b _0231AEC0 -_0231AEF0: - cmp ip, #0 - ldrne r0, _0231AF08 ; =NATURAL_GIFT_ITEM_TABLE - addne r0, r0, r5 - ldmneia sp!, {r3, r4, r5, pc} -_0231AF00: - mov r0, #0 - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_0231AF08: .word NATURAL_GIFT_ITEM_TABLE - arm_func_end GetEntityNaturalGiftInfo - - arm_func_start GetEntityWeatherBallType -GetEntityWeatherBallType: ; 0x0231AF0C - stmdb sp!, {r3, lr} - bl GetApparentWeather - ldr r1, _0231AF20 ; =WEATHER_BALL_TYPE_TABLE - ldrb r0, [r1, r0] - ldmia sp!, {r3, pc} - .align 2, 0 -_0231AF20: .word WEATHER_BALL_TYPE_TABLE - arm_func_end GetEntityWeatherBallType - - arm_func_start ov29_0231AF24 -ov29_0231AF24: ; 0x0231AF24 -#ifdef JAPAN -#define OV29_0231AF24_OFFSET -4 -#else -#define OV29_0231AF24_OFFSET 0 -#endif - stmdb sp!, {r3, r4, r5, r6, lr} - sub sp, sp, #4 - mov r6, r0 - mov r5, r1 - mov r4, r2 - bl IsMonster__0231A9D4 - cmp r0, #0 - beq _0231AFAC - mov r0, r6 - mov r1, r5 - bl ov29_022FB9E0 - mov r1, r0 - cmp r4, #0 - beq _0231AF98 - cmp r1, #0 - bge _0231AF98 - ldr r4, [r6, #0xb4] - mov r1, #0 - mov r2, r1 - add r0, r4, #0x4a - bl SetActionUseMoveAi - mov r2, #1 - strb r2, [r4, #0x124 + OV29_0231AF24_OFFSET] - add r0, r4, #0x100 - mov r1, #0 - strh r1, [r0, #0x26 + OV29_0231AF24_OFFSET] - strh r5, [r0, #0x28 + OV29_0231AF24_OFFSET] - strb r2, [r4, #0x12a + OV29_0231AF24_OFFSET] - strb r1, [r4, #0x12b + OV29_0231AF24_OFFSET] -_0231AF98: - mov r3, #0 - mov r0, r6 - mov r2, #1 - str r3, [sp] - bl ov29_0232145C -_0231AFAC: - add sp, sp, #4 - ldmia sp!, {r3, r4, r5, r6, pc} - arm_func_end ov29_0231AF24 - - arm_func_start ov29_0231AFB4 -ov29_0231AFB4: ; 0x0231AFB4 - stmdb sp!, {r4, lr} - mov ip, #0 - ldr r1, _0231B004 ; =DUNGEON_PTR - mov r2, ip - mov r3, ip -_0231AFC8: - ldr r0, [r1] - mov r4, r3 -#ifdef JAPAN - add r0, r0, #0x1840 - add r0, r0, #0x18000 -#else - add r0, r0, #0xe4 - add r0, r0, #0x19800 -#endif - add lr, r0, ip, lsl #4 -_0231AFDC: - str r2, [lr, r4, lsl #3] - add r0, lr, r4, lsl #3 - add r4, r4, #1 - str r2, [r0, #4] - cmp r4, #2 - blt _0231AFDC - add ip, ip, #1 - cmp ip, #2 - blt _0231AFC8 - ldmia sp!, {r4, pc} - .align 2, 0 -_0231B004: .word DUNGEON_PTR - arm_func_end ov29_0231AFB4 - - arm_func_start ov29_0231B008 -ov29_0231B008: ; 0x0231B008 - stmdb sp!, {r3, r4, r5, lr} - mov lr, #0 - ldr r1, _0231B05C ; =DUNGEON_PTR - mov r3, lr - mov r2, #2 - mov ip, lr -_0231B020: - ldr r0, [r1] - mov r5, ip -#ifdef JAPAN - add r0, r0, #0x1840 - add r0, r0, #0x18000 -#else - add r0, r0, #0xe4 - add r0, r0, #0x19800 -#endif - add r4, r0, lr, lsl #4 -_0231B034: - str r3, [r4, r5, lsl #3] - add r0, r4, r5, lsl #3 - add r5, r5, #1 - str r2, [r0, #4] - cmp r5, #2 - blt _0231B034 - add lr, lr, #1 - cmp lr, #2 - blt _0231B020 - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_0231B05C: .word DUNGEON_PTR - arm_func_end ov29_0231B008 - - arm_func_start ActivateMotorDrive -ActivateMotorDrive: ; 0x0231B060 - stmdb sp!, {r3, r4, lr} - sub sp, sp, #4 -#ifdef JAPAN - mov ip, #0x66 - mov r4, r0 - rsb r2, ip, #0x9e0 -#else - ldr r2, _0231B0A0 ; =0x00000C3B - mov ip, #0x66 - mov r4, r0 -#endif - mov r1, #0 - mov r3, #2 - str ip, [sp] - bl LogMessageByIdWithPopupCheckParticipants - mov r0, r4 - mov r1, r4 - mov r2, #0 - mov r3, #1 - bl BoostSpeedOneStage - add sp, sp, #4 - ldmia sp!, {r3, r4, pc} - .align 2, 0 -#ifndef JAPAN -_0231B0A0: .word 0x00000C3B -#endif - arm_func_end ActivateMotorDrive - - arm_func_start TryActivateFrisk -TryActivateFrisk: ; 0x0231B0A4 - stmdb sp!, {r4, r5, r6, lr} - sub sp, sp, #8 - mov r5, r0 - mov r4, r1 - bl EntityIsValid__0231B194 - cmp r0, #0 - beq _0231B184 - mov r0, r4 - bl EntityIsValid__0231B194 - cmp r0, #0 - beq _0231B184 - ldr r0, [r5, #0xb4] - ldr r6, [r4, #0xb4] - ldrb r0, [r0, #6] - cmp r0, #0 - bne _0231B184 - bl ov29_0232E80C - cmp r4, r0 - ldrneb r0, [r6, #6] - cmpne r0, #0 - beq _0231B184 - ldrsh r0, [r6, #0x66] - cmp r0, #0 - bne _0231B150 - ldrsh r0, [r6, #2] - add r1, sp, #0 - bl GetTreasureBoxChances - ldrsh r0, [sp, #4] - cmp r0, #0 - ldrlesh r0, [sp, #6] - cmple r0, #0 - ble _0231B184 - mov r0, r5 - bl ov29_022E4110 - mov r1, r4 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldr r2, _0231B18C ; =0x00000C3D - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231B184 -_0231B150: - mov r0, r5 - bl ov29_022E4110 - mov r1, r4 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - add r1, r6, #0x62 - mov r0, #2 - bl ov29_02344B44 - ldr r2, _0231B190 ; =0x00000C3C - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget -_0231B184: - add sp, sp, #8 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_0231B18C: .word 0x0000097C -_0231B190: .word 0x0000097B -#else -_0231B18C: .word 0x00000C3D -_0231B190: .word 0x00000C3C -#endif - arm_func_end TryActivateFrisk diff --git a/asm/overlay_29_0231A9F8.s b/asm/overlay_29_0231A9F8.s new file mode 100644 index 00000000..612afda8 --- /dev/null +++ b/asm/overlay_29_0231A9F8.s @@ -0,0 +1,628 @@ + .include "asm/macros.inc" + .include "overlay_29_0231A9F8.inc" + + .text + + arm_func_start ov29_0231A9F8 +ov29_0231A9F8: ; 0x0231A9F8 + stmdb sp!, {r4, r5, r6, r7, lr} + sub sp, sp, #0x34 + mov r7, r0 + mov r1, #0 + mov r2, #0x15 + ldr r5, [r7, #0xb4] + bl GetItemToUse + mov r1, r0 + ldrb r0, [r1] + ldrh r4, [r1] + ldrh r3, [r1, #2] + ldrh r2, [r1, #4] + tst r0, #8 + movne r0, #1 + moveq r0, #0 + strh r4, [sp, #0x18] + strh r3, [sp, #0x1a] + strh r2, [sp, #0x1c] + tst r0, #0xff + beq _0231AA60 + mov r0, #0 + bl ov29_02344B44 + ldr r1, _0231AC90 ; =0x00000DF8 + mov r0, r7 + bl LogMessageByIdWithPopupCheckUser + b _0231AC88 +_0231AA60: + mov r0, r7 + bl ov29_022FBAB4 + add r2, sp, #0x1e + add r3, r5, #0x4a + mov r1, #0xa +_0231AA74: + ldrh r0, [r3], #2 + subs r1, r1, #1 + strh r0, [r2], #2 + bne _0231AA74 + ldr r0, _0231AC94 ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, #0x4000 +#ifdef JAPAN + ldrb r0, [r0, #0x36] +#else + ldrb r0, [r0, #0xda] +#endif + bl AreOrbsAllowed + cmp r0, #0 + mov r4, #1 + bne _0231AAB4 + ldr r1, _0231AC98 ; =0x00000DF9 + mov r0, r7 + bl LogMessageByIdWithPopupCheckUser + b _0231AC24 +_0231AAB4: + ldrsh r6, [sp, #0x1c] + mov r0, r6 + bl GetItemMoveId16 + mov r1, r0 + add r0, sp, #0x10 + bl InitMove + ldrb r0, [r5, #7] + cmp r0, #0 + bne _0231AB18 + mov r2, r4 + mov r3, #0xa + strb r2, [sp, #8] + add r0, sp, #8 + mov r1, r7 +#ifdef JAPAN + add r2, r5, #0x120 +#else + add r2, r5, #0x124 +#endif + str r3, [sp, #0xc] + bl AiConsiderMove + ldrb r0, [sp, #8] + cmp r0, #0 + beq _0231AB18 + ldrb r1, [sp, #9] + mov r0, r7 + and r1, r1, #7 + strb r1, [r5, #0x4c] + bl UpdateAiTargetPos +_0231AB18: + ldrb r0, [r5, #0xd0] + cmp r0, #1 + bne _0231AB48 + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r1, _0231AC9C ; =0x00000DFA + mov r0, r7 + bl LogMessageByIdWithPopupCheckUser + mov r4, #0 + b _0231ABA0 +_0231AB48: + cmp r0, #7 + bne _0231AB74 + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r1, _0231ACA0 ; =0x00000DFB + mov r0, r7 + bl LogMessageByIdWithPopupCheckUser + mov r4, #0 + b _0231ABA0 +_0231AB74: + ldrb r0, [r5, #0xbf] + cmp r0, #4 + bne _0231ABA0 + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r1, _0231ACA4 ; =0x00000DFC + mov r0, r7 + bl LogMessageByIdWithPopupCheckUser + mov r4, #0 +_0231ABA0: + cmp r4, #0 + beq _0231AC20 + cmp r6, #0x138 + ldrne r0, _0231ACA8 ; =0x00000141 + mov r1, #0 + cmpne r6, r0 + bne _0231AC00 + mov r0, r7 + mov r2, #0x7a + bl RemoveUsedItem + ldrb r2, [sp, #0x10] + mov r0, #0xa + mov r1, #0 + orr r2, r2, #0xc + strb r2, [sp, #0x10] + strb r0, [sp, #0x16] + add r4, sp, #0x10 + mov r0, r7 + mov r2, r6 + mov r3, r1 + stmia sp, {r1, r4} + bl ov29_02322374 + mov r4, #0 + b _0231AC24 +_0231AC00: + add r4, sp, #0x10 + mov r0, r7 + mov r2, r6 + mov r3, r1 + stmia sp, {r1, r4} + bl ov29_02322374 + mov r4, r0 + b _0231AC24 +_0231AC20: + mov r4, #0 +_0231AC24: + mov r0, r7 + bl EntityIsValid__02319F8C + cmp r0, #0 + beq _0231AC60 + cmp r4, #0 + beq _0231AC4C + mov r0, r7 + mov r1, #0 + mov r2, #0x7a + bl RemoveUsedItem +_0231AC4C: + mov r0, r7 + bl EnemyEvolution + mov r0, r7 + bl ov29_02321274 + b _0231AC74 +_0231AC60: + cmp r4, #0 + beq _0231AC74 + add r0, sp, #0x1e + mov r1, #0 + bl ov29_022EB4E8 +_0231AC74: + bl IsFloorOver + cmp r0, #0 + bne _0231AC88 + mov r0, r7 + bl TryActivateTruant +_0231AC88: + add sp, sp, #0x34 + ldmia sp!, {r4, r5, r6, r7, pc} + .align 2, 0 +#ifdef JAPAN +#define OV29_0231A9F8_OFFSET -0x2C0 +#else +#define OV29_0231A9F8_OFFSET 0 +#endif +_0231AC90: .word 0x00000DF8 + OV29_0231A9F8_OFFSET +_0231AC94: .word DUNGEON_PTR +_0231AC98: .word 0x00000DF9 + OV29_0231A9F8_OFFSET +_0231AC9C: .word 0x00000DFA + OV29_0231A9F8_OFFSET +_0231ACA0: .word 0x00000DFB + OV29_0231A9F8_OFFSET +_0231ACA4: .word 0x00000DFC + OV29_0231A9F8_OFFSET +_0231ACA8: .word 0x00000141 + arm_func_end ov29_0231A9F8 + + arm_func_start GetEntityMoveTargetAndRange +GetEntityMoveTargetAndRange: ; 0x0231ACAC + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + ldrh r1, [r5, #4] + mov r4, r2 + mov r6, r0 + cmp r1, #0xed + cmpeq r4, #0 + bne _0231ACE0 + mov r1, #0xe + bl MonsterIsType + cmp r0, #0 + moveq r0, #0x73 + ldmeqia sp!, {r4, r5, r6, pc} +_0231ACE0: + mov r0, r5 + mov r1, r4 + bl GetMoveTargetAndRange + mov r4, r0 + mov r0, r5 + bl IsMoveRangeString19 + cmp r0, #0 + beq _0231AD2C + mov r0, r6 + mov r1, #0x55 + bl ExclusiveItemEffectIsActive__0231A87C + cmp r0, #0 + beq _0231AD2C + ldr r0, _0231AD34 ; =0x00000273 + cmp r4, r0 + subeq r4, r0, #0x12 + beq _0231AD2C + cmp r4, #0x73 + moveq r4, #0x61 +_0231AD2C: + mov r0, r4 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_0231AD34: .word 0x00000273 + arm_func_end GetEntityMoveTargetAndRange + + arm_func_start ov29_0231AD38 +ov29_0231AD38: ; 0x0231AD38 + stmdb sp!, {r4, r5, r6, lr} + mov r6, r0 + mov r5, r1 + mov r2, #1 + bl GetEntityMoveTargetAndRange + and r4, r0, #0xf + mov r0, r6 + mov r1, r5 + mov r2, #0 + bl GetEntityMoveTargetAndRange + cmp r4, #3 + and r0, r0, #0xf + cmpne r4, #1 + cmpne r0, #4 + cmpne r0, #3 + cmpne r0, #1 + cmpne r0, #6 + beq _0231ADA0 + mov r0, r6 + mov r1, r5 + mov r2, #0 + bl GetEntityMoveTargetAndRange + and r0, r0, #0xf0 + cmp r0, #0x70 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, pc} +_0231ADA0: + mov r0, #1 + ldmia sp!, {r4, r5, r6, pc} + arm_func_end ov29_0231AD38 + + arm_func_start ov29_0231ADA8 +ov29_0231ADA8: ; 0x0231ADA8 + stmdb sp!, {r3, r4, r5, lr} + sub sp, sp, #8 + ldr r1, [r0, #0xb4] + mov r0, #0 + mov r5, r0 +#ifdef JAPAN + add r4, r1, #0x120 +#else + add r4, r1, #0x124 +#endif + mov ip, r0 + mov lr, #1 + add r2, sp, #0 +_0231ADCC: + ldrb r1, [r4, r5, lsl #3] + add r3, r4, r5, lsl #3 + tst r1, #1 + movne r1, lr + moveq r1, ip + tst r1, #0xff + beq _0231AE00 + ldrh r3, [r3, #4] + add r1, r0, #1 + mov r0, r0, lsl #1 + mov r1, r1, lsl #0x10 + strh r3, [r2, r0] + mov r0, r1, lsr #0x10 +_0231AE00: + add r1, r5, #1 + mov r1, r1, lsl #0x10 + mov r5, r1, lsr #0x10 + cmp r5, #4 + blo _0231ADCC + cmp r0, #0 + moveq r0, #0 + beq _0231AE34 + bl DungeonRandInt + mov r0, r0, lsl #0x10 + add r1, sp, #0 + mov r0, r0, lsr #0xf + ldrh r0, [r1, r0] +_0231AE34: + add sp, sp, #8 + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_0231ADA8 + + arm_func_start ov29_0231AE3C +ov29_0231AE3C: ; 0x0231AE3C + stmdb sp!, {r3, lr} + ldr ip, [r0, #0xb4] + mov r0, #0 + mov lr, r0 + mov r2, r0 + mov r3, #1 +_0231AE54: + add r1, ip, lr, lsl #3 +#ifdef JAPAN + ldrb r1, [r1, #0x120] +#else + ldrb r1, [r1, #0x124] +#endif + tst r1, #1 + movne r1, r3 + moveq r1, r2 + tst r1, #0xff + add r1, lr, #1 + addne r0, r0, #1 + mov r1, r1, lsl #0x10 + movne r0, r0, lsl #0x10 + mov lr, r1, lsr #0x10 + movne r0, r0, lsr #0x10 + cmp lr, #4 + blo _0231AE54 + ldmia sp!, {r3, pc} + arm_func_end ov29_0231AE3C + + arm_func_start GetEntityNaturalGiftInfo +GetEntityNaturalGiftInfo: ; 0x0231AE90 + stmdb sp!, {r3, r4, r5, lr} + mov r4, r0 + bl IsMonster__0231A9D4 + cmp r0, #0 + ldrne r4, [r4, #0xb4] + ldrnesh r0, [r4, #0x66] + cmpne r0, #0 + beq _0231AF00 + mov ip, #0 + ldr r3, _0231AF08 ; =NATURAL_GIFT_ITEM_TABLE + mov lr, ip + mov r1, #6 +_0231AEC0: + smulbb r5, lr, r1 + ldrsh r2, [r3, r5] + cmp r2, #0 + beq _0231AEF0 + ldrsh r0, [r4, #0x66] + cmp r0, r2 + moveq ip, #1 + beq _0231AEF0 + add r0, lr, #1 + mov r0, r0, lsl #0x10 + mov lr, r0, asr #0x10 + b _0231AEC0 +_0231AEF0: + cmp ip, #0 + ldrne r0, _0231AF08 ; =NATURAL_GIFT_ITEM_TABLE + addne r0, r0, r5 + ldmneia sp!, {r3, r4, r5, pc} +_0231AF00: + mov r0, #0 + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_0231AF08: .word NATURAL_GIFT_ITEM_TABLE + arm_func_end GetEntityNaturalGiftInfo + + arm_func_start GetEntityWeatherBallType +GetEntityWeatherBallType: ; 0x0231AF0C + stmdb sp!, {r3, lr} + bl GetApparentWeather + ldr r1, _0231AF20 ; =WEATHER_BALL_TYPE_TABLE + ldrb r0, [r1, r0] + ldmia sp!, {r3, pc} + .align 2, 0 +_0231AF20: .word WEATHER_BALL_TYPE_TABLE + arm_func_end GetEntityWeatherBallType + + arm_func_start ov29_0231AF24 +ov29_0231AF24: ; 0x0231AF24 +#ifdef JAPAN +#define OV29_0231AF24_OFFSET -4 +#else +#define OV29_0231AF24_OFFSET 0 +#endif + stmdb sp!, {r3, r4, r5, r6, lr} + sub sp, sp, #4 + mov r6, r0 + mov r5, r1 + mov r4, r2 + bl IsMonster__0231A9D4 + cmp r0, #0 + beq _0231AFAC + mov r0, r6 + mov r1, r5 + bl ov29_022FB9E0 + mov r1, r0 + cmp r4, #0 + beq _0231AF98 + cmp r1, #0 + bge _0231AF98 + ldr r4, [r6, #0xb4] + mov r1, #0 + mov r2, r1 + add r0, r4, #0x4a + bl SetActionUseMoveAi + mov r2, #1 + strb r2, [r4, #0x124 + OV29_0231AF24_OFFSET] + add r0, r4, #0x100 + mov r1, #0 + strh r1, [r0, #0x26 + OV29_0231AF24_OFFSET] + strh r5, [r0, #0x28 + OV29_0231AF24_OFFSET] + strb r2, [r4, #0x12a + OV29_0231AF24_OFFSET] + strb r1, [r4, #0x12b + OV29_0231AF24_OFFSET] +_0231AF98: + mov r3, #0 + mov r0, r6 + mov r2, #1 + str r3, [sp] + bl ov29_0232145C +_0231AFAC: + add sp, sp, #4 + ldmia sp!, {r3, r4, r5, r6, pc} + arm_func_end ov29_0231AF24 + + arm_func_start ov29_0231AFB4 +ov29_0231AFB4: ; 0x0231AFB4 + stmdb sp!, {r4, lr} + mov ip, #0 + ldr r1, _0231B004 ; =DUNGEON_PTR + mov r2, ip + mov r3, ip +_0231AFC8: + ldr r0, [r1] + mov r4, r3 +#ifdef JAPAN + add r0, r0, #0x1840 + add r0, r0, #0x18000 +#else + add r0, r0, #0xe4 + add r0, r0, #0x19800 +#endif + add lr, r0, ip, lsl #4 +_0231AFDC: + str r2, [lr, r4, lsl #3] + add r0, lr, r4, lsl #3 + add r4, r4, #1 + str r2, [r0, #4] + cmp r4, #2 + blt _0231AFDC + add ip, ip, #1 + cmp ip, #2 + blt _0231AFC8 + ldmia sp!, {r4, pc} + .align 2, 0 +_0231B004: .word DUNGEON_PTR + arm_func_end ov29_0231AFB4 + + arm_func_start ov29_0231B008 +ov29_0231B008: ; 0x0231B008 + stmdb sp!, {r3, r4, r5, lr} + mov lr, #0 + ldr r1, _0231B05C ; =DUNGEON_PTR + mov r3, lr + mov r2, #2 + mov ip, lr +_0231B020: + ldr r0, [r1] + mov r5, ip +#ifdef JAPAN + add r0, r0, #0x1840 + add r0, r0, #0x18000 +#else + add r0, r0, #0xe4 + add r0, r0, #0x19800 +#endif + add r4, r0, lr, lsl #4 +_0231B034: + str r3, [r4, r5, lsl #3] + add r0, r4, r5, lsl #3 + add r5, r5, #1 + str r2, [r0, #4] + cmp r5, #2 + blt _0231B034 + add lr, lr, #1 + cmp lr, #2 + blt _0231B020 + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_0231B05C: .word DUNGEON_PTR + arm_func_end ov29_0231B008 + + arm_func_start ActivateMotorDrive +ActivateMotorDrive: ; 0x0231B060 + stmdb sp!, {r3, r4, lr} + sub sp, sp, #4 +#ifdef JAPAN + mov ip, #0x66 + mov r4, r0 + rsb r2, ip, #0x9e0 +#else + ldr r2, _0231B0A0 ; =0x00000C3B + mov ip, #0x66 + mov r4, r0 +#endif + mov r1, #0 + mov r3, #2 + str ip, [sp] + bl LogMessageByIdWithPopupCheckParticipants + mov r0, r4 + mov r1, r4 + mov r2, #0 + mov r3, #1 + bl BoostSpeedOneStage + add sp, sp, #4 + ldmia sp!, {r3, r4, pc} + .align 2, 0 +#ifndef JAPAN +_0231B0A0: .word 0x00000C3B +#endif + arm_func_end ActivateMotorDrive + + arm_func_start TryActivateFrisk +TryActivateFrisk: ; 0x0231B0A4 + stmdb sp!, {r4, r5, r6, lr} + sub sp, sp, #8 + mov r5, r0 + mov r4, r1 + bl EntityIsValid__0231B194 + cmp r0, #0 + beq _0231B184 + mov r0, r4 + bl EntityIsValid__0231B194 + cmp r0, #0 + beq _0231B184 + ldr r0, [r5, #0xb4] + ldr r6, [r4, #0xb4] + ldrb r0, [r0, #6] + cmp r0, #0 + bne _0231B184 + bl ov29_0232E80C + cmp r4, r0 + ldrneb r0, [r6, #6] + cmpne r0, #0 + beq _0231B184 + ldrsh r0, [r6, #0x66] + cmp r0, #0 + bne _0231B150 + ldrsh r0, [r6, #2] + add r1, sp, #0 + bl GetTreasureBoxChances + ldrsh r0, [sp, #4] + cmp r0, #0 + ldrlesh r0, [sp, #6] + cmple r0, #0 + ble _0231B184 + mov r0, r5 + bl ov29_022E4110 + mov r1, r4 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldr r2, _0231B18C ; =0x00000C3D + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231B184 +_0231B150: + mov r0, r5 + bl ov29_022E4110 + mov r1, r4 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + add r1, r6, #0x62 + mov r0, #2 + bl ov29_02344B44 + ldr r2, _0231B190 ; =0x00000C3C + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget +_0231B184: + add sp, sp, #8 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_0231B18C: .word 0x0000097C +_0231B190: .word 0x0000097B +#else +_0231B18C: .word 0x00000C3D +_0231B190: .word 0x00000C3C +#endif + arm_func_end TryActivateFrisk diff --git a/asm/overlay_29_0231B1B8.s b/asm/overlay_29_0231B1B8.s index 266ef66a..dfde676e 100644 --- a/asm/overlay_29_0231B1B8.s +++ b/asm/overlay_29_0231B1B8.s @@ -106,1810 +106,3 @@ _0231B30C: .word DUNGEON_PTR _0231B310: .word ov10_022C4530 _0231B314: .word 0x0000026E arm_func_end TryActivateBadDreams - - arm_func_start IsMonster__0231B318 -IsMonster__0231B318: ; 0x0231B318 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__0231B318 - - arm_func_start ActivateStench -ActivateStench: ; 0x0231B33C - stmdb sp!, {r4, lr} - ldr r4, [r0, #0xb4] - bl ov29_022E60E4 - ldr r0, _0231B360 ; =ov10_022C457C - mov r1, #2 - ldrsh r0, [r0] -#ifdef JAPAN - strb r1, [r4, #0x103] - strb r0, [r4, #0x104] -#else - strb r1, [r4, #0x104] - strb r0, [r4, #0x105] -#endif - ldmia sp!, {r4, pc} - .align 2, 0 -_0231B360: .word ov10_022C457C - arm_func_end ActivateStench - - arm_func_start TryActivateSteadfast -TryActivateSteadfast: ; 0x0231B364 - stmdb sp!, {r3, r4, r5, lr} - mov r4, r1 - mov r5, r0 - mov r0, r4 - mov r1, #0x70 - bl AbilityIsActiveVeneer - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, r5 - mov r1, r4 - mov r2, #0 - mov r3, #1 - bl BoostSpeedOneStage - ldmia sp!, {r3, r4, r5, pc} - arm_func_end TryActivateSteadfast - - arm_func_start ov29_0231B39C -ov29_0231B39C: ; 0x0231B39C - mov ip, #0 - mov r3, ip -_0231B3A4: - add r1, ip, #1 - mov r1, r1, lsl #0x10 - strb r3, [r0, ip, lsl #2] - add r2, r0, ip, lsl #2 - mov ip, r1, asr #0x10 - strh r3, [r2, #2] - cmp ip, #8 - blt _0231B3A4 - strh r3, [r0, #0x20] - bx lr - arm_func_end ov29_0231B39C - - arm_func_start ov29_0231B3CC -ov29_0231B3CC: ; 0x0231B3CC - ldrsh r3, [r0, #0x20] - cmp r3, #8 - bxge lr - mov r2, #1 - strb r2, [r0, r3, lsl #2] - ldrsh r2, [r0, #0x20] - add r2, r0, r2, lsl #2 - strh r1, [r2, #2] - ldrsh r1, [r0, #0x20] - add r1, r1, #1 - strh r1, [r0, #0x20] - bx lr - arm_func_end ov29_0231B3CC - - arm_func_start IsInSpawnList -IsInSpawnList: ; 0x0231B3FC - stmdb sp!, {r4, r5, r6, lr} - mov r5, r0 - mov r0, r1 - bl FemaleToMaleForm - mov r4, r0 - mov r6, #0 - b _0231B44C -_0231B418: - ldrb r0, [r5, r6, lsl #2] - mov r1, r6, lsl #2 - cmp r0, #0 - beq _0231B440 - add r0, r5, r1 - ldrsh r0, [r0, #2] - bl FemaleToMaleForm - cmp r4, r0 - moveq r0, #1 - ldmeqia sp!, {r4, r5, r6, pc} -_0231B440: - add r0, r6, #1 - mov r0, r0, lsl #0x10 - mov r6, r0, asr #0x10 -_0231B44C: - ldrsh r0, [r5, #0x20] - cmp r6, r0 - blt _0231B418 - mov r0, #0 - ldmia sp!, {r4, r5, r6, pc} - arm_func_end IsInSpawnList - - arm_func_start ov29_0231B460 -ov29_0231B460: ; 0x0231B460 - stmdb sp!, {r3, lr} - ldr r0, _0231B48C ; =DUNGEON_PTR - ldr r2, [r0] - add r0, r2, #0x700 - ldrsh r1, [r0, #0xa8] - cmp r1, #0 - ldmeqia sp!, {r3, pc} - ldrsh r1, [r0, #0xa8] - add r0, r2, #0x7d0 - bl ov29_0231B3CC - ldmia sp!, {r3, pc} - .align 2, 0 -_0231B48C: .word DUNGEON_PTR - arm_func_end ov29_0231B460 - - arm_func_start ov29_0231B490 -ov29_0231B490: ; 0x0231B490 - ldr r0, _0231B4A8 ; =DUNGEON_PTR - mov r1, #0 - ldr r0, [r0] - add r0, r0, #0x3000 -#ifdef JAPAN - strb r1, [r0, #0xd98] -#else - strb r1, [r0, #0xe3c] -#endif - bx lr - .align 2, 0 -_0231B4A8: .word DUNGEON_PTR - arm_func_end ov29_0231B490 - - arm_func_start ov29_0231B4AC -ov29_0231B4AC: ; 0x0231B4AC - stmdb sp!, {r3, lr} - cmp r0, #0 - ldreq r0, _0231B4E8 ; =DUNGEON_PTR - ldreq r0, [r0] - addeq r0, r0, #0x3000 -#ifdef JAPAN - ldreqb r0, [r0, #0xd98] -#else - ldreqb r0, [r0, #0xe3c] -#endif - ldmeqia sp!, {r3, pc} - cmp r0, #1 - movne r0, #0 - ldmneia sp!, {r3, pc} - ldr r0, _0231B4E8 ; =DUNGEON_PTR - ldr r0, [r0] - ldrb r0, [r0, #0x748] - bl IsSkyExclusiveDungeon - ldmia sp!, {r3, pc} - .align 2, 0 -_0231B4E8: .word DUNGEON_PTR - arm_func_end ov29_0231B4AC - - arm_func_start ChangeShayminForme -ChangeShayminForme: ; 0x0231B4EC - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - mov r8, r0 - ldr r7, [r8, #0xb4] - cmp r1, #1 - mov r6, #0 - ldrsh r0, [r7, #2] - bne _0231B548 - bl IsShaymin - cmp r0, #0 - moveq r0, r6 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - ldrsh r4, [r7, #2] - ldr r0, _0231B680 ; =0x00000216 - cmp r4, r0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - ldrb r1, [r7, #0xc4] - cmp r1, #1 - moveq r0, #2 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - add r5, r0, #1 - mov r6, #1 - b _0231B570 -_0231B548: - bl IsShaymin - cmp r0, #0 - moveq r0, r6 - ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - ldrsh r4, [r7, #2] - ldr r0, _0231B684 ; =0x00000217 - cmp r4, r0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - sub r5, r0, #1 -_0231B570: - ldrsh r0, [r7, #0xc] - bl GetActiveTeamMember - mov sb, r0 - cmp r6, #0 - beq _0231B5A0 - mov r0, r8 - mov r1, #0x2b8 - mov r2, #0 - bl ov29_022E3590 - mov r0, #0x21 - mov r1, #0x42 - bl ov29_022EA370 -_0231B5A0: - mov r0, #0 - bl ov29_022E9FD0 - mov r0, r4 - mov r1, r5 - bl SwapMonsterWanFileIndex - strh r5, [r7, #2] - ldrsh r0, [r7, #2] - strh r0, [r7, #4] - strh r0, [sb, #0xc] - strh r5, [r7, #2] - ldrsh r0, [r7, #2] - strh r0, [r7, #4] - ldr r4, [r8, #0xb4] - ldrsh r0, [r4, #4] - bl DungeonGetSpriteIndex - strh r0, [r8, #0xa8] - ldrb r0, [r4, #0xd8] - cmp r0, #2 - beq _0231B5F4 - add r0, r8, #0x2c - bl sub_0201CF80 -_0231B5F4: - mov r0, r8 - bl GetIdleAnimationId - mov r1, r0 - mov r0, r8 - bl ov29_02304830 - mov r0, r8 - bl DetermineMonsterShadow - mov r0, r8 - bl SetMonsterTypeAndAbility - mov r0, #1 - bl ov29_022E9FD0 - ldr r0, _0231B684 ; =0x00000217 - cmp r5, r0 - ldreq r0, _0231B688 ; =DUNGEON_PTR - moveq r1, #1 - ldrne r0, _0231B688 ; =DUNGEON_PTR - movne r1, #0 - ldr r0, [r0] - add r0, r0, #0x3000 -#ifdef JAPAN - strb r1, [r0, #0xd98] -#else - strb r1, [r0, #0xe3c] -#endif - bl sub_020017EC - bl ov29_022E81F8 - mov r0, #1 - mov r1, #0x42 - bl ov29_022EA370 - cmp r6, #0 - beq _0231B678 - mov r0, r8 - bl ov29_022F04F0 -#ifdef JAPAN - mov r0, #2 -#else - mov r0, #1 -#endif - bl AnimationDelayOrSomething - mov r0, r8 - bl ov29_022F0518 -_0231B678: - mov r0, #3 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - .align 2, 0 -_0231B680: .word 0x00000216 -_0231B684: .word 0x00000217 -_0231B688: .word DUNGEON_PTR - arm_func_end ChangeShayminForme - - arm_func_start ApplyItemEffect -ApplyItemEffect: ; 0x0231B68C - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, lr} - sub sp, sp, #0x5c - movs sb, r0 - mov sl, r2 - mov r8, r3 - ldr r7, [sp, #0x80] - ldr r6, [sp, #0x84] - beq _0231B840 - cmp r1, #0 - bne _0231B840 - mov r0, r7 - ldr r5, [r7, #0xb4] - mov r4, #0 - bl ov29_022FB9BC - cmp r0, #0 - beq _0231B6E4 - mov r0, r8 - mov r2, r6 - add r1, r7, #4 - mov r3, r4 - bl SpawnDroppedItemWrapper - b _0231CBA4 -_0231B6E4: - ldrb r0, [r5, #6] - cmp r0, #0 - ldrsh r0, [r6, #4] - beq _0231B74C - bl GetItemCategoryVeneer - cmp r0, #0 - beq _0231B720 - ldrsh r0, [r6, #4] - bl GetItemCategoryVeneer - cmp r0, #2 - beq _0231B720 - ldrsh r0, [r6, #4] - bl GetItemCategoryVeneer - cmp r0, #1 - movne r4, #1 -_0231B720: - ldrsh r0, [r6, #4] - bl GetItemCategoryVeneer - cmp r0, #4 - bne _0231B768 - ldrsh r1, [r6, #4] - cmp r1, #0x190 - blt _0231B768 - ldr r0, _0231C6C0 ; =0x000001AB - cmp r1, r0 - movle r4, #0 - b _0231B768 -_0231B74C: - bl GetItemCategoryVeneer - cmp r0, #2 - beq _0231B768 - mov r0, r7 - mov r1, #2 - bl IqSkillIsEnabled - mov r4, r0 -_0231B768: - mov r0, r7 - bl CheckVariousConditions - cmp r0, #0 - movne r4, #0 - cmp r4, #0 - beq _0231B840 - ldrb r0, [r5, #0x62] - tst r0, #1 - movne r0, #1 - moveq r0, #0 - tst r0, #0xff - bne _0231B840 - ldrb r0, [r5, #6] - cmp r0, #0 - bne _0231B7B0 - bl IsBagFull - cmp r0, #0 - bne _0231B840 -_0231B7B0: - ldrb r0, [r5, #9] - cmp r0, #1 - bne _0231B7D4 - mov r0, r8 - mov r2, r6 - add r1, r7, #4 - mov r3, #0 - bl SpawnDroppedItemWrapper - b _0231CBA4 -_0231B7D4: - ldr r0, _0231C6C4 ; =0x00001317 - bl ov29_022EACCC - mov r1, r6 - mov r0, #0 - bl ov29_02344B44 - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _0231C6C8 ; =0x00000BE6 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - ldrh r0, [r6] - strh r0, [r5, #0x62] - ldrh r0, [r6, #2] - strh r0, [r5, #0x64] - ldrh r0, [r6, #4] - strh r0, [r5, #0x66] - ldrb r0, [r5, #6] - cmp r0, #0 - bne _0231B834 - mov r0, r5 - bl AddHeldItemToBag -_0231B834: - mov r0, r7 - bl ov29_022F9EA0 - b _0231CBA4 -_0231B840: - cmp sb, #0 - beq _0231B860 - mov r0, r7 - mov r1, r6 - bl ov29_022E5A00 - mov r0, r8 - mov r1, r7 - bl UpdateShopkeeperModeAfterAttack -_0231B860: - ldrb r0, [r6] - tst r0, #8 - movne r0, #1 - moveq r0, #0 - tst r0, #0xff - beq _0231B8E4 - mov r1, r6 - mov r0, #0 - bl ov29_02344B44 - ldr r2, _0231C6CC ; =0x00000BE7 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - cmp sb, #0 - beq _0231B8E4 - add r1, sp, #0x21 - ldr r0, _0231C6D0 ; =ov10_022C4574 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - mov r0, r8 - bl EnemyEvolution - b _0231CBA4 -_0231B8E4: - cmp sb, #0 - bne _0231B8F8 - mov r0, r7 - mov r1, r6 - bl ov29_022E5AE4 -_0231B8F8: - mov r0, r8 - mov r1, r6 - bl ov29_0230F9A4 - ldrsh r0, [r6, #4] - bl GetItemCategoryVeneer - cmp r0, #2 - bne _0231B92C - mov r3, #0 - mov r0, r8 - mov r1, r7 - mov r2, #5 - str r3, [sp] - bl TryIncreaseBelly -_0231B92C: - ldrsh r0, [r6, #4] - bl GetItemCategoryVeneer - cmp r0, #5 - beq _0231B94C - ldrsh r0, [r6, #4] - bl GetItemCategoryVeneer - cmp r0, #0xa - bne _0231B9A8 -_0231B94C: - cmp sb, #0 - beq _0231B994 - add r1, sp, #0x20 - ldr r0, _0231C6D8 ; =ov10_022C4558 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231B994: - ldr r2, _0231C6DC ; =0x00000BE8 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231B9A8: - ldrsh r0, [r6, #4] - cmp r0, #0x19c - bgt _0231BD6C - bge _0231CA60 - cmp r0, #0x194 - bgt _0231BD00 - bge _0231CA60 - cmp r0, #0x190 - bgt _0231BCD0 - bge _0231CA60 - cmp r0, #0xb6 - bgt _0231BCC0 - cmp r0, #0 - addge pc, pc, r0, lsl #2 - b _0231CABC -_0231B9E4: ; jump table - b _0231CABC ; case 0 - b _0231BE50 ; case 1 - b _0231BE88 ; case 2 - b _0231BEC0 ; case 3 - b _0231BEF8 ; case 4 - b _0231BF30 ; case 5 - b _0231BF68 ; case 6 - b _0231BFDC ; case 7 - b _0231BFA0 ; case 8 - b _0231C018 ; case 9 - b _0231C050 ; case 10 - b _0231CABC ; case 11 - b _0231CABC ; case 12 - b _0231CABC ; case 13 - b _0231CABC ; case 14 - b _0231CABC ; case 15 - b _0231CABC ; case 16 - b _0231CABC ; case 17 - b _0231CABC ; case 18 - b _0231CABC ; case 19 - b _0231CABC ; case 20 - b _0231CABC ; case 21 - b _0231CABC ; case 22 - b _0231CABC ; case 23 - b _0231CABC ; case 24 - b _0231CABC ; case 25 - b _0231CABC ; case 26 - b _0231CABC ; case 27 - b _0231CABC ; case 28 - b _0231CABC ; case 29 - b _0231CABC ; case 30 - b _0231CABC ; case 31 - b _0231CABC ; case 32 - b _0231CABC ; case 33 - b _0231CABC ; case 34 - b _0231CABC ; case 35 - b _0231CABC ; case 36 - b _0231CABC ; case 37 - b _0231CABC ; case 38 - b _0231CABC ; case 39 - b _0231CABC ; case 40 - b _0231CABC ; case 41 - b _0231CABC ; case 42 - b _0231CABC ; case 43 - b _0231CABC ; case 44 - b _0231CABC ; case 45 - b _0231CABC ; case 46 - b _0231CABC ; case 47 - b _0231CABC ; case 48 - b _0231CABC ; case 49 - b _0231CABC ; case 50 - b _0231CABC ; case 51 - b _0231CABC ; case 52 - b _0231CABC ; case 53 - b _0231CABC ; case 54 - b _0231CABC ; case 55 - b _0231CABC ; case 56 - b _0231CABC ; case 57 - b _0231CABC ; case 58 - b _0231CABC ; case 59 - b _0231CABC ; case 60 - b _0231CABC ; case 61 - b _0231CABC ; case 62 - b _0231CABC ; case 63 - b _0231CABC ; case 64 - b _0231CABC ; case 65 - b _0231CABC ; case 66 - b _0231CABC ; case 67 - b _0231CABC ; case 68 - b _0231C08C ; case 69 - b _0231C0A4 ; case 70 - b _0231C0CC ; case 71 - b _0231C15C ; case 72 - b _0231CABC ; case 73 - b _0231C118 ; case 74 - b _0231C210 ; case 75 - b _0231C130 ; case 76 - b _0231C0F4 ; case 77 - b _0231C248 ; case 78 - b _0231C258 ; case 79 - b _0231C144 ; case 80 - b _0231C194 ; case 81 - b _0231C184 ; case 82 - b _0231C16C ; case 83 - b _0231C1BC ; case 84 - b _0231C234 ; case 85 - b _0231C1A4 ; case 86 - b _0231C278 ; case 87 - b _0231C268 ; case 88 - b _0231C1F4 ; case 89 - b _0231C1E4 ; case 90 - b _0231C224 ; case 91 - b _0231C304 ; case 92 - b _0231C31C ; case 93 - b _0231C338 ; case 94 - b _0231C348 ; case 95 - b _0231C360 ; case 96 - b _0231C370 ; case 97 - b _0231CABC ; case 98 - b _0231C28C ; case 99 - b _0231C2A4 ; case 100 - b _0231C2BC ; case 101 - b _0231C2D4 ; case 102 - b _0231C380 ; case 103 - b _0231C6B0 ; case 104 - b _0231CABC ; case 105 - b _0231C768 ; case 106 - b _0231C7A0 ; case 107 - b _0231C2EC ; case 108 - b _0231C394 ; case 109 - b _0231C3B4 ; case 110 - b _0231C3F4 ; case 111 - b _0231C3D4 ; case 112 - b _0231C5FC ; case 113 - b _0231C61C ; case 114 - b _0231C63C ; case 115 - b _0231C7B0 ; case 116 - b _0231C7C0 ; case 117 - b _0231C7FC ; case 118 - b _0231C404 ; case 119 - b _0231C420 ; case 120 - b _0231C43C ; case 121 - b _0231C458 ; case 122 - b _0231C474 ; case 123 - b _0231C490 ; case 124 - b _0231C4AC ; case 125 - b _0231C4C8 ; case 126 - b _0231C4E4 ; case 127 - b _0231C500 ; case 128 - b _0231C51C ; case 129 - b _0231C538 ; case 130 - b _0231C554 ; case 131 - b _0231C570 ; case 132 - b _0231C58C ; case 133 - b _0231C5A8 ; case 134 - b _0231C5C4 ; case 135 - b _0231C5E0 ; case 136 - b _0231C80C ; case 137 - b _0231CABC ; case 138 - b _0231CABC ; case 139 - b _0231CABC ; case 140 - b _0231CABC ; case 141 - b _0231CABC ; case 142 - b _0231CABC ; case 143 - b _0231CABC ; case 144 - b _0231CABC ; case 145 - b _0231CABC ; case 146 - b _0231CABC ; case 147 - b _0231CABC ; case 148 - b _0231CABC ; case 149 - b _0231CABC ; case 150 - b _0231CABC ; case 151 - b _0231CABC ; case 152 - b _0231CABC ; case 153 - b _0231CABC ; case 154 - b _0231CABC ; case 155 - b _0231CABC ; case 156 - b _0231CABC ; case 157 - b _0231CABC ; case 158 - b _0231CABC ; case 159 - b _0231CABC ; case 160 - b _0231CABC ; case 161 - b _0231CABC ; case 162 - b _0231CABC ; case 163 - b _0231CABC ; case 164 - b _0231CABC ; case 165 - b _0231CABC ; case 166 - b _0231C81C ; case 167 - b _0231C82C ; case 168 - b _0231C844 ; case 169 - b _0231C8B0 ; case 170 - b _0231C91C ; case 171 - b _0231C988 ; case 172 - b _0231CABC ; case 173 - b _0231CABC ; case 174 - b _0231CABC ; case 175 - b _0231CABC ; case 176 - b _0231CABC ; case 177 - b _0231CABC ; case 178 - b _0231CA50 ; case 179 - b _0231C9F4 ; case 180 - b _0231CABC ; case 181 - b _0231C65C ; case 182 -_0231BCC0: - ldr r1, _0231C6E0 ; =0x0000016B - cmp r0, r1 - beq _0231CB14 - b _0231CABC -_0231BCD0: - ldr r1, _0231C6E4 ; =0x00000192 - cmp r0, r1 - bgt _0231BCF0 - bge _0231CA60 - sub r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BCF0: - add r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BD00: - cmp r0, #0x198 - bgt _0231BD3C - bge _0231CA60 - ldr r1, _0231C6E8 ; =0x00000196 - cmp r0, r1 - bgt _0231BD2C - bge _0231CA60 - sub r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BD2C: - add r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BD3C: - ldr r1, _0231C6EC ; =0x0000019A - cmp r0, r1 - bgt _0231BD5C - bge _0231CA60 - sub r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BD5C: - add r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BD6C: - cmp r0, #0x1a4 - bgt _0231BDE4 - bge _0231CA60 - cmp r0, #0x1a0 - bgt _0231BDB4 - bge _0231CA60 - ldr r1, _0231C6F0 ; =0x0000019E - cmp r0, r1 - bgt _0231BDA4 - bge _0231CA60 - sub r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BDA4: - add r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BDB4: - ldr r1, _0231C6F4 ; =0x000001A2 - cmp r0, r1 - bgt _0231BDD4 - bge _0231CA60 - sub r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BDD4: - add r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BDE4: - cmp r0, #0x1a8 - bgt _0231BE20 - bge _0231CA60 - ldr r1, _0231C6F8 ; =0x000001A6 - cmp r0, r1 - bgt _0231BE10 - bge _0231CA60 - sub r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BE10: - add r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BE20: - ldr r1, _0231C6FC ; =0x000001AA - cmp r0, r1 - bgt _0231BE40 - bge _0231CA60 - sub r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BE40: - add r1, r1, #1 - cmp r0, r1 - beq _0231CA60 - b _0231CABC -_0231BE50: - ldr r1, _0231C700 ; =0x00000195 - add r0, sp, #0x52 - bl InitMove - ldr r0, _0231C704 ; =STICK_POWER - mov r4, #0x100 - ldrsh r3, [r0] - str r4, [sp] - mov r4, #1 - add r2, sp, #0x52 - mov r0, r8 - mov r1, r7 - str r4, [sp, #4] - bl DealDamageProjectile - b _0231CB14 -_0231BE88: - ldr r1, _0231C700 ; =0x00000195 - add r0, sp, #0x4a - bl InitMove - ldr r0, _0231C708 ; =IRON_THORN_POWER - mov r4, #0x100 - ldrsh r3, [r0] - str r4, [sp] - mov r4, #2 - add r2, sp, #0x4a - mov r0, r8 - mov r1, r7 - str r4, [sp, #4] - bl DealDamageProjectile - b _0231CB14 -_0231BEC0: - ldr r1, _0231C700 ; =0x00000195 - add r0, sp, #0x42 - bl InitMove - ldr r0, _0231C70C ; =SILVER_SPIKE_POWER - mov r4, #0x100 - ldrsh r3, [r0] - str r4, [sp] - mov r4, #3 - add r2, sp, #0x42 - mov r0, r8 - mov r1, r7 - str r4, [sp, #4] - bl DealDamageProjectile - b _0231CB14 -_0231BEF8: - ldr r1, _0231C700 ; =0x00000195 - add r0, sp, #0x3a - bl InitMove - ldr r0, _0231C710 ; =GOLD_FANG_POWER - mov r4, #0x100 - ldrsh r3, [r0] - str r4, [sp] - mov r4, #4 - add r2, sp, #0x3a - mov r0, r8 - mov r1, r7 - str r4, [sp, #4] - bl DealDamageProjectile - b _0231CB14 -_0231BF30: - ldr r1, _0231C700 ; =0x00000195 - add r0, sp, #0x32 - bl InitMove - ldr r0, _0231C714 ; =CACNEA_SPIKE_POWER - mov r4, #0x100 - ldrsh r3, [r0] - str r4, [sp] - mov r4, #5 - add r2, sp, #0x32 - mov r0, r8 - mov r1, r7 - str r4, [sp, #4] - bl DealDamageProjectile - b _0231CB14 -_0231BF68: - ldr r1, _0231C700 ; =0x00000195 - add r0, sp, #0x2a - bl InitMove - ldr r0, _0231C718 ; =CORSOLA_TWIG_POWER - mov r4, #0x100 - ldrsh r3, [r0] - str r4, [sp] - mov r4, #6 - add r2, sp, #0x2a - mov r0, r8 - mov r1, r7 - str r4, [sp, #4] - bl DealDamageProjectile - b _0231CB14 -_0231BFA0: - mov r4, #0 - str r4, [sp] - ldr r0, _0231C71C ; =GEO_PEBBLE_DAMAGE - ldr r1, _0231C720 ; =0x0000024F - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - ldrsh r2, [r0] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231BFDC: - mov r4, #0 - str r4, [sp] - ldr r0, _0231C724 ; =GRAVELEROCK_DAMAGE - ldr r1, _0231C720 ; =0x0000024F - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - ldrsh r2, [r0] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231C018: - ldr r1, _0231C700 ; =0x00000195 - add r0, sp, #0x22 - bl InitMove - ldr r0, _0231C728 ; =GOLD_THORN_POWER - mov r4, #0x100 - ldrsh r3, [r0] - str r4, [sp] - mov r4, #9 - add r2, sp, #0x22 - mov r0, r8 - mov r1, r7 - str r4, [sp, #4] - bl DealDamageProjectile - b _0231CB14 -_0231C050: - mov r4, #0 - str r4, [sp] - ldr r0, _0231C72C ; =RARE_FOSSIL_DAMAGE - ldr r1, _0231C720 ; =0x0000024F - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - ldrsh r2, [r0] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231C08C: - mov r0, r8 - mov r1, r7 - mov r3, sl - mov r2, #1 - bl EndNegativeStatusConditionWrapper - b _0231CB14 -_0231C0A4: - ldr r1, _0231C730 ; =ORAN_BERRY_HP_RESTORATION - ldr r0, _0231C734 ; =ORAN_BERRY_FULL_HP_BOOST - ldrsh r2, [r1] - ldrsh r3, [r0] - mov r4, #1 - mov r0, r8 - mov r1, r7 - str r4, [sp] - bl TryIncreaseHp - b _0231CB14 -_0231C0CC: - ldr r1, _0231C738 ; =SITRUS_BERRY_HP_RESTORATION - ldr r0, _0231C73C ; =SITRUS_BERRY_FULL_HP_BOOST - ldrsh r2, [r1] - ldrsh r3, [r0] - mov r4, #1 - mov r0, r8 - mov r1, r7 - str r4, [sp] - bl TryIncreaseHp - b _0231CB14 -_0231C0F4: - ldr r0, _0231C740 ; =LIFE_SEED_HP_BOOST - mov r4, #1 - ldrsh r3, [r0] - mov r0, r8 - mov r1, r7 - mov r2, #0 - str r4, [sp] - bl TryIncreaseHp - b _0231CB14 -_0231C118: - mov r2, #0 - mov r0, r8 - mov r1, r7 - mov r3, r2 - bl TryInflictBlinkerStatus - b _0231CB14 -_0231C130: - mov r0, r8 - mov r1, r7 - mov r2, #0 - bl TryInflictCrossEyedStatus - b _0231CB14 -_0231C144: - mov r0, r8 - mov r1, r7 - mov r2, #0 - mov r3, #1 - bl BoostSpeedOneStage - b _0231CB14 -_0231C15C: - mov r0, r8 - mov r1, r7 - bl TryInflictEyedropStatus - b _0231CB14 -_0231C16C: - mov r0, r8 - mov r1, r7 - mov r2, #1 - mov r3, #0 - bl TryInflictConfusedStatus - b _0231CB14 -_0231C184: - mov r0, r8 - mov r1, r7 - bl ApplyCheriBerryEffect - b _0231CB14 -_0231C194: - mov r0, r8 - mov r1, r7 - bl ApplyPechaBerryEffect - b _0231CB14 -_0231C1A4: - mov r2, #0 - mov r0, r8 - mov r1, r7 - mov r3, r2 - bl TryWarp - b _0231CB14 -_0231C1BC: - ldr r1, _0231C744 ; =SLEEP_TURN_RANGE - mov r0, r7 - mov r2, #1 - bl CalcStatusDuration - mov r2, r0 - mov r0, r8 - mov r1, r7 - mov r3, #1 - bl TryInflictSleepStatus - b _0231CB14 -_0231C1E4: - mov r0, r8 - mov r1, r7 - bl TryInflictSleeplessStatus - b _0231CB14 -_0231C1F4: - mov r2, #1 - mov r0, r8 - mov r1, r7 - mov r3, r2 - str r2, [sp] - bl LevelUpItemEffect - b _0231CB14 -_0231C210: - mov r0, r8 - mov r1, r7 - mov r2, #1 - bl TryDecreaseLevel - b _0231CB14 -_0231C224: - mov r0, r8 - mov r1, r7 - bl TryInflictPetrifiedStatus - b _0231CB14 -_0231C234: - ldr r2, _0231C748 ; =0x00000BE9 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231C248: - mov r0, r8 - mov r1, r7 - bl ApplyRawstBerryEffect - b _0231CB14 -_0231C258: - mov r0, r8 - mov r1, r7 - bl ApplyHungerSeedEffect - b _0231CB14 -_0231C268: - mov r0, r8 - mov r1, r7 - bl ApplyGinsengEffect - b _0231CB14 -_0231C278: - mov r0, r8 - mov r1, r7 - mov r2, sb - bl ApplyBlastSeedEffect - b _0231CB14 -_0231C28C: - ldr r2, _0231C74C ; =0x000003E7 - mov r0, r8 - mov r1, r7 - mov r3, #0 - bl RestoreAllMovePP - b _0231CB14 -_0231C2A4: - ldr r1, _0231C750 ; =PROTEIN_STAT_BOOST - mov r0, r8 - ldrsh r2, [r1] - mov r1, r7 - bl ApplyProteinEffect - b _0231CB14 -_0231C2BC: - ldr r1, _0231C754 ; =CALCIUM_STAT_BOOST - mov r0, r8 - ldrsh r2, [r1] - mov r1, r7 - bl ApplyCalciumEffect - b _0231CB14 -_0231C2D4: - ldr r1, _0231C758 ; =IRON_STAT_BOOST - mov r0, r8 - ldrsh r2, [r1] - mov r1, r7 - bl ApplyIronEffect - b _0231CB14 -_0231C2EC: - ldr r1, _0231C75C ; =ZINC_STAT_BOOST - mov r0, r8 - ldrsh r2, [r1] - mov r1, r7 - bl ApplyZincEffect - b _0231CB14 -_0231C304: - mov r0, r8 - mov r1, r7 - mov r2, #1 - mov r3, #0 - bl EndNegativeStatusConditionWrapper - b _0231CB14 -_0231C31C: - mov r3, #1 - mov r0, r8 - mov r1, r7 - mov r2, #5 - str r3, [sp] - bl LevelUpItemEffect - b _0231CB14 -_0231C338: - mov r0, r8 - mov r1, r7 - bl ApplyVileSeedEffect - b _0231CB14 -_0231C348: - mov r0, r8 - mov r1, r7 - mov r2, #4 - mov r3, #0 - bl TryWarp - b _0231CB14 -_0231C360: - mov r0, r8 - mov r1, r7 - bl ApplyViolentSeedEffect - b _0231CB14 -_0231C370: - mov r0, r8 - mov r1, r7 - bl TryInflictInvisibleStatus - b _0231CB14 -_0231C380: - mov r0, r7 - mov r1, #0xa - mov r2, #0 - bl BoostIQ - b _0231CB14 -_0231C394: - mov r4, #1 - mov r0, r8 - mov r1, r7 - mov r2, #0x32 - mov r3, #5 - str r4, [sp] - bl TryIncreaseBelly - b _0231CB14 -_0231C3B4: - mov r4, #1 - mov r0, r8 - mov r1, r7 - mov r2, #0x64 - mov r3, #0xa - str r4, [sp] - bl TryIncreaseBelly - b _0231CB14 -_0231C3D4: - mov r4, #1 - mov r0, r8 - mov r1, r7 - rsb r2, r4, #0x3e8 - mov r3, #0xa - str r4, [sp] - bl TryIncreaseBelly - b _0231CB14 -_0231C3F4: - mov r0, r8 - mov r1, r7 - bl ApplyGrimyFoodEffect - b _0231CB14 -_0231C404: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #1 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C420: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #2 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C43C: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #3 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C458: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #4 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C474: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #5 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C490: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #6 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C4AC: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #7 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C4C8: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #8 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C4E4: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #9 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C500: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0xa - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C51C: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0xb - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C538: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0xc - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C554: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0xd - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C570: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0xe - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C58C: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0xf - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C5A8: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0x10 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C5C4: - ldr r1, _0231C760 ; =GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0x11 - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C5E0: - ldr r1, _0231C764 ; =WONDER_GUMMI_STAT_BOOST - mov r0, r8 - ldrsh r3, [r1] - mov r1, r7 - mov r2, #0xff - bl ApplyGummiBoostsDungeonMode - b _0231CB14 -_0231C5FC: - mov r4, #1 - mov r0, r8 - mov r1, r7 - mov r2, #0x32 - mov r3, #5 - str r4, [sp] - bl TryIncreaseBelly - b _0231CB14 -_0231C61C: - mov r4, #1 - mov r0, r8 - mov r1, r7 - mov r2, #0xa - mov r3, #0 - str r4, [sp] - bl TryIncreaseBelly - b _0231CB14 -_0231C63C: - mov r4, #1 - mov r0, r8 - mov r1, r7 - rsb r2, r4, #0x3e8 - mov r3, #0x32 - str r4, [sp] - bl TryIncreaseBelly - b _0231CB14 -_0231C65C: - cmp sb, #0 - beq _0231C6A4 - add r1, sp, #0x1f - ldr r0, _0231C6D8 ; =ov10_022C4558 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231C6A4: - mov r0, r8 - bl ApplyKeyEffect - b _0231CB14 -_0231C6B0: - mov r0, r8 - mov r1, r7 - bl TryInflictDropeyeStatus - b _0231CB14 - .align 2, 0 -#ifdef JAPAN -#define APPLY_ITEM_EFFECT_OFFSET -0x2C1 -#else -#define APPLY_ITEM_EFFECT_OFFSET 0 -#endif -_0231C6C0: .word 0x000001AB -_0231C6C4: .word 0x00001317 -_0231C6C8: .word 0x00000BE6 + APPLY_ITEM_EFFECT_OFFSET -_0231C6CC: .word 0x00000BE7 + APPLY_ITEM_EFFECT_OFFSET -_0231C6D0: .word ov10_022C4574 -_0231C6D4: .word 0x00000256 -_0231C6D8: .word ov10_022C4558 -_0231C6DC: .word 0x00000BE8 + APPLY_ITEM_EFFECT_OFFSET -_0231C6E0: .word 0x0000016B -_0231C6E4: .word 0x00000192 -_0231C6E8: .word 0x00000196 -_0231C6EC: .word 0x0000019A -_0231C6F0: .word 0x0000019E -_0231C6F4: .word 0x000001A2 -_0231C6F8: .word 0x000001A6 -_0231C6FC: .word 0x000001AA -_0231C700: .word 0x00000195 -_0231C704: .word STICK_POWER -_0231C708: .word IRON_THORN_POWER -_0231C70C: .word SILVER_SPIKE_POWER -_0231C710: .word GOLD_FANG_POWER -_0231C714: .word CACNEA_SPIKE_POWER -_0231C718: .word CORSOLA_TWIG_POWER -_0231C71C: .word GEO_PEBBLE_DAMAGE -_0231C720: .word 0x0000024F -_0231C724: .word GRAVELEROCK_DAMAGE -_0231C728: .word GOLD_THORN_POWER -_0231C72C: .word RARE_FOSSIL_DAMAGE -_0231C730: .word ORAN_BERRY_HP_RESTORATION -_0231C734: .word ORAN_BERRY_FULL_HP_BOOST -_0231C738: .word SITRUS_BERRY_HP_RESTORATION -_0231C73C: .word SITRUS_BERRY_FULL_HP_BOOST -_0231C740: .word LIFE_SEED_HP_BOOST -_0231C744: .word SLEEP_TURN_RANGE -_0231C748: .word 0x00000BE9 + APPLY_ITEM_EFFECT_OFFSET -_0231C74C: .word 0x000003E7 -_0231C750: .word PROTEIN_STAT_BOOST -_0231C754: .word CALCIUM_STAT_BOOST -_0231C758: .word IRON_STAT_BOOST -_0231C75C: .word ZINC_STAT_BOOST -_0231C760: .word GUMMI_STAT_BOOST -_0231C764: .word WONDER_GUMMI_STAT_BOOST -_0231C768: - mov r0, r8 - mov r1, r7 - bl TryInflictSlipStatus - cmp r0, #0 - bne _0231CB14 - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _0231CBAC ; =0x00000C75 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231C7A0: - mov r0, r8 - mov r1, r7 - bl ApplyViaSeedEffect - b _0231CB14 -_0231C7B0: - mov r0, r8 - mov r1, r7 - bl ApplyMixElixirEffect - b _0231CB14 -_0231C7C0: - mov r4, #0 - str r4, [sp] - ldr r0, _0231CBB0 ; =OREN_BERRY_DAMAGE - str r4, [sp, #4] - mov r1, #0x270 - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - ldrsh r2, [r0] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231C7FC: - mov r0, r8 - mov r1, r7 - bl ApplyDoughSeedEffect - b _0231CB14 -_0231C80C: - mov r0, r8 - mov r1, r7 - bl ApplyGravelyrockEffect - b _0231CB14 -_0231C81C: - mov r0, r8 - mov r1, r7 - bl ApplyGonePebbleEffect - b _0231CB14 -_0231C82C: - mov r2, #0 - mov r0, r8 - mov r1, r7 - mov r3, r2 - bl TryInflictBlinkerStatus - b _0231CB14 -_0231C844: - cmp sb, #0 - beq _0231C88C - add r1, sp, #0x1e - ldr r0, _0231C6D8 ; =ov10_022C4558 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231C88C: - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _0231CBB4 ; =0x00000C67 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231C8B0: - cmp sb, #0 - beq _0231C8F8 - add r1, sp, #0x1d - ldr r0, _0231C6D8 ; =ov10_022C4558 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231C8F8: - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _0231CBB4 ; =0x00000C67 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231C91C: - cmp sb, #0 - beq _0231C964 - add r1, sp, #0x1c - ldr r0, _0231C6D8 ; =ov10_022C4558 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231C964: - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _0231CBB4 ; =0x00000C67 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231C988: - cmp sb, #0 - beq _0231C9D0 - add r1, sp, #0x1b - ldr r0, _0231C6D8 ; =ov10_022C4558 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231C9D0: - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _0231CBB4 ; =0x00000C67 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231C9F4: - cmp sb, #0 - beq _0231CA3C - add r1, sp, #0x1a - ldr r0, _0231C6D8 ; =ov10_022C4558 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231CA3C: - ldr r2, _0231CBB8 ; =0x00000C76 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231CA50: - mov r0, r8 - mov r1, r7 - bl ApplyGracideaEffect - b _0231CB14 -_0231CA60: - cmp sb, #0 - beq _0231CAA8 - add r1, sp, #0x19 - ldr r0, _0231CBBC ; =ov10_022C44EC - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231CAA8: - ldr r2, _0231C6DC ; =0x00000BE8 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231CB14 -_0231CABC: - cmp sb, #0 - beq _0231CB04 - add r1, sp, #0x18 - ldr r0, _0231C6D8 ; =ov10_022C4558 - str r1, [sp] - mov r4, #0 - ldrsh r2, [r0] - ldr r1, _0231C6D4 ; =0x00000256 - str r4, [sp, #4] - str r1, [sp, #8] - str r4, [sp, #0xc] - str r4, [sp, #0x10] - mov r0, r8 - mov r1, r7 - mov r3, #1 - str r4, [sp, #0x14] - bl CalcDamageFixedNoCategory - b _0231CB14 -_0231CB04: - ldr r2, _0231C6DC ; =0x00000BE8 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget -_0231CB14: - mov r0, r7 - bl EntityIsValid__0231CBC8 - cmp r0, #0 - beq _0231CB9C - ldr r1, [r7, #0xb4] - ldrsh r4, [r6, #4] - ldrb r0, [r1, #6] - cmp r0, #0 - movne r0, #0 - bne _0231CB48 -#ifdef JAPAN - add r0, r1, #0x224 -#else - add r0, r1, #0x228 -#endif - mov r1, #0x5d - bl ExclusiveItemEffectFlagTest -_0231CB48: - cmp r0, #0 - beq _0231CB9C - ldr r0, _0231CBC0 ; =APPLES_AND_BERRIES_ITEM_IDS - b _0231CB90 -_0231CB58: - cmp r4, r1 - bne _0231CB8C - mov r0, #0xa - bl ov29_0234BA54 - ldr r0, _0231CBC4 ; =ov10_022C4864 - mov r4, #1 - ldr r2, [r0] - mov r0, r8 - mov r1, r7 - mov r3, #0 - str r4, [sp] - bl TryIncreaseHp - b _0231CB9C -_0231CB8C: - add r0, r0, #2 -_0231CB90: - ldrsh r1, [r0] - cmp r1, #0 - bne _0231CB58 -_0231CB9C: -#ifdef EUROPE - mov r0, #1 - bl ov29_022FB920 -#endif - mov r0, r8 - bl EnemyEvolution -_0231CBA4: - add sp, sp, #0x5c - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, pc} - .align 2, 0 -_0231CBAC: .word 0x00000C75 + APPLY_ITEM_EFFECT_OFFSET -_0231CBB0: .word OREN_BERRY_DAMAGE -_0231CBB4: .word 0x00000C67 + APPLY_ITEM_EFFECT_OFFSET -_0231CBB8: .word 0x00000C76 + APPLY_ITEM_EFFECT_OFFSET -_0231CBBC: .word ov10_022C44EC -_0231CBC0: .word APPLES_AND_BERRIES_ITEM_IDS -_0231CBC4: .word ov10_022C4864 - arm_func_end ApplyItemEffect diff --git a/asm/overlay_29_0231B33C.s b/asm/overlay_29_0231B33C.s new file mode 100644 index 00000000..a30fcd94 --- /dev/null +++ b/asm/overlay_29_0231B33C.s @@ -0,0 +1,1798 @@ + .include "asm/macros.inc" + .include "overlay_29_0231B33C.inc" + + .text + + arm_func_start ActivateStench +ActivateStench: ; 0x0231B33C + stmdb sp!, {r4, lr} + ldr r4, [r0, #0xb4] + bl ov29_022E60E4 + ldr r0, _0231B360 ; =ov10_022C457C + mov r1, #2 + ldrsh r0, [r0] +#ifdef JAPAN + strb r1, [r4, #0x103] + strb r0, [r4, #0x104] +#else + strb r1, [r4, #0x104] + strb r0, [r4, #0x105] +#endif + ldmia sp!, {r4, pc} + .align 2, 0 +_0231B360: .word ov10_022C457C + arm_func_end ActivateStench + + arm_func_start TryActivateSteadfast +TryActivateSteadfast: ; 0x0231B364 + stmdb sp!, {r3, r4, r5, lr} + mov r4, r1 + mov r5, r0 + mov r0, r4 + mov r1, #0x70 + bl AbilityIsActiveVeneer + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, r5 + mov r1, r4 + mov r2, #0 + mov r3, #1 + bl BoostSpeedOneStage + ldmia sp!, {r3, r4, r5, pc} + arm_func_end TryActivateSteadfast + + arm_func_start ov29_0231B39C +ov29_0231B39C: ; 0x0231B39C + mov ip, #0 + mov r3, ip +_0231B3A4: + add r1, ip, #1 + mov r1, r1, lsl #0x10 + strb r3, [r0, ip, lsl #2] + add r2, r0, ip, lsl #2 + mov ip, r1, asr #0x10 + strh r3, [r2, #2] + cmp ip, #8 + blt _0231B3A4 + strh r3, [r0, #0x20] + bx lr + arm_func_end ov29_0231B39C + + arm_func_start ov29_0231B3CC +ov29_0231B3CC: ; 0x0231B3CC + ldrsh r3, [r0, #0x20] + cmp r3, #8 + bxge lr + mov r2, #1 + strb r2, [r0, r3, lsl #2] + ldrsh r2, [r0, #0x20] + add r2, r0, r2, lsl #2 + strh r1, [r2, #2] + ldrsh r1, [r0, #0x20] + add r1, r1, #1 + strh r1, [r0, #0x20] + bx lr + arm_func_end ov29_0231B3CC + + arm_func_start IsInSpawnList +IsInSpawnList: ; 0x0231B3FC + stmdb sp!, {r4, r5, r6, lr} + mov r5, r0 + mov r0, r1 + bl FemaleToMaleForm + mov r4, r0 + mov r6, #0 + b _0231B44C +_0231B418: + ldrb r0, [r5, r6, lsl #2] + mov r1, r6, lsl #2 + cmp r0, #0 + beq _0231B440 + add r0, r5, r1 + ldrsh r0, [r0, #2] + bl FemaleToMaleForm + cmp r4, r0 + moveq r0, #1 + ldmeqia sp!, {r4, r5, r6, pc} +_0231B440: + add r0, r6, #1 + mov r0, r0, lsl #0x10 + mov r6, r0, asr #0x10 +_0231B44C: + ldrsh r0, [r5, #0x20] + cmp r6, r0 + blt _0231B418 + mov r0, #0 + ldmia sp!, {r4, r5, r6, pc} + arm_func_end IsInSpawnList + + arm_func_start ov29_0231B460 +ov29_0231B460: ; 0x0231B460 + stmdb sp!, {r3, lr} + ldr r0, _0231B48C ; =DUNGEON_PTR + ldr r2, [r0] + add r0, r2, #0x700 + ldrsh r1, [r0, #0xa8] + cmp r1, #0 + ldmeqia sp!, {r3, pc} + ldrsh r1, [r0, #0xa8] + add r0, r2, #0x7d0 + bl ov29_0231B3CC + ldmia sp!, {r3, pc} + .align 2, 0 +_0231B48C: .word DUNGEON_PTR + arm_func_end ov29_0231B460 + + arm_func_start ov29_0231B490 +ov29_0231B490: ; 0x0231B490 + ldr r0, _0231B4A8 ; =DUNGEON_PTR + mov r1, #0 + ldr r0, [r0] + add r0, r0, #0x3000 +#ifdef JAPAN + strb r1, [r0, #0xd98] +#else + strb r1, [r0, #0xe3c] +#endif + bx lr + .align 2, 0 +_0231B4A8: .word DUNGEON_PTR + arm_func_end ov29_0231B490 + + arm_func_start ov29_0231B4AC +ov29_0231B4AC: ; 0x0231B4AC + stmdb sp!, {r3, lr} + cmp r0, #0 + ldreq r0, _0231B4E8 ; =DUNGEON_PTR + ldreq r0, [r0] + addeq r0, r0, #0x3000 +#ifdef JAPAN + ldreqb r0, [r0, #0xd98] +#else + ldreqb r0, [r0, #0xe3c] +#endif + ldmeqia sp!, {r3, pc} + cmp r0, #1 + movne r0, #0 + ldmneia sp!, {r3, pc} + ldr r0, _0231B4E8 ; =DUNGEON_PTR + ldr r0, [r0] + ldrb r0, [r0, #0x748] + bl IsSkyExclusiveDungeon + ldmia sp!, {r3, pc} + .align 2, 0 +_0231B4E8: .word DUNGEON_PTR + arm_func_end ov29_0231B4AC + + arm_func_start ChangeShayminForme +ChangeShayminForme: ; 0x0231B4EC + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + mov r8, r0 + ldr r7, [r8, #0xb4] + cmp r1, #1 + mov r6, #0 + ldrsh r0, [r7, #2] + bne _0231B548 + bl IsShaymin + cmp r0, #0 + moveq r0, r6 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + ldrsh r4, [r7, #2] + ldr r0, _0231B680 ; =0x00000216 + cmp r4, r0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + ldrb r1, [r7, #0xc4] + cmp r1, #1 + moveq r0, #2 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + add r5, r0, #1 + mov r6, #1 + b _0231B570 +_0231B548: + bl IsShaymin + cmp r0, #0 + moveq r0, r6 + ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + ldrsh r4, [r7, #2] + ldr r0, _0231B684 ; =0x00000217 + cmp r4, r0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + sub r5, r0, #1 +_0231B570: + ldrsh r0, [r7, #0xc] + bl GetActiveTeamMember + mov sb, r0 + cmp r6, #0 + beq _0231B5A0 + mov r0, r8 + mov r1, #0x2b8 + mov r2, #0 + bl ov29_022E3590 + mov r0, #0x21 + mov r1, #0x42 + bl ov29_022EA370 +_0231B5A0: + mov r0, #0 + bl ov29_022E9FD0 + mov r0, r4 + mov r1, r5 + bl SwapMonsterWanFileIndex + strh r5, [r7, #2] + ldrsh r0, [r7, #2] + strh r0, [r7, #4] + strh r0, [sb, #0xc] + strh r5, [r7, #2] + ldrsh r0, [r7, #2] + strh r0, [r7, #4] + ldr r4, [r8, #0xb4] + ldrsh r0, [r4, #4] + bl DungeonGetSpriteIndex + strh r0, [r8, #0xa8] + ldrb r0, [r4, #0xd8] + cmp r0, #2 + beq _0231B5F4 + add r0, r8, #0x2c + bl sub_0201CF80 +_0231B5F4: + mov r0, r8 + bl GetIdleAnimationId + mov r1, r0 + mov r0, r8 + bl ov29_02304830 + mov r0, r8 + bl DetermineMonsterShadow + mov r0, r8 + bl SetMonsterTypeAndAbility + mov r0, #1 + bl ov29_022E9FD0 + ldr r0, _0231B684 ; =0x00000217 + cmp r5, r0 + ldreq r0, _0231B688 ; =DUNGEON_PTR + moveq r1, #1 + ldrne r0, _0231B688 ; =DUNGEON_PTR + movne r1, #0 + ldr r0, [r0] + add r0, r0, #0x3000 +#ifdef JAPAN + strb r1, [r0, #0xd98] +#else + strb r1, [r0, #0xe3c] +#endif + bl sub_020017EC + bl ov29_022E81F8 + mov r0, #1 + mov r1, #0x42 + bl ov29_022EA370 + cmp r6, #0 + beq _0231B678 + mov r0, r8 + bl ov29_022F04F0 +#ifdef JAPAN + mov r0, #2 +#else + mov r0, #1 +#endif + bl AnimationDelayOrSomething + mov r0, r8 + bl ov29_022F0518 +_0231B678: + mov r0, #3 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + .align 2, 0 +_0231B680: .word 0x00000216 +_0231B684: .word 0x00000217 +_0231B688: .word DUNGEON_PTR + arm_func_end ChangeShayminForme + + arm_func_start ApplyItemEffect +ApplyItemEffect: ; 0x0231B68C + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, lr} + sub sp, sp, #0x5c + movs sb, r0 + mov sl, r2 + mov r8, r3 + ldr r7, [sp, #0x80] + ldr r6, [sp, #0x84] + beq _0231B840 + cmp r1, #0 + bne _0231B840 + mov r0, r7 + ldr r5, [r7, #0xb4] + mov r4, #0 + bl ov29_022FB9BC + cmp r0, #0 + beq _0231B6E4 + mov r0, r8 + mov r2, r6 + add r1, r7, #4 + mov r3, r4 + bl SpawnDroppedItemWrapper + b _0231CBA4 +_0231B6E4: + ldrb r0, [r5, #6] + cmp r0, #0 + ldrsh r0, [r6, #4] + beq _0231B74C + bl GetItemCategoryVeneer + cmp r0, #0 + beq _0231B720 + ldrsh r0, [r6, #4] + bl GetItemCategoryVeneer + cmp r0, #2 + beq _0231B720 + ldrsh r0, [r6, #4] + bl GetItemCategoryVeneer + cmp r0, #1 + movne r4, #1 +_0231B720: + ldrsh r0, [r6, #4] + bl GetItemCategoryVeneer + cmp r0, #4 + bne _0231B768 + ldrsh r1, [r6, #4] + cmp r1, #0x190 + blt _0231B768 + ldr r0, _0231C6C0 ; =0x000001AB + cmp r1, r0 + movle r4, #0 + b _0231B768 +_0231B74C: + bl GetItemCategoryVeneer + cmp r0, #2 + beq _0231B768 + mov r0, r7 + mov r1, #2 + bl IqSkillIsEnabled + mov r4, r0 +_0231B768: + mov r0, r7 + bl CheckVariousConditions + cmp r0, #0 + movne r4, #0 + cmp r4, #0 + beq _0231B840 + ldrb r0, [r5, #0x62] + tst r0, #1 + movne r0, #1 + moveq r0, #0 + tst r0, #0xff + bne _0231B840 + ldrb r0, [r5, #6] + cmp r0, #0 + bne _0231B7B0 + bl IsBagFull + cmp r0, #0 + bne _0231B840 +_0231B7B0: + ldrb r0, [r5, #9] + cmp r0, #1 + bne _0231B7D4 + mov r0, r8 + mov r2, r6 + add r1, r7, #4 + mov r3, #0 + bl SpawnDroppedItemWrapper + b _0231CBA4 +_0231B7D4: + ldr r0, _0231C6C4 ; =0x00001317 + bl ov29_022EACCC + mov r1, r6 + mov r0, #0 + bl ov29_02344B44 + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _0231C6C8 ; =0x00000BE6 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + ldrh r0, [r6] + strh r0, [r5, #0x62] + ldrh r0, [r6, #2] + strh r0, [r5, #0x64] + ldrh r0, [r6, #4] + strh r0, [r5, #0x66] + ldrb r0, [r5, #6] + cmp r0, #0 + bne _0231B834 + mov r0, r5 + bl AddHeldItemToBag +_0231B834: + mov r0, r7 + bl ov29_022F9EA0 + b _0231CBA4 +_0231B840: + cmp sb, #0 + beq _0231B860 + mov r0, r7 + mov r1, r6 + bl ov29_022E5A00 + mov r0, r8 + mov r1, r7 + bl UpdateShopkeeperModeAfterAttack +_0231B860: + ldrb r0, [r6] + tst r0, #8 + movne r0, #1 + moveq r0, #0 + tst r0, #0xff + beq _0231B8E4 + mov r1, r6 + mov r0, #0 + bl ov29_02344B44 + ldr r2, _0231C6CC ; =0x00000BE7 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + cmp sb, #0 + beq _0231B8E4 + add r1, sp, #0x21 + ldr r0, _0231C6D0 ; =ov10_022C4574 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + mov r0, r8 + bl EnemyEvolution + b _0231CBA4 +_0231B8E4: + cmp sb, #0 + bne _0231B8F8 + mov r0, r7 + mov r1, r6 + bl ov29_022E5AE4 +_0231B8F8: + mov r0, r8 + mov r1, r6 + bl ov29_0230F9A4 + ldrsh r0, [r6, #4] + bl GetItemCategoryVeneer + cmp r0, #2 + bne _0231B92C + mov r3, #0 + mov r0, r8 + mov r1, r7 + mov r2, #5 + str r3, [sp] + bl TryIncreaseBelly +_0231B92C: + ldrsh r0, [r6, #4] + bl GetItemCategoryVeneer + cmp r0, #5 + beq _0231B94C + ldrsh r0, [r6, #4] + bl GetItemCategoryVeneer + cmp r0, #0xa + bne _0231B9A8 +_0231B94C: + cmp sb, #0 + beq _0231B994 + add r1, sp, #0x20 + ldr r0, _0231C6D8 ; =ov10_022C4558 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231B994: + ldr r2, _0231C6DC ; =0x00000BE8 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231B9A8: + ldrsh r0, [r6, #4] + cmp r0, #0x19c + bgt _0231BD6C + bge _0231CA60 + cmp r0, #0x194 + bgt _0231BD00 + bge _0231CA60 + cmp r0, #0x190 + bgt _0231BCD0 + bge _0231CA60 + cmp r0, #0xb6 + bgt _0231BCC0 + cmp r0, #0 + addge pc, pc, r0, lsl #2 + b _0231CABC +_0231B9E4: ; jump table + b _0231CABC ; case 0 + b _0231BE50 ; case 1 + b _0231BE88 ; case 2 + b _0231BEC0 ; case 3 + b _0231BEF8 ; case 4 + b _0231BF30 ; case 5 + b _0231BF68 ; case 6 + b _0231BFDC ; case 7 + b _0231BFA0 ; case 8 + b _0231C018 ; case 9 + b _0231C050 ; case 10 + b _0231CABC ; case 11 + b _0231CABC ; case 12 + b _0231CABC ; case 13 + b _0231CABC ; case 14 + b _0231CABC ; case 15 + b _0231CABC ; case 16 + b _0231CABC ; case 17 + b _0231CABC ; case 18 + b _0231CABC ; case 19 + b _0231CABC ; case 20 + b _0231CABC ; case 21 + b _0231CABC ; case 22 + b _0231CABC ; case 23 + b _0231CABC ; case 24 + b _0231CABC ; case 25 + b _0231CABC ; case 26 + b _0231CABC ; case 27 + b _0231CABC ; case 28 + b _0231CABC ; case 29 + b _0231CABC ; case 30 + b _0231CABC ; case 31 + b _0231CABC ; case 32 + b _0231CABC ; case 33 + b _0231CABC ; case 34 + b _0231CABC ; case 35 + b _0231CABC ; case 36 + b _0231CABC ; case 37 + b _0231CABC ; case 38 + b _0231CABC ; case 39 + b _0231CABC ; case 40 + b _0231CABC ; case 41 + b _0231CABC ; case 42 + b _0231CABC ; case 43 + b _0231CABC ; case 44 + b _0231CABC ; case 45 + b _0231CABC ; case 46 + b _0231CABC ; case 47 + b _0231CABC ; case 48 + b _0231CABC ; case 49 + b _0231CABC ; case 50 + b _0231CABC ; case 51 + b _0231CABC ; case 52 + b _0231CABC ; case 53 + b _0231CABC ; case 54 + b _0231CABC ; case 55 + b _0231CABC ; case 56 + b _0231CABC ; case 57 + b _0231CABC ; case 58 + b _0231CABC ; case 59 + b _0231CABC ; case 60 + b _0231CABC ; case 61 + b _0231CABC ; case 62 + b _0231CABC ; case 63 + b _0231CABC ; case 64 + b _0231CABC ; case 65 + b _0231CABC ; case 66 + b _0231CABC ; case 67 + b _0231CABC ; case 68 + b _0231C08C ; case 69 + b _0231C0A4 ; case 70 + b _0231C0CC ; case 71 + b _0231C15C ; case 72 + b _0231CABC ; case 73 + b _0231C118 ; case 74 + b _0231C210 ; case 75 + b _0231C130 ; case 76 + b _0231C0F4 ; case 77 + b _0231C248 ; case 78 + b _0231C258 ; case 79 + b _0231C144 ; case 80 + b _0231C194 ; case 81 + b _0231C184 ; case 82 + b _0231C16C ; case 83 + b _0231C1BC ; case 84 + b _0231C234 ; case 85 + b _0231C1A4 ; case 86 + b _0231C278 ; case 87 + b _0231C268 ; case 88 + b _0231C1F4 ; case 89 + b _0231C1E4 ; case 90 + b _0231C224 ; case 91 + b _0231C304 ; case 92 + b _0231C31C ; case 93 + b _0231C338 ; case 94 + b _0231C348 ; case 95 + b _0231C360 ; case 96 + b _0231C370 ; case 97 + b _0231CABC ; case 98 + b _0231C28C ; case 99 + b _0231C2A4 ; case 100 + b _0231C2BC ; case 101 + b _0231C2D4 ; case 102 + b _0231C380 ; case 103 + b _0231C6B0 ; case 104 + b _0231CABC ; case 105 + b _0231C768 ; case 106 + b _0231C7A0 ; case 107 + b _0231C2EC ; case 108 + b _0231C394 ; case 109 + b _0231C3B4 ; case 110 + b _0231C3F4 ; case 111 + b _0231C3D4 ; case 112 + b _0231C5FC ; case 113 + b _0231C61C ; case 114 + b _0231C63C ; case 115 + b _0231C7B0 ; case 116 + b _0231C7C0 ; case 117 + b _0231C7FC ; case 118 + b _0231C404 ; case 119 + b _0231C420 ; case 120 + b _0231C43C ; case 121 + b _0231C458 ; case 122 + b _0231C474 ; case 123 + b _0231C490 ; case 124 + b _0231C4AC ; case 125 + b _0231C4C8 ; case 126 + b _0231C4E4 ; case 127 + b _0231C500 ; case 128 + b _0231C51C ; case 129 + b _0231C538 ; case 130 + b _0231C554 ; case 131 + b _0231C570 ; case 132 + b _0231C58C ; case 133 + b _0231C5A8 ; case 134 + b _0231C5C4 ; case 135 + b _0231C5E0 ; case 136 + b _0231C80C ; case 137 + b _0231CABC ; case 138 + b _0231CABC ; case 139 + b _0231CABC ; case 140 + b _0231CABC ; case 141 + b _0231CABC ; case 142 + b _0231CABC ; case 143 + b _0231CABC ; case 144 + b _0231CABC ; case 145 + b _0231CABC ; case 146 + b _0231CABC ; case 147 + b _0231CABC ; case 148 + b _0231CABC ; case 149 + b _0231CABC ; case 150 + b _0231CABC ; case 151 + b _0231CABC ; case 152 + b _0231CABC ; case 153 + b _0231CABC ; case 154 + b _0231CABC ; case 155 + b _0231CABC ; case 156 + b _0231CABC ; case 157 + b _0231CABC ; case 158 + b _0231CABC ; case 159 + b _0231CABC ; case 160 + b _0231CABC ; case 161 + b _0231CABC ; case 162 + b _0231CABC ; case 163 + b _0231CABC ; case 164 + b _0231CABC ; case 165 + b _0231CABC ; case 166 + b _0231C81C ; case 167 + b _0231C82C ; case 168 + b _0231C844 ; case 169 + b _0231C8B0 ; case 170 + b _0231C91C ; case 171 + b _0231C988 ; case 172 + b _0231CABC ; case 173 + b _0231CABC ; case 174 + b _0231CABC ; case 175 + b _0231CABC ; case 176 + b _0231CABC ; case 177 + b _0231CABC ; case 178 + b _0231CA50 ; case 179 + b _0231C9F4 ; case 180 + b _0231CABC ; case 181 + b _0231C65C ; case 182 +_0231BCC0: + ldr r1, _0231C6E0 ; =0x0000016B + cmp r0, r1 + beq _0231CB14 + b _0231CABC +_0231BCD0: + ldr r1, _0231C6E4 ; =0x00000192 + cmp r0, r1 + bgt _0231BCF0 + bge _0231CA60 + sub r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BCF0: + add r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BD00: + cmp r0, #0x198 + bgt _0231BD3C + bge _0231CA60 + ldr r1, _0231C6E8 ; =0x00000196 + cmp r0, r1 + bgt _0231BD2C + bge _0231CA60 + sub r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BD2C: + add r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BD3C: + ldr r1, _0231C6EC ; =0x0000019A + cmp r0, r1 + bgt _0231BD5C + bge _0231CA60 + sub r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BD5C: + add r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BD6C: + cmp r0, #0x1a4 + bgt _0231BDE4 + bge _0231CA60 + cmp r0, #0x1a0 + bgt _0231BDB4 + bge _0231CA60 + ldr r1, _0231C6F0 ; =0x0000019E + cmp r0, r1 + bgt _0231BDA4 + bge _0231CA60 + sub r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BDA4: + add r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BDB4: + ldr r1, _0231C6F4 ; =0x000001A2 + cmp r0, r1 + bgt _0231BDD4 + bge _0231CA60 + sub r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BDD4: + add r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BDE4: + cmp r0, #0x1a8 + bgt _0231BE20 + bge _0231CA60 + ldr r1, _0231C6F8 ; =0x000001A6 + cmp r0, r1 + bgt _0231BE10 + bge _0231CA60 + sub r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BE10: + add r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BE20: + ldr r1, _0231C6FC ; =0x000001AA + cmp r0, r1 + bgt _0231BE40 + bge _0231CA60 + sub r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BE40: + add r1, r1, #1 + cmp r0, r1 + beq _0231CA60 + b _0231CABC +_0231BE50: + ldr r1, _0231C700 ; =0x00000195 + add r0, sp, #0x52 + bl InitMove + ldr r0, _0231C704 ; =STICK_POWER + mov r4, #0x100 + ldrsh r3, [r0] + str r4, [sp] + mov r4, #1 + add r2, sp, #0x52 + mov r0, r8 + mov r1, r7 + str r4, [sp, #4] + bl DealDamageProjectile + b _0231CB14 +_0231BE88: + ldr r1, _0231C700 ; =0x00000195 + add r0, sp, #0x4a + bl InitMove + ldr r0, _0231C708 ; =IRON_THORN_POWER + mov r4, #0x100 + ldrsh r3, [r0] + str r4, [sp] + mov r4, #2 + add r2, sp, #0x4a + mov r0, r8 + mov r1, r7 + str r4, [sp, #4] + bl DealDamageProjectile + b _0231CB14 +_0231BEC0: + ldr r1, _0231C700 ; =0x00000195 + add r0, sp, #0x42 + bl InitMove + ldr r0, _0231C70C ; =SILVER_SPIKE_POWER + mov r4, #0x100 + ldrsh r3, [r0] + str r4, [sp] + mov r4, #3 + add r2, sp, #0x42 + mov r0, r8 + mov r1, r7 + str r4, [sp, #4] + bl DealDamageProjectile + b _0231CB14 +_0231BEF8: + ldr r1, _0231C700 ; =0x00000195 + add r0, sp, #0x3a + bl InitMove + ldr r0, _0231C710 ; =GOLD_FANG_POWER + mov r4, #0x100 + ldrsh r3, [r0] + str r4, [sp] + mov r4, #4 + add r2, sp, #0x3a + mov r0, r8 + mov r1, r7 + str r4, [sp, #4] + bl DealDamageProjectile + b _0231CB14 +_0231BF30: + ldr r1, _0231C700 ; =0x00000195 + add r0, sp, #0x32 + bl InitMove + ldr r0, _0231C714 ; =CACNEA_SPIKE_POWER + mov r4, #0x100 + ldrsh r3, [r0] + str r4, [sp] + mov r4, #5 + add r2, sp, #0x32 + mov r0, r8 + mov r1, r7 + str r4, [sp, #4] + bl DealDamageProjectile + b _0231CB14 +_0231BF68: + ldr r1, _0231C700 ; =0x00000195 + add r0, sp, #0x2a + bl InitMove + ldr r0, _0231C718 ; =CORSOLA_TWIG_POWER + mov r4, #0x100 + ldrsh r3, [r0] + str r4, [sp] + mov r4, #6 + add r2, sp, #0x2a + mov r0, r8 + mov r1, r7 + str r4, [sp, #4] + bl DealDamageProjectile + b _0231CB14 +_0231BFA0: + mov r4, #0 + str r4, [sp] + ldr r0, _0231C71C ; =GEO_PEBBLE_DAMAGE + ldr r1, _0231C720 ; =0x0000024F + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + ldrsh r2, [r0] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231BFDC: + mov r4, #0 + str r4, [sp] + ldr r0, _0231C724 ; =GRAVELEROCK_DAMAGE + ldr r1, _0231C720 ; =0x0000024F + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + ldrsh r2, [r0] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231C018: + ldr r1, _0231C700 ; =0x00000195 + add r0, sp, #0x22 + bl InitMove + ldr r0, _0231C728 ; =GOLD_THORN_POWER + mov r4, #0x100 + ldrsh r3, [r0] + str r4, [sp] + mov r4, #9 + add r2, sp, #0x22 + mov r0, r8 + mov r1, r7 + str r4, [sp, #4] + bl DealDamageProjectile + b _0231CB14 +_0231C050: + mov r4, #0 + str r4, [sp] + ldr r0, _0231C72C ; =RARE_FOSSIL_DAMAGE + ldr r1, _0231C720 ; =0x0000024F + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + ldrsh r2, [r0] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231C08C: + mov r0, r8 + mov r1, r7 + mov r3, sl + mov r2, #1 + bl EndNegativeStatusConditionWrapper + b _0231CB14 +_0231C0A4: + ldr r1, _0231C730 ; =ORAN_BERRY_HP_RESTORATION + ldr r0, _0231C734 ; =ORAN_BERRY_FULL_HP_BOOST + ldrsh r2, [r1] + ldrsh r3, [r0] + mov r4, #1 + mov r0, r8 + mov r1, r7 + str r4, [sp] + bl TryIncreaseHp + b _0231CB14 +_0231C0CC: + ldr r1, _0231C738 ; =SITRUS_BERRY_HP_RESTORATION + ldr r0, _0231C73C ; =SITRUS_BERRY_FULL_HP_BOOST + ldrsh r2, [r1] + ldrsh r3, [r0] + mov r4, #1 + mov r0, r8 + mov r1, r7 + str r4, [sp] + bl TryIncreaseHp + b _0231CB14 +_0231C0F4: + ldr r0, _0231C740 ; =LIFE_SEED_HP_BOOST + mov r4, #1 + ldrsh r3, [r0] + mov r0, r8 + mov r1, r7 + mov r2, #0 + str r4, [sp] + bl TryIncreaseHp + b _0231CB14 +_0231C118: + mov r2, #0 + mov r0, r8 + mov r1, r7 + mov r3, r2 + bl TryInflictBlinkerStatus + b _0231CB14 +_0231C130: + mov r0, r8 + mov r1, r7 + mov r2, #0 + bl TryInflictCrossEyedStatus + b _0231CB14 +_0231C144: + mov r0, r8 + mov r1, r7 + mov r2, #0 + mov r3, #1 + bl BoostSpeedOneStage + b _0231CB14 +_0231C15C: + mov r0, r8 + mov r1, r7 + bl TryInflictEyedropStatus + b _0231CB14 +_0231C16C: + mov r0, r8 + mov r1, r7 + mov r2, #1 + mov r3, #0 + bl TryInflictConfusedStatus + b _0231CB14 +_0231C184: + mov r0, r8 + mov r1, r7 + bl ApplyCheriBerryEffect + b _0231CB14 +_0231C194: + mov r0, r8 + mov r1, r7 + bl ApplyPechaBerryEffect + b _0231CB14 +_0231C1A4: + mov r2, #0 + mov r0, r8 + mov r1, r7 + mov r3, r2 + bl TryWarp + b _0231CB14 +_0231C1BC: + ldr r1, _0231C744 ; =SLEEP_TURN_RANGE + mov r0, r7 + mov r2, #1 + bl CalcStatusDuration + mov r2, r0 + mov r0, r8 + mov r1, r7 + mov r3, #1 + bl TryInflictSleepStatus + b _0231CB14 +_0231C1E4: + mov r0, r8 + mov r1, r7 + bl TryInflictSleeplessStatus + b _0231CB14 +_0231C1F4: + mov r2, #1 + mov r0, r8 + mov r1, r7 + mov r3, r2 + str r2, [sp] + bl LevelUpItemEffect + b _0231CB14 +_0231C210: + mov r0, r8 + mov r1, r7 + mov r2, #1 + bl TryDecreaseLevel + b _0231CB14 +_0231C224: + mov r0, r8 + mov r1, r7 + bl TryInflictPetrifiedStatus + b _0231CB14 +_0231C234: + ldr r2, _0231C748 ; =0x00000BE9 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231C248: + mov r0, r8 + mov r1, r7 + bl ApplyRawstBerryEffect + b _0231CB14 +_0231C258: + mov r0, r8 + mov r1, r7 + bl ApplyHungerSeedEffect + b _0231CB14 +_0231C268: + mov r0, r8 + mov r1, r7 + bl ApplyGinsengEffect + b _0231CB14 +_0231C278: + mov r0, r8 + mov r1, r7 + mov r2, sb + bl ApplyBlastSeedEffect + b _0231CB14 +_0231C28C: + ldr r2, _0231C74C ; =0x000003E7 + mov r0, r8 + mov r1, r7 + mov r3, #0 + bl RestoreAllMovePP + b _0231CB14 +_0231C2A4: + ldr r1, _0231C750 ; =PROTEIN_STAT_BOOST + mov r0, r8 + ldrsh r2, [r1] + mov r1, r7 + bl ApplyProteinEffect + b _0231CB14 +_0231C2BC: + ldr r1, _0231C754 ; =CALCIUM_STAT_BOOST + mov r0, r8 + ldrsh r2, [r1] + mov r1, r7 + bl ApplyCalciumEffect + b _0231CB14 +_0231C2D4: + ldr r1, _0231C758 ; =IRON_STAT_BOOST + mov r0, r8 + ldrsh r2, [r1] + mov r1, r7 + bl ApplyIronEffect + b _0231CB14 +_0231C2EC: + ldr r1, _0231C75C ; =ZINC_STAT_BOOST + mov r0, r8 + ldrsh r2, [r1] + mov r1, r7 + bl ApplyZincEffect + b _0231CB14 +_0231C304: + mov r0, r8 + mov r1, r7 + mov r2, #1 + mov r3, #0 + bl EndNegativeStatusConditionWrapper + b _0231CB14 +_0231C31C: + mov r3, #1 + mov r0, r8 + mov r1, r7 + mov r2, #5 + str r3, [sp] + bl LevelUpItemEffect + b _0231CB14 +_0231C338: + mov r0, r8 + mov r1, r7 + bl ApplyVileSeedEffect + b _0231CB14 +_0231C348: + mov r0, r8 + mov r1, r7 + mov r2, #4 + mov r3, #0 + bl TryWarp + b _0231CB14 +_0231C360: + mov r0, r8 + mov r1, r7 + bl ApplyViolentSeedEffect + b _0231CB14 +_0231C370: + mov r0, r8 + mov r1, r7 + bl TryInflictInvisibleStatus + b _0231CB14 +_0231C380: + mov r0, r7 + mov r1, #0xa + mov r2, #0 + bl BoostIQ + b _0231CB14 +_0231C394: + mov r4, #1 + mov r0, r8 + mov r1, r7 + mov r2, #0x32 + mov r3, #5 + str r4, [sp] + bl TryIncreaseBelly + b _0231CB14 +_0231C3B4: + mov r4, #1 + mov r0, r8 + mov r1, r7 + mov r2, #0x64 + mov r3, #0xa + str r4, [sp] + bl TryIncreaseBelly + b _0231CB14 +_0231C3D4: + mov r4, #1 + mov r0, r8 + mov r1, r7 + rsb r2, r4, #0x3e8 + mov r3, #0xa + str r4, [sp] + bl TryIncreaseBelly + b _0231CB14 +_0231C3F4: + mov r0, r8 + mov r1, r7 + bl ApplyGrimyFoodEffect + b _0231CB14 +_0231C404: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #1 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C420: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #2 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C43C: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #3 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C458: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #4 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C474: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #5 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C490: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #6 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C4AC: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #7 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C4C8: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #8 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C4E4: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #9 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C500: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0xa + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C51C: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0xb + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C538: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0xc + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C554: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0xd + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C570: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0xe + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C58C: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0xf + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C5A8: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0x10 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C5C4: + ldr r1, _0231C760 ; =GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0x11 + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C5E0: + ldr r1, _0231C764 ; =WONDER_GUMMI_STAT_BOOST + mov r0, r8 + ldrsh r3, [r1] + mov r1, r7 + mov r2, #0xff + bl ApplyGummiBoostsDungeonMode + b _0231CB14 +_0231C5FC: + mov r4, #1 + mov r0, r8 + mov r1, r7 + mov r2, #0x32 + mov r3, #5 + str r4, [sp] + bl TryIncreaseBelly + b _0231CB14 +_0231C61C: + mov r4, #1 + mov r0, r8 + mov r1, r7 + mov r2, #0xa + mov r3, #0 + str r4, [sp] + bl TryIncreaseBelly + b _0231CB14 +_0231C63C: + mov r4, #1 + mov r0, r8 + mov r1, r7 + rsb r2, r4, #0x3e8 + mov r3, #0x32 + str r4, [sp] + bl TryIncreaseBelly + b _0231CB14 +_0231C65C: + cmp sb, #0 + beq _0231C6A4 + add r1, sp, #0x1f + ldr r0, _0231C6D8 ; =ov10_022C4558 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231C6A4: + mov r0, r8 + bl ApplyKeyEffect + b _0231CB14 +_0231C6B0: + mov r0, r8 + mov r1, r7 + bl TryInflictDropeyeStatus + b _0231CB14 + .align 2, 0 +#ifdef JAPAN +#define APPLY_ITEM_EFFECT_OFFSET -0x2C1 +#else +#define APPLY_ITEM_EFFECT_OFFSET 0 +#endif +_0231C6C0: .word 0x000001AB +_0231C6C4: .word 0x00001317 +_0231C6C8: .word 0x00000BE6 + APPLY_ITEM_EFFECT_OFFSET +_0231C6CC: .word 0x00000BE7 + APPLY_ITEM_EFFECT_OFFSET +_0231C6D0: .word ov10_022C4574 +_0231C6D4: .word 0x00000256 +_0231C6D8: .word ov10_022C4558 +_0231C6DC: .word 0x00000BE8 + APPLY_ITEM_EFFECT_OFFSET +_0231C6E0: .word 0x0000016B +_0231C6E4: .word 0x00000192 +_0231C6E8: .word 0x00000196 +_0231C6EC: .word 0x0000019A +_0231C6F0: .word 0x0000019E +_0231C6F4: .word 0x000001A2 +_0231C6F8: .word 0x000001A6 +_0231C6FC: .word 0x000001AA +_0231C700: .word 0x00000195 +_0231C704: .word STICK_POWER +_0231C708: .word IRON_THORN_POWER +_0231C70C: .word SILVER_SPIKE_POWER +_0231C710: .word GOLD_FANG_POWER +_0231C714: .word CACNEA_SPIKE_POWER +_0231C718: .word CORSOLA_TWIG_POWER +_0231C71C: .word GEO_PEBBLE_DAMAGE +_0231C720: .word 0x0000024F +_0231C724: .word GRAVELEROCK_DAMAGE +_0231C728: .word GOLD_THORN_POWER +_0231C72C: .word RARE_FOSSIL_DAMAGE +_0231C730: .word ORAN_BERRY_HP_RESTORATION +_0231C734: .word ORAN_BERRY_FULL_HP_BOOST +_0231C738: .word SITRUS_BERRY_HP_RESTORATION +_0231C73C: .word SITRUS_BERRY_FULL_HP_BOOST +_0231C740: .word LIFE_SEED_HP_BOOST +_0231C744: .word SLEEP_TURN_RANGE +_0231C748: .word 0x00000BE9 + APPLY_ITEM_EFFECT_OFFSET +_0231C74C: .word 0x000003E7 +_0231C750: .word PROTEIN_STAT_BOOST +_0231C754: .word CALCIUM_STAT_BOOST +_0231C758: .word IRON_STAT_BOOST +_0231C75C: .word ZINC_STAT_BOOST +_0231C760: .word GUMMI_STAT_BOOST +_0231C764: .word WONDER_GUMMI_STAT_BOOST +_0231C768: + mov r0, r8 + mov r1, r7 + bl TryInflictSlipStatus + cmp r0, #0 + bne _0231CB14 + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _0231CBAC ; =0x00000C75 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231C7A0: + mov r0, r8 + mov r1, r7 + bl ApplyViaSeedEffect + b _0231CB14 +_0231C7B0: + mov r0, r8 + mov r1, r7 + bl ApplyMixElixirEffect + b _0231CB14 +_0231C7C0: + mov r4, #0 + str r4, [sp] + ldr r0, _0231CBB0 ; =OREN_BERRY_DAMAGE + str r4, [sp, #4] + mov r1, #0x270 + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + ldrsh r2, [r0] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231C7FC: + mov r0, r8 + mov r1, r7 + bl ApplyDoughSeedEffect + b _0231CB14 +_0231C80C: + mov r0, r8 + mov r1, r7 + bl ApplyGravelyrockEffect + b _0231CB14 +_0231C81C: + mov r0, r8 + mov r1, r7 + bl ApplyGonePebbleEffect + b _0231CB14 +_0231C82C: + mov r2, #0 + mov r0, r8 + mov r1, r7 + mov r3, r2 + bl TryInflictBlinkerStatus + b _0231CB14 +_0231C844: + cmp sb, #0 + beq _0231C88C + add r1, sp, #0x1e + ldr r0, _0231C6D8 ; =ov10_022C4558 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231C88C: + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _0231CBB4 ; =0x00000C67 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231C8B0: + cmp sb, #0 + beq _0231C8F8 + add r1, sp, #0x1d + ldr r0, _0231C6D8 ; =ov10_022C4558 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231C8F8: + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _0231CBB4 ; =0x00000C67 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231C91C: + cmp sb, #0 + beq _0231C964 + add r1, sp, #0x1c + ldr r0, _0231C6D8 ; =ov10_022C4558 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231C964: + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _0231CBB4 ; =0x00000C67 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231C988: + cmp sb, #0 + beq _0231C9D0 + add r1, sp, #0x1b + ldr r0, _0231C6D8 ; =ov10_022C4558 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231C9D0: + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _0231CBB4 ; =0x00000C67 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231C9F4: + cmp sb, #0 + beq _0231CA3C + add r1, sp, #0x1a + ldr r0, _0231C6D8 ; =ov10_022C4558 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231CA3C: + ldr r2, _0231CBB8 ; =0x00000C76 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231CA50: + mov r0, r8 + mov r1, r7 + bl ApplyGracideaEffect + b _0231CB14 +_0231CA60: + cmp sb, #0 + beq _0231CAA8 + add r1, sp, #0x19 + ldr r0, _0231CBBC ; =ov10_022C44EC + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231CAA8: + ldr r2, _0231C6DC ; =0x00000BE8 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231CB14 +_0231CABC: + cmp sb, #0 + beq _0231CB04 + add r1, sp, #0x18 + ldr r0, _0231C6D8 ; =ov10_022C4558 + str r1, [sp] + mov r4, #0 + ldrsh r2, [r0] + ldr r1, _0231C6D4 ; =0x00000256 + str r4, [sp, #4] + str r1, [sp, #8] + str r4, [sp, #0xc] + str r4, [sp, #0x10] + mov r0, r8 + mov r1, r7 + mov r3, #1 + str r4, [sp, #0x14] + bl CalcDamageFixedNoCategory + b _0231CB14 +_0231CB04: + ldr r2, _0231C6DC ; =0x00000BE8 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget +_0231CB14: + mov r0, r7 + bl EntityIsValid__0231CBC8 + cmp r0, #0 + beq _0231CB9C + ldr r1, [r7, #0xb4] + ldrsh r4, [r6, #4] + ldrb r0, [r1, #6] + cmp r0, #0 + movne r0, #0 + bne _0231CB48 +#ifdef JAPAN + add r0, r1, #0x224 +#else + add r0, r1, #0x228 +#endif + mov r1, #0x5d + bl ExclusiveItemEffectFlagTest +_0231CB48: + cmp r0, #0 + beq _0231CB9C + ldr r0, _0231CBC0 ; =APPLES_AND_BERRIES_ITEM_IDS + b _0231CB90 +_0231CB58: + cmp r4, r1 + bne _0231CB8C + mov r0, #0xa + bl ov29_0234BA54 + ldr r0, _0231CBC4 ; =ov10_022C4864 + mov r4, #1 + ldr r2, [r0] + mov r0, r8 + mov r1, r7 + mov r3, #0 + str r4, [sp] + bl TryIncreaseHp + b _0231CB9C +_0231CB8C: + add r0, r0, #2 +_0231CB90: + ldrsh r1, [r0] + cmp r1, #0 + bne _0231CB58 +_0231CB9C: +#ifdef EUROPE + mov r0, #1 + bl ov29_022FB920 +#endif + mov r0, r8 + bl EnemyEvolution +_0231CBA4: + add sp, sp, #0x5c + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, pc} + .align 2, 0 +_0231CBAC: .word 0x00000C75 + APPLY_ITEM_EFFECT_OFFSET +_0231CBB0: .word OREN_BERRY_DAMAGE +_0231CBB4: .word 0x00000C67 + APPLY_ITEM_EFFECT_OFFSET +_0231CBB8: .word 0x00000C76 + APPLY_ITEM_EFFECT_OFFSET +_0231CBBC: .word ov10_022C44EC +_0231CBC0: .word APPLES_AND_BERRIES_ITEM_IDS +_0231CBC4: .word ov10_022C4864 + arm_func_end ApplyItemEffect diff --git a/asm/overlay_29_0232145C.s b/asm/overlay_29_0232145C.s index 206ec356..d3d77616 100644 --- a/asm/overlay_29_0232145C.s +++ b/asm/overlay_29_0232145C.s @@ -1893,3003 +1893,3 @@ _02322DA8: ldmia sp!, {r3, r4, r5, r6, r7, pc} #endif arm_func_end DefenderAbilityIsActive__02322D64 - - arm_func_start IsMonster__02322DB8 -IsMonster__02322DB8: ; 0x02322DB8 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__02322DB8 - - arm_func_start ov29_02322DDC -ov29_02322DDC: ; 0x02322DDC - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - mov r4, #0 - mov r8, r2 - mov r5, r4 - mov sl, r0 - mov sb, r1 - mov fp, r3 - ldr r7, [sp, #0x28] - bl ShouldDisplayEntityWrapper - cmp r0, #0 - movne r5, #1 - cmp r8, #0 - beq _02322ED0 - mov r6, #0 - b _02322E38 -_02322E18: - ldr r0, [fp, r6, lsl #2] - cmp r0, #0 - beq _02322E40 - bl ShouldDisplayEntityWrapper - cmp r0, #0 - movne r5, #1 - bne _02322E40 - add r6, r6, #1 -_02322E38: - cmp r6, #0x41 - blt _02322E18 -_02322E40: - cmp r5, #0 - beq _02322E94 - bl ov29_0234B034 - mov r1, #0 - str r1, [sp] - ldr r2, [sl, #0xb4] - mov r3, r1 - bl ov29_0230040C - cmp r7, #0 - bne _02322E80 - bl ov29_0234B034 - mov r1, #0 - mov r2, sb - mov r3, r1 - bl FormatMoveStringMore - b _02322EAC -_02322E80: - mov r0, r7, lsl #0x10 - mov r1, r0, asr #0x10 - mov r0, #0 - bl ov29_0234B084 - b _02322EAC -_02322E94: - cmp r7, #0 - beq _02322EAC - mov r0, r7, lsl #0x10 - mov r1, r0, asr #0x10 - mov r0, #0 - bl ov29_0234B084 -_02322EAC: - ldrh r1, [sb, #4] - ldr r0, _02322F74 ; =0x00000163 - cmp r1, r0 - mov r0, sl - mov r1, r8 - beq _02322ECC - bl LogMessageWithPopup - b _02322ED0 -_02322ECC: - bl LogMessageQuiet -_02322ED0: - cmp r5, #0 - beq _02322F5C - ldrb r0, [sp, #0x2c] - mov r1, sb - cmp r0, #0 - mov r0, sl - beq _02322EF8 - mov r2, #1 - bl ov29_02324E78 - b _02322F00 -_02322EF8: - mov r2, #0 - bl ov29_02324E78 -_02322F00: - mov r4, r0 - ldrh r0, [sb, #4] - cmp r0, #0xfe - bne _02322F24 - mov r0, sl - bl EntityIsValid__02321438 - cmp r0, #0 - movne r0, #0xff - strneb r0, [sl, #0xaf] -_02322F24: - ldrh r0, [sb, #4] - bl ov10_022BFDAC - cmp r0, #0 - beq _02322F4C - ldr r1, [sl, #0xb4] - mov r0, sl - ldrb r1, [r1, #0x4c] - bl ov29_02304A48 - mov r0, #1 - bl AnimationDelayOrSomething -_02322F4C: - mov r0, sl - mov r1, sb - bl ov29_023250D4 - b _02322F6C -_02322F5C: - ldr r1, [sl, #0xb4] - mov r0, sl - ldrb r1, [r1, #0x4c] - bl ov29_02304A48 -_02322F6C: - mov r0, r4 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_02322F74: .word 0x00000163 - arm_func_end ov29_02322DDC - - arm_func_start ov29_02322F78 -ov29_02322F78: ; 0x02322F78 - stmdb sp!, {r4, r5, r6, r7, r8, lr} - sub sp, sp, #0x18 - ldr r4, _023230F4 ; =DUNGEON_PTR - mov r7, r0 - ldr r0, [r4] - mov r6, r1 - add r0, r0, #0x1a000 -#ifdef JAPAN - ldrb r0, [r0, #0x19a] -#else - ldrb r0, [r0, #0x23e] -#endif - mov r5, r2 - mov r8, r3 - cmp r0, #0 - ldr r4, [r7, #0xb4] - mvnne r0, #0 - bne _023230EC - ldrsh r0, [r4, #4] - bl GetBodySize - cmp r0, #4 - blo _02322FC8 - cmp r8, #1 - beq _023230E8 -_02322FC8: - mov r0, r7 - bl GetApparentWeather - mov r1, r0 - ldrh r0, [r5, #4] - mov r2, #1 - bl GetMoveAnimationId - bl GetMoveAnimation - ldrsh r0, [r0, #6] - ldrsh r3, [r6, #2] - mov r1, #0x18 - ldrsh r2, [r6] - smulbb r3, r3, r1 - smulbb r2, r2, r1 - add r3, r3, #0x10 - add r2, r2, #0xc - mov r6, r3, lsl #8 - mov r2, r2, lsl #8 - mov r3, r2, asr #8 - mov r2, r6, asr #8 - strh r3, [sp] - strh r2, [sp, #2] - cmp r0, #0 - beq _023230E0 - mov r0, #0x5e - bl AdvanceFrame - mov r0, r7 - bl GetApparentWeather - mov r1, r0 - ldrh r0, [r5, #4] - mov r2, #1 - bl GetMoveAnimationId - mov r1, r0 - ldrsh r0, [r4, #4] - bl ov10_022BF01C - mov r2, r0 - mvn r0, #0 - cmp r2, r0 - ldreq r0, _023230F8 ; =ov29_02352A54 - ldreqh r1, [r0] - streqh r1, [sp, #0xc] - ldreqh r0, [r0, #2] - streqh r0, [sp, #0xe] - beq _02323084 - add r0, sp, #0xc - add r1, r7, #0x2c - and r2, r2, #0xff - bl sub_0201CF90 -_02323084: - mov r0, r7 - bl GetApparentWeather - mov r1, r0 - ldrh r0, [r5, #4] - mov r2, #1 - bl GetMoveAnimationId - strh r0, [sp, #4] - ldrsh r2, [r4, #4] - add r0, sp, #4 - add r1, sp, #0 - strh r2, [sp, #6] - ldr r3, [r7, #0xc] - mov r2, #0 - mov r3, r3, asr #8 - strh r3, [sp, #8] - ldr r3, [r7, #0x10] - mov r3, r3, asr #8 - strh r3, [sp, #0xa] - ldrb r3, [r4, #0x4c] - str r3, [sp, #0x10] - str r2, [sp, #0x14] - bl ov10_022BE9E8 - b _023230EC -_023230E0: - sub r0, r1, #0x19 - b _023230EC -_023230E8: - mvn r0, #0 -_023230EC: - add sp, sp, #0x18 - ldmia sp!, {r4, r5, r6, r7, r8, pc} - .align 2, 0 -_023230F4: .word DUNGEON_PTR -_023230F8: .word ov29_02352A54 - arm_func_end ov29_02322F78 - - arm_func_start ov29_023230FC -ov29_023230FC: ; 0x023230FC - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0xc0 - ldr r4, _023238F4 ; =ov29_02352A54 - mov r8, r0 - mov r0, #0 - str r0, [sp, #0x88] - ldr r0, [r4, #4] - mov r7, r1 - ldr r1, [r4, #8] - str r0, [sp, #0xb0] - str r1, [sp, #0xb4] - ldr r1, [sp, #0x88] - ldrh r0, [r7, #4] - mov r6, r2 - mov fp, r3 - str r1, [sp, #0x84] - mov r5, r1 - ldr sb, [r8, #0xb4] - bl GetMoveAnimationSpeed - cmp r0, #1 - moveq sl, #2 - beq _02323160 - cmp r0, #2 - moveq sl, #3 - movne sl, #6 -_02323160: - ldrsh r2, [r8, #4] - ldr r0, _023238F8 ; =DIRECTIONS_XY - ldr r1, _023238FC ; =ov29_0235171E - strh r2, [sp, #0xbc] - ldrsh r2, [r8, #6] - mov r4, #0 - strh r2, [sp, #0xbe] - ldrb r2, [sb, #0x4c] - mov r2, r2, lsl #2 - ldrsh r0, [r0, r2] - str r0, [sp, #0x6c] - ldrsh r0, [r1, r2] - str r0, [sp, #0x68] - b _02323214 -_02323198: - ldrsh r2, [sp, #0xbc] - cmp r2, #0 - ldrgesh r1, [sp, #0xbe] - cmpge r1, #0 - blt _0232321C - cmp r2, #0x38 - cmplt r1, #0x20 - bge _0232321C - ldr r0, [sp, #0x6c] - add r0, r2, r0 - strh r0, [sp, #0xbc] - ldr r0, [sp, #0x68] - add r0, r1, r0 - strh r0, [sp, #0xbe] - ldr r0, [sp, #0x84] - ldrsh r1, [sp, #0xbe] - add r0, r0, #1 - str r0, [sp, #0x84] - ldrsh r0, [sp, #0xbc] - bl GetTile - ldrh r1, [r0] - tst r1, #3 - beq _0232321C - ldr r1, [r0, #0xc] - cmp r1, #0 - beq _02323210 - ldr r0, [r1] - cmp r0, #1 - moveq r5, r1 - beq _0232321C -_02323210: - add r4, r4, #1 -_02323214: - cmp r4, r6 - blt _02323198 -_0232321C: - mov r0, r8 - ldrh r1, [r7, #4] - bl ov29_02324D60 - cmp r0, #0 - beq _02323250 - mov r0, r8 - mov r1, r7 - bl IsChargingTwoTurnMove - cmp r0, #0 - mvneq r0, #0 - streq r0, [sp, #0xb0] - streq r0, [sp, #0xb4] - beq _023232E4 -_02323250: - mov r0, r8 - add r1, sp, #0xbc - mov r2, r7 - mov r3, r6 - bl ov29_02322F78 - str r0, [sp, #0xb0] - ldrb r0, [sp, #0xf0] - cmp r0, #0 - beq _023232E4 - cmp r5, #0 - mvneq r0, #0 - streq r0, [sp, #0xb4] - beq _023232E4 - ldrsh r2, [r8, #4] - mov r0, r5 - add r1, sp, #0xb8 - strh r2, [sp, #0xb8] - ldrsh r4, [r8, #6] - mov r2, r7 - mov r3, r6 - strh r4, [sp, #0xba] - bl ov29_02322F78 - ldrsh r2, [r5, #4] - str r0, [sp, #0xb4] - ldr r0, _023238F8 ; =DIRECTIONS_XY - strh r2, [sp, #0xb8] - ldrsh r2, [r5, #6] - ldr r1, _023238FC ; =ov29_0235171E - strh r2, [sp, #0xba] - ldrb r2, [sb, #0x4c] - add r2, r2, #4 - mov r2, r2, lsl #0x1d - mov r2, r2, lsr #0x1b - ldrsh r0, [r0, r2] - str r0, [sp, #0x64] - ldrsh r0, [r1, r2] - str r0, [sp, #0x60] -_023232E4: - ldrsh r0, [r8, #4] - ldr r5, _02323900 ; =ov29_0235175C - ldr r3, _023238F8 ; =DIRECTIONS_XY - strh r0, [sp, #0xbc] - ldrsh r1, [r8, #6] - ldr r2, _023238FC ; =ov29_0235171E - mov r0, #0x18 - strh r1, [sp, #0xbe] - ldrb r1, [sb, #0x4c] - str r1, [sp, #0x1c] - ldr r4, [sp, #0x1c] - mov r1, sl - ldr r4, [r5, r4, lsl #2] - str r4, [sp, #0x7c] - ldr r4, [sp, #0x1c] - mov r4, r4, lsl #2 - ldrsh r3, [r3, r4] - ldrsh r2, [r2, r4] - str r3, [sp, #0x10] - str r2, [sp, #0xc] - bl _s32_div_f - ldr r2, [sp, #0x84] - str r0, [sp, #0x18] - mul r1, r2, r0 - cmp r6, #2 - blt _0232335C - add r4, r1, #8 - cmp r4, #0x40 - movge r4, #0x40 - b _02323360 -_0232335C: - mov r4, #0x20 -_02323360: - mov r0, #0x80000 - mov sb, #0 - bl _s32_div_f - str r0, [sp, #0x80] - mov r0, #1 - bl ov29_0234B4CC - mov r1, sb - str r1, [sp, #0x14] - ldr r1, [sp, #0x10] - mov r0, sl, lsl #8 - mul r2, r1, r0 - ldr r1, [sp, #0xc] - str r2, [sp, #0x2c] - mul r2, r1, r0 - ldr r1, [sp, #0x64] - str r2, [sp, #0x28] - mul r2, r1, r0 - ldr r1, [sp, #0x60] - str r2, [sp, #0x48] - mul r0, r1, r0 - str r0, [sp, #0x44] - ldr r0, [sp, #0x7c] - ldr r1, _02323904 ; =0x00000FFF - add r3, r0, #0xc00 - add r2, r0, #0x1400 - mov r0, r4, asr #1 - str r0, [sp, #0x3c] - and r0, r3, r1 - str r0, [sp, #0x40] - and r0, r2, r1 - str r0, [sp, #0x30] - rsb r0, r4, #0 - str r0, [sp, #0x34] - ldr r1, _02323908 ; =ov29_02352A6C - ldr r0, [sp, #0x1c] - ldr r5, [sp, #0xb4] - ldr r0, [r1, r0, lsl #2] - str r0, [sp, #0x38] - b _02323824 -_023233FC: - ldrsh r1, [sp, #0xbc] - cmp r1, #0 - ldrgesh r2, [sp, #0xbe] - cmpge r2, #0 - blt _02323830 - cmp r1, #0x38 - cmplt r2, #0x20 - bge _02323830 - ldr r0, [sp, #0x10] - ldrh r3, [sp, #0xbc] - add r1, r1, r0 - ldr r0, [sp, #0xc] - cmp r5, #0 - add r0, r2, r0 - ldrh r2, [sp, #0xbe] - strh r3, [sp, #0xa0] - strh r1, [sp, #0xbc] - strh r2, [sp, #0xa2] - strh r0, [sp, #0xbe] - blt _0232347C - ldrh r0, [sp, #0xba] - ldrh r2, [sp, #0xb8] - ldrsh r1, [sp, #0xb8] - strh r0, [sp, #0xa6] - ldr r0, [sp, #0x64] - strh r2, [sp, #0xa4] - add r0, r1, r0 - strh r0, [sp, #0xb8] - ldrsh r1, [sp, #0xba] - ldr r0, [sp, #0x60] - add r0, r1, r0 - strh r0, [sp, #0xba] -_0232347C: - add r0, sp, #0xbc - bl ov29_022E2CA0 - cmp r0, #0 - beq _02323740 - ldr r0, _0232390C ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, #0x1a000 -#ifdef JAPAN - ldrb r0, [r0, #0x19a] -#else - ldrb r0, [r0, #0x23e] -#endif - cmp r0, #0 - bne _02323740 - ldrsh r0, [sp, #0xa0] - mov r1, #0x18 - ldrsh r2, [sp, #0xa2] - smulbb r0, r0, r1 - add r0, r0, #0xc - mov r0, r0, lsl #8 - str r0, [sp, #0x5c] - smulbb r0, r2, r1 - add r0, r0, #0x10 - cmp r5, #0 - mov sl, r0, lsl #8 - blt _0232350C - ldrsh r3, [sp, #0xa4] - ldr r0, [sp, #0x48] - ldrsh r2, [sp, #0xa6] - str r0, [sp, #0x24] - smulbb r0, r3, r1 - add r0, r0, #0xc - mov r0, r0, lsl #8 - smulbb r1, r2, r1 - str r0, [sp, #0x58] - add r0, r1, #0x10 - mov r0, r0, lsl #8 - str r0, [sp, #0x54] - ldr r0, [sp, #0x44] - str r0, [sp, #0x20] -_0232350C: - mov r0, #0 - str r0, [sp, #0x78] - ldr r0, [sp, #0xb0] - str r0, [sp, #0x8c] - mov r0, r0, lsl #0x10 - mov r0, r0, asr #0x10 - str r0, [sp, #0x90] - mov r0, r5, lsl #0x10 - mov r0, r0, asr #0x10 - str r0, [sp, #0x94] - b _0232372C -_02323538: - ldr r0, [sp, #0x8c] - cmp r0, #0 - blt _02323600 - cmp fp, #1 - bne _02323564 - mov r0, sb, asr #8 - bl sub_020018D0 - mul r0, r4, r0 - str r0, [sp, #0x50] - mov r2, #0 - b _023235B4 -_02323564: - cmp fp, #2 - movne r0, #0 - strne r0, [sp, #0x50] - movne r2, r0 - bne _023235B4 - mov r0, sb, asr #8 - bl sub_020018D0 - ldr r1, [sp, #0x3c] - mul r0, r1, r0 - mov r0, r0, asr #8 - str r0, [sp, #0x74] - ldr r0, [sp, #0x40] - bl sub_020018D0 - ldr r1, [sp, #0x74] - mul r0, r1, r0 - str r0, [sp, #0x50] - ldr r0, [sp, #0x40] - bl sub_02001980 - ldr r1, [sp, #0x74] - mul r2, r1, r0 -_023235B4: - ldr r0, [sp, #0x5c] - add r1, sp, #0x9c - add r0, r0, r2 - mov r0, r0, asr #8 - strh r0, [sp, #0x9c] - ldr r0, [sp, #0x50] - ldr r2, _0232390C ; =DUNGEON_PTR - sub r0, sl, r0 - mov r0, r0, asr #8 - ldr r3, [r2] - strh r0, [sp, #0x9e] - ldr r2, _02323910 ; =0x0001A226 - ldr r0, [sp, #0x90] - ldrsh r2, [r3, r2] - rsb r2, r2, sl, asr #8 - add r3, r2, r2, lsr #31 - ldr r2, [sp, #0x38] - add r2, r2, r3, asr #1 - bl ov10_022BEB2C -_02323600: - cmp r5, #0 - blt _023236D0 - cmp fp, #1 - bne _0232362C - mov r0, sb, asr #8 - bl sub_020018D0 - ldr r1, [sp, #0x34] - mov r2, #0 - mul r0, r1, r0 - str r0, [sp, #0x4c] - b _0232367C -_0232362C: - cmp fp, #2 - movne r2, #0 - movne r0, r2 - strne r0, [sp, #0x4c] - bne _0232367C - mov r0, sb, asr #8 - bl sub_020018D0 - ldr r1, [sp, #0x3c] - mul r0, r1, r0 - mov r0, r0, asr #8 - str r0, [sp, #0x70] - ldr r0, [sp, #0x30] - bl sub_020018D0 - ldr r1, [sp, #0x70] - mul r0, r1, r0 - str r0, [sp, #0x4c] - ldr r0, [sp, #0x30] - bl sub_02001980 - ldr r1, [sp, #0x70] - mul r2, r1, r0 -_0232367C: - ldr r0, [sp, #0x58] - ldr r1, [sp, #0x54] - add r0, r0, r2 - mov r0, r0, asr #8 - strh r0, [sp, #0x98] - ldr r0, [sp, #0x4c] - ldr r2, _0232390C ; =DUNGEON_PTR - sub r0, r1, r0 - mov r0, r0, asr #8 - ldr r3, [r2] - strh r0, [sp, #0x9a] - ldr r2, _02323910 ; =0x0001A226 - ldr r0, [sp, #0x94] - ldrsh r3, [r3, r2] - ldr r2, [sp, #0x54] - add r1, sp, #0x98 - rsb r2, r3, r2, asr #8 - add r3, r2, r2, lsr #31 - ldr r2, [sp, #0x38] - add r2, r2, r3, asr #1 - bl ov10_022BEB2C -_023236D0: - mov r0, #0x30 - bl AdvanceFrame - ldr r1, [sp, #0x5c] - ldr r0, [sp, #0x2c] - cmp r5, #0 - add r0, r1, r0 - str r0, [sp, #0x5c] - ldr r0, [sp, #0x28] - add sl, sl, r0 - blt _02323718 - ldr r1, [sp, #0x58] - ldr r0, [sp, #0x24] - add r0, r1, r0 - str r0, [sp, #0x58] - ldr r1, [sp, #0x54] - ldr r0, [sp, #0x20] - add r0, r1, r0 - str r0, [sp, #0x54] -_02323718: - ldr r0, [sp, #0x80] - add sb, sb, r0 - ldr r0, [sp, #0x78] - add r0, r0, #1 - str r0, [sp, #0x78] -_0232372C: - ldr r1, [sp, #0x78] - ldr r0, [sp, #0x18] - cmp r1, r0 - blt _02323538 - b _0232374C -_02323740: - ldr r1, [sp, #0x80] - ldr r0, [sp, #0x18] - mla sb, r1, r0, sb -_0232374C: - ldrsh r0, [sp, #0xbc] - ldrsh r1, [sp, #0xbe] - bl GetTile - mov sl, r0 - ldrh r0, [sl] - tst r0, #3 - beq _02323830 - ldr r0, [sl, #0xc] - cmp r0, #0 - beq _02323818 - ldr r0, [r0] - cmp r0, #1 - bne _02323818 - mov r0, r8 - mov r1, #0x2e - bl IqSkillIsEnabled - cmp r0, #0 - bne _023237A8 - mov r0, r8 - mov r1, #0x60 - bl ExclusiveItemEffectIsActive__02323918 - cmp r0, #0 - beq _023237BC -_023237A8: - mov r0, r8 - ldr r1, [sl, #0xc] - bl ov29_022FAFD4 - cmp r0, #0 - bne _02323818 -_023237BC: - ldr r0, [sl, #0xc] - mov r1, r7 - bl TwoTurnMoveForcedMiss - cmp r0, #0 - bne _02323818 - mov r0, r8 - mov r1, #1 - bl ov29_023024E0 - mov r4, r0 - mov r0, r8 - mov r1, r7 - mov r2, #0 - bl GetEntityMoveTargetAndRange - ldr r1, [sl, #0xc] - mov r2, r0 - stmia sp, {r1, r7} - add r1, sp, #0xa8 - mov r0, #0 - mov r3, r8 - str r4, [sp, #8] - bl ov29_023243B4 - str r0, [sp, #0x88] - b _02323830 -_02323818: - ldr r0, [sp, #0x14] - add r0, r0, #1 - str r0, [sp, #0x14] -_02323824: - ldr r0, [sp, #0x14] - cmp r0, r6 - blt _023233FC -_02323830: - ldr r0, [sp, #0xb0] - cmp r0, #0 - blt _02323848 - mov r0, r0, lsl #0x10 - mov r0, r0, asr #0x10 - bl ov10_022BDE50 -_02323848: - cmp r5, #0 - blt _0232385C - mov r0, r5, lsl #0x10 - mov r0, r0, asr #0x10 - bl ov10_022BDE50 -_0232385C: - mov r0, #0 - bl ov29_0234B4CC - ldrh r1, [r7, #4] - ldr r0, _02323914 ; =0x000001E5 - cmp r1, r0 - bne _0232387C - mov r0, #1 - bl AnimationDelayOrSomething -_0232387C: - ldr r0, [sp, #0x88] - cmp r0, #0 - ble _023238B4 - ldr r1, [sp, #0x88] - add r0, sp, #0xa8 - mov r2, #0 - str r2, [r0, r1, lsl #2] - ldr r4, [sp, #0xec] - ldr r3, [sp, #0xe8] - mov r1, r8 - mov r2, r7 - str r4, [sp] - bl ExecuteMoveEffect - b _023238EC -_023238B4: - cmp r6, #1 - bne _023238EC - add r0, sp, #0xbc - bl ov29_022E2CA0 - cmp r0, #0 - beq _023238EC - mov r0, #1 - mov r1, #0x4a - bl ov29_022EA370 - add r3, sp, #0xbc - mov r0, r8 - mov r2, r7 - mov r1, #0 - bl PlayMoveAnimation -_023238EC: - add sp, sp, #0xc0 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_023238F4: .word ov29_02352A54 -_023238F8: .word DIRECTIONS_XY -_023238FC: .word ov29_0235171E -_02323900: .word ov29_0235175C -_02323904: .word 0x00000FFF -_02323908: .word ov29_02352A6C -_0232390C: .word DUNGEON_PTR -#ifdef JAPAN -_02323910: .word 0x0001A182 -#else -_02323910: .word 0x0001A226 -#endif -_02323914: .word 0x000001E5 - arm_func_end ov29_023230FC - - arm_func_start ExclusiveItemEffectIsActive__02323918 -ExclusiveItemEffectIsActive__02323918: ; 0x02323918 - stmdb sp!, {r3, lr} - ldr r2, [r0, #0xb4] - ldrb r0, [r2, #6] - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, pc} -#ifdef JAPAN - add r0, r2, #0x224 -#else - add r0, r2, #0x228 -#endif - bl ExclusiveItemEffectFlagTest - ldmia sp!, {r3, pc} - arm_func_end ExclusiveItemEffectIsActive__02323918 - - arm_func_start ov29_0232393C -ov29_0232393C: ; 0x0232393C - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x38 - ldr r0, [r0, #0xb4] - mov sb, r2 - str r0, [sp, #0x18] - mov sl, r1 - ldrh r0, [sb, #4] - ldr r1, [sp, #0x60] - str r3, [sp] - str r1, [sp, #0x60] - ldr r7, [sl, #0xb4] - bl GetMoveAnimationSpeed - cmp r0, #1 - moveq r6, #2 - beq _02323984 - cmp r0, #2 - moveq r6, #3 - movne r6, #6 -_02323984: - ldr r0, [sp, #0x18] - ldr r4, _02323C30 ; =DIRECTIONS_XY - ldrb r1, [r0, #0x4c] - ldrsh r0, [sl, #4] - ldr r5, _02323C34 ; =ov29_0235171E - add r1, r1, #4 - strh r0, [sp, #0x34] - and r0, r1, #7 - mov r8, r0, lsl #2 - ldrsh r4, [r4, r8] - ldrsh r3, [sl, #6] - add r1, sp, #0x34 - str r4, [sp, #0x24] - ldrsh r4, [r5, r8] - strh r3, [sp, #0x36] - ldr r3, [sp] - mov r0, sl - mov r2, sb - str r4, [sp, #0x20] - bl ov29_02322F78 - mov r4, r0 - mov r1, r6 - mov r0, #0x18 - bl _s32_div_f - str r0, [sp, #4] - ldr r0, [sp] - cmp r0, #2 - mov r2, r0 - ldr r0, [sp, #4] - mul r1, r2, r0 - blt _02323A18 - add r0, r1, #8 - str r0, [sp, #0x14] - cmp r0, #0x40 - movge r0, #0x40 - strge r0, [sp, #0x14] - b _02323A20 -_02323A18: - mov r0, #0x20 - str r0, [sp, #0x14] -_02323A20: - mov r0, #0x80000 - mov r5, #0 - bl _s32_div_f - str r0, [sp, #0x1c] - ldrb r2, [r7, #0x4c] - ldr r1, _02323C38 ; =ov29_02352A8C - mov r0, #1 - ldr r1, [r1, r2, lsl #2] - str r1, [sp, #0x10] - bl ov29_0234B4CC - ldr r0, [sp, #0x24] - mov r2, r6, lsl #8 - mul r1, r0, r2 - ldr r0, [sp, #0x20] - str r1, [sp, #0xc] - mul r1, r0, r2 - mov fp, r5 - str r1, [sp, #8] - b _02323BC0 -_02323A6C: - ldrsh r2, [sp, #0x34] - cmp r2, #0 - ldrgesh r1, [sp, #0x36] - cmpge r1, #0 - blt _02323BCC - cmp r2, #0x38 - cmplt r1, #0x20 - bge _02323BCC - ldr r0, [sp, #0x24] - ldrh r6, [sp, #0x34] - add r2, r2, r0 - ldr r0, [sp, #0x20] - ldrh r3, [sp, #0x36] - add r1, r1, r0 - add r0, sp, #0x34 - strh r6, [sp, #0x30] - strh r3, [sp, #0x32] - strh r2, [sp, #0x34] - strh r1, [sp, #0x36] - bl ov29_022E2CA0 - cmp r0, #0 - beq _02323BB0 - ldr r0, _02323C3C ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, #0x1a000 -#ifdef JAPAN - ldrb r0, [r0, #0x19a] -#else - ldrb r0, [r0, #0x23e] -#endif - cmp r0, #0 - bne _02323BB0 - ldrsh r2, [sp, #0x30] - ldrsh r1, [sp, #0x32] - mov r0, #0x18 - smulbb r2, r2, r0 - smulbb r0, r1, r0 - add r0, r0, #0x10 - mov r8, r0, lsl #8 - mov r0, r4, lsl #0x10 - add r1, r2, #0xc - mov r0, r0, asr #0x10 - mov r7, r1, lsl #8 - mov r6, #0 - str r0, [sp, #0x28] - b _02323BA0 -_02323B14: - cmp r4, #0 - blt _02323B7C - ldr r0, [sp, #0x60] - cmp r0, #1 - movne r0, #0 - bne _02323B3C - mov r0, r5, asr #8 - bl sub_020018D0 - ldr r1, [sp, #0x14] - mul r0, r1, r0 -_02323B3C: - sub r0, r8, r0 - ldr r2, _02323C3C ; =DUNGEON_PTR - mov r0, r0, asr #8 - strh r0, [sp, #0x2e] - mov r0, r7, asr #8 - ldr r3, [r2] - strh r0, [sp, #0x2c] - ldr r2, _02323C40 ; =0x0001A226 - ldr r0, [sp, #0x28] - ldrsh r2, [r3, r2] - add r1, sp, #0x2c - rsb r2, r2, r8, asr #8 - add r3, r2, r2, lsr #31 - ldr r2, [sp, #0x10] - add r2, r2, r3, asr #1 - bl ov10_022BEB2C -_02323B7C: - mov r0, #0x30 - bl AdvanceFrame - ldr r0, [sp, #0xc] - add r6, r6, #1 - add r7, r7, r0 - ldr r0, [sp, #8] - add r8, r8, r0 - ldr r0, [sp, #0x1c] - add r5, r5, r0 -_02323BA0: - ldr r0, [sp, #4] - cmp r6, r0 - blt _02323B14 - b _02323BBC -_02323BB0: - ldr r1, [sp, #0x1c] - ldr r0, [sp, #4] - mla r5, r1, r0, r5 -_02323BBC: - add fp, fp, #1 -_02323BC0: - ldr r0, [sp] - cmp fp, r0 - blt _02323A6C -_02323BCC: - cmp r4, #0 - blt _02323BE0 - mov r0, r4, lsl #0x10 - mov r0, r0, asr #0x10 - bl ov10_022BDE50 -_02323BE0: - mov r0, #1 - bl AnimationDelayOrSomething - mov r0, #0 - bl ov29_0234B4CC - mov r0, #1 - mov r1, #0x4a - bl ov29_022EA370 - ldrh r1, [sb, #4] - ldr r0, _02323C44 ; =0x00000232 - add r3, sp, #0x34 - cmp r1, r0 - ldreq r0, [sp, #0x18] - moveq r1, #0 -#ifdef JAPAN - streqb r1, [r0, #0x16c] -#else - streqb r1, [r0, #0x170] -#endif - mov r0, sl - mov r2, sb - mov r1, #0 - bl PlayMoveAnimation - add sp, sp, #0x38 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_02323C30: .word DIRECTIONS_XY -_02323C34: .word ov29_0235171E -_02323C38: .word ov29_02352A8C -_02323C3C: .word DUNGEON_PTR -#ifdef JAPAN -_02323C40: .word 0x0001A182 -#else -_02323C40: .word 0x0001A226 -#endif -_02323C44: .word 0x00000232 - arm_func_end ov29_0232393C - - arm_func_start MoveHitCheck -MoveHitCheck: ; 0x02323C48 - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0xc - mov fp, r2 - mov r7, r0 - mov r6, r1 - mov r0, fp - mov r1, r3 - bl GetMoveAccuracyOrAiChance - mov r8, r0 - mov r0, #0x64 - bl DungeonRandInt - mov r1, #0 - str r1, [sp, #4] - ldr sb, [r7, #0xb4] - str r0, [sp, #8] - ldrsh r0, [sb, #2] - mov r1, r1 - str r1, [sp] - ldr r5, [r6, #0xb4] - bl GetMonsterGenderVeneer - cmp r0, #2 - moveq r0, #1 - streq r0, [sp, #4] - ldrsh r0, [r5, #2] - bl GetMonsterGenderVeneer - cmp r0, #2 - moveq r0, #1 - streq r0, [sp] - ldrb r0, [sp, #0x30] - mov sl, #0 - mov r4, sl - cmp r0, #0 - beq _02323CD8 - cmp r7, r6 - moveq r0, #1 - beq _02324008 -_02323CD8: - ldrh r1, [fp, #4] - ldr r0, _02324010 ; =0x00000163 - cmp r1, r0 - bne _02323D00 - mov r0, r7 - mov r1, #4 - bl IqSkillIsEnabled - cmp r0, #0 - movne r0, #1 - bne _02324008 -_02323D00: - ldrb r0, [sb, #0xec] - cmp r0, #1 - moveq r0, #1 - beq _02324008 - cmp r0, #2 - moveq r0, #0 - beq _02324008 - cmp r8, #0x64 - movgt r0, #1 - bgt _02324008 - mov r0, r6 - mov r1, #0x6f - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #0 - bne _02323D4C - mov r0, r6 - mov r1, #0x2a - bl HasHeldItem -_02323D4C: - cmp r0, #0 - ldrne r0, _02324014 ; =DETECT_BAND_MOVE_ACCURACY_DROP - mov r1, #5 - ldrne r0, [r0] - subne r8, r8, r0 - mov r0, r6 - bl IqSkillIsEnabled - cmp r0, #0 - ldrne r0, _02324018 ; =QUICK_DODGER_MOVE_ACCURACY_DROP - mov r1, #0x33 - ldrne r0, [r0] - ldrsh sb, [sb, #0x2c] - subne r8, r8, r0 - mov r0, r7 - bl AbilityIsActiveVeneer - cmp r0, #0 - ldrh r0, [fp, #4] - addne sl, sl, #2 - cmp r0, #0x40 - bne _02323DB8 - mov r0, r7 - bl GetApparentWeather - cmp r0, #4 - moveq r0, #1 - beq _02324008 - cmp r0, #1 - subeq sl, sl, #2 -_02323DB8: - ldrh r1, [fp, #4] - ldr r0, _0232401C ; =0x0000010E - cmp r1, r0 - bne _02323DDC - mov r0, r7 - bl GetApparentWeather - cmp r0, #5 - moveq r0, #1 - beq _02324008 -_02323DDC: - mov r0, r7 - mov r1, #0x30 - bl IqSkillIsEnabled - cmp r0, #0 - addne sl, sl, #1 - ldrb r0, [r5, #0xfe] - add sb, sb, sl - ldrsh sl, [r5, #0x2e] - cmp r0, #0 - mov r0, r6 - movne sl, #0xa - bl GetApparentWeather - cmp r0, #2 - bne _02323E30 - mov r0, r7 - mov r1, r6 - mov r2, #0x1d -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__02322D64 - cmp r0, #0 - addne r4, r4, #2 -_02323E30: - mov r0, r7 - mov r1, #0x30 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _02323E54 - ldrh r0, [fp, #4] - bl MoveIsNotPhysical - cmp r0, #0 - addeq r4, r4, #2 -_02323E54: - mov r0, r6 - mov r1, #0x3f - bl IqSkillIsEnabled - cmp r0, #0 - beq _02323E94 - ldrsh r2, [r5, #0x12] - ldrsh r1, [r5, #0x16] - ldr r0, _02324020 ; =0x000003E7 - add r2, r2, r1 - cmp r2, r0 - movgt r2, r0 - mov r0, r2, asr #1 - ldrsh r1, [r5, #0x10] - add r0, r2, r0, lsr #30 - cmp r1, r0, asr #2 - addle r4, r4, #2 -_02323E94: - mov r0, r6 - mov r1, #0x30 - bl IqSkillIsEnabled - cmp r0, #0 - mov r0, r7 - mov r1, r6 - mov r2, #0x62 -#ifndef JAPAN - mov r3, #1 -#endif - subne r4, r4, #1 - bl DefenderAbilityIsActive__02322D64 - cmp r0, #0 - beq _02323ED8 - ldrb r0, [r5, #0xd0] - cmp r0, #2 - ldrneb r0, [r5, #0xf1] - cmpne r0, #2 - addeq r4, r4, #3 -_02323ED8: - mov r0, r7 - mov r1, r6 - mov r2, #0x77 -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__02322D64 - cmp r0, #0 - beq _02323F18 - mov r0, r6 - bl GetApparentWeather - cmp r0, #5 - beq _02323F14 - mov r0, r6 - bl GetApparentWeather - cmp r0, #7 - bne _02323F18 -_02323F14: - add r4, r4, #2 -_02323F18: - mov r0, r6 - bl GetApparentWeather - ldr r2, _02324024 ; =EXCL_ITEM_EFFECTS_EVASION_BOOST - ldrb r1, [r2, r0] - cmp r1, #0 - beq _02323F44 - ldrb r1, [r2, r0] - mov r0, r6 - bl ExclusiveItemEffectIsActive__02323918 - cmp r0, #0 - addne r4, r4, #1 -_02323F44: - mov r0, r7 - mov r1, #0x6a - add sl, sl, r4 - bl AbilityIsActiveVeneer - cmp r0, #0 - movne sb, #0xa - mov r0, r7 - mov r1, r6 - mov r2, #0x6a -#ifndef JAPAN - mov r3, #1 -#endif - movne sl, sb - bl DefenderAbilityIsActive__02322D64 - cmp r0, #0 - movne sb, #0xa - movne sl, sb - cmp sb, #0 - movlt sb, #0 - blt _02323F94 - cmp sb, #0x14 - movgt sb, #0x14 -_02323F94: - ldr r2, _02324028 ; =MALE_ACCURACY_STAGE_MULTIPLIERS - ldr r0, [sp, #4] - mov r1, #0xa8 - mla r1, r0, r1, r2 - ldr r3, [r1, sb, lsl #2] - cmp sl, #0 - movlt sl, #0 - cmp sl, #0x14 - movgt sl, #0x14 - cmp r3, #0 - movlt r3, #0 - cmp r3, #0x6400 - ldr r2, _0232402C ; =MALE_EVASION_STAGE_MULTIPLIERS - ldr r0, [sp] - mov r1, #0xa8 - mla r1, r0, r1, r2 - movgt r3, #0x6400 - mul r0, r8, r3 - ldr r1, [r1, sl, lsl #2] - mov r8, r0, asr #8 - cmp r1, #0 - movlt r1, #0 - cmp r1, #0x6400 - movgt r1, #0x6400 - mul r1, r8, r1 - ldr r0, [sp, #8] - cmp r0, r1, asr #8 - movlt r0, #1 - movge r0, #0 -_02324008: - add sp, sp, #0xc - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_02324010: .word 0x00000163 -_02324014: .word DETECT_BAND_MOVE_ACCURACY_DROP -_02324018: .word QUICK_DODGER_MOVE_ACCURACY_DROP -_0232401C: .word 0x0000010E -_02324020: .word 0x000003E7 -_02324024: .word EXCL_ITEM_EFFECTS_EVASION_BOOST -_02324028: .word MALE_ACCURACY_STAGE_MULTIPLIERS -_0232402C: .word MALE_EVASION_STAGE_MULTIPLIERS - arm_func_end MoveHitCheck - - arm_func_start ov29_02324030 -ov29_02324030: ; 0x02324030 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x18 - mov sb, r1 - mov sl, r0 - mov r0, sb - mov r1, #1 - mov r4, #0 - mov r8, r2 - bl ov29_023024E0 - mov r6, r0 - mov r0, sb - mov r1, r4 - bl ov29_023024E0 - str r0, [sp, #0x10] - mov r0, sb - mov r1, r8 - mov r2, r4 - bl GetEntityMoveTargetAndRange - mov r5, r0 - and r0, r5, #0xf - cmp r0, #4 - bne _023240C0 - mov r0, sb - mov r1, r8 - bl IsChargingTwoTurnMove - ldrh r1, [r8, #4] - mov r5, r0 - cmp r1, #0x97 - bne _023240B4 - mov r0, sb - bl GetApparentWeather - cmp r0, #1 - moveq r5, #1 -_023240B4: - cmp r5, #0 - movne r5, #0 - moveq r5, #0x73 -_023240C0: - ands r0, r5, #0xf0 - bne _023240FC - mov r0, sb - bl ov29_022F87C0 - cmp r0, #0 - beq _0232439C - stmia sp, {r0, r8} - mov r1, sl - mov r2, r5 - mov r3, sb - mov r0, #0 - str r6, [sp, #8] - bl ov29_023243B4 - mov r4, r0 - b _0232439C -_023240FC: - cmp r0, #0x10 - cmpne r0, #0x20 - bne _023241AC - cmp r0, #0x20 - ldr r0, [sb, #0xb4] - mov fp, #0 - ldreqb r7, [r0, #0x4c] - moveq r0, #8 - ldrneb r1, [r0, #0x4c] - streq r0, [sp, #0xc] - movne r0, #3 - strne r0, [sp, #0xc] - subne r7, r1, #1 - b _0232419C -_02324134: - and r7, r7, #7 - ldr r1, _023243AC ; =DIRECTIONS_XY - mov r2, r7, lsl #2 - ldrsh r2, [r1, r2] - ldrsh r0, [sb, #4] - add r1, r1, r7, lsl #2 - ldrsh r1, [r1, #2] - add r0, r0, r2 - strh r0, [sp, #0x14] - ldrsh r2, [sb, #6] - add r0, sp, #0x14 - add r1, r2, r1 - strh r1, [sp, #0x16] - bl PositionHasMonster - cmp r0, #0 - beq _02324194 - stmia sp, {r0, r8} - mov r0, r4 - mov r1, sl - mov r2, r5 - mov r3, sb - str r6, [sp, #8] - bl ov29_023243B4 - mov r4, r0 -_02324194: - add fp, fp, #1 - add r7, r7, #1 -_0232419C: - ldr r0, [sp, #0xc] - cmp fp, r0 - blt _02324134 - b _0232439C -_023241AC: - cmp r0, #0x30 - bne _02324248 - mov fp, #0 -_023241B8: - ldr r0, _023243B0 ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, fp, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr r7, [r0, #0xad4] -#else - ldr r7, [r0, #0xb78] -#endif - mov r0, r7 - bl EntityIsValid__02321438 - cmp r0, #0 - beq _02324238 - mov r0, sb - mov r1, r7 - bl ov29_022E28D4 - cmp r0, #0 - beq _02324238 - cmp r7, sb - stmia sp, {r7, r8} - mov r0, r4 - bne _02324220 - ldr r4, [sp, #0x10] - mov r1, sl - mov r2, r5 - mov r3, sb - str r4, [sp, #8] - bl ov29_023243B4 - mov r4, r0 - b _02324238 -_02324220: - mov r1, sl - mov r2, r5 - mov r3, sb - str r6, [sp, #8] - bl ov29_023243B4 - mov r4, r0 -_02324238: - add fp, fp, #1 - cmp fp, #0x14 - blt _023241B8 - b _0232439C -_02324248: - cmp r0, #0x40 - bne _023242C4 - mov r0, sb - mov r7, #0 - bl ov29_022F8830 - cmp r0, #0 - beq _02324288 - stmia sp, {r0, r8} - mov r1, sl - mov r2, r5 - mov r3, sb - mov r0, r7 - str r6, [sp, #8] - bl ov29_023243B4 - movs r4, r0 - movne r7, #1 -_02324288: - cmp r7, #0 - bne _0232439C - mov r0, sb - bl ov29_022F88C0 - cmp r0, #0 - beq _0232439C - stmia sp, {r0, r8} - mov r0, r4 - mov r1, sl - mov r2, r5 - mov r3, sb - str r6, [sp, #8] - bl ov29_023243B4 - mov r4, r0 - b _0232439C -_023242C4: - cmp r0, #0x50 - beq _0232439C - cmp r0, #0x80 - cmpne r0, #0x90 - bne _0232430C - mov r0, sb - bl ov29_022F8830 - cmp r0, #0 - beq _0232439C - stmia sp, {r0, r8} - mov r1, sl - mov r2, r5 - mov r3, sb - mov r0, #0 - str r6, [sp, #8] - bl ov29_023243B4 - mov r4, r0 - b _0232439C -_0232430C: - cmp r0, #0x60 - bne _02324370 - mov r7, #0 -_02324318: - ldr r0, _023243B0 ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, r7, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr fp, [r0, #0xad4] -#else - ldr fp, [r0, #0xb78] -#endif - mov r0, fp - bl EntityIsValid__02321438 - cmp r0, #0 - beq _02324360 - str fp, [sp] - str r8, [sp, #4] - mov r0, r4 - mov r1, sl - mov r2, r5 - mov r3, sb - str r6, [sp, #8] - bl ov29_023243B4 - mov r4, r0 -_02324360: - add r7, r7, #1 - cmp r7, #0x14 - blt _02324318 - b _0232439C -_02324370: - cmp r0, #0x70 - bne _0232439C - str sb, [sp] - str r8, [sp, #4] - mov r1, sl - mov r2, r5 - mov r3, sb - mov r0, #0 - str r6, [sp, #8] - bl ov29_023243B4 - mov r4, r0 -_0232439C: - mov r0, #0 - str r0, [sl, r4, lsl #2] - add sp, sp, #0x18 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_023243AC: .word DIRECTIONS_XY -_023243B0: .word DUNGEON_PTR - arm_func_end ov29_02324030 - - arm_func_start ov29_023243B4 -ov29_023243B4: ; 0x023243B4 - stmdb sp!, {r4, r5, r6, r7, r8, lr} - ldr r4, [sp, #0x1c] - ldr r5, [sp, #0x18] - ldrh r4, [r4, #4] - mov r7, r1 - mov r8, r0 - cmp r4, #0xfc - mov r6, r3 - mov r4, #0 - ldr r1, [r5, #0xb4] - cmpeq r6, r5 - ldmeqia sp!, {r4, r5, r6, r7, r8, pc} - ldrb r0, [r1, #9] - cmp r0, #1 - moveq r0, r8 - ldmeqia sp!, {r4, r5, r6, r7, r8, pc} - ldrb r0, [r1, #0xbc] - cmp r0, #7 - moveq r0, r8 - ldmeqia sp!, {r4, r5, r6, r7, r8, pc} - ldrb r0, [sp, #0x20] - cmp r0, #0 - movne r4, #1 - bne _023244C0 - ands r0, r2, #0xf - cmpne r0, #4 - bne _02324440 - mov r0, r6 - mov r1, r5 - mov r2, #1 - mov r3, #0 - bl GetTreatmentBetweenMonsters - cmp r0, #1 - moveq r4, #1 - b _023244C0 -_02324440: - cmp r0, #1 - bne _02324468 - mov r0, r6 - mov r1, r5 - mov r2, #1 - mov r3, #0 - bl GetTreatmentBetweenMonsters - cmp r0, #0 - moveq r4, #1 - b _023244C0 -_02324468: - cmp r0, #2 - moveq r4, #1 - beq _023244C0 - cmp r0, #5 - bne _02324488 - cmp r6, r5 - movne r4, #1 - b _023244C0 -_02324488: - cmp r0, #6 - bne _023244B8 - mov r0, r6 - mov r1, r5 - mov r2, #1 - mov r3, #0 - bl GetTreatmentBetweenMonsters - cmp r0, #0 - bne _023244C0 - cmp r6, r5 - movne r4, #1 - b _023244C0 -_023244B8: - cmp r0, #3 - moveq r4, #1 -_023244C0: - ldr r1, [sp, #0x1c] - mov r0, r5 - bl TwoTurnMoveForcedMiss - cmp r0, #0 - movne r4, #0 - cmp r4, #0 - beq _02324508 - cmp r8, #0x40 - bge _02324508 - str r5, [r7, r8, lsl #2] - ldr r0, [r5, #0xb4] - add r8, r8, #1 - ldrb r0, [r0, #6] - cmp r0, #0 - ldreq r0, _02324510 ; =ov29_0235370C - ldreq r1, [r0] - cmpeq r1, #0 - streq r5, [r0] -_02324508: - mov r0, r8 - ldmia sp!, {r4, r5, r6, r7, r8, pc} - .align 2, 0 -_02324510: .word ov29_0235370C - arm_func_end ov29_023243B4 - - arm_func_start ov29_02324514 -ov29_02324514: ; 0x02324514 - stmdb sp!, {r3, lr} - bl GetMoveNbStrikes - cmp r0, #0 - ldmneia sp!, {r3, pc} - mov r0, #2 - mov r1, #6 - bl DungeonRandRange - ldmia sp!, {r3, pc} - arm_func_end ov29_02324514 - - arm_func_start IsHyperBeamVariant -IsHyperBeamVariant: ; 0x02324534 - ldrh r2, [r0, #4] - cmp r2, #0xee - moveq r0, #1 - bxeq lr - cmp r2, #0xef - moveq r0, #1 - bxeq lr - cmp r2, #0xf2 - moveq r0, #1 - bxeq lr - cmp r2, #0x110 - moveq r0, #1 - bxeq lr - ldr r1, _023245A0 ; =0x000001C5 - cmp r2, r1 - moveq r0, #1 - bxeq lr - add r0, r1, #2 - cmp r2, r0 - moveq r0, #1 - bxeq lr - add r0, r1, #0x29 - cmp r2, r0 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - .align 2, 0 -_023245A0: .word 0x000001C5 - arm_func_end IsHyperBeamVariant - - arm_func_start IsChargingTwoTurnMove -IsChargingTwoTurnMove: ; 0x023245A4 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl EntityIsValid__02321438 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldr ip, [r5, #0xb4] - mov lr, #0 - ldr r2, _02324618 ; =TWO_TURN_MOVES_AND_STATUSES - b _02324608 -_023245D0: - mov r3, lr, lsl #2 - ldrh r1, [r2, r3] - cmp r1, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrh r0, [r4, #4] - cmp r0, r1 - addeq r0, r2, r3 - ldreqb r1, [ip, #0xd2] - ldreqb r0, [r0, #2] - cmpeq r1, r0 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - add lr, lr, #1 -_02324608: - cmp lr, #0x64 - blt _023245D0 - mov r0, #0 - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_02324618: .word TWO_TURN_MOVES_AND_STATUSES - arm_func_end IsChargingTwoTurnMove - - arm_func_start IsChargingAnyTwoTurnMove -IsChargingAnyTwoTurnMove: ; 0x0232461C - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl EntityIsValid__02321438 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldr ip, [r5, #0xb4] - mov r3, #0 - ldr r2, _02324694 ; =ov29_02352A60 - b _0232466C -_02324648: - ldrb r1, [r2, r3] - cmp r1, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [ip, #0xd2] - cmp r0, r1 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - add r3, r3, #1 -_0232466C: - cmp r3, #0x64 - blt _02324648 - cmp r4, #0 - beq _0232468C - ldrb r0, [ip, #0xd2] - cmp r0, #0xb - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} -_0232468C: - mov r0, #0 - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_02324694: .word ov29_02352A60 - arm_func_end IsChargingAnyTwoTurnMove - - arm_func_start ov29_02324698 -ov29_02324698: ; 0x02324698 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x140 - mov r6, #0 - ldr fp, _02324740 ; =DUNGEON_PTR - mov r7, r6 - add r4, sp, #0 -_023246B0: - ldr r0, [fp] - add r0, r0, r7, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr sb, [r0, #0xad4] -#else - ldr sb, [r0, #0xb78] -#endif - mov r0, sb - bl EntityIsValid__02321438 - cmp r0, #0 - beq _0232470C - ldr r0, [sb, #0xb4] - mov r8, #0 -#ifdef JAPAN - add r5, r0, #0x120 -#else - add r5, r0, #0x124 -#endif -_023246DC: - add sl, r5, r8, lsl #3 - mov r0, sb - mov r1, sl - bl ov29_02324748 - cmp r0, #0 - beq _02324700 - cmp r6, #0x50 - strlt sl, [r4, r6, lsl #2] - addlt r6, r6, #1 -_02324700: - add r8, r8, #1 - cmp r8, #4 - blt _023246DC -_0232470C: - add r7, r7, #1 - cmp r7, #0x14 - blt _023246B0 - cmp r6, #0 - ldreq r0, _02324744 ; =0x00000163 - beq _02324738 - mov r0, r6 - bl DungeonRandInt - add r1, sp, #0 - ldr r0, [r1, r0, lsl #2] - ldrh r0, [r0, #4] -_02324738: - add sp, sp, #0x140 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_02324740: .word DUNGEON_PTR -_02324744: .word 0x00000163 - arm_func_end ov29_02324698 - - arm_func_start ov29_02324748 -ov29_02324748: ; 0x02324748 - stmdb sp!, {r4, lr} - mov r4, r1 - ldrb r1, [r4] - tst r1, #1 - movne r1, #1 - moveq r1, #0 - tst r1, #0xff - beq _02324788 - ldrh r1, [r4, #4] - bl ov29_02324D60 - cmp r0, #0 - bne _02324788 - ldrh r0, [r4, #4] - bl IsCopyingMove - cmp r0, #0 - beq _02324790 -_02324788: - mov r0, #0 - ldmia sp!, {r4, pc} -_02324790: - mov r0, #1 - ldmia sp!, {r4, pc} - arm_func_end ov29_02324748 - - arm_func_start HasMaxGinsengBoost99 -HasMaxGinsengBoost99: ; 0x02324798 - stmdb sp!, {r3, lr} - bl GetMoveMaxGinsengBoost - cmp r0, #0x63 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} - arm_func_end HasMaxGinsengBoost99 - - arm_func_start ov29_023247B4 -ov29_023247B4: ; 0x023247B4 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - sub sp, sp, #8 - mov r8, r0 - ldr r0, [r8, #0xb4] - mov r7, #0 - mov r6, r7 -#ifdef JAPAN - add r5, r0, #0x120 -#else - add r5, r0, #0x124 -#endif - add r4, sp, #0 -_023247D4: - add sb, r5, r6, lsl #3 - mov r0, r8 - mov r1, sb - bl ov29_02324748 - cmp r0, #0 - beq _02324814 - mov r0, sb - bl HasMaxGinsengBoost99 - cmp r0, #0 - beq _02324814 - ldrh r2, [sb, #4] - add r0, r7, #1 - mov r1, r7, lsl #1 - mov r0, r0, lsl #0x10 - strh r2, [r4, r1] - mov r7, r0, asr #0x10 -_02324814: - add r0, r6, #1 - mov r0, r0, lsl #0x10 - mov r6, r0, asr #0x10 - cmp r6, #4 - blt _023247D4 - cmp r7, #0 - movle r0, #0 - ble _0232484C - mov r0, r7 - bl DungeonRandInt - mov r0, r0, lsl #0x10 - add r1, sp, #0 - mov r0, r0, asr #0xf - ldrh r0, [r1, r0] -_0232484C: - add sp, sp, #8 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - arm_func_end ov29_023247B4 - - arm_func_start TwoTurnMoveForcedMiss -TwoTurnMoveForcedMiss: ; 0x02324854 - stmdb sp!, {r3, lr} - ldr r2, [r0, #0xb4] -#ifdef JAPAN - ldrb r0, [r2, #0x10a] -#else - ldrb r0, [r2, #0x10b] -#endif - cmp r0, #1 - bne _023248A4 - ldrh r0, [r1, #4] - cmp r0, #0x88 - moveq r0, #0 - ldmeqia sp!, {r3, pc} - cmp r0, #0xa2 - moveq r0, #0 - ldmeqia sp!, {r3, pc} - cmp r0, #0x39 - moveq r0, #0 - ldmeqia sp!, {r3, pc} - cmp r0, #0x40 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} -_023248A4: - cmp r0, #2 - bne _02324928 - ldrb r0, [r2, #0xd2] - cmp r0, #9 - bne _023248D8 - ldrh r0, [r1, #4] - cmp r0, #0x20 - moveq r0, #0 - ldmeqia sp!, {r3, pc} - cmp r0, #0xdb - bne _02324920 - mov r0, #0 - ldmia sp!, {r3, pc} -_023248D8: - cmp r0, #0xa - bne _02324920 - ldrh r0, [r1, #4] - cmp r0, #0x76 - moveq r0, #0 - ldmeqia sp!, {r3, pc} - cmp r0, #0x128 - moveq r0, #0 - ldmeqia sp!, {r3, pc} - cmp r0, #0x77 - bne _02324920 - bl GetNaturePowerVariant - ldr r1, _02324930 ; =NATURE_POWER_TABLE - mov r0, r0, lsl #3 - ldrh r0, [r1, r0] - cmp r0, #0x76 - moveq r0, #0 - ldmeqia sp!, {r3, pc} -_02324920: - mov r0, #1 - ldmia sp!, {r3, pc} -_02324928: - mov r0, #0 - ldmia sp!, {r3, pc} - .align 2, 0 -_02324930: .word NATURE_POWER_TABLE - arm_func_end TwoTurnMoveForcedMiss - - arm_func_start DungeonRandOutcomeUserTargetInteraction -DungeonRandOutcomeUserTargetInteraction: ; 0x02324934 - stmdb sp!, {r4, r5, r6, lr} - mov r6, r0 - mov r5, r1 - mov r4, r2 - bl IsFloorOver - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, pc} - mov r0, r6 - bl EntityIsValid__02321438 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, r5 - bl EntityIsValid__02321438 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - ldr r1, [r5, #0xb4] -#ifdef JAPAN - ldrb r0, [r1, #0x15e] -#else - ldrb r0, [r1, #0x162] -#endif - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - ldrsh r0, [r1, #0x10] - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - cmp r4, #0 - beq _023249DC - mov r0, r6 - mov r1, #0x26 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _023249CC - mov r0, r4, lsl #1 - bl DungeonRandOutcome__022EAB50 - mov r4, r0 - b _023249E0 -_023249CC: - mov r0, r4 - bl DungeonRandOutcome__022EAB50 - mov r4, r0 - b _023249E0 -_023249DC: - mov r4, #1 -_023249E0: - cmp r4, #0 - cmpne r6, r5 - beq _02324A18 - mov r0, r6 - mov r1, r5 - mov r2, #0x4c -#ifndef JAPAN - mov r3, #1 -#endif - bl DefenderAbilityIsActive__02322D64 - cmp r0, #0 - beq _02324A18 - mov r0, r5 - bl ov29_022E65A8 - mov r0, #0 - ldmia sp!, {r4, r5, r6, pc} -_02324A18: - mov r0, r4 - ldmia sp!, {r4, r5, r6, pc} - arm_func_end DungeonRandOutcomeUserTargetInteraction - - arm_func_start DungeonRandOutcomeUserAction -DungeonRandOutcomeUserAction: ; 0x02324A20 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl EntityIsValid__02321438 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r4, #0 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, r5 - mov r1, #0x26 - bl AbilityIsActiveVeneer - cmp r0, #0 - beq _02324A68 - mov r0, r4, lsl #1 - bl DungeonRandOutcome__022EAB50 - ldmia sp!, {r3, r4, r5, pc} -_02324A68: - mov r0, r4 - bl DungeonRandOutcome__022EAB50 - ldmia sp!, {r3, r4, r5, pc} - arm_func_end DungeonRandOutcomeUserAction - - arm_func_start CanAiUseMove -CanAiUseMove: ; 0x02324A74 - stmdb sp!, {r4, r5, r6, r7, r8, lr} - mov r6, r0 - ldr r3, [r6, #0xb4] - mov r5, r2 -#ifdef JAPAN - add r0, r3, #0x120 -#else - add r0, r3, #0x124 -#endif - ldrb r2, [r0, r1, lsl #3] - add r4, r0, r1, lsl #3 - tst r2, #1 - movne r0, #1 - moveq r0, #0 - tst r0, #0xff - moveq r0, #0 - ldmeqia sp!, {r4, r5, r6, r7, r8, pc} - tst r2, #2 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, r7, r8, pc} - tst r2, #0x20 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, r7, r8, pc} - ldrh r0, [r4, #2] - tst r0, #1 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, r7, r8, pc} - mov r8, #0 -#ifdef JAPAN - add r7, r3, #0x140 -#else - add r7, r3, #0x144 -#endif - b _02324B14 -_02324ADC: - mov r0, r6 - mov r1, r4 - mov r2, r5 - bl CanMonsterUseMove - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r4, r5, r6, r7, r8, pc} - add r4, r4, #8 - cmp r4, r7 - bhs _02324B1C - ldrb r0, [r4] - tst r0, #2 - beq _02324B1C - add r8, r8, #1 -_02324B14: - cmp r8, #4 - blt _02324ADC -_02324B1C: - mov r0, #0 - ldmia sp!, {r4, r5, r6, r7, r8, pc} - arm_func_end CanAiUseMove - - arm_func_start CanMonsterUseMove -CanMonsterUseMove: ; 0x02324B24 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r1 - ldrh r3, [r5, #4] - ldr r1, _02324BE4 ; =0x00000163 - ldr r4, [r0, #0xb4] - cmp r3, r1 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r5] - tst r0, #0x20 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - ldrh r0, [r5, #2] - tst r0, #1 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - cmp r2, #0 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r5, #6] - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xd0] - cmp r0, #5 - bne _02324BA0 - mov r0, r5 - bl IsAffectedByTaunt - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} -_02324BA0: - ldrb r0, [r4, #0xd0] - cmp r0, #6 - bne _02324BDC - ldrh r0, [r5, #4] - cmp r0, #0x160 - bne _02324BCC -#ifdef JAPAN - ldrb r0, [r4, #0x140] -#else - ldrb r0, [r4, #0x144] -#endif - tst r0, #0x10 - bne _02324BDC - mov r0, #0 - ldmia sp!, {r3, r4, r5, pc} -_02324BCC: - ldrb r0, [r5] - tst r0, #0x10 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} -_02324BDC: - mov r0, #1 - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_02324BE4: .word 0x00000163 - arm_func_end CanMonsterUseMove - - arm_func_start ov29_02324BE8 -ov29_02324BE8: ; 0x02324BE8 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r1 - ldrh r3, [r5, #4] - ldr r1, _02324C98 ; =0x00000163 - ldr r4, [r0, #0xb4] - cmp r3, r1 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r5] - tst r0, #0x20 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - ldrh r0, [r5, #2] - tst r0, #1 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - cmp r2, #0 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xd0] - cmp r0, #5 - bne _02324C54 - mov r0, r5 - bl IsAffectedByTaunt - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} -_02324C54: - ldrb r0, [r4, #0xd0] - cmp r0, #6 - bne _02324C90 - ldrh r0, [r5, #4] - cmp r0, #0x160 - bne _02324C80 -#ifdef JAPAN - ldrb r0, [r4, #0x140] -#else - ldrb r0, [r4, #0x144] -#endif - tst r0, #0x10 - bne _02324C90 - mov r0, #0 - ldmia sp!, {r3, r4, r5, pc} -_02324C80: - ldrb r0, [r5] - tst r0, #0x10 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} -_02324C90: - mov r0, #1 - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_02324C98: .word 0x00000163 - arm_func_end ov29_02324BE8 - - arm_func_start ov29_02324C9C -ov29_02324C9C: ; 0x02324C9C - stmdb sp!, {lr} - sub sp, sp, #0x104 - mov ip, #0 - mov lr, ip - add r2, sp, #0 - b _02324CDC -_02324CB4: - ldr r3, [r0, lr, lsl #2] - cmp r3, #0 - beq _02324CE4 - cmp r3, r1 - beq _02324CD8 - cmp ip, #0x40 - bge _02324CE4 - str r3, [r2, ip, lsl #2] - add ip, ip, #1 -_02324CD8: - add lr, lr, #1 -_02324CDC: - cmp lr, #0x41 - blt _02324CB4 -_02324CE4: - mov lr, #0 - add r2, sp, #0 - b _02324D18 -_02324CF0: - ldr r3, [r0, lr, lsl #2] - cmp r3, #0 - beq _02324D20 - cmp r3, r1 - bne _02324D14 - cmp ip, #0x40 - bge _02324D20 - str r3, [r2, ip, lsl #2] - add ip, ip, #1 -_02324D14: - add lr, lr, #1 -_02324D18: - cmp lr, #0x41 - blt _02324CF0 -_02324D20: - mov r2, #0 - add r1, sp, #0 - b _02324D34 -_02324D2C: - str r2, [r1, ip, lsl #2] - add ip, ip, #1 -_02324D34: - cmp ip, #0x41 - blt _02324D2C - mov r3, #0 - add r2, sp, #0 -_02324D44: - ldr r1, [r2, r3, lsl #2] - str r1, [r0, r3, lsl #2] - add r3, r3, #1 - cmp r3, #0x41 - blt _02324D44 - add sp, sp, #0x104 - ldmia sp!, {pc} - arm_func_end ov29_02324C9C - - arm_func_start ov29_02324D60 -ov29_02324D60: ; 0x02324D60 - stmdb sp!, {r4, lr} - mov r4, r1 - cmp r4, #0x97 - bne _02324D80 - bl GetApparentWeather - cmp r0, #1 - moveq r0, #0 - ldmeqia sp!, {r4, pc} -_02324D80: - mov r0, r4 - bl Is2TurnsMove - ldmia sp!, {r4, pc} - arm_func_end ov29_02324D60 - - arm_func_start UpdateMovePp -UpdateMovePp: ; 0x02324D8C - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl EntityIsValid__02321438 - cmp r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldr r0, [r5, #0xb4] - mov r1, #0 -_02324DAC: -#ifdef JAPAN - add r2, r0, #0x120 -#else - add r2, r0, #0x124 -#endif - ldrb r3, [r2, r1, lsl #3] - add r2, r2, r1, lsl #3 - tst r3, #1 - movne r3, #1 - moveq r3, #0 - tst r3, #0xff - beq _02324E34 - ldrh r3, [r2, #2] - mov lr, #1 - tst r3, #0x10 - bicne r3, r3, #0x10 - strneh r3, [r2, #2] - ldrh r3, [r2, #2] - movne lr, #2 - tst r3, #0x40 - bicne r3, r3, #0x40 - strneh r3, [r2, #2] - ldrh r3, [r2, #2] - movne lr, #4 - tst r3, #8 - bicne r3, r3, #8 - strneh r3, [r2, #2] - cmpne r4, #0 - beq _02324E34 - mov ip, #0 - b _02324E2C -_02324E18: - ldrb r3, [r2, #6] - add ip, ip, #1 - cmp r3, #0 - subne r3, r3, #1 - strneb r3, [r2, #6] -_02324E2C: - cmp ip, lr - blt _02324E18 -_02324E34: - add r1, r1, #1 - cmp r1, #4 - blt _02324DAC - ldmia sp!, {r3, r4, r5, pc} - arm_func_end UpdateMovePp - - arm_func_start GetDamageSourceWrapper -GetDamageSourceWrapper: ; 0x02324E44 - stmdb sp!, {r4, lr} - mov r4, r0 - mov r0, r1 - bl LowerSshort - mov r1, r0 - ldrh r0, [r4, #4] - bl GetDamageSource - ldmia sp!, {r4, pc} - arm_func_end GetDamageSourceWrapper - - arm_func_start LowerSshort -LowerSshort: ; 0x02324E64 - cmp r0, #0 - moveq r0, #0 - movne r0, r0, lsl #0x10 - movne r0, r0, asr #0x10 - bx lr - arm_func_end LowerSshort - - arm_func_start ov29_02324E78 -ov29_02324E78: ; 0x02324E78 - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x14 - mov r7, r0 - mov r6, r1 - mov r8, r2 - bl ShouldMovePlayAlternativeAnimation - mov r4, r0 - mov r0, r7 - bl GetApparentWeather - mov r1, r0 - ldrh r0, [r6, #4] - mov r2, r4 - bl GetMoveAnimationId - bl ov10_022BFD58 - mov sl, r0 - mov r0, r7 - bl GetApparentWeather - mov r1, r0 - ldrh r0, [r6, #4] - mov r2, r4 - bl GetMoveAnimationId - bl GetMoveAnimation - ldrsh r5, [r0] - mov r0, r7 - bl ShouldDisplayEntityAdvanced - cmp r0, #0 - moveq r0, sl - beq _023250C8 - mov r0, r7 - mov r1, r6 - bl ov29_02325D20 - cmp r0, #0 - movne r0, sl - bne _023250C8 - cmp r8, #0 - moveq r0, sl - beq _023250C8 - cmp r5, #0 - beq _023250C4 - mov r0, r7 - bl GetApparentWeather - mov r1, r0 - ldrh r0, [r6, #4] - mov r2, r4 - bl GetMoveAnimationId - mov r4, r0 - ldrh r0, [r6, #4] - ldr r5, [r7, #0xb4] - bl ov10_022BFD8C - mov sb, r0 - mov r0, r7 - bl GetApparentWeather - mov r1, r0 - ldrh r0, [r6, #4] - mov r2, #1 - bl GetMoveAnimationId - mov r1, r0 - ldrsh r0, [r5, #4] - bl ov10_022BF01C - mov r2, r0 - mvn r0, #0 - cmp r2, r0 - ldreq r0, _023250D0 ; =ov29_02352AD8 - ldreqh r1, [r0, #8] - streqh r1, [sp, #8] - ldreqh r0, [r0, #0xa] - streqh r0, [sp, #0xa] - beq _02324F98 - add r0, sp, #8 - add r1, r7, #0x2c - and r2, r2, #0xff - bl sub_0201CF90 -_02324F98: - strh r4, [sp] - ldrsh r1, [r5, #4] - add r0, sp, #0 - mov r2, #0 - strh r1, [sp, #2] - ldr r3, [r7, #0xc] - mov r1, #1 - mov r3, r3, asr #8 - strh r3, [sp, #4] - ldr r3, [r7, #0x10] - mov r3, r3, asr #8 - strh r3, [sp, #6] - ldrb r3, [r5, #0x4c] - str r3, [sp, #0xc] - str r2, [sp, #0x10] - bl ov29_02325D7C - mov r0, #0x58 - bl AdvanceFrame - add r0, sp, #0 - bl ov10_022BFAA8 - mov r1, r7 - mov r2, #5 - mov r8, r0 - bl ov29_022E6D68 - mov r0, #1 - bl ov29_022DE5F0 - mov r7, r0 - cmp sb, #0 - bne _0232506C - ldrh r0, [r6, #4] - bl ov10_022BFDEC - cmp r0, #0 - beq _0232506C - mov r6, #0 - bl ov29_022ED0C4 - mov r5, r0 - mov r0, #1 - bl ov29_022E3560 - mov r4, #0xff - mov fp, #1 - b _02325064 -_0232503C: - add r0, r5, #0x20 - mov r0, r0, lsl #0x10 - mov r5, r0, asr #0x10 - cmp r5, #0xff - movgt r5, r4 - mov r0, r5 - movgt r6, fp - bl ov29_022ED0D4 - mov r0, #0x26 - bl AdvanceFrame -_02325064: - cmp r6, #0 - beq _0232503C -_0232506C: - mov r0, r8, lsl #0x10 - mov r4, r0, asr #0x10 - mov r8, #0 - mov r6, #1 - mov r5, #0x26 - b _023250B0 -_02325084: - beq _023250A8 - cmp r7, #0x20 - subgt r7, r7, #0x20 - movle r7, r8 - mov r0, r7, lsl #0x10 - mov r1, r6 - mov r0, r0, asr #0x10 - movle sb, r8 - bl ov29_022DE5D8 -_023250A8: - mov r0, r5 - bl AdvanceFrame -_023250B0: - mov r0, r4 - bl AnimationHasMoreFrames - cmp r0, #0 - cmpne sb, #0 - bne _02325084 -_023250C4: - mov r0, sl -_023250C8: - add sp, sp, #0x14 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_023250D0: .word ov29_02352AD8 - arm_func_end ov29_02324E78 - - arm_func_start ov29_023250D4 -ov29_023250D4: ; 0x023250D4 -#ifdef JAPAN -#define OV29_023250D4_OFFSET -0xA4 -#else -#define OV29_023250D4_OFFSET 0 -#endif - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x18 - mov sl, r0 - mov sb, r1 - bl ShouldMovePlayAlternativeAnimation - mov r8, r0 - ldr r7, [sl, #0xb4] - mov r1, #0 - mov r0, sl - str r1, [sp] - bl GetApparentWeather - mov r1, r0 - ldrh r0, [sb, #4] - mov r2, r8 - bl GetMoveAnimationId - mov r1, r0 - ldrsh r0, [r7, #4] - bl ov10_022BFA3C - mov r4, r0 - mov r0, sl - ldr r6, [sl, #0xb4] - bl GetApparentWeather - mov r1, r0 - ldrh r0, [sb, #4] - mov r2, r8 - bl GetMoveAnimationId - mov r5, r0 - bl GetMoveAnimation - ldrsh r0, [r0, #2] - cmp r0, #0 - beq _023251E0 - mov r0, sl - bl GetApparentWeather - mov r1, r0 - ldrh r0, [sb, #4] - mov r2, r8 - bl GetMoveAnimationId - mov r1, r0 - ldrsh r0, [r6, #4] - bl ov10_022BF01C - mov r2, r0 - mvn r0, #0 - cmp r2, r0 - ldreq r0, _02325608 ; =ov29_02352AD8 - ldreqh r1, [r0, #4] - streqh r1, [sp, #0xc] - ldreqh r0, [r0, #6] - streqh r0, [sp, #0xe] - beq _023251A8 - add r0, sp, #0xc - add r1, sl, #0x2c - and r2, r2, #0xff - bl sub_0201CF90 -_023251A8: - strh r5, [sp, #4] - ldrsh r1, [r6, #4] - mov r0, #0 - strh r1, [sp, #6] - ldr r1, [sl, #0xc] - mov r1, r1, asr #8 - strh r1, [sp, #8] - ldr r1, [sl, #0x10] - mov r1, r1, asr #8 - strh r1, [sp, #0xa] - ldrb r1, [r6, #0x4c] - str r1, [sp, #0x10] - str r0, [sp, #0x14] - b _023251E8 -_023251E0: - mov r0, #0 - strh r0, [sp, #4] -_023251E8: - add r0, sp, #4 - mov r1, #1 - bl ov10_022BF1FC - cmp r0, #0 - ldrne r0, _0232560C ; =DUNGEON_PTR - ldrne r0, [r0] - addne r0, r0, #0x1a000 - ldrne r5, [r0, #0x22c + OV29_023250D4_OFFSET] - bne _02325228 - ldrh r0, [sb, #4] - cmp r0, #0x52 - ldreq r0, _0232560C ; =DUNGEON_PTR - ldreq r0, [r0] - addeq r0, r0, #0x1a000 - ldreq r5, [r0, #0x22c + OV29_023250D4_OFFSET] - movne r5, sl -_02325228: - mov r0, r5 - bl EntityIsValid__02325620 - cmp r0, #0 - moveq r5, sl - ldr r1, [r5, #0xc] - mov r0, r5 - mov r1, r1, asr #8 - strh r1, [sp, #8] - ldr r1, [r5, #0x10] - mov r1, r1, asr #8 - strh r1, [sp, #0xa] - bl ShouldDisplayEntityAdvanced - cmp r0, #0 - beq _02325600 - mov r0, sl - mov r1, sb - bl ov29_02325D20 - cmp r0, #0 - bne _02325600 - ldrh r0, [sb, #4] - cmp r0, #0x128 - bne _023252E4 - mov r0, #7 - bl DungeonRandInt - ldr r1, _0232560C ; =DUNGEON_PTR - ldr r6, _02325610 ; =ov29_02352B1C - ldr r3, [r1] - ldr r2, _02325614 ; =ov29_0237CA84 - ldr r6, [r6, r0, lsl #2] - str r0, [r2] - add r0, r3, #0x1a000 - str r6, [r0, #0x234 + OV29_023250D4_OFFSET] - ldr r1, [r1] - mov r0, #0 - add r1, r1, #0x1a000 - ldr r3, [r1, #0x234 + OV29_023250D4_OFFSET] - str r3, [r1, #0x238 + OV29_023250D4_OFFSET] - ldr r1, [r2] - add r1, r1, #4 - bl ov29_0234B09C - ldr r1, _02325618 ; =0x00000EAA - mov r0, r5 - bl LogMessageByIdWithPopupCheckUser - mov r0, r5 - mov r1, #0x214 - bl ov29_022E56A0 - b _0232531C -_023252E4: - cmp r0, #0x76 - bne _0232531C - ldr r2, _0232560C ; =DUNGEON_PTR - mov r3, #0xc - ldr r1, [r2] - mov r0, r5 - add r1, r1, #0x1a000 - str r3, [r1, #0x234 + OV29_023250D4_OFFSET] - ldr r2, [r2] - mov r1, #0x214 - add r2, r2, #0x1a000 - ldr r3, [r2, #0x234 + OV29_023250D4_OFFSET] - str r3, [r2, #0x238 + OV29_023250D4_OFFSET] - bl ov29_022E56A0 -_0232531C: - mov r0, sl - bl GetApparentWeather - mov r1, r0 - ldrh r0, [sb, #4] - mov r2, r8 - bl GetMoveAnimationId - mov r1, r0 - ldrsh r0, [r7, #4] - bl ov10_022BF0F4 - cmp r0, #0x3f00 - beq _02325354 - mov r0, r0, lsl #0x10 - mov r0, r0, lsr #0x10 - bl ov29_022EACCC -_02325354: - cmp r4, #0x63 - bne _023253C8 - mov r0, r5 - bl ShouldDisplayEntityAdvanced - cmp r0, #0 - beq _02325600 - mov r3, r8 - add r0, sp, #4 - mov r1, sl - mov r2, sb - ldrb r8, [r7, #0x4c] - bl ov29_02325644 - mov r7, #0 - mov r6, r7 - mov r5, #2 - mov r4, #0x15 -_02325394: - sub r0, r8, #1 - and r8, r0, #7 - mov r0, sl - mov r1, r6 - mov r2, r8 - bl ChangeMonsterAnimation - mov r0, r5 - mov r1, r4 - bl ov29_022EA370 - add r7, r7, #1 - cmp r7, #8 - blt _02325394 - b _02325600 -_023253C8: - cmp r4, #0x62 - bne _0232543C - mov r0, r5 - bl ShouldDisplayEntityAdvanced - cmp r0, #0 - beq _02325600 - add r0, sp, #4 - mov r1, sl - mov r2, sb - mov r3, r8 - ldrb r7, [r7, #0x4c] - bl ov29_02325644 - mov r8, #0 - mov r6, r8 - mov r5, #2 - mov r4, #0x15 -_02325408: - and r7, r7, #7 - mov r0, sl - mov r1, r6 - mov r2, r7 - bl ChangeMonsterAnimation - mov r0, r5 - mov r1, r4 - bl ov29_022EA370 - add r8, r8, #1 - cmp r8, #8 - add r7, r7, #1 - ble _02325408 - b _02325600 -_0232543C: - ldrb r0, [r7, #0xd8] - mov fp, #0 - cmp r0, #2 - moveq fp, #1 - beq _02325470 - ldr r0, _0232560C ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, #0x1a000 - ldr r1, [r0, #0x22c + OV29_023250D4_OFFSET] - cmp r1, sl - ldrneb r0, [r0, #0x245 + OV29_023250D4_OFFSET] - cmpne r0, #0 - movne fp, #1 -_02325470: - ldrb r0, [sl, #0x28] - cmp r0, #0 - bne _02325524 - mov r5, #0 -_02325480: - ldr r0, _0232560C ; =DUNGEON_PTR - ldr r0, [r0] - add r0, r0, r5, lsl #2 - add r0, r0, #0x12000 - ldr r6, [r0, #0xb78 + OV29_023250D4_OFFSET] - mov r0, r6 - bl EntityIsValid__02325620 - cmp r0, #0 - cmpne r6, sl - ldrneb r0, [r6, #0x28] - cmpne r0, #0 - beq _023254C8 - ldr r1, [r6, #0xb4] - mov r0, r6 - ldrb r1, [r1, #0x4c] - bl ov29_02304A48 - mov r0, #0 - strb r0, [r6, #0x28] -_023254C8: - add r5, r5, #1 - cmp r5, #0x14 - blt _02325480 - mov r0, #0x59 - bl AdvanceFrame - cmp fp, #0 - beq _02325500 - ldr r0, _0232561C ; =0x00000229 - bl GetSpriteIndex__02052708 - mov r1, r0 - mov r0, #1 - bl SetAndLoadCurrentAttackAnimation - mov r5, r0 - b _02325530 -_02325500: - ldrsh r0, [r7, #4] - bl GetSpriteIndex__02052708 - mov r1, r0 - mov r0, #1 - bl SetAndLoadCurrentAttackAnimation - mov r1, #0xff - mov r5, r0 - strb r1, [sl, #0xaf] - b _02325530 -_02325524: - mov r0, #0x59 - bl AdvanceFrame - ldrsh r5, [sl, #0xa8] -_02325530: - ldrb r2, [r7, #0x4c] - mov r0, sl - mov r1, r4 - bl ChangeMonsterAnimation - ldrb r1, [sl, #0xae] - mov r0, r5 - bl WanTableSpriteHasAnimationGroup - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - strb r0, [sl, #0x28] - mov r7, #0 - strb r7, [sl, #0x21] - mov r5, #0x59 - add fp, sp, #4 - b _023255D8 -_02325570: - mov r0, r5 - bl AdvanceFrame - add r0, sl, #0x2c - bl sub_0201D1D4 - cmp r4, #0 - cmpne r4, #7 - mov r6, r0 - cmpne r4, #9 - orreq r6, r6, #2 - tst r6, #2 - beq _023255C4 - ldr r0, [sp] - cmp r0, #0 - bne _023255C4 - mov r0, fp - mov r1, sl - mov r2, sb - mov r3, r8 - bl ov29_02325644 - mov r0, #1 - str r0, [sp] -_023255C4: - tst r6, #1 - ldreqb r0, [sl, #0x21] - cmpeq r0, #0 - bne _023255E0 - add r7, r7, #1 -_023255D8: - cmp r7, #0x78 - blt _02325570 -_023255E0: - mov r0, #0 - strb r0, [sl, #0x21] - ldrh r0, [sb, #4] - bl ov10_022BFDCC - cmp r0, #0 - beq _02325600 - mov r0, #1 - bl AnimationDelayOrSomething -_02325600: - add sp, sp, #0x18 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_02325608: .word ov29_02352AD8 -_0232560C: .word DUNGEON_PTR -_02325610: .word ov29_02352B1C -_02325614: .word ov29_0237CA84 -#ifdef JAPAN -_02325618: .word 0x00000BEC -#else -_02325618: .word 0x00000EAA -#endif -_0232561C: .word 0x00000229 - arm_func_end ov29_023250D4 diff --git a/asm/overlay_29_02322DDC.s b/asm/overlay_29_02322DDC.s new file mode 100644 index 00000000..089bd951 --- /dev/null +++ b/asm/overlay_29_02322DDC.s @@ -0,0 +1,2991 @@ + .include "asm/macros.inc" + .include "overlay_29_02322DDC.inc" + + .text + + arm_func_start ov29_02322DDC +ov29_02322DDC: ; 0x02322DDC + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + mov r4, #0 + mov r8, r2 + mov r5, r4 + mov sl, r0 + mov sb, r1 + mov fp, r3 + ldr r7, [sp, #0x28] + bl ShouldDisplayEntityWrapper + cmp r0, #0 + movne r5, #1 + cmp r8, #0 + beq _02322ED0 + mov r6, #0 + b _02322E38 +_02322E18: + ldr r0, [fp, r6, lsl #2] + cmp r0, #0 + beq _02322E40 + bl ShouldDisplayEntityWrapper + cmp r0, #0 + movne r5, #1 + bne _02322E40 + add r6, r6, #1 +_02322E38: + cmp r6, #0x41 + blt _02322E18 +_02322E40: + cmp r5, #0 + beq _02322E94 + bl ov29_0234B034 + mov r1, #0 + str r1, [sp] + ldr r2, [sl, #0xb4] + mov r3, r1 + bl ov29_0230040C + cmp r7, #0 + bne _02322E80 + bl ov29_0234B034 + mov r1, #0 + mov r2, sb + mov r3, r1 + bl FormatMoveStringMore + b _02322EAC +_02322E80: + mov r0, r7, lsl #0x10 + mov r1, r0, asr #0x10 + mov r0, #0 + bl ov29_0234B084 + b _02322EAC +_02322E94: + cmp r7, #0 + beq _02322EAC + mov r0, r7, lsl #0x10 + mov r1, r0, asr #0x10 + mov r0, #0 + bl ov29_0234B084 +_02322EAC: + ldrh r1, [sb, #4] + ldr r0, _02322F74 ; =0x00000163 + cmp r1, r0 + mov r0, sl + mov r1, r8 + beq _02322ECC + bl LogMessageWithPopup + b _02322ED0 +_02322ECC: + bl LogMessageQuiet +_02322ED0: + cmp r5, #0 + beq _02322F5C + ldrb r0, [sp, #0x2c] + mov r1, sb + cmp r0, #0 + mov r0, sl + beq _02322EF8 + mov r2, #1 + bl ov29_02324E78 + b _02322F00 +_02322EF8: + mov r2, #0 + bl ov29_02324E78 +_02322F00: + mov r4, r0 + ldrh r0, [sb, #4] + cmp r0, #0xfe + bne _02322F24 + mov r0, sl + bl EntityIsValid__02321438 + cmp r0, #0 + movne r0, #0xff + strneb r0, [sl, #0xaf] +_02322F24: + ldrh r0, [sb, #4] + bl ov10_022BFDAC + cmp r0, #0 + beq _02322F4C + ldr r1, [sl, #0xb4] + mov r0, sl + ldrb r1, [r1, #0x4c] + bl ov29_02304A48 + mov r0, #1 + bl AnimationDelayOrSomething +_02322F4C: + mov r0, sl + mov r1, sb + bl ov29_023250D4 + b _02322F6C +_02322F5C: + ldr r1, [sl, #0xb4] + mov r0, sl + ldrb r1, [r1, #0x4c] + bl ov29_02304A48 +_02322F6C: + mov r0, r4 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_02322F74: .word 0x00000163 + arm_func_end ov29_02322DDC + + arm_func_start ov29_02322F78 +ov29_02322F78: ; 0x02322F78 + stmdb sp!, {r4, r5, r6, r7, r8, lr} + sub sp, sp, #0x18 + ldr r4, _023230F4 ; =DUNGEON_PTR + mov r7, r0 + ldr r0, [r4] + mov r6, r1 + add r0, r0, #0x1a000 +#ifdef JAPAN + ldrb r0, [r0, #0x19a] +#else + ldrb r0, [r0, #0x23e] +#endif + mov r5, r2 + mov r8, r3 + cmp r0, #0 + ldr r4, [r7, #0xb4] + mvnne r0, #0 + bne _023230EC + ldrsh r0, [r4, #4] + bl GetBodySize + cmp r0, #4 + blo _02322FC8 + cmp r8, #1 + beq _023230E8 +_02322FC8: + mov r0, r7 + bl GetApparentWeather + mov r1, r0 + ldrh r0, [r5, #4] + mov r2, #1 + bl GetMoveAnimationId + bl GetMoveAnimation + ldrsh r0, [r0, #6] + ldrsh r3, [r6, #2] + mov r1, #0x18 + ldrsh r2, [r6] + smulbb r3, r3, r1 + smulbb r2, r2, r1 + add r3, r3, #0x10 + add r2, r2, #0xc + mov r6, r3, lsl #8 + mov r2, r2, lsl #8 + mov r3, r2, asr #8 + mov r2, r6, asr #8 + strh r3, [sp] + strh r2, [sp, #2] + cmp r0, #0 + beq _023230E0 + mov r0, #0x5e + bl AdvanceFrame + mov r0, r7 + bl GetApparentWeather + mov r1, r0 + ldrh r0, [r5, #4] + mov r2, #1 + bl GetMoveAnimationId + mov r1, r0 + ldrsh r0, [r4, #4] + bl ov10_022BF01C + mov r2, r0 + mvn r0, #0 + cmp r2, r0 + ldreq r0, _023230F8 ; =ov29_02352A54 + ldreqh r1, [r0] + streqh r1, [sp, #0xc] + ldreqh r0, [r0, #2] + streqh r0, [sp, #0xe] + beq _02323084 + add r0, sp, #0xc + add r1, r7, #0x2c + and r2, r2, #0xff + bl sub_0201CF90 +_02323084: + mov r0, r7 + bl GetApparentWeather + mov r1, r0 + ldrh r0, [r5, #4] + mov r2, #1 + bl GetMoveAnimationId + strh r0, [sp, #4] + ldrsh r2, [r4, #4] + add r0, sp, #4 + add r1, sp, #0 + strh r2, [sp, #6] + ldr r3, [r7, #0xc] + mov r2, #0 + mov r3, r3, asr #8 + strh r3, [sp, #8] + ldr r3, [r7, #0x10] + mov r3, r3, asr #8 + strh r3, [sp, #0xa] + ldrb r3, [r4, #0x4c] + str r3, [sp, #0x10] + str r2, [sp, #0x14] + bl ov10_022BE9E8 + b _023230EC +_023230E0: + sub r0, r1, #0x19 + b _023230EC +_023230E8: + mvn r0, #0 +_023230EC: + add sp, sp, #0x18 + ldmia sp!, {r4, r5, r6, r7, r8, pc} + .align 2, 0 +_023230F4: .word DUNGEON_PTR +_023230F8: .word ov29_02352A54 + arm_func_end ov29_02322F78 + + arm_func_start ov29_023230FC +ov29_023230FC: ; 0x023230FC + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0xc0 + ldr r4, _023238F4 ; =ov29_02352A54 + mov r8, r0 + mov r0, #0 + str r0, [sp, #0x88] + ldr r0, [r4, #4] + mov r7, r1 + ldr r1, [r4, #8] + str r0, [sp, #0xb0] + str r1, [sp, #0xb4] + ldr r1, [sp, #0x88] + ldrh r0, [r7, #4] + mov r6, r2 + mov fp, r3 + str r1, [sp, #0x84] + mov r5, r1 + ldr sb, [r8, #0xb4] + bl GetMoveAnimationSpeed + cmp r0, #1 + moveq sl, #2 + beq _02323160 + cmp r0, #2 + moveq sl, #3 + movne sl, #6 +_02323160: + ldrsh r2, [r8, #4] + ldr r0, _023238F8 ; =DIRECTIONS_XY + ldr r1, _023238FC ; =ov29_0235171E + strh r2, [sp, #0xbc] + ldrsh r2, [r8, #6] + mov r4, #0 + strh r2, [sp, #0xbe] + ldrb r2, [sb, #0x4c] + mov r2, r2, lsl #2 + ldrsh r0, [r0, r2] + str r0, [sp, #0x6c] + ldrsh r0, [r1, r2] + str r0, [sp, #0x68] + b _02323214 +_02323198: + ldrsh r2, [sp, #0xbc] + cmp r2, #0 + ldrgesh r1, [sp, #0xbe] + cmpge r1, #0 + blt _0232321C + cmp r2, #0x38 + cmplt r1, #0x20 + bge _0232321C + ldr r0, [sp, #0x6c] + add r0, r2, r0 + strh r0, [sp, #0xbc] + ldr r0, [sp, #0x68] + add r0, r1, r0 + strh r0, [sp, #0xbe] + ldr r0, [sp, #0x84] + ldrsh r1, [sp, #0xbe] + add r0, r0, #1 + str r0, [sp, #0x84] + ldrsh r0, [sp, #0xbc] + bl GetTile + ldrh r1, [r0] + tst r1, #3 + beq _0232321C + ldr r1, [r0, #0xc] + cmp r1, #0 + beq _02323210 + ldr r0, [r1] + cmp r0, #1 + moveq r5, r1 + beq _0232321C +_02323210: + add r4, r4, #1 +_02323214: + cmp r4, r6 + blt _02323198 +_0232321C: + mov r0, r8 + ldrh r1, [r7, #4] + bl ov29_02324D60 + cmp r0, #0 + beq _02323250 + mov r0, r8 + mov r1, r7 + bl IsChargingTwoTurnMove + cmp r0, #0 + mvneq r0, #0 + streq r0, [sp, #0xb0] + streq r0, [sp, #0xb4] + beq _023232E4 +_02323250: + mov r0, r8 + add r1, sp, #0xbc + mov r2, r7 + mov r3, r6 + bl ov29_02322F78 + str r0, [sp, #0xb0] + ldrb r0, [sp, #0xf0] + cmp r0, #0 + beq _023232E4 + cmp r5, #0 + mvneq r0, #0 + streq r0, [sp, #0xb4] + beq _023232E4 + ldrsh r2, [r8, #4] + mov r0, r5 + add r1, sp, #0xb8 + strh r2, [sp, #0xb8] + ldrsh r4, [r8, #6] + mov r2, r7 + mov r3, r6 + strh r4, [sp, #0xba] + bl ov29_02322F78 + ldrsh r2, [r5, #4] + str r0, [sp, #0xb4] + ldr r0, _023238F8 ; =DIRECTIONS_XY + strh r2, [sp, #0xb8] + ldrsh r2, [r5, #6] + ldr r1, _023238FC ; =ov29_0235171E + strh r2, [sp, #0xba] + ldrb r2, [sb, #0x4c] + add r2, r2, #4 + mov r2, r2, lsl #0x1d + mov r2, r2, lsr #0x1b + ldrsh r0, [r0, r2] + str r0, [sp, #0x64] + ldrsh r0, [r1, r2] + str r0, [sp, #0x60] +_023232E4: + ldrsh r0, [r8, #4] + ldr r5, _02323900 ; =ov29_0235175C + ldr r3, _023238F8 ; =DIRECTIONS_XY + strh r0, [sp, #0xbc] + ldrsh r1, [r8, #6] + ldr r2, _023238FC ; =ov29_0235171E + mov r0, #0x18 + strh r1, [sp, #0xbe] + ldrb r1, [sb, #0x4c] + str r1, [sp, #0x1c] + ldr r4, [sp, #0x1c] + mov r1, sl + ldr r4, [r5, r4, lsl #2] + str r4, [sp, #0x7c] + ldr r4, [sp, #0x1c] + mov r4, r4, lsl #2 + ldrsh r3, [r3, r4] + ldrsh r2, [r2, r4] + str r3, [sp, #0x10] + str r2, [sp, #0xc] + bl _s32_div_f + ldr r2, [sp, #0x84] + str r0, [sp, #0x18] + mul r1, r2, r0 + cmp r6, #2 + blt _0232335C + add r4, r1, #8 + cmp r4, #0x40 + movge r4, #0x40 + b _02323360 +_0232335C: + mov r4, #0x20 +_02323360: + mov r0, #0x80000 + mov sb, #0 + bl _s32_div_f + str r0, [sp, #0x80] + mov r0, #1 + bl ov29_0234B4CC + mov r1, sb + str r1, [sp, #0x14] + ldr r1, [sp, #0x10] + mov r0, sl, lsl #8 + mul r2, r1, r0 + ldr r1, [sp, #0xc] + str r2, [sp, #0x2c] + mul r2, r1, r0 + ldr r1, [sp, #0x64] + str r2, [sp, #0x28] + mul r2, r1, r0 + ldr r1, [sp, #0x60] + str r2, [sp, #0x48] + mul r0, r1, r0 + str r0, [sp, #0x44] + ldr r0, [sp, #0x7c] + ldr r1, _02323904 ; =0x00000FFF + add r3, r0, #0xc00 + add r2, r0, #0x1400 + mov r0, r4, asr #1 + str r0, [sp, #0x3c] + and r0, r3, r1 + str r0, [sp, #0x40] + and r0, r2, r1 + str r0, [sp, #0x30] + rsb r0, r4, #0 + str r0, [sp, #0x34] + ldr r1, _02323908 ; =ov29_02352A6C + ldr r0, [sp, #0x1c] + ldr r5, [sp, #0xb4] + ldr r0, [r1, r0, lsl #2] + str r0, [sp, #0x38] + b _02323824 +_023233FC: + ldrsh r1, [sp, #0xbc] + cmp r1, #0 + ldrgesh r2, [sp, #0xbe] + cmpge r2, #0 + blt _02323830 + cmp r1, #0x38 + cmplt r2, #0x20 + bge _02323830 + ldr r0, [sp, #0x10] + ldrh r3, [sp, #0xbc] + add r1, r1, r0 + ldr r0, [sp, #0xc] + cmp r5, #0 + add r0, r2, r0 + ldrh r2, [sp, #0xbe] + strh r3, [sp, #0xa0] + strh r1, [sp, #0xbc] + strh r2, [sp, #0xa2] + strh r0, [sp, #0xbe] + blt _0232347C + ldrh r0, [sp, #0xba] + ldrh r2, [sp, #0xb8] + ldrsh r1, [sp, #0xb8] + strh r0, [sp, #0xa6] + ldr r0, [sp, #0x64] + strh r2, [sp, #0xa4] + add r0, r1, r0 + strh r0, [sp, #0xb8] + ldrsh r1, [sp, #0xba] + ldr r0, [sp, #0x60] + add r0, r1, r0 + strh r0, [sp, #0xba] +_0232347C: + add r0, sp, #0xbc + bl ov29_022E2CA0 + cmp r0, #0 + beq _02323740 + ldr r0, _0232390C ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, #0x1a000 +#ifdef JAPAN + ldrb r0, [r0, #0x19a] +#else + ldrb r0, [r0, #0x23e] +#endif + cmp r0, #0 + bne _02323740 + ldrsh r0, [sp, #0xa0] + mov r1, #0x18 + ldrsh r2, [sp, #0xa2] + smulbb r0, r0, r1 + add r0, r0, #0xc + mov r0, r0, lsl #8 + str r0, [sp, #0x5c] + smulbb r0, r2, r1 + add r0, r0, #0x10 + cmp r5, #0 + mov sl, r0, lsl #8 + blt _0232350C + ldrsh r3, [sp, #0xa4] + ldr r0, [sp, #0x48] + ldrsh r2, [sp, #0xa6] + str r0, [sp, #0x24] + smulbb r0, r3, r1 + add r0, r0, #0xc + mov r0, r0, lsl #8 + smulbb r1, r2, r1 + str r0, [sp, #0x58] + add r0, r1, #0x10 + mov r0, r0, lsl #8 + str r0, [sp, #0x54] + ldr r0, [sp, #0x44] + str r0, [sp, #0x20] +_0232350C: + mov r0, #0 + str r0, [sp, #0x78] + ldr r0, [sp, #0xb0] + str r0, [sp, #0x8c] + mov r0, r0, lsl #0x10 + mov r0, r0, asr #0x10 + str r0, [sp, #0x90] + mov r0, r5, lsl #0x10 + mov r0, r0, asr #0x10 + str r0, [sp, #0x94] + b _0232372C +_02323538: + ldr r0, [sp, #0x8c] + cmp r0, #0 + blt _02323600 + cmp fp, #1 + bne _02323564 + mov r0, sb, asr #8 + bl sub_020018D0 + mul r0, r4, r0 + str r0, [sp, #0x50] + mov r2, #0 + b _023235B4 +_02323564: + cmp fp, #2 + movne r0, #0 + strne r0, [sp, #0x50] + movne r2, r0 + bne _023235B4 + mov r0, sb, asr #8 + bl sub_020018D0 + ldr r1, [sp, #0x3c] + mul r0, r1, r0 + mov r0, r0, asr #8 + str r0, [sp, #0x74] + ldr r0, [sp, #0x40] + bl sub_020018D0 + ldr r1, [sp, #0x74] + mul r0, r1, r0 + str r0, [sp, #0x50] + ldr r0, [sp, #0x40] + bl sub_02001980 + ldr r1, [sp, #0x74] + mul r2, r1, r0 +_023235B4: + ldr r0, [sp, #0x5c] + add r1, sp, #0x9c + add r0, r0, r2 + mov r0, r0, asr #8 + strh r0, [sp, #0x9c] + ldr r0, [sp, #0x50] + ldr r2, _0232390C ; =DUNGEON_PTR + sub r0, sl, r0 + mov r0, r0, asr #8 + ldr r3, [r2] + strh r0, [sp, #0x9e] + ldr r2, _02323910 ; =0x0001A226 + ldr r0, [sp, #0x90] + ldrsh r2, [r3, r2] + rsb r2, r2, sl, asr #8 + add r3, r2, r2, lsr #31 + ldr r2, [sp, #0x38] + add r2, r2, r3, asr #1 + bl ov10_022BEB2C +_02323600: + cmp r5, #0 + blt _023236D0 + cmp fp, #1 + bne _0232362C + mov r0, sb, asr #8 + bl sub_020018D0 + ldr r1, [sp, #0x34] + mov r2, #0 + mul r0, r1, r0 + str r0, [sp, #0x4c] + b _0232367C +_0232362C: + cmp fp, #2 + movne r2, #0 + movne r0, r2 + strne r0, [sp, #0x4c] + bne _0232367C + mov r0, sb, asr #8 + bl sub_020018D0 + ldr r1, [sp, #0x3c] + mul r0, r1, r0 + mov r0, r0, asr #8 + str r0, [sp, #0x70] + ldr r0, [sp, #0x30] + bl sub_020018D0 + ldr r1, [sp, #0x70] + mul r0, r1, r0 + str r0, [sp, #0x4c] + ldr r0, [sp, #0x30] + bl sub_02001980 + ldr r1, [sp, #0x70] + mul r2, r1, r0 +_0232367C: + ldr r0, [sp, #0x58] + ldr r1, [sp, #0x54] + add r0, r0, r2 + mov r0, r0, asr #8 + strh r0, [sp, #0x98] + ldr r0, [sp, #0x4c] + ldr r2, _0232390C ; =DUNGEON_PTR + sub r0, r1, r0 + mov r0, r0, asr #8 + ldr r3, [r2] + strh r0, [sp, #0x9a] + ldr r2, _02323910 ; =0x0001A226 + ldr r0, [sp, #0x94] + ldrsh r3, [r3, r2] + ldr r2, [sp, #0x54] + add r1, sp, #0x98 + rsb r2, r3, r2, asr #8 + add r3, r2, r2, lsr #31 + ldr r2, [sp, #0x38] + add r2, r2, r3, asr #1 + bl ov10_022BEB2C +_023236D0: + mov r0, #0x30 + bl AdvanceFrame + ldr r1, [sp, #0x5c] + ldr r0, [sp, #0x2c] + cmp r5, #0 + add r0, r1, r0 + str r0, [sp, #0x5c] + ldr r0, [sp, #0x28] + add sl, sl, r0 + blt _02323718 + ldr r1, [sp, #0x58] + ldr r0, [sp, #0x24] + add r0, r1, r0 + str r0, [sp, #0x58] + ldr r1, [sp, #0x54] + ldr r0, [sp, #0x20] + add r0, r1, r0 + str r0, [sp, #0x54] +_02323718: + ldr r0, [sp, #0x80] + add sb, sb, r0 + ldr r0, [sp, #0x78] + add r0, r0, #1 + str r0, [sp, #0x78] +_0232372C: + ldr r1, [sp, #0x78] + ldr r0, [sp, #0x18] + cmp r1, r0 + blt _02323538 + b _0232374C +_02323740: + ldr r1, [sp, #0x80] + ldr r0, [sp, #0x18] + mla sb, r1, r0, sb +_0232374C: + ldrsh r0, [sp, #0xbc] + ldrsh r1, [sp, #0xbe] + bl GetTile + mov sl, r0 + ldrh r0, [sl] + tst r0, #3 + beq _02323830 + ldr r0, [sl, #0xc] + cmp r0, #0 + beq _02323818 + ldr r0, [r0] + cmp r0, #1 + bne _02323818 + mov r0, r8 + mov r1, #0x2e + bl IqSkillIsEnabled + cmp r0, #0 + bne _023237A8 + mov r0, r8 + mov r1, #0x60 + bl ExclusiveItemEffectIsActive__02323918 + cmp r0, #0 + beq _023237BC +_023237A8: + mov r0, r8 + ldr r1, [sl, #0xc] + bl ov29_022FAFD4 + cmp r0, #0 + bne _02323818 +_023237BC: + ldr r0, [sl, #0xc] + mov r1, r7 + bl TwoTurnMoveForcedMiss + cmp r0, #0 + bne _02323818 + mov r0, r8 + mov r1, #1 + bl ov29_023024E0 + mov r4, r0 + mov r0, r8 + mov r1, r7 + mov r2, #0 + bl GetEntityMoveTargetAndRange + ldr r1, [sl, #0xc] + mov r2, r0 + stmia sp, {r1, r7} + add r1, sp, #0xa8 + mov r0, #0 + mov r3, r8 + str r4, [sp, #8] + bl ov29_023243B4 + str r0, [sp, #0x88] + b _02323830 +_02323818: + ldr r0, [sp, #0x14] + add r0, r0, #1 + str r0, [sp, #0x14] +_02323824: + ldr r0, [sp, #0x14] + cmp r0, r6 + blt _023233FC +_02323830: + ldr r0, [sp, #0xb0] + cmp r0, #0 + blt _02323848 + mov r0, r0, lsl #0x10 + mov r0, r0, asr #0x10 + bl ov10_022BDE50 +_02323848: + cmp r5, #0 + blt _0232385C + mov r0, r5, lsl #0x10 + mov r0, r0, asr #0x10 + bl ov10_022BDE50 +_0232385C: + mov r0, #0 + bl ov29_0234B4CC + ldrh r1, [r7, #4] + ldr r0, _02323914 ; =0x000001E5 + cmp r1, r0 + bne _0232387C + mov r0, #1 + bl AnimationDelayOrSomething +_0232387C: + ldr r0, [sp, #0x88] + cmp r0, #0 + ble _023238B4 + ldr r1, [sp, #0x88] + add r0, sp, #0xa8 + mov r2, #0 + str r2, [r0, r1, lsl #2] + ldr r4, [sp, #0xec] + ldr r3, [sp, #0xe8] + mov r1, r8 + mov r2, r7 + str r4, [sp] + bl ExecuteMoveEffect + b _023238EC +_023238B4: + cmp r6, #1 + bne _023238EC + add r0, sp, #0xbc + bl ov29_022E2CA0 + cmp r0, #0 + beq _023238EC + mov r0, #1 + mov r1, #0x4a + bl ov29_022EA370 + add r3, sp, #0xbc + mov r0, r8 + mov r2, r7 + mov r1, #0 + bl PlayMoveAnimation +_023238EC: + add sp, sp, #0xc0 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_023238F4: .word ov29_02352A54 +_023238F8: .word DIRECTIONS_XY +_023238FC: .word ov29_0235171E +_02323900: .word ov29_0235175C +_02323904: .word 0x00000FFF +_02323908: .word ov29_02352A6C +_0232390C: .word DUNGEON_PTR +#ifdef JAPAN +_02323910: .word 0x0001A182 +#else +_02323910: .word 0x0001A226 +#endif +_02323914: .word 0x000001E5 + arm_func_end ov29_023230FC + + arm_func_start ExclusiveItemEffectIsActive__02323918 +ExclusiveItemEffectIsActive__02323918: ; 0x02323918 + stmdb sp!, {r3, lr} + ldr r2, [r0, #0xb4] + ldrb r0, [r2, #6] + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, pc} +#ifdef JAPAN + add r0, r2, #0x224 +#else + add r0, r2, #0x228 +#endif + bl ExclusiveItemEffectFlagTest + ldmia sp!, {r3, pc} + arm_func_end ExclusiveItemEffectIsActive__02323918 + + arm_func_start ov29_0232393C +ov29_0232393C: ; 0x0232393C + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x38 + ldr r0, [r0, #0xb4] + mov sb, r2 + str r0, [sp, #0x18] + mov sl, r1 + ldrh r0, [sb, #4] + ldr r1, [sp, #0x60] + str r3, [sp] + str r1, [sp, #0x60] + ldr r7, [sl, #0xb4] + bl GetMoveAnimationSpeed + cmp r0, #1 + moveq r6, #2 + beq _02323984 + cmp r0, #2 + moveq r6, #3 + movne r6, #6 +_02323984: + ldr r0, [sp, #0x18] + ldr r4, _02323C30 ; =DIRECTIONS_XY + ldrb r1, [r0, #0x4c] + ldrsh r0, [sl, #4] + ldr r5, _02323C34 ; =ov29_0235171E + add r1, r1, #4 + strh r0, [sp, #0x34] + and r0, r1, #7 + mov r8, r0, lsl #2 + ldrsh r4, [r4, r8] + ldrsh r3, [sl, #6] + add r1, sp, #0x34 + str r4, [sp, #0x24] + ldrsh r4, [r5, r8] + strh r3, [sp, #0x36] + ldr r3, [sp] + mov r0, sl + mov r2, sb + str r4, [sp, #0x20] + bl ov29_02322F78 + mov r4, r0 + mov r1, r6 + mov r0, #0x18 + bl _s32_div_f + str r0, [sp, #4] + ldr r0, [sp] + cmp r0, #2 + mov r2, r0 + ldr r0, [sp, #4] + mul r1, r2, r0 + blt _02323A18 + add r0, r1, #8 + str r0, [sp, #0x14] + cmp r0, #0x40 + movge r0, #0x40 + strge r0, [sp, #0x14] + b _02323A20 +_02323A18: + mov r0, #0x20 + str r0, [sp, #0x14] +_02323A20: + mov r0, #0x80000 + mov r5, #0 + bl _s32_div_f + str r0, [sp, #0x1c] + ldrb r2, [r7, #0x4c] + ldr r1, _02323C38 ; =ov29_02352A8C + mov r0, #1 + ldr r1, [r1, r2, lsl #2] + str r1, [sp, #0x10] + bl ov29_0234B4CC + ldr r0, [sp, #0x24] + mov r2, r6, lsl #8 + mul r1, r0, r2 + ldr r0, [sp, #0x20] + str r1, [sp, #0xc] + mul r1, r0, r2 + mov fp, r5 + str r1, [sp, #8] + b _02323BC0 +_02323A6C: + ldrsh r2, [sp, #0x34] + cmp r2, #0 + ldrgesh r1, [sp, #0x36] + cmpge r1, #0 + blt _02323BCC + cmp r2, #0x38 + cmplt r1, #0x20 + bge _02323BCC + ldr r0, [sp, #0x24] + ldrh r6, [sp, #0x34] + add r2, r2, r0 + ldr r0, [sp, #0x20] + ldrh r3, [sp, #0x36] + add r1, r1, r0 + add r0, sp, #0x34 + strh r6, [sp, #0x30] + strh r3, [sp, #0x32] + strh r2, [sp, #0x34] + strh r1, [sp, #0x36] + bl ov29_022E2CA0 + cmp r0, #0 + beq _02323BB0 + ldr r0, _02323C3C ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, #0x1a000 +#ifdef JAPAN + ldrb r0, [r0, #0x19a] +#else + ldrb r0, [r0, #0x23e] +#endif + cmp r0, #0 + bne _02323BB0 + ldrsh r2, [sp, #0x30] + ldrsh r1, [sp, #0x32] + mov r0, #0x18 + smulbb r2, r2, r0 + smulbb r0, r1, r0 + add r0, r0, #0x10 + mov r8, r0, lsl #8 + mov r0, r4, lsl #0x10 + add r1, r2, #0xc + mov r0, r0, asr #0x10 + mov r7, r1, lsl #8 + mov r6, #0 + str r0, [sp, #0x28] + b _02323BA0 +_02323B14: + cmp r4, #0 + blt _02323B7C + ldr r0, [sp, #0x60] + cmp r0, #1 + movne r0, #0 + bne _02323B3C + mov r0, r5, asr #8 + bl sub_020018D0 + ldr r1, [sp, #0x14] + mul r0, r1, r0 +_02323B3C: + sub r0, r8, r0 + ldr r2, _02323C3C ; =DUNGEON_PTR + mov r0, r0, asr #8 + strh r0, [sp, #0x2e] + mov r0, r7, asr #8 + ldr r3, [r2] + strh r0, [sp, #0x2c] + ldr r2, _02323C40 ; =0x0001A226 + ldr r0, [sp, #0x28] + ldrsh r2, [r3, r2] + add r1, sp, #0x2c + rsb r2, r2, r8, asr #8 + add r3, r2, r2, lsr #31 + ldr r2, [sp, #0x10] + add r2, r2, r3, asr #1 + bl ov10_022BEB2C +_02323B7C: + mov r0, #0x30 + bl AdvanceFrame + ldr r0, [sp, #0xc] + add r6, r6, #1 + add r7, r7, r0 + ldr r0, [sp, #8] + add r8, r8, r0 + ldr r0, [sp, #0x1c] + add r5, r5, r0 +_02323BA0: + ldr r0, [sp, #4] + cmp r6, r0 + blt _02323B14 + b _02323BBC +_02323BB0: + ldr r1, [sp, #0x1c] + ldr r0, [sp, #4] + mla r5, r1, r0, r5 +_02323BBC: + add fp, fp, #1 +_02323BC0: + ldr r0, [sp] + cmp fp, r0 + blt _02323A6C +_02323BCC: + cmp r4, #0 + blt _02323BE0 + mov r0, r4, lsl #0x10 + mov r0, r0, asr #0x10 + bl ov10_022BDE50 +_02323BE0: + mov r0, #1 + bl AnimationDelayOrSomething + mov r0, #0 + bl ov29_0234B4CC + mov r0, #1 + mov r1, #0x4a + bl ov29_022EA370 + ldrh r1, [sb, #4] + ldr r0, _02323C44 ; =0x00000232 + add r3, sp, #0x34 + cmp r1, r0 + ldreq r0, [sp, #0x18] + moveq r1, #0 +#ifdef JAPAN + streqb r1, [r0, #0x16c] +#else + streqb r1, [r0, #0x170] +#endif + mov r0, sl + mov r2, sb + mov r1, #0 + bl PlayMoveAnimation + add sp, sp, #0x38 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_02323C30: .word DIRECTIONS_XY +_02323C34: .word ov29_0235171E +_02323C38: .word ov29_02352A8C +_02323C3C: .word DUNGEON_PTR +#ifdef JAPAN +_02323C40: .word 0x0001A182 +#else +_02323C40: .word 0x0001A226 +#endif +_02323C44: .word 0x00000232 + arm_func_end ov29_0232393C + + arm_func_start MoveHitCheck +MoveHitCheck: ; 0x02323C48 + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0xc + mov fp, r2 + mov r7, r0 + mov r6, r1 + mov r0, fp + mov r1, r3 + bl GetMoveAccuracyOrAiChance + mov r8, r0 + mov r0, #0x64 + bl DungeonRandInt + mov r1, #0 + str r1, [sp, #4] + ldr sb, [r7, #0xb4] + str r0, [sp, #8] + ldrsh r0, [sb, #2] + mov r1, r1 + str r1, [sp] + ldr r5, [r6, #0xb4] + bl GetMonsterGenderVeneer + cmp r0, #2 + moveq r0, #1 + streq r0, [sp, #4] + ldrsh r0, [r5, #2] + bl GetMonsterGenderVeneer + cmp r0, #2 + moveq r0, #1 + streq r0, [sp] + ldrb r0, [sp, #0x30] + mov sl, #0 + mov r4, sl + cmp r0, #0 + beq _02323CD8 + cmp r7, r6 + moveq r0, #1 + beq _02324008 +_02323CD8: + ldrh r1, [fp, #4] + ldr r0, _02324010 ; =0x00000163 + cmp r1, r0 + bne _02323D00 + mov r0, r7 + mov r1, #4 + bl IqSkillIsEnabled + cmp r0, #0 + movne r0, #1 + bne _02324008 +_02323D00: + ldrb r0, [sb, #0xec] + cmp r0, #1 + moveq r0, #1 + beq _02324008 + cmp r0, #2 + moveq r0, #0 + beq _02324008 + cmp r8, #0x64 + movgt r0, #1 + bgt _02324008 + mov r0, r6 + mov r1, #0x6f + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #0 + bne _02323D4C + mov r0, r6 + mov r1, #0x2a + bl HasHeldItem +_02323D4C: + cmp r0, #0 + ldrne r0, _02324014 ; =DETECT_BAND_MOVE_ACCURACY_DROP + mov r1, #5 + ldrne r0, [r0] + subne r8, r8, r0 + mov r0, r6 + bl IqSkillIsEnabled + cmp r0, #0 + ldrne r0, _02324018 ; =QUICK_DODGER_MOVE_ACCURACY_DROP + mov r1, #0x33 + ldrne r0, [r0] + ldrsh sb, [sb, #0x2c] + subne r8, r8, r0 + mov r0, r7 + bl AbilityIsActiveVeneer + cmp r0, #0 + ldrh r0, [fp, #4] + addne sl, sl, #2 + cmp r0, #0x40 + bne _02323DB8 + mov r0, r7 + bl GetApparentWeather + cmp r0, #4 + moveq r0, #1 + beq _02324008 + cmp r0, #1 + subeq sl, sl, #2 +_02323DB8: + ldrh r1, [fp, #4] + ldr r0, _0232401C ; =0x0000010E + cmp r1, r0 + bne _02323DDC + mov r0, r7 + bl GetApparentWeather + cmp r0, #5 + moveq r0, #1 + beq _02324008 +_02323DDC: + mov r0, r7 + mov r1, #0x30 + bl IqSkillIsEnabled + cmp r0, #0 + addne sl, sl, #1 + ldrb r0, [r5, #0xfe] + add sb, sb, sl + ldrsh sl, [r5, #0x2e] + cmp r0, #0 + mov r0, r6 + movne sl, #0xa + bl GetApparentWeather + cmp r0, #2 + bne _02323E30 + mov r0, r7 + mov r1, r6 + mov r2, #0x1d +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__02322D64 + cmp r0, #0 + addne r4, r4, #2 +_02323E30: + mov r0, r7 + mov r1, #0x30 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _02323E54 + ldrh r0, [fp, #4] + bl MoveIsNotPhysical + cmp r0, #0 + addeq r4, r4, #2 +_02323E54: + mov r0, r6 + mov r1, #0x3f + bl IqSkillIsEnabled + cmp r0, #0 + beq _02323E94 + ldrsh r2, [r5, #0x12] + ldrsh r1, [r5, #0x16] + ldr r0, _02324020 ; =0x000003E7 + add r2, r2, r1 + cmp r2, r0 + movgt r2, r0 + mov r0, r2, asr #1 + ldrsh r1, [r5, #0x10] + add r0, r2, r0, lsr #30 + cmp r1, r0, asr #2 + addle r4, r4, #2 +_02323E94: + mov r0, r6 + mov r1, #0x30 + bl IqSkillIsEnabled + cmp r0, #0 + mov r0, r7 + mov r1, r6 + mov r2, #0x62 +#ifndef JAPAN + mov r3, #1 +#endif + subne r4, r4, #1 + bl DefenderAbilityIsActive__02322D64 + cmp r0, #0 + beq _02323ED8 + ldrb r0, [r5, #0xd0] + cmp r0, #2 + ldrneb r0, [r5, #0xf1] + cmpne r0, #2 + addeq r4, r4, #3 +_02323ED8: + mov r0, r7 + mov r1, r6 + mov r2, #0x77 +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__02322D64 + cmp r0, #0 + beq _02323F18 + mov r0, r6 + bl GetApparentWeather + cmp r0, #5 + beq _02323F14 + mov r0, r6 + bl GetApparentWeather + cmp r0, #7 + bne _02323F18 +_02323F14: + add r4, r4, #2 +_02323F18: + mov r0, r6 + bl GetApparentWeather + ldr r2, _02324024 ; =EXCL_ITEM_EFFECTS_EVASION_BOOST + ldrb r1, [r2, r0] + cmp r1, #0 + beq _02323F44 + ldrb r1, [r2, r0] + mov r0, r6 + bl ExclusiveItemEffectIsActive__02323918 + cmp r0, #0 + addne r4, r4, #1 +_02323F44: + mov r0, r7 + mov r1, #0x6a + add sl, sl, r4 + bl AbilityIsActiveVeneer + cmp r0, #0 + movne sb, #0xa + mov r0, r7 + mov r1, r6 + mov r2, #0x6a +#ifndef JAPAN + mov r3, #1 +#endif + movne sl, sb + bl DefenderAbilityIsActive__02322D64 + cmp r0, #0 + movne sb, #0xa + movne sl, sb + cmp sb, #0 + movlt sb, #0 + blt _02323F94 + cmp sb, #0x14 + movgt sb, #0x14 +_02323F94: + ldr r2, _02324028 ; =MALE_ACCURACY_STAGE_MULTIPLIERS + ldr r0, [sp, #4] + mov r1, #0xa8 + mla r1, r0, r1, r2 + ldr r3, [r1, sb, lsl #2] + cmp sl, #0 + movlt sl, #0 + cmp sl, #0x14 + movgt sl, #0x14 + cmp r3, #0 + movlt r3, #0 + cmp r3, #0x6400 + ldr r2, _0232402C ; =MALE_EVASION_STAGE_MULTIPLIERS + ldr r0, [sp] + mov r1, #0xa8 + mla r1, r0, r1, r2 + movgt r3, #0x6400 + mul r0, r8, r3 + ldr r1, [r1, sl, lsl #2] + mov r8, r0, asr #8 + cmp r1, #0 + movlt r1, #0 + cmp r1, #0x6400 + movgt r1, #0x6400 + mul r1, r8, r1 + ldr r0, [sp, #8] + cmp r0, r1, asr #8 + movlt r0, #1 + movge r0, #0 +_02324008: + add sp, sp, #0xc + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_02324010: .word 0x00000163 +_02324014: .word DETECT_BAND_MOVE_ACCURACY_DROP +_02324018: .word QUICK_DODGER_MOVE_ACCURACY_DROP +_0232401C: .word 0x0000010E +_02324020: .word 0x000003E7 +_02324024: .word EXCL_ITEM_EFFECTS_EVASION_BOOST +_02324028: .word MALE_ACCURACY_STAGE_MULTIPLIERS +_0232402C: .word MALE_EVASION_STAGE_MULTIPLIERS + arm_func_end MoveHitCheck + + arm_func_start ov29_02324030 +ov29_02324030: ; 0x02324030 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x18 + mov sb, r1 + mov sl, r0 + mov r0, sb + mov r1, #1 + mov r4, #0 + mov r8, r2 + bl ov29_023024E0 + mov r6, r0 + mov r0, sb + mov r1, r4 + bl ov29_023024E0 + str r0, [sp, #0x10] + mov r0, sb + mov r1, r8 + mov r2, r4 + bl GetEntityMoveTargetAndRange + mov r5, r0 + and r0, r5, #0xf + cmp r0, #4 + bne _023240C0 + mov r0, sb + mov r1, r8 + bl IsChargingTwoTurnMove + ldrh r1, [r8, #4] + mov r5, r0 + cmp r1, #0x97 + bne _023240B4 + mov r0, sb + bl GetApparentWeather + cmp r0, #1 + moveq r5, #1 +_023240B4: + cmp r5, #0 + movne r5, #0 + moveq r5, #0x73 +_023240C0: + ands r0, r5, #0xf0 + bne _023240FC + mov r0, sb + bl ov29_022F87C0 + cmp r0, #0 + beq _0232439C + stmia sp, {r0, r8} + mov r1, sl + mov r2, r5 + mov r3, sb + mov r0, #0 + str r6, [sp, #8] + bl ov29_023243B4 + mov r4, r0 + b _0232439C +_023240FC: + cmp r0, #0x10 + cmpne r0, #0x20 + bne _023241AC + cmp r0, #0x20 + ldr r0, [sb, #0xb4] + mov fp, #0 + ldreqb r7, [r0, #0x4c] + moveq r0, #8 + ldrneb r1, [r0, #0x4c] + streq r0, [sp, #0xc] + movne r0, #3 + strne r0, [sp, #0xc] + subne r7, r1, #1 + b _0232419C +_02324134: + and r7, r7, #7 + ldr r1, _023243AC ; =DIRECTIONS_XY + mov r2, r7, lsl #2 + ldrsh r2, [r1, r2] + ldrsh r0, [sb, #4] + add r1, r1, r7, lsl #2 + ldrsh r1, [r1, #2] + add r0, r0, r2 + strh r0, [sp, #0x14] + ldrsh r2, [sb, #6] + add r0, sp, #0x14 + add r1, r2, r1 + strh r1, [sp, #0x16] + bl PositionHasMonster + cmp r0, #0 + beq _02324194 + stmia sp, {r0, r8} + mov r0, r4 + mov r1, sl + mov r2, r5 + mov r3, sb + str r6, [sp, #8] + bl ov29_023243B4 + mov r4, r0 +_02324194: + add fp, fp, #1 + add r7, r7, #1 +_0232419C: + ldr r0, [sp, #0xc] + cmp fp, r0 + blt _02324134 + b _0232439C +_023241AC: + cmp r0, #0x30 + bne _02324248 + mov fp, #0 +_023241B8: + ldr r0, _023243B0 ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, fp, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr r7, [r0, #0xad4] +#else + ldr r7, [r0, #0xb78] +#endif + mov r0, r7 + bl EntityIsValid__02321438 + cmp r0, #0 + beq _02324238 + mov r0, sb + mov r1, r7 + bl ov29_022E28D4 + cmp r0, #0 + beq _02324238 + cmp r7, sb + stmia sp, {r7, r8} + mov r0, r4 + bne _02324220 + ldr r4, [sp, #0x10] + mov r1, sl + mov r2, r5 + mov r3, sb + str r4, [sp, #8] + bl ov29_023243B4 + mov r4, r0 + b _02324238 +_02324220: + mov r1, sl + mov r2, r5 + mov r3, sb + str r6, [sp, #8] + bl ov29_023243B4 + mov r4, r0 +_02324238: + add fp, fp, #1 + cmp fp, #0x14 + blt _023241B8 + b _0232439C +_02324248: + cmp r0, #0x40 + bne _023242C4 + mov r0, sb + mov r7, #0 + bl ov29_022F8830 + cmp r0, #0 + beq _02324288 + stmia sp, {r0, r8} + mov r1, sl + mov r2, r5 + mov r3, sb + mov r0, r7 + str r6, [sp, #8] + bl ov29_023243B4 + movs r4, r0 + movne r7, #1 +_02324288: + cmp r7, #0 + bne _0232439C + mov r0, sb + bl ov29_022F88C0 + cmp r0, #0 + beq _0232439C + stmia sp, {r0, r8} + mov r0, r4 + mov r1, sl + mov r2, r5 + mov r3, sb + str r6, [sp, #8] + bl ov29_023243B4 + mov r4, r0 + b _0232439C +_023242C4: + cmp r0, #0x50 + beq _0232439C + cmp r0, #0x80 + cmpne r0, #0x90 + bne _0232430C + mov r0, sb + bl ov29_022F8830 + cmp r0, #0 + beq _0232439C + stmia sp, {r0, r8} + mov r1, sl + mov r2, r5 + mov r3, sb + mov r0, #0 + str r6, [sp, #8] + bl ov29_023243B4 + mov r4, r0 + b _0232439C +_0232430C: + cmp r0, #0x60 + bne _02324370 + mov r7, #0 +_02324318: + ldr r0, _023243B0 ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, r7, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr fp, [r0, #0xad4] +#else + ldr fp, [r0, #0xb78] +#endif + mov r0, fp + bl EntityIsValid__02321438 + cmp r0, #0 + beq _02324360 + str fp, [sp] + str r8, [sp, #4] + mov r0, r4 + mov r1, sl + mov r2, r5 + mov r3, sb + str r6, [sp, #8] + bl ov29_023243B4 + mov r4, r0 +_02324360: + add r7, r7, #1 + cmp r7, #0x14 + blt _02324318 + b _0232439C +_02324370: + cmp r0, #0x70 + bne _0232439C + str sb, [sp] + str r8, [sp, #4] + mov r1, sl + mov r2, r5 + mov r3, sb + mov r0, #0 + str r6, [sp, #8] + bl ov29_023243B4 + mov r4, r0 +_0232439C: + mov r0, #0 + str r0, [sl, r4, lsl #2] + add sp, sp, #0x18 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_023243AC: .word DIRECTIONS_XY +_023243B0: .word DUNGEON_PTR + arm_func_end ov29_02324030 + + arm_func_start ov29_023243B4 +ov29_023243B4: ; 0x023243B4 + stmdb sp!, {r4, r5, r6, r7, r8, lr} + ldr r4, [sp, #0x1c] + ldr r5, [sp, #0x18] + ldrh r4, [r4, #4] + mov r7, r1 + mov r8, r0 + cmp r4, #0xfc + mov r6, r3 + mov r4, #0 + ldr r1, [r5, #0xb4] + cmpeq r6, r5 + ldmeqia sp!, {r4, r5, r6, r7, r8, pc} + ldrb r0, [r1, #9] + cmp r0, #1 + moveq r0, r8 + ldmeqia sp!, {r4, r5, r6, r7, r8, pc} + ldrb r0, [r1, #0xbc] + cmp r0, #7 + moveq r0, r8 + ldmeqia sp!, {r4, r5, r6, r7, r8, pc} + ldrb r0, [sp, #0x20] + cmp r0, #0 + movne r4, #1 + bne _023244C0 + ands r0, r2, #0xf + cmpne r0, #4 + bne _02324440 + mov r0, r6 + mov r1, r5 + mov r2, #1 + mov r3, #0 + bl GetTreatmentBetweenMonsters + cmp r0, #1 + moveq r4, #1 + b _023244C0 +_02324440: + cmp r0, #1 + bne _02324468 + mov r0, r6 + mov r1, r5 + mov r2, #1 + mov r3, #0 + bl GetTreatmentBetweenMonsters + cmp r0, #0 + moveq r4, #1 + b _023244C0 +_02324468: + cmp r0, #2 + moveq r4, #1 + beq _023244C0 + cmp r0, #5 + bne _02324488 + cmp r6, r5 + movne r4, #1 + b _023244C0 +_02324488: + cmp r0, #6 + bne _023244B8 + mov r0, r6 + mov r1, r5 + mov r2, #1 + mov r3, #0 + bl GetTreatmentBetweenMonsters + cmp r0, #0 + bne _023244C0 + cmp r6, r5 + movne r4, #1 + b _023244C0 +_023244B8: + cmp r0, #3 + moveq r4, #1 +_023244C0: + ldr r1, [sp, #0x1c] + mov r0, r5 + bl TwoTurnMoveForcedMiss + cmp r0, #0 + movne r4, #0 + cmp r4, #0 + beq _02324508 + cmp r8, #0x40 + bge _02324508 + str r5, [r7, r8, lsl #2] + ldr r0, [r5, #0xb4] + add r8, r8, #1 + ldrb r0, [r0, #6] + cmp r0, #0 + ldreq r0, _02324510 ; =ov29_0235370C + ldreq r1, [r0] + cmpeq r1, #0 + streq r5, [r0] +_02324508: + mov r0, r8 + ldmia sp!, {r4, r5, r6, r7, r8, pc} + .align 2, 0 +_02324510: .word ov29_0235370C + arm_func_end ov29_023243B4 + + arm_func_start ov29_02324514 +ov29_02324514: ; 0x02324514 + stmdb sp!, {r3, lr} + bl GetMoveNbStrikes + cmp r0, #0 + ldmneia sp!, {r3, pc} + mov r0, #2 + mov r1, #6 + bl DungeonRandRange + ldmia sp!, {r3, pc} + arm_func_end ov29_02324514 + + arm_func_start IsHyperBeamVariant +IsHyperBeamVariant: ; 0x02324534 + ldrh r2, [r0, #4] + cmp r2, #0xee + moveq r0, #1 + bxeq lr + cmp r2, #0xef + moveq r0, #1 + bxeq lr + cmp r2, #0xf2 + moveq r0, #1 + bxeq lr + cmp r2, #0x110 + moveq r0, #1 + bxeq lr + ldr r1, _023245A0 ; =0x000001C5 + cmp r2, r1 + moveq r0, #1 + bxeq lr + add r0, r1, #2 + cmp r2, r0 + moveq r0, #1 + bxeq lr + add r0, r1, #0x29 + cmp r2, r0 + moveq r0, #1 + movne r0, #0 + and r0, r0, #0xff + bx lr + .align 2, 0 +_023245A0: .word 0x000001C5 + arm_func_end IsHyperBeamVariant + + arm_func_start IsChargingTwoTurnMove +IsChargingTwoTurnMove: ; 0x023245A4 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl EntityIsValid__02321438 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldr ip, [r5, #0xb4] + mov lr, #0 + ldr r2, _02324618 ; =TWO_TURN_MOVES_AND_STATUSES + b _02324608 +_023245D0: + mov r3, lr, lsl #2 + ldrh r1, [r2, r3] + cmp r1, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrh r0, [r4, #4] + cmp r0, r1 + addeq r0, r2, r3 + ldreqb r1, [ip, #0xd2] + ldreqb r0, [r0, #2] + cmpeq r1, r0 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + add lr, lr, #1 +_02324608: + cmp lr, #0x64 + blt _023245D0 + mov r0, #0 + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_02324618: .word TWO_TURN_MOVES_AND_STATUSES + arm_func_end IsChargingTwoTurnMove + + arm_func_start IsChargingAnyTwoTurnMove +IsChargingAnyTwoTurnMove: ; 0x0232461C + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl EntityIsValid__02321438 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldr ip, [r5, #0xb4] + mov r3, #0 + ldr r2, _02324694 ; =ov29_02352A60 + b _0232466C +_02324648: + ldrb r1, [r2, r3] + cmp r1, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [ip, #0xd2] + cmp r0, r1 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + add r3, r3, #1 +_0232466C: + cmp r3, #0x64 + blt _02324648 + cmp r4, #0 + beq _0232468C + ldrb r0, [ip, #0xd2] + cmp r0, #0xb + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} +_0232468C: + mov r0, #0 + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_02324694: .word ov29_02352A60 + arm_func_end IsChargingAnyTwoTurnMove + + arm_func_start ov29_02324698 +ov29_02324698: ; 0x02324698 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x140 + mov r6, #0 + ldr fp, _02324740 ; =DUNGEON_PTR + mov r7, r6 + add r4, sp, #0 +_023246B0: + ldr r0, [fp] + add r0, r0, r7, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr sb, [r0, #0xad4] +#else + ldr sb, [r0, #0xb78] +#endif + mov r0, sb + bl EntityIsValid__02321438 + cmp r0, #0 + beq _0232470C + ldr r0, [sb, #0xb4] + mov r8, #0 +#ifdef JAPAN + add r5, r0, #0x120 +#else + add r5, r0, #0x124 +#endif +_023246DC: + add sl, r5, r8, lsl #3 + mov r0, sb + mov r1, sl + bl ov29_02324748 + cmp r0, #0 + beq _02324700 + cmp r6, #0x50 + strlt sl, [r4, r6, lsl #2] + addlt r6, r6, #1 +_02324700: + add r8, r8, #1 + cmp r8, #4 + blt _023246DC +_0232470C: + add r7, r7, #1 + cmp r7, #0x14 + blt _023246B0 + cmp r6, #0 + ldreq r0, _02324744 ; =0x00000163 + beq _02324738 + mov r0, r6 + bl DungeonRandInt + add r1, sp, #0 + ldr r0, [r1, r0, lsl #2] + ldrh r0, [r0, #4] +_02324738: + add sp, sp, #0x140 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_02324740: .word DUNGEON_PTR +_02324744: .word 0x00000163 + arm_func_end ov29_02324698 + + arm_func_start ov29_02324748 +ov29_02324748: ; 0x02324748 + stmdb sp!, {r4, lr} + mov r4, r1 + ldrb r1, [r4] + tst r1, #1 + movne r1, #1 + moveq r1, #0 + tst r1, #0xff + beq _02324788 + ldrh r1, [r4, #4] + bl ov29_02324D60 + cmp r0, #0 + bne _02324788 + ldrh r0, [r4, #4] + bl IsCopyingMove + cmp r0, #0 + beq _02324790 +_02324788: + mov r0, #0 + ldmia sp!, {r4, pc} +_02324790: + mov r0, #1 + ldmia sp!, {r4, pc} + arm_func_end ov29_02324748 + + arm_func_start HasMaxGinsengBoost99 +HasMaxGinsengBoost99: ; 0x02324798 + stmdb sp!, {r3, lr} + bl GetMoveMaxGinsengBoost + cmp r0, #0x63 + moveq r0, #1 + movne r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} + arm_func_end HasMaxGinsengBoost99 + + arm_func_start ov29_023247B4 +ov29_023247B4: ; 0x023247B4 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + sub sp, sp, #8 + mov r8, r0 + ldr r0, [r8, #0xb4] + mov r7, #0 + mov r6, r7 +#ifdef JAPAN + add r5, r0, #0x120 +#else + add r5, r0, #0x124 +#endif + add r4, sp, #0 +_023247D4: + add sb, r5, r6, lsl #3 + mov r0, r8 + mov r1, sb + bl ov29_02324748 + cmp r0, #0 + beq _02324814 + mov r0, sb + bl HasMaxGinsengBoost99 + cmp r0, #0 + beq _02324814 + ldrh r2, [sb, #4] + add r0, r7, #1 + mov r1, r7, lsl #1 + mov r0, r0, lsl #0x10 + strh r2, [r4, r1] + mov r7, r0, asr #0x10 +_02324814: + add r0, r6, #1 + mov r0, r0, lsl #0x10 + mov r6, r0, asr #0x10 + cmp r6, #4 + blt _023247D4 + cmp r7, #0 + movle r0, #0 + ble _0232484C + mov r0, r7 + bl DungeonRandInt + mov r0, r0, lsl #0x10 + add r1, sp, #0 + mov r0, r0, asr #0xf + ldrh r0, [r1, r0] +_0232484C: + add sp, sp, #8 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + arm_func_end ov29_023247B4 + + arm_func_start TwoTurnMoveForcedMiss +TwoTurnMoveForcedMiss: ; 0x02324854 + stmdb sp!, {r3, lr} + ldr r2, [r0, #0xb4] +#ifdef JAPAN + ldrb r0, [r2, #0x10a] +#else + ldrb r0, [r2, #0x10b] +#endif + cmp r0, #1 + bne _023248A4 + ldrh r0, [r1, #4] + cmp r0, #0x88 + moveq r0, #0 + ldmeqia sp!, {r3, pc} + cmp r0, #0xa2 + moveq r0, #0 + ldmeqia sp!, {r3, pc} + cmp r0, #0x39 + moveq r0, #0 + ldmeqia sp!, {r3, pc} + cmp r0, #0x40 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} +_023248A4: + cmp r0, #2 + bne _02324928 + ldrb r0, [r2, #0xd2] + cmp r0, #9 + bne _023248D8 + ldrh r0, [r1, #4] + cmp r0, #0x20 + moveq r0, #0 + ldmeqia sp!, {r3, pc} + cmp r0, #0xdb + bne _02324920 + mov r0, #0 + ldmia sp!, {r3, pc} +_023248D8: + cmp r0, #0xa + bne _02324920 + ldrh r0, [r1, #4] + cmp r0, #0x76 + moveq r0, #0 + ldmeqia sp!, {r3, pc} + cmp r0, #0x128 + moveq r0, #0 + ldmeqia sp!, {r3, pc} + cmp r0, #0x77 + bne _02324920 + bl GetNaturePowerVariant + ldr r1, _02324930 ; =NATURE_POWER_TABLE + mov r0, r0, lsl #3 + ldrh r0, [r1, r0] + cmp r0, #0x76 + moveq r0, #0 + ldmeqia sp!, {r3, pc} +_02324920: + mov r0, #1 + ldmia sp!, {r3, pc} +_02324928: + mov r0, #0 + ldmia sp!, {r3, pc} + .align 2, 0 +_02324930: .word NATURE_POWER_TABLE + arm_func_end TwoTurnMoveForcedMiss + + arm_func_start DungeonRandOutcomeUserTargetInteraction +DungeonRandOutcomeUserTargetInteraction: ; 0x02324934 + stmdb sp!, {r4, r5, r6, lr} + mov r6, r0 + mov r5, r1 + mov r4, r2 + bl IsFloorOver + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, pc} + mov r0, r6 + bl EntityIsValid__02321438 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, r5 + bl EntityIsValid__02321438 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + ldr r1, [r5, #0xb4] +#ifdef JAPAN + ldrb r0, [r1, #0x15e] +#else + ldrb r0, [r1, #0x162] +#endif + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + ldrsh r0, [r1, #0x10] + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + cmp r4, #0 + beq _023249DC + mov r0, r6 + mov r1, #0x26 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _023249CC + mov r0, r4, lsl #1 + bl DungeonRandOutcome__022EAB50 + mov r4, r0 + b _023249E0 +_023249CC: + mov r0, r4 + bl DungeonRandOutcome__022EAB50 + mov r4, r0 + b _023249E0 +_023249DC: + mov r4, #1 +_023249E0: + cmp r4, #0 + cmpne r6, r5 + beq _02324A18 + mov r0, r6 + mov r1, r5 + mov r2, #0x4c +#ifndef JAPAN + mov r3, #1 +#endif + bl DefenderAbilityIsActive__02322D64 + cmp r0, #0 + beq _02324A18 + mov r0, r5 + bl ov29_022E65A8 + mov r0, #0 + ldmia sp!, {r4, r5, r6, pc} +_02324A18: + mov r0, r4 + ldmia sp!, {r4, r5, r6, pc} + arm_func_end DungeonRandOutcomeUserTargetInteraction + + arm_func_start DungeonRandOutcomeUserAction +DungeonRandOutcomeUserAction: ; 0x02324A20 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl EntityIsValid__02321438 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r4, #0 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, r5 + mov r1, #0x26 + bl AbilityIsActiveVeneer + cmp r0, #0 + beq _02324A68 + mov r0, r4, lsl #1 + bl DungeonRandOutcome__022EAB50 + ldmia sp!, {r3, r4, r5, pc} +_02324A68: + mov r0, r4 + bl DungeonRandOutcome__022EAB50 + ldmia sp!, {r3, r4, r5, pc} + arm_func_end DungeonRandOutcomeUserAction + + arm_func_start CanAiUseMove +CanAiUseMove: ; 0x02324A74 + stmdb sp!, {r4, r5, r6, r7, r8, lr} + mov r6, r0 + ldr r3, [r6, #0xb4] + mov r5, r2 +#ifdef JAPAN + add r0, r3, #0x120 +#else + add r0, r3, #0x124 +#endif + ldrb r2, [r0, r1, lsl #3] + add r4, r0, r1, lsl #3 + tst r2, #1 + movne r0, #1 + moveq r0, #0 + tst r0, #0xff + moveq r0, #0 + ldmeqia sp!, {r4, r5, r6, r7, r8, pc} + tst r2, #2 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, r7, r8, pc} + tst r2, #0x20 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, r7, r8, pc} + ldrh r0, [r4, #2] + tst r0, #1 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, r7, r8, pc} + mov r8, #0 +#ifdef JAPAN + add r7, r3, #0x140 +#else + add r7, r3, #0x144 +#endif + b _02324B14 +_02324ADC: + mov r0, r6 + mov r1, r4 + mov r2, r5 + bl CanMonsterUseMove + cmp r0, #0 + movne r0, #1 + ldmneia sp!, {r4, r5, r6, r7, r8, pc} + add r4, r4, #8 + cmp r4, r7 + bhs _02324B1C + ldrb r0, [r4] + tst r0, #2 + beq _02324B1C + add r8, r8, #1 +_02324B14: + cmp r8, #4 + blt _02324ADC +_02324B1C: + mov r0, #0 + ldmia sp!, {r4, r5, r6, r7, r8, pc} + arm_func_end CanAiUseMove + + arm_func_start CanMonsterUseMove +CanMonsterUseMove: ; 0x02324B24 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r1 + ldrh r3, [r5, #4] + ldr r1, _02324BE4 ; =0x00000163 + ldr r4, [r0, #0xb4] + cmp r3, r1 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r5] + tst r0, #0x20 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + ldrh r0, [r5, #2] + tst r0, #1 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + cmp r2, #0 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r5, #6] + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xd0] + cmp r0, #5 + bne _02324BA0 + mov r0, r5 + bl IsAffectedByTaunt + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} +_02324BA0: + ldrb r0, [r4, #0xd0] + cmp r0, #6 + bne _02324BDC + ldrh r0, [r5, #4] + cmp r0, #0x160 + bne _02324BCC +#ifdef JAPAN + ldrb r0, [r4, #0x140] +#else + ldrb r0, [r4, #0x144] +#endif + tst r0, #0x10 + bne _02324BDC + mov r0, #0 + ldmia sp!, {r3, r4, r5, pc} +_02324BCC: + ldrb r0, [r5] + tst r0, #0x10 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} +_02324BDC: + mov r0, #1 + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_02324BE4: .word 0x00000163 + arm_func_end CanMonsterUseMove + + arm_func_start ov29_02324BE8 +ov29_02324BE8: ; 0x02324BE8 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r1 + ldrh r3, [r5, #4] + ldr r1, _02324C98 ; =0x00000163 + ldr r4, [r0, #0xb4] + cmp r3, r1 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r5] + tst r0, #0x20 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + ldrh r0, [r5, #2] + tst r0, #1 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + cmp r2, #0 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xd0] + cmp r0, #5 + bne _02324C54 + mov r0, r5 + bl IsAffectedByTaunt + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} +_02324C54: + ldrb r0, [r4, #0xd0] + cmp r0, #6 + bne _02324C90 + ldrh r0, [r5, #4] + cmp r0, #0x160 + bne _02324C80 +#ifdef JAPAN + ldrb r0, [r4, #0x140] +#else + ldrb r0, [r4, #0x144] +#endif + tst r0, #0x10 + bne _02324C90 + mov r0, #0 + ldmia sp!, {r3, r4, r5, pc} +_02324C80: + ldrb r0, [r5] + tst r0, #0x10 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} +_02324C90: + mov r0, #1 + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_02324C98: .word 0x00000163 + arm_func_end ov29_02324BE8 + + arm_func_start ov29_02324C9C +ov29_02324C9C: ; 0x02324C9C + stmdb sp!, {lr} + sub sp, sp, #0x104 + mov ip, #0 + mov lr, ip + add r2, sp, #0 + b _02324CDC +_02324CB4: + ldr r3, [r0, lr, lsl #2] + cmp r3, #0 + beq _02324CE4 + cmp r3, r1 + beq _02324CD8 + cmp ip, #0x40 + bge _02324CE4 + str r3, [r2, ip, lsl #2] + add ip, ip, #1 +_02324CD8: + add lr, lr, #1 +_02324CDC: + cmp lr, #0x41 + blt _02324CB4 +_02324CE4: + mov lr, #0 + add r2, sp, #0 + b _02324D18 +_02324CF0: + ldr r3, [r0, lr, lsl #2] + cmp r3, #0 + beq _02324D20 + cmp r3, r1 + bne _02324D14 + cmp ip, #0x40 + bge _02324D20 + str r3, [r2, ip, lsl #2] + add ip, ip, #1 +_02324D14: + add lr, lr, #1 +_02324D18: + cmp lr, #0x41 + blt _02324CF0 +_02324D20: + mov r2, #0 + add r1, sp, #0 + b _02324D34 +_02324D2C: + str r2, [r1, ip, lsl #2] + add ip, ip, #1 +_02324D34: + cmp ip, #0x41 + blt _02324D2C + mov r3, #0 + add r2, sp, #0 +_02324D44: + ldr r1, [r2, r3, lsl #2] + str r1, [r0, r3, lsl #2] + add r3, r3, #1 + cmp r3, #0x41 + blt _02324D44 + add sp, sp, #0x104 + ldmia sp!, {pc} + arm_func_end ov29_02324C9C + + arm_func_start ov29_02324D60 +ov29_02324D60: ; 0x02324D60 + stmdb sp!, {r4, lr} + mov r4, r1 + cmp r4, #0x97 + bne _02324D80 + bl GetApparentWeather + cmp r0, #1 + moveq r0, #0 + ldmeqia sp!, {r4, pc} +_02324D80: + mov r0, r4 + bl Is2TurnsMove + ldmia sp!, {r4, pc} + arm_func_end ov29_02324D60 + + arm_func_start UpdateMovePp +UpdateMovePp: ; 0x02324D8C + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl EntityIsValid__02321438 + cmp r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldr r0, [r5, #0xb4] + mov r1, #0 +_02324DAC: +#ifdef JAPAN + add r2, r0, #0x120 +#else + add r2, r0, #0x124 +#endif + ldrb r3, [r2, r1, lsl #3] + add r2, r2, r1, lsl #3 + tst r3, #1 + movne r3, #1 + moveq r3, #0 + tst r3, #0xff + beq _02324E34 + ldrh r3, [r2, #2] + mov lr, #1 + tst r3, #0x10 + bicne r3, r3, #0x10 + strneh r3, [r2, #2] + ldrh r3, [r2, #2] + movne lr, #2 + tst r3, #0x40 + bicne r3, r3, #0x40 + strneh r3, [r2, #2] + ldrh r3, [r2, #2] + movne lr, #4 + tst r3, #8 + bicne r3, r3, #8 + strneh r3, [r2, #2] + cmpne r4, #0 + beq _02324E34 + mov ip, #0 + b _02324E2C +_02324E18: + ldrb r3, [r2, #6] + add ip, ip, #1 + cmp r3, #0 + subne r3, r3, #1 + strneb r3, [r2, #6] +_02324E2C: + cmp ip, lr + blt _02324E18 +_02324E34: + add r1, r1, #1 + cmp r1, #4 + blt _02324DAC + ldmia sp!, {r3, r4, r5, pc} + arm_func_end UpdateMovePp + + arm_func_start GetDamageSourceWrapper +GetDamageSourceWrapper: ; 0x02324E44 + stmdb sp!, {r4, lr} + mov r4, r0 + mov r0, r1 + bl LowerSshort + mov r1, r0 + ldrh r0, [r4, #4] + bl GetDamageSource + ldmia sp!, {r4, pc} + arm_func_end GetDamageSourceWrapper + + arm_func_start LowerSshort +LowerSshort: ; 0x02324E64 + cmp r0, #0 + moveq r0, #0 + movne r0, r0, lsl #0x10 + movne r0, r0, asr #0x10 + bx lr + arm_func_end LowerSshort + + arm_func_start ov29_02324E78 +ov29_02324E78: ; 0x02324E78 + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x14 + mov r7, r0 + mov r6, r1 + mov r8, r2 + bl ShouldMovePlayAlternativeAnimation + mov r4, r0 + mov r0, r7 + bl GetApparentWeather + mov r1, r0 + ldrh r0, [r6, #4] + mov r2, r4 + bl GetMoveAnimationId + bl ov10_022BFD58 + mov sl, r0 + mov r0, r7 + bl GetApparentWeather + mov r1, r0 + ldrh r0, [r6, #4] + mov r2, r4 + bl GetMoveAnimationId + bl GetMoveAnimation + ldrsh r5, [r0] + mov r0, r7 + bl ShouldDisplayEntityAdvanced + cmp r0, #0 + moveq r0, sl + beq _023250C8 + mov r0, r7 + mov r1, r6 + bl ov29_02325D20 + cmp r0, #0 + movne r0, sl + bne _023250C8 + cmp r8, #0 + moveq r0, sl + beq _023250C8 + cmp r5, #0 + beq _023250C4 + mov r0, r7 + bl GetApparentWeather + mov r1, r0 + ldrh r0, [r6, #4] + mov r2, r4 + bl GetMoveAnimationId + mov r4, r0 + ldrh r0, [r6, #4] + ldr r5, [r7, #0xb4] + bl ov10_022BFD8C + mov sb, r0 + mov r0, r7 + bl GetApparentWeather + mov r1, r0 + ldrh r0, [r6, #4] + mov r2, #1 + bl GetMoveAnimationId + mov r1, r0 + ldrsh r0, [r5, #4] + bl ov10_022BF01C + mov r2, r0 + mvn r0, #0 + cmp r2, r0 + ldreq r0, _023250D0 ; =ov29_02352AD8 + ldreqh r1, [r0, #8] + streqh r1, [sp, #8] + ldreqh r0, [r0, #0xa] + streqh r0, [sp, #0xa] + beq _02324F98 + add r0, sp, #8 + add r1, r7, #0x2c + and r2, r2, #0xff + bl sub_0201CF90 +_02324F98: + strh r4, [sp] + ldrsh r1, [r5, #4] + add r0, sp, #0 + mov r2, #0 + strh r1, [sp, #2] + ldr r3, [r7, #0xc] + mov r1, #1 + mov r3, r3, asr #8 + strh r3, [sp, #4] + ldr r3, [r7, #0x10] + mov r3, r3, asr #8 + strh r3, [sp, #6] + ldrb r3, [r5, #0x4c] + str r3, [sp, #0xc] + str r2, [sp, #0x10] + bl ov29_02325D7C + mov r0, #0x58 + bl AdvanceFrame + add r0, sp, #0 + bl ov10_022BFAA8 + mov r1, r7 + mov r2, #5 + mov r8, r0 + bl ov29_022E6D68 + mov r0, #1 + bl ov29_022DE5F0 + mov r7, r0 + cmp sb, #0 + bne _0232506C + ldrh r0, [r6, #4] + bl ov10_022BFDEC + cmp r0, #0 + beq _0232506C + mov r6, #0 + bl ov29_022ED0C4 + mov r5, r0 + mov r0, #1 + bl ov29_022E3560 + mov r4, #0xff + mov fp, #1 + b _02325064 +_0232503C: + add r0, r5, #0x20 + mov r0, r0, lsl #0x10 + mov r5, r0, asr #0x10 + cmp r5, #0xff + movgt r5, r4 + mov r0, r5 + movgt r6, fp + bl ov29_022ED0D4 + mov r0, #0x26 + bl AdvanceFrame +_02325064: + cmp r6, #0 + beq _0232503C +_0232506C: + mov r0, r8, lsl #0x10 + mov r4, r0, asr #0x10 + mov r8, #0 + mov r6, #1 + mov r5, #0x26 + b _023250B0 +_02325084: + beq _023250A8 + cmp r7, #0x20 + subgt r7, r7, #0x20 + movle r7, r8 + mov r0, r7, lsl #0x10 + mov r1, r6 + mov r0, r0, asr #0x10 + movle sb, r8 + bl ov29_022DE5D8 +_023250A8: + mov r0, r5 + bl AdvanceFrame +_023250B0: + mov r0, r4 + bl AnimationHasMoreFrames + cmp r0, #0 + cmpne sb, #0 + bne _02325084 +_023250C4: + mov r0, sl +_023250C8: + add sp, sp, #0x14 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_023250D0: .word ov29_02352AD8 + arm_func_end ov29_02324E78 + + arm_func_start ov29_023250D4 +ov29_023250D4: ; 0x023250D4 +#ifdef JAPAN +#define OV29_023250D4_OFFSET -0xA4 +#else +#define OV29_023250D4_OFFSET 0 +#endif + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x18 + mov sl, r0 + mov sb, r1 + bl ShouldMovePlayAlternativeAnimation + mov r8, r0 + ldr r7, [sl, #0xb4] + mov r1, #0 + mov r0, sl + str r1, [sp] + bl GetApparentWeather + mov r1, r0 + ldrh r0, [sb, #4] + mov r2, r8 + bl GetMoveAnimationId + mov r1, r0 + ldrsh r0, [r7, #4] + bl ov10_022BFA3C + mov r4, r0 + mov r0, sl + ldr r6, [sl, #0xb4] + bl GetApparentWeather + mov r1, r0 + ldrh r0, [sb, #4] + mov r2, r8 + bl GetMoveAnimationId + mov r5, r0 + bl GetMoveAnimation + ldrsh r0, [r0, #2] + cmp r0, #0 + beq _023251E0 + mov r0, sl + bl GetApparentWeather + mov r1, r0 + ldrh r0, [sb, #4] + mov r2, r8 + bl GetMoveAnimationId + mov r1, r0 + ldrsh r0, [r6, #4] + bl ov10_022BF01C + mov r2, r0 + mvn r0, #0 + cmp r2, r0 + ldreq r0, _02325608 ; =ov29_02352AD8 + ldreqh r1, [r0, #4] + streqh r1, [sp, #0xc] + ldreqh r0, [r0, #6] + streqh r0, [sp, #0xe] + beq _023251A8 + add r0, sp, #0xc + add r1, sl, #0x2c + and r2, r2, #0xff + bl sub_0201CF90 +_023251A8: + strh r5, [sp, #4] + ldrsh r1, [r6, #4] + mov r0, #0 + strh r1, [sp, #6] + ldr r1, [sl, #0xc] + mov r1, r1, asr #8 + strh r1, [sp, #8] + ldr r1, [sl, #0x10] + mov r1, r1, asr #8 + strh r1, [sp, #0xa] + ldrb r1, [r6, #0x4c] + str r1, [sp, #0x10] + str r0, [sp, #0x14] + b _023251E8 +_023251E0: + mov r0, #0 + strh r0, [sp, #4] +_023251E8: + add r0, sp, #4 + mov r1, #1 + bl ov10_022BF1FC + cmp r0, #0 + ldrne r0, _0232560C ; =DUNGEON_PTR + ldrne r0, [r0] + addne r0, r0, #0x1a000 + ldrne r5, [r0, #0x22c + OV29_023250D4_OFFSET] + bne _02325228 + ldrh r0, [sb, #4] + cmp r0, #0x52 + ldreq r0, _0232560C ; =DUNGEON_PTR + ldreq r0, [r0] + addeq r0, r0, #0x1a000 + ldreq r5, [r0, #0x22c + OV29_023250D4_OFFSET] + movne r5, sl +_02325228: + mov r0, r5 + bl EntityIsValid__02325620 + cmp r0, #0 + moveq r5, sl + ldr r1, [r5, #0xc] + mov r0, r5 + mov r1, r1, asr #8 + strh r1, [sp, #8] + ldr r1, [r5, #0x10] + mov r1, r1, asr #8 + strh r1, [sp, #0xa] + bl ShouldDisplayEntityAdvanced + cmp r0, #0 + beq _02325600 + mov r0, sl + mov r1, sb + bl ov29_02325D20 + cmp r0, #0 + bne _02325600 + ldrh r0, [sb, #4] + cmp r0, #0x128 + bne _023252E4 + mov r0, #7 + bl DungeonRandInt + ldr r1, _0232560C ; =DUNGEON_PTR + ldr r6, _02325610 ; =ov29_02352B1C + ldr r3, [r1] + ldr r2, _02325614 ; =ov29_0237CA84 + ldr r6, [r6, r0, lsl #2] + str r0, [r2] + add r0, r3, #0x1a000 + str r6, [r0, #0x234 + OV29_023250D4_OFFSET] + ldr r1, [r1] + mov r0, #0 + add r1, r1, #0x1a000 + ldr r3, [r1, #0x234 + OV29_023250D4_OFFSET] + str r3, [r1, #0x238 + OV29_023250D4_OFFSET] + ldr r1, [r2] + add r1, r1, #4 + bl ov29_0234B09C + ldr r1, _02325618 ; =0x00000EAA + mov r0, r5 + bl LogMessageByIdWithPopupCheckUser + mov r0, r5 + mov r1, #0x214 + bl ov29_022E56A0 + b _0232531C +_023252E4: + cmp r0, #0x76 + bne _0232531C + ldr r2, _0232560C ; =DUNGEON_PTR + mov r3, #0xc + ldr r1, [r2] + mov r0, r5 + add r1, r1, #0x1a000 + str r3, [r1, #0x234 + OV29_023250D4_OFFSET] + ldr r2, [r2] + mov r1, #0x214 + add r2, r2, #0x1a000 + ldr r3, [r2, #0x234 + OV29_023250D4_OFFSET] + str r3, [r2, #0x238 + OV29_023250D4_OFFSET] + bl ov29_022E56A0 +_0232531C: + mov r0, sl + bl GetApparentWeather + mov r1, r0 + ldrh r0, [sb, #4] + mov r2, r8 + bl GetMoveAnimationId + mov r1, r0 + ldrsh r0, [r7, #4] + bl ov10_022BF0F4 + cmp r0, #0x3f00 + beq _02325354 + mov r0, r0, lsl #0x10 + mov r0, r0, lsr #0x10 + bl ov29_022EACCC +_02325354: + cmp r4, #0x63 + bne _023253C8 + mov r0, r5 + bl ShouldDisplayEntityAdvanced + cmp r0, #0 + beq _02325600 + mov r3, r8 + add r0, sp, #4 + mov r1, sl + mov r2, sb + ldrb r8, [r7, #0x4c] + bl ov29_02325644 + mov r7, #0 + mov r6, r7 + mov r5, #2 + mov r4, #0x15 +_02325394: + sub r0, r8, #1 + and r8, r0, #7 + mov r0, sl + mov r1, r6 + mov r2, r8 + bl ChangeMonsterAnimation + mov r0, r5 + mov r1, r4 + bl ov29_022EA370 + add r7, r7, #1 + cmp r7, #8 + blt _02325394 + b _02325600 +_023253C8: + cmp r4, #0x62 + bne _0232543C + mov r0, r5 + bl ShouldDisplayEntityAdvanced + cmp r0, #0 + beq _02325600 + add r0, sp, #4 + mov r1, sl + mov r2, sb + mov r3, r8 + ldrb r7, [r7, #0x4c] + bl ov29_02325644 + mov r8, #0 + mov r6, r8 + mov r5, #2 + mov r4, #0x15 +_02325408: + and r7, r7, #7 + mov r0, sl + mov r1, r6 + mov r2, r7 + bl ChangeMonsterAnimation + mov r0, r5 + mov r1, r4 + bl ov29_022EA370 + add r8, r8, #1 + cmp r8, #8 + add r7, r7, #1 + ble _02325408 + b _02325600 +_0232543C: + ldrb r0, [r7, #0xd8] + mov fp, #0 + cmp r0, #2 + moveq fp, #1 + beq _02325470 + ldr r0, _0232560C ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, #0x1a000 + ldr r1, [r0, #0x22c + OV29_023250D4_OFFSET] + cmp r1, sl + ldrneb r0, [r0, #0x245 + OV29_023250D4_OFFSET] + cmpne r0, #0 + movne fp, #1 +_02325470: + ldrb r0, [sl, #0x28] + cmp r0, #0 + bne _02325524 + mov r5, #0 +_02325480: + ldr r0, _0232560C ; =DUNGEON_PTR + ldr r0, [r0] + add r0, r0, r5, lsl #2 + add r0, r0, #0x12000 + ldr r6, [r0, #0xb78 + OV29_023250D4_OFFSET] + mov r0, r6 + bl EntityIsValid__02325620 + cmp r0, #0 + cmpne r6, sl + ldrneb r0, [r6, #0x28] + cmpne r0, #0 + beq _023254C8 + ldr r1, [r6, #0xb4] + mov r0, r6 + ldrb r1, [r1, #0x4c] + bl ov29_02304A48 + mov r0, #0 + strb r0, [r6, #0x28] +_023254C8: + add r5, r5, #1 + cmp r5, #0x14 + blt _02325480 + mov r0, #0x59 + bl AdvanceFrame + cmp fp, #0 + beq _02325500 + ldr r0, _0232561C ; =0x00000229 + bl GetSpriteIndex__02052708 + mov r1, r0 + mov r0, #1 + bl SetAndLoadCurrentAttackAnimation + mov r5, r0 + b _02325530 +_02325500: + ldrsh r0, [r7, #4] + bl GetSpriteIndex__02052708 + mov r1, r0 + mov r0, #1 + bl SetAndLoadCurrentAttackAnimation + mov r1, #0xff + mov r5, r0 + strb r1, [sl, #0xaf] + b _02325530 +_02325524: + mov r0, #0x59 + bl AdvanceFrame + ldrsh r5, [sl, #0xa8] +_02325530: + ldrb r2, [r7, #0x4c] + mov r0, sl + mov r1, r4 + bl ChangeMonsterAnimation + ldrb r1, [sl, #0xae] + mov r0, r5 + bl WanTableSpriteHasAnimationGroup + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + strb r0, [sl, #0x28] + mov r7, #0 + strb r7, [sl, #0x21] + mov r5, #0x59 + add fp, sp, #4 + b _023255D8 +_02325570: + mov r0, r5 + bl AdvanceFrame + add r0, sl, #0x2c + bl sub_0201D1D4 + cmp r4, #0 + cmpne r4, #7 + mov r6, r0 + cmpne r4, #9 + orreq r6, r6, #2 + tst r6, #2 + beq _023255C4 + ldr r0, [sp] + cmp r0, #0 + bne _023255C4 + mov r0, fp + mov r1, sl + mov r2, sb + mov r3, r8 + bl ov29_02325644 + mov r0, #1 + str r0, [sp] +_023255C4: + tst r6, #1 + ldreqb r0, [sl, #0x21] + cmpeq r0, #0 + bne _023255E0 + add r7, r7, #1 +_023255D8: + cmp r7, #0x78 + blt _02325570 +_023255E0: + mov r0, #0 + strb r0, [sl, #0x21] + ldrh r0, [sb, #4] + bl ov10_022BFDCC + cmp r0, #0 + beq _02325600 + mov r0, #1 + bl AnimationDelayOrSomething +_02325600: + add sp, sp, #0x18 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_02325608: .word ov29_02352AD8 +_0232560C: .word DUNGEON_PTR +_02325610: .word ov29_02352B1C +_02325614: .word ov29_0237CA84 +#ifdef JAPAN +_02325618: .word 0x00000BEC +#else +_02325618: .word 0x00000EAA +#endif +_0232561C: .word 0x00000229 + arm_func_end ov29_023250D4 diff --git a/asm/overlay_29_023498A0.s b/asm/overlay_29_023498A0.s index e027d5d2..bb4b4b6d 100644 --- a/asm/overlay_29_023498A0.s +++ b/asm/overlay_29_023498A0.s @@ -4766,758 +4766,3 @@ _0234D454: .word ov29_02353563 _0234D458: .word ov29_02353368 _0234D45C: .word ov29_02353380 arm_func_end ov29_0234D304 - - arm_func_start IsMonster__0234D460 -IsMonster__0234D460: ; 0x0234D460 - cmp r0, #0 - moveq r0, #0 - bxeq lr - ldr r0, [r0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsMonster__0234D460 - - arm_func_start ov29_0234D484 -ov29_0234D484: ; 0x0234D484 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r0, r1 - bl StringFromId - mov r4, r0 - mov r0, #0 - mov r1, r0 - mov r2, r4 - mov r3, #1 - bl ov29_0234D304 - mov r0, r5 - mov r1, r4 - bl LogMessageQuiet - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_0234D484 - - arm_func_start ov29_0234D4BC -ov29_0234D4BC: ; 0x0234D4BC - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r0 - mov r6, r1 - mov r5, r2 - mov r4, r3 - bl ov29_0234D558 - bl ov29_0234D630 - bl ov29_0234B034 - mov r1, r0 - mov r2, r7 - mov r3, r5 - mov r0, r6 - str r4, [sp] - bl ov29_0234D750 - mov r4, r0 - ldrb r0, [sp, #0x18] - cmp r0, #0 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bl ov29_0234D8A0 - mov r0, r4 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - arm_func_end ov29_0234D4BC - - arm_func_start YesNoMenu -YesNoMenu: ; 0x0234D518 - stmdb sp!, {r3, r4, r5, r6, lr} - sub sp, sp, #4 - mov r6, r0 - mov r0, r1 - mov r5, r2 - mov r4, r3 - bl StringFromId - ldrb ip, [sp, #0x18] - mov r1, r0 - mov r0, r6 - mov r2, r5 - mov r3, r4 - str ip, [sp] - bl ov29_0234D4BC - add sp, sp, #4 - ldmia sp!, {r3, r4, r5, r6, pc} - arm_func_end YesNoMenu - - arm_func_start ov29_0234D558 -ov29_0234D558: ; 0x0234D558 - stmdb sp!, {r4, lr} - bl ov29_0234B73C - mov r4, r0 - mov r0, #2 - mov r1, #0 - bl ov29_022EA428 - cmp r4, #0 - ldmeqia sp!, {r4, pc} - mov r0, #0 - bl ov29_0234B1A4 - mov r0, #0xa - mov r1, r0 - bl ov29_022EA370 - ldmia sp!, {r4, pc} - arm_func_end ov29_0234D558 - - arm_func_start DisplayMessageInternal -DisplayMessageInternal: ; 0x0234D590 - stmdb sp!, {r4, r5, r6, lr} - sub sp, sp, #8 - mov r6, r1 - mov r5, r2 - mov r4, r3 - bl StringFromId - ldr r1, [sp, #0x18] - ldrb ip, [sp, #0x1c] - str r1, [sp] - mov r1, r6 - mov r2, r5 - mov r3, r4 - str ip, [sp, #4] - bl ov29_0234D5D0 - add sp, sp, #8 - ldmia sp!, {r4, r5, r6, pc} - arm_func_end DisplayMessageInternal - - arm_func_start ov29_0234D5D0 -ov29_0234D5D0: ; 0x0234D5D0 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r0 - mov r6, r1 - mov r0, #2 - mov r1, #0 - mov r5, r2 - mov r4, r3 - bl ov29_022EA428 - mov r0, #1 - bl ov29_0234B4CC - bl ov29_0234DB58 - mov r0, r5 - bl ov29_0234DBE0 - mov r0, r7 - mov r3, r4 - str r6, [sp] - ldr r1, [sp, #0x18] - mov r2, #0 - bl ov29_0234DC3C - bl ov29_0234D9C0 - mov r0, r6 - ldrb r1, [sp, #0x1c] - bl ov29_0234D8B4 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - arm_func_end ov29_0234D5D0 - - arm_func_start ov29_0234D630 -ov29_0234D630: ; 0x0234D630 - stmdb sp!, {r3, lr} - mov r0, #2 - mov r1, #0 - bl ov29_022EA428 - mov r0, #1 - bl ov29_0234B4CC - bl ov29_0234DB58 - ldmia sp!, {r3, pc} - arm_func_end ov29_0234D630 - - arm_func_start ov29_0234D650 -ov29_0234D650: ; 0x0234D650 - ldr ip, _0234D658 ; =ov29_0234D9C0 - bx ip - .align 2, 0 -_0234D658: .word ov29_0234D9C0 - arm_func_end ov29_0234D650 - - arm_func_start ov29_0234D65C -ov29_0234D65C: ; 0x0234D65C - ldr ip, _0234D664 ; =ov29_0234DBE0 - bx ip - .align 2, 0 -_0234D664: .word ov29_0234DBE0 - arm_func_end ov29_0234D65C - - arm_func_start ov29_0234D668 -ov29_0234D668: ; 0x0234D668 - stmdb sp!, {r3, lr} - ldr r0, _0234D68C ; =ov29_02382800 - mvn r1, #1 - ldr r0, [r0] - ldrsb r0, [r0, #0x12] - cmp r0, r1 - ldmeqia sp!, {r3, pc} - bl HidePortraitBox - ldmia sp!, {r3, pc} - .align 2, 0 -_0234D68C: .word ov29_02382800 - arm_func_end ov29_0234D668 - - arm_func_start ov29_0234D690 -ov29_0234D690: ; 0x0234D690 - stmdb sp!, {r3, r4, r5, r6, lr} - sub sp, sp, #4 - mov r6, r1 - mov r5, r2 - mov r4, r3 - bl StringFromId - ldrb ip, [sp, #0x18] - mov r1, r6 - mov r2, r5 - mov r3, r4 - str ip, [sp] - bl ov29_0234DC3C - add sp, sp, #4 - ldmia sp!, {r3, r4, r5, r6, pc} - arm_func_end ov29_0234D690 - - arm_func_start ov29_0234D6C8 -ov29_0234D6C8: ; 0x0234D6C8 - stmdb sp!, {r3, r4, r5, r6, lr} - sub sp, sp, #4 - mov r6, r0 - mov r0, r2 - mov r5, r1 - mov r4, r3 - bl ov29_0234DBE0 - ldrb ip, [sp, #0x18] - mov r0, r6 - mov r1, r5 - mov r3, r4 - mov r2, #0 - str ip, [sp] - bl ov29_0234DC3C - bl ov29_0234D9C0 - add sp, sp, #4 - ldmia sp!, {r3, r4, r5, r6, pc} - arm_func_end ov29_0234D6C8 - - arm_func_start ov29_0234D70C -ov29_0234D70C: ; 0x0234D70C - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r6, r2 - mov r7, r1 - mov r5, r3 - bl StringFromId - mov r4, r0 - mov r0, r6 - bl ov29_0234DBE0 - mov r0, r4 - mov r1, r7 - mov r3, r5 - ldrb ip, [sp, #0x18] - mov r2, #0 - str ip, [sp] - bl ov29_0234DC3C - bl ov29_0234D9C0 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - arm_func_end ov29_0234D70C - - arm_func_start ov29_0234D750 -ov29_0234D750: ; 0x0234D750 - stmdb sp!, {r3, r4, r5, r6, lr} - sub sp, sp, #0xc - ldrb ip, [sp, #0x20] - mov r4, r2 - mov r6, r0 - mov r5, r1 - mov r2, #0 - mov r1, r3 - add r0, sp, #4 - mov r3, r2 - str ip, [sp] - bl ov29_0234D860 - mov r0, r4 - bl ov29_0234DBE0 - mov r2, #1 - str r2, [sp] - mov r0, r6 - mov r1, r5 - add r2, sp, #4 - mov r3, #0 - bl ov29_0234DC3C - bl ov29_0234D9C0 - ldr r0, _0234D7BC ; =ov29_02382800 - ldr r0, [r0] - ldr r0, [r0, #0x46c] - add sp, sp, #0xc - ldmia sp!, {r3, r4, r5, r6, pc} - .align 2, 0 -_0234D7BC: .word ov29_02382800 - arm_func_end ov29_0234D750 - - arm_func_start ov29_0234D7C0 -ov29_0234D7C0: ; 0x0234D7C0 - stmdb sp!, {r4, r5, r6, r7, lr} - sub sp, sp, #0xc - mov r7, r1 - mov r6, r2 - mov r5, r3 - bl StringFromId - ldrb r1, [sp, #0x20] - mov r2, #0 - mov r4, r0 - str r1, [sp] - add r0, sp, #4 - mov r1, r5 - mov r3, r2 - bl ov29_0234D860 - mov r0, r6 - bl ov29_0234DBE0 - mov r2, #1 - str r2, [sp] - mov r0, r4 - mov r1, r7 - add r2, sp, #4 - mov r3, #0 - bl ov29_0234DC3C - bl ov29_0234D9C0 - ldr r0, _0234D834 ; =ov29_02382800 - ldr r0, [r0] - ldr r0, [r0, #0x46c] - add sp, sp, #0xc - ldmia sp!, {r4, r5, r6, r7, pc} - .align 2, 0 -_0234D834: .word ov29_02382800 - arm_func_end ov29_0234D7C0 - - arm_func_start ov29_0234D838 -ov29_0234D838: ; 0x0234D838 - stmdb sp!, {r3, lr} - ldr r0, _0234D85C ; =ov29_02382800 - mvn r1, #1 - ldr r0, [r0] - ldrsb r0, [r0, #0x10] - cmp r0, r1 - ldmeqia sp!, {r3, pc} - bl sub_0202F334 - ldmia sp!, {r3, pc} - .align 2, 0 -_0234D85C: .word ov29_02382800 - arm_func_end ov29_0234D838 - - arm_func_start ov29_0234D860 -ov29_0234D860: ; 0x0234D860 - ldrb ip, [sp] - strb r3, [r0] - strb ip, [r0, #1] - strh r1, [r0, #2] - str r2, [r0, #4] - bx lr - arm_func_end ov29_0234D860 - - arm_func_start ov29_0234D878 -ov29_0234D878: ; 0x0234D878 - ldr r1, _0234D888 ; =ov29_02382800 - ldr r1, [r1] - str r0, [r1, #0x474] - bx lr - .align 2, 0 -_0234D888: .word ov29_02382800 - arm_func_end ov29_0234D878 - - arm_func_start ov29_0234D88C -ov29_0234D88C: ; 0x0234D88C - ldr r0, _0234D89C ; =ov29_02382800 - ldr r0, [r0] - ldr r0, [r0, #0x46c] - bx lr - .align 2, 0 -_0234D89C: .word ov29_02382800 - arm_func_end ov29_0234D88C - - arm_func_start ov29_0234D8A0 -ov29_0234D8A0: ; 0x0234D8A0 - ldr ip, _0234D8B0 ; =ov29_0234D8B4 - mov r1, r0 - mov r0, #0 - bx ip - .align 2, 0 -_0234D8B0: .word ov29_0234D8B4 - arm_func_end ov29_0234D8A0 - - arm_func_start ov29_0234D8B4 -ov29_0234D8B4: ; 0x0234D8B4 - stmdb sp!, {r3, r4, r5, lr} - ldr r2, _0234D9BC ; =ov29_02382800 - mov r5, r0 - ldr r0, [r2] - mov r4, r1 - cmp r0, #0 - beq _0234D970 - ldrsb r0, [r0, #0x12] - mvn r1, #1 - cmp r0, r1 - beq _0234D8E4 - bl HidePortraitBox -_0234D8E4: - ldr r0, _0234D9BC ; =ov29_02382800 - ldr r0, [r0] - ldrsb r0, [r0, #0x10] - bl sub_0202F334 - mov r0, #8 - mov r1, #0x62 - bl ov29_022EA370 - ldr r0, _0234D9BC ; =ov29_02382800 - mvn r1, #1 - ldr r0, [r0] - ldrsb r0, [r0, #0x11] - cmp r0, r1 - beq _0234D91C - bl CloseParentMenu -_0234D91C: - ldr r0, _0234D9BC ; =ov29_02382800 - mvn r1, #1 - ldr r0, [r0] - ldrsb r0, [r0, #0x12] - cmp r0, r1 - beq _0234D948 - bl ClosePortraitBox - ldr r0, _0234D9BC ; =ov29_02382800 - mvn r1, #1 - ldr r0, [r0] - strb r1, [r0, #0x12] -_0234D948: - ldr r0, _0234D9BC ; =ov29_02382800 - ldr r0, [r0] - ldrsb r0, [r0, #0x10] - bl CloseDialogueBox - ldr r0, _0234D9BC ; =ov29_02382800 - ldr r0, [r0] - bl MemFree - ldr r0, _0234D9BC ; =ov29_02382800 - mov r1, #0 - str r1, [r0] -_0234D970: - mov r0, #0x62 - bl AdvanceFrame - cmp r5, #0 - beq _0234D994 - bl ov29_022F2FE4 - bl ov29_02339148 - mov r0, #8 - mov r1, #9 - bl ov29_022EA370 -_0234D994: - cmp r4, #0 - beq _0234D9A8 - mov r0, #0 - mov r1, r0 - bl ov29_022EA428 -_0234D9A8: - bl sub_02006B70 - bl ov29_022E0B44 - mov r0, #0 - bl ov29_0234B4CC - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_0234D9BC: .word ov29_02382800 - arm_func_end ov29_0234D8B4 - - arm_func_start ov29_0234D9C0 -ov29_0234D9C0: ; 0x0234D9C0 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - mvn r8, #1 - mov r7, #0 - ldr r6, _0234DB50 ; =ov29_02382800 - sub r5, r8, #3 - sub r4, r8, #2 - mov sb, #1 - mov fp, r7 -_0234D9E0: - mov r0, #0x62 - bl AdvanceFrame - ldr r1, [r6] - ldrb r0, [r1, #0x466] - cmp r0, #0 - beq _0234DB2C - add r0, r1, #0x400 - ldrsh r0, [r0, #0x6a] - mov sl, #0 - cmp r0, #0 - bne _0234DA90 - ldrsb r0, [r1, #0x10] - bl IsDialogueBoxActive - cmp r0, #0 - bne _0234DB44 - ldr r0, [r6] - add r0, r0, #0x400 - strh sb, [r0, #0x6a] - ldr r0, [r6] - ldr r3, [r0, #0x470] - ldrb r0, [r0, #0x467] - cmp r3, #0 - ldreq r3, _0234DB54 ; =ov29_02353398 - cmp r0, #0 - movne r1, #0x11 - mov r0, #0 - moveq r1, #0x13 - mov r2, r0 - bl CreateParentMenuFromStringIds - ldr r1, [r6] - strb r0, [r1, #0x11] - ldr r1, [r6] - ldrsb r0, [r1, #0x11] - add r1, r1, #0x400 - ldrsh r1, [r1, #0x68] - bl sub_0202AB94 - ldr r0, [r6] - ldr r0, [r0, #0x474] - cmp r0, #0 - beq _0234DB44 - blx r0 - ldr r0, [r6] - str fp, [r0, #0x474] - b _0234DB44 -_0234DA90: - ldrsb r0, [r1, #0x11] - bl sub_020282F4 - ldr r2, [r6] - ldrb r1, [r2, #0x467] - cmp r1, #0 - cmpeq r0, r5 - moveq r0, #2 - streq r0, [r2, #0x46c] - moveq sl, #1 - beq _0234DAD4 - cmp r0, r4 - bne _0234DAD4 - ldrsb r0, [r2, #0x11] - bl sub_0202ABB0 - ldr r1, [r6] - mov sl, #1 - str r0, [r1, #0x46c] -_0234DAD4: - cmp sl, #0 - beq _0234DB44 - ldr r0, [r6] - ldrsb r0, [r0, #0x11] - cmp r0, r8 - beq _0234DAF8 - bl CloseParentMenu - ldr r0, [r6] - strb r8, [r0, #0x11] -_0234DAF8: - ldr r0, [r6] - add r0, r0, #0x400 - strh r7, [r0, #0x6a] - ldr r0, [r6] - strb r7, [r0, #0x466] - ldr r0, [r6] - strb r7, [r0, #0x467] - ldr r0, [r6] - add r0, r0, #0x400 - strh r7, [r0, #0x68] - ldr r0, [r6] - str r7, [r0, #0x470] - b _0234DB44 -_0234DB2C: - ldrsb r0, [r1, #0x10] - bl IsDialogueBoxActive - cmp r0, #0 - moveq r0, #1 - movne r0, #0 - and sl, r0, #0xff -_0234DB44: - cmp sl, #0 - beq _0234D9E0 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_0234DB50: .word ov29_02382800 -_0234DB54: .word ov29_02353398 - arm_func_end ov29_0234D9C0 - - arm_func_start ov29_0234DB58 -ov29_0234DB58: ; 0x0234DB58 - stmdb sp!, {r3, lr} - ldr r0, _0234DBD8 ; =0x00000478 - mov r1, #8 - bl MemAlloc - ldr r2, _0234DBDC ; =ov29_02382800 - ldr r1, _0234DBD8 ; =0x00000478 - str r0, [r2] - bl MemZero - ldr r0, _0234DBDC ; =ov29_02382800 - mvn r2, #0 - ldr r1, [r0] - str r2, [r1, #0x46c] - ldr r0, [r0] - add r0, r0, #0x14 - bl InitPreprocessorArgs - ldr r1, _0234DBDC ; =ov29_02382800 - mov r3, #0 - ldr r0, [r1] - sub r2, r3, #2 - strb r3, [r0, #0x466] - ldr r0, [r1] - add r0, r0, #0x400 - strh r3, [r0, #0x6a] - ldr r0, [r1] - strb r2, [r0, #0x12] - ldr r0, [r1] - strb r2, [r0, #0x11] - ldr r0, [r1] - strb r2, [r0, #0x10] - ldr r0, [r1] - str r3, [r0, #0x474] - ldmia sp!, {r3, pc} - .align 2, 0 -_0234DBD8: .word 0x00000478 -_0234DBDC: .word ov29_02382800 - arm_func_end ov29_0234DB58 - - arm_func_start ov29_0234DBE0 -ov29_0234DBE0: ; 0x0234DBE0 - stmdb sp!, {r4, lr} - movs r4, r0 - ldmeqia sp!, {r4, pc} - ldr r1, _0234DC38 ; =ov29_02382800 - mvn r0, #1 - ldr r1, [r1] - ldrsb r1, [r1, #0x12] - cmp r1, r0 - bne _0234DC20 - mov r0, #0 - mov r1, #3 - mov r2, #1 - bl CreatePortraitBox - ldr r1, _0234DC38 ; =ov29_02382800 - ldr r1, [r1] - strb r0, [r1, #0x12] -_0234DC20: - ldr r0, _0234DC38 ; =ov29_02382800 - mov r1, r4 - ldr r0, [r0] - ldrsb r0, [r0, #0x12] - bl ShowPortraitInPortraitBox - ldmia sp!, {r4, pc} - .align 2, 0 -_0234DC38: .word ov29_02382800 - arm_func_end ov29_0234DBE0 - - arm_func_start ov29_0234DC3C -ov29_0234DC3C: ; 0x0234DC3C - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} - ldr r4, _0234DD88 ; =ov29_02382800 - mvn ip, #1 - ldr r4, [r4] - mov r7, r0 - ldrsb r0, [r4, #0x10] - mov r6, r1 - mov r5, r2 - mov r4, r3 - cmp r0, ip - bne _0234DC8C - mov r0, #0 - bl CreateDialogueBox - ldr r2, _0234DD88 ; =ov29_02382800 - mov r1, #0 - ldr r3, [r2] - strb r0, [r3, #0x10] - ldr r0, [r2] - ldrsb r0, [r0, #0x10] - bl sub_0202F474 -_0234DC8C: - ldr r0, _0234DD88 ; =ov29_02382800 - mov r8, r6 - ldr sb, [r0] - mov ip, #5 - add lr, sb, #0x14 -_0234DCA0: - ldmia r8!, {r0, r1, r2, r3} - stmia lr!, {r0, r1, r2, r3} - subs ip, ip, #1 - bne _0234DCA0 - ldr r1, _0234DD8C ; =0x00001004 - add r0, sb, #0x400 - strh r1, [r0, #0x64] - cmp r4, #0 - beq _0234DCDC - ldr r0, _0234DD88 ; =ov29_02382800 - ldr r0, [r0] - add r0, r0, #0x400 - ldrh r1, [r0, #0x64] - orr r1, r1, #0x2000 - strh r1, [r0, #0x64] -_0234DCDC: - ldrb r0, [sp, #0x20] - cmp r0, #0 - beq _0234DD24 - cmp r5, #0 - beq _0234DD0C - ldr r0, _0234DD88 ; =ov29_02382800 - ldr r0, [r0] - add r0, r0, #0x400 - ldrh r1, [r0, #0x64] - orr r1, r1, #8 - strh r1, [r0, #0x64] - b _0234DD24 -_0234DD0C: - ldr r0, _0234DD88 ; =ov29_02382800 - ldr r0, [r0] - add r0, r0, #0x400 - ldrh r1, [r0, #0x64] - orr r1, r1, #0x18 - strh r1, [r0, #0x64] -_0234DD24: - cmp r5, #0 - beq _0234DD64 - ldr r1, _0234DD88 ; =ov29_02382800 - mov r2, #1 - ldr r0, [r1] - strb r2, [r0, #0x466] - ldrb r2, [r5, #1] - ldr r0, [r1] - strb r2, [r0, #0x467] - ldr r0, [r1] - ldrsh r2, [r5, #2] - add r0, r0, #0x400 - strh r2, [r0, #0x68] - ldr r2, [r5, #4] - ldr r0, [r1] - str r2, [r0, #0x470] -_0234DD64: - ldr r0, _0234DD88 ; =ov29_02382800 - mov r2, r7 - ldr r0, [r0] - mov r3, r6 - add r1, r0, #0x400 - ldrsb r0, [r0, #0x10] - ldrh r1, [r1, #0x64] - bl ShowStringInDialogueBox - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} - .align 2, 0 -_0234DD88: .word ov29_02382800 -_0234DD8C: .word 0x00001004 - arm_func_end ov29_0234DC3C - - arm_func_start ov29_0234DD90 -ov29_0234DD90: ; 0x0234DD90 - ldr ip, _0234DD9C ; =LoadOverlay - mov r0, #0x22 - bx ip - .align 2, 0 -_0234DD9C: .word LoadOverlay - arm_func_end ov29_0234DD90 - - arm_func_start ov29_0234DDA0 -ov29_0234DDA0: ; 0x0234DDA0 - ldr ip, _0234DDAC ; =OverlayIsLoaded - mov r0, #0x22 - bx ip - .align 2, 0 -_0234DDAC: .word OverlayIsLoaded - arm_func_end ov29_0234DDA0 - - arm_func_start ov29_0234DDB0 -ov29_0234DDB0: ; 0x0234DDB0 - stmdb sp!, {r3, lr} - mov r0, #0x22 - bl OverlayIsLoaded - cmp r0, #0 - ldmeqia sp!, {r3, pc} - mov r0, #0x22 - bl UnloadOverlay - ldmia sp!, {r3, pc} - arm_func_end ov29_0234DDB0 diff --git a/asm/overlay_29_0234D484.s b/asm/overlay_29_0234D484.s new file mode 100644 index 00000000..7bb6ab80 --- /dev/null +++ b/asm/overlay_29_0234D484.s @@ -0,0 +1,746 @@ + .include "asm/macros.inc" + .include "overlay_29_0234D484.inc" + + .text + + arm_func_start ov29_0234D484 +ov29_0234D484: ; 0x0234D484 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r0, r1 + bl StringFromId + mov r4, r0 + mov r0, #0 + mov r1, r0 + mov r2, r4 + mov r3, #1 + bl ov29_0234D304 + mov r0, r5 + mov r1, r4 + bl LogMessageQuiet + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_0234D484 + + arm_func_start ov29_0234D4BC +ov29_0234D4BC: ; 0x0234D4BC + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r0 + mov r6, r1 + mov r5, r2 + mov r4, r3 + bl ov29_0234D558 + bl ov29_0234D630 + bl ov29_0234B034 + mov r1, r0 + mov r2, r7 + mov r3, r5 + mov r0, r6 + str r4, [sp] + bl ov29_0234D750 + mov r4, r0 + ldrb r0, [sp, #0x18] + cmp r0, #0 + moveq r0, #1 + movne r0, #0 + and r0, r0, #0xff + bl ov29_0234D8A0 + mov r0, r4 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + arm_func_end ov29_0234D4BC + + arm_func_start YesNoMenu +YesNoMenu: ; 0x0234D518 + stmdb sp!, {r3, r4, r5, r6, lr} + sub sp, sp, #4 + mov r6, r0 + mov r0, r1 + mov r5, r2 + mov r4, r3 + bl StringFromId + ldrb ip, [sp, #0x18] + mov r1, r0 + mov r0, r6 + mov r2, r5 + mov r3, r4 + str ip, [sp] + bl ov29_0234D4BC + add sp, sp, #4 + ldmia sp!, {r3, r4, r5, r6, pc} + arm_func_end YesNoMenu + + arm_func_start ov29_0234D558 +ov29_0234D558: ; 0x0234D558 + stmdb sp!, {r4, lr} + bl ov29_0234B73C + mov r4, r0 + mov r0, #2 + mov r1, #0 + bl ov29_022EA428 + cmp r4, #0 + ldmeqia sp!, {r4, pc} + mov r0, #0 + bl ov29_0234B1A4 + mov r0, #0xa + mov r1, r0 + bl ov29_022EA370 + ldmia sp!, {r4, pc} + arm_func_end ov29_0234D558 + + arm_func_start DisplayMessageInternal +DisplayMessageInternal: ; 0x0234D590 + stmdb sp!, {r4, r5, r6, lr} + sub sp, sp, #8 + mov r6, r1 + mov r5, r2 + mov r4, r3 + bl StringFromId + ldr r1, [sp, #0x18] + ldrb ip, [sp, #0x1c] + str r1, [sp] + mov r1, r6 + mov r2, r5 + mov r3, r4 + str ip, [sp, #4] + bl ov29_0234D5D0 + add sp, sp, #8 + ldmia sp!, {r4, r5, r6, pc} + arm_func_end DisplayMessageInternal + + arm_func_start ov29_0234D5D0 +ov29_0234D5D0: ; 0x0234D5D0 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r0 + mov r6, r1 + mov r0, #2 + mov r1, #0 + mov r5, r2 + mov r4, r3 + bl ov29_022EA428 + mov r0, #1 + bl ov29_0234B4CC + bl ov29_0234DB58 + mov r0, r5 + bl ov29_0234DBE0 + mov r0, r7 + mov r3, r4 + str r6, [sp] + ldr r1, [sp, #0x18] + mov r2, #0 + bl ov29_0234DC3C + bl ov29_0234D9C0 + mov r0, r6 + ldrb r1, [sp, #0x1c] + bl ov29_0234D8B4 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + arm_func_end ov29_0234D5D0 + + arm_func_start ov29_0234D630 +ov29_0234D630: ; 0x0234D630 + stmdb sp!, {r3, lr} + mov r0, #2 + mov r1, #0 + bl ov29_022EA428 + mov r0, #1 + bl ov29_0234B4CC + bl ov29_0234DB58 + ldmia sp!, {r3, pc} + arm_func_end ov29_0234D630 + + arm_func_start ov29_0234D650 +ov29_0234D650: ; 0x0234D650 + ldr ip, _0234D658 ; =ov29_0234D9C0 + bx ip + .align 2, 0 +_0234D658: .word ov29_0234D9C0 + arm_func_end ov29_0234D650 + + arm_func_start ov29_0234D65C +ov29_0234D65C: ; 0x0234D65C + ldr ip, _0234D664 ; =ov29_0234DBE0 + bx ip + .align 2, 0 +_0234D664: .word ov29_0234DBE0 + arm_func_end ov29_0234D65C + + arm_func_start ov29_0234D668 +ov29_0234D668: ; 0x0234D668 + stmdb sp!, {r3, lr} + ldr r0, _0234D68C ; =ov29_02382800 + mvn r1, #1 + ldr r0, [r0] + ldrsb r0, [r0, #0x12] + cmp r0, r1 + ldmeqia sp!, {r3, pc} + bl HidePortraitBox + ldmia sp!, {r3, pc} + .align 2, 0 +_0234D68C: .word ov29_02382800 + arm_func_end ov29_0234D668 + + arm_func_start ov29_0234D690 +ov29_0234D690: ; 0x0234D690 + stmdb sp!, {r3, r4, r5, r6, lr} + sub sp, sp, #4 + mov r6, r1 + mov r5, r2 + mov r4, r3 + bl StringFromId + ldrb ip, [sp, #0x18] + mov r1, r6 + mov r2, r5 + mov r3, r4 + str ip, [sp] + bl ov29_0234DC3C + add sp, sp, #4 + ldmia sp!, {r3, r4, r5, r6, pc} + arm_func_end ov29_0234D690 + + arm_func_start ov29_0234D6C8 +ov29_0234D6C8: ; 0x0234D6C8 + stmdb sp!, {r3, r4, r5, r6, lr} + sub sp, sp, #4 + mov r6, r0 + mov r0, r2 + mov r5, r1 + mov r4, r3 + bl ov29_0234DBE0 + ldrb ip, [sp, #0x18] + mov r0, r6 + mov r1, r5 + mov r3, r4 + mov r2, #0 + str ip, [sp] + bl ov29_0234DC3C + bl ov29_0234D9C0 + add sp, sp, #4 + ldmia sp!, {r3, r4, r5, r6, pc} + arm_func_end ov29_0234D6C8 + + arm_func_start ov29_0234D70C +ov29_0234D70C: ; 0x0234D70C + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r6, r2 + mov r7, r1 + mov r5, r3 + bl StringFromId + mov r4, r0 + mov r0, r6 + bl ov29_0234DBE0 + mov r0, r4 + mov r1, r7 + mov r3, r5 + ldrb ip, [sp, #0x18] + mov r2, #0 + str ip, [sp] + bl ov29_0234DC3C + bl ov29_0234D9C0 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + arm_func_end ov29_0234D70C + + arm_func_start ov29_0234D750 +ov29_0234D750: ; 0x0234D750 + stmdb sp!, {r3, r4, r5, r6, lr} + sub sp, sp, #0xc + ldrb ip, [sp, #0x20] + mov r4, r2 + mov r6, r0 + mov r5, r1 + mov r2, #0 + mov r1, r3 + add r0, sp, #4 + mov r3, r2 + str ip, [sp] + bl ov29_0234D860 + mov r0, r4 + bl ov29_0234DBE0 + mov r2, #1 + str r2, [sp] + mov r0, r6 + mov r1, r5 + add r2, sp, #4 + mov r3, #0 + bl ov29_0234DC3C + bl ov29_0234D9C0 + ldr r0, _0234D7BC ; =ov29_02382800 + ldr r0, [r0] + ldr r0, [r0, #0x46c] + add sp, sp, #0xc + ldmia sp!, {r3, r4, r5, r6, pc} + .align 2, 0 +_0234D7BC: .word ov29_02382800 + arm_func_end ov29_0234D750 + + arm_func_start ov29_0234D7C0 +ov29_0234D7C0: ; 0x0234D7C0 + stmdb sp!, {r4, r5, r6, r7, lr} + sub sp, sp, #0xc + mov r7, r1 + mov r6, r2 + mov r5, r3 + bl StringFromId + ldrb r1, [sp, #0x20] + mov r2, #0 + mov r4, r0 + str r1, [sp] + add r0, sp, #4 + mov r1, r5 + mov r3, r2 + bl ov29_0234D860 + mov r0, r6 + bl ov29_0234DBE0 + mov r2, #1 + str r2, [sp] + mov r0, r4 + mov r1, r7 + add r2, sp, #4 + mov r3, #0 + bl ov29_0234DC3C + bl ov29_0234D9C0 + ldr r0, _0234D834 ; =ov29_02382800 + ldr r0, [r0] + ldr r0, [r0, #0x46c] + add sp, sp, #0xc + ldmia sp!, {r4, r5, r6, r7, pc} + .align 2, 0 +_0234D834: .word ov29_02382800 + arm_func_end ov29_0234D7C0 + + arm_func_start ov29_0234D838 +ov29_0234D838: ; 0x0234D838 + stmdb sp!, {r3, lr} + ldr r0, _0234D85C ; =ov29_02382800 + mvn r1, #1 + ldr r0, [r0] + ldrsb r0, [r0, #0x10] + cmp r0, r1 + ldmeqia sp!, {r3, pc} + bl sub_0202F334 + ldmia sp!, {r3, pc} + .align 2, 0 +_0234D85C: .word ov29_02382800 + arm_func_end ov29_0234D838 + + arm_func_start ov29_0234D860 +ov29_0234D860: ; 0x0234D860 + ldrb ip, [sp] + strb r3, [r0] + strb ip, [r0, #1] + strh r1, [r0, #2] + str r2, [r0, #4] + bx lr + arm_func_end ov29_0234D860 + + arm_func_start ov29_0234D878 +ov29_0234D878: ; 0x0234D878 + ldr r1, _0234D888 ; =ov29_02382800 + ldr r1, [r1] + str r0, [r1, #0x474] + bx lr + .align 2, 0 +_0234D888: .word ov29_02382800 + arm_func_end ov29_0234D878 + + arm_func_start ov29_0234D88C +ov29_0234D88C: ; 0x0234D88C + ldr r0, _0234D89C ; =ov29_02382800 + ldr r0, [r0] + ldr r0, [r0, #0x46c] + bx lr + .align 2, 0 +_0234D89C: .word ov29_02382800 + arm_func_end ov29_0234D88C + + arm_func_start ov29_0234D8A0 +ov29_0234D8A0: ; 0x0234D8A0 + ldr ip, _0234D8B0 ; =ov29_0234D8B4 + mov r1, r0 + mov r0, #0 + bx ip + .align 2, 0 +_0234D8B0: .word ov29_0234D8B4 + arm_func_end ov29_0234D8A0 + + arm_func_start ov29_0234D8B4 +ov29_0234D8B4: ; 0x0234D8B4 + stmdb sp!, {r3, r4, r5, lr} + ldr r2, _0234D9BC ; =ov29_02382800 + mov r5, r0 + ldr r0, [r2] + mov r4, r1 + cmp r0, #0 + beq _0234D970 + ldrsb r0, [r0, #0x12] + mvn r1, #1 + cmp r0, r1 + beq _0234D8E4 + bl HidePortraitBox +_0234D8E4: + ldr r0, _0234D9BC ; =ov29_02382800 + ldr r0, [r0] + ldrsb r0, [r0, #0x10] + bl sub_0202F334 + mov r0, #8 + mov r1, #0x62 + bl ov29_022EA370 + ldr r0, _0234D9BC ; =ov29_02382800 + mvn r1, #1 + ldr r0, [r0] + ldrsb r0, [r0, #0x11] + cmp r0, r1 + beq _0234D91C + bl CloseParentMenu +_0234D91C: + ldr r0, _0234D9BC ; =ov29_02382800 + mvn r1, #1 + ldr r0, [r0] + ldrsb r0, [r0, #0x12] + cmp r0, r1 + beq _0234D948 + bl ClosePortraitBox + ldr r0, _0234D9BC ; =ov29_02382800 + mvn r1, #1 + ldr r0, [r0] + strb r1, [r0, #0x12] +_0234D948: + ldr r0, _0234D9BC ; =ov29_02382800 + ldr r0, [r0] + ldrsb r0, [r0, #0x10] + bl CloseDialogueBox + ldr r0, _0234D9BC ; =ov29_02382800 + ldr r0, [r0] + bl MemFree + ldr r0, _0234D9BC ; =ov29_02382800 + mov r1, #0 + str r1, [r0] +_0234D970: + mov r0, #0x62 + bl AdvanceFrame + cmp r5, #0 + beq _0234D994 + bl ov29_022F2FE4 + bl ov29_02339148 + mov r0, #8 + mov r1, #9 + bl ov29_022EA370 +_0234D994: + cmp r4, #0 + beq _0234D9A8 + mov r0, #0 + mov r1, r0 + bl ov29_022EA428 +_0234D9A8: + bl sub_02006B70 + bl ov29_022E0B44 + mov r0, #0 + bl ov29_0234B4CC + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_0234D9BC: .word ov29_02382800 + arm_func_end ov29_0234D8B4 + + arm_func_start ov29_0234D9C0 +ov29_0234D9C0: ; 0x0234D9C0 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + mvn r8, #1 + mov r7, #0 + ldr r6, _0234DB50 ; =ov29_02382800 + sub r5, r8, #3 + sub r4, r8, #2 + mov sb, #1 + mov fp, r7 +_0234D9E0: + mov r0, #0x62 + bl AdvanceFrame + ldr r1, [r6] + ldrb r0, [r1, #0x466] + cmp r0, #0 + beq _0234DB2C + add r0, r1, #0x400 + ldrsh r0, [r0, #0x6a] + mov sl, #0 + cmp r0, #0 + bne _0234DA90 + ldrsb r0, [r1, #0x10] + bl IsDialogueBoxActive + cmp r0, #0 + bne _0234DB44 + ldr r0, [r6] + add r0, r0, #0x400 + strh sb, [r0, #0x6a] + ldr r0, [r6] + ldr r3, [r0, #0x470] + ldrb r0, [r0, #0x467] + cmp r3, #0 + ldreq r3, _0234DB54 ; =ov29_02353398 + cmp r0, #0 + movne r1, #0x11 + mov r0, #0 + moveq r1, #0x13 + mov r2, r0 + bl CreateParentMenuFromStringIds + ldr r1, [r6] + strb r0, [r1, #0x11] + ldr r1, [r6] + ldrsb r0, [r1, #0x11] + add r1, r1, #0x400 + ldrsh r1, [r1, #0x68] + bl sub_0202AB94 + ldr r0, [r6] + ldr r0, [r0, #0x474] + cmp r0, #0 + beq _0234DB44 + blx r0 + ldr r0, [r6] + str fp, [r0, #0x474] + b _0234DB44 +_0234DA90: + ldrsb r0, [r1, #0x11] + bl sub_020282F4 + ldr r2, [r6] + ldrb r1, [r2, #0x467] + cmp r1, #0 + cmpeq r0, r5 + moveq r0, #2 + streq r0, [r2, #0x46c] + moveq sl, #1 + beq _0234DAD4 + cmp r0, r4 + bne _0234DAD4 + ldrsb r0, [r2, #0x11] + bl sub_0202ABB0 + ldr r1, [r6] + mov sl, #1 + str r0, [r1, #0x46c] +_0234DAD4: + cmp sl, #0 + beq _0234DB44 + ldr r0, [r6] + ldrsb r0, [r0, #0x11] + cmp r0, r8 + beq _0234DAF8 + bl CloseParentMenu + ldr r0, [r6] + strb r8, [r0, #0x11] +_0234DAF8: + ldr r0, [r6] + add r0, r0, #0x400 + strh r7, [r0, #0x6a] + ldr r0, [r6] + strb r7, [r0, #0x466] + ldr r0, [r6] + strb r7, [r0, #0x467] + ldr r0, [r6] + add r0, r0, #0x400 + strh r7, [r0, #0x68] + ldr r0, [r6] + str r7, [r0, #0x470] + b _0234DB44 +_0234DB2C: + ldrsb r0, [r1, #0x10] + bl IsDialogueBoxActive + cmp r0, #0 + moveq r0, #1 + movne r0, #0 + and sl, r0, #0xff +_0234DB44: + cmp sl, #0 + beq _0234D9E0 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_0234DB50: .word ov29_02382800 +_0234DB54: .word ov29_02353398 + arm_func_end ov29_0234D9C0 + + arm_func_start ov29_0234DB58 +ov29_0234DB58: ; 0x0234DB58 + stmdb sp!, {r3, lr} + ldr r0, _0234DBD8 ; =0x00000478 + mov r1, #8 + bl MemAlloc + ldr r2, _0234DBDC ; =ov29_02382800 + ldr r1, _0234DBD8 ; =0x00000478 + str r0, [r2] + bl MemZero + ldr r0, _0234DBDC ; =ov29_02382800 + mvn r2, #0 + ldr r1, [r0] + str r2, [r1, #0x46c] + ldr r0, [r0] + add r0, r0, #0x14 + bl InitPreprocessorArgs + ldr r1, _0234DBDC ; =ov29_02382800 + mov r3, #0 + ldr r0, [r1] + sub r2, r3, #2 + strb r3, [r0, #0x466] + ldr r0, [r1] + add r0, r0, #0x400 + strh r3, [r0, #0x6a] + ldr r0, [r1] + strb r2, [r0, #0x12] + ldr r0, [r1] + strb r2, [r0, #0x11] + ldr r0, [r1] + strb r2, [r0, #0x10] + ldr r0, [r1] + str r3, [r0, #0x474] + ldmia sp!, {r3, pc} + .align 2, 0 +_0234DBD8: .word 0x00000478 +_0234DBDC: .word ov29_02382800 + arm_func_end ov29_0234DB58 + + arm_func_start ov29_0234DBE0 +ov29_0234DBE0: ; 0x0234DBE0 + stmdb sp!, {r4, lr} + movs r4, r0 + ldmeqia sp!, {r4, pc} + ldr r1, _0234DC38 ; =ov29_02382800 + mvn r0, #1 + ldr r1, [r1] + ldrsb r1, [r1, #0x12] + cmp r1, r0 + bne _0234DC20 + mov r0, #0 + mov r1, #3 + mov r2, #1 + bl CreatePortraitBox + ldr r1, _0234DC38 ; =ov29_02382800 + ldr r1, [r1] + strb r0, [r1, #0x12] +_0234DC20: + ldr r0, _0234DC38 ; =ov29_02382800 + mov r1, r4 + ldr r0, [r0] + ldrsb r0, [r0, #0x12] + bl ShowPortraitInPortraitBox + ldmia sp!, {r4, pc} + .align 2, 0 +_0234DC38: .word ov29_02382800 + arm_func_end ov29_0234DBE0 + + arm_func_start ov29_0234DC3C +ov29_0234DC3C: ; 0x0234DC3C + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr} + ldr r4, _0234DD88 ; =ov29_02382800 + mvn ip, #1 + ldr r4, [r4] + mov r7, r0 + ldrsb r0, [r4, #0x10] + mov r6, r1 + mov r5, r2 + mov r4, r3 + cmp r0, ip + bne _0234DC8C + mov r0, #0 + bl CreateDialogueBox + ldr r2, _0234DD88 ; =ov29_02382800 + mov r1, #0 + ldr r3, [r2] + strb r0, [r3, #0x10] + ldr r0, [r2] + ldrsb r0, [r0, #0x10] + bl sub_0202F474 +_0234DC8C: + ldr r0, _0234DD88 ; =ov29_02382800 + mov r8, r6 + ldr sb, [r0] + mov ip, #5 + add lr, sb, #0x14 +_0234DCA0: + ldmia r8!, {r0, r1, r2, r3} + stmia lr!, {r0, r1, r2, r3} + subs ip, ip, #1 + bne _0234DCA0 + ldr r1, _0234DD8C ; =0x00001004 + add r0, sb, #0x400 + strh r1, [r0, #0x64] + cmp r4, #0 + beq _0234DCDC + ldr r0, _0234DD88 ; =ov29_02382800 + ldr r0, [r0] + add r0, r0, #0x400 + ldrh r1, [r0, #0x64] + orr r1, r1, #0x2000 + strh r1, [r0, #0x64] +_0234DCDC: + ldrb r0, [sp, #0x20] + cmp r0, #0 + beq _0234DD24 + cmp r5, #0 + beq _0234DD0C + ldr r0, _0234DD88 ; =ov29_02382800 + ldr r0, [r0] + add r0, r0, #0x400 + ldrh r1, [r0, #0x64] + orr r1, r1, #8 + strh r1, [r0, #0x64] + b _0234DD24 +_0234DD0C: + ldr r0, _0234DD88 ; =ov29_02382800 + ldr r0, [r0] + add r0, r0, #0x400 + ldrh r1, [r0, #0x64] + orr r1, r1, #0x18 + strh r1, [r0, #0x64] +_0234DD24: + cmp r5, #0 + beq _0234DD64 + ldr r1, _0234DD88 ; =ov29_02382800 + mov r2, #1 + ldr r0, [r1] + strb r2, [r0, #0x466] + ldrb r2, [r5, #1] + ldr r0, [r1] + strb r2, [r0, #0x467] + ldr r0, [r1] + ldrsh r2, [r5, #2] + add r0, r0, #0x400 + strh r2, [r0, #0x68] + ldr r2, [r5, #4] + ldr r0, [r1] + str r2, [r0, #0x470] +_0234DD64: + ldr r0, _0234DD88 ; =ov29_02382800 + mov r2, r7 + ldr r0, [r0] + mov r3, r6 + add r1, r0, #0x400 + ldrsb r0, [r0, #0x10] + ldrh r1, [r1, #0x64] + bl ShowStringInDialogueBox + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc} + .align 2, 0 +_0234DD88: .word ov29_02382800 +_0234DD8C: .word 0x00001004 + arm_func_end ov29_0234DC3C + + arm_func_start ov29_0234DD90 +ov29_0234DD90: ; 0x0234DD90 + ldr ip, _0234DD9C ; =LoadOverlay + mov r0, #0x22 + bx ip + .align 2, 0 +_0234DD9C: .word LoadOverlay + arm_func_end ov29_0234DD90 + + arm_func_start ov29_0234DDA0 +ov29_0234DDA0: ; 0x0234DDA0 + ldr ip, _0234DDAC ; =OverlayIsLoaded + mov r0, #0x22 + bx ip + .align 2, 0 +_0234DDAC: .word OverlayIsLoaded + arm_func_end ov29_0234DDA0 + + arm_func_start ov29_0234DDB0 +ov29_0234DDB0: ; 0x0234DDB0 + stmdb sp!, {r3, lr} + mov r0, #0x22 + bl OverlayIsLoaded + cmp r0, #0 + ldmeqia sp!, {r3, pc} + mov r0, #0x22 + bl UnloadOverlay + ldmia sp!, {r3, pc} + arm_func_end ov29_0234DDB0 diff --git a/include/overlay_29_022F9720.h b/include/overlay_29_022F9720.h new file mode 100644 index 00000000..88dba24c --- /dev/null +++ b/include/overlay_29_022F9720.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_022F9720_H +#define PMDSKY_OVERLAY_29_022F9720_H + +#include "dungeon_mode.h" + +bool8 IsMonster__022F9720(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_022F9720_H diff --git a/include/overlay_29_02301A60.h b/include/overlay_29_02301A60.h new file mode 100644 index 00000000..57d10089 --- /dev/null +++ b/include/overlay_29_02301A60.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_02301A60_H +#define PMDSKY_OVERLAY_29_02301A60_H + +#include "dungeon_mode.h" + +bool8 IsMonster__02301A60(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_02301A60_H diff --git a/include/overlay_29_0230A994.h b/include/overlay_29_0230A994.h new file mode 100644 index 00000000..1d5341ea --- /dev/null +++ b/include/overlay_29_0230A994.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_0230A994_H +#define PMDSKY_OVERLAY_29_0230A994_H + +#include "dungeon_mode.h" + +bool8 IsMonster__0230A994(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_0230A994_H diff --git a/include/overlay_29_0230F980.h b/include/overlay_29_0230F980.h new file mode 100644 index 00000000..220f2de4 --- /dev/null +++ b/include/overlay_29_0230F980.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_0230F980_H +#define PMDSKY_OVERLAY_29_0230F980_H + +#include "dungeon_mode.h" + +bool8 IsMonster__0230F980(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_0230F980_H diff --git a/include/overlay_29_02318AB0.h b/include/overlay_29_02318AB0.h new file mode 100644 index 00000000..c242434b --- /dev/null +++ b/include/overlay_29_02318AB0.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_02318AB0_H +#define PMDSKY_OVERLAY_29_02318AB0_H + +#include "dungeon_mode.h" + +bool8 IsMonster__02318AB0(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_02318AB0_H diff --git a/include/overlay_29_0231A9D4.h b/include/overlay_29_0231A9D4.h new file mode 100644 index 00000000..923ffa89 --- /dev/null +++ b/include/overlay_29_0231A9D4.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_0231A9D4_H +#define PMDSKY_OVERLAY_29_0231A9D4_H + +#include "dungeon_mode.h" + +bool8 IsMonster__0231A9D4(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_0231A9D4_H diff --git a/include/overlay_29_0231B318.h b/include/overlay_29_0231B318.h new file mode 100644 index 00000000..6ab4d38c --- /dev/null +++ b/include/overlay_29_0231B318.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_0231B318_H +#define PMDSKY_OVERLAY_29_0231B318_H + +#include "dungeon_mode.h" + +bool8 IsMonster__0231B318(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_0231B318_H diff --git a/include/overlay_29_02322DB8.h b/include/overlay_29_02322DB8.h new file mode 100644 index 00000000..761242f1 --- /dev/null +++ b/include/overlay_29_02322DB8.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_02322DB8_H +#define PMDSKY_OVERLAY_29_02322DB8_H + +#include "dungeon_mode.h" + +bool8 IsMonster__02322DB8(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_02322DB8_H diff --git a/include/overlay_29_0234D460.h b/include/overlay_29_0234D460.h new file mode 100644 index 00000000..c4b54399 --- /dev/null +++ b/include/overlay_29_0234D460.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_OVERLAY_29_0234D460_H +#define PMDSKY_OVERLAY_29_0234D460_H + +#include "dungeon_mode.h" + +bool8 IsMonster__0234D460(struct entity *entity); + +#endif //PMDSKY_OVERLAY_29_0234D460_H diff --git a/main.lsf b/main.lsf index 61bd005e..d4528f37 100644 --- a/main.lsf +++ b/main.lsf @@ -256,6 +256,8 @@ Overlay OVY_29 Object asm/overlay_29_022F62CC.o Object src/overlay_29_022F7364.o Object asm/overlay_29_022F7388.o + Object src/overlay_29_022F9720.o + Object asm/overlay_29_022F9744.o Object src/joined_at_checks.o Object asm/overlay_29_022FBB1C.o Object src/overlay_29_022FC99C.o @@ -270,6 +272,8 @@ Overlay OVY_29 Object asm/overlay_29_02300BF8.o Object src/dungeon_ai_targeting.o Object asm/overlay_29_023016A8.o + Object src/overlay_29_02301A60.o + Object asm/overlay_29_02301A84.o Object src/dungeon_pokemon_attributes.o Object asm/overlay_29_02301D78.o Object src/overlay_29_02302A38.o @@ -288,24 +292,34 @@ Overlay OVY_29 Object asm/overlay_29_023085DC.o Object src/overlay_29_02308FBC.o Object asm/overlay_29_02308FE0.o + Object src/overlay_29_0230A994.o + Object asm/overlay_29_0230A9B8.o Object src/overlay_29_0230E8F0.o Object asm/overlay_29_0230E914.o Object src/overlay_29_0230F008.o Object asm/overlay_29_0230F02C.o + Object src/overlay_29_0230F980.o + Object asm/overlay_29_0230F9A4.o Object src/overlay_29_02311010.o Object asm/overlay_29_02311034.o Object src/overlay_29_023118B4.o Object asm/overlay_29_023118D8.o Object src/overlay_29_02315118.o Object asm/overlay_29_0231513C.o + Object src/overlay_29_02318AB0.o + Object asm/overlay_29_02318AD4.o Object src/overlay_29_02318D34.o Object asm/overlay_29_02318D58.o Object src/overlay_29_02318E4C.o Object asm/overlay_29_02318E70.o Object src/overlay_29_02319F8C.o Object asm/overlay_29_02319FB0.o + Object src/overlay_29_0231A9D4.o + Object asm/overlay_29_0231A9F8.o Object src/overlay_29_0231B194.o Object asm/overlay_29_0231B1B8.o + Object src/overlay_29_0231B318.o + Object asm/overlay_29_0231B33C.o Object src/overlay_29_0231CBC8.o Object asm/overlay_29_0231CBEC.o Object src/overlay_29_0231EDD8.o @@ -320,6 +334,8 @@ Overlay OVY_29 Object asm/overlay_29_02320788.o Object src/overlay_29_02321438.o Object asm/overlay_29_0232145C.o + Object src/overlay_29_02322DB8.o + Object asm/overlay_29_02322DDC.o Object src/overlay_29_02325620.o Object asm/overlay_29_02325644.o Object src/overlay_29_0232800C.o @@ -350,6 +366,8 @@ Overlay OVY_29 Object asm/overlay_29_02347BC8.o Object src/overlay_29_0234987C.o Object asm/overlay_29_023498A0.o + Object src/overlay_29_0234D460.o + Object asm/overlay_29_0234D484.o Object src/overlay_29_0234DDD0.o Object asm/overlay_29_0234DDF4.o Object src/overlay_29_0234EC14.o diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index 933d8697..b31ed8c7 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -1,7 +1,7 @@ #include "dungeon_pokemon_attributes.h" #include "dungeon_util.h" +#include "overlay_29_02301A60.h" -extern bool8 IsMonster__02301A60(struct entity *pokemon); extern bool8 NoGastroAcidStatus(struct entity *pokemon, enum ability_id ability); bool8 AbilityIsActive(struct entity *pokemon, enum ability_id ability) diff --git a/src/overlay_29_022F9720.c b/src/overlay_29_022F9720.c new file mode 100644 index 00000000..804f2a9d --- /dev/null +++ b/src/overlay_29_022F9720.c @@ -0,0 +1,9 @@ +#include "overlay_29_022F9720.h" + +bool8 IsMonster__022F9720(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} diff --git a/src/overlay_29_02301A60.c b/src/overlay_29_02301A60.c new file mode 100644 index 00000000..f55b5ee9 --- /dev/null +++ b/src/overlay_29_02301A60.c @@ -0,0 +1,9 @@ +#include "overlay_29_02301A60.h" + +bool8 IsMonster__02301A60(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} diff --git a/src/overlay_29_0230A994.c b/src/overlay_29_0230A994.c new file mode 100644 index 00000000..2e695d33 --- /dev/null +++ b/src/overlay_29_0230A994.c @@ -0,0 +1,9 @@ +#include "overlay_29_0230A994.h" + +bool8 IsMonster__0230A994(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} diff --git a/src/overlay_29_0230F980.c b/src/overlay_29_0230F980.c new file mode 100644 index 00000000..ddece016 --- /dev/null +++ b/src/overlay_29_0230F980.c @@ -0,0 +1,9 @@ +#include "overlay_29_0230F980.h" + +bool8 IsMonster__0230F980(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} diff --git a/src/overlay_29_02318AB0.c b/src/overlay_29_02318AB0.c new file mode 100644 index 00000000..ce574d8e --- /dev/null +++ b/src/overlay_29_02318AB0.c @@ -0,0 +1,9 @@ +#include "overlay_29_02318AB0.h" + +bool8 IsMonster__02318AB0(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} diff --git a/src/overlay_29_0231A9D4.c b/src/overlay_29_0231A9D4.c new file mode 100644 index 00000000..57a315b5 --- /dev/null +++ b/src/overlay_29_0231A9D4.c @@ -0,0 +1,9 @@ +#include "overlay_29_0231A9D4.h" + +bool8 IsMonster__0231A9D4(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} diff --git a/src/overlay_29_0231B318.c b/src/overlay_29_0231B318.c new file mode 100644 index 00000000..8ccdddb4 --- /dev/null +++ b/src/overlay_29_0231B318.c @@ -0,0 +1,9 @@ +#include "overlay_29_0231B318.h" + +bool8 IsMonster__0231B318(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} diff --git a/src/overlay_29_02322DB8.c b/src/overlay_29_02322DB8.c new file mode 100644 index 00000000..6ee0da53 --- /dev/null +++ b/src/overlay_29_02322DB8.c @@ -0,0 +1,9 @@ +#include "overlay_29_02322DB8.h" + +bool8 IsMonster__02322DB8(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} diff --git a/src/overlay_29_0234D460.c b/src/overlay_29_0234D460.c new file mode 100644 index 00000000..e8c97c86 --- /dev/null +++ b/src/overlay_29_0234D460.c @@ -0,0 +1,9 @@ +#include "overlay_29_0234D460.h" + +bool8 IsMonster__0234D460(struct entity *entity) +{ + if (entity == NULL) + return FALSE; + + return entity->type == ENTITY_MONSTER; +} From 47044429041af87ebafeb2c4b000897dfd91a48a Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sun, 1 Dec 2024 18:20:37 -0600 Subject: [PATCH 2/5] Decomped NoGastroAcidStatus --- asm/include/overlay_29_02301A84.inc | 1 - asm/overlay_29_02301A84.s | 17 ----------------- include/dg.h | 2 -- include/dg_camera.h | 2 -- include/dg_effect.h | 2 -- include/dg_object.h | 2 -- include/dg_uty.h | 2 -- include/dungeon_pokemon_attributes.h | 3 +++ include/enums.h | 1 + include/overlay_29_022EC608.h | 2 -- include/overlay_29_022ECDC0.h | 2 -- include/overlay_29_022EE348.h | 2 -- include/overlay_29_022EF7A0.h | 2 -- include/overlay_29_022F0590.h | 2 -- include/overlay_29_022F528C.h | 2 -- include/overlay_29_022F62A8.h | 2 -- include/overlay_29_022F7364.h | 2 -- include/overlay_29_022F9720.h | 1 + include/overlay_29_022FC99C.h | 2 -- include/overlay_29_022FED98.h | 2 -- include/overlay_29_023000E4.h | 2 -- include/overlay_29_02301A60.h | 1 + include/overlay_29_02302A38.h | 2 -- include/overlay_29_023047B8.h | 2 -- include/overlay_29_0230558C.h | 2 -- include/overlay_29_02305C04.h | 2 -- include/overlay_29_02307EF8.h | 2 -- include/overlay_29_0230827C.h | 2 -- include/overlay_29_02308FBC.h | 2 -- include/overlay_29_0230A994.h | 1 + include/overlay_29_0230E8F0.h | 2 -- include/overlay_29_0230F008.h | 2 -- include/overlay_29_0230F980.h | 1 + include/overlay_29_02311010.h | 2 -- include/overlay_29_023118B4.h | 2 -- include/overlay_29_02315118.h | 2 -- include/overlay_29_02318AB0.h | 1 + include/overlay_29_02318D34.h | 2 -- include/overlay_29_02318E4C.h | 2 -- include/overlay_29_02319F8C.h | 2 -- include/overlay_29_0231A9D4.h | 1 + include/overlay_29_0231B194.h | 2 -- include/overlay_29_0231B318.h | 1 + include/overlay_29_0231CBC8.h | 2 -- include/overlay_29_0231EDD8.h | 2 -- include/overlay_29_0231F570.h | 2 -- include/overlay_29_0231FBFC.h | 2 -- include/overlay_29_0232017C.h | 2 -- include/overlay_29_02320764.h | 2 -- include/overlay_29_02321438.h | 2 -- include/overlay_29_02322DB8.h | 1 + include/overlay_29_02325620.h | 2 -- include/overlay_29_0232800C.h | 2 -- include/overlay_29_0232A3D8.h | 2 -- include/overlay_29_0232C500.h | 2 -- include/overlay_29_0232E250.h | 2 -- include/overlay_29_0232E840.h | 2 -- include/overlay_29_02333FAC.h | 2 -- include/overlay_29_023350D8.h | 2 -- include/overlay_29_02337CA8.h | 2 -- include/overlay_29_02344AF8.h | 2 -- include/overlay_29_02345698.h | 2 -- include/overlay_29_02347BA4.h | 2 -- include/overlay_29_0234987C.h | 2 -- include/overlay_29_0234D460.h | 1 + include/overlay_29_0234DDD0.h | 2 -- include/overlay_29_0234EC14.h | 2 -- src/dungeon_pokemon_attributes.c | 11 ++++++++++- 68 files changed, 23 insertions(+), 127 deletions(-) diff --git a/asm/include/overlay_29_02301A84.inc b/asm/include/overlay_29_02301A84.inc index e801fec7..ae878d27 100644 --- a/asm/include/overlay_29_02301A84.inc +++ b/asm/include/overlay_29_02301A84.inc @@ -4,7 +4,6 @@ .public ExclusiveItemEffectIsActive__022FFF28 .public GetApparentWeather .public GetExclusiveItemWithEffectFromBag -.public IsMonster__02301A60 .public LogMessageByIdWithPopupCheckUserTarget .public MistIsActive .public SubstitutePlaceholderStringTags diff --git a/asm/overlay_29_02301A84.s b/asm/overlay_29_02301A84.s index 3354c7c2..ce621487 100644 --- a/asm/overlay_29_02301A84.s +++ b/asm/overlay_29_02301A84.s @@ -196,20 +196,3 @@ _02301CCC: mov r0, #0 ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} arm_func_end ov29_02301C2C - - arm_func_start NoGastroAcidStatus -NoGastroAcidStatus: ; 0x02301CDC - stmdb sp!, {r4, lr} - mov r4, r0 - bl IsMonster__02301A60 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #0xd8] - cmp r0, #4 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - arm_func_end NoGastroAcidStatus diff --git a/include/dg.h b/include/dg.h index d1d7e6ed..1243ab65 100644 --- a/include/dg.h +++ b/include/dg.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022E0354(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022E0354_H diff --git a/include/dg_camera.h b/include/dg_camera.h index 7c376ff7..4e45f85a 100644 --- a/include/dg_camera.h +++ b/include/dg_camera.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022E32E8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022E32E8_H diff --git a/include/dg_effect.h b/include/dg_effect.h index 6cfc1ca1..e7973f63 100644 --- a/include/dg_effect.h +++ b/include/dg_effect.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022E37B8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022E37B8_H diff --git a/include/dg_object.h b/include/dg_object.h index 430b4667..5ab58aa4 100644 --- a/include/dg_object.h +++ b/include/dg_object.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022E1A1C(struct entity *entity); void UpdateEntityPixelPos(struct entity *entity, struct pixel_position *pixel_pos); void SetEntityPixelPosXY(struct entity *entity, u32 x, u32 y); diff --git a/include/dg_uty.h b/include/dg_uty.h index e644c0f3..2ac6d78e 100644 --- a/include/dg_uty.h +++ b/include/dg_uty.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022E95F4(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022E95F4_H diff --git a/include/dungeon_pokemon_attributes.h b/include/dungeon_pokemon_attributes.h index 98a95505..1ae90a4c 100644 --- a/include/dungeon_pokemon_attributes.h +++ b/include/dungeon_pokemon_attributes.h @@ -3,6 +3,9 @@ #include "dungeon_mode.h" +// Checks if a monster does not have the Gastro Acid status. +bool8 NoGastroAcidStatus(struct entity *entity, enum ability_id ability); +// Checks if a monster has a certain ability that isn't disabled by Gastro Acid. bool8 AbilityIsActive(struct entity *pokemon, enum ability_id ability); #endif //PMDSKY_DUNGEON_POKEMON_ATTRIBUTES_H diff --git a/include/enums.h b/include/enums.h index 1e148e53..fecc21ce 100644 --- a/include/enums.h +++ b/include/enums.h @@ -3632,6 +3632,7 @@ enum status_id { #define CRINGE_STATUS_CONFUSED (STATUS_CONFUSED - STATUS_CRINGE + 1) // 2 #define CURSED_STATUS_DECOY (STATUS_DECOY - STATUS_CURSED + 1) // 2 +#define CURSED_STATUS_GASTRO_ACID (STATUS_GASTRO_ACID - STATUS_CURSED + 1) // 4 // Mission type on a floor enum mission_type { diff --git a/include/overlay_29_022EC608.h b/include/overlay_29_022EC608.h index d076c29c..527e6f93 100644 --- a/include/overlay_29_022EC608.h +++ b/include/overlay_29_022EC608.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022EC608(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022EC608_H diff --git a/include/overlay_29_022ECDC0.h b/include/overlay_29_022ECDC0.h index 0f82c01b..1dca1719 100644 --- a/include/overlay_29_022ECDC0.h +++ b/include/overlay_29_022ECDC0.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022ECDC0(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022ECDC0_H diff --git a/include/overlay_29_022EE348.h b/include/overlay_29_022EE348.h index 78695c3e..969507be 100644 --- a/include/overlay_29_022EE348.h +++ b/include/overlay_29_022EE348.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022EE348(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022EE348_H diff --git a/include/overlay_29_022EF7A0.h b/include/overlay_29_022EF7A0.h index c7ed8851..4c36012d 100644 --- a/include/overlay_29_022EF7A0.h +++ b/include/overlay_29_022EF7A0.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022EF7A0(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022EF7A0_H diff --git a/include/overlay_29_022F0590.h b/include/overlay_29_022F0590.h index 07607397..aa76a2d2 100644 --- a/include/overlay_29_022F0590.h +++ b/include/overlay_29_022F0590.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022F0590(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022F0590_H diff --git a/include/overlay_29_022F528C.h b/include/overlay_29_022F528C.h index d35cc361..078670fe 100644 --- a/include/overlay_29_022F528C.h +++ b/include/overlay_29_022F528C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022F528C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022F528C_H diff --git a/include/overlay_29_022F62A8.h b/include/overlay_29_022F62A8.h index a3d0aea9..374800ff 100644 --- a/include/overlay_29_022F62A8.h +++ b/include/overlay_29_022F62A8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022F62A8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022F62A8_H diff --git a/include/overlay_29_022F7364.h b/include/overlay_29_022F7364.h index 324a9744..afe17448 100644 --- a/include/overlay_29_022F7364.h +++ b/include/overlay_29_022F7364.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022F7364(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022F7364_H diff --git a/include/overlay_29_022F9720.h b/include/overlay_29_022F9720.h index 88dba24c..bf61f757 100644 --- a/include/overlay_29_022F9720.h +++ b/include/overlay_29_022F9720.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__022F9720(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022F9720_H diff --git a/include/overlay_29_022FC99C.h b/include/overlay_29_022FC99C.h index be002edd..69aabff3 100644 --- a/include/overlay_29_022FC99C.h +++ b/include/overlay_29_022FC99C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022FC99C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022FC99C_H diff --git a/include/overlay_29_022FED98.h b/include/overlay_29_022FED98.h index 43e87b4d..0b07eabc 100644 --- a/include/overlay_29_022FED98.h +++ b/include/overlay_29_022FED98.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__022FED98(struct entity *entity); #endif //PMDSKY_OVERLAY_29_022FED98_H diff --git a/include/overlay_29_023000E4.h b/include/overlay_29_023000E4.h index f79c851e..75e3e38c 100644 --- a/include/overlay_29_023000E4.h +++ b/include/overlay_29_023000E4.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__023000E4(struct entity *entity); #endif //PMDSKY_OVERLAY_29_023000E4_H diff --git a/include/overlay_29_02301A60.h b/include/overlay_29_02301A60.h index 57d10089..88bcc5d4 100644 --- a/include/overlay_29_02301A60.h +++ b/include/overlay_29_02301A60.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__02301A60(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02301A60_H diff --git a/include/overlay_29_02302A38.h b/include/overlay_29_02302A38.h index cb982494..d9819ae5 100644 --- a/include/overlay_29_02302A38.h +++ b/include/overlay_29_02302A38.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02302A38(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02302A38_H diff --git a/include/overlay_29_023047B8.h b/include/overlay_29_023047B8.h index 96139a7a..2836bee4 100644 --- a/include/overlay_29_023047B8.h +++ b/include/overlay_29_023047B8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__023047B8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_023047B8_H diff --git a/include/overlay_29_0230558C.h b/include/overlay_29_0230558C.h index cc4a9f9f..ded7f1c6 100644 --- a/include/overlay_29_0230558C.h +++ b/include/overlay_29_0230558C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0230558C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0230558C_H diff --git a/include/overlay_29_02305C04.h b/include/overlay_29_02305C04.h index 63a11c7d..ba403710 100644 --- a/include/overlay_29_02305C04.h +++ b/include/overlay_29_02305C04.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02305C04(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02305C04_H diff --git a/include/overlay_29_02307EF8.h b/include/overlay_29_02307EF8.h index cdc3f044..e70a63fa 100644 --- a/include/overlay_29_02307EF8.h +++ b/include/overlay_29_02307EF8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02307EF8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02307EF8_H diff --git a/include/overlay_29_0230827C.h b/include/overlay_29_0230827C.h index c663f4e9..b0fb5593 100644 --- a/include/overlay_29_0230827C.h +++ b/include/overlay_29_0230827C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0230827C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0230827C_H diff --git a/include/overlay_29_02308FBC.h b/include/overlay_29_02308FBC.h index cab2b17a..9a2f717d 100644 --- a/include/overlay_29_02308FBC.h +++ b/include/overlay_29_02308FBC.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02308FBC(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02308FBC_H diff --git a/include/overlay_29_0230A994.h b/include/overlay_29_0230A994.h index 1d5341ea..f9c67285 100644 --- a/include/overlay_29_0230A994.h +++ b/include/overlay_29_0230A994.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__0230A994(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0230A994_H diff --git a/include/overlay_29_0230E8F0.h b/include/overlay_29_0230E8F0.h index 756453b7..e1b78991 100644 --- a/include/overlay_29_0230E8F0.h +++ b/include/overlay_29_0230E8F0.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0230E8F0(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0230E8F0_H diff --git a/include/overlay_29_0230F008.h b/include/overlay_29_0230F008.h index 46096d7b..96ef0265 100644 --- a/include/overlay_29_0230F008.h +++ b/include/overlay_29_0230F008.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0230F008(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0230F008_H diff --git a/include/overlay_29_0230F980.h b/include/overlay_29_0230F980.h index 220f2de4..5329bd42 100644 --- a/include/overlay_29_0230F980.h +++ b/include/overlay_29_0230F980.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__0230F980(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0230F980_H diff --git a/include/overlay_29_02311010.h b/include/overlay_29_02311010.h index 0a639832..cabb9df3 100644 --- a/include/overlay_29_02311010.h +++ b/include/overlay_29_02311010.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02311010(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02311010_H diff --git a/include/overlay_29_023118B4.h b/include/overlay_29_023118B4.h index 23a5d4e4..1314790a 100644 --- a/include/overlay_29_023118B4.h +++ b/include/overlay_29_023118B4.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__023118B4(struct entity *entity); #endif //PMDSKY_OVERLAY_29_023118B4_H diff --git a/include/overlay_29_02315118.h b/include/overlay_29_02315118.h index fb15f0b0..3eab387a 100644 --- a/include/overlay_29_02315118.h +++ b/include/overlay_29_02315118.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02315118(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02315118_H diff --git a/include/overlay_29_02318AB0.h b/include/overlay_29_02318AB0.h index c242434b..b0911383 100644 --- a/include/overlay_29_02318AB0.h +++ b/include/overlay_29_02318AB0.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__02318AB0(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02318AB0_H diff --git a/include/overlay_29_02318D34.h b/include/overlay_29_02318D34.h index c1540e0f..520c59d0 100644 --- a/include/overlay_29_02318D34.h +++ b/include/overlay_29_02318D34.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02318D34(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02318D34_H diff --git a/include/overlay_29_02318E4C.h b/include/overlay_29_02318E4C.h index f0758f34..082631ed 100644 --- a/include/overlay_29_02318E4C.h +++ b/include/overlay_29_02318E4C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02318E4C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02318E4C_H diff --git a/include/overlay_29_02319F8C.h b/include/overlay_29_02319F8C.h index 3b241b79..e173ecda 100644 --- a/include/overlay_29_02319F8C.h +++ b/include/overlay_29_02319F8C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02319F8C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02319F8C_H diff --git a/include/overlay_29_0231A9D4.h b/include/overlay_29_0231A9D4.h index 923ffa89..b42b843c 100644 --- a/include/overlay_29_0231A9D4.h +++ b/include/overlay_29_0231A9D4.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__0231A9D4(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0231A9D4_H diff --git a/include/overlay_29_0231B194.h b/include/overlay_29_0231B194.h index cc260d7f..d9a4b8bd 100644 --- a/include/overlay_29_0231B194.h +++ b/include/overlay_29_0231B194.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0231B194(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0231B194_H diff --git a/include/overlay_29_0231B318.h b/include/overlay_29_0231B318.h index 6ab4d38c..4d2cd5a8 100644 --- a/include/overlay_29_0231B318.h +++ b/include/overlay_29_0231B318.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__0231B318(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0231B318_H diff --git a/include/overlay_29_0231CBC8.h b/include/overlay_29_0231CBC8.h index a6202563..ea4e4a67 100644 --- a/include/overlay_29_0231CBC8.h +++ b/include/overlay_29_0231CBC8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0231CBC8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0231CBC8_H diff --git a/include/overlay_29_0231EDD8.h b/include/overlay_29_0231EDD8.h index 6177c7c1..99c8ddf8 100644 --- a/include/overlay_29_0231EDD8.h +++ b/include/overlay_29_0231EDD8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0231EDD8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0231EDD8_H diff --git a/include/overlay_29_0231F570.h b/include/overlay_29_0231F570.h index 9c76cc10..0cec0cec 100644 --- a/include/overlay_29_0231F570.h +++ b/include/overlay_29_0231F570.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0231F570(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0231F570_H diff --git a/include/overlay_29_0231FBFC.h b/include/overlay_29_0231FBFC.h index 222aaa66..36aaa97c 100644 --- a/include/overlay_29_0231FBFC.h +++ b/include/overlay_29_0231FBFC.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0231FBFC(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0231FBFC_H diff --git a/include/overlay_29_0232017C.h b/include/overlay_29_0232017C.h index d239fa45..720eb982 100644 --- a/include/overlay_29_0232017C.h +++ b/include/overlay_29_0232017C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0232017C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0232017C_H diff --git a/include/overlay_29_02320764.h b/include/overlay_29_02320764.h index 2a48a3f3..d00913f5 100644 --- a/include/overlay_29_02320764.h +++ b/include/overlay_29_02320764.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02320764(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02320764_H diff --git a/include/overlay_29_02321438.h b/include/overlay_29_02321438.h index 72752e2c..7561e481 100644 --- a/include/overlay_29_02321438.h +++ b/include/overlay_29_02321438.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02321438(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02321438_H diff --git a/include/overlay_29_02322DB8.h b/include/overlay_29_02322DB8.h index 761242f1..e6b7268b 100644 --- a/include/overlay_29_02322DB8.h +++ b/include/overlay_29_02322DB8.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__02322DB8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02322DB8_H diff --git a/include/overlay_29_02325620.h b/include/overlay_29_02325620.h index 749863f6..6ae17aa6 100644 --- a/include/overlay_29_02325620.h +++ b/include/overlay_29_02325620.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02325620(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02325620_H diff --git a/include/overlay_29_0232800C.h b/include/overlay_29_0232800C.h index d629c338..ee27cb5b 100644 --- a/include/overlay_29_0232800C.h +++ b/include/overlay_29_0232800C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValidMoveEffects__0232800C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0232800C_H diff --git a/include/overlay_29_0232A3D8.h b/include/overlay_29_0232A3D8.h index 3ef95bc8..be637cac 100644 --- a/include/overlay_29_0232A3D8.h +++ b/include/overlay_29_0232A3D8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValidMoveEffects__0232A3D8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0232A3D8_H diff --git a/include/overlay_29_0232C500.h b/include/overlay_29_0232C500.h index 9de2c69f..5b6a5423 100644 --- a/include/overlay_29_0232C500.h +++ b/include/overlay_29_0232C500.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValidMoveEffects__0232C500(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0232C500_H diff --git a/include/overlay_29_0232E250.h b/include/overlay_29_0232E250.h index e0cb7dd2..27d0a03d 100644 --- a/include/overlay_29_0232E250.h +++ b/include/overlay_29_0232E250.h @@ -5,8 +5,6 @@ #include "dungeon_mode_common.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValidMoveEffects__0232E250(struct entity *entity); // Move effect: Defend Order // attacker: attacker pointer diff --git a/include/overlay_29_0232E840.h b/include/overlay_29_0232E840.h index a296b330..c4b54143 100644 --- a/include/overlay_29_0232E840.h +++ b/include/overlay_29_0232E840.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0232E840(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0232E840_H diff --git a/include/overlay_29_02333FAC.h b/include/overlay_29_02333FAC.h index 7f4efca2..052c5fce 100644 --- a/include/overlay_29_02333FAC.h +++ b/include/overlay_29_02333FAC.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02333FAC(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02333FAC_H diff --git a/include/overlay_29_023350D8.h b/include/overlay_29_023350D8.h index 0c85c445..a1aa5a9b 100644 --- a/include/overlay_29_023350D8.h +++ b/include/overlay_29_023350D8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__023350D8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_023350D8_H diff --git a/include/overlay_29_02337CA8.h b/include/overlay_29_02337CA8.h index 90852104..d3a4998e 100644 --- a/include/overlay_29_02337CA8.h +++ b/include/overlay_29_02337CA8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02337CA8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02337CA8_H diff --git a/include/overlay_29_02344AF8.h b/include/overlay_29_02344AF8.h index 94930e82..b93b5123 100644 --- a/include/overlay_29_02344AF8.h +++ b/include/overlay_29_02344AF8.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02344AF8(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02344AF8_H diff --git a/include/overlay_29_02345698.h b/include/overlay_29_02345698.h index 511943e4..9582fb4d 100644 --- a/include/overlay_29_02345698.h +++ b/include/overlay_29_02345698.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02345698(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02345698_H diff --git a/include/overlay_29_02347BA4.h b/include/overlay_29_02347BA4.h index ac8dfe36..efb091b7 100644 --- a/include/overlay_29_02347BA4.h +++ b/include/overlay_29_02347BA4.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__02347BA4(struct entity *entity); #endif //PMDSKY_OVERLAY_29_02347BA4_H diff --git a/include/overlay_29_0234987C.h b/include/overlay_29_0234987C.h index 801e8923..12b0b74f 100644 --- a/include/overlay_29_0234987C.h +++ b/include/overlay_29_0234987C.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0234987C(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0234987C_H diff --git a/include/overlay_29_0234D460.h b/include/overlay_29_0234D460.h index c4b54399..e5778a81 100644 --- a/include/overlay_29_0234D460.h +++ b/include/overlay_29_0234D460.h @@ -3,6 +3,7 @@ #include "dungeon_mode.h" +// Checks if an entity is a monster (entity type 1). bool8 IsMonster__0234D460(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0234D460_H diff --git a/include/overlay_29_0234DDD0.h b/include/overlay_29_0234DDD0.h index 2b6bf1a8..a38be47c 100644 --- a/include/overlay_29_0234DDD0.h +++ b/include/overlay_29_0234DDD0.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0234DDD0(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0234DDD0_H diff --git a/include/overlay_29_0234EC14.h b/include/overlay_29_0234EC14.h index 9b33f642..c3d2d67a 100644 --- a/include/overlay_29_0234EC14.h +++ b/include/overlay_29_0234EC14.h @@ -4,8 +4,6 @@ #include "dungeon_mode.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -// entity: entity pointer -// return: bool bool8 EntityIsValid__0234EC14(struct entity *entity); #endif //PMDSKY_OVERLAY_29_0234EC14_H diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index b31ed8c7..daad3eab 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -2,7 +2,16 @@ #include "dungeon_util.h" #include "overlay_29_02301A60.h" -extern bool8 NoGastroAcidStatus(struct entity *pokemon, enum ability_id ability); +bool8 NoGastroAcidStatus(struct entity *entity, enum ability_id ability) +{ + if (!IsMonster__02301A60(entity)) + return FALSE; + + if (GetEntInfo(entity)->curse_class_status.curse == CURSED_STATUS_GASTRO_ACID) + return FALSE; + + return TRUE; +} bool8 AbilityIsActive(struct entity *pokemon, enum ability_id ability) { From 8651de04255dc6592b720503f4932251cf6bd810 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sun, 1 Dec 2024 18:32:08 -0600 Subject: [PATCH 3/5] Decomped IsTacticSet --- asm/include/overlay_29_02301D78.inc | 52 -- asm/include/overlay_29_02301F50.inc | 58 ++ asm/overlay_29_02301D78.s | 868 ------------------------- asm/overlay_29_02301F50.s | 854 ++++++++++++++++++++++++ include/dungeon_ai_targeting.h | 1 - include/dungeon_mode.h | 2 +- include/dungeon_pokemon_attributes_1.h | 8 + main.lsf | 2 + src/dungeon_ai_targeting.c | 3 +- src/dungeon_pokemon_attributes_1.c | 11 + 10 files changed, 935 insertions(+), 924 deletions(-) create mode 100644 asm/include/overlay_29_02301F50.inc create mode 100644 asm/overlay_29_02301F50.s create mode 100644 include/dungeon_pokemon_attributes_1.h create mode 100644 src/dungeon_pokemon_attributes_1.c diff --git a/asm/include/overlay_29_02301D78.inc b/asm/include/overlay_29_02301D78.inc index 60f1ee0c..4c90d21b 100644 --- a/asm/include/overlay_29_02301D78.inc +++ b/asm/include/overlay_29_02301D78.inc @@ -1,60 +1,8 @@ #pragma once .public AbilityIsActive -.public AllocateTemp1024ByteBufferFromPool -.public CanLearnIqSkill -.public CanSeeTarget -.public CanThrowItems .public DUNGEON_PTR .public DefenderAbilityIsActive__02301A0C -.public DisableIqSkill -.public DungeonGetSpriteIndex -.public DungeonRandInt -.public EXCLUSIVE_ITEM_EXP_BOOST -.public EXP_ELITE_EXP_BOOST -.public EnableIqSkill .public EntityIsValid__023000E4 -.public EntityIsValid__02302A38 -.public EvolveMonster -.public ExclusiveItemEffectFlagTest -.public ExclusiveItemEffectIsActive__022FFF28 -.public GetEntityNaturalGiftInfo -.public GetEntityWeatherBallType -.public GetEvolutions -.public GetExclusiveItemWithEffectFromBag -.public GetForcedLossReason -.public GetMoveBasePower -.public GetMoveType -.public GetPerformanceFlagWithChecks -.public GetSpeciesIqSkill -.public GetUnlockedTacticFlags .public GravityIsActive -.public HasHeldItem -.public IqSkillFlagTest -.public IsBlinded -.public IsExpEnabledInDungeon -.public IsExperienceLocked -.public IsOnMonsterSpawnList -.public IsRegularAttackOrProjectile .public ItemIsActive__022FF898 -.public LeafGuardIsActive -.public LevelUp -.public LogMessageByIdWithPopup -.public LogMessageByIdWithPopupCheckUserTarget -.public MIN_IQ_EXCLUSIVE_MOVE_USER -.public MIN_IQ_ITEM_MASTER -.public MIRACLE_CHEST_EXP_BOOST -.public MultiplyByFixedPoint -.public SubstitutePlaceholderStringTags -.public WONDER_CHEST_EXP_BOOST -.public _s32_div_f -.public ov29_022E2470 .public ov29_022FAFD4 -.public ov29_022FBDE0 -.public ov29_0230040C -.public ov29_02301A84 -.public ov29_02302C04 -.public ov29_02302CC8 -.public ov29_02344B44 -.public ov29_0234B034 -.public ov29_0234B09C -.public ov29_023527F8 diff --git a/asm/include/overlay_29_02301F50.inc b/asm/include/overlay_29_02301F50.inc new file mode 100644 index 00000000..5ddda830 --- /dev/null +++ b/asm/include/overlay_29_02301F50.inc @@ -0,0 +1,58 @@ +#pragma once +.public AbilityIsActive +.public AbilityIsActiveVeneer +.public AllocateTemp1024ByteBufferFromPool +.public CanLearnIqSkill +.public CanSeeTarget +.public CanThrowItems +.public DUNGEON_PTR +.public DisableIqSkill +.public DungeonGetSpriteIndex +.public DungeonRandInt +.public EXCLUSIVE_ITEM_EXP_BOOST +.public EXP_ELITE_EXP_BOOST +.public EnableIqSkill +.public EntityIsValid__023000E4 +.public EntityIsValid__02302A38 +.public EvolveMonster +.public ExclusiveItemEffectFlagTest +.public ExclusiveItemEffectIsActive__022FFF28 +.public GetEntityNaturalGiftInfo +.public GetEntityWeatherBallType +.public GetEvolutions +.public GetExclusiveItemWithEffectFromBag +.public GetForcedLossReason +.public GetMoveBasePower +.public GetMoveType +.public GetPerformanceFlagWithChecks +.public GetSpeciesIqSkill +.public GetUnlockedTacticFlags +.public HasHeldItem +.public IqSkillFlagTest +.public IsBlinded +.public IsExpEnabledInDungeon +.public IsExperienceLocked +.public IsOnMonsterSpawnList +.public IsRegularAttackOrProjectile +.public ItemIsActive__022FF898 +.public LeafGuardIsActive +.public LevelUp +.public LogMessageByIdWithPopup +.public LogMessageByIdWithPopupCheckUserTarget +.public MIN_IQ_EXCLUSIVE_MOVE_USER +.public MIN_IQ_ITEM_MASTER +.public MIRACLE_CHEST_EXP_BOOST +.public MultiplyByFixedPoint +.public SubstitutePlaceholderStringTags +.public WONDER_CHEST_EXP_BOOST +.public _s32_div_f +.public ov29_022E2470 +.public ov29_022FBDE0 +.public ov29_0230040C +.public ov29_02301A84 +.public ov29_02302C04 +.public ov29_02302CC8 +.public ov29_02344B44 +.public ov29_0234B034 +.public ov29_0234B09C +.public ov29_023527F8 diff --git a/asm/overlay_29_02301D78.s b/asm/overlay_29_02301D78.s index f465717b..94fc9eee 100644 --- a/asm/overlay_29_02301D78.s +++ b/asm/overlay_29_02301D78.s @@ -183,871 +183,3 @@ CanSeeInvisibleMonsters: ; 0x02301EEC and r0, r0, #0xff ldmia sp!, {r3, pc} arm_func_end CanSeeInvisibleMonsters - - arm_func_start IsTacticSet -IsTacticSet: ; 0x02301F20 - ldr r2, [r0, #0xb4] - ldrb r0, [r2, #7] - cmp r0, #0 - beq _02301F38 - cmp r1, #1 - b _02301F40 -_02301F38: - ldrb r0, [r2, #0xa8] - cmp r0, r1 -_02301F40: - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end IsTacticSet - - arm_func_start HasDropeyeStatus -HasDropeyeStatus: ; 0x02301F50 - stmdb sp!, {r4, lr} - mov r4, r0 - bl EntityIsValid__023000E4 - cmp r0, #0 - beq _02301F78 - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #0xf1] - cmp r0, #4 - moveq r0, #1 - ldmeqia sp!, {r4, pc} -_02301F78: - mov r0, #0 - ldmia sp!, {r4, pc} - arm_func_end HasDropeyeStatus - - arm_func_start IqSkillIsEnabled -IqSkillIsEnabled: ; 0x02301F80 - stmdb sp!, {r3, lr} - ldr r2, [r0, #0xb4] - ldrb r0, [r2, #6] - cmp r0, #0 - bne _02301FAC - ldr r0, _02301FB8 ; =DUNGEON_PTR - ldr r0, [r0] - ldrb r0, [r0, #0x12] - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, pc} -_02301FAC: - add r0, r2, #0x9c - bl IqSkillFlagTest - ldmia sp!, {r3, pc} - .align 2, 0 -_02301FB8: .word DUNGEON_PTR - arm_func_end IqSkillIsEnabled - - arm_func_start UpdateIqSkills -UpdateIqSkills: ; 0x02301FBC - stmdb sp!, {r4, r5, r6, lr} - mov r4, r0 - ldrb r0, [r4, #6] - mov r6, #0 - cmp r0, #0 - str r6, [r4, #0x9c] - beq _02302118 - str r6, [r4, #0xa0] - str r6, [r4, #0xa4] - b _0230202C -_02301FE4: - ldrsh r0, [r4, #2] - and r1, r6, #0xff - bl GetSpeciesIqSkill - mov r5, r0 - cmp r5, #0xff - beq _02302034 - ldrsh r0, [r4, #0xe] - mov r1, r5 - bl CanLearnIqSkill - cmp r0, #0 - beq _02302028 - mov r1, r5 - add r0, r4, #0x90 - bl EnableIqSkill - mov r1, r5 - add r0, r4, #0x9c - bl EnableIqSkill -_02302028: - add r6, r6, #1 -_0230202C: - cmp r6, #0x19 - blt _02301FE4 -_02302034: - ldr r0, _023021E8 ; =MIN_IQ_EXCLUSIVE_MOVE_USER - ldrsh r1, [r4, #0xe] - ldrsh r0, [r0] - cmp r1, r0 - bge _02302068 - add r0, r4, #0x9c - mov r1, #0x17 - bl IqSkillFlagTest - cmp r0, #0 - beq _02302068 - add r0, r4, #0x9c - mov r1, #0x17 - bl DisableIqSkill -_02302068: - mov r0, r4 - bl ov29_022FBDE0 - cmp r0, #0 - bne _0230208C - ldr r0, _023021EC ; =MIN_IQ_ITEM_MASTER - ldrsh r1, [r4, #0xe] - ldrsh r0, [r0] - cmp r1, r0 - bge _023020AC -_0230208C: - add r0, r4, #0x9c - mov r1, #0x16 - bl IqSkillFlagTest - cmp r0, #0 - beq _023020AC - add r0, r4, #0x9c - mov r1, #0x16 - bl DisableIqSkill -_023020AC: - add r0, r4, #0x9c - mov r1, #0x15 - bl IqSkillFlagTest - cmp r0, #0 - beq _023020CC - add r0, r4, #0x9c - mov r1, #0x15 - bl DisableIqSkill -_023020CC: - add r0, r4, #0x9c - mov r1, #0x14 - bl IqSkillFlagTest - cmp r0, #0 - beq _023020EC - add r0, r4, #0x9c - mov r1, #0x14 - bl DisableIqSkill -_023020EC: - add r0, r4, #0x9c - mov r1, #0xb - bl IqSkillFlagTest - cmp r0, #0 - beq _0230210C - add r0, r4, #0x9c - mov r1, #0xb - bl DisableIqSkill -_0230210C: - mov r0, #2 - strb r0, [r4, #0xa8] - ldmia sp!, {r4, r5, r6, pc} -_02302118: - str r6, [r4, #0xa0] - str r6, [r4, #0xa4] - b _02302174 -_02302124: - ldrsh r0, [r4, #2] - and r1, r6, #0xff - bl GetSpeciesIqSkill - mov r5, r0 - cmp r5, #0xff - beq _0230217C - ldrsh r0, [r4, #0xe] - mov r1, r5 - bl CanLearnIqSkill - cmp r0, #0 - beq _02302170 - mov r1, r5 - add r0, r4, #0x90 - bl IqSkillFlagTest - cmp r0, #0 - beq _02302170 - mov r1, r5 - add r0, r4, #0x9c - bl EnableIqSkill -_02302170: - add r6, r6, #1 -_02302174: - cmp r6, #0x19 - blt _02302124 -_0230217C: - mov r0, #3 - bl GetPerformanceFlagWithChecks - cmp r0, #0 - beq _023021A4 - add r0, r4, #0x90 - mov r1, #0x18 - bl EnableIqSkill - add r0, r4, #0x9c - mov r1, #0x18 - bl EnableIqSkill -_023021A4: - add r0, r4, #0x90 - mov r1, #0x38 - bl IqSkillFlagTest - cmp r0, #0 - beq _023021C4 - add r0, r4, #0x9c - mov r1, #0x38 - bl EnableIqSkill -_023021C4: - add r0, r4, #0x90 - mov r1, #0x39 - bl IqSkillFlagTest - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - add r0, r4, #0x9c - mov r1, #0x39 - bl EnableIqSkill - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_023021E8: .word MIN_IQ_EXCLUSIVE_MOVE_USER -_023021EC: .word MIN_IQ_ITEM_MASTER - arm_func_end UpdateIqSkills - - arm_func_start ov29_023021F0 -ov29_023021F0: ; 0x023021F0 - ldr ip, _023021FC ; =UpdateIqSkills - ldr r0, [r0, #0xb4] - bx ip - .align 2, 0 -_023021FC: .word UpdateIqSkills - arm_func_end ov29_023021F0 - - arm_func_start ov29_02302200 -ov29_02302200: ; 0x02302200 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r4, r0 - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #6] - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - mov r6, #0 - ldr r5, _02302278 ; =DUNGEON_PTR - b _02302268 -_02302228: - ldr r1, [r5] - mov r0, r4 - add r1, r1, r6, lsl #2 - add r1, r1, #0x12000 -#ifdef JAPAN - ldr r7, [r1, #0xa84] -#else - ldr r7, [r1, #0xb28] -#endif - bl EntityIsValid__023000E4 - cmp r0, #0 - cmpne r4, r7 - beq _02302264 - mov r0, r4 - mov r1, r7 - bl CanSeeTarget - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} -_02302264: - add r6, r6, #1 -_02302268: - cmp r6, #4 - blt _02302228 - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_02302278: .word DUNGEON_PTR - arm_func_end ov29_02302200 - - arm_func_start GetMoveTypeForMonster -GetMoveTypeForMonster: ; 0x0230227C - stmdb sp!, {r3, r4, r5, lr} - mov r4, r1 - mov r5, r0 - ldrh r0, [r4, #4] - bl IsRegularAttackOrProjectile - cmp r0, #0 - bne _023022C0 - mov r0, r5 - bl EntityIsValid__023000E4 - cmp r0, #0 - beq _023022C0 - mov r0, r5 - mov r1, #0x6b - bl AbilityIsActive - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, pc} -_023022C0: - ldrh r1, [r4, #4] - cmp r1, #0x144 - ldreq r0, [r5, #0xb4] - ldreqb r0, [r0, #0x46] - ldmeqia sp!, {r3, r4, r5, pc} - ldr r0, _02302318 ; =0x000001D7 - cmp r1, r0 - bne _023022F4 - mov r0, r5 - bl GetEntityNaturalGiftInfo - cmp r0, #0 - ldrneb r0, [r0, #2] - ldmneia sp!, {r3, r4, r5, pc} -_023022F4: - ldrh r0, [r4, #4] - cmp r0, #0x1f - bne _0230230C - mov r0, r5 - bl GetEntityWeatherBallType - ldmia sp!, {r3, r4, r5, pc} -_0230230C: - mov r0, r4 - bl GetMoveType - ldmia sp!, {r3, r4, r5, pc} - .align 2, 0 -_02302318: .word 0x000001D7 - arm_func_end GetMoveTypeForMonster - - arm_func_start GetMovePower -GetMovePower: ; 0x0230231C - stmdb sp!, {r3, r4, r5, lr} - ldrh r2, [r1, #4] - mov r5, r0 - ldrb r4, [r1, #7] - cmp r2, #0x144 - ldreq r0, [r5, #0xb4] - ldreqsh r0, [r0, #0x44] - addeq r0, r4, r0 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, r1 - bl GetMoveBasePower - add r4, r4, r0 - mov r0, r5 - mov r1, #0x2b - bl ItemIsActive__022FF898 - cmp r0, #0 - movne r4, r4, lsl #1 - mov r0, r4 - ldmia sp!, {r3, r4, r5, pc} - arm_func_end GetMovePower - - arm_func_start MonsterCanThrowItems -MonsterCanThrowItems: ; 0x02302368 - stmdb sp!, {r3, lr} - ldrsh r0, [r0, #2] - bl CanThrowItems - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, pc} - arm_func_end MonsterCanThrowItems - - arm_func_start ov29_02302388 -ov29_02302388: ; 0x02302388 - stmdb sp!, {r4, lr} - mov r4, r0 - bl EntityIsValid__023000E4 - cmp r0, #0 - ldrne r0, [r4, #0xb4] - ldrneb r1, [r0, #0xbc] - cmpne r1, #7 - beq _023023B8 - bl IsExperienceLocked - cmp r0, #0 - moveq r0, #1 - ldmeqia sp!, {r4, pc} -_023023B8: - mov r0, #0 - ldmia sp!, {r4, pc} - arm_func_end ov29_02302388 - - arm_func_start UpdateStateFlags -UpdateStateFlags: ; 0x023023C0 -#ifdef JAPAN -#define UPDATE_STATE_FLAGS_OFFSET -4 -#else -#define UPDATE_STATE_FLAGS_OFFSET 0 -#endif - stmdb sp!, {r3, lr} - add r3, r0, #0x100 - ldrh ip, [r3, #0x58 + UPDATE_STATE_FLAGS_OFFSET] - tst ip, r1 - ldrneh ip, [r3, #0x5a + UPDATE_STATE_FLAGS_OFFSET] - ldreqh lr, [r3, #0x5a + UPDATE_STATE_FLAGS_OFFSET] - orrne ip, ip, r1 - mvneq ip, r1 - andeq ip, lr, ip - cmp r2, #0 - add r2, r0, #0x100 - strh ip, [r3, #0x5a + UPDATE_STATE_FLAGS_OFFSET] - ldrneh r3, [r2, #0x58 + UPDATE_STATE_FLAGS_OFFSET] - ldreqh ip, [r2, #0x58 + UPDATE_STATE_FLAGS_OFFSET] - add r0, r0, #0x100 - orrne r3, r3, r1 - mvneq r3, r1 - andeq r3, ip, r3 - strh r3, [r2, #0x58 + UPDATE_STATE_FLAGS_OFFSET] - ldrh r2, [r0, #0x5a + UPDATE_STATE_FLAGS_OFFSET] - tst r2, r1 - bne _02302428 - ldrh r0, [r0, #0x58 + UPDATE_STATE_FLAGS_OFFSET] - tst r0, r1 - movne r0, #1 - ldmneia sp!, {r3, pc} -_02302428: - mov r0, #0 - ldmia sp!, {r3, pc} - arm_func_end UpdateStateFlags - - arm_func_start IsProtectedFromNegativeStatus -IsProtectedFromNegativeStatus: ; 0x02302430 - stmdb sp!, {r4, r5, r6, lr} - sub sp, sp, #8 - mov r6, r0 - mov r5, r1 - mov r4, r2 - bl LeafGuardIsActive - cmp r0, #0 - movne r0, #1 - bne _023024D4 - mov r0, r5 - mov r1, #0x59 - bl ExclusiveItemEffectIsActive__022FFF28 - cmp r0, #0 - beq _023024B4 - cmp r4, #0 - beq _023024AC - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - add r2, sp, #0 - mov r0, r5 - mov r1, #0x59 - bl GetExclusiveItemWithEffectFromBag - add r1, sp, #0 - mov r0, #1 - bl ov29_02344B44 - ldr r2, _023024DC ; =0x00000C39 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_023024AC: - mov r0, #1 - b _023024D4 -_023024B4: - mov r0, r6 - mov r1, r5 - mov r2, r4 - bl ov29_02301A84 - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff -_023024D4: - add sp, sp, #8 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_023024DC: .word 0x00000978 -#else -_023024DC: .word 0x00000C39 -#endif - arm_func_end IsProtectedFromNegativeStatus - - arm_func_start ov29_023024E0 -ov29_023024E0: ; 0x023024E0 - stmdb sp!, {r3, r4, r5, lr} - mov r4, r1 - mov r1, #7 - mov r5, r0 - bl IqSkillIsEnabled - cmp r0, #0 - bne _02302534 - cmp r4, #0 - beq _02302518 - mov r0, r5 - mov r1, #1 - bl IsBlinded - cmp r0, #0 - bne _0230252C -_02302518: - ldr r0, [r5, #0xb4] - ldrb r0, [r0, #0xd0] - cmp r0, #2 - cmpne r0, #4 - bne _02302534 -_0230252C: - mov r0, #1 - ldmia sp!, {r3, r4, r5, pc} -_02302534: - mov r0, #0 - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_023024E0 - - arm_func_start AddExpSpecial -AddExpSpecial: ; 0x0230253C -#ifdef JAPAN -#define ADD_EXP_SPECIAL_OFFSET -4 -#else -#define ADD_EXP_SPECIAL_OFFSET 0 -#endif - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r1 - ldr r5, [r7, #0xb4] - mov r6, r2 - mov r0, r5 - bl IsExperienceLocked - cmp r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - ldrb r0, [r5, #0xa] - cmp r0, #0x64 - bne _02302580 - cmp r6, #0 - ldrgt r0, _023026B4 ; =DUNGEON_PTR - movgt r1, #1 - ldrgt r0, [r0] - strgtb r1, [r0, #0xf] - ldmia sp!, {r3, r4, r5, r6, r7, pc} -_02302580: - ldr r2, [r5, #0x20] - mov r0, r7 - mov r1, #0x1c - add r4, r2, r6 - bl IqSkillIsEnabled - cmp r0, #0 - beq _023025C0 - ldr r0, _023026B8 ; =EXP_ELITE_EXP_BOOST - mov r1, #0x64 - ldrsh r0, [r0] - mov r0, r0, lsl #8 - bl _s32_div_f - mov r1, r0 - mov r0, r6, lsl #8 - bl MultiplyByFixedPoint - add r4, r4, r0, asr #8 -_023025C0: - mov r0, r7 - mov r1, #0x43 - bl ItemIsActive__023026CC - cmp r0, #0 - beq _023025F8 - ldr r0, _023026BC ; =WONDER_CHEST_EXP_BOOST - mov r1, #0x64 - ldrsh r0, [r0] - mov r0, r0, lsl #8 - bl _s32_div_f - mov r1, r0 - mov r0, r6, lsl #8 - bl MultiplyByFixedPoint - add r4, r4, r0, asr #8 -_023025F8: - mov r0, r7 - mov r1, #0x42 - bl ItemIsActive__023026CC - cmp r0, #0 - beq _02302630 - ldr r0, _023026C0 ; =MIRACLE_CHEST_EXP_BOOST - mov r1, #0x64 - ldrsh r0, [r0] - mov r0, r0, lsl #8 - bl _s32_div_f - mov r1, r0 - mov r0, r6, lsl #8 - bl MultiplyByFixedPoint - add r4, r4, r0, asr #8 -_02302630: - ldr r1, [r7, #0xb4] - ldrb r0, [r1, #6] - cmp r0, #0 - movne r0, #0 - bne _02302650 - add r0, r1, #0x228 + ADD_EXP_SPECIAL_OFFSET - mov r1, #0x4f - bl ExclusiveItemEffectFlagTest -_02302650: - cmp r0, #0 - beq _0230267C - ldr r0, _023026C4 ; =EXCLUSIVE_ITEM_EXP_BOOST - mov r1, #0x64 - ldrsh r0, [r0] - mov r0, r0, lsl #8 - bl _s32_div_f - mov r1, r0 - mov r0, r6, lsl #8 - bl MultiplyByFixedPoint - add r4, r4, r0, asr #8 -_0230267C: - ldr r0, _023026C8 ; =0x0098967F - cmp r4, r0 - movge r4, r0 - ldr r0, [r5, #0x20] - subs r2, r4, r0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - ldr r1, [r5, #0x214 + ADD_EXP_SPECIAL_OFFSET] - ldr r0, _023026B4 ; =DUNGEON_PTR - add r1, r1, r2 - str r1, [r5, #0x214 + ADD_EXP_SPECIAL_OFFSET] - ldr r0, [r0] - mov r1, #1 - strb r1, [r0, #0xf] - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_023026B4: .word DUNGEON_PTR -_023026B8: .word EXP_ELITE_EXP_BOOST -_023026BC: .word WONDER_CHEST_EXP_BOOST -_023026C0: .word MIRACLE_CHEST_EXP_BOOST -_023026C4: .word EXCLUSIVE_ITEM_EXP_BOOST -_023026C8: .word 0x0098967F - arm_func_end AddExpSpecial - - arm_func_start ItemIsActive__023026CC -ItemIsActive__023026CC: ; 0x023026CC - stmdb sp!, {r3, r4, r5, lr} - mov r4, r1 - mov r1, #0x6f - mov r5, r0 - bl AbilityIsActiveVeneer - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - mov r0, r5 - mov r1, r4 - bl HasHeldItem - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ItemIsActive__023026CC - - arm_func_start EnemyEvolution -EnemyEvolution: ; 0x023026FC -#ifdef JAPAN -#define ENEMY_EVOLUTION_OFFSET -4 -#else -#define ENEMY_EVOLUTION_OFFSET 0 -#endif - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x168 - mov sl, r0 - bl AllocateTemp1024ByteBufferFromPool - ldr r0, _02302A28 ; =DUNGEON_PTR - ldr r2, [r0] - ldrb r1, [r2, #0xf] - ldrb r0, [r2, #0x748] - cmp r1, #0 - str r0, [sp, #8] - beq _02302A20 - mov r0, #0 - strb r0, [r2, #0xf] - bl GetForcedLossReason - cmp r0, #0 - bne _02302A20 - mov r0, sl - bl EntityIsValid__02302A38 - cmp r0, #0 - bne _02302758 - add r0, sp, #0xb0 - bl ov29_022E2470 - add sl, sp, #0xb0 -_02302758: - ldr r0, _02302A2C ; =ov29_023527F8 - mov r4, #0 - ldr r3, [r0] - ldr r2, [r0, #4] - ldr r1, [r0, #8] - ldr r0, [r0, #0xc] - str r3, [sp, #0x14] - str r2, [sp, #0x18] - str r1, [sp, #0xc] - str r0, [sp, #0x10] -_02302780: - ldr r0, _02302A28 ; =DUNGEON_PTR - ldr r3, [sp, #0x14] - ldr r0, [r0] - ldr r2, [sp, #0x18] - add r0, r0, r4, lsl #2 - add r0, r0, #0x12000 -#ifdef JAPAN - ldr r5, [r0, #0xad4] -#else - ldr r5, [r0, #0xb78] -#endif - ldr r1, [sp, #0xc] - ldr r0, [sp, #0x10] - mov r6, #0 - str r6, [sp, #4] - str r3, [sp, #0x24] - str r2, [sp, #0x28] - str r1, [sp, #0x1c] - str r0, [sp, #0x20] - cmp r5, #0 - beq _02302A14 - mov r0, r5 - bl EntityIsValid__02302A38 - cmp r0, #0 - ldrne sb, [r5, #0xb4] - ldrnesh r0, [sb, #0x10] - cmpne r0, #0 - beq _02302A14 - ldrb r0, [sb, #0x102] - cmp r0, #0 - movne r0, r6 - strneb r0, [sb, #0x102] - bne _02302A08 - ldr fp, [sb, #0x214 + ENEMY_EVOLUTION_OFFSET] - cmp fp, #0 - beq _023028C4 - ldrb r0, [sb, #7] - cmp r0, #0 - beq _02302818 - ldrb r1, [sb, #0xa] - add r0, sp, #0x54 - bl GetUnlockedTacticFlags -_02302818: - ldrsh r2, [sb, #0x12] - ldrsh r0, [sb, #0x16] - ldrb r7, [sb, #0x1a] - ldr r1, _02302A30 ; =0x000003E7 - add r0, r2, r0 - ldrb r3, [sb, #0x1b] - ldrb r2, [sb, #0x1c] - str r0, [sp, #4] - cmp r0, r1 - strgt r1, [sp, #4] - ldrb r1, [sb, #0x1d] - ldrb r0, [sb, #0xa] - str r7, [sp, #0x24] - str r3, [sp, #0x28] - str r2, [sp, #0x1c] - str r1, [sp, #0x20] - cmp r0, #0x64 - beq _023028C4 - ldr r0, [sp, #8] - bl IsExpEnabledInDungeon - cmp r0, #0 - beq _023028C4 - ldr r0, [sb, #0x20] - mov r1, fp - add r2, r0, fp - mov r0, #0 - str r2, [sb, #0x20] - bl ov29_0234B09C - bl ov29_0234B034 - mov r1, #0 - str r1, [sp] - mov r2, sb - mov r3, r1 - bl ov29_0230040C - mov r0, sl - ldr r1, _02302A34 ; =0x00000F1F - bl LogMessageByIdWithPopup - mov r0, sl - mov r1, r5 - mov r2, #1 - mov r3, r2 - bl LevelUp - orr r6, r6, r0 -_023028C4: - ldrb r0, [sb, #0x153 + ENEMY_EVOLUTION_OFFSET] - cmp r0, #0 - beq _02302968 - ldrsh r0, [sb, #2] - mov r2, #0 - add r1, sp, #0x2c - mov r3, r2 - bl GetEvolutions - movs r6, r0 - beq _02302964 - bl DungeonRandInt - mov r8, r0 - mov r7, #0 - b _0230293C -_023028FC: - mov r1, r8, lsl #1 - add r0, sp, #0x2c - ldrsh r0, [r0, r1] - bl IsOnMonsterSpawnList - cmp r0, #0 - beq _0230292C - mov r1, r8, lsl #1 - add r0, sp, #0x2c - ldrsh r0, [r0, r1] - bl DungeonGetSpriteIndex - cmp r0, #0 - bne _02302944 -_0230292C: - add r8, r8, #1 - cmp r8, r6 - movge r8, #0 - add r7, r7, #1 -_0230293C: - cmp r7, r6 - blt _023028FC -_02302944: - cmp r7, r6 - bge _02302964 - add r0, sp, #0x2c - mov r1, r8, lsl #1 - ldrsh r2, [r0, r1] - mov r0, sl - mov r1, r5 - bl EvolveMonster -_02302964: - mov r6, #0 -_02302968: - cmp r6, #0 - beq _023029EC - ldrb r0, [sb, #6] - cmp r0, #0 - bne _023029EC - ldrsh r2, [sb, #0x12] - ldrsh r1, [sb, #0x16] - ldr r0, _02302A30 ; =0x000003E7 - ldr r3, [sp, #0x28] - add r1, r2, r1 - cmp r1, r0 - movgt r1, r0 - ldr r0, [sp, #4] - sub r0, r1, r0 - str r0, [sp, #0x84] - ldrb r2, [sb, #0x1a] - ldr r1, [sp, #0x24] - ldr r0, [sp, #0x1c] - sub r1, r2, r1 - str r1, [sp, #0x88] - ldrb r1, [sb, #0x1c] - ldr r2, [sp, #0x20] - sub r0, r1, r0 - str r0, [sp, #0x8c] - ldrb r6, [sb, #0x1b] - add r1, sp, #0x60 - mov r0, r5 - sub r3, r6, r3 - str r3, [sp, #0x90] - ldrb r3, [sb, #0x1d] - sub r2, r3, r2 - str r2, [sp, #0x94] - bl ov29_02302CC8 -_023029EC: - cmp fp, #0 - beq _02302A08 - add r2, sp, #0x54 - mov r0, sl - mov r1, r5 - mov r3, #1 - bl ov29_02302C04 -_02302A08: - mov r0, #0 - str r0, [sb, #0x214 + ENEMY_EVOLUTION_OFFSET] - strb r0, [sb, #0x153 + ENEMY_EVOLUTION_OFFSET] -_02302A14: - add r4, r4, #1 - cmp r4, #0x14 - blt _02302780 -_02302A20: - add sp, sp, #0x168 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -_02302A28: .word DUNGEON_PTR -_02302A2C: .word ov29_023527F8 -_02302A30: .word 0x000003E7 -#ifdef JAPAN -_02302A34: .word 0x00002486 -#else -_02302A34: .word 0x00000F1F -#endif - arm_func_end EnemyEvolution diff --git a/asm/overlay_29_02301F50.s b/asm/overlay_29_02301F50.s new file mode 100644 index 00000000..b20ccd6e --- /dev/null +++ b/asm/overlay_29_02301F50.s @@ -0,0 +1,854 @@ + .include "asm/macros.inc" + .include "overlay_29_02301F50.inc" + + .text + + arm_func_start HasDropeyeStatus +HasDropeyeStatus: ; 0x02301F50 + stmdb sp!, {r4, lr} + mov r4, r0 + bl EntityIsValid__023000E4 + cmp r0, #0 + beq _02301F78 + ldr r0, [r4, #0xb4] + ldrb r0, [r0, #0xf1] + cmp r0, #4 + moveq r0, #1 + ldmeqia sp!, {r4, pc} +_02301F78: + mov r0, #0 + ldmia sp!, {r4, pc} + arm_func_end HasDropeyeStatus + + arm_func_start IqSkillIsEnabled +IqSkillIsEnabled: ; 0x02301F80 + stmdb sp!, {r3, lr} + ldr r2, [r0, #0xb4] + ldrb r0, [r2, #6] + cmp r0, #0 + bne _02301FAC + ldr r0, _02301FB8 ; =DUNGEON_PTR + ldr r0, [r0] + ldrb r0, [r0, #0x12] + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, pc} +_02301FAC: + add r0, r2, #0x9c + bl IqSkillFlagTest + ldmia sp!, {r3, pc} + .align 2, 0 +_02301FB8: .word DUNGEON_PTR + arm_func_end IqSkillIsEnabled + + arm_func_start UpdateIqSkills +UpdateIqSkills: ; 0x02301FBC + stmdb sp!, {r4, r5, r6, lr} + mov r4, r0 + ldrb r0, [r4, #6] + mov r6, #0 + cmp r0, #0 + str r6, [r4, #0x9c] + beq _02302118 + str r6, [r4, #0xa0] + str r6, [r4, #0xa4] + b _0230202C +_02301FE4: + ldrsh r0, [r4, #2] + and r1, r6, #0xff + bl GetSpeciesIqSkill + mov r5, r0 + cmp r5, #0xff + beq _02302034 + ldrsh r0, [r4, #0xe] + mov r1, r5 + bl CanLearnIqSkill + cmp r0, #0 + beq _02302028 + mov r1, r5 + add r0, r4, #0x90 + bl EnableIqSkill + mov r1, r5 + add r0, r4, #0x9c + bl EnableIqSkill +_02302028: + add r6, r6, #1 +_0230202C: + cmp r6, #0x19 + blt _02301FE4 +_02302034: + ldr r0, _023021E8 ; =MIN_IQ_EXCLUSIVE_MOVE_USER + ldrsh r1, [r4, #0xe] + ldrsh r0, [r0] + cmp r1, r0 + bge _02302068 + add r0, r4, #0x9c + mov r1, #0x17 + bl IqSkillFlagTest + cmp r0, #0 + beq _02302068 + add r0, r4, #0x9c + mov r1, #0x17 + bl DisableIqSkill +_02302068: + mov r0, r4 + bl ov29_022FBDE0 + cmp r0, #0 + bne _0230208C + ldr r0, _023021EC ; =MIN_IQ_ITEM_MASTER + ldrsh r1, [r4, #0xe] + ldrsh r0, [r0] + cmp r1, r0 + bge _023020AC +_0230208C: + add r0, r4, #0x9c + mov r1, #0x16 + bl IqSkillFlagTest + cmp r0, #0 + beq _023020AC + add r0, r4, #0x9c + mov r1, #0x16 + bl DisableIqSkill +_023020AC: + add r0, r4, #0x9c + mov r1, #0x15 + bl IqSkillFlagTest + cmp r0, #0 + beq _023020CC + add r0, r4, #0x9c + mov r1, #0x15 + bl DisableIqSkill +_023020CC: + add r0, r4, #0x9c + mov r1, #0x14 + bl IqSkillFlagTest + cmp r0, #0 + beq _023020EC + add r0, r4, #0x9c + mov r1, #0x14 + bl DisableIqSkill +_023020EC: + add r0, r4, #0x9c + mov r1, #0xb + bl IqSkillFlagTest + cmp r0, #0 + beq _0230210C + add r0, r4, #0x9c + mov r1, #0xb + bl DisableIqSkill +_0230210C: + mov r0, #2 + strb r0, [r4, #0xa8] + ldmia sp!, {r4, r5, r6, pc} +_02302118: + str r6, [r4, #0xa0] + str r6, [r4, #0xa4] + b _02302174 +_02302124: + ldrsh r0, [r4, #2] + and r1, r6, #0xff + bl GetSpeciesIqSkill + mov r5, r0 + cmp r5, #0xff + beq _0230217C + ldrsh r0, [r4, #0xe] + mov r1, r5 + bl CanLearnIqSkill + cmp r0, #0 + beq _02302170 + mov r1, r5 + add r0, r4, #0x90 + bl IqSkillFlagTest + cmp r0, #0 + beq _02302170 + mov r1, r5 + add r0, r4, #0x9c + bl EnableIqSkill +_02302170: + add r6, r6, #1 +_02302174: + cmp r6, #0x19 + blt _02302124 +_0230217C: + mov r0, #3 + bl GetPerformanceFlagWithChecks + cmp r0, #0 + beq _023021A4 + add r0, r4, #0x90 + mov r1, #0x18 + bl EnableIqSkill + add r0, r4, #0x9c + mov r1, #0x18 + bl EnableIqSkill +_023021A4: + add r0, r4, #0x90 + mov r1, #0x38 + bl IqSkillFlagTest + cmp r0, #0 + beq _023021C4 + add r0, r4, #0x9c + mov r1, #0x38 + bl EnableIqSkill +_023021C4: + add r0, r4, #0x90 + mov r1, #0x39 + bl IqSkillFlagTest + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + add r0, r4, #0x9c + mov r1, #0x39 + bl EnableIqSkill + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_023021E8: .word MIN_IQ_EXCLUSIVE_MOVE_USER +_023021EC: .word MIN_IQ_ITEM_MASTER + arm_func_end UpdateIqSkills + + arm_func_start ov29_023021F0 +ov29_023021F0: ; 0x023021F0 + ldr ip, _023021FC ; =UpdateIqSkills + ldr r0, [r0, #0xb4] + bx ip + .align 2, 0 +_023021FC: .word UpdateIqSkills + arm_func_end ov29_023021F0 + + arm_func_start ov29_02302200 +ov29_02302200: ; 0x02302200 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r4, r0 + ldr r0, [r4, #0xb4] + ldrb r0, [r0, #6] + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + mov r6, #0 + ldr r5, _02302278 ; =DUNGEON_PTR + b _02302268 +_02302228: + ldr r1, [r5] + mov r0, r4 + add r1, r1, r6, lsl #2 + add r1, r1, #0x12000 +#ifdef JAPAN + ldr r7, [r1, #0xa84] +#else + ldr r7, [r1, #0xb28] +#endif + bl EntityIsValid__023000E4 + cmp r0, #0 + cmpne r4, r7 + beq _02302264 + mov r0, r4 + mov r1, r7 + bl CanSeeTarget + cmp r0, #0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} +_02302264: + add r6, r6, #1 +_02302268: + cmp r6, #4 + blt _02302228 + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_02302278: .word DUNGEON_PTR + arm_func_end ov29_02302200 + + arm_func_start GetMoveTypeForMonster +GetMoveTypeForMonster: ; 0x0230227C + stmdb sp!, {r3, r4, r5, lr} + mov r4, r1 + mov r5, r0 + ldrh r0, [r4, #4] + bl IsRegularAttackOrProjectile + cmp r0, #0 + bne _023022C0 + mov r0, r5 + bl EntityIsValid__023000E4 + cmp r0, #0 + beq _023022C0 + mov r0, r5 + mov r1, #0x6b + bl AbilityIsActive + cmp r0, #0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, pc} +_023022C0: + ldrh r1, [r4, #4] + cmp r1, #0x144 + ldreq r0, [r5, #0xb4] + ldreqb r0, [r0, #0x46] + ldmeqia sp!, {r3, r4, r5, pc} + ldr r0, _02302318 ; =0x000001D7 + cmp r1, r0 + bne _023022F4 + mov r0, r5 + bl GetEntityNaturalGiftInfo + cmp r0, #0 + ldrneb r0, [r0, #2] + ldmneia sp!, {r3, r4, r5, pc} +_023022F4: + ldrh r0, [r4, #4] + cmp r0, #0x1f + bne _0230230C + mov r0, r5 + bl GetEntityWeatherBallType + ldmia sp!, {r3, r4, r5, pc} +_0230230C: + mov r0, r4 + bl GetMoveType + ldmia sp!, {r3, r4, r5, pc} + .align 2, 0 +_02302318: .word 0x000001D7 + arm_func_end GetMoveTypeForMonster + + arm_func_start GetMovePower +GetMovePower: ; 0x0230231C + stmdb sp!, {r3, r4, r5, lr} + ldrh r2, [r1, #4] + mov r5, r0 + ldrb r4, [r1, #7] + cmp r2, #0x144 + ldreq r0, [r5, #0xb4] + ldreqsh r0, [r0, #0x44] + addeq r0, r4, r0 + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, r1 + bl GetMoveBasePower + add r4, r4, r0 + mov r0, r5 + mov r1, #0x2b + bl ItemIsActive__022FF898 + cmp r0, #0 + movne r4, r4, lsl #1 + mov r0, r4 + ldmia sp!, {r3, r4, r5, pc} + arm_func_end GetMovePower + + arm_func_start MonsterCanThrowItems +MonsterCanThrowItems: ; 0x02302368 + stmdb sp!, {r3, lr} + ldrsh r0, [r0, #2] + bl CanThrowItems + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, pc} + arm_func_end MonsterCanThrowItems + + arm_func_start ov29_02302388 +ov29_02302388: ; 0x02302388 + stmdb sp!, {r4, lr} + mov r4, r0 + bl EntityIsValid__023000E4 + cmp r0, #0 + ldrne r0, [r4, #0xb4] + ldrneb r1, [r0, #0xbc] + cmpne r1, #7 + beq _023023B8 + bl IsExperienceLocked + cmp r0, #0 + moveq r0, #1 + ldmeqia sp!, {r4, pc} +_023023B8: + mov r0, #0 + ldmia sp!, {r4, pc} + arm_func_end ov29_02302388 + + arm_func_start UpdateStateFlags +UpdateStateFlags: ; 0x023023C0 +#ifdef JAPAN +#define UPDATE_STATE_FLAGS_OFFSET -4 +#else +#define UPDATE_STATE_FLAGS_OFFSET 0 +#endif + stmdb sp!, {r3, lr} + add r3, r0, #0x100 + ldrh ip, [r3, #0x58 + UPDATE_STATE_FLAGS_OFFSET] + tst ip, r1 + ldrneh ip, [r3, #0x5a + UPDATE_STATE_FLAGS_OFFSET] + ldreqh lr, [r3, #0x5a + UPDATE_STATE_FLAGS_OFFSET] + orrne ip, ip, r1 + mvneq ip, r1 + andeq ip, lr, ip + cmp r2, #0 + add r2, r0, #0x100 + strh ip, [r3, #0x5a + UPDATE_STATE_FLAGS_OFFSET] + ldrneh r3, [r2, #0x58 + UPDATE_STATE_FLAGS_OFFSET] + ldreqh ip, [r2, #0x58 + UPDATE_STATE_FLAGS_OFFSET] + add r0, r0, #0x100 + orrne r3, r3, r1 + mvneq r3, r1 + andeq r3, ip, r3 + strh r3, [r2, #0x58 + UPDATE_STATE_FLAGS_OFFSET] + ldrh r2, [r0, #0x5a + UPDATE_STATE_FLAGS_OFFSET] + tst r2, r1 + bne _02302428 + ldrh r0, [r0, #0x58 + UPDATE_STATE_FLAGS_OFFSET] + tst r0, r1 + movne r0, #1 + ldmneia sp!, {r3, pc} +_02302428: + mov r0, #0 + ldmia sp!, {r3, pc} + arm_func_end UpdateStateFlags + + arm_func_start IsProtectedFromNegativeStatus +IsProtectedFromNegativeStatus: ; 0x02302430 + stmdb sp!, {r4, r5, r6, lr} + sub sp, sp, #8 + mov r6, r0 + mov r5, r1 + mov r4, r2 + bl LeafGuardIsActive + cmp r0, #0 + movne r0, #1 + bne _023024D4 + mov r0, r5 + mov r1, #0x59 + bl ExclusiveItemEffectIsActive__022FFF28 + cmp r0, #0 + beq _023024B4 + cmp r4, #0 + beq _023024AC + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + add r2, sp, #0 + mov r0, r5 + mov r1, #0x59 + bl GetExclusiveItemWithEffectFromBag + add r1, sp, #0 + mov r0, #1 + bl ov29_02344B44 + ldr r2, _023024DC ; =0x00000C39 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_023024AC: + mov r0, #1 + b _023024D4 +_023024B4: + mov r0, r6 + mov r1, r5 + mov r2, r4 + bl ov29_02301A84 + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff +_023024D4: + add sp, sp, #8 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_023024DC: .word 0x00000978 +#else +_023024DC: .word 0x00000C39 +#endif + arm_func_end IsProtectedFromNegativeStatus + + arm_func_start ov29_023024E0 +ov29_023024E0: ; 0x023024E0 + stmdb sp!, {r3, r4, r5, lr} + mov r4, r1 + mov r1, #7 + mov r5, r0 + bl IqSkillIsEnabled + cmp r0, #0 + bne _02302534 + cmp r4, #0 + beq _02302518 + mov r0, r5 + mov r1, #1 + bl IsBlinded + cmp r0, #0 + bne _0230252C +_02302518: + ldr r0, [r5, #0xb4] + ldrb r0, [r0, #0xd0] + cmp r0, #2 + cmpne r0, #4 + bne _02302534 +_0230252C: + mov r0, #1 + ldmia sp!, {r3, r4, r5, pc} +_02302534: + mov r0, #0 + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_023024E0 + + arm_func_start AddExpSpecial +AddExpSpecial: ; 0x0230253C +#ifdef JAPAN +#define ADD_EXP_SPECIAL_OFFSET -4 +#else +#define ADD_EXP_SPECIAL_OFFSET 0 +#endif + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r1 + ldr r5, [r7, #0xb4] + mov r6, r2 + mov r0, r5 + bl IsExperienceLocked + cmp r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + ldrb r0, [r5, #0xa] + cmp r0, #0x64 + bne _02302580 + cmp r6, #0 + ldrgt r0, _023026B4 ; =DUNGEON_PTR + movgt r1, #1 + ldrgt r0, [r0] + strgtb r1, [r0, #0xf] + ldmia sp!, {r3, r4, r5, r6, r7, pc} +_02302580: + ldr r2, [r5, #0x20] + mov r0, r7 + mov r1, #0x1c + add r4, r2, r6 + bl IqSkillIsEnabled + cmp r0, #0 + beq _023025C0 + ldr r0, _023026B8 ; =EXP_ELITE_EXP_BOOST + mov r1, #0x64 + ldrsh r0, [r0] + mov r0, r0, lsl #8 + bl _s32_div_f + mov r1, r0 + mov r0, r6, lsl #8 + bl MultiplyByFixedPoint + add r4, r4, r0, asr #8 +_023025C0: + mov r0, r7 + mov r1, #0x43 + bl ItemIsActive__023026CC + cmp r0, #0 + beq _023025F8 + ldr r0, _023026BC ; =WONDER_CHEST_EXP_BOOST + mov r1, #0x64 + ldrsh r0, [r0] + mov r0, r0, lsl #8 + bl _s32_div_f + mov r1, r0 + mov r0, r6, lsl #8 + bl MultiplyByFixedPoint + add r4, r4, r0, asr #8 +_023025F8: + mov r0, r7 + mov r1, #0x42 + bl ItemIsActive__023026CC + cmp r0, #0 + beq _02302630 + ldr r0, _023026C0 ; =MIRACLE_CHEST_EXP_BOOST + mov r1, #0x64 + ldrsh r0, [r0] + mov r0, r0, lsl #8 + bl _s32_div_f + mov r1, r0 + mov r0, r6, lsl #8 + bl MultiplyByFixedPoint + add r4, r4, r0, asr #8 +_02302630: + ldr r1, [r7, #0xb4] + ldrb r0, [r1, #6] + cmp r0, #0 + movne r0, #0 + bne _02302650 + add r0, r1, #0x228 + ADD_EXP_SPECIAL_OFFSET + mov r1, #0x4f + bl ExclusiveItemEffectFlagTest +_02302650: + cmp r0, #0 + beq _0230267C + ldr r0, _023026C4 ; =EXCLUSIVE_ITEM_EXP_BOOST + mov r1, #0x64 + ldrsh r0, [r0] + mov r0, r0, lsl #8 + bl _s32_div_f + mov r1, r0 + mov r0, r6, lsl #8 + bl MultiplyByFixedPoint + add r4, r4, r0, asr #8 +_0230267C: + ldr r0, _023026C8 ; =0x0098967F + cmp r4, r0 + movge r4, r0 + ldr r0, [r5, #0x20] + subs r2, r4, r0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + ldr r1, [r5, #0x214 + ADD_EXP_SPECIAL_OFFSET] + ldr r0, _023026B4 ; =DUNGEON_PTR + add r1, r1, r2 + str r1, [r5, #0x214 + ADD_EXP_SPECIAL_OFFSET] + ldr r0, [r0] + mov r1, #1 + strb r1, [r0, #0xf] + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_023026B4: .word DUNGEON_PTR +_023026B8: .word EXP_ELITE_EXP_BOOST +_023026BC: .word WONDER_CHEST_EXP_BOOST +_023026C0: .word MIRACLE_CHEST_EXP_BOOST +_023026C4: .word EXCLUSIVE_ITEM_EXP_BOOST +_023026C8: .word 0x0098967F + arm_func_end AddExpSpecial + + arm_func_start ItemIsActive__023026CC +ItemIsActive__023026CC: ; 0x023026CC + stmdb sp!, {r3, r4, r5, lr} + mov r4, r1 + mov r1, #0x6f + mov r5, r0 + bl AbilityIsActiveVeneer + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + mov r0, r5 + mov r1, r4 + bl HasHeldItem + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ItemIsActive__023026CC + + arm_func_start EnemyEvolution +EnemyEvolution: ; 0x023026FC +#ifdef JAPAN +#define ENEMY_EVOLUTION_OFFSET -4 +#else +#define ENEMY_EVOLUTION_OFFSET 0 +#endif + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x168 + mov sl, r0 + bl AllocateTemp1024ByteBufferFromPool + ldr r0, _02302A28 ; =DUNGEON_PTR + ldr r2, [r0] + ldrb r1, [r2, #0xf] + ldrb r0, [r2, #0x748] + cmp r1, #0 + str r0, [sp, #8] + beq _02302A20 + mov r0, #0 + strb r0, [r2, #0xf] + bl GetForcedLossReason + cmp r0, #0 + bne _02302A20 + mov r0, sl + bl EntityIsValid__02302A38 + cmp r0, #0 + bne _02302758 + add r0, sp, #0xb0 + bl ov29_022E2470 + add sl, sp, #0xb0 +_02302758: + ldr r0, _02302A2C ; =ov29_023527F8 + mov r4, #0 + ldr r3, [r0] + ldr r2, [r0, #4] + ldr r1, [r0, #8] + ldr r0, [r0, #0xc] + str r3, [sp, #0x14] + str r2, [sp, #0x18] + str r1, [sp, #0xc] + str r0, [sp, #0x10] +_02302780: + ldr r0, _02302A28 ; =DUNGEON_PTR + ldr r3, [sp, #0x14] + ldr r0, [r0] + ldr r2, [sp, #0x18] + add r0, r0, r4, lsl #2 + add r0, r0, #0x12000 +#ifdef JAPAN + ldr r5, [r0, #0xad4] +#else + ldr r5, [r0, #0xb78] +#endif + ldr r1, [sp, #0xc] + ldr r0, [sp, #0x10] + mov r6, #0 + str r6, [sp, #4] + str r3, [sp, #0x24] + str r2, [sp, #0x28] + str r1, [sp, #0x1c] + str r0, [sp, #0x20] + cmp r5, #0 + beq _02302A14 + mov r0, r5 + bl EntityIsValid__02302A38 + cmp r0, #0 + ldrne sb, [r5, #0xb4] + ldrnesh r0, [sb, #0x10] + cmpne r0, #0 + beq _02302A14 + ldrb r0, [sb, #0x102] + cmp r0, #0 + movne r0, r6 + strneb r0, [sb, #0x102] + bne _02302A08 + ldr fp, [sb, #0x214 + ENEMY_EVOLUTION_OFFSET] + cmp fp, #0 + beq _023028C4 + ldrb r0, [sb, #7] + cmp r0, #0 + beq _02302818 + ldrb r1, [sb, #0xa] + add r0, sp, #0x54 + bl GetUnlockedTacticFlags +_02302818: + ldrsh r2, [sb, #0x12] + ldrsh r0, [sb, #0x16] + ldrb r7, [sb, #0x1a] + ldr r1, _02302A30 ; =0x000003E7 + add r0, r2, r0 + ldrb r3, [sb, #0x1b] + ldrb r2, [sb, #0x1c] + str r0, [sp, #4] + cmp r0, r1 + strgt r1, [sp, #4] + ldrb r1, [sb, #0x1d] + ldrb r0, [sb, #0xa] + str r7, [sp, #0x24] + str r3, [sp, #0x28] + str r2, [sp, #0x1c] + str r1, [sp, #0x20] + cmp r0, #0x64 + beq _023028C4 + ldr r0, [sp, #8] + bl IsExpEnabledInDungeon + cmp r0, #0 + beq _023028C4 + ldr r0, [sb, #0x20] + mov r1, fp + add r2, r0, fp + mov r0, #0 + str r2, [sb, #0x20] + bl ov29_0234B09C + bl ov29_0234B034 + mov r1, #0 + str r1, [sp] + mov r2, sb + mov r3, r1 + bl ov29_0230040C + mov r0, sl + ldr r1, _02302A34 ; =0x00000F1F + bl LogMessageByIdWithPopup + mov r0, sl + mov r1, r5 + mov r2, #1 + mov r3, r2 + bl LevelUp + orr r6, r6, r0 +_023028C4: + ldrb r0, [sb, #0x153 + ENEMY_EVOLUTION_OFFSET] + cmp r0, #0 + beq _02302968 + ldrsh r0, [sb, #2] + mov r2, #0 + add r1, sp, #0x2c + mov r3, r2 + bl GetEvolutions + movs r6, r0 + beq _02302964 + bl DungeonRandInt + mov r8, r0 + mov r7, #0 + b _0230293C +_023028FC: + mov r1, r8, lsl #1 + add r0, sp, #0x2c + ldrsh r0, [r0, r1] + bl IsOnMonsterSpawnList + cmp r0, #0 + beq _0230292C + mov r1, r8, lsl #1 + add r0, sp, #0x2c + ldrsh r0, [r0, r1] + bl DungeonGetSpriteIndex + cmp r0, #0 + bne _02302944 +_0230292C: + add r8, r8, #1 + cmp r8, r6 + movge r8, #0 + add r7, r7, #1 +_0230293C: + cmp r7, r6 + blt _023028FC +_02302944: + cmp r7, r6 + bge _02302964 + add r0, sp, #0x2c + mov r1, r8, lsl #1 + ldrsh r2, [r0, r1] + mov r0, sl + mov r1, r5 + bl EvolveMonster +_02302964: + mov r6, #0 +_02302968: + cmp r6, #0 + beq _023029EC + ldrb r0, [sb, #6] + cmp r0, #0 + bne _023029EC + ldrsh r2, [sb, #0x12] + ldrsh r1, [sb, #0x16] + ldr r0, _02302A30 ; =0x000003E7 + ldr r3, [sp, #0x28] + add r1, r2, r1 + cmp r1, r0 + movgt r1, r0 + ldr r0, [sp, #4] + sub r0, r1, r0 + str r0, [sp, #0x84] + ldrb r2, [sb, #0x1a] + ldr r1, [sp, #0x24] + ldr r0, [sp, #0x1c] + sub r1, r2, r1 + str r1, [sp, #0x88] + ldrb r1, [sb, #0x1c] + ldr r2, [sp, #0x20] + sub r0, r1, r0 + str r0, [sp, #0x8c] + ldrb r6, [sb, #0x1b] + add r1, sp, #0x60 + mov r0, r5 + sub r3, r6, r3 + str r3, [sp, #0x90] + ldrb r3, [sb, #0x1d] + sub r2, r3, r2 + str r2, [sp, #0x94] + bl ov29_02302CC8 +_023029EC: + cmp fp, #0 + beq _02302A08 + add r2, sp, #0x54 + mov r0, sl + mov r1, r5 + mov r3, #1 + bl ov29_02302C04 +_02302A08: + mov r0, #0 + str r0, [sb, #0x214 + ENEMY_EVOLUTION_OFFSET] + strb r0, [sb, #0x153 + ENEMY_EVOLUTION_OFFSET] +_02302A14: + add r4, r4, #1 + cmp r4, #0x14 + blt _02302780 +_02302A20: + add sp, sp, #0x168 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +_02302A28: .word DUNGEON_PTR +_02302A2C: .word ov29_023527F8 +_02302A30: .word 0x000003E7 +#ifdef JAPAN +_02302A34: .word 0x00002486 +#else +_02302A34: .word 0x00000F1F +#endif + arm_func_end EnemyEvolution diff --git a/include/dungeon_ai_targeting.h b/include/dungeon_ai_targeting.h index cd10f001..49d695f4 100644 --- a/include/dungeon_ai_targeting.h +++ b/include/dungeon_ai_targeting.h @@ -3,7 +3,6 @@ #include "dungeon_mode.h" - // Checks if a monster should run away from other monsters // return: True if the monster should run away, false otherwise bool8 ShouldMonsterRunAway(struct entity *pokemon); diff --git a/include/dungeon_mode.h b/include/dungeon_mode.h index 7d384850..584ec849 100644 --- a/include/dungeon_mode.h +++ b/include/dungeon_mode.h @@ -224,7 +224,7 @@ struct monster { // 0x9C: First 9 bytes contain bitfield data; the rest is presumably padding. // Bitvector. See enum iq_skill_id for the meaning of each bit. u32 iq_skill_flags[3]; - enum tactic_id tactic : 8; // 0xA8 + enum tactic_id tactic; // 0xA8 // 0xA9 bool8 roost; diff --git a/include/dungeon_pokemon_attributes_1.h b/include/dungeon_pokemon_attributes_1.h new file mode 100644 index 00000000..7bbfb7b0 --- /dev/null +++ b/include/dungeon_pokemon_attributes_1.h @@ -0,0 +1,8 @@ +#ifndef PMDSKY_DUNGEON_POKEMON_ATTRIBUTES_1_H +#define PMDSKY_DUNGEON_POKEMON_ATTRIBUTES_1_H + +#include "dungeon_mode.h" + +bool8 IsTacticSet(struct entity *pokemon, enum tactic_id tactic_id); + +#endif //PMDSKY_DUNGEON_POKEMON_ATTRIBUTES_1_H diff --git a/main.lsf b/main.lsf index d4528f37..99ebd23e 100644 --- a/main.lsf +++ b/main.lsf @@ -276,6 +276,8 @@ Overlay OVY_29 Object asm/overlay_29_02301A84.o Object src/dungeon_pokemon_attributes.o Object asm/overlay_29_02301D78.o + Object src/dungeon_pokemon_attributes_1.o + Object asm/overlay_29_02301F50.o Object src/overlay_29_02302A38.o Object asm/overlay_29_02302A5C.o Object src/overlay_29_023047B8.o diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index 842bac51..fc683f5e 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -1,10 +1,9 @@ #include "dungeon_ai_targeting.h" #include "dungeon_pokemon_attributes.h" +#include "dungeon_pokemon_attributes_1.h" #include "dungeon_util.h" #include "overlay_29_023000E4.h" -extern bool8 IsTacticSet(struct entity *entity, enum tactic_id tactic); - bool8 ShouldMonsterRunAway(struct entity *pokemon) { if (!EntityIsValid__023000E4(pokemon)) diff --git a/src/dungeon_pokemon_attributes_1.c b/src/dungeon_pokemon_attributes_1.c new file mode 100644 index 00000000..6e9a8f51 --- /dev/null +++ b/src/dungeon_pokemon_attributes_1.c @@ -0,0 +1,11 @@ +#include "dungeon_pokemon_attributes_1.h" +#include "dungeon_util.h" + +bool8 IsTacticSet(struct entity *pokemon, enum tactic_id tactic_id) +{ + struct monster *pokemon_info = GetEntInfo(pokemon); + if (pokemon_info->is_team_leader) + return tactic_id == TACTIC_YOU_GO_THE_OTHER_WAY; + + return pokemon_info->tactic == tactic_id; +} From 2d3d79927a4a59d2a6f249366e4cec3a33b097b0 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sun, 1 Dec 2024 19:29:40 -0600 Subject: [PATCH 4/5] Decomped CheckVariousStatuses2 --- asm/include/overlay_29_02300108.inc | 6 +- asm/include/overlay_29_023008DC.inc | 6 + asm/overlay_29_02300108.s | 234 ---------------------------- asm/overlay_29_023008DC.s | 180 +++++++++++++++++++++ include/dungeon_capabilities.h | 12 +- include/dungeon_capabilities_1.h | 11 ++ include/dungeon_mode.h | 25 +-- include/enums.h | 12 +- main.lsf | 2 + src/dungeon_ai.c | 2 +- src/dungeon_capabilities.c | 36 ++--- src/dungeon_capabilities_1.c | 39 +++++ 12 files changed, 288 insertions(+), 277 deletions(-) create mode 100644 asm/include/overlay_29_023008DC.inc create mode 100644 asm/overlay_29_023008DC.s create mode 100644 include/dungeon_capabilities_1.h create mode 100644 src/dungeon_capabilities_1.c diff --git a/asm/include/overlay_29_02300108.inc b/asm/include/overlay_29_02300108.inc index 8d087e6b..6fc9e04d 100644 --- a/asm/include/overlay_29_02300108.inc +++ b/asm/include/overlay_29_02300108.inc @@ -1,5 +1,4 @@ #pragma once -.public CheckVariousStatuses .public CopyStringFromId .public DUNGEON_PTR .public GetActiveTeamMember @@ -8,14 +7,11 @@ .public GetNameRaw .public GetNameWithGender .public IsBlinded -.public IsChargingAnyTwoTurnMove -.public ov29_02300D00 +.public StringFromId .public ov29_0234B0B4 .public ov29_023527C0 .public ov29_023527D0 -.public ShouldMonsterRunAway .public strcpy -.public StringFromId .public sub_02024FB8 .public sub_02056084 .public sub_02058534 diff --git a/asm/include/overlay_29_023008DC.inc b/asm/include/overlay_29_023008DC.inc new file mode 100644 index 00000000..50098172 --- /dev/null +++ b/asm/include/overlay_29_023008DC.inc @@ -0,0 +1,6 @@ +#pragma once +.public CheckVariousStatuses2 +.public IsBlinded +.public IsChargingAnyTwoTurnMove +.public ShouldMonsterRunAway +.public ov29_02300D00 diff --git a/asm/overlay_29_02300108.s b/asm/overlay_29_02300108.s index 5c1a4b0d..763bd0f6 100644 --- a/asm/overlay_29_02300108.s +++ b/asm/overlay_29_02300108.s @@ -690,237 +690,3 @@ ov29_023007DC: ; 0x023007DC .align 2, 0 _02300814: .word 0x000003E7 arm_func_end ov29_023007DC - - arm_func_start CheckVariousStatuses2 -CheckVariousStatuses2: ; 0x02300818 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - cmp r1, #0 - ldr r4, [r5, #0xb4] - beq _02300840 - mov r1, #1 - bl IsBlinded - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, pc} -_02300840: - ldrb r0, [r4, #0xbd] - cmp r0, #1 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #5 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #3 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xd0] - cmp r0, #3 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #7 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xc4] - cmp r0, #3 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #4 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, r5 - bl CheckVariousStatuses - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xc4] - cmp r0, #6 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} -#ifdef JAPAN - ldrb r0, [r4, #0x104] -#else - ldrb r0, [r4, #0x105] -#endif - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, r4, r5, pc} - arm_func_end CheckVariousStatuses2 - - arm_func_start ov29_023008DC -ov29_023008DC: ; 0x023008DC - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - cmp r1, #0 - ldr r4, [r5, #0xb4] - beq _02300904 - mov r1, #1 - bl IsBlinded - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, pc} -_02300904: - ldrb r0, [r4, #0xbd] - cmp r0, #1 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #5 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #3 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xd0] - cmp r0, #3 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #7 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xc4] - cmp r0, #3 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #4 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, r5 - bl ov29_02300D00 - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xc4] - cmp r0, #6 - moveq r0, #1 - ldmeqia sp!, {r3, r4, r5, pc} -#ifdef JAPAN - ldrb r0, [r4, #0x104] -#else - ldrb r0, [r4, #0x105] -#endif - cmp r0, #0 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_023008DC - - arm_func_start ov29_023009A0 -ov29_023009A0: ; 0x023009A0 - stmdb sp!, {r4, lr} - mov r1, #0 - mov r4, r0 - bl IsChargingAnyTwoTurnMove - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r4, pc} - mov r0, r4 - mov r1, #0 - bl CheckVariousStatuses2 - ldmia sp!, {r4, pc} - arm_func_end ov29_023009A0 - - arm_func_start ov29_023009CC -ov29_023009CC: ; 0x023009CC - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - ldr r4, [r5, #0xb4] - mov r1, #0 - bl IsChargingAnyTwoTurnMove - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xbd] - cmp r0, #4 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #3 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, r5 - bl ShouldMonsterRunAway - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xf3] - cmp r0, #1 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r3, [r4, #0xc4] - cmp r3, #6 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r3, #1 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r2, [r4, #0xd0] - cmp r2, #2 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r1, [r4, #0xbd] - cmp r1, #1 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xef] - cmp r0, #1 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r1, #5 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r2, #1 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r3, #3 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r3, #4 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xf1] - cmp r0, #2 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xd8] - cmp r0, #2 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - mov r0, r5 - mov r1, #1 - bl IsBlinded - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, pc} - ldrb r0, [r4, #0xd0] - cmp r0, #7 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, pc} - cmp r0, #3 - movne r0, #1 - moveq r0, #0 - and r0, r0, #0xff - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_023009CC - - arm_func_start ov29_02300B04 -ov29_02300B04: ; 0x02300B04 - ldr r1, [r0, #0xb4] - ldrb r0, [r1, #0xbd] - cmp r0, #1 - cmpne r0, #5 - cmpne r0, #3 - beq _02300B30 - ldrb r0, [r1, #0xc4] - add r0, r0, #0xff - and r0, r0, #0xff - cmp r0, #6 - bhi _02300B38 -_02300B30: - mov r0, #0 - bx lr -_02300B38: - mov r0, #1 - bx lr - arm_func_end ov29_02300B04 diff --git a/asm/overlay_29_023008DC.s b/asm/overlay_29_023008DC.s new file mode 100644 index 00000000..34d3bb3b --- /dev/null +++ b/asm/overlay_29_023008DC.s @@ -0,0 +1,180 @@ + .include "asm/macros.inc" + .include "overlay_29_023008DC.inc" + + .text + + arm_func_start ov29_023008DC +ov29_023008DC: ; 0x023008DC + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + cmp r1, #0 + ldr r4, [r5, #0xb4] + beq _02300904 + mov r1, #1 + bl IsBlinded + cmp r0, #0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, pc} +_02300904: + ldrb r0, [r4, #0xbd] + cmp r0, #1 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r0, #5 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r0, #3 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xd0] + cmp r0, #3 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r0, #7 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xc4] + cmp r0, #3 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r0, #4 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, r5 + bl ov29_02300D00 + cmp r0, #0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xc4] + cmp r0, #6 + moveq r0, #1 + ldmeqia sp!, {r3, r4, r5, pc} +#ifdef JAPAN + ldrb r0, [r4, #0x104] +#else + ldrb r0, [r4, #0x105] +#endif + cmp r0, #0 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_023008DC + + arm_func_start ov29_023009A0 +ov29_023009A0: ; 0x023009A0 + stmdb sp!, {r4, lr} + mov r1, #0 + mov r4, r0 + bl IsChargingAnyTwoTurnMove + cmp r0, #0 + movne r0, #1 + ldmneia sp!, {r4, pc} + mov r0, r4 + mov r1, #0 + bl CheckVariousStatuses2 + ldmia sp!, {r4, pc} + arm_func_end ov29_023009A0 + + arm_func_start ov29_023009CC +ov29_023009CC: ; 0x023009CC + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + ldr r4, [r5, #0xb4] + mov r1, #0 + bl IsChargingAnyTwoTurnMove + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xbd] + cmp r0, #4 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r0, #3 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, r5 + bl ShouldMonsterRunAway + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xf3] + cmp r0, #1 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r3, [r4, #0xc4] + cmp r3, #6 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r3, #1 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r2, [r4, #0xd0] + cmp r2, #2 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r1, [r4, #0xbd] + cmp r1, #1 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xef] + cmp r0, #1 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r1, #5 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r2, #1 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r3, #3 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r3, #4 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xf1] + cmp r0, #2 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xd8] + cmp r0, #2 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + mov r0, r5 + mov r1, #1 + bl IsBlinded + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, pc} + ldrb r0, [r4, #0xd0] + cmp r0, #7 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, pc} + cmp r0, #3 + movne r0, #1 + moveq r0, #0 + and r0, r0, #0xff + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_023009CC + + arm_func_start ov29_02300B04 +ov29_02300B04: ; 0x02300B04 + ldr r1, [r0, #0xb4] + ldrb r0, [r1, #0xbd] + cmp r0, #1 + cmpne r0, #5 + cmpne r0, #3 + beq _02300B30 + ldrb r0, [r1, #0xc4] + add r0, r0, #0xff + and r0, r0, #0xff + cmp r0, #6 + bhi _02300B38 +_02300B30: + mov r0, #0 + bx lr +_02300B38: + mov r0, #1 + bx lr + arm_func_end ov29_02300B04 diff --git a/include/dungeon_capabilities.h b/include/dungeon_capabilities.h index cff0fc8f..884ee996 100644 --- a/include/dungeon_capabilities.h +++ b/include/dungeon_capabilities.h @@ -1,11 +1,13 @@ #ifndef PMDSKY_DUNGEON_CAPABILITIES_H #define PMDSKY_DUNGEON_CAPABILITIES_H -#include "dungeon.h" +#include "dungeon_mode.h" -// Returns 0 if none of these conditions holds for the given entity: is a rescue client, -// doesn't gain experience (a mission client/story teammate?), is a terrified non-team-leader, -// meets any of the conditions in CheckVariousStatuses2 (with blind_check = 0), is charging a two-turn move. -bool8 CheckVariousConditions(struct entity *pokemon); +// Returns false if none of these conditions holds for the given entity: +// blinded (checked only if blind_check == true), +// asleep, frozen, paused, infatuated, wrapping, wrapped, biding, petrified, or terrified. +// entity: Entity pointer +// blind_check: If true, return true if entity is blinded +bool8 CheckVariousStatuses2(struct entity *entity, bool8 blind_check); #endif //PMDSKY_DUNGEON_CAPABILITIES_H diff --git a/include/dungeon_capabilities_1.h b/include/dungeon_capabilities_1.h new file mode 100644 index 00000000..150f9f5f --- /dev/null +++ b/include/dungeon_capabilities_1.h @@ -0,0 +1,11 @@ +#ifndef PMDSKY_DUNGEON_CAPABILITIES_1_H +#define PMDSKY_DUNGEON_CAPABILITIES_1_H + +#include "dungeon_mode.h" + +// Returns 0 if none of these conditions holds for the given entity: is a rescue client, +// doesn't gain experience (a mission client/story teammate?), is a terrified non-team-leader, +// meets any of the conditions in CheckVariousStatuses2 (with blind_check = 0), is charging a two-turn move. +bool8 CheckVariousConditions(struct entity *pokemon); + +#endif //PMDSKY_DUNGEON_CAPABILITIES_H \ No newline at end of file diff --git a/include/dungeon_mode.h b/include/dungeon_mode.h index 584ec849..ba375659 100644 --- a/include/dungeon_mode.h +++ b/include/dungeon_mode.h @@ -130,6 +130,11 @@ struct action_data { s16 field_0x12; }; +struct sleep_class_status { + u8 sleep; // 0xBD: STATUS_SLEEP if 1 + u8 sleep_turns; // 0xBE: Turns left for the status in statuses::sleep +}; + struct frozen_class_status { u8 freeze; // 0x0: STATUS_FROZEN if 1 // 0x4: Controls the animation that plays when taking damage from the constriction status. @@ -157,6 +162,11 @@ struct curse_class_status { u8 curse_damage_countdown; }; +struct blinker_class_status { + u8 blinded; // 0x0: STATUS_BLINKER if 1 + u8 blinded_turns; // 0x1: Turns left for the status in statuses::blinded +}; + // Monster info struct monster { // 0x0: flags: 2-byte bitfield @@ -246,8 +256,7 @@ struct monster { // 0xB8: Tracks the damage taken to deal when bide status ends. Max 0x3E7 (999). u32 bide_damage_tally; enum monster_behavior monster_behavior : 8; // 0xBC - u8 sleep; // 0xBD: STATUS_SLEEP if 1 - u8 sleep_turns; // 0xBE: Turns left for the status in statuses::sleep + struct sleep_class_status sleep_class_status; // 0xBD u8 burn; // 0xBF: STATUS_BURN if 1 u8 burn_turns; // 0xC0: Turns left for the status in statuses::burn // 0xC1: Turns left until residual damage for the status in statuses::burn, if applicable @@ -257,10 +266,8 @@ struct monster { // will deal. There is no noticable difference because the table this value is looked up // on is filled with 0x6 u8 badly_poisoned_damage_count; - // 0xC4 - struct frozen_class_status frozen_class_status; - // 0xD0 - struct cringe_class_status cringe_class_status; + struct frozen_class_status frozen_class_status; // 0xC4 + struct cringe_class_status cringe_class_status; // 0xD0 u8 bide; // 0xD2: STATUS_BIDE if 1 u8 bide_turns; // 0xD3: Turns left for the status in statuses::bide u8 bide_move_slot; // 0xD4: Slot in the user's move list @@ -268,8 +275,7 @@ struct monster { u8 reflect_turns; // 0xD6: Turns left for the status in statuses::reflect // 0xD7: Turns left until residual healing for the status in statuses::reflect, if applicable u8 reflect_damage_countdown; - // 0xD8 - struct curse_class_status curse_class_status; + struct curse_class_status curse_class_status; // 0xD8 u8 leech_seed; // 0xE0: STATUS_LEECH_SEED if 1 u8 field_0xe1; u8 field_0xe2; @@ -290,8 +296,7 @@ struct monster { u8 long_toss; // 0xEE: STATUS_LONG_TOSS if 1 u8 invisible; // 0xEF: STATUS_INVISIBLE if 1 u8 invisible_turns; // 0xF0: Turns left for the status in statuses::invisible - u8 blinded; // 0xF1: STATUS_BLINKER if 1 - u8 blinded_turns; // 0xF2: Turns left for the status in statuses::blinded + struct blinker_class_status blinker_class_status; // 0xF1 u8 muzzled; // 0xF3: STATUS_MUZZLED if 1 u8 muzzled_turns; // 0xF4: Turns left for the status in statuses::muzzled u8 miracle_eye; // 0xF5: STATUS_MIRACLE_EYE if 1 diff --git a/include/enums.h b/include/enums.h index fecc21ce..ef3c2e18 100644 --- a/include/enums.h +++ b/include/enums.h @@ -3625,15 +3625,23 @@ enum status_id { STATUS_STAIR_SPOTTER = 101, // Can locate stairs }; +#define SLEEP_STATUS_SLEEP (STATUS_SLEEP - STATUS_SLEEP + 1) // 1 +#define SLEEP_STATUS_NIGHTMARE (STATUS_NAPPING - STATUS_NIGHTMARE + 1) // 3 +#define SLEEP_STATUS_NAPPING (STATUS_NAPPING - STATUS_SLEEP + 1) // 5 + #define FREEZE_STATUS_WRAP (STATUS_PETRIFIED - STATUS_WRAP + 1) // 3 #define FREEZE_STATUS_WRAPPED (STATUS_PETRIFIED - STATUS_WRAPPED + 1) // 4 #define FREEZE_STATUS_PETRIFIED (STATUS_PETRIFIED - STATUS_FROZEN + 1) // 6 -#define CRINGE_STATUS_CONFUSED (STATUS_CONFUSED - STATUS_CRINGE + 1) // 2 +#define CRINGE_STATUS_CONFUSED (STATUS_CONFUSED - STATUS_CRINGE + 1) // 2 +#define CRINGE_STATUS_PAUSED (STATUS_PAUSED - STATUS_CRINGE + 1) // 3 +#define CRINGE_STATUS_INFATUATED (STATUS_INFATUATED - STATUS_CRINGE + 1) // 7 -#define CURSED_STATUS_DECOY (STATUS_DECOY - STATUS_CURSED + 1) // 2 +#define CURSED_STATUS_DECOY (STATUS_DECOY - STATUS_CURSED + 1) // 2 #define CURSED_STATUS_GASTRO_ACID (STATUS_GASTRO_ACID - STATUS_CURSED + 1) // 4 +#define BLINKER_STATUS_BLINKER (STATUS_BLINKER - STATUS_BLINKER + 1) // 1 + // Mission type on a floor enum mission_type { MISSION_RESCUE_CLIENT = 0, diff --git a/main.lsf b/main.lsf index 99ebd23e..3376923c 100644 --- a/main.lsf +++ b/main.lsf @@ -269,6 +269,8 @@ Overlay OVY_29 Object src/overlay_29_023000E4.o Object asm/overlay_29_02300108.o Object src/dungeon_capabilities.o + Object asm/overlay_29_023008DC.o + Object src/dungeon_capabilities_1.o Object asm/overlay_29_02300BF8.o Object src/dungeon_ai_targeting.o Object asm/overlay_29_023016A8.o diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index d11d57a4..215e2c37 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -1,6 +1,6 @@ #include "dungeon_ai.h" #include "dg_random.h" -#include "dungeon_capabilities.h" +#include "dungeon_capabilities_1.h" #include "dungeon_util.h" #include "dungeon_util_1.h" diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index f37d459e..771217a1 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -1,39 +1,35 @@ #include "dungeon_capabilities.h" -#include "dungeon_ai_targeting.h" #include "dungeon_util.h" -#include "joined_at_checks.h" -extern bool8 CheckVariousStatuses2(struct entity *pokemon, bool8 check_blinker); -extern bool8 CheckVariousStatuses(struct entity *pokemon); -extern bool8 IsChargingAnyTwoTurnMove(struct entity *pokemon, bool8 check_charge); +extern bool8 IsBlinded(struct entity *entity, bool8 check_held_item); +extern bool8 CheckVariousStatuses(struct entity *entity); -bool8 CheckVariousConditions(struct entity *pokemon) +bool8 CheckVariousStatuses2(struct entity *entity, bool8 blind_check) { - struct monster *pokemon_info = GetEntInfo(pokemon); + struct monster *pokemon_info = GetEntInfo(entity); - if (pokemon_info->monster_behavior == BEHAVIOR_RESCUE_TARGET) + if ((blind_check && IsBlinded(entity, TRUE))) return TRUE; - - if (IsExperienceLocked(pokemon_info)) + if (pokemon_info->sleep_class_status.sleep == SLEEP_STATUS_SLEEP) return TRUE; - - if (!pokemon_info->is_team_leader && ShouldMonsterRunAway(pokemon)) + if (pokemon_info->sleep_class_status.sleep == SLEEP_STATUS_NAPPING) return TRUE; - - if (CheckVariousStatuses2(pokemon, FALSE)) + if (pokemon_info->sleep_class_status.sleep == SLEEP_STATUS_NIGHTMARE) return TRUE; - - if (CheckVariousStatuses(pokemon)) + if (pokemon_info->cringe_class_status.cringe == CRINGE_STATUS_PAUSED) return TRUE; - - if (IsChargingAnyTwoTurnMove(pokemon, FALSE)) + if (pokemon_info->cringe_class_status.cringe == CRINGE_STATUS_INFATUATED) return TRUE; - if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_WRAPPED) return TRUE; - if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_WRAP) return TRUE; + if (CheckVariousStatuses(entity)) + return TRUE; + if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_PETRIFIED) + return TRUE; + if (pokemon_info->terrified_turns != 0) + return TRUE; return FALSE; } diff --git a/src/dungeon_capabilities_1.c b/src/dungeon_capabilities_1.c new file mode 100644 index 00000000..e2161637 --- /dev/null +++ b/src/dungeon_capabilities_1.c @@ -0,0 +1,39 @@ +#include "dungeon_capabilities_1.h" +#include "dungeon_ai_targeting.h" +#include "dungeon_capabilities.h" +#include "dungeon_util.h" +#include "joined_at_checks.h" + +extern bool8 CheckVariousStatuses(struct entity *pokemon); +extern bool8 IsChargingAnyTwoTurnMove(struct entity *pokemon, bool8 check_charge); + +bool8 CheckVariousConditions(struct entity *pokemon) +{ + struct monster *pokemon_info = GetEntInfo(pokemon); + + if (pokemon_info->monster_behavior == BEHAVIOR_RESCUE_TARGET) + return TRUE; + + if (IsExperienceLocked(pokemon_info)) + return TRUE; + + if (!pokemon_info->is_team_leader && ShouldMonsterRunAway(pokemon)) + return TRUE; + + if (CheckVariousStatuses2(pokemon, FALSE)) + return TRUE; + + if (CheckVariousStatuses(pokemon)) + return TRUE; + + if (IsChargingAnyTwoTurnMove(pokemon, FALSE)) + return TRUE; + + if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_WRAPPED) + return TRUE; + + if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_WRAP) + return TRUE; + + return FALSE; +} From e820198a747776ad3f540486e131a15d3f705f6c Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Mon, 2 Dec 2024 00:02:39 -0600 Subject: [PATCH 5/5] Decomped IsBlinded --- asm/include/overlay_29_0231513C.inc | 33 - asm/include/overlay_29_02317844.inc | 51 + asm/overlay_29_0231513C.s | 1516 --------------------------- asm/overlay_29_02317844.s | 1490 ++++++++++++++++++++++++++ include/dungeon_statuses.h | 11 + main.lsf | 2 + src/dungeon_capabilities.c | 2 +- src/dungeon_statuses.c | 17 + 8 files changed, 1572 insertions(+), 1550 deletions(-) create mode 100644 asm/include/overlay_29_02317844.inc create mode 100644 asm/overlay_29_02317844.s create mode 100644 include/dungeon_statuses.h create mode 100644 src/dungeon_statuses.c diff --git a/asm/include/overlay_29_0231513C.inc b/asm/include/overlay_29_0231513C.inc index f9b4027f..c6f5736e 100644 --- a/asm/include/overlay_29_0231513C.inc +++ b/asm/include/overlay_29_0231513C.inc @@ -19,20 +19,13 @@ .public ExclusiveItemEffectIsActiveWithLogging .public GetFloorType .public GetIdleAnimationId -.public GetMaxPp -.public GetMaxPpWrapper -.public GetMobilityType .public GetMonsterApparentId .public GetMonsterIdFromSpawnEntry .public GetNameWithGender -.public GravityIsActive .public HasHeldItem -.public HasTypeAffectedByGravity .public HiddenStairsTrigger .public IqSkillIsEnabled -.public IsMonster__02318AB0 .public IsProtectedFromNegativeStatus -.public LogMessageByIdWithPopupCheckUser .public LogMessageByIdWithPopupCheckUserTarget .public LowerSpeed .public MewSpawnCheck @@ -42,11 +35,9 @@ .public PERISH_SONG_TURN_RANGE .public SafeguardIsActive .public ShouldDisplayEntityWrapper -.public ShowPpRestoreEffect .public SubFixedPoint .public SubstitutePlaceholderStringTags .public TryActivateQuickFeet -.public TryActivateSteadfast .public TryRemoveSnatchedMonsterFromDungeonStruct .public UpdateCamera .public UpdateMinimap @@ -55,15 +46,6 @@ .public _s32_div_f .public ov10_022C4470 .public ov10_022C44B0 -.public ov10_022C4620 -.public ov10_022C4628 -.public ov10_022C4764 -.public ov10_022C4768 -.public ov10_022C476C -.public ov10_022C4774 -.public ov10_022C4778 -.public ov10_022C477C -.public ov10_022C4780 .public ov10_022C4784 .public ov10_022C4788 .public ov10_022C4790 @@ -78,11 +60,7 @@ .public ov10_022C47FC .public ov10_022C480C .public ov10_022C4828 -.public ov10_022C4830 -.public ov10_022C4838 .public ov10_022C4848 -.public ov10_022C486C -.public ov10_022C487C .public ov29_022E41DC .public ov29_022E442C .public ov29_022E4430 @@ -113,22 +91,11 @@ .public ov29_022E47CC .public ov29_022E4868 .public ov29_022E486C -.public ov29_022E48B8 -.public ov29_022E4914 -.public ov29_022E49B4 -.public ov29_022E4A04 -.public ov29_022E4A54 -.public ov29_022E4AA4 -.public ov29_022E4AF0 -.public ov29_022E4B3C .public ov29_022E81F8 -.public ov29_022EACCC -.public ov29_022FB984 .public ov29_02304830 .public ov29_0234B09C .public ov29_0234B0B4 .public strcpy -.public sub_01FFB62C .public sub_02001888 .public sub_02024FB8 .public sub_02050EBC diff --git a/asm/include/overlay_29_02317844.inc b/asm/include/overlay_29_02317844.inc new file mode 100644 index 00000000..1fcf23e2 --- /dev/null +++ b/asm/include/overlay_29_02317844.inc @@ -0,0 +1,51 @@ +#pragma once +.public AdvanceFrame +.public CalcStatusDuration +.public DUNGEON_PTR +.public DungeonRandInt +.public EndInvisibleClassStatus +.public EntityIsValid__02315118 +.public GetMaxPp +.public GetMaxPpWrapper +.public GetMobilityType +.public GravityIsActive +.public HasTypeAffectedByGravity +.public IsMonster__02318AB0 +.public IsProtectedFromNegativeStatus +.public LogMessageByIdWithPopupCheckUser +.public LogMessageByIdWithPopupCheckUserTarget +.public SafeguardIsActive +.public ShowPpRestoreEffect +.public SubstitutePlaceholderStringTags +.public TryActivateQuickFeet +.public TryActivateSteadfast +.public TryIncreaseHp +.public TryRemoveSnatchedMonsterFromDungeonStruct +.public UpdateCamera +.public UpdateMinimap +.public UpdateStatusIconFlags +.public UpdateTrapsVisibility +.public ov10_022C4620 +.public ov10_022C4628 +.public ov10_022C4764 +.public ov10_022C4768 +.public ov10_022C476C +.public ov10_022C4774 +.public ov10_022C4778 +.public ov10_022C477C +.public ov10_022C4780 +.public ov10_022C4830 +.public ov10_022C4838 +.public ov10_022C486C +.public ov10_022C487C +.public ov29_022E48B8 +.public ov29_022E4914 +.public ov29_022E49B4 +.public ov29_022E4A04 +.public ov29_022E4A54 +.public ov29_022E4AA4 +.public ov29_022E4AF0 +.public ov29_022E4B3C +.public ov29_022EACCC +.public ov29_022FB984 +.public sub_01FFB62C diff --git a/asm/overlay_29_0231513C.s b/asm/overlay_29_0231513C.s index 24b53be2..8d798641 100644 --- a/asm/overlay_29_0231513C.s +++ b/asm/overlay_29_0231513C.s @@ -2960,1519 +2960,3 @@ _023177DC: .word 0x00000D34 _023177E0: .word 0x00000D35 #endif arm_func_end TryInflictBlinkerStatus - - arm_func_start IsBlinded -IsBlinded: ; 0x023177E4 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl EntityIsValid__02315118 - cmp r0, #0 - beq _0231783C - ldr r1, [r5, #0xb4] - ldrb r0, [r1, #0xf1] - cmp r0, #1 - beq _02317834 - cmp r4, #0 - beq _0231783C - ldrb r0, [r1, #7] - cmp r0, #0 - bne _0231783C - mov r0, r5 - mov r1, #0xe - bl ItemIsActive__0231513C - cmp r0, #0 - beq _0231783C -_02317834: - mov r0, #1 - ldmia sp!, {r3, r4, r5, pc} -_0231783C: - mov r0, #0 - ldmia sp!, {r3, r4, r5, pc} - arm_func_end IsBlinded - - arm_func_start TryInflictCrossEyedStatus -TryInflictCrossEyedStatus: ; 0x02317844 - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - mov r6, r0 - mov r0, r5 - mov r4, r2 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl SafeguardIsActive - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, pc} - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl IsProtectedFromNegativeStatus - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, pc} - cmp r4, #0 - movne r0, #1 - ldmneia sp!, {r4, r5, r6, pc} - mov r0, #0 - ldr r4, [r5, #0xb4] - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r4, #0xf1] - cmp r0, #2 - beq _02317930 - mov r0, r5 - bl ov29_022E48B8 - ldr r2, _02317950 ; =0x00000D36 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - mov r3, #2 - ldr r1, _02317954 ; =ov10_022C4830 - mov r0, r5 - mov r2, #1 - strb r3, [r4, #0xf1] - bl CalcStatusDuration - add r2, r0, #1 - mov r0, r6 - mov r1, r5 - strb r2, [r4, #0xf2] - bl TryActivateSteadfast - mov r0, #1 - bl UpdateCamera - bl UpdateTrapsVisibility - bl UpdateMinimap - mov r0, r6 - mov r1, r5 - bl TryActivateQuickFeet - b _02317940 -_02317930: - ldr r2, _02317958 ; =0x00000D37 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_02317940: - mov r0, r5 - bl UpdateStatusIconFlags - mov r0, #1 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_02317950: .word 0x00000A76 -_02317954: .word ov10_022C4830 -_02317958: .word 0x00000A77 -#else -_02317950: .word 0x00000D36 -_02317954: .word ov10_022C4830 -_02317958: .word 0x00000D37 -#endif - arm_func_end TryInflictCrossEyedStatus - - arm_func_start TryInflictEyedropStatus -TryInflictEyedropStatus: ; 0x0231795C - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - mov r6, r0 - mov r0, r5 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, #0 - ldr r4, [r5, #0xb4] - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r4, #0xf1] - cmp r0, #3 - beq _023179E4 - ldr r1, _02317A00 ; =ov10_022C4838 - mov r3, #3 - mov r0, r5 - mov r2, #0 - strb r3, [r4, #0xf1] - bl CalcStatusDuration - add r1, r0, #1 - mov r0, r5 - strb r1, [r4, #0xf2] - bl ov29_022E4914 - ldr r2, _02317A04 ; =0x00000D38 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - mov r0, #0x31 - bl AdvanceFrame - bl UpdateTrapsVisibility - bl UpdateMinimap - b _023179F4 -_023179E4: - ldr r2, _02317A08 ; =0x00000D39 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_023179F4: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_02317A00: .word ov10_022C4838 -#ifdef JAPAN -_02317A04: .word 0x00000A78 -_02317A08: .word 0x00000A79 -#else -_02317A04: .word 0x00000D38 -_02317A08: .word 0x00000D39 -#endif - arm_func_end TryInflictEyedropStatus - - arm_func_start TryInflictSlipStatus -TryInflictSlipStatus: ; 0x02317A0C - stmdb sp!, {r4, r5, r6, lr} - mov r4, r1 - mov r5, r0 - mov r0, r4 - bl EntityIsValid__02315118 - cmp r0, #0 - beq _02317A4C - ldr r0, [r4, #0xb4] - ldrsh r0, [r0, #2] - bl GetMobilityType - cmp r0, #0 - cmpne r0, #4 - moveq r0, #1 - movne r0, #0 - tst r0, #0xff - bne _02317A54 -_02317A4C: - mov r0, #0 - ldmia sp!, {r4, r5, r6, pc} -_02317A54: - ldr r6, [r4, #0xb4] - ldrb r0, [r6, #0xef] - cmp r0, #4 - beq _02317AB8 - mov r0, r5 - mov r1, r4 - mov r2, #0 - bl EndInvisibleClassStatus - mov r3, #4 - ldr r1, _02317AE8 ; =ov10_022C486C - mov r0, r4 - mov r2, #1 - strb r3, [r6, #0xef] - bl CalcStatusDuration - add r3, r0, #1 - mov r0, #0 - mov r1, r4 - mov r2, r0 - strb r3, [r6, #0xf0] - bl SubstitutePlaceholderStringTags - ldr r2, _02317AEC ; =0x00000D3A - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget - b _02317AD8 -_02317AB8: - mov r0, #0 - mov r1, r4 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _02317AF0 ; =0x00000D3B - mov r0, r5 - mov r1, r4 - bl LogMessageByIdWithPopupCheckUserTarget -_02317AD8: - mov r0, r4 - bl UpdateStatusIconFlags - mov r0, #1 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_02317AE8: .word ov10_022C486C -#ifdef JAPAN -_02317AEC: .word 0x00000A7A -_02317AF0: .word 0x00000A7B -#else -_02317AEC: .word 0x00000D3A -_02317AF0: .word 0x00000D3B -#endif - arm_func_end TryInflictSlipStatus - - arm_func_start TryInflictDropeyeStatus -TryInflictDropeyeStatus: ; 0x02317AF4 - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - mov r6, r0 - mov r0, r5 - bl EntityIsValid__02315118 - cmp r0, #0 - beq _02317B40 - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl SafeguardIsActive - cmp r0, #0 - bne _02317B40 - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl IsProtectedFromNegativeStatus - cmp r0, #0 - beq _02317B48 -_02317B40: - mov r0, #0 - ldmia sp!, {r4, r5, r6, pc} -_02317B48: - ldr r4, [r5, #0xb4] - ldrb r0, [r4, #0xf1] - cmp r0, #1 - bne _02317B70 - ldr r2, _02317C0C ; =0x00000D3E - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - mov r0, #0 - ldmia sp!, {r4, r5, r6, pc} -_02317B70: - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r4, #0xf1] - cmp r0, #4 - beq _02317BEC - ldr r1, _02317C10 ; =ov10_022C487C - mov r3, #4 - mov r0, r5 - mov r2, #1 - strb r3, [r4, #0xf1] - bl CalcStatusDuration - add r1, r0, #1 - mov r0, r5 - strb r1, [r4, #0xf2] - bl sub_01FFB62C - ldr r0, _02317C14 ; =0x00000115 - bl ov29_022EACCC - ldr r2, _02317C18 ; =0x00000D3C - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - mov r0, #0x31 - bl AdvanceFrame - bl UpdateTrapsVisibility - bl UpdateMinimap - mov r0, r6 - mov r1, r5 - bl TryActivateQuickFeet - b _02317BFC -_02317BEC: - ldr r2, _02317C1C ; =0x00000D3D - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_02317BFC: - mov r0, r5 - bl UpdateStatusIconFlags - mov r0, #1 - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -#define TRY_INFLICT_DROPEYE_STATUS_OFFSET -0x2C0 -#else -#define TRY_INFLICT_DROPEYE_STATUS_OFFSET 0 -#endif -_02317C0C: .word 0x00000D3E + TRY_INFLICT_DROPEYE_STATUS_OFFSET -_02317C10: .word ov10_022C487C -_02317C14: .word 0x00000115 -_02317C18: .word 0x00000D3C + TRY_INFLICT_DROPEYE_STATUS_OFFSET -_02317C1C: .word 0x00000D3D + TRY_INFLICT_DROPEYE_STATUS_OFFSET - arm_func_end TryInflictDropeyeStatus - - arm_func_start RestoreAllMovePP -RestoreAllMovePP: ; 0x02317C20 - stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #8 - mov sb, r1 - mov sl, r0 - mov r0, sb - mov fp, r2 - mov r8, r3 - mov r6, #0 - bl EntityIsValid__02315118 - cmp r0, #0 - beq _02317D48 - ldr r0, [sb, #0xb4] - mov r5, r6 -#ifdef JAPAN - add r4, r0, #0x120 -#else - add r4, r0, #0x124 -#endif -_02317C58: - ldrb r0, [r4, r5, lsl #3] - add r7, r4, r5, lsl #3 - tst r0, #1 - movne r0, #1 - moveq r0, #0 - tst r0, #0xff - beq _02317CD0 - ldrb r1, [r7, #6] - mov r0, r7 - str r1, [sp, #4] - bl GetMaxPp - str r0, [sp] - mov r0, r7 - bl GetMaxPpWrapper - str r0, [sp] - ldr r1, [sp, #4] - ldr r0, [sp] - cmp r1, r0 - bge _02317CD0 - ldr r0, [sp, #4] - mov r6, #1 - add r0, r0, fp - str r0, [sp, #4] - ldr r1, [sp, #4] - ldr r0, [sp] - cmp r1, r0 - ldrgt r0, [sp] - strgt r0, [sp, #4] - ldr r0, [sp, #4] - strb r0, [r7, #6] -_02317CD0: - add r5, r5, #1 - cmp r5, #4 - blt _02317C58 - cmp r6, #0 - beq _02317D18 - mov r0, sb - bl ShowPpRestoreEffect - cmp r8, #0 - bne _02317D40 - mov r0, #0 - mov r1, sb - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _02317D50 ; =0x00000DB3 - mov r0, sl - mov r1, sb - bl LogMessageByIdWithPopupCheckUserTarget - b _02317D40 -_02317D18: - cmp r8, #0 - bne _02317D40 - mov r0, #0 - mov r1, sb - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _02317D54 ; =0x00000DB4 - mov r0, sl - mov r1, sb - bl LogMessageByIdWithPopupCheckUserTarget -_02317D40: - mov r0, sb - bl UpdateStatusIconFlags -_02317D48: - add sp, sp, #8 - ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} - .align 2, 0 -#ifdef JAPAN -_02317D50: .word 0x00000AF3 -_02317D54: .word 0x00000AF4 -#else -_02317D50: .word 0x00000DB3 -_02317D54: .word 0x00000DB4 -#endif - arm_func_end RestoreAllMovePP - - arm_func_start RestoreOneMovePP -RestoreOneMovePP: ; 0x02317D58 - stmdb sp!, {r4, r5, r6, r7, r8, lr} - sub sp, sp, #8 - mov r7, r1 - mov r8, r0 - mov r0, r7 - mov r5, r2 - mov r6, r3 - mov r4, #0 - bl EntityIsValid__02315118 - cmp r0, #0 - beq _02317E78 - ldr r0, [r7, #0xb4] -#ifdef JAPAN - add r1, r0, #0x120 -#else - add r1, r0, #0x124 -#endif - ldrb r0, [r1, r5, lsl #3] - add r5, r1, r5, lsl #3 - tst r0, #1 - movne r0, #1 - moveq r0, r4 - tst r0, #0xff - beq _02317E78 - ldrb r1, [r5, #6] - mov r0, r5 - str r1, [sp, #4] - bl GetMaxPp - str r0, [sp] - mov r0, r5 - bl GetMaxPpWrapper - str r0, [sp] - ldr r1, [sp, #4] - ldr r0, [sp] - cmp r1, r0 - bge _02317E04 - ldr r0, [sp, #4] - mov r4, #1 - add r0, r0, r6 - str r0, [sp, #4] - ldr r1, [sp, #4] - ldr r0, [sp] - cmp r1, r0 - ldrgt r0, [sp] - strgt r0, [sp, #4] - ldr r0, [sp, #4] - strb r0, [r5, #6] -_02317E04: - cmp r4, #0 - beq _02317E44 - mov r0, r7 - bl ShowPpRestoreEffect - ldrb r0, [sp, #0x20] - cmp r0, #0 - beq _02317E70 - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _02317E80 ; =0x00000DB3 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget - b _02317E70 -_02317E44: - ldrb r0, [sp, #0x20] - cmp r0, #0 - beq _02317E70 - mov r0, #0 - mov r1, r7 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, _02317E84 ; =0x00000DB4 - mov r0, r8 - mov r1, r7 - bl LogMessageByIdWithPopupCheckUserTarget -_02317E70: - mov r0, r7 - bl UpdateStatusIconFlags -_02317E78: - add sp, sp, #8 - ldmia sp!, {r4, r5, r6, r7, r8, pc} - .align 2, 0 -#ifdef JAPAN -_02317E80: .word 0x00000AF3 -_02317E84: .word 0x00000AF4 -#else -_02317E80: .word 0x00000DB3 -_02317E84: .word 0x00000DB4 -#endif - arm_func_end RestoreOneMovePP - - arm_func_start RestoreRandomMovePP -RestoreRandomMovePP: ; 0x02317E88 - stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} - sub sp, sp, #0x14 - mov sb, r1 - ldr r1, [sb, #0xb4] - mov r6, #0 - mov sl, r0 - mov r8, r2 - mov r7, r3 - mov r5, r6 -#ifdef JAPAN - add r4, r1, #0x120 -#else - add r4, r1, #0x124 -#endif - add fp, sp, #0xc -_02317EB4: - ldrb r1, [r4, r5, lsl #3] - add r0, r4, r5, lsl #3 - tst r1, #1 - movne r1, #1 - moveq r1, #0 - tst r1, #0xff - beq _02317F00 - ldrb r1, [r0, #6] - str r1, [sp, #8] - bl GetMaxPp - str r0, [sp, #4] - ldr r1, [sp, #8] - ldr r0, [sp, #4] - cmp r1, r0 - addlt r0, r6, #1 - movlt r1, r6, lsl #1 - movlt r0, r0, lsl #0x10 - strlth r5, [fp, r1] - movlt r6, r0, asr #0x10 -_02317F00: - add r0, r5, #1 - mov r0, r0, lsl #0x10 - mov r5, r0, asr #0x10 - cmp r5, #4 - blt _02317EB4 - cmp r6, #0 - ble _02317F48 - mov r0, r6 - bl DungeonRandInt - mov r0, r0, lsl #0x10 - add r1, sp, #0xc - mov r0, r0, asr #0xf - ldrh r2, [r1, r0] - mov r0, sl - mov r1, sb - mov r3, r8 - str r7, [sp] - bl RestoreOneMovePP -_02317F48: - add sp, sp, #0x14 - ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} - arm_func_end RestoreRandomMovePP - - arm_func_start ApplyProteinEffect -ApplyProteinEffect: ; 0x02317F50 - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - mov r6, r0 - mov r0, r5 - mov r4, r2 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, [r5, #0xb4] - ldrb r3, [r2, #0x1a] - add r1, r3, r4 - cmp r1, #0xff - movge r1, #0xff - and r0, r1, #0xff - strb r1, [r2, #0x1a] - cmp r3, r0 - bhs _02317FC0 - mov r0, r5 - bl ov29_022E49B4 - ldr r2, _02317FDC ; =0x00000D96 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - b _02317FD0 -_02317FC0: - ldr r2, _02317FE0 ; =0x00000D97 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_02317FD0: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_02317FDC: .word 0x00000AD6 -_02317FE0: .word 0x00000AD7 -#else -_02317FDC: .word 0x00000D96 -_02317FE0: .word 0x00000D97 -#endif - arm_func_end ApplyProteinEffect - - arm_func_start ApplyCalciumEffect -ApplyCalciumEffect: ; 0x02317FE4 - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - mov r6, r0 - mov r0, r5 - mov r4, r2 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, [r5, #0xb4] - ldrb r3, [r2, #0x1b] - add r1, r3, r4 - cmp r1, #0xff - movge r1, #0xff - and r0, r1, #0xff - strb r1, [r2, #0x1b] - cmp r3, r0 - bhs _02318054 - mov r0, r5 - bl ov29_022E4A04 - ldr r2, _02318070 ; =0x00000D98 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - b _02318064 -_02318054: - ldr r2, _02318074 ; =0x00000D99 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_02318064: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_02318070: .word 0x00000AD8 -_02318074: .word 0x00000AD9 -#else -_02318070: .word 0x00000D98 -_02318074: .word 0x00000D99 -#endif - arm_func_end ApplyCalciumEffect - - arm_func_start ApplyIronEffect -ApplyIronEffect: ; 0x02318078 - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - mov r6, r0 - mov r0, r5 - mov r4, r2 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, [r5, #0xb4] - ldrb r3, [r2, #0x1c] - add r1, r3, r4 - cmp r1, #0xff - movge r1, #0xff - and r0, r1, #0xff - strb r1, [r2, #0x1c] - cmp r3, r0 - bhs _023180E8 - mov r0, r5 - bl ov29_022E4A54 - ldr r2, _02318104 ; =0x00000D9A - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - b _023180F8 -_023180E8: - ldr r2, _02318108 ; =0x00000D9B - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_023180F8: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_02318104: .word 0x00000ADA -_02318108: .word 0x00000ADB -#else -_02318104: .word 0x00000D9A -_02318108: .word 0x00000D9B -#endif - arm_func_end ApplyIronEffect - - arm_func_start ApplyZincEffect -ApplyZincEffect: ; 0x0231810C - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - mov r6, r0 - mov r0, r5 - mov r4, r2 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, #0 - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r2, [r5, #0xb4] - ldrb r3, [r2, #0x1d] - add r1, r3, r4 - cmp r1, #0xff - movge r1, #0xff - and r0, r1, #0xff - strb r1, [r2, #0x1d] - cmp r3, r0 - bhs _0231817C - mov r0, r5 - bl ov29_022E4AA4 - ldr r2, _02318198 ; =0x00000D9C - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231818C -_0231817C: - ldr r2, _0231819C ; =0x00000D9D - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_0231818C: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_02318198: .word 0x00000ADC -_0231819C: .word 0x00000ADD -#else -_02318198: .word 0x00000D9C -_0231819C: .word 0x00000D9D -#endif - arm_func_end ApplyZincEffect - - arm_func_start TryInflictLongTossStatus -TryInflictLongTossStatus: ; 0x023181A0 - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - ldr r4, [r5, #0xb4] - mov r6, r0 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r4, #0xee] - cmp r0, #1 - beq _023181EC - mov r1, #1 - mov r0, r5 - strb r1, [r4, #0xee] - bl ov29_022E4AF0 - ldr r2, _02318208 ; =0x00000DDD - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - b _023181FC -_023181EC: - ldr r2, _0231820C ; =0x00000DDE - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_023181FC: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_02318208: .word 0x00000B1D -_0231820C: .word 0x00000B1E -#else -_02318208: .word 0x00000DDD -_0231820C: .word 0x00000DDE -#endif - arm_func_end TryInflictLongTossStatus - - arm_func_start TryInflictPierceStatus -TryInflictPierceStatus: ; 0x02318210 - stmdb sp!, {r4, r5, r6, lr} - mov r5, r1 - ldr r4, [r5, #0xb4] - mov r6, r0 - mov r0, #1 - mov r2, #0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r4, #0xee] - cmp r0, #2 - beq _0231825C - mov r1, #2 - mov r0, r5 - strb r1, [r4, #0xee] - bl ov29_022E4B3C - ldr r2, _02318278 ; =0x00000DDF - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - b _0231826C -_0231825C: - mov r0, r6 - mov r1, r5 -#ifdef JAPAN - mov r2, #0xb20 -#else - mov r2, #0xde0 -#endif - bl LogMessageByIdWithPopupCheckUserTarget -_0231826C: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -_02318278: .word 0x00000B1F -#else -_02318278: .word 0x00000DDF -#endif - arm_func_end TryInflictPierceStatus - - arm_func_start TryInflictGastroAcidStatus -TryInflictGastroAcidStatus: ; 0x0231827C - stmdb sp!, {r4, r5, r6, r7, r8, lr} - mov r7, r0 - mov r6, r1 - mov r5, r2 - mov r8, r3 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, r5, r6, r7, r8, pc} - mov r0, r6 - bl EntityIsValid__02315118 - cmp r0, #0 - mov r0, #0 - ldmeqia sp!, {r4, r5, r6, r7, r8, pc} - mov r1, r6 - mov r2, r0 - ldr r4, [r6, #0xb4] - bl SubstitutePlaceholderStringTags - mov r0, r7 - mov r1, r6 - mov r2, #1 - bl SafeguardIsActive - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, r7, r8, pc} - mov r0, r7 - mov r1, r6 - mov r2, #1 - bl IsProtectedFromNegativeStatus - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r4, r5, r6, r7, r8, pc} - cmp r8, #0 - movne r0, #1 - ldmneia sp!, {r4, r5, r6, r7, r8, pc} - ldrb r0, [r4, #0xd8] - cmp r0, #4 - beq _02318388 - mov r0, r7 - mov r1, r6 - bl TryRemoveSnatchedMonsterFromDungeonStruct - mov r3, #4 - ldr r1, _023183B0 ; =ov10_022C476C - mov r0, r6 - mov r2, #1 - strb r3, [r4, #0xd8] - bl CalcStatusDuration - add r0, r0, #1 - strb r0, [r4, #0xdb] - mov r1, #0 - ldr r0, _023183B4 ; =DUNGEON_PTR - strb r1, [r4, #0xdc] - ldr r0, [r0] - mov r1, #1 - strb r1, [r0, #0xe] - cmp r5, #0 - beq _02318370 - ldr r2, _023183B8 ; =0x00000D7B - mov r0, r7 - mov r1, r6 - bl LogMessageByIdWithPopupCheckUserTarget -_02318370: - mov r0, r7 - mov r1, r6 - bl TryActivateQuickFeet - mov r0, r6 - bl ov29_022FB984 - b _023183A0 -_02318388: - cmp r5, #0 - beq _023183A0 - ldr r2, _023183BC ; =0x00000D7C - mov r0, r7 - mov r1, r6 - bl LogMessageByIdWithPopupCheckUserTarget -_023183A0: - mov r0, r6 - bl UpdateStatusIconFlags - mov r0, #1 - ldmia sp!, {r4, r5, r6, r7, r8, pc} - .align 2, 0 -_023183B0: .word ov10_022C476C -_023183B4: .word DUNGEON_PTR -#ifdef JAPAN -_023183B8: .word 0x00000ABB -_023183BC: .word 0x00000ABC -#else -_023183B8: .word 0x00000D7B -_023183BC: .word 0x00000D7C -#endif - arm_func_end TryInflictGastroAcidStatus - - arm_func_start SetAquaRingHealingCountdownTo4 -SetAquaRingHealingCountdownTo4: ; 0x023183C0 - stmdb sp!, {r4, lr} - mov r4, r0 - bl EntityIsValid__02315118 - cmp r0, #0 - ldrne r0, _023183E4 ; =ov10_022C4620 - ldrne r1, [r4, #0xb4] - ldrnesh r0, [r0] - strneb r0, [r1, #0xd7] - ldmia sp!, {r4, pc} - .align 2, 0 -_023183E4: .word ov10_022C4620 - arm_func_end SetAquaRingHealingCountdownTo4 - - arm_func_start ApplyAquaRingHealing -ApplyAquaRingHealing: ; 0x023183E8 - stmdb sp!, {r3, r4, lr} - sub sp, sp, #4 - mov r4, r0 - bl EntityIsValid__02315118 - cmp r0, #0 - beq _0231844C - ldr r3, [r4, #0xb4] - ldr r0, _02318454 ; =0x000003E7 - ldrsh r2, [r3, #0x12] - ldrsh r1, [r3, #0x16] - add r1, r2, r1 - cmp r1, r0 - movgt r1, r0 - ldrsh r0, [r3, #0x10] - cmp r0, r1 - bge _02318444 - ldr r0, _02318458 ; =ov10_022C4628 - mov r3, #0 - ldrsh r2, [r0] - mov r0, r4 - mov r1, r4 - str r3, [sp] - bl TryIncreaseHp -_02318444: - mov r0, r4 - bl SetAquaRingHealingCountdownTo4 -_0231844C: - add sp, sp, #4 - ldmia sp!, {r3, r4, pc} - .align 2, 0 -_02318454: .word 0x000003E7 -_02318458: .word ov10_022C4628 - arm_func_end ApplyAquaRingHealing - - arm_func_start TryInflictAquaRingStatus -TryInflictAquaRingStatus: ; 0x0231845C - stmdb sp!, {r4, r5, r6, lr} - mov r6, r0 - mov r5, r1 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, r5 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, #0 - ldr r4, [r5, #0xb4] - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r4, #0xd5] - cmp r0, #0x10 - beq _023184E0 - ldr r1, _023184FC ; =ov10_022C4764 - mov r3, #0x10 - mov r0, r5 - mov r2, #0 - strb r3, [r4, #0xd5] - bl CalcStatusDuration - add r1, r0, #1 - mov r0, r5 - strb r1, [r4, #0xd6] - bl SetAquaRingHealingCountdownTo4 - ldr r2, _02318500 ; =0x00000D7D - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - b _023184F0 -_023184E0: - ldr r2, _02318504 ; =0x00000D7E - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_023184F0: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_023184FC: .word ov10_022C4764 -#ifdef JAPAN -_02318500: .word 0x00000ABD -_02318504: .word 0x00000ABE -#else -_02318500: .word 0x00000D7D -_02318504: .word 0x00000D7E -#endif - arm_func_end TryInflictAquaRingStatus - - arm_func_start TryInflictLuckyChantStatus -TryInflictLuckyChantStatus: ; 0x02318508 - stmdb sp!, {r4, r5, r6, lr} - mov r6, r0 - mov r5, r1 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, r5 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, #0 - ldr r4, [r5, #0xb4] - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r4, #0xd5] - cmp r0, #0x11 - beq _02318584 - ldr r1, _023185A0 ; =ov10_022C4768 - mov r3, #0x11 - mov r0, r5 - mov r2, #0 - strb r3, [r4, #0xd5] - bl CalcStatusDuration - add r3, r0, #1 - ldr r2, _023185A4 ; =0x00000D7F - mov r0, r6 - mov r1, r5 - strb r3, [r4, #0xd6] - bl LogMessageByIdWithPopupCheckUserTarget - b _02318594 -_02318584: - mov r0, r6 - mov r1, r5 -#ifdef JAPAN - mov r2, #0xac0 -#else - mov r2, #0xd80 -#endif - bl LogMessageByIdWithPopupCheckUserTarget -_02318594: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -_023185A0: .word ov10_022C4768 -#ifdef JAPAN -_023185A4: .word 0x00000ABF -#else -_023185A4: .word 0x00000D7F -#endif - arm_func_end TryInflictLuckyChantStatus - - arm_func_start TryInflictHealBlockStatus -TryInflictHealBlockStatus: ; 0x023185A8 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r6, r0 - mov r5, r1 - mov r4, r2 - mov r7, r3 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r5 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl SafeguardIsActive - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl IsProtectedFromNegativeStatus - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - cmp r7, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, #0 - ldr r7, [r5, #0xb4] - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r7, #0xd8] - cmp r0, #5 - beq _02318698 - mov r0, r6 - mov r1, r5 - bl TryRemoveSnatchedMonsterFromDungeonStruct - mov r3, #5 - ldr r1, _023186C0 ; =ov10_022C4774 - mov r0, r5 - mov r2, #1 - strb r3, [r7, #0xd8] - bl CalcStatusDuration - add r0, r0, #1 - strb r0, [r7, #0xdb] - cmp r4, #0 - beq _02318688 - ldr r2, _023186C4 ; =0x00000D81 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_02318688: - mov r0, r6 - mov r1, r5 - bl TryActivateQuickFeet - b _023186B0 -_02318698: - cmp r4, #0 - beq _023186B0 - ldr r2, _023186C8 ; =0x00000D82 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_023186B0: - mov r0, r5 - bl UpdateStatusIconFlags - mov r0, #1 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_023186C0: .word ov10_022C4774 -#ifdef JAPAN -_023186C4: .word 0x00000AC1 -_023186C8: .word 0x00000AC2 -#else -_023186C4: .word 0x00000D81 -_023186C8: .word 0x00000D82 -#endif - arm_func_end TryInflictHealBlockStatus - - arm_func_start MonsterHasEmbargoStatus -MonsterHasEmbargoStatus: ; 0x023186CC - stmdb sp!, {r4, lr} - mov r4, r0 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #0xd8] - cmp r0, #6 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - arm_func_end MonsterHasEmbargoStatus - - arm_func_start LogItemBlockedByEmbargo -LogItemBlockedByEmbargo: ; 0x02318700 - stmdb sp!, {r4, lr} - mov r4, r0 - mov r0, #0 - mov r1, r4 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldr r1, _02318728 ; =0x00000D86 - mov r0, r4 - bl LogMessageByIdWithPopupCheckUser - ldmia sp!, {r4, pc} - .align 2, 0 -#ifdef JAPAN -_02318728: .word 0x00000AC6 -#else -_02318728: .word 0x00000D86 -#endif - arm_func_end LogItemBlockedByEmbargo - - arm_func_start TryInflictEmbargoStatus -TryInflictEmbargoStatus: ; 0x0231872C - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r6, r0 - mov r5, r1 - mov r4, r2 - mov r7, r3 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r5 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl SafeguardIsActive - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r6 - mov r1, r5 - mov r2, #1 - bl IsProtectedFromNegativeStatus - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - cmp r7, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, #0 - ldr r7, [r5, #0xb4] - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r7, #0xd8] - cmp r0, #6 - beq _0231881C - mov r0, r6 - mov r1, r5 - bl TryRemoveSnatchedMonsterFromDungeonStruct - mov r3, #6 - ldr r1, _02318844 ; =ov10_022C4778 - mov r0, r5 - mov r2, #1 - strb r3, [r7, #0xd8] - bl CalcStatusDuration - add r0, r0, #1 - strb r0, [r7, #0xdb] - cmp r4, #0 - beq _0231880C - ldr r2, _02318848 ; =0x00000D84 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_0231880C: - mov r0, r6 - mov r1, r5 - bl TryActivateQuickFeet - b _02318834 -_0231881C: - cmp r4, #0 - beq _02318834 - ldr r2, _0231884C ; =0x00000D85 - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_02318834: - mov r0, r5 - bl UpdateStatusIconFlags - mov r0, #1 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -_02318844: .word ov10_022C4778 -#ifdef JAPAN -_02318848: .word 0x00000AC4 -_0231884C: .word 0x00000AC5 -#else -_02318848: .word 0x00000D84 -_0231884C: .word 0x00000D85 -#endif - arm_func_end TryInflictEmbargoStatus - - arm_func_start TryInflictMiracleEyeStatus -TryInflictMiracleEyeStatus: ; 0x02318850 - stmdb sp!, {r3, r4, r5, r6, r7, lr} - mov r7, r0 - mov r6, r1 - mov r5, r2 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r6 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r7 - mov r1, r6 - mov r2, #1 - bl SafeguardIsActive - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - mov r0, r7 - mov r1, r6 - mov r2, #1 - bl IsProtectedFromNegativeStatus - cmp r0, #0 - mov r0, #0 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - mov r1, r6 - mov r2, r0 - ldr r4, [r6, #0xb4] - bl SubstitutePlaceholderStringTags - mov r0, r6 - mov r1, #0x10 - bl HasTypeAffectedByGravity - cmp r0, #0 - bne _02318900 - cmp r5, #0 - bne _023188F8 - ldr r2, _02318974 ; =0x00000D89 - mov r0, r7 - mov r1, r6 - bl LogMessageByIdWithPopupCheckUserTarget -_023188F8: - mov r0, #0 - ldmia sp!, {r3, r4, r5, r6, r7, pc} -_02318900: - cmp r5, #0 - movne r0, #1 - ldmneia sp!, {r3, r4, r5, r6, r7, pc} - ldrb r0, [r4, #0xf5] - cmp r0, #1 - beq _02318954 - ldr r1, _02318978 ; =ov10_022C477C - mov r2, #1 - mov r0, r6 - strb r2, [r4, #0xf5] - bl CalcStatusDuration - add r3, r0, #1 - ldr r2, _0231897C ; =0x00000D87 - mov r0, r7 - mov r1, r6 - strb r3, [r4, #0xf6] - bl LogMessageByIdWithPopupCheckUserTarget - mov r0, r7 - mov r1, r6 - bl TryActivateQuickFeet - b _02318964 -_02318954: - ldr r2, _02318980 ; =0x00000D88 - mov r0, r7 - mov r1, r6 - bl LogMessageByIdWithPopupCheckUserTarget -_02318964: - mov r0, r6 - bl UpdateStatusIconFlags - mov r0, #1 - ldmia sp!, {r3, r4, r5, r6, r7, pc} - .align 2, 0 -#ifdef JAPAN -#define TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET -0x2C0 -#else -#define TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET 0 -#endif -_02318974: .word 0x00000D89 + TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET -_02318978: .word ov10_022C477C -_0231897C: .word 0x00000D87 + TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET -_02318980: .word 0x00000D88 + TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET - arm_func_end TryInflictMiracleEyeStatus - - arm_func_start TryInflictMagnetRiseStatus -TryInflictMagnetRiseStatus: ; 0x02318984 - stmdb sp!, {r4, r5, r6, lr} - mov r6, r0 - mov r5, r1 - bl GravityIsActive - cmp r0, #0 - beq _023189B0 - ldr r2, _02318A3C ; =0x00000D8C - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget - ldmia sp!, {r4, r5, r6, pc} -_023189B0: - mov r0, r6 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, r5 - bl EntityIsValid__02315118 - cmp r0, #0 - ldmeqia sp!, {r4, r5, r6, pc} - mov r0, #0 - ldr r4, [r5, #0xb4] - mov r1, r5 - mov r2, r0 - bl SubstitutePlaceholderStringTags - ldrb r0, [r4, #0xf7] - cmp r0, #1 - beq _02318A20 - ldr r1, _02318A40 ; =ov10_022C4780 - mov r2, #1 - mov r0, r5 - strb r2, [r4, #0xf7] - bl CalcStatusDuration - add r3, r0, #1 - ldr r2, _02318A44 ; =0x00000D8A - mov r0, r6 - mov r1, r5 - strb r3, [r4, #0xf8] - bl LogMessageByIdWithPopupCheckUserTarget - b _02318A30 -_02318A20: - ldr r2, _02318A48 ; =0x00000D8B - mov r0, r6 - mov r1, r5 - bl LogMessageByIdWithPopupCheckUserTarget -_02318A30: - mov r0, r5 - bl UpdateStatusIconFlags - ldmia sp!, {r4, r5, r6, pc} - .align 2, 0 -#ifdef JAPAN -#define TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET -0x2C0 -#else -#define TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET 0 -#endif -_02318A3C: .word 0x00000D8C + TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET -_02318A40: .word ov10_022C4780 -_02318A44: .word 0x00000D8A + TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET -_02318A48: .word 0x00000D8B + TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET - arm_func_end TryInflictMagnetRiseStatus - - arm_func_start IsFloating -IsFloating: ; 0x02318A4C - stmdb sp!, {r4, lr} - mov r4, r0 - bl EntityIsValid__02315118 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - bl GravityIsActive - cmp r0, #0 - movne r0, #0 - ldmneia sp!, {r4, pc} - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #0xf7] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - ldmia sp!, {r4, pc} - arm_func_end IsFloating - - arm_func_start ov29_02318A90 -ov29_02318A90: ; 0x02318A90 - stmdb sp!, {r3, r4, r5, lr} - mov r5, r0 - mov r4, r1 - bl IsMonster__02318AB0 - cmp r0, #0 - ldrne r0, [r5, #0xb4] -#ifdef JAPAN - strneb r4, [r0, #0x10a] -#else - strneb r4, [r0, #0x10b] -#endif - ldmia sp!, {r3, r4, r5, pc} - arm_func_end ov29_02318A90 diff --git a/asm/overlay_29_02317844.s b/asm/overlay_29_02317844.s new file mode 100644 index 00000000..ce2ca0ac --- /dev/null +++ b/asm/overlay_29_02317844.s @@ -0,0 +1,1490 @@ + .include "asm/macros.inc" + .include "overlay_29_02317844.inc" + + .text + + arm_func_start TryInflictCrossEyedStatus +TryInflictCrossEyedStatus: ; 0x02317844 + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + mov r6, r0 + mov r0, r5 + mov r4, r2 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl SafeguardIsActive + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, pc} + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl IsProtectedFromNegativeStatus + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, pc} + cmp r4, #0 + movne r0, #1 + ldmneia sp!, {r4, r5, r6, pc} + mov r0, #0 + ldr r4, [r5, #0xb4] + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r4, #0xf1] + cmp r0, #2 + beq _02317930 + mov r0, r5 + bl ov29_022E48B8 + ldr r2, _02317950 ; =0x00000D36 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + mov r3, #2 + ldr r1, _02317954 ; =ov10_022C4830 + mov r0, r5 + mov r2, #1 + strb r3, [r4, #0xf1] + bl CalcStatusDuration + add r2, r0, #1 + mov r0, r6 + mov r1, r5 + strb r2, [r4, #0xf2] + bl TryActivateSteadfast + mov r0, #1 + bl UpdateCamera + bl UpdateTrapsVisibility + bl UpdateMinimap + mov r0, r6 + mov r1, r5 + bl TryActivateQuickFeet + b _02317940 +_02317930: + ldr r2, _02317958 ; =0x00000D37 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_02317940: + mov r0, r5 + bl UpdateStatusIconFlags + mov r0, #1 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_02317950: .word 0x00000A76 +_02317954: .word ov10_022C4830 +_02317958: .word 0x00000A77 +#else +_02317950: .word 0x00000D36 +_02317954: .word ov10_022C4830 +_02317958: .word 0x00000D37 +#endif + arm_func_end TryInflictCrossEyedStatus + + arm_func_start TryInflictEyedropStatus +TryInflictEyedropStatus: ; 0x0231795C + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + mov r6, r0 + mov r0, r5 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, #0 + ldr r4, [r5, #0xb4] + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r4, #0xf1] + cmp r0, #3 + beq _023179E4 + ldr r1, _02317A00 ; =ov10_022C4838 + mov r3, #3 + mov r0, r5 + mov r2, #0 + strb r3, [r4, #0xf1] + bl CalcStatusDuration + add r1, r0, #1 + mov r0, r5 + strb r1, [r4, #0xf2] + bl ov29_022E4914 + ldr r2, _02317A04 ; =0x00000D38 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + mov r0, #0x31 + bl AdvanceFrame + bl UpdateTrapsVisibility + bl UpdateMinimap + b _023179F4 +_023179E4: + ldr r2, _02317A08 ; =0x00000D39 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_023179F4: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_02317A00: .word ov10_022C4838 +#ifdef JAPAN +_02317A04: .word 0x00000A78 +_02317A08: .word 0x00000A79 +#else +_02317A04: .word 0x00000D38 +_02317A08: .word 0x00000D39 +#endif + arm_func_end TryInflictEyedropStatus + + arm_func_start TryInflictSlipStatus +TryInflictSlipStatus: ; 0x02317A0C + stmdb sp!, {r4, r5, r6, lr} + mov r4, r1 + mov r5, r0 + mov r0, r4 + bl EntityIsValid__02315118 + cmp r0, #0 + beq _02317A4C + ldr r0, [r4, #0xb4] + ldrsh r0, [r0, #2] + bl GetMobilityType + cmp r0, #0 + cmpne r0, #4 + moveq r0, #1 + movne r0, #0 + tst r0, #0xff + bne _02317A54 +_02317A4C: + mov r0, #0 + ldmia sp!, {r4, r5, r6, pc} +_02317A54: + ldr r6, [r4, #0xb4] + ldrb r0, [r6, #0xef] + cmp r0, #4 + beq _02317AB8 + mov r0, r5 + mov r1, r4 + mov r2, #0 + bl EndInvisibleClassStatus + mov r3, #4 + ldr r1, _02317AE8 ; =ov10_022C486C + mov r0, r4 + mov r2, #1 + strb r3, [r6, #0xef] + bl CalcStatusDuration + add r3, r0, #1 + mov r0, #0 + mov r1, r4 + mov r2, r0 + strb r3, [r6, #0xf0] + bl SubstitutePlaceholderStringTags + ldr r2, _02317AEC ; =0x00000D3A + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget + b _02317AD8 +_02317AB8: + mov r0, #0 + mov r1, r4 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _02317AF0 ; =0x00000D3B + mov r0, r5 + mov r1, r4 + bl LogMessageByIdWithPopupCheckUserTarget +_02317AD8: + mov r0, r4 + bl UpdateStatusIconFlags + mov r0, #1 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_02317AE8: .word ov10_022C486C +#ifdef JAPAN +_02317AEC: .word 0x00000A7A +_02317AF0: .word 0x00000A7B +#else +_02317AEC: .word 0x00000D3A +_02317AF0: .word 0x00000D3B +#endif + arm_func_end TryInflictSlipStatus + + arm_func_start TryInflictDropeyeStatus +TryInflictDropeyeStatus: ; 0x02317AF4 + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + mov r6, r0 + mov r0, r5 + bl EntityIsValid__02315118 + cmp r0, #0 + beq _02317B40 + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl SafeguardIsActive + cmp r0, #0 + bne _02317B40 + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl IsProtectedFromNegativeStatus + cmp r0, #0 + beq _02317B48 +_02317B40: + mov r0, #0 + ldmia sp!, {r4, r5, r6, pc} +_02317B48: + ldr r4, [r5, #0xb4] + ldrb r0, [r4, #0xf1] + cmp r0, #1 + bne _02317B70 + ldr r2, _02317C0C ; =0x00000D3E + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + mov r0, #0 + ldmia sp!, {r4, r5, r6, pc} +_02317B70: + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r4, #0xf1] + cmp r0, #4 + beq _02317BEC + ldr r1, _02317C10 ; =ov10_022C487C + mov r3, #4 + mov r0, r5 + mov r2, #1 + strb r3, [r4, #0xf1] + bl CalcStatusDuration + add r1, r0, #1 + mov r0, r5 + strb r1, [r4, #0xf2] + bl sub_01FFB62C + ldr r0, _02317C14 ; =0x00000115 + bl ov29_022EACCC + ldr r2, _02317C18 ; =0x00000D3C + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + mov r0, #0x31 + bl AdvanceFrame + bl UpdateTrapsVisibility + bl UpdateMinimap + mov r0, r6 + mov r1, r5 + bl TryActivateQuickFeet + b _02317BFC +_02317BEC: + ldr r2, _02317C1C ; =0x00000D3D + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_02317BFC: + mov r0, r5 + bl UpdateStatusIconFlags + mov r0, #1 + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +#define TRY_INFLICT_DROPEYE_STATUS_OFFSET -0x2C0 +#else +#define TRY_INFLICT_DROPEYE_STATUS_OFFSET 0 +#endif +_02317C0C: .word 0x00000D3E + TRY_INFLICT_DROPEYE_STATUS_OFFSET +_02317C10: .word ov10_022C487C +_02317C14: .word 0x00000115 +_02317C18: .word 0x00000D3C + TRY_INFLICT_DROPEYE_STATUS_OFFSET +_02317C1C: .word 0x00000D3D + TRY_INFLICT_DROPEYE_STATUS_OFFSET + arm_func_end TryInflictDropeyeStatus + + arm_func_start RestoreAllMovePP +RestoreAllMovePP: ; 0x02317C20 + stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #8 + mov sb, r1 + mov sl, r0 + mov r0, sb + mov fp, r2 + mov r8, r3 + mov r6, #0 + bl EntityIsValid__02315118 + cmp r0, #0 + beq _02317D48 + ldr r0, [sb, #0xb4] + mov r5, r6 +#ifdef JAPAN + add r4, r0, #0x120 +#else + add r4, r0, #0x124 +#endif +_02317C58: + ldrb r0, [r4, r5, lsl #3] + add r7, r4, r5, lsl #3 + tst r0, #1 + movne r0, #1 + moveq r0, #0 + tst r0, #0xff + beq _02317CD0 + ldrb r1, [r7, #6] + mov r0, r7 + str r1, [sp, #4] + bl GetMaxPp + str r0, [sp] + mov r0, r7 + bl GetMaxPpWrapper + str r0, [sp] + ldr r1, [sp, #4] + ldr r0, [sp] + cmp r1, r0 + bge _02317CD0 + ldr r0, [sp, #4] + mov r6, #1 + add r0, r0, fp + str r0, [sp, #4] + ldr r1, [sp, #4] + ldr r0, [sp] + cmp r1, r0 + ldrgt r0, [sp] + strgt r0, [sp, #4] + ldr r0, [sp, #4] + strb r0, [r7, #6] +_02317CD0: + add r5, r5, #1 + cmp r5, #4 + blt _02317C58 + cmp r6, #0 + beq _02317D18 + mov r0, sb + bl ShowPpRestoreEffect + cmp r8, #0 + bne _02317D40 + mov r0, #0 + mov r1, sb + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _02317D50 ; =0x00000DB3 + mov r0, sl + mov r1, sb + bl LogMessageByIdWithPopupCheckUserTarget + b _02317D40 +_02317D18: + cmp r8, #0 + bne _02317D40 + mov r0, #0 + mov r1, sb + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _02317D54 ; =0x00000DB4 + mov r0, sl + mov r1, sb + bl LogMessageByIdWithPopupCheckUserTarget +_02317D40: + mov r0, sb + bl UpdateStatusIconFlags +_02317D48: + add sp, sp, #8 + ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} + .align 2, 0 +#ifdef JAPAN +_02317D50: .word 0x00000AF3 +_02317D54: .word 0x00000AF4 +#else +_02317D50: .word 0x00000DB3 +_02317D54: .word 0x00000DB4 +#endif + arm_func_end RestoreAllMovePP + + arm_func_start RestoreOneMovePP +RestoreOneMovePP: ; 0x02317D58 + stmdb sp!, {r4, r5, r6, r7, r8, lr} + sub sp, sp, #8 + mov r7, r1 + mov r8, r0 + mov r0, r7 + mov r5, r2 + mov r6, r3 + mov r4, #0 + bl EntityIsValid__02315118 + cmp r0, #0 + beq _02317E78 + ldr r0, [r7, #0xb4] +#ifdef JAPAN + add r1, r0, #0x120 +#else + add r1, r0, #0x124 +#endif + ldrb r0, [r1, r5, lsl #3] + add r5, r1, r5, lsl #3 + tst r0, #1 + movne r0, #1 + moveq r0, r4 + tst r0, #0xff + beq _02317E78 + ldrb r1, [r5, #6] + mov r0, r5 + str r1, [sp, #4] + bl GetMaxPp + str r0, [sp] + mov r0, r5 + bl GetMaxPpWrapper + str r0, [sp] + ldr r1, [sp, #4] + ldr r0, [sp] + cmp r1, r0 + bge _02317E04 + ldr r0, [sp, #4] + mov r4, #1 + add r0, r0, r6 + str r0, [sp, #4] + ldr r1, [sp, #4] + ldr r0, [sp] + cmp r1, r0 + ldrgt r0, [sp] + strgt r0, [sp, #4] + ldr r0, [sp, #4] + strb r0, [r5, #6] +_02317E04: + cmp r4, #0 + beq _02317E44 + mov r0, r7 + bl ShowPpRestoreEffect + ldrb r0, [sp, #0x20] + cmp r0, #0 + beq _02317E70 + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _02317E80 ; =0x00000DB3 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget + b _02317E70 +_02317E44: + ldrb r0, [sp, #0x20] + cmp r0, #0 + beq _02317E70 + mov r0, #0 + mov r1, r7 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, _02317E84 ; =0x00000DB4 + mov r0, r8 + mov r1, r7 + bl LogMessageByIdWithPopupCheckUserTarget +_02317E70: + mov r0, r7 + bl UpdateStatusIconFlags +_02317E78: + add sp, sp, #8 + ldmia sp!, {r4, r5, r6, r7, r8, pc} + .align 2, 0 +#ifdef JAPAN +_02317E80: .word 0x00000AF3 +_02317E84: .word 0x00000AF4 +#else +_02317E80: .word 0x00000DB3 +_02317E84: .word 0x00000DB4 +#endif + arm_func_end RestoreOneMovePP + + arm_func_start RestoreRandomMovePP +RestoreRandomMovePP: ; 0x02317E88 + stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} + sub sp, sp, #0x14 + mov sb, r1 + ldr r1, [sb, #0xb4] + mov r6, #0 + mov sl, r0 + mov r8, r2 + mov r7, r3 + mov r5, r6 +#ifdef JAPAN + add r4, r1, #0x120 +#else + add r4, r1, #0x124 +#endif + add fp, sp, #0xc +_02317EB4: + ldrb r1, [r4, r5, lsl #3] + add r0, r4, r5, lsl #3 + tst r1, #1 + movne r1, #1 + moveq r1, #0 + tst r1, #0xff + beq _02317F00 + ldrb r1, [r0, #6] + str r1, [sp, #8] + bl GetMaxPp + str r0, [sp, #4] + ldr r1, [sp, #8] + ldr r0, [sp, #4] + cmp r1, r0 + addlt r0, r6, #1 + movlt r1, r6, lsl #1 + movlt r0, r0, lsl #0x10 + strlth r5, [fp, r1] + movlt r6, r0, asr #0x10 +_02317F00: + add r0, r5, #1 + mov r0, r0, lsl #0x10 + mov r5, r0, asr #0x10 + cmp r5, #4 + blt _02317EB4 + cmp r6, #0 + ble _02317F48 + mov r0, r6 + bl DungeonRandInt + mov r0, r0, lsl #0x10 + add r1, sp, #0xc + mov r0, r0, asr #0xf + ldrh r2, [r1, r0] + mov r0, sl + mov r1, sb + mov r3, r8 + str r7, [sp] + bl RestoreOneMovePP +_02317F48: + add sp, sp, #0x14 + ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc} + arm_func_end RestoreRandomMovePP + + arm_func_start ApplyProteinEffect +ApplyProteinEffect: ; 0x02317F50 + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + mov r6, r0 + mov r0, r5 + mov r4, r2 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, [r5, #0xb4] + ldrb r3, [r2, #0x1a] + add r1, r3, r4 + cmp r1, #0xff + movge r1, #0xff + and r0, r1, #0xff + strb r1, [r2, #0x1a] + cmp r3, r0 + bhs _02317FC0 + mov r0, r5 + bl ov29_022E49B4 + ldr r2, _02317FDC ; =0x00000D96 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + b _02317FD0 +_02317FC0: + ldr r2, _02317FE0 ; =0x00000D97 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_02317FD0: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_02317FDC: .word 0x00000AD6 +_02317FE0: .word 0x00000AD7 +#else +_02317FDC: .word 0x00000D96 +_02317FE0: .word 0x00000D97 +#endif + arm_func_end ApplyProteinEffect + + arm_func_start ApplyCalciumEffect +ApplyCalciumEffect: ; 0x02317FE4 + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + mov r6, r0 + mov r0, r5 + mov r4, r2 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, [r5, #0xb4] + ldrb r3, [r2, #0x1b] + add r1, r3, r4 + cmp r1, #0xff + movge r1, #0xff + and r0, r1, #0xff + strb r1, [r2, #0x1b] + cmp r3, r0 + bhs _02318054 + mov r0, r5 + bl ov29_022E4A04 + ldr r2, _02318070 ; =0x00000D98 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + b _02318064 +_02318054: + ldr r2, _02318074 ; =0x00000D99 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_02318064: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_02318070: .word 0x00000AD8 +_02318074: .word 0x00000AD9 +#else +_02318070: .word 0x00000D98 +_02318074: .word 0x00000D99 +#endif + arm_func_end ApplyCalciumEffect + + arm_func_start ApplyIronEffect +ApplyIronEffect: ; 0x02318078 + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + mov r6, r0 + mov r0, r5 + mov r4, r2 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, [r5, #0xb4] + ldrb r3, [r2, #0x1c] + add r1, r3, r4 + cmp r1, #0xff + movge r1, #0xff + and r0, r1, #0xff + strb r1, [r2, #0x1c] + cmp r3, r0 + bhs _023180E8 + mov r0, r5 + bl ov29_022E4A54 + ldr r2, _02318104 ; =0x00000D9A + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + b _023180F8 +_023180E8: + ldr r2, _02318108 ; =0x00000D9B + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_023180F8: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_02318104: .word 0x00000ADA +_02318108: .word 0x00000ADB +#else +_02318104: .word 0x00000D9A +_02318108: .word 0x00000D9B +#endif + arm_func_end ApplyIronEffect + + arm_func_start ApplyZincEffect +ApplyZincEffect: ; 0x0231810C + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + mov r6, r0 + mov r0, r5 + mov r4, r2 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, #0 + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r2, [r5, #0xb4] + ldrb r3, [r2, #0x1d] + add r1, r3, r4 + cmp r1, #0xff + movge r1, #0xff + and r0, r1, #0xff + strb r1, [r2, #0x1d] + cmp r3, r0 + bhs _0231817C + mov r0, r5 + bl ov29_022E4AA4 + ldr r2, _02318198 ; =0x00000D9C + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231818C +_0231817C: + ldr r2, _0231819C ; =0x00000D9D + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_0231818C: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_02318198: .word 0x00000ADC +_0231819C: .word 0x00000ADD +#else +_02318198: .word 0x00000D9C +_0231819C: .word 0x00000D9D +#endif + arm_func_end ApplyZincEffect + + arm_func_start TryInflictLongTossStatus +TryInflictLongTossStatus: ; 0x023181A0 + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + ldr r4, [r5, #0xb4] + mov r6, r0 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r4, #0xee] + cmp r0, #1 + beq _023181EC + mov r1, #1 + mov r0, r5 + strb r1, [r4, #0xee] + bl ov29_022E4AF0 + ldr r2, _02318208 ; =0x00000DDD + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + b _023181FC +_023181EC: + ldr r2, _0231820C ; =0x00000DDE + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_023181FC: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_02318208: .word 0x00000B1D +_0231820C: .word 0x00000B1E +#else +_02318208: .word 0x00000DDD +_0231820C: .word 0x00000DDE +#endif + arm_func_end TryInflictLongTossStatus + + arm_func_start TryInflictPierceStatus +TryInflictPierceStatus: ; 0x02318210 + stmdb sp!, {r4, r5, r6, lr} + mov r5, r1 + ldr r4, [r5, #0xb4] + mov r6, r0 + mov r0, #1 + mov r2, #0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r4, #0xee] + cmp r0, #2 + beq _0231825C + mov r1, #2 + mov r0, r5 + strb r1, [r4, #0xee] + bl ov29_022E4B3C + ldr r2, _02318278 ; =0x00000DDF + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + b _0231826C +_0231825C: + mov r0, r6 + mov r1, r5 +#ifdef JAPAN + mov r2, #0xb20 +#else + mov r2, #0xde0 +#endif + bl LogMessageByIdWithPopupCheckUserTarget +_0231826C: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +_02318278: .word 0x00000B1F +#else +_02318278: .word 0x00000DDF +#endif + arm_func_end TryInflictPierceStatus + + arm_func_start TryInflictGastroAcidStatus +TryInflictGastroAcidStatus: ; 0x0231827C + stmdb sp!, {r4, r5, r6, r7, r8, lr} + mov r7, r0 + mov r6, r1 + mov r5, r2 + mov r8, r3 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, r5, r6, r7, r8, pc} + mov r0, r6 + bl EntityIsValid__02315118 + cmp r0, #0 + mov r0, #0 + ldmeqia sp!, {r4, r5, r6, r7, r8, pc} + mov r1, r6 + mov r2, r0 + ldr r4, [r6, #0xb4] + bl SubstitutePlaceholderStringTags + mov r0, r7 + mov r1, r6 + mov r2, #1 + bl SafeguardIsActive + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, r7, r8, pc} + mov r0, r7 + mov r1, r6 + mov r2, #1 + bl IsProtectedFromNegativeStatus + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r4, r5, r6, r7, r8, pc} + cmp r8, #0 + movne r0, #1 + ldmneia sp!, {r4, r5, r6, r7, r8, pc} + ldrb r0, [r4, #0xd8] + cmp r0, #4 + beq _02318388 + mov r0, r7 + mov r1, r6 + bl TryRemoveSnatchedMonsterFromDungeonStruct + mov r3, #4 + ldr r1, _023183B0 ; =ov10_022C476C + mov r0, r6 + mov r2, #1 + strb r3, [r4, #0xd8] + bl CalcStatusDuration + add r0, r0, #1 + strb r0, [r4, #0xdb] + mov r1, #0 + ldr r0, _023183B4 ; =DUNGEON_PTR + strb r1, [r4, #0xdc] + ldr r0, [r0] + mov r1, #1 + strb r1, [r0, #0xe] + cmp r5, #0 + beq _02318370 + ldr r2, _023183B8 ; =0x00000D7B + mov r0, r7 + mov r1, r6 + bl LogMessageByIdWithPopupCheckUserTarget +_02318370: + mov r0, r7 + mov r1, r6 + bl TryActivateQuickFeet + mov r0, r6 + bl ov29_022FB984 + b _023183A0 +_02318388: + cmp r5, #0 + beq _023183A0 + ldr r2, _023183BC ; =0x00000D7C + mov r0, r7 + mov r1, r6 + bl LogMessageByIdWithPopupCheckUserTarget +_023183A0: + mov r0, r6 + bl UpdateStatusIconFlags + mov r0, #1 + ldmia sp!, {r4, r5, r6, r7, r8, pc} + .align 2, 0 +_023183B0: .word ov10_022C476C +_023183B4: .word DUNGEON_PTR +#ifdef JAPAN +_023183B8: .word 0x00000ABB +_023183BC: .word 0x00000ABC +#else +_023183B8: .word 0x00000D7B +_023183BC: .word 0x00000D7C +#endif + arm_func_end TryInflictGastroAcidStatus + + arm_func_start SetAquaRingHealingCountdownTo4 +SetAquaRingHealingCountdownTo4: ; 0x023183C0 + stmdb sp!, {r4, lr} + mov r4, r0 + bl EntityIsValid__02315118 + cmp r0, #0 + ldrne r0, _023183E4 ; =ov10_022C4620 + ldrne r1, [r4, #0xb4] + ldrnesh r0, [r0] + strneb r0, [r1, #0xd7] + ldmia sp!, {r4, pc} + .align 2, 0 +_023183E4: .word ov10_022C4620 + arm_func_end SetAquaRingHealingCountdownTo4 + + arm_func_start ApplyAquaRingHealing +ApplyAquaRingHealing: ; 0x023183E8 + stmdb sp!, {r3, r4, lr} + sub sp, sp, #4 + mov r4, r0 + bl EntityIsValid__02315118 + cmp r0, #0 + beq _0231844C + ldr r3, [r4, #0xb4] + ldr r0, _02318454 ; =0x000003E7 + ldrsh r2, [r3, #0x12] + ldrsh r1, [r3, #0x16] + add r1, r2, r1 + cmp r1, r0 + movgt r1, r0 + ldrsh r0, [r3, #0x10] + cmp r0, r1 + bge _02318444 + ldr r0, _02318458 ; =ov10_022C4628 + mov r3, #0 + ldrsh r2, [r0] + mov r0, r4 + mov r1, r4 + str r3, [sp] + bl TryIncreaseHp +_02318444: + mov r0, r4 + bl SetAquaRingHealingCountdownTo4 +_0231844C: + add sp, sp, #4 + ldmia sp!, {r3, r4, pc} + .align 2, 0 +_02318454: .word 0x000003E7 +_02318458: .word ov10_022C4628 + arm_func_end ApplyAquaRingHealing + + arm_func_start TryInflictAquaRingStatus +TryInflictAquaRingStatus: ; 0x0231845C + stmdb sp!, {r4, r5, r6, lr} + mov r6, r0 + mov r5, r1 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, r5 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, #0 + ldr r4, [r5, #0xb4] + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r4, #0xd5] + cmp r0, #0x10 + beq _023184E0 + ldr r1, _023184FC ; =ov10_022C4764 + mov r3, #0x10 + mov r0, r5 + mov r2, #0 + strb r3, [r4, #0xd5] + bl CalcStatusDuration + add r1, r0, #1 + mov r0, r5 + strb r1, [r4, #0xd6] + bl SetAquaRingHealingCountdownTo4 + ldr r2, _02318500 ; =0x00000D7D + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + b _023184F0 +_023184E0: + ldr r2, _02318504 ; =0x00000D7E + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_023184F0: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_023184FC: .word ov10_022C4764 +#ifdef JAPAN +_02318500: .word 0x00000ABD +_02318504: .word 0x00000ABE +#else +_02318500: .word 0x00000D7D +_02318504: .word 0x00000D7E +#endif + arm_func_end TryInflictAquaRingStatus + + arm_func_start TryInflictLuckyChantStatus +TryInflictLuckyChantStatus: ; 0x02318508 + stmdb sp!, {r4, r5, r6, lr} + mov r6, r0 + mov r5, r1 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, r5 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, #0 + ldr r4, [r5, #0xb4] + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r4, #0xd5] + cmp r0, #0x11 + beq _02318584 + ldr r1, _023185A0 ; =ov10_022C4768 + mov r3, #0x11 + mov r0, r5 + mov r2, #0 + strb r3, [r4, #0xd5] + bl CalcStatusDuration + add r3, r0, #1 + ldr r2, _023185A4 ; =0x00000D7F + mov r0, r6 + mov r1, r5 + strb r3, [r4, #0xd6] + bl LogMessageByIdWithPopupCheckUserTarget + b _02318594 +_02318584: + mov r0, r6 + mov r1, r5 +#ifdef JAPAN + mov r2, #0xac0 +#else + mov r2, #0xd80 +#endif + bl LogMessageByIdWithPopupCheckUserTarget +_02318594: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +_023185A0: .word ov10_022C4768 +#ifdef JAPAN +_023185A4: .word 0x00000ABF +#else +_023185A4: .word 0x00000D7F +#endif + arm_func_end TryInflictLuckyChantStatus + + arm_func_start TryInflictHealBlockStatus +TryInflictHealBlockStatus: ; 0x023185A8 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r6, r0 + mov r5, r1 + mov r4, r2 + mov r7, r3 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r5 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl SafeguardIsActive + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl IsProtectedFromNegativeStatus + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + cmp r7, #0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, #0 + ldr r7, [r5, #0xb4] + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r7, #0xd8] + cmp r0, #5 + beq _02318698 + mov r0, r6 + mov r1, r5 + bl TryRemoveSnatchedMonsterFromDungeonStruct + mov r3, #5 + ldr r1, _023186C0 ; =ov10_022C4774 + mov r0, r5 + mov r2, #1 + strb r3, [r7, #0xd8] + bl CalcStatusDuration + add r0, r0, #1 + strb r0, [r7, #0xdb] + cmp r4, #0 + beq _02318688 + ldr r2, _023186C4 ; =0x00000D81 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_02318688: + mov r0, r6 + mov r1, r5 + bl TryActivateQuickFeet + b _023186B0 +_02318698: + cmp r4, #0 + beq _023186B0 + ldr r2, _023186C8 ; =0x00000D82 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_023186B0: + mov r0, r5 + bl UpdateStatusIconFlags + mov r0, #1 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_023186C0: .word ov10_022C4774 +#ifdef JAPAN +_023186C4: .word 0x00000AC1 +_023186C8: .word 0x00000AC2 +#else +_023186C4: .word 0x00000D81 +_023186C8: .word 0x00000D82 +#endif + arm_func_end TryInflictHealBlockStatus + + arm_func_start MonsterHasEmbargoStatus +MonsterHasEmbargoStatus: ; 0x023186CC + stmdb sp!, {r4, lr} + mov r4, r0 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + ldr r0, [r4, #0xb4] + ldrb r0, [r0, #0xd8] + cmp r0, #6 + moveq r0, #1 + movne r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + arm_func_end MonsterHasEmbargoStatus + + arm_func_start LogItemBlockedByEmbargo +LogItemBlockedByEmbargo: ; 0x02318700 + stmdb sp!, {r4, lr} + mov r4, r0 + mov r0, #0 + mov r1, r4 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldr r1, _02318728 ; =0x00000D86 + mov r0, r4 + bl LogMessageByIdWithPopupCheckUser + ldmia sp!, {r4, pc} + .align 2, 0 +#ifdef JAPAN +_02318728: .word 0x00000AC6 +#else +_02318728: .word 0x00000D86 +#endif + arm_func_end LogItemBlockedByEmbargo + + arm_func_start TryInflictEmbargoStatus +TryInflictEmbargoStatus: ; 0x0231872C + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r6, r0 + mov r5, r1 + mov r4, r2 + mov r7, r3 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r5 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl SafeguardIsActive + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r6 + mov r1, r5 + mov r2, #1 + bl IsProtectedFromNegativeStatus + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + cmp r7, #0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, #0 + ldr r7, [r5, #0xb4] + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r7, #0xd8] + cmp r0, #6 + beq _0231881C + mov r0, r6 + mov r1, r5 + bl TryRemoveSnatchedMonsterFromDungeonStruct + mov r3, #6 + ldr r1, _02318844 ; =ov10_022C4778 + mov r0, r5 + mov r2, #1 + strb r3, [r7, #0xd8] + bl CalcStatusDuration + add r0, r0, #1 + strb r0, [r7, #0xdb] + cmp r4, #0 + beq _0231880C + ldr r2, _02318848 ; =0x00000D84 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_0231880C: + mov r0, r6 + mov r1, r5 + bl TryActivateQuickFeet + b _02318834 +_0231881C: + cmp r4, #0 + beq _02318834 + ldr r2, _0231884C ; =0x00000D85 + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_02318834: + mov r0, r5 + bl UpdateStatusIconFlags + mov r0, #1 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +_02318844: .word ov10_022C4778 +#ifdef JAPAN +_02318848: .word 0x00000AC4 +_0231884C: .word 0x00000AC5 +#else +_02318848: .word 0x00000D84 +_0231884C: .word 0x00000D85 +#endif + arm_func_end TryInflictEmbargoStatus + + arm_func_start TryInflictMiracleEyeStatus +TryInflictMiracleEyeStatus: ; 0x02318850 + stmdb sp!, {r3, r4, r5, r6, r7, lr} + mov r7, r0 + mov r6, r1 + mov r5, r2 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r6 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r7 + mov r1, r6 + mov r2, #1 + bl SafeguardIsActive + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + mov r0, r7 + mov r1, r6 + mov r2, #1 + bl IsProtectedFromNegativeStatus + cmp r0, #0 + mov r0, #0 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + mov r1, r6 + mov r2, r0 + ldr r4, [r6, #0xb4] + bl SubstitutePlaceholderStringTags + mov r0, r6 + mov r1, #0x10 + bl HasTypeAffectedByGravity + cmp r0, #0 + bne _02318900 + cmp r5, #0 + bne _023188F8 + ldr r2, _02318974 ; =0x00000D89 + mov r0, r7 + mov r1, r6 + bl LogMessageByIdWithPopupCheckUserTarget +_023188F8: + mov r0, #0 + ldmia sp!, {r3, r4, r5, r6, r7, pc} +_02318900: + cmp r5, #0 + movne r0, #1 + ldmneia sp!, {r3, r4, r5, r6, r7, pc} + ldrb r0, [r4, #0xf5] + cmp r0, #1 + beq _02318954 + ldr r1, _02318978 ; =ov10_022C477C + mov r2, #1 + mov r0, r6 + strb r2, [r4, #0xf5] + bl CalcStatusDuration + add r3, r0, #1 + ldr r2, _0231897C ; =0x00000D87 + mov r0, r7 + mov r1, r6 + strb r3, [r4, #0xf6] + bl LogMessageByIdWithPopupCheckUserTarget + mov r0, r7 + mov r1, r6 + bl TryActivateQuickFeet + b _02318964 +_02318954: + ldr r2, _02318980 ; =0x00000D88 + mov r0, r7 + mov r1, r6 + bl LogMessageByIdWithPopupCheckUserTarget +_02318964: + mov r0, r6 + bl UpdateStatusIconFlags + mov r0, #1 + ldmia sp!, {r3, r4, r5, r6, r7, pc} + .align 2, 0 +#ifdef JAPAN +#define TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET -0x2C0 +#else +#define TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET 0 +#endif +_02318974: .word 0x00000D89 + TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET +_02318978: .word ov10_022C477C +_0231897C: .word 0x00000D87 + TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET +_02318980: .word 0x00000D88 + TRY_INFLICT_MIRACLE_EYE_STATUS_OFFSET + arm_func_end TryInflictMiracleEyeStatus + + arm_func_start TryInflictMagnetRiseStatus +TryInflictMagnetRiseStatus: ; 0x02318984 + stmdb sp!, {r4, r5, r6, lr} + mov r6, r0 + mov r5, r1 + bl GravityIsActive + cmp r0, #0 + beq _023189B0 + ldr r2, _02318A3C ; =0x00000D8C + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget + ldmia sp!, {r4, r5, r6, pc} +_023189B0: + mov r0, r6 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, r5 + bl EntityIsValid__02315118 + cmp r0, #0 + ldmeqia sp!, {r4, r5, r6, pc} + mov r0, #0 + ldr r4, [r5, #0xb4] + mov r1, r5 + mov r2, r0 + bl SubstitutePlaceholderStringTags + ldrb r0, [r4, #0xf7] + cmp r0, #1 + beq _02318A20 + ldr r1, _02318A40 ; =ov10_022C4780 + mov r2, #1 + mov r0, r5 + strb r2, [r4, #0xf7] + bl CalcStatusDuration + add r3, r0, #1 + ldr r2, _02318A44 ; =0x00000D8A + mov r0, r6 + mov r1, r5 + strb r3, [r4, #0xf8] + bl LogMessageByIdWithPopupCheckUserTarget + b _02318A30 +_02318A20: + ldr r2, _02318A48 ; =0x00000D8B + mov r0, r6 + mov r1, r5 + bl LogMessageByIdWithPopupCheckUserTarget +_02318A30: + mov r0, r5 + bl UpdateStatusIconFlags + ldmia sp!, {r4, r5, r6, pc} + .align 2, 0 +#ifdef JAPAN +#define TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET -0x2C0 +#else +#define TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET 0 +#endif +_02318A3C: .word 0x00000D8C + TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET +_02318A40: .word ov10_022C4780 +_02318A44: .word 0x00000D8A + TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET +_02318A48: .word 0x00000D8B + TRY_INFLICT_MAGNET_RISE_STATUS_OFFSET + arm_func_end TryInflictMagnetRiseStatus + + arm_func_start IsFloating +IsFloating: ; 0x02318A4C + stmdb sp!, {r4, lr} + mov r4, r0 + bl EntityIsValid__02315118 + cmp r0, #0 + moveq r0, #0 + ldmeqia sp!, {r4, pc} + bl GravityIsActive + cmp r0, #0 + movne r0, #0 + ldmneia sp!, {r4, pc} + ldr r0, [r4, #0xb4] + ldrb r0, [r0, #0xf7] + cmp r0, #1 + moveq r0, #1 + movne r0, #0 + and r0, r0, #0xff + ldmia sp!, {r4, pc} + arm_func_end IsFloating + + arm_func_start ov29_02318A90 +ov29_02318A90: ; 0x02318A90 + stmdb sp!, {r3, r4, r5, lr} + mov r5, r0 + mov r4, r1 + bl IsMonster__02318AB0 + cmp r0, #0 + ldrne r0, [r5, #0xb4] +#ifdef JAPAN + strneb r4, [r0, #0x10a] +#else + strneb r4, [r0, #0x10b] +#endif + ldmia sp!, {r3, r4, r5, pc} + arm_func_end ov29_02318A90 diff --git a/include/dungeon_statuses.h b/include/dungeon_statuses.h new file mode 100644 index 00000000..e4892f85 --- /dev/null +++ b/include/dungeon_statuses.h @@ -0,0 +1,11 @@ +#ifndef PMDSKY_DUNGEON_STATUSES_H +#define PMDSKY_DUNGEON_STATUSES_H + +#include "dungeon_mode.h" + +// Returns true if the monster has the blinded status (see statuses::blinded), or if it is not the leader and is holding Y-Ray Specs. +// entity: pointer to entity +// check_held_item: flag for whether to check for the held item +bool8 IsBlinded(struct entity *entity, bool8 check_held_item); + +#endif //PMDSKY_DUNGEON_STATUSES_H diff --git a/main.lsf b/main.lsf index 3376923c..2d217c72 100644 --- a/main.lsf +++ b/main.lsf @@ -310,6 +310,8 @@ Overlay OVY_29 Object asm/overlay_29_023118D8.o Object src/overlay_29_02315118.o Object asm/overlay_29_0231513C.o + Object src/dungeon_statuses.o + Object asm/overlay_29_02317844.o Object src/overlay_29_02318AB0.o Object asm/overlay_29_02318AD4.o Object src/overlay_29_02318D34.o diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index 771217a1..871ec725 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -1,7 +1,7 @@ #include "dungeon_capabilities.h" +#include "dungeon_statuses.h" #include "dungeon_util.h" -extern bool8 IsBlinded(struct entity *entity, bool8 check_held_item); extern bool8 CheckVariousStatuses(struct entity *entity); bool8 CheckVariousStatuses2(struct entity *entity, bool8 blind_check) diff --git a/src/dungeon_statuses.c b/src/dungeon_statuses.c new file mode 100644 index 00000000..9d36f928 --- /dev/null +++ b/src/dungeon_statuses.c @@ -0,0 +1,17 @@ +#include "dungeon_statuses.h" +#include "dungeon_util.h" +#include "overlay_29_02315118.h" + +extern bool8 ItemIsActive__0231513C(struct entity *entity, enum item_id item_id); + +bool8 IsBlinded(struct entity *entity, bool8 check_held_item) +{ + if (EntityIsValid__02315118(entity)) + { + struct monster *pokemon_info = GetEntInfo(entity); + if (pokemon_info->blinker_class_status.blinded == BLINKER_STATUS_BLINKER || + check_held_item && !pokemon_info->is_team_leader && ItemIsActive__0231513C(entity, ITEM_Y_RAY_SPECS)) + return TRUE; + } + return FALSE; +}